summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* rtl8xxxu: Rename rtl8xxxu.c to rtl8xxxu_core.cJes Sorensen2016-05-031-10213/+0
| | | | | | | | | This renames the core file to rtl8xxxu_core.c in order to allow us to keep the module nake rtl8xxxu.ko when refactoring the code into multiple files. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: Rename rtl8723au_iqk_phy_iq_bb_regJes Sorensen2016-04-261-4/+4
| | | | | | | | There is nothing 8723au specific about rtl8723au_iqk_phy_iq_bb_reg so rename the array to rtl8xxxu_iqk_phy_iq_bb_reg. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: Rename rtl8723bu_simularity_compare()Jes Sorensen2016-04-261-8/+14
| | | | | | | | | This renames rtl8723bu_simularity_compare() to rtl8xxxu_gen2_simularity_compare() to reflect it is used for all gen2 parts. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: Rename rtl8723b_channel_to_group()Jes Sorensen2016-04-261-3/+3
| | | | | | | | | This renames rtl8723b_channel_to_group() to rtl8xxxu_gen2_channel_to_group() to reflect it is used by all currently supported gen2 parts. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: Rename rtl8723a_mac_init_table to rtl8xxxu_gen1_mac_init_tableJes Sorensen2016-04-261-3/+3
| | | | | | | | All currently supported gen1 parts use the same mac_init_table, so rename it to reflect this. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: Rename rtl8723a_enable_rf() to rtl8xxxu_gen1_enable_rf()Jes Sorensen2016-04-261-3/+3
| | | | | | | | All gen1 parts use the same enable_rf() function, so rename it to reflect this. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: Rename rtl8723a_set_tx_power() to rtl8xxxu_gen1_set_tx_power()Jes Sorensen2016-04-261-3/+3
| | | | | | | | All gen1 parts use the same interface for setting TX power, so rename the function to reflect this. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: Rename rtl8723au_init_phy_bb() to rtl8xxxu_gen1_init_phy_bb()Jes Sorensen2016-04-261-3/+3
| | | | | | | | All gen1 parts use the same init_phy_bb() function, so rename it to reflect this. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: Rename rtl8723au_phy_iq_calibrate() to ↵Jes Sorensen2016-04-261-3/+3
| | | | | | | | | | rtl8xxxu_gen1_phy_iq_calibrate() All supported gen1 parts use the same phy_iq_calibrate() function (unlike their gen2 counterparts). Rename the function to reflect this. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: Rename rtl8723au_update_rate_mask() to rtl8xxxu_update_rate_mask()Jes Sorensen2016-04-261-4/+4
| | | | | | | | All currently supported gen1 parts use the same function for updating the rate mask, so rename it to reflect this. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: Rename rtl8723au_config_channel() to rtl8xxxu_gen1_config_channel()Jes Sorensen2016-04-261-3/+3
| | | | | | | | All supported gen1 parts use the same config_channel() function, so rename it to reflect this. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: Rename rtl8723a_disable_rf() to rtl8xxxu_gen1_disable_rf()Jes Sorensen2016-04-261-3/+3
| | | | | | | | All currently supported gen1 parts use the same disable_rf() routine, so rename the function to reflect that. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: Rename rtl8723b_disable_rf() to rtl8xxxu_gen2_disable_rf()Jes Sorensen2016-04-261-3/+3
| | | | | | | At least for now, all gen2 parts use the same disable_rf() function Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: Rename rtl8723bu_config_channel() to rtl8xxxu_gen2_config_channel()Jes Sorensen2016-04-261-3/+3
| | | | | | | | Rename the function to indicate it is applicable to most/all gen2 parts. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: Rename rtl8723au_report_connect() to rtl8xxxu_gen1_report_connect()Jes Sorensen2016-04-261-4/+4
| | | | | | | Rename the function to reflect it is for all/most gen1 parts. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: Rename rtl8723bu_report_connect() to rtl8xxxu_gen2_report_connect()Jes Sorensen2016-04-261-4/+4
| | | | | | | Make the name reflect this is for most/all gen2 parts. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: Rename rtl8723bu_update_rate_mask() to ↵Jes Sorensen2016-04-261-4/+4
| | | | | | | | | | rtl8xxxu_gen2_update_rate_mask() Update the name of rtl8723bu_update_rate_mask() to make it reflect it's applicable for all/most gen2 N parts. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: hide unused tablesArnd Bergmann2016-04-211-0/+4
| | | | | | | | | | | | | | | | | | | The references to some arrays in the rtl8xxxu driver were moved inside of an #ifdef, but the symbols remain outside, resulting in build warnings: rtl8xxxu/rtl8xxxu.c:1506:33: error: 'rtl8188ru_radioa_1t_highpa_table' defined but not used rtl8xxxu/rtl8xxxu.c:1431:33: error: 'rtl8192cu_radioa_1t_init_table' defined but not used rtl8xxxu/rtl8xxxu.c:1407:33: error: 'rtl8192cu_radiob_2t_init_table' defined but not used rtl8xxxu/rtl8xxxu.c:1332:33: error: 'rtl8192cu_radioa_2t_init_table' defined but not used rtl8xxxu/rtl8xxxu.c:239:35: error: 'rtl8192c_power_base' defined but not used rtl8xxxu/rtl8xxxu.c:217:35: error: 'rtl8188r_power_base' defined but not used This adds an extra #ifdef around them to shut up the warnings. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: 2fc0b8e5a17d ("rtl8xxxu: Add TX power base values for gen1 parts") Fixes: 4062b8ffec36 ("rtl8xxxu: Move PHY RF init into device specific functions") Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: Pause TX before calling disable_rf()Jes Sorensen2016-04-151-4/+2
| | | | | | | | | All the disable_rf() functions were setting REG_TXPAUSE to 0xff to stop transmission. Do it centrally before calling disable_rf() instead. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: Implement rtl8192e_enable_rf()Jes Sorensen2016-04-151-1/+38
| | | | | | | | | This implements an 8192eu specific enable_rf() function. The 8192eu is not a combo device, so no need for doing the BT specific bits needed by the 8723bu. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: Fix OOPS if user tries to add device via /sysJes Sorensen2016-04-151-0/+1
| | | | | | | | | | | | This driver relies on driver_info in struct usb_device_id, so allowing adding a device via /sys/bus/usb/drivers/rtl8xxxu/new_id will cause a NULL pointer dereference. Set .no_dynamic_id = 1 to disable hot add of USB IDs. Reported-by: Xose Vazquez Perez <xose.vazquez@gmail.com> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: Fix 8188RU supportJes Sorensen2016-04-151-7/+14
| | | | | | | | | | The 8188RU does not like PAPE to be enabled, while all the other gen1 parts seem to require it. This makes the RTL8188RU able to associate for me. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: Add TX power base values for gen1 partsJes Sorensen2016-04-151-14/+104
| | | | | Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: Set register 0xfe10 on rtl8192cu based partsJes Sorensen2016-04-151-0/+2
| | | | | | | | This register is undocumented in the vendor code, but it is set unconditionally for all 8192cu/8188cu/8188ru parts. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: Update copyright statement to include 2016Jes Sorensen2016-04-151-1/+1
| | | | | Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: Unregister from mac80211 before shutting down the deviceJes Sorensen2016-04-151-10/+4
| | | | | | | | This fixes a long standing bug where mac80211 would send disconnect packets to the device, after we had shut down the device. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: Match 8723bu power down sequence to vendor driverJes Sorensen2016-04-151-4/+12
| | | | | | | | In particular set APS_FSMCO_WLON_RESET in the right register, and do not overwrite too much of REG_CR. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: Use rtl_chip == RTL8188R to identify high PA partsJes Sorensen2016-04-151-7/+5
| | | | | | | This is simpler than checking for RTL8188C && hi_pa. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: Apply 8188RU workaround for UMC B cut parts correctlyJes Sorensen2016-04-151-1/+1
| | | | | | | | This patch was being missed since rtl_chip will never match RTL8188C if hi_pa is true. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: For devices with external PA (8188RU), limit CCK TX powerJes Sorensen2016-04-151-0/+7
| | | | | | | | Per the vendor driver, devices with an external PA needs limiting it's TX power to 0x20. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: Move PHY RF init into device specific functionsJes Sorensen2016-04-151-54/+79
| | | | | | | | | Load the RF table in init_phy_rf(), which allows for applying device specific RF hacks in the same place. Getting rid of more ugly if () clutter. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: fix uninitialized return value in retColin Ian King2016-04-151-3/+3
| | | | | | | | | | | | several functions are not initializing a return status in ret resulting in garbage to be returned instead of 0 for success. Currently, the calls to these functions are not checking the return, however, it seems prudent to return the correct status in case they are to be checked at a later date. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: Mark 0x050d:0x1004 as testedJes Sorensen2016-04-151-2/+7
| | | | | | | | This dongle was tested successfully by Andrea Merello Reported-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* Re-enable 8192eu supportJes Sorensen2016-04-151-4/+0
| | | | | | | | | Revert "rtl8xxxu: Temporarily disable 8192eu device init" This reverts commit ccfe1e85322090649d2fae599e55300c1512bf15. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: 8192eu Fix bug in LDPC RX hang fixJes Sorensen2016-04-151-1/+1
| | | | | | | Write the adjusted value back to the correct register Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: Remove unneeded 8192eu hackJes Sorensen2016-04-151-9/+6
| | | | | | | | | This removes an unneeded hack for 8192eu, and allows for initializing REG_FPGA0_XAB_RF_SW_CTRL at the same point as it is done for all other parts. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: Split USB quirks into gen1 and gen2 quirksJes Sorensen2016-04-151-40/+55
| | | | | | | | This removes a bunch of if () spaghetti and re-applies the USB bus quirks for 8188/8192 that had gotten lost. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: Make PBP tuning a fileops parameterJes Sorensen2016-04-151-7/+10
| | | | | | | | Rather than scattering the code with #ifdefs, use the fileops structure to hold device specific PBP values. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: Do not backup RF_MODE_AG when it's never being usedJes Sorensen2016-04-151-3/+0
| | | | | | | | This was expired by the vendor driver, but we never ended up using the backed up value. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: Store device specific TRXFF boundary in the fileopsJes Sorensen2016-04-151-6/+5
| | | | | | | This removes another case of ugly if () clutter Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: REG_LDOA15_CTRL is only used on gen1 partsJes Sorensen2016-04-151-13/+9
| | | | | | | Move setting it to rtl8723au_init_phy_bb() Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: Move loading of AGC table to device specific functionJes Sorensen2016-04-151-14/+12
| | | | | | | | This moves the loading of the AGC table into init_phy_bb() and reduces the if() clutter. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: Load AGC table before patching for 1T2R partsJes Sorensen2016-04-151-14/+14
| | | | | | | | This should get the order right and avoid patching something that is later overwritten. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: Split rtl8xxxu_init_phy_bb() into device specific functionsJes Sorensen2016-04-151-58/+76
| | | | | | | | | This reduces the if () clutter. Longer term it probably makes sense to split this between gen1 (8723au/8188cu/8192cu) and gen2 (8192eu/8723bu) devices. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: Use descriptive bits for setting RX paths for 1T2R partsJes Sorensen2016-04-151-1/+3
| | | | | | | This reduce the use of magic values a little. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: Correctly mask what was read from REG_CCK0_AFE_SETTINGJes Sorensen2016-04-151-1/+1
| | | | | | | | The old code incorrectly wiped out bits 0-23 by mistake when setting the RX path for 1T parts. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: Remove unused 8723bu path B IQ calibration codeJes Sorensen2016-04-151-73/+3
| | | | | | | | The 8723bu is a combo WiFi/BT dongle, and path B is not used for WiFi, so no point in calibrating it. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: Remove misleading warning from rtl8192eu_phy_iqcalibrate()Jes Sorensen2016-04-151-2/+0
| | | | | | | | No actual code flow change, but no need to warn about something that isn't a prioblem. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: Name RX descriptor types rxdesc16/rxdesc24Jes Sorensen2016-04-151-16/+22
| | | | | | | | This caught a bug where too little memory was allocated for RX urbs for parts using 24 byte RX descriptors Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* rtl8xxxu: byteswap the entire RX descriptor for 24 byte RX descriptorsJes Sorensen2016-04-151-6/+13
| | | | | | | | | This shouldn't affect little endian system, but may have prevented the driver working on big endian systems for devices with the larger 24 byte RX descriptors. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>