Commit Graph

404 Commits

Author SHA1 Message Date
Jes Sorensen
41892729cf rtl8xxxu: Correct rxdesc16 definition
This corrects the definition of rxdesc16 to correctly specify pkt_cnt
for aggregated packets. This is based on the code of the vendor
rtl8723au driver, as opposed to the struct definitions they use.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-07-08 16:41:55 +03:00
Jes Sorensen
2db125d4af rtl8xxxu: Obtain ieee80211_rx_status within parse_rx_desc()
When handling aggregated packets, we'll get a new ieee80211_rx_status
for each cloned skb, so passing in the pointer from the outside
doesn't make sense.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-07-08 16:41:54 +03:00
Jes Sorensen
a635df8a41 rtl8xxxu: Move skb delivery into parse_tx_desc() handler
This is another prepatory patch to be able to handle aggregated RX
packets.

In order to avoid adding a prototype, this also moves the
rtl8723bu_handle_c2h() function.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-07-08 16:41:53 +03:00
Jes Sorensen
c14ee43b8a rtl8xxxu: Set all ieee80211_rx_status values in parse_rx_desc()
This needs to be handled locally in the parse_rx_desc() function in
order to be able to handle aggregated packets in the future.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-07-08 16:41:53 +03:00
Jes Sorensen
78383ac951 rtl8xxxu: Reduce console noise when removing the kernel module
USB urbs will return with a status != 0 when rmmod'ing the driver. No
need to fill the log with messages from rtl8xxxu_int_complete()

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-07-08 12:54:24 +03:00
Luis de Bethencourt
efcb32883f rtl8xxxu: remove unneeded assignments
reg_eac and reg_ecc are only used if candidate is bigger than 0, and in
that case new values will be given to them. Removing the unused
assignments.

Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-07-08 12:54:23 +03:00
Andy Shevchenko
2b9c9f52dc rtl8xxxu: tuse %*ph to dump buffers
Use %*ph specifier to dump small buffers in hex format instead of doing this
byte-by-byte.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-06-29 18:44:32 +03:00
Jes Sorensen
08eca32ebc rtl8xxxu: Add additional documentation for RX DMA registers
This also renames REG_USB_AGG_{TO,TH} to REG_USB_AGG_{TIMEOUT,THRESH}

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-06-29 18:44:32 +03:00
Jes Sorensen
e4ac0a8ac8 rtl8xxxu: Add bit definitions for REG_USB_SPECIAL_OPTION
Documentation for enabling USB aggregation and whether to select
interrupt or bulk delivery of interrupt events.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-06-29 18:44:31 +03:00
Colin Ian King
c70410cb91 rtl8xxxu: fix typo on variable name, compare against correct variable
path_b_ok is being assigned but immediately after path_a_ok is being
compared to the value 0x03.  This appears to be a typo on the
variable name, compare path_b_ok instead.

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>
2016-06-16 17:49:18 +03:00
Jes Sorensen
e1ca790c8a rtl8xxxu: Remove the now obsolete mbox_ext_reg info from rtl8xxxu_fileops
With two different h2c_cmd() functions, mbox_ext_reg and
mbox_ext_width are no longer needed.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-05-03 13:07:24 +03:00
Jes Sorensen
27c7e89ea7 rtl8xxxu: rtl8xxxu_prepare_calibrate() is never used on gen1
Rename it to rtl8xxxu_gen2_prepare_calibrate() and remove the calls to
it from rtl8xxxu_gen1_phy_iq_calibrate()

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-05-03 13:07:23 +03:00
Jes Sorensen
9c0343d4f4 rtl8xxxu: Split rtl8723a_h2c_cmd() into a gen1 and a gen2 version
The H2C API is completely different between gen1 and gen2 parts, so
there is little point trying to treat this as a generic function. All
calls to *_h2c_cmd() will always come from a gen1 or a gen2 specific
function.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-05-03 13:07:22 +03:00
Jes Sorensen
993dd9b425 rtl8xxxu: Rename rtl8723a_disabled_to_emu() to rtl8xxxu_disabled_to_emu()
This function is generic to most of the chips, so change the name to
reflect this.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-05-03 13:07:21 +03:00
Jes Sorensen
a46b099ca7 rtl8xxxu: rename rtl8723a_channel_group() to rtl8xxxu_gen1_channel_to_group()
This function is generic for most (if not all) gen1 parts, so rename
it to reflect this.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-05-03 13:07:20 +03:00
Jes Sorensen
97db5a87b0 rtl8xxxu: Rename rtl8723a_stop_tx_beacon() to rtl8xxxu_stop_tx_beacon()
There is nothing 8723au specific about this function, so rename it to
reflect this.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-05-03 13:07:19 +03:00
Jes Sorensen
181725dd4f rtl8xxxu: move rtl8188[cr] and rtl8192c related code into rtl8xxxu_8192c.c
This moves the code for rtl8188c, rtl8188r, and rtl8192c into it's own
file. This is purely a code moving exercise, there is no change to the
code itself.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-05-03 13:07:18 +03:00
Jes Sorensen
20e3b2e97e rtl8xxxu: move rtl8723a related code into rtl8xxxu_8723a.c
This moves the rtl8723a code into it's own file. This is purely a code
moving exercise, no code changes.

