summaryrefslogtreecommitdiff
path: root/drivers/net/wireless
AgeCommit message (Collapse)AuthorFilesLines
2016-03-14ath9k: fix misleading indentationArnd Bergmann1-2/+2
A cleanup patch in linux-3.18 moved around some code in the ath9k driver and left some code to be indented in a misleading way, made worse by the addition of some new code for p2p mode, as discovered by a new gcc-6 warning: drivers/net/wireless/ath/ath9k/init.c: In function 'ath9k_set_hw_capab': drivers/net/wireless/ath/ath9k/init.c:851:4: warning: statement is indented as if it were guarded by... [-Wmisleading-indentation] hw->wiphy->iface_combinations = if_comb; ^~ drivers/net/wireless/ath/ath9k/init.c:847:3: note: ...this 'if' clause, but it is not if (ath9k_is_chanctx_enabled()) ^~ The code is in fact correct, but the indentation is not, so I'm reformatting it as it should have been after the original cleanup. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: 499afaccf6f3 ("ath9k: Isolate ath9k_use_chanctx module parameter") Fixes: eb61f9f623f7 ("ath9k: advertise p2p dev support when chanctx") Signed-off-by: David S. Miller <davem@davemloft.net>
2016-03-14ath9k: fix buffer overrun for ar9287Arnd Bergmann1-4/+3
Code that was added back in 2.6.38 has an obvious overflow when accessing a static array, and at the time it was added only a code comment was put in front of it as a reminder to have it reviewed properly. This has not happened, but gcc-6 now points to the specific overflow: drivers/net/wireless/ath/ath9k/eeprom.c: In function 'ath9k_hw_get_gain_boundaries_pdadcs': drivers/net/wireless/ath/ath9k/eeprom.c:483:44: error: array subscript is above array bounds [-Werror=array-bounds] maxPwrT4[i] = data_9287[idxL].pwrPdg[i][4]; ~~~~~~~~~~~~~~~~~~~~~~~~~^~~ It turns out that the correct array length exists in the local 'intercepts' variable of this function, so we can just use that instead of hardcoding '4', so this patch changes all three instances to use that variable. The other two instances were already correct, but it's more consistent this way. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: 940cd2c12ebf ("ath9k_hw: merge the ar9287 version of ath9k_hw_get_gain_boundaries_pdadcs") Signed-off-by: David S. Miller <davem@davemloft.net>
2016-03-10rtl8xxxu: Temporarily disable 8192eu device initJes Sorensen1-0/+4
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-10rtl8xxxu: Use correct 8051 reset function for 8723b partsJes Sorensen2-2/+39
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-10rtl8xxxu: Print a warning if flushing the FIFO failsJes Sorensen1-1/+4
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-10rtl8xxxu: Flush FIFO before powering down devicesJes Sorensen2-0/+36
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-10rtl8xxxu: Implement device specific power_off functionJes Sorensen3-2/+99
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-10rtl8xxxu: Implement 8723bu specific disable_rf() functionJes Sorensen2-1/+17
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-10rtl8xxxu: Use define for REG_PWR_DATA bitsJes Sorensen2-2/+2
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-10rtl8xxxu: convert rtl8723bu_init_bt() into rtl8723b_enable_rf()Jes Sorensen2-11/+1
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-10rtl8xxxu: Remove unncessary semicolonJes Sorensen1-1/+1
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-10rtl8xxxu: Pass RX rate to rx_parse_phystats and enable phystats for rtl8723buJes Sorensen1-4/+9
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-10rtl8xxxu: Process C2H RA_REPORT events for 8723buJes Sorensen2-0/+17
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-10rtl8xxxu: Dump contents of unhandled C2H eventsJes Sorensen1-1/+4
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-10rtl8xxxu: Report media status using the correct H2C command for 8723buJes Sorensen2-7/+47
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-10rtl8xxxu: Implement basic 8723b specific update_rate_mask() functionJes Sorensen2-4/+50
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-10rtl8xxxu: Define 8723b H2C ramask command structureJes Sorensen1-1/+10
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-10rtl8xxxu: Do not parse RX descriptor info for C2H packetsJes Sorensen1-10/+7
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-10rtl8xxxu: Improve handling of txdesc32 vs txdesc40 handlingJes Sorensen2-38/+92
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-10rtl8xxxu: TX RTS rate is word 4 for 8723aJes Sorensen2-3/+4
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-10rtl8723au: Update TX descriptor words 4 and 5 definitionsJes Sorensen2-15/+28
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-10rtl8xxxu: Set sequence number correctly for 40 byte TX descriptorsJes Sorensen2-10/+22
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-10rtl8xxxu: Set the correct TX descriptor bits for agg and break on 8723bJes Sorensen1-3/+16
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-10rtl8xxxu: Add more 40 byte TX desc bit definitionsJes Sorensen2-6/+28
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-10rtl8xxxu: Add additional tx descriptor bits for data word 0Jes Sorensen1-0/+4
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-10rtl8xxxu: Do not unconditionally print debug info in rtl8723bu_handle_c2h()Jes Sorensen1-9/+9
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-10rtl8xxxu: Handle 40 byte TX descriptors for rtl8723buJes Sorensen2-13/+25
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-10rtl8xxxu: Add definition for 8723bu tx descriptorJes Sorensen1-0/+16
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-10rtl8xxxu: Set the correct thermal meter register for 8723buJes Sorensen1-1/+5
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-10rtl8xxxu: Set 8723bu MCS TX powerJes Sorensen1-2/+12
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-10rtl8xxxu: Set 8723bu TX power for CCK and OFDM ratesJes Sorensen1-1/+22
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-10rtl8xxxu: Parse efuse power indices for 8723buJes Sorensen2-15/+71
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-10rtl8xxxu: Bump TX power arrays to handle larger channel groupsJes Sorensen1-9/+16
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-10rtl8xxxu: Use size of source pointer when copying efuse dataJes Sorensen1-17/+17
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-10rtl8xxxu: Introduce set_tx_power() fileop and a new 8723b dummy derivativeJes Sorensen2-2/+34
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-10rtl8xxxu: Correct struct rtl8723bu_efuse to list power bases correctlyJes Sorensen2-15/+18
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-10rtl8xxxu: Do not use hard-wired RF enable settings for 8723buJes Sorensen2-1/+10
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-10rtl8xxxu: Setup coex table correctly (hopefully)Jes Sorensen1-5/+9
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-10rtl8xxxu: Use REG_RFE_CTRL_ANTA_SRC rather than hard coded valueJes Sorensen1-2/+2
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-10rtl8xxxu: Use name for REG_RFE_BUFFER rather than hard coded valueJes Sorensen1-4/+4
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-10rtl8xxxu: 8723bu: REG_BT_COEX_TABLE4 is only 8 bitsJes Sorensen1-1/+1
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-10rtl8xxxu: Set WLAN_ACT_CONTROL per vendor driver settingJes Sorensen1-1/+1
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-10rtl8xxxu: RF_T_METER is different on the newer chipsJes Sorensen1-6/+7
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-10rtl8xxxu: Implement init_statistics for 8723buJes Sorensen3-0/+35
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-10rtl8xxxu: Add missing blank space in front of bracketJes Sorensen1-1/+1
Keep the automated tools happy Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-03-10rtl8xxxu: Setup RX aggregationJes Sorensen3-0/+25
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-10rtl8xxxu: Group chip quirks togetherJes Sorensen1-13/+15
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-10rtl8xxxu: Add REG_DWBCN1_CTRL_8723B defineJes Sorensen1-0/+2
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-10rtl8xxxu: 8723bu lock phy after RF initJes Sorensen1-0/+7
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-10rtl8xxxu: Call device specific _config_channel()Jes Sorensen1-1/+1
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>