Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390/cio: Add new Operation Code OC3 to PNSO

Add support for operation code 3 (OC3) of the
Perform-Network-Subchannel-Operations (PNSO) function
of the Channel-Subsystem-Call (CHSC) instruction.

PNSO provides 2 operation codes:
OC0 - BRIDGE_INFO
OC3 - ADDR_INFO (new)

Extend the function calls to *pnso* to pass the OC and
add new response code 0108.

Support for OC3 is indicated by a flag in the css_general_characteristics.

Signed-off-by: Alexandra Winter <wintera@linux.ibm.com>
Reviewed-by: Julian Wiedmann <jwi@linux.ibm.com>
Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Reviewed-by: Vineeth Vijayan <vneethv@linux.ibm.com>
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Alexandra Winter and committed by
David S. Miller
4fea49a7 afb83012

+32 -22
+2 -3
arch/s390/include/asm/ccwdev.h
··· 238 238 struct channel_path_desc_fmt0 *ccw_device_get_chp_desc(struct ccw_device *, int); 239 239 u8 *ccw_device_get_util_str(struct ccw_device *cdev, int chp_idx); 240 240 int ccw_device_pnso(struct ccw_device *cdev, 241 - struct chsc_pnso_area *pnso_area, 242 - struct chsc_pnso_resume_token resume_token, 243 - int cnc); 241 + struct chsc_pnso_area *pnso_area, u8 oc, 242 + struct chsc_pnso_resume_token resume_token, int cnc); 244 243 #endif /* _S390_CCWDEV_H_ */
+7
arch/s390/include/asm/chsc.h
··· 12 12 #include <uapi/asm/chsc.h> 13 13 14 14 /** 15 + * Operation codes for CHSC PNSO: 16 + * PNSO_OC_NET_BRIDGE_INFO - only addresses that are visible to a bridgeport 17 + * PNSO_OC_NET_ADDR_INFO - all addresses 18 + */ 19 + #define PNSO_OC_NET_BRIDGE_INFO 0 20 + #define PNSO_OC_NET_ADDR_INFO 3 21 + /** 15 22 * struct chsc_pnso_naid_l2 - network address information descriptor 16 23 * @nit: Network interface token 17 24 * @addr_lnid: network address and logical network id (VLAN ID)
+3 -1
arch/s390/include/asm/css_chars.h
··· 36 36 u64 alt_ssi : 1; /* bit 108 */ 37 37 u64 : 1; 38 38 u64 narf : 1; /* bit 110 */ 39 - u64 : 12; 39 + u64 : 5; 40 + u64 enarf: 1; /* bit 116 */ 41 + u64 : 6; 40 42 u64 util_str : 1;/* bit 123 */ 41 43 } __packed; 42 44
+6 -5
drivers/s390/cio/chsc.c
··· 65 65 case 0x0100: 66 66 case 0x0102: 67 67 return -ENOMEM; 68 + case 0x0108: /* "HW limit exceeded" for the op 0x003d */ 69 + return -EUSERS; 68 70 default: 69 71 return -EIO; 70 72 } ··· 1342 1340 * chsc_pnso() - Perform Network-Subchannel Operation 1343 1341 * @schid: id of the subchannel on which PNSO is performed 1344 1342 * @pnso_area: request and response block for the operation 1343 + * @oc: Operation Code 1345 1344 * @resume_token: resume token for multiblock response 1346 1345 * @cnc: Boolean change-notification control 1347 1346 * ··· 1350 1347 * 1351 1348 * Returns 0 on success. 1352 1349 */ 1353 - int chsc_pnso(struct subchannel_id schid, 1354 - struct chsc_pnso_area *pnso_area, 1355 - struct chsc_pnso_resume_token resume_token, 1356 - int cnc) 1350 + int chsc_pnso(struct subchannel_id schid, struct chsc_pnso_area *pnso_area, 1351 + u8 oc, struct chsc_pnso_resume_token resume_token, int cnc) 1357 1352 { 1358 1353 memset(pnso_area, 0, sizeof(*pnso_area)); 1359 1354 pnso_area->request.length = 0x0030; ··· 1360 1359 pnso_area->ssid = schid.ssid; 1361 1360 pnso_area->sch = schid.sch_no; 1362 1361 pnso_area->cssid = schid.cssid; 1363 - pnso_area->oc = 0; /* Store-network-bridging-information list */ 1362 + pnso_area->oc = oc; 1364 1363 pnso_area->resume_token = resume_token; 1365 1364 pnso_area->n = (cnc != 0); 1366 1365 if (chsc(pnso_area))
+2 -4
drivers/s390/cio/chsc.h
··· 205 205 206 206 int chsc_scm_info(struct chsc_scm_info *scm_area, u64 token); 207 207 208 - int chsc_pnso(struct subchannel_id schid, 209 - struct chsc_pnso_area *pnso_area, 210 - struct chsc_pnso_resume_token resume_token, 211 - int cnc); 208 + int chsc_pnso(struct subchannel_id schid, struct chsc_pnso_area *pnso_area, 209 + u8 oc, struct chsc_pnso_resume_token resume_token, int cnc); 212 210 213 211 int __init chsc_get_cssid(int idx); 214 212
+4 -4
drivers/s390/cio/device_ops.c
··· 714 714 * ccw_device_pnso() - Perform Network-Subchannel Operation 715 715 * @cdev: device on which PNSO is performed 716 716 * @pnso_area: request and response block for the operation 717 + * @oc: Operation Code 717 718 * @resume_token: resume token for multiblock response 718 719 * @cnc: Boolean change-notification control 719 720 * ··· 723 722 * Returns 0 on success. 724 723 */ 725 724 int ccw_device_pnso(struct ccw_device *cdev, 726 - struct chsc_pnso_area *pnso_area, 727 - struct chsc_pnso_resume_token resume_token, 728 - int cnc) 725 + struct chsc_pnso_area *pnso_area, u8 oc, 726 + struct chsc_pnso_resume_token resume_token, int cnc) 729 727 { 730 728 struct subchannel_id schid; 731 729 732 730 ccw_device_get_schid(cdev, &schid); 733 - return chsc_pnso(schid, pnso_area, resume_token, cnc); 731 + return chsc_pnso(schid, pnso_area, oc, resume_token, cnc); 734 732 } 735 733 EXPORT_SYMBOL_GPL(ccw_device_pnso); 736 734
+8 -5
drivers/s390/net/qeth_l2_main.c
··· 642 642 /** 643 643 * qeth_l2_pnso() - perform network subchannel operation 644 644 * @card: qeth_card structure pointer 645 + * @oc: Operation Code 645 646 * @cnc: Boolean Change-Notification Control 646 647 * @cb: Callback function will be executed for each element 647 648 * of the address list ··· 653 652 * control" is set, further changes in the address list will be reported 654 653 * via the IPA command. 655 654 */ 656 - static int qeth_l2_pnso(struct qeth_card *card, int cnc, 655 + static int qeth_l2_pnso(struct qeth_card *card, u8 oc, int cnc, 657 656 void (*cb)(void *priv, struct chsc_pnso_naid_l2 *entry), 658 657 void *priv) 659 658 { ··· 664 663 int i, size, elems; 665 664 int rc; 666 665 667 - QETH_CARD_TEXT(card, 2, "PNSO"); 668 666 rr = (struct chsc_pnso_area *)get_zeroed_page(GFP_KERNEL); 669 667 if (rr == NULL) 670 668 return -ENOMEM; 671 669 do { 670 + QETH_CARD_TEXT(card, 2, "PNSO"); 672 671 /* on the first iteration, naihdr.resume_token will be zero */ 673 - rc = ccw_device_pnso(ddev, rr, rr->naihdr.resume_token, cnc); 672 + rc = ccw_device_pnso(ddev, rr, oc, rr->naihdr.resume_token, 673 + cnc); 674 674 if (rc) 675 675 continue; 676 676 if (cb == NULL) ··· 1580 1578 if (enable) { 1581 1579 qeth_bridge_emit_host_event(card, anev_reset, 0, NULL, NULL); 1582 1580 qeth_l2_set_pnso_mode(card, QETH_PNSO_BRIDGEPORT); 1583 - rc = qeth_l2_pnso(card, 1, qeth_bridgeport_an_set_cb, card); 1581 + rc = qeth_l2_pnso(card, PNSO_OC_NET_BRIDGE_INFO, 1, 1582 + qeth_bridgeport_an_set_cb, card); 1584 1583 if (rc) 1585 1584 qeth_l2_set_pnso_mode(card, QETH_PNSO_NONE); 1586 1585 } else { 1587 - rc = qeth_l2_pnso(card, 0, NULL, NULL); 1586 + rc = qeth_l2_pnso(card, PNSO_OC_NET_BRIDGE_INFO, 0, NULL, NULL); 1588 1587 qeth_l2_set_pnso_mode(card, QETH_PNSO_NONE); 1589 1588 } 1590 1589 return rc;