This device specific file is a lot smaller since the gen1 chips
(8723a, 8188c, 8188r, 8192c) share a lot more common code than the
gen2 chips.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-05-03 13:07:17 +03:00
Jes Sorensen
6c46ca3b5f rtl8xxxu: move rtl8723b related code into rtl8xxxu_8723b.c
This moves the rtl8723b code into it's own file. This is purely a code
moving exercise, no functional changes. This did expose
rtl723a_h2c_cmd() as a function that should be refactored into a gen1
and a gen2 version.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-05-03 13:07:15 +03:00
Jes Sorensen
599119f683 rtl8xxxu: move rtl8192e related code into rtl8xxxu_8192e.c
This moves the rtl8192e code into it's own file. This is purely a code
moving exercise, no code changes.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-05-03 13:07:14 +03:00
Jes Sorensen
6c60e65cd0 rtl8xxxu: Rename rtl8xxxu.c to rtl8xxxu_core.c
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>
2016-05-03 13:07:10 +03:00
Jes Sorensen
04a74a9f8a rtl8xxxu: Rename rtl8723au_iqk_phy_iq_bb_reg
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>
2016-04-26 12:26:54 +03:00
Jes Sorensen
85f466350a rtl8xxxu: Rename rtl8723bu_simularity_compare()
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>
2016-04-26 12:26:53 +03:00
Jes Sorensen
5ac7414548 rtl8xxxu: Rename rtl8723b_channel_to_group()
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>
2016-04-26 12:26:52 +03:00
Jes Sorensen
8db71451e5 rtl8xxxu: Rename rtl8723a_mac_init_table to rtl8xxxu_gen1_mac_init_table
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>
2016-04-26 12:26:51 +03:00
Jes Sorensen
8396a41cf7 rtl8xxxu: Rename rtl8723a_enable_rf() to rtl8xxxu_gen1_enable_rf()
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>
2016-04-26 12:26:50 +03:00
Jes Sorensen
42a3bc7a2a rtl8xxxu: Rename rtl8723a_set_tx_power() to rtl8xxxu_gen1_set_tx_power()
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>
2016-04-26 12:26:50 +03:00
Jes Sorensen
de7c189c34 rtl8xxxu: Rename rtl8723au_init_phy_bb() to rtl8xxxu_gen1_init_phy_bb()
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>
2016-04-26 12:26:49 +03:00
Jes Sorensen
28466e9214 rtl8xxxu: Rename rtl8723au_phy_iq_calibrate() to 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>
2016-04-26 12:26:48 +03:00
Jes Sorensen
c6e39da02e rtl8xxxu: Rename rtl8723au_update_rate_mask() to rtl8xxxu_update_rate_mask()
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>
2016-04-26 12:26:47 +03:00
Jes Sorensen
e09718c2fd rtl8xxxu: Rename rtl8723au_config_channel() to rtl8xxxu_gen1_config_channel()
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>
2016-04-26 12:26:46 +03:00
Jes Sorensen
7eb1400c24 rtl8xxxu: Rename rtl8723a_disable_rf() to rtl8xxxu_gen1_disable_rf()
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>
2016-04-26 12:26:45 +03:00
Jes Sorensen
6a07b7915a rtl8xxxu: Rename rtl8723b_disable_rf() to rtl8xxxu_gen2_disable_rf()
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>
2016-04-26 12:26:45 +03:00
Jes Sorensen
3a56bf6aa1 rtl8xxxu: Rename rtl8723bu_config_channel() to rtl8xxxu_gen2_config_channel()
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>
2016-04-26 12:26:44 +03:00
Jes Sorensen
beb5531619 rtl8xxxu: Rename rtl8723au_report_connect() to rtl8xxxu_gen1_report_connect()
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>
2016-04-26 12:26:43 +03:00
Jes Sorensen
32353a784f rtl8xxxu: Rename rtl8723bu_report_connect() to rtl8xxxu_gen2_report_connect()
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>
2016-04-26 12:26:42 +03:00
Jes Sorensen
a8c8dfa593 rtl8xxxu: Rename rtl8723bu_update_rate_mask() to 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>
2016-04-26 12:26:40 +03:00
Arnd Bergmann
06d05463ee rtl8xxxu: hide unused tables
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: 2fc0b8e5a1 ("rtl8xxxu: Add TX power base values for gen1 parts")
Fixes: 4062b8ffec ("rtl8xxxu: Move PHY RF init into device specific functions")
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-21 15:46:11 +03:00
Jes Sorensen
265697eb2f rtl8xxxu: Pause TX before calling disable_rf()
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>
2016-04-15 21:38:16 +03:00
Jes Sorensen
ae5c01fd2f rtl8xxxu: Implement rtl8192e_enable_rf()
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>
2016-04-15 21:38:15 +03:00
Jes Sorensen
6a62f9d527 rtl8xxxu: Fix OOPS if user tries to add device via /sys
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>
2016-04-15 21:38:14 +03:00
Jes Sorensen
cabb550e2b rtl8xxxu: Fix 8188RU support
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>
2016-04-15 21:38:13 +03:00
Jes Sorensen
2fc0b8e5a1 rtl8xxxu: Add TX power base values for gen1 parts
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-15 21:38:12 +03:00
Jes Sorensen
b9f9d6992f rtl8xxxu: Set register 0xfe10 on rtl8192cu based parts
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>
2016-04-15 21:38:11 +03:00
Jes Sorensen
eb18806261 rtl8xxxu: Update copyright statement to include 2016
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-15 21:38:10 +03:00
Jes Sorensen
8cae2f1da8 rtl8xxxu: Unregister from mac80211 before shutting down the device
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>
2016-04-15 21:38:09 +03:00
Jes Sorensen
8e25496090 rtl8xxxu: Match 8723bu power down sequence to vendor driver
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>
2016-04-15 21:38:08 +03:00
Jes Sorensen
8d95c8084f rtl8xxxu: Use rtl_chip == RTL8188R to identify high PA parts
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>
2016-04-15 21:38:07 +03:00
Jes Sorensen
78a8421959 rtl8xxxu: Apply 8188RU workaround for UMC B cut parts correctly
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>
2016-04-15 21:38:06 +03:00
Jes Sorensen
b591e982bc rtl8xxxu: For devices with external PA (8188RU), limit CCK TX power
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>
2016-04-15 21:38:05 +03:00
Jes Sorensen
4062b8ffec rtl8xxxu: Move PHY RF init into device specific functions
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>
2016-04-15 21:38:04 +03:00
Colin Ian King
37ba4b6265 rtl8xxxu: fix uninitialized return value in ret
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>
2016-04-15 21:38:03 +03:00
Jes Sorensen
e1d70c9b04 rtl8xxxu: Mark 0x050d:0x1004 as tested
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>
2016-04-15 21:38:01 +03:00
Jes Sorensen
a39b683966 Re-enable 8192eu support
Revert "rtl8xxxu: Temporarily disable 8192eu device init"

