Commit Graph

97 Commits

Author SHA1 Message Date
Thomas Gleixner
5b497af42f treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 295
Based on 1 normalized pattern(s):

  this program is free software you can redistribute it and or modify
  it under the terms of version 2 of the gnu general public license as
  published by the free software foundation this program is
  distributed in the hope that it will be useful but without any
  warranty without even the implied warranty of merchantability or
  fitness for a particular purpose see the gnu general public license
  for more details

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-only

has been chosen to replace the boilerplate/reference in 64 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Alexios Zavras <alexios.zavras@intel.com>
Reviewed-by: Allison Randal <allison@lohutok.net>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190529141901.894819585@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-05 17:36:38 +02:00
Luis de Bethencourt
8054a275de rtl8xxxu: Fix trailing semicolon
The trailing semicolon is an empty statement that does no operation.
Removing it since it doesn't do anything.

Signed-off-by: Luis de Bethencourt <luisbg@kernel.org>
Acked-by: Jes Sorensen <Jes.Sorensen@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-01-24 17:45:17 +02:00
Jes Sorensen
1ee83789fc rtl8xxxu: Update author/maintainer contact info
Update copyright year and email address.

Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-01-20 11:49:01 +02:00
Jes Sorensen
b4c3d9cfb6 rtl8xxxu: Pass tx_info to fill_txdesc in order to have access to retry count
In order to obtain retry count for a given rate we need to pass the
full struct ieee80211_tx_info to the function setting the rate in he
TX descriptor.

This uncovered a huge bug where the old code would use struct
ieee80211_rate.flags to test for rate parameters, which is always
zero, instead of the flags value from struct ieee80211_tx_rate.

Time to find a brown paper bag :(

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-11-25 11:51:01 +02:00
Jes Sorensen
a748a11038 rtl8xxxu: Obtain RTS rates from mac80211
Use the mac80211 provided rate for RTS rather than the hard coded
24Mbps as suggested by the vendor drivers.

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-11-25 11:51:01 +02:00
Jes Sorensen
cf7cfef064 rtl8xxxu: Fix big-endian problem reporting mactime
The full RX descriptor is converted so converting tsfl again would
return it to it's original endian value.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-11-25 11:50:59 +02:00
Larry Finger
b42fbed6b8 rtl8xxxu: Stop log spam from each successful interrupt
As soon as debugging is turned on, the logs are filled with messages
reporting the interrupt status. As this quantity is usually zero, this
output is not needed. In fact, there will be a report if the status is
not zero, thus the debug line in question could probably be deleted.
Rather than taking that action, I have changed it to only be printed
when the newly added RTL8XXXU_DEBUG_INTERRUPT bit is set in the debug
mask.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-09-26 20:41:37 +03:00
Jes Sorensen
c0a99bbb1b rtl8xxxu: Clean up llt_init() API
Remove last_tx_page argument from the llt_init() function. The
rtl8xxxu_fileops structure contains the correct TX_TOTAL_PAGE_NUM
value for the device, and rtl8xxxu_auto_llt_table() doesn't need to
know the value in the first place.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-09-26 20:41:36 +03:00
Jes Sorensen
b59415c2dd rtl8xxxu: Split filling of TX descriptors into separate functions
Split the filling of TX descriptors into a generic portion used on all
devices, and format specific helper functions provided in the fops
structure.

This also cleaned up some mess, even if non harmful, in the handling
of txdesc40 descriptors, where the code randomly would switch between
the pointer to tx_desc and tx_desc40.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-09-03 19:57:31 +03:00
Jes Sorensen
eed145ab25 rtl8xxxu: Introduce fops bitflag indicating type of thermal meter
Do not rely on TX descriptor size to determine the thermal meter
type.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-09-03 19:57:22 +03:00
Jes Sorensen
ee675cc30e rtl8xxxu: Convert flags in rtl8xxxu_fileops to bitflags
This leaves space for a few more flags within the same space.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-09-03 19:57:21 +03:00
Jes Sorensen
e3ebcd7428 rtl8xxxu: Use flag to indicate whether device has TX report timer support
Use a fileops flag to indicate whether the device has TX report timer
support. This will make it easier to include future devices such as
8188eu to use the TX report timer.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-09-03 19:57:20 +03:00
Jes Sorensen
44abaa08d0 rtl8xxxu: Add TX page defines for 8723b
This switches the 8723b driver to use the new
rtl8xxxu_init_queue_reserved_page() function.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-09-03 19:57:13 +03:00
Jes Sorensen
91dcbb7175 rtl8xxxu: Enable aggregation for rtl8723au
Implement rtl8xxxu_gen1_init_aggregation(). Aggregation should be the
same for all gen1 parts. We may want to allow for tuning parameters in
the fileopes struct. For now this is based allocating 16KB RX buffers,
leaving 16000 bytes for actual packets, and the rest for the skb
overhead.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-07-08 16:41:57 +03:00
Jes Sorensen
04319ae2f6 rtl8xxxu: Allocate larger RX skbs when aggregation is enabled
This adds support for allocating larger skbs for devices which
indicate they support it.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-07-08 16:41:56 +03:00
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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