Commit Graph
26 Commits
Author SHA1 Message Date
Felix Fietkau 93e3fce916 mt76: pass original queue id from __mt76_tx_queue_skb to the driver
MT7615 and newer map multiple software tx queues to the hardware id

Signed-off-by: Felix Fietkau <[email protected]>
2022-07-03 17:52:25 +02:00
Bo JiaoandFelix Fietkau 6ef22f4dc4 mt76: mt7915: add support for MT7986
This adds MT7986 SoC integrated multi-band 4x4 WiFi 6/6E.

Co-developed-by: Peter Chiu <[email protected]>
Signed-off-by: Peter Chiu <[email protected]>
Co-developed-by: Ryder Lee <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Sujuan Chen <[email protected]>
Signed-off-by: Bo Jiao <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2022-02-14 15:08:04 +01:00
Shayne ChenandFelix Fietkau 0c489ea286 mt76: testmode: add support to set MAC
Add support to set SA/DA/BSSID in testmode.
During mass production stage, some test scripts or test equipments need
to set fixed addresses to detect or parse if a test is passed.
Also, MAC setting is necessary for some tx/rx tests with rx filter,
to make sure rx site only receives expected packets.

Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-11-21 20:26:13 +01:00
Lorenzo BianconiandFelix Fietkau 4ccd420295 mt76: mt7921: introduce testmode support
We add the testmode support to access the testmode feature provided
by the MT7921 firmware.

Tested-by: Sean Wang <[email protected]>
Co-developed-by: Sean Wang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-07-14 15:54:43 +02:00
Shayne ChenandFelix Fietkau 5954e3381f mt76: testmode: move chip-specific stats dump before common stats
Move chip-specific stats dumping part before common stats dumping
to provide flexibility for per-chip driver to modify the value of
common stats.

Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-06-10 13:28:33 +02:00
Lorenzo BianconiandFelix Fietkau a976345260 mt76: testmode: remove undefined behaviour in mt76_testmode_alloc_skb
Get rid of an undefined behaviour in mt76_testmode_alloc_skb routine
allocating skb frames

Fixes: 2601dda8faa76 ("mt76: testmode: add support to send larger packet")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-05-28 11:52:34 +02:00
Lorenzo BianconiandFelix Fietkau bdcc57a116 mt76: testmode: remove unnecessary function calls in mt76_testmode_free_skb
Get rid of unnecessary function calls in mt76_testmode_free_skb routine
since they are already managed by dev_kfree_skb

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-05-28 11:52:34 +02:00
Lorenzo BianconiandFelix Fietkau 3945264468 mt76: testmode: fix memory leak in mt76_testmode_alloc_skb
Free all pending frames in case of failure in mt76_testmode_alloc_skb
routine

Fixes: 2601dda8faa76 ("mt76: testmode: add support to send larger packet")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-05-28 11:52:34 +02:00
Shayne ChenandFelix Fietkau a8e89c5a1d mt76: testmode: add support to send larger packet
Add support to send larger packet in testmode to meet requirements
of some test cases.
The limit of max packet size is determined based on tx rate mode setting.

Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-13 10:15:11 +02:00
Shayne ChenandFelix Fietkau 77b18b16fe mt76: testmode: make tx queued limit adjustable
Originally, tx queued limit is set to 1000 to prevent from running out
of tx token. If a new testmode tx is triggered while the previous one
hasn't finished yet, we'll wait a period of time until tx_done equals to
tx_queued. Normally, current queued limit can finish in 10 seconds.

However, if ipg is configured to a larger value, less than 1000 packets
can be done in the default timeout period, which may lead to a crash
when a new testmode tx triggered.

To deal with this, make tx queued limit dynamically adjusted according
to ipg value.

Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-01-14 11:14:59 +01:00
Shayne ChenandFelix Fietkau cc05f46796 mt76: testmode: add attributes for ipg related parameters
Add attributes for setting tx inter-packet gap (ipg), duty cycle, and
transmission time in testmode.

Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-01-14 11:14:59 +01:00
Shayne ChenandFelix Fietkau 3d0834e780 mt76: testmode: add support to set user-defined spe index
Add spatial extension (spe) index as a configurable parameter in testmode.
This is used for specifically configuring TX path, such as different
WF TX priority, number of antennas and spatial streams.

If spe_idx is not set, TX path depends on tx_antenna_mask; otherwise,
both spe_idx and tx_antenna_mask are referenced to decide TX path.

Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-01-14 11:14:59 +01:00
Shayne ChenandFelix Fietkau b44472e998 mt76: testmode: move mtd part to mt76_dev
Move testmode mtd variables to mt76_dev, since they are the same on
each phy.

Signed-off-by: Shayne Chen <[email protected]>
Acked-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-01-04 18:30:34 +01:00
Shayne ChenandFelix Fietkau a897a69769 mt76: testmode: introduce dbdc support
Add testmode support for DBDC NICs (both MT7615D and MT7915D work).
Testmode data and parameters are moved from per-dev to per-phy
for maintaining the value of each band.

Signed-off-by: Shayne Chen <[email protected]>
Acked-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-01-04 18:30:34 +01:00
Lorenzo BianconiandFelix Fietkau 8aa24c91b1 mt76: move hw mac_addr in mt76_phy
This is a preliminary patch to properly support mt7915 dbdc

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-11-13 11:19:13 +01:00
Lorenzo BianconiandFelix Fietkau 2e217fb9e9 mt76: move tx hw data queues in mt76_phy
Move hw data queues in mt76_phy from mt76_dev since mt7915 supports per
phy hw queues in dbdc mode

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-11-12 14:59:29 +01:00
Lorenzo BianconiandFelix Fietkau 0f9350bef1 mt76: rely on mt76_queue in tx_queue_skb signature
Rely on mt76_queue instead of qid in tx_queue_skb signature.
This is a preliminary patch to move data queues in mt76_phy and add
dbdc support to mt7915 driver

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-11-12 14:59:29 +01:00
Shayne ChenandFelix Fietkau 9909c0551e mt76: testmode: add support for HE rate modes
Extend enum mt76_testmode_tx_mode to support various HE rate modes.

Reviewed-by: Ryder Lee <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]> [update tools/]
2020-11-10 13:34:05 +01:00
Shayne ChenandFelix Fietkau 73427ebbbd mt76: testmode: add support for LTF and GI combinations for HE mode
Prepare for setting different LTF (1x, 2x, and 4x) and GI (0.8us,
1.6us, 3.2us) combinations in HE rate mode.

Reviewed-by: Ryder Lee <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]> [update tools/]
2020-11-10 13:30:22 +01:00
Shayne ChenandFelix Fietkau 3ea9a0433b mt76: testmode: add tx_rate_stbc parameter
Add the parameter to control STBC function in testmode.

Reviewed-by: Ryder Lee <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]> [update tools/]
2020-11-10 13:27:19 +01:00
Felix Fietkau e2b8a4ec98 mt76: testmode: add a limit for queued tx_frames packets
This avoids running out of available tx tokens

Signed-off-by: Felix Fietkau <[email protected]>
2020-09-08 19:12:53 +02:00
Felix Fietkau 3218b914a2 mt76: remove struct mt76_sw_queue
All members except for the struct mt76_queue pointer have been removed

Signed-off-by: Felix Fietkau <[email protected]>
2020-08-24 20:59:30 +02:00
Lorenzo BianconiandFelix Fietkau 8c7c1a207d mt76: fix a possible NULL pointer dereference in mt76_testmode_dump
Fix a possible NULL pointer dereference in mt76_testmode_dump() since
nla_nest_start returns NULL in case of error

Fixes: f0efa8621550e ("mt76: add API for testmode support")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-08-22 21:19:24 +02:00
Felix Fietkau 2f1318a06d mt76: convert from tx tasklet to tx worker thread
This should improve performance by allowing the scheduler to move the tx
scheduling work to idle CPUs

Signed-off-by: Felix Fietkau <[email protected]>
2020-08-22 15:56:57 +02:00
Felix Fietkau 750797b61b mt76: fix copy&paste error in mt76_testmode_cmd
Signed-off-by: Felix Fietkau <[email protected]>
2020-07-13 09:17:24 +02:00
Felix Fietkau 3a1ea7287e mt76: add API for testmode support
This can be used for calibration in the manufacturing process.
It supports sending a configurable number of packets with a specific rate
and configurable tx power levels / antenna settings.
It also supports receiving packets and showing some statistics, including
packet counters and detailed RSSI information.
It will only be compiled in if CONFIG_NL80211_TESTMODE is enabled

Signed-off-by: Felix Fietkau <[email protected]>
2020-06-22 21:31:02 +02:00