Commit Graph
80 Commits
Author SHA1 Message Date
Stanislaw GruszkaandFelix Fietkau 086ea9f42c mt76: unify sta structure part 2
Second part of unifying mt76x02_sta structure between mt76x0 and mt76x2.

Signed-off-by: Stanislaw Gruszka <[email protected]>
2018-09-11 13:49:19 +02:00
Stanislaw GruszkaandFelix Fietkau 732535e54b mt76: unify mac_wcid_setup
Merge mt76x{0,2}_mac_wcid_setup into common code.

Signed-off-by: Stanislaw Gruszka <[email protected]>
2018-09-11 13:49:19 +02:00
Stanislaw GruszkaandFelix Fietkau 34a95b8bf5 mt76: unify mac_shared_key_setup
Merge mt76x{0,2} mac_shared_key_setup into common code.

Signed-off-by: Stanislaw Gruszka <[email protected]>
2018-09-11 13:49:19 +02:00
Stanislaw GruszkaandFelix Fietkau a2380992d8 mt76: create new mt76x02-lib module for common mt76x{0,2} code
Move rxfilter and mutex to common structure. Create mt76x02-lib.ko
for mt76x0 and mt76x2 common functions and create new unified
mt76x02_configure_filter() function there.

Signed-off-by: Stanislaw Gruszka <[email protected]>
2018-09-11 13:49:19 +02:00
Stanislaw GruszkaandFelix Fietkau 884eca5f4b mt76: unify wait_for_mac
Create new mt76x02_mac.h for common mac functions of mt76x0 and mt76x2
and unity wait_for_mac for both drivers.

Signed-off-by: Stanislaw Gruszka <[email protected]>
2018-09-11 13:49:19 +02:00
Lorenzo BianconiandFelix Fietkau 8f568cebdb mt76: add mt76x2_init_common to mt76x2-common module
Move init related code shared between mt76x2 and mt76x2u in
mt76x2-common module

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
2018-09-11 13:49:19 +02:00
Lorenzo BianconiandFelix Fietkau 29f960aa27 mt76: add mt76x2_mac_common to mt76x2-common module
Move mac related code shared between mt76x2 and mt76x2u in
mt76x2-common module

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
2018-09-11 13:49:19 +02:00
Lorenzo BianconiandFelix Fietkau 6a1e809102 mt76x2: move interface_modes definition in mt76x2_init
Move  wiphy interface_modes definition in mt76x2_init in order to
reuse mt76_register_device routine supporting mt76x2u based chipsets
since mt76x2u currently supports just sta mode

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
2018-09-11 13:49:19 +02:00
Lorenzo BianconiandFelix Fietkau d08ea82f7f mt76x2: introduce mt76x2_init_device routine
Add mt76x2_init_device routine in order to reuse common pcie/usb mac80211
initialization code supporting mt76x2u based device

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
2018-09-11 13:49:19 +02:00
Lorenzo BianconiandFelix Fietkau c55d29bcf1 mt76x2: move utility routines in mt76x2.h
In order to reuse them supporting mt76x2u based devices, move
mt76x2_wait_for_mac, wait_for_wpdma and mt76x2_channel_silent in
mt76x2.h

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
2018-09-11 13:49:19 +02:00
Lorenzo BianconiandFelix Fietkau 3f0ac3557b mt76x2: init: disable APCLI by default
It is no longer necessary for client mode operation, vif index entries
8-16 are no longer used

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2018-09-11 13:49:19 +02:00
Felix Fietkau 0853d79366 Revert "mt76x2: add functions for setting extended MAC address registers"
This reverts commit 68b0cf17ef.
Not used at the moment, will be added back later, when needed.

Signed-off-by: Felix Fietkau <[email protected]>
2018-08-25 13:17:16 +02:00
Felix Fietkau d220f4383a Revert "mt76x2: reset HW before probe"
This reverts commit 4d2c565653.
Will be added back later after mt76x2u rework

Signed-off-by: Felix Fietkau <[email protected]>
2018-08-25 13:17:16 +02:00
Lorenzo BianconiandFelix Fietkau f622975a99 mt76x2: fix CCK protection control frame rate
Use 11M as tx rate for CCK protection control frames

Fixes: 7bc04215a66b ("mt76: add driver code for MT76x2e")
Signed-off-by: Lorenzo Bianconi <[email protected]>
2018-07-13 16:32:33 +02:00
Stanislaw GruszkaandFelix Fietkau 4d2c565653 mt76x2: reset HW before probe
Signed-off-by: Stanislaw Gruszka <[email protected]>
2018-07-13 16:30:17 +02:00
Felix Fietkau 1d4ca10a56 mt76x2: track rssi for gain adjustment per station
This preserves more sensitivity when weak stations are active

Signed-off-by: Felix Fietkau <[email protected]>
2018-06-19 11:15:19 +02:00
Felix Fietkau 65e161bec8 mt76x2: fix tracking rssi for dynamic gain adjustment
Only use unicast rssi, to avoid counting signal data from other
networks.

Signed-off-by: Felix Fietkau <[email protected]>
2018-06-15 20:49:55 +02:00
Felix Fietkau fcbb49e863 mt76x2: use udelay instead of usleep_range in mt76x2_mac_stop
usleep_range can cause excessive latency on channel change if waiting
for the MAC to stop fails. It will be forced to stop by the code
following that loop anyway.

Signed-off-by: Felix Fietkau <[email protected]>
2018-05-20 07:57:25 +02:00
Felix Fietkau 21c1e1eae5 mt76: move ieee80211_hw allocation to common core
Allows it to be shared between different drivers and locks to be
initialized earlier

Signed-off-by: Felix Fietkau <[email protected]>
2018-05-20 07:57:25 +02:00
Lorenzo BianconiandFelix Fietkau e87f925667 mt76x2: apply coverage class on slot time too
According to 802.11-2007 17.3.8.6 (slot time), the slot time should
be increased by 3 us * coverage class. Taking into account coverage
class in slot time configuration allows to increase by an order of
magnitude the throughput on a 4Km link in a noisy environment

Tested-by: Luca Bisti <[email protected]>
Tested-by: Gaetano Catalli <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
2018-05-15 13:16:16 +02:00
Felix Fietkau a78673d523 mt76: fix sending encrypted broadcast packets for secondary interfaces
For encryption to work properly, the BSS index needs to be initialized
for the WCID entry used for the interface.

Signed-off-by: Felix Fietkau <[email protected]>
2018-05-15 13:03:31 +02:00
Lorenzo BianconiandFelix Fietkau fd58b28292 mt76x2: add a polling delay in mt76x2_mac_stop routine
Add a usleep_range in mt76x2_mac_stop routine in order to add
a polling delay checking values of MT_MAC_STATUS and IBI_R12 registers

Signed-off-by: Lorenzo Bianconi <[email protected]>
2018-05-10 18:28:18 +02:00
Felix Fietkau ec8435e711 mt76: initialize rx lock earlier
Fixes lockdep warning on mt7603

Signed-off-by: Felix Fietkau <[email protected]>
2018-04-18 09:38:07 +02:00
Lorenzo BianconiandFelix Fietkau 700ed20476 mt76x2: make mt76x2_mac_reset routine static
Add static qualifier to mt76x2_mac_reset routine and remove the
prototype from mt76x2_mac.h since it is used just in mt76x2_init.c

Signed-off-by: Lorenzo Bianconi <[email protected]>
2018-04-03 21:36:32 +02:00
Lorenzo BianconiandFelix Fietkau 7e6e00bf0a mt76: initialize available_antennas_{tx,rx} info
Initialize available_antennas related info in wiphy data structure
according to antenna_mask field; antenna_mask info is initialized
in device specific code and will be used in mac80211 {set,get}_antenna
callbacks

Signed-off-by: Lorenzo Bianconi <[email protected]>
2018-03-21 11:23:10 +01:00
Felix Fietkau f515dfcca1 mt76: implement AP_LINK_PS
With software A-MPDU reordering in place, frames that notify mac80211 of
powersave changes are reordered as well, which can cause connection
stalls. Fix this by implementing powersave state processing in the
driver.

Signed-off-by: Felix Fietkau <[email protected]>
2018-01-26 11:41:38 +01:00
Lorenzo BianconiandFelix Fietkau 302af90bdc mt76x2: init: disable all pending tasklets during device removal
There is a possible race in mt76x2_stop_hardware() since pre_tbtt and
dfs tasklets could run during driver cleanup. Fix it disabling all
pending tasklets during device removal

Signed-off-by: Lorenzo Bianconi <[email protected]>
2018-01-23 11:39:46 +01:00
Felix Fietkau 9b2c77826d mt76: validate rx CCMP PN
Apparently hardware does not perform CCMP PN validation in hardware, so
we need to take care of this in the driver.

Signed-off-by: Felix Fietkau <[email protected]>
2018-01-22 11:06:19 +01:00
Felix Fietkau b0508d3044 mt76: implement A-MPDU rx reordering in the driver code
This is required for performing CCMP PN validation in software

