--- linux-2.6.17-gentoo-r4_orig/drivers/net/pcmcia/xirc2ps_cs.c 2006-07-28 18:47:14.000000000 +0200 +++ linux-2.6.17-gentoo-r4/drivers/net/pcmcia/xirc2ps_cs.c 2006-08-14 23:52:35.000000000 +0200 @@ -345,6 +345,7 @@ void __iomem *dingo_ccr; /* only used for CEM56 cards */ unsigned last_ptr_value; /* last packets transmitted value */ const char *manf_str; + struct work_struct tx_timeout_task; } local_info_t; /**************** @@ -542,6 +543,9 @@ /*============= Main bulk of functions =========================*/ +#ifdef HAVE_TX_TIMEOUT +static void xirc2ps_tx_timeout_task(void *data); +#endif /**************** * xirc2ps_attach() creates an "instance" of the driver, allocating * local data structures for one device. The device is registered @@ -589,6 +593,7 @@ #ifdef HAVE_TX_TIMEOUT dev->tx_timeout = do_tx_timeout; dev->watchdog_timeo = TX_TIMEOUT; + INIT_WORK(&local->tx_timeout_task, xirc2ps_tx_timeout_task, dev); #endif return xirc2ps_config(link); @@ -1340,10 +1345,29 @@ /*====================================================================*/ +#ifdef HAVE_TX_TIMEOUT +static void +xirc2ps_tx_timeout_task(void *data) +{ + struct net_device *dev = data; + local_info_t *lp = netdev_priv(dev); + printk(KERN_NOTICE "%s: transmit timed out\n", dev->name); + lp->stats.tx_errors++; + /* reset the card */ + do_reset(dev,1); + dev->trans_start = jiffies; + netif_wake_queue(dev); +} static void do_tx_timeout(struct net_device *dev) { local_info_t *lp = netdev_priv(dev); + schedule_work(&lp->tx_timeout_task); +} +#else +do_tx_timeout(struct net_device *dev) +{ + local_info_t *lp = netdev_priv(dev); printk(KERN_NOTICE "%s: transmit timed out\n", dev->name); lp->stats.tx_errors++; /* reset the card */ @@ -1351,6 +1375,7 @@ dev->trans_start = jiffies; netif_wake_queue(dev); } +#endif static int do_start_xmit(struct sk_buff *skb, struct net_device *dev)