All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] staging: rtl8723bs: remove mgmt_frame_register method
@ 2020-04-28  8:14 ` Johannes Berg
  0 siblings, 0 replies; 16+ messages in thread
From: Johannes Berg @ 2020-04-28  8:14 UTC (permalink / raw)
  To: linux-wireless; +Cc: devel, Sergey Matyukevich, Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

This was changed in cfg80211, so having it broke things, but
there's no need to adjust since it's an empty implementation.
Just remove it.

Fixes: 6cd536fe62ef ("cfg80211: change internal management frame registration API")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 .../staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 24 -------------------
 1 file changed, 24 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
index 1ba85a43f05a..cd31ad2b8a7b 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
@@ -3163,29 +3163,6 @@ static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy,
 	return ret;
 }
 
-static void cfg80211_rtw_mgmt_frame_register(struct wiphy *wiphy,
-	struct wireless_dev *wdev,
-	u16 frame_type, bool reg)
-{
-	struct net_device *ndev = wdev_to_ndev(wdev);
-	struct adapter *adapter;
-
-	if (ndev == NULL)
-		goto exit;
-
-	adapter = (struct adapter *)rtw_netdev_priv(ndev);
-
-#ifdef DEBUG_CFG80211
-	DBG_871X(FUNC_ADPT_FMT" frame_type:%x, reg:%d\n", FUNC_ADPT_ARG(adapter),
-		frame_type, reg);
-#endif
-
-	if (frame_type != (IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_PROBE_REQ))
-		return;
-exit:
-	return;
-}
-
 #if defined(CONFIG_PNO_SUPPORT)
 static int cfg80211_rtw_sched_scan_start(struct wiphy *wiphy,
 		struct net_device *dev,
@@ -3397,7 +3374,6 @@ static struct cfg80211_ops rtw_cfg80211_ops = {
 	.change_bss = cfg80211_rtw_change_bss,
 
 	.mgmt_tx = cfg80211_rtw_mgmt_tx,
-	.mgmt_frame_register = cfg80211_rtw_mgmt_frame_register,
 
 #if defined(CONFIG_PNO_SUPPORT)
 	.sched_scan_start = cfg80211_rtw_sched_scan_start,
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 1/2] staging: rtl8723bs: remove mgmt_frame_register method
@ 2020-04-28  8:14 ` Johannes Berg
  0 siblings, 0 replies; 16+ messages in thread
From: Johannes Berg @ 2020-04-28  8:14 UTC (permalink / raw)
  To: linux-wireless; +Cc: devel, Johannes Berg, Sergey Matyukevich

From: Johannes Berg <johannes.berg@intel.com>

This was changed in cfg80211, so having it broke things, but
there's no need to adjust since it's an empty implementation.
Just remove it.

Fixes: 6cd536fe62ef ("cfg80211: change internal management frame registration API")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 .../staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 24 -------------------
 1 file changed, 24 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
index 1ba85a43f05a..cd31ad2b8a7b 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
@@ -3163,29 +3163,6 @@ static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy,
 	return ret;
 }
 
-static void cfg80211_rtw_mgmt_frame_register(struct wiphy *wiphy,
-	struct wireless_dev *wdev,
-	u16 frame_type, bool reg)
-{
-	struct net_device *ndev = wdev_to_ndev(wdev);
-	struct adapter *adapter;
-
-	if (ndev == NULL)
-		goto exit;
-
-	adapter = (struct adapter *)rtw_netdev_priv(ndev);
-
-#ifdef DEBUG_CFG80211
-	DBG_871X(FUNC_ADPT_FMT" frame_type:%x, reg:%d\n", FUNC_ADPT_ARG(adapter),
-		frame_type, reg);
-#endif
-
-	if (frame_type != (IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_PROBE_REQ))
-		return;
-exit:
-	return;
-}
-
 #if defined(CONFIG_PNO_SUPPORT)
 static int cfg80211_rtw_sched_scan_start(struct wiphy *wiphy,
 		struct net_device *dev,
@@ -3397,7 +3374,6 @@ static struct cfg80211_ops rtw_cfg80211_ops = {
 	.change_bss = cfg80211_rtw_change_bss,
 
 	.mgmt_tx = cfg80211_rtw_mgmt_tx,
-	.mgmt_frame_register = cfg80211_rtw_mgmt_frame_register,
 
 #if defined(CONFIG_PNO_SUPPORT)
 	.sched_scan_start = cfg80211_rtw_sched_scan_start,
-- 
2.25.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 2/2] staging: wilc1000: adjust for management frame register API changes
  2020-04-28  8:14 ` Johannes Berg
@ 2020-04-28  8:14   ` Johannes Berg
  -1 siblings, 0 replies; 16+ messages in thread
From: Johannes Berg @ 2020-04-28  8:14 UTC (permalink / raw)
  To: linux-wireless; +Cc: devel, Sergey Matyukevich, Johannes Berg

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>
---
 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


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 2/2] staging: wilc1000: adjust for management frame register API changes
@ 2020-04-28  8:14   ` Johannes Berg
  0 siblings, 0 replies; 16+ messages in thread
From: Johannes Berg @ 2020-04-28  8:14 UTC (permalink / raw)
  To: linux-wireless; +Cc: devel, Johannes Berg, Sergey Matyukevich

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>
---
 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

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH 1/2] staging: rtl8723bs: remove mgmt_frame_register method
  2020-04-28  8:14 ` Johannes Berg
@ 2020-04-28  8:16   ` Johannes Berg
  -1 siblings, 0 replies; 16+ messages in thread
From: Johannes Berg @ 2020-04-28  8:16 UTC (permalink / raw)
  To: linux-wireless, Greg Kroah-Hartman; +Cc: devel, Sergey Matyukevich

Greg,

I'm going to take these through my tree because I broke the APIs there
(and wasn't paying attention to staging), but every bot around the world
is complaining now that my tree doesn't build ... :)

johannes


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 1/2] staging: rtl8723bs: remove mgmt_frame_register method
@ 2020-04-28  8:16   ` Johannes Berg
  0 siblings, 0 replies; 16+ messages in thread
From: Johannes Berg @ 2020-04-28  8:16 UTC (permalink / raw)
  To: linux-wireless, Greg Kroah-Hartman; +Cc: devel, Sergey Matyukevich

Greg,

I'm going to take these through my tree because I broke the APIs there
(and wasn't paying attention to staging), but every bot around the world
is complaining now that my tree doesn't build ... :)

johannes

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 2/2] staging: wilc1000: adjust for management frame register API changes
  2020-04-28  8:14   ` Johannes Berg
@ 2020-04-28  8:41     ` Sergey Matyukevich
  -1 siblings, 0 replies; 16+ messages in thread
From: Sergey Matyukevich @ 2020-04-28  8:41 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, devel, Johannes Berg

> 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>
> ---
>  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(-)

Reviewed-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>

Regards,
Sergey

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 2/2] staging: wilc1000: adjust for management frame register API changes
@ 2020-04-28  8:41     ` Sergey Matyukevich
  0 siblings, 0 replies; 16+ messages in thread
From: Sergey Matyukevich @ 2020-04-28  8:41 UTC (permalink / raw)
  To: Johannes Berg; +Cc: devel, linux-wireless, Johannes Berg

> 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>
> ---
>  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(-)

Reviewed-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>

Regards,
Sergey
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 1/2] staging: rtl8723bs: remove mgmt_frame_register method
  2020-04-28  8:16   ` Johannes Berg
@ 2020-04-28  8:46     ` Greg Kroah-Hartman
  -1 siblings, 0 replies; 16+ messages in thread
From: Greg Kroah-Hartman @ 2020-04-28  8:46 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, devel, Sergey Matyukevich

On Tue, Apr 28, 2020 at 10:16:57AM +0200, Johannes Berg wrote:
> Greg,
> 
> I'm going to take these through my tree because I broke the APIs there
> (and wasn't paying attention to staging), but every bot around the world
> is complaining now that my tree doesn't build ... :)

No objection from me!

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 1/2] staging: rtl8723bs: remove mgmt_frame_register method
@ 2020-04-28  8:46     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 16+ messages in thread
From: Greg Kroah-Hartman @ 2020-04-28  8:46 UTC (permalink / raw)
  To: Johannes Berg; +Cc: devel, linux-wireless, Sergey Matyukevich

On Tue, Apr 28, 2020 at 10:16:57AM +0200, Johannes Berg wrote:
> Greg,
> 
> I'm going to take these through my tree because I broke the APIs there
> (and wasn't paying attention to staging), but every bot around the world
> is complaining now that my tree doesn't build ... :)

No objection from me!
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 1/2] staging: rtl8723bs: remove mgmt_frame_register method
  2020-04-28  8:14 ` Johannes Berg
