static int __devexit sunximmc_remove(struct platform_device *pdev) { struct mmc_host *mmc = platform_get_drvdata(pdev); struct sunxi_mmc_host *smc_host = mmc_priv(mmc); SMC_MSG("%s: Remove.\n", dev_name(&pdev->dev)); sdxc_exit(smc_host); sunximmc_shutdown(pdev); //dma tasklet_disable(&smc_host->tasklet); //irq free_irq(smc_host->irq, smc_host); if (smc_host->cd_mode == CARD_DETECT_BY_GPIO) { del_timer(&smc_host->cd_timer); } sunximmc_resource_release(smc_host); mmc_free_host(mmc); sw_host[pdev->id] = NULL; return 0; }
/** * poison_channel - poison buffers of a channel * @iface: pointer to the interface the channel to be poisoned belongs to * @channel_id: corresponding channel ID * * Destroy a channel and complete all the buffers in both started_list & * pending_list. Return 0 on success, negative on failure. */ static int poison_channel(struct most_interface *most_iface, int ch_idx) { struct dim2_hdm *dev = iface_to_hdm(most_iface); struct hdm_channel *hdm_ch = dev->hch + ch_idx; unsigned long flags; u8 hal_ret; int ret = 0; BUG_ON(ch_idx < 0 || ch_idx >= DMA_CHANNELS); if (!hdm_ch->is_initialized) return -EPERM; tasklet_disable(&dim2_tasklet); spin_lock_irqsave(&dim_lock, flags); hal_ret = dim_destroy_channel(&hdm_ch->ch); hdm_ch->is_initialized = false; if (ch_idx == dev->atx_idx) dev->atx_idx = -1; spin_unlock_irqrestore(&dim_lock, flags); tasklet_enable(&dim2_tasklet); if (hal_ret != DIM_NO_ERROR) { pr_err("HAL Failed to close channel %s\n", hdm_ch->name); ret = -EFAULT; } complete_all_mbos(&hdm_ch->started_list); complete_all_mbos(&hdm_ch->pending_list); return ret; }
static void hci_cc_read_voice_setting(struct hci_dev *hdev, struct sk_buff *skb) { struct hci_rp_read_voice_setting *rp = (void *) skb->data; __u16 setting; BT_DBG("%s status 0x%x", hdev->name, rp->status); if (rp->status) return; setting = __le16_to_cpu(rp->voice_setting); if (hdev->voice_setting == setting) return; hdev->voice_setting = setting; BT_DBG("%s voice setting 0x%04x", hdev->name, setting); if (hdev->notify) { tasklet_disable(&hdev->tx_task); hdev->notify(hdev, HCI_NOTIFY_VOICE_SETTING); tasklet_enable(&hdev->tx_task); } }
static void mt7603_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_bss_conf *info, u32 changed) { struct mt7603_dev *dev = hw->priv; struct mt7603_vif *mvif = (struct mt7603_vif *) vif->drv_priv; mutex_lock(&dev->mutex); if (changed & BSS_CHANGED_ASSOC) { mt76_wr(dev, MT_BSSID0(mvif->idx), get_unaligned_le32(info->bssid)); mt76_wr(dev, MT_BSSID1(mvif->idx), get_unaligned_le16(info->bssid + 4)); } if (changed & BSS_CHANGED_ERP_SLOT) { dev->slottime = info->use_short_slot ? 9 : 20; mt7603_mac_set_timing(dev); } if (changed & (BSS_CHANGED_BEACON_ENABLED | BSS_CHANGED_BEACON_INT)) { int beacon_int = !!info->enable_beacon * info->beacon_int; tasklet_disable(&dev->pre_tbtt_tasklet); mt7603_beacon_set_timer(dev, mvif->idx, beacon_int); tasklet_enable(&dev->pre_tbtt_tasklet); } mutex_unlock(&dev->mutex); }
static int imxmci_remove(struct platform_device *pdev) { struct mmc_host *mmc = platform_get_drvdata(pdev); platform_set_drvdata(pdev, NULL); if (mmc) { struct imxmci_host *host = mmc_priv(mmc); tasklet_disable(&host->tasklet); del_timer_sync(&host->timer); mmc_remove_host(mmc); free_irq(host->irq, host); if(host->dma_allocated){ imx_dma_free(host->dma); host->dma_allocated=0; } tasklet_kill(&host->tasklet); release_resource(host->res); mmc_free_host(mmc); } return 0; }
static void hci_cc_write_voice_setting(struct hci_dev *hdev, struct sk_buff *skb) { __u8 status = *((__u8 *) skb->data); __u16 setting; void *sent; BT_DBG("%s status 0x%x", hdev->name, status); if (status) return; sent = hci_sent_cmd_data(hdev, HCI_OP_WRITE_VOICE_SETTING); if (!sent) return; setting = get_unaligned_le16(sent); if (hdev->voice_setting == setting) return; hdev->voice_setting = setting; BT_DBG("%s voice setting 0x%04x", hdev->name, setting); if (hdev->notify) { tasklet_disable(&hdev->tx_task); hdev->notify(hdev, HCI_NOTIFY_VOICE_SETTING); tasklet_enable(&hdev->tx_task); } }
static void adf_cleanup_bh(struct adf_accel_dev *accel_dev) { struct adf_etr_data *priv_data = accel_dev->transport; tasklet_disable(&priv_data->banks[0].resp_handler); tasklet_kill(&priv_data->banks[0].resp_handler); }
int zd_mac_stop(struct net_device *netdev) { struct zd_mac *mac = zd_netdev_mac(netdev); struct zd_chip *chip = &mac->chip; netif_stop_queue(netdev); /* * The order here deliberately is a little different from the open() * method, since we need to make sure there is no opportunity for RX * frames to be processed by softmac after we have stopped it. */ zd_chip_disable_rx(chip); skb_queue_purge(&mac->rx_queue); tasklet_disable(&mac->rx_tasklet); housekeeping_disable(mac); ieee80211softmac_stop(netdev); /* Ensure no work items are running or queued from this point */ cancel_delayed_work(&mac->set_rts_cts_work); cancel_delayed_work(&mac->set_basic_rates_work); flush_workqueue(zd_workqueue); mac->updating_rts_rate = 0; mac->updating_basic_rates = 0; zd_chip_disable_hwint(chip); zd_chip_switch_radio_off(chip); zd_chip_disable_int(chip); return 0; }
static void acm_port_down(struct acm *acm, int drain) { int i, nr = acm->rx_buflimit; mutex_lock(&open_mutex); if (acm->dev) { usb_autopm_get_interface(acm->control); acm_set_control(acm, acm->ctrlout = 0); /* try letting the last writes drain naturally */ if (drain) { wait_event_interruptible_timeout(acm->drain_wait, (ACM_NW == acm_wb_is_avail(acm)) || !acm->dev, ACM_CLOSE_TIMEOUT * HZ); } usb_kill_urb(acm->ctrlurb); for (i = 0; i < ACM_NW; i++) usb_kill_urb(acm->wb[i].urb); tasklet_disable(&acm->urb_task); for (i = 0; i < nr; i++) usb_kill_urb(acm->ru[i].urb); tasklet_enable(&acm->urb_task); acm->control->needs_remote_wakeup = 0; usb_autopm_put_interface(acm->control); } mutex_unlock(&open_mutex); }
static void mt76x2_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_bss_conf *info, u32 changed) { struct mt76x2_dev *dev = hw->priv; struct mt76x2_vif *mvif = (struct mt76x2_vif *) vif->drv_priv; mutex_lock(&dev->mutex); if (changed & BSS_CHANGED_BSSID) mt76x2_mac_set_bssid(dev, mvif->idx, info->bssid); if (changed & BSS_CHANGED_BEACON_INT) mt76_rmw_field(dev, MT_BEACON_TIME_CFG, MT_BEACON_TIME_CFG_INTVAL, info->beacon_int << 4); if (changed & BSS_CHANGED_BEACON_ENABLED) { tasklet_disable(&dev->pre_tbtt_tasklet); mt76x2_mac_set_beacon_enable(dev, mvif->idx, info->enable_beacon); tasklet_enable(&dev->pre_tbtt_tasklet); } if (changed & BSS_CHANGED_ERP_SLOT) { int slottime = info->use_short_slot ? 9 : 20; dev->slottime = slottime; mt76x2_set_tx_ackto(dev); } mutex_unlock(&dev->mutex); }
void ath9k_beacon_remove_slot(struct ath_softc *sc, struct ieee80211_vif *vif) { struct ath_common *common = ath9k_hw_common(sc->sc_ah); struct ath_vif *avp = (void *)vif->drv_priv; struct ath_buf *bf = avp->av_bcbuf; ath_dbg(common, CONFIG, "Removing interface at beacon slot: %d\n", avp->av_bslot); tasklet_disable(&sc->bcon_tasklet); if (bf && bf->bf_mpdu) { struct sk_buff *skb = bf->bf_mpdu; dma_unmap_single(sc->dev, bf->bf_buf_addr, skb->len, DMA_TO_DEVICE); dev_kfree_skb_any(skb); bf->bf_mpdu = NULL; bf->bf_buf_addr = 0; } avp->av_bcbuf = NULL; sc->beacon.bslot[avp->av_bslot] = NULL; sc->nbcnvifs--; list_add_tail(&bf->list, &sc->beacon.bbuf); tasklet_enable(&sc->bcon_tasklet); }
/** gpsdrv_release Function * This function will un-registers from the ST driver. * * Parameters : * @file : File pointer for GPS char driver * @inod : * Returns GPS_SUCCESS - on success * else suitable error code */ int gpsdrv_release(struct inode *inod, struct file *file) { struct gpsdrv_data *hgps = file->private_data; GPSDRV_DBG(" Inside %s", __func__); /* Disabling task-let 1st & then un-reg to avoid * tasklet getting scheduled */ tasklet_disable(&hgps->gpsdrv_tx_tsklet); tasklet_kill(&hgps->gpsdrv_tx_tsklet); /* Cleat registered bit if already registered */ if (test_and_clear_bit(GPS_ST_REGISTERED, &hgps->state)) { if (st_unregister(&gpsdrv_proto) < 0) { GPSDRV_ERR(" st_unregister failed"); /* Re-Enable the task-let if un-register fails */ tasklet_enable(&hgps->gpsdrv_tx_tsklet); return GPS_ERR_FAILURE; } } /* Reset Tx count value and st_write function pointer */ hgps->tx_count = 0; hgps->st_write = NULL; clear_bit(GPS_ST_RUNNING, &hgps->state); GPSDRV_VER(" st_unregister success"); skb_queue_purge(&hgps->rx_list); skb_queue_purge(&hgps->tx_list); kfree(hgps); file->private_data = NULL; return GPS_SUCCESS; }
static int mantis_dvb_stop_feed(struct dvb_demux_feed *dvbdmxfeed) { struct dvb_demux *dvbdmx = dvbdmxfeed->demux; struct mantis_pci *mantis = dvbdmx->priv; #ifdef CONFIG_DEBUG_PRINTK dprintk(MANTIS_DEBUG, 1, "Mantis DVB Stop feed"); #else d; #endif if (!dvbdmx->dmx.frontend) { #ifdef CONFIG_DEBUG_PRINTK dprintk(MANTIS_DEBUG, 1, "no frontend ?"); #else d; #endif return -EINVAL; } mantis->feeds--; if (mantis->feeds == 0) { #ifdef CONFIG_DEBUG_PRINTK dprintk(MANTIS_DEBUG, 1, "mantis stop feed and dma"); #else d; #endif tasklet_disable(&mantis->tasklet); mantis_dma_stop(mantis); } return 0; }
static int __devexit omap_kp_remove(struct platform_device *pdev) { struct omap_kp *omap_kp = platform_get_drvdata(pdev); /* disable keypad interrupt handling */ tasklet_disable(&kp_tasklet); if (cpu_is_omap24xx()) { int i; for (i = 0; i < omap_kp->cols; i++) gpio_free(col_gpios[i]); for (i = 0; i < omap_kp->rows; i++) { gpio_free(row_gpios[i]); free_irq(gpio_to_irq(row_gpios[i]), 0); } } else { omap_writew(1, OMAP_MPUIO_BASE + OMAP_MPUIO_KBD_MASKIT); free_irq(omap_kp->irq, 0); } del_timer_sync(&omap_kp->timer); tasklet_kill(&kp_tasklet); /* unregister everything */ input_unregister_device(omap_kp->input); kfree(omap_kp); return 0; }
void bnxt_qplib_disable_rcfw_channel(struct bnxt_qplib_rcfw *rcfw) { unsigned long indx; /* Make sure the HW channel is stopped! */ synchronize_irq(rcfw->vector); tasklet_disable(&rcfw->worker); tasklet_kill(&rcfw->worker); if (rcfw->requested) { free_irq(rcfw->vector, rcfw); rcfw->requested = false; } if (rcfw->cmdq_bar_reg_iomem) iounmap(rcfw->cmdq_bar_reg_iomem); rcfw->cmdq_bar_reg_iomem = NULL; if (rcfw->creq_bar_reg_iomem) iounmap(rcfw->creq_bar_reg_iomem); rcfw->creq_bar_reg_iomem = NULL; indx = find_first_bit(rcfw->cmdq_bitmap, rcfw->bmap_size); if (indx != rcfw->bmap_size) dev_err(&rcfw->pdev->dev, "QPLIB: disabling RCFW with pending cmd-bit %lx", indx); kfree(rcfw->cmdq_bitmap); rcfw->bmap_size = 0; rcfw->aeq_handler = NULL; rcfw->vector = 0; }
static void acm_disconnect(struct usb_interface *intf) { struct acm *acm = usb_get_intfdata(intf); struct usb_device *usb_dev = interface_to_usbdev(intf); int i; if (!acm || !acm->dev) { dbg("disconnect on nonexisting interface"); return; } mutex_lock(&open_mutex); if (!usb_get_intfdata(intf)) { mutex_unlock(&open_mutex); return; } if (acm->country_codes){ device_remove_file(&acm->control->dev, &dev_attr_wCountryCodes); device_remove_file(&acm->control->dev, &dev_attr_iCountryCodeRelDate); } device_remove_file(&acm->control->dev, &dev_attr_bmCapabilities); acm->dev = NULL; usb_set_intfdata(acm->control, NULL); usb_set_intfdata(acm->data, NULL); tasklet_disable(&acm->urb_task); usb_kill_urb(acm->ctrlurb); usb_kill_urb(acm->writeurb); for (i = 0; i < acm->rx_buflimit; i++) usb_kill_urb(acm->ru[i].urb); INIT_LIST_HEAD(&acm->filled_read_bufs); INIT_LIST_HEAD(&acm->spare_read_bufs); tasklet_enable(&acm->urb_task); flush_scheduled_work(); /* wait for acm_softint */ acm_write_buffers_free(acm); usb_buffer_free(usb_dev, acm->ctrlsize, acm->ctrl_buffer, acm->ctrl_dma); for (i = 0; i < acm->rx_buflimit; i++) usb_buffer_free(usb_dev, acm->readsize, acm->rb[i].base, acm->rb[i].dma); usb_driver_release_interface(&acm_driver, intf == acm->control ? acm->data : intf); if (!acm->used) { acm_tty_unregister(acm); mutex_unlock(&open_mutex); return; } mutex_unlock(&open_mutex); if (acm->tty) tty_hangup(acm->tty); }
static int mwl_mac80211_start(struct ieee80211_hw *hw) { struct mwl_priv *priv = hw->priv; int rc; /* Enable TX reclaim and RX tasklets. */ tasklet_enable(&priv->tx_task); tasklet_enable(&priv->rx_task); tasklet_enable(&priv->qe_task); /* Enable interrupts */ mwl_fwcmd_int_enable(hw); rc = mwl_fwcmd_radio_enable(hw); if (rc) goto fwcmd_fail; rc = mwl_fwcmd_set_rate_adapt_mode(hw, 0); if (rc) goto fwcmd_fail; rc = mwl_fwcmd_set_wmm_mode(hw, true); if (rc) goto fwcmd_fail; rc = mwl_fwcmd_ht_guard_interval(hw, GUARD_INTERVAL_AUTO); if (rc) goto fwcmd_fail; rc = mwl_fwcmd_set_dwds_stamode(hw, true); if (rc) goto fwcmd_fail; rc = mwl_fwcmd_set_fw_flush_timer(hw, SYSADPT_AMSDU_FLUSH_TIME); if (rc) goto fwcmd_fail; rc = mwl_fwcmd_set_optimization_level(hw, 1); if (rc) goto fwcmd_fail; ieee80211_wake_queues(hw); return 0; fwcmd_fail: mwl_fwcmd_int_disable(hw); tasklet_disable(&priv->tx_task); tasklet_disable(&priv->rx_task); tasklet_disable(&priv->qe_task); return rc; }
static void mt76_sw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif, const u8 *mac) { struct mt76_dev *dev = hw->priv; tasklet_disable(&dev->pre_tbtt_tasklet); set_bit(MT76_SCANNING, &dev->state); }
void mt76x02_sw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif, const u8 *mac) { struct mt76x02_dev *dev = hw->priv; if (mt76_is_mmio(dev)) tasklet_disable(&dev->pre_tbtt_tasklet); set_bit(MT76_SCANNING, &dev->mt76.state); }
static void mwl_mac80211_stop(struct ieee80211_hw *hw) { struct mwl_priv *priv = hw->priv; mwl_fwcmd_radio_disable(hw); ieee80211_stop_queues(hw); /* Disable interrupts */ mwl_fwcmd_int_disable(hw); /* Disable TX reclaim and RX tasklets. */ tasklet_disable(&priv->tx_task); tasklet_disable(&priv->rx_task); tasklet_disable(&priv->qe_task); /* Return all skbs to mac80211 */ mwl_tx_done((unsigned long)hw); }
/** * void bcm_disable_reentrancy(void); */ void bcm_disable_reentrancy(void) { preempt_disable(); local_irq_disable(); if (intr_tasklet_ptr_g) tasklet_disable(intr_tasklet_ptr_g); return; }
static void led_output_handler(unsigned long data) { // We need to make sure that our tasklet is not scheduled again tasklet_disable(&ledtasklet); printk("%s: Takslets executed!\n", __FUNCTION__); // TODO: Set the led buttons here tasklet_enable(&ledtasklet); }
static void adf_cleanup_bh(struct adf_accel_dev *accel_dev) { struct adf_etr_data *priv_data = accel_dev->transport; struct adf_hw_device_data *hw_data = accel_dev->hw_device; int i; for (i = 0; i < hw_data->num_banks; i++) { tasklet_disable(&priv_data->banks[i].resp_handler); tasklet_kill(&priv_data->banks[i].resp_handler); } }
} static void qcnmea_disconnect (struct usb_interface *intf) { struct qcnmea *nmea = usb_get_intfdata(intf); struct usb_device *usb_dev = interface_to_usbdev(intf); int i; if (!nmea || !nmea->usb_dev) { //dbg("disconnect on nonexisting interface"); return; } down(&open_mutex); if (!usb_get_intfdata(intf)) { up(&open_mutex); return; } //device_remove_file(&intf->dev, &dev_attr_bmCapabilities); nmea->usb_dev = NULL; usb_set_intfdata(intf, NULL); tasklet_disable(&nmea->rx_tasklet); usb_kill_urb(nmea->write_urb); for (i = 0; i < QCNMEA_NR; i++) usb_kill_urb(nmea->ru[i].urb); INIT_LIST_HEAD(&nmea->filled_read_bufs); INIT_LIST_HEAD(&nmea->spare_read_bufs); tasklet_enable(&nmea->rx_tasklet); flush_scheduled_work(); /* wait for acm_softint */ qcnmea_write_buf_free(nmea); for (i = 0; i < QCNMEA_NR; i++) usb_buffer_free(usb_dev, nmea->read_size, nmea->rb[i].base, nmea->rb[i].dma); usb_driver_release_interface(&qcnmea_usb_driver, intf); if (!nmea->used) { qcnmea_tty_unregister(nmea); up(&open_mutex); return; } up(&open_mutex); if (nmea->tty) tty_hangup(nmea->tty);
static int pe_device_exit(unsigned int cpu_id, void *pHandle) { free_irq(G_IRQ_dHubIntrAvio0, pHandle); free_irq(IRQ_dHubIntrVpro, pHandle); free_irq(G_IRQ_dHubIntrAvio1, pHandle); free_irq(G_IRQ_zspInt, pHandle); tasklet_disable(&pe_vpp_tasklet); tasklet_disable(&pe_vdec_tasklet); tasklet_disable(&pe_ma_tasklet); tasklet_disable(&pe_st_tasklet); tasklet_disable(&pe_spdif_tasklet); tasklet_disable(&pe_app_tasklet); tasklet_disable(&pe_zsp_tasklet); tasklet_disable(&pe_pg_done_tasklet); tasklet_disable(&pe_rle_err_tasklet); tasklet_disable(&pe_rle_done_tasklet); return S_OK; }
void gigaset_if_free(struct cardstate *cs) { struct gigaset_driver *drv; drv = cs->driver; if (!drv->have_tty) return; tasklet_disable(&cs->if_wake_tasklet); tasklet_kill(&cs->if_wake_tasklet); cs->tty_dev = NULL; tty_unregister_device(drv->tty, cs->minor_index); }
static int omap_kp_remove(struct device *dev) { /* disable keypad interrupt handling */ tasklet_disable(&kp_tasklet); omap_writew(1, OMAP_MPUIO_BASE + OMAP_MPUIO_KBD_MASKIT); free_irq(INT_KEYBOARD, 0); del_timer_sync(&kp_timer); /* unregister everything */ input_unregister_device(&omap_kp_dev); return 0; }
/** * ntb_unregister_db_callback() - unregister a callback for doorbell interrupt * @ndev: pointer to ntb_device instance * @idx: doorbell index to register callback, zero based * * This function unregisters a callback function for the doorbell interrupt * on the primary side. The function will also mask the said doorbell. */ void ntb_unregister_db_callback(struct ntb_device *ndev, unsigned int idx) { unsigned long mask; if (idx >= ndev->max_cbs || !ndev->db_cb[idx].callback) return; mask = readw(ndev->reg_ofs.ldb_mask); set_bit(idx * ndev->bits_per_vector, &mask); writew(mask, ndev->reg_ofs.ldb_mask); tasklet_disable(&ndev->db_cb[idx].irq_work); ndev->db_cb[idx].callback = NULL; }
/* * adf_cleanup_pf2vf_bh * Cleanup Tasklet structures */ STATIC int adf_cleanup_pf2vf_bh(icp_accel_dev_t *accel_dev) { if(NULL == accel_dev) { ADF_ERROR("adf_cleanup_pf2vf_bh invalid param accel_dev\n"); return FAIL; } /*Cleanup the PF2VF tasklet */ if (accel_dev->pf2vf_tasklet != NULL) { ADF_DEBUG("Cleanup bh tasklet for pf2vf \n"); tasklet_disable(accel_dev->pf2vf_tasklet); tasklet_kill(accel_dev->pf2vf_tasklet); ICP_FREE(accel_dev->pf2vf_tasklet); accel_dev->pf2vf_tasklet = NULL; } return SUCCESS; }
static void stop_data_traffic(struct acm *acm) { int i; tasklet_disable(&acm->urb_task); usb_kill_urb(acm->ctrlurb); for(i = 0; i < ACM_NW; i++) usb_kill_urb(acm->wb[i].urb); for (i = 0; i < acm->rx_buflimit; i++) usb_kill_urb(acm->ru[i].urb); tasklet_enable(&acm->urb_task); cancel_work_sync(&acm->work); }