Skip to contentSkip to conversation

mt76: add mt7916 to set wlan_idx_hi

PATCH In review Bo Jiao 3 participants 4 messages Dec 22, 2021 – Dec 24, 2021 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Bo Jiao

author
#1 lore raw

PATCH 1/1 mt76: add mt7916 to set wlan_idx_hi

From: Bo Jiao <[email protected]>

since mt7916 support up to 544 wcid entries,
add it to set wlan_idx_hi.

---
 drivers/net/wireless/mediatek/mt76/mt76_connac.h     | 5 +++++
 drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt76_connac.h +5 -0
index e999d71..8701f04 100644
@@ -110,6 +110,11 @@ static inline bool is_mt7915(struct mt76_dev *dev)
 	return mt76_chip(dev) == 0x7915;
 }
 
+static inline bool is_mt7916(struct mt76_dev *dev)
+{
+	return mt76_chip(dev) == 0x7906;
+}
+
 static inline u8 mt76_connac_chan_bw(struct cfg80211_chan_def *chandef)
 {
 	static const u8 width_to_bw[] = {
drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h +1 -1
index edad583..fc9a084 100644
@@ -1464,7 +1464,7 @@ mt76_connac_mcu_get_wlan_idx(struct mt76_dev *dev, struct mt76_wcid *wcid,
 {
 	*wlan_idx_hi = 0;
 
-	if (is_mt7921(dev) || is_mt7915(dev)) {
+	if (is_mt7921(dev) || is_mt7915(dev) || is_mt7916(dev)) {
 		*wlan_idx_lo = wcid ? to_wcid_lo(wcid->idx) : 0;
 		*wlan_idx_hi = wcid ? to_wcid_hi(wcid->idx) : 0;
 	} else {
Signature · 1 line
2.18.0
maintainer
#2 lore raw
Quoted 33 lines

From: Bo Jiao <[email protected]>

since mt7916 support up to 544 wcid entries,
add it to set wlan_idx_hi.

---
 drivers/net/wireless/mediatek/mt76/mt76_connac.h     | 5 +++++
 drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt76_connac.h +5 -0
index e999d71..8701f04 100644
@@ -110,6 +110,11 @@ static inline bool is_mt7915(struct mt76_dev *dev)
 	return mt76_chip(dev) == 0x7915;
 }
 
+static inline bool is_mt7916(struct mt76_dev *dev)
+{
+	return mt76_chip(dev) == 0x7906;
+}
+
 static inline u8 mt76_connac_chan_bw(struct cfg80211_chan_def *chandef)
 {
 	static const u8 width_to_bw[] = {
drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h +0 -0
index edad583..fc9a084 100644

drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h mt76_connac_mcu_get_wlan_idx(struct mt76_dev *dev, struct mt76_wcid *wcid, · line 1469

Quoted 7 lines
drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h +1 -1
@@ -1464,7 +1464,7 @@ mt76_connac_mcu_get_wlan_idx(struct mt76_dev *dev, struct mt76_wcid *wcid,
 {
 	*wlan_idx_hi = 0;
 
-	if (is_mt7921(dev) || is_mt7915(dev)) {
+	if (is_mt7921(dev) || is_mt7915(dev) || is_mt7916(dev)) {
 		*wlan_idx_lo = wcid ? to_wcid_lo(wcid->idx) : 0;
 		*wlan_idx_hi = wcid ? to_wcid_hi(wcid->idx) : 0;

I guess I have already included the fix here:
https://patchwork.kernel.org/project/linux-wireless/patch/df4d462f1ef4cfc1ae4f6482051a28a10c78262b.1640260901.git.lorenzo@kernel.org/

Regards,
Lorenzo

Quoted 4 lines
drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h +0 -0
 	} else {
Signature · 1 line
2.18.0
maintainer
#3 lore raw
Quoted 41 lines · Lorenzo Bianconi
Quoted 41 lines

From: Bo Jiao <[email protected]>

since mt7916 support up to 544 wcid entries,
add it to set wlan_idx_hi.

---
 drivers/net/wireless/mediatek/mt76/mt76_connac.h     | 5 +++++
 drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt76_connac.h +5 -0
index e999d71..8701f04 100644
@@ -110,6 +110,11 @@ static inline bool is_mt7915(struct mt76_dev
 *dev)
 	return mt76_chip(dev) == 0x7915;
 }
 
+static inline bool is_mt7916(struct mt76_dev *dev)
+{
+	return mt76_chip(dev) == 0x7906;
+}
+
 static inline u8 mt76_connac_chan_bw(struct cfg80211_chan_def
 *chandef)

{

drivers/net/wireless/mediatek/mt76/mt76_connac.h +0 -0
 	static const u8 width_to_bw[] = {
drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h +0 -0
index edad583..fc9a084 100644
@@ -1464,7 +1464,7 @@ mt76_connac_mcu_get_wlan_idx(struct mt76_dev
 *dev, struct mt76_wcid *wcid,
 {
 	*wlan_idx_hi = 0;
 
Quoted 7 lines

drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h mt76_connac_mcu_get_wlan_idx(struct mt76_dev *dev, struct mt76_wcid *wcid, · line 1469

Quoted 4 lines
drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h +1 -1
-	if (is_mt7921(dev) || is_mt7915(dev)) {
+	if (is_mt7921(dev) || is_mt7915(dev) || is_mt7916(dev)) {
 		*wlan_idx_lo = wcid ? to_wcid_lo(wcid->idx) : 0;
 		*wlan_idx_hi = wcid ? to_wcid_hi(wcid->idx) : 0;

I guess I have already included the fix here:

https://patchwork.kernel.org/project/linux-wireless/patch/df4d462f1ef4cfc1ae4f6482051a28a10c78262b.1640260901.git.lorenzo@kernel.org/

Quoted 4 lines

Regards,
Lorenzo

I think we can fold these patches together and use !is_connac_v1 instead so that we can avoid endless is_mtxxxx || ... || ...

Ryder

maintainer
#4 lore raw
Quoted 49 lines · Lorenzo Bianconi
Quoted 41 lines
Quoted 41 lines

From: Bo Jiao <[email protected]>

since mt7916 support up to 544 wcid entries,
add it to set wlan_idx_hi.

---
 drivers/net/wireless/mediatek/mt76/mt76_connac.h     | 5 +++++
 drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt76_connac.h +5 -0
index e999d71..8701f04 100644
@@ -110,6 +110,11 @@ static inline bool is_mt7915(struct mt76_dev
 *dev)
 	return mt76_chip(dev) == 0x7915;
 }
 
+static inline bool is_mt7916(struct mt76_dev *dev)
+{
+	return mt76_chip(dev) == 0x7906;
+}
+
 static inline u8 mt76_connac_chan_bw(struct cfg80211_chan_def
 *chandef)

{

drivers/net/wireless/mediatek/mt76/mt76_connac.h +0 -0
 	static const u8 width_to_bw[] = {
drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h +0 -0
index edad583..fc9a084 100644
@@ -1464,7 +1464,7 @@ mt76_connac_mcu_get_wlan_idx(struct mt76_dev
 *dev, struct mt76_wcid *wcid,
 {
 	*wlan_idx_hi = 0;
 
Quoted 7 lines

drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h mt76_connac_mcu_get_wlan_idx(struct mt76_dev *dev, struct mt76_wcid *wcid, · line 1469

Quoted 4 lines
drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h +1 -1
-	if (is_mt7921(dev) || is_mt7915(dev)) {
+	if (is_mt7921(dev) || is_mt7915(dev) || is_mt7916(dev)) {
 		*wlan_idx_lo = wcid ? to_wcid_lo(wcid->idx) : 0;
 		*wlan_idx_hi = wcid ? to_wcid_hi(wcid->idx) : 0;

I guess I have already included the fix here:

Quoted 8 lines

https://patchwork.kernel.org/project/linux-wireless/patch/df4d462f1ef4cfc1ae4f6482051a28a10c78262b.1640260901.git.lorenzo@kernel.org/

Quoted 4 lines

Regards,
Lorenzo

I think we can fold these patches together and use !is_connac_v1 instead so that we can avoid endless is_mtxxxx || ... || ...

yes, it is already in my tree and I will post it in the next series. @Felix: can you please ignore this patch?

Regards,
Lorenzo

Quoted 4 lines

Ryder