From: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
To: Ryder Lee <ryder.lee@mediatek.com>
Cc: linux-mediatek@lists.infradead.org,
Shayne Chen <shayne.chen@mediatek.com>,
linux-wireless@vger.kernel.org, Felix Fietkau <nbd@nbd.name>
Subject: Re: [PATCH 1/2] mt76: mt7915: simplify peer's TxBF capability check
Date: Wed, 13 Jan 2021 14:08:10 +0100 [thread overview]
Message-ID: <20210113130810.GA5528@lore-desk> (raw)
In-Reply-To: <287bbdb0193bd74069219b97199ba4ec72127bd8.1610539467.git.ryder.lee@mediatek.com>
[-- Attachment #1.1: Type: text/plain, Size: 4227 bytes --]
> This is a preliminary patch for implicit beamforming support.
>
Hi Ryber,
just few nitpicks inline.
Regards,
Lorenzo
> Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
> ---
> .../net/wireless/mediatek/mt76/mt7915/mcu.c | 50 +++++++------------
> 1 file changed, 17 insertions(+), 33 deletions(-)
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
> index 0baef70fc522..f38bc421ea8e 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
> @@ -66,9 +66,6 @@ struct mt7915_fw_region {
>
> #define MCU_PATCH_ADDRESS 0x200000
>
> -#define MT_STA_BFER BIT(0)
> -#define MT_STA_BFEE BIT(1)
> -
> #define FW_FEATURE_SET_ENCRYPT BIT(0)
> #define FW_FEATURE_SET_KEY_IDX GENMASK(2, 1)
> #define FW_FEATURE_OVERRIDE_ADDR BIT(5)
> @@ -1948,16 +1945,23 @@ mt7915_mcu_sta_bfee_tlv(struct sk_buff *skb, struct ieee80211_sta *sta,
> bfee->fb_identity_matrix = true;
> }
>
> -static u8
> -mt7915_mcu_sta_txbf_type(struct mt7915_phy *phy, struct ieee80211_vif *vif,
> - struct ieee80211_sta *sta)
> +static int
> +mt7915_mcu_add_txbf(struct mt7915_dev *dev, struct ieee80211_vif *vif,
> + struct ieee80211_sta *sta, bool enable)
> {
> - u8 type = 0;
> + struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv;
> + struct mt7915_sta *msta = (struct mt7915_sta *)sta->drv_priv;
> + struct mt7915_phy *phy;
> + struct sk_buff *skb;
> + int r, len;
> + bool ebfee = 0, ebf = 0;
>
> if (vif->type != NL80211_IFTYPE_STATION &&
> vif->type != NL80211_IFTYPE_AP)
> return 0;
>
> + phy = mvif->band_idx ? mt7915_ext_phy(dev) : &dev->phy;
> +
> if (sta->he_cap.has_he) {
> struct ieee80211_he_cap_elem *pe;
> const struct ieee80211_he_cap_elem *ve;
> @@ -1970,12 +1974,12 @@ mt7915_mcu_sta_txbf_type(struct mt7915_phy *phy, struct ieee80211_vif *vif,
> if ((HE_PHY(CAP3_SU_BEAMFORMER, pe->phy_cap_info[3]) ||
> HE_PHY(CAP4_MU_BEAMFORMER, pe->phy_cap_info[4])) &&
> HE_PHY(CAP4_SU_BEAMFORMEE, ve->phy_cap_info[4]))
> - type |= MT_STA_BFEE;
> + ebfee = true;
>
> if ((HE_PHY(CAP3_SU_BEAMFORMER, ve->phy_cap_info[3]) ||
> HE_PHY(CAP4_MU_BEAMFORMER, ve->phy_cap_info[4])) &&
> HE_PHY(CAP4_SU_BEAMFORMEE, pe->phy_cap_info[4]))
> - type |= MT_STA_BFER;
> + ebf = true;
> } else if (sta->vht_cap.vht_supported) {
> struct ieee80211_sta_vht_cap *pc;
> struct ieee80211_sta_vht_cap *vc;
> @@ -1989,36 +1993,16 @@ mt7915_mcu_sta_txbf_type(struct mt7915_phy *phy, struct ieee80211_vif *vif,
> IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE;
>
> if ((pc->cap & cr) && (vc->cap & ce))
> - type |= MT_STA_BFEE;
> + ebfee = true;
what about:
ebfee = !!((pc->cap & cr) && (vc->cap & ce))
>
> if ((vc->cap & cr) && (pc->cap & ce))
> - type |= MT_STA_BFER;
> - } else if (sta->ht_cap.ht_supported) {
> - /* TODO: iBF */
> + ebf = true;
ebfee = !!((vc->cap & cr) && (pc->cap & ce))
> }
>
> - return type;
> -}
> -
> -static int
> -mt7915_mcu_add_txbf(struct mt7915_dev *dev, struct ieee80211_vif *vif,
> - struct ieee80211_sta *sta, bool enable)
> -{
> - struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv;
> - struct mt7915_sta *msta = (struct mt7915_sta *)sta->drv_priv;
> - struct mt7915_phy *phy;
> - struct sk_buff *skb;
> - int r, len;
> - u8 type;
> -
> - phy = mvif->band_idx ? mt7915_ext_phy(dev) : &dev->phy;
> -
> - type = mt7915_mcu_sta_txbf_type(phy, vif, sta);
> -
> /* must keep each tag independent */
>
> /* starec bf */
> - if (type & MT_STA_BFER) {
> + if (ebf) {
> len = sizeof(struct sta_req_hdr) + sizeof(struct sta_rec_bf);
>
> skb = mt7915_mcu_alloc_sta_req(dev, mvif, msta, len);
> @@ -2034,7 +2018,7 @@ mt7915_mcu_add_txbf(struct mt7915_dev *dev, struct ieee80211_vif *vif,
> }
>
> /* starec bfee */
> - if (type & MT_STA_BFEE) {
> + if (ebfee) {
> len = sizeof(struct sta_req_hdr) + sizeof(struct sta_rec_bfee);
>
> skb = mt7915_mcu_alloc_sta_req(dev, mvif, msta, len);
> --
> 2.18.0
>
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
[-- Attachment #2: Type: text/plain, Size: 170 bytes --]
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
WARNING: multiple messages have this Message-ID (diff)
From: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
To: Ryder Lee <ryder.lee@mediatek.com>
Cc: Felix Fietkau <nbd@nbd.name>,
Shayne Chen <shayne.chen@mediatek.com>,
linux-wireless@vger.kernel.org,
linux-mediatek@lists.infradead.org
Subject: Re: [PATCH 1/2] mt76: mt7915: simplify peer's TxBF capability check
Date: Wed, 13 Jan 2021 14:08:10 +0100 [thread overview]
Message-ID: <20210113130810.GA5528@lore-desk> (raw)
In-Reply-To: <287bbdb0193bd74069219b97199ba4ec72127bd8.1610539467.git.ryder.lee@mediatek.com>
[-- Attachment #1: Type: text/plain, Size: 4227 bytes --]
> This is a preliminary patch for implicit beamforming support.
>
Hi Ryber,
just few nitpicks inline.
Regards,
Lorenzo
> Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
> ---
> .../net/wireless/mediatek/mt76/mt7915/mcu.c | 50 +++++++------------
> 1 file changed, 17 insertions(+), 33 deletions(-)
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
> index 0baef70fc522..f38bc421ea8e 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
> @@ -66,9 +66,6 @@ struct mt7915_fw_region {
>
> #define MCU_PATCH_ADDRESS 0x200000
>
> -#define MT_STA_BFER BIT(0)
> -#define MT_STA_BFEE BIT(1)
> -
> #define FW_FEATURE_SET_ENCRYPT BIT(0)
> #define FW_FEATURE_SET_KEY_IDX GENMASK(2, 1)
> #define FW_FEATURE_OVERRIDE_ADDR BIT(5)
> @@ -1948,16 +1945,23 @@ mt7915_mcu_sta_bfee_tlv(struct sk_buff *skb, struct ieee80211_sta *sta,
> bfee->fb_identity_matrix = true;
> }
>
> -static u8
> -mt7915_mcu_sta_txbf_type(struct mt7915_phy *phy, struct ieee80211_vif *vif,
> - struct ieee80211_sta *sta)
> +static int
> +mt7915_mcu_add_txbf(struct mt7915_dev *dev, struct ieee80211_vif *vif,
> + struct ieee80211_sta *sta, bool enable)
> {
> - u8 type = 0;
> + struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv;
> + struct mt7915_sta *msta = (struct mt7915_sta *)sta->drv_priv;
> + struct mt7915_phy *phy;
> + struct sk_buff *skb;
> + int r, len;
> + bool ebfee = 0, ebf = 0;
>
> if (vif->type != NL80211_IFTYPE_STATION &&
> vif->type != NL80211_IFTYPE_AP)
> return 0;
>
> + phy = mvif->band_idx ? mt7915_ext_phy(dev) : &dev->phy;
> +
> if (sta->he_cap.has_he) {
> struct ieee80211_he_cap_elem *pe;
> const struct ieee80211_he_cap_elem *ve;
> @@ -1970,12 +1974,12 @@ mt7915_mcu_sta_txbf_type(struct mt7915_phy *phy, struct ieee80211_vif *vif,
> if ((HE_PHY(CAP3_SU_BEAMFORMER, pe->phy_cap_info[3]) ||
> HE_PHY(CAP4_MU_BEAMFORMER, pe->phy_cap_info[4])) &&
> HE_PHY(CAP4_SU_BEAMFORMEE, ve->phy_cap_info[4]))
> - type |= MT_STA_BFEE;
> + ebfee = true;
>
> if ((HE_PHY(CAP3_SU_BEAMFORMER, ve->phy_cap_info[3]) ||
> HE_PHY(CAP4_MU_BEAMFORMER, ve->phy_cap_info[4])) &&
> HE_PHY(CAP4_SU_BEAMFORMEE, pe->phy_cap_info[4]))
> - type |= MT_STA_BFER;
> + ebf = true;
> } else if (sta->vht_cap.vht_supported) {
> struct ieee80211_sta_vht_cap *pc;
> struct ieee80211_sta_vht_cap *vc;
> @@ -1989,36 +1993,16 @@ mt7915_mcu_sta_txbf_type(struct mt7915_phy *phy, struct ieee80211_vif *vif,
> IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE;
>
> if ((pc->cap & cr) && (vc->cap & ce))
> - type |= MT_STA_BFEE;
> + ebfee = true;
what about:
ebfee = !!((pc->cap & cr) && (vc->cap & ce))
>
> if ((vc->cap & cr) && (pc->cap & ce))
> - type |= MT_STA_BFER;
> - } else if (sta->ht_cap.ht_supported) {
> - /* TODO: iBF */
> + ebf = true;
ebfee = !!((vc->cap & cr) && (pc->cap & ce))
> }
>
> - return type;
> -}
> -
> -static int
> -mt7915_mcu_add_txbf(struct mt7915_dev *dev, struct ieee80211_vif *vif,
> - struct ieee80211_sta *sta, bool enable)
> -{
> - struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv;
> - struct mt7915_sta *msta = (struct mt7915_sta *)sta->drv_priv;
> - struct mt7915_phy *phy;
> - struct sk_buff *skb;
> - int r, len;
> - u8 type;
> -
> - phy = mvif->band_idx ? mt7915_ext_phy(dev) : &dev->phy;
> -
> - type = mt7915_mcu_sta_txbf_type(phy, vif, sta);
> -
> /* must keep each tag independent */
>
> /* starec bf */
> - if (type & MT_STA_BFER) {
> + if (ebf) {
> len = sizeof(struct sta_req_hdr) + sizeof(struct sta_rec_bf);
>
> skb = mt7915_mcu_alloc_sta_req(dev, mvif, msta, len);
> @@ -2034,7 +2018,7 @@ mt7915_mcu_add_txbf(struct mt7915_dev *dev, struct ieee80211_vif *vif,
> }
>
> /* starec bfee */
> - if (type & MT_STA_BFEE) {
> + if (ebfee) {
> len = sizeof(struct sta_req_hdr) + sizeof(struct sta_rec_bfee);
>
> skb = mt7915_mcu_alloc_sta_req(dev, mvif, msta, len);
> --
> 2.18.0
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2021-01-13 13:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-13 12:09 [PATCH 1/2] mt76: mt7915: simplify peer's TxBF capability check Ryder Lee
2021-01-13 12:09 ` Ryder Lee
2021-01-13 12:09 ` [PATCH 2/2] mt76: mt7915: add implicit Tx beamforming support Ryder Lee
2021-01-13 12:09 ` Ryder Lee
2021-01-13 13:10 ` Lorenzo Bianconi
2021-01-13 13:10 ` Lorenzo Bianconi
2021-01-13 13:08 ` Lorenzo Bianconi [this message]
2021-01-13 13:08 ` [PATCH 1/2] mt76: mt7915: simplify peer's TxBF capability check Lorenzo Bianconi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210113130810.GA5528@lore-desk \
--to=lorenzo.bianconi@redhat.com \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=nbd@nbd.name \
--cc=ryder.lee@mediatek.com \
--cc=shayne.chen@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.