* [PATCH 1/2] mt76: mt7615: fix TSF configuration
@ 2021-02-23 8:43 ` Ryder Lee
0 siblings, 0 replies; 3+ messages in thread
From: Ryder Lee @ 2021-02-23 8:43 UTC (permalink / raw)
To: Felix Fietkau, Lorenzo Bianconi
Cc: linux-mediatek, Ryder Lee, linux-wireless, Shayne Chen
The index of TSF counters should follow HWBSSID.
Fixes: cd795267612d ("mt76: mt7615: support 16 interfaces")
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
---
drivers/net/wireless/mediatek/mt76/mt7615/mac.c | 6 +++++-
drivers/net/wireless/mediatek/mt76/mt7615/main.c | 16 ++++++++++++++--
drivers/net/wireless/mediatek/mt76/mt7615/regs.h | 7 ++++---
.../net/wireless/mediatek/mt76/mt7615/usb_sdio.c | 6 +++++-
4 files changed, 28 insertions(+), 7 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
index f2dd56674acb..df2dc77a323a 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
@@ -1005,6 +1005,7 @@ void mt7615_mac_set_rates(struct mt7615_phy *phy, struct mt7615_sta *sta,
struct mt7615_dev *dev = phy->dev;
struct mt7615_rate_desc rd;
u32 w5, w27, addr;
+ u16 idx = sta->vif->mt76.omac_idx;
if (!mt76_is_mmio(&dev->mt76)) {
mt7615_mac_queue_rate_update(phy, sta, probe_rate, rates);
@@ -1056,7 +1057,10 @@ void mt7615_mac_set_rates(struct mt7615_phy *phy, struct mt7615_sta *sta,
mt76_wr(dev, addr + 27 * 4, w27);
- mt76_set(dev, MT_LPON_T0CR, MT_LPON_T0CR_MODE); /* TSF read */
+ idx = idx > HW_BSSID_MAX ? HW_BSSID_0 : idx;
+ addr = idx > 1 ? MT_LPON_TCR2(idx): MT_LPON_TCR0(idx);
+
+ mt76_set(dev, addr, MT_LPON_TCR_MODE); /* TSF read */
sta->rate_set_tsf = mt76_rr(dev, MT_LPON_UTTR0) & ~BIT(0);
sta->rate_set_tsf |= rd.rateset;
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/main.c b/drivers/net/wireless/mediatek/mt76/mt7615/main.c
index 1cf40f85eb55..68accb37ea28 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/main.c
@@ -818,15 +818,21 @@ mt7615_get_stats(struct ieee80211_hw *hw,
static u64
mt7615_get_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
{
+ struct mt7615_vif *mvif = (struct mt7615_vif *)vif->drv_priv;
struct mt7615_dev *dev = mt7615_hw_dev(hw);
union {
u64 t64;
u32 t32[2];
} tsf;
+ u16 idx = mvif->mt76.omac_idx;
+ u32 reg;
+
+ idx = idx > HW_BSSID_MAX ? HW_BSSID_0 : idx;
+ reg = idx > 1 ? MT_LPON_TCR2(idx): MT_LPON_TCR0(idx);
mt7615_mutex_acquire(dev);
- mt76_set(dev, MT_LPON_T0CR, MT_LPON_T0CR_MODE); /* TSF read */
+ mt76_set(dev, reg, MT_LPON_TCR_MODE); /* TSF read */
tsf.t32[0] = mt76_rr(dev, MT_LPON_UTTR0);
tsf.t32[1] = mt76_rr(dev, MT_LPON_UTTR1);
@@ -839,18 +845,24 @@ static void
mt7615_set_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
u64 timestamp)
{
+ struct mt7615_vif *mvif = (struct mt7615_vif *)vif->drv_priv;
struct mt7615_dev *dev = mt7615_hw_dev(hw);
union {
u64 t64;
u32 t32[2];
} tsf = { .t64 = timestamp, };
+ u16 idx = mvif->mt76.omac_idx;
+ u32 reg;
+
+ idx = idx > HW_BSSID_MAX ? HW_BSSID_0 : idx;
+ reg = idx > 1 ? MT_LPON_TCR2(idx): MT_LPON_TCR0(idx);
mt7615_mutex_acquire(dev);
mt76_wr(dev, MT_LPON_UTTR0, tsf.t32[0]);
mt76_wr(dev, MT_LPON_UTTR1, tsf.t32[1]);
/* TSF software overwrite */
- mt76_set(dev, MT_LPON_T0CR, MT_LPON_T0CR_WRITE);
+ mt76_set(dev, reg, MT_LPON_TCR_WRITE);
mt7615_mutex_release(dev);
}
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/regs.h b/drivers/net/wireless/mediatek/mt76/mt7615/regs.h
index 1fd7f183629e..190a02670795 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/regs.h
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/regs.h
@@ -449,9 +449,10 @@ enum mt7615_reg_base {
#define MT_LPON(_n) ((dev)->reg_map[MT_LPON_BASE] + (_n))
-#define MT_LPON_T0CR MT_LPON(0x010)
-#define MT_LPON_T0CR_MODE GENMASK(1, 0)
-#define MT_LPON_T0CR_WRITE BIT(0)
+#define MT_LPON_TCR0(_n) MT_LPON(0x010 + ((_n) * 4))
+#define MT_LPON_TCR2(_n) MT_LPON(0x0f8 + ((_n) - 2) * 4)
+#define MT_LPON_TCR_MODE GENMASK(1, 0)
+#define MT_LPON_TCR_WRITE BIT(0)
#define MT_LPON_UTTR0 MT_LPON(0x018)
#define MT_LPON_UTTR1 MT_LPON(0x01c)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/usb_sdio.c b/drivers/net/wireless/mediatek/mt76/mt7615/usb_sdio.c
index 203256862dfd..4a370b9f7a17 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/usb_sdio.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/usb_sdio.c
@@ -67,6 +67,7 @@ static int mt7663_usb_sdio_set_rates(struct mt7615_dev *dev,
struct mt7615_rate_desc *rate = &wrd->rate;
struct mt7615_sta *sta = wrd->sta;
u32 w5, w27, addr, val;
+ u16 idx = sta->vif->mt76.omac_idx;
lockdep_assert_held(&dev->mt76.mutex);
@@ -118,7 +119,10 @@ static int mt7663_usb_sdio_set_rates(struct mt7615_dev *dev,
sta->rate_probe = sta->rateset[rate->rateset].probe_rate.idx != -1;
- mt76_set(dev, MT_LPON_T0CR, MT_LPON_T0CR_MODE); /* TSF read */
+ idx = idx > HW_BSSID_MAX ? HW_BSSID_0 : idx;
+ addr = idx > 1 ? MT_LPON_TCR2(idx): MT_LPON_TCR0(idx);
+
+ mt76_set(dev, addr, MT_LPON_TCR_MODE); /* TSF read */
val = mt76_rr(dev, MT_LPON_UTTR0);
sta->rate_set_tsf = (val & ~BIT(0)) | rate->rateset;
--
2.18.0
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 1/2] mt76: mt7615: fix TSF configuration
@ 2021-02-23 8:43 ` Ryder Lee
0 siblings, 0 replies; 3+ messages in thread
From: Ryder Lee @ 2021-02-23 8:43 UTC (permalink / raw)
To: Felix Fietkau, Lorenzo Bianconi
Cc: Shayne Chen, linux-wireless, linux-mediatek, Ryder Lee
The index of TSF counters should follow HWBSSID.
Fixes: cd795267612d ("mt76: mt7615: support 16 interfaces")
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
---
drivers/net/wireless/mediatek/mt76/mt7615/mac.c | 6 +++++-
drivers/net/wireless/mediatek/mt76/mt7615/main.c | 16 ++++++++++++++--
drivers/net/wireless/mediatek/mt76/mt7615/regs.h | 7 ++++---
.../net/wireless/mediatek/mt76/mt7615/usb_sdio.c | 6 +++++-
4 files changed, 28 insertions(+), 7 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
index f2dd56674acb..df2dc77a323a 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
@@ -1005,6 +1005,7 @@ void mt7615_mac_set_rates(struct mt7615_phy *phy, struct mt7615_sta *sta,
struct mt7615_dev *dev = phy->dev;
struct mt7615_rate_desc rd;
u32 w5, w27, addr;
+ u16 idx = sta->vif->mt76.omac_idx;
if (!mt76_is_mmio(&dev->mt76)) {
mt7615_mac_queue_rate_update(phy, sta, probe_rate, rates);
@@ -1056,7 +1057,10 @@ void mt7615_mac_set_rates(struct mt7615_phy *phy, struct mt7615_sta *sta,
mt76_wr(dev, addr + 27 * 4, w27);
- mt76_set(dev, MT_LPON_T0CR, MT_LPON_T0CR_MODE); /* TSF read */
+ idx = idx > HW_BSSID_MAX ? HW_BSSID_0 : idx;
+ addr = idx > 1 ? MT_LPON_TCR2(idx): MT_LPON_TCR0(idx);
+
+ mt76_set(dev, addr, MT_LPON_TCR_MODE); /* TSF read */
sta->rate_set_tsf = mt76_rr(dev, MT_LPON_UTTR0) & ~BIT(0);
sta->rate_set_tsf |= rd.rateset;
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/main.c b/drivers/net/wireless/mediatek/mt76/mt7615/main.c
index 1cf40f85eb55..68accb37ea28 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/main.c
@@ -818,15 +818,21 @@ mt7615_get_stats(struct ieee80211_hw *hw,
static u64
mt7615_get_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
{
+ struct mt7615_vif *mvif = (struct mt7615_vif *)vif->drv_priv;
struct mt7615_dev *dev = mt7615_hw_dev(hw);
union {
u64 t64;
u32 t32[2];
} tsf;
+ u16 idx = mvif->mt76.omac_idx;
+ u32 reg;
+
+ idx = idx > HW_BSSID_MAX ? HW_BSSID_0 : idx;
+ reg = idx > 1 ? MT_LPON_TCR2(idx): MT_LPON_TCR0(idx);
mt7615_mutex_acquire(dev);
- mt76_set(dev, MT_LPON_T0CR, MT_LPON_T0CR_MODE); /* TSF read */
+ mt76_set(dev, reg, MT_LPON_TCR_MODE); /* TSF read */
tsf.t32[0] = mt76_rr(dev, MT_LPON_UTTR0);
tsf.t32[1] = mt76_rr(dev, MT_LPON_UTTR1);
@@ -839,18 +845,24 @@ static void
mt7615_set_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
u64 timestamp)
{
+ struct mt7615_vif *mvif = (struct mt7615_vif *)vif->drv_priv;
struct mt7615_dev *dev = mt7615_hw_dev(hw);
union {
u64 t64;
u32 t32[2];
} tsf = { .t64 = timestamp, };
+ u16 idx = mvif->mt76.omac_idx;
+ u32 reg;
+
+ idx = idx > HW_BSSID_MAX ? HW_BSSID_0 : idx;
+ reg = idx > 1 ? MT_LPON_TCR2(idx): MT_LPON_TCR0(idx);
mt7615_mutex_acquire(dev);
mt76_wr(dev, MT_LPON_UTTR0, tsf.t32[0]);
mt76_wr(dev, MT_LPON_UTTR1, tsf.t32[1]);
/* TSF software overwrite */
- mt76_set(dev, MT_LPON_T0CR, MT_LPON_T0CR_WRITE);
+ mt76_set(dev, reg, MT_LPON_TCR_WRITE);
mt7615_mutex_release(dev);
}
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/regs.h b/drivers/net/wireless/mediatek/mt76/mt7615/regs.h
index 1fd7f183629e..190a02670795 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/regs.h
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/regs.h
@@ -449,9 +449,10 @@ enum mt7615_reg_base {
#define MT_LPON(_n) ((dev)->reg_map[MT_LPON_BASE] + (_n))
-#define MT_LPON_T0CR MT_LPON(0x010)
-#define MT_LPON_T0CR_MODE GENMASK(1, 0)
-#define MT_LPON_T0CR_WRITE BIT(0)
+#define MT_LPON_TCR0(_n) MT_LPON(0x010 + ((_n) * 4))
+#define MT_LPON_TCR2(_n) MT_LPON(0x0f8 + ((_n) - 2) * 4)
+#define MT_LPON_TCR_MODE GENMASK(1, 0)
+#define MT_LPON_TCR_WRITE BIT(0)
#define MT_LPON_UTTR0 MT_LPON(0x018)
#define MT_LPON_UTTR1 MT_LPON(0x01c)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/usb_sdio.c b/drivers/net/wireless/mediatek/mt76/mt7615/usb_sdio.c
index 203256862dfd..4a370b9f7a17 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/usb_sdio.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/usb_sdio.c
@@ -67,6 +67,7 @@ static int mt7663_usb_sdio_set_rates(struct mt7615_dev *dev,
struct mt7615_rate_desc *rate = &wrd->rate;
struct mt7615_sta *sta = wrd->sta;
u32 w5, w27, addr, val;
+ u16 idx = sta->vif->mt76.omac_idx;
lockdep_assert_held(&dev->mt76.mutex);
@@ -118,7 +119,10 @@ static int mt7663_usb_sdio_set_rates(struct mt7615_dev *dev,
sta->rate_probe = sta->rateset[rate->rateset].probe_rate.idx != -1;
- mt76_set(dev, MT_LPON_T0CR, MT_LPON_T0CR_MODE); /* TSF read */
+ idx = idx > HW_BSSID_MAX ? HW_BSSID_0 : idx;
+ addr = idx > 1 ? MT_LPON_TCR2(idx): MT_LPON_TCR0(idx);
+
+ mt76_set(dev, addr, MT_LPON_TCR_MODE); /* TSF read */
val = mt76_rr(dev, MT_LPON_UTTR0);
sta->rate_set_tsf = (val & ~BIT(0)) | rate->rateset;
--
2.18.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] mt76: mt7615: fix TSF configuration
@ 2021-03-04 6:08 kernel test robot
0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2021-03-04 6:08 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 7851 bytes --]
CC: kbuild-all(a)lists.01.org
In-Reply-To: <61d40a20375f888c122ee0e186168fc2db863fc3.1614058187.git.ryder.lee@mediatek.com>
References: <61d40a20375f888c122ee0e186168fc2db863fc3.1614058187.git.ryder.lee@mediatek.com>
TO: Ryder Lee <ryder.lee@mediatek.com>
TO: Felix Fietkau <nbd@nbd.name>
TO: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
CC: Shayne Chen <shayne.chen@mediatek.com>
CC: linux-wireless(a)vger.kernel.org
CC: linux-mediatek(a)lists.infradead.org
CC: Ryder Lee <ryder.lee@mediatek.com>
Hi Ryder,
I love your patch! Perhaps something to improve:
[auto build test WARNING on wireless-drivers-next/master]
[also build test WARNING on wireless-drivers/master v5.12-rc1 next-20210303]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Ryder-Lee/mt76-mt7615-fix-TSF-configuration/20210223-164744
base: https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git master
:::::: branch date: 9 days ago
:::::: commit date: 9 days ago
config: x86_64-randconfig-m001-20210304 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch warnings:
drivers/net/wireless/mediatek/mt76/mt7615/usb_sdio.c:74 mt7663_usb_sdio_set_rates() warn: variable dereferenced before check 'sta' (see line 70)
vim +/sta +74 drivers/net/wireless/mediatek/mt76/mt7615/usb_sdio.c
90520afbae5f01 Lorenzo Bianconi 2020-07-15 63
d927ebb99d0895 Lorenzo Bianconi 2020-11-08 64 static int mt7663_usb_sdio_set_rates(struct mt7615_dev *dev,
d927ebb99d0895 Lorenzo Bianconi 2020-11-08 65 struct mt7615_wtbl_rate_desc *wrd)
90520afbae5f01 Lorenzo Bianconi 2020-07-15 66 {
d927ebb99d0895 Lorenzo Bianconi 2020-11-08 67 struct mt7615_rate_desc *rate = &wrd->rate;
d927ebb99d0895 Lorenzo Bianconi 2020-11-08 68 struct mt7615_sta *sta = wrd->sta;
90520afbae5f01 Lorenzo Bianconi 2020-07-15 69 u32 w5, w27, addr, val;
c0d89d743c2783 Ryder Lee 2021-02-23 @70 u16 idx = sta->vif->mt76.omac_idx;
90520afbae5f01 Lorenzo Bianconi 2020-07-15 71
90520afbae5f01 Lorenzo Bianconi 2020-07-15 72 lockdep_assert_held(&dev->mt76.mutex);
90520afbae5f01 Lorenzo Bianconi 2020-07-15 73
90520afbae5f01 Lorenzo Bianconi 2020-07-15 @74 if (!sta)
90520afbae5f01 Lorenzo Bianconi 2020-07-15 75 return -EINVAL;
90520afbae5f01 Lorenzo Bianconi 2020-07-15 76
90520afbae5f01 Lorenzo Bianconi 2020-07-15 77 if (!mt76_poll(dev, MT_WTBL_UPDATE, MT_WTBL_UPDATE_BUSY, 0, 5000))
90520afbae5f01 Lorenzo Bianconi 2020-07-15 78 return -ETIMEDOUT;
90520afbae5f01 Lorenzo Bianconi 2020-07-15 79
90520afbae5f01 Lorenzo Bianconi 2020-07-15 80 addr = mt7615_mac_wtbl_addr(dev, sta->wcid.idx);
90520afbae5f01 Lorenzo Bianconi 2020-07-15 81
90520afbae5f01 Lorenzo Bianconi 2020-07-15 82 w27 = mt76_rr(dev, addr + 27 * 4);
90520afbae5f01 Lorenzo Bianconi 2020-07-15 83 w27 &= ~MT_WTBL_W27_CC_BW_SEL;
90520afbae5f01 Lorenzo Bianconi 2020-07-15 84 w27 |= FIELD_PREP(MT_WTBL_W27_CC_BW_SEL, rate->bw);
90520afbae5f01 Lorenzo Bianconi 2020-07-15 85
90520afbae5f01 Lorenzo Bianconi 2020-07-15 86 w5 = mt76_rr(dev, addr + 5 * 4);
90520afbae5f01 Lorenzo Bianconi 2020-07-15 87 w5 &= ~(MT_WTBL_W5_BW_CAP | MT_WTBL_W5_CHANGE_BW_RATE |
90520afbae5f01 Lorenzo Bianconi 2020-07-15 88 MT_WTBL_W5_MPDU_OK_COUNT |
90520afbae5f01 Lorenzo Bianconi 2020-07-15 89 MT_WTBL_W5_MPDU_FAIL_COUNT |
90520afbae5f01 Lorenzo Bianconi 2020-07-15 90 MT_WTBL_W5_RATE_IDX);
90520afbae5f01 Lorenzo Bianconi 2020-07-15 91 w5 |= FIELD_PREP(MT_WTBL_W5_BW_CAP, rate->bw) |
90520afbae5f01 Lorenzo Bianconi 2020-07-15 92 FIELD_PREP(MT_WTBL_W5_CHANGE_BW_RATE,
90520afbae5f01 Lorenzo Bianconi 2020-07-15 93 rate->bw_idx ? rate->bw_idx - 1 : 7);
90520afbae5f01 Lorenzo Bianconi 2020-07-15 94
90520afbae5f01 Lorenzo Bianconi 2020-07-15 95 mt76_wr(dev, MT_WTBL_RIUCR0, w5);
90520afbae5f01 Lorenzo Bianconi 2020-07-15 96
90520afbae5f01 Lorenzo Bianconi 2020-07-15 97 mt76_wr(dev, MT_WTBL_RIUCR1,
90520afbae5f01 Lorenzo Bianconi 2020-07-15 98 FIELD_PREP(MT_WTBL_RIUCR1_RATE0, rate->probe_val) |
90520afbae5f01 Lorenzo Bianconi 2020-07-15 99 FIELD_PREP(MT_WTBL_RIUCR1_RATE1, rate->val[0]) |
90520afbae5f01 Lorenzo Bianconi 2020-07-15 100 FIELD_PREP(MT_WTBL_RIUCR1_RATE2_LO, rate->val[1]));
90520afbae5f01 Lorenzo Bianconi 2020-07-15 101
90520afbae5f01 Lorenzo Bianconi 2020-07-15 102 mt76_wr(dev, MT_WTBL_RIUCR2,
90520afbae5f01 Lorenzo Bianconi 2020-07-15 103 FIELD_PREP(MT_WTBL_RIUCR2_RATE2_HI, rate->val[1] >> 8) |
90520afbae5f01 Lorenzo Bianconi 2020-07-15 104 FIELD_PREP(MT_WTBL_RIUCR2_RATE3, rate->val[1]) |
90520afbae5f01 Lorenzo Bianconi 2020-07-15 105 FIELD_PREP(MT_WTBL_RIUCR2_RATE4, rate->val[2]) |
90520afbae5f01 Lorenzo Bianconi 2020-07-15 106 FIELD_PREP(MT_WTBL_RIUCR2_RATE5_LO, rate->val[2]));
90520afbae5f01 Lorenzo Bianconi 2020-07-15 107
90520afbae5f01 Lorenzo Bianconi 2020-07-15 108 mt76_wr(dev, MT_WTBL_RIUCR3,
90520afbae5f01 Lorenzo Bianconi 2020-07-15 109 FIELD_PREP(MT_WTBL_RIUCR3_RATE5_HI, rate->val[2] >> 4) |
90520afbae5f01 Lorenzo Bianconi 2020-07-15 110 FIELD_PREP(MT_WTBL_RIUCR3_RATE6, rate->val[3]) |
90520afbae5f01 Lorenzo Bianconi 2020-07-15 111 FIELD_PREP(MT_WTBL_RIUCR3_RATE7, rate->val[3]));
90520afbae5f01 Lorenzo Bianconi 2020-07-15 112
90520afbae5f01 Lorenzo Bianconi 2020-07-15 113 mt76_wr(dev, MT_WTBL_UPDATE,
90520afbae5f01 Lorenzo Bianconi 2020-07-15 114 FIELD_PREP(MT_WTBL_UPDATE_WLAN_IDX, sta->wcid.idx) |
90520afbae5f01 Lorenzo Bianconi 2020-07-15 115 MT_WTBL_UPDATE_RATE_UPDATE |
90520afbae5f01 Lorenzo Bianconi 2020-07-15 116 MT_WTBL_UPDATE_TX_COUNT_CLEAR);
90520afbae5f01 Lorenzo Bianconi 2020-07-15 117
90520afbae5f01 Lorenzo Bianconi 2020-07-15 118 mt76_wr(dev, addr + 27 * 4, w27);
90520afbae5f01 Lorenzo Bianconi 2020-07-15 119
90520afbae5f01 Lorenzo Bianconi 2020-07-15 120 sta->rate_probe = sta->rateset[rate->rateset].probe_rate.idx != -1;
90520afbae5f01 Lorenzo Bianconi 2020-07-15 121
c0d89d743c2783 Ryder Lee 2021-02-23 122 idx = idx > HW_BSSID_MAX ? HW_BSSID_0 : idx;
c0d89d743c2783 Ryder Lee 2021-02-23 123 addr = idx > 1 ? MT_LPON_TCR2(idx): MT_LPON_TCR0(idx);
c0d89d743c2783 Ryder Lee 2021-02-23 124
c0d89d743c2783 Ryder Lee 2021-02-23 125 mt76_set(dev, addr, MT_LPON_TCR_MODE); /* TSF read */
90520afbae5f01 Lorenzo Bianconi 2020-07-15 126 val = mt76_rr(dev, MT_LPON_UTTR0);
90520afbae5f01 Lorenzo Bianconi 2020-07-15 127 sta->rate_set_tsf = (val & ~BIT(0)) | rate->rateset;
90520afbae5f01 Lorenzo Bianconi 2020-07-15 128
90520afbae5f01 Lorenzo Bianconi 2020-07-15 129 if (!(sta->wcid.tx_info & MT_WCID_TX_INFO_SET))
90520afbae5f01 Lorenzo Bianconi 2020-07-15 130 mt76_poll(dev, MT_WTBL_UPDATE, MT_WTBL_UPDATE_BUSY, 0, 5000);
90520afbae5f01 Lorenzo Bianconi 2020-07-15 131
90520afbae5f01 Lorenzo Bianconi 2020-07-15 132 sta->rate_count = 2 * MT7615_RATE_RETRY * sta->n_rates;
90520afbae5f01 Lorenzo Bianconi 2020-07-15 133 sta->wcid.tx_info |= MT_WCID_TX_INFO_SET;
90520afbae5f01 Lorenzo Bianconi 2020-07-15 134
90520afbae5f01 Lorenzo Bianconi 2020-07-15 135 return 0;
90520afbae5f01 Lorenzo Bianconi 2020-07-15 136 }
90520afbae5f01 Lorenzo Bianconi 2020-07-15 137
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 33737 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-03-04 6:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-04 6:08 [PATCH 1/2] mt76: mt7615: fix TSF configuration kernel test robot
-- strict thread matches above, loose matches on Subject: below --
2021-02-23 8:43 Ryder Lee
2021-02-23 8:43 ` Ryder Lee
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.