aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/s390/net/netiucv.c64
-rw-r--r--net/iucv/af_iucv.c19
-rw-r--r--net/iucv/iucv.c9
3 files changed, 60 insertions, 32 deletions
diff --git a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c
index 0fea51e34b57..930e2fc2a011 100644
--- a/drivers/s390/net/netiucv.c
+++ b/drivers/s390/net/netiucv.c
@@ -31,6 +31,9 @@
31 * 31 *
32 */ 32 */
33 33
34#define KMSG_COMPONENT "netiucv"
35#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
36
34#undef DEBUG 37#undef DEBUG
35 38
36#include <linux/module.h> 39#include <linux/module.h>
@@ -846,7 +849,8 @@ static void conn_action_connsever(fsm_instance *fi, int event, void *arg)
846 849
847 fsm_deltimer(&conn->timer); 850 fsm_deltimer(&conn->timer);
848 iucv_path_sever(conn->path, NULL); 851 iucv_path_sever(conn->path, NULL);
849 PRINT_INFO("%s: Remote dropped connection\n", netdev->name); 852 dev_info(privptr->dev, "The peer interface of the IUCV device"
853 " has closed the connection\n");
850 IUCV_DBF_TEXT(data, 2, 854 IUCV_DBF_TEXT(data, 2,
851 "conn_action_connsever: Remote dropped connection\n"); 855 "conn_action_connsever: Remote dropped connection\n");
852 fsm_newstate(fi, CONN_STATE_STARTWAIT); 856 fsm_newstate(fi, CONN_STATE_STARTWAIT);
@@ -856,13 +860,15 @@ static void conn_action_connsever(fsm_instance *fi, int event, void *arg)
856static void conn_action_start(fsm_instance *fi, int event, void *arg) 860static void conn_action_start(fsm_instance *fi, int event, void *arg)
857{ 861{
858 struct iucv_connection *conn = arg; 862 struct iucv_connection *conn = arg;
863 struct net_device *netdev = conn->netdev;
864 struct netiucv_priv *privptr = netdev_priv(netdev);
859 int rc; 865 int rc;
860 866
861 IUCV_DBF_TEXT(trace, 3, __func__); 867 IUCV_DBF_TEXT(trace, 3, __func__);
862 868
863 fsm_newstate(fi, CONN_STATE_STARTWAIT); 869 fsm_newstate(fi, CONN_STATE_STARTWAIT);
864 IUCV_DBF_TEXT_(setup, 2, "%s('%s'): connecting ...\n", 870 IUCV_DBF_TEXT_(setup, 2, "%s('%s'): connecting ...\n",
865 conn->netdev->name, conn->userid); 871 netdev->name, conn->userid);
866 872
867 /* 873 /*
868 * We must set the state before calling iucv_connect because the 874 * We must set the state before calling iucv_connect because the
@@ -876,41 +882,45 @@ static void conn_action_start(fsm_instance *fi, int event, void *arg)
876 NULL, iucvMagic, conn); 882 NULL, iucvMagic, conn);
877 switch (rc) { 883 switch (rc) {
878 case 0: 884 case 0:
879 conn->netdev->tx_queue_len = conn->path->msglim; 885 netdev->tx_queue_len = conn->path->msglim;
880 fsm_addtimer(&conn->timer, NETIUCV_TIMEOUT_5SEC, 886 fsm_addtimer(&conn->timer, NETIUCV_TIMEOUT_5SEC,
881 CONN_EVENT_TIMER, conn); 887 CONN_EVENT_TIMER, conn);
882 return; 888 return;
883 case 11: 889 case 11:
884 PRINT_INFO("%s: User %s is currently not available.\n", 890 dev_warn(privptr->dev,
885 conn->netdev->name, 891 "The IUCV device failed to connect to z/VM guest %s\n",
886 netiucv_printname(conn->userid)); 892 netiucv_printname(conn->userid));
887 fsm_newstate(fi, CONN_STATE_STARTWAIT); 893 fsm_newstate(fi, CONN_STATE_STARTWAIT);
888 break; 894 break;
889 case 12: 895 case 12:
890 PRINT_INFO("%s: User %s is currently not ready.\n", 896 dev_warn(privptr->dev,
891 conn->netdev->name, 897 "The IUCV device failed to connect to the peer on z/VM"
892 netiucv_printname(conn->userid)); 898 " guest %s\n", netiucv_printname(conn->userid));
893 fsm_newstate(fi, CONN_STATE_STARTWAIT); 899 fsm_newstate(fi, CONN_STATE_STARTWAIT);
894 break; 900 break;
895 case 13: 901 case 13:
896 PRINT_WARN("%s: Too many IUCV connections.\n", 902 dev_err(privptr->dev,
897 conn->netdev->name); 903 "Connecting the IUCV device would exceed the maximum"
904 " number of IUCV connections\n");
898 fsm_newstate(fi, CONN_STATE_CONNERR); 905 fsm_newstate(fi, CONN_STATE_CONNERR);
899 break; 906 break;
900 case 14: 907 case 14:
901 PRINT_WARN("%s: User %s has too many IUCV connections.\n", 908 dev_err(privptr->dev,
902 conn->netdev->name, 909 "z/VM guest %s has too many IUCV connections"
903 netiucv_printname(conn->userid)); 910 " to connect with the IUCV device\n",
911 netiucv_printname(conn->userid));
904 fsm_newstate(fi, CONN_STATE_CONNERR); 912 fsm_newstate(fi, CONN_STATE_CONNERR);
905 break; 913 break;
906 case 15: 914 case 15:
907 PRINT_WARN("%s: No IUCV authorization in CP directory.\n", 915 dev_err(privptr->dev,
908 conn->netdev->name); 916 "The IUCV device cannot connect to a z/VM guest with no"
917 " IUCV authorization\n");
909 fsm_newstate(fi, CONN_STATE_CONNERR); 918 fsm_newstate(fi, CONN_STATE_CONNERR);
910 break; 919 break;
911 default: 920 default:
912 PRINT_WARN("%s: iucv_connect returned error %d\n", 921 dev_err(privptr->dev,
913 conn->netdev->name, rc); 922 "Connecting the IUCV device failed with error %d\n",
923 rc);
914 fsm_newstate(fi, CONN_STATE_CONNERR); 924 fsm_newstate(fi, CONN_STATE_CONNERR);
915 break; 925 break;
916 } 926 }
@@ -1059,8 +1069,9 @@ dev_action_connup(fsm_instance *fi, int event, void *arg)
1059 switch (fsm_getstate(fi)) { 1069 switch (fsm_getstate(fi)) {
1060 case DEV_STATE_STARTWAIT: 1070 case DEV_STATE_STARTWAIT:
1061 fsm_newstate(fi, DEV_STATE_RUNNING); 1071 fsm_newstate(fi, DEV_STATE_RUNNING);
1062 PRINT_INFO("%s: connected with remote side %s\n", 1072 dev_info(privptr->dev,
1063 dev->name, privptr->conn->userid); 1073 "The IUCV device has been connected"
1074 " successfully to %s\n", privptr->conn->userid);
1064 IUCV_DBF_TEXT(setup, 3, 1075 IUCV_DBF_TEXT(setup, 3,
1065 "connection is up and running\n"); 1076 "connection is up and running\n");
1066 break; 1077 break;
@@ -1982,6 +1993,8 @@ static ssize_t conn_write(struct device_driver *drv,
1982 if (rc) 1993 if (rc)
1983 goto out_unreg; 1994 goto out_unreg;
1984 1995
1996 dev_info(priv->dev, "The IUCV interface to %s has been"
1997 " established successfully\n", netiucv_printname(username));
1985 1998
1986 return count; 1999 return count;
1987 2000
@@ -2027,10 +2040,9 @@ static ssize_t remove_write (struct device_driver *drv,
2027 continue; 2040 continue;
2028 read_unlock_bh(&iucv_connection_rwlock); 2041 read_unlock_bh(&iucv_connection_rwlock);
2029 if (ndev->flags & (IFF_UP | IFF_RUNNING)) { 2042 if (ndev->flags & (IFF_UP | IFF_RUNNING)) {
2030 PRINT_WARN("netiucv: net device %s active with peer " 2043 dev_warn(dev, "The IUCV device is connected"
2031 "%s\n", ndev->name, priv->conn->userid); 2044 " to %s and cannot be removed\n",
2032 PRINT_WARN("netiucv: %s cannot be removed\n", 2045 priv->conn->userid);
2033 ndev->name);
2034 IUCV_DBF_TEXT(data, 2, "remove_write: still active\n"); 2046 IUCV_DBF_TEXT(data, 2, "remove_write: still active\n");
2035 return -EPERM; 2047 return -EPERM;
2036 } 2048 }
@@ -2062,7 +2074,7 @@ static struct attribute_group *netiucv_drv_attr_groups[] = {
2062 2074
2063static void netiucv_banner(void) 2075static void netiucv_banner(void)
2064{ 2076{
2065 PRINT_INFO("NETIUCV driver initialized\n"); 2077 pr_info("driver initialized\n");
2066} 2078}
2067 2079
2068static void __exit netiucv_exit(void) 2080static void __exit netiucv_exit(void)
@@ -2088,7 +2100,7 @@ static void __exit netiucv_exit(void)
2088 iucv_unregister(&netiucv_handler, 1); 2100 iucv_unregister(&netiucv_handler, 1);
2089 iucv_unregister_dbf_views(); 2101 iucv_unregister_dbf_views();
2090 2102
2091 PRINT_INFO("NETIUCV driver unloaded\n"); 2103 pr_info("driver unloaded\n");
2092 return; 2104 return;
2093} 2105}
2094 2106
diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c
index 29f7baa25110..af3192d2a5a3 100644
--- a/net/iucv/af_iucv.c
+++ b/net/iucv/af_iucv.c
@@ -8,6 +8,9 @@
8 * Author(s): Jennifer Hunt <jenhunt@us.ibm.com> 8 * Author(s): Jennifer Hunt <jenhunt@us.ibm.com>
9 */ 9 */
10 10
11#define KMSG_COMPONENT "af_iucv"
12#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
13
11#include <linux/module.h> 14#include <linux/module.h>
12#include <linux/types.h> 15#include <linux/types.h>
13#include <linux/list.h> 16#include <linux/list.h>
@@ -616,6 +619,8 @@ static int iucv_sock_sendmsg(struct kiocb *iocb, struct socket *sock,
616 struct iucv_sock *iucv = iucv_sk(sk); 619 struct iucv_sock *iucv = iucv_sk(sk);
617 struct sk_buff *skb; 620 struct sk_buff *skb;
618 struct iucv_message txmsg; 621 struct iucv_message txmsg;
622 char user_id[9];
623 char appl_id[9];
619 int err; 624 int err;
620 625
621 err = sock_error(sk); 626 err = sock_error(sk);
@@ -651,8 +656,15 @@ static int iucv_sock_sendmsg(struct kiocb *iocb, struct socket *sock,
651 err = iucv_message_send(iucv->path, &txmsg, 0, 0, 656 err = iucv_message_send(iucv->path, &txmsg, 0, 0,
652 (void *) skb->data, skb->len); 657 (void *) skb->data, skb->len);
653 if (err) { 658 if (err) {
654 if (err == 3) 659 if (err == 3) {
655 printk(KERN_ERR "AF_IUCV msg limit exceeded\n"); 660 user_id[8] = 0;
661 memcpy(user_id, iucv->dst_user_id, 8);
662 appl_id[8] = 0;
663 memcpy(appl_id, iucv->dst_name, 8);
664 pr_err("Application %s on z/VM guest %s"
665 " exceeds message limit\n",
666 user_id, appl_id);
667 }
656 skb_unlink(skb, &iucv->send_skb_q); 668 skb_unlink(skb, &iucv->send_skb_q);
657 err = -EPIPE; 669 err = -EPIPE;
658 goto fail; 670 goto fail;
@@ -1190,7 +1202,8 @@ static int __init afiucv_init(void)
1190 int err; 1202 int err;
1191 1203
1192 if (!MACHINE_IS_VM) { 1204 if (!MACHINE_IS_VM) {
1193 printk(KERN_ERR "AF_IUCV connection needs VM as base\n"); 1205 pr_err("The af_iucv module cannot be loaded"
1206 " without z/VM\n");
1194 err = -EPROTONOSUPPORT; 1207 err = -EPROTONOSUPPORT;
1195 goto out; 1208 goto out;
1196 } 1209 }
diff --git a/net/iucv/iucv.c b/net/iucv/iucv.c
index 6bf51f7e597f..8f57d4f4328a 100644
--- a/net/iucv/iucv.c
+++ b/net/iucv/iucv.c
@@ -30,6 +30,9 @@
30 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 30 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
31 */ 31 */
32 32
33#define KMSG_COMPONENT "iucv"
34#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
35
33#include <linux/module.h> 36#include <linux/module.h>
34#include <linux/moduleparam.h> 37#include <linux/moduleparam.h>
35#include <linux/spinlock.h> 38#include <linux/spinlock.h>
@@ -424,8 +427,8 @@ static void iucv_declare_cpu(void *data)
424 err = "Paging or storage error"; 427 err = "Paging or storage error";
425 break; 428 break;
426 } 429 }
427 printk(KERN_WARNING "iucv_register: iucv_declare_buffer " 430 pr_warning("Defining an interrupt buffer on CPU %i"
428 "on cpu %i returned error 0x%02x (%s)\n", cpu, rc, err); 431 " failed with 0x%02x (%s)\n", cpu, rc, err);
429 return; 432 return;
430 } 433 }
431 434
@@ -1652,7 +1655,7 @@ static void iucv_external_interrupt(u16 code)
1652 BUG_ON(p->iptype < 0x01 || p->iptype > 0x09); 1655 BUG_ON(p->iptype < 0x01 || p->iptype > 0x09);
1653 work = kmalloc(sizeof(struct iucv_irq_list), GFP_ATOMIC); 1656 work = kmalloc(sizeof(struct iucv_irq_list), GFP_ATOMIC);
1654 if (!work) { 1657 if (!work) {
1655 printk(KERN_WARNING "iucv_external_interrupt: out of memory\n"); 1658 pr_warning("iucv_external_interrupt: out of memory\n");
1656 return; 1659 return;
1657 } 1660 }
1658 memcpy(&work->data, p, sizeof(work->data)); 1661 memcpy(&work->data, p, sizeof(work->data));