Commit graph

291 commits

Author SHA1 Message Date
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
Jes Sorensen ed35d09469 rtl8xxxu: Handle 32 bit mailbox extension regs found on 8723bu/8192eu/8812
Gen1 chips use a 16 bit mailbox extension register, for upto 48 bit
mailbox commands. The newer generation chips use a 32 bit mailbox
extension register instead, for upto 64 bit mailbox commands.

Handle writing the larger mailboxes.

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
Jes Sorensen b9f498e11f rtl8xxxu: Add 8723by AGC table
The different RF module seems to require a different AGC table as well

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
Jes Sorensen b7dd8ff916 rtl8xxxu: Add rtl8723b_mac_init_table
Newer chips seem to have some different mac registers, requiring
a different init table.

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
Jes Sorensen f0d9f5e907 rtl8xxxu: Add rtl8723bu_phy_init_antenna_selection()
So far this is just for 8723BU. It includes writing to a number of
registers I have seen no description for so far.

0x0064
0x0930
0x0944

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:28:56 +02:00
Jes Sorensen 22a31d455c rtl8xxxu: Add rtl8723bu_radioa_1t_init_table
Add 8723bu 1T radio init table. The vendor driver indicates that some
registers need special treatment for TFBGA90, TFBGA80, and TFBGA79
packaging. However the vendor driver never actually checks the package
type, so just stick to default values here.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:28:56 +02:00
Jes Sorensen 36c32588c8 rtl8xxxu: Add rtl8723b_phy_1t_init_table
This adds the 8723bu PHY 1T init table.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:28:56 +02:00
Jes Sorensen 0e28b9753a rtl8xxxu: Only setup USB interrupts for parts which support it
Only 1st generation chips do provide USB interrupts, so do not try to
setup interrupts for newer chips (8192eu and 8723bu).

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:28:56 +02:00
Jes Sorensen adfc01243f rtl8xxxu: Use 1024 byte writes for writing 8723bu firmware
The 8723bu, like the 8192eu, can also handle 1024 byte block writes.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:28:55 +02:00
Jes Sorensen 3c836d6014 rtl8xxxu: Add rtl8723bu_parse_efuse() and 8723bu efuse definition
Implement first stab at parsing the 8723bu's efuse.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:28:55 +02:00
Jes Sorensen 35a741febf rtl8xxxu: Initial rtl8723bu chip identification
This provides initial detection of 8723bu devices, and selects the
correct firmware image to load.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:28:55 +02:00
Jes Sorensen 99ad16cbea rtl8xxxu: Init REG_HIMR[01] for 8192eu parts
The newer generation chips have different interrupt registers.
Initialize this correct registers on 8192eu.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:28:55 +02:00
Jes Sorensen b63d0aaca6 rtl8xxxu: Kludge to drop incorrect USB OUT EP for 8192EU
The 8192eu (and some other parts) will report an incorrect USB OUT
EP. This tells the chip to drop it - as per the vendor driver.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:28:54 +02:00
Jes Sorensen 4de2481919 rtl8xxxu: Fix incorrect test for auto LLT failure
The logic for testing auto load failure in rtl8xxxu_auto_llt_table()
was inverted.

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