aboutsummaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--drivers/s390/net/ctcm_fsms.c46
-rw-r--r--drivers/s390/net/ctcm_main.c72
-rw-r--r--drivers/s390/net/ctcm_main.h6
-rw-r--r--drivers/s390/net/ctcm_mpc.c15
-rw-r--r--drivers/s390/net/ctcm_sysfs.c3
5 files changed, 86 insertions, 56 deletions
diff --git a/drivers/s390/net/ctcm_fsms.c b/drivers/s390/net/ctcm_fsms.c
index 42776550acfd..f29c7086fc19 100644
--- a/drivers/s390/net/ctcm_fsms.c
+++ b/drivers/s390/net/ctcm_fsms.c
@@ -13,6 +13,9 @@
13#undef DEBUGDATA 13#undef DEBUGDATA
14#undef DEBUGCCW 14#undef DEBUGCCW
15 15
16#define KMSG_COMPONENT "ctcm"
17#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
18
16#include <linux/module.h> 19#include <linux/module.h>
17#include <linux/init.h> 20#include <linux/init.h>
18#include <linux/kernel.h> 21#include <linux/kernel.h>
@@ -190,21 +193,22 @@ static void ctcmpc_chx_send_sweep(fsm_instance *fsm, int event, void *arg);
190void ctcm_ccw_check_rc(struct channel *ch, int rc, char *msg) 193void ctcm_ccw_check_rc(struct channel *ch, int rc, char *msg)
191{ 194{
192 CTCM_DBF_TEXT_(ERROR, CTC_DBF_ERROR, 195 CTCM_DBF_TEXT_(ERROR, CTC_DBF_ERROR,
193 "%s(%s): %s: %04x\n", 196 "%s(%s): %s: %04x\n",
194 CTCM_FUNTAIL, ch->id, msg, rc); 197 CTCM_FUNTAIL, ch->id, msg, rc);
195 switch (rc) { 198 switch (rc) {
196 case -EBUSY: 199 case -EBUSY:
197 ctcm_pr_warn("%s (%s): Busy !\n", ch->id, msg); 200 pr_info("%s: The communication peer is busy\n",
201 ch->id);
198 fsm_event(ch->fsm, CTC_EVENT_IO_EBUSY, ch); 202 fsm_event(ch->fsm, CTC_EVENT_IO_EBUSY, ch);
199 break; 203 break;
200 case -ENODEV: 204 case -ENODEV:
201 ctcm_pr_emerg("%s (%s): Invalid device called for IO\n", 205 pr_err("%s: The specified target device is not valid\n",
202 ch->id, msg); 206 ch->id);
203 fsm_event(ch->fsm, CTC_EVENT_IO_ENODEV, ch); 207 fsm_event(ch->fsm, CTC_EVENT_IO_ENODEV, ch);
204 break; 208 break;
205 default: 209 default:
206 ctcm_pr_emerg("%s (%s): Unknown error in do_IO %04x\n", 210 pr_err("An I/O operation resulted in error %04x\n",
207 ch->id, msg, rc); 211 rc);
208 fsm_event(ch->fsm, CTC_EVENT_IO_UNKNOWN, ch); 212 fsm_event(ch->fsm, CTC_EVENT_IO_UNKNOWN, ch);
209 } 213 }
210} 214}
@@ -886,8 +890,15 @@ static void ctcm_chx_rxiniterr(fsm_instance *fi, int event, void *arg)
886 fsm_newstate(fi, CTC_STATE_RXERR); 890 fsm_newstate(fi, CTC_STATE_RXERR);
887 fsm_event(priv->fsm, DEV_EVENT_RXDOWN, dev); 891 fsm_event(priv->fsm, DEV_EVENT_RXDOWN, dev);
888 } 892 }
889 } else 893 } else {
890 ctcm_pr_warn("%s: Error during RX init handshake\n", dev->name); 894 CTCM_DBF_TEXT_(ERROR, CTC_DBF_ERROR,
895 "%s(%s): %s in %s", CTCM_FUNTAIL, ch->id,
896 ctc_ch_event_names[event], fsm_getstate_str(fi));
897
898 dev_warn(&dev->dev,
899 "Initialization failed with RX/TX init handshake "
900 "error %s\n", ctc_ch_event_names[event]);
901 }
891} 902}
892 903
893/** 904/**
@@ -969,7 +980,9 @@ static void ctcm_chx_txiniterr(fsm_instance *fi, int event, void *arg)
969 "%s(%s): %s in %s", CTCM_FUNTAIL, ch->id, 980 "%s(%s): %s in %s", CTCM_FUNTAIL, ch->id,
970 ctc_ch_event_names[event], fsm_getstate_str(fi)); 981 ctc_ch_event_names[event], fsm_getstate_str(fi));
971 982
972 ctcm_pr_warn("%s: Error during TX init handshake\n", dev->name); 983 dev_warn(&dev->dev,
984 "Initialization failed with RX/TX init handshake "
985 "error %s\n", ctc_ch_event_names[event]);
973 } 986 }
974} 987}
975 988
@@ -2101,14 +2114,11 @@ static void dev_action_restart(fsm_instance *fi, int event, void *arg)
2101 CTCMY_DBF_DEV_NAME(TRACE, dev, ""); 2114 CTCMY_DBF_DEV_NAME(TRACE, dev, "");
2102 2115
2103 if (IS_MPC(priv)) { 2116 if (IS_MPC(priv)) {
2104 ctcm_pr_info("ctcm: %s Restarting Device and "
2105 "MPC Group in 5 seconds\n",
2106 dev->name);
2107 restart_timer = CTCM_TIME_1_SEC; 2117 restart_timer = CTCM_TIME_1_SEC;
2108 } else { 2118 } else {
2109 ctcm_pr_info("%s: Restarting\n", dev->name);
2110 restart_timer = CTCM_TIME_5_SEC; 2119 restart_timer = CTCM_TIME_5_SEC;
2111 } 2120 }
2121 dev_info(&dev->dev, "Restarting device\n");
2112 2122
2113 dev_action_stop(fi, event, arg); 2123 dev_action_stop(fi, event, arg);
2114 fsm_event(priv->fsm, DEV_EVENT_STOP, dev); 2124 fsm_event(priv->fsm, DEV_EVENT_STOP, dev);
@@ -2150,16 +2160,16 @@ static void dev_action_chup(fsm_instance *fi, int event, void *arg)
2150 case DEV_STATE_STARTWAIT_RX: 2160 case DEV_STATE_STARTWAIT_RX:
2151 if (event == DEV_EVENT_RXUP) { 2161 if (event == DEV_EVENT_RXUP) {
2152 fsm_newstate(fi, DEV_STATE_RUNNING); 2162 fsm_newstate(fi, DEV_STATE_RUNNING);
2153 ctcm_pr_info("%s: connected with remote side\n", 2163 dev_info(&dev->dev,
2154 dev->name); 2164 "Connected with remote side\n");
2155 ctcm_clear_busy(dev); 2165 ctcm_clear_busy(dev);
2156 } 2166 }
2157 break; 2167 break;
2158 case DEV_STATE_STARTWAIT_TX: 2168 case DEV_STATE_STARTWAIT_TX:
2159 if (event == DEV_EVENT_TXUP) { 2169 if (event == DEV_EVENT_TXUP) {
2160 fsm_newstate(fi, DEV_STATE_RUNNING); 2170 fsm_newstate(fi, DEV_STATE_RUNNING);
2161 ctcm_pr_info("%s: connected with remote side\n", 2171 dev_info(&dev->dev,
2162 dev->name); 2172 "Connected with remote side\n");
2163 ctcm_clear_busy(dev); 2173 ctcm_clear_busy(dev);
2164 } 2174 }
2165 break; 2175 break;
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();
diff --git a/drivers/s390/net/ctcm_main.h b/drivers/s390/net/ctcm_main.h
index d77cce3fe4d4..d925e732b7d8 100644
--- a/drivers/s390/net/ctcm_main.h
+++ b/drivers/s390/net/ctcm_main.h
@@ -41,12 +41,6 @@
41#define LOG_FLAG_NOMEM 8 41#define LOG_FLAG_NOMEM 8
42 42
43#define ctcm_pr_debug(fmt, arg...) printk(KERN_DEBUG fmt, ##arg) 43#define ctcm_pr_debug(fmt, arg...) printk(KERN_DEBUG fmt, ##arg)
44#define ctcm_pr_info(fmt, arg...) printk(KERN_INFO fmt, ##arg)
45#define ctcm_pr_notice(fmt, arg...) printk(KERN_NOTICE fmt, ##arg)
46#define ctcm_pr_warn(fmt, arg...) printk(KERN_WARNING fmt, ##arg)
47#define ctcm_pr_emerg(fmt, arg...) printk(KERN_EMERG fmt, ##arg)
48#define ctcm_pr_err(fmt, arg...) printk(KERN_ERR fmt, ##arg)
49#define ctcm_pr_crit(fmt, arg...) printk(KERN_CRIT fmt, ##arg)
50 44
51#define CTCM_PR_DEBUG(fmt, arg...) \ 45#define CTCM_PR_DEBUG(fmt, arg...) \
52 do { \ 46 do { \
diff --git a/drivers/s390/net/ctcm_mpc.c b/drivers/s390/net/ctcm_mpc.c
index 19f5d5ed85e0..3db5f846bbf6 100644
--- a/drivers/s390/net/ctcm_mpc.c
+++ b/drivers/s390/net/ctcm_mpc.c
@@ -19,6 +19,9 @@
19#undef DEBUGDATA 19#undef DEBUGDATA
20#undef DEBUGCCW 20#undef DEBUGCCW
21 21
22#define KMSG_COMPONENT "ctcm"
23#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
24
22#include <linux/module.h> 25#include <linux/module.h>
23#include <linux/init.h> 26#include <linux/init.h>
24#include <linux/kernel.h> 27#include <linux/kernel.h>
@@ -386,7 +389,7 @@ int ctc_mpc_alloc_channel(int port_num, void (*callback)(int, int))
386 if (grp->allocchan_callback_retries < 4) { 389 if (grp->allocchan_callback_retries < 4) {
387 if (grp->allochanfunc) 390 if (grp->allochanfunc)
388 grp->allochanfunc(grp->port_num, 391 grp->allochanfunc(grp->port_num,
389 grp->group_max_buflen); 392 grp->group_max_buflen);
390 } else { 393 } else {
391 /* there are problems...bail out */ 394 /* there are problems...bail out */
392 /* there may be a state mismatch so restart */ 395 /* there may be a state mismatch so restart */
@@ -1232,8 +1235,9 @@ done:
1232 1235
1233 dev_kfree_skb_any(pskb); 1236 dev_kfree_skb_any(pskb);
1234 if (sendrc == NET_RX_DROP) { 1237 if (sendrc == NET_RX_DROP) {
1235 printk(KERN_WARNING "%s %s() NETWORK BACKLOG EXCEEDED" 1238 dev_warn(&dev->dev,
1236 " - PACKET DROPPED\n", dev->name, __func__); 1239 "The network backlog for %s is exceeded, "
1240 "package dropped\n", __func__);
1237 fsm_event(grp->fsm, MPCG_EVENT_INOP, dev); 1241 fsm_event(grp->fsm, MPCG_EVENT_INOP, dev);
1238 } 1242 }
1239 1243
@@ -1670,10 +1674,11 @@ static int mpc_validate_xid(struct mpcg_info *mpcginfo)
1670 CTCM_FUNTAIL, ch->id); 1674 CTCM_FUNTAIL, ch->id);
1671 } 1675 }
1672 } 1676 }
1673
1674done: 1677done:
1675 if (rc) { 1678 if (rc) {
1676 ctcm_pr_info("ctcmpc : %s() failed\n", __func__); 1679 dev_warn(&dev->dev,
1680 "The XID used in the MPC protocol is not valid, "
1681 "rc = %d\n", rc);
1677 priv->xid->xid2_flag2 = 0x40; 1682 priv->xid->xid2_flag2 = 0x40;
1678 grp->saved_xid2->xid2_flag2 = 0x40; 1683 grp->saved_xid2->xid2_flag2 = 0x40;
1679 } 1684 }
diff --git a/drivers/s390/net/ctcm_sysfs.c b/drivers/s390/net/ctcm_sysfs.c
index bb2d13721d34..8452bb052d68 100644
--- a/drivers/s390/net/ctcm_sysfs.c
+++ b/drivers/s390/net/ctcm_sysfs.c
@@ -10,6 +10,9 @@
10#undef DEBUGDATA 10#undef DEBUGDATA
11#undef DEBUGCCW 11#undef DEBUGCCW
12 12
13#define KMSG_COMPONENT "ctcm"
14#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
15
13#include <linux/sysfs.h> 16#include <linux/sysfs.h>
14#include "ctcm_main.h" 17#include "ctcm_main.h"
15 18