Signed-off-by: Felix Fietkau <[email protected]>
2018-01-22 10:43:21 +01:00
Lorenzo BianconiandFelix Fietkau cf591704e2 mt76x2: dfs: add set_domain handler
Add mt76x2_dfs_set_domain routine in order to properly reconfigure
pattern detector when DFS domain has been changed

Signed-off-by: Lorenzo Bianconi <[email protected]>
2018-01-18 19:06:30 +01:00
Felix Fietkau 68b0cf17ef mt76x2: add functions for setting extended MAC address registers
Signed-off-by: Felix Fietkau <[email protected]>
2017-12-17 11:50:14 +01:00
Felix Fietkau d242650960 Revert "mt76x2: remove MAC address limitation for multi-vif setups"
This reverts commit 170f3341c6.
2017-12-17 11:44:47 +01:00
Felix Fietkau bdc6f2f970 Revert "mt76x2: clean up MAC/BSSID address initialization"
This reverts commit 3563b8fd0a.
2017-12-17 11:44:27 +01:00
Felix Fietkau bcd576e710 Revert "mt76x2: drop wiphy->addresses"
This reverts commit 9de77e1efc.
2017-12-17 11:44:11 +01:00
Felix Fietkau 860b185a43 Revert "mt76x2: init: disable APCLI by default"
This reverts commit a6a6e2582a.
2017-12-17 11:43:51 +01:00
Lorenzo BianconiandFelix Fietkau ac815fa2a5 mt76x2: init: fix rx filter default value during init
mt76x2_mac_start writes dev->rxfilter to the hardware. It also happens
during init, before dev->rxfilter is filled with the initval register
value, leading to issues like promisc mode being enabled
unconditionally.

Fix this by reading the default value into dev->rxfilter earlier

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2017-12-08 12:11:04 +01:00
Lorenzo BianconiandFelix Fietkau a6a6e2582a mt76x2: init: disable APCLI by default
It is no longer necessary for client mode operation, vif index entries
8-16 are no longer used

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2017-12-07 21:18:55 +01:00
Felix Fietkau 9de77e1efc mt76x2: drop wiphy->addresses
Now that the MAC address limitation is resolved, we no longer need a MAC
address list

Signed-off-by: Felix Fietkau <[email protected]>
2017-12-07 19:51:01 +01:00
Felix Fietkau 3563b8fd0a mt76x2: clean up MAC/BSSID address initialization
Drop the use of the EEPROM address entirely, rely on interface address
only

Signed-off-by: Felix Fietkau <[email protected]>
2017-12-07 19:51:01 +01:00
Felix Fietkau 170f3341c6 mt76x2: remove MAC address limitation for multi-vif setups
The hardware has a separate set of registers to configure a
per-interface MAC address.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2017-12-07 19:50:46 +01:00
Felix Fietkau 19fff41338 mt76x2: convert between per-chain tx power and combined output
Using both chains adds max. 3 dBm.

Signed-off-by: Felix Fietkau <[email protected]>
2017-11-30 12:59:31 +01:00
Felix Fietkau 3bd7e76e2d mt76x2: initialize channel power limits
Signed-off-by: Felix Fietkau <[email protected]>
2017-11-30 12:33:47 +01:00
Felix Fietkau 60172cc63c mt76x2: clear drop flag for all WCIDs on init
Signed-off-by: Felix Fietkau <[email protected]>
2017-11-15 18:00:10 +01:00
Lorenzo BianconiandFelix Fietkau 58e9138323 mt76x2: init: add ma80211 led callbacks
Signed-off-by: Lorenzo Bianconi <[email protected]>
2017-10-31 10:22:15 +01:00
Lorenzo BianconiandFelix Fietkau b9f3193a24 mt76x2: init: unlock DFS channels
Signed-off-by: Lorenzo Bianconi <[email protected]>
2016-09-25 18:13:37 +02:00
Lorenzo BianconiandFelix Fietkau 6375fc1abe mt76x2: add hw radar detector
add hw DFS pattern detector support for mt76x2 based devices
DFS region supported:
 - FCC
 - ETSI
 - JAPAN_W53
 - JAPAN_W56

Signed-off-by: Lorenzo Bianconi <[email protected]>
2016-09-25 18:13:12 +02:00
Felix Fietkau d7f5112c09 mt76x2: fix checkpatch warnings
Signed-off-by: Felix Fietkau <[email protected]>
2016-09-04 18:59:22 +02:00
Felix Fietkau b300bdc42e use the new bitfield accessor macros
Signed-off-by: Felix Fietkau <[email protected]>
2016-09-04 17:37:26 +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