Commit 99e0846e authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] s390: network drivers

From: Martin Schwidefsky <schwidefsky@de.ibm.com>

 - ctc/iucv: Add module author/description/license to fsm.c
 - ctc/lcs/iucv/qeth: Remove dst_link_failure calls because they can
   trigger a BUG in icmp.c.
 - ctc/iucv/qeth: Use s390_root_dev_{register,unregister} to fix reference
   counting for the group device sysfs root object.
 - ctc/lcs/qeth: Fix ccwgroup behaviour, remove should not imply offline.
 - ctc: Adapt to notify api change in cio.
 - ctc: Remove duplicate put_user.
 - iucv: Fix oops with empty netiucv peer name.
 - iucv: Use GFP_ATOMIC for kmalloc from tasklet.
 - iucv: Fix removal of attritubes.
 - qeth: Use correct length in clearing of MAC address.
 - qeth: Queue multicast and broadcast packets into the last
   queue on HiperSocket.
 - qeth: Reenable send control data after i/o error.
 - qeth: Find correct recbuf in qeth_send_control_data.
 - qeth: Handle VM startlan disabled.
 - qeth: Set flags for vipa entries.
 - qeth: Correct netmask on vipa setting.
 - qeth: Fix spinlock problems ("scheduling while atomic").
 - qeth: Avoid setting multicast IP addresses several times.
 - qeth: Fix /proc/qeth format.
 - qeth: Fix race on device removal.