@ 2020-04-28  8:46   ` Greg KH
  -1 siblings, 0 replies; 16+ messages in thread
From: Greg KH @ 2020-04-28  8:46 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, devel, Johannes Berg, Sergey Matyukevich

On Tue, Apr 28, 2020 at 10:14:02AM +0200, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
> 
> This was changed in cfg80211, so having it broke things, but
> there's no need to adjust since it's an empty implementation.
> Just remove it.
> 
> Fixes: 6cd536fe62ef ("cfg80211: change internal management frame registration API")
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> ---
>  .../staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 24 -------------------
>  1 file changed, 24 deletions(-)

Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 1/2] staging: rtl8723bs: remove mgmt_frame_register method
@ 2020-04-28  8:46   ` Greg KH
  0 siblings, 0 replies; 16+ messages in thread
From: Greg KH @ 2020-04-28  8:46 UTC (permalink / raw)
  To: Johannes Berg; +Cc: devel, linux-wireless, Sergey Matyukevich, Johannes Berg

On Tue, Apr 28, 2020 at 10:14:02AM +0200, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
> 
> This was changed in cfg80211, so having it broke things, but
> there's no need to adjust since it's an empty implementation.
> Just remove it.
> 
> Fixes: 6cd536fe62ef ("cfg80211: change internal management frame registration API")
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> ---
>  .../staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 24 -------------------
>  1 file changed, 24 deletions(-)

Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 2/2] staging: wilc1000: adjust for management frame register API changes
  2020-04-28  8:14   ` Johannes Berg
@ 2020-04-28  8:46     ` Greg KH
  -1 siblings, 0 replies; 16+ messages in thread
From: Greg KH @ 2020-04-28  8:46 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, devel, Johannes Berg, Sergey Matyukevich

On Tue, Apr 28, 2020 at 10:14:03AM +0200, Johannes Berg wrote:
> 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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 2/2] staging: wilc1000: adjust for management frame register API changes
@ 2020-04-28  8:46     ` Greg KH
  0 siblings, 0 replies; 16+ messages in thread
From: Greg KH @ 2020-04-28  8:46 UTC (permalink / raw)
  To: Johannes Berg; +Cc: devel, linux-wireless, Sergey Matyukevich, Johannes Berg

On Tue, Apr 28, 2020 at 10:14:03AM +0200, Johannes Berg wrote:
> 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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 2/2] staging: wilc1000: adjust for management frame register API changes
  2020-04-28  8:14   ` Johannes Berg
@ 2020-04-28 10:03     ` Ajay.Kathat
  -1 siblings, 0 replies; 16+ messages in thread
From: Ajay.Kathat @ 2020-04-28 10:03 UTC (permalink / raw)
  To: johannes, linux-wireless; +Cc: devel, geomatsi, johannes.berg


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
> 

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 2/2] staging: wilc1000: adjust for management frame register API changes
@ 2020-04-28 10:03     ` Ajay.Kathat
  0 siblings, 0 replies; 16+ messages in thread
From: Ajay.Kathat @ 2020-04-28 10:03 UTC (permalink / raw)
  To: johannes, linux-wireless; +Cc: devel, johannes.berg, geomatsi


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
> 
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2020-04-28 10:04 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-28  8:14 [PATCH 1/2] staging: rtl8723bs: remove mgmt_frame_register method Johannes Berg
2020-04-28  8:14 ` 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:14   ` Johannes Berg
2020-04-28  8:41   ` Sergey Matyukevich
2020-04-28  8:41     ` Sergey Matyukevich
2020-04-28  8:46   ` Greg KH
2020-04-28  8:46     ` Greg KH
2020-04-28 10:03   ` Ajay.Kathat
2020-04-28 10:03     ` Ajay.Kathat
2020-04-28  8:16 ` [PATCH 1/2] staging: rtl8723bs: remove mgmt_frame_register method Johannes Berg
2020-04-28  8:16   ` Johannes Berg
2020-04-28  8:46   ` Greg Kroah-Hartman
2020-04-28  8:46     ` Greg Kroah-Hartman
2020-04-28  8:46 ` Greg KH
2020-04-28  8:46   ` Greg KH

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.