This reverts commit ccfe1e8532.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-15 21:36:48 +03:00
Jes Sorensen
46b378318d rtl8xxxu: 8192eu Fix bug in LDPC RX hang fix
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>
2016-04-15 21:36:46 +03:00
Jes Sorensen
31133da702 rtl8xxxu: Remove unneeded 8192eu hack
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>
2016-04-15 21:36:46 +03:00
Jes Sorensen
747bf23759 rtl8xxxu: Split USB quirks into gen1 and gen2 quirks
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>
2016-04-15 21:36:44 +03:00
Jes Sorensen
9b323ee97a rtl8xxxu: Make PBP tuning a fileops parameter
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>
2016-04-15 21:36:43 +03:00
Jes Sorensen
a773720691 rtl8xxxu: Do not backup RF_MODE_AG when it's never being used
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>
2016-04-15 21:36:43 +03:00
Jes Sorensen
24e8e7ec33 rtl8xxxu: Store device specific TRXFF boundary in the fileops
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>
2016-04-15 21:36:42 +03:00
Jes Sorensen
b84cac16f0 rtl8xxxu: REG_LDOA15_CTRL is only used on gen1 parts
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>
2016-04-15 21:36:41 +03:00
Jes Sorensen
c82f8d113e rtl8xxxu: Move loading of AGC table to device specific function
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>
2016-04-15 21:36:40 +03:00
Jes Sorensen
ade0dedde1 rtl8xxxu: Load AGC table before patching for 1T2R parts
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>
2016-04-15 21:36:39 +03:00
Jes Sorensen
cb8772504a rtl8xxxu: Split rtl8xxxu_init_phy_bb() into device specific functions
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>
2016-04-15 21:36:38 +03:00
Jes Sorensen
bd8fe40cc4 rtl8xxxu: Use descriptive bits for setting RX paths for 1T2R parts
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>
2016-04-15 21:36:37 +03:00
Jes Sorensen
9068308ad1 rtl8xxxu: Correctly mask what was read from REG_CCK0_AFE_SETTING
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>
2016-04-15 21:36:36 +03:00
Jes Sorensen
15f9dc9923 rtl8xxxu: Remove unused 8723bu path B IQ calibration code
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>
2016-04-15 21:36:35 +03:00
Jes Sorensen
fe62171fb5 rtl8xxxu: Remove misleading warning from rtl8192eu_phy_iqcalibrate()
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>
2016-04-15 21:36:34 +03:00
Jes Sorensen
a49c7ce183 rtl8xxxu: Name RX descriptor types rxdesc16/rxdesc24
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>
2016-04-15 21:36:33 +03:00
Jes Sorensen
2cb79eb74f rtl8xxxu: byteswap the entire RX descriptor for 24 byte RX descriptors
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>
2016-04-15 21:36:32 +03:00
Jes Sorensen
55c0b6ae1e rtl8xxxu: Use has_s0s1 for REG_S0S1 issues only
Instead use tx_desc_size() to distinguish between gen1
(8723a/8192c/8188c) and gen2 (8723b/8192e) parts.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-15 21:36:31 +03:00
Jes Sorensen
57e42a21a9 rtl8xxxu: Implment rtl8192e_set_tx_power()
8192eu is a 2T part, so setting TX power for path A only, as done by
rtl8723bu_set_tx_power() is not sufficient.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-15 21:36:30 +03:00
Jes Sorensen
5bdb6b0859 rtl8xxxu: Do not try to set REG_LEDCFG2 on 8192eu
Presumably 8192eu devices do not have leds, so do not enable them.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-15 21:36:29 +03:00
Jes Sorensen
b816901b3d rtl8xxxu: Do not init FPGA0_TX_INFO on 8192eu
Like the 8723bu, the vendor driver does not set FPGA0_TX_INFO for
8192eu in the init sequence.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-15 21:36:28 +03:00
Jes Sorensen
2e7c7b347d rtl8xxxu: Do not set REG_PBP on 8192eu
The vendor driver does not set REG_PBP on 8192eu. Whether this is due
to the device not supporting it or simply an oversight in the vendor
driver is not clear.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-15 21:36:27 +03:00
Jes Sorensen
0486e80b2a rtl8xxxu: Reorder chip quirks to follow flow of 8192eu driver
Another flow order change to match the vendor driver.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-15 21:36:26 +03:00
Jes Sorensen
89c2a097df rtl8xxxu: Implement generic init_queue_reserved_page() function
Longer term we should switch all the chips over to use this function
instead of the random chip specific ifdef hacks.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-15 21:36:25 +03:00
Jes Sorensen
59b24dad20 rtl8xxxu: Reorg more code to match the flow of the 8192eu vendor driver
This further reorganizes the init code flow to match that of the
8192eu vendor driver. This helps diffing the register write log
against that of the vendor driver.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-15 21:36:24 +03:00
Jes Sorensen
c157863d99 rtl8xxxu: Reorder parts of init code to match the 8192eu vendor code flow
In order to debug 8192eu support, reorder some init code to match the
flow of the vendor driver.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-15 21:36:23 +03:00
Jes Sorensen
28e460b02c rtl8xxxu: Adjust AFE crystal value on 8192eu
Adjust AFE before enabling PLL on 8192eu, probably also needed for
8723bu.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-14 15:45:30 +03:00
Jes Sorensen
f991f4e914 rtl8xxxu: Implement IQK calibration for 8192eu
8192eu has it's own IQK calibration procedure, and notably uses
undocumented RF register 0x56 in the process.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-14 15:45:29 +03:00
Jes Sorensen
70bc1e24d9 rtl8xxxu: Use proper register name for REG_PAD_CTRL1
Fixup another case where the hard coded register value was used
instead of the name.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-14 15:45:28 +03:00
Jes Sorensen
b052b7fc7d rtl8xxxu: Implement 8192eu device specific quirks
Set REG_QUEUE_CTRL and REG_ACLK_MON for 8192eu.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-14 15:45:27 +03:00
Jes Sorensen
e1394fe5f9 rtl8xxxu: Fix LDPC RX hang issue on 8192eu
Implement workaround for LDPC RX hands on 8192eu. This was inspired by
workaround found in the 8192eu vendor driver.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-14 15:45:26 +03:00
Jes Sorensen
3021e51f2b rtl8xxxu: Set REG_USB_HRPWM for 8192eu
The vendor driver set register 0xfe58 REG_USB_HWPWM in it's init
sequence for 8192eu. Do the same here.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-14 15:45:25 +03:00
Jes Sorensen
57e5e2e650 rtl8xxxu: Set correct interrupt masking registers on 8192eu
Set HIMR[01] on 8192eu instead of HISR/HIMR. It's not obvious this
really matters for USB devices, but this matches the register writes
performed by the vendor driver.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-14 15:45:24 +03:00
Jes Sorensen
8a59485c8e rtl8xxxu: Handle XTAL value setting on 8192eu
Set REG_AFE_XTAL_CTRL on 8192eu to the vendor driver value, and do not
skip setting REG_MAX_AGGR_NUM on 8192eu.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-14 15:45:23 +03:00
Jes Sorensen
2949b9ee77 rtl8xxxu: Provide special handling when writing RF regs on 8192eu
The 8192eu requires clearing/restoring bit 17 in REG_FPGA0_POWER_SAVE
before/after writing RF registers.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-14 15:45:22 +03:00
Jes Sorensen
444004bd13 rtl8xxxu: Handle BB init for 8192eu
The 8192eu does not use REG_AFE_PLL_CTRL in it's BB init sequence, so
provide device specific handling.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-14 15:45:21 +03:00
Jes Sorensen
9e24772ae2 rtl8xxxu: Correctly parse 8192eu efuse
The 8192eu efuse only has power data for path A and B. It follows the
same layout as 8723bu.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-14 15:45:20 +03:00
Jes Sorensen
abd71bdb94 rtl8xxxu: Pick PHY init table based on chip version first
Pick PHY init table based on device before distinguishing between
1T/2T/high PA tables. The latter is only currently used for
8188cu/8192cu/8188ru.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-14 15:45:19 +03:00
Jes Sorensen
ae14c5d20d rtl8xxxu: Add 8192eu PHY init table
The 8192eu also requires it's own PHY init table.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-14 15:45:18 +03:00
Jes Sorensen
e293278deb rtl8xxxu: Add 8192eu AGC tables
A device specific AGC table is required for the 8192eu as well.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-14 15:45:17 +03:00
Jes Sorensen
19102f8419 rtl8xxxu: Add radio init tables for 8192eu
Add the required radio init tables for 8192eu devices.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-14 15:45:16 +03:00
Jes Sorensen
80805aa5f3 rtl8xxxu: Set TX page boundaries for 8192eu
The 8192eu also has it's own TRXFF boundary value to set.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-14 15:45:15 +03:00
Jes Sorensen
2ca73dc786 rtl8xxxu: Do not mess with AFE_XTAL_CTRL on 8192eu
To match the vendor driver, do not mess with AFE_XTAL_CTRL on 8192eu.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-14 15:45:14 +03:00
Jes Sorensen
c606e662a5 rtl8xxxu: Add MAC init table for 8192eu
The 8192eu requires a different MAC init table. Add the missing table
and specify the table to use in the fileops structure.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-14 15:45:12 +03:00
Johannes Berg
57fbcce37b cfg80211: remove enum ieee80211_band
This enum is already perfectly aliased to enum nl80211_band, and
the only reason for it is that we get IEEE80211_NUM_BANDS out of
it. There's no really good reason to not declare the number of
bands in nl80211 though, so do that and remove the cfg80211 one.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2016-04-12 15:56:15 +02:00
Jes Sorensen
a069caa3c3 rtl8xxxu: Do not set LDOA15 / LDOV12 on 8192eu
Per the vendor driver, it looks like the 8192eu doesn't have LDOA15 /
LDOV12 registers.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-07 19:41:21 +03:00
Jes Sorensen
91cbe4e731 rtl8xxxu: Use correct H2C calls for 8192eu
The 8192eu uses the same H2C API as the 8723bu. Call the correct
functions for update_rate_mask() and report_connect().

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-07 19:41:20 +03:00
Jes Sorensen
af13faff85 rtl8xxxu: Identify 8192eu rev A/B parts correctly
8192eu A/B cut parts were incorrectly identified as 8192cu devices.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-07 19:41:19 +03:00
Jes Sorensen
ba17d82478 rtl8xxxu: Use enums for chip version numbers
With support for more chips being added, use an enum to specify the
chip version.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-07 19:41:18 +03:00
Jes Sorensen
931d927825 rtl8xxxu: Update some register definitions
Improve descriptive names of some registers and add some additional
registers only found on nextgen chips.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-07 19:41:17 +03:00
Jes Sorensen
f3fc251162 rtl8xxxu: 8192eu uses txdesc40
8192eu uses the new TX descriptor format

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-07 19:41:16 +03:00
Jes Sorensen
1df1de3485 rtl8xxxu: TXDESC_SHORT_GI is txdesc32 only
This is no short GI bit in the txdesc40 format.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-07 19:41:15 +03:00
Jes Sorensen
169bc5cb0b rtl8xxxu: Correct txdesc40 gid definition
txdesc40 dword2 gid is a 6 bit field, not a single bit

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-07 19:41:14 +03:00
Jes Sorensen
33f3724948 rtl8xxxu: Rename TX descriptor bits to map them to 32/40 byte descriptors
With the size based naming of TX descriptors. Change the bit
definition namings to indicate which descriptor format they match,
rather than having a device name in the bit name.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-07 19:41:13 +03:00
Jes Sorensen
dbb2896b48 rtl8xxxu: Change name of struct tx_desc to be more decriptive
There are two major types of TX descriptor formats for the RTL parts,
the old 32 byte descriptor, and the newer 40 byte descriptor used by
the 8723bu, 8192eu, and 88xx series.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-07 19:41:12 +03:00
Jes Sorensen
ccfe1e8532 rtl8xxxu: Temporarily disable 8192eu device init
To reduce the patch volume, temporariliy disable 8192eu device init.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:21 +02:00
Jes Sorensen
7d4ccb8bae rtl8xxxu: Use correct 8051 reset function for 8723b parts
8723b needs more action, so implement support for device specific
reset functions.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:20 +02:00
Jes Sorensen
145428ec7c rtl8xxxu: Print a warning if flushing the FIFO fails
Only print a warning if the FIFO flush fails, as opposed to printing
the status unconditionally.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:20 +02:00
Jes Sorensen
430b454c5a rtl8xxxu: Flush FIFO before powering down devices
This should help when reloading the driver for 8723bu devices

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:20 +02:00
Jes Sorensen
fe37d5f644 rtl8xxxu: Implement device specific power_off function
Implment 8723bu specific device power down, and make power_off() a
fileops function.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:20 +02:00
Jes Sorensen
fc89a41fa6 rtl8xxxu: Implement 8723bu specific disable_rf() function
Powering up the 8723bu RF should probably be matched by the ability to
power it down again.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:19 +02:00
Jes Sorensen
37f44dc79a rtl8xxxu: Use define for REG_PWR_DATA bits
Use the bit define rather than hard code the value for REG_PWR_DATA bits.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:19 +02:00
Jes Sorensen
0290e7d0fd rtl8xxxu: convert rtl8723bu_init_bt() into rtl8723b_enable_rf()
rtl8723bu_init_bt() is effectively the function enabling RF, so name
it appropriately.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:19 +02:00
Jes Sorensen
6979494adf rtl8xxxu: Remove unncessary semicolon
This removes an superfluous semicolon.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:19 +02:00
Jes Sorensen
87957081b7 rtl8xxxu: Pass RX rate to rx_parse_phystats and enable phystats for rtl8723bu
rtl8xxxu_rx_parse_phystats() only needs the RX rate to determine
whether to handle the stats as CCK or not. Parsing in the rate rather
than the rx descriptor elimantes the need to handle multiple rx
descriptor formats in the function.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:18 +02:00
Jes Sorensen
55a18dd180 rtl8xxxu: Process C2H RA_REPORT events for 8723bu
Handle RA_REPORTS events for 8723bu to not have them show up as
unhandled.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:18 +02:00
Jes Sorensen
739dc9f2f5 rtl8xxxu: Dump contents of unhandled C2H events
Dump the contents of unhandled C2H events. We should be handling all
expected events, so this is debugging help in case an unexpected event
happens.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:18 +02:00
Jes Sorensen
7d794eaa85 rtl8xxxu: Report media status using the correct H2C command for 8723bu
Implement support for nextgen devices reporting connectition to the
firmware.

The H2C API for reporting connection to the firmware is different
between the two device generations. Use the fileops structure to
determine which one to call.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:18 +02:00
Jes Sorensen
f653e69009 rtl8xxxu: Implement basic 8723b specific update_rate_mask() function
Support for setting bandwidth and VHT parameters is still missing

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:17 +02:00
Jes Sorensen
80b30b2af5 rtl8xxxu: Define 8723b H2C ramask command structure
Define H2C command structure for setting the rate mask.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:17 +02:00
Jes Sorensen
e975b87caf rtl8xxxu: Do not parse RX descriptor info for C2H packets
C2H events are delivered as RX packets on 8723bu/8192eu. When
receiving a C2H event, do not parse the rest of the RX descriptor as
the info isn't valid.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:17 +02:00
Jes Sorensen
4c68360714 rtl8xxxu: Improve handling of txdesc32 vs txdesc40 handling
Further correct the handling of 40 byte TX descriptors.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:17 +02:00
Jes Sorensen
2c6670b2a8 rtl8xxxu: TX RTS rate is word 4 for 8723a
Correct the setting of TX RTS for 8723a generation chips. In addition
update documentation to match that this is part of data word 4, note
data word 5.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:16 +02:00
Jes Sorensen
2098bfb5f3 rtl8723au: Update TX descriptor words 4 and 5 definitions
TX data words 4 and 5 differ significantly between 32 byte and 40 byte
descriptors.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:16 +02:00
Jes Sorensen
cc2646d4be rtl8xxxu: Set sequence number correctly for 40 byte TX descriptors
SEQ changed location in the 40 byte TX descriptor. Set it correctly.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:16 +02:00
Jes Sorensen
a40ace4f01 rtl8xxxu: Set the correct TX descriptor bits for agg and break on 8723b
Fixup victim of the relocated bits for AGG_ENABLE/AGG_BREAK in the 40
byte TX descriptor

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:16 +02:00
Jes Sorensen
ce2d1dbbb4 rtl8xxxu: Add more 40 byte TX desc bit definitions
Add additional bit definitions for 40 byte TX descriptors, and rename
bits for 32 byte descriptors that are located differently in the 40
byte descriptor format.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:15 +02:00
Jes Sorensen
0249258db4 rtl8xxxu: Add additional tx descriptor bits for data word 0
This adds documentation for some additional bits in TX descriptor word
0.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:15 +02:00
Jes Sorensen
5e00d5034a rtl8xxxu: Do not unconditionally print debug info in rtl8723bu_handle_c2h()
Reduce the log level in rtl8723bu_handle_c2h()

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:15 +02:00
Jes Sorensen
179e174256 rtl8xxxu: Handle 40 byte TX descriptors for rtl8723bu
Note the descriptor checksum is still only calculated over the initial
32 bytes of the descriptor, ignoring the last 8 bytes of the
descriptor.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:15 +02:00
Jes Sorensen
80491a1f3c rtl8xxxu: Add definition for 8723bu tx descriptor
Newer generation chips use a 40 byte TX descriptor, compared to the
32 byte descriptor used on older chips.