parent 08f64b97
/*
* $Id: ctcmain.c,v 1.47 2003/09/22 13:40:51 cohuck Exp $
* $Id: ctcmain.c,v 1.50 2003/12/02 15:18:50 cohuck Exp $
*
* CTC / ESCON network driver
*
......@@ -36,7 +36,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* RELEASE-TAG: CTC/ESCON network driver $Revision: 1.47 $
* RELEASE-TAG: CTC/ESCON network driver $Revision: 1.50 $
*
*/
......@@ -272,7 +272,7 @@ static void
print_banner(void)
{
static int printed = 0;
char vbuf[] = "$Revision: 1.47 $";
char vbuf[] = "$Revision: 1.50 $";
char *version = vbuf;
if (printed)
......@@ -2441,14 +2441,12 @@ ctc_tx(struct sk_buff *skb, struct net_device * dev)
/**
* If channels are not running, try to restart them
* notify anybody about a link failure and throw
* away packet.
* and throw away packet.
*/
if (fsm_getstate(privptr->fsm) != DEV_STATE_RUNNING) {
fsm_event(privptr->fsm, DEV_EVENT_START, dev);
if (privptr->protocol == CTC_PROTO_LINUX_TTY)
return -EBUSY;
dst_link_failure(skb);
dev_kfree_skb(skb);
privptr->stats.tx_dropped++;
privptr->stats.tx_errors++;
......@@ -2994,20 +2992,20 @@ ctc_shutdown_device(struct ccwgroup_device *cgdev)
}
static int
static void
ctc_remove_device(struct ccwgroup_device *cgdev)
{
struct ctc_priv *priv;
priv = cgdev->dev.driver_data;
if (!priv)
return 0;
return;
if (cgdev->state == CCWGROUP_ONLINE)
ctc_shutdown_device(cgdev);
ctc_remove_files(&cgdev->dev);
cgdev->dev.driver_data = NULL;
kfree(priv);
put_device(&cgdev->dev);
return 0;
}
static struct ccwgroup_driver ctc_group_driver = {
......
/*
* $Id: ctctty.c,v 1.13 2003/09/26 14:48:36 mschwide Exp $
* $Id: ctctty.c,v 1.14 2003/10/06 11:33:33 mschwide Exp $
*
* CTC / ESCON network driver, tty interface.
*
......@@ -761,7 +761,6 @@ ctc_tty_ioctl(struct tty_struct *tty, struct file *file,
error = put_user(C_CLOCAL(tty) ? 1 : 0, (ulong *) arg);
if (error)
return error;
put_user(C_CLOCAL(tty) ? 1 : 0, (ulong *) arg);
return 0;
case TIOCSSOFTCAR:
#ifdef CTC_DEBUG_MODEM_IOCTL
......
/*
* $Id: cu3088.c,v 1.31 2003/09/29 15:24:27 cohuck Exp $
* $Id: cu3088.c,v 1.33 2003/10/14 12:10:19 cohuck Exp $
*
* CTC / LCS ccw_device driver
*
......@@ -25,6 +25,7 @@
#include <linux/init.h>
#include <linux/module.h>
#include <linux/err.h>
#include <asm/ccwdev.h>
#include <asm/ccwgroup.h>
......@@ -55,15 +56,7 @@ static struct ccw_device_id cu3088_ids[] = {
static struct ccw_driver cu3088_driver;
static void
cu3088_root_dev_release (struct device *dev)
{
}
struct device cu3088_root_dev = {
.bus_id = "cu3088",
.release = cu3088_root_dev_release,
};
struct device *cu3088_root_dev;
static ssize_t
group_write(struct device_driver *drv, const char *buf, size_t count)
......@@ -90,7 +83,7 @@ group_write(struct device_driver *drv, const char *buf, size_t count)
start = end + 1;
}
ret = ccwgroup_create(&cu3088_root_dev, cdrv->driver_id,
ret = ccwgroup_create(cu3088_root_dev, cdrv->driver_id,
&cu3088_driver, 2, argv);
return (ret == 0) ? count : ret;
......@@ -144,12 +137,12 @@ cu3088_init (void)
{
int rc;
rc = device_register(&cu3088_root_dev);
if (rc)
return rc;
cu3088_root_dev = s390_root_dev_register("cu3088");
if (IS_ERR(cu3088_root_dev))
return PTR_ERR(cu3088_root_dev);
rc = ccw_driver_register(&cu3088_driver);
if (rc)
device_unregister(&cu3088_root_dev);
s390_root_dev_unregister(cu3088_root_dev);
return rc;
}
......@@ -158,7 +151,7 @@ static void __exit
cu3088_exit (void)
{
ccw_driver_unregister(&cu3088_driver);
device_unregister(&cu3088_root_dev);
s390_root_dev_unregister(cu3088_root_dev);
}
MODULE_DEVICE_TABLE(ccw,cu3088_ids);
......
/**
* $Id: fsm.c,v 1.4 2003/03/28 08:54:40 mschwide Exp $
* $Id: fsm.c,v 1.6 2003/10/15 11:37:29 mschwide Exp $
*
* A generic FSM based on fsm used in isdn4linux
*
......@@ -10,6 +10,10 @@
#include <linux/module.h>
#include <linux/timer.h>
MODULE_AUTHOR("(C) 2000 IBM Corp. by Fritz Elfert (felfert@millenux.com)");
MODULE_DESCRIPTION("Finite state machine helper functions");
MODULE_LICENSE("GPL");
fsm_instance *
init_fsm(char *name, const char **state_names, const char **event_names, int nr_states,
int nr_events, const fsm_node *tmpl, int tmpl_len, int order)
......
/*
* $Id: iucv.c,v 1.15 2003/10/01 09:25:15 mschwide Exp $
* $Id: iucv.c,v 1.19 2003/12/18 15:28:49 braunu Exp $
*
* IUCV network driver
*
......@@ -29,7 +29,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* RELEASE-TAG: IUCV lowlevel driver $Revision: 1.15 $
* RELEASE-TAG: IUCV lowlevel driver $Revision: 1.19 $
*
*/
......@@ -44,12 +44,14 @@
#include <linux/interrupt.h>
#include <linux/list.h>
#include <linux/errno.h>
#include <linux/err.h>
#include <linux/device.h>
#include <asm/atomic.h>
#include "iucv.h"
#include <asm/io.h>
#include <asm/s390_ext.h>
#include <asm/ebcdic.h>
#include <asm/ccwdev.h> //for root device stuff
#define DEBUG
......@@ -79,20 +81,12 @@ iucv_bus_match (struct device *dev, struct device_driver *drv)
return 0;
}
static void
iucv_root_release (struct device *dev)
{
}
struct bus_type iucv_bus = {
.name = "iucv",
.match = iucv_bus_match,
};
struct device iucv_root = {
.bus_id = "iucv",
.release = iucv_root_release,
};
struct device *iucv_root;
/* General IUCV interrupt structure */
typedef struct {
......@@ -355,7 +349,7 @@ do { \
static void
iucv_banner(void)
{
char vbuf[] = "$Revision: 1.15 $";
char vbuf[] = "$Revision: 1.19 $";
char *version = vbuf;
if ((version = strchr(version, ':'))) {
......@@ -378,6 +372,11 @@ iucv_init(void)
{
int ret;
if (!MACHINE_IS_VM) {
printk(KERN_ERR "IUCV: IUCV connection needs VM as base\n");
return -EPROTONOSUPPORT;
}
if (iucv_external_int_buffer)
return 0;
......@@ -387,11 +386,11 @@ iucv_init(void)
return ret;
}
ret = device_register(&iucv_root);
if (ret != 0) {
iucv_root = s390_root_dev_register("iucv");
if (IS_ERR(iucv_root)) {
printk(KERN_ERR "IUCV: failed to register iucv root.\n");
bus_unregister(&iucv_bus);
return ret;
return PTR_ERR(iucv_root);
}
/* Note: GFP_DMA used used to get memory below 2G */
......@@ -401,6 +400,7 @@ iucv_init(void)
printk(KERN_WARNING
"%s: Could not allocate external interrupt buffer\n",
__FUNCTION__);
s390_root_dev_unregister(iucv_root);
return -ENOMEM;
}
memset(iucv_external_int_buffer, 0, sizeof(iucv_GeneralInterrupt));
......@@ -413,6 +413,7 @@ iucv_init(void)
__FUNCTION__);
kfree(iucv_external_int_buffer);
iucv_external_int_buffer = NULL;
s390_root_dev_unregister(iucv_root);
return -ENOMEM;
}
memset(iucv_param_pool, 0, sizeof(iucv_param) * PARAM_POOL_SIZE);
......@@ -439,7 +440,7 @@ iucv_exit(void)
kfree(iucv_external_int_buffer);
if (iucv_param_pool)
kfree(iucv_param_pool);
device_unregister(&iucv_root);
s390_root_dev_unregister(iucv_root);
bus_unregister(&iucv_bus);
printk(KERN_INFO "IUCV lowlevel driver unloaded\n");
}
......@@ -772,7 +773,7 @@ iucv_register_program (__u8 pgmname[16],
}
/* Allocate handler entry */
new_handler = (handler *)kmalloc(sizeof(handler), GFP_KERNEL);
new_handler = (handler *)kmalloc(sizeof(handler), GFP_ATOMIC);
if (new_handler == NULL) {
printk(KERN_WARNING "%s: storage allocation for new handler "
"failed.\n", __FUNCTION__);
......@@ -787,7 +788,7 @@ iucv_register_program (__u8 pgmname[16],
max_connections = iucv_query_maxconn();
iucv_pathid_table = kmalloc(max_connections * sizeof(handler *),
GFP_KERNEL);
GFP_ATOMIC);
if (iucv_pathid_table == NULL) {
printk(KERN_WARNING "%s: iucv_pathid_table storage "
"allocation failed\n", __FUNCTION__);
......
......@@ -203,7 +203,7 @@ typedef struct {
} iucv_array_t __attribute__ ((aligned (8)));
extern struct bus_type iucv_bus;
extern struct device iucv_root;
extern struct device *iucv_root;
/* -prototypes- */
/*
......
......@@ -11,7 +11,7 @@
* Frank Pavlic (pavlic@de.ibm.com) and
* Martin Schwidefsky <schwidefsky@de.ibm.com>
*
* $Revision: 1.58 $ $Date: 2003/09/22 13:33:56 $
* $Revision: 1.61 $ $Date: 2003/12/02 15:18:50 $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -58,7 +58,7 @@
/**
* initialization string for output
*/
#define VERSION_LCS_C "$Revision: 1.58 $"
#define VERSION_LCS_C "$Revision: 1.61 $"
static char version[] __initdata = "LCS driver ("VERSION_LCS_C "/" VERSION_LCS_H ")";
......@@ -1168,7 +1168,6 @@ __lcs_start_xmit(struct lcs_card *card, struct sk_buff *skb,
return -EIO;
}
if (card->state != DEV_STATE_UP) {
dst_link_failure(skb);
dev_kfree_skb(skb);
card->stats.tx_dropped++;
card->stats.tx_errors++;
......@@ -1891,7 +1890,7 @@ lcs_shutdown_device(struct ccwgroup_device *ccwgdev)
/**
* lcs_remove_device, free buffers and card
*/
static int
static void
lcs_remove_device(struct ccwgroup_device *ccwgdev)
{
struct lcs_card *card;
......@@ -1899,12 +1898,18 @@ lcs_remove_device(struct ccwgroup_device *ccwgdev)
LCS_DBF_TEXT(3, setup, "remdev");
card = (struct lcs_card *)ccwgdev->dev.driver_data;
if (!card)
return 0;
return;
if (ccwgdev->state == CCWGROUP_ONLINE) {
lcs_stop_device(card->dev); /* Ignore rc. */
sysfs_remove_link(&card->dev->class_dev.kobj,
ccwgdev->dev.bus_id);
sysfs_remove_link(&ccwgdev->dev.kobj, card->dev->name);
unregister_netdev(card->dev);
}
sysfs_remove_group(&ccwgdev->dev.kobj, &lcs_attr_group);
lcs_cleanup_card(card);
lcs_free_card(card);
put_device(&ccwgdev->dev);
return 0;
}
/**
......
/*
* $Id: netiucv.c,v 1.26 2003/09/23 16:48:17 mschwide Exp $
* $Id: netiucv.c,v 1.30 2003/12/02 12:29:32 braunu Exp $
*
* IUCV network driver
*
......@@ -30,7 +30,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* RELEASE-TAG: IUCV network driver $Revision: 1.26 $
* RELEASE-TAG: IUCV network driver $Revision: 1.30 $
*
*/
......@@ -1177,12 +1177,10 @@ static int netiucv_tx(struct sk_buff *skb, struct net_device *dev)
/**
* If connection is not running, try to restart it
* notify anybody about a link failure and throw
* away packet.
* and throw away packet.
*/
if (fsm_getstate(privptr->fsm) != DEV_STATE_RUNNING) {
fsm_event(privptr->fsm, DEV_EVENT_START, dev);
dst_link_failure(skb);
dev_kfree_skb(skb);
privptr->stats.tx_dropped++;
privptr->stats.tx_errors++;
......@@ -1464,7 +1462,7 @@ netiucv_add_files(struct device *dev)
return ret;
ret = sysfs_create_group(&dev->kobj, &netiucv_stat_attr_group);
if (ret)
sysfs_remove_group(&dev->kobj, &netiucv_stat_attr_group);
sysfs_remove_group(&dev->kobj, &netiucv_attr_group);
return ret;
}
......@@ -1472,7 +1470,7 @@ static inline void
netiucv_remove_files(struct device *dev)
{
sysfs_remove_group(&dev->kobj, &netiucv_stat_attr_group);
sysfs_remove_group(&dev->kobj, &netiucv_stat_attr_group);
sysfs_remove_group(&dev->kobj, &netiucv_attr_group);
}
static int
......@@ -1485,7 +1483,7 @@ netiucv_register_device(struct net_device *ndev, int ifno)
snprintf(dev->bus_id, BUS_ID_SIZE, "%s%x", str, ifno);
dev->bus = &iucv_bus;
dev->parent = &iucv_root;
dev->parent = iucv_root;
ret = device_register(dev);
......@@ -1731,7 +1729,7 @@ static struct device_driver netiucv_driver = {
static void
netiucv_banner(void)
{
char vbuf[] = "$Revision: 1.26 $";
char vbuf[] = "$Revision: 1.30 $";
char *version = vbuf;
if ((version = strchr(version, ':'))) {
......
This diff is collapsed.
......@@ -14,7 +14,7 @@
#define QETH_NAME " qeth"
#define VERSION_QETH_H "$Revision: 1.58 $"
#define VERSION_QETH_H "$Revision: 1.60 $"
/******************** CONFIG STUFF ***********************/
//#define QETH_DBF_LIKE_HELL
......@@ -288,6 +288,12 @@
#define QETH_HEADER_PASSTHRU 0x10
#define QETH_HEADER_IPV6 0x80
#define QETH_ETH_MAC_V4 0x0100 /* like v4 */
#define QETH_ETH_MAC_V6 0x3333 /* like v6 */
/* tr mc mac is longer, but that will be enough to detect mc frames */
#define QETH_TR_MAC_NC 0xc000 /* non-canonical */
#define QETH_TR_MAC_C 0x0300 /* canonical */
#define QETH_CAST_FLAGS 0x07
#define QETH_CAST_UNICAST 6
#define QETH_CAST_MULTICAST 4
......@@ -888,8 +894,8 @@ struct qeth_card { /* pointed to by dev->priv */
atomic_t is_open; /* card is in use */
/* prevents deadlocks :-O */
spinlock_t softsetup_lock;
spinlock_t hardsetup_lock;
struct semaphore softsetup_sema;
struct semaphore hardsetup_sema;
spinlock_t ioctl_lock;
atomic_t softsetup_thread_is_running;
struct semaphore softsetup_thread_sem;
......
......@@ -10,7 +10,7 @@
#ifndef __QETH_MPC_H__
#define __QETH_MPC_H__
#define VERSION_QETH_MPC_H "$Revision: 1.16 $"
#define VERSION_QETH_MPC_H "$Revision: 1.18 $"
#define QETH_IPA_TIMEOUT (card->ipa_timeout)
#define QETH_MPC_TIMEOUT 2000
......@@ -143,6 +143,7 @@ extern unsigned char DM_ACT[];
#define IPA_PASSTHRU 0x00001000L
#define IPA_FULL_VLAN 0x00004000L
#define IPA_SOURCE_MAC_AVAIL 0x00010000L
#define IPA_OSA_MC_ROUTER_AVAIL 0x00020000L
#define IPA_SETADP_QUERY_COMMANDS_SUPPORTED 0x01
#define IPA_SETADP_ALTER_MAC_ADDRESS 0x02
......@@ -319,8 +320,9 @@ struct ipa_cmd{
}__attribute__ ((packed));
#define QETH_IOC_MAGIC 0x22
#define QETH_IOCPROC_OSAEINTERFACES _IOWR(QETH_IOC_MAGIC, 1, arg)
#define QETH_IOCPROC_INTERFACECHANGES _IOWR(QETH_IOC_MAGIC, 2, arg)
/* these don't really have 'unsigned long' arguments but were defined that way */
#define QETH_IOCPROC_OSAEINTERFACES _IOWR(QETH_IOC_MAGIC, 1, unsigned long)
#define QETH_IOCPROC_INTERFACECHANGES _IOWR(QETH_IOC_MAGIC, 2, unsigned long)
#define SNMP_QUERY_CARD_INFO 0x00000002L
#define SNMP_REGISETER_MIB 0x00000004L
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment