[PATCH v2 2/3] mt76: mt7921: add mt7921_mcu_sta_update support
Lorenzo Bianconi
lorenzo.bianconi at redhat.com
Wed Jun 2 01:00:45 PDT 2021
> From: Sean Wang <sean.wang at mediatek.com>
>
> Add mt7921_mcu_sta_update support to make we are able to update the station
> record with the current state the station has into the mt7921 firmware at
> runtime. That is the prerequisite patch to fix .sta_state incorrect
> implementation for the mt7921 driver.
>
> Signed-off-by: Sean Wang <sean.wang at mediatek.com>
> ---
> v1->v2: no change
> ---
> .../net/wireless/mediatek/mt76/mt7921/mcu.c | 20 +++++++++++++++++++
> .../wireless/mediatek/mt76/mt7921/mt7921.h | 2 ++
> 2 files changed, 22 insertions(+)
What about squashing this patch with 3/3? it is just used there.
Regards,
Lorenzo
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
> index 631f408520c9..3f53bd9b2b55 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
> @@ -1342,6 +1342,26 @@ int mt7921_mcu_sta_add(struct mt7921_dev *dev, struct ieee80211_sta *sta,
> return mt76_connac_mcu_add_sta_cmd(&dev->mphy, &info);
> }
>
> +int mt7921_mcu_sta_update(struct mt7921_dev *dev, struct ieee80211_sta *sta,
> + struct ieee80211_vif *vif, u8 state)
> +{
> + struct mt7921_vif *mvif = (struct mt7921_vif *)vif->drv_priv;
> + int rssi = -ewma_rssi_read(&mvif->rssi);
> + struct mt76_sta_cmd_info info = {
> + .sta = sta,
> + .vif = vif,
> + .enable = true,
> + .state = state,
> + .cmd = MCU_UNI_CMD_STA_REC_UPDATE,
> + .rcpi = to_rcpi(rssi),
> + };
> + struct mt7921_sta *msta;
> +
> + msta = sta ? (struct mt7921_sta *)sta->drv_priv : NULL;
> + info.wcid = msta ? &msta->wcid : &mvif->sta.wcid;
> + return mt76_connac_mcu_update_sta_cmd(&dev->mphy, &info);
> +}
> +
> int __mt7921_mcu_drv_pmctrl(struct mt7921_dev *dev)
> {
> struct mt76_phy *mphy = &dev->mt76.phy;
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h b/drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h
> index 694f85e52222..13d0f472b043 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h
> +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h
> @@ -262,6 +262,8 @@ int mt7921_mcu_add_key(struct mt7921_dev *dev, struct ieee80211_vif *vif,
> int mt7921_set_channel(struct mt7921_phy *phy);
> int mt7921_mcu_sta_add(struct mt7921_dev *dev, struct ieee80211_sta *sta,
> struct ieee80211_vif *vif, bool enable, u8 state);
> +int mt7921_mcu_sta_update(struct mt7921_dev *dev, struct ieee80211_sta *sta,
> + struct ieee80211_vif *vif, u8 state);
> int mt7921_mcu_set_chan_info(struct mt7921_phy *phy, int cmd);
> int mt7921_mcu_set_tx(struct mt7921_dev *dev, struct ieee80211_vif *vif);
> int mt7921_mcu_set_eeprom(struct mt7921_dev *dev);
> --
> 2.25.1
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-mediatek/attachments/20210602/a0523293/attachment.sig>
More information about the Linux-mediatek
mailing list