diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-03-17 22:13:41 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-03-17 22:13:41 -0700 |
commit | 9dffdb38d864ae89e16ff7b3a09451270736e35b (patch) | |
tree | 709caf4ff2790a993ca11a40233ab241475451be /drivers/staging/rtl8192e | |
parent | 10fdfee7f7fd8d4a6a8455ac4c9fbbc51d79b9f7 (diff) | |
parent | 2df122bdebaba1daad3a8087b89a5e3456474538 (diff) | |
download | linux-9dffdb38d864ae89e16ff7b3a09451270736e35b.tar.gz linux-9dffdb38d864ae89e16ff7b3a09451270736e35b.tar.bz2 linux-9dffdb38d864ae89e16ff7b3a09451270736e35b.zip |
Merge tag 'staging-4.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging driver updates from Greg KH:
"Here is the big staging driver pull request for 4.6-rc1.
Lots of little things here, over 1600 patches or so. Notable is all
of the good Lustre work happening, those developers have finally woken
up and are cleaning up their code greatly. The Outreachy intern
application process is also happening, which brought in another 400 or
so patches. Full details are in the very long shortlog.
All of these have been in linux-next with no reported issues"
* tag 'staging-4.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (1673 commits)
staging: lustre: fix aligments in lnet selftest
staging: lustre: report minimum of two buffers for LNet selftest load test
staging: lustre: test for proper errno code in lstcon_rpc_trans_abort
staging: lustre: filter remaining extra spacing for lnet selftest
staging: lustre: remove extra spacing when setting variable for lnet selftest
staging: lustre: remove extra spacing of variable declartions for lnet selftest
staging: lustre: fix spacing issues checkpatch reported in lnet selftest
staging: lustre: remove returns in void function for lnet selftest
staging: lustre: fix bogus lst errors for lnet selftest
staging: netlogic: Replacing pr_err with dev_err after the call to devm_kzalloc
staging: mt29f_spinand: Replacing pr_info with dev_info after the call to devm_kzalloc
staging: android: ion: fix up file mode
staging: ion: debugfs invalid gfp mask
staging: rts5208: Replace pci_enable_device with pcim_enable_device
Staging: ieee80211: Place constant on right side of the test.
staging: speakup: Replace del_timer with del_timer_sync
staging: lowmemorykiller: fix 2 checks that checkpatch complained
staging: mt29f_spinand: Drop void pointer cast
staging: rdma: hfi1: file_ops: Replace ALIGN with PAGE_ALIGN
staging: rdma: hfi1: driver: Replace IS_ALIGNED with PAGE_ALIGNED
...
Diffstat (limited to 'drivers/staging/rtl8192e')
-rw-r--r-- | drivers/staging/rtl8192e/dot11d.h | 3 | ||||
-rw-r--r-- | drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 8 | ||||
-rw-r--r-- | drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 56 | ||||
-rw-r--r-- | drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 2 | ||||
-rw-r--r-- | drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 9 | ||||
-rw-r--r-- | drivers/staging/rtl8192e/rtl8192e/rtl_pm.c | 2 | ||||
-rw-r--r-- | drivers/staging/rtl8192e/rtl8192e/rtl_ps.c | 14 | ||||
-rw-r--r-- | drivers/staging/rtl8192e/rtl819x_BAProc.c | 6 | ||||
-rw-r--r-- | drivers/staging/rtl8192e/rtllib.h | 3 | ||||
-rw-r--r-- | drivers/staging/rtl8192e/rtllib_crypt_ccmp.c | 4 | ||||
-rw-r--r-- | drivers/staging/rtl8192e/rtllib_crypt_tkip.c | 3 | ||||
-rw-r--r-- | drivers/staging/rtl8192e/rtllib_module.c | 5 | ||||
-rw-r--r-- | drivers/staging/rtl8192e/rtllib_rx.c | 6 | ||||
-rw-r--r-- | drivers/staging/rtl8192e/rtllib_softmac.c | 63 | ||||
-rw-r--r-- | drivers/staging/rtl8192e/rtllib_softmac_wx.c | 4 | ||||
-rw-r--r-- | drivers/staging/rtl8192e/rtllib_wx.c | 2 |
16 files changed, 83 insertions, 107 deletions
diff --git a/drivers/staging/rtl8192e/dot11d.h b/drivers/staging/rtl8192e/dot11d.h index 2c19054cf027..735a199ebdcf 100644 --- a/drivers/staging/rtl8192e/dot11d.h +++ b/drivers/staging/rtl8192e/dot11d.h @@ -17,8 +17,6 @@ #include "rtllib.h" - - struct chnl_txpow_triple { u8 FirstChnl; u8 NumChnls; @@ -42,7 +40,6 @@ enum dot11d_state { */ struct rt_dot11d_info { - bool bEnabled; u16 CountryIeLen; diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c index e9c4f973bba9..ba64a4f1b3a8 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c @@ -680,7 +680,7 @@ static void _rtl92e_hwconfig(struct net_device *dev) rtl92e_writeb(dev, BW_OPMODE, regBwOpMode); { - u32 ratr_value = 0; + u32 ratr_value; ratr_value = regRATR; if (priv->rf_type == RF_1T2R) @@ -1000,7 +1000,7 @@ void rtl92e_link_change(struct net_device *dev) _rtl92e_update_msr(dev); if (ieee->iw_mode == IW_MODE_INFRA || ieee->iw_mode == IW_MODE_ADHOC) { - u32 reg = 0; + u32 reg; reg = rtl92e_readl(dev, RCR); if (priv->rtllib->state == RTLLIB_LINKED) { @@ -1186,7 +1186,7 @@ void rtl92e_fill_tx_desc(struct net_device *dev, struct tx_desc *pdesc, struct r8192_priv *priv = rtllib_priv(dev); dma_addr_t mapping = pci_map_single(priv->pdev, skb->data, skb->len, PCI_DMA_TODEVICE); - struct tx_fwinfo_8190pci *pTxFwInfo = NULL; + struct tx_fwinfo_8190pci *pTxFwInfo; pTxFwInfo = (struct tx_fwinfo_8190pci *)skb->data; memset(pTxFwInfo, 0, sizeof(struct tx_fwinfo_8190pci)); @@ -2235,7 +2235,7 @@ void rtl92e_disable_irq(struct net_device *dev) void rtl92e_clear_irq(struct net_device *dev) { - u32 tmp = 0; + u32 tmp; tmp = rtl92e_readl(dev, ISR); rtl92e_writel(dev, ISR, tmp); diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c index 8f989a95a019..9b7cc7dc7cb8 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c @@ -249,7 +249,7 @@ bool rtl92e_set_rf_state(struct net_device *dev, if (StateToSet == eRfOn) { if (bConnectBySSID && priv->blinked_ingpio) { - queue_delayed_work_rsl(ieee->wq, + schedule_delayed_work( &ieee->associate_procedure_wq, 0); priv->blinked_ingpio = false; } @@ -288,7 +288,7 @@ static void _rtl92e_tx_timeout(struct net_device *dev) void rtl92e_irq_enable(struct net_device *dev) { - struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev); + struct r8192_priv *priv = rtllib_priv(dev); priv->irq_enabled = 1; @@ -297,7 +297,7 @@ void rtl92e_irq_enable(struct net_device *dev) void rtl92e_irq_disable(struct net_device *dev) { - struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev); + struct r8192_priv *priv = rtllib_priv(dev); priv->ops->irq_disable(dev); @@ -306,7 +306,7 @@ void rtl92e_irq_disable(struct net_device *dev) static void _rtl92e_set_chan(struct net_device *dev, short ch) { - struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev); + struct r8192_priv *priv = rtllib_priv(dev); RT_TRACE(COMP_CH, "=====>%s()====ch:%d\n", __func__, ch); if (priv->chan_forced) @@ -437,7 +437,7 @@ static int _rtl92e_qos_handle_probe_response(struct r8192_priv *priv, network->qos_data.old_param_count = network->qos_data.param_count; priv->rtllib->wmm_acm = network->qos_data.wmm_acm; - queue_work_rsl(priv->priv_wq, &priv->qos_activate); + schedule_work(&priv->qos_activate); RT_TRACE(COMP_QOS, "QoS parameters change call qos_activate\n"); } @@ -446,7 +446,7 @@ static int _rtl92e_qos_handle_probe_response(struct r8192_priv *priv, &def_qos_parameters, size); if ((network->qos_data.active == 1) && (active_network == 1)) { - queue_work_rsl(priv->priv_wq, &priv->qos_activate); + schedule_work(&priv->qos_activate); RT_TRACE(COMP_QOS, "QoS was disabled call qos_activate\n"); } @@ -465,7 +465,7 @@ static int _rtl92e_handle_beacon(struct net_device *dev, _rtl92e_qos_handle_probe_response(priv, 1, network); - queue_delayed_work_rsl(priv->priv_wq, &priv->update_beacon_wq, 0); + schedule_delayed_work(&priv->update_beacon_wq, 0); return 0; } @@ -512,7 +512,7 @@ static int _rtl92e_qos_assoc_resp(struct r8192_priv *priv, network->flags, priv->rtllib->current_network.qos_data.active); if (set_qos_param == 1) { rtl92e_dm_init_edca_turbo(priv->rtllib->dev); - queue_work_rsl(priv->priv_wq, &priv->qos_activate); + schedule_work(&priv->qos_activate); } return 0; } @@ -1002,7 +1002,6 @@ static void _rtl92e_init_priv_task(struct net_device *dev) { struct r8192_priv *priv = rtllib_priv(dev); - priv->priv_wq = create_workqueue(DRV_NAME); INIT_WORK_RSL(&priv->reset_wq, (void *)_rtl92e_restart, dev); INIT_WORK_RSL(&priv->rtllib->ips_leave_wq, (void *)rtl92e_ips_leave_wq, dev); @@ -1327,7 +1326,7 @@ RESET_START: ieee->set_chan(ieee->dev, ieee->current_network.channel); - queue_work_rsl(ieee->wq, &ieee->associate_complete_wq); + schedule_work(&ieee->associate_complete_wq); } else if (ieee->state == RTLLIB_LINKED && ieee->iw_mode == IW_MODE_ADHOC) { @@ -1499,7 +1498,7 @@ static void _rtl92e_watchdog_wq_cb(void *data) if (!(ieee->rtllib_ap_sec_type(ieee) & (SEC_ALG_CCMP|SEC_ALG_TKIP))) - queue_delayed_work_rsl(ieee->wq, + schedule_delayed_work( &ieee->associate_procedure_wq, 0); priv->check_roaming_cnt = 0; @@ -1536,7 +1535,7 @@ static void _rtl92e_watchdog_timer_cb(unsigned long data) { struct r8192_priv *priv = rtllib_priv((struct net_device *)data); - queue_delayed_work_rsl(priv->priv_wq, &priv->watch_dog_wq, 0); + schedule_delayed_work(&priv->watch_dog_wq, 0); mod_timer(&priv->watch_dog_timer, jiffies + msecs_to_jiffies(RTLLIB_WATCH_DOG_TIME)); } @@ -1546,14 +1545,14 @@ static void _rtl92e_watchdog_timer_cb(unsigned long data) *****************************************************************************/ void rtl92e_rx_enable(struct net_device *dev) { - struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev); + struct r8192_priv *priv = rtllib_priv(dev); priv->ops->rx_enable(dev); } void rtl92e_tx_enable(struct net_device *dev) { - struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev); + struct r8192_priv *priv = rtllib_priv(dev); priv->ops->tx_enable(dev); @@ -1612,7 +1611,7 @@ static void _rtl92e_free_tx_ring(struct net_device *dev, unsigned int prio) static void _rtl92e_hard_data_xmit(struct sk_buff *skb, struct net_device *dev, int rate) { - struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev); + struct r8192_priv *priv = rtllib_priv(dev); int ret; struct cb_desc *tcb_desc = (struct cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE); @@ -1643,7 +1642,7 @@ static void _rtl92e_hard_data_xmit(struct sk_buff *skb, struct net_device *dev, static int _rtl92e_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) { - struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev); + struct r8192_priv *priv = rtllib_priv(dev); int ret; struct cb_desc *tcb_desc = (struct cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE); @@ -1676,7 +1675,7 @@ static int _rtl92e_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) static void _rtl92e_tx_isr(struct net_device *dev, int prio) { - struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev); + struct r8192_priv *priv = rtllib_priv(dev); struct rtl8192_tx_ring *ring = &priv->tx_ring[prio]; @@ -1850,7 +1849,7 @@ static short _rtl92e_alloc_rx_ring(struct net_device *dev) static int _rtl92e_alloc_tx_ring(struct net_device *dev, unsigned int prio, unsigned int entries) { - struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev); + struct r8192_priv *priv = rtllib_priv(dev); struct tx_desc *ring; dma_addr_t dma; int i; @@ -1944,7 +1943,7 @@ void rtl92e_reset_desc_ring(struct net_device *dev) void rtl92e_update_rx_pkt_timestamp(struct net_device *dev, struct rtllib_rx_stats *stats) { - struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev); + struct r8192_priv *priv = rtllib_priv(dev); if (stats->bIsAMPDU && !stats->bFirstMPDU) stats->mac_time = priv->LastRxDescTSF; @@ -2022,7 +2021,7 @@ void rtl92e_copy_mpdu_stats(struct rtllib_rx_stats *psrc_stats, static void _rtl92e_rx_normal(struct net_device *dev) { - struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev); + struct r8192_priv *priv = rtllib_priv(dev); struct rtllib_hdr_1addr *rtllib_hdr = NULL; bool unicast_packet = false; bool bLedBlinking = true; @@ -2128,7 +2127,7 @@ done: static void _rtl92e_tx_resume(struct net_device *dev) { - struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev); + struct r8192_priv *priv = rtllib_priv(dev); struct rtllib_device *ieee = priv->rtllib; struct sk_buff *skb; int queue_index; @@ -2161,8 +2160,8 @@ static void _rtl92e_irq_rx_tasklet(struct r8192_priv *priv) *****************************************************************************/ static void _rtl92e_cancel_deferred_work(struct r8192_priv *priv) { - cancel_delayed_work(&priv->watch_dog_wq); - cancel_delayed_work(&priv->update_beacon_wq); + cancel_delayed_work_sync(&priv->watch_dog_wq); + cancel_delayed_work_sync(&priv->update_beacon_wq); cancel_delayed_work(&priv->rtllib->hw_sleep_wq); cancel_work_sync(&priv->reset_wq); cancel_work_sync(&priv->qos_activate); @@ -2279,7 +2278,7 @@ static int _rtl92e_set_mac_adr(struct net_device *dev, void *mac) /* based on ipw2200 driver */ static int _rtl92e_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) { - struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev); + struct r8192_priv *priv = rtllib_priv(dev); struct iwreq *wrq = (struct iwreq *)rq; int ret = -1; struct rtllib_device *ieee = priv->rtllib; @@ -2402,8 +2401,8 @@ out: static irqreturn_t _rtl92e_irq(int irq, void *netdev) { - struct net_device *dev = (struct net_device *) netdev; - struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev); + struct net_device *dev = netdev; + struct r8192_priv *priv = rtllib_priv(dev); unsigned long flags; u32 inta; u32 intb; @@ -2693,7 +2692,7 @@ static void _rtl92e_pci_disconnect(struct pci_dev *pdev) priv = rtllib_priv(dev); del_timer_sync(&priv->gpio_polling_timer); - cancel_delayed_work(&priv->gpio_change_rf_wq); + cancel_delayed_work_sync(&priv->gpio_change_rf_wq); priv->polling_timer_on = 0; _rtl92e_down(dev, true); rtl92e_dm_deinit(dev); @@ -2701,7 +2700,6 @@ static void _rtl92e_pci_disconnect(struct pci_dev *pdev) vfree(priv->pFirmware); priv->pFirmware = NULL; } - destroy_workqueue(priv->priv_wq); _rtl92e_free_rx_ring(dev); for (i = 0; i < MAX_TX_QUEUE_COUNT; i++) _rtl92e_free_tx_ring(dev, i); @@ -2783,7 +2781,7 @@ void rtl92e_check_rfctrl_gpio_timer(unsigned long data) priv->polling_timer_on = 1; - queue_delayed_work_rsl(priv->priv_wq, &priv->gpio_change_rf_wq, 0); + schedule_delayed_work(&priv->gpio_change_rf_wq, 0); mod_timer(&priv->gpio_polling_timer, jiffies + msecs_to_jiffies(RTLLIB_WATCH_DOG_TIME)); diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h index a7777a319c02..f627fdc15a58 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h @@ -338,8 +338,6 @@ struct r8192_priv { struct delayed_work rfpath_check_wq; struct delayed_work gpio_change_rf_wq; - struct workqueue_struct *priv_wq; - struct channel_access_setting ChannelAccessSetting; struct rtl819x_ops *ops; diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c index ef03242113be..9bc284812c30 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c @@ -994,8 +994,7 @@ static void _rtl92e_dm_check_tx_power_tracking_tssi(struct net_device *dev) if (tx_power_track_counter >= 180) { - queue_delayed_work_rsl(priv->priv_wq, - &priv->txpower_tracking_wq, 0); + schedule_delayed_work(&priv->txpower_tracking_wq, 0); tx_power_track_counter = 0; } @@ -1028,7 +1027,7 @@ static void _rtl92e_dm_check_tx_power_tracking_thermal(struct net_device *dev) return; } netdev_info(dev, "===============>Schedule TxPowerTrackingWorkItem\n"); - queue_delayed_work_rsl(priv->priv_wq, &priv->txpower_tracking_wq, 0); + schedule_delayed_work(&priv->txpower_tracking_wq, 0); TM_Trigger = 0; } @@ -1875,7 +1874,7 @@ void rtl92e_dm_rf_pathcheck_wq(void *data) struct r8192_priv, rfpath_check_wq); struct net_device *dev = priv->rtllib->dev; - u8 rfpath = 0, i; + u8 rfpath, i; rfpath = rtl92e_readb(dev, 0xc04); @@ -2121,7 +2120,7 @@ static void _rtl92e_dm_check_rx_path_selection(struct net_device *dev) { struct r8192_priv *priv = rtllib_priv(dev); - queue_delayed_work_rsl(priv->priv_wq, &priv->rfpath_check_wq, 0); + schedule_delayed_work(&priv->rfpath_check_wq, 0); } diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_pm.c b/drivers/staging/rtl8192e/rtl8192e/rtl_pm.c index b2b5ada69e73..9e04dc29fbbb 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_pm.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_pm.c @@ -27,7 +27,7 @@ int rtl92e_suspend(struct pci_dev *pdev, pm_message_t state) netdev_info(dev, "============> r8192E suspend call.\n"); del_timer_sync(&priv->gpio_polling_timer); - cancel_delayed_work(&priv->gpio_change_rf_wq); + cancel_delayed_work_sync(&priv->gpio_change_rf_wq); priv->polling_timer_on = 0; if (!netif_running(dev)) { diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c b/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c index 9a4d1bcb881d..98e4d88d0e73 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c @@ -63,9 +63,8 @@ void rtl92e_hw_wakeup(struct net_device *dev) spin_unlock_irqrestore(&priv->rf_ps_lock, flags); RT_TRACE(COMP_DBG, "rtl92e_hw_wakeup(): RF Change in progress!\n"); - queue_delayed_work_rsl(priv->rtllib->wq, - &priv->rtllib->hw_wakeup_wq, - msecs_to_jiffies(10)); + schedule_delayed_work(&priv->rtllib->hw_wakeup_wq, + msecs_to_jiffies(10)); return; } spin_unlock_irqrestore(&priv->rf_ps_lock, flags); @@ -111,10 +110,8 @@ void rtl92e_enter_sleep(struct net_device *dev, u64 time) return; } tmp = time - jiffies; - queue_delayed_work_rsl(priv->rtllib->wq, - &priv->rtllib->hw_wakeup_wq, tmp); - queue_delayed_work_rsl(priv->rtllib->wq, - (void *)&priv->rtllib->hw_sleep_wq, 0); + schedule_delayed_work(&priv->rtllib->hw_wakeup_wq, tmp); + schedule_delayed_work(&priv->rtllib->hw_sleep_wq, 0); spin_unlock_irqrestore(&priv->ps_lock, flags); } @@ -203,8 +200,7 @@ void rtl92e_rtllib_ips_leave_wq(struct net_device *dev) } netdev_info(dev, "=========>%s(): rtl92e_ips_leave\n", __func__); - queue_work_rsl(priv->rtllib->wq, - &priv->rtllib->ips_leave_wq); + schedule_work(&priv->rtllib->ips_leave_wq); } } } diff --git a/drivers/staging/rtl8192e/rtl819x_BAProc.c b/drivers/staging/rtl8192e/rtl819x_BAProc.c index c04a020f6d6c..c7fd1b1653d6 100644 --- a/drivers/staging/rtl8192e/rtl819x_BAProc.c +++ b/drivers/staging/rtl8192e/rtl819x_BAProc.c @@ -189,7 +189,7 @@ static struct sk_buff *rtllib_DELBA(struct rtllib_device *ieee, u8 *dst, static void rtllib_send_ADDBAReq(struct rtllib_device *ieee, u8 *dst, struct ba_record *pBA) { - struct sk_buff *skb = NULL; + struct sk_buff *skb; skb = rtllib_ADDBA(ieee, dst, pBA, 0, ACT_ADDBAREQ); @@ -204,7 +204,7 @@ static void rtllib_send_ADDBAReq(struct rtllib_device *ieee, u8 *dst, static void rtllib_send_ADDBARsp(struct rtllib_device *ieee, u8 *dst, struct ba_record *pBA, u16 StatusCode) { - struct sk_buff *skb = NULL; + struct sk_buff *skb; skb = rtllib_ADDBA(ieee, dst, pBA, StatusCode, ACT_ADDBARSP); if (skb) @@ -217,7 +217,7 @@ static void rtllib_send_DELBA(struct rtllib_device *ieee, u8 *dst, struct ba_record *pBA, enum tr_select TxRxSelect, u16 ReasonCode) { - struct sk_buff *skb = NULL; + struct sk_buff *skb; skb = rtllib_DELBA(ieee, dst, pBA, TxRxSelect, ReasonCode); if (skb) diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index 563ac12f0b2c..776e179d5bfd 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -76,7 +76,7 @@ #define container_of_work_rsl(x, y, z) container_of(x, y, z) #define container_of_dwork_rsl(x, y, z) \ - container_of(container_of(x, struct delayed_work, work), y, z) + container_of(to_delayed_work(x), y, z) #define iwe_stream_add_event_rsl(info, start, stop, iwe, len) \ iwe_stream_add_event(info, start, stop, iwe, len) @@ -1728,7 +1728,6 @@ struct rtllib_device { struct delayed_work link_change_wq; struct work_struct wx_sync_scan_wq; - struct workqueue_struct *wq; union { struct rtllib_rxb *RfdArray[REORDER_WIN_SIZE]; struct rtllib_rxb *stats_IndicateArray[REORDER_WIN_SIZE]; diff --git a/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c b/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c index 496de4f6a7bc..bc45cf098b04 100644 --- a/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c +++ b/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c @@ -233,7 +233,7 @@ static int rtllib_ccmp_encrypt(struct sk_buff *skb, int hdr_len, void *priv) ccmp_init_blocks(key->tfm, hdr, key->tx_pn, data_len, b0, b, s0); - blocks = (data_len + AES_BLOCK_LEN - 1) / AES_BLOCK_LEN; + blocks = DIV_ROUND_UP(data_len, AES_BLOCK_LEN); last = data_len % AES_BLOCK_LEN; for (i = 1; i <= blocks; i++) { @@ -319,7 +319,7 @@ static int rtllib_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv) ccmp_init_blocks(key->tfm, hdr, pn, data_len, b0, a, b); xor_block(mic, b, CCMP_MIC_LEN); - blocks = (data_len + AES_BLOCK_LEN - 1) / AES_BLOCK_LEN; + blocks = DIV_ROUND_UP(data_len, AES_BLOCK_LEN); last = data_len % AES_BLOCK_LEN; for (i = 1; i <= blocks; i++) { diff --git a/drivers/staging/rtl8192e/rtllib_crypt_tkip.c b/drivers/staging/rtl8192e/rtllib_crypt_tkip.c index 8eac7cdd5f3e..ae103b0b7a2a 100644 --- a/drivers/staging/rtl8192e/rtllib_crypt_tkip.c +++ b/drivers/staging/rtl8192e/rtllib_crypt_tkip.c @@ -367,8 +367,7 @@ static int rtllib_tkip_encrypt(struct sk_buff *skb, int hdr_len, void *priv) if (!tcb_desc->bHwSec) return ret; - else - return 0; + return 0; } diff --git a/drivers/staging/rtl8192e/rtllib_module.c b/drivers/staging/rtl8192e/rtllib_module.c index 113fbf7fbb17..f4f318abb299 100644 --- a/drivers/staging/rtl8192e/rtllib_module.c +++ b/drivers/staging/rtl8192e/rtllib_module.c @@ -45,15 +45,11 @@ #include <linux/etherdevice.h> #include <linux/uaccess.h> #include <net/arp.h> - #include "rtllib.h" - u32 rt_global_debug_component = COMP_ERR; EXPORT_SYMBOL(rt_global_debug_component); - - static inline int rtllib_networks_allocate(struct rtllib_device *ieee) { if (ieee->networks) @@ -110,7 +106,6 @@ struct net_device *alloc_rtllib(int sizeof_priv) } rtllib_networks_initialize(ieee); - /* Default fragmentation threshold is maximum payload size */ ieee->fts = DEFAULT_FTS; ieee->scan_age = DEFAULT_MAX_SCAN_AGE; diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c index 37343ec3b484..c743182b933e 100644 --- a/drivers/staging/rtl8192e/rtllib_rx.c +++ b/drivers/staging/rtl8192e/rtllib_rx.c @@ -467,7 +467,7 @@ static bool AddReorderEntry(struct rx_ts_record *pTS, else if (SN_EQUAL(pReorderEntry->SeqNum, ((struct rx_reorder_entry *)list_entry(pList->next, struct rx_reorder_entry, List))->SeqNum)) - return false; + return false; else break; } @@ -905,7 +905,7 @@ static size_t rtllib_rx_get_hdrlen(struct rtllib_device *ieee, { struct rtllib_hdr_4addr *hdr = (struct rtllib_hdr_4addr *)skb->data; u16 fc = le16_to_cpu(hdr->frame_ctl); - size_t hdrlen = 0; + size_t hdrlen; hdrlen = rtllib_get_hdrlen(fc); if (HTCCheck(ieee, skb->data)) { @@ -1829,7 +1829,6 @@ static inline void rtllib_extract_country_ie( if (IS_EQUAL_CIE_SRC(ieee, addr2)) UPDATE_CIE_WATCHDOG(ieee); } - } static void rtllib_parse_mife_generic(struct rtllib_device *ieee, @@ -1902,7 +1901,6 @@ static void rtllib_parse_mife_generic(struct rtllib_device *ieee, info_element->data, network->bssht.bdHTInfoLen); } - } } diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c index d0fedb0ff132..cfab715495ad 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac.c +++ b/drivers/staging/rtl8192e/rtllib_softmac.c @@ -355,9 +355,9 @@ static inline struct sk_buff *rtllib_probe_req(struct rtllib_device *ieee) req->header.frame_ctl = cpu_to_le16(RTLLIB_STYPE_PROBE_REQ); req->header.duration_id = 0; - memset(req->header.addr1, 0xff, ETH_ALEN); + eth_broadcast_addr(req->header.addr1); ether_addr_copy(req->header.addr2, ieee->dev->dev_addr); - memset(req->header.addr3, 0xff, ETH_ALEN); + eth_broadcast_addr(req->header.addr3); tag = (u8 *) skb_put(skb, len + 2 + rate_len); @@ -615,8 +615,8 @@ static void rtllib_softmac_scan_wq(void *data) if (ieee->active_channel_map[ieee->current_network.channel] == 1) rtllib_send_probe_requests(ieee, 0); - queue_delayed_work_rsl(ieee->wq, &ieee->softmac_scan_wq, - msecs_to_jiffies(RTLLIB_SOFTMAC_SCAN_TIME)); + schedule_delayed_work(&ieee->softmac_scan_wq, + msecs_to_jiffies(RTLLIB_SOFTMAC_SCAN_TIME)); up(&ieee->scan_sem); return; @@ -689,7 +689,7 @@ static void rtllib_softmac_stop_scan(struct rtllib_device *ieee) ieee->scanning_continue = 0; ieee->actscanning = false; - cancel_delayed_work(&ieee->softmac_scan_wq); + cancel_delayed_work_sync(&ieee->softmac_scan_wq); } up(&ieee->scan_sem); @@ -745,8 +745,7 @@ static void rtllib_start_scan(struct rtllib_device *ieee) if (ieee->scanning_continue == 0) { ieee->actscanning = true; ieee->scanning_continue = 1; - queue_delayed_work_rsl(ieee->wq, - &ieee->softmac_scan_wq, 0); + schedule_delayed_work(&ieee->softmac_scan_wq, 0); } } else { if (ieee->rtllib_start_hw_scan) @@ -776,7 +775,7 @@ inline struct sk_buff *rtllib_authentication_req(struct rtllib_network *beacon, { struct sk_buff *skb; struct rtllib_authentication *auth; - int len = 0; + int len; len = sizeof(struct rtllib_authentication) + challengelen + ieee->tx_headroom + 4; @@ -1428,8 +1427,8 @@ static void rtllib_associate_abort(struct rtllib_device *ieee) ieee->state = RTLLIB_ASSOCIATING_RETRY; - queue_delayed_work_rsl(ieee->wq, &ieee->associate_retry_wq, - RTLLIB_SOFTMAC_ASSOC_RETRY_TIME); + schedule_delayed_work(&ieee->associate_retry_wq, + RTLLIB_SOFTMAC_ASSOC_RETRY_TIME); spin_unlock_irqrestore(&ieee->lock, flags); } @@ -1580,7 +1579,7 @@ static void rtllib_associate_complete(struct rtllib_device *ieee) ieee->state = RTLLIB_LINKED; rtllib_sta_send_associnfo(ieee); - queue_work_rsl(ieee->wq, &ieee->associate_complete_wq); + schedule_work(&ieee->associate_complete_wq); } static void rtllib_associate_procedure_wq(void *data) @@ -1729,7 +1728,7 @@ inline void rtllib_softmac_new_net(struct rtllib_device *ieee, if (ieee->LedControlHandler != NULL) ieee->LedControlHandler(ieee->dev, LED_CTL_START_TO_LINK); - queue_delayed_work_rsl(ieee->wq, + schedule_delayed_work( &ieee->associate_procedure_wq, 0); } else { if (rtllib_is_54g(&ieee->current_network) && @@ -2283,7 +2282,7 @@ inline int rtllib_rx_assoc_resp(struct rtllib_device *ieee, struct sk_buff *skb, "Association response status code 0x%x\n", errcode); if (ieee->AsocRetryCount < RT_ASOC_RETRY_LIMIT) - queue_delayed_work_rsl(ieee->wq, + schedule_delayed_work( &ieee->associate_procedure_wq, 0); else rtllib_associate_abort(ieee); @@ -2393,7 +2392,7 @@ inline int rtllib_rx_deauth(struct rtllib_device *ieee, struct sk_buff *skb) if (!(ieee->rtllib_ap_sec_type(ieee) & (SEC_ALG_CCMP|SEC_ALG_TKIP))) - queue_delayed_work_rsl(ieee->wq, + schedule_delayed_work( &ieee->associate_procedure_wq, 5); } return 0; @@ -2538,12 +2537,6 @@ void rtllib_wake_all_queues(struct rtllib_device *ieee) netif_tx_wake_all_queues(ieee->dev); } -inline void rtllib_randomize_cell(struct rtllib_device *ieee) -{ - - random_ether_addr(ieee->current_network.bssid); -} - /* called in user context only */ static void rtllib_start_master_bss(struct rtllib_device *ieee) { @@ -2634,7 +2627,7 @@ static void rtllib_start_ibss_wq(void *data) netdev_info(ieee->dev, "creating new IBSS cell\n"); ieee->current_network.channel = ieee->IbssStartChnl; if (!ieee->wap_set) - rtllib_randomize_cell(ieee); + eth_random_addr(ieee->current_network.bssid); if (ieee->modulation & RTLLIB_CCK_MODULATION) { @@ -2715,8 +2708,7 @@ static void rtllib_start_ibss_wq(void *data) inline void rtllib_start_ibss(struct rtllib_device *ieee) { - queue_delayed_work_rsl(ieee->wq, &ieee->start_ibss_wq, - msecs_to_jiffies(150)); + schedule_delayed_work(&ieee->start_ibss_wq, msecs_to_jiffies(150)); } /* this is called only in user context, with wx_sem held */ @@ -2770,7 +2762,7 @@ void rtllib_disassociate(struct rtllib_device *ieee) ieee->is_set_key = false; ieee->wap_set = 0; - queue_delayed_work_rsl(ieee->wq, &ieee->link_change_wq, 0); + schedule_delayed_work(&ieee->link_change_wq, 0); notify_wx_assoc_event(ieee); } @@ -2882,9 +2874,9 @@ void rtllib_stop_protocol(struct rtllib_device *ieee, u8 shutdown) rtllib_stop_send_beacons(ieee); del_timer_sync(&ieee->associate_timer); - cancel_delayed_work(&ieee->associate_retry_wq); - cancel_delayed_work(&ieee->start_ibss_wq); - cancel_delayed_work(&ieee->link_change_wq); + cancel_delayed_work_sync(&ieee->associate_retry_wq); + cancel_delayed_work_sync(&ieee->start_ibss_wq); + cancel_delayed_work_sync(&ieee->link_change_wq); rtllib_stop_scan(ieee); if (ieee->state <= RTLLIB_ASSOCIATING_AUTHENTICATED) @@ -3027,9 +3019,6 @@ void rtllib_softmac_init(struct rtllib_device *ieee) rtllib_send_beacon_cb, (unsigned long) ieee); - - ieee->wq = create_workqueue(DRV_NAME); - INIT_DELAYED_WORK_RSL(&ieee->link_change_wq, (void *)rtllib_link_change_wq, ieee); INIT_DELAYED_WORK_RSL(&ieee->start_ibss_wq, @@ -3065,8 +3054,16 @@ void rtllib_softmac_free(struct rtllib_device *ieee) ieee->pDot11dInfo = NULL; del_timer_sync(&ieee->associate_timer); - cancel_delayed_work(&ieee->associate_retry_wq); - destroy_workqueue(ieee->wq); + cancel_delayed_work_sync(&ieee->associate_retry_wq); + cancel_delayed_work_sync(&ieee->associate_procedure_wq); + cancel_delayed_work_sync(&ieee->softmac_scan_wq); + cancel_delayed_work_sync(&ieee->start_ibss_wq); + cancel_delayed_work_sync(&ieee->hw_wakeup_wq); + cancel_delayed_work_sync(&ieee->hw_sleep_wq); + cancel_delayed_work_sync(&ieee->link_change_wq); + cancel_work_sync(&ieee->associate_complete_wq); + cancel_work_sync(&ieee->ips_leave_wq); + cancel_work_sync(&ieee->wx_sync_scan_wq); up(&ieee->wx_sem); tasklet_kill(&ieee->ps_task); } @@ -3328,7 +3325,7 @@ static int rtllib_wpa_set_encryption(struct rtllib_device *ieee, goto done; } new_crypt->ops = ops; - if (new_crypt->ops) + if (new_crypt->ops && try_module_get(new_crypt->ops->owner)) new_crypt->priv = new_crypt->ops->init(param->u.crypt.idx); diff --git a/drivers/staging/rtl8192e/rtllib_softmac_wx.c b/drivers/staging/rtl8192e/rtllib_softmac_wx.c index 86f52ac7d33e..61ed8b0413e4 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac_wx.c +++ b/drivers/staging/rtl8192e/rtllib_softmac_wx.c @@ -243,7 +243,7 @@ int rtllib_wx_get_rate(struct rtllib_device *ieee, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { - u32 tmp_rate = 0; + u32 tmp_rate; tmp_rate = TxCountToDataRate(ieee, ieee->softmac_stats.CurrentShowTxate); @@ -429,7 +429,7 @@ int rtllib_wx_set_scan(struct rtllib_device *ieee, struct iw_request_info *a, } if (ieee->state == RTLLIB_LINKED) { - queue_work_rsl(ieee->wq, &ieee->wx_sync_scan_wq); + schedule_work(&ieee->wx_sync_scan_wq); /* intentionally forget to up sem */ return 0; } diff --git a/drivers/staging/rtl8192e/rtllib_wx.c b/drivers/staging/rtl8192e/rtllib_wx.c index 80f7a099dff1..84e6272f28cd 100644 --- a/drivers/staging/rtl8192e/rtllib_wx.c +++ b/drivers/staging/rtl8192e/rtllib_wx.c @@ -623,7 +623,7 @@ int rtllib_wx_set_encode_ext(struct rtllib_device *ieee, goto done; } new_crypt->ops = ops; - if (new_crypt->ops) + if (new_crypt->ops && try_module_get(new_crypt->ops->owner)) new_crypt->priv = new_crypt->ops->init(idx); if (new_crypt->priv == NULL) { |