diff options
Diffstat (limited to 'drivers/net/wireless/rtlwifi/rtl8192cu')
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192cu/hw.c | 77 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192cu/led.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192cu/mac.c | 22 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192cu/phy.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192cu/rf.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192cu/sw.c | 21 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192cu/trx.c | 2 |
7 files changed, 64 insertions, 66 deletions
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c b/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c index 52e2af58c1ed..814c05df51e8 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c +++ b/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c @@ -27,6 +27,8 @@ * *****************************************************************************/ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + #include "../wifi.h" #include "../efuse.h" #include "../base.h" @@ -337,7 +339,7 @@ static void _rtl92cu_read_board_type(struct ieee80211_hw *hw, u8 *contents) rtlefuse->board_type = boardType; if (IS_HIGHT_PA(rtlefuse->board_type)) rtlefuse->external_pa = 1; - printk(KERN_INFO "rtl8192cu: Board Type %x\n", rtlefuse->board_type); + pr_info("Board Type %x\n", rtlefuse->board_type); #ifdef CONFIG_ANTENNA_DIVERSITY /* Antenna Diversity setting. */ @@ -346,8 +348,7 @@ static void _rtl92cu_read_board_type(struct ieee80211_hw *hw, u8 *contents) else rtl_efuse->antenna_cfg = registry_par->antdiv_cfg; /* 0:OFF, */ - printk(KERN_INFO "rtl8192cu: Antenna Config %x\n", - rtl_efuse->antenna_cfg); + pr_info("Antenna Config %x\n", rtl_efuse->antenna_cfg); #endif } @@ -384,71 +385,57 @@ static void _update_bt_param(_adapter *padapter) pbtpriv->bBTNonTrafficModeSet = _FALSE; pbtpriv->CurrentState = 0; pbtpriv->PreviousState = 0; - printk(KERN_INFO "rtl8192cu: BT Coexistance = %s\n", - (pbtpriv->BT_Coexist == _TRUE) ? "enable" : "disable"); + pr_info("BT Coexistance = %s\n", + (pbtpriv->BT_Coexist == _TRUE) ? "enable" : "disable"); if (pbtpriv->BT_Coexist) { if (pbtpriv->BT_Ant_Num == Ant_x2) - printk(KERN_INFO "rtl8192cu: BlueTooth BT_" - "Ant_Num = Antx2\n"); + pr_info("BlueTooth BT_Ant_Num = Antx2\n"); else if (pbtpriv->BT_Ant_Num == Ant_x1) - printk(KERN_INFO "rtl8192cu: BlueTooth BT_" - "Ant_Num = Antx1\n"); + pr_info("BlueTooth BT_Ant_Num = Antx1\n"); switch (pbtpriv->BT_CoexistType) { case BT_2Wire: - printk(KERN_INFO "rtl8192cu: BlueTooth BT_" - "CoexistType = BT_2Wire\n"); + pr_info("BlueTooth BT_CoexistType = BT_2Wire\n"); break; case BT_ISSC_3Wire: - printk(KERN_INFO "rtl8192cu: BlueTooth BT_" - "CoexistType = BT_ISSC_3Wire\n"); + pr_info("BlueTooth BT_CoexistType = BT_ISSC_3Wire\n"); break; case BT_Accel: - printk(KERN_INFO "rtl8192cu: BlueTooth BT_" - "CoexistType = BT_Accel\n"); + pr_info("BlueTooth BT_CoexistType = BT_Accel\n"); break; case BT_CSR_BC4: - printk(KERN_INFO "rtl8192cu: BlueTooth BT_" - "CoexistType = BT_CSR_BC4\n"); + pr_info("BlueTooth BT_CoexistType = BT_CSR_BC4\n"); break; case BT_CSR_BC8: - printk(KERN_INFO "rtl8192cu: BlueTooth BT_" - "CoexistType = BT_CSR_BC8\n"); + pr_info("BlueTooth BT_CoexistType = BT_CSR_BC8\n"); break; case BT_RTL8756: - printk(KERN_INFO "rtl8192cu: BlueTooth BT_" - "CoexistType = BT_RTL8756\n"); + pr_info("BlueTooth BT_CoexistType = BT_RTL8756\n"); break; default: - printk(KERN_INFO "rtl8192cu: BlueTooth BT_" - "CoexistType = Unknown\n"); + pr_info("BlueTooth BT_CoexistType = Unknown\n"); break; } - printk(KERN_INFO "rtl8192cu: BlueTooth BT_Ant_isolation = %d\n", - pbtpriv->BT_Ant_isolation); + pr_info("BlueTooth BT_Ant_isolation = %d\n", + pbtpriv->BT_Ant_isolation); switch (pbtpriv->BT_Service) { case BT_OtherAction: - printk(KERN_INFO "rtl8192cu: BlueTooth BT_Service = " - "BT_OtherAction\n"); + pr_info("BlueTooth BT_Service = BT_OtherAction\n"); break; case BT_SCO: - printk(KERN_INFO "rtl8192cu: BlueTooth BT_Service = " - "BT_SCO\n"); + pr_info("BlueTooth BT_Service = BT_SCO\n"); break; case BT_Busy: - printk(KERN_INFO "rtl8192cu: BlueTooth BT_Service = " - "BT_Busy\n"); + pr_info("BlueTooth BT_Service = BT_Busy\n"); break; case BT_OtherBusy: - printk(KERN_INFO "rtl8192cu: BlueTooth BT_Service = " - "BT_OtherBusy\n"); + pr_info("BlueTooth BT_Service = BT_OtherBusy\n"); break; default: - printk(KERN_INFO "rtl8192cu: BlueTooth BT_Service = " - "BT_Idle\n"); + pr_info("BlueTooth BT_Service = BT_Idle\n"); break; } - printk(KERN_INFO "rtl8192cu: BT_RadioSharedType = 0x%x\n", - pbtpriv->BT_RadioSharedType); + pr_info("BT_RadioSharedType = 0x%x\n", + pbtpriv->BT_RadioSharedType); } } @@ -520,13 +507,13 @@ static void _rtl92cu_read_adapter_info(struct ieee80211_hw *hw) RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, ("Autoload OK\n")); rtlefuse->autoload_failflag = false; } - if (rtlefuse->autoload_failflag == true) + if (rtlefuse->autoload_failflag) return; for (i = 0; i < 6; i += 2) { usvalue = *(u16 *)&hwinfo[EEPROM_MAC_ADDR + i]; *((u16 *) (&rtlefuse->dev_addr[i])) = usvalue; } - printk(KERN_INFO "rtl8192cu: MAC address: %pM\n", rtlefuse->dev_addr); + pr_info("MAC address: %pM\n", rtlefuse->dev_addr); _rtl92cu_read_txpower_info_from_hwpg(hw, rtlefuse->autoload_failflag, hwinfo); rtlefuse->eeprom_vid = *(u16 *)&hwinfo[EEPROM_VID]; @@ -665,7 +652,7 @@ static int _rtl92cu_init_power_on(struct ieee80211_hw *hw) rtl_write_word(rtlpriv, REG_APS_FSMCO, value16); do { if (!(rtl_read_word(rtlpriv, REG_APS_FSMCO) & APFM_ONMAC)) { - printk(KERN_INFO "rtl8192cu: MAC auto ON okay!\n"); + pr_info("MAC auto ON okay!\n"); break; } if (pollingCount++ > 100) { @@ -819,7 +806,7 @@ static void _rtl92cu_init_chipN_one_out_ep_priority(struct ieee80211_hw *hw, } _rtl92c_init_chipN_reg_priority(hw, value, value, value, value, value, value); - printk(KERN_INFO "rtl8192cu: Tx queue select: 0x%02x\n", queue_sel); + pr_info("Tx queue select: 0x%02x\n", queue_sel); } static void _rtl92cu_init_chipN_two_out_ep_priority(struct ieee80211_hw *hw, @@ -863,7 +850,7 @@ static void _rtl92cu_init_chipN_two_out_ep_priority(struct ieee80211_hw *hw, hiQ = valueHi; } _rtl92c_init_chipN_reg_priority(hw, beQ, bkQ, viQ, voQ, mgtQ, hiQ); - printk(KERN_INFO "rtl8192cu: Tx queue select: 0x%02x\n", queue_sel); + pr_info("Tx queue select: 0x%02x\n", queue_sel); } static void _rtl92cu_init_chipN_three_out_ep_priority(struct ieee80211_hw *hw, @@ -1594,7 +1581,7 @@ static void _rtl92cu_set_check_bssid(struct ieee80211_hw *hw, default: break; } - if (filterout_non_associated_bssid == true) { + if (filterout_non_associated_bssid) { if (IS_NORMAL_CHIP(rtlhal->version)) { switch (rtlphy->current_io_type) { case IO_CMD_RESUME_DM_BY_SCAN: @@ -2155,7 +2142,7 @@ void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val) case HW_VAR_CORRECT_TSF:{ u8 btype_ibss = ((u8 *) (val))[0]; - if (btype_ibss == true) + if (btype_ibss) _rtl92cu_stop_tx_beacon(hw); _rtl92cu_set_bcn_ctrl_reg(hw, 0, BIT(3)); rtl_write_dword(rtlpriv, REG_TSFTR, (u32)(mac->tsf & @@ -2163,7 +2150,7 @@ void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val) rtl_write_dword(rtlpriv, REG_TSFTR + 4, (u32)((mac->tsf >> 32) & 0xffffffff)); _rtl92cu_set_bcn_ctrl_reg(hw, BIT(3), 0); - if (btype_ibss == true) + if (btype_ibss) _rtl92cu_resume_tx_beacon(hw); break; } diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/led.c b/drivers/net/wireless/rtlwifi/rtl8192cu/led.c index 332c74348a69..2ff9d8314e7b 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192cu/led.c +++ b/drivers/net/wireless/rtlwifi/rtl8192cu/led.c @@ -82,7 +82,7 @@ void rtl92cu_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled) break; case LED_PIN_LED0: ledcfg &= 0xf0; - if (usbpriv->ledctl.led_opendrain == true) + if (usbpriv->ledctl.led_opendrain) rtl_write_byte(rtlpriv, REG_LEDCFG2, (ledcfg | BIT(1) | BIT(5) | BIT(6))); else diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/mac.c b/drivers/net/wireless/rtlwifi/rtl8192cu/mac.c index f8514cba17b6..194fc693c1fa 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192cu/mac.c +++ b/drivers/net/wireless/rtlwifi/rtl8192cu/mac.c @@ -26,6 +26,9 @@ * Larry Finger <Larry.Finger@lwfinger.net> * ****************************************************************************/ + +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + #include <linux/module.h> #include "../wifi.h" @@ -213,14 +216,14 @@ bool rtl92c_init_llt_table(struct ieee80211_hw *hw, u32 boundary) for (i = 0; i < (boundary - 1); i++) { rst = rtl92c_llt_write(hw, i , i + 1); if (true != rst) { - printk(KERN_ERR "===> %s #1 fail\n", __func__); + pr_err("===> %s #1 fail\n", __func__); return rst; } } /* end of list */ rst = rtl92c_llt_write(hw, (boundary - 1), 0xFF); if (true != rst) { - printk(KERN_ERR "===> %s #2 fail\n", __func__); + pr_err("===> %s #2 fail\n", __func__); return rst; } /* Make the other pages as ring buffer @@ -231,14 +234,14 @@ bool rtl92c_init_llt_table(struct ieee80211_hw *hw, u32 boundary) for (i = boundary; i < LLT_LAST_ENTRY_OF_TX_PKT_BUFFER; i++) { rst = rtl92c_llt_write(hw, i, (i + 1)); if (true != rst) { - printk(KERN_ERR "===> %s #3 fail\n", __func__); + pr_err("===> %s #3 fail\n", __func__); return rst; } } /* Let last entry point to the start entry of ring buffer */ rst = rtl92c_llt_write(hw, LLT_LAST_ENTRY_OF_TX_PKT_BUFFER, boundary); if (true != rst) { - printk(KERN_ERR "===> %s #4 fail\n", __func__); + pr_err("===> %s #4 fail\n", __func__); return rst; } return rst; @@ -380,13 +383,11 @@ void rtl92c_enable_interrupt(struct ieee80211_hw *hw) 0xFFFFFFFF); rtl_write_dword(rtlpriv, REG_HIMRE, rtlpci->irq_mask[1] & 0xFFFFFFFF); - rtlpci->irq_enabled = true; } else { rtl_write_dword(rtlpriv, REG_HIMR, rtlusb->irq_mask[0] & 0xFFFFFFFF); rtl_write_dword(rtlpriv, REG_HIMRE, rtlusb->irq_mask[1] & 0xFFFFFFFF); - rtlusb->irq_enabled = true; } } @@ -398,16 +399,9 @@ void rtl92c_init_interrupt(struct ieee80211_hw *hw) void rtl92c_disable_interrupt(struct ieee80211_hw *hw) { struct rtl_priv *rtlpriv = rtl_priv(hw); - struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); - struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); - struct rtl_usb *rtlusb = rtl_usbdev(rtl_usbpriv(hw)); rtl_write_dword(rtlpriv, REG_HIMR, IMR8190_DISABLED); rtl_write_dword(rtlpriv, REG_HIMRE, IMR8190_DISABLED); - if (IS_HARDWARE_TYPE_8192CE(rtlhal)) - rtlpci->irq_enabled = false; - else if (IS_HARDWARE_TYPE_8192CU(rtlhal)) - rtlusb->irq_enabled = false; } void rtl92c_set_qos(struct ieee80211_hw *hw, int aci) @@ -1113,7 +1107,6 @@ void rtl92c_translate_rx_signal_stuff(struct ieee80211_hw *hw, struct ieee80211_hdr *hdr; u8 *tmp_buf; u8 *praddr; - u8 *psaddr; __le16 fc; u16 type, cpu_fc; bool packet_matchbssid, packet_toself, packet_beacon; @@ -1124,7 +1117,6 @@ void rtl92c_translate_rx_signal_stuff(struct ieee80211_hw *hw, cpu_fc = le16_to_cpu(fc); type = WLAN_FC_GET_TYPE(fc); praddr = hdr->addr1; - psaddr = hdr->addr2; packet_matchbssid = ((IEEE80211_FTYPE_CTL != type) && (!compare_ether_addr(mac->bssid, diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/phy.c b/drivers/net/wireless/rtlwifi/rtl8192cu/phy.c index 9a3d0239e27e..72852900df84 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192cu/phy.c +++ b/drivers/net/wireless/rtlwifi/rtl8192cu/phy.c @@ -470,7 +470,6 @@ static bool _rtl92cu_phy_set_rf_power_state(struct ieee80211_hw *hw, u8 i, queue_id; struct rtl8192_tx_ring *ring = NULL; - ppsc->set_rfpowerstate_inprogress = true; switch (rfpwr_state) { case ERFON: if ((ppsc->rfpwr_state == ERFOFF) && @@ -590,7 +589,6 @@ static bool _rtl92cu_phy_set_rf_power_state(struct ieee80211_hw *hw, } if (bresult) ppsc->rfpwr_state = rfpwr_state; - ppsc->set_rfpowerstate_inprogress = false; return bresult; } diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/rf.c b/drivers/net/wireless/rtlwifi/rtl8192cu/rf.c index c7576ec4744e..17a8e9628512 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192cu/rf.c +++ b/drivers/net/wireless/rtlwifi/rtl8192cu/rf.c @@ -82,7 +82,7 @@ void rtl92cu_phy_rf6052_set_cck_txpower(struct ieee80211_hw *hw, (rtlefuse->external_pa)) turbo_scanoff = true; } - if (mac->act_scanning == true) { + if (mac->act_scanning) { tx_agc[RF90_PATH_A] = 0x3f3f3f3f; tx_agc[RF90_PATH_B] = 0x3f3f3f3f; if (turbo_scanoff) { @@ -104,7 +104,7 @@ void rtl92cu_phy_rf6052_set_cck_txpower(struct ieee80211_hw *hw, tx_agc[RF90_PATH_A] = 0x10101010; tx_agc[RF90_PATH_B] = 0x10101010; } else if (rtlpriv->dm.dynamic_txhighpower_lvl == - TXHIGHPWRLEVEL_LEVEL1) { + TXHIGHPWRLEVEL_LEVEL2) { tx_agc[RF90_PATH_A] = 0x00000000; tx_agc[RF90_PATH_B] = 0x00000000; } else{ diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c index bee7c1480f63..942f7a3969a7 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c +++ b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c @@ -53,6 +53,8 @@ MODULE_FIRMWARE("rtlwifi/rtl8192cufw.bin"); static int rtl92cu_init_sw_vars(struct ieee80211_hw *hw) { struct rtl_priv *rtlpriv = rtl_priv(hw); + const struct firmware *firmware; + int err; rtlpriv->dm.dm_initialgain_enable = 1; rtlpriv->dm.dm_flag = 0; @@ -64,6 +66,24 @@ static int rtl92cu_init_sw_vars(struct ieee80211_hw *hw) ("Can't alloc buffer for fw.\n")); return 1; } + /* request fw */ + err = request_firmware(&firmware, rtlpriv->cfg->fw_name, + rtlpriv->io.dev); + if (err) { + RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, + ("Failed to request firmware!\n")); + return 1; + } + if (firmware->size > 0x4000) { + RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, + ("Firmware is too big!\n")); + release_firmware(firmware); + return 1; + } + memcpy(rtlpriv->rtlhal.pfirmware, firmware->data, firmware->size); + rtlpriv->rtlhal.fwsize = firmware->size; + release_firmware(firmware); + return 0; } @@ -278,6 +298,7 @@ static struct usb_device_id rtl8192c_usb_ids[] = { {RTL_USB_DEVICE(0x06f8, 0xe033, rtl92cu_hal_cfg)}, /*Hercules - Edimax*/ {RTL_USB_DEVICE(0x07b8, 0x8188, rtl92cu_hal_cfg)}, /*Abocom - Abocom*/ {RTL_USB_DEVICE(0x07b8, 0x8189, rtl92cu_hal_cfg)}, /*Funai - Abocom*/ + {RTL_USB_DEVICE(0x0846, 0x9041, rtl92cu_hal_cfg)}, /*NetGear WNA1000M*/ {RTL_USB_DEVICE(0x0Df6, 0x0052, rtl92cu_hal_cfg)}, /*Sitecom - Edimax*/ {RTL_USB_DEVICE(0x0eb0, 0x9071, rtl92cu_hal_cfg)}, /*NO Brand - Etop*/ /* HP - Lite-On ,8188CUS Slim Combo */ diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c b/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c index 3a92ba3c4a1e..906e7aa55bc3 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c +++ b/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c @@ -342,7 +342,7 @@ bool rtl92cu_rx_query_desc(struct ieee80211_hw *hw, (u8)GET_RX_DESC_RX_MCS(pdesc), (bool)GET_RX_DESC_PAGGR(pdesc)); rx_status->mactime = GET_RX_DESC_TSFL(pdesc); - if (phystatus == true) { + if (phystatus) { p_drvinfo = (struct rx_fwinfo_92c *)(pdesc + RTL_RX_DESC_SIZE); rtl92c_translate_rx_signal_stuff(hw, skb, stats, pdesc, p_drvinfo); |