aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath
diff options
context:
space:
mode:
authorLior David <qca_liord@qca.qualcomm.com>2016-11-23 09:06:43 -0500
committerKalle Valo <kvalo@qca.qualcomm.com>2016-11-23 09:50:07 -0500
commit3fea18d079e2f1f50bc2a37db826c9e6e8a4003e (patch)
tree0ff39cfecc89db75c105ee9bdd52250ca4123fb8 /drivers/net/wireless/ath
parentcbf795c195fb48dafd5f160570af9086fe04d4d0 (diff)
wil6210: support NL80211_ATTR_WIPHY_RETRY_SHORT
Add support for setting retry limit for short frames, using NL80211_CMD_SET_WIPHY with the attribute NL80211_ATTR_WIPHY_RETRY_SHORT. Update wiphy->retry_short from the FW default when interface is brought up. Signed-off-by: Lior David <qca_liord@qca.qualcomm.com> Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r--drivers/net/wireless/ath/wil6210/cfg80211.c21
-rw-r--r--drivers/net/wireless/ath/wil6210/main.c15
-rw-r--r--drivers/net/wireless/ath/wil6210/wil6210.h2
-rw-r--r--drivers/net/wireless/ath/wil6210/wmi.c59
4 files changed, 97 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/wil6210/cfg80211.c b/drivers/net/wireless/ath/wil6210/cfg80211.c
index 533872ace0d7..22078b0ffc8c 100644
--- a/drivers/net/wireless/ath/wil6210/cfg80211.c
+++ b/drivers/net/wireless/ath/wil6210/cfg80211.c
@@ -702,6 +702,26 @@ static int wil_cfg80211_disconnect(struct wiphy *wiphy,
702 return rc; 702 return rc;
703} 703}
704 704
705static int wil_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed)
706{
707 struct wil6210_priv *wil = wiphy_to_wil(wiphy);
708 int rc;
709
710 /* these parameters are explicitly not supported */
711 if (changed & (WIPHY_PARAM_RETRY_LONG |
712 WIPHY_PARAM_FRAG_THRESHOLD |
713 WIPHY_PARAM_RTS_THRESHOLD))
714 return -ENOTSUPP;
715
716 if (changed & WIPHY_PARAM_RETRY_SHORT) {
717 rc = wmi_set_mgmt_retry(wil, wiphy->retry_short);
718 if (rc)
719 return rc;
720 }
721
722 return 0;
723}
724
705int wil_cfg80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, 725int wil_cfg80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
706 struct cfg80211_mgmt_tx_params *params, 726 struct cfg80211_mgmt_tx_params *params,
707 u64 *cookie) 727 u64 *cookie)
@@ -1489,6 +1509,7 @@ static struct cfg80211_ops wil_cfg80211_ops = {
1489 .abort_scan = wil_cfg80211_abort_scan, 1509 .abort_scan = wil_cfg80211_abort_scan,
1490 .connect = wil_cfg80211_connect, 1510 .connect = wil_cfg80211_connect,
1491 .disconnect = wil_cfg80211_disconnect, 1511 .disconnect = wil_cfg80211_disconnect,
1512 .set_wiphy_params = wil_cfg80211_set_wiphy_params,
1492 .change_virtual_intf = wil_cfg80211_change_iface, 1513 .change_virtual_intf = wil_cfg80211_change_iface,
1493 .get_station = wil_cfg80211_get_station, 1514 .get_station = wil_cfg80211_get_station,
1494 .dump_station = wil_cfg80211_dump_station, 1515 .dump_station = wil_cfg80211_dump_station,
diff --git a/drivers/net/wireless/ath/wil6210/main.c b/drivers/net/wireless/ath/wil6210/main.c
index 65a487c95fbf..70f9c07749e3 100644
--- a/drivers/net/wireless/ath/wil6210/main.c
+++ b/drivers/net/wireless/ath/wil6210/main.c
@@ -693,6 +693,19 @@ static int wil_target_reset(struct wil6210_priv *wil)
693 return 0; 693 return 0;
694} 694}
695 695
696static void wil_collect_fw_info(struct wil6210_priv *wil)
697{
698 struct wiphy *wiphy = wil_to_wiphy(wil);
699 u8 retry_short;
700 int rc;
701
702 rc = wmi_get_mgmt_retry(wil, &retry_short);
703 if (!rc) {
704 wiphy->retry_short = retry_short;
705 wil_dbg_misc(wil, "FW retry_short: %d\n", retry_short);
706 }
707}
708
696void wil_mbox_ring_le2cpus(struct wil6210_mbox_ring *r) 709void wil_mbox_ring_le2cpus(struct wil6210_mbox_ring *r)
697{ 710{
698 le32_to_cpus(&r->base); 711 le32_to_cpus(&r->base);
@@ -966,6 +979,8 @@ int wil_reset(struct wil6210_priv *wil, bool load_fw)
966 return rc; 979 return rc;
967 } 980 }
968 981
982 wil_collect_fw_info(wil);
983
969 if (wil->platform_ops.notify) { 984 if (wil->platform_ops.notify) {
970 rc = wil->platform_ops.notify(wil->platform_handle, 985 rc = wil->platform_ops.notify(wil->platform_handle,
971 WIL_PLATFORM_EVT_FW_RDY); 986 WIL_PLATFORM_EVT_FW_RDY);
diff --git a/drivers/net/wireless/ath/wil6210/wil6210.h b/drivers/net/wireless/ath/wil6210/wil6210.h
index d65a5e688850..b449f84bcc68 100644
--- a/drivers/net/wireless/ath/wil6210/wil6210.h
+++ b/drivers/net/wireless/ath/wil6210/wil6210.h
@@ -821,6 +821,8 @@ int wmi_addba_rx_resp(struct wil6210_priv *wil, u8 cid, u8 tid, u8 token,
821 u16 status, bool amsdu, u16 agg_wsize, u16 timeout); 821 u16 status, bool amsdu, u16 agg_wsize, u16 timeout);
822int wmi_ps_dev_profile_cfg(struct wil6210_priv *wil, 822int wmi_ps_dev_profile_cfg(struct wil6210_priv *wil,
823 enum wmi_ps_profile_type ps_profile); 823 enum wmi_ps_profile_type ps_profile);
824int wmi_set_mgmt_retry(struct wil6210_priv *wil, u8 retry_short);
825int wmi_get_mgmt_retry(struct wil6210_priv *wil, u8 *retry_short);
824int wil_addba_rx_request(struct wil6210_priv *wil, u8 cidxtid, 826int wil_addba_rx_request(struct wil6210_priv *wil, u8 cidxtid,
825 u8 dialog_token, __le16 ba_param_set, 827 u8 dialog_token, __le16 ba_param_set,
826 __le16 ba_timeout, __le16 ba_seq_ctrl); 828 __le16 ba_timeout, __le16 ba_seq_ctrl);
diff --git a/drivers/net/wireless/ath/wil6210/wmi.c b/drivers/net/wireless/ath/wil6210/wmi.c
index e72654861744..2971ddf0bc44 100644
--- a/drivers/net/wireless/ath/wil6210/wmi.c
+++ b/drivers/net/wireless/ath/wil6210/wmi.c
@@ -1599,6 +1599,65 @@ int wmi_ps_dev_profile_cfg(struct wil6210_priv *wil,
1599 return rc; 1599 return rc;
1600} 1600}
1601 1601
1602int wmi_set_mgmt_retry(struct wil6210_priv *wil, u8 retry_short)
1603{
1604 int rc;
1605 struct wmi_set_mgmt_retry_limit_cmd cmd = {
1606 .mgmt_retry_limit = retry_short,
1607 };
1608 struct {
1609 struct wmi_cmd_hdr wmi;
1610 struct wmi_set_mgmt_retry_limit_event evt;
1611 } __packed reply;
1612
1613 wil_dbg_wmi(wil, "Setting mgmt retry short %d\n", retry_short);
1614
1615 if (!test_bit(WMI_FW_CAPABILITY_MGMT_RETRY_LIMIT, wil->fw_capabilities))
1616 return -ENOTSUPP;
1617
1618 reply.evt.status = WMI_FW_STATUS_FAILURE;
1619
1620 rc = wmi_call(wil, WMI_SET_MGMT_RETRY_LIMIT_CMDID, &cmd, sizeof(cmd),
1621 WMI_SET_MGMT_RETRY_LIMIT_EVENTID, &reply, sizeof(reply),
1622 100);
1623 if (rc)
1624 return rc;
1625
1626 if (reply.evt.status != WMI_FW_STATUS_SUCCESS) {
1627 wil_err(wil, "set mgmt retry limit failed with status %d\n",
1628 reply.evt.status);
1629 rc = -EINVAL;
1630 }
1631
1632 return rc;
1633}
1634
1635int wmi_get_mgmt_retry(struct wil6210_priv *wil, u8 *retry_short)
1636{
1637 int rc;
1638 struct {
1639 struct wmi_cmd_hdr wmi;
1640 struct wmi_get_mgmt_retry_limit_event evt;
1641 } __packed reply;
1642
1643 wil_dbg_wmi(wil, "getting mgmt retry short\n");
1644
1645 if (!test_bit(WMI_FW_CAPABILITY_MGMT_RETRY_LIMIT, wil->fw_capabilities))
1646 return -ENOTSUPP;
1647
1648 reply.evt.mgmt_retry_limit = 0;
1649 rc = wmi_call(wil, WMI_GET_MGMT_RETRY_LIMIT_CMDID, NULL, 0,
1650 WMI_GET_MGMT_RETRY_LIMIT_EVENTID, &reply, sizeof(reply),
1651 100);
1652 if (rc)
1653 return rc;
1654
1655 if (retry_short)
1656 *retry_short = reply.evt.mgmt_retry_limit;
1657
1658 return 0;
1659}
1660
1602int wmi_abort_scan(struct wil6210_priv *wil) 1661int wmi_abort_scan(struct wil6210_priv *wil)
1603{ 1662{
1604 int rc; 1663 int rc;