This adds the definition for the 40 byte descriptor.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:14 +02:00
Jes Sorensen
72143b9e94 rtl8xxxu: Set the correct thermal meter register for 8723bu
Older chips use RF register 0x24 to set the thermal meter. Newer chips
use register 0x42.

This change makes sure to set the correct thermal meter register
depending on the chip.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:14 +02:00
Jes Sorensen
1d3cc44ddd rtl8xxxu: Set 8723bu MCS TX power
This adds the missing support for setting MCS TX power rates on 8723bu.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:14 +02:00
Jes Sorensen
54bed43f3a rtl8xxxu: Set 8723bu TX power for CCK and OFDM rates
This implements support for setting TX power for CCK and OFDM rates on
8723bu. MCS rates is still pending.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:14 +02:00
Jes Sorensen
3be2699908 rtl8xxxu: Parse efuse power indices for 8723bu
This should (hopefully) parse the power indices correctly for the
8723bu.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:13 +02:00
Jes Sorensen
21db997330 rtl8xxxu: Bump TX power arrays to handle larger channel groups
Newer generation chips have more channels groups. In order to carry
the larger arrays in common structures, bump the array sizes to
match.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:13 +02:00
Jes Sorensen
3e84f93861 rtl8xxxu: Use size of source pointer when copying efuse data
Some newer chips have more channel groups in their efuse parameter
tables, so use the size of the source, rather than the destination
when copying them out. This avoids copying garbage when increasing the
common array sizes.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:13 +02:00
Jes Sorensen
e796dab4b9 rtl8xxxu: Introduce set_tx_power() fileop and a new 8723b dummy derivative
The 8723b series is significantly different from the older generation
in this sense. So far the 8723b version doesn't do anything useful.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:13 +02:00
Jes Sorensen
4a0d7db531 rtl8xxxu: Correct struct rtl8723bu_efuse to list power bases correctly
Correct TX power definitions in rtl8723bu_efuse

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:12 +02:00
Jes Sorensen
db08de9443 rtl8xxxu: Do not use hard-wired RF enable settings for 8723bu
These settings simply block the 8723bu, for now leave an empty
function.

