Commit Graph
1251 Commits
Author SHA1 Message Date
Lorenzo BianconiandFelix Fietkau 82fa31293f mt7603: move alloc_dev common code in mt76_alloc_device
Signed-off-by: Lorenzo Bianconi <[email protected]>
2019-02-18 20:39:41 +01:00
Lorenzo BianconiandFelix Fietkau 11ab62057e mt7603: rely on mt76_tx_queue_skb_raw common routine
Signed-off-by: Lorenzo Bianconi <[email protected]>
2019-02-18 20:39:41 +01:00
Lorenzo BianconiandFelix Fietkau cacc986701 mt7603: rely on mt76_mcu_rx_event routine
Signed-off-by: Lorenzo Bianconi <[email protected]>
2019-02-07 14:50:23 +01:00
Lorenzo BianconiandFelix Fietkau 471c447ca1 mt7603: rely on mt76_mcu_get_response routine
Signed-off-by: Lorenzo Bianconi <[email protected]>
2019-02-07 14:50:10 +01:00
Lorenzo BianconiandFelix Fietkau db47920ac2 mt7603: rely on mt76_mcu_msg_alloc routine
Signed-off-by: Lorenzo Bianconi <[email protected]>
2019-02-07 14:49:54 +01:00
Lorenzo BianconiandFelix Fietkau 0e8e53f6ad mt76: remove add_buf pointer in mt76_queue_ops
Remove add_buf function pointer in mt76_queue_ops data structure since
it is no longer used

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-02-07 14:48:44 +01:00
Lorenzo BianconiandFelix Fietkau 91d04558f0 mt76: move mt76_dma_tx_queue_skb_raw in mt76-core module
Move mt76_dma_tx_queue_skb_raw routine in dma.c and add the
corresponding entry in mt76_queue_ops data structure.
mt76_dma_tx_queue_skb_raw  will be reused adding support for
mt7603 driver

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-02-07 14:48:44 +01:00
Lorenzo BianconiandFelix Fietkau 4db9d75a08 mt76x0: mcu: remove useless commented configuration
Remove useless commented out configuration in mt76x0u_load_firmware
routine

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-02-07 14:48:44 +01:00
Lorenzo BianconiandFelix Fietkau 1763cb0d38 mt76: move mt76_mcu_rx_event in mt76-core
Move mt76_mcu_rx_event i mt76-core module and remove duplicated code.
mt76_mcu_rx_event will be reused adding support for mt7603 driver

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-02-07 14:48:44 +01:00
Lorenzo BianconiandFelix Fietkau 4637f95417 mt76: move mt76_mcu_get_response in mt76-core
Move mt76_mcu_get_response in mt76-core module and remove duplicated
code. mt76_mcu_get_response will be reused adding support for mt7603
driver

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-02-07 14:48:44 +01:00
Lorenzo BianconiandFelix Fietkau 6e33ce6d73 mt76: move mt76_mcu_msg_alloc in mt76-core
Move mt76_mcu_msg_alloc in mt76-core module and remove duplicated code.
mt76_mcu_msg_alloc will be reused adding support for mt7603 driver

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-02-07 14:48:34 +01:00
Lorenzo BianconiandFelix Fietkau 28d81ff90e mt76x0: eeprom: fix VHT mcs{8,9} rate power offset
Fix rate power configuration for VHT mcs 8 and 9 in
mt76x0_get_tx_power_per_rate. Moreover use the rate power
offset used for HT/VHT mcs 6 even for HT/VHT mcs 7

Fixes: b37bbc8c8251 ("mt76x0: remove eeprom dependency from mt76x0_set_tx_power_per_rate")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-02-07 14:47:57 +01:00
Felix Fietkau 74075efe44 mt76: increase ED/CCA tx block threshold
Block only when the busy time reaches 92%, as lower values can be reached with
heavy 802.11 traffic as well.

Signed-off-by: Felix Fietkau <[email protected]>
2019-02-03 20:37:47 +01:00
Felix Fietkau e301f2349a mt76: measure the time between mt76x02_edcca_check runs
Based on system load and time needed by other calibration runs, the time
between dev->mac_work runs can vary quite a bit.
Calculate busy time based on the actual time difference in order to avoid
potentially over-estimating busy time, which could lead to unnecessary tx
blocking.

Signed-off-by: Felix Fietkau <[email protected]>
2019-02-03 14:46:59 +01:00
Felix Fietkau 4e8766a59c mt76: clear CCA timer stats in mt76x02_edcca_init
Avoid triggering too early

Signed-off-by: Felix Fietkau <[email protected]>
2019-02-03 14:46:59 +01:00
Felix Fietkau e3c1aad159 mt76: run MAC work every 100ms
ED/CCA Tx blocking checks need to be run every 100 ms in order to avoid
triggering too late and keeping tx blocking on for too long

Signed-off-by: Felix Fietkau <[email protected]>
2019-02-03 14:46:51 +01:00
Felix Fietkau 4d7e13fcd5 mt76: explicitly disable energy detect cca during scan
Avoid reusing the previous channel's tx blocking state

Signed-off-by: Felix Fietkau <[email protected]>
2019-02-03 13:59:32 +01:00
Felix Fietkau a9d4c0ea0d mt76: mt76x2: avoid running DPD calibration if tx is blocked
Doing so could lead to hangs

Signed-off-by: Felix Fietkau <[email protected]>
2019-02-03 13:52:14 +01:00
Felix Fietkau 2afa0d7e7a mt7603: remove WCID override for software encrypted frames
It is not necessary, since the hardware has a flag to indicate hardware
encryption offload

Signed-off-by: Felix Fietkau <[email protected]>
2019-01-31 21:51:29 +01:00
Felix Fietkau e747e804c9 mt76: fix software encryption issues
Software encrypted packets can be passed not just through the drv_tx callback,
but also through the intermediate tx queue.
In order to deal with that, move the override to mt76x02_mac_write_txwi and
also take care of filling in the per-packet rate information

Signed-off-by: Felix Fietkau <[email protected]>
2019-01-31 21:13:39 +01:00
Felix Fietkau 8027b5d061 mt7603: remove copyright headers
No longer needed because of SPDX License Identifier

Signed-off-by: Felix Fietkau <[email protected]>
2019-01-31 18:30:30 +01:00
Stanislaw GruszkaandFelix Fietkau ff81de1fa3 mt76x02: enable support for IBSS and MESH
Since we implement beconing on USB now, similar interfaces should be
supported for USB as are for MMIO. Tested only on IBSS mode and
AP mode (not enabled due to lack of PS buffering).

Signed-off-by: Stanislaw Gruszka <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-01-31 09:37:27 +01:00
Stanislaw GruszkaandFelix Fietkau dcab682bd3 mt76: beaconing fixes for USB
Configure beaconing on USB devices without PS buffering support.

Signed-off-by: Stanislaw Gruszka <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-01-31 09:37:27 +01:00
Stanislaw GruszkaandFelix Fietkau 171adaf2c2 mt76x02: init beacon config for mt76x2u
Initialize beaconing also on mt76x2u.

Signed-off-by: Stanislaw Gruszka <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-01-31 09:37:27 +01:00
Stanislaw GruszkaandFelix Fietkau 38e832d912 mt76x02: minor beaconing init changes
Disable BEACON timer during init and configure interrupt registers
only for mmio devices.

Signed-off-by: Stanislaw Gruszka <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-01-31 09:37:27 +01:00
Stanislaw GruszkaandFelix Fietkau a80acaf544 mt76x02: initialize mutli bss mode when set up address
BSSID is not strtirct related with beaconing (for example we can have
2 STA vifs) and more related with MAC address, so initaize BSSID when
setting MAC address.

Signed-off-by: Stanislaw Gruszka <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-01-31 09:37:27 +01:00
Stanislaw GruszkaandFelix Fietkau dd52191faa mt76x02: use commmon add interface for mt76x2u
Since we now support mt76x2u feature to allow set mac address
when creating interface in common code we can use it for
mt76x2u.

Signed-off-by: Stanislaw Gruszka <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-01-31 09:37:27 +01:00
Stanislaw GruszkaandFelix Fietkau edda5c56d4 mt76x02: use mask for vifs
Use vif_mask to count interfaces to allow to set mac address in HW
if there is only one interface and report error if we create
interface with wrong BSSID resulting in already used index.

Signed-off-by: Stanislaw Gruszka <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-01-31 09:37:27 +01:00
Felix Fietkau a4ec45c294 mt7603: fix LED support (copy CFLAGS from main Makefile)
Signed-off-by: Felix Fietkau <[email protected]>
2019-01-31 09:35:33 +01:00
Lorenzo BianconiandFelix Fietkau bc7ce2a170 mt76x0: init: introduce mt76x0_init_txpower routine
Add mt76x0_init_txpower in order to initialize max_power per channel
at device bootstrap. Modify mt76x0_get_tx_power_per_rate and
mt76x0_get_power_info signature in order to compute tx power for
non-operating channels

Signed-off-by: Lorenzo Bianconi <[email protected]>
2019-01-30 15:14:44 +01:00
Lorenzo BianconiandFelix Fietkau 24bd2c0d6e mt76x0: phy: report target_power in debugfs
Initialize target_power variable in mt76x0_phy_set_txpower in order to
report target_power in debugfs

Signed-off-by: Lorenzo Bianconi <[email protected]>
2019-01-30 15:14:31 +01:00
Lorenzo BianconiandFelix Fietkau c989bac555 mt76x0: eeprom: fix chan_vs_power map in mt76x0_get_power_info
Report correct eeprom per channel power value.
Fix chan_vs_power map in mt76x0_get_power_info routine

