Commit graph

291 commits

Author SHA1 Message Date
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
Jes Sorensen a47b9d477c rtl8xxxu: Init the LLT after we start the firmware
To match the flow of the vendor driver, move the LLT init to after the
firmware is started.

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 07bb46be53 rtl8xxxu: Init page boundaries before starting the firmware
This reorganizes the device initialization to init page boundaries
before starting the firmware. This matches the flow in the 8192eu
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 74b99bed87 rtl8xxxu: Add rtl8xxxu_auto_llt_table()
Newer chips can auto load the LLT table, it is no longer necessary to
build it manually in the driver.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:28:53 +02:00
Jes Sorensen c05a9dbfb2 rtl8xxxu: Implment rtl8192eu_power_on()
This implements the rtl8192eu power on sequence, and splits it off
from the rtl8192cu/rtl8723au power on sequence.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:28:53 +02:00
Jes Sorensen b001e086c4 rtl8xxxu: Add rtl8192eu_nic.bin to the MODULE_FIRMWARE list
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:28:53 +02:00
Jes Sorensen 4a82ffe3f8 rtl8xxxu: Use 1024 byte block loads for 8192eu firmware
The rtl8192eu can handle 1024 byte block writes, unlike it's
predecessors (8192cu/8188cu).

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:28:53 +02:00
Jes Sorensen 0e5d435a61 rtl8xxxu: Identify chip vendors correctly
This identifies the chip vendors correctly and also picks the correct
firmware for rtl8192eu.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:28:52 +02:00
Jes Sorensen 3307d84024 rtl8xxxu: Add initial code to parse rtl8192eu efuse
This is the start of 8192eu support. For now just detect the device
and parse the efuse.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10 15:28:52 +02:00
Kalle Valo 89ef41bfaa Merge 'net-next/master'
Needed by the upcoming merge of iwlwifi-next-for-kalle-2016-03-02 tag.
2016-03-06 14:57:44 +02:00
Jes Sorensen 5b22a111aa rtl8xxxu: Add missing bit define for REG_APS_FSMCO
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-02-25 11:55:44 +02:00
Jes Sorensen 4042e61735 rtl8xxxu: Make device_init kludge 8723au only
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-02-25 11:55:43 +02:00
Jes Sorensen dc254ca411 rtl8xxxu: Do not mask RF registers to 6 bits
Newer chips have RF registers beyond the original 0x3f address.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-02-25 11:55:42 +02:00
Jes Sorensen a9ffa615aa rtl8xxxu: Remove unused len/cnt variables from rtl8xxxu_rx_complete()
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-02-25 11:55:41 +02:00
Jes Sorensen 796c554257 rtl8xxxu: Remove unused mgmt variable from rtl8xxxu_rx_complete()
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-02-25 11:55:41 +02:00
Jes Sorensen 53b381c4d7 rtl8xxxu: Set correct bit to reset MCU IO wrapper
All chips, except for 8812 require BIT(0) for resetting the MCU IO
wrapper. 8723b requires a more complicated reset sequence, so it will
need a custom reset function.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-02-25 11:55:40 +02:00
Jes Sorensen a26703f39d rtl8xxxu: rtl8xxxu_set_linktype(): Be consistent aboutregister size REG_MSR
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-02-25 11:55:39 +02:00
Bruno Randolf c85ea1156d rtl8xxxu: Enable data frame reception in rtl8xxxu_start
mac80211 documentation says, the ieee80211_ops.start callback "must turn on
frame reception (for possibly enabled monitor interfaces.)". If not a single
monitor interface does not receive data frames.

Similarly we should not change the data reception based on the association
state.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-02-25 11:55:38 +02:00
Jes Sorensen 755bda116e rtl8xxxu: Fix 80 character per line issue
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-02-25 11:55:37 +02:00
Jes Sorensen 124bc63c99 rtl8xxxu: Remove duplicate USB ID
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-02-25 11:55:36 +02:00
Bruno Randolf b40027ba8d rtl8xxxu: Document REG_RXFLTMAP registers
Add comments describing how REG_RXFLTMAP0, REG_RXFLTMAP1 and REG_RXFLTMAP2
work.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-02-25 11:55:36 +02:00
Bruno Randolf 3bed4bfa51 rtl8xxxu: Enable monitor mode by handling filters
Monitor mode is enabled by handling the filter flags we get from mac80211 in
rtl8xxxu_configure_filter() and writing them to the RCR register.

