diff options
-rw-r--r-- | drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c index f1bcefae7487..a4d1bac4a844 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c @@ -346,7 +346,7 @@ static void _rtl92e_update_cap(struct net_device *dev, u16 cap) } } - if (net->mode & (IEEE_G|IEEE_N_24G)) { + if (net->mode & (IEEE_G | IEEE_N_24G)) { u8 slot_time_val; u8 CurSlotTime = priv->slot_time; @@ -680,7 +680,7 @@ static u8 _rtl92e_get_supported_wireless_mode(struct net_device *dev) case RF_8256: case RF_6052: case RF_PSEUDO_11N: - ret = (WIRELESS_MODE_N_24G|WIRELESS_MODE_G | WIRELESS_MODE_B); + ret = (WIRELESS_MODE_N_24G | WIRELESS_MODE_G | WIRELESS_MODE_B); break; case RF_8258: ret = (WIRELESS_MODE_A | WIRELESS_MODE_N_5G); @@ -742,7 +742,7 @@ static int _rtl92e_sta_up(struct net_device *dev, bool is_silent_reset) { struct r8192_priv *priv = rtllib_priv(dev); struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *) - (&(priv->rtllib->PowerSaveControl)); + (&priv->rtllib->PowerSaveControl); bool init_status = true; priv->bDriverIsGoingToUnload = false; @@ -888,7 +888,7 @@ static void _rtl92e_init_priv_constant(struct net_device *dev) { struct r8192_priv *priv = rtllib_priv(dev); struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *) - &(priv->rtllib->PowerSaveControl); + &priv->rtllib->PowerSaveControl; pPSC->RegMaxLPSAwakeIntvl = 5; } @@ -1015,9 +1015,9 @@ static void _rtl92e_init_priv_task(struct net_device *dev) (void *)_rtl92e_update_beacon, dev); INIT_WORK_RSL(&priv->qos_activate, (void *)_rtl92e_qos_activate, dev); INIT_DELAYED_WORK_RSL(&priv->rtllib->hw_wakeup_wq, - (void *) rtl92e_hw_wakeup_wq, dev); + (void *)rtl92e_hw_wakeup_wq, dev); INIT_DELAYED_WORK_RSL(&priv->rtllib->hw_sleep_wq, - (void *) rtl92e_hw_sleep_wq, dev); + (void *)rtl92e_hw_sleep_wq, dev); tasklet_init(&priv->irq_rx_tasklet, (void(*)(unsigned long))_rtl92e_irq_rx_tasklet, (unsigned long)priv); @@ -1035,8 +1035,8 @@ static short _rtl92e_get_channel_map(struct net_device *dev) struct r8192_priv *priv = rtllib_priv(dev); - if ((priv->rf_chip != RF_8225) && (priv->rf_chip != RF_8256) - && (priv->rf_chip != RF_6052)) { + if ((priv->rf_chip != RF_8225) && (priv->rf_chip != RF_8256) && + (priv->rf_chip != RF_6052)) { netdev_err(dev, "%s: unknown rf chip, can't set channel map\n", __func__); return -1; @@ -1062,7 +1062,7 @@ static short _rtl92e_init(struct net_device *dev) { struct r8192_priv *priv = rtllib_priv(dev); - memset(&(priv->stats), 0, sizeof(struct rt_stats)); + memset(&priv->stats, 0, sizeof(struct rt_stats)); _rtl92e_init_priv_handler(dev); _rtl92e_init_priv_constant(dev); @@ -1077,7 +1077,7 @@ static short _rtl92e_init(struct net_device *dev) setup_timer(&priv->watch_dog_timer, _rtl92e_watchdog_timer_cb, - (unsigned long) dev); + (unsigned long)dev); setup_timer(&priv->gpio_polling_timer, rtl92e_check_rfctrl_gpio_timer, @@ -1134,7 +1134,7 @@ static enum reset_type _rtl92e_tx_check_stuck(struct net_device *dev) switch (priv->rtllib->ps) { case RTLLIB_PS_DISABLED: break; - case (RTLLIB_PS_MBCAST|RTLLIB_PS_UNICAST): + case (RTLLIB_PS_MBCAST | RTLLIB_PS_UNICAST): break; default: break; @@ -1387,7 +1387,7 @@ static void _rtl92e_watchdog_wq_cb(void *data) static u8 check_reset_cnt; unsigned long flags; struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *) - (&(priv->rtllib->PowerSaveControl)); + (&priv->rtllib->PowerSaveControl); bool bBusyTraffic = false; bool bHigherBusyTraffic = false; bool bHigherBusyRxTraffic = false; @@ -1469,7 +1469,7 @@ static void _rtl92e_watchdog_wq_cb(void *data) _rtl92e_update_rxcounts(priv, &TotalRxBcnNum, &TotalRxDataNum); - if ((TotalRxBcnNum+TotalRxDataNum) == 0) + if ((TotalRxBcnNum + TotalRxDataNum) == 0) priv->check_roaming_cnt++; else priv->check_roaming_cnt = 0; @@ -1497,7 +1497,7 @@ static void _rtl92e_watchdog_wq_cb(void *data) notify_wx_assoc_event(ieee); if (!(ieee->rtllib_ap_sec_type(ieee) & - (SEC_ALG_CCMP|SEC_ALG_TKIP))) + (SEC_ALG_CCMP | SEC_ALG_TKIP))) schedule_delayed_work( &ieee->associate_procedure_wq, 0); @@ -1603,7 +1603,7 @@ static void _rtl92e_free_tx_ring(struct net_device *dev, unsigned int prio) ring->idx = (ring->idx + 1) % ring->entries; } - pci_free_consistent(priv->pdev, sizeof(*ring->desc)*ring->entries, + pci_free_consistent(priv->pdev, sizeof(*ring->desc) * ring->entries, ring->desc, ring->dma); ring->desc = NULL; } @@ -1712,7 +1712,7 @@ static void _rtl92e_tx_cmd(struct net_device *dev, struct sk_buff *skb) ring = &priv->tx_ring[TXCMD_QUEUE]; idx = (ring->idx + skb_queue_len(&ring->queue)) % ring->entries; - entry = (struct tx_desc_cmd *) &ring->desc[idx]; + entry = (struct tx_desc_cmd *)&ring->desc[idx]; tcb_desc = (struct cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE); @@ -2031,7 +2031,7 @@ static void _rtl92e_rx_normal(struct net_device *dev) struct rtllib_rx_stats stats = { .signal = 0, - .noise = (u8) -98, + .noise = (u8)-98, .rate = 0, .freq = RTLLIB_24GHZ_BAND, }; @@ -2104,7 +2104,7 @@ static void _rtl92e_rx_normal(struct net_device *dev) priv->rx_buf[rx_queue_idx][priv->rx_idx[rx_queue_idx]] = skb; - *((dma_addr_t *) skb->cb) = pci_map_single(priv->pdev, + *((dma_addr_t *)skb->cb) = pci_map_single(priv->pdev, skb_tail_pointer_rsl(skb), priv->rxbuffersize, PCI_DMA_FROMDEVICE); @@ -2117,7 +2117,7 @@ done: pdesc->BufferAddress = *((dma_addr_t *)skb->cb); pdesc->OWN = 1; pdesc->Length = priv->rxbuffersize; - if (priv->rx_idx[rx_queue_idx] == priv->rxringcount-1) + if (priv->rx_idx[rx_queue_idx] == priv->rxringcount - 1) pdesc->EOR = 1; priv->rx_idx[rx_queue_idx] = (priv->rx_idx[rx_queue_idx] + 1) % priv->rxringcount; @@ -2348,8 +2348,9 @@ static int _rtl92e_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) 0, key); } } - if ((ieee->pairwise_key_type == KEY_TYPE_CCMP) - && ieee->pHTInfo->bCurrentHTSupport) { + if ((ieee->pairwise_key_type == + KEY_TYPE_CCMP) && + ieee->pHTInfo->bCurrentHTSupport) { rtl92e_writeb(dev, 0x173, 1); } @@ -2726,7 +2727,7 @@ bool rtl92e_enable_nic(struct net_device *dev) bool init_status = true; struct r8192_priv *priv = rtllib_priv(dev); struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *) - (&(priv->rtllib->PowerSaveControl)); + (&priv->rtllib->PowerSaveControl); if (!priv->up) { netdev_warn(dev, "%s(): Driver is already down!\n", __func__); @@ -2751,6 +2752,7 @@ bool rtl92e_enable_nic(struct net_device *dev) RT_TRACE(COMP_PS, "<===========%s()\n", __func__); return init_status; } + bool rtl92e_disable_nic(struct net_device *dev) { struct r8192_priv *priv = rtllib_priv(dev); |