Commit Graph

577000 Commits

Author SHA1 Message Date
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