aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/net/ctcm_main.c
diff options
context:
space:
mode:
authorPeter Tiedemann <ptiedem@de.ibm.com>2008-12-25 07:39:54 -0500
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2008-12-25 07:39:27 -0500
commit2a7c6f2c39d1291e55403676b25fcfbff78fc5fb (patch)
treeb37f40a4f4b582e9e3eafa8da923a098c62a7c09 /drivers/s390/net/ctcm_main.c
parentecf39d42129767c0b4b4a6cf4997c1219c860934 (diff)
[S390] convert ctcm printks to dev_xxx and pr_xxx macros.
Signed-off-by: Peter Tiedemann <ptiedem@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/net/ctcm_main.c')
-rw-r--r--drivers/s390/net/ctcm_main.c72
1 files changed, 45 insertions, 27 deletions
diff --git a/drivers/s390/net/ctcm_main.c b/drivers/s390/net/ctcm_main.c
index a4e29836a2aa..2678573becec 100644
--- a/drivers/s390/net/ctcm_main.c
+++ b/drivers/s390/net/ctcm_main.c
@@ -21,6 +21,9 @@
21#undef DEBUGDATA 21#undef DEBUGDATA
22#undef DEBUGCCW 22#undef DEBUGCCW
23 23
24#define KMSG_COMPONENT "ctcm"
25#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
26
24#include <linux/module.h> 27#include <linux/module.h>
25#include <linux/init.h> 28#include <linux/init.h>
26#include <linux/kernel.h> 29#include <linux/kernel.h>
@@ -281,14 +284,16 @@ static long ctcm_check_irb_error(struct ccw_device *cdev, struct irb *irb)
281 284
282 switch (PTR_ERR(irb)) { 285 switch (PTR_ERR(irb)) {
283 case -EIO: 286 case -EIO:
284 ctcm_pr_warn("i/o-error on device %s\n", dev_name(&cdev->dev)); 287 dev_err(&cdev->dev,
288 "An I/O-error occurred on the CTCM device\n");
285 break; 289 break;
286 case -ETIMEDOUT: 290 case -ETIMEDOUT:
287 ctcm_pr_warn("timeout on device %s\n", dev_name(&cdev->dev)); 291 dev_err(&cdev->dev,
292 "An adapter hardware operation timed out\n");
288 break; 293 break;
289 default: 294 default:
290 ctcm_pr_warn("unknown error %ld on device %s\n", 295 dev_err(&cdev->dev,
291 PTR_ERR(irb), dev_name(&cdev->dev)); 296 "An error occurred on the adapter hardware\n");
292 } 297 }
293 return PTR_ERR(irb); 298 return PTR_ERR(irb);
294} 299}
@@ -309,15 +314,17 @@ static inline void ccw_unit_check(struct channel *ch, __u8 sense)
309 if (sense & SNS0_INTERVENTION_REQ) { 314 if (sense & SNS0_INTERVENTION_REQ) {
310 if (sense & 0x01) { 315 if (sense & 0x01) {
311 if (ch->sense_rc != 0x01) { 316 if (ch->sense_rc != 0x01) {
312 ctcm_pr_debug("%s: Interface disc. or Sel. " 317 pr_notice(
313 "reset (remote)\n", ch->id); 318 "%s: The communication peer has "
319 "disconnected\n", ch->id);
314 ch->sense_rc = 0x01; 320 ch->sense_rc = 0x01;
315 } 321 }
316 fsm_event(ch->fsm, CTC_EVENT_UC_RCRESET, ch); 322 fsm_event(ch->fsm, CTC_EVENT_UC_RCRESET, ch);
317 } else { 323 } else {
318 if (ch->sense_rc != SNS0_INTERVENTION_REQ) { 324 if (ch->sense_rc != SNS0_INTERVENTION_REQ) {
319 ctcm_pr_debug("%s: System reset (remote)\n", 325 pr_notice(
320 ch->id); 326 "%s: The remote operating system is "
327 "not available\n", ch->id);
321 ch->sense_rc = SNS0_INTERVENTION_REQ; 328 ch->sense_rc = SNS0_INTERVENTION_REQ;
322 } 329 }
323 fsm_event(ch->fsm, CTC_EVENT_UC_RSRESET, ch); 330 fsm_event(ch->fsm, CTC_EVENT_UC_RSRESET, ch);
@@ -1194,8 +1201,11 @@ static void ctcm_irq_handler(struct ccw_device *cdev,
1194 1201
1195 /* Check for unsolicited interrupts. */ 1202 /* Check for unsolicited interrupts. */
1196 if (cgdev == NULL) { 1203 if (cgdev == NULL) {
1197 ctcm_pr_warn("ctcm: Got unsolicited irq: c-%02x d-%02x\n", 1204 CTCM_DBF_TEXT_(TRACE, CTC_DBF_ERROR,
1198 cstat, dstat); 1205 "%s(%s) unsolicited irq: c-%02x d-%02x\n",
1206 CTCM_FUNTAIL, dev_name(&cdev->dev), cstat, dstat);
1207 dev_warn(&cdev->dev,
1208 "The adapter received a non-specific IRQ\n");
1199 return; 1209 return;
1200 } 1210 }
1201 1211
@@ -1207,31 +1217,34 @@ static void ctcm_irq_handler(struct ccw_device *cdev,
1207 else if (priv->channel[WRITE]->cdev == cdev) 1217 else if (priv->channel[WRITE]->cdev == cdev)
1208 ch = priv->channel[WRITE]; 1218 ch = priv->channel[WRITE];
1209 else { 1219 else {
1210 ctcm_pr_err("ctcm: Can't determine channel for interrupt, " 1220 dev_err(&cdev->dev,
1211 "device %s\n", dev_name(&cdev->dev)); 1221 "%s: Internal error: Can't determine channel for "
1222 "interrupt device %s\n",
1223 __func__, dev_name(&cdev->dev));
1224 /* Explain: inconsistent internal structures */
1212 return; 1225 return;
1213 } 1226 }
1214 1227
1215 dev = ch->netdev; 1228 dev = ch->netdev;
1216 if (dev == NULL) { 1229 if (dev == NULL) {
1217 ctcm_pr_crit("ctcm: %s dev=NULL bus_id=%s, ch=0x%p\n", 1230 dev_err(&cdev->dev,
1218 __func__, dev_name(&cdev->dev), ch); 1231 "%s Internal error: net_device is NULL, ch = 0x%p\n",
1232 __func__, ch);
1233 /* Explain: inconsistent internal structures */
1219 return; 1234 return;
1220 } 1235 }
1221 1236
1222 CTCM_DBF_TEXT_(TRACE, CTC_DBF_DEBUG,
1223 "%s(%s): int. for %s: cstat=%02x dstat=%02x",
1224 CTCM_FUNTAIL, dev->name, ch->id, cstat, dstat);
1225
1226 /* Copy interruption response block. */ 1237 /* Copy interruption response block. */
1227 memcpy(ch->irb, irb, sizeof(struct irb)); 1238 memcpy(ch->irb, irb, sizeof(struct irb));
1228 1239
1240 /* Issue error message and return on subchannel error code */
1229 if (irb->scsw.cmd.cstat) { 1241 if (irb->scsw.cmd.cstat) {
1230 /* Check for good subchannel return code, otherwise error message */
1231 fsm_event(ch->fsm, CTC_EVENT_SC_UNKNOWN, ch); 1242 fsm_event(ch->fsm, CTC_EVENT_SC_UNKNOWN, ch);
1232 ctcm_pr_warn("%s: subchannel check for dev: %s - %02x %02x\n", 1243 CTCM_DBF_TEXT_(TRACE, CTC_DBF_WARN,
1233 dev->name, ch->id, irb->scsw.cmd.cstat, 1244 "%s(%s): sub-ch check %s: cs=%02x ds=%02x",
1234 irb->scsw.cmd.dstat); 1245 CTCM_FUNTAIL, dev->name, ch->id, cstat, dstat);
1246 dev_warn(&cdev->dev,
1247 "A check occurred on the subchannel\n");
1235 return; 1248 return;
1236 } 1249 }
1237 1250
@@ -1239,7 +1252,7 @@ static void ctcm_irq_handler(struct ccw_device *cdev,
1239 if (irb->scsw.cmd.dstat & DEV_STAT_UNIT_CHECK) { 1252 if (irb->scsw.cmd.dstat & DEV_STAT_UNIT_CHECK) {
1240 if ((irb->ecw[0] & ch->sense_rc) == 0) 1253 if ((irb->ecw[0] & ch->sense_rc) == 0)
1241 /* print it only once */ 1254 /* print it only once */
1242 CTCM_DBF_TEXT_(TRACE, CTC_DBF_INFO, 1255 CTCM_DBF_TEXT_(TRACE, CTC_DBF_WARN,
1243 "%s(%s): sense=%02x, ds=%02x", 1256 "%s(%s): sense=%02x, ds=%02x",
1244 CTCM_FUNTAIL, ch->id, irb->ecw[0], dstat); 1257 CTCM_FUNTAIL, ch->id, irb->ecw[0], dstat);
1245 ccw_unit_check(ch, irb->ecw[0]); 1258 ccw_unit_check(ch, irb->ecw[0]);
@@ -1574,6 +1587,11 @@ static int ctcm_new_device(struct ccwgroup_device *cgdev)
1574 1587
1575 strlcpy(priv->fsm->name, dev->name, sizeof(priv->fsm->name)); 1588 strlcpy(priv->fsm->name, dev->name, sizeof(priv->fsm->name));
1576 1589
1590 dev_info(&dev->dev,
1591 "setup OK : r/w = %s/%s, protocol : %d\n",
1592 priv->channel[READ]->id,
1593 priv->channel[WRITE]->id, priv->protocol);
1594
1577 CTCM_DBF_TEXT_(SETUP, CTC_DBF_INFO, 1595 CTCM_DBF_TEXT_(SETUP, CTC_DBF_INFO,
1578 "setup(%s) OK : r/w = %s/%s, protocol : %d", dev->name, 1596 "setup(%s) OK : r/w = %s/%s, protocol : %d", dev->name,
1579 priv->channel[READ]->id, 1597 priv->channel[READ]->id,
@@ -1687,7 +1705,7 @@ static void __exit ctcm_exit(void)
1687{ 1705{
1688 unregister_cu3088_discipline(&ctcm_group_driver); 1706 unregister_cu3088_discipline(&ctcm_group_driver);
1689 ctcm_unregister_dbf_views(); 1707 ctcm_unregister_dbf_views();
1690 ctcm_pr_info("CTCM driver unloaded\n"); 1708 pr_info("CTCM driver unloaded\n");
1691} 1709}
1692 1710
1693/* 1711/*
@@ -1695,7 +1713,7 @@ static void __exit ctcm_exit(void)
1695 */ 1713 */
1696static void print_banner(void) 1714static void print_banner(void)
1697{ 1715{
1698 printk(KERN_INFO "CTCM driver initialized\n"); 1716 pr_info("CTCM driver initialized\n");
1699} 1717}
1700 1718
1701/** 1719/**
@@ -1717,8 +1735,8 @@ static int __init ctcm_init(void)
1717 ret = register_cu3088_discipline(&ctcm_group_driver); 1735 ret = register_cu3088_discipline(&ctcm_group_driver);
1718 if (ret) { 1736 if (ret) {
1719 ctcm_unregister_dbf_views(); 1737 ctcm_unregister_dbf_views();
1720 ctcm_pr_crit("ctcm_init failed with register_cu3088_discipline " 1738 pr_err("%s / register_cu3088_discipline failed, ret = %d\n",
1721 "(rc = %d)\n", ret); 1739 __func__, ret);
1722 return ret; 1740 return ret;
1723 } 1741 }
1724 print_banner(); 1742 print_banner();