Skip to contentSkip to conversation

Feed current txrate information for mac80211

PATCH In review Chris Chiu 2 participants 4 messages Mar 20, 2020 – Mar 26, 2020

Subsystems (3)
lore
Share & tools
lore

Chris Chiu

author
#0 lore raw

v2 cover Feed current txrate information for mac80211

This patchset fills the txrate, sgi, bandwidth information in the sta_statistics function. Then the nl80211 commands such as 'iw link' can show the correct txrate information.

v2: make the rtl8xxxu_desc_to_mcsrate() static

Chris Chiu (2):
rtl8xxxu: add enumeration for channel bandwidth
rtl8xxxu: Feed current txrate information for mac80211

 .../net/wireless/realtek/rtl8xxxu/rtl8xxxu.h  | 21 ++++-
 .../wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 77 ++++++++++++++++++-
 2 files changed, 95 insertions(+), 3 deletions(-)
Signature · 1 line
2.20.1
author
#1 lore raw

PATCH v2 1/2 rtl8xxxu: add enumeration for channel bandwidth

There's a data field in H2C and C2H commands which is used to carry channel bandwidth information. Add enumeration to make it more descriptive in code.

---

Note:
v2: no change

 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h      | 9 +++++++++
 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 2 +-
 2 files changed, 10 insertions(+), 1 deletion(-)
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h +9 -0
index 6598c8d786ea..86d1d50511a8 100644
@@ -1133,6 +1133,15 @@ enum bt_mp_oper_opcode_8723b {
 	BT_MP_OP_ENABLE_CFO_TRACKING = 0x24,
 };
 
+enum rtl8xxxu_bw_mode {
+	RTL8XXXU_CHANNEL_WIDTH_20 = 0,
+	RTL8XXXU_CHANNEL_WIDTH_40 = 1,
+	RTL8XXXU_CHANNEL_WIDTH_80 = 2,
+	RTL8XXXU_CHANNEL_WIDTH_160 = 3,
+	RTL8XXXU_CHANNEL_WIDTH_80_80 = 4,
+	RTL8XXXU_CHANNEL_WIDTH_MAX = 5,
+};
+
 struct rtl8723bu_c2h {
 	u8 id;
 	u8 seq;
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +1 -1
index daa6ce14c68b..c334418cd7ae 100644
@@ -4328,7 +4328,7 @@ void rtl8xxxu_gen2_update_rate_mask(struct rtl8xxxu_priv *priv,
 				    u32 ramask, u8 rateid, int sgi)
 {
 	struct h2c_cmd h2c;
-	u8 bw = 0;
+	u8 bw = RTL8XXXU_CHANNEL_WIDTH_20;
 
 	memset(&h2c, 0, sizeof(struct h2c_cmd));
 
Signature · 1 line
2.20.1
#2 lore raw

Re: [PATCH v2 1/2] rtl8xxxu: add enumeration for channel bandwidth

Quoted 5 lines · Chris Chiu

There's a data field in H2C and C2H commands which is used to carry channel bandwidth information. Add enumeration to make it more descriptive in code.

2 patches applied to wireless-drivers-next.git, thanks.

a66b8b4108f1 rtl8xxxu: add enumeration for channel bandwidth 0985d3a410ac rtl8xxxu: Feed current txrate information for mac80211

Signature · 3 lines
https://patchwork.kernel.org/patch/11448459/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
author
#3 lore raw

PATCH v2 2/2 rtl8xxxu: Feed current txrate information for mac80211

In reply to Chris Chiu

The nl80211 commands such as 'iw link' can't get current txrate information from the driver. This commit fills in the tx rate information from the C2H RA report in the sta_statistics function.

---

Note:
v2: Make the rtl8xxxu_desc_to_mcsrate() static

 .../net/wireless/realtek/rtl8xxxu/rtl8xxxu.h  | 12 ++-
 .../wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 75 ++++++++++++++++++-
 2 files changed, 85 insertions(+), 2 deletions(-)
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h +11 -1
index 86d1d50511a8..e6fd1ecaca9c 100644
@@ -1183,13 +1183,16 @@ struct rtl8723bu_c2h {
 		} __packed bt_info;
 		struct {
 			u8 rate:7;
-			u8 dummy0_0:1;
+			u8 sgi:1;
 			u8 macid;
 			u8 ldpc:1;
 			u8 txbf:1;
 			u8 noisy_state:1;
 			u8 dummy2_0:5;
 			u8 dummy3_0;
+			u8 dummy4_0;
+			u8 dummy5_0;
+			u8 bw;
 		} __packed ra_report;
 	};
 };
@@ -1269,6 +1272,12 @@ struct rtl8xxxu_btcoex {
 #define RTL8XXXU_SNR_THRESH_HIGH	50
 #define RTL8XXXU_SNR_THRESH_LOW	20
 
+struct rtl8xxxu_ra_report {
+	struct rate_info txrate;
+	u32 bit_rate;
+	u8 desc_rate;
+};
+
 struct rtl8xxxu_priv {
 	struct ieee80211_hw *hw;
 	struct usb_device *udev;
@@ -1384,6 +1393,7 @@ struct rtl8xxxu_priv {
 	struct sk_buff_head c2hcmd_queue;
 	spinlock_t c2hcmd_lock;
 	struct rtl8xxxu_btcoex bt_coex;
+	struct rtl8xxxu_ra_report ra_report;
 };
 
 struct rtl8xxxu_rx_urb {
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +74 -1

114 lines not on this page · raw message

Signature · 1 line
2.20.1