With this change we can finally communicate with aliens using the
8723bu!

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:12 +02:00
Jes Sorensen
a3a5dac6b1 rtl8xxxu: Setup coex table correctly (hopefully)
Use the same values as the vendor driver when setting up the BTCOEX
table for 8723bu.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:12 +02:00
Jes Sorensen
59b743979c rtl8xxxu: Use REG_RFE_CTRL_ANTA_SRC rather than hard coded value
Another case where we should use the register name rather than the
hard coded value when accessing it.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:11 +02:00
Jes Sorensen
120e627f65 rtl8xxxu: Use name for REG_RFE_BUFFER rather than hard coded value
Register 0x0944 is REG_RFE_BUFFER. Use the name rather than hard coded
value when accessing it.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:11 +02:00
Jes Sorensen
499cfc02a0 rtl8xxxu: 8723bu: REG_BT_COEX_TABLE4 is only 8 bits
The BT_COEX_TABLE register list contains 3 32 bit registers and one 8
bit register. Hence, use rtl8xxxu_write8() when writing the 8 bit
register.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:11 +02:00
Jes Sorensen
fc1c89b340 rtl8xxxu: Set WLAN_ACT_CONTROL per vendor driver setting
The initial code set the wrong setting in WLAN_ACT_CONTROL for the
8723bu.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:11 +02:00
Jes Sorensen
541bca7f5d rtl8xxxu: RF_T_METER is different on the newer chips
Provide RF_T_METER register location for nextgen chips.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:10 +02:00
Jes Sorensen
9c79bf95d0 rtl8xxxu: Implement init_statistics for 8723bu
Vendor driver implements this for 8723b and 8821 series

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:10 +02:00
Jes Sorensen
f2a4163a22 rtl8xxxu: Add missing blank space in front of bracket
Keep the automated tools happy

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:10 +02:00
Jes Sorensen
3e88ca447a rtl8xxxu: Setup RX aggregation
This initializes RX DMA aggregation on 8723bu. We should do this for
all parts eventually, and also init TX aggregation.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:10 +02:00
Jes Sorensen
2f109c8e51 rtl8xxxu: Group chip quirks together
Group chip quirks together instead of having them scattered all over
in the init code.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:09 +02:00
Jes Sorensen
7e9567ff98 rtl8xxxu: Add REG_DWBCN1_CTRL_8723B define
List yet another new register found on the 8723b.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:09 +02:00
Jes Sorensen
5ac61789e8 rtl8xxxu: 8723bu lock phy after RF init
Set PHY lock after running the RF init sequence on 8723bu.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:09 +02:00
Jes Sorensen
1ea8e846c9 rtl8xxxu: Call device specific _config_channel()
Having a version for the newer chips without calling it doesn't do
much good.....

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:09 +02:00
Jes Sorensen
c369060441 rtl8xxxu: Initialize burst parameters for 8723bu
Implement burst parameter sequence for 8723bu parts. Eventually this
should be moved into device specific sections.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:08 +02:00
Jes Sorensen
fadfa04154 rtl8xxxu: Set RX boundary for 8723bu
Set the correct TRXFF boundary for 8723bu.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:08 +02:00
Jes Sorensen
b87212cece rtl8xxxu: Do not set FPGA0_TX_INFO for 8723bu and use a larger PBP page size
The vendor driver does not set FPGA0_TX_INFO here. In additiona the
8723bu can handler a larger PBP page size.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:08 +02:00
Jes Sorensen
1f1b20f11a rtl8xxxu: Do queue init in same order as 8723bu vendor driver
Reorganize the init sequence in order to be able to compare to the
8723bu vendor driver's init sequence.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:08 +02:00
Jes Sorensen
f30ed67554 rtl8xxxu: 80M spur hack is for 8723au only
Only apply the 80M spur hack for 8723au parts.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:07 +02:00
Jes Sorensen
3a4be6a092 rtl8xxxu: Init H2C command register for 8723bu
In addition make register read/write flow match closer to vendor
driver flow. This is mainly to be able to compare the register write
log with the vendor driver, and can be optimized later once 8723bu
support is working.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:07 +02:00
Jes Sorensen
360157eb25 rtl8xxxu: Another 8723bu magic register set during init
No indication of what register 0xa3 does anywhere in the vendor source.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:07 +02:00
Jes Sorensen
a0e262bcbe rtl8xxxu: Another 8723bu patch for rtl8xxxu_init_phy_bb()
This function is going to need to be split up into chip specific
variants.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:07 +02:00
Jes Sorensen
4ef22eb933 rtl8xxxu: Handle XTAL_K value in efuse specific location
Retrieve the XTAL_K value in the parse_efuse() functions as it's
location various on a per device basis. For parts that do not provide
an XTAL_K value, skip setting it.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:06 +02:00
Jes Sorensen
8baf670b89 rtl8xxxu: Additional fixes for 8723bu
Additional tweaks to further map the init sequence for the 8723bu to
that of the vendor driver.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:06 +02:00
Jes Sorensen
79fb5fe9ed rtl8xxxu: Setup LLT before downloading firmware
This matches the order of the 8723bu vendor driver

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:06 +02:00
Jes Sorensen
42836db1f6 rtl8xxxu: Implement 8723bu power on sequence
This implements the 8723bu specific power on sequence as it is
different from that of the 8723au chips.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:06 +02:00
Jes Sorensen
04313eb4f2 rtl8xxxu: Do not set REG_AFE_XTAL_CTRL on 8723bu
The 8723bu does not like REG_AFE_XTAL_CTRL being set, so skip this for
now, to match the vendor driver.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:05 +02:00
Jes Sorensen
6b9eae0129 rtl8xxxu: Issue BT_INFO command
Issue a BT_INFO command to verify the status of BT/WiFi settings.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:05 +02:00
Jes Sorensen
394f1bd314 rtl8xxxu: Handle BT register writes and MP_OPER events
8723bu BT registers are written via the mailbox interface. Add support
for writing these and corresponding C2H event responses.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:05 +02:00
Jes Sorensen
b2b43b7837 rtl8xxxu: Initial functionality to handle C2H events for 8723bu
The 64 bit mailbox commands also provide a different method for
mailbox command responses (C2H events).

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:05 +02:00
Jes Sorensen
b18cdfdb67 rtl8xxxu: Handle 8723bu style rx descriptors
This adds code to parse the new RX descriptor format used by the
8723bu/8192eu parts.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:04 +02:00
Jes Sorensen
a6c80d211c rtl8xxxu: Add rtl8723bu (nextgen) rx descriptor definition
The nextgen chips use a slightly different RX descriptor format. This
adds support for the new format.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:04 +02:00
Jes Sorensen
a228a5db4d rtl8xxxu: Set the right type for ps tdma on 8723bu
Use the correct type when setting PS TDMA for 8723bu. This matches the
vendor driver.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:04 +02:00
Jes Sorensen
7297f49c37 rtl8xxxu: Do not ignore wlan activity on 8723bu
The 8723bu is a WiFi/BT combo part. When initializing it for WiFi,
make sure to tell it not to ignore WiFi activity.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:04 +02:00
Jes Sorensen
3ca7b32c9d rtl8xxxu: Improve 8723bu init code
Implement additional init sequence code for the 8723bu.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:03 +02:00
Jes Sorensen
368633ce68 rtl8xxxu: Remove unused variable
Remove an unused variable to make the compiler happy.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:03 +02:00
Jes Sorensen
f37e9228ae rtl8xxxu: Initial rtl8723bu_init_bt() code
This should initialize the antennas on the 8723bu, but so far I am
still not receiving anything :( More work is needed.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:03 +02:00
Jes Sorensen
c3f9506f23 rtl8xxxu: Initial implementation of rtl8723bu_config_channel()
This is a first stab of implementing rtl8723bu_config_channel(). For
now this will only do 20MHz channels.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:02 +02:00
Jakub Sitnicki
e6f9a9c3b5 rtl8xxxu: rtl8192eu: Map out EFUSE TX power area
TX power values are laid out differently in EFUSE found in RTL8192EU &
RTL8188EU devices.  TX power indices and differences for each RF path
are not interleaved (A, B, A, B), as in other chips, but follow one
another (A, B, C, D).

Signed-off-by: Jakub Sitnicki <jsitnicki@gmail.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:02 +02:00
Jes Sorensen
60c76cbadb rtl8xxxu: Remove backing up certain registers, which was never used
This was inspired by the vendor driver, but in the end never used for
anything.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:02 +02:00
Jes Sorensen
fa0f2d481d rtl8xxxu: Do LC calibration before IQK calibration
This matches the flow of the vendor driver for newer hardware, and
doesn't seem to cause issues for the older parts.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:02 +02:00
Jes Sorensen
0d698dec06 rtl8xxxu: Handle S0S1 register in lc_calibrate()
Newer chips (8723bu/8192eu) has S0S1 settings which needs to be dealt
with during LC calibration.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:01 +02:00
Jes Sorensen
e1547c535e rtl8xxxu: First stab at adding IQK calibration for 8723bu parts
The 8723bu also has it's own IQK calibration process. This is similar
in flow, but still different enough to warrent it's own
implementation, at least for now.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:01 +02:00
Jes Sorensen
c6594ffd46 rtl8xxxu: Add a couple of new register definitions
This adds some additional register definitions for 8723bu, as well as
a bit define for USB RXDMA aggregation in REG_RXDMA_AGG_PG_TH.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:01 +02:00
Jes Sorensen
8634af5e6a rtl8xxxu: Make rtl8xxxu_add_path_on() use device specific init values
rtl8192cu/rtl8188cu/rtl8723au use the same values, but 8723bu and
8192eu have their own.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:01 +02:00
Jes Sorensen
7ff8c1ae61 rtl8xxxu: Use correct formatting type to print sizeof()
Usual gcc i386 issue reported by kbuildbot

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:00 +02:00
Jes Sorensen
eaa4d14c97 rtl8xxxu: Do not overwrite rtl8xxxu_debug for untested chips
Fix a silly bug where the debug level was overwritten rather than
amended for untested chips.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:00 +02:00
Jes Sorensen
c7a5a190df rtl8xxxu: Do BT_WLAN_CALIBRATION before doing IQK calibration
Newer generation chips require the firmware be notified before we
start the IQK calibration.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:00 +02:00
Jes Sorensen
8da91571bb rtl8xxxu: rtl8xxxu_h2c_cmd(): Add size argument
The firmware command API differs slightly between new and old
devices. The new generation requires the size since there is no
extension bit encoded into the command number.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:29:00 +02:00
Jes Sorensen
b8ba8602b8 rtl8xxxu: rtl8723bu_parse_efuse(): Use a pointer to the struct rtl8723bu_efuse
Likewise for 8723bu, use a pointer to the efuse.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:28:59 +02:00
Jes Sorensen
b7dda34d1e rtl8xxxu: rtl8192eu_parse_efuse(): Use a pointer to the struct rtl8192eu_efuse
Make the code easier to read and less error prone by using a pointer
to the efuse.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:28:59 +02:00
Jakub Sitnicki
4959444165 rtl8xxxu: rtl8192cu: Introduce a pointer to efuse
Signed-off-by: Jakub Sitnicki <jsitnicki@gmail.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:28:59 +02:00
Jakub Sitnicki
d38f1c3715 rtl8xxxu: rtl8723au: Introduce a pointer to efuse
Signed-off-by: Jakub Sitnicki <jsitnicki@gmail.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:28:59 +02:00
Jakub Sitnicki
32a39dd4b5 rtl8xxxu: Skip disabled efuse words early
Avoid a negative conditional and an extra level of indentation in the
bigger part of the loop body.

Signed-off-by: Jakub Sitnicki <jsitnicki@gmail.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:28:58 +02:00
Jakub Sitnicki
f6c47702ed rtl8xxxu: Don't check for illegal offset when reading from efuse
It is enough to check for either illegal offset or illegal map address
because map address is a value derived from an offset:

  map_addr = offset * 8
  EFUSE_MAP_LEN = EFUSE_MAX_SECTION_8723A * 8

Leave just the check for an illegal map address because its upper
bound (EFUSE_MAP_LEN) is used also in a couple other places.

Signed-off-by: Jakub Sitnicki <jsitnicki@gmail.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:28:58 +02:00
Jes Sorensen
d940c247ad rtl8xxxu: Add definitions for new generation h2c commands
The larger mailboxes also use a different set of mailbox commands.
This provides a list of the 64 bit commands.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:28:58 +02:00
Jes Sorensen
6431ea00df rtl8xxxu: Group USB fixups together for all chips
In addition do not apply fixups for 8188/8191/8192 A-cut UMC parts.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:28:58 +02:00
Jes Sorensen
14d8856082 rtl8xxxu: Add some missing register definitions for 8723bu
This introduces additional register definitions for newer generation
chips.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:28:57 +02:00