aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
authorCarsten Otte <cotte@de.ibm.com>2010-06-21 18:57:04 -0400
committerDavid S. Miller <davem@davemloft.net>2010-06-23 16:16:33 -0400
commitaf039068ca43e29d29ca1b387cb0b3e10eae3b92 (patch)
treecd0b4d36eac3f9c4355734fd75f197289295fabd /drivers/s390
parent8e96c51cb60689e1d804c4b23bc47a98a6b6efb3 (diff)
qeth: Add new s390 debug feature for each qeth card
This patch adds a debug area for each qeth card. This debug area will replace various other debug areas that are global for all cards handled by the device driver. On crash dump analysis this makes life easier when trying to find out what's going on with an interface. Also, the forest of debug areas for this device driver is significantly cleared up. Signed-off-by: Carsten Otte <cotte@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.h13
-rw-r--r--drivers/s390/net/qeth_core_main.c21
2 files changed, 31 insertions, 3 deletions
diff --git a/drivers/s390/net/qeth_core.h b/drivers/s390/net/qeth_core.h
index 0d078d4e941d..26fa5aa65209 100644
--- a/drivers/s390/net/qeth_core.h
+++ b/drivers/s390/net/qeth_core.h
@@ -73,6 +73,18 @@ struct qeth_dbf_info {
73#define QETH_DBF_TEXT_(name, level, text...) \ 73#define QETH_DBF_TEXT_(name, level, text...) \
74 qeth_dbf_longtext(qeth_dbf[QETH_DBF_##name].id, level, text) 74 qeth_dbf_longtext(qeth_dbf[QETH_DBF_##name].id, level, text)
75 75
76#define QETH_CARD_TEXT(card, level, text) \
77 debug_text_event(card->debug, level, text)
78
79#define QETH_CARD_HEX(card, level, addr, len) \
80 debug_event(card->debug, level, (void *)(addr), len)
81
82#define QETH_CARD_MESSAGE(card, text...) \
83 debug_sprintf_event(card->debug, level, text)
84
85#define QETH_CARD_TEXT_(card, level, text...) \
86 qeth_dbf_longtext(card->debug, level, text)
87
76#define SENSE_COMMAND_REJECT_BYTE 0 88#define SENSE_COMMAND_REJECT_BYTE 0
77#define SENSE_COMMAND_REJECT_FLAG 0x80 89#define SENSE_COMMAND_REJECT_FLAG 0x80
78#define SENSE_RESETTING_EVENT_BYTE 1 90#define SENSE_RESETTING_EVENT_BYTE 1
@@ -738,6 +750,7 @@ struct qeth_card {
738 atomic_t force_alloc_skb; 750 atomic_t force_alloc_skb;
739 struct service_level qeth_service_level; 751 struct service_level qeth_service_level;
740 struct qdio_ssqd_desc ssqd; 752 struct qdio_ssqd_desc ssqd;
753 debug_info_t *debug;
741 struct mutex conf_mutex; 754 struct mutex conf_mutex;
742}; 755};
743 756
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index 57770cc3d562..a06a9b79e336 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -4282,6 +4282,7 @@ static int qeth_core_probe_device(struct ccwgroup_device *gdev)
4282 struct device *dev; 4282 struct device *dev;
4283 int rc; 4283 int rc;
4284 unsigned long flags; 4284 unsigned long flags;
4285 char dbf_name[20];
4285 4286
4286 QETH_DBF_TEXT(SETUP, 2, "probedev"); 4287 QETH_DBF_TEXT(SETUP, 2, "probedev");
4287 4288
@@ -4297,6 +4298,17 @@ static int qeth_core_probe_device(struct ccwgroup_device *gdev)
4297 rc = -ENOMEM; 4298 rc = -ENOMEM;
4298 goto err_dev; 4299 goto err_dev;
4299 } 4300 }
4301
4302 snprintf(dbf_name, sizeof(dbf_name), "qeth_card_%s",
4303 dev_name(&gdev->dev));
4304 card->debug = debug_register(dbf_name, 2, 1, 8);
4305 if (!card->debug) {
4306 QETH_DBF_TEXT_(SETUP, 2, "%s", "qcdbf");
4307 rc = -ENOMEM;
4308 goto err_card;
4309 }
4310 debug_register_view(card->debug, &debug_hex_ascii_view);
4311
4300 card->read.ccwdev = gdev->cdev[0]; 4312 card->read.ccwdev = gdev->cdev[0];
4301 card->write.ccwdev = gdev->cdev[1]; 4313 card->write.ccwdev = gdev->cdev[1];
4302 card->data.ccwdev = gdev->cdev[2]; 4314 card->data.ccwdev = gdev->cdev[2];
@@ -4309,12 +4321,12 @@ static int qeth_core_probe_device(struct ccwgroup_device *gdev)
4309 rc = qeth_determine_card_type(card); 4321 rc = qeth_determine_card_type(card);
4310 if (rc) { 4322 if (rc) {
4311 QETH_DBF_TEXT_(SETUP, 2, "3err%d", rc); 4323 QETH_DBF_TEXT_(SETUP, 2, "3err%d", rc);
4312 goto err_card; 4324 goto err_dbf;
4313 } 4325 }
4314 rc = qeth_setup_card(card); 4326 rc = qeth_setup_card(card);
4315 if (rc) { 4327 if (rc) {
4316 QETH_DBF_TEXT_(SETUP, 2, "2err%d", rc); 4328 QETH_DBF_TEXT_(SETUP, 2, "2err%d", rc);
4317 goto err_card; 4329 goto err_dbf;
4318 } 4330 }
4319 4331
4320 if (card->info.type == QETH_CARD_TYPE_OSN) 4332 if (card->info.type == QETH_CARD_TYPE_OSN)
@@ -4322,7 +4334,7 @@ static int qeth_core_probe_device(struct ccwgroup_device *gdev)
4322 else 4334 else
4323 rc = qeth_core_create_device_attributes(dev); 4335 rc = qeth_core_create_device_attributes(dev);
4324 if (rc) 4336 if (rc)
4325 goto err_card; 4337 goto err_dbf;
4326 switch (card->info.type) { 4338 switch (card->info.type) {
4327 case QETH_CARD_TYPE_OSN: 4339 case QETH_CARD_TYPE_OSN:
4328 case QETH_CARD_TYPE_OSM: 4340 case QETH_CARD_TYPE_OSM:
@@ -4352,6 +4364,8 @@ err_attr:
4352 qeth_core_remove_osn_attributes(dev); 4364 qeth_core_remove_osn_attributes(dev);
4353 else 4365 else
4354 qeth_core_remove_device_attributes(dev); 4366 qeth_core_remove_device_attributes(dev);
4367err_dbf:
4368 debug_unregister(card->debug);
4355err_card: 4369err_card:
4356 qeth_core_free_card(card); 4370 qeth_core_free_card(card);
4357err_dev: 4371err_dev:
@@ -4375,6 +4389,7 @@ static void qeth_core_remove_device(struct ccwgroup_device *gdev)
4375 } else { 4389 } else {
4376 qeth_core_remove_device_attributes(&gdev->dev); 4390 qeth_core_remove_device_attributes(&gdev->dev);
4377 } 4391 }
4392 debug_unregister(card->debug);
4378 write_lock_irqsave(&qeth_core_card_list.rwlock, flags); 4393 write_lock_irqsave(&qeth_core_card_list.rwlock, flags);
4379 list_del(&card->list); 4394 list_del(&card->list);
4380 write_unlock_irqrestore(&qeth_core_card_list.rwlock, flags); 4395 write_unlock_irqrestore(&qeth_core_card_list.rwlock, flags);