Commit Graph
35 Commits
Author SHA1 Message Date
Shayne ChenandFelix Fietkau 1d2aedb248 mt76: extend DT rate power limits to support 11ax devices
Enable parsing per-rate txpower limits from DT for 11ax chipsets.

Co-developed-by: Felix Fietkau <[email protected]>
Tested-by: Evelyn Tsai <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-06-16 22:04:15 +02:00
Felix Fietkau 769b030de6 mt76: add functions for parsing rate power limits from DT
This subnode can be used to set per-rate tx power limits either per
country code / regdomain or globally.
These limits are typically provided by the device manufacturers and are
used to limit sideband emissions and stay within regulatory limits

Signed-off-by: Felix Fietkau <[email protected]>
2020-06-16 22:04:15 +02:00
Lorenzo BianconiandFelix Fietkau 1c8e76f4de mt76: fix compilation warning in mt76_eeprom_override()
Fix the following compilation warning in mt76_eeprom_override routine
when CONFIG_OF is not set and label 'out' is not actually used

drivers/net/wireless/mediatek/mt76/eeprom.c: In function ‘mt76_eeprom_override’:
drivers/net/wireless/mediatek/mt76/eeprom.c:100:1: warning: label ‘out’ defined but not used [-Wunused-label]

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-12-22 16:11:10 +01:00
Lorenzo BianconiandFelix Fietkau 812692db17 mt76: eeprom: add support for big endian eeprom partition
mt76x0e users reported some devices (e.g TP-Link Archer VR200v) have
been flashed with big endian radio partition. Add the possibility to
specify eeprom endianness using big-endian dts property and in case
covert eeprom data in little endian

Tested-by: Kevin Schmidt <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-12-13 23:16:32 +01:00
Shayne ChenandFelix Fietkau a116b0a6af mt76: fix possible undetected invalid MAC address
Make sure the MAC address is checked before function returns.

If CONFIG_OF is set and the device node is null, the function will
return directly, and an invalid MAC address will not be checked.

Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-12-13 22:43:10 +01:00
Wen YangandFelix Fietkau 0e3baf0213 mt76: fix a leaked reference by adding a missing of_node_put
The call to of_find_node_by_phandle returns a node pointer with refcount
incremented thus it must be explicitly decremented after the last
usage.

Detected by coccinelle with the following warnings:
./drivers/net/wireless/mediatek/mt76/eeprom.c:58:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 48, but without a corresponding object release within this function.
./drivers/net/wireless/mediatek/mt76/eeprom.c:61:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 48, but without a corresponding object release within this function.
./drivers/net/wireless/mediatek/mt76/eeprom.c:67:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 48, but without a corresponding object release within this function.
./drivers/net/wireless/mediatek/mt76/eeprom.c:70:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 48, but without a corresponding object release within this function.
./drivers/net/wireless/mediatek/mt76/eeprom.c:72:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 48, but without a corresponding object release within this function.

Signed-off-by: Wen Yang <[email protected]>
Cc: Felix Fietkau <[email protected]>
Cc: Lorenzo Bianconi <[email protected]>
Cc: Kalle Valo <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Matthias Brugger <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Kalle Valo <[email protected]>
2019-08-22 09:26:30 +02:00
Ryder LeeandFelix Fietkau f625afcedc mt76: switch to SPDX tag instead of verbose boilerplate text
No functional change intended.

Add SPDX identifiers to all remaining files in /mt76.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-08-20 15:22:20 +02:00
Felix Fietkau 3245ca8b8a mt76: check of_get_mac_address for NULL as well to restore old kernel compat
Signed-off-by: Felix Fietkau <[email protected]>
2019-08-12 20:26:55 +02:00
Petr Štetiar 75656a4590 net: wireless: support of_get_mac_address new ERR_PTR error
commit d31a36b5f407d796d121af745730712337cd32a1 upstream.

There was NVMEM support added to of_get_mac_address, so it could now return
ERR_PTR encoded error values, so we need to adjust all current users of
of_get_mac_address to this new fact.

Signed-off-by: Petr Štetiar <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2019-07-22 22:27:46 +02:00
Felix Fietkau a5eaeb27d6 revert mt76_eeprom_override call reordering
This call order is necessary for handling the device MAC address

