static int prism2_cs_suspend(struct pcmcia_device *pdev) { struct wlandevice *wlandev; #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17) dev_link_t *link = dev_to_instance(pdev); #endif DBFENTER; #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,16) wlandev = pdev->priv; prism2sta_ifstate(wlandev, P80211ENUM_ifstate_disable); #else wlandev = link->priv; link->state |= DEV_SUSPEND; if (link->state & DEV_CONFIG) { prism2sta_ifstate(wlandev, P80211ENUM_ifstate_disable); pcmcia_release_configuration(link->handle); } #endif DBFEXIT; return 0; }
static int prism2_cs_resume(struct pcmcia_device *pdev) { struct wlandevice *wlandev; #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17) dev_link_t *link = dev_to_instance(pdev); #endif DBFENTER; #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,16) wlandev = pdev->priv; // XXX do something here? #else wlandev = link->priv; link->state &= ~DEV_SUSPEND; if (link->state & DEV_CONFIG) { pcmcia_request_configuration(link->handle, &link->conf); // XXX do something here? } #endif DBFEXIT; return 0; }
static int ixj_suspend(struct pcmcia_device *dev) { dev_link_t *link = dev_to_instance(dev); link->state |= DEV_SUSPEND; if (link->state & DEV_CONFIG) pcmcia_release_configuration(link->handle); return 0; }
static int ixj_resume(struct pcmcia_device *dev) { dev_link_t *link = dev_to_instance(dev); link->state &= ~DEV_SUSPEND; if (DEV_OK(link)) pcmcia_request_configuration(link->handle, &link->conf); return 0; }
static void prism2_cs_remove(struct pcmcia_device *pdev) { struct wlandevice *wlandev; #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17) dev_link_t *link = dev_to_instance(pdev); #endif DBFENTER; #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,16) wlandev = pdev->priv; #else wlandev = link->priv; #endif if (wlandev) { p80211netdev_hwremoved(wlandev); unregister_wlandev(wlandev); wlan_unsetup(wlandev); if (wlandev->priv) { hfa384x_t *hw = wlandev->priv; wlandev->priv = NULL; if (hw) { hfa384x_destroy(hw); kfree(hw); } } kfree(wlandev); } #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,16) pdev->priv = NULL; pcmcia_disable_device(pdev); #else if (link->state & DEV_CONFIG) { if (link->win) pcmcia_release_window(link->win); pcmcia_release_configuration(link->handle); if (link->io.NumPorts1) pcmcia_release_io(link->handle, &link->io); if (link->irq.AssignedIRQ) pcmcia_release_irq(link->handle, &link->irq); link->state &= ~DEV_CONFIG; } link->priv = NULL; kfree(link); #endif DBFEXIT; return; }
static void fdomain_detach(struct pcmcia_device *p_dev) { dev_link_t *link = dev_to_instance(p_dev); DEBUG(0, "fdomain_detach(0x%p)\n", link); if (link->state & DEV_CONFIG) fdomain_release(link); kfree(link->priv); } /* fdomain_detach */
static int elsa_suspend(struct pcmcia_device *p_dev) { dev_link_t *link = dev_to_instance(p_dev); local_info_t *dev = link->priv; link->state |= DEV_SUSPEND; dev->busy = 1; if (link->state & DEV_CONFIG) pcmcia_release_configuration(link->handle); return 0; }
static int elsa_resume(struct pcmcia_device *p_dev) { dev_link_t *link = dev_to_instance(p_dev); local_info_t *dev = link->priv; link->state &= ~DEV_SUSPEND; if (link->state & DEV_CONFIG) pcmcia_request_configuration(link->handle, &link->conf); dev->busy = 0; return 0; }
static int fdomain_resume(struct pcmcia_device *dev) { dev_link_t *link = dev_to_instance(dev); link->state &= ~DEV_SUSPEND; if (link->state & DEV_CONFIG) { pcmcia_request_configuration(link->handle, &link->conf); fdomain_16x0_bus_reset(NULL); } return 0; }
/* * snd_pdacf_detach - detach callback for cs */ static void snd_pdacf_detach(struct pcmcia_device *p_dev) { dev_link_t *link = dev_to_instance(p_dev); struct snd_pdacf *chip = link->priv; snd_printdd(KERN_DEBUG "pdacf_detach called\n"); if (chip->chip_status & PDAUDIOCF_STAT_IS_CONFIGURED) snd_pdacf_powerdown(chip); chip->chip_status |= PDAUDIOCF_STAT_IS_STALE; /* to be sure */ snd_card_disconnect(chip->card); snd_card_free_when_closed(chip->card); }
static void ixj_detach(struct pcmcia_device *p_dev) { dev_link_t *link = dev_to_instance(p_dev); DEBUG(0, "ixj_detach(0x%p)\n", link); link->state &= ~DEV_RELEASE_PENDING; if (link->state & DEV_CONFIG) ixj_cs_release(link); kfree(link->priv); kfree(link); }
static int nmclan_suspend(struct pcmcia_device *p_dev) { dev_link_t *link = dev_to_instance(p_dev); struct net_device *dev = link->priv; link->state |= DEV_SUSPEND; if (link->state & DEV_CONFIG) { if (link->open) netif_device_detach(dev); pcmcia_release_configuration(link->handle); } return 0; }
static void elsa_cs_detach(struct pcmcia_device *p_dev) { dev_link_t *link = dev_to_instance(p_dev); local_info_t *info = link->priv; DEBUG(0, "elsa_cs_detach(0x%p)\n", link); if (link->state & DEV_CONFIG) { info->busy = 1; elsa_cs_release(link); } kfree(info); } /* elsa_cs_detach */
static void nmclan_detach(struct pcmcia_device *p_dev) { dev_link_t *link = dev_to_instance(p_dev); struct net_device *dev = link->priv; DEBUG(0, "nmclan_detach(0x%p)\n", link); if (link->dev) unregister_netdev(dev); if (link->state & DEV_CONFIG) nmclan_release(link); free_netdev(dev); } /* nmclan_detach */
static int nmclan_resume(struct pcmcia_device *p_dev) { dev_link_t *link = dev_to_instance(p_dev); struct net_device *dev = link->priv; link->state &= ~DEV_SUSPEND; if (link->state & DEV_CONFIG) { pcmcia_request_configuration(link->handle, &link->conf); if (link->open) { nmclan_reset(dev); netif_device_attach(dev); } } return 0; }
static int vxp_suspend(struct pcmcia_device *dev) { dev_link_t *link = dev_to_instance(dev); struct vx_core *chip = link->priv; snd_printdd(KERN_DEBUG "SUSPEND\n"); link->state |= DEV_SUSPEND; if (chip) { snd_printdd(KERN_DEBUG "snd_vx_suspend calling\n"); snd_vx_suspend(chip); } snd_printdd(KERN_DEBUG "RESET_PHYSICAL\n"); if (link->state & DEV_CONFIG) pcmcia_release_configuration(link->handle); return 0; }
static void vxpocket_detach(struct pcmcia_device *p_dev) { dev_link_t *link = dev_to_instance(p_dev); struct snd_vxpocket *vxp; struct vx_core *chip; if (! link) return; vxp = link->priv; chip = (struct vx_core *)vxp; card_alloc &= ~(1 << vxp->index); chip->chip_status |= VX_STAT_IS_STALE; /* to be sure */ snd_card_disconnect(chip->card); vxpocket_release(link); snd_card_free_when_closed(chip->card); }
static int serial_suspend(struct pcmcia_device *dev) { dev_link_t *link = dev_to_instance(dev); link->state |= DEV_SUSPEND; if (link->state & DEV_CONFIG) { struct serial_info *info = link->priv; int i; for (i = 0; i < info->ndev; i++) serial8250_suspend_port(info->line[i]); if (!info->slave) pcmcia_release_configuration(link->handle); } return 0; }
static int serial_resume(struct pcmcia_device *dev) { dev_link_t *link = dev_to_instance(dev); link->state &= ~DEV_SUSPEND; if (DEV_OK(link)) { struct serial_info *info = link->priv; int i; if (!info->slave) pcmcia_request_configuration(link->handle, &link->conf); for (i = 0; i < info->ndev; i++) serial8250_resume_port(info->line[i]); } return 0; }
static void serial_detach(struct pcmcia_device *p_dev) { dev_link_t *link = dev_to_instance(p_dev); struct serial_info *info = link->priv; DEBUG(0, "serial_detach(0x%p)\n", link); /* * Ensure any outstanding scheduled tasks are completed. */ flush_scheduled_work(); /* * Ensure that the ports have been released. */ serial_remove(link); /* free bits */ kfree(info); }
static int pdacf_resume(struct pcmcia_device *dev) { dev_link_t *link = dev_to_instance(dev); struct snd_pdacf *chip = link->priv; snd_printdd(KERN_DEBUG "RESUME\n"); link->state &= ~DEV_SUSPEND; snd_printdd(KERN_DEBUG "CARD_RESET\n"); if (DEV_OK(link)) { snd_printdd(KERN_DEBUG "requestconfig...\n"); pcmcia_request_configuration(link->handle, &link->conf); if (chip) { snd_printdd(KERN_DEBUG "calling snd_pdacf_resume\n"); snd_pdacf_resume(chip); } } snd_printdd(KERN_DEBUG "resume done!\n"); return 0; }