s390 (3/6): network driver.
Subsystems (4)
PATCH 1/1 s390 (3/6): network driver.
[PATCH] s390: network device driver.
From: Martin Schwidefsky <[email protected]>
Network driver changes:
- ctc: Add missing irb error checking.
- iucv: Add name of net_device to iucvMagic to more than one connection between two guests.
- qeth: Don't send IPA command if card is not in state SOFTSETUP or UP.
- qeth: Fix number base in simple_strtoul call for buffer_count attribute.
- qeth: Fix reallocating of buffers when buffer_count attribute is changed.
- qeth: Correct handling of return codes in qeth_realloc_buffer_pool.
- qeth: Don't call dev_close/dev_open on STOPLAN/STARTLAN commands. Use netif_carrier_off/netif_carrier_on instead.
diffstat:
drivers/s390/net/ctcmain.c | 35 ++++++- drivers/s390/net/netiucv.c | 35 +++++-- drivers/s390/net/qeth.h | 27 ++--- drivers/s390/net/qeth_main.c | 209 ++++++++++++++++++++++++++++++------------- drivers/s390/net/qeth_sys.c | 78 ++++++---------- 5 files changed, 251 insertions(+), 133 deletions(-)
drivers/s390/net/ctcmain.c +32 -3
@@ -1,5 +1,5 @@/* -* $Id: ctcmain.c,v 1.58 2004/03/24 10:51:56 ptiedem Exp $ +* $Id: ctcmain.c,v 1.59 2004/04/21 17:10:13 ptiedem 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.58 $ +* RELEASE-TAG: CTC/ESCON network driver $Revision: 1.59 $ * */
@@ -319,7 +319,7 @@print_banner (void) {static int printed =0 ; -char vbuf[] ="$Revision: 1.58 $" ; +char vbuf[] ="$Revision: 1.59 $" ;char *version = vbuf;if (printed)
@@ -2045,6 +2045,32 @@return ret; } +static long +__ctc_check_irb_error (struct ccw_device *cdev,struct irb *irb) +{ +if (!IS_ERR (irb)) +return 0 ; + +switch (PTR_ERR (irb)) { +case -EIO : +ctc_pr_warn ("i/o-error on device %s\n" , cdev->dev.bus_id); +// CTC_DBF_TEXT(trace, 2, "ckirberr"); +// CTC_DBF_TEXT_(trace, 2, " rc%d", -EIO); +break ; +case -ETIMEDOUT : +ctc_pr_warn ("timeout on device %s\n" , cdev->dev.bus_id); +// CTC_DBF_TEXT(trace, 2, "ckirberr"); +// CTC_DBF_TEXT_(trace, 2, " rc%d", -ETIMEDOUT); +break ; +default : +ctc_pr_warn ("unknown error %ld on device %s\n" ,PTR_ERR (irb), + cdev->dev.bus_id); +// CTC_DBF_TEXT(trace, 2, "ckirberr"); +// CTC_DBF_TEXT(trace, 2, " rc???"); + } +return PTR_ERR (irb); +} +/** * Main IRQ handler. *
@@ -2059,6 +2085,9 @@struct net_device *dev;struct ctc_priv *priv; +if (__ctc_check_irb_error (cdev, irb)) +return ; +/* Check for unsolicited interrupts. */ if (!cdev->dev.driver_data) { ctc_pr_warn("ctc: Got unsolicited irq: %s c-%02x d-%02x\n",
drivers/s390/net/netiucv.c +26 -9
@@ -1,5 +1,5 @@/* -* $Id: netiucv.c,v 1.49 2004/04/15 06:37:54 braunu Exp $ +* $Id: netiucv.c,v 1.51 2004/04/23 08:11:21 mschwide 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.49 $ +* RELEASE-TAG: IUCV network driver $Revision: 1.51 $ * */
@@ -169,10 +169,10 @@ }static __u8 iucv_host[8 ] = {0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 }; -static __u8 iucvMagic[16 ] = { -0xF0 ,0x40 ,0x40 ,0x40 ,0x40 ,0x40 ,0x40 ,0x40 , -0xF0 ,0x40 ,0x40 ,0x40 ,0x40 ,0x40 ,0x40 ,0x40 -}; +//static __u8 iucvMagic[16] = { +// 0xF0, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, +// 0xF0, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 +//}; /** * This mask means the 16-byte IUCV "magic" and the origin userid must
@@ -693,13 +693,20 @@ conn_action_connreject(fsm_instance *fi, int event, void *arg) {struct iucv_event *ev = (struct iucv_event *)arg; -// struct iucv_connection *conn = ev->conn; +struct iucv_connection *conn = ev->conn; +struct net_device *netdev = conn->netdev;iucv_ConnectionPending *eib = (iucv_ConnectionPending *)ev->data;__u8 udata[16 ];pr_debug ("%s() called\n" , __FUNCTION__);iucv_sever (eib->ippathid, udata); +if (eib->ippathid != conn->pathid) { +printk (KERN_INFO +"%s: IR pathid %d does not match original pathid %d\n" , + netdev->name, eib->ippathid, conn->pathid); +iucv_sever (conn->pathid, udata); + } } static void
@@ -715,7 +722,12 @@fsm_deltimer (&conn->timer);fsm_newstate (fi,CONN_STATE_IDLE ); - conn->pathid = eib->ippathid; +if (eib->ippathid != conn->pathid) { +printk (KERN_INFO +"%s: IR pathid %d does not match original pathid %d\n" , + netdev->name, eib->ippathid, conn->pathid); + conn->pathid = eib->ippathid; + } netdev->tx_queue_len = eib->ipmsglim;fsm_event (privptr->fsm,DEV_EVENT_CONUP , netdev); }
@@ -759,9 +771,14 @@struct iucv_connection *conn = ev->conn;__u16 msglimit;int rc; +__u8 iucvMagic[16 ] = { +0xF0 ,0x40 ,0x40 ,0x40 ,0x40 ,0x40 ,0x40 ,0x40 , +0xF0 ,0x40 ,0x40 ,0x40 ,0x40 ,0x40 ,0x40 ,0x40 + };pr_debug ("%s() called\n" , __FUNCTION__); +memcpy (iucvMagic, conn->netdev->name,IFNAMSIZ );if (conn->handle ==0 ) { conn->handle = iucv_register_program(iucvMagic, conn->userid, mask,
@@ -1882,7 +1899,7 @@static void netiucv_banner (void ) { -char vbuf[] ="$Revision: 1.49 $" ; +char vbuf[] ="$Revision: 1.51 $" ;char *version = vbuf;if ((version =strchr (version,':' ))) {
drivers/s390/net/qeth.h +12 -15
@@ -23,7 +23,7 @@#include "qeth_mpc.h" -#define VERSION_QETH_H "$Revision: 1.100 $" +#define VERSION_QETH_H "$Revision: 1.102 $"#ifdef CONFIG_QETH_IPV6 #define QETH_VERSION_IPV6 ":IPv6"
@@ -398,11 +398,6 @@struct qdio_buffer qdio_bufs[QDIO_MAX_BUFFERS_PER_Q ];struct qeth_qdio_buffer bufs[QDIO_MAX_BUFFERS_PER_Q ];/* -* buf_to_process means "buffer primed by hardware, -* has to be read in by driver"; current state PRIMED -*/ -volatile int next_buf_to_process; -/* * buf_to_init means "buffer must be initialized by driver and must * be made available for hardware" -> state is set to EMPTY */
@@ -493,8 +488,7 @@CARD_STATE_DOWN ,CARD_STATE_HARDSETUP ,CARD_STATE_SOFTSETUP , -CARD_STATE_UP_LAN_OFFLINE , -CARD_STATE_UP_LAN_ONLINE , +CARD_STATE_UP , CARD_STATE_RECOVER, };
@@ -981,24 +975,27 @@extern int qeth_setrouting_v6 (struct qeth_card *); -int +extern int qeth_add_ipato_entry (struct qeth_card *,struct qeth_ipato_entry *); -void +extern void qeth_del_ipato_entry (struct qeth_card *,enum qeth_prot_versions ,u8 *,int ); -int +extern int qeth_add_vipa (struct qeth_card *,enum qeth_prot_versions ,const u8 *); -void +extern void qeth_del_vipa (struct qeth_card *,enum qeth_prot_versions ,const u8 *); -int +extern int qeth_add_rxip (struct qeth_card *,enum qeth_prot_versions ,const u8 *); -void +extern void qeth_del_rxip (struct qeth_card *,enum qeth_prot_versions ,const u8 *); -void +extern void qeth_schedule_recovery (struct qeth_card *); + +extern int +qeth_realloc_buffer_pool (struct qeth_card *,int );#endif /* __QETH_H__ */
drivers/s390/net/qeth_main.c +149 -60
386 lines not on this page · raw message
drivers/s390/net/qeth_sys.c +32 -46
148 lines not on this page · raw message