static int tc589_resume(struct pcmcia_device *link) { struct net_device *dev = link->priv; if (link->open) { tc589_reset(dev); netif_device_attach(dev); } return 0; }
static int tc589_event(event_t event, int priority, event_callback_args_t *args) { dev_link_t *link = args->client_data; struct el3_private *lp = link->priv; struct net_device *dev = &lp->dev; DEBUG(1, "3c589_event(0x%06x)\n", event); switch (event) { case CS_EVENT_CARD_REMOVAL: link->state &= ~DEV_PRESENT; if (link->state & DEV_CONFIG) { netif_device_detach(dev); mod_timer(&link->release, jiffies + HZ/20); } break; case CS_EVENT_CARD_INSERTION: link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; tc589_config(link); break; case CS_EVENT_PM_SUSPEND: link->state |= DEV_SUSPEND; /* Fall through... */ case CS_EVENT_RESET_PHYSICAL: if (link->state & DEV_CONFIG) { if (link->open) netif_device_detach(dev); CardServices(ReleaseConfiguration, link->handle); } break; case CS_EVENT_PM_RESUME: link->state &= ~DEV_SUSPEND; /* Fall through... */ case CS_EVENT_CARD_RESET: if (link->state & DEV_CONFIG) { CardServices(RequestConfiguration, link->handle, &link->conf); if (link->open) { tc589_reset(dev); netif_device_attach(dev); } } break; } return 0; } /* tc589_event */
static int el3_open(struct net_device *dev) { struct el3_private *lp = netdev_priv(dev); struct pcmcia_device *link = lp->p_dev; if (!pcmcia_dev_present(link)) return -ENODEV; link->open++; netif_start_queue(dev); tc589_reset(dev); setup_timer(&lp->media, media_check, (unsigned long)dev); mod_timer(&lp->media, jiffies + HZ); dev_dbg(&link->dev, "%s: opened, status %4.4x.\n", dev->name, inw(dev->base_addr + EL3_STATUS)); return 0; }
static int el3_open(struct net_device *dev) { struct el3_private *lp = netdev_priv(dev); struct pcmcia_device *link = lp->p_dev; if (!pcmcia_dev_present(link)) return -ENODEV; link->open++; netif_start_queue(dev); tc589_reset(dev); init_timer(&lp->media); lp->media.function = &media_check; lp->media.data = (unsigned long) dev; lp->media.expires = jiffies + HZ; add_timer(&lp->media); DEBUG(1, "%s: opened, status %4.4x.\n", dev->name, inw(dev->base_addr + EL3_STATUS)); return 0; }
static int el3_open(struct net_device *dev) { struct el3_private *lp = (struct el3_private *)dev->priv; dev_link_t *link = &lp->link; if (!DEV_OK(link)) return -ENODEV; link->open++; MOD_INC_USE_COUNT; netif_start_queue(dev); tc589_reset(dev); lp->media.function = &media_check; lp->media.data = (u_long)lp; lp->media.expires = jiffies + HZ; add_timer(&lp->media); DEBUG(1, "%s: opened, status %4.4x.\n", dev->name, inw(dev->base_addr + EL3_STATUS)); return 0; }