George | 442888c | 2011-02-19 16:29:17 -0600 | [diff] [blame] | 1 | /****************************************************************************** |
| 2 | * |
Larry Finger | c1d6604 | 2012-01-07 20:46:45 -0600 | [diff] [blame] | 3 | * Copyright(c) 2009-2012 Realtek Corporation. All rights reserved. |
George | 442888c | 2011-02-19 16:29:17 -0600 | [diff] [blame] | 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify it |
| 6 | * under the terms of version 2 of the GNU General Public License as |
| 7 | * published by the Free Software Foundation. |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, but WITHOUT |
| 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
| 12 | * more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License along with |
| 15 | * this program; if not, write to the Free Software Foundation, Inc., |
| 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA |
| 17 | * |
| 18 | * The full GNU General Public License is included in this distribution in the |
| 19 | * file called LICENSE. |
| 20 | * |
| 21 | * Contact Information: |
| 22 | * wlanfae <wlanfae@realtek.com> |
| 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, |
| 24 | * Hsinchu 300, Taiwan. |
| 25 | * |
| 26 | * Larry Finger <Larry.Finger@lwfinger.net> |
| 27 | * |
| 28 | *****************************************************************************/ |
| 29 | |
| 30 | #include "../wifi.h" |
| 31 | #include "../core.h" |
| 32 | #include "../usb.h" |
| 33 | #include "../efuse.h" |
Larry Finger | 5784935 | 2013-09-26 13:25:28 -0500 | [diff] [blame] | 34 | #include "../base.h" |
George | 442888c | 2011-02-19 16:29:17 -0600 | [diff] [blame] | 35 | #include "reg.h" |
| 36 | #include "def.h" |
| 37 | #include "phy.h" |
| 38 | #include "mac.h" |
| 39 | #include "dm.h" |
Larry Finger | 1472d3a | 2011-02-23 10:24:58 -0600 | [diff] [blame] | 40 | #include "rf.h" |
George | 442888c | 2011-02-19 16:29:17 -0600 | [diff] [blame] | 41 | #include "sw.h" |
| 42 | #include "trx.h" |
| 43 | #include "led.h" |
| 44 | #include "hw.h" |
Larry Finger | 9f087a9 | 2014-09-26 16:40:26 -0500 | [diff] [blame] | 45 | #include "../rtl8192c/fw_common.h" |
Paul Gortmaker | 9d9779e | 2011-07-03 15:21:01 -0400 | [diff] [blame] | 46 | #include <linux/module.h> |
George | 442888c | 2011-02-19 16:29:17 -0600 | [diff] [blame] | 47 | |
| 48 | MODULE_AUTHOR("Georgia <georgia@realtek.com>"); |
| 49 | MODULE_AUTHOR("Ziv Huang <ziv_huang@realtek.com>"); |
| 50 | MODULE_AUTHOR("Larry Finger <Larry.Finger@lwfinger.net>"); |
| 51 | MODULE_LICENSE("GPL"); |
| 52 | MODULE_DESCRIPTION("Realtek 8192C/8188C 802.11n USB wireless"); |
| 53 | MODULE_FIRMWARE("rtlwifi/rtl8192cufw.bin"); |
Larry Finger | 62009b7 | 2013-11-18 11:11:26 -0600 | [diff] [blame] | 54 | MODULE_FIRMWARE("rtlwifi/rtl8192cufw_A.bin"); |
| 55 | MODULE_FIRMWARE("rtlwifi/rtl8192cufw_B.bin"); |
| 56 | MODULE_FIRMWARE("rtlwifi/rtl8192cufw_TMSC.bin"); |
George | 442888c | 2011-02-19 16:29:17 -0600 | [diff] [blame] | 57 | |
| 58 | static int rtl92cu_init_sw_vars(struct ieee80211_hw *hw) |
| 59 | { |
| 60 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
Larry Finger | 9935d12 | 2011-06-21 10:48:31 -0500 | [diff] [blame] | 61 | int err; |
Larry Finger | cf4747d | 2016-10-12 13:54:04 -0500 | [diff] [blame] | 62 | char *fw_name; |
George | 442888c | 2011-02-19 16:29:17 -0600 | [diff] [blame] | 63 | |
Rusty Russell | 3db1cd5 | 2011-12-19 13:56:45 +0000 | [diff] [blame] | 64 | rtlpriv->dm.dm_initialgain_enable = true; |
George | 442888c | 2011-02-19 16:29:17 -0600 | [diff] [blame] | 65 | rtlpriv->dm.dm_flag = 0; |
Rusty Russell | 3db1cd5 | 2011-12-19 13:56:45 +0000 | [diff] [blame] | 66 | rtlpriv->dm.disable_framebursting = false; |
George | 442888c | 2011-02-19 16:29:17 -0600 | [diff] [blame] | 67 | rtlpriv->dm.thermalvalue = 0; |
Larry Finger | 73a253c | 2011-10-07 11:27:33 -0500 | [diff] [blame] | 68 | rtlpriv->dbg.global_debuglevel = rtlpriv->cfg->mod_params->debug; |
Larry Finger | b68d0ae | 2015-12-14 16:34:38 -0600 | [diff] [blame] | 69 | rtlpriv->cfg->mod_params->sw_crypto = |
| 70 | rtlpriv->cfg->mod_params->sw_crypto; |
Larry Finger | b0302ab | 2012-01-30 09:54:49 -0600 | [diff] [blame] | 71 | |
| 72 | /* for firmware buf */ |
| 73 | rtlpriv->rtlhal.pfirmware = vzalloc(0x4000); |
George | 442888c | 2011-02-19 16:29:17 -0600 | [diff] [blame] | 74 | if (!rtlpriv->rtlhal.pfirmware) { |
| 75 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, |
Joe Perches | f30d750 | 2012-01-04 19:40:41 -0800 | [diff] [blame] | 76 | "Can't alloc buffer for fw\n"); |
George | 442888c | 2011-02-19 16:29:17 -0600 | [diff] [blame] | 77 | return 1; |
| 78 | } |
Larry Finger | 62009b7 | 2013-11-18 11:11:26 -0600 | [diff] [blame] | 79 | if (IS_VENDOR_UMC_A_CUT(rtlpriv->rtlhal.version) && |
| 80 | !IS_92C_SERIAL(rtlpriv->rtlhal.version)) { |
Larry Finger | cf4747d | 2016-10-12 13:54:04 -0500 | [diff] [blame] | 81 | fw_name = "rtlwifi/rtl8192cufw_A.bin"; |
Larry Finger | 9f087a9 | 2014-09-26 16:40:26 -0500 | [diff] [blame] | 82 | } else if (IS_81XXC_VENDOR_UMC_B_CUT(rtlpriv->rtlhal.version)) { |
Larry Finger | cf4747d | 2016-10-12 13:54:04 -0500 | [diff] [blame] | 83 | fw_name = "rtlwifi/rtl8192cufw_B.bin"; |
Larry Finger | 62009b7 | 2013-11-18 11:11:26 -0600 | [diff] [blame] | 84 | } else { |
Larry Finger | cf4747d | 2016-10-12 13:54:04 -0500 | [diff] [blame] | 85 | fw_name = "rtlwifi/rtl8192cufw_TMSC.bin"; |
Larry Finger | 62009b7 | 2013-11-18 11:11:26 -0600 | [diff] [blame] | 86 | } |
| 87 | /* provide name of alternative file */ |
| 88 | rtlpriv->cfg->alt_fw_name = "rtlwifi/rtl8192cufw.bin"; |
Larry Finger | cf4747d | 2016-10-12 13:54:04 -0500 | [diff] [blame] | 89 | pr_info("Loading firmware %s\n", fw_name); |
Larry Finger | b0302ab | 2012-01-30 09:54:49 -0600 | [diff] [blame] | 90 | rtlpriv->max_fw_size = 0x4000; |
| 91 | err = request_firmware_nowait(THIS_MODULE, 1, |
Larry Finger | cf4747d | 2016-10-12 13:54:04 -0500 | [diff] [blame] | 92 | fw_name, rtlpriv->io.dev, |
Larry Finger | b0302ab | 2012-01-30 09:54:49 -0600 | [diff] [blame] | 93 | GFP_KERNEL, hw, rtl_fw_cb); |
Larry Finger | 0b94834 | 2013-02-01 10:40:25 -0600 | [diff] [blame] | 94 | return err; |
George | 442888c | 2011-02-19 16:29:17 -0600 | [diff] [blame] | 95 | } |
| 96 | |
| 97 | static void rtl92cu_deinit_sw_vars(struct ieee80211_hw *hw) |
| 98 | { |
| 99 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
| 100 | |
| 101 | if (rtlpriv->rtlhal.pfirmware) { |
| 102 | vfree(rtlpriv->rtlhal.pfirmware); |
| 103 | rtlpriv->rtlhal.pfirmware = NULL; |
| 104 | } |
| 105 | } |
| 106 | |
Karsten Wiese | b2d624a | 2014-10-22 15:47:32 +0200 | [diff] [blame] | 107 | /* get bt coexist status */ |
| 108 | static bool rtl92cu_get_btc_status(void) |
| 109 | { |
| 110 | return false; |
| 111 | } |
| 112 | |
George | 442888c | 2011-02-19 16:29:17 -0600 | [diff] [blame] | 113 | static struct rtl_hal_ops rtl8192cu_hal_ops = { |
| 114 | .init_sw_vars = rtl92cu_init_sw_vars, |
| 115 | .deinit_sw_vars = rtl92cu_deinit_sw_vars, |
| 116 | .read_chip_version = rtl92c_read_chip_version, |
| 117 | .read_eeprom_info = rtl92cu_read_eeprom_info, |
| 118 | .enable_interrupt = rtl92c_enable_interrupt, |
| 119 | .disable_interrupt = rtl92c_disable_interrupt, |
| 120 | .hw_init = rtl92cu_hw_init, |
| 121 | .hw_disable = rtl92cu_card_disable, |
| 122 | .set_network_type = rtl92cu_set_network_type, |
| 123 | .set_chk_bssid = rtl92cu_set_check_bssid, |
| 124 | .set_qos = rtl92c_set_qos, |
| 125 | .set_bcn_reg = rtl92cu_set_beacon_related_registers, |
| 126 | .set_bcn_intv = rtl92cu_set_beacon_interval, |
| 127 | .update_interrupt_mask = rtl92cu_update_interrupt_mask, |
| 128 | .get_hw_reg = rtl92cu_get_hw_reg, |
| 129 | .set_hw_reg = rtl92cu_set_hw_reg, |
Larry Finger | 5b8df24 | 2013-05-30 18:05:55 -0500 | [diff] [blame] | 130 | .update_rate_tbl = rtl92cu_update_hal_rate_tbl, |
George | 442888c | 2011-02-19 16:29:17 -0600 | [diff] [blame] | 131 | .fill_tx_desc = rtl92cu_tx_fill_desc, |
| 132 | .fill_fake_txdesc = rtl92cu_fill_fake_txdesc, |
| 133 | .fill_tx_cmddesc = rtl92cu_tx_fill_cmddesc, |
George | 442888c | 2011-02-19 16:29:17 -0600 | [diff] [blame] | 134 | .query_rx_desc = rtl92cu_rx_query_desc, |
| 135 | .set_channel_access = rtl92cu_update_channel_access_setting, |
| 136 | .radio_onoff_checking = rtl92cu_gpio_radio_on_off_checking, |
| 137 | .set_bw_mode = rtl92c_phy_set_bw_mode, |
| 138 | .switch_channel = rtl92c_phy_sw_chnl, |
| 139 | .dm_watchdog = rtl92c_dm_watchdog, |
Larry Finger | 5784935 | 2013-09-26 13:25:28 -0500 | [diff] [blame] | 140 | .scan_operation_backup = rtl_phy_scan_operation_backup, |
Larry Finger | 1472d3a | 2011-02-23 10:24:58 -0600 | [diff] [blame] | 141 | .set_rf_power_state = rtl92cu_phy_set_rf_power_state, |
George | 442888c | 2011-02-19 16:29:17 -0600 | [diff] [blame] | 142 | .led_control = rtl92cu_led_control, |
| 143 | .enable_hw_sec = rtl92cu_enable_hw_security_config, |
| 144 | .set_key = rtl92c_set_key, |
| 145 | .init_sw_leds = rtl92cu_init_sw_leds, |
| 146 | .deinit_sw_leds = rtl92cu_deinit_sw_leds, |
| 147 | .get_bbreg = rtl92c_phy_query_bb_reg, |
| 148 | .set_bbreg = rtl92c_phy_set_bb_reg, |
Larry Finger | 1472d3a | 2011-02-23 10:24:58 -0600 | [diff] [blame] | 149 | .get_rfreg = rtl92cu_phy_query_rf_reg, |
| 150 | .set_rfreg = rtl92cu_phy_set_rf_reg, |
| 151 | .phy_rf6052_config = rtl92cu_phy_rf6052_config, |
| 152 | .phy_rf6052_set_cck_txpower = rtl92cu_phy_rf6052_set_cck_txpower, |
| 153 | .phy_rf6052_set_ofdm_txpower = rtl92cu_phy_rf6052_set_ofdm_txpower, |
| 154 | .config_bb_with_headerfile = _rtl92cu_phy_config_bb_with_headerfile, |
| 155 | .config_bb_with_pgheaderfile = _rtl92cu_phy_config_bb_with_pgheaderfile, |
| 156 | .phy_lc_calibrate = _rtl92cu_phy_lc_calibrate, |
| 157 | .phy_set_bw_mode_callback = rtl92cu_phy_set_bw_mode_callback, |
| 158 | .dm_dynamic_txpower = rtl92cu_dm_dynamic_txpower, |
Larry Finger | 5b8df24 | 2013-05-30 18:05:55 -0500 | [diff] [blame] | 159 | .fill_h2c_cmd = rtl92c_fill_h2c_cmd, |
Karsten Wiese | b2d624a | 2014-10-22 15:47:32 +0200 | [diff] [blame] | 160 | .get_btc_status = rtl92cu_get_btc_status, |
George | 442888c | 2011-02-19 16:29:17 -0600 | [diff] [blame] | 161 | }; |
| 162 | |
| 163 | static struct rtl_mod_params rtl92cu_mod_params = { |
| 164 | .sw_crypto = 0, |
Larry Finger | 73a253c | 2011-10-07 11:27:33 -0500 | [diff] [blame] | 165 | .debug = DBG_EMERG, |
George | 442888c | 2011-02-19 16:29:17 -0600 | [diff] [blame] | 166 | }; |
| 167 | |
Larry Finger | 73a253c | 2011-10-07 11:27:33 -0500 | [diff] [blame] | 168 | module_param_named(swenc, rtl92cu_mod_params.sw_crypto, bool, 0444); |
| 169 | module_param_named(debug, rtl92cu_mod_params.debug, int, 0444); |
| 170 | MODULE_PARM_DESC(swenc, "Set to 1 for software crypto (default 0)\n"); |
| 171 | MODULE_PARM_DESC(debug, "Set debug level (0-5) (default 0)"); |
| 172 | |
George | 442888c | 2011-02-19 16:29:17 -0600 | [diff] [blame] | 173 | static struct rtl_hal_usbint_cfg rtl92cu_interface_cfg = { |
| 174 | /* rx */ |
| 175 | .in_ep_num = RTL92C_USB_BULK_IN_NUM, |
| 176 | .rx_urb_num = RTL92C_NUM_RX_URBS, |
| 177 | .rx_max_size = RTL92C_SIZE_MAX_RX_BUFFER, |
| 178 | .usb_rx_hdl = rtl8192cu_rx_hdl, |
| 179 | .usb_rx_segregate_hdl = NULL, /* rtl8192c_rx_segregate_hdl; */ |
| 180 | /* tx */ |
| 181 | .usb_tx_cleanup = rtl8192c_tx_cleanup, |
| 182 | .usb_tx_post_hdl = rtl8192c_tx_post_hdl, |
| 183 | .usb_tx_aggregate_hdl = rtl8192c_tx_aggregate_hdl, |
| 184 | /* endpoint mapping */ |
| 185 | .usb_endpoint_mapping = rtl8192cu_endpoint_mapping, |
| 186 | .usb_mq_to_hwq = rtl8192cu_mq_to_hwq, |
| 187 | }; |
| 188 | |
| 189 | static struct rtl_hal_cfg rtl92cu_hal_cfg = { |
| 190 | .name = "rtl92c_usb", |
George | 442888c | 2011-02-19 16:29:17 -0600 | [diff] [blame] | 191 | .ops = &rtl8192cu_hal_ops, |
| 192 | .mod_params = &rtl92cu_mod_params, |
| 193 | .usb_interface_cfg = &rtl92cu_interface_cfg, |
| 194 | |
| 195 | .maps[SYS_ISO_CTRL] = REG_SYS_ISO_CTRL, |
| 196 | .maps[SYS_FUNC_EN] = REG_SYS_FUNC_EN, |
| 197 | .maps[SYS_CLK] = REG_SYS_CLKR, |
| 198 | .maps[MAC_RCR_AM] = AM, |
| 199 | .maps[MAC_RCR_AB] = AB, |
| 200 | .maps[MAC_RCR_ACRC32] = ACRC32, |
| 201 | .maps[MAC_RCR_ACF] = ACF, |
| 202 | .maps[MAC_RCR_AAP] = AAP, |
| 203 | |
| 204 | .maps[EFUSE_TEST] = REG_EFUSE_TEST, |
| 205 | .maps[EFUSE_CTRL] = REG_EFUSE_CTRL, |
| 206 | .maps[EFUSE_CLK] = 0, |
| 207 | .maps[EFUSE_CLK_CTRL] = REG_EFUSE_CTRL, |
| 208 | .maps[EFUSE_PWC_EV12V] = PWC_EV12V, |
| 209 | .maps[EFUSE_FEN_ELDR] = FEN_ELDR, |
| 210 | .maps[EFUSE_LOADER_CLK_EN] = LOADER_CLK_EN, |
| 211 | .maps[EFUSE_ANA8M] = EFUSE_ANA8M, |
| 212 | .maps[EFUSE_HWSET_MAX_SIZE] = HWSET_MAX_SIZE, |
| 213 | .maps[EFUSE_MAX_SECTION_MAP] = EFUSE_MAX_SECTION, |
| 214 | .maps[EFUSE_REAL_CONTENT_SIZE] = EFUSE_REAL_CONTENT_LEN, |
| 215 | |
| 216 | .maps[RWCAM] = REG_CAMCMD, |
| 217 | .maps[WCAMI] = REG_CAMWRITE, |
| 218 | .maps[RCAMO] = REG_CAMREAD, |
| 219 | .maps[CAMDBG] = REG_CAMDBG, |
| 220 | .maps[SECR] = REG_SECCFG, |
| 221 | .maps[SEC_CAM_NONE] = CAM_NONE, |
| 222 | .maps[SEC_CAM_WEP40] = CAM_WEP40, |
| 223 | .maps[SEC_CAM_TKIP] = CAM_TKIP, |
| 224 | .maps[SEC_CAM_AES] = CAM_AES, |
| 225 | .maps[SEC_CAM_WEP104] = CAM_WEP104, |
| 226 | |
| 227 | .maps[RTL_IMR_BCNDMAINT6] = IMR_BCNDMAINT6, |
| 228 | .maps[RTL_IMR_BCNDMAINT5] = IMR_BCNDMAINT5, |
| 229 | .maps[RTL_IMR_BCNDMAINT4] = IMR_BCNDMAINT4, |
| 230 | .maps[RTL_IMR_BCNDMAINT3] = IMR_BCNDMAINT3, |
| 231 | .maps[RTL_IMR_BCNDMAINT2] = IMR_BCNDMAINT2, |
| 232 | .maps[RTL_IMR_BCNDMAINT1] = IMR_BCNDMAINT1, |
| 233 | .maps[RTL_IMR_BCNDOK8] = IMR_BCNDOK8, |
| 234 | .maps[RTL_IMR_BCNDOK7] = IMR_BCNDOK7, |
| 235 | .maps[RTL_IMR_BCNDOK6] = IMR_BCNDOK6, |
| 236 | .maps[RTL_IMR_BCNDOK5] = IMR_BCNDOK5, |
| 237 | .maps[RTL_IMR_BCNDOK4] = IMR_BCNDOK4, |
| 238 | .maps[RTL_IMR_BCNDOK3] = IMR_BCNDOK3, |
| 239 | .maps[RTL_IMR_BCNDOK2] = IMR_BCNDOK2, |
| 240 | .maps[RTL_IMR_BCNDOK1] = IMR_BCNDOK1, |
| 241 | .maps[RTL_IMR_TIMEOUT2] = IMR_TIMEOUT2, |
| 242 | .maps[RTL_IMR_TIMEOUT1] = IMR_TIMEOUT1, |
| 243 | |
| 244 | .maps[RTL_IMR_TXFOVW] = IMR_TXFOVW, |
| 245 | .maps[RTL_IMR_PSTIMEOUT] = IMR_PSTIMEOUT, |
Larry Finger | e6deaf8 | 2013-03-24 22:06:55 -0500 | [diff] [blame] | 246 | .maps[RTL_IMR_BCNINT] = IMR_BCNINT, |
George | 442888c | 2011-02-19 16:29:17 -0600 | [diff] [blame] | 247 | .maps[RTL_IMR_RXFOVW] = IMR_RXFOVW, |
| 248 | .maps[RTL_IMR_RDU] = IMR_RDU, |
| 249 | .maps[RTL_IMR_ATIMEND] = IMR_ATIMEND, |
| 250 | .maps[RTL_IMR_BDOK] = IMR_BDOK, |
| 251 | .maps[RTL_IMR_MGNTDOK] = IMR_MGNTDOK, |
| 252 | .maps[RTL_IMR_TBDER] = IMR_TBDER, |
| 253 | .maps[RTL_IMR_HIGHDOK] = IMR_HIGHDOK, |
| 254 | .maps[RTL_IMR_TBDOK] = IMR_TBDOK, |
| 255 | .maps[RTL_IMR_BKDOK] = IMR_BKDOK, |
| 256 | .maps[RTL_IMR_BEDOK] = IMR_BEDOK, |
| 257 | .maps[RTL_IMR_VIDOK] = IMR_VIDOK, |
| 258 | .maps[RTL_IMR_VODOK] = IMR_VODOK, |
| 259 | .maps[RTL_IMR_ROK] = IMR_ROK, |
| 260 | .maps[RTL_IBSS_INT_MASKS] = (IMR_BCNINT | IMR_TBDOK | IMR_TBDER), |
| 261 | |
Larry Finger | e0e776a | 2014-12-18 03:05:36 -0600 | [diff] [blame] | 262 | .maps[RTL_RC_CCK_RATE1M] = DESC_RATE1M, |
| 263 | .maps[RTL_RC_CCK_RATE2M] = DESC_RATE2M, |
| 264 | .maps[RTL_RC_CCK_RATE5_5M] = DESC_RATE5_5M, |
| 265 | .maps[RTL_RC_CCK_RATE11M] = DESC_RATE11M, |
| 266 | .maps[RTL_RC_OFDM_RATE6M] = DESC_RATE6M, |
| 267 | .maps[RTL_RC_OFDM_RATE9M] = DESC_RATE9M, |
| 268 | .maps[RTL_RC_OFDM_RATE12M] = DESC_RATE12M, |
| 269 | .maps[RTL_RC_OFDM_RATE18M] = DESC_RATE18M, |
| 270 | .maps[RTL_RC_OFDM_RATE24M] = DESC_RATE24M, |
| 271 | .maps[RTL_RC_OFDM_RATE36M] = DESC_RATE36M, |
| 272 | .maps[RTL_RC_OFDM_RATE48M] = DESC_RATE48M, |
| 273 | .maps[RTL_RC_OFDM_RATE54M] = DESC_RATE54M, |
| 274 | .maps[RTL_RC_HT_RATEMCS7] = DESC_RATEMCS7, |
| 275 | .maps[RTL_RC_HT_RATEMCS15] = DESC_RATEMCS15, |
George | 442888c | 2011-02-19 16:29:17 -0600 | [diff] [blame] | 276 | }; |
| 277 | |
| 278 | #define USB_VENDER_ID_REALTEK 0x0bda |
| 279 | |
| 280 | /* 2010-10-19 DID_USB_V3.4 */ |
| 281 | static struct usb_device_id rtl8192c_usb_ids[] = { |
| 282 | |
| 283 | /*=== Realtek demoboard ===*/ |
| 284 | /* Default ID */ |
| 285 | {RTL_USB_DEVICE(USB_VENDER_ID_REALTEK, 0x8191, rtl92cu_hal_cfg)}, |
| 286 | |
| 287 | /****** 8188CU ********/ |
Larry Finger | 6cddafa | 2011-10-18 17:52:01 -0500 | [diff] [blame] | 288 | /* RTL8188CTV */ |
| 289 | {RTL_USB_DEVICE(USB_VENDER_ID_REALTEK, 0x018a, rtl92cu_hal_cfg)}, |
George | 442888c | 2011-02-19 16:29:17 -0600 | [diff] [blame] | 290 | /* 8188CE-VAU USB minCard */ |
| 291 | {RTL_USB_DEVICE(USB_VENDER_ID_REALTEK, 0x8170, rtl92cu_hal_cfg)}, |
| 292 | /* 8188cu 1*1 dongle */ |
| 293 | {RTL_USB_DEVICE(USB_VENDER_ID_REALTEK, 0x8176, rtl92cu_hal_cfg)}, |
| 294 | /* 8188cu 1*1 dongle, (b/g mode only) */ |
| 295 | {RTL_USB_DEVICE(USB_VENDER_ID_REALTEK, 0x8177, rtl92cu_hal_cfg)}, |
| 296 | /* 8188cu Slim Solo */ |
| 297 | {RTL_USB_DEVICE(USB_VENDER_ID_REALTEK, 0x817a, rtl92cu_hal_cfg)}, |
| 298 | /* 8188cu Slim Combo */ |
| 299 | {RTL_USB_DEVICE(USB_VENDER_ID_REALTEK, 0x817b, rtl92cu_hal_cfg)}, |
| 300 | /* 8188RU High-power USB Dongle */ |
| 301 | {RTL_USB_DEVICE(USB_VENDER_ID_REALTEK, 0x817d, rtl92cu_hal_cfg)}, |
| 302 | /* 8188CE-VAU USB minCard (b/g mode only) */ |
| 303 | {RTL_USB_DEVICE(USB_VENDER_ID_REALTEK, 0x817e, rtl92cu_hal_cfg)}, |
Larry Finger | 03f18fa | 2011-08-02 16:52:33 -0500 | [diff] [blame] | 304 | /* 8188RU in Alfa AWUS036NHR */ |
| 305 | {RTL_USB_DEVICE(USB_VENDER_ID_REALTEK, 0x817f, rtl92cu_hal_cfg)}, |
Larry Finger | 6cddafa | 2011-10-18 17:52:01 -0500 | [diff] [blame] | 306 | /* RTL8188CUS-VL */ |
| 307 | {RTL_USB_DEVICE(USB_VENDER_ID_REALTEK, 0x818a, rtl92cu_hal_cfg)}, |
Larry Finger | 8708aac | 2013-02-08 12:28:18 -0600 | [diff] [blame] | 308 | {RTL_USB_DEVICE(USB_VENDER_ID_REALTEK, 0x819a, rtl92cu_hal_cfg)}, |
George | 442888c | 2011-02-19 16:29:17 -0600 | [diff] [blame] | 309 | /* 8188 Combo for BC4 */ |
| 310 | {RTL_USB_DEVICE(USB_VENDER_ID_REALTEK, 0x8754, rtl92cu_hal_cfg)}, |
| 311 | |
| 312 | /****** 8192CU ********/ |
George | 442888c | 2011-02-19 16:29:17 -0600 | [diff] [blame] | 313 | /* 8192cu 2*2 */ |
Larry Finger | 6cddafa | 2011-10-18 17:52:01 -0500 | [diff] [blame] | 314 | {RTL_USB_DEVICE(USB_VENDER_ID_REALTEK, 0x8178, rtl92cu_hal_cfg)}, |
George | 442888c | 2011-02-19 16:29:17 -0600 | [diff] [blame] | 315 | /* 8192CE-VAU USB minCard */ |
| 316 | {RTL_USB_DEVICE(USB_VENDER_ID_REALTEK, 0x817c, rtl92cu_hal_cfg)}, |
| 317 | |
| 318 | /*=== Customer ID ===*/ |
| 319 | /****** 8188CU ********/ |
| 320 | {RTL_USB_DEVICE(0x050d, 0x1102, rtl92cu_hal_cfg)}, /*Belkin - Edimax*/ |
Albert Pool | a485e82 | 2012-10-30 20:58:06 +0100 | [diff] [blame] | 321 | {RTL_USB_DEVICE(0x050d, 0x11f2, rtl92cu_hal_cfg)}, /*Belkin - ISY*/ |
George | 442888c | 2011-02-19 16:29:17 -0600 | [diff] [blame] | 322 | {RTL_USB_DEVICE(0x06f8, 0xe033, rtl92cu_hal_cfg)}, /*Hercules - Edimax*/ |
| 323 | {RTL_USB_DEVICE(0x07b8, 0x8188, rtl92cu_hal_cfg)}, /*Abocom - Abocom*/ |
| 324 | {RTL_USB_DEVICE(0x07b8, 0x8189, rtl92cu_hal_cfg)}, /*Funai - Abocom*/ |
Yoann DI-RUZZA | 35cbcbc | 2011-07-01 08:47:17 -0500 | [diff] [blame] | 325 | {RTL_USB_DEVICE(0x0846, 0x9041, rtl92cu_hal_cfg)}, /*NetGear WNA1000M*/ |
Adrien Schildknecht | 1642d09 | 2015-08-19 17:33:12 +0200 | [diff] [blame] | 326 | {RTL_USB_DEVICE(0x0846, 0x9043, rtl92cu_hal_cfg)}, /*NG WNA1000Mv2*/ |
Marek Vasut | 9374e7d | 2015-03-26 02:16:06 +0100 | [diff] [blame] | 327 | {RTL_USB_DEVICE(0x0b05, 0x17ba, rtl92cu_hal_cfg)}, /*ASUS-Edimax*/ |
Larry Finger | f63d7dab | 2012-06-25 18:01:12 -0500 | [diff] [blame] | 328 | {RTL_USB_DEVICE(0x0bda, 0x5088, rtl92cu_hal_cfg)}, /*Thinkware-CC&C*/ |
Larry Finger | 6cddafa | 2011-10-18 17:52:01 -0500 | [diff] [blame] | 329 | {RTL_USB_DEVICE(0x0df6, 0x0052, rtl92cu_hal_cfg)}, /*Sitecom - Edimax*/ |
| 330 | {RTL_USB_DEVICE(0x0df6, 0x005c, rtl92cu_hal_cfg)}, /*Sitecom - Edimax*/ |
Larry Finger | c665171 | 2014-08-24 17:49:43 -0500 | [diff] [blame] | 331 | {RTL_USB_DEVICE(0x0df6, 0x0070, rtl92cu_hal_cfg)}, /*Sitecom - 150N */ |
Larry Finger | f87f960 | 2014-01-09 10:27:27 -0600 | [diff] [blame] | 332 | {RTL_USB_DEVICE(0x0df6, 0x0077, rtl92cu_hal_cfg)}, /*Sitecom-WLA2100V2*/ |
George | 442888c | 2011-02-19 16:29:17 -0600 | [diff] [blame] | 333 | {RTL_USB_DEVICE(0x0eb0, 0x9071, rtl92cu_hal_cfg)}, /*NO Brand - Etop*/ |
Larry Finger | f63d7dab | 2012-06-25 18:01:12 -0500 | [diff] [blame] | 334 | {RTL_USB_DEVICE(0x4856, 0x0091, rtl92cu_hal_cfg)}, /*NetweeN - Feixun*/ |
George | 442888c | 2011-02-19 16:29:17 -0600 | [diff] [blame] | 335 | /* HP - Lite-On ,8188CUS Slim Combo */ |
| 336 | {RTL_USB_DEVICE(0x103c, 0x1629, rtl92cu_hal_cfg)}, |
Larry Finger | 03f18fa | 2011-08-02 16:52:33 -0500 | [diff] [blame] | 337 | {RTL_USB_DEVICE(0x13d3, 0x3357, rtl92cu_hal_cfg)}, /* AzureWave */ |
George | 442888c | 2011-02-19 16:29:17 -0600 | [diff] [blame] | 338 | {RTL_USB_DEVICE(0x2001, 0x3308, rtl92cu_hal_cfg)}, /*D-Link - Alpha*/ |
Larry Finger | 6cddafa | 2011-10-18 17:52:01 -0500 | [diff] [blame] | 339 | {RTL_USB_DEVICE(0x2019, 0x4902, rtl92cu_hal_cfg)}, /*Planex - Etop*/ |
George | 442888c | 2011-02-19 16:29:17 -0600 | [diff] [blame] | 340 | {RTL_USB_DEVICE(0x2019, 0xab2a, rtl92cu_hal_cfg)}, /*Planex - Abocom*/ |
Larry Finger | 6cddafa | 2011-10-18 17:52:01 -0500 | [diff] [blame] | 341 | /*SW-WF02-AD15 -Abocom*/ |
| 342 | {RTL_USB_DEVICE(0x2019, 0xab2e, rtl92cu_hal_cfg)}, |
George | 442888c | 2011-02-19 16:29:17 -0600 | [diff] [blame] | 343 | {RTL_USB_DEVICE(0x2019, 0xed17, rtl92cu_hal_cfg)}, /*PCI - Edimax*/ |
| 344 | {RTL_USB_DEVICE(0x20f4, 0x648b, rtl92cu_hal_cfg)}, /*TRENDnet - Cameo*/ |
| 345 | {RTL_USB_DEVICE(0x7392, 0x7811, rtl92cu_hal_cfg)}, /*Edimax - Edimax*/ |
Larry Finger | 03f18fa | 2011-08-02 16:52:33 -0500 | [diff] [blame] | 346 | {RTL_USB_DEVICE(0x13d3, 0x3358, rtl92cu_hal_cfg)}, /*Azwave 8188CE-VAU*/ |
George | 442888c | 2011-02-19 16:29:17 -0600 | [diff] [blame] | 347 | /* Russian customer -Azwave (8188CE-VAU b/g mode only) */ |
Larry Finger | 03f18fa | 2011-08-02 16:52:33 -0500 | [diff] [blame] | 348 | {RTL_USB_DEVICE(0x13d3, 0x3359, rtl92cu_hal_cfg)}, |
| 349 | {RTL_USB_DEVICE(0x4855, 0x0090, rtl92cu_hal_cfg)}, /* Feixun */ |
| 350 | {RTL_USB_DEVICE(0x4855, 0x0091, rtl92cu_hal_cfg)}, /* NetweeN-Feixun */ |
| 351 | {RTL_USB_DEVICE(0x9846, 0x9041, rtl92cu_hal_cfg)}, /* Netgear Cameo */ |
George | 442888c | 2011-02-19 16:29:17 -0600 | [diff] [blame] | 352 | |
Larry Finger | 6cddafa | 2011-10-18 17:52:01 -0500 | [diff] [blame] | 353 | /****** 8188 RU ********/ |
| 354 | /* Netcore */ |
| 355 | {RTL_USB_DEVICE(USB_VENDER_ID_REALTEK, 0x317f, rtl92cu_hal_cfg)}, |
| 356 | |
| 357 | /****** 8188CUS Slim Solo********/ |
| 358 | {RTL_USB_DEVICE(0x04f2, 0xaff7, rtl92cu_hal_cfg)}, /*Xavi*/ |
| 359 | {RTL_USB_DEVICE(0x04f2, 0xaff9, rtl92cu_hal_cfg)}, /*Xavi*/ |
| 360 | {RTL_USB_DEVICE(0x04f2, 0xaffa, rtl92cu_hal_cfg)}, /*Xavi*/ |
| 361 | |
| 362 | /****** 8188CUS Slim Combo ********/ |
| 363 | {RTL_USB_DEVICE(0x04f2, 0xaff8, rtl92cu_hal_cfg)}, /*Xavi*/ |
| 364 | {RTL_USB_DEVICE(0x04f2, 0xaffb, rtl92cu_hal_cfg)}, /*Xavi*/ |
| 365 | {RTL_USB_DEVICE(0x04f2, 0xaffc, rtl92cu_hal_cfg)}, /*Xavi*/ |
| 366 | {RTL_USB_DEVICE(0x2019, 0x1201, rtl92cu_hal_cfg)}, /*Planex-Vencer*/ |
| 367 | |
George | 442888c | 2011-02-19 16:29:17 -0600 | [diff] [blame] | 368 | /****** 8192CU ********/ |
Lorenzo Bianconi | 711d8de | 2012-04-08 20:12:35 +0200 | [diff] [blame] | 369 | {RTL_USB_DEVICE(0x050d, 0x1004, rtl92cu_hal_cfg)}, /*Belcom-SurfN300*/ |
Larry Finger | 6cddafa | 2011-10-18 17:52:01 -0500 | [diff] [blame] | 370 | {RTL_USB_DEVICE(0x050d, 0x2102, rtl92cu_hal_cfg)}, /*Belcom-Sercomm*/ |
| 371 | {RTL_USB_DEVICE(0x050d, 0x2103, rtl92cu_hal_cfg)}, /*Belcom-Edimax*/ |
George | 442888c | 2011-02-19 16:29:17 -0600 | [diff] [blame] | 372 | {RTL_USB_DEVICE(0x0586, 0x341f, rtl92cu_hal_cfg)}, /*Zyxel -Abocom*/ |
| 373 | {RTL_USB_DEVICE(0x07aa, 0x0056, rtl92cu_hal_cfg)}, /*ATKK-Gemtek*/ |
| 374 | {RTL_USB_DEVICE(0x07b8, 0x8178, rtl92cu_hal_cfg)}, /*Funai -Abocom*/ |
Larry Finger | 6cddafa | 2011-10-18 17:52:01 -0500 | [diff] [blame] | 375 | {RTL_USB_DEVICE(0x0846, 0x9021, rtl92cu_hal_cfg)}, /*Netgear-Sercomm*/ |
Albert Pool | 707a615 | 2013-05-15 10:03:16 -0500 | [diff] [blame] | 376 | {RTL_USB_DEVICE(0x0846, 0xf001, rtl92cu_hal_cfg)}, /*On Netwrks N300MA*/ |
Larry Finger | 6cddafa | 2011-10-18 17:52:01 -0500 | [diff] [blame] | 377 | {RTL_USB_DEVICE(0x0b05, 0x17ab, rtl92cu_hal_cfg)}, /*ASUS-Edimax*/ |
Larry Finger | f63d7dab | 2012-06-25 18:01:12 -0500 | [diff] [blame] | 378 | {RTL_USB_DEVICE(0x0bda, 0x8186, rtl92cu_hal_cfg)}, /*Realtek 92CE-VAU*/ |
Larry Finger | 6cddafa | 2011-10-18 17:52:01 -0500 | [diff] [blame] | 379 | {RTL_USB_DEVICE(0x0df6, 0x0061, rtl92cu_hal_cfg)}, /*Sitecom-Edimax*/ |
| 380 | {RTL_USB_DEVICE(0x0e66, 0x0019, rtl92cu_hal_cfg)}, /*Hawking-Edimax*/ |
George | 442888c | 2011-02-19 16:29:17 -0600 | [diff] [blame] | 381 | {RTL_USB_DEVICE(0x2001, 0x3307, rtl92cu_hal_cfg)}, /*D-Link-Cameo*/ |
| 382 | {RTL_USB_DEVICE(0x2001, 0x3309, rtl92cu_hal_cfg)}, /*D-Link-Alpha*/ |
| 383 | {RTL_USB_DEVICE(0x2001, 0x330a, rtl92cu_hal_cfg)}, /*D-Link-Alpha*/ |
Larry Finger | 2f92b31 | 2015-03-23 18:14:10 -0500 | [diff] [blame] | 384 | {RTL_USB_DEVICE(0x2001, 0x330d, rtl92cu_hal_cfg)}, /*D-Link DWA-131 */ |
George | 442888c | 2011-02-19 16:29:17 -0600 | [diff] [blame] | 385 | {RTL_USB_DEVICE(0x2019, 0xab2b, rtl92cu_hal_cfg)}, /*Planex -Abocom*/ |
Larry Finger | 6cddafa | 2011-10-18 17:52:01 -0500 | [diff] [blame] | 386 | {RTL_USB_DEVICE(0x20f4, 0x624d, rtl92cu_hal_cfg)}, /*TRENDNet*/ |
Larry Finger | c4d827c | 2013-06-17 13:25:49 -0500 | [diff] [blame] | 387 | {RTL_USB_DEVICE(0x2357, 0x0100, rtl92cu_hal_cfg)}, /*TP-Link WN8200ND*/ |
George | 442888c | 2011-02-19 16:29:17 -0600 | [diff] [blame] | 388 | {RTL_USB_DEVICE(0x7392, 0x7822, rtl92cu_hal_cfg)}, /*Edimax -Edimax*/ |
| 389 | {} |
| 390 | }; |
| 391 | |
| 392 | MODULE_DEVICE_TABLE(usb, rtl8192c_usb_ids); |
| 393 | |
Larry Finger | 957f4ac | 2013-02-06 12:54:17 -0600 | [diff] [blame] | 394 | static int rtl8192cu_probe(struct usb_interface *intf, |
| 395 | const struct usb_device_id *id) |
| 396 | { |
| 397 | return rtl_usb_probe(intf, id, &rtl92cu_hal_cfg); |
| 398 | } |
| 399 | |
George | 442888c | 2011-02-19 16:29:17 -0600 | [diff] [blame] | 400 | static struct usb_driver rtl8192cu_driver = { |
| 401 | .name = "rtl8192cu", |
Larry Finger | 957f4ac | 2013-02-06 12:54:17 -0600 | [diff] [blame] | 402 | .probe = rtl8192cu_probe, |
George | 442888c | 2011-02-19 16:29:17 -0600 | [diff] [blame] | 403 | .disconnect = rtl_usb_disconnect, |
| 404 | .id_table = rtl8192c_usb_ids, |
| 405 | |
| 406 | #ifdef CONFIG_PM |
| 407 | /* .suspend = rtl_usb_suspend, */ |
| 408 | /* .resume = rtl_usb_resume, */ |
| 409 | /* .reset_resume = rtl8192c_resume, */ |
| 410 | #endif /* CONFIG_PM */ |
Sarah Sharp | e1f12eb | 2012-04-23 10:08:51 -0700 | [diff] [blame] | 411 | .disable_hub_initiated_lpm = 1, |
George | 442888c | 2011-02-19 16:29:17 -0600 | [diff] [blame] | 412 | }; |
| 413 | |
Greg Kroah-Hartman | d632eb1 | 2011-11-18 09:44:20 -0800 | [diff] [blame] | 414 | module_usb_driver(rtl8192cu_driver); |