By handling the filters, we can also stop setting the BSSID filters in the
association event.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-02-25 11:55:35 +02:00
Jes Sorensen 56e4374a5e rtl8xxxu: Fix cosmetics to quiet down checkpatch police
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-02-25 11:55:34 +02:00
Jakub Sitnicki 38451998fb rtl8xxxu: Use REG_EFUSE_TEST register only on multifunctional devices
rtl8192cu driver doesn't read/write the REG_EFUSE_TEST register.
Neither does the rtl8188eu driver.  Do it only for multifunc devices
RTL8723AU/RTL8723BU.

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-02-25 11:55:33 +02:00
Jes Sorensen e5c447ccf8 rtl8xxxu: Remove unused clutter for handling recursive calls to rtl8xxxu_init_device()
This was a leftover from the vendor driver that was never utilized.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-02-25 11:55:32 +02:00
Jes Sorensen ce6f2e3669 rtl8xxxu: Add REG_OFDM0_RX_D_SYNC_PATH definitions
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-02-25 11:55:31 +02:00
Jes Sorensen 29c2139cd0 rtl8xxxu: Add mbox extension register definitions for 8723B
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-02-25 11:55:30 +02:00
Jes Sorensen af9e4d6d9d rtl8xxxu: Add definitions for antenna selection registers for 8723BU
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-02-25 11:55:29 +02:00
Jes Sorensen d48fe60e06 rtl8xxxu: Implement rtl8xxxu_reset_8051()
We need to reset the 8051 in order for it to launch the fw on the
rtl8192eu.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-02-25 11:55:28 +02:00
Tobias Klauser 98e27cbd94 rtl8xxxu: Check return value of kmemdup()
In rtl8xxxu_load_firmware() check the return value of kmemdup() and
error out with -ENOMEM in case of NULL to prevent a NULL pointer
dereference.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-02-25 11:55:27 +02:00
Tobias Klauser c1edece3c2 rtl8xxxu: Fix typo in Kconfig help text
Fix spelling of "benefits".

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-02-25 11:55:27 +02:00
Jes Sorensen 22229fcb48 rtl8xxxu: Add more RCR bits
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-02-25 11:55:26 +02:00
Jes Sorensen cecfd3cb29 rtl8xxxu: Add REG_TX_REPORT_* defines
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-02-25 11:55:25 +02:00
Jes Sorensen f076977537 rtl8xxxu: Define SYS_CFG_SW_OFFLOAD_EN
This is needed for chips with IOL support.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-02-25 11:55:24 +02:00
Jes Sorensen 0635f8cede rtl8xxxu: Add RQPN_[NE]PQ_SHIFT values
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-02-25 11:55:23 +02:00
Jes Sorensen 216202ae20 rtl8xxxu: If fw running in RAM, reset the 8051 before trying to download a new one
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-02-25 11:55:22 +02:00
Jes Sorensen ef1c049931 rtl8xxxu: rtl8xxxu_download_firmware(): Cosmetic cleanups
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-02-25 11:55:21 +02:00
Jes Sorensen 43154f6fd4 rtl8xxxu: Minor cleanup to rtl8xxxu_download_firmware()
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-02-25 11:55:20 +02:00
Sara Sharon 50ea05efaf mac80211: pass block ack session timeout to to driver
Currently mac80211 does not inform the driver of the session
block ack timeout when starting a rx aggregation session.
Drivers that manage the reorder buffer need to know this
parameter.
Seeing that there are now too many arguments for the
drv_ampdu_action() function, wrap them inside a structure.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2016-01-14 11:13:17 +01:00
Kalle Valo c0963772cb rtl8xxxu: fix unused rtl8192cu_fops compiler warning
kbuild reported:

rtl8xxxu.c:5786:32: warning: ‘rtl8192cu_fops’ defined but not used [-Wunused-variable]

Fix it by adding temporary ifdefs around the static functions.

Fixes: 033695bdf6 ("rtl8xxxu: move devices supported by rtlwifi under UNTESTED config")
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-10-26 18:06:10 +02:00
Kalle Valo 033695bdf6 rtl8xxxu: move devices supported by rtlwifi under UNTESTED config
There are still four devices which are currently supported both by the new
rtl8xxxu driver and rtlwifi. To not break existing setups enable the support
for these four devices only when CONFIG_RTL8XXXU_UNTESTED is turned on.

Once rtl8xxxu support is found to be good enough the devices can be removed
from rtlwifi and enabled by default in rtl8xxxu.

Reported-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-10-24 09:20:13 +03:00
Jes Sorensen 26f1fad29a New driver: rtl8xxxu (mac80211)
This is an alternate driver for a number of Realtek WiFi USB devices,
including RTL8723AU, RTL8188CU, RTL8188RU, RTL8191CU, and RTL8192CU.
It was written from scratch utilizing the Linux mac80211 stack.

After spending months cleaning up the vendor provided rtl8723au
driver, which comes with it's own 802.11 stack included, I decided to
rewrite this driver from the bottom up.

Many thanks to Johannes Berg for 802.11 insights and help and Larry
Finger for help with the vendor driver.

The full git log for the development of this driver can be found here:
git git://git.kernel.org/pub/scm/linux/kernel/git/jes/linux.git
    branch rtl8723au-mac80211

This driver is still under development, but has proven to be very
stable for me. It currently supports station mode only. It has support
for OFDM and CCK rates. It does lack certain features found in the
staging driver, such as power management, AMPDU, and 40MHz channel
support. In addition it does not support AD-HOC, AP, and monitor mode
support at this point.

The driver is known to work with the following devices:
Lenovo Yoga (rtl8723au)
TP-Link TL-WN823N (rtl8192cu)
Etekcity 6R (rtl8188cu)
Daffodil LAN03 (rtl8188cu)
Alfa AWUS036NHR (rtl8188ru)

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-10-21 10:53:29 +03:00