aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/net/qeth_l2_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/net/qeth_l2_main.c')
-rw-r--r--drivers/s390/net/qeth_l2_main.c143
1 files changed, 67 insertions, 76 deletions
diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c
index 0263d9406fcf..3921d1631a78 100644
--- a/drivers/s390/net/qeth_l2_main.c
+++ b/drivers/s390/net/qeth_l2_main.c
@@ -22,16 +22,7 @@
22#include "qeth_core.h" 22#include "qeth_core.h"
23#include "qeth_core_offl.h" 23#include "qeth_core_offl.h"
24 24
25#define QETH_DBF_TEXT_(name, level, text...) \ 25#define QETH_DBF_TXT_BUF qeth_l2_dbf_txt_buf
26 do { \
27 if (qeth_dbf_passes(qeth_dbf_##name, level)) { \
28 char *dbf_txt_buf = get_cpu_var(qeth_l2_dbf_txt_buf); \
29 sprintf(dbf_txt_buf, text); \
30 debug_text_event(qeth_dbf_##name, level, dbf_txt_buf); \
31 put_cpu_var(qeth_l2_dbf_txt_buf); \
32 } \
33 } while (0)
34
35static DEFINE_PER_CPU(char[256], qeth_l2_dbf_txt_buf); 26static DEFINE_PER_CPU(char[256], qeth_l2_dbf_txt_buf);
36 27
37static int qeth_l2_set_offline(struct ccwgroup_device *); 28static int qeth_l2_set_offline(struct ccwgroup_device *);
@@ -87,7 +78,7 @@ static int qeth_l2_do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
87 rc = -EOPNOTSUPP; 78 rc = -EOPNOTSUPP;
88 } 79 }
89 if (rc) 80 if (rc)
90 QETH_DBF_TEXT_(trace, 2, "ioce%d", rc); 81 QETH_DBF_TEXT_(TRACE, 2, "ioce%d", rc);
91 return rc; 82 return rc;
92} 83}
93 84
@@ -141,7 +132,7 @@ static int qeth_l2_send_setgroupmac_cb(struct qeth_card *card,
141 struct qeth_ipa_cmd *cmd; 132 struct qeth_ipa_cmd *cmd;
142 __u8 *mac; 133 __u8 *mac;
143 134
144 QETH_DBF_TEXT(trace, 2, "L2Sgmacb"); 135 QETH_DBF_TEXT(TRACE, 2, "L2Sgmacb");
145 cmd = (struct qeth_ipa_cmd *) data; 136 cmd = (struct qeth_ipa_cmd *) data;
146 mac = &cmd->data.setdelmac.mac[0]; 137 mac = &cmd->data.setdelmac.mac[0];
147 /* MAC already registered, needed in couple/uncouple case */ 138 /* MAC already registered, needed in couple/uncouple case */
@@ -162,7 +153,7 @@ static int qeth_l2_send_setgroupmac_cb(struct qeth_card *card,
162 153
163static int qeth_l2_send_setgroupmac(struct qeth_card *card, __u8 *mac) 154static int qeth_l2_send_setgroupmac(struct qeth_card *card, __u8 *mac)
164{ 155{
165 QETH_DBF_TEXT(trace, 2, "L2Sgmac"); 156 QETH_DBF_TEXT(TRACE, 2, "L2Sgmac");
166 return qeth_l2_send_setdelmac(card, mac, IPA_CMD_SETGMAC, 157 return qeth_l2_send_setdelmac(card, mac, IPA_CMD_SETGMAC,
167 qeth_l2_send_setgroupmac_cb); 158 qeth_l2_send_setgroupmac_cb);
168} 159}
@@ -174,7 +165,7 @@ static int qeth_l2_send_delgroupmac_cb(struct qeth_card *card,
174 struct qeth_ipa_cmd *cmd; 165 struct qeth_ipa_cmd *cmd;
175 __u8 *mac; 166 __u8 *mac;
176 167
177 QETH_DBF_TEXT(trace, 2, "L2Dgmacb"); 168 QETH_DBF_TEXT(TRACE, 2, "L2Dgmacb");
178 cmd = (struct qeth_ipa_cmd *) data; 169 cmd = (struct qeth_ipa_cmd *) data;
179 mac = &cmd->data.setdelmac.mac[0]; 170 mac = &cmd->data.setdelmac.mac[0];
180 if (cmd->hdr.return_code) 171 if (cmd->hdr.return_code)
@@ -187,7 +178,7 @@ static int qeth_l2_send_delgroupmac_cb(struct qeth_card *card,
187 178
188static int qeth_l2_send_delgroupmac(struct qeth_card *card, __u8 *mac) 179static int qeth_l2_send_delgroupmac(struct qeth_card *card, __u8 *mac)
189{ 180{
190 QETH_DBF_TEXT(trace, 2, "L2Dgmac"); 181 QETH_DBF_TEXT(TRACE, 2, "L2Dgmac");
191 return qeth_l2_send_setdelmac(card, mac, IPA_CMD_DELGMAC, 182 return qeth_l2_send_setdelmac(card, mac, IPA_CMD_DELGMAC,
192 qeth_l2_send_delgroupmac_cb); 183 qeth_l2_send_delgroupmac_cb);
193} 184}
@@ -289,15 +280,15 @@ static int qeth_l2_send_setdelvlan_cb(struct qeth_card *card,
289{ 280{
290 struct qeth_ipa_cmd *cmd; 281 struct qeth_ipa_cmd *cmd;
291 282
292 QETH_DBF_TEXT(trace, 2, "L2sdvcb"); 283 QETH_DBF_TEXT(TRACE, 2, "L2sdvcb");
293 cmd = (struct qeth_ipa_cmd *) data; 284 cmd = (struct qeth_ipa_cmd *) data;
294 if (cmd->hdr.return_code) { 285 if (cmd->hdr.return_code) {
295 PRINT_ERR("Error in processing VLAN %i on %s: 0x%x. " 286 PRINT_ERR("Error in processing VLAN %i on %s: 0x%x. "
296 "Continuing\n", cmd->data.setdelvlan.vlan_id, 287 "Continuing\n", cmd->data.setdelvlan.vlan_id,
297 QETH_CARD_IFNAME(card), cmd->hdr.return_code); 288 QETH_CARD_IFNAME(card), cmd->hdr.return_code);
298 QETH_DBF_TEXT_(trace, 2, "L2VL%4x", cmd->hdr.command); 289 QETH_DBF_TEXT_(TRACE, 2, "L2VL%4x", cmd->hdr.command);
299 QETH_DBF_TEXT_(trace, 2, "L2%s", CARD_BUS_ID(card)); 290 QETH_DBF_TEXT_(TRACE, 2, "L2%s", CARD_BUS_ID(card));
300 QETH_DBF_TEXT_(trace, 2, "err%d", cmd->hdr.return_code); 291 QETH_DBF_TEXT_(TRACE, 2, "err%d", cmd->hdr.return_code);
301 } 292 }
302 return 0; 293 return 0;
303} 294}
@@ -308,7 +299,7 @@ static int qeth_l2_send_setdelvlan(struct qeth_card *card, __u16 i,
308 struct qeth_ipa_cmd *cmd; 299 struct qeth_ipa_cmd *cmd;
309 struct qeth_cmd_buffer *iob; 300 struct qeth_cmd_buffer *iob;
310 301
311 QETH_DBF_TEXT_(trace, 4, "L2sdv%x", ipacmd); 302 QETH_DBF_TEXT_(TRACE, 4, "L2sdv%x", ipacmd);
312 iob = qeth_get_ipacmd_buffer(card, ipacmd, QETH_PROT_IPV4); 303 iob = qeth_get_ipacmd_buffer(card, ipacmd, QETH_PROT_IPV4);
313 cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE); 304 cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE);
314 cmd->data.setdelvlan.vlan_id = i; 305 cmd->data.setdelvlan.vlan_id = i;
@@ -319,7 +310,7 @@ static int qeth_l2_send_setdelvlan(struct qeth_card *card, __u16 i,
319static void qeth_l2_process_vlans(struct qeth_card *card, int clear) 310static void qeth_l2_process_vlans(struct qeth_card *card, int clear)
320{ 311{
321 struct qeth_vlan_vid *id; 312 struct qeth_vlan_vid *id;
322 QETH_DBF_TEXT(trace, 3, "L2prcvln"); 313 QETH_DBF_TEXT(TRACE, 3, "L2prcvln");
323 spin_lock_bh(&card->vlanlock); 314 spin_lock_bh(&card->vlanlock);
324 list_for_each_entry(id, &card->vid_list, list) { 315 list_for_each_entry(id, &card->vid_list, list) {
325 if (clear) 316 if (clear)
@@ -337,7 +328,7 @@ static void qeth_l2_vlan_rx_add_vid(struct net_device *dev, unsigned short vid)
337 struct qeth_card *card = netdev_priv(dev); 328 struct qeth_card *card = netdev_priv(dev);
338 struct qeth_vlan_vid *id; 329 struct qeth_vlan_vid *id;
339 330
340 QETH_DBF_TEXT_(trace, 4, "aid:%d", vid); 331 QETH_DBF_TEXT_(TRACE, 4, "aid:%d", vid);
341 id = kmalloc(sizeof(struct qeth_vlan_vid), GFP_ATOMIC); 332 id = kmalloc(sizeof(struct qeth_vlan_vid), GFP_ATOMIC);
342 if (id) { 333 if (id) {
343 id->vid = vid; 334 id->vid = vid;
@@ -355,7 +346,7 @@ static void qeth_l2_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
355 struct qeth_vlan_vid *id, *tmpid = NULL; 346 struct qeth_vlan_vid *id, *tmpid = NULL;
356 struct qeth_card *card = netdev_priv(dev); 347 struct qeth_card *card = netdev_priv(dev);
357 348
358 QETH_DBF_TEXT_(trace, 4, "kid:%d", vid); 349 QETH_DBF_TEXT_(TRACE, 4, "kid:%d", vid);
359 spin_lock_bh(&card->vlanlock); 350 spin_lock_bh(&card->vlanlock);
360 list_for_each_entry(id, &card->vid_list, list) { 351 list_for_each_entry(id, &card->vid_list, list) {
361 if (id->vid == vid) { 352 if (id->vid == vid) {
@@ -376,8 +367,8 @@ static int qeth_l2_stop_card(struct qeth_card *card, int recovery_mode)
376{ 367{
377 int rc = 0; 368 int rc = 0;
378 369
379 QETH_DBF_TEXT(setup , 2, "stopcard"); 370 QETH_DBF_TEXT(SETUP , 2, "stopcard");
380 QETH_DBF_HEX(setup, 2, &card, sizeof(void *)); 371 QETH_DBF_HEX(SETUP, 2, &card, sizeof(void *));
381 372
382 qeth_set_allowed_threads(card, 0, 1); 373 qeth_set_allowed_threads(card, 0, 1);
383 if (qeth_wait_for_threads(card, ~QETH_RECOVER_THREAD)) 374 if (qeth_wait_for_threads(card, ~QETH_RECOVER_THREAD))
@@ -396,7 +387,7 @@ static int qeth_l2_stop_card(struct qeth_card *card, int recovery_mode)
396 if (!card->use_hard_stop) { 387 if (!card->use_hard_stop) {
397 __u8 *mac = &card->dev->dev_addr[0]; 388 __u8 *mac = &card->dev->dev_addr[0];
398 rc = qeth_l2_send_delmac(card, mac); 389 rc = qeth_l2_send_delmac(card, mac);
399 QETH_DBF_TEXT_(setup, 2, "Lerr%d", rc); 390 QETH_DBF_TEXT_(SETUP, 2, "Lerr%d", rc);
400 } 391 }
401 card->state = CARD_STATE_SOFTSETUP; 392 card->state = CARD_STATE_SOFTSETUP;
402 } 393 }
@@ -465,8 +456,8 @@ static void qeth_l2_process_inbound_buffer(struct qeth_card *card,
465 break; 456 break;
466 default: 457 default:
467 dev_kfree_skb_any(skb); 458 dev_kfree_skb_any(skb);
468 QETH_DBF_TEXT(trace, 3, "inbunkno"); 459 QETH_DBF_TEXT(TRACE, 3, "inbunkno");
469 QETH_DBF_HEX(control, 3, hdr, QETH_DBF_CONTROL_LEN); 460 QETH_DBF_HEX(CTRL, 3, hdr, QETH_DBF_CTRL_LEN);
470 continue; 461 continue;
471 } 462 }
472 card->dev->last_rx = jiffies; 463 card->dev->last_rx = jiffies;
@@ -484,7 +475,7 @@ static int qeth_l2_send_setdelmac(struct qeth_card *card, __u8 *mac,
484 struct qeth_ipa_cmd *cmd; 475 struct qeth_ipa_cmd *cmd;
485 struct qeth_cmd_buffer *iob; 476 struct qeth_cmd_buffer *iob;
486 477
487 QETH_DBF_TEXT(trace, 2, "L2sdmac"); 478 QETH_DBF_TEXT(TRACE, 2, "L2sdmac");
488 iob = qeth_get_ipacmd_buffer(card, ipacmd, QETH_PROT_IPV4); 479 iob = qeth_get_ipacmd_buffer(card, ipacmd, QETH_PROT_IPV4);
489 cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE); 480 cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE);
490 cmd->data.setdelmac.mac_length = OSA_ADDR_LEN; 481 cmd->data.setdelmac.mac_length = OSA_ADDR_LEN;
@@ -498,10 +489,10 @@ static int qeth_l2_send_setmac_cb(struct qeth_card *card,
498{ 489{
499 struct qeth_ipa_cmd *cmd; 490 struct qeth_ipa_cmd *cmd;
500 491
501 QETH_DBF_TEXT(trace, 2, "L2Smaccb"); 492 QETH_DBF_TEXT(TRACE, 2, "L2Smaccb");
502 cmd = (struct qeth_ipa_cmd *) data; 493 cmd = (struct qeth_ipa_cmd *) data;
503 if (cmd->hdr.return_code) { 494 if (cmd->hdr.return_code) {
504 QETH_DBF_TEXT_(trace, 2, "L2er%x", cmd->hdr.return_code); 495 QETH_DBF_TEXT_(TRACE, 2, "L2er%x", cmd->hdr.return_code);
505 card->info.mac_bits &= ~QETH_LAYER2_MAC_REGISTERED; 496 card->info.mac_bits &= ~QETH_LAYER2_MAC_REGISTERED;
506 cmd->hdr.return_code = -EIO; 497 cmd->hdr.return_code = -EIO;
507 } else { 498 } else {
@@ -520,7 +511,7 @@ static int qeth_l2_send_setmac_cb(struct qeth_card *card,
520 511
521static int qeth_l2_send_setmac(struct qeth_card *card, __u8 *mac) 512static int qeth_l2_send_setmac(struct qeth_card *card, __u8 *mac)
522{ 513{
523 QETH_DBF_TEXT(trace, 2, "L2Setmac"); 514 QETH_DBF_TEXT(TRACE, 2, "L2Setmac");
524 return qeth_l2_send_setdelmac(card, mac, IPA_CMD_SETVMAC, 515 return qeth_l2_send_setdelmac(card, mac, IPA_CMD_SETVMAC,
525 qeth_l2_send_setmac_cb); 516 qeth_l2_send_setmac_cb);
526} 517}
@@ -531,10 +522,10 @@ static int qeth_l2_send_delmac_cb(struct qeth_card *card,
531{ 522{
532 struct qeth_ipa_cmd *cmd; 523 struct qeth_ipa_cmd *cmd;
533 524
534 QETH_DBF_TEXT(trace, 2, "L2Dmaccb"); 525 QETH_DBF_TEXT(TRACE, 2, "L2Dmaccb");
535 cmd = (struct qeth_ipa_cmd *) data; 526 cmd = (struct qeth_ipa_cmd *) data;
536 if (cmd->hdr.return_code) { 527 if (cmd->hdr.return_code) {
537 QETH_DBF_TEXT_(trace, 2, "err%d", cmd->hdr.return_code); 528 QETH_DBF_TEXT_(TRACE, 2, "err%d", cmd->hdr.return_code);
538 cmd->hdr.return_code = -EIO; 529 cmd->hdr.return_code = -EIO;
539 return 0; 530 return 0;
540 } 531 }
@@ -545,7 +536,7 @@ static int qeth_l2_send_delmac_cb(struct qeth_card *card,
545 536
546static int qeth_l2_send_delmac(struct qeth_card *card, __u8 *mac) 537static int qeth_l2_send_delmac(struct qeth_card *card, __u8 *mac)
547{ 538{
548 QETH_DBF_TEXT(trace, 2, "L2Delmac"); 539 QETH_DBF_TEXT(TRACE, 2, "L2Delmac");
549 if (!(card->info.mac_bits & QETH_LAYER2_MAC_REGISTERED)) 540 if (!(card->info.mac_bits & QETH_LAYER2_MAC_REGISTERED))
550 return 0; 541 return 0;
551 return qeth_l2_send_setdelmac(card, mac, IPA_CMD_DELVMAC, 542 return qeth_l2_send_setdelmac(card, mac, IPA_CMD_DELVMAC,
@@ -557,8 +548,8 @@ static int qeth_l2_request_initial_mac(struct qeth_card *card)
557 int rc = 0; 548 int rc = 0;
558 char vendor_pre[] = {0x02, 0x00, 0x00}; 549 char vendor_pre[] = {0x02, 0x00, 0x00};
559 550
560 QETH_DBF_TEXT(setup, 2, "doL2init"); 551 QETH_DBF_TEXT(SETUP, 2, "doL2init");
561 QETH_DBF_TEXT_(setup, 2, "doL2%s", CARD_BUS_ID(card)); 552 QETH_DBF_TEXT_(SETUP, 2, "doL2%s", CARD_BUS_ID(card));
562 553
563 rc = qeth_query_setadapterparms(card); 554 rc = qeth_query_setadapterparms(card);
564 if (rc) { 555 if (rc) {
@@ -572,10 +563,10 @@ static int qeth_l2_request_initial_mac(struct qeth_card *card)
572 PRINT_WARN("couldn't get MAC address on " 563 PRINT_WARN("couldn't get MAC address on "
573 "device %s: x%x\n", 564 "device %s: x%x\n",
574 CARD_BUS_ID(card), rc); 565 CARD_BUS_ID(card), rc);
575 QETH_DBF_TEXT_(setup, 2, "1err%d", rc); 566 QETH_DBF_TEXT_(SETUP, 2, "1err%d", rc);
576 return rc; 567 return rc;
577 } 568 }
578 QETH_DBF_HEX(setup, 2, card->dev->dev_addr, OSA_ADDR_LEN); 569 QETH_DBF_HEX(SETUP, 2, card->dev->dev_addr, OSA_ADDR_LEN);
579 } else { 570 } else {
580 random_ether_addr(card->dev->dev_addr); 571 random_ether_addr(card->dev->dev_addr);
581 memcpy(card->dev->dev_addr, vendor_pre, 3); 572 memcpy(card->dev->dev_addr, vendor_pre, 3);
@@ -589,21 +580,21 @@ static int qeth_l2_set_mac_address(struct net_device *dev, void *p)
589 struct qeth_card *card = netdev_priv(dev); 580 struct qeth_card *card = netdev_priv(dev);
590 int rc = 0; 581 int rc = 0;
591 582
592 QETH_DBF_TEXT(trace, 3, "setmac"); 583 QETH_DBF_TEXT(TRACE, 3, "setmac");
593 584
594 if (qeth_l2_verify_dev(dev) != QETH_REAL_CARD) { 585 if (qeth_l2_verify_dev(dev) != QETH_REAL_CARD) {
595 QETH_DBF_TEXT(trace, 3, "setmcINV"); 586 QETH_DBF_TEXT(TRACE, 3, "setmcINV");
596 return -EOPNOTSUPP; 587 return -EOPNOTSUPP;
597 } 588 }
598 589
599 if (card->info.type == QETH_CARD_TYPE_OSN) { 590 if (card->info.type == QETH_CARD_TYPE_OSN) {
600 PRINT_WARN("Setting MAC address on %s is not supported.\n", 591 PRINT_WARN("Setting MAC address on %s is not supported.\n",
601 dev->name); 592 dev->name);
602 QETH_DBF_TEXT(trace, 3, "setmcOSN"); 593 QETH_DBF_TEXT(TRACE, 3, "setmcOSN");
603 return -EOPNOTSUPP; 594 return -EOPNOTSUPP;
604 } 595 }
605 QETH_DBF_TEXT_(trace, 3, "%s", CARD_BUS_ID(card)); 596 QETH_DBF_TEXT_(TRACE, 3, "%s", CARD_BUS_ID(card));
606 QETH_DBF_HEX(trace, 3, addr->sa_data, OSA_ADDR_LEN); 597 QETH_DBF_HEX(TRACE, 3, addr->sa_data, OSA_ADDR_LEN);
607 rc = qeth_l2_send_delmac(card, &card->dev->dev_addr[0]); 598 rc = qeth_l2_send_delmac(card, &card->dev->dev_addr[0]);
608 if (!rc) 599 if (!rc)
609 rc = qeth_l2_send_setmac(card, addr->sa_data); 600 rc = qeth_l2_send_setmac(card, addr->sa_data);
@@ -618,7 +609,7 @@ static void qeth_l2_set_multicast_list(struct net_device *dev)
618 if (card->info.type == QETH_CARD_TYPE_OSN) 609 if (card->info.type == QETH_CARD_TYPE_OSN)
619 return ; 610 return ;
620 611
621 QETH_DBF_TEXT(trace, 3, "setmulti"); 612 QETH_DBF_TEXT(TRACE, 3, "setmulti");
622 qeth_l2_del_all_mc(card); 613 qeth_l2_del_all_mc(card);
623 spin_lock_bh(&card->mclock); 614 spin_lock_bh(&card->mclock);
624 for (dm = dev->mc_list; dm; dm = dm->next) 615 for (dm = dev->mc_list; dm; dm = dm->next)
@@ -644,7 +635,7 @@ static int qeth_l2_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
644 enum qeth_large_send_types large_send = QETH_LARGE_SEND_NO; 635 enum qeth_large_send_types large_send = QETH_LARGE_SEND_NO;
645 struct qeth_eddp_context *ctx = NULL; 636 struct qeth_eddp_context *ctx = NULL;
646 637
647 QETH_DBF_TEXT(trace, 6, "l2xmit"); 638 QETH_DBF_TEXT(TRACE, 6, "l2xmit");
648 639
649 if ((card->state != CARD_STATE_UP) || !card->lan_online) { 640 if ((card->state != CARD_STATE_UP) || !card->lan_online) {
650 card->stats.tx_carrier_errors++; 641 card->stats.tx_carrier_errors++;
@@ -756,7 +747,7 @@ static void qeth_l2_qdio_input_handler(struct ccw_device *ccwdev,
756 int index; 747 int index;
757 int i; 748 int i;
758 749
759 QETH_DBF_TEXT(trace, 6, "qdinput"); 750 QETH_DBF_TEXT(TRACE, 6, "qdinput");
760 card = (struct qeth_card *) card_ptr; 751 card = (struct qeth_card *) card_ptr;
761 net_dev = card->dev; 752 net_dev = card->dev;
762 if (card->options.performance_stats) { 753 if (card->options.performance_stats) {
@@ -765,11 +756,11 @@ static void qeth_l2_qdio_input_handler(struct ccw_device *ccwdev,
765 } 756 }
766 if (status & QDIO_STATUS_LOOK_FOR_ERROR) { 757 if (status & QDIO_STATUS_LOOK_FOR_ERROR) {
767 if (status & QDIO_STATUS_ACTIVATE_CHECK_CONDITION) { 758 if (status & QDIO_STATUS_ACTIVATE_CHECK_CONDITION) {
768 QETH_DBF_TEXT(trace, 1, "qdinchk"); 759 QETH_DBF_TEXT(TRACE, 1, "qdinchk");
769 QETH_DBF_TEXT_(trace, 1, "%s", CARD_BUS_ID(card)); 760 QETH_DBF_TEXT_(TRACE, 1, "%s", CARD_BUS_ID(card));
770 QETH_DBF_TEXT_(trace, 1, "%04X%04X", first_element, 761 QETH_DBF_TEXT_(TRACE, 1, "%04X%04X", first_element,
771 count); 762 count);
772 QETH_DBF_TEXT_(trace, 1, "%04X%04X", queue, status); 763 QETH_DBF_TEXT_(TRACE, 1, "%04X%04X", queue, status);
773 qeth_schedule_recovery(card); 764 qeth_schedule_recovery(card);
774 return; 765 return;
775 } 766 }
@@ -794,13 +785,13 @@ static int qeth_l2_open(struct net_device *dev)
794{ 785{
795 struct qeth_card *card = netdev_priv(dev); 786 struct qeth_card *card = netdev_priv(dev);
796 787
797 QETH_DBF_TEXT(trace, 4, "qethopen"); 788 QETH_DBF_TEXT(TRACE, 4, "qethopen");
798 if (card->state != CARD_STATE_SOFTSETUP) 789 if (card->state != CARD_STATE_SOFTSETUP)
799 return -ENODEV; 790 return -ENODEV;
800 791
801 if ((card->info.type != QETH_CARD_TYPE_OSN) && 792 if ((card->info.type != QETH_CARD_TYPE_OSN) &&
802 (!(card->info.mac_bits & QETH_LAYER2_MAC_REGISTERED))) { 793 (!(card->info.mac_bits & QETH_LAYER2_MAC_REGISTERED))) {
803 QETH_DBF_TEXT(trace, 4, "nomacadr"); 794 QETH_DBF_TEXT(TRACE, 4, "nomacadr");
804 return -EPERM; 795 return -EPERM;
805 } 796 }
806 card->data.state = CH_STATE_UP; 797 card->data.state = CH_STATE_UP;
@@ -818,7 +809,7 @@ static int qeth_l2_stop(struct net_device *dev)
818{ 809{
819 struct qeth_card *card = netdev_priv(dev); 810 struct qeth_card *card = netdev_priv(dev);
820 811
821 QETH_DBF_TEXT(trace, 4, "qethstop"); 812 QETH_DBF_TEXT(TRACE, 4, "qethstop");
822 netif_tx_disable(dev); 813 netif_tx_disable(dev);
823 card->dev->flags &= ~IFF_UP; 814 card->dev->flags &= ~IFF_UP;
824 if (card->state == CARD_STATE_UP) 815 if (card->state == CARD_STATE_UP)
@@ -934,8 +925,8 @@ static int __qeth_l2_set_online(struct ccwgroup_device *gdev, int recovery_mode)
934 enum qeth_card_states recover_flag; 925 enum qeth_card_states recover_flag;
935 926
936 BUG_ON(!card); 927 BUG_ON(!card);
937 QETH_DBF_TEXT(setup, 2, "setonlin"); 928 QETH_DBF_TEXT(SETUP, 2, "setonlin");
938 QETH_DBF_HEX(setup, 2, &card, sizeof(void *)); 929 QETH_DBF_HEX(SETUP, 2, &card, sizeof(void *));
939 930
940 qeth_set_allowed_threads(card, QETH_RECOVER_THREAD, 1); 931 qeth_set_allowed_threads(card, QETH_RECOVER_THREAD, 1);
941 if (qeth_wait_for_threads(card, ~QETH_RECOVER_THREAD)) { 932 if (qeth_wait_for_threads(card, ~QETH_RECOVER_THREAD)) {
@@ -947,23 +938,23 @@ static int __qeth_l2_set_online(struct ccwgroup_device *gdev, int recovery_mode)
947 recover_flag = card->state; 938 recover_flag = card->state;
948 rc = ccw_device_set_online(CARD_RDEV(card)); 939 rc = ccw_device_set_online(CARD_RDEV(card));
949 if (rc) { 940 if (rc) {
950 QETH_DBF_TEXT_(setup, 2, "1err%d", rc); 941 QETH_DBF_TEXT_(SETUP, 2, "1err%d", rc);
951 return -EIO; 942 return -EIO;
952 } 943 }
953 rc = ccw_device_set_online(CARD_WDEV(card)); 944 rc = ccw_device_set_online(CARD_WDEV(card));
954 if (rc) { 945 if (rc) {
955 QETH_DBF_TEXT_(setup, 2, "1err%d", rc); 946 QETH_DBF_TEXT_(SETUP, 2, "1err%d", rc);
956 return -EIO; 947 return -EIO;
957 } 948 }
958 rc = ccw_device_set_online(CARD_DDEV(card)); 949 rc = ccw_device_set_online(CARD_DDEV(card));
959 if (rc) { 950 if (rc) {
960 QETH_DBF_TEXT_(setup, 2, "1err%d", rc); 951 QETH_DBF_TEXT_(SETUP, 2, "1err%d", rc);
961 return -EIO; 952 return -EIO;
962 } 953 }
963 954
964 rc = qeth_core_hardsetup_card(card); 955 rc = qeth_core_hardsetup_card(card);
965 if (rc) { 956 if (rc) {
966 QETH_DBF_TEXT_(setup, 2, "2err%d", rc); 957 QETH_DBF_TEXT_(SETUP, 2, "2err%d", rc);
967 goto out_remove; 958 goto out_remove;
968 } 959 }
969 960
@@ -977,11 +968,11 @@ static int __qeth_l2_set_online(struct ccwgroup_device *gdev, int recovery_mode)
977 qeth_print_status_message(card); 968 qeth_print_status_message(card);
978 969
979 /* softsetup */ 970 /* softsetup */
980 QETH_DBF_TEXT(setup, 2, "softsetp"); 971 QETH_DBF_TEXT(SETUP, 2, "softsetp");
981 972
982 rc = qeth_send_startlan(card); 973 rc = qeth_send_startlan(card);
983 if (rc) { 974 if (rc) {
984 QETH_DBF_TEXT_(setup, 2, "1err%d", rc); 975 QETH_DBF_TEXT_(SETUP, 2, "1err%d", rc);
985 if (rc == 0xe080) { 976 if (rc == 0xe080) {
986 PRINT_WARN("LAN on card %s if offline! " 977 PRINT_WARN("LAN on card %s if offline! "
987 "Waiting for STARTLAN from card.\n", 978 "Waiting for STARTLAN from card.\n",
@@ -1001,7 +992,7 @@ static int __qeth_l2_set_online(struct ccwgroup_device *gdev, int recovery_mode)
1001 992
1002 rc = qeth_init_qdio_queues(card); 993 rc = qeth_init_qdio_queues(card);
1003 if (rc) { 994 if (rc) {
1004 QETH_DBF_TEXT_(setup, 2, "6err%d", rc); 995 QETH_DBF_TEXT_(SETUP, 2, "6err%d", rc);
1005 goto out_remove; 996 goto out_remove;
1006 } 997 }
1007 card->state = CARD_STATE_SOFTSETUP; 998 card->state = CARD_STATE_SOFTSETUP;
@@ -1048,8 +1039,8 @@ static int __qeth_l2_set_offline(struct ccwgroup_device *cgdev,
1048 int rc = 0, rc2 = 0, rc3 = 0; 1039 int rc = 0, rc2 = 0, rc3 = 0;
1049 enum qeth_card_states recover_flag; 1040 enum qeth_card_states recover_flag;
1050 1041
1051 QETH_DBF_TEXT(setup, 3, "setoffl"); 1042 QETH_DBF_TEXT(SETUP, 3, "setoffl");
1052 QETH_DBF_HEX(setup, 3, &card, sizeof(void *)); 1043 QETH_DBF_HEX(SETUP, 3, &card, sizeof(void *));
1053 1044
1054 if (card->dev && netif_carrier_ok(card->dev)) 1045 if (card->dev && netif_carrier_ok(card->dev))
1055 netif_carrier_off(card->dev); 1046 netif_carrier_off(card->dev);
@@ -1065,7 +1056,7 @@ static int __qeth_l2_set_offline(struct ccwgroup_device *cgdev,
1065 if (!rc) 1056 if (!rc)
1066 rc = (rc2) ? rc2 : rc3; 1057 rc = (rc2) ? rc2 : rc3;
1067 if (rc) 1058 if (rc)
1068 QETH_DBF_TEXT_(setup, 2, "1err%d", rc); 1059 QETH_DBF_TEXT_(SETUP, 2, "1err%d", rc);
1069 if (recover_flag == CARD_STATE_UP) 1060 if (recover_flag == CARD_STATE_UP)
1070 card->state = CARD_STATE_RECOVER; 1061 card->state = CARD_STATE_RECOVER;
1071 /* let user_space know that device is offline */ 1062 /* let user_space know that device is offline */
@@ -1084,11 +1075,11 @@ static int qeth_l2_recover(void *ptr)
1084 int rc = 0; 1075 int rc = 0;
1085 1076
1086 card = (struct qeth_card *) ptr; 1077 card = (struct qeth_card *) ptr;
1087 QETH_DBF_TEXT(trace, 2, "recover1"); 1078 QETH_DBF_TEXT(TRACE, 2, "recover1");
1088 QETH_DBF_HEX(trace, 2, &card, sizeof(void *)); 1079 QETH_DBF_HEX(TRACE, 2, &card, sizeof(void *));
1089 if (!qeth_do_run_thread(card, QETH_RECOVER_THREAD)) 1080 if (!qeth_do_run_thread(card, QETH_RECOVER_THREAD))
1090 return 0; 1081 return 0;
1091 QETH_DBF_TEXT(trace, 2, "recover2"); 1082 QETH_DBF_TEXT(TRACE, 2, "recover2");
1092 PRINT_WARN("Recovery of device %s started ...\n", 1083 PRINT_WARN("Recovery of device %s started ...\n",
1093 CARD_BUS_ID(card)); 1084 CARD_BUS_ID(card));
1094 card->use_hard_stop = 1; 1085 card->use_hard_stop = 1;
@@ -1139,12 +1130,12 @@ static int qeth_osn_send_control_data(struct qeth_card *card, int len,
1139 unsigned long flags; 1130 unsigned long flags;
1140 int rc = 0; 1131 int rc = 0;
1141 1132
1142 QETH_DBF_TEXT(trace, 5, "osndctrd"); 1133 QETH_DBF_TEXT(TRACE, 5, "osndctrd");
1143 1134
1144 wait_event(card->wait_q, 1135 wait_event(card->wait_q,
1145 atomic_cmpxchg(&card->write.irq_pending, 0, 1) == 0); 1136 atomic_cmpxchg(&card->write.irq_pending, 0, 1) == 0);
1146 qeth_prepare_control_data(card, len, iob); 1137 qeth_prepare_control_data(card, len, iob);
1147 QETH_DBF_TEXT(trace, 6, "osnoirqp"); 1138 QETH_DBF_TEXT(TRACE, 6, "osnoirqp");
1148 spin_lock_irqsave(get_ccwdev_lock(card->write.ccwdev), flags); 1139 spin_lock_irqsave(get_ccwdev_lock(card->write.ccwdev), flags);
1149 rc = ccw_device_start(card->write.ccwdev, &card->write.ccw, 1140 rc = ccw_device_start(card->write.ccwdev, &card->write.ccw,
1150 (addr_t) iob, 0, 0); 1141 (addr_t) iob, 0, 0);
@@ -1152,7 +1143,7 @@ static int qeth_osn_send_control_data(struct qeth_card *card, int len,
1152 if (rc) { 1143 if (rc) {
1153 PRINT_WARN("qeth_osn_send_control_data: " 1144 PRINT_WARN("qeth_osn_send_control_data: "
1154 "ccw_device_start rc = %i\n", rc); 1145 "ccw_device_start rc = %i\n", rc);
1155 QETH_DBF_TEXT_(trace, 2, " err%d", rc); 1146 QETH_DBF_TEXT_(TRACE, 2, " err%d", rc);
1156 qeth_release_buffer(iob->channel, iob); 1147 qeth_release_buffer(iob->channel, iob);
1157 atomic_set(&card->write.irq_pending, 0); 1148 atomic_set(&card->write.irq_pending, 0);
1158 wake_up(&card->wait_q); 1149 wake_up(&card->wait_q);
@@ -1165,7 +1156,7 @@ static int qeth_osn_send_ipa_cmd(struct qeth_card *card,
1165{ 1156{
1166 u16 s1, s2; 1157 u16 s1, s2;
1167 1158
1168 QETH_DBF_TEXT(trace, 4, "osndipa"); 1159 QETH_DBF_TEXT(TRACE, 4, "osndipa");
1169 1160
1170 qeth_prepare_ipa_cmd(card, iob, QETH_PROT_OSN2); 1161 qeth_prepare_ipa_cmd(card, iob, QETH_PROT_OSN2);
1171 s1 = (u16)(IPA_PDU_HEADER_SIZE + data_len); 1162 s1 = (u16)(IPA_PDU_HEADER_SIZE + data_len);
@@ -1183,7 +1174,7 @@ int qeth_osn_assist(struct net_device *dev, void *data, int data_len)
1183 struct qeth_card *card; 1174 struct qeth_card *card;
1184 int rc; 1175 int rc;
1185 1176
1186 QETH_DBF_TEXT(trace, 2, "osnsdmc"); 1177 QETH_DBF_TEXT(TRACE, 2, "osnsdmc");
1187 if (!dev) 1178 if (!dev)
1188 return -ENODEV; 1179 return -ENODEV;
1189 card = netdev_priv(dev); 1180 card = netdev_priv(dev);
@@ -1205,7 +1196,7 @@ int qeth_osn_register(unsigned char *read_dev_no, struct net_device **dev,
1205{ 1196{
1206 struct qeth_card *card; 1197 struct qeth_card *card;
1207 1198
1208 QETH_DBF_TEXT(trace, 2, "osnreg"); 1199 QETH_DBF_TEXT(TRACE, 2, "osnreg");
1209 *dev = qeth_l2_netdev_by_devno(read_dev_no); 1200 *dev = qeth_l2_netdev_by_devno(read_dev_no);
1210 if (*dev == NULL) 1201 if (*dev == NULL)
1211 return -ENODEV; 1202 return -ENODEV;
@@ -1224,7 +1215,7 @@ void qeth_osn_deregister(struct net_device *dev)
1224{ 1215{
1225 struct qeth_card *card; 1216 struct qeth_card *card;
1226 1217
1227 QETH_DBF_TEXT(trace, 2, "osndereg"); 1218 QETH_DBF_TEXT(TRACE, 2, "osndereg");
1228 if (!dev) 1219 if (!dev)
1229 return; 1220 return;
1230 card = netdev_priv(dev); 1221 card = netdev_priv(dev);