Fixes: f2a2e819d672 ("mt76x0: remove eeprom dependency from mt76x0_get_power_info")
Signed-off-by: Lorenzo Bianconi <[email protected]>
2019-01-30 15:14:19 +01:00
Felix Fietkau b5ac8e49c5 mt7603: initialize LED callbacks only if CONFIG_MT76_LEDS is set
Signed-off-by: Felix Fietkau <[email protected]>
2019-01-30 15:03:25 +01:00
Felix Fietkau 0db925f076 mt7603: update HT/VHT capabilities after assoc
Signed-off-by: Felix Fietkau <[email protected]>
2019-01-30 12:18:32 +01:00
Felix Fietkau ae30c30f33 mt76: add driver callback for when a sta is associated
MT7603 needs this to update the HT/VHT capabilities

Signed-off-by: Felix Fietkau <[email protected]>
2019-01-30 12:17:23 +01:00
Felix Fietkau 6eef33bfd5 mt7603: remove mt7603_txq_init
Simplify the code by open coding it in the only remaining caller

Signed-off-by: Felix Fietkau <[email protected]>
2019-01-30 12:10:45 +01:00
Felix Fietkau 7a53138b32 mt7603: trigger watchdog reset if flushing CAB queue fails
Signed-off-by: Felix Fietkau <[email protected]>
2019-01-29 16:20:15 +01:00
Felix Fietkau c3da1aa3b0 mt7603: trigger beacon stuck detection faster
Check against number of active beacon interfaces instead of maximum number
of interfaces

Signed-off-by: Felix Fietkau <[email protected]>
2019-01-29 16:18:19 +01:00
Felix Fietkau 0b939dc7ed mt76: fix resetting software IV flag on key delete
It needs to be unset instead of set

Fixes: 23405236460b9 ("mt76: fix transmission of encrypted management frames")
Cc: [email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2019-01-25 18:02:04 +01:00
Felix Fietkau 64abb35d2b mt76: fix corrupted software generated tx CCMP PN
Since ccmp_pn is u8 *, the second half needs to start at array index 4
instead of 0. Fixes a connection stall after a certain amount of traffic

Fixes: 23405236460b9 ("mt76: fix transmission of encrypted management frames")
Cc: [email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2019-01-25 18:01:55 +01:00
Felix Fietkau 7d00d58f74 mt76x02: fix per-chain signal strength reporting
Set the per-chain signal value for chain 0 and simplify the code
(no need for a loop for just one extra chain)

Signed-off-by: Felix Fietkau <[email protected]>
2019-01-25 15:26:13 +01:00
Felix Fietkau b4ee01f95c mt76: fix tx status timeout processing
Remove bogus check for MT_PACKET_ID_NO_ACK in mt76_tx_status_skb_get, which
is already handled in callers and turns timeout calls into no-ops
Do not clean up pending status items on reordering of tx status information
if the timeout is not reached yet

Signed-off-by: Felix Fietkau <[email protected]>
2019-01-25 15:22:41 +01:00
Felix Fietkau aa470d8655 mt7603: fix buffered multicast queue flush
For some reason the BMC queue flush does not work properly if packets were
queued for a BSS0_n interface (secondary vif).
Work around this issue by using the DMA scheduler to filter the queue before
issueing the BMC queue flush.

Signed-off-by: Felix Fietkau <[email protected]>
2019-01-22 15:25:16 +01:00
Felix Fietkau e342cc5c72 mt7603: fix buffered multicast count register
Signed-off-by: Felix Fietkau <[email protected]>
2019-01-22 14:24:43 +01:00
Felix Fietkau ce8cc5d52d mt7603: issue PSE client reset on init
Improves reliability of module reload after tx hangs

Signed-off-by: Felix Fietkau <[email protected]>
2019-01-22 14:09:54 +01:00
Felix Fietkau fe30bd35e2 mt7603: issue PSE reset on tx hang
Signed-off-by: Felix Fietkau <[email protected]>
2019-01-22 14:03:31 +01:00
Lorenzo BianconiandFelix Fietkau 63a79ff71f mt76: do not report out-of-range rx nss
Take into account device rx stream in mt76x02_mac_process_rate
in order to not report wrong number of rx spatial stream to mac80211.
The issue has been reported on mt76x0 device which is 1x1:1 however
the hw sometimes reports rx nss equal to 2

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-01-21 21:48:35 +01:00
Felix Fietkau 2efa389b4c mt7603: limit station power save queue length to 64
Avoid excessive memory use, in case something goes wrong.

Signed-off-by: Felix Fietkau <[email protected]>
2019-01-21 21:02:33 +01:00
Felix Fietkau 1c751f391f mt76: avoid scheduling tx queues for powersave stations
Signed-off-by: Felix Fietkau <[email protected]>
2019-01-21 17:33:38 +01:00
Felix Fietkau 3df341d597 mt7603: avoid redundant MAC timing updates
Signed-off-by: Felix Fietkau <[email protected]>
2019-01-21 15:04:37 +01:00