Commit f082bcae authored by Ursula Braun's avatar Ursula Braun Committed by Heiko Carstens

[S390] Cleanup netiucv printk messages.

Cc: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: default avatarUrsula Braun <braunu@de.ibm.com>
Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent c2b4afd2
...@@ -625,9 +625,6 @@ static void netiucv_unpack_skb(struct iucv_connection *conn, ...@@ -625,9 +625,6 @@ static void netiucv_unpack_skb(struct iucv_connection *conn,
offset += header->next; offset += header->next;
header->next -= NETIUCV_HDRLEN; header->next -= NETIUCV_HDRLEN;
if (skb_tailroom(pskb) < header->next) { if (skb_tailroom(pskb) < header->next) {
PRINT_WARN("%s: Illegal next field in iucv header: "
"%d > %d\n",
dev->name, header->next, skb_tailroom(pskb));
IUCV_DBF_TEXT_(data, 2, "Illegal next field: %d > %d\n", IUCV_DBF_TEXT_(data, 2, "Illegal next field: %d > %d\n",
header->next, skb_tailroom(pskb)); header->next, skb_tailroom(pskb));
return; return;
...@@ -636,8 +633,6 @@ static void netiucv_unpack_skb(struct iucv_connection *conn, ...@@ -636,8 +633,6 @@ static void netiucv_unpack_skb(struct iucv_connection *conn,
skb_reset_mac_header(pskb); skb_reset_mac_header(pskb);
skb = dev_alloc_skb(pskb->len); skb = dev_alloc_skb(pskb->len);
if (!skb) { if (!skb) {
PRINT_WARN("%s Out of memory in netiucv_unpack_skb\n",
dev->name);
IUCV_DBF_TEXT(data, 2, IUCV_DBF_TEXT(data, 2,
"Out of memory in netiucv_unpack_skb\n"); "Out of memory in netiucv_unpack_skb\n");
privptr->stats.rx_dropped++; privptr->stats.rx_dropped++;
...@@ -674,7 +669,6 @@ static void conn_action_rx(fsm_instance *fi, int event, void *arg) ...@@ -674,7 +669,6 @@ static void conn_action_rx(fsm_instance *fi, int event, void *arg)
if (!conn->netdev) { if (!conn->netdev) {
iucv_message_reject(conn->path, msg); iucv_message_reject(conn->path, msg);
PRINT_WARN("Received data for unlinked connection\n");
IUCV_DBF_TEXT(data, 2, IUCV_DBF_TEXT(data, 2,
"Received data for unlinked connection\n"); "Received data for unlinked connection\n");
return; return;
...@@ -682,8 +676,6 @@ static void conn_action_rx(fsm_instance *fi, int event, void *arg) ...@@ -682,8 +676,6 @@ static void conn_action_rx(fsm_instance *fi, int event, void *arg)
if (msg->length > conn->max_buffsize) { if (msg->length > conn->max_buffsize) {
iucv_message_reject(conn->path, msg); iucv_message_reject(conn->path, msg);
privptr->stats.rx_dropped++; privptr->stats.rx_dropped++;
PRINT_WARN("msglen %d > max_buffsize %d\n",
msg->length, conn->max_buffsize);
IUCV_DBF_TEXT_(data, 2, "msglen %d > max_buffsize %d\n", IUCV_DBF_TEXT_(data, 2, "msglen %d > max_buffsize %d\n",
msg->length, conn->max_buffsize); msg->length, conn->max_buffsize);
return; return;
...@@ -695,7 +687,6 @@ static void conn_action_rx(fsm_instance *fi, int event, void *arg) ...@@ -695,7 +687,6 @@ static void conn_action_rx(fsm_instance *fi, int event, void *arg)
msg->length, NULL); msg->length, NULL);
if (rc || msg->length < 5) { if (rc || msg->length < 5) {
privptr->stats.rx_errors++; privptr->stats.rx_errors++;
PRINT_WARN("iucv_receive returned %08x\n", rc);
IUCV_DBF_TEXT_(data, 2, "rc %d from iucv_receive\n", rc); IUCV_DBF_TEXT_(data, 2, "rc %d from iucv_receive\n", rc);
return; return;
} }
...@@ -778,7 +769,6 @@ static void conn_action_txdone(fsm_instance *fi, int event, void *arg) ...@@ -778,7 +769,6 @@ static void conn_action_txdone(fsm_instance *fi, int event, void *arg)
fsm_newstate(fi, CONN_STATE_IDLE); fsm_newstate(fi, CONN_STATE_IDLE);
if (privptr) if (privptr)
privptr->stats.tx_errors += txpackets; privptr->stats.tx_errors += txpackets;
PRINT_WARN("iucv_send returned %08x\n", rc);
IUCV_DBF_TEXT_(data, 2, "rc %d from iucv_send\n", rc); IUCV_DBF_TEXT_(data, 2, "rc %d from iucv_send\n", rc);
} else { } else {
if (privptr) { if (privptr) {
...@@ -806,8 +796,6 @@ static void conn_action_connaccept(fsm_instance *fi, int event, void *arg) ...@@ -806,8 +796,6 @@ static void conn_action_connaccept(fsm_instance *fi, int event, void *arg)
path->flags = 0; path->flags = 0;
rc = iucv_path_accept(path, &netiucv_handler, NULL, conn); rc = iucv_path_accept(path, &netiucv_handler, NULL, conn);
if (rc) { if (rc) {
PRINT_WARN("%s: IUCV accept failed with error %d\n",
netdev->name, rc);
IUCV_DBF_TEXT_(setup, 2, "rc %d from iucv_accept", rc); IUCV_DBF_TEXT_(setup, 2, "rc %d from iucv_accept", rc);
return; return;
} }
...@@ -873,7 +861,7 @@ static void conn_action_start(fsm_instance *fi, int event, void *arg) ...@@ -873,7 +861,7 @@ static void conn_action_start(fsm_instance *fi, int event, void *arg)
IUCV_DBF_TEXT(trace, 3, __func__); IUCV_DBF_TEXT(trace, 3, __func__);
fsm_newstate(fi, CONN_STATE_STARTWAIT); fsm_newstate(fi, CONN_STATE_STARTWAIT);
PRINT_DEBUG("%s('%s'): connecting ...\n", IUCV_DBF_TEXT_(setup, 2, "%s('%s'): connecting ...\n",
conn->netdev->name, conn->userid); conn->netdev->name, conn->userid);
/* /*
...@@ -968,8 +956,8 @@ static void conn_action_inval(fsm_instance *fi, int event, void *arg) ...@@ -968,8 +956,8 @@ static void conn_action_inval(fsm_instance *fi, int event, void *arg)
struct iucv_connection *conn = arg; struct iucv_connection *conn = arg;
struct net_device *netdev = conn->netdev; struct net_device *netdev = conn->netdev;
PRINT_WARN("%s: Cannot connect without username\n", netdev->name); IUCV_DBF_TEXT_(data, 2, "%s('%s'): conn_action_inval called\n",
IUCV_DBF_TEXT(data, 2, "conn_action_inval called\n"); netdev->name, conn->userid);
} }
static const fsm_node conn_fsm[] = { static const fsm_node conn_fsm[] = {
...@@ -1077,9 +1065,6 @@ dev_action_connup(fsm_instance *fi, int event, void *arg) ...@@ -1077,9 +1065,6 @@ dev_action_connup(fsm_instance *fi, int event, void *arg)
"connection is up and running\n"); "connection is up and running\n");
break; break;
case DEV_STATE_STOPWAIT: case DEV_STATE_STOPWAIT:
PRINT_INFO(
"%s: got connection UP event during shutdown!\n",
dev->name);
IUCV_DBF_TEXT(data, 2, IUCV_DBF_TEXT(data, 2,
"dev_action_connup: in DEV_STATE_STOPWAIT\n"); "dev_action_connup: in DEV_STATE_STOPWAIT\n");
break; break;
...@@ -1174,8 +1159,6 @@ static int netiucv_transmit_skb(struct iucv_connection *conn, ...@@ -1174,8 +1159,6 @@ static int netiucv_transmit_skb(struct iucv_connection *conn,
nskb = alloc_skb(skb->len + NETIUCV_HDRLEN + nskb = alloc_skb(skb->len + NETIUCV_HDRLEN +
NETIUCV_HDRLEN, GFP_ATOMIC | GFP_DMA); NETIUCV_HDRLEN, GFP_ATOMIC | GFP_DMA);
if (!nskb) { if (!nskb) {
PRINT_WARN("%s: Could not allocate tx_skb\n",
conn->netdev->name);
IUCV_DBF_TEXT(data, 2, "alloc_skb failed\n"); IUCV_DBF_TEXT(data, 2, "alloc_skb failed\n");
rc = -ENOMEM; rc = -ENOMEM;
return rc; return rc;
...@@ -1223,7 +1206,6 @@ static int netiucv_transmit_skb(struct iucv_connection *conn, ...@@ -1223,7 +1206,6 @@ static int netiucv_transmit_skb(struct iucv_connection *conn,
skb_pull(skb, NETIUCV_HDRLEN); skb_pull(skb, NETIUCV_HDRLEN);
skb_trim(skb, skb->len - NETIUCV_HDRLEN); skb_trim(skb, skb->len - NETIUCV_HDRLEN);
} }
PRINT_WARN("iucv_send returned %08x\n", rc);
IUCV_DBF_TEXT_(data, 2, "rc %d from iucv_send\n", rc); IUCV_DBF_TEXT_(data, 2, "rc %d from iucv_send\n", rc);
} else { } else {
if (copied) if (copied)
...@@ -1293,14 +1275,11 @@ static int netiucv_tx(struct sk_buff *skb, struct net_device *dev) ...@@ -1293,14 +1275,11 @@ static int netiucv_tx(struct sk_buff *skb, struct net_device *dev)
* Some sanity checks ... * Some sanity checks ...
*/ */
if (skb == NULL) { if (skb == NULL) {
PRINT_WARN("%s: NULL sk_buff passed\n", dev->name);
IUCV_DBF_TEXT(data, 2, "netiucv_tx: skb is NULL\n"); IUCV_DBF_TEXT(data, 2, "netiucv_tx: skb is NULL\n");
privptr->stats.tx_dropped++; privptr->stats.tx_dropped++;
return 0; return 0;
} }
if (skb_headroom(skb) < NETIUCV_HDRLEN) { if (skb_headroom(skb) < NETIUCV_HDRLEN) {
PRINT_WARN("%s: Got sk_buff with head room < %ld bytes\n",
dev->name, NETIUCV_HDRLEN);
IUCV_DBF_TEXT(data, 2, IUCV_DBF_TEXT(data, 2,
"netiucv_tx: skb_headroom < NETIUCV_HDRLEN\n"); "netiucv_tx: skb_headroom < NETIUCV_HDRLEN\n");
dev_kfree_skb(skb); dev_kfree_skb(skb);
...@@ -1393,7 +1372,6 @@ static ssize_t user_write(struct device *dev, struct device_attribute *attr, ...@@ -1393,7 +1372,6 @@ static ssize_t user_write(struct device *dev, struct device_attribute *attr,
IUCV_DBF_TEXT(trace, 3, __func__); IUCV_DBF_TEXT(trace, 3, __func__);
if (count > 9) { if (count > 9) {
PRINT_WARN("netiucv: username too long (%d)!\n", (int) count);
IUCV_DBF_TEXT_(setup, 2, IUCV_DBF_TEXT_(setup, 2,
"%d is length of username\n", (int) count); "%d is length of username\n", (int) count);
return -EINVAL; return -EINVAL;
...@@ -1409,7 +1387,6 @@ static ssize_t user_write(struct device *dev, struct device_attribute *attr, ...@@ -1409,7 +1387,6 @@ static ssize_t user_write(struct device *dev, struct device_attribute *attr,
/* trailing lf, grr */ /* trailing lf, grr */
break; break;
} }
PRINT_WARN("netiucv: Invalid char %c in username!\n", *p);
IUCV_DBF_TEXT_(setup, 2, IUCV_DBF_TEXT_(setup, 2,
"username: invalid character %c\n", *p); "username: invalid character %c\n", *p);
return -EINVAL; return -EINVAL;
...@@ -1421,18 +1398,15 @@ static ssize_t user_write(struct device *dev, struct device_attribute *attr, ...@@ -1421,18 +1398,15 @@ static ssize_t user_write(struct device *dev, struct device_attribute *attr,
if (memcmp(username, priv->conn->userid, 9) && if (memcmp(username, priv->conn->userid, 9) &&
(ndev->flags & (IFF_UP | IFF_RUNNING))) { (ndev->flags & (IFF_UP | IFF_RUNNING))) {
/* username changed while the interface is active. */ /* username changed while the interface is active. */
PRINT_WARN("netiucv: device %s active, connected to %s\n",
dev->bus_id, priv->conn->userid);
PRINT_WARN("netiucv: user cannot be updated\n");
IUCV_DBF_TEXT(setup, 2, "user_write: device active\n"); IUCV_DBF_TEXT(setup, 2, "user_write: device active\n");
return -EBUSY; return -EPERM;
} }
read_lock_bh(&iucv_connection_rwlock); read_lock_bh(&iucv_connection_rwlock);
list_for_each_entry(cp, &iucv_connection_list, list) { list_for_each_entry(cp, &iucv_connection_list, list) {
if (!strncmp(username, cp->userid, 9) && cp->netdev != ndev) { if (!strncmp(username, cp->userid, 9) && cp->netdev != ndev) {
read_unlock_bh(&iucv_connection_rwlock); read_unlock_bh(&iucv_connection_rwlock);
PRINT_WARN("netiucv: Connection to %s already " IUCV_DBF_TEXT_(setup, 2, "user_write: Connection "
"exists\n", username); "to %s already exists\n", username);
return -EEXIST; return -EEXIST;
} }
} }
...@@ -1466,13 +1440,10 @@ static ssize_t buffer_write (struct device *dev, struct device_attribute *attr, ...@@ -1466,13 +1440,10 @@ static ssize_t buffer_write (struct device *dev, struct device_attribute *attr,
bs1 = simple_strtoul(buf, &e, 0); bs1 = simple_strtoul(buf, &e, 0);
if (e && (!isspace(*e))) { if (e && (!isspace(*e))) {
PRINT_WARN("netiucv: Invalid character in buffer!\n");
IUCV_DBF_TEXT_(setup, 2, "buffer_write: invalid char %c\n", *e); IUCV_DBF_TEXT_(setup, 2, "buffer_write: invalid char %c\n", *e);
return -EINVAL; return -EINVAL;
} }
if (bs1 > NETIUCV_BUFSIZE_MAX) { if (bs1 > NETIUCV_BUFSIZE_MAX) {
PRINT_WARN("netiucv: Given buffer size %d too large.\n",
bs1);
IUCV_DBF_TEXT_(setup, 2, IUCV_DBF_TEXT_(setup, 2,
"buffer_write: buffer size %d too large\n", "buffer_write: buffer size %d too large\n",
bs1); bs1);
...@@ -1480,16 +1451,12 @@ static ssize_t buffer_write (struct device *dev, struct device_attribute *attr, ...@@ -1480,16 +1451,12 @@ static ssize_t buffer_write (struct device *dev, struct device_attribute *attr,
} }
if ((ndev->flags & IFF_RUNNING) && if ((ndev->flags & IFF_RUNNING) &&
(bs1 < (ndev->mtu + NETIUCV_HDRLEN + 2))) { (bs1 < (ndev->mtu + NETIUCV_HDRLEN + 2))) {
PRINT_WARN("netiucv: Given buffer size %d too small.\n",
bs1);
IUCV_DBF_TEXT_(setup, 2, IUCV_DBF_TEXT_(setup, 2,
"buffer_write: buffer size %d too small\n", "buffer_write: buffer size %d too small\n",
bs1); bs1);
return -EINVAL; return -EINVAL;
} }
if (bs1 < (576 + NETIUCV_HDRLEN + NETIUCV_HDRLEN)) { if (bs1 < (576 + NETIUCV_HDRLEN + NETIUCV_HDRLEN)) {
PRINT_WARN("netiucv: Given buffer size %d too small.\n",
bs1);
IUCV_DBF_TEXT_(setup, 2, IUCV_DBF_TEXT_(setup, 2,
"buffer_write: buffer size %d too small\n", "buffer_write: buffer size %d too small\n",
bs1); bs1);
...@@ -1963,7 +1930,6 @@ static ssize_t conn_write(struct device_driver *drv, ...@@ -1963,7 +1930,6 @@ static ssize_t conn_write(struct device_driver *drv,
IUCV_DBF_TEXT(trace, 3, __func__); IUCV_DBF_TEXT(trace, 3, __func__);
if (count>9) { if (count>9) {
PRINT_WARN("netiucv: username too long (%d)!\n", (int)count);
IUCV_DBF_TEXT(setup, 2, "conn_write: too long\n"); IUCV_DBF_TEXT(setup, 2, "conn_write: too long\n");
return -EINVAL; return -EINVAL;
} }
...@@ -1976,7 +1942,6 @@ static ssize_t conn_write(struct device_driver *drv, ...@@ -1976,7 +1942,6 @@ static ssize_t conn_write(struct device_driver *drv,
if (*p == '\n') if (*p == '\n')
/* trailing lf, grr */ /* trailing lf, grr */
break; break;
PRINT_WARN("netiucv: Invalid character in username!\n");
IUCV_DBF_TEXT_(setup, 2, IUCV_DBF_TEXT_(setup, 2,
"conn_write: invalid character %c\n", *p); "conn_write: invalid character %c\n", *p);
return -EINVAL; return -EINVAL;
...@@ -1989,8 +1954,8 @@ static ssize_t conn_write(struct device_driver *drv, ...@@ -1989,8 +1954,8 @@ static ssize_t conn_write(struct device_driver *drv,
list_for_each_entry(cp, &iucv_connection_list, list) { list_for_each_entry(cp, &iucv_connection_list, list) {
if (!strncmp(username, cp->userid, 9)) { if (!strncmp(username, cp->userid, 9)) {
read_unlock_bh(&iucv_connection_rwlock); read_unlock_bh(&iucv_connection_rwlock);
PRINT_WARN("netiucv: Connection to %s already " IUCV_DBF_TEXT_(setup, 2, "conn_write: Connection "
"exists\n", username); "to %s already exists\n", username);
return -EEXIST; return -EEXIST;
} }
} }
...@@ -1998,9 +1963,6 @@ static ssize_t conn_write(struct device_driver *drv, ...@@ -1998,9 +1963,6 @@ static ssize_t conn_write(struct device_driver *drv,
dev = netiucv_init_netdevice(username); dev = netiucv_init_netdevice(username);
if (!dev) { if (!dev) {
PRINT_WARN("netiucv: Could not allocate network device "
"structure for user '%s'\n",
netiucv_printname(username));
IUCV_DBF_TEXT(setup, 2, "NULL from netiucv_init_netdevice\n"); IUCV_DBF_TEXT(setup, 2, "NULL from netiucv_init_netdevice\n");
return -ENODEV; return -ENODEV;
} }
...@@ -2020,15 +1982,12 @@ static ssize_t conn_write(struct device_driver *drv, ...@@ -2020,15 +1982,12 @@ static ssize_t conn_write(struct device_driver *drv,
if (rc) if (rc)
goto out_unreg; goto out_unreg;
PRINT_INFO("%s: '%s'\n", dev->name, netiucv_printname(username));
return count; return count;
out_unreg: out_unreg:
netiucv_unregister_device(priv->dev); netiucv_unregister_device(priv->dev);
out_free_ndev: out_free_ndev:
PRINT_WARN("netiucv: Could not register '%s'\n", dev->name);
IUCV_DBF_TEXT(setup, 2, "conn_write: could not register\n");
netiucv_free_netdevice(dev); netiucv_free_netdevice(dev);
return rc; return rc;
} }
...@@ -2073,14 +2032,13 @@ static ssize_t remove_write (struct device_driver *drv, ...@@ -2073,14 +2032,13 @@ static ssize_t remove_write (struct device_driver *drv,
PRINT_WARN("netiucv: %s cannot be removed\n", PRINT_WARN("netiucv: %s cannot be removed\n",
ndev->name); ndev->name);
IUCV_DBF_TEXT(data, 2, "remove_write: still active\n"); IUCV_DBF_TEXT(data, 2, "remove_write: still active\n");
return -EBUSY; return -EPERM;
} }
unregister_netdev(ndev); unregister_netdev(ndev);
netiucv_unregister_device(dev); netiucv_unregister_device(dev);
return count; return count;
} }
read_unlock_bh(&iucv_connection_rwlock); read_unlock_bh(&iucv_connection_rwlock);
PRINT_WARN("netiucv: net device %s unknown\n", name);
IUCV_DBF_TEXT(data, 2, "remove_write: unknown device\n"); IUCV_DBF_TEXT(data, 2, "remove_write: unknown device\n");
return -EINVAL; return -EINVAL;
} }
...@@ -2148,7 +2106,6 @@ static int __init netiucv_init(void) ...@@ -2148,7 +2106,6 @@ static int __init netiucv_init(void)
netiucv_driver.groups = netiucv_drv_attr_groups; netiucv_driver.groups = netiucv_drv_attr_groups;
rc = driver_register(&netiucv_driver); rc = driver_register(&netiucv_driver);
if (rc) { if (rc) {
PRINT_ERR("NETIUCV: failed to register driver.\n");
IUCV_DBF_TEXT_(setup, 2, "ret %d from driver_register\n", rc); IUCV_DBF_TEXT_(setup, 2, "ret %d from driver_register\n", rc);
goto out_iucv; goto out_iucv;
} }
......
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