aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKlaus-D. Wacker <kdwacker@de.ibm.com>2008-12-25 07:39:33 -0500
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2008-12-25 07:39:18 -0500
commitc99fc5dadcd87e8b97613f50c48407678b731cfb (patch)
tree35f3f6c6804a2eac4c11e94ba6a068b2997b7892
parent8988e58f8b7d4b5e8b64435bedf84e4b3987a63d (diff)
[S390] convert lcs printks to dev_xxx and pr_xxx macros.
Signed-off-by: Klaus-D. Wacker <kdwacker@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r--drivers/s390/net/lcs.c92
1 files changed, 53 insertions, 39 deletions
diff --git a/drivers/s390/net/lcs.c b/drivers/s390/net/lcs.c
index 0825be87e5a0..fb6c70cec253 100644
--- a/drivers/s390/net/lcs.c
+++ b/drivers/s390/net/lcs.c
@@ -26,6 +26,9 @@
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27 */ 27 */
28 28
29#define KMSG_COMPONENT "lcs"
30#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
31
29#include <linux/module.h> 32#include <linux/module.h>
30#include <linux/if.h> 33#include <linux/if.h>
31#include <linux/netdevice.h> 34#include <linux/netdevice.h>
@@ -54,8 +57,6 @@
54#error Cannot compile lcs.c without some net devices switched on. 57#error Cannot compile lcs.c without some net devices switched on.
55#endif 58#endif
56 59
57#define PRINTK_HEADER " lcs: "
58
59/** 60/**
60 * initialization string for output 61 * initialization string for output
61 */ 62 */
@@ -96,7 +97,7 @@ lcs_register_debug_facility(void)
96 lcs_dbf_setup = debug_register("lcs_setup", 2, 1, 8); 97 lcs_dbf_setup = debug_register("lcs_setup", 2, 1, 8);
97 lcs_dbf_trace = debug_register("lcs_trace", 4, 1, 8); 98 lcs_dbf_trace = debug_register("lcs_trace", 4, 1, 8);
98 if (lcs_dbf_setup == NULL || lcs_dbf_trace == NULL) { 99 if (lcs_dbf_setup == NULL || lcs_dbf_trace == NULL) {
99 PRINT_ERR("Not enough memory for debug facility.\n"); 100 pr_err("Not enough memory for debug facility.\n");
100 lcs_unregister_debug_facility(); 101 lcs_unregister_debug_facility();
101 return -ENOMEM; 102 return -ENOMEM;
102 } 103 }
@@ -503,7 +504,9 @@ lcs_start_channel(struct lcs_channel *channel)
503 if (rc) { 504 if (rc) {
504 LCS_DBF_TEXT_(4,trace,"essh%s", 505 LCS_DBF_TEXT_(4,trace,"essh%s",
505 dev_name(&channel->ccwdev->dev)); 506 dev_name(&channel->ccwdev->dev));
506 PRINT_ERR("Error in starting channel, rc=%d!\n", rc); 507 dev_err(&channel->ccwdev->dev,
508 "Starting an LCS device resulted in an error,"
509 " rc=%d!\n", rc);
507 } 510 }
508 return rc; 511 return rc;
509} 512}
@@ -640,7 +643,9 @@ __lcs_resume_channel(struct lcs_channel *channel)
640 if (rc) { 643 if (rc) {
641 LCS_DBF_TEXT_(4, trace, "ersc%s", 644 LCS_DBF_TEXT_(4, trace, "ersc%s",
642 dev_name(&channel->ccwdev->dev)); 645 dev_name(&channel->ccwdev->dev));
643 PRINT_ERR("Error in lcs_resume_channel: rc=%d\n",rc); 646 dev_err(&channel->ccwdev->dev,
647 "Sending data from the LCS device to the LAN failed"
648 " with rc=%d\n",rc);
644 } else 649 } else
645 channel->state = LCS_CH_STATE_RUNNING; 650 channel->state = LCS_CH_STATE_RUNNING;
646 return rc; 651 return rc;
@@ -1086,7 +1091,7 @@ lcs_check_multicast_support(struct lcs_card *card)
1086 cmd->cmd.lcs_qipassist.num_ip_pairs = 1; 1091 cmd->cmd.lcs_qipassist.num_ip_pairs = 1;
1087 rc = lcs_send_lancmd(card, buffer, __lcs_check_multicast_cb); 1092 rc = lcs_send_lancmd(card, buffer, __lcs_check_multicast_cb);
1088 if (rc != 0) { 1093 if (rc != 0) {
1089 PRINT_ERR("Query IPAssist failed. Assuming unsupported!\n"); 1094 pr_err("Query IPAssist failed. Assuming unsupported!\n");
1090 return -EOPNOTSUPP; 1095 return -EOPNOTSUPP;
1091 } 1096 }
1092 if (card->ip_assists_supported & LCS_IPASS_MULTICAST_SUPPORT) 1097 if (card->ip_assists_supported & LCS_IPASS_MULTICAST_SUPPORT)
@@ -1119,8 +1124,8 @@ list_modified:
1119 rc = lcs_send_setipm(card, ipm); 1124 rc = lcs_send_setipm(card, ipm);
1120 spin_lock_irqsave(&card->ipm_lock, flags); 1125 spin_lock_irqsave(&card->ipm_lock, flags);
1121 if (rc) { 1126 if (rc) {
1122 PRINT_INFO("Adding multicast address failed. " 1127 pr_info("Adding multicast address failed."
1123 "Table possibly full!\n"); 1128 " Table possibly full!\n");
1124 /* store ipm in failed list -> will be added 1129 /* store ipm in failed list -> will be added
1125 * to ipm_list again, so a retry will be done 1130 * to ipm_list again, so a retry will be done
1126 * during the next call of this function */ 1131 * during the next call of this function */
@@ -1231,8 +1236,8 @@ lcs_set_mc_addresses(struct lcs_card *card, struct in_device *in4_dev)
1231 ipm = (struct lcs_ipm_list *) 1236 ipm = (struct lcs_ipm_list *)
1232 kzalloc(sizeof(struct lcs_ipm_list), GFP_ATOMIC); 1237 kzalloc(sizeof(struct lcs_ipm_list), GFP_ATOMIC);
1233 if (ipm == NULL) { 1238 if (ipm == NULL) {
1234 PRINT_INFO("Not enough memory to add " 1239 pr_info("Not enough memory to add"
1235 "new multicast entry!\n"); 1240 " new multicast entry!\n");
1236 break; 1241 break;
1237 } 1242 }
1238 memcpy(&ipm->ipm.mac_addr, buf, LCS_MAC_LENGTH); 1243 memcpy(&ipm->ipm.mac_addr, buf, LCS_MAC_LENGTH);
@@ -1306,18 +1311,21 @@ lcs_check_irb_error(struct ccw_device *cdev, struct irb *irb)
1306 1311
1307 switch (PTR_ERR(irb)) { 1312 switch (PTR_ERR(irb)) {
1308 case -EIO: 1313 case -EIO:
1309 PRINT_WARN("i/o-error on device %s\n", dev_name(&cdev->dev)); 1314 dev_warn(&cdev->dev,
1315 "An I/O-error occurred on the LCS device\n");
1310 LCS_DBF_TEXT(2, trace, "ckirberr"); 1316 LCS_DBF_TEXT(2, trace, "ckirberr");
1311 LCS_DBF_TEXT_(2, trace, " rc%d", -EIO); 1317 LCS_DBF_TEXT_(2, trace, " rc%d", -EIO);
1312 break; 1318 break;
1313 case -ETIMEDOUT: 1319 case -ETIMEDOUT:
1314 PRINT_WARN("timeout on device %s\n", dev_name(&cdev->dev)); 1320 dev_warn(&cdev->dev,
1321 "A command timed out on the LCS device\n");
1315 LCS_DBF_TEXT(2, trace, "ckirberr"); 1322 LCS_DBF_TEXT(2, trace, "ckirberr");
1316 LCS_DBF_TEXT_(2, trace, " rc%d", -ETIMEDOUT); 1323 LCS_DBF_TEXT_(2, trace, " rc%d", -ETIMEDOUT);
1317 break; 1324 break;
1318 default: 1325 default:
1319 PRINT_WARN("unknown error %ld on device %s\n", PTR_ERR(irb), 1326 dev_warn(&cdev->dev,
1320 dev_name(&cdev->dev)); 1327 "An error occurred on the LCS device, rc=%ld\n",
1328 PTR_ERR(irb));
1321 LCS_DBF_TEXT(2, trace, "ckirberr"); 1329 LCS_DBF_TEXT(2, trace, "ckirberr");
1322 LCS_DBF_TEXT(2, trace, " rc???"); 1330 LCS_DBF_TEXT(2, trace, " rc???");
1323 } 1331 }
@@ -1403,8 +1411,10 @@ lcs_irq(struct ccw_device *cdev, unsigned long intparm, struct irb *irb)
1403 /* Check for channel and device errors presented */ 1411 /* Check for channel and device errors presented */
1404 rc = lcs_get_problem(cdev, irb); 1412 rc = lcs_get_problem(cdev, irb);
1405 if (rc || (dstat & DEV_STAT_UNIT_EXCEP)) { 1413 if (rc || (dstat & DEV_STAT_UNIT_EXCEP)) {
1406 PRINT_WARN("check on device %s, dstat=0x%X, cstat=0x%X \n", 1414 dev_warn(&cdev->dev,
1407 dev_name(&cdev->dev), dstat, cstat); 1415 "The LCS device stopped because of an error,"
1416 " dstat=0x%X, cstat=0x%X \n",
1417 dstat, cstat);
1408 if (rc) { 1418 if (rc) {
1409 channel->state = LCS_CH_STATE_ERROR; 1419 channel->state = LCS_CH_STATE_ERROR;
1410 } 1420 }
@@ -1761,8 +1771,8 @@ lcs_get_control(struct lcs_card *card, struct lcs_cmd *cmd)
1761 lcs_schedule_recovery(card); 1771 lcs_schedule_recovery(card);
1762 break; 1772 break;
1763 case LCS_CMD_STOPLAN: 1773 case LCS_CMD_STOPLAN:
1764 PRINT_WARN("Stoplan for %s initiated by LGW.\n", 1774 pr_warning("Stoplan for %s initiated by LGW.\n",
1765 card->dev->name); 1775 card->dev->name);
1766 if (card->dev) 1776 if (card->dev)
1767 netif_carrier_off(card->dev); 1777 netif_carrier_off(card->dev);
1768 break; 1778 break;
@@ -1790,7 +1800,8 @@ lcs_get_skb(struct lcs_card *card, char *skb_data, unsigned int skb_len)
1790 1800
1791 skb = dev_alloc_skb(skb_len); 1801 skb = dev_alloc_skb(skb_len);
1792 if (skb == NULL) { 1802 if (skb == NULL) {
1793 PRINT_ERR("LCS: alloc_skb failed for device=%s\n", 1803 dev_err(&card->dev->dev,
1804 " Allocating a socket buffer to interface %s failed\n",
1794 card->dev->name); 1805 card->dev->name);
1795 card->stats.rx_dropped++; 1806 card->stats.rx_dropped++;
1796 return; 1807 return;
@@ -1886,7 +1897,8 @@ lcs_stop_device(struct net_device *dev)
1886 (card->write.state != LCS_CH_STATE_RUNNING)); 1897 (card->write.state != LCS_CH_STATE_RUNNING));
1887 rc = lcs_stopcard(card); 1898 rc = lcs_stopcard(card);
1888 if (rc) 1899 if (rc)
1889 PRINT_ERR("Try it again!\n "); 1900 dev_err(&card->dev->dev,
1901 " Shutting down the LCS device failed\n ");
1890 return rc; 1902 return rc;
1891} 1903}
1892 1904
@@ -1905,7 +1917,7 @@ lcs_open_device(struct net_device *dev)
1905 /* initialize statistics */ 1917 /* initialize statistics */
1906 rc = lcs_detect(card); 1918 rc = lcs_detect(card);
1907 if (rc) { 1919 if (rc) {
1908 PRINT_ERR("LCS:Error in opening device!\n"); 1920 pr_err("Error in opening device!\n");
1909 1921
1910 } else { 1922 } else {
1911 dev->flags |= IFF_UP; 1923 dev->flags |= IFF_UP;
@@ -2113,8 +2125,9 @@ lcs_new_device(struct ccwgroup_device *ccwgdev)
2113 rc = lcs_detect(card); 2125 rc = lcs_detect(card);
2114 if (rc) { 2126 if (rc) {
2115 LCS_DBF_TEXT(2, setup, "dtctfail"); 2127 LCS_DBF_TEXT(2, setup, "dtctfail");
2116 PRINT_WARN("Detection of LCS card failed with return code " 2128 dev_err(&card->dev->dev,
2117 "%d (0x%x)\n", rc, rc); 2129 "Detecting a network adapter for LCS devices"
2130 " failed with rc=%d (0x%x)\n", rc, rc);
2118 lcs_stopcard(card); 2131 lcs_stopcard(card);
2119 goto out; 2132 goto out;
2120 } 2133 }
@@ -2144,7 +2157,7 @@ lcs_new_device(struct ccwgroup_device *ccwgdev)
2144#endif 2157#endif
2145 default: 2158 default:
2146 LCS_DBF_TEXT(3, setup, "errinit"); 2159 LCS_DBF_TEXT(3, setup, "errinit");
2147 PRINT_ERR("LCS: Initialization failed\n"); 2160 pr_err(" Initialization failed\n");
2148 goto out; 2161 goto out;
2149 } 2162 }
2150 if (!dev) 2163 if (!dev)
@@ -2176,13 +2189,13 @@ netdev_out:
2176 goto out; 2189 goto out;
2177 2190
2178 /* Print out supported assists: IPv6 */ 2191 /* Print out supported assists: IPv6 */
2179 PRINT_INFO("LCS device %s %s IPv6 support\n", card->dev->name, 2192 pr_info("LCS device %s %s IPv6 support\n", card->dev->name,
2180 (card->ip_assists_supported & LCS_IPASS_IPV6_SUPPORT) ? 2193 (card->ip_assists_supported & LCS_IPASS_IPV6_SUPPORT) ?
2181 "with" : "without"); 2194 "with" : "without");
2182 /* Print out supported assist: Multicast */ 2195 /* Print out supported assist: Multicast */
2183 PRINT_INFO("LCS device %s %s Multicast support\n", card->dev->name, 2196 pr_info("LCS device %s %s Multicast support\n", card->dev->name,
2184 (card->ip_assists_supported & LCS_IPASS_MULTICAST_SUPPORT) ? 2197 (card->ip_assists_supported & LCS_IPASS_MULTICAST_SUPPORT) ?
2185 "with" : "without"); 2198 "with" : "without");
2186 return 0; 2199 return 0;
2187out: 2200out:
2188 2201
@@ -2248,15 +2261,16 @@ lcs_recovery(void *ptr)
2248 return 0; 2261 return 0;
2249 LCS_DBF_TEXT(4, trace, "recover2"); 2262 LCS_DBF_TEXT(4, trace, "recover2");
2250 gdev = card->gdev; 2263 gdev = card->gdev;
2251 PRINT_WARN("Recovery of device %s started...\n", dev_name(&gdev->dev)); 2264 dev_warn(&gdev->dev,
2265 "A recovery process has been started for the LCS device\n");
2252 rc = __lcs_shutdown_device(gdev, 1); 2266 rc = __lcs_shutdown_device(gdev, 1);
2253 rc = lcs_new_device(gdev); 2267 rc = lcs_new_device(gdev);
2254 if (!rc) 2268 if (!rc)
2255 PRINT_INFO("Device %s successfully recovered!\n", 2269 pr_info("Device %s successfully recovered!\n",
2256 card->dev->name); 2270 card->dev->name);
2257 else 2271 else
2258 PRINT_INFO("Device %s could not be recovered!\n", 2272 pr_info("Device %s could not be recovered!\n",
2259 card->dev->name); 2273 card->dev->name);
2260 lcs_clear_thread_running_bit(card, LCS_RECOVERY_THREAD); 2274 lcs_clear_thread_running_bit(card, LCS_RECOVERY_THREAD);
2261 return 0; 2275 return 0;
2262} 2276}
@@ -2308,17 +2322,17 @@ __init lcs_init_module(void)
2308{ 2322{
2309 int rc; 2323 int rc;
2310 2324
2311 PRINT_INFO("Loading %s\n",version); 2325 pr_info("Loading %s\n", version);
2312 rc = lcs_register_debug_facility(); 2326 rc = lcs_register_debug_facility();
2313 LCS_DBF_TEXT(0, setup, "lcsinit"); 2327 LCS_DBF_TEXT(0, setup, "lcsinit");
2314 if (rc) { 2328 if (rc) {
2315 PRINT_ERR("Initialization failed\n"); 2329 pr_err("Initialization failed\n");
2316 return rc; 2330 return rc;
2317 } 2331 }
2318 2332
2319 rc = register_cu3088_discipline(&lcs_group_driver); 2333 rc = register_cu3088_discipline(&lcs_group_driver);
2320 if (rc) { 2334 if (rc) {
2321 PRINT_ERR("Initialization failed\n"); 2335 pr_err("Initialization failed\n");
2322 return rc; 2336 return rc;
2323 } 2337 }
2324 return 0; 2338 return 0;
@@ -2331,7 +2345,7 @@ __init lcs_init_module(void)
2331static void 2345static void
2332__exit lcs_cleanup_module(void) 2346__exit lcs_cleanup_module(void)
2333{ 2347{
2334 PRINT_INFO("Terminating lcs module.\n"); 2348 pr_info("Terminating lcs module.\n");
2335 LCS_DBF_TEXT(0, trace, "cleanup"); 2349 LCS_DBF_TEXT(0, trace, "cleanup");
2336 unregister_cu3088_discipline(&lcs_group_driver); 2350 unregister_cu3088_discipline(&lcs_group_driver);
2337 lcs_unregister_debug_facility(); 2351 lcs_unregister_debug_facility();