aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-05-26 22:01:26 -0400
committerJeff Garzik <jeff@garzik.org>2006-05-26 22:01:26 -0400
commit983f27d37d4fc72c252835cb2ee3103b360735a6 (patch)
tree8a7d3c3e251db494e285896debeb906473178a3e /drivers/s390
parentde1e938e54deba5b093a3074dfafd0d11afacbe1 (diff)
parente82b0f2cc21be905e504573483fa9542b15df96f (diff)
Merge branch 'upstream-fixes' into upstream
Conflicts: drivers/s390/net/ctctty.c
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/net/ctcmain.c26
-rw-r--r--drivers/s390/net/cu3088.c10
-rw-r--r--drivers/s390/net/iucv.c36
-rw-r--r--drivers/s390/net/iucv.h622
-rw-r--r--drivers/s390/net/lcs.c345
-rw-r--r--drivers/s390/net/lcs.h14
-rw-r--r--drivers/s390/net/netiucv.c36
-rw-r--r--drivers/s390/net/qeth.h18
-rw-r--r--drivers/s390/net/qeth_eddp.c18
-rw-r--r--drivers/s390/net/qeth_fs.h2
-rw-r--r--drivers/s390/net/qeth_main.c107
-rw-r--r--drivers/s390/net/qeth_mpc.h4
-rw-r--r--drivers/s390/net/qeth_proc.c8
-rw-r--r--drivers/s390/net/qeth_sys.c6
-rw-r--r--drivers/s390/net/qeth_tso.h4
15 files changed, 632 insertions, 624 deletions
diff --git a/drivers/s390/net/ctcmain.c b/drivers/s390/net/ctcmain.c
index e2ccaf55961c..20c8eb16f464 100644
--- a/drivers/s390/net/ctcmain.c
+++ b/drivers/s390/net/ctcmain.c
@@ -1481,13 +1481,13 @@ ch_action_iofatal(fsm_instance * fi, int event, void *arg)
1481 } 1481 }
1482} 1482}
1483 1483
1484static void 1484static void
1485ch_action_reinit(fsm_instance *fi, int event, void *arg) 1485ch_action_reinit(fsm_instance *fi, int event, void *arg)
1486{ 1486{
1487 struct channel *ch = (struct channel *)arg; 1487 struct channel *ch = (struct channel *)arg;
1488 struct net_device *dev = ch->netdev; 1488 struct net_device *dev = ch->netdev;
1489 struct ctc_priv *privptr = dev->priv; 1489 struct ctc_priv *privptr = dev->priv;
1490 1490
1491 DBF_TEXT(trace, 4, __FUNCTION__); 1491 DBF_TEXT(trace, 4, __FUNCTION__);
1492 ch_action_iofatal(fi, event, arg); 1492 ch_action_iofatal(fi, event, arg);
1493 fsm_addtimer(&privptr->restart_timer, 1000, DEV_EVENT_RESTART, dev); 1493 fsm_addtimer(&privptr->restart_timer, 1000, DEV_EVENT_RESTART, dev);
@@ -1619,7 +1619,7 @@ less_than(char *id1, char *id2)
1619 } 1619 }
1620 dev1 = simple_strtoul(id1, &id1, 16); 1620 dev1 = simple_strtoul(id1, &id1, 16);
1621 dev2 = simple_strtoul(id2, &id2, 16); 1621 dev2 = simple_strtoul(id2, &id2, 16);
1622 1622
1623 return (dev1 < dev2); 1623 return (dev1 < dev2);
1624} 1624}
1625 1625
@@ -1890,7 +1890,7 @@ ctc_irq_handler(struct ccw_device *cdev, unsigned long intparm, struct irb *irb)
1890 irb->scsw.dstat); 1890 irb->scsw.dstat);
1891 return; 1891 return;
1892 } 1892 }
1893 1893
1894 priv = ((struct ccwgroup_device *)cdev->dev.driver_data) 1894 priv = ((struct ccwgroup_device *)cdev->dev.driver_data)
1895 ->dev.driver_data; 1895 ->dev.driver_data;
1896 1896
@@ -1904,7 +1904,7 @@ ctc_irq_handler(struct ccw_device *cdev, unsigned long intparm, struct irb *irb)
1904 "device %s\n", cdev->dev.bus_id); 1904 "device %s\n", cdev->dev.bus_id);
1905 return; 1905 return;
1906 } 1906 }
1907 1907
1908 dev = (struct net_device *) (ch->netdev); 1908 dev = (struct net_device *) (ch->netdev);
1909 if (dev == NULL) { 1909 if (dev == NULL) {
1910 ctc_pr_crit("ctc: ctc_irq_handler dev=NULL bus_id=%s, ch=0x%p\n", 1910 ctc_pr_crit("ctc: ctc_irq_handler dev=NULL bus_id=%s, ch=0x%p\n",
@@ -2003,12 +2003,12 @@ dev_action_stop(fsm_instance * fi, int event, void *arg)
2003 fsm_event(ch->fsm, CH_EVENT_STOP, ch); 2003 fsm_event(ch->fsm, CH_EVENT_STOP, ch);
2004 } 2004 }
2005} 2005}
2006static void 2006static void
2007dev_action_restart(fsm_instance *fi, int event, void *arg) 2007dev_action_restart(fsm_instance *fi, int event, void *arg)
2008{ 2008{
2009 struct net_device *dev = (struct net_device *)arg; 2009 struct net_device *dev = (struct net_device *)arg;
2010 struct ctc_priv *privptr = dev->priv; 2010 struct ctc_priv *privptr = dev->priv;
2011 2011
2012 DBF_TEXT(trace, 3, __FUNCTION__); 2012 DBF_TEXT(trace, 3, __FUNCTION__);
2013 ctc_pr_debug("%s: Restarting\n", dev->name); 2013 ctc_pr_debug("%s: Restarting\n", dev->name);
2014 dev_action_stop(fi, event, arg); 2014 dev_action_stop(fi, event, arg);
@@ -2179,7 +2179,7 @@ transmit_skb(struct channel *ch, struct sk_buff *skb)
2179 2179
2180 DBF_TEXT(trace, 5, __FUNCTION__); 2180 DBF_TEXT(trace, 5, __FUNCTION__);
2181 /* we need to acquire the lock for testing the state 2181 /* we need to acquire the lock for testing the state
2182 * otherwise we can have an IRQ changing the state to 2182 * otherwise we can have an IRQ changing the state to
2183 * TXIDLE after the test but before acquiring the lock. 2183 * TXIDLE after the test but before acquiring the lock.
2184 */ 2184 */
2185 spin_lock_irqsave(&ch->collect_lock, saveflags); 2185 spin_lock_irqsave(&ch->collect_lock, saveflags);
@@ -2379,7 +2379,7 @@ ctc_tx(struct sk_buff *skb, struct net_device * dev)
2379 2379
2380 /** 2380 /**
2381 * If channels are not running, try to restart them 2381 * If channels are not running, try to restart them
2382 * and throw away packet. 2382 * and throw away packet.
2383 */ 2383 */
2384 if (fsm_getstate(privptr->fsm) != DEV_STATE_RUNNING) { 2384 if (fsm_getstate(privptr->fsm) != DEV_STATE_RUNNING) {
2385 fsm_event(privptr->fsm, DEV_EVENT_START, dev); 2385 fsm_event(privptr->fsm, DEV_EVENT_START, dev);
@@ -2717,7 +2717,7 @@ ctc_remove_files(struct device *dev)
2717/** 2717/**
2718 * Add ctc specific attributes. 2718 * Add ctc specific attributes.
2719 * Add ctc private data. 2719 * Add ctc private data.
2720 * 2720 *
2721 * @param cgdev pointer to ccwgroup_device just added 2721 * @param cgdev pointer to ccwgroup_device just added
2722 * 2722 *
2723 * @returns 0 on success, !0 on failure. 2723 * @returns 0 on success, !0 on failure.
@@ -2848,7 +2848,7 @@ ctc_new_device(struct ccwgroup_device *cgdev)
2848 DBF_TEXT(setup, 3, buffer); 2848 DBF_TEXT(setup, 3, buffer);
2849 2849
2850 type = get_channel_type(&cgdev->cdev[0]->id); 2850 type = get_channel_type(&cgdev->cdev[0]->id);
2851 2851
2852 snprintf(read_id, CTC_ID_SIZE, "ch-%s", cgdev->cdev[0]->dev.bus_id); 2852 snprintf(read_id, CTC_ID_SIZE, "ch-%s", cgdev->cdev[0]->dev.bus_id);
2853 snprintf(write_id, CTC_ID_SIZE, "ch-%s", cgdev->cdev[1]->dev.bus_id); 2853 snprintf(write_id, CTC_ID_SIZE, "ch-%s", cgdev->cdev[1]->dev.bus_id);
2854 2854
@@ -2883,7 +2883,7 @@ ctc_new_device(struct ccwgroup_device *cgdev)
2883 channel_get(type, direction == READ ? read_id : write_id, 2883 channel_get(type, direction == READ ? read_id : write_id,
2884 direction); 2884 direction);
2885 if (privptr->channel[direction] == NULL) { 2885 if (privptr->channel[direction] == NULL) {
2886 if (direction == WRITE) 2886 if (direction == WRITE)
2887 channel_free(privptr->channel[READ]); 2887 channel_free(privptr->channel[READ]);
2888 2888
2889 ctc_free_netdevice(dev, 1); 2889 ctc_free_netdevice(dev, 1);
@@ -2931,7 +2931,7 @@ ctc_shutdown_device(struct ccwgroup_device *cgdev)
2931{ 2931{
2932 struct ctc_priv *priv; 2932 struct ctc_priv *priv;
2933 struct net_device *ndev; 2933 struct net_device *ndev;
2934 2934
2935 DBF_TEXT(setup, 3, __FUNCTION__); 2935 DBF_TEXT(setup, 3, __FUNCTION__);
2936 pr_debug("%s() called\n", __FUNCTION__); 2936 pr_debug("%s() called\n", __FUNCTION__);
2937 2937
diff --git a/drivers/s390/net/cu3088.c b/drivers/s390/net/cu3088.c
index b12533104c1f..e965f03a7291 100644
--- a/drivers/s390/net/cu3088.c
+++ b/drivers/s390/net/cu3088.c
@@ -20,7 +20,7 @@
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 * 21 *
22 */ 22 */
23 23
24#include <linux/init.h> 24#include <linux/init.h>
25#include <linux/module.h> 25#include <linux/module.h>
26#include <linux/err.h> 26#include <linux/err.h>
@@ -77,7 +77,7 @@ group_write(struct device_driver *drv, const char *buf, size_t count)
77 int len; 77 int len;
78 78
79 if (!(end = strchr(start, delim[i]))) 79 if (!(end = strchr(start, delim[i])))
80 return count; 80 return -EINVAL;
81 len = min_t(ptrdiff_t, BUS_ID_SIZE, end - start + 1); 81 len = min_t(ptrdiff_t, BUS_ID_SIZE, end - start + 1);
82 strlcpy (bus_ids[i], start, len); 82 strlcpy (bus_ids[i], start, len);
83 argv[i] = bus_ids[i]; 83 argv[i] = bus_ids[i];
@@ -94,7 +94,7 @@ static DRIVER_ATTR(group, 0200, NULL, group_write);
94 94
95/* Register-unregister for ctc&lcs */ 95/* Register-unregister for ctc&lcs */
96int 96int
97register_cu3088_discipline(struct ccwgroup_driver *dcp) 97register_cu3088_discipline(struct ccwgroup_driver *dcp)
98{ 98{
99 int rc; 99 int rc;
100 100
@@ -109,7 +109,7 @@ register_cu3088_discipline(struct ccwgroup_driver *dcp)
109 rc = driver_create_file(&dcp->driver, &driver_attr_group); 109 rc = driver_create_file(&dcp->driver, &driver_attr_group);
110 if (rc) 110 if (rc)
111 ccwgroup_driver_unregister(dcp); 111 ccwgroup_driver_unregister(dcp);
112 112
113 return rc; 113 return rc;
114 114
115} 115}
@@ -137,7 +137,7 @@ static int __init
137cu3088_init (void) 137cu3088_init (void)
138{ 138{
139 int rc; 139 int rc;
140 140
141 cu3088_root_dev = s390_root_dev_register("cu3088"); 141 cu3088_root_dev = s390_root_dev_register("cu3088");
142 if (IS_ERR(cu3088_root_dev)) 142 if (IS_ERR(cu3088_root_dev))
143 return PTR_ERR(cu3088_root_dev); 143 return PTR_ERR(cu3088_root_dev);
diff --git a/drivers/s390/net/iucv.c b/drivers/s390/net/iucv.c
index 6190be9dca99..e0c7deb98831 100644
--- a/drivers/s390/net/iucv.c
+++ b/drivers/s390/net/iucv.c
@@ -1,4 +1,4 @@
1/* 1/*
2 * IUCV network driver 2 * IUCV network driver
3 * 3 *
4 * Copyright (C) 2001 IBM Deutschland Entwicklung GmbH, IBM Corporation 4 * Copyright (C) 2001 IBM Deutschland Entwicklung GmbH, IBM Corporation
@@ -28,7 +28,7 @@
28 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 28 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29 * 29 *
30 */ 30 */
31 31
32/* #define DEBUG */ 32/* #define DEBUG */
33 33
34#include <linux/module.h> 34#include <linux/module.h>
@@ -81,7 +81,7 @@ iucv_bus_match (struct device *dev, struct device_driver *drv)
81struct bus_type iucv_bus = { 81struct bus_type iucv_bus = {
82 .name = "iucv", 82 .name = "iucv",
83 .match = iucv_bus_match, 83 .match = iucv_bus_match,
84}; 84};
85 85
86struct device *iucv_root; 86struct device *iucv_root;
87 87
@@ -297,7 +297,7 @@ MODULE_LICENSE("GPL");
297/* 297/*
298 * Debugging stuff 298 * Debugging stuff
299 *******************************************************************************/ 299 *******************************************************************************/
300 300
301 301
302#ifdef DEBUG 302#ifdef DEBUG
303static int debuglevel = 0; 303static int debuglevel = 0;
@@ -344,7 +344,7 @@ do { \
344/* 344/*
345 * Internal functions 345 * Internal functions
346 *******************************************************************************/ 346 *******************************************************************************/
347 347
348/** 348/**
349 * print start banner 349 * print start banner
350 */ 350 */
@@ -810,7 +810,7 @@ iucv_register_program (__u8 pgmname[16],
810 sizeof (new_handler->id.userid)); 810 sizeof (new_handler->id.userid));
811 EBC_TOUPPER (new_handler->id.userid, 811 EBC_TOUPPER (new_handler->id.userid,
812 sizeof (new_handler->id.userid)); 812 sizeof (new_handler->id.userid));
813 813
814 if (pgmmask) { 814 if (pgmmask) {
815 memcpy (new_handler->id.mask, pgmmask, 815 memcpy (new_handler->id.mask, pgmmask,
816 sizeof (new_handler->id.mask)); 816 sizeof (new_handler->id.mask));
@@ -1229,7 +1229,7 @@ iucv_purge (__u16 pathid, __u32 msgid, __u32 srccls, __u32 *audit)
1229 /* parm->ipaudit has only 3 bytes */ 1229 /* parm->ipaudit has only 3 bytes */
1230 *audit >>= 8; 1230 *audit >>= 8;
1231 } 1231 }
1232 1232
1233 release_param(parm); 1233 release_param(parm);
1234 1234
1235 iucv_debug(1, "b2f0_result = %ld", b2f0_result); 1235 iucv_debug(1, "b2f0_result = %ld", b2f0_result);
@@ -2330,14 +2330,14 @@ iucv_do_int(iucv_GeneralInterrupt * int_buf)
2330 temp_buff1[j] &= (h->id.mask)[j]; 2330 temp_buff1[j] &= (h->id.mask)[j];
2331 temp_buff2[j] &= (h->id.mask)[j]; 2331 temp_buff2[j] &= (h->id.mask)[j];
2332 } 2332 }
2333 2333
2334 iucv_dumpit("temp_buff1:", 2334 iucv_dumpit("temp_buff1:",
2335 temp_buff1, sizeof(temp_buff1)); 2335 temp_buff1, sizeof(temp_buff1));
2336 iucv_dumpit("temp_buff2", 2336 iucv_dumpit("temp_buff2",
2337 temp_buff2, sizeof(temp_buff2)); 2337 temp_buff2, sizeof(temp_buff2));
2338 2338
2339 if (!memcmp (temp_buff1, temp_buff2, 24)) { 2339 if (!memcmp (temp_buff1, temp_buff2, 24)) {
2340 2340
2341 iucv_debug(2, 2341 iucv_debug(2,
2342 "found a matching handler"); 2342 "found a matching handler");
2343 break; 2343 break;
@@ -2368,7 +2368,7 @@ iucv_do_int(iucv_GeneralInterrupt * int_buf)
2368 } else 2368 } else
2369 iucv_sever(int_buf->ippathid, no_listener); 2369 iucv_sever(int_buf->ippathid, no_listener);
2370 break; 2370 break;
2371 2371
2372 case 0x02: /*connection complete */ 2372 case 0x02: /*connection complete */
2373 if (messagesDisabled) { 2373 if (messagesDisabled) {
2374 iucv_setmask(~0); 2374 iucv_setmask(~0);
@@ -2387,7 +2387,7 @@ iucv_do_int(iucv_GeneralInterrupt * int_buf)
2387 } else 2387 } else
2388 iucv_sever(int_buf->ippathid, no_listener); 2388 iucv_sever(int_buf->ippathid, no_listener);
2389 break; 2389 break;
2390 2390
2391 case 0x03: /* connection severed */ 2391 case 0x03: /* connection severed */
2392 if (messagesDisabled) { 2392 if (messagesDisabled) {
2393 iucv_setmask(~0); 2393 iucv_setmask(~0);
@@ -2398,13 +2398,13 @@ iucv_do_int(iucv_GeneralInterrupt * int_buf)
2398 interrupt->ConnectionSevered( 2398 interrupt->ConnectionSevered(
2399 (iucv_ConnectionSevered *)int_buf, 2399 (iucv_ConnectionSevered *)int_buf,
2400 h->pgm_data); 2400 h->pgm_data);
2401 2401
2402 else 2402 else
2403 iucv_sever (int_buf->ippathid, no_listener); 2403 iucv_sever (int_buf->ippathid, no_listener);
2404 } else 2404 } else
2405 iucv_sever(int_buf->ippathid, no_listener); 2405 iucv_sever(int_buf->ippathid, no_listener);
2406 break; 2406 break;
2407 2407
2408 case 0x04: /* connection quiesced */ 2408 case 0x04: /* connection quiesced */
2409 if (messagesDisabled) { 2409 if (messagesDisabled) {
2410 iucv_setmask(~0); 2410 iucv_setmask(~0);
@@ -2420,7 +2420,7 @@ iucv_do_int(iucv_GeneralInterrupt * int_buf)
2420 "ConnectionQuiesced not called"); 2420 "ConnectionQuiesced not called");
2421 } 2421 }
2422 break; 2422 break;
2423 2423
2424 case 0x05: /* connection resumed */ 2424 case 0x05: /* connection resumed */
2425 if (messagesDisabled) { 2425 if (messagesDisabled) {
2426 iucv_setmask(~0); 2426 iucv_setmask(~0);
@@ -2436,7 +2436,7 @@ iucv_do_int(iucv_GeneralInterrupt * int_buf)
2436 "ConnectionResumed not called"); 2436 "ConnectionResumed not called");
2437 } 2437 }
2438 break; 2438 break;
2439 2439
2440 case 0x06: /* priority message complete */ 2440 case 0x06: /* priority message complete */
2441 case 0x07: /* nonpriority message complete */ 2441 case 0x07: /* nonpriority message complete */
2442 if (h) { 2442 if (h) {
@@ -2449,7 +2449,7 @@ iucv_do_int(iucv_GeneralInterrupt * int_buf)
2449 "MessageComplete not called"); 2449 "MessageComplete not called");
2450 } 2450 }
2451 break; 2451 break;
2452 2452
2453 case 0x08: /* priority message pending */ 2453 case 0x08: /* priority message pending */
2454 case 0x09: /* nonpriority message pending */ 2454 case 0x09: /* nonpriority message pending */
2455 if (h) { 2455 if (h) {
@@ -2467,7 +2467,7 @@ iucv_do_int(iucv_GeneralInterrupt * int_buf)
2467 __FUNCTION__); 2467 __FUNCTION__);
2468 break; 2468 break;
2469 } /* end switch */ 2469 } /* end switch */
2470 2470
2471 iucv_debug(2, "exiting pathid %d, type %02X", 2471 iucv_debug(2, "exiting pathid %d, type %02X",
2472 int_buf->ippathid, int_buf->iptype); 2472 int_buf->ippathid, int_buf->iptype);
2473 2473
diff --git a/drivers/s390/net/iucv.h b/drivers/s390/net/iucv.h
index 0c4644d3d2f3..5b6b1b7241c9 100644
--- a/drivers/s390/net/iucv.h
+++ b/drivers/s390/net/iucv.h
@@ -4,7 +4,7 @@
4 * 4 *
5 * S390 version 5 * S390 version
6 * Copyright (C) 2000 IBM Corporation 6 * Copyright (C) 2000 IBM Corporation
7 * Author(s):Alan Altmark (Alan_Altmark@us.ibm.com) 7 * Author(s):Alan Altmark (Alan_Altmark@us.ibm.com)
8 * Xenia Tkatschow (xenia@us.ibm.com) 8 * Xenia Tkatschow (xenia@us.ibm.com)
9 * 9 *
10 * 10 *
@@ -16,17 +16,17 @@
16 * CP Programming Services book, also available on the web 16 * CP Programming Services book, also available on the web
17 * thru www.ibm.com/s390/vm/pubs, manual # SC24-5760 17 * thru www.ibm.com/s390/vm/pubs, manual # SC24-5760
18 * 18 *
19 * Definition of Return Codes 19 * Definition of Return Codes
20 * -All positive return codes including zero are reflected back 20 * -All positive return codes including zero are reflected back
21 * from CP except for iucv_register_program. The definition of each 21 * from CP except for iucv_register_program. The definition of each
22 * return code can be found in CP Programming Services book. 22 * return code can be found in CP Programming Services book.
23 * Also available on the web thru www.ibm.com/s390/vm/pubs, manual # SC24-5760 23 * Also available on the web thru www.ibm.com/s390/vm/pubs, manual # SC24-5760
24 * - Return Code of: 24 * - Return Code of:
25 * (-EINVAL) Invalid value 25 * (-EINVAL) Invalid value
26 * (-ENOMEM) storage allocation failed 26 * (-ENOMEM) storage allocation failed
27 * pgmask defined in iucv_register_program will be set depending on input 27 * pgmask defined in iucv_register_program will be set depending on input
28 * paramters. 28 * paramters.
29 * 29 *
30 */ 30 */
31 31
32#include <linux/types.h> 32#include <linux/types.h>
@@ -124,13 +124,13 @@ iucv_hex_dump(unsigned char *buf, size_t len)
124#define iucv_handle_t void * 124#define iucv_handle_t void *
125 125
126/* flags1: 126/* flags1:
127 * All flags are defined in the field IPFLAGS1 of each function 127 * All flags are defined in the field IPFLAGS1 of each function
128 * and can be found in CP Programming Services. 128 * and can be found in CP Programming Services.
129 * IPLOCAL - Indicates the connect can only be satisfied on the 129 * IPLOCAL - Indicates the connect can only be satisfied on the
130 * local system 130 * local system
131 * IPPRTY - Indicates a priority message 131 * IPPRTY - Indicates a priority message
132 * IPQUSCE - Indicates you do not want to receive messages on a 132 * IPQUSCE - Indicates you do not want to receive messages on a
133 * path until an iucv_resume is issued 133 * path until an iucv_resume is issued
134 * IPRMDATA - Indicates that the message is in the parameter list 134 * IPRMDATA - Indicates that the message is in the parameter list
135 */ 135 */
136#define IPLOCAL 0x01 136#define IPLOCAL 0x01
@@ -154,14 +154,14 @@ iucv_hex_dump(unsigned char *buf, size_t len)
154#define AllInterrupts 0xf8 154#define AllInterrupts 0xf8
155/* 155/*
156 * Mapping of external interrupt buffers should be used with the corresponding 156 * Mapping of external interrupt buffers should be used with the corresponding
157 * interrupt types. 157 * interrupt types.
158 * Names: iucv_ConnectionPending -> connection pending 158 * Names: iucv_ConnectionPending -> connection pending
159 * iucv_ConnectionComplete -> connection complete 159 * iucv_ConnectionComplete -> connection complete
160 * iucv_ConnectionSevered -> connection severed 160 * iucv_ConnectionSevered -> connection severed
161 * iucv_ConnectionQuiesced -> connection quiesced 161 * iucv_ConnectionQuiesced -> connection quiesced
162 * iucv_ConnectionResumed -> connection resumed 162 * iucv_ConnectionResumed -> connection resumed
163 * iucv_MessagePending -> message pending 163 * iucv_MessagePending -> message pending
164 * iucv_MessageComplete -> message complete 164 * iucv_MessageComplete -> message complete
165 */ 165 */
166typedef struct { 166typedef struct {
167 u16 ippathid; 167 u16 ippathid;
@@ -260,16 +260,16 @@ typedef struct {
260 uchar res2[3]; 260 uchar res2[3];
261} iucv_MessageComplete; 261} iucv_MessageComplete;
262 262
263/* 263/*
264 * iucv_interrupt_ops_t: Is a vector of functions that handle 264 * iucv_interrupt_ops_t: Is a vector of functions that handle
265 * IUCV interrupts. 265 * IUCV interrupts.
266 * Parameter list: 266 * Parameter list:
267 * eib - is a pointer to a 40-byte area described 267 * eib - is a pointer to a 40-byte area described
268 * with one of the structures above. 268 * with one of the structures above.
269 * pgm_data - this data is strictly for the 269 * pgm_data - this data is strictly for the
270 * interrupt handler that is passed by 270 * interrupt handler that is passed by
271 * the application. This may be an address 271 * the application. This may be an address
272 * or token. 272 * or token.
273*/ 273*/
274typedef struct { 274typedef struct {
275 void (*ConnectionPending) (iucv_ConnectionPending * eib, 275 void (*ConnectionPending) (iucv_ConnectionPending * eib,
@@ -287,8 +287,8 @@ typedef struct {
287} iucv_interrupt_ops_t; 287} iucv_interrupt_ops_t;
288 288
289/* 289/*
290 *iucv_array_t : Defines buffer array. 290 *iucv_array_t : Defines buffer array.
291 * Inside the array may be 31- bit addresses and 31-bit lengths. 291 * Inside the array may be 31- bit addresses and 31-bit lengths.
292*/ 292*/
293typedef struct { 293typedef struct {
294 u32 address; 294 u32 address;
@@ -299,19 +299,19 @@ extern struct bus_type iucv_bus;
299extern struct device *iucv_root; 299extern struct device *iucv_root;
300 300
301/* -prototypes- */ 301/* -prototypes- */
302/* 302/*
303 * Name: iucv_register_program 303 * Name: iucv_register_program
304 * Purpose: Registers an application with IUCV 304 * Purpose: Registers an application with IUCV
305 * Input: prmname - user identification 305 * Input: prmname - user identification
306 * userid - machine identification 306 * userid - machine identification
307 * pgmmask - indicates which bits in the prmname and userid combined will be 307 * pgmmask - indicates which bits in the prmname and userid combined will be
308 * used to determine who is given control 308 * used to determine who is given control
309 * ops - address of vector of interrupt handlers 309 * ops - address of vector of interrupt handlers
310 * pgm_data- application data passed to interrupt handlers 310 * pgm_data- application data passed to interrupt handlers
311 * Output: NA 311 * Output: NA
312 * Return: address of handler 312 * Return: address of handler
313 * (0) - Error occurred, registration not completed. 313 * (0) - Error occurred, registration not completed.
314 * NOTE: Exact cause of failure will be recorded in syslog. 314 * NOTE: Exact cause of failure will be recorded in syslog.
315*/ 315*/
316iucv_handle_t iucv_register_program (uchar pgmname[16], 316iucv_handle_t iucv_register_program (uchar pgmname[16],
317 uchar userid[8], 317 uchar userid[8],
@@ -319,13 +319,13 @@ iucv_handle_t iucv_register_program (uchar pgmname[16],
319 iucv_interrupt_ops_t * ops, 319 iucv_interrupt_ops_t * ops,
320 void *pgm_data); 320 void *pgm_data);
321 321
322/* 322/*
323 * Name: iucv_unregister_program 323 * Name: iucv_unregister_program
324 * Purpose: Unregister application with IUCV 324 * Purpose: Unregister application with IUCV
325 * Input: address of handler 325 * Input: address of handler
326 * Output: NA 326 * Output: NA
327 * Return: (0) - Normal return 327 * Return: (0) - Normal return
328 * (-EINVAL) - Internal error, wild pointer 328 * (-EINVAL) - Internal error, wild pointer
329*/ 329*/
330int iucv_unregister_program (iucv_handle_t handle); 330int iucv_unregister_program (iucv_handle_t handle);
331 331
@@ -333,7 +333,7 @@ int iucv_unregister_program (iucv_handle_t handle);
333 * Name: iucv_accept 333 * Name: iucv_accept
334 * Purpose: This function is issued after the user receives a Connection Pending external 334 * Purpose: This function is issued after the user receives a Connection Pending external
335 * interrupt and now wishes to complete the IUCV communication path. 335 * interrupt and now wishes to complete the IUCV communication path.
336 * Input: pathid - u16 , Path identification number 336 * Input: pathid - u16 , Path identification number
337 * msglim_reqstd - u16, The number of outstanding messages requested. 337 * msglim_reqstd - u16, The number of outstanding messages requested.
338 * user_data - uchar[16], Data specified by the iucv_connect function. 338 * user_data - uchar[16], Data specified by the iucv_connect function.
339 * flags1 - int, Contains options for this path. 339 * flags1 - int, Contains options for this path.
@@ -358,34 +358,34 @@ int iucv_accept (u16 pathid,
358 void *pgm_data, int *flags1_out, u16 * msglim); 358 void *pgm_data, int *flags1_out, u16 * msglim);
359 359
360/* 360/*
361 * Name: iucv_connect 361 * Name: iucv_connect
362 * Purpose: This function establishes an IUCV path. Although the connect may complete 362 * Purpose: This function establishes an IUCV path. Although the connect may complete
363 * successfully, you are not able to use the path until you receive an IUCV 363 * successfully, you are not able to use the path until you receive an IUCV
364 * Connection Complete external interrupt. 364 * Connection Complete external interrupt.
365 * Input: pathid - u16 *, Path identification number 365 * Input: pathid - u16 *, Path identification number
366 * msglim_reqstd - u16, Number of outstanding messages requested 366 * msglim_reqstd - u16, Number of outstanding messages requested
367 * user_data - uchar[16], 16-byte user data 367 * user_data - uchar[16], 16-byte user data
368 * userid - uchar[8], User identification 368 * userid - uchar[8], User identification
369 * system_name - uchar[8], 8-byte identifying the system name 369 * system_name - uchar[8], 8-byte identifying the system name
370 * flags1 - int, Contains options for this path. 370 * flags1 - int, Contains options for this path.
371 * -IPPRTY - 0x20, Specifies if you want to send priority message. 371 * -IPPRTY - 0x20, Specifies if you want to send priority message.
372 * -IPRMDATA - 0x80, Specifies whether your program can handle a message 372 * -IPRMDATA - 0x80, Specifies whether your program can handle a message
373 * in the parameter list. 373 * in the parameter list.
374 * -IPQUSCE - 0x40, Specifies whether you want to quiesce the path being 374 * -IPQUSCE - 0x40, Specifies whether you want to quiesce the path being
375 * established. 375 * established.
376 * -IPLOCAL - 0X01, Allows an application to force the partner to be on 376 * -IPLOCAL - 0X01, Allows an application to force the partner to be on
377 * the local system. If local is specified then target class cannot be 377 * the local system. If local is specified then target class cannot be
378 * specified. 378 * specified.
379 * flags1_out - int * Contains information about the path 379 * flags1_out - int * Contains information about the path
380 * - IPPRTY - 0x20, Indicates you may send priority messages. 380 * - IPPRTY - 0x20, Indicates you may send priority messages.
381 * msglim - * u16, Number of outstanding messages 381 * msglim - * u16, Number of outstanding messages
382 * handle - iucv_handle_t, Address of handler 382 * handle - iucv_handle_t, Address of handler
383 * pgm_data - void *, Application data passed to interrupt handlers 383 * pgm_data - void *, Application data passed to interrupt handlers
384 * Output: return code from CP IUCV call 384 * Output: return code from CP IUCV call
385 * rc - return code from iucv_declare_buffer 385 * rc - return code from iucv_declare_buffer
386 * -EINVAL - Invalid handle passed by application 386 * -EINVAL - Invalid handle passed by application
387 * -EINVAL - Pathid address is NULL 387 * -EINVAL - Pathid address is NULL
388 * add_pathid_result - Return code from internal function add_pathid 388 * add_pathid_result - Return code from internal function add_pathid
389*/ 389*/
390int 390int
391 iucv_connect (u16 * pathid, 391 iucv_connect (u16 * pathid,
@@ -397,16 +397,16 @@ int
397 int *flags1_out, 397 int *flags1_out,
398 u16 * msglim, iucv_handle_t handle, void *pgm_data); 398 u16 * msglim, iucv_handle_t handle, void *pgm_data);
399 399
400/* 400/*
401 * Name: iucv_purge 401 * Name: iucv_purge
402 * Purpose: This function cancels a message that you have sent. 402 * Purpose: This function cancels a message that you have sent.
403 * Input: pathid - Path identification number. 403 * Input: pathid - Path identification number.
404 * msgid - Specifies the message ID of the message to be purged. 404 * msgid - Specifies the message ID of the message to be purged.
405 * srccls - Specifies the source message class. 405 * srccls - Specifies the source message class.
406 * Output: audit - Contains information about asynchronous error 406 * Output: audit - Contains information about asynchronous error
407 * that may have affected the normal completion 407 * that may have affected the normal completion
408 * of this message. 408 * of this message.
409 * Return: Return code from CP IUCV call. 409 * Return: Return code from CP IUCV call.
410*/ 410*/
411int iucv_purge (u16 pathid, u32 msgid, u32 srccls, __u32 *audit); 411int iucv_purge (u16 pathid, u32 msgid, u32 srccls, __u32 *audit);
412/* 412/*
@@ -426,38 +426,38 @@ ulong iucv_query_maxconn (void);
426 */ 426 */
427ulong iucv_query_bufsize (void); 427ulong iucv_query_bufsize (void);
428 428
429/* 429/*
430 * Name: iucv_quiesce 430 * Name: iucv_quiesce
431 * Purpose: This function temporarily suspends incoming messages on an 431 * Purpose: This function temporarily suspends incoming messages on an
432 * IUCV path. You can later reactivate the path by invoking 432 * IUCV path. You can later reactivate the path by invoking
433 * the iucv_resume function. 433 * the iucv_resume function.
434 * Input: pathid - Path identification number 434 * Input: pathid - Path identification number
435 * user_data - 16-bytes of user data 435 * user_data - 16-bytes of user data
436 * Output: NA 436 * Output: NA
437 * Return: Return code from CP IUCV call. 437 * Return: Return code from CP IUCV call.
438*/ 438*/
439int iucv_quiesce (u16 pathid, uchar user_data[16]); 439int iucv_quiesce (u16 pathid, uchar user_data[16]);
440 440
441/* 441/*
442 * Name: iucv_receive 442 * Name: iucv_receive
443 * Purpose: This function receives messages that are being sent to you 443 * Purpose: This function receives messages that are being sent to you
444 * over established paths. Data will be returned in buffer for length of 444 * over established paths. Data will be returned in buffer for length of
445 * buflen. 445 * buflen.
446 * Input: 446 * Input:
447 * pathid - Path identification number. 447 * pathid - Path identification number.
448 * buffer - Address of buffer to receive. 448 * buffer - Address of buffer to receive.
449 * buflen - Length of buffer to receive. 449 * buflen - Length of buffer to receive.
450 * msgid - Specifies the message ID. 450 * msgid - Specifies the message ID.
451 * trgcls - Specifies target class. 451 * trgcls - Specifies target class.
452 * Output: 452 * Output:
453 * flags1_out: int *, Contains information about this path. 453 * flags1_out: int *, Contains information about this path.
454 * IPNORPY - 0x10 Specifies this is a one-way message and no reply is 454 * IPNORPY - 0x10 Specifies this is a one-way message and no reply is
455 * expected. 455 * expected.
456 * IPPRTY - 0x20 Specifies if you want to send priority message. 456 * IPPRTY - 0x20 Specifies if you want to send priority message.
457 * IPRMDATA - 0x80 specifies the data is contained in the parameter list 457 * IPRMDATA - 0x80 specifies the data is contained in the parameter list
458 * residual_buffer - address of buffer updated by the number 458 * residual_buffer - address of buffer updated by the number
459 * of bytes you have received. 459 * of bytes you have received.
460 * residual_length - 460 * residual_length -
461 * Contains one of the following values, if the receive buffer is: 461 * Contains one of the following values, if the receive buffer is:
462 * The same length as the message, this field is zero. 462 * The same length as the message, this field is zero.
463 * Longer than the message, this field contains the number of 463 * Longer than the message, this field contains the number of
@@ -466,8 +466,8 @@ int iucv_quiesce (u16 pathid, uchar user_data[16]);
466 * count (that is, the number of bytes remaining in the 466 * count (that is, the number of bytes remaining in the
467 * message that does not fit into the buffer. In this 467 * message that does not fit into the buffer. In this
468 * case b2f0_result = 5. 468 * case b2f0_result = 5.
469 * Return: Return code from CP IUCV call. 469 * Return: Return code from CP IUCV call.
470 * (-EINVAL) - buffer address is pointing to NULL 470 * (-EINVAL) - buffer address is pointing to NULL
471*/ 471*/
472int iucv_receive (u16 pathid, 472int iucv_receive (u16 pathid,
473 u32 msgid, 473 u32 msgid,
@@ -477,16 +477,16 @@ int iucv_receive (u16 pathid,
477 int *flags1_out, 477 int *flags1_out,
478 ulong * residual_buffer, ulong * residual_length); 478 ulong * residual_buffer, ulong * residual_length);
479 479
480 /* 480 /*
481 * Name: iucv_receive_array 481 * Name: iucv_receive_array
482 * Purpose: This function receives messages that are being sent to you 482 * Purpose: This function receives messages that are being sent to you
483 * over established paths. Data will be returned in first buffer for 483 * over established paths. Data will be returned in first buffer for
484 * length of first buffer. 484 * length of first buffer.
485 * Input: pathid - Path identification number. 485 * Input: pathid - Path identification number.
486 * msgid - specifies the message ID. 486 * msgid - specifies the message ID.
487 * trgcls - Specifies target class. 487 * trgcls - Specifies target class.
488 * buffer - Address of array of buffers. 488 * buffer - Address of array of buffers.
489 * buflen - Total length of buffers. 489 * buflen - Total length of buffers.
490 * Output: 490 * Output:
491 * flags1_out: int *, Contains information about this path. 491 * flags1_out: int *, Contains information about this path.
492 * IPNORPY - 0x10 Specifies this is a one-way message and no reply is 492 * IPNORPY - 0x10 Specifies this is a one-way message and no reply is
@@ -504,8 +504,8 @@ int iucv_receive (u16 pathid,
504 * count (that is, the number of bytes remaining in the 504 * count (that is, the number of bytes remaining in the
505 * message that does not fit into the buffer. In this 505 * message that does not fit into the buffer. In this
506 * case b2f0_result = 5. 506 * case b2f0_result = 5.
507 * Return: Return code from CP IUCV call. 507 * Return: Return code from CP IUCV call.
508 * (-EINVAL) - Buffer address is NULL. 508 * (-EINVAL) - Buffer address is NULL.
509 */ 509 */
510int iucv_receive_array (u16 pathid, 510int iucv_receive_array (u16 pathid,
511 u32 msgid, 511 u32 msgid,
@@ -515,44 +515,44 @@ int iucv_receive_array (u16 pathid,
515 int *flags1_out, 515 int *flags1_out,
516 ulong * residual_buffer, ulong * residual_length); 516 ulong * residual_buffer, ulong * residual_length);
517 517
518/* 518/*
519 * Name: iucv_reject 519 * Name: iucv_reject
520 * Purpose: The reject function refuses a specified message. Between the 520 * Purpose: The reject function refuses a specified message. Between the
521 * time you are notified of a message and the time that you 521 * time you are notified of a message and the time that you
522 * complete the message, the message may be rejected. 522 * complete the message, the message may be rejected.
523 * Input: pathid - Path identification number. 523 * Input: pathid - Path identification number.
524 * msgid - Specifies the message ID. 524 * msgid - Specifies the message ID.
525 * trgcls - Specifies target class. 525 * trgcls - Specifies target class.
526 * Output: NA 526 * Output: NA
527 * Return: Return code from CP IUCV call. 527 * Return: Return code from CP IUCV call.
528*/ 528*/
529int iucv_reject (u16 pathid, u32 msgid, u32 trgcls); 529int iucv_reject (u16 pathid, u32 msgid, u32 trgcls);
530 530
531/* 531/*
532 * Name: iucv_reply 532 * Name: iucv_reply
533 * Purpose: This function responds to the two-way messages that you 533 * Purpose: This function responds to the two-way messages that you
534 * receive. You must identify completely the message to 534 * receive. You must identify completely the message to
535 * which you wish to reply. ie, pathid, msgid, and trgcls. 535 * which you wish to reply. ie, pathid, msgid, and trgcls.
536 * Input: pathid - Path identification number. 536 * Input: pathid - Path identification number.
537 * msgid - Specifies the message ID. 537 * msgid - Specifies the message ID.
538 * trgcls - Specifies target class. 538 * trgcls - Specifies target class.
539 * flags1 - Option for path. 539 * flags1 - Option for path.
540 * IPPRTY- 0x20, Specifies if you want to send priority message. 540 * IPPRTY- 0x20, Specifies if you want to send priority message.
541 * buffer - Address of reply buffer. 541 * buffer - Address of reply buffer.
542 * buflen - Length of reply buffer. 542 * buflen - Length of reply buffer.
543 * Output: residual_buffer - Address of buffer updated by the number 543 * Output: residual_buffer - Address of buffer updated by the number
544 * of bytes you have moved. 544 * of bytes you have moved.
545 * residual_length - Contains one of the following values: 545 * residual_length - Contains one of the following values:
546 * If the answer buffer is the same length as the reply, this field 546 * If the answer buffer is the same length as the reply, this field
547 * contains zero. 547 * contains zero.
548 * If the answer buffer is longer than the reply, this field contains 548 * If the answer buffer is longer than the reply, this field contains
549 * the number of bytes remaining in the buffer. 549 * the number of bytes remaining in the buffer.
550 * If the answer buffer is shorter than the reply, this field contains 550 * If the answer buffer is shorter than the reply, this field contains
551 * a residual count (that is, the number of bytes remianing in the 551 * a residual count (that is, the number of bytes remianing in the
552 * reply that does not fit into the buffer. In this 552 * reply that does not fit into the buffer. In this
553 * case b2f0_result = 5. 553 * case b2f0_result = 5.
554 * Return: Return code from CP IUCV call. 554 * Return: Return code from CP IUCV call.
555 * (-EINVAL) - Buffer address is NULL. 555 * (-EINVAL) - Buffer address is NULL.
556*/ 556*/
557int iucv_reply (u16 pathid, 557int iucv_reply (u16 pathid,
558 u32 msgid, 558 u32 msgid,
@@ -561,20 +561,20 @@ int iucv_reply (u16 pathid,
561 void *buffer, ulong buflen, ulong * residual_buffer, 561 void *buffer, ulong buflen, ulong * residual_buffer,
562 ulong * residual_length); 562 ulong * residual_length);
563 563
564/* 564/*
565 * Name: iucv_reply_array 565 * Name: iucv_reply_array
566 * Purpose: This function responds to the two-way messages that you 566 * Purpose: This function responds to the two-way messages that you
567 * receive. You must identify completely the message to 567 * receive. You must identify completely the message to
568 * which you wish to reply. ie, pathid, msgid, and trgcls. 568 * which you wish to reply. ie, pathid, msgid, and trgcls.
569 * The array identifies a list of addresses and lengths of 569 * The array identifies a list of addresses and lengths of
570 * discontiguous buffers that contains the reply data. 570 * discontiguous buffers that contains the reply data.
571 * Input: pathid - Path identification number 571 * Input: pathid - Path identification number
572 * msgid - Specifies the message ID. 572 * msgid - Specifies the message ID.
573 * trgcls - Specifies target class. 573 * trgcls - Specifies target class.
574 * flags1 - Option for path. 574 * flags1 - Option for path.
575 * IPPRTY- 0x20, Specifies if you want to send priority message. 575 * IPPRTY- 0x20, Specifies if you want to send priority message.
576 * buffer - Address of array of reply buffers. 576 * buffer - Address of array of reply buffers.
577 * buflen - Total length of reply buffers. 577 * buflen - Total length of reply buffers.
578 * Output: residual_buffer - Address of buffer which IUCV is currently working on. 578 * Output: residual_buffer - Address of buffer which IUCV is currently working on.
579 * residual_length - Contains one of the following values: 579 * residual_length - Contains one of the following values:
580 * If the answer buffer is the same length as the reply, this field 580 * If the answer buffer is the same length as the reply, this field
@@ -585,8 +585,8 @@ int iucv_reply (u16 pathid,
585 * a residual count (that is, the number of bytes remianing in the 585 * a residual count (that is, the number of bytes remianing in the
586 * reply that does not fit into the buffer. In this 586 * reply that does not fit into the buffer. In this
587 * case b2f0_result = 5. 587 * case b2f0_result = 5.
588 * Return: Return code from CP IUCV call. 588 * Return: Return code from CP IUCV call.
589 * (-EINVAL) - Buffer address is NULL. 589 * (-EINVAL) - Buffer address is NULL.
590*/ 590*/
591int iucv_reply_array (u16 pathid, 591int iucv_reply_array (u16 pathid,
592 u32 msgid, 592 u32 msgid,
@@ -596,77 +596,77 @@ int iucv_reply_array (u16 pathid,
596 ulong buflen, ulong * residual_address, 596 ulong buflen, ulong * residual_address,
597 ulong * residual_length); 597 ulong * residual_length);
598 598
599/* 599/*
600 * Name: iucv_reply_prmmsg 600 * Name: iucv_reply_prmmsg
601 * Purpose: This function responds to the two-way messages that you 601 * Purpose: This function responds to the two-way messages that you
602 * receive. You must identify completely the message to 602 * receive. You must identify completely the message to
603 * which you wish to reply. ie, pathid, msgid, and trgcls. 603 * which you wish to reply. ie, pathid, msgid, and trgcls.
604 * Prmmsg signifies the data is moved into the 604 * Prmmsg signifies the data is moved into the
605 * parameter list. 605 * parameter list.
606 * Input: pathid - Path identification number. 606 * Input: pathid - Path identification number.
607 * msgid - Specifies the message ID. 607 * msgid - Specifies the message ID.
608 * trgcls - Specifies target class. 608 * trgcls - Specifies target class.
609 * flags1 - Option for path. 609 * flags1 - Option for path.
610 * IPPRTY- 0x20 Specifies if you want to send priority message. 610 * IPPRTY- 0x20 Specifies if you want to send priority message.
611 * prmmsg - 8-bytes of data to be placed into the parameter. 611 * prmmsg - 8-bytes of data to be placed into the parameter.
612 * list. 612 * list.
613 * Output: NA 613 * Output: NA
614 * Return: Return code from CP IUCV call. 614 * Return: Return code from CP IUCV call.
615*/ 615*/
616int iucv_reply_prmmsg (u16 pathid, 616int iucv_reply_prmmsg (u16 pathid,
617 u32 msgid, u32 trgcls, int flags1, uchar prmmsg[8]); 617 u32 msgid, u32 trgcls, int flags1, uchar prmmsg[8]);
618 618
619/* 619/*
620 * Name: iucv_resume 620 * Name: iucv_resume
621 * Purpose: This function restores communications over a quiesced path 621 * Purpose: This function restores communications over a quiesced path
622 * Input: pathid - Path identification number. 622 * Input: pathid - Path identification number.
623 * user_data - 16-bytes of user data. 623 * user_data - 16-bytes of user data.
624 * Output: NA 624 * Output: NA
625 * Return: Return code from CP IUCV call. 625 * Return: Return code from CP IUCV call.
626*/ 626*/
627int iucv_resume (u16 pathid, uchar user_data[16]); 627int iucv_resume (u16 pathid, uchar user_data[16]);
628 628
629/* 629/*
630 * Name: iucv_send 630 * Name: iucv_send
631 * Purpose: This function transmits data to another application. 631 * Purpose: This function transmits data to another application.
632 * Data to be transmitted is in a buffer and this is a 632 * Data to be transmitted is in a buffer and this is a
633 * one-way message and the receiver will not reply to the 633 * one-way message and the receiver will not reply to the
634 * message. 634 * message.
635 * Input: pathid - Path identification number. 635 * Input: pathid - Path identification number.
636 * trgcls - Specifies target class. 636 * trgcls - Specifies target class.
637 * srccls - Specifies the source message class. 637 * srccls - Specifies the source message class.
638 * msgtag - Specifies a tag to be associated with the message. 638 * msgtag - Specifies a tag to be associated with the message.
639 * flags1 - Option for path. 639 * flags1 - Option for path.
640 * IPPRTY- 0x20 Specifies if you want to send priority message. 640 * IPPRTY- 0x20 Specifies if you want to send priority message.
641 * buffer - Address of send buffer. 641 * buffer - Address of send buffer.
642 * buflen - Length of send buffer. 642 * buflen - Length of send buffer.
643 * Output: msgid - Specifies the message ID. 643 * Output: msgid - Specifies the message ID.
644 * Return: Return code from CP IUCV call. 644 * Return: Return code from CP IUCV call.
645 * (-EINVAL) - Buffer address is NULL. 645 * (-EINVAL) - Buffer address is NULL.
646*/ 646*/
647int iucv_send (u16 pathid, 647int iucv_send (u16 pathid,
648 u32 * msgid, 648 u32 * msgid,
649 u32 trgcls, 649 u32 trgcls,
650 u32 srccls, u32 msgtag, int flags1, void *buffer, ulong buflen); 650 u32 srccls, u32 msgtag, int flags1, void *buffer, ulong buflen);
651 651
652/* 652/*
653 * Name: iucv_send_array 653 * Name: iucv_send_array
654 * Purpose: This function transmits data to another application. 654 * Purpose: This function transmits data to another application.
655 * The contents of buffer is the address of the array of 655 * The contents of buffer is the address of the array of
656 * addresses and lengths of discontiguous buffers that hold 656 * addresses and lengths of discontiguous buffers that hold
657 * the message text. This is a one-way message and the 657 * the message text. This is a one-way message and the
658 * receiver will not reply to the message. 658 * receiver will not reply to the message.
659 * Input: pathid - Path identification number. 659 * Input: pathid - Path identification number.
660 * trgcls - Specifies target class. 660 * trgcls - Specifies target class.
661 * srccls - Specifies the source message class. 661 * srccls - Specifies the source message class.
662 * msgtag - Specifies a tag to be associated witht the message. 662 * msgtag - Specifies a tag to be associated witht the message.
663 * flags1 - Option for path. 663 * flags1 - Option for path.
664 * IPPRTY- specifies if you want to send priority message. 664 * IPPRTY- specifies if you want to send priority message.
665 * buffer - Address of array of send buffers. 665 * buffer - Address of array of send buffers.
666 * buflen - Total length of send buffers. 666 * buflen - Total length of send buffers.
667 * Output: msgid - Specifies the message ID. 667 * Output: msgid - Specifies the message ID.
668 * Return: Return code from CP IUCV call. 668 * Return: Return code from CP IUCV call.
669 * (-EINVAL) - Buffer address is NULL. 669 * (-EINVAL) - Buffer address is NULL.
670*/ 670*/
671int iucv_send_array (u16 pathid, 671int iucv_send_array (u16 pathid,
672 u32 * msgid, 672 u32 * msgid,
@@ -675,48 +675,48 @@ int iucv_send_array (u16 pathid,
675 u32 msgtag, 675 u32 msgtag,
676 int flags1, iucv_array_t * buffer, ulong buflen); 676 int flags1, iucv_array_t * buffer, ulong buflen);
677 677
678/* 678/*
679 * Name: iucv_send_prmmsg 679 * Name: iucv_send_prmmsg
680 * Purpose: This function transmits data to another application. 680 * Purpose: This function transmits data to another application.
681 * Prmmsg specifies that the 8-bytes of data are to be moved 681 * Prmmsg specifies that the 8-bytes of data are to be moved
682 * into the parameter list. This is a one-way message and the 682 * into the parameter list. This is a one-way message and the
683 * receiver will not reply to the message. 683 * receiver will not reply to the message.
684 * Input: pathid - Path identification number. 684 * Input: pathid - Path identification number.
685 * trgcls - Specifies target class. 685 * trgcls - Specifies target class.
686 * srccls - Specifies the source message class. 686 * srccls - Specifies the source message class.
687 * msgtag - Specifies a tag to be associated with the message. 687 * msgtag - Specifies a tag to be associated with the message.
688 * flags1 - Option for path. 688 * flags1 - Option for path.
689 * IPPRTY- 0x20 specifies if you want to send priority message. 689 * IPPRTY- 0x20 specifies if you want to send priority message.
690 * prmmsg - 8-bytes of data to be placed into parameter list. 690 * prmmsg - 8-bytes of data to be placed into parameter list.
691 * Output: msgid - Specifies the message ID. 691 * Output: msgid - Specifies the message ID.
692 * Return: Return code from CP IUCV call. 692 * Return: Return code from CP IUCV call.
693*/ 693*/
694int iucv_send_prmmsg (u16 pathid, 694int iucv_send_prmmsg (u16 pathid,
695 u32 * msgid, 695 u32 * msgid,
696 u32 trgcls, 696 u32 trgcls,
697 u32 srccls, u32 msgtag, int flags1, uchar prmmsg[8]); 697 u32 srccls, u32 msgtag, int flags1, uchar prmmsg[8]);
698 698
699/* 699/*
700 * Name: iucv_send2way 700 * Name: iucv_send2way
701 * Purpose: This function transmits data to another application. 701 * Purpose: This function transmits data to another application.
702 * Data to be transmitted is in a buffer. The receiver 702 * Data to be transmitted is in a buffer. The receiver
703 * of the send is expected to reply to the message and 703 * of the send is expected to reply to the message and
704 * a buffer is provided into which IUCV moves the reply 704 * a buffer is provided into which IUCV moves the reply
705 * to this message. 705 * to this message.
706 * Input: pathid - Path identification number. 706 * Input: pathid - Path identification number.
707 * trgcls - Specifies target class. 707 * trgcls - Specifies target class.
708 * srccls - Specifies the source message class. 708 * srccls - Specifies the source message class.
709 * msgtag - Specifies a tag associated with the message. 709 * msgtag - Specifies a tag associated with the message.
710 * flags1 - Option for path. 710 * flags1 - Option for path.
711 * IPPRTY- 0x20 Specifies if you want to send priority message. 711 * IPPRTY- 0x20 Specifies if you want to send priority message.
712 * buffer - Address of send buffer. 712 * buffer - Address of send buffer.
713 * buflen - Length of send buffer. 713 * buflen - Length of send buffer.
714 * ansbuf - Address of buffer into which IUCV moves the reply of 714 * ansbuf - Address of buffer into which IUCV moves the reply of
715 * this message. 715 * this message.
716 * anslen - Address of length of buffer. 716 * anslen - Address of length of buffer.
717 * Output: msgid - Specifies the message ID. 717 * Output: msgid - Specifies the message ID.
718 * Return: Return code from CP IUCV call. 718 * Return: Return code from CP IUCV call.
719 * (-EINVAL) - Buffer or ansbuf address is NULL. 719 * (-EINVAL) - Buffer or ansbuf address is NULL.
720*/ 720*/
721int iucv_send2way (u16 pathid, 721int iucv_send2way (u16 pathid,
722 u32 * msgid, 722 u32 * msgid,
@@ -726,28 +726,28 @@ int iucv_send2way (u16 pathid,
726 int flags1, 726 int flags1,
727 void *buffer, ulong buflen, void *ansbuf, ulong anslen); 727 void *buffer, ulong buflen, void *ansbuf, ulong anslen);
728 728
729/* 729/*
730 * Name: iucv_send2way_array 730 * Name: iucv_send2way_array
731 * Purpose: This function transmits data to another application. 731 * Purpose: This function transmits data to another application.
732 * The contents of buffer is the address of the array of 732 * The contents of buffer is the address of the array of
733 * addresses and lengths of discontiguous buffers that hold 733 * addresses and lengths of discontiguous buffers that hold
734 * the message text. The receiver of the send is expected to 734 * the message text. The receiver of the send is expected to
735 * reply to the message and a buffer is provided into which 735 * reply to the message and a buffer is provided into which
736 * IUCV moves the reply to this message. 736 * IUCV moves the reply to this message.
737 * Input: pathid - Path identification number. 737 * Input: pathid - Path identification number.
738 * trgcls - Specifies target class. 738 * trgcls - Specifies target class.
739 * srccls - Specifies the source message class. 739 * srccls - Specifies the source message class.
740 * msgtag - Specifies a tag to be associated with the message. 740 * msgtag - Specifies a tag to be associated with the message.
741 * flags1 - Option for path. 741 * flags1 - Option for path.
742 * IPPRTY- 0x20 Specifies if you want to send priority message. 742 * IPPRTY- 0x20 Specifies if you want to send priority message.
743 * buffer - Sddress of array of send buffers. 743 * buffer - Sddress of array of send buffers.
744 * buflen - Total length of send buffers. 744 * buflen - Total length of send buffers.
745 * ansbuf - Address of array of buffer into which IUCV moves the reply 745 * ansbuf - Address of array of buffer into which IUCV moves the reply
746 * of this message. 746 * of this message.
747 * anslen - Address of length reply buffers. 747 * anslen - Address of length reply buffers.
748 * Output: msgid - Specifies the message ID. 748 * Output: msgid - Specifies the message ID.
749 * Return: Return code from CP IUCV call. 749 * Return: Return code from CP IUCV call.
750 * (-EINVAL) - Buffer address is NULL. 750 * (-EINVAL) - Buffer address is NULL.
751*/ 751*/
752int iucv_send2way_array (u16 pathid, 752int iucv_send2way_array (u16 pathid,
753 u32 * msgid, 753 u32 * msgid,
@@ -758,27 +758,27 @@ int iucv_send2way_array (u16 pathid,
758 iucv_array_t * buffer, 758 iucv_array_t * buffer,
759 ulong buflen, iucv_array_t * ansbuf, ulong anslen); 759 ulong buflen, iucv_array_t * ansbuf, ulong anslen);
760 760
761/* 761/*
762 * Name: iucv_send2way_prmmsg 762 * Name: iucv_send2way_prmmsg
763 * Purpose: This function transmits data to another application. 763 * Purpose: This function transmits data to another application.
764 * Prmmsg specifies that the 8-bytes of data are to be moved 764 * Prmmsg specifies that the 8-bytes of data are to be moved
765 * into the parameter list. This is a two-way message and the 765 * into the parameter list. This is a two-way message and the
766 * receiver of the message is expected to reply. A buffer 766 * receiver of the message is expected to reply. A buffer
767 * is provided into which IUCV moves the reply to this 767 * is provided into which IUCV moves the reply to this
768 * message. 768 * message.
769 * Input: pathid - Rath identification number. 769 * Input: pathid - Rath identification number.
770 * trgcls - Specifies target class. 770 * trgcls - Specifies target class.
771 * srccls - Specifies the source message class. 771 * srccls - Specifies the source message class.
772 * msgtag - Specifies a tag to be associated with the message. 772 * msgtag - Specifies a tag to be associated with the message.
773 * flags1 - Option for path. 773 * flags1 - Option for path.
774 * IPPRTY- 0x20 Specifies if you want to send priority message. 774 * IPPRTY- 0x20 Specifies if you want to send priority message.
775 * prmmsg - 8-bytes of data to be placed in parameter list. 775 * prmmsg - 8-bytes of data to be placed in parameter list.
776 * ansbuf - Address of buffer into which IUCV moves the reply of 776 * ansbuf - Address of buffer into which IUCV moves the reply of
777 * this message. 777 * this message.
778 * anslen - Address of length of buffer. 778 * anslen - Address of length of buffer.
779 * Output: msgid - Specifies the message ID. 779 * Output: msgid - Specifies the message ID.
780 * Return: Return code from CP IUCV call. 780 * Return: Return code from CP IUCV call.
781 * (-EINVAL) - Buffer address is NULL. 781 * (-EINVAL) - Buffer address is NULL.
782*/ 782*/
783int iucv_send2way_prmmsg (u16 pathid, 783int iucv_send2way_prmmsg (u16 pathid,
784 u32 * msgid, 784 u32 * msgid,
@@ -788,29 +788,29 @@ int iucv_send2way_prmmsg (u16 pathid,
788 ulong flags1, 788 ulong flags1,
789 uchar prmmsg[8], void *ansbuf, ulong anslen); 789 uchar prmmsg[8], void *ansbuf, ulong anslen);
790 790
791/* 791/*
792 * Name: iucv_send2way_prmmsg_array 792 * Name: iucv_send2way_prmmsg_array
793 * Purpose: This function transmits data to another application. 793 * Purpose: This function transmits data to another application.
794 * Prmmsg specifies that the 8-bytes of data are to be moved 794 * Prmmsg specifies that the 8-bytes of data are to be moved
795 * into the parameter list. This is a two-way message and the 795 * into the parameter list. This is a two-way message and the
796 * receiver of the message is expected to reply. A buffer 796 * receiver of the message is expected to reply. A buffer
797 * is provided into which IUCV moves the reply to this 797 * is provided into which IUCV moves the reply to this
798 * message. The contents of ansbuf is the address of the 798 * message. The contents of ansbuf is the address of the
799 * array of addresses and lengths of discontiguous buffers 799 * array of addresses and lengths of discontiguous buffers
800 * that contain the reply. 800 * that contain the reply.
801 * Input: pathid - Path identification number. 801 * Input: pathid - Path identification number.
802 * trgcls - Specifies target class. 802 * trgcls - Specifies target class.
803 * srccls - Specifies the source message class. 803 * srccls - Specifies the source message class.
804 * msgtag - Specifies a tag to be associated with the message. 804 * msgtag - Specifies a tag to be associated with the message.
805 * flags1 - Option for path. 805 * flags1 - Option for path.
806 * IPPRTY- 0x20 specifies if you want to send priority message. 806 * IPPRTY- 0x20 specifies if you want to send priority message.
807 * prmmsg - 8-bytes of data to be placed into the parameter list. 807 * prmmsg - 8-bytes of data to be placed into the parameter list.
808 * ansbuf - Address of array of buffer into which IUCV moves the reply 808 * ansbuf - Address of array of buffer into which IUCV moves the reply
809 * of this message. 809 * of this message.
810 * anslen - Address of length of reply buffers. 810 * anslen - Address of length of reply buffers.
811 * Output: msgid - Specifies the message ID. 811 * Output: msgid - Specifies the message ID.
812 * Return: Return code from CP IUCV call. 812 * Return: Return code from CP IUCV call.
813 * (-EINVAL) - Ansbuf address is NULL. 813 * (-EINVAL) - Ansbuf address is NULL.
814*/ 814*/
815int iucv_send2way_prmmsg_array (u16 pathid, 815int iucv_send2way_prmmsg_array (u16 pathid,
816 u32 * msgid, 816 u32 * msgid,
@@ -821,29 +821,29 @@ int iucv_send2way_prmmsg_array (u16 pathid,
821 uchar prmmsg[8], 821 uchar prmmsg[8],
822 iucv_array_t * ansbuf, ulong anslen); 822 iucv_array_t * ansbuf, ulong anslen);
823 823
824/* 824/*
825 * Name: iucv_setmask 825 * Name: iucv_setmask
826 * Purpose: This function enables or disables the following IUCV 826 * Purpose: This function enables or disables the following IUCV
827 * external interruptions: Nonpriority and priority message 827 * external interruptions: Nonpriority and priority message
828 * interrupts, nonpriority and priority reply interrupts. 828 * interrupts, nonpriority and priority reply interrupts.
829 * Input: SetMaskFlag - options for interrupts 829 * Input: SetMaskFlag - options for interrupts
830 * 0x80 - Nonpriority_MessagePendingInterruptsFlag 830 * 0x80 - Nonpriority_MessagePendingInterruptsFlag
831 * 0x40 - Priority_MessagePendingInterruptsFlag 831 * 0x40 - Priority_MessagePendingInterruptsFlag
832 * 0x20 - Nonpriority_MessageCompletionInterruptsFlag 832 * 0x20 - Nonpriority_MessageCompletionInterruptsFlag
833 * 0x10 - Priority_MessageCompletionInterruptsFlag 833 * 0x10 - Priority_MessageCompletionInterruptsFlag
834 * 0x08 - IUCVControlInterruptsFlag 834 * 0x08 - IUCVControlInterruptsFlag
835 * Output: NA 835 * Output: NA
836 * Return: Return code from CP IUCV call. 836 * Return: Return code from CP IUCV call.
837*/ 837*/
838int iucv_setmask (int SetMaskFlag); 838int iucv_setmask (int SetMaskFlag);
839 839
840/* 840/*
841 * Name: iucv_sever 841 * Name: iucv_sever
842 * Purpose: This function terminates an IUCV path. 842 * Purpose: This function terminates an IUCV path.
843 * Input: pathid - Path identification number. 843 * Input: pathid - Path identification number.
844 * user_data - 16-bytes of user data. 844 * user_data - 16-bytes of user data.
845 * Output: NA 845 * Output: NA
846 * Return: Return code from CP IUCV call. 846 * Return: Return code from CP IUCV call.
847 * (-EINVAL) - Interal error, wild pointer. 847 * (-EINVAL) - Interal error, wild pointer.
848*/ 848*/
849int iucv_sever (u16 pathid, uchar user_data[16]); 849int iucv_sever (u16 pathid, uchar user_data[16]);
diff --git a/drivers/s390/net/lcs.c b/drivers/s390/net/lcs.c
index e65da921a827..f94419b334f7 100644
--- a/drivers/s390/net/lcs.c
+++ b/drivers/s390/net/lcs.c
@@ -68,6 +68,7 @@ static void lcs_tasklet(unsigned long);
68static void lcs_start_kernel_thread(struct lcs_card *card); 68static void lcs_start_kernel_thread(struct lcs_card *card);
69static void lcs_get_frames_cb(struct lcs_channel *, struct lcs_buffer *); 69static void lcs_get_frames_cb(struct lcs_channel *, struct lcs_buffer *);
70static int lcs_send_delipm(struct lcs_card *, struct lcs_ipm_list *); 70static int lcs_send_delipm(struct lcs_card *, struct lcs_ipm_list *);
71static int lcs_recovery(void *ptr);
71 72
72/** 73/**
73 * Debug Facility Stuff 74 * Debug Facility Stuff
@@ -429,12 +430,6 @@ lcs_setup_card(struct lcs_card *card)
429 card->tx_buffer = NULL; 430 card->tx_buffer = NULL;
430 card->tx_emitted = 0; 431 card->tx_emitted = 0;
431 432
432 /* Initialize kernel thread task used for LGW commands. */
433 INIT_WORK(&card->kernel_thread_starter,
434 (void *)lcs_start_kernel_thread,card);
435 card->thread_start_mask = 0;
436 card->thread_allowed_mask = 0;
437 card->thread_running_mask = 0;
438 init_waitqueue_head(&card->wait_q); 433 init_waitqueue_head(&card->wait_q);
439 spin_lock_init(&card->lock); 434 spin_lock_init(&card->lock);
440 spin_lock_init(&card->ipm_lock); 435 spin_lock_init(&card->ipm_lock);
@@ -675,8 +670,9 @@ lcs_ready_buffer(struct lcs_channel *channel, struct lcs_buffer *buffer)
675 int index, rc; 670 int index, rc;
676 671
677 LCS_DBF_TEXT(5, trace, "rdybuff"); 672 LCS_DBF_TEXT(5, trace, "rdybuff");
678 BUG_ON(buffer->state != BUF_STATE_LOCKED && 673 if (buffer->state != BUF_STATE_LOCKED &&
679 buffer->state != BUF_STATE_PROCESSED); 674 buffer->state != BUF_STATE_PROCESSED)
675 BUG();
680 spin_lock_irqsave(get_ccwdev_lock(channel->ccwdev), flags); 676 spin_lock_irqsave(get_ccwdev_lock(channel->ccwdev), flags);
681 buffer->state = BUF_STATE_READY; 677 buffer->state = BUF_STATE_READY;
682 index = buffer - channel->iob; 678 index = buffer - channel->iob;
@@ -700,7 +696,8 @@ __lcs_processed_buffer(struct lcs_channel *channel, struct lcs_buffer *buffer)
700 int index, prev, next; 696 int index, prev, next;
701 697
702 LCS_DBF_TEXT(5, trace, "prcsbuff"); 698 LCS_DBF_TEXT(5, trace, "prcsbuff");
703 BUG_ON(buffer->state != BUF_STATE_READY); 699 if (buffer->state != BUF_STATE_READY)
700 BUG();
704 buffer->state = BUF_STATE_PROCESSED; 701 buffer->state = BUF_STATE_PROCESSED;
705 index = buffer - channel->iob; 702 index = buffer - channel->iob;
706 prev = (index - 1) & (LCS_NUM_BUFFS - 1); 703 prev = (index - 1) & (LCS_NUM_BUFFS - 1);
@@ -732,8 +729,9 @@ lcs_release_buffer(struct lcs_channel *channel, struct lcs_buffer *buffer)
732 unsigned long flags; 729 unsigned long flags;
733 730
734 LCS_DBF_TEXT(5, trace, "relbuff"); 731 LCS_DBF_TEXT(5, trace, "relbuff");
735 BUG_ON(buffer->state != BUF_STATE_LOCKED && 732 if (buffer->state != BUF_STATE_LOCKED &&
736 buffer->state != BUF_STATE_PROCESSED); 733 buffer->state != BUF_STATE_PROCESSED)
734 BUG();
737 spin_lock_irqsave(get_ccwdev_lock(channel->ccwdev), flags); 735 spin_lock_irqsave(get_ccwdev_lock(channel->ccwdev), flags);
738 buffer->state = BUF_STATE_EMPTY; 736 buffer->state = BUF_STATE_EMPTY;
739 spin_unlock_irqrestore(get_ccwdev_lock(channel->ccwdev), flags); 737 spin_unlock_irqrestore(get_ccwdev_lock(channel->ccwdev), flags);
@@ -1147,8 +1145,6 @@ list_modified:
1147 list_add_tail(&ipm->list, &card->ipm_list); 1145 list_add_tail(&ipm->list, &card->ipm_list);
1148 } 1146 }
1149 spin_unlock_irqrestore(&card->ipm_lock, flags); 1147 spin_unlock_irqrestore(&card->ipm_lock, flags);
1150 if (card->state == DEV_STATE_UP)
1151 netif_wake_queue(card->dev);
1152} 1148}
1153 1149
1154/** 1150/**
@@ -1231,17 +1227,17 @@ lcs_set_mc_addresses(struct lcs_card *card, struct in_device *in4_dev)
1231 if (ipm != NULL) 1227 if (ipm != NULL)
1232 continue; /* Address already in list. */ 1228 continue; /* Address already in list. */
1233 ipm = (struct lcs_ipm_list *) 1229 ipm = (struct lcs_ipm_list *)
1234 kmalloc(sizeof(struct lcs_ipm_list), GFP_ATOMIC); 1230 kzalloc(sizeof(struct lcs_ipm_list), GFP_ATOMIC);
1235 if (ipm == NULL) { 1231 if (ipm == NULL) {
1236 PRINT_INFO("Not enough memory to add " 1232 PRINT_INFO("Not enough memory to add "
1237 "new multicast entry!\n"); 1233 "new multicast entry!\n");
1238 break; 1234 break;
1239 } 1235 }
1240 memset(ipm, 0, sizeof(struct lcs_ipm_list));
1241 memcpy(&ipm->ipm.mac_addr, buf, LCS_MAC_LENGTH); 1236 memcpy(&ipm->ipm.mac_addr, buf, LCS_MAC_LENGTH);
1242 ipm->ipm.ip_addr = im4->multiaddr; 1237 ipm->ipm.ip_addr = im4->multiaddr;
1243 ipm->ipm_state = LCS_IPM_STATE_SET_REQUIRED; 1238 ipm->ipm_state = LCS_IPM_STATE_SET_REQUIRED;
1244 spin_lock_irqsave(&card->ipm_lock, flags); 1239 spin_lock_irqsave(&card->ipm_lock, flags);
1240 LCS_DBF_HEX(2,trace,&ipm->ipm.ip_addr,4);
1245 list_add(&ipm->list, &card->ipm_list); 1241 list_add(&ipm->list, &card->ipm_list);
1246 spin_unlock_irqrestore(&card->ipm_lock, flags); 1242 spin_unlock_irqrestore(&card->ipm_lock, flags);
1247 } 1243 }
@@ -1269,7 +1265,15 @@ lcs_register_mc_addresses(void *data)
1269 read_unlock(&in4_dev->mc_list_lock); 1265 read_unlock(&in4_dev->mc_list_lock);
1270 in_dev_put(in4_dev); 1266 in_dev_put(in4_dev);
1271 1267
1268 netif_carrier_off(card->dev);
1269 netif_tx_disable(card->dev);
1270 wait_event(card->write.wait_q,
1271 (card->write.state != CH_STATE_RUNNING));
1272 lcs_fix_multicast_list(card); 1272 lcs_fix_multicast_list(card);
1273 if (card->state == DEV_STATE_UP) {
1274 netif_carrier_on(card->dev);
1275 netif_wake_queue(card->dev);
1276 }
1273out: 1277out:
1274 lcs_clear_thread_running_bit(card, LCS_SET_MC_THREAD); 1278 lcs_clear_thread_running_bit(card, LCS_SET_MC_THREAD);
1275 return 0; 1279 return 0;
@@ -1286,7 +1290,7 @@ lcs_set_multicast_list(struct net_device *dev)
1286 LCS_DBF_TEXT(4, trace, "setmulti"); 1290 LCS_DBF_TEXT(4, trace, "setmulti");
1287 card = (struct lcs_card *) dev->priv; 1291 card = (struct lcs_card *) dev->priv;
1288 1292
1289 if (!lcs_set_thread_start_bit(card, LCS_SET_MC_THREAD)) 1293 if (!lcs_set_thread_start_bit(card, LCS_SET_MC_THREAD))
1290 schedule_work(&card->kernel_thread_starter); 1294 schedule_work(&card->kernel_thread_starter);
1291} 1295}
1292 1296
@@ -1318,6 +1322,53 @@ lcs_check_irb_error(struct ccw_device *cdev, struct irb *irb)
1318 return PTR_ERR(irb); 1322 return PTR_ERR(irb);
1319} 1323}
1320 1324
1325static int
1326lcs_get_problem(struct ccw_device *cdev, struct irb *irb)
1327{
1328 int dstat, cstat;
1329 char *sense;
1330
1331 sense = (char *) irb->ecw;
1332 cstat = irb->scsw.cstat;
1333 dstat = irb->scsw.dstat;
1334
1335 if (cstat & (SCHN_STAT_CHN_CTRL_CHK | SCHN_STAT_INTF_CTRL_CHK |
1336 SCHN_STAT_CHN_DATA_CHK | SCHN_STAT_CHAIN_CHECK |
1337 SCHN_STAT_PROT_CHECK | SCHN_STAT_PROG_CHECK)) {
1338 LCS_DBF_TEXT(2, trace, "CGENCHK");
1339 return 1;
1340 }
1341 if (dstat & DEV_STAT_UNIT_CHECK) {
1342 if (sense[LCS_SENSE_BYTE_1] &
1343 LCS_SENSE_RESETTING_EVENT) {
1344 LCS_DBF_TEXT(2, trace, "REVIND");
1345 return 1;
1346 }
1347 if (sense[LCS_SENSE_BYTE_0] &
1348 LCS_SENSE_CMD_REJECT) {
1349 LCS_DBF_TEXT(2, trace, "CMDREJ");
1350 return 0;
1351 }
1352 if ((!sense[LCS_SENSE_BYTE_0]) &&
1353 (!sense[LCS_SENSE_BYTE_1]) &&
1354 (!sense[LCS_SENSE_BYTE_2]) &&
1355 (!sense[LCS_SENSE_BYTE_3])) {
1356 LCS_DBF_TEXT(2, trace, "ZEROSEN");
1357 return 0;
1358 }
1359 LCS_DBF_TEXT(2, trace, "DGENCHK");
1360 return 1;
1361 }
1362 return 0;
1363}
1364
1365void
1366lcs_schedule_recovery(struct lcs_card *card)
1367{
1368 LCS_DBF_TEXT(2, trace, "startrec");
1369 if (!lcs_set_thread_start_bit(card, LCS_RECOVERY_THREAD))
1370 schedule_work(&card->kernel_thread_starter);
1371}
1321 1372
1322/** 1373/**
1323 * IRQ Handler for LCS channels 1374 * IRQ Handler for LCS channels
@@ -1327,7 +1378,8 @@ lcs_irq(struct ccw_device *cdev, unsigned long intparm, struct irb *irb)
1327{ 1378{
1328 struct lcs_card *card; 1379 struct lcs_card *card;
1329 struct lcs_channel *channel; 1380 struct lcs_channel *channel;
1330 int index; 1381 int rc, index;
1382 int cstat, dstat;
1331 1383
1332 if (lcs_check_irb_error(cdev, irb)) 1384 if (lcs_check_irb_error(cdev, irb))
1333 return; 1385 return;
@@ -1338,14 +1390,27 @@ lcs_irq(struct ccw_device *cdev, unsigned long intparm, struct irb *irb)
1338 else 1390 else
1339 channel = &card->write; 1391 channel = &card->write;
1340 1392
1393 cstat = irb->scsw.cstat;
1394 dstat = irb->scsw.dstat;
1341 LCS_DBF_TEXT_(5, trace, "Rint%s",cdev->dev.bus_id); 1395 LCS_DBF_TEXT_(5, trace, "Rint%s",cdev->dev.bus_id);
1342 LCS_DBF_TEXT_(5, trace, "%4x%4x",irb->scsw.cstat, irb->scsw.dstat); 1396 LCS_DBF_TEXT_(5, trace, "%4x%4x",irb->scsw.cstat, irb->scsw.dstat);
1343 LCS_DBF_TEXT_(5, trace, "%4x%4x",irb->scsw.fctl, irb->scsw.actl); 1397 LCS_DBF_TEXT_(5, trace, "%4x%4x",irb->scsw.fctl, irb->scsw.actl);
1344 1398
1399 /* Check for channel and device errors presented */
1400 rc = lcs_get_problem(cdev, irb);
1401 if (rc || (dstat & DEV_STAT_UNIT_EXCEP)) {
1402 PRINT_WARN("check on device %s, dstat=0x%X, cstat=0x%X \n",
1403 cdev->dev.bus_id, dstat, cstat);
1404 if (rc) {
1405 lcs_schedule_recovery(card);
1406 wake_up(&card->wait_q);
1407 return;
1408 }
1409 }
1345 /* How far in the ccw chain have we processed? */ 1410 /* How far in the ccw chain have we processed? */
1346 if ((channel->state != CH_STATE_INIT) && 1411 if ((channel->state != CH_STATE_INIT) &&
1347 (irb->scsw.fctl & SCSW_FCTL_START_FUNC)) { 1412 (irb->scsw.fctl & SCSW_FCTL_START_FUNC)) {
1348 index = (struct ccw1 *) __va((addr_t) irb->scsw.cpa) 1413 index = (struct ccw1 *) __va((addr_t) irb->scsw.cpa)
1349 - channel->ccws; 1414 - channel->ccws;
1350 if ((irb->scsw.actl & SCSW_ACTL_SUSPENDED) || 1415 if ((irb->scsw.actl & SCSW_ACTL_SUSPENDED) ||
1351 (irb->scsw.cstat & SCHN_STAT_PCI)) 1416 (irb->scsw.cstat & SCHN_STAT_PCI))
@@ -1367,7 +1432,6 @@ lcs_irq(struct ccw_device *cdev, unsigned long intparm, struct irb *irb)
1367 else if (irb->scsw.actl & SCSW_ACTL_SUSPENDED) 1432 else if (irb->scsw.actl & SCSW_ACTL_SUSPENDED)
1368 /* CCW execution stopped on a suspend bit. */ 1433 /* CCW execution stopped on a suspend bit. */
1369 channel->state = CH_STATE_SUSPENDED; 1434 channel->state = CH_STATE_SUSPENDED;
1370
1371 if (irb->scsw.fctl & SCSW_FCTL_HALT_FUNC) { 1435 if (irb->scsw.fctl & SCSW_FCTL_HALT_FUNC) {
1372 if (irb->scsw.cc != 0) { 1436 if (irb->scsw.cc != 0) {
1373 ccw_device_halt(channel->ccwdev, (addr_t) channel); 1437 ccw_device_halt(channel->ccwdev, (addr_t) channel);
@@ -1376,7 +1440,6 @@ lcs_irq(struct ccw_device *cdev, unsigned long intparm, struct irb *irb)
1376 /* The channel has been stopped by halt_IO. */ 1440 /* The channel has been stopped by halt_IO. */
1377 channel->state = CH_STATE_HALTED; 1441 channel->state = CH_STATE_HALTED;
1378 } 1442 }
1379
1380 if (irb->scsw.fctl & SCSW_FCTL_CLEAR_FUNC) { 1443 if (irb->scsw.fctl & SCSW_FCTL_CLEAR_FUNC) {
1381 channel->state = CH_STATE_CLEARED; 1444 channel->state = CH_STATE_CLEARED;
1382 } 1445 }
@@ -1452,7 +1515,7 @@ lcs_txbuffer_cb(struct lcs_channel *channel, struct lcs_buffer *buffer)
1452 lcs_release_buffer(channel, buffer); 1515 lcs_release_buffer(channel, buffer);
1453 card = (struct lcs_card *) 1516 card = (struct lcs_card *)
1454 ((char *) channel - offsetof(struct lcs_card, write)); 1517 ((char *) channel - offsetof(struct lcs_card, write));
1455 if (netif_queue_stopped(card->dev)) 1518 if (netif_queue_stopped(card->dev) && netif_carrier_ok(card->dev))
1456 netif_wake_queue(card->dev); 1519 netif_wake_queue(card->dev);
1457 spin_lock(&card->lock); 1520 spin_lock(&card->lock);
1458 card->tx_emitted--; 1521 card->tx_emitted--;
@@ -1488,6 +1551,10 @@ __lcs_start_xmit(struct lcs_card *card, struct sk_buff *skb,
1488 card->stats.tx_carrier_errors++; 1551 card->stats.tx_carrier_errors++;
1489 return 0; 1552 return 0;
1490 } 1553 }
1554 if (skb->protocol == htons(ETH_P_IPV6)) {
1555 dev_kfree_skb(skb);
1556 return 0;
1557 }
1491 netif_stop_queue(card->dev); 1558 netif_stop_queue(card->dev);
1492 spin_lock(&card->lock); 1559 spin_lock(&card->lock);
1493 if (card->tx_buffer != NULL && 1560 if (card->tx_buffer != NULL &&
@@ -1633,30 +1700,6 @@ lcs_detect(struct lcs_card *card)
1633} 1700}
1634 1701
1635/** 1702/**
1636 * reset card
1637 */
1638static int
1639lcs_resetcard(struct lcs_card *card)
1640{
1641 int retries;
1642
1643 LCS_DBF_TEXT(2, trace, "rescard");
1644 for (retries = 0; retries < 10; retries++) {
1645 if (lcs_detect(card) == 0) {
1646 netif_wake_queue(card->dev);
1647 card->state = DEV_STATE_UP;
1648 PRINT_INFO("LCS device %s successfully restarted!\n",
1649 card->dev->name);
1650 return 0;
1651 }
1652 msleep(3000);
1653 }
1654 PRINT_ERR("Error in Reseting LCS card!\n");
1655 return -EIO;
1656}
1657
1658
1659/**
1660 * LCS Stop card 1703 * LCS Stop card
1661 */ 1704 */
1662static int 1705static int
@@ -1680,126 +1723,18 @@ lcs_stopcard(struct lcs_card *card)
1680} 1723}
1681 1724
1682/** 1725/**
1683 * LGW initiated commands
1684 */
1685static int
1686lcs_lgw_startlan_thread(void *data)
1687{
1688 struct lcs_card *card;
1689
1690 card = (struct lcs_card *) data;
1691 daemonize("lgwstpln");
1692
1693 if (!lcs_do_run_thread(card, LCS_STARTLAN_THREAD))
1694 return 0;
1695 LCS_DBF_TEXT(4, trace, "lgwstpln");
1696 if (card->dev)
1697 netif_stop_queue(card->dev);
1698 if (lcs_startlan(card) == 0) {
1699 netif_wake_queue(card->dev);
1700 card->state = DEV_STATE_UP;
1701 PRINT_INFO("LCS Startlan for device %s succeeded!\n",
1702 card->dev->name);
1703
1704 } else
1705 PRINT_ERR("LCS Startlan for device %s failed!\n",
1706 card->dev->name);
1707 lcs_clear_thread_running_bit(card, LCS_STARTLAN_THREAD);
1708 return 0;
1709}
1710
1711/**
1712 * Send startup command initiated by Lan Gateway
1713 */
1714static int
1715lcs_lgw_startup_thread(void *data)
1716{
1717 int rc;
1718
1719 struct lcs_card *card;
1720
1721 card = (struct lcs_card *) data;
1722 daemonize("lgwstaln");
1723
1724 if (!lcs_do_run_thread(card, LCS_STARTUP_THREAD))
1725 return 0;
1726 LCS_DBF_TEXT(4, trace, "lgwstaln");
1727 if (card->dev)
1728 netif_stop_queue(card->dev);
1729 rc = lcs_send_startup(card, LCS_INITIATOR_LGW);
1730 if (rc != 0) {
1731 PRINT_ERR("Startup for LCS device %s initiated " \
1732 "by LGW failed!\nReseting card ...\n",
1733 card->dev->name);
1734 /* do a card reset */
1735 rc = lcs_resetcard(card);
1736 if (rc == 0)
1737 goto Done;
1738 }
1739 rc = lcs_startlan(card);
1740 if (rc == 0) {
1741 netif_wake_queue(card->dev);
1742 card->state = DEV_STATE_UP;
1743 }
1744Done:
1745 if (rc == 0)
1746 PRINT_INFO("LCS Startup for device %s succeeded!\n",
1747 card->dev->name);
1748 else
1749 PRINT_ERR("LCS Startup for device %s failed!\n",
1750 card->dev->name);
1751 lcs_clear_thread_running_bit(card, LCS_STARTUP_THREAD);
1752 return 0;
1753}
1754
1755
1756/**
1757 * send stoplan command initiated by Lan Gateway
1758 */
1759static int
1760lcs_lgw_stoplan_thread(void *data)
1761{
1762 struct lcs_card *card;
1763 int rc;
1764
1765 card = (struct lcs_card *) data;
1766 daemonize("lgwstop");
1767
1768 if (!lcs_do_run_thread(card, LCS_STOPLAN_THREAD))
1769 return 0;
1770 LCS_DBF_TEXT(4, trace, "lgwstop");
1771 if (card->dev)
1772 netif_stop_queue(card->dev);
1773 if (lcs_send_stoplan(card, LCS_INITIATOR_LGW) == 0)
1774 PRINT_INFO("Stoplan for %s initiated by LGW succeeded!\n",
1775 card->dev->name);
1776 else
1777 PRINT_ERR("Stoplan %s initiated by LGW failed!\n",
1778 card->dev->name);
1779 /*Try to reset the card, stop it on failure */
1780 rc = lcs_resetcard(card);
1781 if (rc != 0)
1782 rc = lcs_stopcard(card);
1783 lcs_clear_thread_running_bit(card, LCS_STOPLAN_THREAD);
1784 return rc;
1785}
1786
1787/**
1788 * Kernel Thread helper functions for LGW initiated commands 1726 * Kernel Thread helper functions for LGW initiated commands
1789 */ 1727 */
1790static void 1728static void
1791lcs_start_kernel_thread(struct lcs_card *card) 1729lcs_start_kernel_thread(struct lcs_card *card)
1792{ 1730{
1793 LCS_DBF_TEXT(5, trace, "krnthrd"); 1731 LCS_DBF_TEXT(5, trace, "krnthrd");
1794 if (lcs_do_start_thread(card, LCS_STARTUP_THREAD)) 1732 if (lcs_do_start_thread(card, LCS_RECOVERY_THREAD))
1795 kernel_thread(lcs_lgw_startup_thread, (void *) card, SIGCHLD); 1733 kernel_thread(lcs_recovery, (void *) card, SIGCHLD);
1796 if (lcs_do_start_thread(card, LCS_STARTLAN_THREAD))
1797 kernel_thread(lcs_lgw_startlan_thread, (void *) card, SIGCHLD);
1798 if (lcs_do_start_thread(card, LCS_STOPLAN_THREAD))
1799 kernel_thread(lcs_lgw_stoplan_thread, (void *) card, SIGCHLD);
1800#ifdef CONFIG_IP_MULTICAST 1734#ifdef CONFIG_IP_MULTICAST
1801 if (lcs_do_start_thread(card, LCS_SET_MC_THREAD)) 1735 if (lcs_do_start_thread(card, LCS_SET_MC_THREAD))
1802 kernel_thread(lcs_register_mc_addresses, (void *) card, SIGCHLD); 1736 kernel_thread(lcs_register_mc_addresses,
1737 (void *) card, SIGCHLD);
1803#endif 1738#endif
1804} 1739}
1805 1740
@@ -1813,19 +1748,14 @@ lcs_get_control(struct lcs_card *card, struct lcs_cmd *cmd)
1813 if (cmd->initiator == LCS_INITIATOR_LGW) { 1748 if (cmd->initiator == LCS_INITIATOR_LGW) {
1814 switch(cmd->cmd_code) { 1749 switch(cmd->cmd_code) {
1815 case LCS_CMD_STARTUP: 1750 case LCS_CMD_STARTUP:
1816 if (!lcs_set_thread_start_bit(card,
1817 LCS_STARTUP_THREAD))
1818 schedule_work(&card->kernel_thread_starter);
1819 break;
1820 case LCS_CMD_STARTLAN: 1751 case LCS_CMD_STARTLAN:
1821 if (!lcs_set_thread_start_bit(card, 1752 lcs_schedule_recovery(card);
1822 LCS_STARTLAN_THREAD))
1823 schedule_work(&card->kernel_thread_starter);
1824 break; 1753 break;
1825 case LCS_CMD_STOPLAN: 1754 case LCS_CMD_STOPLAN:
1826 if (!lcs_set_thread_start_bit(card, 1755 PRINT_WARN("Stoplan for %s initiated by LGW.\n",
1827 LCS_STOPLAN_THREAD)) 1756 card->dev->name);
1828 schedule_work(&card->kernel_thread_starter); 1757 if (card->dev)
1758 netif_carrier_off(card->dev);
1829 break; 1759 break;
1830 default: 1760 default:
1831 PRINT_INFO("UNRECOGNIZED LGW COMMAND\n"); 1761 PRINT_INFO("UNRECOGNIZED LGW COMMAND\n");
@@ -1941,8 +1871,11 @@ lcs_stop_device(struct net_device *dev)
1941 1871
1942 LCS_DBF_TEXT(2, trace, "stopdev"); 1872 LCS_DBF_TEXT(2, trace, "stopdev");
1943 card = (struct lcs_card *) dev->priv; 1873 card = (struct lcs_card *) dev->priv;
1944 netif_stop_queue(dev); 1874 netif_carrier_off(dev);
1875 netif_tx_disable(dev);
1945 dev->flags &= ~IFF_UP; 1876 dev->flags &= ~IFF_UP;
1877 wait_event(card->write.wait_q,
1878 (card->write.state != CH_STATE_RUNNING));
1946 rc = lcs_stopcard(card); 1879 rc = lcs_stopcard(card);
1947 if (rc) 1880 if (rc)
1948 PRINT_ERR("Try it again!\n "); 1881 PRINT_ERR("Try it again!\n ");
@@ -1968,6 +1901,7 @@ lcs_open_device(struct net_device *dev)
1968 1901
1969 } else { 1902 } else {
1970 dev->flags |= IFF_UP; 1903 dev->flags |= IFF_UP;
1904 netif_carrier_on(dev);
1971 netif_wake_queue(dev); 1905 netif_wake_queue(dev);
1972 card->state = DEV_STATE_UP; 1906 card->state = DEV_STATE_UP;
1973 } 1907 }
@@ -2059,10 +1993,31 @@ lcs_timeout_store (struct device *dev, struct device_attribute *attr, const char
2059 1993
2060DEVICE_ATTR(lancmd_timeout, 0644, lcs_timeout_show, lcs_timeout_store); 1994DEVICE_ATTR(lancmd_timeout, 0644, lcs_timeout_show, lcs_timeout_store);
2061 1995
1996static ssize_t
1997lcs_dev_recover_store(struct device *dev, struct device_attribute *attr,
1998 const char *buf, size_t count)
1999{
2000 struct lcs_card *card = dev->driver_data;
2001 char *tmp;
2002 int i;
2003
2004 if (!card)
2005 return -EINVAL;
2006 if (card->state != DEV_STATE_UP)
2007 return -EPERM;
2008 i = simple_strtoul(buf, &tmp, 16);
2009 if (i == 1)
2010 lcs_schedule_recovery(card);
2011 return count;
2012}
2013
2014static DEVICE_ATTR(recover, 0200, NULL, lcs_dev_recover_store);
2015
2062static struct attribute * lcs_attrs[] = { 2016static struct attribute * lcs_attrs[] = {
2063 &dev_attr_portno.attr, 2017 &dev_attr_portno.attr,
2064 &dev_attr_type.attr, 2018 &dev_attr_type.attr,
2065 &dev_attr_lancmd_timeout.attr, 2019 &dev_attr_lancmd_timeout.attr,
2020 &dev_attr_recover.attr,
2066 NULL, 2021 NULL,
2067}; 2022};
2068 2023
@@ -2099,6 +2054,12 @@ lcs_probe_device(struct ccwgroup_device *ccwgdev)
2099 ccwgdev->dev.driver_data = card; 2054 ccwgdev->dev.driver_data = card;
2100 ccwgdev->cdev[0]->handler = lcs_irq; 2055 ccwgdev->cdev[0]->handler = lcs_irq;
2101 ccwgdev->cdev[1]->handler = lcs_irq; 2056 ccwgdev->cdev[1]->handler = lcs_irq;
2057 card->gdev = ccwgdev;
2058 INIT_WORK(&card->kernel_thread_starter,
2059 (void *) lcs_start_kernel_thread, card);
2060 card->thread_start_mask = 0;
2061 card->thread_allowed_mask = 0;
2062 card->thread_running_mask = 0;
2102 return 0; 2063 return 0;
2103} 2064}
2104 2065
@@ -2200,6 +2161,7 @@ netdev_out:
2200 if (recover_state == DEV_STATE_RECOVER) { 2161 if (recover_state == DEV_STATE_RECOVER) {
2201 lcs_set_multicast_list(card->dev); 2162 lcs_set_multicast_list(card->dev);
2202 card->dev->flags |= IFF_UP; 2163 card->dev->flags |= IFF_UP;
2164 netif_carrier_on(card->dev);
2203 netif_wake_queue(card->dev); 2165 netif_wake_queue(card->dev);
2204 card->state = DEV_STATE_UP; 2166 card->state = DEV_STATE_UP;
2205 } else { 2167 } else {
@@ -2229,7 +2191,7 @@ out:
2229 * lcs_shutdown_device, called when setting the group device offline. 2191 * lcs_shutdown_device, called when setting the group device offline.
2230 */ 2192 */
2231static int 2193static int
2232lcs_shutdown_device(struct ccwgroup_device *ccwgdev) 2194__lcs_shutdown_device(struct ccwgroup_device *ccwgdev, int recovery_mode)
2233{ 2195{
2234 struct lcs_card *card; 2196 struct lcs_card *card;
2235 enum lcs_dev_states recover_state; 2197 enum lcs_dev_states recover_state;
@@ -2239,9 +2201,11 @@ lcs_shutdown_device(struct ccwgroup_device *ccwgdev)
2239 card = (struct lcs_card *)ccwgdev->dev.driver_data; 2201 card = (struct lcs_card *)ccwgdev->dev.driver_data;
2240 if (!card) 2202 if (!card)
2241 return -ENODEV; 2203 return -ENODEV;
2242 lcs_set_allowed_threads(card, 0); 2204 if (recovery_mode == 0) {
2243 if (lcs_wait_for_threads(card, LCS_SET_MC_THREAD)) 2205 lcs_set_allowed_threads(card, 0);
2244 return -ERESTARTSYS; 2206 if (lcs_wait_for_threads(card, LCS_SET_MC_THREAD))
2207 return -ERESTARTSYS;
2208 }
2245 LCS_DBF_HEX(3, setup, &card, sizeof(void*)); 2209 LCS_DBF_HEX(3, setup, &card, sizeof(void*));
2246 recover_state = card->state; 2210 recover_state = card->state;
2247 2211
@@ -2256,6 +2220,43 @@ lcs_shutdown_device(struct ccwgroup_device *ccwgdev)
2256 return 0; 2220 return 0;
2257} 2221}
2258 2222
2223static int
2224lcs_shutdown_device(struct ccwgroup_device *ccwgdev)
2225{
2226 return __lcs_shutdown_device(ccwgdev, 0);
2227}
2228
2229/**
2230 * drive lcs recovery after startup and startlan initiated by Lan Gateway
2231 */
2232static int
2233lcs_recovery(void *ptr)
2234{
2235 struct lcs_card *card;
2236 struct ccwgroup_device *gdev;
2237 int rc;
2238
2239 card = (struct lcs_card *) ptr;
2240 daemonize("lcs_recover");
2241
2242 LCS_DBF_TEXT(4, trace, "recover1");
2243 if (!lcs_do_run_thread(card, LCS_RECOVERY_THREAD))
2244 return 0;
2245 LCS_DBF_TEXT(4, trace, "recover2");
2246 gdev = card->gdev;
2247 PRINT_WARN("Recovery of device %s started...\n", gdev->dev.bus_id);
2248 rc = __lcs_shutdown_device(gdev, 1);
2249 rc = lcs_new_device(gdev);
2250 if (!rc)
2251 PRINT_INFO("Device %s successfully recovered!\n",
2252 card->dev->name);
2253 else
2254 PRINT_INFO("Device %s could not be recovered!\n",
2255 card->dev->name);
2256 lcs_clear_thread_running_bit(card, LCS_RECOVERY_THREAD);
2257 return 0;
2258}
2259
2259/** 2260/**
2260 * lcs_remove_device, free buffers and card 2261 * lcs_remove_device, free buffers and card
2261 */ 2262 */
diff --git a/drivers/s390/net/lcs.h b/drivers/s390/net/lcs.h
index 2fad5e40c2e4..93143932983b 100644
--- a/drivers/s390/net/lcs.h
+++ b/drivers/s390/net/lcs.h
@@ -73,13 +73,17 @@ do { \
73/** 73/**
74 * LCS sense byte definitions 74 * LCS sense byte definitions
75 */ 75 */
76#define LCS_SENSE_BYTE_0 0
77#define LCS_SENSE_BYTE_1 1
78#define LCS_SENSE_BYTE_2 2
79#define LCS_SENSE_BYTE_3 3
76#define LCS_SENSE_INTERFACE_DISCONNECT 0x01 80#define LCS_SENSE_INTERFACE_DISCONNECT 0x01
77#define LCS_SENSE_EQUIPMENT_CHECK 0x10 81#define LCS_SENSE_EQUIPMENT_CHECK 0x10
78#define LCS_SENSE_BUS_OUT_CHECK 0x20 82#define LCS_SENSE_BUS_OUT_CHECK 0x20
79#define LCS_SENSE_INTERVENTION_REQUIRED 0x40 83#define LCS_SENSE_INTERVENTION_REQUIRED 0x40
80#define LCS_SENSE_CMD_REJECT 0x80 84#define LCS_SENSE_CMD_REJECT 0x80
81#define LCS_SENSE_RESETTING_EVENT 0x0080 85#define LCS_SENSE_RESETTING_EVENT 0x80
82#define LCS_SENSE_DEVICE_ONLINE 0x0020 86#define LCS_SENSE_DEVICE_ONLINE 0x20
83 87
84/** 88/**
85 * LCS packet type definitions 89 * LCS packet type definitions
@@ -152,10 +156,9 @@ enum lcs_dev_states {
152 156
153enum lcs_threads { 157enum lcs_threads {
154 LCS_SET_MC_THREAD = 1, 158 LCS_SET_MC_THREAD = 1,
155 LCS_STARTLAN_THREAD = 2, 159 LCS_RECOVERY_THREAD = 2,
156 LCS_STOPLAN_THREAD = 4,
157 LCS_STARTUP_THREAD = 8,
158}; 160};
161
159/** 162/**
160 * LCS struct declarations 163 * LCS struct declarations
161 */ 164 */
@@ -286,6 +289,7 @@ struct lcs_card {
286 struct net_device_stats stats; 289 struct net_device_stats stats;
287 unsigned short (*lan_type_trans)(struct sk_buff *skb, 290 unsigned short (*lan_type_trans)(struct sk_buff *skb,
288 struct net_device *dev); 291 struct net_device *dev);
292 struct ccwgroup_device *gdev;
289 struct lcs_channel read; 293 struct lcs_channel read;
290 struct lcs_channel write; 294 struct lcs_channel write;
291 struct lcs_buffer *tx_buffer; 295 struct lcs_buffer *tx_buffer;
diff --git a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c
index 260a93c8c442..b452cc1afd55 100644
--- a/drivers/s390/net/netiucv.c
+++ b/drivers/s390/net/netiucv.c
@@ -30,7 +30,7 @@
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 33
34#undef DEBUG 34#undef DEBUG
35 35
36#include <linux/module.h> 36#include <linux/module.h>
@@ -65,7 +65,7 @@ MODULE_AUTHOR
65 ("(C) 2001 IBM Corporation by Fritz Elfert (felfert@millenux.com)"); 65 ("(C) 2001 IBM Corporation by Fritz Elfert (felfert@millenux.com)");
66MODULE_DESCRIPTION ("Linux for S/390 IUCV network driver"); 66MODULE_DESCRIPTION ("Linux for S/390 IUCV network driver");
67 67
68 68
69#define PRINTK_HEADER " iucv: " /* for debugging */ 69#define PRINTK_HEADER " iucv: " /* for debugging */
70 70
71static struct device_driver netiucv_driver = { 71static struct device_driver netiucv_driver = {
@@ -202,7 +202,7 @@ netiucv_printname(char *name)
202 *p = '\0'; 202 *p = '\0';
203 return tmp; 203 return tmp;
204} 204}
205 205
206/** 206/**
207 * States of the interface statemachine. 207 * States of the interface statemachine.
208 */ 208 */
@@ -244,7 +244,7 @@ static const char *dev_event_names[] = {
244 "Connection up", 244 "Connection up",
245 "Connection down", 245 "Connection down",
246}; 246};
247 247
248/** 248/**
249 * Events of the connection statemachine 249 * Events of the connection statemachine
250 */ 250 */
@@ -364,7 +364,7 @@ static const char *conn_state_names[] = {
364 "Connect error", 364 "Connect error",
365}; 365};
366 366
367 367
368/** 368/**
369 * Debug Facility Stuff 369 * Debug Facility Stuff
370 */ 370 */
@@ -516,7 +516,7 @@ static void
516fsm_action_nop(fsm_instance *fi, int event, void *arg) 516fsm_action_nop(fsm_instance *fi, int event, void *arg)
517{ 517{
518} 518}
519 519
520/** 520/**
521 * Actions of the connection statemachine 521 * Actions of the connection statemachine
522 *****************************************************************************/ 522 *****************************************************************************/
@@ -993,7 +993,7 @@ static const fsm_node conn_fsm[] = {
993 993
994static const int CONN_FSM_LEN = sizeof(conn_fsm) / sizeof(fsm_node); 994static const int CONN_FSM_LEN = sizeof(conn_fsm) / sizeof(fsm_node);
995 995
996 996
997/** 997/**
998 * Actions for interface - statemachine. 998 * Actions for interface - statemachine.
999 *****************************************************************************/ 999 *****************************************************************************/
@@ -1182,7 +1182,7 @@ netiucv_transmit_skb(struct iucv_connection *conn, struct sk_buff *skb) {
1182 1182
1183 fsm_newstate(conn->fsm, CONN_STATE_TX); 1183 fsm_newstate(conn->fsm, CONN_STATE_TX);
1184 conn->prof.send_stamp = xtime; 1184 conn->prof.send_stamp = xtime;
1185 1185
1186 rc = iucv_send(conn->pathid, NULL, 0, 0, 1 /* single_flag */, 1186 rc = iucv_send(conn->pathid, NULL, 0, 0, 1 /* single_flag */,
1187 0, nskb->data, nskb->len); 1187 0, nskb->data, nskb->len);
1188 /* Shut up, gcc! nskb is always below 2G. */ 1188 /* Shut up, gcc! nskb is always below 2G. */
@@ -1220,7 +1220,7 @@ netiucv_transmit_skb(struct iucv_connection *conn, struct sk_buff *skb) {
1220 1220
1221 return rc; 1221 return rc;
1222} 1222}
1223 1223
1224/** 1224/**
1225 * Interface API for upper network layers 1225 * Interface API for upper network layers
1226 *****************************************************************************/ 1226 *****************************************************************************/
@@ -1291,7 +1291,7 @@ static int netiucv_tx(struct sk_buff *skb, struct net_device *dev)
1291 1291
1292 /** 1292 /**
1293 * If connection is not running, try to restart it 1293 * If connection is not running, try to restart it
1294 * and throw away packet. 1294 * and throw away packet.
1295 */ 1295 */
1296 if (fsm_getstate(privptr->fsm) != DEV_STATE_RUNNING) { 1296 if (fsm_getstate(privptr->fsm) != DEV_STATE_RUNNING) {
1297 fsm_event(privptr->fsm, DEV_EVENT_START, dev); 1297 fsm_event(privptr->fsm, DEV_EVENT_START, dev);
@@ -1538,7 +1538,7 @@ static ssize_t
1538maxcq_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) 1538maxcq_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1539{ 1539{
1540 struct netiucv_priv *priv = dev->driver_data; 1540 struct netiucv_priv *priv = dev->driver_data;
1541 1541
1542 IUCV_DBF_TEXT(trace, 4, __FUNCTION__); 1542 IUCV_DBF_TEXT(trace, 4, __FUNCTION__);
1543 priv->conn->prof.maxcqueue = 0; 1543 priv->conn->prof.maxcqueue = 0;
1544 return count; 1544 return count;
@@ -1559,7 +1559,7 @@ static ssize_t
1559sdoio_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) 1559sdoio_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1560{ 1560{
1561 struct netiucv_priv *priv = dev->driver_data; 1561 struct netiucv_priv *priv = dev->driver_data;
1562 1562
1563 IUCV_DBF_TEXT(trace, 4, __FUNCTION__); 1563 IUCV_DBF_TEXT(trace, 4, __FUNCTION__);
1564 priv->conn->prof.doios_single = 0; 1564 priv->conn->prof.doios_single = 0;
1565 return count; 1565 return count;
@@ -1580,7 +1580,7 @@ static ssize_t
1580mdoio_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) 1580mdoio_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1581{ 1581{
1582 struct netiucv_priv *priv = dev->driver_data; 1582 struct netiucv_priv *priv = dev->driver_data;
1583 1583
1584 IUCV_DBF_TEXT(trace, 5, __FUNCTION__); 1584 IUCV_DBF_TEXT(trace, 5, __FUNCTION__);
1585 priv->conn->prof.doios_multi = 0; 1585 priv->conn->prof.doios_multi = 0;
1586 return count; 1586 return count;
@@ -1601,7 +1601,7 @@ static ssize_t
1601txlen_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) 1601txlen_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1602{ 1602{
1603 struct netiucv_priv *priv = dev->driver_data; 1603 struct netiucv_priv *priv = dev->driver_data;
1604 1604
1605 IUCV_DBF_TEXT(trace, 4, __FUNCTION__); 1605 IUCV_DBF_TEXT(trace, 4, __FUNCTION__);
1606 priv->conn->prof.txlen = 0; 1606 priv->conn->prof.txlen = 0;
1607 return count; 1607 return count;
@@ -1622,7 +1622,7 @@ static ssize_t
1622txtime_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) 1622txtime_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1623{ 1623{
1624 struct netiucv_priv *priv = dev->driver_data; 1624 struct netiucv_priv *priv = dev->driver_data;
1625 1625
1626 IUCV_DBF_TEXT(trace, 4, __FUNCTION__); 1626 IUCV_DBF_TEXT(trace, 4, __FUNCTION__);
1627 priv->conn->prof.tx_time = 0; 1627 priv->conn->prof.tx_time = 0;
1628 return count; 1628 return count;
@@ -2000,7 +2000,7 @@ conn_write(struct device_driver *drv, const char *buf, size_t count)
2000 } 2000 }
2001 2001
2002 PRINT_INFO("%s: '%s'\n", dev->name, netiucv_printname(username)); 2002 PRINT_INFO("%s: '%s'\n", dev->name, netiucv_printname(username));
2003 2003
2004 return count; 2004 return count;
2005 2005
2006out_free_ndev: 2006out_free_ndev:
@@ -2099,7 +2099,7 @@ static int __init
2099netiucv_init(void) 2099netiucv_init(void)
2100{ 2100{
2101 int ret; 2101 int ret;
2102 2102
2103 ret = iucv_register_dbf_views(); 2103 ret = iucv_register_dbf_views();
2104 if (ret) { 2104 if (ret) {
2105 PRINT_WARN("netiucv_init failed, " 2105 PRINT_WARN("netiucv_init failed, "
@@ -2128,7 +2128,7 @@ netiucv_init(void)
2128 } 2128 }
2129 return ret; 2129 return ret;
2130} 2130}
2131 2131
2132module_init(netiucv_init); 2132module_init(netiucv_init);
2133module_exit(netiucv_exit); 2133module_exit(netiucv_exit);
2134MODULE_LICENSE("GPL"); 2134MODULE_LICENSE("GPL");
diff --git a/drivers/s390/net/qeth.h b/drivers/s390/net/qeth.h
index 4df0fcd7b10b..619f4a0c7160 100644
--- a/drivers/s390/net/qeth.h
+++ b/drivers/s390/net/qeth.h
@@ -376,7 +376,7 @@ struct qeth_hdr_osn {
376 __u8 reserved3[18]; 376 __u8 reserved3[18];
377 __u32 ccid; 377 __u32 ccid;
378} __attribute__ ((packed)); 378} __attribute__ ((packed));
379 379
380struct qeth_hdr { 380struct qeth_hdr {
381 union { 381 union {
382 struct qeth_hdr_layer2 l2; 382 struct qeth_hdr_layer2 l2;
@@ -825,7 +825,7 @@ struct qeth_card {
825 int use_hard_stop; 825 int use_hard_stop;
826 int (*orig_hard_header)(struct sk_buff *,struct net_device *, 826 int (*orig_hard_header)(struct sk_buff *,struct net_device *,
827 unsigned short,void *,void *,unsigned); 827 unsigned short,void *,void *,unsigned);
828 struct qeth_osn_info osn_info; 828 struct qeth_osn_info osn_info;
829}; 829};
830 830
831struct qeth_card_list_struct { 831struct qeth_card_list_struct {
@@ -944,7 +944,7 @@ qeth_get_netdev_flags(struct qeth_card *card)
944 return 0; 944 return 0;
945 switch (card->info.type) { 945 switch (card->info.type) {
946 case QETH_CARD_TYPE_IQD: 946 case QETH_CARD_TYPE_IQD:
947 case QETH_CARD_TYPE_OSN: 947 case QETH_CARD_TYPE_OSN:
948 return IFF_NOARP; 948 return IFF_NOARP;
949#ifdef CONFIG_QETH_IPV6 949#ifdef CONFIG_QETH_IPV6
950 default: 950 default:
@@ -981,7 +981,7 @@ static inline int
981qeth_get_max_mtu_for_card(int cardtype) 981qeth_get_max_mtu_for_card(int cardtype)
982{ 982{
983 switch (cardtype) { 983 switch (cardtype) {
984 984
985 case QETH_CARD_TYPE_UNKNOWN: 985 case QETH_CARD_TYPE_UNKNOWN:
986 case QETH_CARD_TYPE_OSAE: 986 case QETH_CARD_TYPE_OSAE:
987 case QETH_CARD_TYPE_OSN: 987 case QETH_CARD_TYPE_OSN:
@@ -1097,9 +1097,9 @@ qeth_string_to_ipaddr4(const char *buf, __u8 *addr)
1097 int count = 0, rc = 0; 1097 int count = 0, rc = 0;
1098 int in[4]; 1098 int in[4];
1099 1099
1100 rc = sscanf(buf, "%d.%d.%d.%d%n", 1100 rc = sscanf(buf, "%d.%d.%d.%d%n",
1101 &in[0], &in[1], &in[2], &in[3], &count); 1101 &in[0], &in[1], &in[2], &in[3], &count);
1102 if (rc != 4 || count) 1102 if (rc != 4 || count<=0)
1103 return -EINVAL; 1103 return -EINVAL;
1104 for (count = 0; count < 4; count++) { 1104 for (count = 0; count < 4; count++) {
1105 if (in[count] > 255) 1105 if (in[count] > 255)
@@ -1131,7 +1131,7 @@ qeth_string_to_ipaddr6(const char *buf, __u8 *addr)
1131 1131
1132 cnt = out = found = save_cnt = num2 = 0; 1132 cnt = out = found = save_cnt = num2 = 0;
1133 end = start = (char *) buf; 1133 end = start = (char *) buf;
1134 in = (__u16 *) addr; 1134 in = (__u16 *) addr;
1135 memset(in, 0, 16); 1135 memset(in, 0, 16);
1136 while (end) { 1136 while (end) {
1137 end = strchr(end,':'); 1137 end = strchr(end,':');
@@ -1139,7 +1139,7 @@ qeth_string_to_ipaddr6(const char *buf, __u8 *addr)
1139 end = (char *)buf + (strlen(buf)); 1139 end = (char *)buf + (strlen(buf));
1140 out = 1; 1140 out = 1;
1141 } 1141 }
1142 if ((end - start)) { 1142 if ((end - start)) {
1143 memset(num, 0, 5); 1143 memset(num, 0, 5);
1144 memcpy(num, start, end - start); 1144 memcpy(num, start, end - start);
1145 if (!qeth_isxdigit(num)) 1145 if (!qeth_isxdigit(num))
@@ -1241,5 +1241,5 @@ qeth_osn_register(unsigned char *read_dev_no,
1241 1241
1242extern void 1242extern void
1243qeth_osn_deregister(struct net_device *); 1243qeth_osn_deregister(struct net_device *);
1244 1244
1245#endif /* __QETH_H__ */ 1245#endif /* __QETH_H__ */
diff --git a/drivers/s390/net/qeth_eddp.c b/drivers/s390/net/qeth_eddp.c
index 44e226f211e7..0bab60a20309 100644
--- a/drivers/s390/net/qeth_eddp.c
+++ b/drivers/s390/net/qeth_eddp.c
@@ -81,7 +81,7 @@ void
81qeth_eddp_buf_release_contexts(struct qeth_qdio_out_buffer *buf) 81qeth_eddp_buf_release_contexts(struct qeth_qdio_out_buffer *buf)
82{ 82{
83 struct qeth_eddp_context_reference *ref; 83 struct qeth_eddp_context_reference *ref;
84 84
85 QETH_DBF_TEXT(trace, 6, "eddprctx"); 85 QETH_DBF_TEXT(trace, 6, "eddprctx");
86 while (!list_empty(&buf->ctx_list)){ 86 while (!list_empty(&buf->ctx_list)){
87 ref = list_entry(buf->ctx_list.next, 87 ref = list_entry(buf->ctx_list.next,
@@ -135,7 +135,7 @@ qeth_eddp_fill_buffer(struct qeth_qdio_out_q *queue,
135 "buffer!\n"); 135 "buffer!\n");
136 goto out; 136 goto out;
137 } 137 }
138 } 138 }
139 /* check if the whole next skb fits into current buffer */ 139 /* check if the whole next skb fits into current buffer */
140 if ((QETH_MAX_BUFFER_ELEMENTS(queue->card) - 140 if ((QETH_MAX_BUFFER_ELEMENTS(queue->card) -
141 buf->next_element_to_fill) 141 buf->next_element_to_fill)
@@ -148,7 +148,7 @@ qeth_eddp_fill_buffer(struct qeth_qdio_out_q *queue,
148 * and increment ctx's refcnt */ 148 * and increment ctx's refcnt */
149 must_refcnt = 1; 149 must_refcnt = 1;
150 continue; 150 continue;
151 } 151 }
152 if (must_refcnt){ 152 if (must_refcnt){
153 must_refcnt = 0; 153 must_refcnt = 0;
154 if (qeth_eddp_buf_ref_context(buf, ctx)){ 154 if (qeth_eddp_buf_ref_context(buf, ctx)){
@@ -266,7 +266,7 @@ qeth_eddp_copy_data_tcp(char *dst, struct qeth_eddp_data *eddp, int len,
266 int left_in_frag; 266 int left_in_frag;
267 int copy_len; 267 int copy_len;
268 u8 *src; 268 u8 *src;
269 269
270 QETH_DBF_TEXT(trace, 5, "eddpcdtc"); 270 QETH_DBF_TEXT(trace, 5, "eddpcdtc");
271 if (skb_shinfo(eddp->skb)->nr_frags == 0) { 271 if (skb_shinfo(eddp->skb)->nr_frags == 0) {
272 memcpy(dst, eddp->skb->data + eddp->skb_offset, len); 272 memcpy(dst, eddp->skb->data + eddp->skb_offset, len);
@@ -408,7 +408,7 @@ __qeth_eddp_fill_context_tcp(struct qeth_eddp_context *ctx,
408 struct tcphdr *tcph; 408 struct tcphdr *tcph;
409 int data_len; 409 int data_len;
410 u32 hcsum; 410 u32 hcsum;
411 411
412 QETH_DBF_TEXT(trace, 5, "eddpftcp"); 412 QETH_DBF_TEXT(trace, 5, "eddpftcp");
413 eddp->skb_offset = sizeof(struct qeth_hdr) + eddp->nhl + eddp->thl; 413 eddp->skb_offset = sizeof(struct qeth_hdr) + eddp->nhl + eddp->thl;
414 if (eddp->qh.hdr.l2.id == QETH_HEADER_TYPE_LAYER2) { 414 if (eddp->qh.hdr.l2.id == QETH_HEADER_TYPE_LAYER2) {
@@ -465,13 +465,13 @@ __qeth_eddp_fill_context_tcp(struct qeth_eddp_context *ctx,
465 eddp->th.tcp.h.seq += data_len; 465 eddp->th.tcp.h.seq += data_len;
466 } 466 }
467} 467}
468 468
469static inline int 469static inline int
470qeth_eddp_fill_context_tcp(struct qeth_eddp_context *ctx, 470qeth_eddp_fill_context_tcp(struct qeth_eddp_context *ctx,
471 struct sk_buff *skb, struct qeth_hdr *qhdr) 471 struct sk_buff *skb, struct qeth_hdr *qhdr)
472{ 472{
473 struct qeth_eddp_data *eddp = NULL; 473 struct qeth_eddp_data *eddp = NULL;
474 474
475 QETH_DBF_TEXT(trace, 5, "eddpficx"); 475 QETH_DBF_TEXT(trace, 5, "eddpficx");
476 /* create our segmentation headers and copy original headers */ 476 /* create our segmentation headers and copy original headers */
477 if (skb->protocol == ETH_P_IP) 477 if (skb->protocol == ETH_P_IP)
@@ -512,7 +512,7 @@ qeth_eddp_calc_num_pages(struct qeth_eddp_context *ctx, struct sk_buff *skb,
512 int hdr_len) 512 int hdr_len)
513{ 513{
514 int skbs_per_page; 514 int skbs_per_page;
515 515
516 QETH_DBF_TEXT(trace, 5, "eddpcanp"); 516 QETH_DBF_TEXT(trace, 5, "eddpcanp");
517 /* can we put multiple skbs in one page? */ 517 /* can we put multiple skbs in one page? */
518 skbs_per_page = PAGE_SIZE / (skb_shinfo(skb)->tso_size + hdr_len); 518 skbs_per_page = PAGE_SIZE / (skb_shinfo(skb)->tso_size + hdr_len);
@@ -588,7 +588,7 @@ qeth_eddp_create_context_tcp(struct qeth_card *card, struct sk_buff *skb,
588 struct qeth_hdr *qhdr) 588 struct qeth_hdr *qhdr)
589{ 589{
590 struct qeth_eddp_context *ctx = NULL; 590 struct qeth_eddp_context *ctx = NULL;
591 591
592 QETH_DBF_TEXT(trace, 5, "creddpct"); 592 QETH_DBF_TEXT(trace, 5, "creddpct");
593 if (skb->protocol == ETH_P_IP) 593 if (skb->protocol == ETH_P_IP)
594 ctx = qeth_eddp_create_context_generic(card, skb, 594 ctx = qeth_eddp_create_context_generic(card, skb,
diff --git a/drivers/s390/net/qeth_fs.h b/drivers/s390/net/qeth_fs.h
index e422b41c656e..61faf05517d6 100644
--- a/drivers/s390/net/qeth_fs.h
+++ b/drivers/s390/net/qeth_fs.h
@@ -42,7 +42,7 @@ qeth_create_device_attributes_osn(struct device *dev);
42 42
43extern void 43extern void
44qeth_remove_device_attributes_osn(struct device *dev); 44qeth_remove_device_attributes_osn(struct device *dev);
45 45
46extern int 46extern int
47qeth_create_driver_attributes(void); 47qeth_create_driver_attributes(void);
48 48
diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c
index cb14642d97aa..9e671a48cd2f 100644
--- a/drivers/s390/net/qeth_main.c
+++ b/drivers/s390/net/qeth_main.c
@@ -513,7 +513,7 @@ __qeth_set_offline(struct ccwgroup_device *cgdev, int recovery_mode)
513 513
514 QETH_DBF_TEXT(setup, 3, "setoffl"); 514 QETH_DBF_TEXT(setup, 3, "setoffl");
515 QETH_DBF_HEX(setup, 3, &card, sizeof(void *)); 515 QETH_DBF_HEX(setup, 3, &card, sizeof(void *));
516 516
517 if (card->dev && netif_carrier_ok(card->dev)) 517 if (card->dev && netif_carrier_ok(card->dev))
518 netif_carrier_off(card->dev); 518 netif_carrier_off(card->dev);
519 recover_flag = card->state; 519 recover_flag = card->state;
@@ -604,13 +604,13 @@ __qeth_ref_ip_on_card(struct qeth_card *card, struct qeth_ipaddr *todo,
604 list_for_each_entry(addr, &card->ip_list, entry) { 604 list_for_each_entry(addr, &card->ip_list, entry) {
605 if (card->options.layer2) { 605 if (card->options.layer2) {
606 if ((addr->type == todo->type) && 606 if ((addr->type == todo->type) &&
607 (memcmp(&addr->mac, &todo->mac, 607 (memcmp(&addr->mac, &todo->mac,
608 OSA_ADDR_LEN) == 0)) { 608 OSA_ADDR_LEN) == 0)) {
609 found = 1; 609 found = 1;
610 break; 610 break;
611 } 611 }
612 continue; 612 continue;
613 } 613 }
614 if ((addr->proto == QETH_PROT_IPV4) && 614 if ((addr->proto == QETH_PROT_IPV4) &&
615 (todo->proto == QETH_PROT_IPV4) && 615 (todo->proto == QETH_PROT_IPV4) &&
616 (addr->type == todo->type) && 616 (addr->type == todo->type) &&
@@ -694,13 +694,13 @@ __qeth_insert_ip_todo(struct qeth_card *card, struct qeth_ipaddr *addr, int add)
694 if (card->options.layer2) { 694 if (card->options.layer2) {
695 if ((tmp->type == addr->type) && 695 if ((tmp->type == addr->type) &&
696 (tmp->is_multicast == addr->is_multicast) && 696 (tmp->is_multicast == addr->is_multicast) &&
697 (memcmp(&tmp->mac, &addr->mac, 697 (memcmp(&tmp->mac, &addr->mac,
698 OSA_ADDR_LEN) == 0)) { 698 OSA_ADDR_LEN) == 0)) {
699 found = 1; 699 found = 1;
700 break; 700 break;
701 } 701 }
702 continue; 702 continue;
703 } 703 }
704 if ((tmp->proto == QETH_PROT_IPV4) && 704 if ((tmp->proto == QETH_PROT_IPV4) &&
705 (addr->proto == QETH_PROT_IPV4) && 705 (addr->proto == QETH_PROT_IPV4) &&
706 (tmp->type == addr->type) && 706 (tmp->type == addr->type) &&
@@ -1173,7 +1173,7 @@ qeth_determine_card_type(struct qeth_card *card)
1173 "due to hardware limitations!\n"); 1173 "due to hardware limitations!\n");
1174 card->qdio.no_out_queues = 1; 1174 card->qdio.no_out_queues = 1;
1175 card->qdio.default_out_queue = 0; 1175 card->qdio.default_out_queue = 0;
1176 } 1176 }
1177 return 0; 1177 return 0;
1178 } 1178 }
1179 i++; 1179 i++;
@@ -1198,7 +1198,7 @@ qeth_probe_device(struct ccwgroup_device *gdev)
1198 return -ENODEV; 1198 return -ENODEV;
1199 1199
1200 QETH_DBF_TEXT_(setup, 2, "%s", gdev->dev.bus_id); 1200 QETH_DBF_TEXT_(setup, 2, "%s", gdev->dev.bus_id);
1201 1201
1202 card = qeth_alloc_card(); 1202 card = qeth_alloc_card();
1203 if (!card) { 1203 if (!card) {
1204 put_device(dev); 1204 put_device(dev);
@@ -1220,7 +1220,7 @@ qeth_probe_device(struct ccwgroup_device *gdev)
1220 put_device(dev); 1220 put_device(dev);
1221 qeth_free_card(card); 1221 qeth_free_card(card);
1222 return rc; 1222 return rc;
1223 } 1223 }
1224 if ((rc = qeth_setup_card(card))){ 1224 if ((rc = qeth_setup_card(card))){
1225 QETH_DBF_TEXT_(setup, 2, "2err%d", rc); 1225 QETH_DBF_TEXT_(setup, 2, "2err%d", rc);
1226 put_device(dev); 1226 put_device(dev);
@@ -1843,7 +1843,7 @@ struct qeth_cmd_buffer *iob)
1843 &card->seqno.pdu_hdr_ack, QETH_SEQ_NO_LENGTH); 1843 &card->seqno.pdu_hdr_ack, QETH_SEQ_NO_LENGTH);
1844 QETH_DBF_HEX(control, 2, iob->data, QETH_DBF_CONTROL_LEN); 1844 QETH_DBF_HEX(control, 2, iob->data, QETH_DBF_CONTROL_LEN);
1845} 1845}
1846 1846
1847static int 1847static int
1848qeth_send_control_data(struct qeth_card *card, int len, 1848qeth_send_control_data(struct qeth_card *card, int len,
1849 struct qeth_cmd_buffer *iob, 1849 struct qeth_cmd_buffer *iob,
@@ -1937,7 +1937,7 @@ qeth_osn_send_control_data(struct qeth_card *card, int len,
1937 wake_up(&card->wait_q); 1937 wake_up(&card->wait_q);
1938 } 1938 }
1939 return rc; 1939 return rc;
1940} 1940}
1941 1941
1942static inline void 1942static inline void
1943qeth_prepare_ipa_cmd(struct qeth_card *card, struct qeth_cmd_buffer *iob, 1943qeth_prepare_ipa_cmd(struct qeth_card *card, struct qeth_cmd_buffer *iob,
@@ -1966,7 +1966,7 @@ qeth_osn_send_ipa_cmd(struct qeth_card *card, struct qeth_cmd_buffer *iob,
1966 memcpy(QETH_IPA_PDU_LEN_PDU3(iob->data), &s2, 2); 1966 memcpy(QETH_IPA_PDU_LEN_PDU3(iob->data), &s2, 2);
1967 return qeth_osn_send_control_data(card, s1, iob); 1967 return qeth_osn_send_control_data(card, s1, iob);
1968} 1968}
1969 1969
1970static int 1970static int
1971qeth_send_ipa_cmd(struct qeth_card *card, struct qeth_cmd_buffer *iob, 1971qeth_send_ipa_cmd(struct qeth_card *card, struct qeth_cmd_buffer *iob,
1972 int (*reply_cb) 1972 int (*reply_cb)
@@ -2579,7 +2579,7 @@ qeth_process_inbound_buffer(struct qeth_card *card,
2579 skb->dev = card->dev; 2579 skb->dev = card->dev;
2580 if (hdr->hdr.l2.id == QETH_HEADER_TYPE_LAYER2) 2580 if (hdr->hdr.l2.id == QETH_HEADER_TYPE_LAYER2)
2581 vlan_tag = qeth_layer2_rebuild_skb(card, skb, hdr); 2581 vlan_tag = qeth_layer2_rebuild_skb(card, skb, hdr);
2582 else if (hdr->hdr.l3.id == QETH_HEADER_TYPE_LAYER3) 2582 else if (hdr->hdr.l3.id == QETH_HEADER_TYPE_LAYER3)
2583 qeth_rebuild_skb(card, skb, hdr); 2583 qeth_rebuild_skb(card, skb, hdr);
2584 else { /*in case of OSN*/ 2584 else { /*in case of OSN*/
2585 skb_push(skb, sizeof(struct qeth_hdr)); 2585 skb_push(skb, sizeof(struct qeth_hdr));
@@ -2763,7 +2763,7 @@ qeth_qdio_input_handler(struct ccw_device * ccwdev, unsigned int status,
2763 index = i % QDIO_MAX_BUFFERS_PER_Q; 2763 index = i % QDIO_MAX_BUFFERS_PER_Q;
2764 buffer = &card->qdio.in_q->bufs[index]; 2764 buffer = &card->qdio.in_q->bufs[index];
2765 if (!((status & QDIO_STATUS_LOOK_FOR_ERROR) && 2765 if (!((status & QDIO_STATUS_LOOK_FOR_ERROR) &&
2766 qeth_check_qdio_errors(buffer->buffer, 2766 qeth_check_qdio_errors(buffer->buffer,
2767 qdio_err, siga_err,"qinerr"))) 2767 qdio_err, siga_err,"qinerr")))
2768 qeth_process_inbound_buffer(card, buffer, index); 2768 qeth_process_inbound_buffer(card, buffer, index);
2769 /* clear buffer and give back to hardware */ 2769 /* clear buffer and give back to hardware */
@@ -3187,7 +3187,7 @@ qeth_alloc_qdio_buffers(struct qeth_card *card)
3187 if (card->qdio.state == QETH_QDIO_ALLOCATED) 3187 if (card->qdio.state == QETH_QDIO_ALLOCATED)
3188 return 0; 3188 return 0;
3189 3189
3190 card->qdio.in_q = kmalloc(sizeof(struct qeth_qdio_q), 3190 card->qdio.in_q = kmalloc(sizeof(struct qeth_qdio_q),
3191 GFP_KERNEL|GFP_DMA); 3191 GFP_KERNEL|GFP_DMA);
3192 if (!card->qdio.in_q) 3192 if (!card->qdio.in_q)
3193 return - ENOMEM; 3193 return - ENOMEM;
@@ -3476,7 +3476,7 @@ qeth_halt_channels(struct qeth_card *card)
3476 rc3 = qeth_halt_channel(&card->data); 3476 rc3 = qeth_halt_channel(&card->data);
3477 if (rc1) 3477 if (rc1)
3478 return rc1; 3478 return rc1;
3479 if (rc2) 3479 if (rc2)
3480 return rc2; 3480 return rc2;
3481 return rc3; 3481 return rc3;
3482} 3482}
@@ -3491,7 +3491,7 @@ qeth_clear_channels(struct qeth_card *card)
3491 rc3 = qeth_clear_channel(&card->data); 3491 rc3 = qeth_clear_channel(&card->data);
3492 if (rc1) 3492 if (rc1)
3493 return rc1; 3493 return rc1;
3494 if (rc2) 3494 if (rc2)
3495 return rc2; 3495 return rc2;
3496 return rc3; 3496 return rc3;
3497} 3497}
@@ -3798,10 +3798,10 @@ qeth_open(struct net_device *dev)
3798 QETH_DBF_TEXT(trace,4,"nomacadr"); 3798 QETH_DBF_TEXT(trace,4,"nomacadr");
3799 return -EPERM; 3799 return -EPERM;
3800 } 3800 }
3801 card->dev->flags |= IFF_UP;
3802 netif_start_queue(dev);
3803 card->data.state = CH_STATE_UP; 3801 card->data.state = CH_STATE_UP;
3804 card->state = CARD_STATE_UP; 3802 card->state = CARD_STATE_UP;
3803 card->dev->flags |= IFF_UP;
3804 netif_start_queue(dev);
3805 3805
3806 if (!card->lan_online && netif_carrier_ok(dev)) 3806 if (!card->lan_online && netif_carrier_ok(dev))
3807 netif_carrier_off(dev); 3807 netif_carrier_off(dev);
@@ -3817,7 +3817,7 @@ qeth_stop(struct net_device *dev)
3817 3817
3818 card = (struct qeth_card *) dev->priv; 3818 card = (struct qeth_card *) dev->priv;
3819 3819
3820 netif_stop_queue(dev); 3820 netif_tx_disable(dev);
3821 card->dev->flags &= ~IFF_UP; 3821 card->dev->flags &= ~IFF_UP;
3822 if (card->state == CARD_STATE_UP) 3822 if (card->state == CARD_STATE_UP)
3823 card->state = CARD_STATE_SOFTSETUP; 3823 card->state = CARD_STATE_SOFTSETUP;
@@ -3958,7 +3958,7 @@ qeth_prepare_skb(struct qeth_card *card, struct sk_buff **skb,
3958#endif 3958#endif
3959 *hdr = (struct qeth_hdr *) 3959 *hdr = (struct qeth_hdr *)
3960 qeth_push_skb(card, skb, sizeof(struct qeth_hdr)); 3960 qeth_push_skb(card, skb, sizeof(struct qeth_hdr));
3961 if (hdr == NULL) 3961 if (*hdr == NULL)
3962 return -EINVAL; 3962 return -EINVAL;
3963 return 0; 3963 return 0;
3964} 3964}
@@ -4098,7 +4098,7 @@ qeth_fill_header(struct qeth_card *card, struct qeth_hdr *hdr,
4098 } 4098 }
4099 } else { /* passthrough */ 4099 } else { /* passthrough */
4100 if((skb->dev->type == ARPHRD_IEEE802_TR) && 4100 if((skb->dev->type == ARPHRD_IEEE802_TR) &&
4101 !memcmp(skb->data + sizeof(struct qeth_hdr) + 4101 !memcmp(skb->data + sizeof(struct qeth_hdr) +
4102 sizeof(__u16), skb->dev->broadcast, 6)) { 4102 sizeof(__u16), skb->dev->broadcast, 6)) {
4103 hdr->hdr.l3.flags = QETH_CAST_BROADCAST | 4103 hdr->hdr.l3.flags = QETH_CAST_BROADCAST |
4104 QETH_HDR_PASSTHRU; 4104 QETH_HDR_PASSTHRU;
@@ -4385,7 +4385,7 @@ out:
4385} 4385}
4386 4386
4387static inline int 4387static inline int
4388qeth_get_elements_no(struct qeth_card *card, void *hdr, 4388qeth_get_elements_no(struct qeth_card *card, void *hdr,
4389 struct sk_buff *skb, int elems) 4389 struct sk_buff *skb, int elems)
4390{ 4390{
4391 int elements_needed = 0; 4391 int elements_needed = 0;
@@ -4416,6 +4416,8 @@ qeth_send_packet(struct qeth_card *card, struct sk_buff *skb)
4416 enum qeth_large_send_types large_send = QETH_LARGE_SEND_NO; 4416 enum qeth_large_send_types large_send = QETH_LARGE_SEND_NO;
4417 struct qeth_eddp_context *ctx = NULL; 4417 struct qeth_eddp_context *ctx = NULL;
4418 int tx_bytes = skb->len; 4418 int tx_bytes = skb->len;
4419 unsigned short nr_frags = skb_shinfo(skb)->nr_frags;
4420 unsigned short tso_size = skb_shinfo(skb)->tso_size;
4419 int rc; 4421 int rc;
4420 4422
4421 QETH_DBF_TEXT(trace, 6, "sendpkt"); 4423 QETH_DBF_TEXT(trace, 6, "sendpkt");
@@ -4441,7 +4443,7 @@ qeth_send_packet(struct qeth_card *card, struct sk_buff *skb)
4441 return 0; 4443 return 0;
4442 } 4444 }
4443 cast_type = qeth_get_cast_type(card, skb); 4445 cast_type = qeth_get_cast_type(card, skb);
4444 if ((cast_type == RTN_BROADCAST) && 4446 if ((cast_type == RTN_BROADCAST) &&
4445 (card->info.broadcast_capable == 0)){ 4447 (card->info.broadcast_capable == 0)){
4446 card->stats.tx_dropped++; 4448 card->stats.tx_dropped++;
4447 card->stats.tx_errors++; 4449 card->stats.tx_errors++;
@@ -4463,7 +4465,7 @@ qeth_send_packet(struct qeth_card *card, struct sk_buff *skb)
4463 card->stats.tx_errors++; 4465 card->stats.tx_errors++;
4464 dev_kfree_skb_any(skb); 4466 dev_kfree_skb_any(skb);
4465 return NETDEV_TX_OK; 4467 return NETDEV_TX_OK;
4466 } 4468 }
4467 elements_needed++; 4469 elements_needed++;
4468 } else { 4470 } else {
4469 if ((rc = qeth_prepare_skb(card, &skb, &hdr, ipv))) { 4471 if ((rc = qeth_prepare_skb(card, &skb, &hdr, ipv))) {
@@ -4498,16 +4500,16 @@ qeth_send_packet(struct qeth_card *card, struct sk_buff *skb)
4498 card->stats.tx_packets++; 4500 card->stats.tx_packets++;
4499 card->stats.tx_bytes += tx_bytes; 4501 card->stats.tx_bytes += tx_bytes;
4500#ifdef CONFIG_QETH_PERF_STATS 4502#ifdef CONFIG_QETH_PERF_STATS
4501 if (skb_shinfo(skb)->tso_size && 4503 if (tso_size &&
4502 !(large_send == QETH_LARGE_SEND_NO)) { 4504 !(large_send == QETH_LARGE_SEND_NO)) {
4503 card->perf_stats.large_send_bytes += skb->len; 4505 card->perf_stats.large_send_bytes += tx_bytes;
4504 card->perf_stats.large_send_cnt++; 4506 card->perf_stats.large_send_cnt++;
4505 } 4507 }
4506 if (skb_shinfo(skb)->nr_frags > 0){ 4508 if (nr_frags > 0){
4507 card->perf_stats.sg_skbs_sent++; 4509 card->perf_stats.sg_skbs_sent++;
4508 /* nr_frags + skb->data */ 4510 /* nr_frags + skb->data */
4509 card->perf_stats.sg_frags_sent += 4511 card->perf_stats.sg_frags_sent +=
4510 skb_shinfo(skb)->nr_frags + 1; 4512 nr_frags + 1;
4511 } 4513 }
4512#endif /* CONFIG_QETH_PERF_STATS */ 4514#endif /* CONFIG_QETH_PERF_STATS */
4513 } 4515 }
@@ -5373,7 +5375,7 @@ qeth_layer2_send_setdelvlan_cb(struct qeth_card *card,
5373 cmd = (struct qeth_ipa_cmd *) data; 5375 cmd = (struct qeth_ipa_cmd *) data;
5374 if (cmd->hdr.return_code) { 5376 if (cmd->hdr.return_code) {
5375 PRINT_ERR("Error in processing VLAN %i on %s: 0x%x. " 5377 PRINT_ERR("Error in processing VLAN %i on %s: 0x%x. "
5376 "Continuing\n",cmd->data.setdelvlan.vlan_id, 5378 "Continuing\n",cmd->data.setdelvlan.vlan_id,
5377 QETH_CARD_IFNAME(card), cmd->hdr.return_code); 5379 QETH_CARD_IFNAME(card), cmd->hdr.return_code);
5378 QETH_DBF_TEXT_(trace, 2, "L2VL%4x", cmd->hdr.command); 5380 QETH_DBF_TEXT_(trace, 2, "L2VL%4x", cmd->hdr.command);
5379 QETH_DBF_TEXT_(trace, 2, "L2%s", CARD_BUS_ID(card)); 5381 QETH_DBF_TEXT_(trace, 2, "L2%s", CARD_BUS_ID(card));
@@ -5393,7 +5395,7 @@ qeth_layer2_send_setdelvlan(struct qeth_card *card, __u16 i,
5393 iob = qeth_get_ipacmd_buffer(card, ipacmd, QETH_PROT_IPV4); 5395 iob = qeth_get_ipacmd_buffer(card, ipacmd, QETH_PROT_IPV4);
5394 cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE); 5396 cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE);
5395 cmd->data.setdelvlan.vlan_id = i; 5397 cmd->data.setdelvlan.vlan_id = i;
5396 return qeth_send_ipa_cmd(card, iob, 5398 return qeth_send_ipa_cmd(card, iob,
5397 qeth_layer2_send_setdelvlan_cb, NULL); 5399 qeth_layer2_send_setdelvlan_cb, NULL);
5398} 5400}
5399 5401
@@ -5457,7 +5459,7 @@ qeth_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
5457 * Examine hardware response to SET_PROMISC_MODE 5459 * Examine hardware response to SET_PROMISC_MODE
5458 */ 5460 */
5459static int 5461static int
5460qeth_setadp_promisc_mode_cb(struct qeth_card *card, 5462qeth_setadp_promisc_mode_cb(struct qeth_card *card,
5461 struct qeth_reply *reply, 5463 struct qeth_reply *reply,
5462 unsigned long data) 5464 unsigned long data)
5463{ 5465{
@@ -5468,10 +5470,10 @@ qeth_setadp_promisc_mode_cb(struct qeth_card *card,
5468 5470
5469 cmd = (struct qeth_ipa_cmd *) data; 5471 cmd = (struct qeth_ipa_cmd *) data;
5470 setparms = &(cmd->data.setadapterparms); 5472 setparms = &(cmd->data.setadapterparms);
5471 5473
5472 qeth_default_setadapterparms_cb(card, reply, (unsigned long)cmd); 5474 qeth_default_setadapterparms_cb(card, reply, (unsigned long)cmd);
5473 if (cmd->hdr.return_code) { 5475 if (cmd->hdr.return_code) {
5474 QETH_DBF_TEXT_(trace,4,"prmrc%2.2x",cmd->hdr.return_code); 5476 QETH_DBF_TEXT_(trace,4,"prmrc%2.2x",cmd->hdr.return_code);
5475 setparms->data.mode = SET_PROMISC_MODE_OFF; 5477 setparms->data.mode = SET_PROMISC_MODE_OFF;
5476 } 5478 }
5477 card->info.promisc_mode = setparms->data.mode; 5479 card->info.promisc_mode = setparms->data.mode;
@@ -5517,7 +5519,7 @@ qeth_set_multicast_list(struct net_device *dev)
5517 5519
5518 if (card->info.type == QETH_CARD_TYPE_OSN) 5520 if (card->info.type == QETH_CARD_TYPE_OSN)
5519 return ; 5521 return ;
5520 5522
5521 QETH_DBF_TEXT(trace, 3, "setmulti"); 5523 QETH_DBF_TEXT(trace, 3, "setmulti");
5522 qeth_delete_mc_addresses(card); 5524 qeth_delete_mc_addresses(card);
5523 if (card->options.layer2) { 5525 if (card->options.layer2) {
@@ -5575,7 +5577,7 @@ qeth_osn_assist(struct net_device *dev,
5575 struct qeth_cmd_buffer *iob; 5577 struct qeth_cmd_buffer *iob;
5576 struct qeth_card *card; 5578 struct qeth_card *card;
5577 int rc; 5579 int rc;
5578 5580
5579 QETH_DBF_TEXT(trace, 2, "osnsdmc"); 5581 QETH_DBF_TEXT(trace, 2, "osnsdmc");
5580 if (!dev) 5582 if (!dev)
5581 return -ENODEV; 5583 return -ENODEV;
@@ -5654,7 +5656,7 @@ qeth_osn_deregister(struct net_device * dev)
5654 card->osn_info.data_cb = NULL; 5656 card->osn_info.data_cb = NULL;
5655 return; 5657 return;
5656} 5658}
5657 5659
5658static void 5660static void
5659qeth_delete_mc_addresses(struct qeth_card *card) 5661qeth_delete_mc_addresses(struct qeth_card *card)
5660{ 5662{
@@ -5818,7 +5820,7 @@ qeth_add_multicast_ipv6(struct qeth_card *card)
5818 struct inet6_dev *in6_dev; 5820 struct inet6_dev *in6_dev;
5819 5821
5820 QETH_DBF_TEXT(trace,4,"chkmcv6"); 5822 QETH_DBF_TEXT(trace,4,"chkmcv6");
5821 if (!qeth_is_supported(card, IPA_IPV6)) 5823 if (!qeth_is_supported(card, IPA_IPV6))
5822 return ; 5824 return ;
5823 in6_dev = in6_dev_get(card->dev); 5825 in6_dev = in6_dev_get(card->dev);
5824 if (in6_dev == NULL) 5826 if (in6_dev == NULL)
@@ -6359,12 +6361,9 @@ qeth_netdev_init(struct net_device *dev)
6359 dev->vlan_rx_kill_vid = qeth_vlan_rx_kill_vid; 6361 dev->vlan_rx_kill_vid = qeth_vlan_rx_kill_vid;
6360 dev->vlan_rx_add_vid = qeth_vlan_rx_add_vid; 6362 dev->vlan_rx_add_vid = qeth_vlan_rx_add_vid;
6361#endif 6363#endif
6362 dev->hard_header = card->orig_hard_header;
6363 if (qeth_get_netdev_flags(card) & IFF_NOARP) { 6364 if (qeth_get_netdev_flags(card) & IFF_NOARP) {
6364 dev->rebuild_header = NULL; 6365 dev->rebuild_header = NULL;
6365 dev->hard_header = NULL; 6366 dev->hard_header = NULL;
6366 if (card->options.fake_ll)
6367 dev->hard_header = qeth_fake_header;
6368 dev->header_cache_update = NULL; 6367 dev->header_cache_update = NULL;
6369 dev->hard_header_cache = NULL; 6368 dev->hard_header_cache = NULL;
6370 } 6369 }
@@ -6373,6 +6372,9 @@ qeth_netdev_init(struct net_device *dev)
6373 if (!(card->info.unique_id & UNIQUE_ID_NOT_BY_CARD)) 6372 if (!(card->info.unique_id & UNIQUE_ID_NOT_BY_CARD))
6374 card->dev->dev_id = card->info.unique_id & 0xffff; 6373 card->dev->dev_id = card->info.unique_id & 0xffff;
6375#endif 6374#endif
6375 if (card->options.fake_ll &&
6376 (qeth_get_netdev_flags(card) & IFF_NOARP))
6377 dev->hard_header = qeth_fake_header;
6376 dev->hard_header_parse = NULL; 6378 dev->hard_header_parse = NULL;
6377 dev->set_mac_address = qeth_layer2_set_mac_address; 6379 dev->set_mac_address = qeth_layer2_set_mac_address;
6378 dev->flags |= qeth_get_netdev_flags(card); 6380 dev->flags |= qeth_get_netdev_flags(card);
@@ -6477,6 +6479,9 @@ retry:
6477 /*network device will be recovered*/ 6479 /*network device will be recovered*/
6478 if (card->dev) { 6480 if (card->dev) {
6479 card->dev->hard_header = card->orig_hard_header; 6481 card->dev->hard_header = card->orig_hard_header;
6482 if (card->options.fake_ll &&
6483 (qeth_get_netdev_flags(card) & IFF_NOARP))
6484 card->dev->hard_header = qeth_fake_header;
6480 return 0; 6485 return 0;
6481 } 6486 }
6482 /* at first set_online allocate netdev */ 6487 /* at first set_online allocate netdev */
@@ -6584,7 +6589,7 @@ qeth_setadpparms_change_macaddr_cb(struct qeth_card *card,
6584 6589
6585 cmd = (struct qeth_ipa_cmd *) data; 6590 cmd = (struct qeth_ipa_cmd *) data;
6586 if (!card->options.layer2 || card->info.guestlan || 6591 if (!card->options.layer2 || card->info.guestlan ||
6587 !(card->info.mac_bits & QETH_LAYER2_MAC_READ)) { 6592 !(card->info.mac_bits & QETH_LAYER2_MAC_READ)) {
6588 memcpy(card->dev->dev_addr, 6593 memcpy(card->dev->dev_addr,
6589 &cmd->data.setadapterparms.data.change_addr.addr, 6594 &cmd->data.setadapterparms.data.change_addr.addr,
6590 OSA_ADDR_LEN); 6595 OSA_ADDR_LEN);
@@ -7031,14 +7036,12 @@ qeth_softsetup_ipv6(struct qeth_card *card)
7031 7036
7032 QETH_DBF_TEXT(trace,3,"softipv6"); 7037 QETH_DBF_TEXT(trace,3,"softipv6");
7033 7038
7034 netif_stop_queue(card->dev);
7035 rc = qeth_send_startlan(card, QETH_PROT_IPV6); 7039 rc = qeth_send_startlan(card, QETH_PROT_IPV6);
7036 if (rc) { 7040 if (rc) {
7037 PRINT_ERR("IPv6 startlan failed on %s\n", 7041 PRINT_ERR("IPv6 startlan failed on %s\n",
7038 QETH_CARD_IFNAME(card)); 7042 QETH_CARD_IFNAME(card));
7039 return rc; 7043 return rc;
7040 } 7044 }
7041 netif_wake_queue(card->dev);
7042 rc = qeth_query_ipassists(card,QETH_PROT_IPV6); 7045 rc = qeth_query_ipassists(card,QETH_PROT_IPV6);
7043 if (rc) { 7046 if (rc) {
7044 PRINT_ERR("IPv6 query ipassist failed on %s\n", 7047 PRINT_ERR("IPv6 query ipassist failed on %s\n",
@@ -7352,7 +7355,8 @@ qeth_set_large_send(struct qeth_card *card, enum qeth_large_send_types type)
7352 card->options.large_send = type; 7355 card->options.large_send = type;
7353 return 0; 7356 return 0;
7354 } 7357 }
7355 netif_stop_queue(card->dev); 7358 if (card->state == CARD_STATE_UP)
7359 netif_tx_disable(card->dev);
7356 card->options.large_send = type; 7360 card->options.large_send = type;
7357 switch (card->options.large_send) { 7361 switch (card->options.large_send) {
7358 case QETH_LARGE_SEND_EDDP: 7362 case QETH_LARGE_SEND_EDDP:
@@ -7374,7 +7378,8 @@ qeth_set_large_send(struct qeth_card *card, enum qeth_large_send_types type)
7374 card->dev->features &= ~(NETIF_F_TSO | NETIF_F_SG); 7378 card->dev->features &= ~(NETIF_F_TSO | NETIF_F_SG);
7375 break; 7379 break;
7376 } 7380 }
7377 netif_wake_queue(card->dev); 7381 if (card->state == CARD_STATE_UP)
7382 netif_wake_queue(card->dev);
7378 return rc; 7383 return rc;
7379} 7384}
7380 7385
@@ -7427,7 +7432,7 @@ qeth_softsetup_card(struct qeth_card *card)
7427 if ((rc = qeth_setrouting_v6(card))) 7432 if ((rc = qeth_setrouting_v6(card)))
7428 QETH_DBF_TEXT_(setup, 2, "5err%d", rc); 7433 QETH_DBF_TEXT_(setup, 2, "5err%d", rc);
7429out: 7434out:
7430 netif_stop_queue(card->dev); 7435 netif_tx_disable(card->dev);
7431 return 0; 7436 return 0;
7432} 7437}
7433 7438
@@ -7567,7 +7572,7 @@ qeth_stop_card(struct qeth_card *card, int recovery_mode)
7567 if (card->read.state == CH_STATE_UP && 7572 if (card->read.state == CH_STATE_UP &&
7568 card->write.state == CH_STATE_UP && 7573 card->write.state == CH_STATE_UP &&
7569 (card->state == CARD_STATE_UP)) { 7574 (card->state == CARD_STATE_UP)) {
7570 if (recovery_mode && 7575 if (recovery_mode &&
7571 card->info.type != QETH_CARD_TYPE_OSN) { 7576 card->info.type != QETH_CARD_TYPE_OSN) {
7572 qeth_stop(card->dev); 7577 qeth_stop(card->dev);
7573 } else { 7578 } else {
@@ -7736,10 +7741,8 @@ static int
7736qeth_register_netdev(struct qeth_card *card) 7741qeth_register_netdev(struct qeth_card *card)
7737{ 7742{
7738 QETH_DBF_TEXT(setup, 3, "regnetd"); 7743 QETH_DBF_TEXT(setup, 3, "regnetd");
7739 if (card->dev->reg_state != NETREG_UNINITIALIZED) { 7744 if (card->dev->reg_state != NETREG_UNINITIALIZED)
7740 qeth_netdev_init(card->dev);
7741 return 0; 7745 return 0;
7742 }
7743 /* sysfs magic */ 7746 /* sysfs magic */
7744 SET_NETDEV_DEV(card->dev, &card->gdev->dev); 7747 SET_NETDEV_DEV(card->dev, &card->gdev->dev);
7745 return register_netdev(card->dev); 7748 return register_netdev(card->dev);
@@ -7750,7 +7753,7 @@ qeth_start_again(struct qeth_card *card, int recovery_mode)
7750{ 7753{
7751 QETH_DBF_TEXT(setup ,2, "startag"); 7754 QETH_DBF_TEXT(setup ,2, "startag");
7752 7755
7753 if (recovery_mode && 7756 if (recovery_mode &&
7754 card->info.type != QETH_CARD_TYPE_OSN) { 7757 card->info.type != QETH_CARD_TYPE_OSN) {
7755 qeth_open(card->dev); 7758 qeth_open(card->dev);
7756 } else { 7759 } else {
diff --git a/drivers/s390/net/qeth_mpc.h b/drivers/s390/net/qeth_mpc.h
index 011c41041029..0477c47471c5 100644
--- a/drivers/s390/net/qeth_mpc.h
+++ b/drivers/s390/net/qeth_mpc.h
@@ -445,7 +445,7 @@ enum qeth_ipa_arp_return_codes {
445/* Helper functions */ 445/* Helper functions */
446#define IS_IPA_REPLY(cmd) ((cmd->hdr.initiator == IPA_CMD_INITIATOR_HOST) || \ 446#define IS_IPA_REPLY(cmd) ((cmd->hdr.initiator == IPA_CMD_INITIATOR_HOST) || \
447 (cmd->hdr.initiator == IPA_CMD_INITIATOR_OSA_REPLY)) 447 (cmd->hdr.initiator == IPA_CMD_INITIATOR_OSA_REPLY))
448 448
449/*****************************************************************************/ 449/*****************************************************************************/
450/* END OF IP Assist related definitions */ 450/* END OF IP Assist related definitions */
451/*****************************************************************************/ 451/*****************************************************************************/
@@ -490,7 +490,7 @@ extern unsigned char ULP_ENABLE[];
490/* Layer 2 defintions */ 490/* Layer 2 defintions */
491#define QETH_PROT_LAYER2 0x08 491#define QETH_PROT_LAYER2 0x08
492#define QETH_PROT_TCPIP 0x03 492#define QETH_PROT_TCPIP 0x03
493#define QETH_PROT_OSN2 0x0a 493#define QETH_PROT_OSN2 0x0a
494#define QETH_ULP_ENABLE_PROT_TYPE(buffer) (buffer+0x50) 494#define QETH_ULP_ENABLE_PROT_TYPE(buffer) (buffer+0x50)
495#define QETH_IPA_CMD_PROT_TYPE(buffer) (buffer+0x19) 495#define QETH_IPA_CMD_PROT_TYPE(buffer) (buffer+0x19)
496 496
diff --git a/drivers/s390/net/qeth_proc.c b/drivers/s390/net/qeth_proc.c
index 360d782c7ada..66f2da14e6e3 100644
--- a/drivers/s390/net/qeth_proc.c
+++ b/drivers/s390/net/qeth_proc.c
@@ -36,7 +36,7 @@ qeth_procfile_seq_start(struct seq_file *s, loff_t *offset)
36{ 36{
37 struct device *dev = NULL; 37 struct device *dev = NULL;
38 loff_t nr = 0; 38 loff_t nr = 0;
39 39
40 down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); 40 down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem);
41 if (*offset == 0) 41 if (*offset == 0)
42 return SEQ_START_TOKEN; 42 return SEQ_START_TOKEN;
@@ -60,8 +60,8 @@ static void *
60qeth_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset) 60qeth_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset)
61{ 61{
62 struct device *prev, *next; 62 struct device *prev, *next;
63 63
64 if (it == SEQ_START_TOKEN) 64 if (it == SEQ_START_TOKEN)
65 prev = NULL; 65 prev = NULL;
66 else 66 else
67 prev = (struct device *) it; 67 prev = (struct device *) it;
@@ -180,7 +180,7 @@ qeth_perf_procfile_seq_show(struct seq_file *s, void *it)
180 struct device *device; 180 struct device *device;
181 struct qeth_card *card; 181 struct qeth_card *card;
182 182
183 183
184 if (it == SEQ_START_TOKEN) 184 if (it == SEQ_START_TOKEN)
185 return 0; 185 return 0;
186 186
diff --git a/drivers/s390/net/qeth_sys.c b/drivers/s390/net/qeth_sys.c
index 882d419e4160..185a9cfbcbdc 100644
--- a/drivers/s390/net/qeth_sys.c
+++ b/drivers/s390/net/qeth_sys.c
@@ -785,7 +785,7 @@ qeth_dev_large_send_store(struct device *dev, struct device_attribute *attr, con
785 } 785 }
786 if (card->options.large_send == type) 786 if (card->options.large_send == type)
787 return count; 787 return count;
788 if ((rc = qeth_set_large_send(card, type))) 788 if ((rc = qeth_set_large_send(card, type)))
789 return rc; 789 return rc;
790 return count; 790 return count;
791} 791}
@@ -1682,7 +1682,7 @@ qeth_create_device_attributes(struct device *dev)
1682 if (card->info.type == QETH_CARD_TYPE_OSN) 1682 if (card->info.type == QETH_CARD_TYPE_OSN)
1683 return sysfs_create_group(&dev->kobj, 1683 return sysfs_create_group(&dev->kobj,
1684 &qeth_osn_device_attr_group); 1684 &qeth_osn_device_attr_group);
1685 1685
1686 if ((ret = sysfs_create_group(&dev->kobj, &qeth_device_attr_group))) 1686 if ((ret = sysfs_create_group(&dev->kobj, &qeth_device_attr_group)))
1687 return ret; 1687 return ret;
1688 if ((ret = sysfs_create_group(&dev->kobj, &qeth_device_ipato_group))){ 1688 if ((ret = sysfs_create_group(&dev->kobj, &qeth_device_ipato_group))){
@@ -1713,7 +1713,7 @@ qeth_remove_device_attributes(struct device *dev)
1713 if (card->info.type == QETH_CARD_TYPE_OSN) 1713 if (card->info.type == QETH_CARD_TYPE_OSN)
1714 return sysfs_remove_group(&dev->kobj, 1714 return sysfs_remove_group(&dev->kobj,
1715 &qeth_osn_device_attr_group); 1715 &qeth_osn_device_attr_group);
1716 1716
1717 sysfs_remove_group(&dev->kobj, &qeth_device_attr_group); 1717 sysfs_remove_group(&dev->kobj, &qeth_device_attr_group);
1718 sysfs_remove_group(&dev->kobj, &qeth_device_ipato_group); 1718 sysfs_remove_group(&dev->kobj, &qeth_device_ipato_group);
1719 sysfs_remove_group(&dev->kobj, &qeth_device_vipa_group); 1719 sysfs_remove_group(&dev->kobj, &qeth_device_vipa_group);
diff --git a/drivers/s390/net/qeth_tso.h b/drivers/s390/net/qeth_tso.h
index 1286ddea450b..24ef40ca9562 100644
--- a/drivers/s390/net/qeth_tso.h
+++ b/drivers/s390/net/qeth_tso.h
@@ -117,11 +117,11 @@ __qeth_fill_buffer_frag(struct sk_buff *skb, struct qdio_buffer *buffer,
117 int fragno; 117 int fragno;
118 unsigned long addr; 118 unsigned long addr;
119 int element, cnt, dlen; 119 int element, cnt, dlen;
120 120
121 fragno = skb_shinfo(skb)->nr_frags; 121 fragno = skb_shinfo(skb)->nr_frags;
122 element = *next_element_to_fill; 122 element = *next_element_to_fill;
123 dlen = 0; 123 dlen = 0;
124 124
125 if (is_tso) 125 if (is_tso)
126 buffer->element[element].flags = 126 buffer->element[element].flags =
127 SBAL_FLAGS_MIDDLE_FRAG; 127 SBAL_FLAGS_MIDDLE_FRAG;