Linux wireless drivers development
 help / color / mirror / Atom feed
* Re: [PATCH 2/2] ath10k: pci: remove unnecessary casts
From: Kalle Valo @ 2019-06-28  5:08 UTC (permalink / raw)
  To: Johannes Berg; +Cc: ath10k, linux-wireless
In-Reply-To: <a6c87741bc3e992bf61d2706834e069917018745.camel@sipsolutions.net>

Johannes Berg <johannes@sipsolutions.net> writes:

> On Thu, 2019-06-27 at 21:12 +0200, Johannes Berg wrote:
>> On Thu, 2019-06-27 at 21:47 +0300, Kalle Valo wrote:
>> > Fixes checkpatch warnings:
>> > 
>> > drivers/net/wireless/ath/ath10k/pci.c:926: unnecessary cast may
>> > hide bugs, see http://c-faq.com/malloc/ma
>> > drivers/net/wireless/ath/ath10k/pci.c:1072: unnecessary cast may
>> > hide bugs, see http://c-faq.com/malloc/m
>> 
>> I think you cut off the link there, did you mean
>> http://c-faq.com/malloc/mallocnocast.html perhaps?

Yes, thanks. Fixed now in the pending branch.

> Which I should've read before replying ... WHAT? We consider calling
> undeclared functions an *error* in the kernel, this is quite pointless.

Yeah, the link checkpatch provides is pointless. TBH I didn't even read
it until you commented on it :) But the patch is still good to have as
there's no point of use casting on void pointers, it's just extra cruft.
Right?

-- 
Kalle Valo

^ permalink raw reply

* Re: [PATCH 2/2] ath10k: pci: remove unnecessary casts
From: Johannes Berg @ 2019-06-27 19:15 UTC (permalink / raw)
  To: Kalle Valo, ath10k; +Cc: linux-wireless
In-Reply-To: <58e8952b87c8aa533c15fe5650f3f71288377f36.camel@sipsolutions.net>

On Thu, 2019-06-27 at 21:12 +0200, Johannes Berg wrote:
> On Thu, 2019-06-27 at 21:47 +0300, Kalle Valo wrote:
> > Fixes checkpatch warnings:
> > 
> > drivers/net/wireless/ath/ath10k/pci.c:926: unnecessary cast may hide bugs, see http://c-faq.com/malloc/ma
> > drivers/net/wireless/ath/ath10k/pci.c:1072: unnecessary cast may hide bugs, see http://c-faq.com/malloc/m
> 
> I think you cut off the link there, did you mean
> http://c-faq.com/malloc/mallocnocast.html perhaps?

Which I should've read before replying ... WHAT? We consider calling
undeclared functions an *error* in the kernel, this is quite pointless.

johannes


^ permalink raw reply

* Re: [PATCH 2/2] ath10k: pci: remove unnecessary casts
From: Johannes Berg @ 2019-06-27 19:12 UTC (permalink / raw)
  To: Kalle Valo, ath10k; +Cc: linux-wireless
In-Reply-To: <1561661250-30528-2-git-send-email-kvalo@codeaurora.org>

On Thu, 2019-06-27 at 21:47 +0300, Kalle Valo wrote:
> Fixes checkpatch warnings:
> 
> drivers/net/wireless/ath/ath10k/pci.c:926: unnecessary cast may hide bugs, see http://c-faq.com/malloc/ma
> drivers/net/wireless/ath/ath10k/pci.c:1072: unnecessary cast may hide bugs, see http://c-faq.com/malloc/m

I think you cut off the link there, did you mean
http://c-faq.com/malloc/mallocnocast.html perhaps?

johannes


^ permalink raw reply

* [PATCH 2/2] ath10k: pci: remove unnecessary casts
From: Kalle Valo @ 2019-06-27 18:47 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless
In-Reply-To: <1561661250-30528-1-git-send-email-kvalo@codeaurora.org>

Fixes checkpatch warnings:

drivers/net/wireless/ath/ath10k/pci.c:926: unnecessary cast may hide bugs, see http://c-faq.com/malloc/ma
drivers/net/wireless/ath/ath10k/pci.c:1072: unnecessary cast may hide bugs, see http://c-faq.com/malloc/m

