qtnfmac: debugfs update and other misc fixes
cover qtnfmac: debugfs update and other misc fixes
Hello Kalle and all,
Here is the patch set with minor fixes and enhancements for qtnfmac driver, that were not included into the previous larger series.
The major changes include the following items:
- updating debugfs structure to support multiple cards on a single host
- add kernel module param to control DFS slave radar detection behavior
Regards,
Sergey
Igor Mitsyanko (1):
qtnfmac: allow to control DFS slave radar detection
Sergey Matyukevich (2):
qtnfmac: handle channel switch events for connected stations only
qtnfmac: modify debugfs to support multiple cards
drivers/net/wireless/quantenna/qtnfmac/cfg80211.c | 2 +- drivers/net/wireless/quantenna/qtnfmac/commands.c | 4 ++- drivers/net/wireless/quantenna/qtnfmac/commands.h | 3 +- drivers/net/wireless/quantenna/qtnfmac/core.c | 35 +++++++++++++++++++++++ drivers/net/wireless/quantenna/qtnfmac/core.h | 2 ++ drivers/net/wireless/quantenna/qtnfmac/debug.c | 4 ++- drivers/net/wireless/quantenna/qtnfmac/event.c | 16 +++++++---- drivers/net/wireless/quantenna/qtnfmac/qlink.h | 4 ++- 8 files changed, 60 insertions(+), 10 deletions(-)
Signature · 1 line
2.11.0
PATCH 1/3 qtnfmac: handle channel switch events for connected stations only
Channel switch events from firmware should be processed only when STA is already connected to BSS. On connect this notification is not needed since full BSS info will be supplied by cfg80211_connect_result.
--- drivers/net/wireless/quantenna/qtnfmac/event.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-)
drivers/net/wireless/quantenna/qtnfmac/event.c +11 -5
@@ -493,14 +493,20 @@ qtnf_event_handle_freq_change(struct qtnf_wmac *mac,for (i =0 ; i <QTNF_MAX_INTF ; i++) { vif = &mac->iflist[i]; +if (vif->wdev.iftype ==NL80211_IFTYPE_UNSPECIFIED )continue ; -if (vif->netdev) { -mutex_lock (&vif->wdev.mtx); -cfg80211_ch_switch_notify (vif->netdev, &chandef); -mutex_unlock (&vif->wdev.mtx); - } +if (vif->wdev.iftype ==NL80211_IFTYPE_STATION && + !vif->wdev.current_bss) +continue ; + +if (!vif->netdev) +continue ; + +mutex_lock (&vif->wdev.mtx); +cfg80211_ch_switch_notify (vif->netdev, &chandef); +mutex_unlock (&vif->wdev.mtx); }return 0 ;
Signature · 1 line
2.11.0
Re: [PATCH 1/3] qtnfmac: handle channel switch events for connected stations only
Quoted 5 lines · Sergey Matyukevich
Channel switch events from firmware should be processed only when STA is already connected to BSS. On connect this notification is not needed since full BSS info will be supplied by
cfg80211_connect_result.Signed-off-by Sergey Matyukevich <[email protected]>
3 patches applied to wireless-drivers-next.git, thanks.
4f87d486faf1 qtnfmac: handle channel switch events for connected stations only 888f1564a272 qtnfmac: allow to control DFS slave radar detection 0b68fe10b8e8 qtnfmac: modify debugfs to support multiple cards
Signature · 3 lines
https://patchwork.kernel.org/patch/10890667/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
PATCH 2/3 qtnfmac: allow to control DFS slave radar detection
In reply to Sergey MatyukevichFrom: Igor Mitsyanko <[email protected]>
In ETSI region DFS slave device can operate in two modes on DFS channels:
- do on-channel radar detection and use higher Tx power
- don't do radar detection and use lower Tx power as a consequence
Allow user to control that behavior through qtnfmac module parameter.
--- drivers/net/wireless/quantenna/qtnfmac/cfg80211.c | 2 +- drivers/net/wireless/quantenna/qtnfmac/commands.c | 4 +++- drivers/net/wireless/quantenna/qtnfmac/commands.h | 3 ++- drivers/net/wireless/quantenna/qtnfmac/core.c | 9 +++++++++ drivers/net/wireless/quantenna/qtnfmac/core.h | 1 + drivers/net/wireless/quantenna/qtnfmac/qlink.h | 4 +++- 6 files changed, 19 insertions(+), 4 deletions(-)
drivers/net/wireless/quantenna/qtnfmac/cfg80211.c +1 -1
@@ -1008,7 +1008,7 @@ static void qtnf_cfg80211_reg_notifier(struct wiphy *wiphy,pr_debug ("MAC%u: initiator=%d alpha=%c%c\n" , mac->macid, req->initiator, req->alpha2[0 ], req->alpha2[1 ]); - ret =qtnf_cmd_reg_notify (mac, req); + ret =qtnf_cmd_reg_notify (mac, req,qtnf_mac_slave_radar_get (wiphy));if (ret) {pr_err ("MAC%u: failed to update region to %c%c: %d\n" , mac->macid, req->alpha2[0 ], req->alpha2[1 ], ret);
drivers/net/wireless/quantenna/qtnfmac/commands.c +3 -1
@@ -2367,7 +2367,8 @@ int qtnf_cmd_send_updown_intf(struct qtnf_vif *vif, bool up)return ret; } -int qtnf_cmd_reg_notify (struct qtnf_wmac *mac,struct regulatory_request *req) +int qtnf_cmd_reg_notify (struct qtnf_wmac *mac,struct regulatory_request *req, +bool slave_radar) {struct wiphy *wiphy =priv_to_wiphy (mac);struct qtnf_bus *bus = mac->bus;
@@ -2429,6 +2430,7 @@ int qtnf_cmd_reg_notify(struct qtnf_wmac *mac, struct regulatory_request *req)break ; } + cmd->slave_radar = slave_radar; cmd->num_channels =0 ;for (band =0 ; band <NUM_NL80211_BANDS ; band++) {
drivers/net/wireless/quantenna/qtnfmac/commands.h +2 -1
@@ -57,7 +57,8 @@ int qtnf_cmd_send_disconnect(struct qtnf_vif *vif, u16 reason_code);int qtnf_cmd_send_updown_intf (struct qtnf_vif *vif,bool up); -int qtnf_cmd_reg_notify (struct qtnf_wmac *mac,struct regulatory_request *req); +int qtnf_cmd_reg_notify (struct qtnf_wmac *mac,struct regulatory_request *req, +bool slave_radar);int qtnf_cmd_get_chan_stats (struct qtnf_wmac *mac,u16 channel,struct qtnf_chan_stats *stats); int qtnf_cmd_send_chan_switch(struct qtnf_vif *vif,
drivers/net/wireless/quantenna/qtnfmac/core.c +9 -0
@@ -16,6 +16,10 @@#define QTNF_DMP_MAX_LEN 48#define QTNF_PRIMARY_VIF_IDX 0 +static bool slave_radar = true; +module_param (slave_radar, bool,0644 ); +MODULE_PARM_DESC (slave_radar,"set 0 to disable radar detection in slave mode" ); +struct qtnf_frame_meta_info {u8 magic_s;u8 ifidx;
@@ -426,6 +430,11 @@ static struct qtnf_wmac *qtnf_core_mac_alloc(struct qtnf_bus *bus,return mac; } +bool qtnf_mac_slave_radar_get (struct wiphy *wiphy) +{ +return slave_radar; +} +static const struct ethtool_ops qtnf_ethtool_ops = { .get_drvinfo = cfg80211_get_drvinfo, };
drivers/net/wireless/quantenna/qtnfmac/core.h +1 -0
@@ -134,6 +134,7 @@ struct qtnf_vif *qtnf_mac_get_free_vif(struct qtnf_wmac *mac);struct qtnf_vif *qtnf_mac_get_base_vif (struct qtnf_wmac *mac);void qtnf_mac_iface_comb_free (struct qtnf_wmac *mac);void qtnf_mac_ext_caps_free (struct qtnf_wmac *mac); +bool qtnf_mac_slave_radar_get (struct wiphy *wiphy);struct wiphy *qtnf_wiphy_allocate (struct qtnf_bus *bus);int qtnf_core_net_attach (struct qtnf_wmac *mac,struct qtnf_vif *priv,const char *name,unsigned char name_assign_type);
drivers/net/wireless/quantenna/qtnfmac/qlink.h +3 -1
@@ -588,6 +588,7 @@ enum qlink_user_reg_hint_type {* of &enum qlink_user_reg_hint_type. * @num_channels: number of &struct qlink_tlv_channel in a variable portion of a * payload. +* @slave_radar: whether slave device should enable radar detection. * @dfs_region: one of &enum qlink_dfs_regions. * @info: variable portion of regulatory notifier callback. */
@@ -598,7 +599,8 @@ struct qlink_cmd_reg_notify {u8 user_reg_hint_type;u8 num_channels;u8 dfs_region; -u8 rsvd[2 ]; +u8 slave_radar; +u8 rsvd[1 ];u8 info[0 ]; } __packed;
Signature · 1 line
2.11.0
PATCH 3/3 qtnfmac: modify debugfs to support multiple cards
In reply to Sergey MatyukevichThis patch modifies location of debugfs entries and their naming conventions to support multiple wireless cards on pcie host. Selected approach is to use separate directories for different wireless cards in top-level qtnfmac debugfs directory.
Here is an example that clarifies the chosen naming conventions:
$ sudo ls /sys/kernel/debug/qtnfmac/ qtnfmac_pcie:0000:01:00.0
--- drivers/net/wireless/quantenna/qtnfmac/core.c | 26 ++++++++++++++++++++++++++ drivers/net/wireless/quantenna/qtnfmac/core.h | 1 + drivers/net/wireless/quantenna/qtnfmac/debug.c | 4 +++- 3 files changed, 30 insertions(+), 1 deletion(-)
drivers/net/wireless/quantenna/qtnfmac/core.c +26 -0
@@ -20,6 +20,8 @@ static bool slave_radar = true;module_param (slave_radar, bool,0644 );MODULE_PARM_DESC (slave_radar,"set 0 to disable radar detection in slave mode" ); +static struct dentry *qtnf_debugfs_dir; +struct qtnf_frame_meta_info {u8 magic_s;u8 ifidx;
@@ -848,6 +850,30 @@ void qtnf_packet_send_hi_pri(struct sk_buff *skb) }EXPORT_SYMBOL_GPL (qtnf_packet_send_hi_pri); +struct dentry *qtnf_get_debugfs_dir (void ) +{ +return qtnf_debugfs_dir; +} +EXPORT_SYMBOL_GPL (qtnf_get_debugfs_dir); + +static int __init qtnf_core_register (void ) +{ + qtnf_debugfs_dir =debugfs_create_dir (KBUILD_MODNAME ,NULL ); + +if (IS_ERR (qtnf_debugfs_dir)) + qtnf_debugfs_dir =NULL ; + +return 0 ; +} + +static void __exit qtnf_core_exit(void) +{ +debugfs_remove (qtnf_debugfs_dir); +} + +module_init (qtnf_core_register); +module_exit (qtnf_core_exit); +MODULE_AUTHOR ("Quantenna Communications" );MODULE_DESCRIPTION ("Quantenna 802.11 wireless LAN FullMAC driver." );MODULE_LICENSE ("GPL" );
drivers/net/wireless/quantenna/qtnfmac/core.h +1 -0
@@ -153,6 +153,7 @@ void qtnf_virtual_intf_cleanup(struct net_device *ndev);void qtnf_netdev_updown (struct net_device *ndev,bool up);void qtnf_scan_done (struct qtnf_wmac *mac,bool aborted);void qtnf_packet_send_hi_pri (struct sk_buff *skb); +struct dentry *qtnf_get_debugfs_dir (void );static inline struct qtnf_vif *qtnf_netdev_get_priv (struct net_device *dev) {
drivers/net/wireless/quantenna/qtnfmac/debug.c +3 -1
@@ -5,7 +5,9 @@void qtnf_debugfs_init (struct qtnf_bus *bus,const char *name) { - bus->dbg_dir =debugfs_create_dir (name,NULL ); +struct dentry *parent =qtnf_get_debugfs_dir (); + + bus->dbg_dir =debugfs_create_dir (name, parent); }void qtnf_debugfs_remove (struct qtnf_bus *bus)
Signature · 1 line
2.11.0