Search Linux Wireless

[RFC 3/3] qtnfmac: add support for basic aggregation control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add support for basic AMPDU/AMSDU aggregation control:
- report initial aggregation configuration to cfg80211 core
- pass AMPDU/AMSDU aggregation changes to wireless card
  using set_wiphy_params cfg80211 callback

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@xxxxxxxxxxxxx>
---
 drivers/net/wireless/quantenna/qtnfmac/cfg80211.c |  2 ++
 drivers/net/wireless/quantenna/qtnfmac/commands.c | 17 +++++++++++++++++
 drivers/net/wireless/quantenna/qtnfmac/core.h     |  2 ++
 drivers/net/wireless/quantenna/qtnfmac/qlink.h    |  7 +++++++
 4 files changed, 28 insertions(+)

diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
index 51b33ec78fac..98bd0a3d29db 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
@@ -1087,6 +1087,8 @@ int qtnf_wiphy_register(struct qtnf_hw_info *hw_info, struct qtnf_wmac *mac)
 	wiphy->retry_short = macinfo->sretry_limit;
 	wiphy->retry_long = macinfo->lretry_limit;
 	wiphy->coverage_class = macinfo->coverage_class;
+	wiphy->ampdu_enabled = macinfo->ampdu_enabled;
+	wiphy->amsdu_enabled = macinfo->amsdu_enabled;
 
 	wiphy->max_scan_ssids =
 		(hw_info->max_scan_ssids) ? hw_info->max_scan_ssids : 1;
diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.c b/drivers/net/wireless/quantenna/qtnfmac/commands.c
index bfdc1ad30c13..6ab0a25b917f 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/commands.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c
@@ -1531,6 +1531,7 @@ static int qtnf_cmd_resp_proc_phy_params(struct qtnf_wmac *mac,
 	struct qlink_tlv_frag_rts_thr *phy_thr;
 	struct qlink_tlv_rlimit *limit;
 	struct qlink_tlv_cclass *class;
+	struct qlink_tlv_aggr *aggr;
 	u16 tlv_type;
 	u16 tlv_value_len;
 	size_t tlv_full_len;
@@ -1571,6 +1572,14 @@ static int qtnf_cmd_resp_proc_phy_params(struct qtnf_wmac *mac,
 			class = (void *)tlv;
 			mac_info->coverage_class = class->cclass;
 			break;
+		case QTN_TLV_ID_AMPDU_ENABLED:
+			aggr = (void *)tlv;
+			mac_info->ampdu_enabled = aggr->aggr;
+			break;
+		case QTN_TLV_ID_AMSDU_ENABLED:
+			aggr = (void *)tlv;
+			mac_info->amsdu_enabled = aggr->aggr;
+			break;
 		default:
 			pr_err("MAC%u: Unknown TLV type: %#x\n", mac->macid,
 			       le16_to_cpu(tlv->type));
@@ -1814,6 +1823,14 @@ int qtnf_cmd_send_update_phy_params(struct qtnf_wmac *mac, u32 changed)
 		qtnf_cmd_skb_put_tlv_u8(cmd_skb, QTN_TLV_ID_COVERAGE_CLASS,
 					wiphy->coverage_class);
 
+	if (changed & WIPHY_PARAM_AMPDU_ENABLED)
+		qtnf_cmd_skb_put_tlv_u8(cmd_skb, QTN_TLV_ID_AMPDU_ENABLED,
+					wiphy->ampdu_enabled);
+
+	if (changed & WIPHY_PARAM_AMSDU_ENABLED)
+		qtnf_cmd_skb_put_tlv_u8(cmd_skb, QTN_TLV_ID_AMSDU_ENABLED,
+					wiphy->amsdu_enabled);
+
 	ret = qtnf_cmd_send(mac->bus, cmd_skb);
 	if (ret)
 		goto out;
diff --git a/drivers/net/wireless/quantenna/qtnfmac/core.h b/drivers/net/wireless/quantenna/qtnfmac/core.h
index 293055049caa..e6752faf0f50 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/core.h
+++ b/drivers/net/wireless/quantenna/qtnfmac/core.h
@@ -94,6 +94,8 @@ struct qtnf_mac_info {
 	u8 lretry_limit;
 	u8 sretry_limit;
 	u8 coverage_class;
+	u8 amsdu_enabled;
+	u8 ampdu_enabled;
 	u8 radar_detect_widths;
 	u32 max_acl_mac_addrs;
 	struct ieee80211_ht_cap ht_cap_mod_mask;
diff --git a/drivers/net/wireless/quantenna/qtnfmac/qlink.h b/drivers/net/wireless/quantenna/qtnfmac/qlink.h
index 8d62addea895..7dede44c75d7 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/qlink.h
+++ b/drivers/net/wireless/quantenna/qtnfmac/qlink.h
@@ -1154,6 +1154,8 @@ enum qlink_tlv_id {
 	QTN_TLV_ID_WOWLAN_PATTERN	= 0x0411,
 	QTN_TLV_ID_SCAN_FLUSH		= 0x0412,
 	QTN_TLV_ID_SCAN_DWELL		= 0x0413,
+	QTN_TLV_ID_AMPDU_ENABLED	= 0x0414,
+	QTN_TLV_ID_AMSDU_ENABLED	= 0x0415,
 };
 
 struct qlink_tlv_hdr {
@@ -1195,6 +1197,11 @@ struct qlink_tlv_cclass {
 	u8 cclass;
 } __packed;
 
+struct qlink_tlv_aggr {
+	struct qlink_tlv_hdr hdr;
+	u8 aggr;
+} __packed;
+
 /**
  * enum qlink_reg_rule_flags - regulatory rule flags
  *
-- 
2.11.0





[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux