* pull-request: wireless-drivers 2019-04-30
From: Kalle Valo @ 2019-04-30 15:10 UTC (permalink / raw)
To: David Miller; +Cc: linux-wireless, netdev, linux-kernel
Hi Dave,
here's one more pull request to net tree for 5.1, more info below.
Also note that this pull conflicts with net-next. And I want to emphasie
that it's really net-next, so when you pull this to net tree it should
go without conflicts. Stephen reported the conflict here:
https://lkml.kernel.org/r/20190429115338.5decb50b@canb.auug.org.au
In iwlwifi oddly commit 154d4899e411 adds the IS_ERR_OR_NULL() in
wireless-drivers but commit c9af7528c331 removes the whole check in
wireless-drivers-next. The fix is easy, just drop the whole check for
mvmvif->dbgfs_dir in iwlwifi/mvm/debugfs-vif.c, it's unneeded anyway.
As usual, please let me know if you have any problems.
Kalle
The following changes since commit 614c70f35cd77a9af8e2ca841dcdb121cec3068f:
bnx2x: fix spelling mistake "dicline" -> "decline" (2019-04-15 17:23:09 -0700)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers.git tags/wireless-drivers-for-davem-2019-04-30
for you to fetch changes up to 7a0f8ad5ff6323dd8badfeb01d338db146569976:
Merge ath-current from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git (2019-04-29 19:33:33 +0300)
----------------------------------------------------------------
wireless-drivers fixes for 5.1
Third set of fixes for 5.1.
iwlwifi
* fix an oops when creating debugfs entries
* fix bug when trying to capture debugging info while in rfkill
* prevent potential uninitialized memory dumps into debugging logs
* fix some initialization parameters for AX210 devices
* fix an oops with non-MSIX devices
* fix an oops when we receive a packet with bogus lengths
* fix a bug that prevented 5350 devices from working
* fix a small merge damage from the previous series
mwifiex
* fig regression with resume on SDIO
ath10k
* fix locking problem with crashdump
* fix warnings during suspend and resume
----------------------------------------------------------------
Brian Norris (1):
ath10k: perform crash dump collection in workqueue
Douglas Anderson (1):
mwifiex: Make resume actually do something useful again on SDIO cards
Emmanuel Grumbach (1):
iwlwifi: fix driver operation for 5350
Greg Kroah-Hartman (1):
iwlwifi: mvm: properly check debugfs dentry before using it
Johannes Berg (1):
iwlwifi: mvm: don't attempt debug collection in rfkill
Kalle Valo (3):
Merge tag 'iwlwifi-for-kalle-2019-04-19' of git://git.kernel.org/.../iwlwifi/iwlwifi-fixes
Merge tag 'iwlwifi-for-kalle-2019-04-28' of git://git.kernel.org/.../iwlwifi/iwlwifi-fixes
Merge ath-current from git://git.kernel.org/.../kvalo/ath.git
Luca Coelho (2):
iwlwifi: mvm: check for length correctness in iwl_mvm_create_skb()
iwlwifi: mvm: fix merge damage in iwl_mvm_vif_dbgfs_register()
Rafael J. Wysocki (1):
ath10k: Drop WARN_ON()s that always trigger during system resume
Shahar S Matityahu (2):
iwlwifi: don't panic in error path on non-msix systems
iwlwifi: dbg_ini: check debug TLV type explicitly
Shaul Triebitz (1):
iwlwifi: cfg: use family 22560 based_params for AX210 family
drivers/net/wireless/ath/ath10k/ce.c | 2 +-
drivers/net/wireless/ath/ath10k/core.c | 1 +
drivers/net/wireless/ath/ath10k/core.h | 3 +++
drivers/net/wireless/ath/ath10k/coredump.c | 6 ++---
drivers/net/wireless/ath/ath10k/mac.c | 4 ++--
drivers/net/wireless/ath/ath10k/pci.c | 24 +++++++++++++++----
drivers/net/wireless/ath/ath10k/pci.h | 2 ++
drivers/net/wireless/intel/iwlwifi/cfg/22000.c | 2 +-
drivers/net/wireless/intel/iwlwifi/cfg/5000.c | 3 ++-
drivers/net/wireless/intel/iwlwifi/fw/file.h | 15 +++++++-----
drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c | 3 ++-
.../net/wireless/intel/iwlwifi/mvm/debugfs-vif.c | 3 +--
drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 4 +++-
drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 2 +-
drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 28 ++++++++++++++++++----
drivers/net/wireless/intel/iwlwifi/pcie/trans.c | 19 ++++++++++-----
drivers/net/wireless/marvell/mwifiex/sdio.c | 2 +-
17 files changed, 88 insertions(+), 35 deletions(-)
^ permalink raw reply
* Re: [PATCH] ath10k: add peer id check in ath10k_peer_find_by_id
From: Kalle Valo @ 2019-04-30 14:25 UTC (permalink / raw)
To: Wen Gong
Cc: Nicolas Boichat, Claire Chang, linux-wireless@vger.kernel.org,
ath10k@lists.infradead.org, Wen Gong
In-Reply-To: <7d528d143ae14de2a489c6986f71ac45@aptaiexm02f.ap.qualcomm.com>
Wen Gong <wgong@qti.qualcomm.com> writes:
>> -----Original Message-----
>> From: ath10k <ath10k-bounces@lists.infradead.org> On Behalf Of Kalle Valo
>> Sent: Tuesday, April 30, 2019 5:37 PM
>> To: Nicolas Boichat <drinkcat@chromium.org>
>> Cc: Claire Chang <tientzu@chromium.org>; linux-wireless@vger.kernel.org;
>> ath10k@lists.infradead.org; Wen Gong <wgong@codeaurora.org>
>> Subject: [EXT] Re: [PATCH] ath10k: add peer id check in
>> ath10k_peer_find_by_id
>> >> --- a/drivers/net/wireless/ath/ath10k/txrx.c
>> >> +++ b/drivers/net/wireless/ath/ath10k/txrx.c
>> >> @@ -157,6 +157,9 @@ struct ath10k_peer
>> *ath10k_peer_find_by_id(struct ath10k *ar, int peer_id)
>> >> {
>> >> struct ath10k_peer *peer;
>> >>
>> >> + if (peer_id >= sizeof(peer->peer_ids) * BITS_PER_BYTE)
>> >
>> > I'd use >= BITS_PER_TYPE(peer->peer_ids).
>>
>> Nice, I didn't know about that. Wen, please submit v2 using this.
>>
>> --
>> Kalle Valo
> Yes,
> I have send v2 yesterday:
> [PATCH v2] ath10k: add peer id check in ath10k_peer_find_by_id
Ok, I didn't notice that yet. But in general it's good practise to reply
to review comments and let the reviewer (and others) know if you agree
with the comment or not. For example, in this case you could have said
to Nicolas: "Ok, I'll send v2".
--
Kalle Valo
^ permalink raw reply
* [PATCH v3] mt76: add TX/RX antenna pattern capabilities
From: Ryder Lee @ 2019-04-30 13:55 UTC (permalink / raw)
To: Lorenzo Bianconi, Felix Fietkau
Cc: Roy Luo, YF Luo, Yiwei Chung, Sean Wang, linux-wireless,
linux-mediatek, linux-kernel, Ryder Lee
Announce antenna pattern cap to adapt PHY and baseband settings.
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
---
Changes since v3:
- Move these flags to common code.
Changes since v2:
- Add a prefix mt76 in the title.
---
drivers/net/wireless/mediatek/mt76/mac80211.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/wireless/mediatek/mt76/mac80211.c b/drivers/net/wireless/mediatek/mt76/mac80211.c
index 851caabbecda..26a336ef86c5 100644
--- a/drivers/net/wireless/mediatek/mt76/mac80211.c
+++ b/drivers/net/wireless/mediatek/mt76/mac80211.c
@@ -214,6 +214,8 @@ mt76_init_sband(struct mt76_dev *dev, struct mt76_sband *msband,
vht_cap->cap |= IEEE80211_VHT_CAP_RXLDPC |
IEEE80211_VHT_CAP_RXSTBC_1 |
IEEE80211_VHT_CAP_SHORT_GI_80 |
+ IEEE80211_VHT_CAP_RX_ANTENNA_PATTERN |
+ IEEE80211_VHT_CAP_TX_ANTENNA_PATTERN |
(3 << IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT);
return 0;
--
2.18.0
^ permalink raw reply related
* Re: [RFC/RFT 7/7] rt2800: do not enable watchdog by default
From: Kalle Valo @ 2019-04-30 13:25 UTC (permalink / raw)
To: Stanislaw Gruszka
Cc: linux-wireless, Tomislav Požega, Daniel Golle, Felix Fietkau,
Mathias Kresin
In-Reply-To: <1556535270-3551-8-git-send-email-sgruszka@redhat.com>
Stanislaw Gruszka <sgruszka@redhat.com> writes:
> Make watchdog disabled by default and add module parameter to enable it.
>
> User will have to create file in /etc/modprobe.d/ with
>
> options rt2800lib watchdog=1
>
> to enable the watchdog or load "rt2800lib watchdog=1" module manually
> before loading rt2800{soc,pci,usb} module.
>
> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
[...]
> +static bool modparam_watchdog;
> +module_param_named(watchdog, modparam_watchdog, bool, S_IRUGO);
> +MODULE_PARM_DESC(watchdog, "Enable watchdog.");
You could describe a bit more what this watchdog does and that it's in
driver (or at least I assume so).
--
Kalle Valo
^ permalink raw reply
* [PATCH v3 3/3] mt76: do not enable/disable pre_tbtt_tasklet in scan_start/scan_complete
From: Lorenzo Bianconi @ 2019-04-30 13:12 UTC (permalink / raw)
To: nbd; +Cc: lorenzo.bianconi, linux-wireless, sgruszka
In-Reply-To: <cover.1556629547.git.lorenzo@kernel.org>
Do not enable/disable pre_tbtt_tasklet tasklet in
mt76x02_sw_scan/mt76x02_sw_scan_complete since it is already done
setting the operating channel. Do run tbtt_tasklet while the device is
offchannel
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c | 3 +++
drivers/net/wireless/mediatek/mt76/mt76x02_usb_core.c | 3 +++
drivers/net/wireless/mediatek/mt76/mt76x02_util.c | 5 -----
3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c b/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c
index 8f899b8aa9fe..7b7163bc3b62 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c
@@ -30,6 +30,9 @@ static void mt76x02_pre_tbtt_tasklet(unsigned long arg)
struct sk_buff *skb;
int i;
+ if (mt76_hw(dev)->conf.flags & IEEE80211_CONF_OFFCHANNEL)
+ return;
+
mt76x02_resync_beacon_timer(dev);
ieee80211_iterate_active_interfaces_atomic(mt76_hw(dev),
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_usb_core.c b/drivers/net/wireless/mediatek/mt76/mt76x02_usb_core.c
index 5b6ac1b364e1..6b89f7eab26c 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x02_usb_core.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x02_usb_core.c
@@ -178,6 +178,9 @@ static void mt76x02u_pre_tbtt_work(struct work_struct *work)
if (!dev->mt76.beacon_mask)
return;
+ if (mt76_hw(dev)->conf.flags & IEEE80211_CONF_OFFCHANNEL)
+ return;
+
mt76x02_resync_beacon_timer(dev);
ieee80211_iterate_active_interfaces(mt76_hw(dev),
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_util.c b/drivers/net/wireless/mediatek/mt76/mt76x02_util.c
index 12724e96b290..ad5323447ed4 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x02_util.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x02_util.c
@@ -593,8 +593,6 @@ void mt76x02_sw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
{
struct mt76x02_dev *dev = hw->priv;
- if (mt76_is_mmio(dev))
- tasklet_disable(&dev->mt76.pre_tbtt_tasklet);
set_bit(MT76_SCANNING, &dev->mt76.state);
}
EXPORT_SYMBOL_GPL(mt76x02_sw_scan);
@@ -605,9 +603,6 @@ void mt76x02_sw_scan_complete(struct ieee80211_hw *hw,
struct mt76x02_dev *dev = hw->priv;
clear_bit(MT76_SCANNING, &dev->mt76.state);
- if (mt76_is_mmio(dev))
- tasklet_enable(&dev->mt76.pre_tbtt_tasklet);
-
if (dev->cal.gain_init_done) {
/* Restore AGC gain and resume calibration after scanning. */
dev->cal.low_gain = -1;
--
2.20.1
^ permalink raw reply related
* [PATCH v3 2/3] mt76: mt7603: enable/disable pre_tbtt_tasklet in mt7603_set_channel
From: Lorenzo Bianconi @ 2019-04-30 13:12 UTC (permalink / raw)
To: nbd; +Cc: lorenzo.bianconi, linux-wireless, sgruszka
In-Reply-To: <cover.1556629547.git.lorenzo@kernel.org>
Disable pre_tbtt_tasklet tasklet before setting the operating channel.
Enable/disable beacon_timer in mt7603_set_channel
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
drivers/net/wireless/mediatek/mt76/mt7603/beacon.c | 3 +++
drivers/net/wireless/mediatek/mt76/mt7603/main.c | 8 ++++++--
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/beacon.c b/drivers/net/wireless/mediatek/mt76/mt7603/beacon.c
index f3e7406e731f..58e68fbdbf75 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7603/beacon.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7603/beacon.c
@@ -72,6 +72,9 @@ void mt7603_pre_tbtt_tasklet(unsigned long arg)
struct sk_buff *skb;
int i, nframes;
+ if (mt76_hw(dev)->conf.flags & IEEE80211_CONF_OFFCHANNEL)
+ return;
+
data.dev = dev;
__skb_queue_head_init(&data.q);
diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/main.c b/drivers/net/wireless/mediatek/mt76/mt7603/main.c
index be5d43050100..0a0334dc40d5 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7603/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7603/main.c
@@ -133,10 +133,12 @@ mt7603_set_channel(struct mt7603_dev *dev, struct cfg80211_chan_def *def)
bool failed = false;
cancel_delayed_work_sync(&dev->mt76.mac_work);
+ tasklet_disable(&dev->mt76.pre_tbtt_tasklet);
mutex_lock(&dev->mt76.mutex);
set_bit(MT76_RESET, &dev->mt76.state);
+ mt7603_beacon_set_timer(dev, -1, 0);
mt76_set_channel(&dev->mt76);
mt7603_mac_stop(dev);
@@ -186,8 +188,12 @@ mt7603_set_channel(struct mt7603_dev *dev, struct cfg80211_chan_def *def)
mt7603_init_edcca(dev);
out:
+ if (!(mt76_hw(dev)->conf.flags & IEEE80211_CONF_OFFCHANNEL))
+ mt7603_beacon_set_timer(dev, -1, dev->mt76.beacon_int);
mutex_unlock(&dev->mt76.mutex);
+ tasklet_enable(&dev->mt76.pre_tbtt_tasklet);
+
if (failed)
mt7603_mac_work(&dev->mt76.mac_work.work);
@@ -535,7 +541,6 @@ mt7603_sw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
struct mt7603_dev *dev = hw->priv;
set_bit(MT76_SCANNING, &dev->mt76.state);
- mt7603_beacon_set_timer(dev, -1, 0);
}
static void
@@ -544,7 +549,6 @@ mt7603_sw_scan_complete(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
struct mt7603_dev *dev = hw->priv;
clear_bit(MT76_SCANNING, &dev->mt76.state);
- mt7603_beacon_set_timer(dev, -1, dev->mt76.beacon_int);
}
static void
--
2.20.1
^ permalink raw reply related
* [PATCH v3 1/3] mt76: move pre_tbtt_tasklet in mt76_dev
From: Lorenzo Bianconi @ 2019-04-30 13:12 UTC (permalink / raw)
To: nbd; +Cc: lorenzo.bianconi, linux-wireless, sgruszka
In-Reply-To: <cover.1556629547.git.lorenzo@kernel.org>
Move pre_tbtt_tasklet tasklet in mt76_dev data structure since
it is used by all drivers
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
drivers/net/wireless/mediatek/mt76/mt76.h | 1 +
drivers/net/wireless/mediatek/mt76/mt7603/core.c | 2 +-
drivers/net/wireless/mediatek/mt76/mt7603/init.c | 4 ++--
drivers/net/wireless/mediatek/mt76/mt7603/mac.c | 4 ++--
drivers/net/wireless/mediatek/mt76/mt7603/main.c | 4 ++--
drivers/net/wireless/mediatek/mt76/mt7603/mt7603.h | 2 --
drivers/net/wireless/mediatek/mt76/mt76x0/pci.c | 2 +-
drivers/net/wireless/mediatek/mt76/mt76x02.h | 1 -
drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c | 12 ++++++------
drivers/net/wireless/mediatek/mt76/mt76x02_util.c | 4 ++--
drivers/net/wireless/mediatek/mt76/mt76x2/pci_init.c | 2 +-
drivers/net/wireless/mediatek/mt76/mt76x2/pci_main.c | 4 ++--
12 files changed, 20 insertions(+), 22 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt76.h b/drivers/net/wireless/mediatek/mt76/mt76.h
index f1f56d24e8fc..8ecbf81a906f 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76.h
+++ b/drivers/net/wireless/mediatek/mt76/mt76.h
@@ -469,6 +469,7 @@ struct mt76_dev {
u8 antenna_mask;
u16 chainmask;
+ struct tasklet_struct pre_tbtt_tasklet;
int beacon_int;
u8 beacon_mask;
diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/core.c b/drivers/net/wireless/mediatek/mt76/mt7603/core.c
index 0d06ff67ce44..37e5644b45ef 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7603/core.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7603/core.c
@@ -27,7 +27,7 @@ irqreturn_t mt7603_irq_handler(int irq, void *dev_instance)
mt76_wr(dev, MT_HW_INT_STATUS(3), hwintr);
if (hwintr & MT_HW_INT3_PRE_TBTT0)
- tasklet_schedule(&dev->pre_tbtt_tasklet);
+ tasklet_schedule(&dev->mt76.pre_tbtt_tasklet);
if ((hwintr & MT_HW_INT3_TBTT0) && dev->mt76.csa_complete)
mt76_csa_finish(&dev->mt76);
diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/init.c b/drivers/net/wireless/mediatek/mt76/mt7603/init.c
index 46ac23e2d0b7..78cdbb70e178 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7603/init.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7603/init.c
@@ -515,7 +515,7 @@ int mt7603_register_device(struct mt7603_dev *dev)
spin_lock_init(&dev->ps_lock);
INIT_DELAYED_WORK(&dev->mt76.mac_work, mt7603_mac_work);
- tasklet_init(&dev->pre_tbtt_tasklet, mt7603_pre_tbtt_tasklet,
+ tasklet_init(&dev->mt76.pre_tbtt_tasklet, mt7603_pre_tbtt_tasklet,
(unsigned long)dev);
/* Check for 7688, which only has 1SS */
@@ -574,7 +574,7 @@ int mt7603_register_device(struct mt7603_dev *dev)
void mt7603_unregister_device(struct mt7603_dev *dev)
{
- tasklet_disable(&dev->pre_tbtt_tasklet);
+ tasklet_disable(&dev->mt76.pre_tbtt_tasklet);
mt76_unregister_device(&dev->mt76);
mt7603_mcu_exit(dev);
mt7603_dma_cleanup(dev);
diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/mac.c b/drivers/net/wireless/mediatek/mt76/mt7603/mac.c
index 02e18b976de5..6d506e34c3ee 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7603/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7603/mac.c
@@ -1279,7 +1279,7 @@ static void mt7603_mac_watchdog_reset(struct mt7603_dev *dev)
mt76_txq_schedule_all(&dev->mt76);
tasklet_disable(&dev->mt76.tx_tasklet);
- tasklet_disable(&dev->pre_tbtt_tasklet);
+ tasklet_disable(&dev->mt76.pre_tbtt_tasklet);
napi_disable(&dev->mt76.napi[0]);
napi_disable(&dev->mt76.napi[1]);
@@ -1328,7 +1328,7 @@ static void mt7603_mac_watchdog_reset(struct mt7603_dev *dev)
tasklet_enable(&dev->mt76.tx_tasklet);
tasklet_schedule(&dev->mt76.tx_tasklet);
- tasklet_enable(&dev->pre_tbtt_tasklet);
+ tasklet_enable(&dev->mt76.pre_tbtt_tasklet);
mt7603_beacon_set_timer(dev, -1, beacon_int);
napi_enable(&dev->mt76.napi[0]);
diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/main.c b/drivers/net/wireless/mediatek/mt76/mt7603/main.c
index 9be9ae02103e..be5d43050100 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7603/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7603/main.c
@@ -294,9 +294,9 @@ mt7603_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
if (changed & (BSS_CHANGED_BEACON_ENABLED | BSS_CHANGED_BEACON_INT)) {
int beacon_int = !!info->enable_beacon * info->beacon_int;
- tasklet_disable(&dev->pre_tbtt_tasklet);
+ tasklet_disable(&dev->mt76.pre_tbtt_tasklet);
mt7603_beacon_set_timer(dev, mvif->idx, beacon_int);
- tasklet_enable(&dev->pre_tbtt_tasklet);
+ tasklet_enable(&dev->mt76.pre_tbtt_tasklet);
}
mutex_unlock(&dev->mt76.mutex);
diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/mt7603.h b/drivers/net/wireless/mediatek/mt76/mt7603/mt7603.h
index cc20a0cbed8d..fa64bbaab0d2 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7603/mt7603.h
+++ b/drivers/net/wireless/mediatek/mt76/mt7603/mt7603.h
@@ -140,8 +140,6 @@ struct mt7603_dev {
u32 reset_test;
unsigned int reset_cause[__RESET_CAUSE_MAX];
-
- struct tasklet_struct pre_tbtt_tasklet;
};
extern const struct mt76_driver_ops mt7603_drv_ops;
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/pci.c b/drivers/net/wireless/mediatek/mt76/mt76x0/pci.c
index 0eeccc3b529d..4585e1b756c2 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x0/pci.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x0/pci.c
@@ -213,7 +213,7 @@ mt76x0e_probe(struct pci_dev *pdev, const struct pci_device_id *id)
static void mt76x0e_cleanup(struct mt76x02_dev *dev)
{
clear_bit(MT76_STATE_INITIALIZED, &dev->mt76.state);
- tasklet_disable(&dev->pre_tbtt_tasklet);
+ tasklet_disable(&dev->mt76.pre_tbtt_tasklet);
mt76x0_chip_onoff(dev, false, false);
mt76x0e_stop_hw(dev);
mt76x02_dma_cleanup(dev);
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02.h b/drivers/net/wireless/mediatek/mt76/mt76x02.h
index a679914e4551..687bd14b2d77 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x02.h
+++ b/drivers/net/wireless/mediatek/mt76/mt76x02.h
@@ -91,7 +91,6 @@ struct mt76x02_dev {
struct sk_buff *rx_head;
struct napi_struct tx_napi;
- struct tasklet_struct pre_tbtt_tasklet;
struct delayed_work cal_work;
struct delayed_work wdt_work;
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c b/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c
index 4e0f8aed4603..8f899b8aa9fe 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c
@@ -68,9 +68,9 @@ static void mt76x02_pre_tbtt_tasklet(unsigned long arg)
static void mt76x02e_pre_tbtt_enable(struct mt76x02_dev *dev, bool en)
{
if (en)
- tasklet_enable(&dev->pre_tbtt_tasklet);
+ tasklet_enable(&dev->mt76.pre_tbtt_tasklet);
else
- tasklet_disable(&dev->pre_tbtt_tasklet);
+ tasklet_disable(&dev->mt76.pre_tbtt_tasklet);
}
static void mt76x02e_beacon_enable(struct mt76x02_dev *dev, bool en)
@@ -198,7 +198,7 @@ int mt76x02_dma_init(struct mt76x02_dev *dev)
tasklet_init(&dev->mt76.tx_tasklet, mt76x02_tx_tasklet,
(unsigned long) dev);
- tasklet_init(&dev->pre_tbtt_tasklet, mt76x02_pre_tbtt_tasklet,
+ tasklet_init(&dev->mt76.pre_tbtt_tasklet, mt76x02_pre_tbtt_tasklet,
(unsigned long)dev);
spin_lock_init(&dev->txstatus_fifo_lock);
@@ -285,7 +285,7 @@ irqreturn_t mt76x02_irq_handler(int irq, void *dev_instance)
}
if (intr & MT_INT_PRE_TBTT)
- tasklet_schedule(&dev->pre_tbtt_tasklet);
+ tasklet_schedule(&dev->mt76.pre_tbtt_tasklet);
/* send buffered multicast frames now */
if (intr & MT_INT_TBTT) {
@@ -449,7 +449,7 @@ static void mt76x02_watchdog_reset(struct mt76x02_dev *dev)
ieee80211_stop_queues(dev->mt76.hw);
set_bit(MT76_RESET, &dev->mt76.state);
- tasklet_disable(&dev->pre_tbtt_tasklet);
+ tasklet_disable(&dev->mt76.pre_tbtt_tasklet);
tasklet_disable(&dev->mt76.tx_tasklet);
napi_disable(&dev->tx_napi);
@@ -508,7 +508,7 @@ static void mt76x02_watchdog_reset(struct mt76x02_dev *dev)
napi_enable(&dev->tx_napi);
napi_schedule(&dev->tx_napi);
- tasklet_enable(&dev->pre_tbtt_tasklet);
+ tasklet_enable(&dev->mt76.pre_tbtt_tasklet);
for (i = 0; i < ARRAY_SIZE(dev->mt76.napi); i++) {
napi_enable(&dev->mt76.napi[i]);
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_util.c b/drivers/net/wireless/mediatek/mt76/mt76x02_util.c
index 227c360165b0..12724e96b290 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x02_util.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x02_util.c
@@ -594,7 +594,7 @@ void mt76x02_sw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
struct mt76x02_dev *dev = hw->priv;
if (mt76_is_mmio(dev))
- tasklet_disable(&dev->pre_tbtt_tasklet);
+ tasklet_disable(&dev->mt76.pre_tbtt_tasklet);
set_bit(MT76_SCANNING, &dev->mt76.state);
}
EXPORT_SYMBOL_GPL(mt76x02_sw_scan);
@@ -606,7 +606,7 @@ void mt76x02_sw_scan_complete(struct ieee80211_hw *hw,
clear_bit(MT76_SCANNING, &dev->mt76.state);
if (mt76_is_mmio(dev))
- tasklet_enable(&dev->pre_tbtt_tasklet);
+ tasklet_enable(&dev->mt76.pre_tbtt_tasklet);
if (dev->cal.gain_init_done) {
/* Restore AGC gain and resume calibration after scanning. */
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/pci_init.c b/drivers/net/wireless/mediatek/mt76/mt76x2/pci_init.c
index 90c1a0489294..71aea2832644 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x2/pci_init.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x2/pci_init.c
@@ -300,7 +300,7 @@ void mt76x2_stop_hardware(struct mt76x02_dev *dev)
void mt76x2_cleanup(struct mt76x02_dev *dev)
{
tasklet_disable(&dev->dfs_pd.dfs_tasklet);
- tasklet_disable(&dev->pre_tbtt_tasklet);
+ tasklet_disable(&dev->mt76.pre_tbtt_tasklet);
mt76x2_stop_hardware(dev);
mt76x02_dma_cleanup(dev);
mt76x02_mcu_cleanup(dev);
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/pci_main.c b/drivers/net/wireless/mediatek/mt76/mt76x2/pci_main.c
index ab716957b8ba..e416eee6a306 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x2/pci_main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x2/pci_main.c
@@ -59,7 +59,7 @@ mt76x2_set_channel(struct mt76x02_dev *dev, struct cfg80211_chan_def *chandef)
mt76_set_channel(&dev->mt76);
- tasklet_disable(&dev->pre_tbtt_tasklet);
+ tasklet_disable(&dev->mt76.pre_tbtt_tasklet);
tasklet_disable(&dev->dfs_pd.dfs_tasklet);
mt76x2_mac_stop(dev, true);
@@ -73,7 +73,7 @@ mt76x2_set_channel(struct mt76x02_dev *dev, struct cfg80211_chan_def *chandef)
mt76x2_mac_resume(dev);
tasklet_enable(&dev->dfs_pd.dfs_tasklet);
- tasklet_enable(&dev->pre_tbtt_tasklet);
+ tasklet_enable(&dev->mt76.pre_tbtt_tasklet);
clear_bit(MT76_RESET, &dev->mt76.state);
--
2.20.1
^ permalink raw reply related
* [PATCH v3 0/3] mt76: move common beacon code in mt76 module
From: Lorenzo Bianconi @ 2019-04-30 13:12 UTC (permalink / raw)
To: nbd; +Cc: lorenzo.bianconi, linux-wireless, sgruszka
Move beacon data structures shared between mt76x02 and mt7603 drivers
in mt76_dev.
Enable/disable pre_tbtt_tasklet tasklet in mt7603_set_channel
Changes since v2:
- remove patch 2/5 and 3/5 since already applied
- do not run tbtt tasklet while offchannel
Changes since v1:
- added new patch: 'mt76: do not enable/disable pre_tbtt_tasklet in
scan_start/scan_complete'
Lorenzo Bianconi (3):
mt76: move pre_tbtt_tasklet in mt76_dev
mt76: mt7603: enable/disable pre_tbtt_tasklet in mt7603_set_channel
mt76: do not enable/disable pre_tbtt_tasklet in
scan_start/scan_complete
drivers/net/wireless/mediatek/mt76/mt76.h | 1 +
.../net/wireless/mediatek/mt76/mt7603/beacon.c | 3 +++
drivers/net/wireless/mediatek/mt76/mt7603/core.c | 2 +-
drivers/net/wireless/mediatek/mt76/mt7603/init.c | 4 ++--
drivers/net/wireless/mediatek/mt76/mt7603/mac.c | 4 ++--
drivers/net/wireless/mediatek/mt76/mt7603/main.c | 12 ++++++++----
.../net/wireless/mediatek/mt76/mt7603/mt7603.h | 2 --
drivers/net/wireless/mediatek/mt76/mt76x0/pci.c | 2 +-
drivers/net/wireless/mediatek/mt76/mt76x02.h | 1 -
drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c | 15 +++++++++------
.../net/wireless/mediatek/mt76/mt76x02_usb_core.c | 3 +++
drivers/net/wireless/mediatek/mt76/mt76x02_util.c | 5 -----
.../net/wireless/mediatek/mt76/mt76x2/pci_init.c | 2 +-
.../net/wireless/mediatek/mt76/mt76x2/pci_main.c | 4 ++--
14 files changed, 33 insertions(+), 27 deletions(-)
--
2.20.1
^ permalink raw reply
* Re: [PATCH v9 04/14] rtw88: trx files
From: Kalle Valo @ 2019-04-30 12:45 UTC (permalink / raw)
To: yhchuang
Cc: linux-wireless, johannes, pkshih, tehuang, Larry.Finger, sgruszka,
briannorris, gregkh
In-Reply-To: <1555653004-1795-5-git-send-email-yhchuang@realtek.com>
<yhchuang@realtek.com> writes:
> From: Yan-Hsuan Chuang <yhchuang@realtek.com>
>
> trx files for Realtek 802.11ac wireless network chips
>
> Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
> Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
[...]
> --- /dev/null
> +++ b/drivers/net/wireless/realtek/rtw88/rx.h
> @@ -0,0 +1,41 @@
> +/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
> +/* Copyright(c) 2018-2019 Realtek Corporation
> + */
> +
> +#ifndef __RTW_RX_H_
> +#define __RTW_RX_H_
> +
> +#define GET_RX_DESC_PHYST(rxdesc) \
> + le32_get_bits(*((__le32 *)(rxdesc) + 0x00), BIT(26))
> +#define GET_RX_DESC_ICV_ERR(rxdesc) \
> + le32_get_bits(*((__le32 *)(rxdesc) + 0x00), BIT(15))
> +#define GET_RX_DESC_CRC32(rxdesc) \
> + le32_get_bits(*((__le32 *)(rxdesc) + 0x00), BIT(14))
> +#define GET_RX_DESC_SWDEC(rxdesc) \
> + le32_get_bits(*((__le32 *)(rxdesc) + 0x00), BIT(27))
> +#define GET_RX_DESC_C2H(rxdesc) \
> + le32_get_bits(*((__le32 *)(rxdesc) + 0x02), BIT(28))
> +#define GET_RX_DESC_PKT_LEN(rxdesc) \
> + le32_get_bits(*((__le32 *)(rxdesc) + 0x00), GENMASK(13, 0))
> +#define GET_RX_DESC_DRV_INFO_SIZE(rxdesc) \
> + le32_get_bits(*((__le32 *)(rxdesc) + 0x00), GENMASK(19, 16))
> +#define GET_RX_DESC_SHIFT(rxdesc) \
> + le32_get_bits(*((__le32 *)(rxdesc) + 0x00), GENMASK(25, 24))
> +#define GET_RX_DESC_RX_RATE(rxdesc) \
> + le32_get_bits(*((__le32 *)(rxdesc) + 0x03), GENMASK(6, 0))
> +#define GET_RX_DESC_MACID(rxdesc) \
> + le32_get_bits(*((__le32 *)(rxdesc) + 0x01), GENMASK(6, 0))
> +#define GET_RX_DESC_PPDU_CNT(rxdesc) \
> + le32_get_bits(*((__le32 *)(rxdesc) + 0x02), GENMASK(30, 29))
> +#define GET_RX_DESC_TSFL(rxdesc) \
> + le32_get_bits(*((__le32 *)(rxdesc) + 0x05), GENMASK(31, 0))
I'm not really fond of these "byte macros" or whatever they should be
called, you use these a lot in rtw88 but I have seen the same usage also
other drivers. The upstream way of doing this is to create a struct,
which also acts as a documentation, and you can pass it around different
functions. And the GENMASK()s are defined close the struct.
Also you could change these defines to static inline functions, which
take the struct as a pointer, and that you get type checking from the
compiler. And that way you would get rid of that ugly casting as well.
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH v9 00/14] rtw88: mac80211 driver for Realtek 802.11ac wireless network chips
From: Kalle Valo @ 2019-04-30 12:40 UTC (permalink / raw)
To: yhchuang
Cc: linux-wireless, johannes, pkshih, tehuang, Larry.Finger, sgruszka,
briannorris, gregkh
In-Reply-To: <1555653004-1795-1-git-send-email-yhchuang@realtek.com>
<yhchuang@realtek.com> writes:
> From: Yan-Hsuan Chuang <yhchuang@realtek.com>
>
> This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
> rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
> functionalities. The firmware for both can be found at linux-firmware.
This looks very good now. I did a quick review of the driver and had few
netpicks but nothing really blocking applying this. So I have now
combined these patches into one big patch and pushed it to the pending
branch:
https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git/commit/?h=pending&id=284d1e4e3311cfe67c1c57ccc275ff0f5666aeea
I appreciate if people could do a quick check and make sure that I
didn't do anything stupid when folding the patches. I'm planning to
apply this to master branch still today evening so that it makes to
tomorrow's linux-next build, and I can get it to net-next before the
merge window starts on Sunday.
Yan-Hsuan, during review you have received very good comments from a lot
of folks, I recommend you go through all of them and send fixes as
follow up patches. I can then apply them after the merge window.
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH v9 01/14] rtw88: main files
From: Kalle Valo @ 2019-04-30 12:16 UTC (permalink / raw)
To: yhchuang
Cc: linux-wireless, johannes, pkshih, tehuang, Larry.Finger, sgruszka,
briannorris, gregkh
In-Reply-To: <1555653004-1795-2-git-send-email-yhchuang@realtek.com>
<yhchuang@realtek.com> writes:
> From: Yan-Hsuan Chuang <yhchuang@realtek.com>
>
> main files for Realtek 802.11ac wireless network chips
>
> Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
> Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
[...]
> +static inline u8 *get_hdr_bssid(struct ieee80211_hdr *hdr)
> +{
> + __le16 fc = hdr->frame_control;
> + u8 *bssid;
> +
> + if (ieee80211_has_tods(fc))
> + bssid = hdr->addr1;
> + else if (ieee80211_has_fromds(fc))
> + bssid = hdr->addr2;
> + else
> + bssid = hdr->addr3;
> +
> + return bssid;
> +}
I wonder should something like this be in include/linux/ieee80211.h?
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH v9 09/14] rtw88: chip files
From: Kalle Valo @ 2019-04-30 12:06 UTC (permalink / raw)
To: yhchuang
Cc: linux-wireless, johannes, pkshih, tehuang, Larry.Finger, sgruszka,
briannorris, gregkh
In-Reply-To: <1555653004-1795-10-git-send-email-yhchuang@realtek.com>
<yhchuang@realtek.com> writes:
> From: Yan-Hsuan Chuang <yhchuang@realtek.com>
>
> chip files Realtek 802.11ac wireless network chips
> 8822B & 8822C series files
>
> Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
> Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
[...]
> +static void rtw8822be_efuse_parsing(struct rtw_efuse *efuse,
> + struct rtw8822b_efuse *map)
> +{
> + ether_addr_copy(efuse->addr, map->e.mac_addr);
> +}
Looks like a quite useless function and just confuses the code.
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH v9 09/14] rtw88: chip files
From: Kalle Valo @ 2019-04-30 12:00 UTC (permalink / raw)
To: yhchuang
Cc: linux-wireless, johannes, pkshih, tehuang, Larry.Finger, sgruszka,
briannorris, gregkh
In-Reply-To: <87d0l3rdpp.fsf@kamboji.qca.qualcomm.com>
Kalle Valo <kvalo@codeaurora.org> writes:
> <yhchuang@realtek.com> writes:
>
>> From: Yan-Hsuan Chuang <yhchuang@realtek.com>
>>
>> chip files Realtek 802.11ac wireless network chips
>> 8822B & 8822C series files
>>
>> Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
>> Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
>
> [...]
>
>> +static struct rtw_pwr_seq_cmd trans_carddis_to_cardemu_8822b[] = {
>> + {0x0086,
>> + RTW_PWR_CUT_ALL_MSK,
>> + RTW_PWR_INTF_SDIO_MSK,
>> + RTW_PWR_ADDR_SDIO,
>> + RTW_PWR_CMD_WRITE, BIT(0), 0},
>
> I see lots of arrays like this which are not const. I think they should
> be const.
And I'm seeing even more of these while I review the driver. So
basically all static variables should be const to make sure you don't
accidentally between driver instances. IIRC there was something in
cfg80211 API which prevent to use const (maybe the channels? can't
remember now) but that's just an exception to the rule.
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH v9 05/14] rtw88: mac files
From: Kalle Valo @ 2019-04-30 11:48 UTC (permalink / raw)
To: yhchuang
Cc: linux-wireless, johannes, pkshih, tehuang, Larry.Finger, sgruszka,
briannorris, gregkh
In-Reply-To: <1555653004-1795-6-git-send-email-yhchuang@realtek.com>
<yhchuang@realtek.com> writes:
> From: Yan-Hsuan Chuang <yhchuang@realtek.com>
>
> mac files for Realtek 802.11ac wireless network chips
>
> Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
> Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
[...]
> +static int rtw_pwr_cmd_polling(struct rtw_dev *rtwdev,
> + struct rtw_pwr_seq_cmd *cmd)
> +{
> + u8 value;
> + u8 flag = 0;
> + u32 offset;
> + u32 cnt = RTW_PWR_POLLING_CNT;
> +
> + if (cmd->base == RTW_PWR_ADDR_SDIO)
> + offset = cmd->offset | SDIO_LOCAL_OFFSET;
> + else
> + offset = cmd->offset;
> +
> + do {
> + cnt--;
> + value = rtw_read8(rtwdev, offset);
> + value &= cmd->mask;
> + if (value == (cmd->value & cmd->mask))
> + return 0;
> + if (cnt == 0) {
> + if (rtw_hci_type(rtwdev) == RTW_HCI_TYPE_PCIE &&
> + flag == 0) {
> + value = rtw_read8(rtwdev, REG_SYS_PW_CTRL);
> + value |= BIT(3);
> + rtw_write8(rtwdev, REG_SYS_PW_CTRL, value);
> + value &= ~BIT(3);
> + rtw_write8(rtwdev, REG_SYS_PW_CTRL, value);
> + cnt = RTW_PWR_POLLING_CNT;
> + flag = 1;
> + } else {
> + return -EBUSY;
> + }
> + } else {
> + udelay(50);
> + }
> + } while (1);
Never ending loops in kernel are dangerous. I would add some kind of
fail safe to "while (1)", for example max number of loops or some time
based limit.
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH v9 12/14] rtw88: Kconfig & Makefile
From: Kalle Valo @ 2019-04-30 11:53 UTC (permalink / raw)
To: yhchuang
Cc: linux-wireless, johannes, pkshih, tehuang, Larry.Finger, sgruszka,
briannorris, gregkh
In-Reply-To: <1555653004-1795-13-git-send-email-yhchuang@realtek.com>
<yhchuang@realtek.com> writes:
> From: Yan-Hsuan Chuang <yhchuang@realtek.com>
>
> Kconfig & Makefile for Realtek 802.11ac wireless network chips
>
> Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
> Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
[...]
> --- /dev/null
> +++ b/drivers/net/wireless/realtek/rtw88/Makefile
> @@ -0,0 +1,20 @@
> +obj-$(CONFIG_RTW88_CORE) += rtw88.o
> +rtw88-y += main.o \
> + mac80211.o \
> + util.o \
> + debug.o \
> + tx.o \
> + rx.o \
> + mac.o \
> + phy.o \
> + efuse.o \
> + fw.o \
> + ps.o \
> + sec.o \
> + regd.o
> +
> +rtw88-$(CONFIG_RTW88_8822BE) += rtw8822b.o rtw8822b_table.o
> +rtw88-$(CONFIG_RTW88_8822CE) += rtw8822c.o rtw8822c_table.o
> +
> +obj-$(CONFIG_RTW88_PCI) += rtwpci.o
> +rtwpci-objs := pci.o
Please add an SPDX tag also for the makefile.
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH v9 01/14] rtw88: main files
From: Kalle Valo @ 2019-04-30 11:45 UTC (permalink / raw)
To: yhchuang
Cc: linux-wireless, johannes, pkshih, tehuang, Larry.Finger, sgruszka,
briannorris, gregkh
In-Reply-To: <1555653004-1795-2-git-send-email-yhchuang@realtek.com>
<yhchuang@realtek.com> writes:
> From: Yan-Hsuan Chuang <yhchuang@realtek.com>
>
> main files for Realtek 802.11ac wireless network chips
>
> Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
> Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
[...]
> +static int rtw_ops_add_interface(struct ieee80211_hw *hw,
> + struct ieee80211_vif *vif)
> +{
> + struct rtw_dev *rtwdev = hw->priv;
> + struct rtw_vif *rtwvif = (struct rtw_vif *)vif->drv_priv;
> + enum rtw_net_type net_type;
> + u32 config = 0;
> + u8 port = 0;
> +
> + rtwvif->port = port;
> + rtwvif->vif = vif;
> + rtwvif->stats.tx_unicast = 0;
> + rtwvif->stats.rx_unicast = 0;
> + rtwvif->stats.tx_cnt = 0;
> + rtwvif->stats.rx_cnt = 0;
> + rtwvif->in_lps = false;
> + rtwvif->conf = &rtw_vif_port[port];
> +
> + mutex_lock(&rtwdev->mutex);
> +
> + switch (vif->type) {
> + case NL80211_IFTYPE_AP:
> + case NL80211_IFTYPE_MESH_POINT:
> + net_type = RTW_NET_AP_MODE;
> + break;
> + case NL80211_IFTYPE_ADHOC:
> + net_type = RTW_NET_AD_HOC;
> + break;
> + case NL80211_IFTYPE_STATION:
> + default:
> + net_type = RTW_NET_NO_LINK;
> + break;
> + }
> +
> + ether_addr_copy(rtwvif->mac_addr, vif->addr);
> + config |= PORT_SET_MAC_ADDR;
> + rtwvif->net_type = net_type;
> + config |= PORT_SET_NET_TYPE;
> + rtw_vif_port_config(rtwdev, rtwvif, config);
> +
> + mutex_unlock(&rtwdev->mutex);
> +
> + rtw_info(rtwdev, "start vif %pM on port %d\n", vif->addr, rtwvif->port);
I think this somewhat spammy. And looking at other uses of rtw_info():
mac80211.c:157: rtw_info(rtwdev, "start vif %pM on port %d\n", vif->addr, rtwvif->port);
mac80211.c:168: rtw_info(rtwdev, "stop vif %pM on port %d\n", vif->addr, rtwvif->port);
mac80211.c:318: rtw_info(rtwdev, "sta %pM joined with macid %d\n",
mac80211.c:340: rtw_info(rtwdev, "sta %pM with macid %d left\n",
rtw8822b.c:936: rtw_info(rtwdev, "unsupport tx path, set to default path ab\n");
rtw8822b.c:940: rtw_info(rtwdev, "unsupport rx path, set to default path ab\n");
I would just convert the last two to warning level, assuming those cases
do not happen normally. And the rest would be better as debug messages
to keep the dmesg clean.
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH v2] mt76: mt7615: add TX/RX antenna pattern capabilities
From: Ryder Lee @ 2019-04-30 11:27 UTC (permalink / raw)
To: Felix Fietkau
Cc: Lorenzo Bianconi, Roy Luo, YF Luo, Yiwei Chung, Sean Wang,
linux-wireless, linux-mediatek, linux-kernel
In-Reply-To: <c3f6e202-8c2f-a103-a104-e0d1cde8147b@nbd.name>
On Tue, 2019-04-30 at 11:24 +0200, Felix Fietkau wrote:
> On 2019-04-26 07:23, Ryder Lee wrote:
> > Announce antenna pattern cap to adapt PHY and baseband settings.
> >
> > Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
> > ---
> > Changes since v2:
> > - Add a prefix mt76 in the title.
> > ---
> > drivers/net/wireless/mediatek/mt76/mt7615/init.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/init.c b/drivers/net/wireless/mediatek/mt76/mt7615/init.c
> > index 3ab3ff553ef2..122f7a565540 100644
> > --- a/drivers/net/wireless/mediatek/mt76/mt7615/init.c
> > +++ b/drivers/net/wireless/mediatek/mt76/mt7615/init.c
> > @@ -190,6 +190,8 @@ int mt7615_register_device(struct mt7615_dev *dev)
> > IEEE80211_VHT_CAP_SHORT_GI_160 |
> > IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454 |
> > IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK |
> > + IEEE80211_VHT_CAP_RX_ANTENNA_PATTERN |
> > + IEEE80211_VHT_CAP_TX_ANTENNA_PATTERN |
> If I read the standard correctly, these flags indicate that the rx/tx
> antenna pattern does NOT change during association.
> Doesn't that mean that we should set it in mac80211.c instead, so that
> it also applies to MT76x2?
>
Right. I will add these flags in common code.
Ryder
^ permalink raw reply
* Re: [PATCH v9 01/14] rtw88: main files
From: Kalle Valo @ 2019-04-30 10:32 UTC (permalink / raw)
To: yhchuang
Cc: linux-wireless, johannes, pkshih, tehuang, Larry.Finger, sgruszka,
briannorris, gregkh
In-Reply-To: <1555653004-1795-2-git-send-email-yhchuang@realtek.com>
<yhchuang@realtek.com> writes:
> From: Yan-Hsuan Chuang <yhchuang@realtek.com>
>
> main files for Realtek 802.11ac wireless network chips
>
> Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
> Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
[...]
> +static bool rtw_fw_support_lps;
> +unsigned int rtw_debug_mask;
> +EXPORT_SYMBOL(rtw_debug_mask);
> +
> +module_param_named(support_lps, rtw_fw_support_lps, bool, 0644);
> +module_param_named(debug_mask, rtw_debug_mask, uint, 0644);
> +
> +MODULE_PARM_DESC(support_lps, "Set Y to enable LPS support");
Not everyone (myself included) do not know what LPS means, please spell
it out in the description.
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH v9 01/14] rtw88: main files
From: Kalle Valo @ 2019-04-30 10:30 UTC (permalink / raw)
To: yhchuang
Cc: linux-wireless, johannes, pkshih, tehuang, Larry.Finger, sgruszka,
briannorris, gregkh
In-Reply-To: <1555653004-1795-2-git-send-email-yhchuang@realtek.com>
<yhchuang@realtek.com> writes:
> From: Yan-Hsuan Chuang <yhchuang@realtek.com>
>
> main files for Realtek 802.11ac wireless network chips
>
> Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
> Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
[...]
> +static inline bool rtw_flag_check(struct rtw_dev *rtwdev, enum rtw_flags flag)
> +{
> + return test_bit(flag, rtwdev->flags);
> +}
> +
> +static inline void rtw_flag_clear(struct rtw_dev *rtwdev, enum rtw_flags flag)
> +{
> + clear_bit(flag, rtwdev->flags);
> +}
> +
> +static inline void rtw_flag_set(struct rtw_dev *rtwdev, enum rtw_flags flag)
> +{
> + set_bit(flag, rtwdev->flags);
> +}
In upstream we don't usually like these kind of abstractions, they just
hide what the code does.
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH v9 09/14] rtw88: chip files
From: Kalle Valo @ 2019-04-30 10:26 UTC (permalink / raw)
To: yhchuang
Cc: linux-wireless, johannes, pkshih, tehuang, Larry.Finger, sgruszka,
briannorris, gregkh
In-Reply-To: <1555653004-1795-10-git-send-email-yhchuang@realtek.com>
<yhchuang@realtek.com> writes:
> From: Yan-Hsuan Chuang <yhchuang@realtek.com>
>
> chip files Realtek 802.11ac wireless network chips
> 8822B & 8822C series files
>
> Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
> Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
[...]
> +static struct rtw_pwr_seq_cmd trans_carddis_to_cardemu_8822b[] = {
> + {0x0086,
> + RTW_PWR_CUT_ALL_MSK,
> + RTW_PWR_INTF_SDIO_MSK,
> + RTW_PWR_ADDR_SDIO,
> + RTW_PWR_CMD_WRITE, BIT(0), 0},
I see lots of arrays like this which are not const. I think they should
be const.
--
Kalle Valo
^ permalink raw reply
* RE: [PATCH] ath10k: add peer id check in ath10k_peer_find_by_id
From: Wen Gong @ 2019-04-30 10:12 UTC (permalink / raw)
To: kvalo@codeaurora.org, Nicolas Boichat
Cc: Claire Chang, linux-wireless@vger.kernel.org,
ath10k@lists.infradead.org, Wen Gong
In-Reply-To: <87wojbrg0m.fsf@kamboji.qca.qualcomm.com>
> -----Original Message-----
> From: ath10k <ath10k-bounces@lists.infradead.org> On Behalf Of Kalle Valo
> Sent: Tuesday, April 30, 2019 5:37 PM
> To: Nicolas Boichat <drinkcat@chromium.org>
> Cc: Claire Chang <tientzu@chromium.org>; linux-wireless@vger.kernel.org;
> ath10k@lists.infradead.org; Wen Gong <wgong@codeaurora.org>
> Subject: [EXT] Re: [PATCH] ath10k: add peer id check in
> ath10k_peer_find_by_id
> >> --- a/drivers/net/wireless/ath/ath10k/txrx.c
> >> +++ b/drivers/net/wireless/ath/ath10k/txrx.c
> >> @@ -157,6 +157,9 @@ struct ath10k_peer
> *ath10k_peer_find_by_id(struct ath10k *ar, int peer_id)
> >> {
> >> struct ath10k_peer *peer;
> >>
> >> + if (peer_id >= sizeof(peer->peer_ids) * BITS_PER_BYTE)
> >
> > I'd use >= BITS_PER_TYPE(peer->peer_ids).
>
> Nice, I didn't know about that. Wen, please submit v2 using this.
>
> --
> Kalle Valo
Yes,
I have send v2 yesterday:
[PATCH v2] ath10k: add peer id check in ath10k_peer_find_by_id
>
> _______________________________________________
> ath10k mailing list
> ath10k@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply
* Re: [PATCH] brcmfmac: change the order of things in brcmf_detach()
From: Arend Van Spriel @ 2019-04-30 10:10 UTC (permalink / raw)
To: Piotr Figiel; +Cc: Rafał Miłecki, linux-wireless@vger.kernel.org
In-Reply-To: <20190430081142.GA27822@phoenix>
On 4/30/2019 10:11 AM, Piotr Figiel wrote:
> Hi Arend,
>
> On Mon, Apr 29, 2019 at 12:09:21PM +0200, Arend van Spriel wrote:
>> When brcmf_detach() from the bus layer upon rmmod we can no longer
>> communicate. Hence we will set the bus state to DOWN and cleanup
>> the event and protocol layer. The network interfaces need to be
>> deleted before brcmf_cfg80211_detach() because the latter does the
>> wiphy_unregister() which issues a warning if there are still network
>> devices linked to the wiphy instance.
>
> This seems to already happen - brcmf_cfg80211_detach() is called after the
> interfaces are removed.
Right. This was just to remind me why brcmf_cfg80211_detach() must be
called after removing the interfaces.
>> This change solves a null pointer dereference issue which happened
>> upon issueing rmmod while there are packets queued in bus protocol
>> layer.
>>
>> Reported-by: Rafał Miłecki <rafal@milecki.pl>
>> Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
>> Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
>> Reviewed-by: Franky Lin <franky.lin@broadcom.com>
>> Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
>> ---
>> Hi Piotr,
>>
>> While working on an issue with msgbuf protocol (used for PCIe devices)
>> your change 5cdb0ef6144f ("brcmfmac: fix NULL pointer derefence during
>> USB disconnect") conflicted. I suspect my reordering stuff in
>> brcmf_detach() also fixes your issue so could you retest this patch,
>> which basically reverts your change and applies my reordering, and see
>> whether my suspicion can be confirmed.
>
> Does the issue reported by Rafał you are trying to solve with this patch occur
> on current linux-next?
Looking at you patch I suspect it does, because
brcmf_proto_msgbuf_detach() is invoked in
brcmf_proto_detach_post_delif(). However, I could not reproduce it with
or without the patch.
Rafał,
Do you know whether your reported issue, ie. calling brcmf_tx_finalize()
after interfaces were removed, still exists in wireless-testing (or
linux-next).
Regards,
Arend
^ permalink raw reply
* Re: [PATCHv5 5/9] nl80211: Add netlink attribute to configure TID specific tx rate
From: Tamizh chelvam @ 2019-04-30 9:58 UTC (permalink / raw)
To: Johannes Berg; +Cc: ath10k, linux-wireless
In-Reply-To: <d9135c6be42425424e4c3fd606c7e5aaf9dac1e9.camel@sipsolutions.net>
On 2019-04-26 15:07, Johannes Berg wrote:
>> @@ -13354,6 +13367,42 @@ static int parse_tid_conf(struct
>> cfg80211_registered_device *rdev,
>> nla_get_u8(attrs[NL80211_ATTR_TID_CONFIG_RTSCTS_CTRL]);
>> }
>>
>> + if (attrs[NL80211_ATTR_TID_CONFIG_TX_RATES_TYPE]) {
>> + int idx;
>> + enum nl80211_attrs attr;
>> +
>> + if (!wiphy_ext_feature_isset(&rdev->wiphy,
>> + NL80211_EXT_FEATURE_PER_TID_TX_BITRATE_MASK))
>> + return -EOPNOTSUPP;
>> +
>> + if (peer &&
>> + !wiphy_ext_feature_isset(&rdev->wiphy,
>> + NL80211_EXT_FEATURE_PER_STA_TX_BITRATE_MASK))
>> + return -EOPNOTSUPP;
>> +
>> + idx = NL80211_ATTR_TID_CONFIG_TX_RATES_TYPE;
>> + tid_conf->txrate_type = nla_get_u8(attrs[idx]);
>> +
>> + tid_conf->tid_conf_mask |= IEEE80211_TID_CONF_TX_BITRATE;
>> + if (tid_conf->txrate_type != NL80211_TX_RATE_AUTOMATIC) {
>> + tid_conf->mask =
>> + kzalloc(sizeof(struct cfg80211_bitrate_mask),
>> + GFP_KERNEL);
>
> You leak this
>
>> + if (!tid_conf->mask)
>> + return -ENOMEM;
>> +
>> + attr = NL80211_ATTR_TID_CONFIG_TX_RATES;
>> + ret = nl80211_parse_tx_bitrate_mask(attrs, rdev, attr,
>> + tid_conf->mask);
>> + if (ret) {
>> + kfree(tid_conf->mask);
>> + return ret;
>> + }
>> + } else {
>> + tid_conf->mask = NULL;
>> + }
>> + }
>> +
>> return 0;
>> }
>>
>> @@ -13407,7 +13456,7 @@ static int nl80211_set_tid_config(struct
>> sk_buff *skb,
>> }
>>
>> ret = parse_tid_conf(rdev, attrs, &tid_conf->tid_conf[conf_idx],
>> - tid_conf->peer);
>> + info, tid_conf->peer);
>> if (ret)
>> goto bad_tid_conf;
>
> Practically everywhere, but particularly in the bad case in the next
> loop iteration etc?
>
Yeah. I will fix this in next version.
^ permalink raw reply
* Re: [PATCH v2 5/5] mt76: mt7603: enable/disable pre_tbtt_tasklet in mt7603_set_channel
From: Lorenzo Bianconi @ 2019-04-30 9:57 UTC (permalink / raw)
To: Felix Fietkau; +Cc: Lorenzo Bianconi, linux-wireless, Stanislaw Gruszka
In-Reply-To: <2c1357f9-95e6-49a2-7a75-7c2d6c89203a@nbd.name>
>
> On 2019-04-29 10:13, Lorenzo Bianconi wrote:
> > Disable pre_tbtt_tasklet tasklet before setting the operating channel.
> > Enable/disable beacon_timer in mt7603_set_channel
> >
> > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> This doesn't seem right to me - I don't think we should send beacons
> while off-channel.
Yes, right. I will rework this patch and even patch 1/5
Regards,
Lorenzo
>
> - Felix
^ permalink raw reply
* Re: [RFC/RFT] mac80211: Switch to a virtual time-based airtime scheduler
From: Yibo Zhao @ 2019-04-30 9:45 UTC (permalink / raw)
To: Toke Høiland-Jørgensen
Cc: make-wifi-fast, linux-wireless, Felix Fietkau, Rajkumar Manoharan,
Kan Yan, linux-wireless-owner
In-Reply-To: <87bm10ped0.fsf@toke.dk>
On 2019-04-21 05:15, Toke Høiland-Jørgensen wrote:
> Yibo Zhao <yiboz@codeaurora.org> writes:
>
>> On 2019-04-11 19:24, Toke Høiland-Jørgensen wrote:
>>> Yibo Zhao <yiboz@codeaurora.org> writes:
>>>
>>>> On 2019-04-10 18:40, Toke Høiland-Jørgensen wrote:
>>>>> Yibo Zhao <yiboz@codeaurora.org> writes:
>>>>>
>>>>>> On 2019-04-10 04:41, Toke Høiland-Jørgensen wrote:
>>>>>>> Yibo Zhao <yiboz@codeaurora.org> writes:
>>>>>>>
>>>>>>>> On 2019-04-04 16:31, Toke Høiland-Jørgensen wrote:
>>>>>>>>> Yibo Zhao <yiboz@codeaurora.org> writes:
>>>>>>>>>
>>>>>>>>>> On 2019-02-16 01:05, Toke Høiland-Jørgensen wrote:
>>>>>>>>>>> This switches the airtime scheduler in mac80211 to use a
>>>>>>>>>>> virtual
>>>>>>>>>>> time-based
>>>>>>>>>>> scheduler instead of the round-robin scheduler used before.
>>>>>>>>>>> This
>>>>>>>>>>> has
>>>>>>>>>>> a
>>>>>>>>>>> couple of advantages:
>>>>>>>>>>>
>>>>>>>>>>> - No need to sync up the round-robin scheduler in
>>>>>>>>>>> firmware/hardware
>>>>>>>>>>> with
>>>>>>>>>>> the round-robin airtime scheduler.
>>>>>>>>>>>
>>>>>>>>>>> - If several stations are eligible for transmission we can
>>>>>>>>>>> schedule
>>>>>>>>>>> both of
>>>>>>>>>>> them; no need to hard-block the scheduling rotation until
>>>>>>>>>>> the
>>>>>>>>>>> head
>>>>>>>>>>> of
>>>>>>>>>>> the
>>>>>>>>>>> queue has used up its quantum.
>>>>>>>>>>>
>>>>>>>>>>> - The check of whether a station is eligible for transmission
>>>>>>>>>>> becomes
>>>>>>>>>>> simpler (in ieee80211_txq_may_transmit()).
>>>>>>>>>>>
>>>>>>>>>>> The drawback is that scheduling becomes slightly more
>>>>>>>>>>> expensive,
>>>>>>>>>>> as
>>>>>>>>>>> we
>>>>>>>>>>> need
>>>>>>>>>>> to maintain an rbtree of TXQs sorted by virtual time. This
>>>>>>>>>>> means
>>>>>>>>>>> that
>>>>>>>>>>> ieee80211_register_airtime() becomes O(logN) in the number of
>>>>>>>>>>> currently
>>>>>>>>>>> scheduled TXQs. However, hopefully this number rarely grows
>>>>>>>>>>> too
>>>>>>>>>>> big
>>>>>>>>>>> (it's
>>>>>>>>>>> only TXQs currently backlogged, not all associated stations),
>>>>>>>>>>> so
>>>>>>>>>>> it
>>>>>>>>>>> shouldn't be too big of an issue.
>>>>>>>>>>>
>>>>>>>>>>> @@ -1831,18 +1830,32 @@ void
>>>>>>>>>>> ieee80211_sta_register_airtime(struct
>>>>>>>>>>> ieee80211_sta *pubsta, u8 tid,
>>>>>>>>>>> {
>>>>>>>>>>> struct sta_info *sta = container_of(pubsta, struct
>>>>>>>>>>> sta_info,
>>>>>>>>>>> sta);
>>>>>>>>>>> struct ieee80211_local *local = sta->sdata->local;
>>>>>>>>>>> + struct ieee80211_txq *txq = sta->sta.txq[tid];
>>>>>>>>>>> u8 ac = ieee80211_ac_from_tid(tid);
>>>>>>>>>>> - u32 airtime = 0;
>>>>>>>>>>> + u64 airtime = 0, weight_sum;
>>>>>>>>>>> +
>>>>>>>>>>> + if (!txq)
>>>>>>>>>>> + return;
>>>>>>>>>>>
>>>>>>>>>>> if (sta->local->airtime_flags & AIRTIME_USE_TX)
>>>>>>>>>>> airtime += tx_airtime;
>>>>>>>>>>> if (sta->local->airtime_flags & AIRTIME_USE_RX)
>>>>>>>>>>> airtime += rx_airtime;
>>>>>>>>>>>
>>>>>>>>>>> + /* Weights scale so the unit weight is 256 */
>>>>>>>>>>> + airtime <<= 8;
>>>>>>>>>>> +
>>>>>>>>>>> spin_lock_bh(&local->active_txq_lock[ac]);
>>>>>>>>>>> +
>>>>>>>>>>> sta->airtime[ac].tx_airtime += tx_airtime;
>>>>>>>>>>> sta->airtime[ac].rx_airtime += rx_airtime;
>>>>>>>>>>> - sta->airtime[ac].deficit -= airtime;
>>>>>>>>>>> +
>>>>>>>>>>> + weight_sum = local->airtime_weight_sum[ac] ?:
>>>>>>>>>>> sta->airtime_weight;
>>>>>>>>>>> +
>>>>>>>>>>> + local->airtime_v_t[ac] += airtime / weight_sum;
>> Hi Toke,
>>
>> I was porting this version of ATF design to my ath10k platform and
>> found
>> my old kernel version not supporting 64bit division. I'm wondering if
>> it
>> is necessary to use u64 for airtime and weight_sum here though I can
>> find a solution for it. I think u32 might be enough. For airtime,
>> u32_max / 256 = 7182219 us(718 ms). As for weight_sum, u32_max / 8092
>> us
>> = 130490, meaning we can support more than 130000 nodes with airtime
>> weight 8092 us.
>
> As Felix said, we don't really want divides in the fast path at all.
> And
> since the divisors are constant, we should be able to just pre-compute
> reciprocals and turn the whole thing into multiplications...
>
>> Another finding was when I configured two 11ac STAs with different
>> airtime weight, such as 256 and 1024 meaning ratio is 1:4, the
>> throughput ratio was not roughly matching the ratio. Could you please
>> share your results? I am not sure if it is due to platform difference.
>
> Hmm, I tested them with ath9k where things seemed to work equivalently
> to the DRR. Are you testing the same hardware with that? Would be a
> good
> baseline.
>
> I am on vacation until the end of the month, but can share my actual
> test results once I get back...
Hi Toke,
I saw your commit in hostapd in
http://patchwork.ozlabs.org/patch/1059334/
For dynamic and limit mode described in above hostapd patch, do I need
to change any code in this kernel patch or any other patches am I
missing?
After a quick look at the hostapd patch, I guess all the efforts for
both modes are done in hostapd. Correct me if I am wrong. :)
>
> -Toke
--
Yibo
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox