On 2020-10-12 14:54, Shayne Chen wrote: > 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@xxxxxxxxxxxx> > Signed-off-by: Shayne Chen <shayne.chen@xxxxxxxxxxxx> > --- > v2: change last_snr to u8 > v3: use nla_put_u8 for MT76_TM_RX_ATTR_SNR > change snr variable type to u8 in mt7915_mac_fill_rx_vector > > diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/testmode.c b/drivers/net/wireless/mediatek/mt76/mt7915/testmode.c > index 5d95766..acab268 100644 > --- a/drivers/net/wireless/mediatek/mt76/mt7915/testmode.c > +++ b/drivers/net/wireless/mediatek/mt76/mt7915/testmode.c > @@ -113,6 +113,31 @@ mt7915_tm_reg_backup_restore(struct mt7915_dev *dev, struct mt7915_phy *phy) > mt76_clear(dev, MT_TMAC_TCR0(0), MT_TMAC_TCR0_TBTT_STOP_CTRL); > } > > +static int > +mt7915_tm_config_rx_filter(struct mt7915_dev *dev, bool en) > +{ > + struct mt7915_tm_cmd req = { > + .testmode_en = 1, > + .param_idx = MCU_ATE_SET_RX_FILTER, > + .param.filter.report_en = en, > + .param.filter.band = 0, /* TODO: support dbdc */ > + }; > + __le32 mask = RX_FILTER_NOT_OWN_BTIM | > + RX_FILTER_NOT_OWN_UCAST | > + RX_FILTER_RTS | RX_FILTER_CTS | > + RX_FILTER_CTRL_RSV | > + RX_FILTER_BC_MC_BSSID_A2 | > + RX_FILTER_BC_MC_BSSID_A3 | > + RX_FILTER_BC_MC_OMAC_A3 | > + RX_FILTER_PROTOCOL_VERSION | > + RX_FILTER_FCS_ERR; > + > + req.param.filter.mask = cpu_to_le32(mask); > + > + return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD_ATE_CTRL, &req, > + sizeof(req), false); Why do we need this? In order to use testmode you have to set up a monitor mode interface, which should configure the rx filter settings properly already. - Felix