While at it, also remove unnecessary initialisation of data_buf variable in both cases.

Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
---
 drivers/net/wireless/ath/ath10k/pci.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index 80bcb2ef5926..a0b4d265c6eb 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -909,7 +909,7 @@ static int ath10k_pci_diag_read_mem(struct ath10k *ar, u32 address, void *data,
 	/* Host buffer address in CE space */
 	u32 ce_data;
 	dma_addr_t ce_data_base = 0;
-	void *data_buf = NULL;
+	void *data_buf;
 	int i;
 
 	mutex_lock(&ar_pci->ce_diag_mutex);
@@ -923,10 +923,8 @@ static int ath10k_pci_diag_read_mem(struct ath10k *ar, u32 address, void *data,
 	 */
 	alloc_nbytes = min_t(unsigned int, nbytes, DIAG_TRANSFER_LIMIT);
 
-	data_buf = (unsigned char *)dma_alloc_coherent(ar->dev, alloc_nbytes,
-						       &ce_data_base,
-						       GFP_ATOMIC);
-
+	data_buf = dma_alloc_coherent(ar->dev, alloc_nbytes, &ce_data_base,
+				      GFP_ATOMIC);
 	if (!data_buf) {
 		ret = -ENOMEM;
 		goto done;
@@ -1054,7 +1052,7 @@ int ath10k_pci_diag_write_mem(struct ath10k *ar, u32 address,
 	u32 *buf;
 	unsigned int completed_nbytes, alloc_nbytes, remaining_bytes;
 	struct ath10k_ce_pipe *ce_diag;
-	void *data_buf = NULL;
+	void *data_buf;
 	dma_addr_t ce_data_base = 0;
 	int i;
 
@@ -1069,10 +1067,8 @@ int ath10k_pci_diag_write_mem(struct ath10k *ar, u32 address,
 	 */
 	alloc_nbytes = min_t(unsigned int, nbytes, DIAG_TRANSFER_LIMIT);
 
-	data_buf = (unsigned char *)dma_alloc_coherent(ar->dev,
-						       alloc_nbytes,
-						       &ce_data_base,
-						       GFP_ATOMIC);
+	data_buf = dma_alloc_coherent(ar->dev, alloc_nbytes, &ce_data_base,
+				      GFP_ATOMIC);
 	if (!data_buf) {
 		ret = -ENOMEM;
 		goto done;
-- 
2.7.4


^ permalink raw reply related

* [PATCH 1/2] ath10k: remove unnecessary 'out of memory' message
From: Kalle Valo @ 2019-06-27 18:47 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless

Fixes checkpatch warning:

drivers/net/wireless/ath/ath10k/swap.c:110: Possible unnecessary 'out of memory' message

Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
---
 drivers/net/wireless/ath/ath10k/swap.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/swap.c b/drivers/net/wireless/ath/ath10k/swap.c
index 4dddeee684b4..7198a386f2fb 100644
--- a/drivers/net/wireless/ath/ath10k/swap.c
+++ b/drivers/net/wireless/ath/ath10k/swap.c
@@ -106,10 +106,8 @@ ath10k_swap_code_seg_alloc(struct ath10k *ar, size_t swap_bin_len)
 
 	virt_addr = dma_alloc_coherent(ar->dev, swap_bin_len, &paddr,
 				       GFP_KERNEL);
-	if (!virt_addr) {
-		ath10k_err(ar, "failed to allocate dma coherent memory\n");
+	if (!virt_addr)
 		return NULL;
-	}
 
 	seg_info->seg_hw_info.bus_addr[0] = __cpu_to_le32(paddr);
 	seg_info->seg_hw_info.size = __cpu_to_le32(swap_bin_len);
-- 
2.7.4


^ permalink raw reply related

* Re: [PATCH v3] ath9k: add loader for AR92XX (and older) pci(e)
From: Kalle Valo @ 2019-06-27 18:13 UTC (permalink / raw)
  To: Christian Lamparter; +Cc: linux-wireless, QCA ath9k Development, Julian Calaby
In-Reply-To: <20190609203621.13015-1-chunkeey@gmail.com>

Christian Lamparter <chunkeey@gmail.com> writes:

> Atheros cards with a AR92XX generation (and older) chip usually
> store their pci(e) initialization vectors on an external eeprom chip.
> However these chips technically don't need the eeprom chip attached,
> the AR9280 Datasheet in section "6.1.2 DEVICE_ID" describes that
> "... if the EEPROM content is not valid, a value of 0xFF1C returns
> when read from the register". So, they will show up on the system's
> pci bus. However in that state, ath9k can't load, since it relies
> on having the correct pci-id, otherwise it doesn't know what chip it
> actually is. This happens on many embedded devices like routers
> and accesspoint since they want to keep the BOM low and store the
> pci(e) initialization vectors together with the calibration data
> on the system's FLASH, which is out of reach of the ath9k chip.
>
> Furthermore, Some devices (like the Cisco Meraki Z1 Cloud Managed
> Teleworker Gateway) need to be able to initialize the PCIe wifi device.
> Normally, this should be done as a pci quirk during the early stages of
> booting linux. However, this isn't possible for devices which have the
> init code for the Atheros chip stored on NAND in an UBI volume.
> Hence, this module can be used to initialize the chip when the
> user-space is ready to extract the init code.
>
> Martin Blumenstingl prodived the following fixes:
> owl-loader: add support for OWL emulation PCI devices
> owl-loader: don't re-scan the bus when ath9k_pci_fixup failed
> owl-loader: use dev_* instead of pr_* logging functions
> owl-loader: auto-generate the eeprom filename as fallback
> owl-loader: add a debug message when swapping the eeprom data
> owl-loader: add missing newlines in log messages
>
> Reviewed-by: Julian Calaby <julian.calaby@gmail.com>
> Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>

[...]

> --- /dev/null
> +++ b/drivers/net/wireless/ath/ath9k/ath9k_pci_owl_loader.c
> @@ -0,0 +1,215 @@
> +// SPDX-License-Identifier: GPL-2.0

[...]

> +MODULE_LICENSE("GPL v2");

ath9k has ISC license, is there a specific reason why you chose GPLv2
here instead of ISC? I don't like mixing licenses within a driver,
that's why I'm asking.

-- 
Kalle Valo

^ permalink raw reply

* Re: [PATCH] ath10k: add new hw_ops for sdio chip
From: Kalle Valo @ 2019-06-27 17:59 UTC (permalink / raw)
  To: Wen Gong; +Cc: ath10k, linux-wireless
In-Reply-To: <1560757048-19223-1-git-send-email-wgong@codeaurora.org>

Wen Gong <wgong@codeaurora.org> wrote:

> It report error message while suspend/resume test.
> dmesg log:
> [  150.749962] ath10k_sdio mmc1:0001:1: hif read32 not supported
> [  150.755728] ath10k_sdio mmc1:0001:1: failed to set coverage class: expected integer microsecond value in register
> 
> Reason is sdio chip does not support set_coverage_class as well as
> pcie chip, remove the set_coverage_class handler will avoid it.
> 
> callstack of the error message:
> OUTLINED_FUNCTION_6+0xc/0x14 [ath10k_core]
> ath10k_mac_op_set_coverage_class+0x2c/0x40 [ath10k_core]
> ieee80211_reconfig+0x5d0/0x108c [mac80211]
> ieee80211_resume+0x34/0x6c [mac80211]
> wiphy_resume+0xbc/0x13c [cfg80211]
> dpm_run_callback+0xa4/0x168
> device_resume+0x1d4/0x200
> async_resume+0x1c/0x34
> async_run_entry_fn+0x48/0xf8
> process_one_work+0x178/0x2f8
> worker_thread+0x1d8/0x2cc
> kthread+0x11c/0x12c
> ret_from_fork+0x10/0x18
> 
> the error log will not happen after this patch applied.
> 
> Tested with QCA6174 SDIO with firmware
> WLAN.RMH.4.4.1-00007-QCARMSWP-1.
> 
> Signed-off-by: Wen Gong <wgong@codeaurora.org>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

Patch applied to ath-next branch of ath.git, thanks.

6b4021deb03f ath10k: add new hw_ops for sdio chip

-- 
https://patchwork.kernel.org/patch/10998099/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply

* Re: [PATCH 01/11] wil6210: do not reset FW in STA to P2P client interface switch
From: Kalle Valo @ 2019-06-27 17:51 UTC (permalink / raw)
  To: Maya Erez; +Cc: Alexei Avshalom Lazar, linux-wireless, wil6210, Maya Erez
In-Reply-To: <1560669967-23706-2-git-send-email-merez@codeaurora.org>

Maya Erez <merez@codeaurora.org> wrote:

> Currently the FW is reset on every interface type change, because
> of various FW bugs.
> FW reset is not required when switching from STA to P2P client, hence
> can be skipped.
> 
> Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org>
> Signed-off-by: Maya Erez <merez@codeaurora.org>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

11 patches applied to ath-next branch of ath.git, thanks.

b913e33076c8 wil6210: do not reset FW in STA to P2P client interface switch
c903ece596cb wil6210: enlarge Tx status ring size
96b77bb04470 wil6210: increase the frequency of status ring hw tail update
c5b3a6582b1e wil6210: Add support for setting RBUFCAP configuration
dedec35b4019 wil6210: fix printout in wil_read_pmccfg
f2b6b46e483b wil6210: clear FW and ucode log address
c478ac9daae6 wil6210: update cid boundary check of wil_find_cid/_by_idx()
3e7ee09d36a6 wil6210: publish max_msdu_size to FW on BCAST ring
9b586118730e wil6210: add support for reading multiple RFs temperature via debugfs
2a32c20b76af wil6210: set WIL_WMI_CALL_GENERAL_TO_MS as wmi_call timeout
1a276003111c wil6210: drop old event after wmi_call timeout

-- 
https://patchwork.kernel.org/patch/10997287/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply

* Re: [PATCH] wireless: wil6210: no need to check return value of debugfs_create functions
From: Kalle Valo @ 2019-06-27 17:48 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Maya Erez, David S. Miller, linux-wireless, wil6210
In-Reply-To: <20190611191024.GA17227@kroah.com>

Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:

> When calling debugfs functions, there is no need to ever check the
> return value.  The function can work or not, but the code logic should
> never do something different based on this.
> 
> Cc: Maya Erez <merez@codeaurora.org>
> Cc: Kalle Valo <kvalo@codeaurora.org>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: linux-wireless@vger.kernel.org
> Cc: wil6210@qti.qualcomm.com
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Reviewed-by: Maya Erez <merez@codeaurora.org>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

Patch applied to ath-next branch of ath.git, thanks.

ce564170dfe5 wil6210: no need to check return value of debugfs_create functions

-- 
https://patchwork.kernel.org/patch/10988197/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply

* Re: [PATCH] carl9170: remove dead branch in op_conf_tx callback
From: Kalle Valo @ 2019-06-27 17:48 UTC (permalink / raw)
  To: Christian Lamparter; +Cc: linux-wireless
In-Reply-To: <20190615100009.14654-1-chunkeey@gmail.com>

Christian Lamparter <chunkeey@gmail.com> wrote:

> This patch removes the error branch for (queue > ar->hw->queues).
> It is no longer needed anymore as the "queue" value is validated by
> cfg80211's parse_txq_params() before the driver code gets called.
> 
> Some background:
> In the old days (linux 2.6 and early 3.x), the parse_txq_params()
> function did not verify the "queue" value. That's why these drivers
> had to do it.
> 
> Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

Patch applied to ath-next branch of ath.git, thanks.

4ba641262b91 carl9170: remove dead branch in op_conf_tx callback

-- 
https://patchwork.kernel.org/patch/10997023/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply

* Re: [PATCH v2] carl9170: fix misuse of device driver API
From: Kalle Valo @ 2019-06-27 17:47 UTC (permalink / raw)
  To: Christian Lamparter; +Cc: linux-wireless, linux-usb, Alan Stern
In-Reply-To: <20190608144947.744-3-chunkeey@gmail.com>

Christian Lamparter <chunkeey@gmail.com> wrote:

> This patch follows Alan Stern's recent patch:
> "p54: Fix race between disconnect and firmware loading"
> 
> that overhauled carl9170 buggy firmware loading and driver
> unbinding procedures.
> 
> Since the carl9170 code was adapted from p54 it uses the
> same functions and is likely to have the same problem, but
> it's just that the syzbot hasn't reproduce them (yet).
> 
> a summary from the changes (copied from the p54 patch):
>  * Call usb_driver_release_interface() rather than
>    device_release_driver().
> 
>  * Lock udev (the interface's parent) before unbinding the
>    driver instead of locking udev->parent.
> 
>  * During the firmware loading process, take a reference
>    to the USB interface instead of the USB device.
> 
>  * Don't take an unnecessary reference to the device during
>    probe (and then don't drop it during disconnect).
> 
> and
> 
>  * Make sure to prevent use-after-free bugs by explicitly
>    setting the driver context to NULL after signaling the
>    completion.
> 
> Cc: <stable@vger.kernel.org>
> Cc: Alan Stern <stern@rowland.harvard.edu>
> Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
> Acked-by: Alan Stern <stern@rowland.harvard.edu>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

Patch applied to ath-next branch of ath.git, thanks.

feb09b293327 carl9170: fix misuse of device driver API

-- 
https://patchwork.kernel.org/patch/10983223/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply

* [PATCH 76/87] wireless: quantenna: pcie: remove memset after dmam_alloc_coherent
From: Fuqian Huang @ 2019-06-27 17:46 UTC (permalink / raw)
  Cc: Fuqian Huang, Igor Mitsyanko, Avinash Patil, Sergey Matyukevich,
	Kalle Valo, David S. Miller, Andrey Shevchenko, linux-wireless,
	netdev, linux-kernel

In commit af7ddd8a627c
("Merge tag 'dma-mapping-4.21' of git://git.infradead.org/users/hch/dma-mapping"),
dmam_alloc_coherent has already zeroed the memory.
So memset is not needed.

Signed-off-by: Fuqian Huang <huangfq.daxian@gmail.com>
---
 drivers/net/wireless/quantenna/qtnfmac/pcie/pearl_pcie.c | 2 --
 drivers/net/wireless/quantenna/qtnfmac/pcie/topaz_pcie.c | 2 --
 2 files changed, 4 deletions(-)

diff --git a/drivers/net/wireless/quantenna/qtnfmac/pcie/pearl_pcie.c b/drivers/net/wireless/quantenna/qtnfmac/pcie/pearl_pcie.c
index 3aa3714d4dfd..5ec1c9bc1612 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/pcie/pearl_pcie.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/pcie/pearl_pcie.c
@@ -244,8 +244,6 @@ static int pearl_alloc_bd_table(struct qtnf_pcie_pearl_state *ps)
 
 	/* tx bd */
 
-	memset(vaddr, 0, len);
-
 	ps->bd_table_vaddr = vaddr;
 	ps->bd_table_paddr = paddr;
 	ps->bd_table_len = len;
diff --git a/drivers/net/wireless/quantenna/qtnfmac/pcie/topaz_pcie.c b/drivers/net/wireless/quantenna/qtnfmac/pcie/topaz_pcie.c
index 9a4380ed7f1b..1f91088e3dff 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/pcie/topaz_pcie.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/pcie/topaz_pcie.c
@@ -199,8 +199,6 @@ static int topaz_alloc_bd_table(struct qtnf_pcie_topaz_state *ts,
 	if (!vaddr)
 		return -ENOMEM;
 
-	memset(vaddr, 0, len);
-
 	/* tx bd */
 
 	ts->tx_bd_vbase = vaddr;
-- 
2.11.0


^ permalink raw reply related

* Re: [PATCH v2] ath9k: correctly handle short radar pulses (fixes 3c0efb745a)
From: Kalle Valo @ 2019-06-27 17:46 UTC (permalink / raw)
  To: Zefir Kurtisi; +Cc: linux-wireless, nbd
In-Reply-To: <20190611133656.16964-1-zefir.kurtisi@neratec.com>

Zefir Kurtisi <zefir.kurtisi@neratec.com> wrote:

> In commit 3c0efb745a17 ("ath9k: discard undersized packets")
> the lower bound of RX packets was set to 10 (min ACK size) to
> filter those that would otherwise be treated as invalid at
> mac80211.
> 
> Alas, short radar pulses are reported as PHY_ERROR frames
> with length set to 3. Therefore their detection stopped
> working after that commit.
> 
> NOTE: ath9k drivers built thereafter will not pass DFS
> certification.
> 
> This extends the criteria for short packets to explicitly
> handle PHY_ERROR frames.
> 
> Fixes: 3c0efb745a17 ("ath9k: discard undersized packets")
> Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

Patch applied to ath-next branch of ath.git, thanks.

df5c4150501e ath9k: correctly handle short radar pulses

-- 
https://patchwork.kernel.org/patch/10986957/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply

* [PATCH 77/87] wireless: broadcom: remove memset after dma_alloc_coherent
From: Fuqian Huang @ 2019-06-27 17:45 UTC (permalink / raw)
  Cc: Fuqian Huang, Arend van Spriel, Franky Lin, Hante Meuleman,
	Chi-Hsien Lin, Wright Feng, Kalle Valo, David S. Miller,
	Rafał Miłecki, Hans de Goede, Luis Chamberlain,
	linux-wireless, brcm80211-dev-list.pdl, brcm80211-dev-list,
	netdev, linux-kernel

In commit af7ddd8a627c
("Merge tag 'dma-mapping-4.21' of git://git.infradead.org/users/hch/dma-mapping"),
dma_alloc_coherent has already zeroed the memory.
So memset is not needed.

Signed-off-by: Fuqian Huang <huangfq.daxian@gmail.com>
---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
index 83e4938527f4..3fc08fe7c3a2 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
@@ -1033,8 +1033,6 @@ brcmf_pcie_init_dmabuffer_for_device(struct brcmf_pciedev_info *devinfo,
 			       address & 0xffffffff);
 	brcmf_pcie_write_tcm32(devinfo, tcm_dma_phys_addr + 4, address >> 32);
 
-	memset(ring, 0, size);
-
 	return (ring);
 }
 
-- 
2.11.0


^ permalink raw reply related

* [PATCH 78/87] wireless: ath10k: remove memset after dma_alloc_coherent
From: Fuqian Huang @ 2019-06-27 17:45 UTC (permalink / raw)
  Cc: Fuqian Huang, Kalle Valo, David S. Miller, ath10k, linux-wireless,
	netdev, linux-kernel

In commit af7ddd8a627c
("Merge tag 'dma-mapping-4.21' of git://git.infradead.org/users/hch/dma-mapping"),
dma_alloc_coherent has already zeroed the memory.
So memset is not needed.

Signed-off-by: Fuqian Huang <huangfq.daxian@gmail.com>
---
 drivers/net/wireless/ath/ath10k/ce.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/ce.c b/drivers/net/wireless/ath/ath10k/ce.c
index eca87f7c5b6c..294fbc1e89ab 100644
--- a/drivers/net/wireless/ath/ath10k/ce.c
+++ b/drivers/net/wireless/ath/ath10k/ce.c
@@ -1704,9 +1704,6 @@ ath10k_ce_alloc_dest_ring_64(struct ath10k *ar, unsigned int ce_id,
 	/* Correctly initialize memory to 0 to prevent garbage
 	 * data crashing system when download firmware
 	 */
-	memset(dest_ring->base_addr_owner_space_unaligned, 0,
-	       nentries * sizeof(struct ce_desc_64) + CE_DESC_RING_ALIGN);
-
 	dest_ring->base_addr_owner_space =
 			PTR_ALIGN(dest_ring->base_addr_owner_space_unaligned,
 				  CE_DESC_RING_ALIGN);
@@ -2019,8 +2016,6 @@ void ath10k_ce_alloc_rri(struct ath10k *ar)
 		value |= ar->hw_ce_regs->upd->mask;
 		ath10k_ce_write32(ar, ce_base_addr + ctrl1_regs, value);
 	}
-
-	memset(ce->vaddr_rri, 0, CE_COUNT * sizeof(u32));
 }
 EXPORT_SYMBOL(ath10k_ce_alloc_rri);
 
-- 
2.11.0


^ permalink raw reply related

* Re: [PATCH 01/11] rtw88: resolve order of tx power setting routines
From: Kalle Valo @ 2019-06-27 17:27 UTC (permalink / raw)
  To: yhchuang; +Cc: linux-wireless
In-Reply-To: <1559116487-5244-2-git-send-email-yhchuang@realtek.com>

<yhchuang@realtek.com> wrote:

> From: Yan-Hsuan Chuang <yhchuang@realtek.com>
> 
> Some functions that should be static are unnecessarily exposed, remove
> their declaration in header file phy.h.
> 
> After resolving their declaration order, they can be declared as static.
> So this commit changes nothing except the order and marking them static.
> 
> Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>

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

fa6dfe6bff24 rtw88: resolve order of tx power setting routines
226746fd1201 rtw88: do not use (void *) as argument
43712199e05b rtw88: unify prefixes for tx power setting routine
522801493e7b rtw88: remove unused variable
764038160aea rtw88: fix incorrect tx power limit at 5G
adf3c676d1d2 rtw88: choose the lowest as world-wide power limit
93f68a865f11 rtw88: correct power limit selection
191c4257ba19 rtw88: update tx power limit table to RF v20
0d350f0a91f2 rtw88: remove all RTW_MAX_POWER_INDEX macro
b741422218ef rtw88: refine flow to get tx power index

-- 
https://patchwork.kernel.org/patch/10966415/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply

* Re: [PATCH v2 1/2] mwifiex: dispatch/rotate from reorder table atomically
From: Kalle Valo @ 2019-06-27 16:51 UTC (permalink / raw)
  To: Brian Norris
  Cc: Ganapathi Bhat, Nishant Sarmukadam, Amitkumar Karwar, Xinming Hu,
	linux-kernel, linux-wireless, Brian Norris
In-Reply-To: <20190625174045.125223-2-briannorris@chromium.org>

Brian Norris <briannorris@chromium.org> wrote:

> mwifiex_11n_scan_and_dispatch() and
> mwifiex_11n_dispatch_pkt_until_start_win() share similar patterns, where
> they perform a few different actions on the same table, using the same
> lock, but non-atomically. There have been other attempts to clean up
> this sort of behavior, but they have had problems (incomplete;
> introducing new deadlocks).
> 
> We can improve these functions' atomicity by queueing up our RX packets
> in a list, to dispatch at the end of the function. This avoids problems
> of another operation modifying the table in between our dispatch and
> rotation operations.
> 
> This was inspired by investigations around this:
> 
>   http://lkml.kernel.org/linux-wireless/20181130175957.167031-1-briannorris@chromium.org
>   Subject: [4.20 PATCH] Revert "mwifiex: restructure rx_reorder_tbl_lock usage"
> 
> While the original (now-reverted) patch had good intentions in
> restructuring some of the locking patterns in this driver, it missed an
> important detail: we cannot defer to softirq contexts while already in
> an atomic context. We can help avoid this sort of problem by separating
> the two steps of:
> (1) iterating / clearing the mwifiex reordering table
> (2) dispatching received packets to upper layers
> 
> This makes it much harder to make lock recursion mistakes, as these
> two steps no longer need to hold the same locks.
> 
> Testing: I've played with a variety of stress tests, including download
> stress tests on the same APs which caught regressions with commit
> 5188d5453bc9 ("mwifiex: restructure rx_reorder_tbl_lock usage"). I've
> primarily tested on Marvell 8997 / PCIe, although I've given 8897 / SDIO
> a quick spin as well.
> 
> Signed-off-by: Brian Norris <briannorris@chromium.org>
> Acked-by: Ganapathi Bhat <gbhat@marvell.com>

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

ce2e942e32e8 mwifiex: dispatch/rotate from reorder table atomically
8a7f9fd8a3e0 mwifiex: don't disable hardirqs; just softirqs

-- 
https://patchwork.kernel.org/patch/11016151/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply

* Re: [PATCH v4 wireless-drivers] mt76: usb: fix rx A-MSDU support
From: Kalle Valo @ 2019-06-27 16:49 UTC (permalink / raw)
  To: Lorenzo Bianconi; +Cc: nbd, lorenzo.bianconi, linux-wireless, sgruszka
In-Reply-To: <7d93cba766b5a0220c86fa900f9d29048d67e02c.1560607085.git.lorenzo@kernel.org>

Lorenzo Bianconi <lorenzo@kernel.org> wrote:

> Commit f8f527b16db5 ("mt76: usb: use EP max packet aligned buffer sizes
> for rx") breaks A-MSDU support. When A-MSDU is enable the device can
> receive frames up to q->buf_size but they will be discarded in
> mt76u_process_rx_entry since there is no enough room for
> skb_shared_info. Fix the issue reallocating the skb and copying in the
> linear area the first 128B of the received frames and in the frag_list
> the remaining part
> 
> Fixes: f8f527b16db5 ("mt76: usb: use EP max packet aligned buffer sizes for rx")
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>

Patch applied to wireless-drivers.git, thanks.

2a92b08b1855 mt76: usb: fix rx A-MSDU support

-- 
https://patchwork.kernel.org/patch/10997119/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply

* [PATCH] mt76: mt7615: fix sparse warnings: warning: restricted __le16 degrades to integer
From: Lorenzo Bianconi @ 2019-06-27 14:49 UTC (permalink / raw)
  To: nbd; +Cc: lorenzo.bianconi, linux-wireless, ryder.lee, royluo

Fix the following sparse warning in __mt7615_mcu_msg_send:
drivers/net/wireless/mediatek/mt76/mt7615/mcu.c:78:15: sparse: warning:
restricted __le16 degrades to integer
drivers/net/wireless/mediatek/mt76/mt7615/mcu.c:78:15: sparse: warning:
cast from restricted __le16

Fixes: 04b8e65922f6 ("mt76: add mac80211 driver for MT7615 PCIe-based chipsets")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 drivers/net/wireless/mediatek/mt76/mt7615/mcu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
index beee25e69053..cc6da5145d12 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
@@ -75,7 +75,7 @@ static int __mt7615_mcu_msg_send(struct mt7615_dev *dev, struct sk_buff *skb,
 
 	txd = mcu_txd->txd;
 
-	val = FIELD_PREP(MT_TXD0_TX_BYTES, cpu_to_le16(skb->len)) |
+	val = FIELD_PREP(MT_TXD0_TX_BYTES, skb->len) |
 	      FIELD_PREP(MT_TXD0_P_IDX, MT_TX_PORT_IDX_MCU) |
 	      FIELD_PREP(MT_TXD0_Q_IDX, q_idx);
 	txd[0] = cpu_to_le32(val);
-- 
2.21.0


^ permalink raw reply related

* [PATCH] drivers: net: wireless: rsi: return explicit error values
From: Enrico Weigelt, metux IT consult @ 2019-06-27 14:30 UTC (permalink / raw)
  To: linux-kernel; +Cc: amitkarwar, siva8118, kvalo, linux-wireless, netdev

From: Enrico Weigelt <info@metux.net>

Explicitly return constants instead of variable (and rely on
it to be explicitly initialized), if the value is supposed
to be fixed anyways. Align it with the rest of the driver,
which does it the same way.

Signed-off-by: Enrico Weigelt <info@metux.net>
---
 drivers/net/wireless/rsi/rsi_91x_sdio.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/rsi/rsi_91x_sdio.c b/drivers/net/wireless/rsi/rsi_91x_sdio.c
index b42cd50..2a3577d 100644
--- a/drivers/net/wireless/rsi/rsi_91x_sdio.c
+++ b/drivers/net/wireless/rsi/rsi_91x_sdio.c
@@ -844,11 +844,11 @@ static int rsi_init_sdio_interface(struct rsi_hw *adapter,
 				   struct sdio_func *pfunction)
 {
 	struct rsi_91x_sdiodev *rsi_91x_dev;
-	int status = -ENOMEM;
+	int status;
 
 	rsi_91x_dev = kzalloc(sizeof(*rsi_91x_dev), GFP_KERNEL);
 	if (!rsi_91x_dev)
-		return status;
+		return -ENOMEM;
 
 	adapter->rsi_dev = rsi_91x_dev;
 
@@ -890,7 +890,7 @@ static int rsi_init_sdio_interface(struct rsi_hw *adapter,
 #ifdef CONFIG_RSI_DEBUGFS
 	adapter->num_debugfs_entries = MAX_DEBUGFS_ENTRIES;
 #endif
-	return status;
+	return 0;
 fail:
 	sdio_disable_func(pfunction);
 	sdio_release_host(pfunction);
-- 
1.9.1


^ permalink raw reply related

* Re: [PATCH 1/4] b43legacy: remove b43legacy_dma_set_mask
From: Kalle Valo @ 2019-06-27 11:38 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Larry Finger, b43-dev, linux-wireless, netdev, linux-kernel
In-Reply-To: <20190625102932.32257-2-hch@lst.de>

Christoph Hellwig <hch@lst.de> wrote:

> These days drivers are not required to fallback to smaller DMA masks,
> but can just set the largest mask they support, removing the need for
> this trial and error logic.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Tested-by: Larry Finger <Larry.Finger@lwfinger.net>

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

258989000849 b43legacy: remove b43legacy_dma_set_mask
80372782e4cb b43legacy: simplify engine type / DMA mask selection
c897523febae b43: remove b43_dma_set_mask
288aa4ee7acf b43: simplify engine type / DMA mask selection

-- 
https://patchwork.kernel.org/patch/11015245/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply

* pull request: mt76 2019-06-27
From: Felix Fietkau @ 2019-06-27 11:03 UTC (permalink / raw)
  To: Kalle Valo; +Cc: linux-wireless

Hi Kalle,

here's my first pull request for 5.3

- Felix

The following changes since commit e5db0ad7563c38b7b329504836c9a64ae025a47a:

  airo: switch to skcipher interface (2019-06-25 08:12:20 +0300)

are available in the Git repository at:

  https://github.com/nbd168/wireless tags/mt76-for-kvalo-2019-06-27

for you to fetch changes up to 676fabd1d2f089f9fb8bece3476c2ab5584b4a1a:

  mt76: mt7603: fix sparse warnings: warning: incorrect type in assignment (different base types) (2019-06-27 12:59:07 +0200)

----------------------------------------------------------------
mt76 patches for 5.3

* use NAPI polling for tx cleanup on mt7603/mt7615
* various fixes for mt7615
* unify some code between mt7603 and mt7615
* fix locking issues on mt76x02
* add support for toggling edcca on mt7603
* fix reading target tx power with ext PA on mt7603/mt7615
* fix initalizing channel maximum power
* fix rate control / tx status reporting issues on mt76x02/mt7603
* add support for eeprom calibration data from mtd on mt7615
* support configuring tx power on mt7615
* fix external PA support on mt76x0
* per-chain signal reporting on mt7615
* rx/tx buffer fixes for USB devices

----------------------------------------------------------------
Dan Carpenter (2):
      mt76: Fix a signedness bug in mt7615_add_interface()
      mt76: mt7615: Use after free in mt7615_mcu_set_bcn()

Felix Fietkau (7):
      mt76: mt7603: fix reading target tx power from eeprom
      mt76: fix setting chan->max_power
      mt76: mt76x02: fix tx status reporting issues
      mt76: mt76x02: fix tx reordering on rate control probing without a-mpdu
      mt76: mt76x0: fix RF frontend initialization for external PA
      mt76: mt7603: rework and fix tx status reporting
      mt76: mt7603: improve hardware rate switching configuration

Lorenzo Bianconi (53):
      mt76: mt76x02: remove useless return in mt76x02_resync_beacon_timer
      mt76: move tx_napi in mt76_dev
      mt76: mt7603: use napi polling for tx cleanup
      mt76: mt7615: use napi polling for tx cleanup
      mt76: move netif_napi_del in mt76_dma_cleanup
      mt7615: mcu: simplify __mt7615_mcu_set_wtbl
      mt7615: mcu: simplify __mt7615_mcu_set_sta_rec
      mt7615: mcu: remove bss_info_convert_vif_type routine
      mt7615: mcu: use proper msg size in mt7615_mcu_add_wtbl_bmc
      mt7615: mcu: use proper msg size in mt7615_mcu_add_wtbl
      mt7615: mcu: unify mt7615_mcu_add_wtbl_bmc and mt7615_mcu_del_wtbl_bmc
      mt7615: mcu: remove unused parameter in mt7615_mcu_del_wtbl
      mt7615: remove query from mt7615_mcu_msg_send signature
      mt7615: remove dest from mt7615_mcu_msg_send signature
      mt7615: mcu: remove skb_ret from mt7615_mcu_msg_send
      mt7615: mcu: unify __mt7615_mcu_set_dev_info and mt7615_mcu_set_dev_info
      mt7615: mcu: do not use function pointers whenever possible
      mt7615: mcu: remove unused structure in mcu.h
      mt7615: mcu: use standard signature for mt7615_mcu_msg_send
      mt7615: initialize mt76_mcu_ops data structure
      mt7615: mcu: init mcu_restart function pointer
      mt7615: mcu: run __mt76_mcu_send_msg in mt7615_mcu_send_firmware
      mt76: mt7603: stop mac80211 queues before setting the channel
      mt76: mt7615: rearrange cleanup operations in mt7615_unregister_device
      mt76: mt7615: add static qualifier to mt7615_rx_poll_complete
      mt76: mt76x02: remove enable from mt76x02_edcca_init signature
      mt76: mt76x2u: remove mt76x02_edcca_init in mt76x2u_set_channel
      mt76: mt76x2: move mutex_lock inside mt76x2_set_channel
      mt76: mt76x02: run mt76x02_edcca_init atomically in mt76_edcca_set
      mt76: mt7603: add debugfs knob to enable/disable edcca
      mt76: mt76x02: fix edcca file permission
      mt76: mt7615: do not process rx packets if the device is not initialized
      mt76: move mt76_insert_ccmp_hdr in mt76-module
      mt76: mt7615: add support for mtd eeprom parsing
      mt76: mt7615: select wifi band according to eeprom
      mt76: generalize mt76_get_txpower for 4x4:4 devices
      mt76: mt7615: add the capability to configure tx power
      mt76: mt7615: init get_txpower mac80211 callback
      mt76: mt7615: rearrange locking in mt7615_config
      mt76: move mt76_get_rate in mt76-module
      mt76: mt7615: remove unused variable in mt7615_mcu_set_bcn
      mt76: mt7615: remove key check in mt7615_mcu_set_wtbl_key
      mt76: mt7615: simplify mt7615_mcu_set_sta_rec routine
      mt76: mt7615: init per-channel target power
      mt76: mt7615: take into account extPA when configuring tx power
      mt76: mt76x02u: fix sparse warnings: should it be static?
      mt76: mt76u: reduce rx memory footprint
      mt76: mt7615: remove cfg80211_chan_def from mt7615_set_channel signature
      mt76: move nl80211_dfs_regions in mt76_dev data structure
      mt76: mt76u: get rid of {out,in}_max_packet
      mt76: mt7615: fix sparse warnings: incorrect type in assignment (different base types)
      mt76: mt7615: fix sparse warnings: warning: cast from restricted __le16
      mt76: mt7603: fix sparse warnings: warning: incorrect type in assignment (different base types)

Ryder Lee (5):
      mt76: mt7615: enable support for mesh
      mt76: mt7615: fix slow performance when enable encryption
      mt76: mt7615: add support for per-chain signal strength reporting
      mt76: mt7615: fix incorrect settings in mesh mode
      mt76: mt7615: update peer's bssid when state transition occurs

YueHaibing (2):
      mt76: mt7615: Make mt7615_irq_handler static
      mt76: Remove set but not used variables 'pid' and 'final_mpdu'

 drivers/net/wireless/mediatek/mt76/dma.c              |    1 +
 drivers/net/wireless/mediatek/mt76/mac80211.c         |   62 ++++-
 drivers/net/wireless/mediatek/mt76/mt76.h             |   23 +-
 drivers/net/wireless/mediatek/mt76/mt7603/core.c      |    2 +-
 drivers/net/wireless/mediatek/mt76/mt7603/debugfs.c   |   30 +++
 drivers/net/wireless/mediatek/mt76/mt7603/dma.c       |   29 ++-
 drivers/net/wireless/mediatek/mt76/mt7603/eeprom.h    |    2 +
 drivers/net/wireless/mediatek/mt76/mt7603/init.c      |   26 +-
 drivers/net/wireless/mediatek/mt76/mt7603/mac.c       |  191 ++++++++-------
 drivers/net/wireless/mediatek/mt76/mt7603/main.c      |    8 +-
 drivers/net/wireless/mediatek/mt76/mt7603/mcu.c       |    2 +-
 drivers/net/wireless/mediatek/mt76/mt7603/mt7603.h    |   15 +-
 drivers/net/wireless/mediatek/mt76/mt7603/regs.h      |    6 +
 drivers/net/wireless/mediatek/mt76/mt7615/dma.c       |   23 +-
 drivers/net/wireless/mediatek/mt76/mt7615/eeprom.c    |   97 +++++++-
 drivers/net/wireless/mediatek/mt76/mt7615/eeprom.h    |   61 +++++
 drivers/net/wireless/mediatek/mt76/mt7615/init.c      |   77 +++++-
 drivers/net/wireless/mediatek/mt76/mt7615/mac.c       |   85 +++----
 drivers/net/wireless/mediatek/mt76/mt7615/mac.h       |    5 +
 drivers/net/wireless/mediatek/mt76/mt7615/main.c      |   52 ++--
 drivers/net/wireless/mediatek/mt76/mt7615/mcu.c       | 1265 ++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------
 drivers/net/wireless/mediatek/mt76/mt7615/mcu.h       |   56 ++---
 drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h    |   16 +-
 drivers/net/wireless/mediatek/mt76/mt7615/pci.c       |    7 +-
 drivers/net/wireless/mediatek/mt76/mt76x0/init.c      |    5 +-
 drivers/net/wireless/mediatek/mt76/mt76x0/main.c      |    2 +-
 drivers/net/wireless/mediatek/mt76/mt76x0/phy.c       |   13 +-
 drivers/net/wireless/mediatek/mt76/mt76x0/usb.c       |    2 +-
 drivers/net/wireless/mediatek/mt76/mt76x02.h          |    1 -
 drivers/net/wireless/mediatek/mt76/mt76x02_beacon.c   |    4 +-
 drivers/net/wireless/mediatek/mt76/mt76x02_debugfs.c  |   10 +-
 drivers/net/wireless/mediatek/mt76/mt76x02_dfs.c      |   18 +-
 drivers/net/wireless/mediatek/mt76/mt76x02_dfs.h      |    2 -
 drivers/net/wireless/mediatek/mt76/mt76x02_eeprom.h   |    1 +
 drivers/net/wireless/mediatek/mt76/mt76x02_mac.c      |  106 ++++++--
 drivers/net/wireless/mediatek/mt76/mt76x02_mac.h      |    2 +-
 drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c     |   18 +-
 drivers/net/wireless/mediatek/mt76/mt76x02_regs.h     |    3 +
 drivers/net/wireless/mediatek/mt76/mt76x02_txrx.c     |    9 +-
 drivers/net/wireless/mediatek/mt76/mt76x02_usb_core.c |   11 +-
 drivers/net/wireless/mediatek/mt76/mt76x2/init.c      |    9 +-
 drivers/net/wireless/mediatek/mt76/mt76x2/pci_main.c  |   16 +-
 drivers/net/wireless/mediatek/mt76/mt76x2/pci_phy.c   |    8 +-
 drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c  |    2 +-
 drivers/net/wireless/mediatek/mt76/mt76x2/usb_main.c  |   23 +-
 drivers/net/wireless/mediatek/mt76/mt76x2/usb_phy.c   |    7 +-
 drivers/net/wireless/mediatek/mt76/usb.c              |   20 +-
 47 files changed, 1422 insertions(+), 1011 deletions(-)

^ permalink raw reply

* [PATCH v2 1/4] mt76: mt7603: fix reading target tx power from eeprom
From: Felix Fietkau @ 2019-06-27 10:58 UTC (permalink / raw)
  To: linux-wireless
In-Reply-To: <20190607164355.51876-1-nbd@nbd.name>

For the external PA (TSSI OFF) case, the target power needs to be read
from a different location in EEPROM

Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
v2:
 - fix patch prefix
 - limit change to mt7603 (mt7628 does not have this eeprom field)

 drivers/net/wireless/mediatek/mt76/mt7603/eeprom.h | 2 ++
 drivers/net/wireless/mediatek/mt76/mt7603/init.c   | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/eeprom.h b/drivers/net/wireless/mediatek/mt76/mt7603/eeprom.h
index f27b99b7e359..b893facfba48 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7603/eeprom.h
+++ b/drivers/net/wireless/mediatek/mt76/mt7603/eeprom.h
@@ -69,6 +69,8 @@ enum mt7603_eeprom_field {
 
 	MT_EE_CP_FT_VERSION =			0x0f0,
 
+	MT_EE_TX_POWER_TSSI_OFF =		0x0f2,
+
 	MT_EE_XTAL_FREQ_OFFSET =		0x0f4,
 	MT_EE_XTAL_TRIM_2_COMP =		0x0f5,
 	MT_EE_XTAL_TRIM_3_COMP =		0x0f6,
diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/init.c b/drivers/net/wireless/mediatek/mt76/mt7603/init.c
index 4e269044f8a4..43baad7fd082 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7603/init.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7603/init.c
@@ -465,9 +465,13 @@ mt7603_init_txpower(struct mt7603_dev *dev,
 	u8 *eeprom = (u8 *)dev->mt76.eeprom.data;
 	int target_power = eeprom[MT_EE_TX_POWER_0_START_2G + 2] & ~BIT(7);
 	u8 *rate_power = &eeprom[MT_EE_TX_POWER_CCK];
+	bool ext_pa = eeprom[MT_EE_NIC_CONF_0 + 1] & BIT(1);
 	int max_offset, cur_offset;
 	int i;
 
+	if (ext_pa && is_mt7603(dev))
+		target_power = eeprom[MT_EE_TX_POWER_TSSI_OFF] & ~BIT(7);
+
 	if (target_power & BIT(6))
 		target_power = -(target_power & GENMASK(5, 0));
 
-- 
2.17.0


^ permalink raw reply related

* [PATCH] mt76: mt7603: fix sparse warnings: warning: incorrect type in assignment (different base types)
From: Lorenzo Bianconi @ 2019-06-27 10:13 UTC (permalink / raw)
  To: nbd; +Cc: lorenzo.bianconi, linux-wireless

Fix the following sparse warning in mt7603_mcu_set_eeprom:
drivers/net/wireless/mediatek/mt76/mt7603/mcu.c:376:30: sparse: warning:
incorrect type in assignment (different base types)
drivers/net/wireless/mediatek/mt76/mt7603/mcu.c:376:30: sparse:
expected unsigned short [usertype] addr
drivers/net/wireless/mediatek/mt76/mt7603/mcu.c:376:30: sparse: got
restricted __le16 [usertype]

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 drivers/net/wireless/mediatek/mt76/mt7603/mcu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7603/mcu.c
index 6357b5658a32..343ddc5543c2 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7603/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7603/mcu.c
@@ -346,7 +346,7 @@ int mt7603_mcu_set_eeprom(struct mt7603_dev *dev)
 
 	};
 	struct req_data {
-		u16 addr;
+		__le16 addr;
 		u8 val;
 		u8 pad;
 	} __packed;
-- 
2.21.0


^ permalink raw reply related

* [PATCH] nl80211: fix NL80211_HE_MAX_CAPABILITY_LEN
From: John Crispin @ 2019-06-27  9:58 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, John Crispin

NL80211_HE_MAX_CAPABILITY_LEN has changed between D2.0 and D4.0. It is now
MAC (6) + PHY (11) + MCS (12) + PPE (25) = 54.

Signed-off-by: John Crispin <john@phrozen.org>
---
 include/uapi/linux/nl80211.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 68ee35cbd75e..ceae54ea0ddf 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -2868,7 +2868,7 @@ enum nl80211_attrs {
 #define NL80211_HT_CAPABILITY_LEN		26
 #define NL80211_VHT_CAPABILITY_LEN		12
 #define NL80211_HE_MIN_CAPABILITY_LEN           16
-#define NL80211_HE_MAX_CAPABILITY_LEN           51
+#define NL80211_HE_MAX_CAPABILITY_LEN           54
 #define NL80211_MAX_NR_CIPHER_SUITES		5
 #define NL80211_MAX_NR_AKM_SUITES		2
 
-- 
2.20.1


^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox