1
0
Fork 0
Commit Graph

17 Commits (05a59d79793d482f628a31753c671f2e92178a21)

Author SHA1 Message Date
Arnd Bergmann c490492f15 mt76: mt7915: fix unused 'mode' variable
clang points out a possible corner case in the mt7915_tm_set_tx_cont()
function if called with invalid arguments:

drivers/net/wireless/mediatek/mt76/mt7915/testmode.c:593:2: warning: variable 'mode' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
        default:
        ^~~~~~~
drivers/net/wireless/mediatek/mt76/mt7915/testmode.c:597:13: note: uninitialized use occurs here
        rateval =  mode << 6 | rate_idx;
                   ^~~~
drivers/net/wireless/mediatek/mt76/mt7915/testmode.c:506:37: note: initialize the variable 'mode' to silence this warning
        u8 rate_idx = td->tx_rate_idx, mode;
                                           ^

Change it to return an error instead of continuing with invalid data
here.

Fixes: 3f0caa3cbf ("mt76: mt7915: add support for continuous tx in testmode")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2021-02-26 17:35:15 +02:00
Felix Fietkau c203dd6217 mt76: mt7915: rework mcu API
Add support for passing flags for selecting the MCU target and query type
instead of trying to detect it based on the command id

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-01-26 20:07:50 +01:00
Shayne Chen 06e0bbe1c5 mt76: mt7615: mt7915: disable txpower sku when testmode enabled
When testmode can be enabled, the start() callback would already be
called, causing that txpower sku feature isn't really disabled after
testmode is enabled. This patch fix the issue.

Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-01-26 20:07:49 +01:00
Shayne Chen 3f0caa3cbf mt76: mt7915: add support for continuous tx in testmode
Implement continuous tx state for MT7915 NIC testmode.

Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-01-26 20:07:49 +01:00
Shayne Chen 39e48823e1 mt76: mt7915: rework set state part in testmode
This is a preliminary patch to simplify setting state in mt7915
testmode, for adding the new continuous tx state.

Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-01-26 20:07:49 +01:00
Shayne Chen 8efe387cc7 mt76: mt7915: clean hw queue before starting new testmode tx
Add a testmode mcu command to clean up hw tx queue before a new
testmode tx starts.

Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-01-26 20:07:49 +01:00
Shayne Chen c46df37f72 mt76: mt7915: calculate new packet length when tx_time is set in testmode
If tx_time is set, calculate a new packet length based on tx time and
tx rate.

Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-01-26 20:07:49 +01:00
Shayne Chen c2d3b1926f mt76: mt7915: add support for ipg in testmode
Add support to calculate and apply ipg parameters in testmode
for MT7915 NIC.

Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-01-26 20:07:48 +01:00
Shayne Chen fdc9c18eb4 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 <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-01-26 20:07:48 +01:00
Lorenzo Bianconi b9027e0816 mt76: move chainmask in mt76_phy
Move chainmask from driver phy to mt76_phy since it is used by all
drivers. This is a preliminary patch to create a common mcu library used
by mt7615 and mt7921 drivers

Co-developed-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-01-26 20:07:48 +01:00
Shayne Chen 78fc30a21c mt76: mt7915: move testmode data from dev to phy
Move per-chip testmode data to mt7915_phy, to properly support
reg_backup and rx status of each band in testmode.

Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Acked-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-01-26 20:07:47 +01:00
Shayne Chen c918c74d06 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 <shayne.chen@mediatek.com>
Acked-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-01-26 20:07:47 +01:00
Shayne Chen dae0dc2bd0 mt76: mt7915: add partial add_bss_info command on testmode init
This is a preliminary patch for DBDC and ipg config support
in testmode.

The wmm_idx of band1 should be configured by this command to
make band1 Tx work normally. Also, for setting ipg, FW needs a
non-empty bss_info structure to do edca parameters update.

Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Acked-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-01-26 20:07:47 +01:00
Shayne Chen ed3c9072fa mt76: mt7915: add support to set tx frequency offset in testmode
Support to set tx frequency offset in testmode, which is usally used in
the pre-calibration stage.

Reviewed-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04 14:31:13 +01:00
Shayne Chen e0852d9083 mt76: mt7915: add support to set txpower in testmode
Support tx_power setting in testmode. Note that the tx power value of
antenna 1-3 equal to antenna 0.

Reviewed-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04 14:31:13 +01:00
Shayne Chen 5d8a83f099 mt76: mt7915: implement testmode rx support
Support testmode rx and display rx statistic by parsing RXV packet
type, which is currently only enabled in testmode.

Reviewed-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04 14:31:13 +01:00
Shayne Chen aadf09537c mt76: mt7915: implement testmode tx support
Support testmode tx for MT7915A, including tx streams and HE rate
settings.

Reviewed-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-12-04 14:31:13 +01:00