diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-22 19:09:51 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-22 19:09:51 -0700 |
commit | c010b2f76c3032e48097a6eef291d8593d5d79a6 (patch) | |
tree | 16077c83703527732991a55dea1abe330c0ccdc6 /drivers/s390 | |
parent | 6069fb2ef5d4f47432359c97f350e0cfcc4d208e (diff) | |
parent | 521c4d96e0840ecce25b956e00f416ed499ef2ba (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (82 commits)
ipw2200: Call netif_*_queue() interfaces properly.
netxen: Needs to include linux/vmalloc.h
[netdrvr] atl1d: fix !CONFIG_PM build
r6040: rework init_one error handling
r6040: bump release number to 0.18
r6040: handle RX fifo full and no descriptor interrupts
r6040: change the default waiting time
r6040: use definitions for magic values in descriptor status
r6040: completely rework the RX path
r6040: call napi_disable when puting down the interface and set lp->dev accordingly.
mv643xx_eth: fix NETPOLL build
r6040: rework the RX buffers allocation routine
r6040: fix scheduling while atomic in r6040_tx_timeout
r6040: fix null pointer access and tx timeouts
r6040: prefix all functions with r6040
rndis_host: support WM6 devices as modems
at91_ether: use netstats in net_device structure
sfc: Create one RX queue and interrupt per CPU package by default
sfc: Use a separate workqueue for resets
sfc: I2C adapter initialisation fixes
...
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/net/claw.c | 2141 | ||||
-rw-r--r-- | drivers/s390/net/ctcm_dbug.c | 29 | ||||
-rw-r--r-- | drivers/s390/net/ctcm_dbug.h | 39 | ||||
-rw-r--r-- | drivers/s390/net/ctcm_fsms.c | 402 | ||||
-rw-r--r-- | drivers/s390/net/ctcm_main.c | 514 | ||||
-rw-r--r-- | drivers/s390/net/ctcm_main.h | 31 | ||||
-rw-r--r-- | drivers/s390/net/ctcm_mpc.c | 1110 | ||||
-rw-r--r-- | drivers/s390/net/ctcm_mpc.h | 2 | ||||
-rw-r--r-- | drivers/s390/net/qeth_l3_main.c | 2 |
9 files changed, 1403 insertions, 2867 deletions
diff --git a/drivers/s390/net/claw.c b/drivers/s390/net/claw.c index c644669a75c..a08b1682c8e 100644 --- a/drivers/s390/net/claw.c +++ b/drivers/s390/net/claw.c @@ -58,13 +58,13 @@ * 1.10 Changes for Buffer allocation * 1.15 Changed for 2.6 Kernel No longer compiles on 2.4 or lower * 1.25 Added Packing support + * 1.5 */ #include <asm/ccwdev.h> #include <asm/ccwgroup.h> #include <asm/debug.h> #include <asm/idals.h> #include <asm/io.h> - #include <linux/bitops.h> #include <linux/ctype.h> #include <linux/delay.h> @@ -90,36 +90,10 @@ #include "cu3088.h" #include "claw.h" -MODULE_AUTHOR("Andy Richter <richtera@us.ibm.com>"); -MODULE_DESCRIPTION("Linux for zSeries CLAW Driver\n" \ - "Copyright 2000,2005 IBM Corporation\n"); -MODULE_LICENSE("GPL"); - -/* Debugging is based on DEBUGMSG, IOTRACE, or FUNCTRACE options: - DEBUGMSG - Enables output of various debug messages in the code - IOTRACE - Enables output of CCW and other IO related traces - FUNCTRACE - Enables output of function entry/exit trace - Define any combination of above options to enable tracing - - CLAW also uses the s390dbf file system see claw_trace and claw_setup +/* + CLAW uses the s390dbf file system see claw_trace and claw_setup */ -/* following enables tracing */ -//#define DEBUGMSG -//#define IOTRACE -//#define FUNCTRACE - -#ifdef DEBUGMSG -#define DEBUG -#endif - -#ifdef IOTRACE -#define DEBUG -#endif - -#ifdef FUNCTRACE -#define DEBUG -#endif static char debug_buffer[255]; /** @@ -146,7 +120,6 @@ claw_register_debug_facility(void) claw_dbf_setup = debug_register("claw_setup", 2, 1, 8); claw_dbf_trace = debug_register("claw_trace", 2, 2, 8); if (claw_dbf_setup == NULL || claw_dbf_trace == NULL) { - printk(KERN_WARNING "Not enough memory for debug facility.\n"); claw_unregister_debug_facility(); return -ENOMEM; } @@ -232,9 +205,6 @@ static void probe_error( struct ccwgroup_device *cgdev); static struct net_device_stats *claw_stats(struct net_device *dev); static int pages_to_order_of_mag(int num_of_pages); static struct sk_buff *claw_pack_skb(struct claw_privbk *privptr); -#ifdef DEBUG -static void dumpit (char *buf, int len); -#endif /* sysfs Functions */ static ssize_t claw_hname_show(struct device *dev, struct device_attribute *attr, char *buf); static ssize_t claw_hname_write(struct device *dev, struct device_attribute *attr, @@ -263,12 +233,12 @@ static int claw_snd_disc(struct net_device *dev, struct clawctl * p_ctl); static int claw_snd_sys_validate_rsp(struct net_device *dev, struct clawctl * p_ctl, __u32 return_code); static int claw_strt_conn_req(struct net_device *dev ); -static void claw_strt_read ( struct net_device *dev, int lock ); -static void claw_strt_out_IO( struct net_device *dev ); -static void claw_free_wrt_buf( struct net_device *dev ); +static void claw_strt_read(struct net_device *dev, int lock); +static void claw_strt_out_IO(struct net_device *dev); +static void claw_free_wrt_buf(struct net_device *dev); /* Functions for unpack reads */ -static void unpack_read (struct net_device *dev ); +static void unpack_read(struct net_device *dev); /* ccwgroup table */ @@ -284,7 +254,6 @@ static struct ccwgroup_driver claw_group_driver = { }; /* -* * Key functions */ @@ -298,23 +267,14 @@ claw_probe(struct ccwgroup_device *cgdev) int rc; struct claw_privbk *privptr=NULL; -#ifdef FUNCTRACE - printk(KERN_INFO "%s Enter\n",__func__); -#endif - CLAW_DBF_TEXT(2,setup,"probe"); + CLAW_DBF_TEXT(2, setup, "probe"); if (!get_device(&cgdev->dev)) return -ENODEV; -#ifdef DEBUGMSG - printk(KERN_INFO "claw: variable cgdev =\n"); - dumpit((char *)cgdev, sizeof(struct ccwgroup_device)); -#endif privptr = kzalloc(sizeof(struct claw_privbk), GFP_KERNEL); if (privptr == NULL) { probe_error(cgdev); put_device(&cgdev->dev); - printk(KERN_WARNING "Out of memory %s %s Exit Line %d \n", - cgdev->cdev[0]->dev.bus_id,__func__,__LINE__); - CLAW_DBF_TEXT_(2,setup,"probex%d",-ENOMEM); + CLAW_DBF_TEXT_(2, setup, "probex%d", -ENOMEM); return -ENOMEM; } privptr->p_mtc_envelope= kzalloc( MAX_ENVELOPE_SIZE, GFP_KERNEL); @@ -322,9 +282,7 @@ claw_probe(struct ccwgroup_device *cgdev) if ((privptr->p_mtc_envelope==NULL) || (privptr->p_env==NULL)) { probe_error(cgdev); put_device(&cgdev->dev); - printk(KERN_WARNING "Out of memory %s %s Exit Line %d \n", - cgdev->cdev[0]->dev.bus_id,__func__,__LINE__); - CLAW_DBF_TEXT_(2,setup,"probex%d",-ENOMEM); + CLAW_DBF_TEXT_(2, setup, "probex%d", -ENOMEM); return -ENOMEM; } memcpy(privptr->p_env->adapter_name,WS_NAME_NOT_DEF,8); @@ -341,19 +299,14 @@ claw_probe(struct ccwgroup_device *cgdev) put_device(&cgdev->dev); printk(KERN_WARNING "add_files failed %s %s Exit Line %d \n", cgdev->cdev[0]->dev.bus_id,__func__,__LINE__); - CLAW_DBF_TEXT_(2,setup,"probex%d",rc); + CLAW_DBF_TEXT_(2, setup, "probex%d", rc); return rc; } - printk(KERN_INFO "claw: sysfs files added for %s\n",cgdev->cdev[0]->dev.bus_id); privptr->p_env->p_priv = privptr; cgdev->cdev[0]->handler = claw_irq_handler; cgdev->cdev[1]->handler = claw_irq_handler; cgdev->dev.driver_data = privptr; -#ifdef FUNCTRACE - printk(KERN_INFO "claw:%s exit on line %d, " - "rc = 0\n",__func__,__LINE__); -#endif - CLAW_DBF_TEXT(2,setup,"prbext 0"); + CLAW_DBF_TEXT(2, setup, "prbext 0"); return 0; } /* end of claw_probe */ @@ -370,37 +323,18 @@ claw_tx(struct sk_buff *skb, struct net_device *dev) unsigned long saveflags; struct chbk *p_ch; -#ifdef FUNCTRACE - printk(KERN_INFO "%s:%s enter\n",dev->name,__func__); -#endif - CLAW_DBF_TEXT(4,trace,"claw_tx"); + CLAW_DBF_TEXT(4, trace, "claw_tx"); p_ch=&privptr->channel[WRITE]; if (skb == NULL) { - printk(KERN_WARNING "%s: null pointer passed as sk_buffer\n", - dev->name); privptr->stats.tx_dropped++; -#ifdef FUNCTRACE - printk(KERN_INFO "%s: %s() exit on line %d, rc = EIO\n", - dev->name,__func__, __LINE__); -#endif - CLAW_DBF_TEXT_(2,trace,"clawtx%d",-EIO); + privptr->stats.tx_errors++; + CLAW_DBF_TEXT_(2, trace, "clawtx%d", -EIO); return -EIO; } - -#ifdef IOTRACE - printk(KERN_INFO "%s: variable sk_buff=\n",dev->name); - dumpit((char *) skb, sizeof(struct sk_buff)); - printk(KERN_INFO "%s: variable dev=\n",dev->name); - dumpit((char *) dev, sizeof(struct net_device)); -#endif spin_lock_irqsave(get_ccwdev_lock(p_ch->cdev), saveflags); rc=claw_hw_tx( skb, dev, 1 ); spin_unlock_irqrestore(get_ccwdev_lock(p_ch->cdev), saveflags); -#ifdef FUNCTRACE - printk(KERN_INFO "%s:%s exit on line %d, rc = %d\n", - dev->name, __func__, __LINE__, rc); -#endif - CLAW_DBF_TEXT_(4,trace,"clawtx%d",rc); + CLAW_DBF_TEXT_(4, trace, "clawtx%d", rc); return rc; } /* end of claw_tx */ @@ -419,7 +353,7 @@ claw_pack_skb(struct claw_privbk *privptr) new_skb = NULL; /* assume no dice */ pkt_cnt = 0; - CLAW_DBF_TEXT(4,trace,"PackSKBe"); + CLAW_DBF_TEXT(4, trace, "PackSKBe"); if (!skb_queue_empty(&p_ch->collect_queue)) { /* some data */ held_skb = skb_dequeue(&p_ch->collect_queue); @@ -457,13 +391,8 @@ claw_pack_skb(struct claw_privbk *privptr) skb_queue_head(&p_ch->collect_queue,held_skb); } } -#ifdef IOTRACE - printk(KERN_INFO "%s: %s() Packed %d len %d\n", - p_env->ndev->name, - __func__,pkt_cnt,new_skb->len); -#endif } - CLAW_DBF_TEXT(4,trace,"PackSKBx"); + CLAW_DBF_TEXT(4, trace, "PackSKBx"); return new_skb; } @@ -477,29 +406,12 @@ claw_change_mtu(struct net_device *dev, int new_mtu) { struct claw_privbk *privptr=dev->priv; int buff_size; -#ifdef FUNCTRACE - printk(KERN_INFO "%s:%s Enter \n",dev->name,__func__); -#endif -#ifdef DEBUGMSG - printk(KERN_INFO "variable dev =\n"); - dumpit((char *) dev, sizeof(struct net_device)); - printk(KERN_INFO "variable new_mtu = %d\n", new_mtu); -#endif - CLAW_DBF_TEXT(4,trace,"setmtu"); + CLAW_DBF_TEXT(4, trace, "setmtu"); buff_size = privptr->p_env->write_size; if ((new_mtu < 60) || (new_mtu > buff_size)) { -#ifdef FUNCTRACE - printk(KERN_INFO "%s:%s Exit on line %d, rc=EINVAL\n", - dev->name, - __func__, __LINE__); -#endif return -EINVAL; } dev->mtu = new_mtu; -#ifdef FUNCTRACE - printk(KERN_INFO "%s:%s Exit on line %d\n",dev->name, - __func__, __LINE__); -#endif return 0; } /* end of claw_change_mtu */ @@ -521,24 +433,13 @@ claw_open(struct net_device *dev) struct timer_list timer; struct ccwbk *p_buf; -#ifdef FUNCTRACE - printk(KERN_INFO "%s:%s Enter \n",dev->name,__func__); -#endif - CLAW_DBF_TEXT(4,trace,"open"); - if (!dev || (dev->name[0] == 0x00)) { - CLAW_DBF_TEXT(2,trace,"BadDev"); - printk(KERN_WARNING "claw: Bad device at open failing \n"); - return -ENODEV; - } + CLAW_DBF_TEXT(4, trace, "open"); privptr = (struct claw_privbk *)dev->priv; /* allocate and initialize CCW blocks */ if (privptr->buffs_alloc == 0) { rc=init_ccw_bk(dev); if (rc) { - printk(KERN_INFO "%s:%s Exit on line %d, rc=ENOMEM\n", - dev->name, - __func__, __LINE__); - CLAW_DBF_TEXT(2,trace,"openmem"); + CLAW_DBF_TEXT(2, trace, "openmem"); return -ENOMEM; } } @@ -557,7 +458,7 @@ claw_open(struct net_device *dev) tasklet_init(&privptr->channel[READ].tasklet, claw_irq_tasklet, (unsigned long) &privptr->channel[READ]); for ( i = 0; i < 2; i++) { - CLAW_DBF_TEXT_(2,trace,"opn_ch%d",i); + CLAW_DBF_TEXT_(2, trace, "opn_ch%d", i); init_waitqueue_head(&privptr->channel[i].wait); /* skb_queue_head_init(&p_ch->io_queue); */ if (i == WRITE) @@ -595,15 +496,8 @@ claw_open(struct net_device *dev) ~(DEV_STAT_CHN_END | DEV_STAT_DEV_END)) != 0x00) || (((privptr->channel[READ].flag | privptr->channel[WRITE].flag) & CLAW_TIMER) != 0x00)) { -#ifdef DEBUGMSG - printk(KERN_INFO "%s: channel problems during open - read:" - " %02x - write: %02x\n", - dev->name, - privptr->channel[READ].last_dstat, - privptr->channel[WRITE].last_dstat); -#endif printk(KERN_INFO "%s: remote side is not ready\n", dev->name); - CLAW_DBF_TEXT(2,trace,"notrdy"); + CLAW_DBF_TEXT(2, trace, "notrdy"); for ( i = 0; i < 2; i++) { spin_lock_irqsave( @@ -659,23 +553,14 @@ claw_open(struct net_device *dev) privptr->p_buff_read=NULL; privptr->p_buff_write=NULL; claw_clear_busy(dev); -#ifdef FUNCTRACE - printk(KERN_INFO "%s:%s Exit on line %d, rc=EIO\n", - dev->name,__func__,__LINE__); -#endif - CLAW_DBF_TEXT(2,trace,"open EIO"); + CLAW_DBF_TEXT(2, trace, "open EIO"); return -EIO; } /* Send SystemValidate command */ claw_clear_busy(dev); - -#ifdef FUNCTRACE - printk(KERN_INFO "%s:%s Exit on line %d, rc=0\n", - dev->name,__func__,__LINE__); -#endif - CLAW_DBF_TEXT(4,trace,"openok"); + CLAW_DBF_TEXT(4, trace, "openok"); return 0; } /* end of claw_open */ @@ -694,22 +579,14 @@ claw_irq_handler(struct ccw_device *cdev, struct claw_env *p_env; struct chbk *p_ch_r=NULL; - -#ifdef FUNCTRACE - printk(KERN_INFO "%s enter \n",__func__); -#endif - CLAW_DBF_TEXT(4,trace,"clawirq"); + CLAW_DBF_TEXT(4, trace, "clawirq"); /* Bypass all 'unsolicited interrupts' */ if (!cdev->dev.driver_data) { printk(KERN_WARNING "claw: unsolicited interrupt for device:" "%s received c-%02x d-%02x\n", cdev->dev.bus_id, irb->scsw.cmd.cstat, irb->scsw.cmd.dstat); -#ifdef FUNCTRACE - printk(KERN_INFO "claw: %s() " - "exit on line %d\n",__func__,__LINE__); -#endif - CLAW_DBF_TEXT(2,trace,"badirq"); + CLAW_DBF_TEXT(2, trace, "badirq"); return; } privptr = (struct claw_privbk *)cdev->dev.driver_data; @@ -722,41 +599,25 @@ claw_irq_handler(struct ccw_device *cdev, else { printk(KERN_WARNING "claw: Can't determine channel for " "interrupt, device %s\n", cdev->dev.bus_id); - CLAW_DBF_TEXT(2,trace,"badchan"); + CLAW_DBF_TEXT(2, trace, "badchan"); return; } - CLAW_DBF_TEXT_(4,trace,"IRQCH=%d",p_ch->flag); + CLAW_DBF_TEXT_(4, trace, "IRQCH=%d", p_ch->flag); dev = (struct net_device *) (p_ch->ndev); p_env=privptr->p_env; -#ifdef IOTRACE - printk(KERN_INFO "%s: interrupt for device: %04x " - "received c-%02x d-%02x state-%02x\n", - dev->name, p_ch->devno, irb->scsw.cmd.cstat, - irb->scsw.cmd.dstat, p_ch->claw_state); -#endif - /* Copy interruption response block. */ memcpy(p_ch->irb, irb, sizeof(struct irb)); - /* Check for good subchannel return code, otherwise error message */ + /* Check for good subchannel return code, otherwise info message */ if (irb->scsw.cmd.cstat && !(irb->scsw.cmd.cstat & SCHN_STAT_PCI)) { printk(KERN_INFO "%s: subchannel check for device: %04x -" " Sch Stat %02x Dev Stat %02x CPA - %04x\n", dev->name, p_ch->devno, irb->scsw.cmd.cstat, irb->scsw.cmd.dstat, irb->scsw.cmd.cpa); -#ifdef IOTRACE - dumpit((char *)irb,sizeof(struct irb)); - dumpit((char *)(unsigned long)irb->scsw.cmd.cpa, - sizeof(struct ccw1)); -#endif -#ifdef FUNCTRACE - printk(KERN_INFO "%s:%s Exit on line %d\n", - dev->name,__func__,__LINE__); -#endif - CLAW_DBF_TEXT(2,trace,"chanchk"); + CLAW_DBF_TEXT(2, trace, "chanchk"); /* return; */ } @@ -768,233 +629,138 @@ claw_irq_handler(struct ccw_device *cdev, p_ch->last_dstat = irb->scsw.cmd.dstat; switch (p_ch->claw_state) { - case CLAW_STOP:/* HALT_IO by claw_release (halt sequence) */ -#ifdef DEBUGMSG - printk(KERN_INFO "%s: CLAW_STOP enter\n", dev->name); -#endif - if (!((p_ch->irb->scsw.cmd.stctl & - SCSW_STCTL_SEC_STATUS) || - (p_ch->irb->scsw.cmd.stctl == - SCSW_STCTL_STATUS_PEND) || - (p_ch->irb->scsw.cmd.stctl == - (SCSW_STCTL_ALERT_STATUS | - SCSW_STCTL_STATUS_PEND)))) { -#ifdef FUNCTRACE - printk(KERN_INFO "%s:%s Exit on line %d\n", - dev->name,__func__,__LINE__); -#endif - return; - } - wake_up(&p_ch->wait); /* wake up claw_release */ - -#ifdef DEBUGMSG - printk(KERN_INFO "%s: CLAW_STOP exit\n", dev->name); -#endif -#ifdef FUNCTRACE - printk(KERN_INFO "%s:%s Exit on line %d\n", - dev->name,__func__,__LINE__); -#endif - CLAW_DBF_TEXT(4,trace,"stop"); - return; - - case CLAW_START_HALT_IO: /* HALT_IO issued by claw_open */ -#ifdef DEBUGMSG - printk(KERN_INFO "%s: process CLAW_STAT_HALT_IO\n", - dev->name); -#endif - if (!((p_ch->irb->scsw.cmd.stctl & - SCSW_STCTL_SEC_STATUS) || - (p_ch->irb->scsw.cmd.stctl == - SCSW_STCTL_STATUS_PEND) || - (p_ch->irb->scsw.cmd.stctl == - (SCSW_STCTL_ALERT_STATUS | - SCSW_STCTL_STATUS_PEND)))) { -#ifdef FUNCTRACE - printk(KERN_INFO "%s:%s Exit on line %d\n", - dev->name,__func__,__LINE__); -#endif - CLAW_DBF_TEXT(4,trace,"haltio"); - return; - } - if (p_ch->flag == CLAW_READ) { - p_ch->claw_state = CLAW_START_READ; - wake_up(&p_ch->wait); /* wake claw_open (READ)*/ - } + case CLAW_STOP:/* HALT_IO by claw_release (halt sequence) */ + if (!((p_ch->irb->scsw.cmd.stctl & SCSW_STCTL_SEC_STATUS) || + (p_ch->irb->scsw.cmd.stctl == SCSW_STCTL_STATUS_PEND) || + (p_ch->irb->scsw.cmd.stctl == + (SCSW_STCTL_ALERT_STATUS | SCSW_STCTL_STATUS_PEND)))) + return; + wake_up(&p_ch->wait); /* wake up claw_release */ + CLAW_DBF_TEXT(4, trace, "stop"); + return; + case CLAW_START_HALT_IO: /* HALT_IO issued by claw_open */ + if (!((p_ch->irb->scsw.cmd.stctl & SCSW_STCTL_SEC_STATUS) || + (p_ch->irb->scsw.cmd.stctl == SCSW_STCTL_STATUS_PEND) || + (p_ch->irb->scsw.cmd.stctl == + (SCSW_STCTL_ALERT_STATUS | SCSW_STCTL_STATUS_PEND)))) { + CLAW_DBF_TEXT(4, trace, "haltio"); + return; + } + if (p_ch->flag == CLAW_READ) { + p_ch->claw_state = CLAW_START_READ; + wake_up(&p_ch->wait); /* wake claw_open (READ)*/ + } else if (p_ch->flag == CLAW_WRITE) { + p_ch->claw_state = CLAW_START_WRITE; + /* send SYSTEM_VALIDATE */ + claw_strt_read(dev, LOCK_NO); + claw_send_control(dev, + SYSTEM_VALIDATE_REQUEST, + 0, 0, 0, + p_env->host_name, + p_env->adapter_name); + } else { + printk(KERN_WARNING "claw: unsolicited " + "interrupt for device:" + "%s received c-%02x d-%02x\n", + cdev->dev.bus_id, + irb->scsw.cmd.cstat, + irb->scsw.cmd.dstat); + return; + } + CLAW_DBF_TEXT(4, trace, "haltio"); + return; + case CLAW_START_READ: + CLAW_DBF_TEXT(4, trace, "ReadIRQ"); + if (p_ch->irb->scsw.cmd.dstat & DEV_STAT_UNIT_CHECK) { + clear_bit(0, (void *)&p_ch->IO_active); + if ((p_ch->irb->ecw[0] & 0x41) == 0x41 || + (p_ch->irb->ecw[0] & 0x40) == 0x40 || + (p_ch->irb->ecw[0]) == 0) { + privptr->stats.rx_errors++; + printk(KERN_INFO "%s: Restart is " + "required after remote " + "side recovers \n", + dev->name); + } + CLAW_DBF_TEXT(4, trace, "notrdy"); + return; + } + if ((p_ch->irb->scsw.cmd.cstat & SCHN_STAT_PCI) && + (p_ch->irb->scsw.cmd.dstat == 0)) { + if (test_and_set_bit(CLAW_BH_ACTIVE, + (void *)&p_ch->flag_a) == 0) + tasklet_schedule(&p_ch->tasklet); else - if (p_ch->flag == CLAW_WRITE) { - p_ch->claw_state = CLAW_START_WRITE; - /* send SYSTEM_VALIDATE */ - claw_strt_read(dev, LOCK_NO); - claw_send_control(dev, - SYSTEM_VALIDATE_REQUEST, - 0, 0, 0, - p_env->host_name, - p_env->adapter_name ); - } else { - printk(KERN_WARNING "claw: unsolicited " - "interrupt for device:" - "%s received c-%02x d-%02x\n", - cdev->dev.bus_id, - irb->scsw.cmd.cstat, - irb->scsw.cmd.dstat); - return; - } -#ifdef DEBUGMSG - printk(KERN_INFO "%s: process CLAW_STAT_HALT_IO exit\n", - dev->name); -#endif -#ifdef FUNCTRACE - printk(KERN_INFO "%s:%s Exit on line %d\n", - dev->name,__func__,__LINE__); -#endif - CLAW_DBF_TEXT(4,trace,"haltio"); - return; - case CLAW_START_READ: - CLAW_DBF_TEXT(4,trace,"ReadIRQ"); - if (p_ch->irb->scsw.cmd.dstat & DEV_STAT_UNIT_CHECK) { - clear_bit(0, (void *)&p_ch->IO_active); - if ((p_ch->irb->ecw[0] & 0x41) == 0x41 || - (p_ch->irb->ecw[0] & 0x40) == 0x40 || - (p_ch->irb->ecw[0]) == 0) - { - privptr->stats.rx_errors++; - printk(KERN_INFO "%s: Restart is " - "required after remote " - "side recovers \n", - dev->name); - } -#ifdef FUNCTRACE - printk(KERN_INFO "%s:%s Exit on line %d\n", - dev->name,__func__,__LINE__); -#endif - CLAW_DBF_TEXT(4,trace,"notrdy"); - return; - } - if ((p_ch->irb->scsw.cmd.cstat & SCHN_STAT_PCI) && - (p_ch->irb->scsw.cmd.dstat == 0)) { - if (test_and_set_bit(CLAW_BH_ACTIVE, - (void *)&p_ch->flag_a) == 0) { - tasklet_schedule(&p_ch->tasklet); - } - else { - CLAW_DBF_TEXT(4,trace,"PCINoBH"); - } -#ifdef FUNCTRACE - printk(KERN_INFO "%s:%s Exit on line %d\n", - dev->name,__func__,__LINE__); -#endif - CLAW_DBF_TEXT(4,trace,"PCI_read"); - return; - } - if (!((p_ch->irb->scsw.cmd.stctl & - SCSW_STCTL_SEC_STATUS) || - (p_ch->irb->scsw.cmd.stctl == - SCSW_STCTL_STATUS_PEND) || - (p_ch->irb->scsw.cmd.stctl == - (SCSW_STCTL_ALERT_STATUS | - SCSW_STCTL_STATUS_PEND)))) { -#ifdef FUNCTRACE - printk(KERN_INFO "%s:%s Exit on line %d\n", - dev->name,__func__,__LINE__); -#endif - CLAW_DBF_TEXT(4,trace,"SPend_rd"); - return; - } - clear_bit(0, (void *)&p_ch->IO_active); - claw_clearbit_busy(TB_RETRY,dev); - if (test_and_set_bit(CLAW_BH_ACTIVE, - (void *)&p_ch->flag_a) == 0) { - tasklet_schedule(&p_ch->tasklet); - } - else { - CLAW_DBF_TEXT(4,trace,"RdBHAct"); - } - -#ifdef DEBUGMSG - printk(KERN_INFO "%s: process CLAW_START_READ exit\n", - dev->name); -#endif -#ifdef FUNCTRACE - printk(KERN_INFO "%s:%s Exit on line %d\n", - dev->name,__func__,__LINE__); -#endif - CLAW_DBF_TEXT(4,trace,"RdIRQXit"); - return; - case CLAW_START_WRITE: - if (p_ch->irb->scsw.cmd.dstat & DEV_STAT_UNIT_CHECK) { - printk(KERN_INFO "%s: Unit Check Occured in " - "write channel\n",dev->name); - clear_bit(0, (void *)&p_ch->IO_active); - if (p_ch->irb->ecw[0] & 0x80 ) { - printk(KERN_INFO "%s: Resetting Event " - "occurred:\n",dev->name); - init_timer(&p_ch->timer); - p_ch->timer.function = - (void *)claw_write_retry; - p_ch->timer.data = (unsigned long)p_ch; - p_ch->timer.expires = jiffies + 10*HZ; - add_timer(&p_ch->timer); - printk(KERN_INFO "%s: write connection " - "restarting\n",dev->name); - } -#ifdef FUNCTRACE - printk(KERN_INFO "%s:%s Exit on line %d\n", - dev->name,__func__,__LINE__); -#endif - CLAW_DBF_TEXT(4,trace,"rstrtwrt"); - return; - } - if (p_ch->irb->scsw.cmd.dstat & DEV_STAT_UNIT_EXCEP) { - clear_bit(0, (void *)&p_ch->IO_active); - printk(KERN_INFO "%s: Unit Exception " - "Occured in write channel\n", - dev->name); - } - if (!((p_ch->irb->scsw.cmd.stctl & - SCSW_STCTL_SEC_STATUS) || - (p_ch->irb->scsw.cmd.stctl == - SCSW_STCTL_STATUS_PEND) || - (p_ch->irb->scsw.cmd.stctl == - (SCSW_STCTL_ALERT_STATUS | - SCSW_STCTL_STATUS_PEND)))) { -#ifdef FUNCTRACE - printk(KERN_INFO "%s:%s Exit on line %d\n", - dev->name,__func__,__LINE__); -#endif - CLAW_DBF_TEXT(4,trace,"writeUE"); - return; - } - clear_bit(0, (void *)&p_ch->IO_active); - if (claw_test_and_setbit_busy(TB_TX,dev)==0) { - claw_write_next(p_ch); - claw_clearbit_busy(TB_TX,dev); - claw_clear_busy(dev); - } - p_ch_r=(struct chbk *)&privptr->channel[READ]; - if (test_and_set_bit(CLAW_BH_ACTIVE, - (void *)&p_ch_r->flag_a) == 0) { - tasklet_schedule(&p_ch_r->tasklet); - } - -#ifdef DEBUGMSG - printk(KERN_INFO "%s: process CLAW_START_WRITE exit\n", - dev->name); -#endif -#ifdef FUNCTRACE - printk(KERN_INFO "%s:%s Exit on line %d\n", - dev->name,__func__,__LINE__); -#endif - CLAW_DBF_TEXT(4,trace,"StWtExit"); - return; - default: - printk(KERN_WARNING "%s: wrong selection code - irq " - "state=%d\n",dev->name,p_ch->claw_state); -#ifdef FUNCTRACE - printk(KERN_INFO "%s:%s Exit on line %d\n", - dev->name,__func__,__LINE__); -#endif - CLAW_DBF_TEXT(2,trace,"badIRQ"); - return; + CLAW_DBF_TEXT(4, trace, "PCINoBH"); + CLAW_DBF_TEXT(4, trace, "PCI_read"); + return; + } + if (!((p_ch->irb->scsw.cmd.stctl & SCSW_STCTL_SEC_STATUS) || + (p_ch->irb->scsw.cmd.stctl == SCSW_STCTL_STATUS_PEND) || + (p_ch->irb->scsw.cmd.stctl == + (SCSW_STCTL_ALERT_STATUS | SCSW_STCTL_STATUS_PEND)))) { + CLAW_DBF_TEXT(4, trace, "SPend_rd"); + return; + } + clear_bit(0, (void *)&p_ch->IO_active); + claw_clearbit_busy(TB_RETRY, dev); + if (test_and_set_bit(CLAW_BH_ACTIVE, + (void *)&p_ch->flag_a) == 0) + tasklet_schedule(&p_ch->tasklet); + else + CLAW_DBF_TEXT(4, trace, "RdBHAct"); + CLAW_DBF_TEXT(4, trace, "RdIRQXit"); + return; + case CLAW_START_WRITE: + if (p_ch->irb->scsw.cmd.dstat & DEV_STAT_UNIT_CHECK) { + printk(KERN_INFO "%s: Unit Check Occured in " + "write channel\n", dev->name); + clear_bit(0, (void *)&p_ch->IO_active); + if (p_ch->irb->ecw[0] & 0x80) { + printk(KERN_INFO "%s: Resetting Event " + "occurred:\n", dev->name); + init_timer(&p_ch->timer); + p_ch->timer.function = + (void *)claw_write_retry; + p_ch->timer.data = (unsigned long)p_ch; + p_ch->timer.expires = jiffies + 10*HZ; + add_timer(&p_ch->timer); + printk(KERN_INFO "%s: write connection " + "restarting\n", dev->name); + } + CLAW_DBF_TEXT(4, trace, "rstrtwrt"); + return; + } + if (p_ch->irb->scsw.cmd.dstat & DEV_STAT_UNIT_EXCEP) { + clear_bit(0, (void *)&p_ch->IO_active); + printk(KERN_INFO "%s: Unit Exception " + "Occured in write channel\n", + dev->name); + } + if (!((p_ch->irb->scsw.cmd.stctl & SCSW_STCTL_SEC_STATUS) || + (p_ch->irb->scsw.cmd.stctl == SCSW_STCTL_STATUS_PEND) || + (p_ch->irb->scsw.cmd.stctl == + (SCSW_STCTL_ALERT_STATUS | SCSW_STCTL_STATUS_PEND)))) { + CLAW_DBF_TEXT(4, trace, "writeUE"); + return; + } + clear_bit(0, (void *)&p_ch->IO_active); + if (claw_test_and_setbit_busy(TB_TX, dev) == 0) { + claw_write_next(p_ch); + claw_clearbit_busy(TB_TX, dev); + claw_clear_busy(dev); + } + p_ch_r = (struct chbk *)&privptr->channel[READ]; + if (test_and_set_bit(CLAW_BH_ACTIVE, + (void *)&p_ch_r->flag_a) == 0) + tasklet_schedule(&p_ch_r->tasklet); + CLAW_DBF_TEXT(4, trace, "StWtExit"); + return; + default: + printk(KERN_WARNING "%s: wrong selection code - irq " + "state=%d\n", dev->name, p_ch->claw_state); + CLAW_DBF_TEXT(2, trace, "badIRQ"); + return; } } /* end of claw_irq_handler */ @@ -1013,29 +779,11 @@ claw_irq_tasklet ( unsigned long data ) p_ch = (struct chbk *) data; dev = (struct net_device *)p_ch->ndev; -#ifdef FUNCTRACE - printk(KERN_INFO "%s:%s Enter \n",dev->name,__func__); -#endif -#ifdef DEBUGMSG - printk(KERN_INFO "%s: variable p_ch =\n",dev->name); - dumpit((char *) p_ch, sizeof(struct chbk)); -#endif - CLAW_DBF_TEXT(4,trace,"IRQtask"); - + CLAW_DBF_TEXT(4, trace, "IRQtask"); privptr = (struct claw_privbk *) dev->priv; - -#ifdef DEBUGMSG - printk(KERN_INFO "%s: bh routine - state-%02x\n" , - dev->name, p_ch->claw_state); -#endif - unpack_read(dev); clear_bit(CLAW_BH_ACTIVE, (void *)&p_ch->flag_a); - CLAW_DBF_TEXT(4,trace,"TskletXt"); -#ifdef FUNCTRACE - printk(KERN_INFO "%s:%s Exit on line %d\n", - dev->name,__func__,__LINE__); -#endif + CLAW_DBF_TEXT(4, trace, "TskletXt"); return; } /* end of claw_irq_bh */ @@ -1060,16 +808,7 @@ claw_release(struct net_device *dev) privptr = (struct claw_privbk *) dev->priv; if (!privptr) return 0; -#ifdef FUNCTRACE - printk(KERN_INFO "%s:%s Enter \n",dev->name,__func__); -#endif - CLAW_DBF_TEXT(4,trace,"release"); -#ifdef DEBUGMSG - printk(KERN_INFO "%s: variable dev =\n",dev->name); - dumpit((char *) dev, sizeof(struct net_device)); - printk(KERN_INFO "Priv Buffalloc %d\n",privptr->buffs_alloc); - printk(KERN_INFO "Priv p_buff_ccw = %p\n",&privptr->p_buff_ccw); -#endif + CLAW_DBF_TEXT(4, trace, "release"); privptr->release_pend=1; claw_setbit_busy(TB_STOP,dev); for ( i = 1; i >=0 ; i--) { @@ -1101,19 +840,15 @@ claw_release(struct net_device *dev) privptr->pk_skb = NULL; } if(privptr->buffs_alloc != 1) { -#ifdef FUNCTRACE - printk(KERN_INFO "%s:%s Exit on line %d\n", - dev->name,__func__,__LINE__); -#endif - CLAW_DBF_TEXT(4,trace,"none2fre"); + CLAW_DBF_TEXT(4, trace, "none2fre"); return 0; } - CLAW_DBF_TEXT(4,trace,"freebufs"); + CLAW_DBF_TEXT(4, trace, "freebufs"); if (privptr->p_buff_ccw != NULL) { free_pages((unsigned long)privptr->p_buff_ccw, (int)pages_to_order_of_mag(privptr->p_buff_ccw_num)); } - CLAW_DBF_TEXT(4,trace,"freeread"); + CLAW_DBF_TEXT(4, trace, "freeread"); if (privptr->p_env->read_size < PAGE_SIZE) { if (privptr->p_buff_read != NULL) { free_pages((unsigned long)privptr->p_buff_read, @@ -1129,7 +864,7 @@ claw_release(struct net_device *dev) p_buf=p_buf->next; } } - CLAW_DBF_TEXT(4,trace,"freewrit"); + CLAW_DBF_TEXT(4, trace, "freewrit"); if (privptr->p_env->write_size < PAGE_SIZE ) { free_pages((unsigned long)privptr->p_buff_write, (int)pages_to_order_of_mag(privptr->p_buff_write_num)); @@ -1143,7 +878,7 @@ claw_release(struct net_device *dev) p_buf=p_buf->next; } } - CLAW_DBF_TEXT(4,trace,"clearptr"); + CLAW_DBF_TEXT(4, trace, "clearptr"); privptr->buffs_alloc = 0; privptr->p_buff_ccw=NULL; privptr->p_buff_read=NULL; @@ -1180,18 +915,12 @@ claw_release(struct net_device *dev) dev->name, privptr->channel[READ].last_dstat, privptr->channel[WRITE].last_dstat); - CLAW_DBF_TEXT(2,trace,"badclose"); + CLAW_DBF_TEXT(2, trace, "badclose"); } -#ifdef FUNCTRACE - printk(KERN_INFO "%s:%s Exit on line %d\n", - dev->name,__func__,__LINE__); -#endif - CLAW_DBF_TEXT(4,trace,"rlsexit"); + CLAW_DBF_TEXT(4, trace, "rlsexit"); return 0; } /* end of claw_release */ - - /*-------------------------------------------------------------------* * claw_write_retry * * * @@ -1203,32 +932,12 @@ claw_write_retry ( struct chbk *p_ch ) struct net_device *dev=p_ch->ndev; - -#ifdef FUNCTRACE - printk(KERN_INFO "%s:%s Enter\n",dev->name,__func__); - printk(KERN_INFO "claw: variable p_ch =\n"); - dumpit((char *) p_ch, sizeof(struct chbk)); -#endif - CLAW_DBF_TEXT(4,trace,"w_retry"); + CLAW_DBF_TEXT(4, trace, "w_retry"); if (p_ch->claw_state == CLAW_STOP) { -#ifdef FUNCTRACE - printk(KERN_INFO "%s:%s Exit on line %d\n", - dev->name,__func__,__LINE__); -#endif return; } -#ifdef DEBUGMSG - printk( KERN_INFO "%s:%s state-%02x\n" , - dev->name, - __func__, - p_ch->claw_state); -#endif claw_strt_out_IO( dev ); -#ifdef FUNCTRACE - printk(KERN_INFO "%s:%s Exit on line %d\n", - dev->name,__func__,__LINE__); -#endif - CLAW_DBF_TEXT(4,trace,"rtry_xit"); + CLAW_DBF_TEXT(4, trace, "rtry_xit"); return; } /* end of claw_write_retry */ @@ -1247,12 +956,7 @@ claw_write_next ( struct chbk * p_ch ) struct sk_buff *pk_skb; int rc; -#ifdef FUNCTRACE - printk(KERN_INFO "%s: |