Commit af039068 authored by Carsten Otte's avatar Carsten Otte Committed by David S. Miller

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: default avatarCarsten Otte <cotte@de.ibm.com>
Signed-off-by: default avatarFrank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8e96c51c
...@@ -73,6 +73,18 @@ struct qeth_dbf_info { ...@@ -73,6 +73,18 @@ struct qeth_dbf_info {
#define QETH_DBF_TEXT_(name, level, text...) \ #define QETH_DBF_TEXT_(name, level, text...) \
qeth_dbf_longtext(qeth_dbf[QETH_DBF_##name].id, level, text) qeth_dbf_longtext(qeth_dbf[QETH_DBF_##name].id, level, text)
#define QETH_CARD_TEXT(card, level, text) \
debug_text_event(card->debug, level, text)
#define QETH_CARD_HEX(card, level, addr, len) \
debug_event(card->debug, level, (void *)(addr), len)
#define QETH_CARD_MESSAGE(card, text...) \
debug_sprintf_event(card->debug, level, text)
#define QETH_CARD_TEXT_(card, level, text...) \
qeth_dbf_longtext(card->debug, level, text)
#define SENSE_COMMAND_REJECT_BYTE 0 #define SENSE_COMMAND_REJECT_BYTE 0
#define SENSE_COMMAND_REJECT_FLAG 0x80 #define SENSE_COMMAND_REJECT_FLAG 0x80
#define SENSE_RESETTING_EVENT_BYTE 1 #define SENSE_RESETTING_EVENT_BYTE 1
...@@ -738,6 +750,7 @@ struct qeth_card { ...@@ -738,6 +750,7 @@ struct qeth_card {
atomic_t force_alloc_skb; atomic_t force_alloc_skb;
struct service_level qeth_service_level; struct service_level qeth_service_level;
struct qdio_ssqd_desc ssqd; struct qdio_ssqd_desc ssqd;
debug_info_t *debug;
struct mutex conf_mutex; struct mutex conf_mutex;
}; };
......
...@@ -4282,6 +4282,7 @@ static int qeth_core_probe_device(struct ccwgroup_device *gdev) ...@@ -4282,6 +4282,7 @@ static int qeth_core_probe_device(struct ccwgroup_device *gdev)
struct device *dev; struct device *dev;
int rc; int rc;
unsigned long flags; unsigned long flags;
char dbf_name[20];
QETH_DBF_TEXT(SETUP, 2, "probedev"); QETH_DBF_TEXT(SETUP, 2, "probedev");
...@@ -4297,6 +4298,17 @@ static int qeth_core_probe_device(struct ccwgroup_device *gdev) ...@@ -4297,6 +4298,17 @@ static int qeth_core_probe_device(struct ccwgroup_device *gdev)
rc = -ENOMEM; rc = -ENOMEM;
goto err_dev; goto err_dev;
} }
snprintf(dbf_name, sizeof(dbf_name), "qeth_card_%s",
dev_name(&gdev->dev));
card->debug = debug_register(dbf_name, 2, 1, 8);
if (!card->debug) {
QETH_DBF_TEXT_(SETUP, 2, "%s", "qcdbf");
rc = -ENOMEM;
goto err_card;
}
debug_register_view(card->debug, &debug_hex_ascii_view);
card->read.ccwdev = gdev->cdev[0]; card->read.ccwdev = gdev->cdev[0];
card->write.ccwdev = gdev->cdev[1]; card->write.ccwdev = gdev->cdev[1];
card->data.ccwdev = gdev->cdev[2]; card->data.ccwdev = gdev->cdev[2];
...@@ -4309,12 +4321,12 @@ static int qeth_core_probe_device(struct ccwgroup_device *gdev) ...@@ -4309,12 +4321,12 @@ static int qeth_core_probe_device(struct ccwgroup_device *gdev)
rc = qeth_determine_card_type(card); rc = qeth_determine_card_type(card);
if (rc) { if (rc) {
QETH_DBF_TEXT_(SETUP, 2, "3err%d", rc); QETH_DBF_TEXT_(SETUP, 2, "3err%d", rc);
goto err_card; goto err_dbf;
} }
rc = qeth_setup_card(card); rc = qeth_setup_card(card);
if (rc) { if (rc) {
QETH_DBF_TEXT_(SETUP, 2, "2err%d", rc); QETH_DBF_TEXT_(SETUP, 2, "2err%d", rc);
goto err_card; goto err_dbf;
} }
if (card->info.type == QETH_CARD_TYPE_OSN) if (card->info.type == QETH_CARD_TYPE_OSN)
...@@ -4322,7 +4334,7 @@ static int qeth_core_probe_device(struct ccwgroup_device *gdev) ...@@ -4322,7 +4334,7 @@ static int qeth_core_probe_device(struct ccwgroup_device *gdev)
else else
rc = qeth_core_create_device_attributes(dev); rc = qeth_core_create_device_attributes(dev);
if (rc) if (rc)
goto err_card; goto err_dbf;
switch (card->info.type) { switch (card->info.type) {
case QETH_CARD_TYPE_OSN: case QETH_CARD_TYPE_OSN:
case QETH_CARD_TYPE_OSM: case QETH_CARD_TYPE_OSM:
...@@ -4352,6 +4364,8 @@ static int qeth_core_probe_device(struct ccwgroup_device *gdev) ...@@ -4352,6 +4364,8 @@ static int qeth_core_probe_device(struct ccwgroup_device *gdev)
qeth_core_remove_osn_attributes(dev); qeth_core_remove_osn_attributes(dev);
else else
qeth_core_remove_device_attributes(dev); qeth_core_remove_device_attributes(dev);
err_dbf:
debug_unregister(card->debug);
err_card: err_card:
qeth_core_free_card(card); qeth_core_free_card(card);
err_dev: err_dev:
...@@ -4375,6 +4389,7 @@ static void qeth_core_remove_device(struct ccwgroup_device *gdev) ...@@ -4375,6 +4389,7 @@ static void qeth_core_remove_device(struct ccwgroup_device *gdev)
} else { } else {
qeth_core_remove_device_attributes(&gdev->dev); qeth_core_remove_device_attributes(&gdev->dev);
} }
debug_unregister(card->debug);
write_lock_irqsave(&qeth_core_card_list.rwlock, flags); write_lock_irqsave(&qeth_core_card_list.rwlock, flags);
list_del(&card->list); list_del(&card->list);
write_unlock_irqrestore(&qeth_core_card_list.rwlock, flags); write_unlock_irqrestore(&qeth_core_card_list.rwlock, flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment