From: <Ajay.Kathat@microchip.com>
To: <johannes@sipsolutions.net>, <linux-wireless@vger.kernel.org>
Cc: <devel@driverdev.osuosl.org>, <geomatsi@gmail.com>,
<johannes.berg@intel.com>
Subject: Re: [PATCH 2/2] staging: wilc1000: adjust for management frame register API changes
Date: Tue, 28 Apr 2020 10:03:53 +0000 [thread overview]
Message-ID: <2d14898e-57a2-142d-7bca-d32a3d135db2@microchip.com> (raw)
In-Reply-To: <20200428101400.bac7e94c2bf8.I6a2287b9f68f35aff5f6de409c5ffa388de760e2@changeid>
On 28/04/20 1:44 pm, Johannes Berg wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
> From: Johannes Berg <johannes.berg@intel.com>
>
> Adjust to the API changes in cfg80211 for management frame registration.
>
> Fixes: 6cd536fe62ef ("cfg80211: change internal management frame registration API")
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Acked-by: Ajay Singh <ajay.kathat@microchip.com>
This patch looks better to handle cfg80211 callback changes for frame
registration compared to [1].
[1].
https://lore.kernel.org/linux-wireless/20200424212454.230080-1-geomatsi@gmail.com/
> ---
> drivers/staging/wilc1000/cfg80211.c | 36 ++++++++++++++---------------
> drivers/staging/wilc1000/cfg80211.h | 5 ++--
> drivers/staging/wilc1000/netdev.c | 21 ++++++++---------
> drivers/staging/wilc1000/netdev.h | 9 +-------
> 4 files changed, 30 insertions(+), 41 deletions(-)
>
> diff --git a/drivers/staging/wilc1000/cfg80211.c b/drivers/staging/wilc1000/cfg80211.c
> index 4bdcbc5fd2fd..b6065a0d660f 100644
> --- a/drivers/staging/wilc1000/cfg80211.c
> +++ b/drivers/staging/wilc1000/cfg80211.c
> @@ -1217,33 +1217,31 @@ static int mgmt_tx_cancel_wait(struct wiphy *wiphy,
> return 0;
> }
>
> -void wilc_mgmt_frame_register(struct wiphy *wiphy, struct wireless_dev *wdev,
> - u16 frame_type, bool reg)
> +void wilc_update_mgmt_frame_registrations(struct wiphy *wiphy,
> + struct wireless_dev *wdev,
> + struct mgmt_frame_regs *upd)
> {
> struct wilc *wl = wiphy_priv(wiphy);
> struct wilc_vif *vif = netdev_priv(wdev->netdev);
> + u32 presp_bit = BIT(IEEE80211_STYPE_PROBE_REQ >> 4);
> + u32 action_bit = BIT(IEEE80211_STYPE_ACTION >> 4);
>
> - if (!frame_type)
> - return;
> + if (wl->initialized) {
> + bool prev = vif->mgmt_reg_stypes & presp_bit;
> + bool now = upd->interface_stypes & presp_bit;
>
> - switch (frame_type) {
> - case IEEE80211_STYPE_PROBE_REQ:
> - vif->frame_reg[0].type = frame_type;
> - vif->frame_reg[0].reg = reg;
> - break;
> + if (now != prev)
> + wilc_frame_register(vif, IEEE80211_STYPE_PROBE_REQ, now);
>
> - case IEEE80211_STYPE_ACTION:
> - vif->frame_reg[1].type = frame_type;
> - vif->frame_reg[1].reg = reg;
> - break;
> + prev = vif->mgmt_reg_stypes & action_bit;
> + now = upd->interface_stypes & action_bit;
>
> - default:
> - break;
> + if (now != prev)
> + wilc_frame_register(vif, IEEE80211_STYPE_ACTION, now);
> }
>
> - if (!wl->initialized)
> - return;
> - wilc_frame_register(vif, frame_type, reg);
> + vif->mgmt_reg_stypes =
> + upd->interface_stypes & (presp_bit | action_bit);
> }
>
> static int set_cqm_rssi_config(struct wiphy *wiphy, struct net_device *dev,
> @@ -1665,7 +1663,7 @@ static const struct cfg80211_ops wilc_cfg80211_ops = {
> .cancel_remain_on_channel = cancel_remain_on_channel,
> .mgmt_tx_cancel_wait = mgmt_tx_cancel_wait,
> .mgmt_tx = mgmt_tx,
> - .mgmt_frame_register = wilc_mgmt_frame_register,
> + .update_mgmt_frame_registrations = wilc_update_mgmt_frame_registrations,
> .set_power_mgmt = set_power_mgmt,
> .set_cqm_rssi_config = set_cqm_rssi_config,
>
> diff --git a/drivers/staging/wilc1000/cfg80211.h b/drivers/staging/wilc1000/cfg80211.h
> index 5e5d63f70df2..37b294cb3b37 100644
> --- a/drivers/staging/wilc1000/cfg80211.h
> +++ b/drivers/staging/wilc1000/cfg80211.h
> @@ -21,8 +21,9 @@ void wilc_wfi_deinit_mon_interface(struct wilc *wl, bool rtnl_locked);
> struct net_device *wilc_wfi_init_mon_interface(struct wilc *wl,
> const char *name,
> struct net_device *real_dev);
> -void wilc_mgmt_frame_register(struct wiphy *wiphy, struct wireless_dev *wdev,
> - u16 frame_type, bool reg);
> +void wilc_update_mgmt_frame_registrations(struct wiphy *wiphy,
> + struct wireless_dev *wdev,
> + struct mgmt_frame_regs *upd);
> struct wilc_vif *wilc_get_interface(struct wilc *wl);
> struct wilc_vif *wilc_get_wl_to_vif(struct wilc *wl);
> void wlan_deinit_locks(struct wilc *wilc);
> diff --git a/drivers/staging/wilc1000/netdev.c b/drivers/staging/wilc1000/netdev.c
> index f94a17babd12..fda0ab97b02c 100644
> --- a/drivers/staging/wilc1000/netdev.c
> +++ b/drivers/staging/wilc1000/netdev.c
> @@ -571,6 +571,7 @@ static int wilc_mac_open(struct net_device *ndev)
> struct wilc *wl = vif->wilc;
> unsigned char mac_add[ETH_ALEN] = {0};
> int ret = 0;
> + struct mgmt_frame_regs mgmt_regs = {};
>
> if (!wl || !wl->dev) {
> netdev_err(ndev, "device not ready\n");
> @@ -602,14 +603,12 @@ static int wilc_mac_open(struct net_device *ndev)
> return -EINVAL;
> }
>
> - wilc_mgmt_frame_register(vif->ndev->ieee80211_ptr->wiphy,
> - vif->ndev->ieee80211_ptr,
> - vif->frame_reg[0].type,
> - vif->frame_reg[0].reg);
> - wilc_mgmt_frame_register(vif->ndev->ieee80211_ptr->wiphy,
> - vif->ndev->ieee80211_ptr,
> - vif->frame_reg[1].type,
> - vif->frame_reg[1].reg);
> + mgmt_regs.interface_stypes = vif->mgmt_reg_stypes;
> + /* so we detect a change */
> + vif->mgmt_reg_stypes = 0;
> + wilc_update_mgmt_frame_registrations(vif->ndev->ieee80211_ptr->wiphy,
> + vif->ndev->ieee80211_ptr,
> + &mgmt_regs);
> netif_wake_queue(ndev);
> wl->open_ifcs++;
> vif->mac_opened = 1;
> @@ -792,12 +791,10 @@ void wilc_wfi_mgmt_rx(struct wilc *wilc, u8 *buff, u32 size)
> srcu_idx = srcu_read_lock(&wilc->srcu);
> list_for_each_entry_rcu(vif, &wilc->vif_list, list) {
> u16 type = le16_to_cpup((__le16 *)buff);
> + u32 type_bit = BIT(type >> 4);
>
> if (vif->priv.p2p_listen_state &&
> - ((type == vif->frame_reg[0].type &&
> - vif->frame_reg[0].reg) ||
> - (type == vif->frame_reg[1].type &&
> - vif->frame_reg[1].reg)))
> + vif->mgmt_reg_stypes & type_bit)
> wilc_wfi_p2p_rx(vif, buff, size);
>
> if (vif->monitor_flag)
> diff --git a/drivers/staging/wilc1000/netdev.h b/drivers/staging/wilc1000/netdev.h
> index 61cbec674a62..d0a006b68d08 100644
> --- a/drivers/staging/wilc1000/netdev.h
> +++ b/drivers/staging/wilc1000/netdev.h
> @@ -24,8 +24,6 @@
> #define PMKID_FOUND 1
> #define NUM_STA_ASSOCIATED 8
>
> -#define NUM_REG_FRAME 2
> -
> #define TCP_ACK_FILTER_LINK_SPEED_THRESH 54
> #define DEFAULT_LINK_SPEED 72
>
> @@ -151,11 +149,6 @@ struct wilc_priv {
> u64 inc_roc_cookie;
> };
>
> -struct frame_reg {
> - u16 type;
> - bool reg;
> -};
> -
> #define MAX_TCP_SESSION 25
> #define MAX_PENDING_ACKS 256
>
> @@ -187,7 +180,7 @@ struct wilc_vif {
> u8 iftype;
> int monitor_flag;
> int mac_opened;
> - struct frame_reg frame_reg[NUM_REG_FRAME];
> + u32 mgmt_reg_stypes;
> struct net_device_stats netstats;
> struct wilc *wilc;
> u8 bssid[ETH_ALEN];
> --
> 2.25.1
>
next prev parent reply other threads:[~2020-04-28 10:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-28 8:14 [PATCH 1/2] staging: rtl8723bs: remove mgmt_frame_register method Johannes Berg
2020-04-28 8:14 ` [PATCH 2/2] staging: wilc1000: adjust for management frame register API changes Johannes Berg
2020-04-28 8:41 ` Sergey Matyukevich
2020-04-28 8:46 ` Greg KH
2020-04-28 10:03 ` Ajay.Kathat [this message]
2020-04-28 8:16 ` [PATCH 1/2] staging: rtl8723bs: remove mgmt_frame_register method Johannes Berg
2020-04-28 8:46 ` Greg Kroah-Hartman
2020-04-28 8:46 ` Greg KH
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=2d14898e-57a2-142d-7bca-d32a3d135db2@microchip.com \
--to=ajay.kathat@microchip.com \
--cc=devel@driverdev.osuosl.org \
--cc=geomatsi@gmail.com \
--cc=johannes.berg@intel.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
/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.