aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
authorUrsula Braun <ursula.braun@de.ibm.com>2010-05-16 17:15:14 -0400
committerDavid S. Miller <davem@davemloft.net>2010-05-18 01:42:55 -0400
commit5113fec0984276836cb6f0677f7cb53586ec3451 (patch)
treebfce3e11a7f16c2b393c4e663414248e18ecb4b9 /drivers/s390
parentae57b20a0a1d3aa6cc35b51355949177de94aece (diff)
qeth: support the new OSA CHPID types OSX and OSM
The qeth driver is enabled to support the new OSA CHPID types OSX and OSM. Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com> Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/net/qeth_core.h28
-rw-r--r--drivers/s390/net/qeth_core_main.c224
-rw-r--r--drivers/s390/net/qeth_core_mpc.h10
-rw-r--r--drivers/s390/net/qeth_core_sys.c3
-rw-r--r--drivers/s390/net/qeth_l2_main.c34
-rw-r--r--drivers/s390/net/qeth_l3_main.c6
6 files changed, 194 insertions, 111 deletions
diff --git a/drivers/s390/net/qeth_core.h b/drivers/s390/net/qeth_core.h
index af661cd527df..7a44c38aaf65 100644
--- a/drivers/s390/net/qeth_core.h
+++ b/drivers/s390/net/qeth_core.h
@@ -179,25 +179,23 @@ static inline int qeth_is_ipa_enabled(struct qeth_ipa_info *ipa,
179 ((prot == QETH_PROT_IPV6) ? \ 179 ((prot == QETH_PROT_IPV6) ? \
180 qeth_is_enabled6(c, f) : qeth_is_enabled(c, f)) 180 qeth_is_enabled6(c, f) : qeth_is_enabled(c, f))
181 181
182#define QETH_IDX_FUNC_LEVEL_OSAE_ENA_IPAT 0x0101 182#define QETH_IDX_FUNC_LEVEL_OSD 0x0101
183#define QETH_IDX_FUNC_LEVEL_OSAE_DIS_IPAT 0x0101
184#define QETH_IDX_FUNC_LEVEL_IQD_ENA_IPAT 0x4108 183#define QETH_IDX_FUNC_LEVEL_IQD_ENA_IPAT 0x4108
185#define QETH_IDX_FUNC_LEVEL_IQD_DIS_IPAT 0x5108 184#define QETH_IDX_FUNC_LEVEL_IQD_DIS_IPAT 0x5108
186 185
187#define QETH_MODELLIST_ARRAY \ 186#define QETH_MODELLIST_ARRAY \
188 {{0x1731, 0x01, 0x1732, 0x01, QETH_CARD_TYPE_OSAE, 1, \ 187 {{0x1731, 0x01, 0x1732, QETH_CARD_TYPE_OSD, QETH_MAX_QUEUES, 0}, \
189 QETH_IDX_FUNC_LEVEL_OSAE_ENA_IPAT, \ 188 {0x1731, 0x05, 0x1732, QETH_CARD_TYPE_IQD, QETH_MAX_QUEUES, 0x103}, \
190 QETH_IDX_FUNC_LEVEL_OSAE_DIS_IPAT, \ 189 {0x1731, 0x06, 0x1732, QETH_CARD_TYPE_OSN, QETH_MAX_QUEUES, 0}, \
191 QETH_MAX_QUEUES, 0}, \ 190 {0x1731, 0x02, 0x1732, QETH_CARD_TYPE_OSM, QETH_MAX_QUEUES, 0}, \
192 {0x1731, 0x05, 0x1732, 0x05, QETH_CARD_TYPE_IQD, 0, \ 191 {0x1731, 0x02, 0x1732, QETH_CARD_TYPE_OSX, QETH_MAX_QUEUES, 0}, \
193 QETH_IDX_FUNC_LEVEL_IQD_ENA_IPAT, \ 192 {0, 0, 0, 0, 0, 0} }
194 QETH_IDX_FUNC_LEVEL_IQD_DIS_IPAT, \ 193#define QETH_CU_TYPE_IND 0
195 QETH_MAX_QUEUES, 0x103}, \ 194#define QETH_CU_MODEL_IND 1
196 {0x1731, 0x06, 0x1732, 0x06, QETH_CARD_TYPE_OSN, 0, \ 195#define QETH_DEV_TYPE_IND 2
197 QETH_IDX_FUNC_LEVEL_OSAE_ENA_IPAT, \ 196#define QETH_DEV_MODEL_IND 3
198 QETH_IDX_FUNC_LEVEL_OSAE_DIS_IPAT, \ 197#define QETH_QUEUE_NO_IND 4
199 QETH_MAX_QUEUES, 0}, \ 198#define QETH_MULTICAST_IND 5
200 {0, 0, 0, 0, 0, 0, 0, 0, 0} }
201 199
202#define QETH_REAL_CARD 1 200#define QETH_REAL_CARD 1
203#define QETH_VLAN_CARD 2 201#define QETH_VLAN_CARD 2
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index e862c2d8e5c0..01fe405da9fd 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -53,7 +53,7 @@ struct kmem_cache *qeth_core_header_cache;
53EXPORT_SYMBOL_GPL(qeth_core_header_cache); 53EXPORT_SYMBOL_GPL(qeth_core_header_cache);
54 54
55static struct device *qeth_core_root_dev; 55static struct device *qeth_core_root_dev;
56static unsigned int known_devices[][10] = QETH_MODELLIST_ARRAY; 56static unsigned int known_devices[][6] = QETH_MODELLIST_ARRAY;
57static struct lock_class_key qdio_out_skb_queue_key; 57static struct lock_class_key qdio_out_skb_queue_key;
58 58
59static void qeth_send_control_data_cb(struct qeth_channel *, 59static void qeth_send_control_data_cb(struct qeth_channel *,
@@ -111,21 +111,29 @@ static inline const char *qeth_get_cardname(struct qeth_card *card)
111{ 111{
112 if (card->info.guestlan) { 112 if (card->info.guestlan) {
113 switch (card->info.type) { 113 switch (card->info.type) {
114 case QETH_CARD_TYPE_OSAE: 114 case QETH_CARD_TYPE_OSD:
115 return " Guest LAN QDIO"; 115 return " Guest LAN QDIO";
116 case QETH_CARD_TYPE_IQD: 116 case QETH_CARD_TYPE_IQD:
117 return " Guest LAN Hiper"; 117 return " Guest LAN Hiper";
118 case QETH_CARD_TYPE_OSM:
119 return " Guest LAN QDIO - OSM";
120 case QETH_CARD_TYPE_OSX:
121 return " Guest LAN QDIO - OSX";
118 default: 122 default:
119 return " unknown"; 123 return " unknown";
120 } 124 }
121 } else { 125 } else {
122 switch (card->info.type) { 126 switch (card->info.type) {
123 case QETH_CARD_TYPE_OSAE: 127 case QETH_CARD_TYPE_OSD:
124 return " OSD Express"; 128 return " OSD Express";
125 case QETH_CARD_TYPE_IQD: 129 case QETH_CARD_TYPE_IQD:
126 return " HiperSockets"; 130 return " HiperSockets";
127 case QETH_CARD_TYPE_OSN: 131 case QETH_CARD_TYPE_OSN:
128 return " OSN QDIO"; 132 return " OSN QDIO";
133 case QETH_CARD_TYPE_OSM:
134 return " OSM QDIO";
135 case QETH_CARD_TYPE_OSX:
136 return " OSX QDIO";
129 default: 137 default:
130 return " unknown"; 138 return " unknown";
131 } 139 }
@@ -138,16 +146,20 @@ const char *qeth_get_cardname_short(struct qeth_card *card)
138{ 146{
139 if (card->info.guestlan) { 147 if (card->info.guestlan) {
140 switch (card->info.type) { 148 switch (card->info.type) {
141 case QETH_CARD_TYPE_OSAE: 149 case QETH_CARD_TYPE_OSD:
142 return "GuestLAN QDIO"; 150 return "GuestLAN QDIO";
143 case QETH_CARD_TYPE_IQD: 151 case QETH_CARD_TYPE_IQD:
144 return "GuestLAN Hiper"; 152 return "GuestLAN Hiper";
153 case QETH_CARD_TYPE_OSM:
154 return "GuestLAN OSM";
155 case QETH_CARD_TYPE_OSX:
156 return "GuestLAN OSX";
145 default: 157 default:
146 return "unknown"; 158 return "unknown";
147 } 159 }
148 } else { 160 } else {
149 switch (card->info.type) { 161 switch (card->info.type) {
150 case QETH_CARD_TYPE_OSAE: 162 case QETH_CARD_TYPE_OSD:
151 switch (card->info.link_type) { 163 switch (card->info.link_type) {
152 case QETH_LINK_TYPE_FAST_ETH: 164 case QETH_LINK_TYPE_FAST_ETH:
153 return "OSD_100"; 165 return "OSD_100";
@@ -172,6 +184,10 @@ const char *qeth_get_cardname_short(struct qeth_card *card)
172 return "HiperSockets"; 184 return "HiperSockets";
173 case QETH_CARD_TYPE_OSN: 185 case QETH_CARD_TYPE_OSN:
174 return "OSN"; 186 return "OSN";
187 case QETH_CARD_TYPE_OSM:
188 return "OSM_1000";
189 case QETH_CARD_TYPE_OSX:
190 return "OSX_10GIG";
175 default: 191 default:
176 return "unknown"; 192 return "unknown";
177 } 193 }
@@ -419,7 +435,8 @@ void qeth_clear_ipacmd_list(struct qeth_card *card)
419} 435}
420EXPORT_SYMBOL_GPL(qeth_clear_ipacmd_list); 436EXPORT_SYMBOL_GPL(qeth_clear_ipacmd_list);
421 437
422static int qeth_check_idx_response(unsigned char *buffer) 438static int qeth_check_idx_response(struct qeth_card *card,
439 unsigned char *buffer)
423{ 440{
424 if (!buffer) 441 if (!buffer)
425 return 0; 442 return 0;
@@ -434,6 +451,12 @@ static int qeth_check_idx_response(unsigned char *buffer)
434 QETH_DBF_TEXT(TRACE, 2, "ckidxres"); 451 QETH_DBF_TEXT(TRACE, 2, "ckidxres");
435 QETH_DBF_TEXT(TRACE, 2, " idxterm"); 452 QETH_DBF_TEXT(TRACE, 2, " idxterm");
436 QETH_DBF_TEXT_(TRACE, 2, " rc%d", -EIO); 453 QETH_DBF_TEXT_(TRACE, 2, " rc%d", -EIO);
454 if (buffer[4] == 0xf6) {
455 dev_err(&card->gdev->dev,
456 "The qeth device is not configured "
457 "for the OSI layer required by z/VM\n");
458 return -EPERM;
459 }
437 return -EIO; 460 return -EIO;
438 } 461 }
439 return 0; 462 return 0;
@@ -528,18 +551,19 @@ static void qeth_send_control_data_cb(struct qeth_channel *channel,
528 struct qeth_ipa_cmd *cmd; 551 struct qeth_ipa_cmd *cmd;
529 unsigned long flags; 552 unsigned long flags;
530 int keep_reply; 553 int keep_reply;
554 int rc = 0;
531 555
532 QETH_DBF_TEXT(TRACE, 4, "sndctlcb"); 556 QETH_DBF_TEXT(TRACE, 4, "sndctlcb");
533 557
534 card = CARD_FROM_CDEV(channel->ccwdev); 558 card = CARD_FROM_CDEV(channel->ccwdev);
535 if (qeth_check_idx_response(iob->data)) { 559 rc = qeth_check_idx_response(card, iob->data);
560 switch (rc) {
561 case 0:
562 break;
563 case -EIO:
536 qeth_clear_ipacmd_list(card); 564 qeth_clear_ipacmd_list(card);
537 if (((iob->data[2] & 0xc0) == 0xc0) && iob->data[4] == 0xf6) 565 qeth_schedule_recovery(card);
538 dev_err(&card->gdev->dev, 566 default:
539 "The qeth device is not configured "
540 "for the OSI layer required by z/VM\n");
541 else
542 qeth_schedule_recovery(card);
543 goto out; 567 goto out;
544 } 568 }
545 569
@@ -719,7 +743,7 @@ static int qeth_get_problem(struct ccw_device *cdev, struct irb *irb)
719 QETH_DBF_TEXT(TRACE, 2, "CGENCHK"); 743 QETH_DBF_TEXT(TRACE, 2, "CGENCHK");
720 dev_warn(&cdev->dev, "The qeth device driver " 744 dev_warn(&cdev->dev, "The qeth device driver "
721 "failed to recover an error on the device\n"); 745 "failed to recover an error on the device\n");
722 QETH_DBF_MESSAGE(2, "%s check on device dstat=x%x, cstat=x%x ", 746 QETH_DBF_MESSAGE(2, "%s check on device dstat=x%x, cstat=x%x\n",
723 dev_name(&cdev->dev), dstat, cstat); 747 dev_name(&cdev->dev), dstat, cstat);
724 print_hex_dump(KERN_WARNING, "qeth: irb ", DUMP_PREFIX_OFFSET, 748 print_hex_dump(KERN_WARNING, "qeth: irb ", DUMP_PREFIX_OFFSET,
725 16, 1, irb, 64, 1); 749 16, 1, irb, 64, 1);
@@ -998,9 +1022,8 @@ static void qeth_clean_channel(struct qeth_channel *channel)
998 kfree(channel->iob[cnt].data); 1022 kfree(channel->iob[cnt].data);
999} 1023}
1000 1024
1001static int qeth_is_1920_device(struct qeth_card *card) 1025static void qeth_get_channel_path_desc(struct qeth_card *card)
1002{ 1026{
1003 int single_queue = 0;
1004 struct ccw_device *ccwdev; 1027 struct ccw_device *ccwdev;
1005 struct channelPath_dsc { 1028 struct channelPath_dsc {
1006 u8 flags; 1029 u8 flags;
@@ -1013,17 +1036,25 @@ static int qeth_is_1920_device(struct qeth_card *card)
1013 u8 chpp; 1036 u8 chpp;
1014 } *chp_dsc; 1037 } *chp_dsc;
1015 1038
1016 QETH_DBF_TEXT(SETUP, 2, "chk_1920"); 1039 QETH_DBF_TEXT(SETUP, 2, "chp_desc");
1017 1040
1018 ccwdev = card->data.ccwdev; 1041 ccwdev = card->data.ccwdev;
1019 chp_dsc = (struct channelPath_dsc *)ccw_device_get_chp_desc(ccwdev, 0); 1042 chp_dsc = (struct channelPath_dsc *)ccw_device_get_chp_desc(ccwdev, 0);
1020 if (chp_dsc != NULL) { 1043 if (chp_dsc != NULL) {
1021 /* CHPP field bit 6 == 1 -> single queue */ 1044 /* CHPP field bit 6 == 1 -> single queue */
1022 single_queue = ((chp_dsc->chpp & 0x02) == 0x02); 1045 if ((chp_dsc->chpp & 0x02) == 0x02)
1046 card->qdio.no_out_queues = 1;
1047 card->info.func_level = 0x4100 + chp_dsc->desc;
1023 kfree(chp_dsc); 1048 kfree(chp_dsc);
1024 } 1049 }
1025 QETH_DBF_TEXT_(SETUP, 2, "rc:%x", single_queue); 1050 if (card->qdio.no_out_queues == 1) {
1026 return single_queue; 1051 card->qdio.default_out_queue = 0;
1052 dev_info(&card->gdev->dev,
1053 "Priority Queueing not supported\n");
1054 }
1055 QETH_DBF_TEXT_(SETUP, 2, "nr:%x", card->qdio.no_out_queues);
1056 QETH_DBF_TEXT_(SETUP, 2, "lvl:%02x", card->info.func_level);
1057 return;
1027} 1058}
1028 1059
1029static void qeth_init_qdio_info(struct qeth_card *card) 1060static void qeth_init_qdio_info(struct qeth_card *card)
@@ -1171,18 +1202,17 @@ static int qeth_determine_card_type(struct qeth_card *card)
1171 1202
1172 card->qdio.do_prio_queueing = QETH_PRIOQ_DEFAULT; 1203 card->qdio.do_prio_queueing = QETH_PRIOQ_DEFAULT;
1173 card->qdio.default_out_queue = QETH_DEFAULT_QUEUE; 1204 card->qdio.default_out_queue = QETH_DEFAULT_QUEUE;
1174 while (known_devices[i][4]) { 1205 while (known_devices[i][QETH_DEV_MODEL_IND]) {
1175 if ((CARD_RDEV(card)->id.dev_type == known_devices[i][2]) && 1206 if ((CARD_RDEV(card)->id.dev_type ==
1176 (CARD_RDEV(card)->id.dev_model == known_devices[i][3])) { 1207 known_devices[i][QETH_DEV_TYPE_IND]) &&
1177 card->info.type = known_devices[i][4]; 1208 (CARD_RDEV(card)->id.dev_model ==
1178 card->qdio.no_out_queues = known_devices[i][8]; 1209 known_devices[i][QETH_DEV_MODEL_IND])) {
1179 card->info.is_multicast_different = known_devices[i][9]; 1210 card->info.type = known_devices[i][QETH_DEV_MODEL_IND];
1180 if (qeth_is_1920_device(card)) { 1211 card->qdio.no_out_queues =
1181 dev_info(&card->gdev->dev, 1212 known_devices[i][QETH_QUEUE_NO_IND];
1182 "Priority Queueing not supported\n"); 1213 card->info.is_multicast_different =
1183 card->qdio.no_out_queues = 1; 1214 known_devices[i][QETH_MULTICAST_IND];
1184 card->qdio.default_out_queue = 0; 1215 qeth_get_channel_path_desc(card);
1185 }
1186 return 0; 1216 return 0;
1187 } 1217 }
1188 i++; 1218 i++;
@@ -1399,22 +1429,20 @@ static void qeth_init_tokens(struct qeth_card *card)
1399 1429
1400static void qeth_init_func_level(struct qeth_card *card) 1430static void qeth_init_func_level(struct qeth_card *card)
1401{ 1431{
1402 if (card->ipato.enabled) { 1432 switch (card->info.type) {
1403 if (card->info.type == QETH_CARD_TYPE_IQD) 1433 case QETH_CARD_TYPE_IQD:
1404 card->info.func_level = 1434 if (card->ipato.enabled)
1405 QETH_IDX_FUNC_LEVEL_IQD_ENA_IPAT;
1406 else
1407 card->info.func_level =
1408 QETH_IDX_FUNC_LEVEL_OSAE_ENA_IPAT;
1409 } else {
1410 if (card->info.type == QETH_CARD_TYPE_IQD)
1411 /*FIXME:why do we have same values for dis and ena for
1412 osae??? */
1413 card->info.func_level = 1435 card->info.func_level =
1414 QETH_IDX_FUNC_LEVEL_IQD_DIS_IPAT; 1436 QETH_IDX_FUNC_LEVEL_IQD_ENA_IPAT;
1415 else 1437 else
1416 card->info.func_level = 1438 card->info.func_level =
1417 QETH_IDX_FUNC_LEVEL_OSAE_DIS_IPAT; 1439 QETH_IDX_FUNC_LEVEL_IQD_DIS_IPAT;
1440 break;
1441 case QETH_CARD_TYPE_OSD:
1442 card->info.func_level = QETH_IDX_FUNC_LEVEL_OSD;
1443 break;
1444 default:
1445 break;
1418 } 1446 }
1419} 1447}
1420 1448
@@ -1561,7 +1589,7 @@ static void qeth_idx_write_cb(struct qeth_channel *channel,
1561 card = CARD_FROM_CDEV(channel->ccwdev); 1589 card = CARD_FROM_CDEV(channel->ccwdev);
1562 1590
1563 if (!(QETH_IS_IDX_ACT_POS_REPLY(iob->data))) { 1591 if (!(QETH_IS_IDX_ACT_POS_REPLY(iob->data))) {
1564 if (QETH_IDX_ACT_CAUSE_CODE(iob->data) == 0x19) 1592 if (QETH_IDX_ACT_CAUSE_CODE(iob->data) == QETH_IDX_ACT_ERR_EXCL)
1565 dev_err(&card->write.ccwdev->dev, 1593 dev_err(&card->write.ccwdev->dev,
1566 "The adapter is used exclusively by another " 1594 "The adapter is used exclusively by another "
1567 "host\n"); 1595 "host\n");
@@ -1597,27 +1625,35 @@ static void qeth_idx_read_cb(struct qeth_channel *channel,
1597 } 1625 }
1598 1626
1599 card = CARD_FROM_CDEV(channel->ccwdev); 1627 card = CARD_FROM_CDEV(channel->ccwdev);
1600 if (qeth_check_idx_response(iob->data)) 1628 if (qeth_check_idx_response(card, iob->data))
1601 goto out; 1629 goto out;
1602 1630
1603 if (!(QETH_IS_IDX_ACT_POS_REPLY(iob->data))) { 1631 if (!(QETH_IS_IDX_ACT_POS_REPLY(iob->data))) {
1604 if (QETH_IDX_ACT_CAUSE_CODE(iob->data) == 0x19) 1632 switch (QETH_IDX_ACT_CAUSE_CODE(iob->data)) {
1633 case QETH_IDX_ACT_ERR_EXCL:
1605 dev_err(&card->write.ccwdev->dev, 1634 dev_err(&card->write.ccwdev->dev,
1606 "The adapter is used exclusively by another " 1635 "The adapter is used exclusively by another "
1607 "host\n"); 1636 "host\n");
1608 else 1637 break;
1638 case QETH_IDX_ACT_ERR_AUTH:
1639 dev_err(&card->read.ccwdev->dev,
1640 "Setting the device online failed because of "
1641 "insufficient LPAR authorization\n");
1642 break;
1643 default:
1609 QETH_DBF_MESSAGE(2, "%s IDX_ACTIVATE on read channel:" 1644 QETH_DBF_MESSAGE(2, "%s IDX_ACTIVATE on read channel:"
1610 " negative reply\n", 1645 " negative reply\n",
1611 dev_name(&card->read.ccwdev->dev)); 1646 dev_name(&card->read.ccwdev->dev));
1647 }
1612 goto out; 1648 goto out;
1613 } 1649 }
1614 1650
1615/** 1651/**
1616 * temporary fix for microcode bug 1652 * * temporary fix for microcode bug
1617 * to revert it,replace OR by AND 1653 * * to revert it,replace OR by AND
1618 */ 1654 * */
1619 if ((!QETH_IDX_NO_PORTNAME_REQUIRED(iob->data)) || 1655 if ((!QETH_IDX_NO_PORTNAME_REQUIRED(iob->data)) ||
1620 (card->info.type == QETH_CARD_TYPE_OSAE)) 1656 (card->info.type == QETH_CARD_TYPE_OSD))
1621 card->info.portname_required = 1; 1657 card->info.portname_required = 1;
1622 1658
1623 memcpy(&temp, QETH_IDX_ACT_FUNC_LEVEL(iob->data), 2); 1659 memcpy(&temp, QETH_IDX_ACT_FUNC_LEVEL(iob->data), 2);
@@ -1826,7 +1862,7 @@ static inline int qeth_get_initial_mtu_for_card(struct qeth_card *card)
1826 return 1500; 1862 return 1500;
1827 case QETH_CARD_TYPE_IQD: 1863 case QETH_CARD_TYPE_IQD:
1828 return card->info.max_mtu; 1864 return card->info.max_mtu;
1829 case QETH_CARD_TYPE_OSAE: 1865 case QETH_CARD_TYPE_OSD:
1830 switch (card->info.link_type) { 1866 switch (card->info.link_type) {
1831 case QETH_LINK_TYPE_HSTR: 1867 case QETH_LINK_TYPE_HSTR:
1832 case QETH_LINK_TYPE_LANE_TR: 1868 case QETH_LINK_TYPE_LANE_TR:
@@ -1834,6 +1870,9 @@ static inline int qeth_get_initial_mtu_for_card(struct qeth_card *card)
1834 default: 1870 default:
1835 return 1492; 1871 return 1492;
1836 } 1872 }
1873 case QETH_CARD_TYPE_OSM:
1874 case QETH_CARD_TYPE_OSX:
1875 return 1492;
1837 default: 1876 default:
1838 return 1500; 1877 return 1500;
1839 } 1878 }
@@ -1844,8 +1883,10 @@ static inline int qeth_get_max_mtu_for_card(int cardtype)
1844 switch (cardtype) { 1883 switch (cardtype) {
1845 1884
1846 case QETH_CARD_TYPE_UNKNOWN: 1885 case QETH_CARD_TYPE_UNKNOWN:
1847 case QETH_CARD_TYPE_OSAE: 1886 case QETH_CARD_TYPE_OSD:
1848 case QETH_CARD_TYPE_OSN: 1887 case QETH_CARD_TYPE_OSN:
1888 case QETH_CARD_TYPE_OSM:
1889 case QETH_CARD_TYPE_OSX:
1849 return 61440; 1890 return 61440;
1850 case QETH_CARD_TYPE_IQD: 1891 case QETH_CARD_TYPE_IQD:
1851 return 57344; 1892 return 57344;
@@ -1883,7 +1924,9 @@ static inline int qeth_get_mtu_outof_framesize(int framesize)
1883static inline int qeth_mtu_is_valid(struct qeth_card *card, int mtu) 1924static inline int qeth_mtu_is_valid(struct qeth_card *card, int mtu)
1884{ 1925{
1885 switch (card->info.type) { 1926 switch (card->info.type) {
1886 case QETH_CARD_TYPE_OSAE: 1927 case QETH_CARD_TYPE_OSD:
1928 case QETH_CARD_TYPE_OSM:
1929 case QETH_CARD_TYPE_OSX:
1887 return ((mtu >= 576) && (mtu <= 61440)); 1930 return ((mtu >= 576) && (mtu <= 61440));
1888 case QETH_CARD_TYPE_IQD: 1931 case QETH_CARD_TYPE_IQD:
1889 return ((mtu >= 576) && 1932 return ((mtu >= 576) &&
@@ -1934,6 +1977,7 @@ static int qeth_ulp_enable_cb(struct qeth_card *card, struct qeth_reply *reply,
1934 card->info.link_type = link_type; 1977 card->info.link_type = link_type;
1935 } else 1978 } else
1936 card->info.link_type = 0; 1979 card->info.link_type = 0;
1980 QETH_DBF_TEXT_(SETUP, 2, "link%d", link_type);
1937 QETH_DBF_TEXT_(SETUP, 2, " rc%d", iob->rc); 1981 QETH_DBF_TEXT_(SETUP, 2, " rc%d", iob->rc);
1938 return 0; 1982 return 0;
1939} 1983}
@@ -2246,7 +2290,9 @@ static void qeth_print_status_no_portname(struct qeth_card *card)
2246void qeth_print_status_message(struct qeth_card *card) 2290void qeth_print_status_message(struct qeth_card *card)
2247{ 2291{
2248 switch (card->info.type) { 2292 switch (card->info.type) {
2249 case QETH_CARD_TYPE_OSAE: 2293 case QETH_CARD_TYPE_OSD:
2294 case QETH_CARD_TYPE_OSM:
2295 case QETH_CARD_TYPE_OSX:
2250 /* VM will use a non-zero first character 2296 /* VM will use a non-zero first character
2251 * to indicate a HiperSockets like reporting 2297 * to indicate a HiperSockets like reporting
2252 * of the level OSA sets the first character to zero 2298 * of the level OSA sets the first character to zero
@@ -2553,9 +2599,11 @@ static int qeth_query_setadapterparms_cb(struct qeth_card *card,
2553 QETH_DBF_TEXT(TRACE, 3, "quyadpcb"); 2599 QETH_DBF_TEXT(TRACE, 3, "quyadpcb");
2554 2600
2555 cmd = (struct qeth_ipa_cmd *) data; 2601 cmd = (struct qeth_ipa_cmd *) data;
2556 if (cmd->data.setadapterparms.data.query_cmds_supp.lan_type & 0x7f) 2602 if (cmd->data.setadapterparms.data.query_cmds_supp.lan_type & 0x7f) {
2557 card->info.link_type = 2603 card->info.link_type =
2558 cmd->data.setadapterparms.data.query_cmds_supp.lan_type; 2604 cmd->data.setadapterparms.data.query_cmds_supp.lan_type;
2605 QETH_DBF_TEXT_(SETUP, 2, "lnk %d", card->info.link_type);
2606 }
2559 card->options.adp.supported_funcs = 2607 card->options.adp.supported_funcs =
2560 cmd->data.setadapterparms.data.query_cmds_supp.supported_cmds; 2608 cmd->data.setadapterparms.data.query_cmds_supp.supported_cmds;
2561 return qeth_default_setadapterparms_cb(card, reply, (unsigned long)cmd); 2609 return qeth_default_setadapterparms_cb(card, reply, (unsigned long)cmd);
@@ -2945,7 +2993,8 @@ EXPORT_SYMBOL_GPL(qeth_qdio_output_handler);
2945int qeth_get_priority_queue(struct qeth_card *card, struct sk_buff *skb, 2993int qeth_get_priority_queue(struct qeth_card *card, struct sk_buff *skb,
2946 int ipv, int cast_type) 2994 int ipv, int cast_type)
2947{ 2995{
2948 if (!ipv && (card->info.type == QETH_CARD_TYPE_OSAE)) 2996 if (!ipv && (card->info.type == QETH_CARD_TYPE_OSD ||
2997 card->info.type == QETH_CARD_TYPE_OSX))
2949 return card->qdio.default_out_queue; 2998 return card->qdio.default_out_queue;
2950 switch (card->qdio.no_out_queues) { 2999 switch (card->qdio.no_out_queues) {
2951 case 4: 3000 case 4:
@@ -3507,13 +3556,14 @@ int qeth_set_access_ctrl_online(struct qeth_card *card)
3507 3556
3508 QETH_DBF_TEXT(TRACE, 4, "setactlo"); 3557 QETH_DBF_TEXT(TRACE, 4, "setactlo");
3509 3558
3510 if (card->info.type == QETH_CARD_TYPE_OSAE && 3559 if ((card->info.type == QETH_CARD_TYPE_OSD ||
3511 qeth_adp_supported(card, IPA_SETADP_SET_ACCESS_CONTROL)) { 3560 card->info.type == QETH_CARD_TYPE_OSX) &&
3561 qeth_adp_supported(card, IPA_SETADP_SET_ACCESS_CONTROL)) {
3512 rc = qeth_setadpparms_set_access_ctrl(card, 3562 rc = qeth_setadpparms_set_access_ctrl(card,
3513 card->options.isolation); 3563 card->options.isolation);
3514 if (rc) { 3564 if (rc) {
3515 QETH_DBF_MESSAGE(3, 3565 QETH_DBF_MESSAGE(3,
3516 "IPA(SET_ACCESS_CTRL,%s,%d) sent failed", 3566 "IPA(SET_ACCESS_CTRL,%s,%d) sent failed\n",
3517 card->gdev->dev.kobj.name, 3567 card->gdev->dev.kobj.name,
3518 rc); 3568 rc);
3519 } 3569 }
@@ -3845,9 +3895,16 @@ static void qeth_core_free_card(struct qeth_card *card)
3845} 3895}
3846 3896
3847static struct ccw_device_id qeth_ids[] = { 3897static struct ccw_device_id qeth_ids[] = {
3848 {CCW_DEVICE(0x1731, 0x01), .driver_info = QETH_CARD_TYPE_OSAE}, 3898 {CCW_DEVICE_DEVTYPE(0x1731, 0x01, 0x1732, 0x01),
3849 {CCW_DEVICE(0x1731, 0x05), .driver_info = QETH_CARD_TYPE_IQD}, 3899 .driver_info = QETH_CARD_TYPE_OSD},
3850 {CCW_DEVICE(0x1731, 0x06), .driver_info = QETH_CARD_TYPE_OSN}, 3900 {CCW_DEVICE_DEVTYPE(0x1731, 0x05, 0x1732, 0x05),
3901 .driver_info = QETH_CARD_TYPE_IQD},
3902 {CCW_DEVICE_DEVTYPE(0x1731, 0x06, 0x1732, 0x06),
3903 .driver_info = QETH_CARD_TYPE_OSN},
3904 {CCW_DEVICE_DEVTYPE(0x1731, 0x02, 0x1732, 0x03),
3905 .driver_info = QETH_CARD_TYPE_OSM},
3906 {CCW_DEVICE_DEVTYPE(0x1731, 0x02, 0x1732, 0x02),
3907 .driver_info = QETH_CARD_TYPE_OSX},
3851 {}, 3908 {},
3852}; 3909};
3853MODULE_DEVICE_TABLE(ccw, qeth_ids); 3910MODULE_DEVICE_TABLE(ccw, qeth_ids);
@@ -4251,25 +4308,25 @@ static int qeth_core_probe_device(struct ccwgroup_device *gdev)
4251 goto err_card; 4308 goto err_card;
4252 } 4309 }
4253 4310
4254 if (card->info.type == QETH_CARD_TYPE_OSN) { 4311 if (card->info.type == QETH_CARD_TYPE_OSN)
4255 rc = qeth_core_create_osn_attributes(dev); 4312 rc = qeth_core_create_osn_attributes(dev);
4256 if (rc) 4313 else
4257 goto err_card; 4314 rc = qeth_core_create_device_attributes(dev);
4315 if (rc)
4316 goto err_card;
4317 switch (card->info.type) {
4318 case QETH_CARD_TYPE_OSN:
4319 case QETH_CARD_TYPE_OSM:
4258 rc = qeth_core_load_discipline(card, QETH_DISCIPLINE_LAYER2); 4320 rc = qeth_core_load_discipline(card, QETH_DISCIPLINE_LAYER2);
4259 if (rc) { 4321 if (rc)
4260 qeth_core_remove_osn_attributes(dev); 4322 goto err_attr;
4261 goto err_card;
4262 }
4263 rc = card->discipline.ccwgdriver->probe(card->gdev); 4323 rc = card->discipline.ccwgdriver->probe(card->gdev);
4264 if (rc) {
4265 qeth_core_free_discipline(card);
4266 qeth_core_remove_osn_attributes(dev);
4267 goto err_card;
4268 }
4269 } else {
4270 rc = qeth_core_create_device_attributes(dev);
4271 if (rc) 4324 if (rc)
4272 goto err_card; 4325 goto err_disc;
4326 case QETH_CARD_TYPE_OSD:
4327 case QETH_CARD_TYPE_OSX:
4328 default:
4329 break;
4273 } 4330 }
4274 4331
4275 write_lock_irqsave(&qeth_core_card_list.rwlock, flags); 4332 write_lock_irqsave(&qeth_core_card_list.rwlock, flags);
@@ -4279,6 +4336,13 @@ static int qeth_core_probe_device(struct ccwgroup_device *gdev)
4279 qeth_determine_capabilities(card); 4336 qeth_determine_capabilities(card);
4280 return 0; 4337 return 0;
4281 4338
4339err_disc:
4340 qeth_core_free_discipline(card);
4341err_attr:
4342 if (card->info.type == QETH_CARD_TYPE_OSN)
4343 qeth_core_remove_osn_attributes(dev);
4344 else
4345 qeth_core_remove_device_attributes(dev);
4282err_card: 4346err_card:
4283 qeth_core_free_card(card); 4347 qeth_core_free_card(card);
4284err_dev: 4348err_dev:
diff --git a/drivers/s390/net/qeth_core_mpc.h b/drivers/s390/net/qeth_core_mpc.h
index 104a3351e02b..f9ed24de7514 100644
--- a/drivers/s390/net/qeth_core_mpc.h
+++ b/drivers/s390/net/qeth_core_mpc.h
@@ -48,9 +48,11 @@ extern unsigned char IPA_PDU_HEADER[];
48 48
49enum qeth_card_types { 49enum qeth_card_types {
50 QETH_CARD_TYPE_UNKNOWN = 0, 50 QETH_CARD_TYPE_UNKNOWN = 0,
51 QETH_CARD_TYPE_OSAE = 10, 51 QETH_CARD_TYPE_OSD = 1,
52 QETH_CARD_TYPE_IQD = 1234, 52 QETH_CARD_TYPE_IQD = 5,
53 QETH_CARD_TYPE_OSN = 11, 53 QETH_CARD_TYPE_OSN = 6,
54 QETH_CARD_TYPE_OSM = 3,
55 QETH_CARD_TYPE_OSX = 2,
54}; 56};
55 57
56#define QETH_MPC_DIFINFO_LEN_INDICATES_LINK_TYPE 0x18 58#define QETH_MPC_DIFINFO_LEN_INDICATES_LINK_TYPE 0x18
@@ -614,6 +616,8 @@ extern unsigned char IDX_ACTIVATE_WRITE[];
614#define QETH_IS_IDX_ACT_POS_REPLY(buffer) (((buffer)[0x08] & 3) == 2) 616#define QETH_IS_IDX_ACT_POS_REPLY(buffer) (((buffer)[0x08] & 3) == 2)
615#define QETH_IDX_REPLY_LEVEL(buffer) (buffer + 0x12) 617#define QETH_IDX_REPLY_LEVEL(buffer) (buffer + 0x12)
616#define QETH_IDX_ACT_CAUSE_CODE(buffer) (buffer)[0x09] 618#define QETH_IDX_ACT_CAUSE_CODE(buffer) (buffer)[0x09]
619#define QETH_IDX_ACT_ERR_EXCL 0x19
620#define QETH_IDX_ACT_ERR_AUTH 0x1E
617 621
618#define PDU_ENCAPSULATION(buffer) \ 622#define PDU_ENCAPSULATION(buffer) \
619 (buffer + *(buffer + (*(buffer + 0x0b)) + \ 623 (buffer + *(buffer + (*(buffer + 0x0b)) + \
diff --git a/drivers/s390/net/qeth_core_sys.c b/drivers/s390/net/qeth_core_sys.c
index cbac4050afb2..2eb022ff2610 100644
--- a/drivers/s390/net/qeth_core_sys.c
+++ b/drivers/s390/net/qeth_core_sys.c
@@ -490,7 +490,8 @@ static ssize_t qeth_dev_isolation_store(struct device *dev,
490 490
491 mutex_lock(&card->conf_mutex); 491 mutex_lock(&card->conf_mutex);
492 /* check for unknown, too, in case we do not yet know who we are */ 492 /* check for unknown, too, in case we do not yet know who we are */
493 if (card->info.type != QETH_CARD_TYPE_OSAE && 493 if (card->info.type != QETH_CARD_TYPE_OSD &&
494 card->info.type != QETH_CARD_TYPE_OSX &&
494 card->info.type != QETH_CARD_TYPE_UNKNOWN) { 495 card->info.type != QETH_CARD_TYPE_UNKNOWN) {
495 rc = -EOPNOTSUPP; 496 rc = -EOPNOTSUPP;
496 dev_err(&card->gdev->dev, "Adapter does not " 497 dev_err(&card->gdev->dev, "Adapter does not "
diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c
index b447e1998c6b..d43f57a4ac66 100644
--- a/drivers/s390/net/qeth_l2_main.c
+++ b/drivers/s390/net/qeth_l2_main.c
@@ -56,7 +56,9 @@ static int qeth_l2_do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
56 rc = qeth_snmp_command(card, rq->ifr_ifru.ifru_data); 56 rc = qeth_snmp_command(card, rq->ifr_ifru.ifru_data);
57 break; 57 break;
58 case SIOC_QETH_GET_CARD_TYPE: 58 case SIOC_QETH_GET_CARD_TYPE:
59 if ((card->info.type == QETH_CARD_TYPE_OSAE) && 59 if ((card->info.type == QETH_CARD_TYPE_OSD ||
60 card->info.type == QETH_CARD_TYPE_OSM ||
61 card->info.type == QETH_CARD_TYPE_OSX) &&
60 !card->info.guestlan) 62 !card->info.guestlan)
61 return 1; 63 return 1;
62 return 0; 64 return 0;
@@ -309,6 +311,10 @@ static void qeth_l2_vlan_rx_add_vid(struct net_device *dev, unsigned short vid)
309 struct qeth_vlan_vid *id; 311 struct qeth_vlan_vid *id;
310 312
311 QETH_DBF_TEXT_(TRACE, 4, "aid:%d", vid); 313 QETH_DBF_TEXT_(TRACE, 4, "aid:%d", vid);
314 if (card->info.type == QETH_CARD_TYPE_OSM) {
315 QETH_DBF_TEXT(TRACE, 3, "aidOSM");
316 return;
317 }
312 if (qeth_wait_for_threads(card, QETH_RECOVER_THREAD)) { 318 if (qeth_wait_for_threads(card, QETH_RECOVER_THREAD)) {
313 QETH_DBF_TEXT(TRACE, 3, "aidREC"); 319 QETH_DBF_TEXT(TRACE, 3, "aidREC");
314 return; 320 return;
@@ -329,6 +335,10 @@ static void qeth_l2_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
329 struct qeth_card *card = dev->ml_priv; 335 struct qeth_card *card = dev->ml_priv;
330 336
331 QETH_DBF_TEXT_(TRACE, 4, "kid:%d", vid); 337 QETH_DBF_TEXT_(TRACE, 4, "kid:%d", vid);
338 if (card->info.type == QETH_CARD_TYPE_OSM) {
339 QETH_DBF_TEXT(TRACE, 3, "kidOSM");
340 return;
341 }
332 if (qeth_wait_for_threads(card, QETH_RECOVER_THREAD)) { 342 if (qeth_wait_for_threads(card, QETH_RECOVER_THREAD)) {
333 QETH_DBF_TEXT(TRACE, 3, "kidREC"); 343 QETH_DBF_TEXT(TRACE, 3, "kidREC");
334 return; 344 return;
@@ -559,8 +569,10 @@ static int qeth_l2_request_initial_mac(struct qeth_card *card)
559 "device %s: x%x\n", CARD_BUS_ID(card), rc); 569 "device %s: x%x\n", CARD_BUS_ID(card), rc);
560 } 570 }
561 571
562 if ((card->info.type == QETH_CARD_TYPE_IQD) || 572 if (card->info.type == QETH_CARD_TYPE_IQD ||
563 (card->info.guestlan)) { 573 card->info.type == QETH_CARD_TYPE_OSM ||
574 card->info.type == QETH_CARD_TYPE_OSX ||
575 card->info.guestlan) {
564 rc = qeth_setadpparms_change_macaddr(card); 576 rc = qeth_setadpparms_change_macaddr(card);
565 if (rc) { 577 if (rc) {
566 QETH_DBF_MESSAGE(2, "couldn't get MAC address on " 578 QETH_DBF_MESSAGE(2, "couldn't get MAC address on "
@@ -589,8 +601,10 @@ static int qeth_l2_set_mac_address(struct net_device *dev, void *p)
589 return -EOPNOTSUPP; 601 return -EOPNOTSUPP;
590 } 602 }
591 603
592 if (card->info.type == QETH_CARD_TYPE_OSN) { 604 if (card->info.type == QETH_CARD_TYPE_OSN ||
593 QETH_DBF_TEXT(TRACE, 3, "setmcOSN"); 605 card->info.type == QETH_CARD_TYPE_OSM ||
606 card->info.type == QETH_CARD_TYPE_OSX) {
607 QETH_DBF_TEXT(TRACE, 3, "setmcTYP");
594 return -EOPNOTSUPP; 608 return -EOPNOTSUPP;
595 } 609 }
596 QETH_DBF_TEXT_(TRACE, 3, "%s", CARD_BUS_ID(card)); 610 QETH_DBF_TEXT_(TRACE, 3, "%s", CARD_BUS_ID(card));
@@ -885,9 +899,6 @@ static const struct net_device_ops qeth_l2_netdev_ops = {
885static int qeth_l2_setup_netdev(struct qeth_card *card) 899static int qeth_l2_setup_netdev(struct qeth_card *card)
886{ 900{
887 switch (card->info.type) { 901 switch (card->info.type) {
888 case QETH_CARD_TYPE_OSAE:
889 card->dev = alloc_etherdev(0);
890 break;
891 case QETH_CARD_TYPE_IQD: 902 case QETH_CARD_TYPE_IQD:
892 card->dev = alloc_netdev(0, "hsi%d", ether_setup); 903 card->dev = alloc_netdev(0, "hsi%d", ether_setup);
893 break; 904 break;
@@ -964,11 +975,14 @@ static int __qeth_l2_set_online(struct ccwgroup_device *gdev, int recovery_mode)
964 } else 975 } else
965 card->lan_online = 1; 976 card->lan_online = 1;
966 977
967 if (card->info.type != QETH_CARD_TYPE_OSN) { 978 if ((card->info.type == QETH_CARD_TYPE_OSD) ||
979 (card->info.type == QETH_CARD_TYPE_OSX))
968 /* configure isolation level */ 980 /* configure isolation level */
969 qeth_set_access_ctrl_online(card); 981 qeth_set_access_ctrl_online(card);
982
983 if (card->info.type != QETH_CARD_TYPE_OSN &&
984 card->info.type != QETH_CARD_TYPE_OSM)
970 qeth_l2_process_vlans(card, 0); 985 qeth_l2_process_vlans(card, 0);
971 }
972 986
973 netif_tx_disable(card->dev); 987 netif_tx_disable(card->dev);
974 988
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c
index 83c7f9444c4f..61adae21a464 100644
--- a/drivers/s390/net/qeth_l3_main.c
+++ b/drivers/s390/net/qeth_l3_main.c
@@ -2711,7 +2711,8 @@ static int qeth_l3_do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
2711 rc = qeth_snmp_command(card, rq->ifr_ifru.ifru_data); 2711 rc = qeth_snmp_command(card, rq->ifr_ifru.ifru_data);
2712 break; 2712 break;
2713 case SIOC_QETH_GET_CARD_TYPE: 2713 case SIOC_QETH_GET_CARD_TYPE:
2714 if ((card->info.type == QETH_CARD_TYPE_OSAE) && 2714 if ((card->info.type == QETH_CARD_TYPE_OSD ||
2715 card->info.type == QETH_CARD_TYPE_OSX) &&
2715 !card->info.guestlan) 2716 !card->info.guestlan)
2716 return 1; 2717 return 1;
2717 return 0; 2718 return 0;
@@ -3248,7 +3249,8 @@ static const struct net_device_ops qeth_l3_osa_netdev_ops = {
3248 3249
3249static int qeth_l3_setup_netdev(struct qeth_card *card) 3250static int qeth_l3_setup_netdev(struct qeth_card *card)
3250{ 3251{
3251 if (card->info.type == QETH_CARD_TYPE_OSAE) { 3252 if (card->info.type == QETH_CARD_TYPE_OSD ||
3253 card->info.type == QETH_CARD_TYPE_OSX) {
3252 if ((card->info.link_type == QETH_LINK_TYPE_LANE_TR) || 3254 if ((card->info.link_type == QETH_LINK_TYPE_LANE_TR) ||
3253 (card->info.link_type == QETH_LINK_TYPE_HSTR)) { 3255 (card->info.link_type == QETH_LINK_TYPE_HSTR)) {
3254#ifdef CONFIG_TR 3256#ifdef CONFIG_TR