Commit fbb93020 authored by Dmitry Lebed's avatar Dmitry Lebed Committed by Kalle Valo

qtnfmac: add DFS offload support

DFS offload support implemented:
- DFS_OFFLOAD feature is advertised depending on HW capabilities
- CAC_STARTED event forwarding from HW implemented
- start_radar_detection() callback now returning -ENOTSUPP
  if DFS_OFFLOAD is enabled
Signed-off-by: default avatarDmitry Lebed <dlebed@quantenna.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent fb7bcb6b
...@@ -813,6 +813,9 @@ static int qtnf_start_radar_detection(struct wiphy *wiphy, ...@@ -813,6 +813,9 @@ static int qtnf_start_radar_detection(struct wiphy *wiphy,
struct qtnf_vif *vif = qtnf_netdev_get_priv(ndev); struct qtnf_vif *vif = qtnf_netdev_get_priv(ndev);
int ret; int ret;
if (wiphy_ext_feature_isset(wiphy, NL80211_EXT_FEATURE_DFS_OFFLOAD))
return -ENOTSUPP;
ret = qtnf_cmd_start_cac(vif, chandef, cac_time_ms); ret = qtnf_cmd_start_cac(vif, chandef, cac_time_ms);
if (ret) if (ret)
pr_err("%s: failed to start CAC ret=%d\n", ndev->name, ret); pr_err("%s: failed to start CAC ret=%d\n", ndev->name, ret);
...@@ -909,6 +912,9 @@ struct wiphy *qtnf_wiphy_allocate(struct qtnf_bus *bus) ...@@ -909,6 +912,9 @@ struct wiphy *qtnf_wiphy_allocate(struct qtnf_bus *bus)
{ {
struct wiphy *wiphy; struct wiphy *wiphy;
if (bus->hw_info.hw_capab & QLINK_HW_CAPAB_DFS_OFFLOAD)
qtn_cfg80211_ops.start_radar_detection = NULL;
wiphy = wiphy_new(&qtn_cfg80211_ops, sizeof(struct qtnf_wmac)); wiphy = wiphy_new(&qtn_cfg80211_ops, sizeof(struct qtnf_wmac));
if (!wiphy) if (!wiphy)
return NULL; return NULL;
...@@ -982,6 +988,9 @@ int qtnf_wiphy_register(struct qtnf_hw_info *hw_info, struct qtnf_wmac *mac) ...@@ -982,6 +988,9 @@ int qtnf_wiphy_register(struct qtnf_hw_info *hw_info, struct qtnf_wmac *mac)
WIPHY_FLAG_AP_UAPSD | WIPHY_FLAG_AP_UAPSD |
WIPHY_FLAG_HAS_CHANNEL_SWITCH; WIPHY_FLAG_HAS_CHANNEL_SWITCH;
if (hw_info->hw_capab & QLINK_HW_CAPAB_DFS_OFFLOAD)
wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_DFS_OFFLOAD);
wiphy->probe_resp_offload = NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS | wiphy->probe_resp_offload = NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS |
NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS2; NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS2;
......
...@@ -443,6 +443,17 @@ static int qtnf_event_handle_radar(struct qtnf_vif *vif, ...@@ -443,6 +443,17 @@ static int qtnf_event_handle_radar(struct qtnf_vif *vif,
cfg80211_cac_event(vif->netdev, &chandef, cfg80211_cac_event(vif->netdev, &chandef,
NL80211_RADAR_CAC_ABORTED, GFP_KERNEL); NL80211_RADAR_CAC_ABORTED, GFP_KERNEL);
break; break;
case QLINK_RADAR_CAC_STARTED:
if (vif->wdev.cac_started)
break;
if (!wiphy_ext_feature_isset(wiphy,
NL80211_EXT_FEATURE_DFS_OFFLOAD))
break;
cfg80211_cac_event(vif->netdev, &chandef,
NL80211_RADAR_CAC_STARTED, GFP_KERNEL);
break;
default: default:
pr_warn("%s: unhandled radar event %u\n", pr_warn("%s: unhandled radar event %u\n",
vif->netdev->name, ev->event); vif->netdev->name, ev->event);
......
...@@ -68,10 +68,12 @@ struct qlink_msg_header { ...@@ -68,10 +68,12 @@ struct qlink_msg_header {
* @QLINK_HW_CAPAB_STA_INACT_TIMEOUT: device implements a logic to kick-out * @QLINK_HW_CAPAB_STA_INACT_TIMEOUT: device implements a logic to kick-out
* associated STAs due to inactivity. Inactivity timeout period is taken * associated STAs due to inactivity. Inactivity timeout period is taken
* from QLINK_CMD_START_AP parameters. * from QLINK_CMD_START_AP parameters.
* @QLINK_HW_CAPAB_DFS_OFFLOAD: device implements DFS offload functionality
*/ */
enum qlink_hw_capab { enum qlink_hw_capab {
QLINK_HW_CAPAB_REG_UPDATE = BIT(0), QLINK_HW_CAPAB_REG_UPDATE = BIT(0),
QLINK_HW_CAPAB_STA_INACT_TIMEOUT = BIT(1), QLINK_HW_CAPAB_STA_INACT_TIMEOUT = BIT(1),
QLINK_HW_CAPAB_DFS_OFFLOAD = BIT(2),
}; };
enum qlink_iface_type { enum qlink_iface_type {
...@@ -1031,6 +1033,7 @@ enum qlink_radar_event { ...@@ -1031,6 +1033,7 @@ enum qlink_radar_event {
QLINK_RADAR_CAC_ABORTED, QLINK_RADAR_CAC_ABORTED,
QLINK_RADAR_NOP_FINISHED, QLINK_RADAR_NOP_FINISHED,
QLINK_RADAR_PRE_CAC_EXPIRED, QLINK_RADAR_PRE_CAC_EXPIRED,
QLINK_RADAR_CAC_STARTED,
}; };
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment