Felix Fietkau
5fb60a7d7a
mt7603: fix aggregation size handling
...
Do not step over the 32 subframe limit.
Fix staying under the limit
Signed-off-by: Felix Fietkau <[email protected] >
2018-11-21 19:04:19 +01:00
Felix Fietkau
da666a74a6
mt7603: issue PSE reset if firmware debug register indicates stuck queues
...
Signed-off-by: Felix Fietkau <[email protected] >
2018-11-21 15:10:31 +01:00
Felix Fietkau
b38fe7d531
mt7603: only issue PSE reset on PSE stuck
...
The reset can take quite a bit of time, so only issue it when necessary
Signed-off-by: Felix Fietkau <[email protected] >
2018-11-21 15:04:47 +01:00
Felix Fietkau
94cebfc31a
mt7603: fix handling lost interrupt events during watchdog reset
...
Schedule tx tasklet and rx napi poll after reset to ensure that processing
of DMA queues resumes
Signed-off-by: Felix Fietkau <[email protected] >
2018-11-21 15:00:15 +01:00
Felix Fietkau
a301decead
mt7603: add back PSE client reset code
...
Should help with MT7628 reliability
Signed-off-by: Felix Fietkau <[email protected] >
2018-11-21 13:52:04 +01:00
Felix Fietkau
b3f82a33c0
mt7603: report PSE reset failures via debugfs
...
Signed-off-by: Felix Fietkau <[email protected] >
2018-11-21 13:18:28 +01:00
Felix Fietkau
9428e34d1f
mt7603: fix watchdog reset sequence
...
- issue PSE reset first
- skip DMA reset if PSE reset failed
- schedule tx after reset has completed
Signed-off-by: Felix Fietkau <[email protected] >
2018-11-21 13:08:16 +01:00
Felix Fietkau
4734108318
mt7603: use mt7603_wtbl_clear on station removal
...
It removes more stale data from the WTBL
Signed-off-by: Felix Fietkau <[email protected] >
2018-11-21 12:59:13 +01:00
Felix Fietkau
c09e8a489f
mt7603: fix buffering of tx packets for powersave clients
...
Use PSE registers to loop back any pending tx packets for a client that
just went to sleep back into the MCU rx queue.
Re-queue those packets to the tx queue immediately after a client wakes up.
Signed-off-by: Felix Fietkau <[email protected] >
2018-11-20 16:18:22 +01:00
Felix Fietkau
82363abeaf
mt7603: move tx status to rx queue 0
...
This makes it easier to loop powersave-filtered packets through the MCU queue
without involving the firmware
Signed-off-by: Felix Fietkau <[email protected] >
2018-11-20 16:18:22 +01:00
Felix Fietkau
b44d793e25
mt7603: clear PSE redirections before MCU init
...
Ensure that stale data from a previous run is cleaned up
Signed-off-by: Felix Fietkau <[email protected] >
2018-11-20 16:18:01 +01:00
Felix Fietkau
ca2c875ae6
mt7603: add support for accessing remapped registers via ops
...
Add wrappers for existing register ops
Signed-off-by: Felix Fietkau <[email protected] >
2018-11-20 12:15:32 +01:00
Felix Fietkau
7c4c33c41e
mt7603: skip efuse tx power data for mt7628
...
Sync with vendor driver behavior
Signed-off-by: Felix Fietkau <[email protected] >
2018-11-20 12:15:32 +01:00
Felix Fietkau
84aa12a4e1
mt76: fix potential null pointer deref in mt76_sta_add
...
Signed-off-by: Felix Fietkau <[email protected] >
2018-11-17 18:22:33 +01:00
Lorenzo Bianconi and Felix Fietkau
fa7335bbe3
mt76: fix potential NULL pointer dereference in mt76_stop_tx_queues
...
Starting from mac80211 commit adf8ed01e4fd ("mac80211: add an optional
TXQ for other PS-buffered frames") and commit 0eeb2b674f05 ("mac80211:
add an option for station management TXQ") a new per-sta queue has been
introduced for bufferable management frames.
sta->txq[IEEE80211_NUM_TIDS] is initialized just if the driver reports
the following hw flags:
- IEEE80211_HW_STA_MMPDU_TXQ
- IEEE80211_HW_BUFF_MMPDU_TXQ
This can produce a NULL pointer dereference in mt76_stop_tx_queues
since mt76 iterates on all available sta tx queues assuming they are
initialized by mac80211. This issue has been spotted analyzing the code
(it has not triggered any crash yet)
Signed-off-by: Lorenzo Bianconi <[email protected] >
2018-11-17 18:15:00 +01:00
Felix Fietkau
42c5281187
mt7603: fix maximum frame size in scheduler init
...
Since hardware A-MSDU decap is disabled, use maximum A-MSDU size
as maximum packet size
Signed-off-by: Felix Fietkau <[email protected] >
2018-11-17 17:56:07 +01:00
Felix Fietkau
d22799b2c3
mt7603: reduce reserved pages for beacons
...
Only 4 interfaces are supported anyway
Signed-off-by: Felix Fietkau <[email protected] >
2018-11-17 17:56:07 +01:00
Felix Fietkau
749d5c3d2c
mt7603: fix reserved page handling for mt7628
...
Signed-off-by: Felix Fietkau <[email protected] >
2018-11-17 17:56:07 +01:00
Felix Fietkau
3873e827ed
mt7603: fix MT_BMAP_0/MT_GROUP_THD_0 register initializion for mt7628
...
Signed-off-by: Felix Fietkau <[email protected] >
2018-11-17 17:34:19 +01:00
Felix Fietkau
471d397e06
mt7603: fix priority for buffered multicast packets
...
Ensure that they are transmitted immediately after the beacon
Signed-off-by: Felix Fietkau <[email protected] >
2018-11-17 15:41:32 +01:00
Lorenzo Bianconi and Felix Fietkau
96b3b3d60d
mt76x2u: main: fix typo setting sta_state mac80211 callback
...
Signed-off-by: Lorenzo Bianconi <[email protected] >
2018-11-16 13:33:14 +01:00
Felix Fietkau
d0fdf01a95
mt7603: avoid unnecessary wtbl writes for ps-filter
...
Only clear the skip_tx flag if powersave mode is enabled
Signed-off-by: Felix Fietkau <[email protected] >
2018-11-16 12:41:17 +01:00
Felix Fietkau
41931e43ab
mt7603: toggle skip_tx on station add/remove
...
Signed-off-by: Felix Fietkau <[email protected] >
2018-11-16 12:33:17 +01:00
Felix Fietkau
90e2c1b616
mt7603: add mt7603_wtbl_set_skip_tx, change mt7603_wtbl_set_ps users
...
Avoids unnecessary toggling of the MT_WTBL1_OR_PSM_WRITE flag
Signed-off-by: Felix Fietkau <[email protected] >
2018-11-16 12:28:30 +01:00
Felix Fietkau
13f1e82f6f
mt7603: clear wtbl entry for removed stations
...
Should fix some issues with reassociating stations
Signed-off-by: Felix Fietkau <[email protected] >
2018-11-16 12:09:52 +01:00
Felix Fietkau
a97127b1b3
mt76: replace sta_add/remove ops with common sta_state function
...
Allows adding unassociated stations from mac80211
Signed-off-by: Felix Fietkau <[email protected] >
2018-11-16 12:09:52 +01:00
Felix Fietkau
7b1373e7e2
mt76: mt76x02: remove mt76x02_txq_init
...
Open-coding it simplifies the code
Signed-off-by: Felix Fietkau <[email protected] >
2018-11-16 12:09:52 +01:00
Felix Fietkau
e65ad4c5db
mt7603: make group_wcid the first member in struct mt7603_vif
...
Allows mt76 core to cast vif->drv_priv to struct mt76_wcid
Signed-off-by: Felix Fietkau <[email protected] >
2018-11-16 12:09:52 +01:00
Felix Fietkau
d7788cc661
mt76: mt76x02: make group_wcid the first member in struct mt76x02_vif
...
Allows mt76 core to cast vif->drv_priv to struct mt76_wcid
Signed-off-by: Felix Fietkau <[email protected] >
2018-11-16 12:09:52 +01:00
Felix Fietkau
963768d38f
mt76x02: fix regression in tx station race condition fix
...
Signed-off-by: Felix Fietkau <[email protected] >
2018-11-16 12:09:52 +01:00
Felix Fietkau
009ab9179e
mt76: clean up more unused EXPORT_SYMBOLs
...
Make functions static where possible
Signed-off-by: Felix Fietkau <[email protected] >
2018-11-16 12:09:52 +01:00
Stanislaw Gruszka and Felix Fietkau
88f68838d9
mt76: remove wait argument from mt76x02_mcu_calibrate
...
We always wait for CMD_CALIBRATION_OP mcu message, but wait argument is used
for do additional MT_MCU_COM_REG0 register operations, which are needed
for mt76x2e devices and we can use appropriate check instead of wait argument.
Signed-off-by: Stanislaw Gruszka <[email protected] >
2018-11-13 20:56:41 +01:00
Lorenzo Bianconi and Felix Fietkau
3fc95d7464
mt76x2u: init: remove mt76x2u_init_beacon_offsets routine
...
Remove mt76x2u_init_beacon_offsets routine since the driver supports
just STA mode
Signed-off-by: Lorenzo Bianconi <[email protected] >
2018-11-13 20:56:41 +01:00
Lorenzo Bianconi and Felix Fietkau
9fe0fe8594
mt76x2u: main: use mt76x02_bss_info_changed utility routine
...
Initialize bss_info_changed mac80211 callback to
mt76x02_bss_info_changed utility routine and remove duplicated code.
Use 8 as WCID index for sta interface
Signed-off-by: Lorenzo Bianconi <[email protected] >
2018-11-13 20:56:41 +01:00
Lorenzo Bianconi and Felix Fietkau
c1d67b47d4
mt76x2u: phy: run phy_channel_calibrate after channel switch
...
Perform channel calibration after each channel switch and not only after
connection establishment since NetworkManager perform multiple frequency
scanning if RSSI in lower a given threshold
Signed-off-by: Lorenzo Bianconi <[email protected] >
2018-11-13 20:56:41 +01:00
Lorenzo Bianconi and Felix Fietkau
f75efd81f8
mt76x2u: phy: add TX_SHAPING calibration
...
Add MCU_CAL_TX_SHAPING calibration in mt76x2u_phy_channel_calibrate
routine since now mt76x2 and mt76x2u driver run the same firmware
Signed-off-by: Lorenzo Bianconi <[email protected] >
2018-11-13 20:56:41 +01:00
Lorenzo Bianconi and Felix Fietkau
4248446224
mt76x0: pci: enable VHT rates in IBSS mode
...
Enable VHT tx rates in ad-hoc mode for mt76x0e driver.
Signed-off-by: Lorenzo Bianconi <[email protected] >
2018-11-13 20:56:41 +01:00
Lorenzo Bianconi and Felix Fietkau
0bfa98eb08
mt76: introduce mt76x02_config_mac_addr_list routine
...
Add mt76x02_config_mac_addr_list routine in order to set
the mac address list supported by the driver. Initialize
wiphy->addresses/n_addresses for mt76x0e driver
Signed-off-by: Lorenzo Bianconi <[email protected] >
2018-11-13 20:56:41 +01:00
Lorenzo Bianconi and Felix Fietkau
df5c797b21
mt76: fix uninitialized mutex access setting rts threshold
...
Fix following crash due to a leftover uninitialized mutex access
in mt76x2_set_rts_threshold routine.
[ 31.018059] Call Trace:
[ 31.018341] register_lock_class+0x51f/0x530
[ 31.018828] __lock_acquire+0x6c/0x1580
[ 31.019247] lock_acquire+0x88/0x120
[ 31.021089] __mutex_lock+0x4a/0x4f0
[ 31.023343] mt76x2_set_rts_threshold+0x28/0x50
[ 31.023831] ieee80211_set_wiphy_params+0x16d/0x4e0
[ 31.024344] nl80211_set_wiphy+0x72b/0xbc0
[ 31.024781] genl_family_rcv_msg+0x192/0x3a0
[ 31.025233] genl_rcv_msg+0x42/0x89
[ 31.026079] netlink_rcv_skb+0x38/0x100
[ 31.026475] genl_rcv+0x1f/0x30
[ 31.026804] netlink_unicast+0x19c/0x250
[ 31.027212] netlink_sendmsg+0x1ed/0x390
[ 31.027615] sock_sendmsg+0x31/0x40
[ 31.027973] ___sys_sendmsg+0x23c/0x280
[ 31.030414] __sys_sendmsg+0x42/0x80
[ 31.030783] do_syscall_64+0x4a/0x170
[ 31.031160] entry_SYSCALL_64_after_hwframe+0x49/0xbe
[ 31.031677] RIP: 0033:0x7f3498b39ba7
[ 31.033953] RSP: 002b:00007fffe19675b8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
[ 31.034883] RAX: ffffffffffffffda RBX: 00000000012d5350 RCX: 00007f3498b39ba7
[ 31.035756] RDX: 0000000000000000 RSI: 00007fffe19675f0 RDI: 0000000000000003
[ 31.036587] RBP: 00000000012da740 R08: 0000000000000002 R09: 0000000000000000
[ 31.037422] R10: 0000000000000006 R11: 0000000000000246 R12: 00000000012da880
[ 31.038252] R13: 00007fffe19675f0 R14: 00007fffe19678c0 R15: 00000000012da880
Fixes: 108a4861ef19 ("mt76: create new mt76x02-lib module for common
mt76x{0,2} code")
Reported-by: [email protected]
Reported-by: [email protected]
Signed-off-by: Lorenzo Bianconi <[email protected] >
2018-11-13 20:56:18 +01:00
Felix Fietkau
83a80cabbd
mt76: request tx status for powersave released EOSP packet
...
Allows mac80211 to keep track of the service period
Signed-off-by: Felix Fietkau <[email protected] >
2018-11-13 20:54:19 +01:00
Felix Fietkau
0848d2db97
mt7603: simplify mt7603_mcu_msg_send, remove skb_ret handling
...
Signed-off-by: Felix Fietkau <[email protected] >
2018-11-13 14:53:45 +01:00
Felix Fietkau
fd85ff9a97
mt7603: use mt76_sta_remove helper
...
Signed-off-by: Felix Fietkau <[email protected] >
2018-11-13 11:53:22 +01:00
Felix Fietkau
75aa36e0a3
mt7603: use wcid/wcid_mask from struct mt76_dev
...
Signed-off-by: Felix Fietkau <[email protected] >
2018-11-13 11:51:49 +01:00
Felix Fietkau
7e5c819a45
mt76: add mt76_sta_remove helper
...
This allows station removal code to be used by mt7603 later
Signed-off-by: Felix Fietkau <[email protected] >
2018-11-13 11:33:48 +01:00
Felix Fietkau
67458301fd
mt76: fix race condition in station removal
...
If there are still pending packets in the tx queue when removing a station,
it could possibly lead to a call to further attempts to pull packets from
the mac80211 tx queue after it has already been removed from the scheduling
list.
Prevent this from happening by calling synchronize_rcu after deleting the
wcid pointer before further cleaning up the tx queues.
To be extra careful, ensure that mtxq->list is always initialized properly.
Also drop the useless call to mt76x02_mac_wcid_setup, which only re-assigns
the bss index of the wcid entry, but does not help with the cleanup in any
way.
Signed-off-by: Felix Fietkau <[email protected] >
2018-11-13 11:30:00 +01:00
Felix Fietkau
ffccb48c50
mt76: do not wake tx queues during flush
...
While the queue is being cleaned up, the stack must not attempt to add
any extra packets
Signed-off-by: Felix Fietkau <[email protected] >
2018-11-09 13:44:02 +01:00
Felix Fietkau
29d95328d6
mt7603: fix faulty variable initialization in last commit
...
Should be harmless, since watchdog reset is only performed when necessary
Signed-off-by: Felix Fietkau <[email protected] >
2018-11-08 09:07:11 +01:00
Felix Fietkau
417cf49ce8
mt7603: improve recovery from MCU hang
...
Fix forcing watchdog reset after a MCU hang
Run watchdog work immediately after a failed channel change
Signed-off-by: Felix Fietkau <[email protected] >
2018-11-07 18:46:47 +01:00
Felix Fietkau
5ee05239fa
mt7603: fix tx status rate reporting for fixed-rate packets
...
Add support for parsing legacy rates, use a flag in the tx status info
as indicator for fixed rate packets
Signed-off-by: Felix Fietkau <[email protected] >
2018-11-06 22:19:20 +01:00
Felix Fietkau
a1afefdbf0
mt7603: fix handling of fixed rate packets
...
The FIXED_RATE flag of txd6 does not enable fixed rate, it only configures
the use of the fixed rate register as rate source.
Set the right flag in txd2 instead.
Signed-off-by: Felix Fietkau <[email protected] >
2018-11-06 17:42:10 +01:00