Commit c99fc5da authored by Klaus-D. Wacker's avatar Klaus-D. Wacker Committed by Martin Schwidefsky

[S390] convert lcs printks to dev_xxx and pr_xxx macros.

Signed-off-by: default avatarKlaus-D. Wacker <kdwacker@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 8988e58f
...@@ -26,6 +26,9 @@ ...@@ -26,6 +26,9 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#define KMSG_COMPONENT "lcs"
#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
#include <linux/module.h> #include <linux/module.h>
#include <linux/if.h> #include <linux/if.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
...@@ -54,8 +57,6 @@ ...@@ -54,8 +57,6 @@
#error Cannot compile lcs.c without some net devices switched on. #error Cannot compile lcs.c without some net devices switched on.
#endif #endif
#define PRINTK_HEADER " lcs: "
/** /**
* initialization string for output * initialization string for output
*/ */
...@@ -96,7 +97,7 @@ lcs_register_debug_facility(void) ...@@ -96,7 +97,7 @@ lcs_register_debug_facility(void)
lcs_dbf_setup = debug_register("lcs_setup", 2, 1, 8); lcs_dbf_setup = debug_register("lcs_setup", 2, 1, 8);
lcs_dbf_trace = debug_register("lcs_trace", 4, 1, 8); lcs_dbf_trace = debug_register("lcs_trace", 4, 1, 8);
if (lcs_dbf_setup == NULL || lcs_dbf_trace == NULL) { if (lcs_dbf_setup == NULL || lcs_dbf_trace == NULL) {
PRINT_ERR("Not enough memory for debug facility.\n"); pr_err("Not enough memory for debug facility.\n");
lcs_unregister_debug_facility(); lcs_unregister_debug_facility();
return -ENOMEM; return -ENOMEM;
} }
...@@ -503,7 +504,9 @@ lcs_start_channel(struct lcs_channel *channel) ...@@ -503,7 +504,9 @@ lcs_start_channel(struct lcs_channel *channel)
if (rc) { if (rc) {
LCS_DBF_TEXT_(4,trace,"essh%s", LCS_DBF_TEXT_(4,trace,"essh%s",
dev_name(&channel->ccwdev->dev)); dev_name(&channel->ccwdev->dev));
PRINT_ERR("Error in starting channel, rc=%d!\n", rc); dev_err(&channel->ccwdev->dev,
"Starting an LCS device resulted in an error,"
" rc=%d!\n", rc);
} }
return rc; return rc;
} }
...@@ -640,7 +643,9 @@ __lcs_resume_channel(struct lcs_channel *channel) ...@@ -640,7 +643,9 @@ __lcs_resume_channel(struct lcs_channel *channel)
if (rc) { if (rc) {
LCS_DBF_TEXT_(4, trace, "ersc%s", LCS_DBF_TEXT_(4, trace, "ersc%s",
dev_name(&channel->ccwdev->dev)); dev_name(&channel->ccwdev->dev));
PRINT_ERR("Error in lcs_resume_channel: rc=%d\n",rc); dev_err(&channel->ccwdev->dev,
"Sending data from the LCS device to the LAN failed"
" with rc=%d\n",rc);
} else } else
channel->state = LCS_CH_STATE_RUNNING; channel->state = LCS_CH_STATE_RUNNING;
return rc; return rc;
...@@ -1086,7 +1091,7 @@ lcs_check_multicast_support(struct lcs_card *card) ...@@ -1086,7 +1091,7 @@ lcs_check_multicast_support(struct lcs_card *card)
cmd->cmd.lcs_qipassist.num_ip_pairs = 1; cmd->cmd.lcs_qipassist.num_ip_pairs = 1;
rc = lcs_send_lancmd(card, buffer, __lcs_check_multicast_cb); rc = lcs_send_lancmd(card, buffer, __lcs_check_multicast_cb);
if (rc != 0) { if (rc != 0) {
PRINT_ERR("Query IPAssist failed. Assuming unsupported!\n"); pr_err("Query IPAssist failed. Assuming unsupported!\n");
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
if (card->ip_assists_supported & LCS_IPASS_MULTICAST_SUPPORT) if (card->ip_assists_supported & LCS_IPASS_MULTICAST_SUPPORT)
...@@ -1119,8 +1124,8 @@ lcs_fix_multicast_list(struct lcs_card *card) ...@@ -1119,8 +1124,8 @@ lcs_fix_multicast_list(struct lcs_card *card)
rc = lcs_send_setipm(card, ipm); rc = lcs_send_setipm(card, ipm);
spin_lock_irqsave(&card->ipm_lock, flags); spin_lock_irqsave(&card->ipm_lock, flags);
if (rc) { if (rc) {
PRINT_INFO("Adding multicast address failed. " pr_info("Adding multicast address failed."
"Table possibly full!\n"); " Table possibly full!\n");
/* store ipm in failed list -> will be added /* store ipm in failed list -> will be added
* to ipm_list again, so a retry will be done * to ipm_list again, so a retry will be done
* during the next call of this function */ * 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,8 +1236,8 @@ lcs_set_mc_addresses(struct lcs_card *card, struct in_device *in4_dev)
ipm = (struct lcs_ipm_list *) ipm = (struct lcs_ipm_list *)
kzalloc(sizeof(struct lcs_ipm_list), GFP_ATOMIC); kzalloc(sizeof(struct lcs_ipm_list), GFP_ATOMIC);
if (ipm == NULL) { if (ipm == NULL) {
PRINT_INFO("Not enough memory to add " pr_info("Not enough memory to add"
"new multicast entry!\n"); " new multicast entry!\n");
break; break;
} }
memcpy(&ipm->ipm.mac_addr, buf, LCS_MAC_LENGTH); 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,18 +1311,21 @@ lcs_check_irb_error(struct ccw_device *cdev, struct irb *irb)
switch (PTR_ERR(irb)) { switch (PTR_ERR(irb)) {
case -EIO: case -EIO:
PRINT_WARN("i/o-error on device %s\n", dev_name(&cdev->dev)); dev_warn(&cdev->dev,
"An I/O-error occurred on the LCS device\n");
LCS_DBF_TEXT(2, trace, "ckirberr"); LCS_DBF_TEXT(2, trace, "ckirberr");
LCS_DBF_TEXT_(2, trace, " rc%d", -EIO); LCS_DBF_TEXT_(2, trace, " rc%d", -EIO);
break; break;
case -ETIMEDOUT: case -ETIMEDOUT:
PRINT_WARN("timeout on device %s\n", dev_name(&cdev->dev)); dev_warn(&cdev->dev,
"A command timed out on the LCS device\n");
LCS_DBF_TEXT(2, trace, "ckirberr"); LCS_DBF_TEXT(2, trace, "ckirberr");
LCS_DBF_TEXT_(2, trace, " rc%d", -ETIMEDOUT); LCS_DBF_TEXT_(2, trace, " rc%d", -ETIMEDOUT);
break; break;
default: default:
PRINT_WARN("unknown error %ld on device %s\n", PTR_ERR(irb), dev_warn(&cdev->dev,
dev_name(&cdev->dev)); "An error occurred on the LCS device, rc=%ld\n",
PTR_ERR(irb));
LCS_DBF_TEXT(2, trace, "ckirberr"); LCS_DBF_TEXT(2, trace, "ckirberr");
LCS_DBF_TEXT(2, trace, " rc???"); LCS_DBF_TEXT(2, trace, " rc???");
} }
...@@ -1403,8 +1411,10 @@ lcs_irq(struct ccw_device *cdev, unsigned long intparm, struct irb *irb) ...@@ -1403,8 +1411,10 @@ lcs_irq(struct ccw_device *cdev, unsigned long intparm, struct irb *irb)
/* Check for channel and device errors presented */ /* Check for channel and device errors presented */
rc = lcs_get_problem(cdev, irb); rc = lcs_get_problem(cdev, irb);
if (rc || (dstat & DEV_STAT_UNIT_EXCEP)) { if (rc || (dstat & DEV_STAT_UNIT_EXCEP)) {
PRINT_WARN("check on device %s, dstat=0x%X, cstat=0x%X \n", dev_warn(&cdev->dev,
dev_name(&cdev->dev), dstat, cstat); "The LCS device stopped because of an error,"
" dstat=0x%X, cstat=0x%X \n",
dstat, cstat);
if (rc) { if (rc) {
channel->state = LCS_CH_STATE_ERROR; channel->state = LCS_CH_STATE_ERROR;
} }
...@@ -1761,8 +1771,8 @@ lcs_get_control(struct lcs_card *card, struct lcs_cmd *cmd) ...@@ -1761,8 +1771,8 @@ lcs_get_control(struct lcs_card *card, struct lcs_cmd *cmd)
lcs_schedule_recovery(card); lcs_schedule_recovery(card);
break; break;
case LCS_CMD_STOPLAN: case LCS_CMD_STOPLAN:
PRINT_WARN("Stoplan for %s initiated by LGW.\n", pr_warning("Stoplan for %s initiated by LGW.\n",
card->dev->name); card->dev->name);
if (card->dev) if (card->dev)
netif_carrier_off(card->dev); netif_carrier_off(card->dev);
break; break;
...@@ -1790,7 +1800,8 @@ lcs_get_skb(struct lcs_card *card, char *skb_data, unsigned int skb_len) ...@@ -1790,7 +1800,8 @@ lcs_get_skb(struct lcs_card *card, char *skb_data, unsigned int skb_len)
skb = dev_alloc_skb(skb_len); skb = dev_alloc_skb(skb_len);
if (skb == NULL) { if (skb == NULL) {
PRINT_ERR("LCS: alloc_skb failed for device=%s\n", dev_err(&card->dev->dev,
" Allocating a socket buffer to interface %s failed\n",
card->dev->name); card->dev->name);
card->stats.rx_dropped++; card->stats.rx_dropped++;
return; return;
...@@ -1886,7 +1897,8 @@ lcs_stop_device(struct net_device *dev) ...@@ -1886,7 +1897,8 @@ lcs_stop_device(struct net_device *dev)
(card->write.state != LCS_CH_STATE_RUNNING)); (card->write.state != LCS_CH_STATE_RUNNING));
rc = lcs_stopcard(card); rc = lcs_stopcard(card);
if (rc) if (rc)
PRINT_ERR("Try it again!\n "); dev_err(&card->dev->dev,
" Shutting down the LCS device failed\n ");
return rc; return rc;
} }
...@@ -1905,7 +1917,7 @@ lcs_open_device(struct net_device *dev) ...@@ -1905,7 +1917,7 @@ lcs_open_device(struct net_device *dev)
/* initialize statistics */ /* initialize statistics */
rc = lcs_detect(card); rc = lcs_detect(card);
if (rc) { if (rc) {
PRINT_ERR("LCS:Error in opening device!\n"); pr_err("Error in opening device!\n");
} else { } else {
dev->flags |= IFF_UP; dev->flags |= IFF_UP;
...@@ -2113,8 +2125,9 @@ lcs_new_device(struct ccwgroup_device *ccwgdev) ...@@ -2113,8 +2125,9 @@ lcs_new_device(struct ccwgroup_device *ccwgdev)
rc = lcs_detect(card); rc = lcs_detect(card);
if (rc) { if (rc) {
LCS_DBF_TEXT(2, setup, "dtctfail"); LCS_DBF_TEXT(2, setup, "dtctfail");
PRINT_WARN("Detection of LCS card failed with return code " dev_err(&card->dev->dev,
"%d (0x%x)\n", rc, rc); "Detecting a network adapter for LCS devices"
" failed with rc=%d (0x%x)\n", rc, rc);
lcs_stopcard(card); lcs_stopcard(card);
goto out; goto out;
} }
...@@ -2144,7 +2157,7 @@ lcs_new_device(struct ccwgroup_device *ccwgdev) ...@@ -2144,7 +2157,7 @@ lcs_new_device(struct ccwgroup_device *ccwgdev)
#endif #endif
default: default:
LCS_DBF_TEXT(3, setup, "errinit"); LCS_DBF_TEXT(3, setup, "errinit");
PRINT_ERR("LCS: Initialization failed\n"); pr_err(" Initialization failed\n");
goto out; goto out;
} }
if (!dev) if (!dev)
...@@ -2176,13 +2189,13 @@ lcs_new_device(struct ccwgroup_device *ccwgdev) ...@@ -2176,13 +2189,13 @@ lcs_new_device(struct ccwgroup_device *ccwgdev)
goto out; goto out;
/* Print out supported assists: IPv6 */ /* Print out supported assists: IPv6 */
PRINT_INFO("LCS device %s %s IPv6 support\n", card->dev->name, pr_info("LCS device %s %s IPv6 support\n", card->dev->name,
(card->ip_assists_supported & LCS_IPASS_IPV6_SUPPORT) ? (card->ip_assists_supported & LCS_IPASS_IPV6_SUPPORT) ?
"with" : "without"); "with" : "without");
/* Print out supported assist: Multicast */ /* Print out supported assist: Multicast */
PRINT_INFO("LCS device %s %s Multicast support\n", card->dev->name, pr_info("LCS device %s %s Multicast support\n", card->dev->name,
(card->ip_assists_supported & LCS_IPASS_MULTICAST_SUPPORT) ? (card->ip_assists_supported & LCS_IPASS_MULTICAST_SUPPORT) ?
"with" : "without"); "with" : "without");
return 0; return 0;
out: out:
...@@ -2248,15 +2261,16 @@ lcs_recovery(void *ptr) ...@@ -2248,15 +2261,16 @@ lcs_recovery(void *ptr)
return 0; return 0;
LCS_DBF_TEXT(4, trace, "recover2"); LCS_DBF_TEXT(4, trace, "recover2");
gdev = card->gdev; gdev = card->gdev;
PRINT_WARN("Recovery of device %s started...\n", dev_name(&gdev->dev)); dev_warn(&gdev->dev,
"A recovery process has been started for the LCS device\n");
rc = __lcs_shutdown_device(gdev, 1); rc = __lcs_shutdown_device(gdev, 1);
rc = lcs_new_device(gdev); rc = lcs_new_device(gdev);
if (!rc) if (!rc)
PRINT_INFO("Device %s successfully recovered!\n", pr_info("Device %s successfully recovered!\n",
card->dev->name); card->dev->name);
else else
PRINT_INFO("Device %s could not be recovered!\n", pr_info("Device %s could not be recovered!\n",
card->dev->name); card->dev->name);
lcs_clear_thread_running_bit(card, LCS_RECOVERY_THREAD); lcs_clear_thread_running_bit(card, LCS_RECOVERY_THREAD);
return 0; return 0;
} }
...@@ -2308,17 +2322,17 @@ __init lcs_init_module(void) ...@@ -2308,17 +2322,17 @@ __init lcs_init_module(void)
{ {
int rc; int rc;
PRINT_INFO("Loading %s\n",version); pr_info("Loading %s\n", version);
rc = lcs_register_debug_facility(); rc = lcs_register_debug_facility();
LCS_DBF_TEXT(0, setup, "lcsinit"); LCS_DBF_TEXT(0, setup, "lcsinit");
if (rc) { if (rc) {
PRINT_ERR("Initialization failed\n"); pr_err("Initialization failed\n");
return rc; return rc;
} }
rc = register_cu3088_discipline(&lcs_group_driver); rc = register_cu3088_discipline(&lcs_group_driver);
if (rc) { if (rc) {
PRINT_ERR("Initialization failed\n"); pr_err("Initialization failed\n");
return rc; return rc;
} }
return 0; return 0;
...@@ -2331,7 +2345,7 @@ __init lcs_init_module(void) ...@@ -2331,7 +2345,7 @@ __init lcs_init_module(void)
static void static void
__exit lcs_cleanup_module(void) __exit lcs_cleanup_module(void)
{ {
PRINT_INFO("Terminating lcs module.\n"); pr_info("Terminating lcs module.\n");
LCS_DBF_TEXT(0, trace, "cleanup"); LCS_DBF_TEXT(0, trace, "cleanup");
unregister_cu3088_discipline(&lcs_group_driver); unregister_cu3088_discipline(&lcs_group_driver);
lcs_unregister_debug_facility(); lcs_unregister_debug_facility();
......
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