Commit 0646b429 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jeff Garzik

[netdrvr pcmcia] remove the release timer from all pcmcia net drivers

Ack'd by Russell King as well.
parent 11e5bb60
...@@ -232,7 +232,7 @@ static char mii_preamble_required = 0; ...@@ -232,7 +232,7 @@ static char mii_preamble_required = 0;
/* Index of functions. */ /* Index of functions. */
static void tc574_config(dev_link_t *link); static void tc574_config(dev_link_t *link);
static void tc574_release(unsigned long arg); static void tc574_release(dev_link_t *link);
static int tc574_event(event_t event, int priority, static int tc574_event(event_t event, int priority,
event_callback_args_t *args); event_callback_args_t *args);
...@@ -298,9 +298,6 @@ static dev_link_t *tc574_attach(void) ...@@ -298,9 +298,6 @@ static dev_link_t *tc574_attach(void)
link->priv = dev; link->priv = dev;
spin_lock_init(&lp->window_lock); spin_lock_init(&lp->window_lock);
init_timer(&link->release);
link->release.function = &tc574_release;
link->release.data = (unsigned long)link;
link->io.NumPorts1 = 32; link->io.NumPorts1 = 32;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_16; link->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT; link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT;
...@@ -374,9 +371,8 @@ static void tc574_detach(dev_link_t *link) ...@@ -374,9 +371,8 @@ static void tc574_detach(dev_link_t *link)
if (*linkp == NULL) if (*linkp == NULL)
return; return;
del_timer_sync(&link->release);
if (link->state & DEV_CONFIG) { if (link->state & DEV_CONFIG) {
tc574_release((unsigned long)link); tc574_release(link);
if (link->state & DEV_STALE_CONFIG) { if (link->state & DEV_STALE_CONFIG) {
link->state |= DEV_STALE_LINK; link->state |= DEV_STALE_LINK;
return; return;
...@@ -555,7 +551,7 @@ static void tc574_config(dev_link_t *link) ...@@ -555,7 +551,7 @@ static void tc574_config(dev_link_t *link)
cs_failed: cs_failed:
cs_error(link->handle, last_fn, last_ret); cs_error(link->handle, last_fn, last_ret);
failed: failed:
tc574_release((unsigned long)link); tc574_release(link);
return; return;
} /* tc574_config */ } /* tc574_config */
...@@ -566,10 +562,8 @@ static void tc574_config(dev_link_t *link) ...@@ -566,10 +562,8 @@ static void tc574_config(dev_link_t *link)
still open, this will be postponed until it is closed. still open, this will be postponed until it is closed.
*/ */
static void tc574_release(unsigned long arg) static void tc574_release(dev_link_t *link)
{ {
dev_link_t *link = (dev_link_t *)arg;
DEBUG(0, "3c574_release(0x%p)\n", link); DEBUG(0, "3c574_release(0x%p)\n", link);
if (link->open) { if (link->open) {
...@@ -607,7 +601,7 @@ static int tc574_event(event_t event, int priority, ...@@ -607,7 +601,7 @@ static int tc574_event(event_t event, int priority,
link->state &= ~DEV_PRESENT; link->state &= ~DEV_PRESENT;
if (link->state & DEV_CONFIG) { if (link->state & DEV_CONFIG) {
netif_device_detach(dev); netif_device_detach(dev);
mod_timer(&link->release, jiffies + HZ/20); tc574_release(link);
} }
break; break;
case CS_EVENT_CARD_INSERTION: case CS_EVENT_CARD_INSERTION:
...@@ -1323,7 +1317,7 @@ static int el3_close(struct net_device *dev) ...@@ -1323,7 +1317,7 @@ static int el3_close(struct net_device *dev)
netif_stop_queue(dev); netif_stop_queue(dev);
del_timer_sync(&lp->media); del_timer_sync(&lp->media);
if (link->state & DEV_STALE_CONFIG) if (link->state & DEV_STALE_CONFIG)
mod_timer(&link->release, jiffies + HZ/20); tc574_release(link);
return 0; return 0;
} }
......
...@@ -148,7 +148,7 @@ DRV_NAME ".c " DRV_VERSION " 2001/10/13 00:08:50 (David Hinds)"; ...@@ -148,7 +148,7 @@ DRV_NAME ".c " DRV_VERSION " 2001/10/13 00:08:50 (David Hinds)";
/*====================================================================*/ /*====================================================================*/
static void tc589_config(dev_link_t *link); static void tc589_config(dev_link_t *link);
static void tc589_release(unsigned long arg); static void tc589_release(dev_link_t *link);
static int tc589_event(event_t event, int priority, static int tc589_event(event_t event, int priority,
event_callback_args_t *args); event_callback_args_t *args);
...@@ -220,9 +220,6 @@ static dev_link_t *tc589_attach(void) ...@@ -220,9 +220,6 @@ static dev_link_t *tc589_attach(void)
link->priv = dev; link->priv = dev;
spin_lock_init(&lp->lock); spin_lock_init(&lp->lock);
init_timer(&link->release);
link->release.function = &tc589_release;
link->release.data = (unsigned long)link;
link->io.NumPorts1 = 16; link->io.NumPorts1 = 16;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_16; link->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT; link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT;
...@@ -298,9 +295,8 @@ static void tc589_detach(dev_link_t *link) ...@@ -298,9 +295,8 @@ static void tc589_detach(dev_link_t *link)
if (*linkp == NULL) if (*linkp == NULL)
return; return;
del_timer_sync(&link->release);
if (link->state & DEV_CONFIG) { if (link->state & DEV_CONFIG) {
tc589_release((unsigned long)link); tc589_release(link);
if (link->state & DEV_STALE_CONFIG) { if (link->state & DEV_STALE_CONFIG) {
link->state |= DEV_STALE_LINK; link->state |= DEV_STALE_LINK;
return; return;
...@@ -439,7 +435,7 @@ static void tc589_config(dev_link_t *link) ...@@ -439,7 +435,7 @@ static void tc589_config(dev_link_t *link)
cs_failed: cs_failed:
cs_error(link->handle, last_fn, last_ret); cs_error(link->handle, last_fn, last_ret);
failed: failed:
tc589_release((unsigned long)link); tc589_release(link);
return; return;
} /* tc589_config */ } /* tc589_config */
...@@ -452,10 +448,8 @@ static void tc589_config(dev_link_t *link) ...@@ -452,10 +448,8 @@ static void tc589_config(dev_link_t *link)
======================================================================*/ ======================================================================*/
static void tc589_release(unsigned long arg) static void tc589_release(dev_link_t *link)
{ {
dev_link_t *link = (dev_link_t *)arg;
DEBUG(0, "3c589_release(0x%p)\n", link); DEBUG(0, "3c589_release(0x%p)\n", link);
if (link->open) { if (link->open) {
...@@ -495,7 +489,7 @@ static int tc589_event(event_t event, int priority, ...@@ -495,7 +489,7 @@ static int tc589_event(event_t event, int priority,
link->state &= ~DEV_PRESENT; link->state &= ~DEV_PRESENT;
if (link->state & DEV_CONFIG) { if (link->state & DEV_CONFIG) {
netif_device_detach(dev); netif_device_detach(dev);
mod_timer(&link->release, jiffies + HZ/20); tc589_release(link);
} }
break; break;
case CS_EVENT_CARD_INSERTION: case CS_EVENT_CARD_INSERTION:
...@@ -1137,7 +1131,7 @@ static int el3_close(struct net_device *dev) ...@@ -1137,7 +1131,7 @@ static int el3_close(struct net_device *dev)
netif_stop_queue(dev); netif_stop_queue(dev);
del_timer_sync(&lp->media); del_timer_sync(&lp->media);
if (link->state & DEV_STALE_CONFIG) if (link->state & DEV_STALE_CONFIG)
mod_timer(&link->release, jiffies + HZ/20); tc589_release(link);
return 0; return 0;
} }
......
...@@ -92,7 +92,7 @@ static char *version = ...@@ -92,7 +92,7 @@ static char *version =
/*====================================================================*/ /*====================================================================*/
static void axnet_config(dev_link_t *link); static void axnet_config(dev_link_t *link);
static void axnet_release(u_long arg); static void axnet_release(dev_link_t *link);
static int axnet_event(event_t event, int priority, static int axnet_event(event_t event, int priority,
event_callback_args_t *args); event_callback_args_t *args);
static int axnet_open(struct net_device *dev); static int axnet_open(struct net_device *dev);
...@@ -194,10 +194,6 @@ static dev_link_t *axnet_attach(void) ...@@ -194,10 +194,6 @@ static dev_link_t *axnet_attach(void)
memset(info, 0, sizeof(*info)); memset(info, 0, sizeof(*info));
link = &info->link; dev = &info->dev; link = &info->link; dev = &info->dev;
link->priv = info; link->priv = info;
init_timer(&link->release);
link->release.function = &axnet_release;
link->release.data = (u_long)link;
link->irq.Attributes = IRQ_TYPE_EXCLUSIVE; link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
link->irq.IRQInfo1 = IRQ_INFO2_VALID|IRQ_LEVEL_ID; link->irq.IRQInfo1 = IRQ_INFO2_VALID|IRQ_LEVEL_ID;
if (irq_list[0] == -1) if (irq_list[0] == -1)
...@@ -258,9 +254,8 @@ static void axnet_detach(dev_link_t *link) ...@@ -258,9 +254,8 @@ static void axnet_detach(dev_link_t *link)
if (*linkp == NULL) if (*linkp == NULL)
return; return;
del_timer_sync(&link->release);
if (link->state & DEV_CONFIG) { if (link->state & DEV_CONFIG) {
axnet_release((u_long)link); axnet_release(link);
if (link->state & DEV_STALE_CONFIG) { if (link->state & DEV_STALE_CONFIG) {
link->state |= DEV_STALE_LINK; link->state |= DEV_STALE_LINK;
return; return;
...@@ -518,7 +513,7 @@ static void axnet_config(dev_link_t *link) ...@@ -518,7 +513,7 @@ static void axnet_config(dev_link_t *link)
cs_failed: cs_failed:
cs_error(link->handle, last_fn, last_ret); cs_error(link->handle, last_fn, last_ret);
failed: failed:
axnet_release((u_long)link); axnet_release(link);
link->state &= ~DEV_CONFIG_PENDING; link->state &= ~DEV_CONFIG_PENDING;
return; return;
} /* axnet_config */ } /* axnet_config */
...@@ -531,10 +526,8 @@ static void axnet_config(dev_link_t *link) ...@@ -531,10 +526,8 @@ static void axnet_config(dev_link_t *link)
======================================================================*/ ======================================================================*/
static void axnet_release(u_long arg) static void axnet_release(dev_link_t *link)
{ {
dev_link_t *link = (dev_link_t *)arg;
DEBUG(0, "axnet_release(0x%p)\n", link); DEBUG(0, "axnet_release(0x%p)\n", link);
if (link->open) { if (link->open) {
...@@ -574,7 +567,7 @@ static int axnet_event(event_t event, int priority, ...@@ -574,7 +567,7 @@ static int axnet_event(event_t event, int priority,
link->state &= ~DEV_PRESENT; link->state &= ~DEV_PRESENT;
if (link->state & DEV_CONFIG) { if (link->state & DEV_CONFIG) {
netif_device_detach(&info->dev); netif_device_detach(&info->dev);
mod_timer(&link->release, jiffies + HZ/20); axnet_release(link);
} }
break; break;
case CS_EVENT_CARD_INSERTION: case CS_EVENT_CARD_INSERTION:
...@@ -708,7 +701,7 @@ static int axnet_close(struct net_device *dev) ...@@ -708,7 +701,7 @@ static int axnet_close(struct net_device *dev)
netif_stop_queue(dev); netif_stop_queue(dev);
del_timer_sync(&info->watchdog); del_timer_sync(&info->watchdog);
if (link->state & DEV_STALE_CONFIG) if (link->state & DEV_STALE_CONFIG)
mod_timer(&link->release, jiffies + HZ/20); axnet_release(link);
return 0; return 0;
} /* axnet_close */ } /* axnet_close */
......
...@@ -126,7 +126,7 @@ MODULE_LICENSE("GPL"); ...@@ -126,7 +126,7 @@ MODULE_LICENSE("GPL");
/*====================================================================*/ /*====================================================================*/
static void com20020_config(dev_link_t *link); static void com20020_config(dev_link_t *link);
static void com20020_release(u_long arg); static void com20020_release(dev_link_t *link);
static int com20020_event(event_t event, int priority, static int com20020_event(event_t event, int priority,
event_callback_args_t *args); event_callback_args_t *args);
...@@ -205,9 +205,6 @@ static dev_link_t *com20020_attach(void) ...@@ -205,9 +205,6 @@ static dev_link_t *com20020_attach(void)
memset(link, 0, sizeof(struct dev_link_t)); memset(link, 0, sizeof(struct dev_link_t));
dev->priv = lp; dev->priv = lp;
init_timer(&link->release);
link->release.function = &com20020_release;
link->release.data = (u_long)link;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
link->io.NumPorts1 = 16; link->io.NumPorts1 = 16;
link->io.IOAddrLines = 16; link->io.IOAddrLines = 16;
...@@ -292,7 +289,7 @@ static void com20020_detach(dev_link_t *link) ...@@ -292,7 +289,7 @@ static void com20020_detach(dev_link_t *link)
dev = info->dev; dev = info->dev;
if (link->state & DEV_CONFIG) { if (link->state & DEV_CONFIG) {
com20020_release((u_long)link); com20020_release(link);
if (link->state & DEV_STALE_CONFIG) { if (link->state & DEV_STALE_CONFIG) {
link->state |= DEV_STALE_LINK; link->state |= DEV_STALE_LINK;
return; return;
...@@ -456,7 +453,7 @@ static void com20020_config(dev_link_t *link) ...@@ -456,7 +453,7 @@ static void com20020_config(dev_link_t *link)
cs_error(link->handle, last_fn, last_ret); cs_error(link->handle, last_fn, last_ret);
failed: failed:
DEBUG(1,"com20020_config failed...\n"); DEBUG(1,"com20020_config failed...\n");
com20020_release((u_long)link); com20020_release(link);
} /* com20020_config */ } /* com20020_config */
/*====================================================================== /*======================================================================
...@@ -467,9 +464,8 @@ static void com20020_config(dev_link_t *link) ...@@ -467,9 +464,8 @@ static void com20020_config(dev_link_t *link)
======================================================================*/ ======================================================================*/
static void com20020_release(u_long arg) static void com20020_release(dev_link_t *link)
{ {
dev_link_t *link = (dev_link_t *)arg;
DEBUG(1,"release...\n"); DEBUG(1,"release...\n");
...@@ -513,9 +509,7 @@ static int com20020_event(event_t event, int priority, ...@@ -513,9 +509,7 @@ static int com20020_event(event_t event, int priority,
link->state &= ~DEV_PRESENT; link->state &= ~DEV_PRESENT;
if (link->state & DEV_CONFIG) { if (link->state & DEV_CONFIG) {
netif_device_detach(dev); netif_device_detach(dev);
link->release.expires = jiffies + HZ/20;
link->state |= DEV_RELEASE_PENDING; link->state |= DEV_RELEASE_PENDING;
add_timer(&link->release);
} }
break; break;
case CS_EVENT_CARD_INSERTION: case CS_EVENT_CARD_INSERTION:
......
...@@ -94,7 +94,7 @@ static char *version = DRV_NAME ".c " DRV_VERSION " 2002/03/23"; ...@@ -94,7 +94,7 @@ static char *version = DRV_NAME ".c " DRV_VERSION " 2002/03/23";
static void fmvj18x_config(dev_link_t *link); static void fmvj18x_config(dev_link_t *link);
static int fmvj18x_get_hwinfo(dev_link_t *link, u_char *node_id); static int fmvj18x_get_hwinfo(dev_link_t *link, u_char *node_id);
static int fmvj18x_setup_mfc(dev_link_t *link); static int fmvj18x_setup_mfc(dev_link_t *link);
static void fmvj18x_release(u_long arg); static void fmvj18x_release(dev_link_t *link);
static int fmvj18x_event(event_t event, int priority, static int fmvj18x_event(event_t event, int priority,
event_callback_args_t *args); event_callback_args_t *args);
static dev_link_t *fmvj18x_attach(void); static dev_link_t *fmvj18x_attach(void);
...@@ -279,10 +279,6 @@ static dev_link_t *fmvj18x_attach(void) ...@@ -279,10 +279,6 @@ static dev_link_t *fmvj18x_attach(void)
link = &lp->link; link = &lp->link;
link->priv = dev; link->priv = dev;
init_timer(&link->release);
link->release.function = &fmvj18x_release;
link->release.data = (u_long)link;
/* The io structure describes IO port mapping */ /* The io structure describes IO port mapping */
link->io.NumPorts1 = 32; link->io.NumPorts1 = 32;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
...@@ -355,9 +351,8 @@ static void fmvj18x_detach(dev_link_t *link) ...@@ -355,9 +351,8 @@ static void fmvj18x_detach(dev_link_t *link)
if (*linkp == NULL) if (*linkp == NULL)
return; return;
del_timer_sync(&link->release);
if (link->state & DEV_CONFIG) { if (link->state & DEV_CONFIG) {
fmvj18x_release((u_long)link); fmvj18x_release(link);
if (link->state & DEV_STALE_CONFIG) { if (link->state & DEV_STALE_CONFIG) {
link->state |= DEV_STALE_LINK; link->state |= DEV_STALE_LINK;
return; return;
...@@ -638,7 +633,7 @@ static void fmvj18x_config(dev_link_t *link) ...@@ -638,7 +633,7 @@ static void fmvj18x_config(dev_link_t *link)
/* All Card Services errors end up here */ /* All Card Services errors end up here */
cs_error(link->handle, last_fn, last_ret); cs_error(link->handle, last_fn, last_ret);
failed: failed:
fmvj18x_release((u_long)link); fmvj18x_release(link);
link->state &= ~DEV_CONFIG_PENDING; link->state &= ~DEV_CONFIG_PENDING;
} /* fmvj18x_config */ } /* fmvj18x_config */
...@@ -742,9 +737,8 @@ static int fmvj18x_setup_mfc(dev_link_t *link) ...@@ -742,9 +737,8 @@ static int fmvj18x_setup_mfc(dev_link_t *link)
} }
/*====================================================================*/ /*====================================================================*/
static void fmvj18x_release(u_long arg) static void fmvj18x_release(dev_link_t *link)
{ {
dev_link_t *link = (dev_link_t *)arg;
DEBUG(0, "fmvj18x_release(0x%p)\n", link); DEBUG(0, "fmvj18x_release(0x%p)\n", link);
...@@ -784,7 +778,7 @@ static int fmvj18x_event(event_t event, int priority, ...@@ -784,7 +778,7 @@ static int fmvj18x_event(event_t event, int priority,
link->state &= ~DEV_PRESENT; link->state &= ~DEV_PRESENT;
if (link->state & DEV_CONFIG) { if (link->state & DEV_CONFIG) {
netif_device_detach(dev); netif_device_detach(dev);
mod_timer(&link->release, jiffies + HZ/20); fmvj18x_release(link);
} }
break; break;
case CS_EVENT_CARD_INSERTION: case CS_EVENT_CARD_INSERTION:
...@@ -1306,7 +1300,7 @@ static int fjn_close(struct net_device *dev) ...@@ -1306,7 +1300,7 @@ static int fjn_close(struct net_device *dev)
link->open--; link->open--;
if (link->state & DEV_STALE_CONFIG) if (link->state & DEV_STALE_CONFIG)
mod_timer(&link->release, jiffies + HZ/20); fmvj18x_release(link);
return 0; return 0;
} /* fjn_close */ } /* fjn_close */
......
...@@ -114,7 +114,7 @@ MODULE_LICENSE("GPL"); ...@@ -114,7 +114,7 @@ MODULE_LICENSE("GPL");
static void ibmtr_config(dev_link_t *link); static void ibmtr_config(dev_link_t *link);
static void ibmtr_hw_setup(struct net_device *dev, u_int mmiobase); static void ibmtr_hw_setup(struct net_device *dev, u_int mmiobase);
static void ibmtr_release(u_long arg); static void ibmtr_release(dev_link_t *link);
static int ibmtr_event(event_t event, int priority, static int ibmtr_event(event_t event, int priority,
event_callback_args_t *args); event_callback_args_t *args);
...@@ -216,9 +216,6 @@ static dev_link_t *ibmtr_attach(void) ...@@ -216,9 +216,6 @@ static dev_link_t *ibmtr_attach(void)
link = &info->link; link = &info->link;
link->priv = info; link->priv = info;
init_timer(&link->release);
link->release.function = &ibmtr_release;
link->release.data = (u_long)link;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
link->io.NumPorts1 = 4; link->io.NumPorts1 = 4;
link->io.IOAddrLines = 16; link->io.IOAddrLines = 16;
...@@ -295,9 +292,8 @@ static void ibmtr_detach(dev_link_t *link) ...@@ -295,9 +292,8 @@ static void ibmtr_detach(dev_link_t *link)
struct tok_info *ti = (struct tok_info *)dev->priv; struct tok_info *ti = (struct tok_info *)dev->priv;
del_timer_sync(&(ti->tr_timer)); del_timer_sync(&(ti->tr_timer));
} }
del_timer_sync(&link->release);
if (link->state & DEV_CONFIG) { if (link->state & DEV_CONFIG) {
ibmtr_release((u_long)link); ibmtr_release(link);
if (link->state & DEV_STALE_CONFIG) { if (link->state & DEV_STALE_CONFIG) {
link->state |= DEV_STALE_LINK; link->state |= DEV_STALE_LINK;
return; return;
...@@ -434,7 +430,7 @@ static void ibmtr_config(dev_link_t *link) ...@@ -434,7 +430,7 @@ static void ibmtr_config(dev_link_t *link)
cs_failed: cs_failed:
cs_error(link->handle, last_fn, last_ret); cs_error(link->handle, last_fn, last_ret);
failed: failed:
ibmtr_release((u_long)link); ibmtr_release(link);
} /* ibmtr_config */ } /* ibmtr_config */
/*====================================================================== /*======================================================================
...@@ -445,9 +441,8 @@ static void ibmtr_config(dev_link_t *link) ...@@ -445,9 +441,8 @@ static void ibmtr_config(dev_link_t *link)
======================================================================*/ ======================================================================*/
static void ibmtr_release(u_long arg) static void ibmtr_release(dev_link_t *link)
{ {
dev_link_t *link = (dev_link_t *)arg;
ibmtr_dev_t *info = link->priv; ibmtr_dev_t *info = link->priv;
struct net_device *dev = info->dev; struct net_device *dev = info->dev;
...@@ -499,7 +494,7 @@ static int ibmtr_event(event_t event, int priority, ...@@ -499,7 +494,7 @@ static int ibmtr_event(event_t event, int priority,
/* set flag to bypass normal interrupt code */ /* set flag to bypass normal interrupt code */
((struct tok_info *)dev->priv)->sram_virt |= 1; ((struct tok_info *)dev->priv)->sram_virt |= 1;
netif_device_detach(dev); netif_device_detach(dev);
mod_timer(&link->release, jiffies + HZ/20); ibmtr_release(link);
} }
break; break;
case CS_EVENT_CARD_INSERTION: case CS_EVENT_CARD_INSERTION:
......
...@@ -427,7 +427,7 @@ Function Prototypes ...@@ -427,7 +427,7 @@ Function Prototypes
---------------------------------------------------------------------------- */ ---------------------------------------------------------------------------- */
static void nmclan_config(dev_link_t *link); static void nmclan_config(dev_link_t *link);
static void nmclan_release(u_long arg); static void nmclan_release(dev_link_t *link);
static int nmclan_event(event_t event, int priority, static int nmclan_event(event_t event, int priority,
event_callback_args_t *args); event_callback_args_t *args);
...@@ -490,9 +490,6 @@ static dev_link_t *nmclan_attach(void) ...@@ -490,9 +490,6 @@ static dev_link_t *nmclan_attach(void)
link->priv = dev; link->priv = dev;
spin_lock_init(&lp->bank_lock); spin_lock_init(&lp->bank_lock);
init_timer(&link->release);
link->release.function = &nmclan_release;
link->release.data = (u_long)link;
link->io.NumPorts1 = 32; link->io.NumPorts1 = 32;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
link->io.IOAddrLines = 5; link->io.IOAddrLines = 5;
...@@ -569,9 +566,8 @@ static void nmclan_detach(dev_link_t *link) ...@@ -569,9 +566,8 @@ static void nmclan_detach(dev_link_t *link)
if (*linkp == NULL) if (*linkp == NULL)
return; return;
del_timer_sync(&link->release);
if (link->state & DEV_CONFIG) { if (link->state & DEV_CONFIG) {
nmclan_release((u_long)link); nmclan_release(link);
if (link->state & DEV_STALE_CONFIG) { if (link->state & DEV_STALE_CONFIG) {
link->state |= DEV_STALE_LINK; link->state |= DEV_STALE_LINK;
return; return;
...@@ -815,7 +811,7 @@ static void nmclan_config(dev_link_t *link) ...@@ -815,7 +811,7 @@ static void nmclan_config(dev_link_t *link)
cs_failed: cs_failed:
cs_error(link->handle, last_fn, last_ret); cs_error(link->handle, last_fn, last_ret);
failed: failed:
nmclan_release((u_long)link); nmclan_release(link);
return; return;
} /* nmclan_config */ } /* nmclan_config */
...@@ -826,9 +822,8 @@ nmclan_release ...@@ -826,9 +822,8 @@ nmclan_release
net device, and release the PCMCIA configuration. If the device net device, and release the PCMCIA configuration. If the device
is still open, this will be postponed until it is closed. is still open, this will be postponed until it is closed.
---------------------------------------------------------------------------- */ ---------------------------------------------------------------------------- */
static void nmclan_release(u_long arg) static void nmclan_release(dev_link_t *link)
{ {
dev_link_t *link = (dev_link_t *)arg;
DEBUG(0, "nmclan_release(0x%p)\n", link); DEBUG(0, "nmclan_release(0x%p)\n", link);
...@@ -867,7 +862,7 @@ static int nmclan_event(event_t event, int priority, ...@@ -867,7 +862,7 @@ static int nmclan_event(event_t event, int priority,
link->state &= ~DEV_PRESENT; link->state &= ~DEV_PRESENT;
if (link->state & DEV_CONFIG) { if (link->state & DEV_CONFIG) {
netif_device_detach(dev); netif_device_detach(dev);
mod_timer(&link->release, jiffies + HZ/20); nmclan_release(link);
} }
break; break;
case CS_EVENT_CARD_INSERTION: case CS_EVENT_CARD_INSERTION:
...@@ -1012,7 +1007,7 @@ static int mace_close(struct net_device *dev) ...@@ -1012,7 +1007,7 @@ static int mace_close(struct net_device *dev)
link->open--; link->open--;
netif_stop_queue(dev); netif_stop_queue(dev);
if (link->state & DEV_STALE_CONFIG) if (link->state & DEV_STALE_CONFIG)
mod_timer(&link->release, jiffies + HZ/20); nmclan_release(link);
return 0; return 0;
} /* mace_close */ } /* mace_close */
......
...@@ -110,7 +110,7 @@ MODULE_PARM(hw_addr, "6i"); ...@@ -110,7 +110,7 @@ MODULE_PARM(hw_addr, "6i");
static void mii_phy_probe(struct net_device *dev); static void mii_phy_probe(struct net_device *dev);
static void pcnet_config(dev_link_t *link); static void pcnet_config(dev_link_t *link);
static void pcnet_release(u_long arg); static void pcnet_release(dev_link_t *link);
static int pcnet_event(event_t event, int priority, static int pcnet_event(event_t event, int priority,
event_callback_args_t *args); event_callback_args_t *args);
static int pcnet_open(struct net_device *dev); static int pcnet_open(struct net_device *dev);
...@@ -293,9 +293,6 @@ static dev_link_t *pcnet_attach(void) ...@@ -293,9 +293,6 @@ static dev_link_t *pcnet_attach(void)
link = &info->link; dev = &info->dev; link = &info->link; dev = &info->dev;
link->priv = info; link->priv = info;
init_timer(&link->release);
link->release.function = &pcnet_release;
link->release.data = (u_long)link;
link->irq.Attributes = IRQ_TYPE_EXCLUSIVE; link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
link->irq.IRQInfo1 = IRQ_INFO2_VALID|IRQ_LEVEL_ID; link->irq.IRQInfo1 = IRQ_INFO2_VALID|IRQ_LEVEL_ID;
if (irq_list[0] == -1) if (irq_list[0] == -1)
...@@ -357,9 +354,8 @@ static void pcnet_detach(dev_link_t *link) ...@@ -357,9 +354,8 @@ static void pcnet_detach(dev_link_t *link)
if (*linkp == NULL) if (*linkp == NULL)
return; return;
del_timer_sync(&link->release);
if (link->state & DEV_CONFIG) { if (link->state & DEV_CONFIG) {
pcnet_release((u_long)link); pcnet_release(link);
if (link->state & DEV_STALE_CONFIG) { if (link->state & DEV_STALE_CONFIG) {
link->state |= DEV_STALE_LINK; link->state |= DEV_STALE_LINK;
return; return;
...@@ -787,7 +783,7 @@ static void pcnet_config(dev_link_t *link) ...@@ -787,7 +783,7 @@ static void pcnet_config(dev_link_t *link)
cs_failed: cs_failed:
cs_error(link->handle, last_fn, last_ret); cs_error(link->handle, last_fn, last_ret);
failed: failed:
pcnet_release((u_long)link); pcnet_release(link);
link->state &= ~DEV_CONFIG_PENDING; link->state &= ~DEV_CONFIG_PENDING;
return; return;
} /* pcnet_config */ } /* pcnet_config */
...@@ -800,9 +796,8 @@ static void pcnet_config(dev_link_t *link) ...@@ -800,9 +796,8 @@ static void pcnet_config(dev_link_t *link)
======================================================================*/ ======================================================================*/
static void pcnet_release(u_long arg) static void pcnet_release(dev_link_t *link)
{ {
dev_link_t *link = (dev_link_t *)arg;
pcnet_dev_t *info = link->priv; pcnet_dev_t *info = link->priv;
DEBUG(0, "pcnet_release(0x%p)\n", link); DEBUG(0, "pcnet_release(0x%p)\n", link);
...@@ -848,7 +843,7 @@ static int pcnet_event(event_t event, int priority, ...@@ -848,7 +843,7 @@ static int pcnet_event(event_t event, int priority,
link->state &= ~DEV_PRESENT; link->state &= ~DEV_PRESENT;
if (link->state & DEV_CONFIG) { if (link->state & DEV_CONFIG) {
netif_device_detach(&info->dev); netif_device_detach(&info->dev);
mod_timer(&link->release, jiffies + HZ/20); pcnet_release(link);
} }
break; break;
case CS_EVENT_CARD_INSERTION: case CS_EVENT_CARD_INSERTION:
...@@ -1054,7 +1049,7 @@ static int pcnet_close(struct net_device *dev) ...@@ -1054,7 +1049,7 @@ static int pcnet_close(struct net_device *dev)
netif_stop_queue(dev); netif_stop_queue(dev);
del_timer_sync(&info->watchdog); del_timer_sync(&info->watchdog);
if (link->state & DEV_STALE_CONFIG) if (link->state & DEV_STALE_CONFIG)
mod_timer(&link->release, jiffies + HZ/20); pcnet_release(link);
return 0; return 0;
} /* pcnet_close */ } /* pcnet_close */
......
...@@ -283,7 +283,7 @@ enum RxCfg { RxAllMulti = 0x0004, RxPromisc = 0x0002, ...@@ -283,7 +283,7 @@ enum RxCfg { RxAllMulti = 0x0004, RxPromisc = 0x0002,
static dev_link_t *smc91c92_attach(void); static dev_link_t *smc91c92_attach(void);
static void smc91c92_detach(dev_link_t *); static void smc91c92_detach(dev_link_t *);
static void smc91c92_config(dev_link_t *link); static void smc91c92_config(dev_link_t *link);
static void smc91c92_release(u_long arg); static void smc91c92_release(dev_link_t *link);
static int smc91c92_event(event_t event, int priority, static int smc91c92_event(event_t event, int priority,
event_callback_args_t *args); event_callback_args_t *args);
...@@ -351,9 +351,6 @@ static dev_link_t *smc91c92_attach(void) ...@@ -351,9 +351,6 @@ static dev_link_t *smc91c92_attach(void)
link->priv = dev; link->priv = dev;
spin_lock_init(&smc->lock); spin_lock_init(&smc->lock);
init_timer(&link->release);
link->release.function = &smc91c92_release;
link->release.data = (u_long)link;
link->io.NumPorts1 = 16; link->io.NumPorts1 = 16;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
link->io.IOAddrLines = 4; link->io.IOAddrLines = 4;
...@@ -433,9 +430,8 @@ static void smc91c92_detach(dev_link_t *link) ...@@ -433,9 +430,8 @@ static void smc91c92_detach(dev_link_t *link)
if (*linkp == NULL) if (*linkp == NULL)
return; return;
del_timer_sync(&link->release);
if (link->state & DEV_CONFIG) { if (link->state & DEV_CONFIG) {
smc91c92_release((u_long)link); smc91c92_release(link);
if (link->state & DEV_STALE_CONFIG) { if (link->state & DEV_STALE_CONFIG) {
link->state |= DEV_STALE_LINK; link->state |= DEV_STALE_LINK;
return; return;
...@@ -1068,7 +1064,7 @@ static void smc91c92_config(dev_link_t *link) ...@@ -1068,7 +1064,7 @@ static void smc91c92_config(dev_link_t *link)
config_undo: config_undo:
unregister_netdev(dev); unregister_netdev(dev);
config_failed: /* CS_EXIT_TEST() calls jump to here... */ config_failed: /* CS_EXIT_TEST() calls jump to here... */
smc91c92_release((u_long)link); smc91c92_release(link);
link->state &= ~DEV_CONFIG_PENDING; link->state &= ~DEV_CONFIG_PENDING;
} /* smc91c92_config */ } /* smc91c92_config */
...@@ -1081,9 +1077,8 @@ static void smc91c92_config(dev_link_t *link) ...@@ -1081,9 +1077,8 @@ static void smc91c92_config(dev_link_t *link)
======================================================================*/ ======================================================================*/
static void smc91c92_release(u_long arg) static void smc91c92_release(dev_link_t *link)
{ {
dev_link_t *link = (dev_link_t *)arg;
DEBUG(0, "smc91c92_release(0x%p)\n", link); DEBUG(0, "smc91c92_release(0x%p)\n", link);
...@@ -1132,7 +1127,7 @@ static int smc91c92_event(event_t event, int priority, ...@@ -1132,7 +1127,7 @@ static int smc91c92_event(event_t event, int priority,
link->state &= ~DEV_PRESENT; link->state &= ~DEV_PRESENT;
if (link->state & DEV_CONFIG) { if (link->state & DEV_CONFIG) {
netif_device_detach(dev); netif_device_detach(dev);
mod_timer(&link->release, jiffies + HZ/20); smc91c92_release(link);
} }
break; break;
case CS_EVENT_CARD_INSERTION: case CS_EVENT_CARD_INSERTION:
...@@ -1332,7 +1327,7 @@ static int smc_close(struct net_device *dev) ...@@ -1332,7 +1327,7 @@ static int smc_close(struct net_device *dev)
link->open--; link->open--;
del_timer_sync(&smc->media); del_timer_sync(&smc->media);
if (link->state & DEV_STALE_CONFIG) if (link->state & DEV_STALE_CONFIG)
mod_timer(&link->release, jiffies + HZ/20); smc91c92_release(link);
return 0; return 0;
} /* smc_close */ } /* smc_close */
......
...@@ -295,7 +295,7 @@ static void mii_wr(ioaddr_t ioaddr, u_char phyaddr, u_char phyreg, ...@@ -295,7 +295,7 @@ static void mii_wr(ioaddr_t ioaddr, u_char phyaddr, u_char phyreg,
static int has_ce2_string(dev_link_t * link); static int has_ce2_string(dev_link_t * link);
static void xirc2ps_config(dev_link_t * link); static void xirc2ps_config(dev_link_t * link);
static void xirc2ps_release(u_long arg); static void xirc2ps_release(dev_link_t * link);
static int xirc2ps_event(event_t event, int priority, static int xirc2ps_event(event_t event, int priority,
event_callback_args_t * args); event_callback_args_t * args);
...@@ -611,10 +611,6 @@ xirc2ps_attach(void) ...@@ -611,10 +611,6 @@ xirc2ps_attach(void)
link = &local->link; link = &local->link;
link->priv = dev; link->priv = dev;
init_timer(&link->release);
link->release.function = &xirc2ps_release;
link->release.data = (u_long) link;
/* General socket configuration */ /* General socket configuration */
link->conf.Attributes = CONF_ENABLE_IRQ; link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.Vcc = 50; link->conf.Vcc = 50;
...@@ -689,9 +685,8 @@ xirc2ps_detach(dev_link_t * link) ...@@ -689,9 +685,8 @@ xirc2ps_detach(dev_link_t * link)
* the release() function is called, that will trigger a proper * the release() function is called, that will trigger a proper
* detach(). * detach().
*/ */
del_timer_sync(&link->release);
if (link->state & DEV_CONFIG) { if (link->state & DEV_CONFIG) {
xirc2ps_release((unsigned long)link); xirc2ps_release(link);
if (link->state & DEV_STALE_CONFIG) { if (link->state & DEV_STALE_CONFIG) {
link->state |= DEV_STALE_LINK; link->state |= DEV_STALE_LINK;
return; return;
...@@ -1164,7 +1159,7 @@ xirc2ps_config(dev_link_t * link) ...@@ -1164,7 +1159,7 @@ xirc2ps_config(dev_link_t * link)
config_error: config_error:
link->state &= ~DEV_CONFIG_PENDING; link->state &= ~DEV_CONFIG_PENDING;
xirc2ps_release((u_long)link); xirc2ps_release(link);
return; return;
cis_error: cis_error:
...@@ -1179,9 +1174,8 @@ xirc2ps_config(dev_link_t * link) ...@@ -1179,9 +1174,8 @@ xirc2ps_config(dev_link_t * link)
* still open, this will be postponed until it is closed. * still open, this will be postponed until it is closed.
*/ */
static void static void
xirc2ps_release(u_long arg) xirc2ps_release(dev_link_t *link)
{ {
dev_link_t *link = (dev_link_t *) arg;
DEBUG(0, "release(0x%p)\n", link); DEBUG(0, "release(0x%p)\n", link);
...@@ -1243,7 +1237,7 @@ xirc2ps_event(event_t event, int priority, ...@@ -1243,7 +1237,7 @@ xirc2ps_event(event_t event, int priority,
link->state &= ~DEV_PRESENT; link->state &= ~DEV_PRESENT;
if (link->state & DEV_CONFIG) { if (link->state & DEV_CONFIG) {
netif_device_detach(dev); netif_device_detach(dev);
mod_timer(&link->release, jiffies + HZ/20); xirc2ps_release(link);
} }
break; break;
case CS_EVENT_CARD_INSERTION: case CS_EVENT_CARD_INSERTION:
...@@ -2045,7 +2039,7 @@ do_stop(struct net_device *dev) ...@@ -2045,7 +2039,7 @@ do_stop(struct net_device *dev)
link->open--; link->open--;
if (link->state & DEV_STALE_CONFIG) if (link->state & DEV_STALE_CONFIG)
mod_timer(&link->release, jiffies + HZ/20); xirc2ps_release(link);
return 0; return 0;
} }
......
...@@ -94,7 +94,7 @@ void stop_airo_card( struct net_device *, int ); ...@@ -94,7 +94,7 @@ void stop_airo_card( struct net_device *, int );
int reset_airo_card( struct net_device * ); int reset_airo_card( struct net_device * );
static void airo_config(dev_link_t *link); static void airo_config(dev_link_t *link);
static void airo_release(u_long arg); static void airo_release(dev_link_t *link);
static int airo_event(event_t event, int priority, static int airo_event(event_t event, int priority,
event_callback_args_t *args); event_callback_args_t *args);
...@@ -208,9 +208,6 @@ static dev_link_t *airo_attach(void) ...@@ -208,9 +208,6 @@ static dev_link_t *airo_attach(void)
return NULL; return NULL;
} }
memset(link, 0, sizeof(struct dev_link_t)); memset(link, 0, sizeof(struct dev_link_t));
init_timer(&link->release);
link->release.function = &airo_release;
link->release.data = (u_long)link;
/* Interrupt setup */ /* Interrupt setup */
link->irq.Attributes = IRQ_TYPE_EXCLUSIVE; link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
...@@ -286,10 +283,9 @@ static void airo_detach(dev_link_t *link) ...@@ -286,10 +283,9 @@ static void airo_detach(dev_link_t *link)
if (*linkp == NULL) if (*linkp == NULL)
return; return;
del_timer(&link->release); if (link->state & DEV_CONFIG) {
if ( link->state & DEV_CONFIG ) { airo_release(link);
airo_release( (int)link ); if (link->state & DEV_STALE_CONFIG) {
if ( link->state & DEV_STALE_CONFIG ) {
link->state |= DEV_STALE_LINK; link->state |= DEV_STALE_LINK;
return; return;
} }
...@@ -513,7 +509,7 @@ static void airo_config(dev_link_t *link) ...@@ -513,7 +509,7 @@ static void airo_config(dev_link_t *link)
cs_failed: cs_failed:
cs_error(link->handle, last_fn, last_ret); cs_error(link->handle, last_fn, last_ret);
airo_release((u_long)link); airo_release(link);
} /* airo_config */ } /* airo_config */
...@@ -525,10 +521,8 @@ static void airo_config(dev_link_t *link) ...@@ -525,10 +521,8 @@ static void airo_config(dev_link_t *link)
======================================================================*/ ======================================================================*/
static void airo_release(u_long arg) static void airo_release(dev_link_t *link)
{ {
dev_link_t *link = (dev_link_t *)arg;
DEBUG(0, "airo_release(0x%p)\n", link); DEBUG(0, "airo_release(0x%p)\n", link);
/* /*
...@@ -588,7 +582,7 @@ static int airo_event(event_t event, int priority, ...@@ -588,7 +582,7 @@ static int airo_event(event_t event, int priority,
link->state &= ~DEV_PRESENT; link->state &= ~DEV_PRESENT;
if (link->state & DEV_CONFIG) { if (link->state & DEV_CONFIG) {
netif_device_detach(local->eth_dev); netif_device_detach(local->eth_dev);
mod_timer(&link->release, jiffies + HZ/20); airo_release(link);
} }
break; break;
case CS_EVENT_CARD_INSERTION: case CS_EVENT_CARD_INSERTION:
...@@ -639,7 +633,7 @@ static void airo_cs_cleanup(void) ...@@ -639,7 +633,7 @@ static void airo_cs_cleanup(void)
/* XXX: this really needs to move into generic code.. */ /* XXX: this really needs to move into generic code.. */
while (dev_list != NULL) { while (dev_list != NULL) {
if (dev_list->state & DEV_CONFIG) if (dev_list->state & DEV_CONFIG)
airo_release((u_long)dev_list); airo_release(dev_list);
airo_detach(dev_list); airo_detach(dev_list);
} }
} }
......
...@@ -204,7 +204,7 @@ MODULE_PARM(irq_list, "1-4i"); ...@@ -204,7 +204,7 @@ MODULE_PARM(irq_list, "1-4i");
/*====================================================================*/ /*====================================================================*/
/* PCMCIA (Card Services) related functions */ /* PCMCIA (Card Services) related functions */
static void netwave_release(u_long arg); /* Card removal */ static void netwave_release(dev_link_t *link); /* Card removal */
static int netwave_event(event_t event, int priority, static int netwave_event(event_t event, int priority,
event_callback_args_t *args); event_callback_args_t *args);
static void netwave_pcmcia_config(dev_link_t *arg); /* Runs after card static void netwave_pcmcia_config(dev_link_t *arg); /* Runs after card
...@@ -455,10 +455,6 @@ static dev_link_t *netwave_attach(void) ...@@ -455,10 +455,6 @@ static dev_link_t *netwave_attach(void)
link = &priv->link; link = &priv->link;
link->priv = dev; link->priv = dev;
init_timer(&link->release);
link->release.function = &netwave_release;
link->release.data = (u_long)link;
/* The io structure describes IO port mapping */ /* The io structure describes IO port mapping */
link->io.NumPorts1 = 16; link->io.NumPorts1 = 16;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_16; link->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
...@@ -552,9 +548,8 @@ static void netwave_detach(dev_link_t *link) ...@@ -552,9 +548,8 @@ static void netwave_detach(dev_link_t *link)
the release() function is called, that will trigger a proper the release() function is called, that will trigger a proper
detach(). detach().
*/ */
del_timer(&link->release);
if (link->state & DEV_CONFIG) { if (link->state & DEV_CONFIG) {
netwave_release((u_long) link); netwave_release(link);
if (link->state & DEV_STALE_CONFIG) { if (link->state & DEV_STALE_CONFIG) {
DEBUG(1, "netwave_cs: detach postponed, '%s' still " DEBUG(1, "netwave_cs: detach postponed, '%s' still "
"locked\n", link->dev->dev_name); "locked\n", link->dev->dev_name);
...@@ -1149,7 +1144,7 @@ static void netwave_pcmcia_config(dev_link_t *link) { ...@@ -1149,7 +1144,7 @@ static void netwave_pcmcia_config(dev_link_t *link) {
cs_failed: cs_failed:
cs_error(link->handle, last_fn, last_ret); cs_error(link->handle, last_fn, last_ret);
failed: failed:
netwave_release((u_long)link); netwave_release(link);
} /* netwave_pcmcia_config */ } /* netwave_pcmcia_config */
/* /*
...@@ -1159,8 +1154,8 @@ static void netwave_pcmcia_config(dev_link_t *link) { ...@@ -1159,8 +1154,8 @@ static void netwave_pcmcia_config(dev_link_t *link) {
* device, and release the PCMCIA configuration. If the device is * device, and release the PCMCIA configuration. If the device is
* still open, this will be postponed until it is closed. * still open, this will be postponed until it is closed.
*/ */
static void netwave_release(u_long arg) { static void netwave_release(dev_link_t *link)
dev_link_t *link = (dev_link_t *)arg; {
struct net_device *dev = link->priv; struct net_device *dev = link->priv;
netwave_private *priv = dev->priv; netwave_private *priv = dev->priv;
...@@ -1220,7 +1215,7 @@ static int netwave_event(event_t event, int priority, ...@@ -1220,7 +1215,7 @@ static int netwave_event(event_t event, int priority,
link->state &= ~DEV_PRESENT; link->state &= ~DEV_PRESENT;
if (link->state & DEV_CONFIG) { if (link->state & DEV_CONFIG) {
netif_device_detach(dev); netif_device_detach(dev);
mod_timer(&link->release, jiffies + HZ/20); netwave_release(link);
} }
break; break;
case CS_EVENT_CARD_INSERTION: case CS_EVENT_CARD_INSERTION:
...@@ -1738,8 +1733,7 @@ static int netwave_close(struct net_device *dev) { ...@@ -1738,8 +1733,7 @@ static int netwave_close(struct net_device *dev) {
link->open--; link->open--;
netif_stop_queue(dev); netif_stop_queue(dev);
if (link->state & DEV_STALE_CONFIG) if (link->state & DEV_STALE_CONFIG)
mod_timer(&link->release, jiffies + HZ/20); netwave_release(link);
return 0; return 0;
} }
......
...@@ -110,7 +110,7 @@ static int orinoco_cs_hard_reset(struct orinoco_private *priv); ...@@ -110,7 +110,7 @@ static int orinoco_cs_hard_reset(struct orinoco_private *priv);
/* PCMCIA gumpf */ /* PCMCIA gumpf */
static void orinoco_cs_config(dev_link_t * link); static void orinoco_cs_config(dev_link_t * link);
static void orinoco_cs_release(u_long arg); static void orinoco_cs_release(dev_link_t * link);
static int orinoco_cs_event(event_t event, int priority, static int orinoco_cs_event(event_t event, int priority,
event_callback_args_t * args); event_callback_args_t * args);
...@@ -202,11 +202,6 @@ orinoco_cs_attach(void) ...@@ -202,11 +202,6 @@ orinoco_cs_attach(void)
link = &card->link; link = &card->link;
link->priv = dev; link->priv = dev;
/* Initialize the dev_link_t structure */
init_timer(&link->release);
link->release.function = &orinoco_cs_release;
link->release.data = (u_long) link;
/* Interrupt setup */ /* Interrupt setup */
link->irq.Attributes = IRQ_TYPE_EXCLUSIVE; link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
link->irq.IRQInfo1 = IRQ_INFO2_VALID | IRQ_LEVEL_ID; link->irq.IRQInfo1 = IRQ_INFO2_VALID | IRQ_LEVEL_ID;
...@@ -272,7 +267,7 @@ orinoco_cs_detach(dev_link_t * link) ...@@ -272,7 +267,7 @@ orinoco_cs_detach(dev_link_t * link)
} }
if (link->state & DEV_CONFIG) { if (link->state & DEV_CONFIG) {
orinoco_cs_release((u_long)link); orinoco_cs_release(link);
if (link->state & DEV_CONFIG) { if (link->state & DEV_CONFIG) {
link->state |= DEV_STALE_LINK; link->state |= DEV_STALE_LINK;
return; return;
...@@ -530,7 +525,7 @@ orinoco_cs_config(dev_link_t *link) ...@@ -530,7 +525,7 @@ orinoco_cs_config(dev_link_t *link)
orinoco_cs_error(link->handle, last_fn, last_ret); orinoco_cs_error(link->handle, last_fn, last_ret);
failed: failed:
orinoco_cs_release((u_long) link); orinoco_cs_release(link);
} /* orinoco_cs_config */ } /* orinoco_cs_config */
/* /*
...@@ -539,9 +534,8 @@ orinoco_cs_config(dev_link_t *link) ...@@ -539,9 +534,8 @@ orinoco_cs_config(dev_link_t *link)
* still open, this will be postponed until it is closed. * still open, this will be postponed until it is closed.
*/ */
static void static void
orinoco_cs_release(u_long arg) orinoco_cs_release(dev_link_t *link)
{ {
dev_link_t *link = (dev_link_t *) arg;
struct net_device *dev = link->priv; struct net_device *dev = link->priv;
struct orinoco_private *priv = dev->priv; struct orinoco_private *priv = dev->priv;
unsigned long flags; unsigned long flags;
...@@ -697,7 +691,7 @@ exit_orinoco_cs(void) ...@@ -697,7 +691,7 @@ exit_orinoco_cs(void)
DEBUG(0, "orinoco_cs: Removing leftover devices.\n"); DEBUG(0, "orinoco_cs: Removing leftover devices.\n");
while (dev_list != NULL) { while (dev_list != NULL) {
if (dev_list->state & DEV_CONFIG) if (dev_list->state & DEV_CONFIG)
orinoco_cs_release((u_long) dev_list); orinoco_cs_release(dev_list);
orinoco_cs_detach(dev_list); orinoco_cs_detach(dev_list);
} }
} }
......
...@@ -94,7 +94,7 @@ MODULE_PARM(pc_debug, "i"); ...@@ -94,7 +94,7 @@ MODULE_PARM(pc_debug, "i");
#endif #endif
/** Prototypes based on PCMCIA skeleton driver *******************************/ /** Prototypes based on PCMCIA skeleton driver *******************************/
static void ray_config(dev_link_t *link); static void ray_config(dev_link_t *link);
static void ray_release(u_long arg); static void ray_release(dev_link_t *link);
static int ray_event(event_t event, int priority, event_callback_args_t *args); static int ray_event(event_t event, int priority, event_callback_args_t *args);
static dev_link_t *ray_attach(void); static dev_link_t *ray_attach(void);
static void ray_detach(dev_link_t *); static void ray_detach(dev_link_t *);
...@@ -374,10 +374,6 @@ static dev_link_t *ray_attach(void) ...@@ -374,10 +374,6 @@ static dev_link_t *ray_attach(void)
memset(dev, 0, sizeof(struct net_device)); memset(dev, 0, sizeof(struct net_device));
memset(local, 0, sizeof(ray_dev_t)); memset(local, 0, sizeof(ray_dev_t));
init_timer(&link->release);
link->release.function = &ray_release;
link->release.data = (u_long)link;
/* The io structure describes IO port mapping. None used here */ /* The io structure describes IO port mapping. None used here */
link->io.NumPorts1 = 0; link->io.NumPorts1 = 0;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
...@@ -482,9 +478,8 @@ static void ray_detach(dev_link_t *link) ...@@ -482,9 +478,8 @@ static void ray_detach(dev_link_t *link)
the release() function is called, that will trigger a proper the release() function is called, that will trigger a proper
detach(). detach().
*/ */
del_timer(&link->release);
if (link->state & DEV_CONFIG) { if (link->state & DEV_CONFIG) {
ray_release((u_long)link); ray_release(link);
if(link->state & DEV_STALE_CONFIG) { if(link->state & DEV_STALE_CONFIG) {
link->state |= DEV_STALE_LINK; link->state |= DEV_STALE_LINK;
return; return;
...@@ -602,14 +597,14 @@ static void ray_config(dev_link_t *link) ...@@ -602,14 +597,14 @@ static void ray_config(dev_link_t *link)
DEBUG(3,"ray_config rmem=%p\n",local->rmem); DEBUG(3,"ray_config rmem=%p\n",local->rmem);
DEBUG(3,"ray_config amem=%p\n",local->amem); DEBUG(3,"ray_config amem=%p\n",local->amem);
if (ray_init(dev) < 0) { if (ray_init(dev) < 0) {
ray_release((u_long)link); ray_release(link);
return; return;
} }
i = register_netdev(dev); i = register_netdev(dev);
if (i != 0) { if (i != 0) {
printk("ray_config register_netdev() failed\n"); printk("ray_config register_netdev() failed\n");
ray_release((u_long)link); ray_release(link);
return; return;
} }
...@@ -627,7 +622,7 @@ static void ray_config(dev_link_t *link) ...@@ -627,7 +622,7 @@ static void ray_config(dev_link_t *link)
cs_failed: cs_failed:
cs_error(link->handle, last_fn, last_ret); cs_error(link->handle, last_fn, last_ret);
ray_release((u_long)link); ray_release(link);
} /* ray_config */ } /* ray_config */
/*===========================================================================*/ /*===========================================================================*/
static int ray_init(struct net_device *dev) static int ray_init(struct net_device *dev)
...@@ -898,9 +893,8 @@ static void join_net(u_long data) ...@@ -898,9 +893,8 @@ static void join_net(u_long data)
device, and release the PCMCIA configuration. If the device is device, and release the PCMCIA configuration. If the device is
still open, this will be postponed until it is closed. still open, this will be postponed until it is closed.
=============================================================================*/ =============================================================================*/
static void ray_release(u_long arg) static void ray_release(dev_link_t *link)
{ {
dev_link_t *link = (dev_link_t *)arg;
struct net_device *dev = link->priv; struct net_device *dev = link->priv;
ray_dev_t *local = dev->priv; ray_dev_t *local = dev->priv;
int i; int i;
...@@ -959,7 +953,7 @@ static int ray_event(event_t event, int priority, ...@@ -959,7 +953,7 @@ static int ray_event(event_t event, int priority,
link->state &= ~DEV_PRESENT; link->state &= ~DEV_PRESENT;
netif_device_detach(dev); netif_device_detach(dev);
if (link->state & DEV_CONFIG) { if (link->state & DEV_CONFIG) {
mod_timer(&link->release, jiffies + HZ/20); ray_release(link);
del_timer(&local->timer); del_timer(&local->timer);
} }
break; break;
...@@ -1769,7 +1763,7 @@ static int ray_dev_close(struct net_device *dev) ...@@ -1769,7 +1763,7 @@ static int ray_dev_close(struct net_device *dev)
link->open--; link->open--;
netif_stop_queue(dev); netif_stop_queue(dev);
if (link->state & DEV_STALE_CONFIG) if (link->state & DEV_STALE_CONFIG)
mod_timer(&link->release, jiffies + HZ/20); ray_release(link);
/* In here, we should stop the hardware (stop card from beeing active) /* In here, we should stop the hardware (stop card from beeing active)
* and set local->card_status to CARD_AWAITING_PARAM, so that while the * and set local->card_status to CARD_AWAITING_PARAM, so that while the
......
...@@ -4128,7 +4128,7 @@ wv_pcmcia_config(dev_link_t * link) ...@@ -4128,7 +4128,7 @@ wv_pcmcia_config(dev_link_t * link)
/* If any step failed, release any partially configured state */ /* If any step failed, release any partially configured state */
if(i != 0) if(i != 0)
{ {
wv_pcmcia_release((u_long) link); wv_pcmcia_release(link);
return FALSE; return FALSE;
} }
...@@ -4148,9 +4148,8 @@ wv_pcmcia_config(dev_link_t * link) ...@@ -4148,9 +4148,8 @@ wv_pcmcia_config(dev_link_t * link)
* still open, this will be postponed until it is closed. * still open, this will be postponed until it is closed.
*/ */
static void static void
wv_pcmcia_release(u_long arg) /* Address of the interface struct */ wv_pcmcia_release(dev_link_t *link)
{ {
dev_link_t * link = (dev_link_t *) arg;
device * dev = (device *) link->priv; device * dev = (device *) link->priv;
#ifdef DEBUG_CONFIG_TRACE #ifdef DEBUG_CONFIG_TRACE
...@@ -4675,7 +4674,7 @@ wavelan_close(device * dev) ...@@ -4675,7 +4674,7 @@ wavelan_close(device * dev)
else else
/* The card is no more there (flag is activated in wv_pcmcia_release) */ /* The card is no more there (flag is activated in wv_pcmcia_release) */
if(link->state & DEV_STALE_CONFIG) if(link->state & DEV_STALE_CONFIG)
wv_pcmcia_release((u_long)link); wv_pcmcia_release(link);
#ifdef DEBUG_CALLBACK_TRACE #ifdef DEBUG_CALLBACK_TRACE
printk(KERN_DEBUG "%s: <-wavelan_close()\n", dev->name); printk(KERN_DEBUG "%s: <-wavelan_close()\n", dev->name);
...@@ -4714,10 +4713,6 @@ wavelan_attach(void) ...@@ -4714,10 +4713,6 @@ wavelan_attach(void)
if (!link) return NULL; if (!link) return NULL;
memset(link, 0, sizeof(struct dev_link_t)); memset(link, 0, sizeof(struct dev_link_t));
/* Unused for the Wavelan */
link->release.function = &wv_pcmcia_release;
link->release.data = (u_long) link;
/* The io structure describes IO port mapping */ /* The io structure describes IO port mapping */
link->io.NumPorts1 = 8; link->io.NumPorts1 = 8;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
...@@ -4857,7 +4852,7 @@ wavelan_detach(dev_link_t * link) ...@@ -4857,7 +4852,7 @@ wavelan_detach(dev_link_t * link)
if(link->state & DEV_CONFIG) if(link->state & DEV_CONFIG)
{ {
/* Some others haven't done their job : give them another chance */ /* Some others haven't done their job : give them another chance */
wv_pcmcia_release((u_long) link); wv_pcmcia_release(link);
if(link->state & DEV_STALE_CONFIG) if(link->state & DEV_STALE_CONFIG)
{ {
#ifdef DEBUG_CONFIG_INFO #ifdef DEBUG_CONFIG_INFO
...@@ -4965,7 +4960,7 @@ wavelan_event(event_t event, /* The event received */ ...@@ -4965,7 +4960,7 @@ wavelan_event(event_t event, /* The event received */
netif_device_detach(dev); netif_device_detach(dev);
/* Release the card */ /* Release the card */
wv_pcmcia_release((u_long) link); wv_pcmcia_release(link);
} }
break; break;
......
...@@ -761,7 +761,7 @@ static inline void ...@@ -761,7 +761,7 @@ static inline void
static inline int static inline int
wv_pcmcia_config(dev_link_t *); /* Configure the pcmcia interface */ wv_pcmcia_config(dev_link_t *); /* Configure the pcmcia interface */
static void static void
wv_pcmcia_release(u_long), /* Remove a device */ wv_pcmcia_release(dev_link_t *),/* Remove a device */
wv_flush_stale_links(void); /* "detach" all possible devices */ wv_flush_stale_links(void); /* "detach" all possible devices */
/* ---------------------- INTERRUPT HANDLING ---------------------- */ /* ---------------------- INTERRUPT HANDLING ---------------------- */
static irqreturn_t static irqreturn_t
......
...@@ -45,7 +45,6 @@ ...@@ -45,7 +45,6 @@
#include <linux/skbuff.h> #include <linux/skbuff.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/timer.h>
#include <linux/wireless.h> #include <linux/wireless.h>
#include <net/iw_handler.h> #include <net/iw_handler.h>
...@@ -112,7 +111,7 @@ static int wl3501_irq_list[4] = { -1 }; ...@@ -112,7 +111,7 @@ static int wl3501_irq_list[4] = { -1 };
* are invoked from the wl24 event handler. * are invoked from the wl24 event handler.
*/ */
static void wl3501_config(dev_link_t *link); static void wl3501_config(dev_link_t *link);
static void wl3501_release(unsigned long arg); static void wl3501_release(dev_link_t *link);
static int wl3501_event(event_t event, int pri, event_callback_args_t *args); static int wl3501_event(event_t event, int pri, event_callback_args_t *args);
/* /*
...@@ -1298,9 +1297,8 @@ static int wl3501_close(struct net_device *dev) ...@@ -1298,9 +1297,8 @@ static int wl3501_close(struct net_device *dev)
wl3501_block_interrupt(this); wl3501_block_interrupt(this);
if (link->state & DEV_STALE_CONFIG) { if (link->state & DEV_STALE_CONFIG) {
link->release.expires = jiffies + WL3501_RELEASE_TIMEOUT;
link->state |= DEV_RELEASE_PENDING; link->state |= DEV_RELEASE_PENDING;
add_timer(&link->release); wl3501_release(link);
} }
rc = 0; rc = 0;
printk(KERN_INFO "%s: WL3501 closed\n", dev->name); printk(KERN_INFO "%s: WL3501 closed\n", dev->name);
...@@ -2042,9 +2040,6 @@ static dev_link_t *wl3501_attach(void) ...@@ -2042,9 +2040,6 @@ static dev_link_t *wl3501_attach(void)
if (!link) if (!link)
goto out; goto out;
memset(link, 0, sizeof(struct dev_link_t)); memset(link, 0, sizeof(struct dev_link_t));
init_timer(&link->release);
link->release.function = wl3501_release;
link->release.data = (unsigned long)link;
/* The io structure describes IO port mapping */ /* The io structure describes IO port mapping */
link->io.NumPorts1 = 16; link->io.NumPorts1 = 16;
...@@ -2230,7 +2225,7 @@ static void wl3501_config(dev_link_t *link) ...@@ -2230,7 +2225,7 @@ static void wl3501_config(dev_link_t *link)
cs_failed: cs_failed:
cs_error(link->handle, last_fn, last_ret); cs_error(link->handle, last_fn, last_ret);
failed: failed:
wl3501_release((unsigned long)link); wl3501_release(link);
out: out:
return; return;
} }
...@@ -2243,9 +2238,8 @@ static void wl3501_config(dev_link_t *link) ...@@ -2243,9 +2238,8 @@ static void wl3501_config(dev_link_t *link)
* and release the PCMCIA configuration. If the device is still open, this * and release the PCMCIA configuration. If the device is still open, this
* will be postponed until it is closed. * will be postponed until it is closed.
*/ */
static void wl3501_release(unsigned long arg) static void wl3501_release(dev_link_t *link)
{ {
dev_link_t *link = (dev_link_t *)arg;
struct net_device *dev = link->priv; struct net_device *dev = link->priv;
/* If the device is currently in use, we won't release until it is /* If the device is currently in use, we won't release until it is
...@@ -2301,9 +2295,7 @@ static int wl3501_event(event_t event, int pri, event_callback_args_t *args) ...@@ -2301,9 +2295,7 @@ static int wl3501_event(event_t event, int pri, event_callback_args_t *args)
while (link->open > 0) while (link->open > 0)
wl3501_close(dev); wl3501_close(dev);
netif_device_detach(dev); netif_device_detach(dev);
link->release.expires = jiffies + wl3501_release(link);
WL3501_RELEASE_TIMEOUT;
add_timer(&link->release);
} }
break; break;
case CS_EVENT_CARD_INSERTION: case CS_EVENT_CARD_INSERTION:
...@@ -2370,11 +2362,10 @@ static void __exit wl3501_exit_module(void) ...@@ -2370,11 +2362,10 @@ static void __exit wl3501_exit_module(void)
dprintk(0, ": unloading"); dprintk(0, ": unloading");
pcmcia_unregister_driver(&wl3501_driver); pcmcia_unregister_driver(&wl3501_driver);
while (wl3501_dev_list) { while (wl3501_dev_list) {
del_timer(&wl3501_dev_list->release);
/* Mark the device as non-existing to minimize calls to card */ /* Mark the device as non-existing to minimize calls to card */
wl3501_dev_list->state &= ~DEV_PRESENT; wl3501_dev_list->state &= ~DEV_PRESENT;
if (wl3501_dev_list->state & DEV_CONFIG) if (wl3501_dev_list->state & DEV_CONFIG)
wl3501_release((unsigned long)wl3501_dev_list); wl3501_release(wl3501_dev_list);
wl3501_detach(wl3501_dev_list); wl3501_detach(wl3501_dev_list);
} }
} }
......
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