Signed-off-by: Felix Fietkau <[email protected]>
2017-02-03 14:25:08 +01:00
Felix Fietkau 184e068b6f use wiphy_read_of_freq_limits to parse band capability overrides
Signed-off-by: Felix Fietkau <[email protected]>
2017-02-01 16:11:35 +01:00
Felix Fietkau a39d4b7bf9 eeprom: add missing ifdef for MTD support
Signed-off-by: Felix Fietkau <[email protected]>
2016-12-15 13:00:03 +01:00
Felix Fietkau b18d66f749 core: fix checkpatch errors
Signed-off-by: Felix Fietkau <[email protected]>
2016-09-05 11:12:19 +02:00
Felix Fietkau 53c1b7f6ac update my email address
Signed-off-by: Felix Fietkau <[email protected]>
2016-09-04 17:33:28 +02:00
Felix Fietkau ced81a3458 relicense to ISC (except for util.h which is based on GPL'd kernel code
Signed-off-by: Felix Fietkau <[email protected]>
2016-07-12 08:38:46 +02:00
Felix Fietkau 079ad90fe2 update copyright lines
Signed-off-by: Felix Fietkau <[email protected]>
2016-02-25 18:09:13 +01:00
Felix Fietkau d8d9600e12 eeprom: add support for overriding the mac address via OF
Signed-off-by: Felix Fietkau <[email protected]>
2016-01-01 19:40:30 +01:00
Felix Fietkau 6ca2852f65 move mac address validation to core
Signed-off-by: Felix Fietkau <[email protected]>
2016-01-01 19:38:59 +01:00
Felix Fietkau 239b67204c move eeprom related code to common
Signed-off-by: Felix Fietkau <[email protected]>
2015-12-16 02:09:26 +01:00
Felix Fietkau a0ee20716f add a mt76x2_ prefix to all files
Signed-off-by: Felix Fietkau <[email protected]>
2015-12-06 16:54:53 +01:00
Felix Fietkau 31c11fdb05 replace mt76 prefix with mt76x2 in preparation for splitting the driver for more chipset support
Signed-off-by: Felix Fietkau <[email protected]>
2015-12-06 16:54:53 +01:00
Felix Fietkau ffdfbb745b mt76: apply OTP tx power overrides for 2.4 GHz
Signed-off-by: Felix Fietkau <[email protected]>
2015-09-26 01:22:38 +02:00
Felix Fietkau d99eddbdee mt76: fix OTP based tx power data override for group 0
Signed-off-by: Felix Fietkau <[email protected]>
2015-09-26 01:09:16 +02:00
Felix Fietkau a1767ddf64 eeprom: add support for dumping otp data separately via debugfs
Signed-off-by: Felix Fietkau <[email protected]>
2015-09-26 00:59:16 +02:00
Felix Fietkau 58a24ef247 eeprom: fix swapped 2g/5g power for OFDM rates
Signed-off-by: Felix Fietkau <[email protected]>
2015-08-28 08:53:49 +02:00
Felix Fietkau ebe9aebc92 eeprom: apply cal free data
Signed-off-by: Felix Fietkau <[email protected]>
2015-07-30 18:29:31 +02:00
Felix Fietkau b0c1bbb8bc phy: fix tx power delta parsing for 2.4 GHz as well
Signed-off-by: Felix Fietkau <[email protected]>
2015-07-29 17:57:30 +02:00
Felix Fietkau b960a4f0c5 eeprom: move OF specific functions to of.c
Signed-off-by: Felix Fietkau <[email protected]>
2015-07-29 17:04:58 +02:00
Felix Fietkau a5bdc19797 phy: fix tx power delta parsing
Signed-off-by: Felix Fietkau <[email protected]>
2015-07-29 13:50:48 +02:00
Felix Fietkau 902757f059 phy: store rate tx power individually
Signed-off-by: Felix Fietkau <[email protected]>
2015-07-28 15:01:48 +02:00
Felix Fietkau ec91841868 eeprom: wrap mt76_check_eeprom in #ifdef CONFIG_OF for now
Signed-off-by: Felix Fietkau <[email protected]>
2015-06-15 23:10:41 +02:00
Felix Fietkau c772c3bc89 eeprom: validate flash data before using it
Signed-off-by: Felix Fietkau <[email protected]>
2015-06-13 10:32:46 +02:00
Jakub Kicinski bd45637645 correct number of efuse registers read
mt76_efuse_read() is supposed to read out 16 bytes of data
that is 4x4B data registers.  Correct the loop bounds.

Signed-off-by: Jakub Kicinski <[email protected]>
2015-02-01 10:53:57 +01:00
Felix Fietkau eca052894b eeprom.c: fix retlen type
Signed-off-by: Felix Fietkau <[email protected]>
2014-12-10 21:48:24 +01:00
Felix Fietkau 9e7049b1d1 Initial import
Signed-off-by: Felix Fietkau <[email protected]>
2014-11-20 21:21:19 +01:00