[PATCH v4 3/3] ath10k: allow dynamic SAR power limits via common API

2020-12-03 Thread Carl Huang
WLAN.RM.4.4.1-00110-QCARMSWP-1 Signed-off-by: Carl Huang Reviewed-by: Brian Norris Reviewed-by: Abhishek Kumar --- v4: - add "Reviewed-by:" tag v3: - no change v2: - rebased on ToT - get correct index in ath10k_mac_set_sar_specs - fix one output format commented by Abhishek d

[PATCH v4 1/3] nl80211: add common API to configure SAR power limitations.

2020-12-03 Thread Carl Huang
in 0.25dbm unit (14dbm) freq range 1 power: 0x48 in 0.25dbm unit (18dbm) Signed-off-by: Carl Huang Reviewed-by: Brian Norris Reviewed-by: Abhishek Kumar --- v4: - add "Reviewed-by:" tag v3: - check index duplicates. Return error if index duplicates. v2: - rebased on ToT - fix spelling error

[PATCH v4 2/3] mac80211: add ieee80211_set_sar_specs

2020-12-03 Thread Carl Huang
This change registers ieee80211_set_sar_specs to mac80211_config_ops, so cfg80211 can call it. Signed-off-by: Carl Huang Reviewed-by: Brian Norris Reviewed-by: Abhishek Kumar --- v4: - add "Reviewed-by:" tag v3: - no change v2: - rebased on ToT include/net/mac80211.h | 2 ++ ne

[PATCH v4 0/3] add common API to configure SAR

2020-12-03 Thread Carl Huang
error v2: - rebased on ToT - fix comments by Johannes and Abhishek - change sar_power to s32 and range_index to u32 Carl Huang (3): nl80211: add common API to configure SAR power limitations. mac80211: add ieee80211_set_sar_specs ath10k: allow dynamic SAR power limits via common API d

Re: [PATCH v2 1/3] nl80211: add common API to configure SAR power limitations.

2020-12-01 Thread Carl Huang
that duplicated index is not allowed. Thanks Abhishek On Mon, Nov 30, 2020 at 2:10 AM Carl Huang wrote: On 2020-11-21 10:42, Brian Norris wrote: > On Fri, Nov 20, 2020 at 12:53 AM Carl Huang > wrote: >> >> NL80211_CMD_SET_SAR_SPECS is added to configure SAR

[PATCH v3 3/3] ath10k: allow dynamic SAR power limits via common API

2020-12-01 Thread Carl Huang
WLAN.RM.4.4.1-00110-QCARMSWP-1 Signed-off-by: Carl Huang --- v3: - no change v2: - rebased on ToT - get correct index in ath10k_mac_set_sar_specs - fix one output format commented by Abhishek drivers/net/wireless/ath/ath10k/core.c | 16 +++ drivers/net/wireless/ath/ath10k/core.h | 3 + drivers

[PATCH v3 1/3] nl80211: add common API to configure SAR power limitations.

2020-12-01 Thread Carl Huang
in 0.25dbm unit (14dbm) freq range 1 power: 0x48 in 0.25dbm unit (18dbm) Signed-off-by: Carl Huang --- v3: - check index duplicates. Return error if index duplicates. v2: - rebased on ToT - fix spelling errors and some comment styles - use switch-case to process sar specs - put power_type sar spec

[PATCH v3 0/3] add common API to configure SAR

2020-12-01 Thread Carl Huang
by Johannes and Abhishek - change sar_power to s32 and range_index to u32 Carl Huang (3): nl80211: add common API to configure SAR power limitations. mac80211: add ieee80211_set_sar_specs ath10k: allow dynamic SAR power limits via common API drivers/net/wireless/ath/ath10k/core.c | 16

[PATCH v3 2/3] mac80211: add ieee80211_set_sar_specs

2020-12-01 Thread Carl Huang
This change registers ieee80211_set_sar_specs to mac80211_config_ops, so cfg80211 can call it. Signed-off-by: Carl Huang --- v3: - no change v2: - rebased on ToT include/net/mac80211.h | 2 ++ net/mac80211/cfg.c | 12 2 files changed, 14 insertions(+) diff --git a/include

Re: [PATCH v2 1/3] nl80211: add common API to configure SAR power limitations.

2020-11-30 Thread Carl Huang
On 2020-11-21 10:42, Brian Norris wrote: On Fri, Nov 20, 2020 at 12:53 AM Carl Huang wrote: NL80211_CMD_SET_SAR_SPECS is added to configure SAR from user space. NL80211_ATTR_SAR_SPEC is used to pass the SAR power specification when used with NL80211_CMD_SET_SAR_SPECS. Wireless driver needs

[PATCH v2 2/3] mac80211: add ieee80211_set_sar_specs

2020-11-20 Thread Carl Huang
This change registers ieee80211_set_sar_specs to mac80211_config_ops, so cfg80211 can call it. Signed-off-by: Carl Huang --- v2: - rebased on ToT include/net/mac80211.h | 2 ++ net/mac80211/cfg.c | 12 2 files changed, 14 insertions(+) diff --git a/include/net/mac80211.h b

[PATCH v2 3/3] ath10k: allow dynamic SAR power limits via common API

2020-11-20 Thread Carl Huang
WLAN.RM.4.4.1-00110-QCARMSWP-1 Signed-off-by: Carl Huang --- v2: - rebased on ToT - get correct index in ath10k_mac_set_sar_specs - fix one output format commented by Abhishek drivers/net/wireless/ath/ath10k/core.c | 16 +++ drivers/net/wireless/ath/ath10k/core.h | 3 + drivers/net/wireless/ath

[PATCH v2 1/3] nl80211: add common API to configure SAR power limitations.

2020-11-20 Thread Carl Huang
in 0.25dbm unit (14dbm) freq range 1 power: 0x48 in 0.25dbm unit (18dbm) Signed-off-by: Carl Huang --- v2: - rebased on ToT - fix spelling errors and some comment styles - use switch-case to process sar specs - put power_type sar spec to a sub function - change power to s32 and index to u32 - add error

[PATCH v2 0/3] add common API to configure SAR

2020-11-20 Thread Carl Huang
to u32 Carl Huang (3): nl80211: add common API to configure SAR power limitations. mac80211: add ieee80211_set_sar_specs ath10k: allow dynamic SAR power limits via common API drivers/net/wireless/ath/ath10k/core.c | 16 +++ drivers/net/wireless/ath/ath10k/core.h | 3 + drivers/net

Re: [PATCH 1/3] nl80211: add common API to configure SAR power limitations.

2020-11-19 Thread Carl Huang
On 2020-11-20 04:25, Abhishek Kumar wrote: Hi, Johannes has some good comments, apart for that I have some nits. > And wait, I thought we agreed to remove the index? Now I'm confused. > Using index in SET operation doesn't add burden to userspace and kernel, but it provides some flexibility

Re: [PATCH 1/3] nl80211: add common API to configure SAR power limitations.

2020-11-10 Thread Carl Huang
On 2020-11-06 18:25, Johannes Berg wrote: Hi, Looks pretty good. Some comments, mostly nits, below. Thank you for the comments, Johannes. I don't understand below well, please help explain: And even if we do need the index, then perhaps we should use the (otherwise anyway ignored)

Re: [RFC 1/2] nl80211: add common API to configure SAR power limitations.

2020-11-06 Thread Carl Huang
On 2020-11-06 02:25, Brian Norris wrote: On Thu, Nov 5, 2020 at 3:10 AM Carl Huang wrote: On 2020-11-05 16:35, Kalle Valo wrote: > Brian Norris writes: >> On Tue, Nov 3, 2020 at 11:32 PM Carl Huang >> wrote: >>> On 2020-11-04 10:00, Brian Norris wrote: >>&

[PATCH 1/3] nl80211: add common API to configure SAR power limitations.

2020-11-06 Thread Carl Huang
in 0.25dbm unit (14dbm) freq range 1 power: 0x48 in 0.25dbm unit (18dbm) Signed-off-by: Carl Huang --- include/net/cfg80211.h | 51 +++ include/uapi/linux/nl80211.h | 101 + net/wireless/nl80211.c | 150 +++ net

[PATCH 0/3] add common API to configure SAR

2020-11-06 Thread Carl Huang
This patchset is to add common API to configure SAR. The mechanism is wlan driver registers sar capability to wiphy and userspace queries it. Userspace then sets power limiation to wlan driver. Carl Huang (3): nl80211: add common API to configure SAR power limitations. mac80211: add

[PATCH 3/3] ath10k: allow dynamic SAR power limits via common API

2020-11-06 Thread Carl Huang
WLAN.RM.4.4.1-00110-QCARMSWP-1 Signed-off-by: Carl Huang --- drivers/net/wireless/ath/ath10k/core.c | 16 +++ drivers/net/wireless/ath/ath10k/core.h | 3 + drivers/net/wireless/ath/ath10k/hw.h | 2 + drivers/net/wireless/ath/ath10k/mac.c | 221 - 4 files

[PATCH 2/3] mac80211: add ieee80211_set_sar_specs

2020-11-06 Thread Carl Huang
This change registers ieee80211_set_sar_specs to mac80211_config_ops, so cfg80211 can call it. Signed-off-by: Carl Huang --- include/net/mac80211.h | 2 ++ net/mac80211/cfg.c | 12 2 files changed, 14 insertions(+) diff --git a/include/net/mac80211.h b/include/net/mac80211.h

Re: [RFC 1/2] nl80211: add common API to configure SAR power limitations.

2020-11-05 Thread Carl Huang
On 2020-11-05 01:48, Brian Norris wrote: On Wed, Nov 4, 2020 at 12:44 AM Carl Huang wrote: On 2020-09-28 20:36, Johannes Berg wrote: > On Tue, 2020-09-22 at 13:49 +0800, Carl Huang wrote: >> +struct cfg80211_sar_freq_ranges { >> +u8 index; > > Does an

Re: [RFC 1/2] nl80211: add common API to configure SAR power limitations.

2020-11-05 Thread Carl Huang
On 2020-11-05 07:27, Brian Norris wrote: Hi Carl, Sorry, I lied; I have a few more notes after spending another day looking at this: On Tue, Sep 22, 2020 at 01:49:34PM +0800, Carl Huang wrote: --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -1663,6 +1663,55 @@ struct station_info

Re: [RFC 2/2] ath10k: allow dynamic SAR power limits via common API

2020-11-05 Thread Carl Huang
On 2020-11-05 07:11, Brian Norris wrote: Hi, On Tue, Sep 22, 2020 at 01:49:35PM +0800, Carl Huang wrote: ath10k assigns ath10k_mac_set_sar_specs to ath10k_ops, and this function is called when user space application calls NL80211_CMD_SET_SAR_SPECS. ath10k also registers SAR type, and supported

Re: [RFC 1/2] nl80211: add common API to configure SAR power limitations.

2020-11-05 Thread Carl Huang
On 2020-11-05 01:44, Brian Norris wrote: + ath10k [ I realize I replied to the "wrong" RFC v1; I fell trap to Kalle's note: "When you submit a new version mark it as "v2". Otherwise people don't know what's the latest version." ] On Tue, Nov 3, 2020 at 11:32 P

Re: [RFC 1/2] nl80211: add common API to configure SAR power limitations.

2020-11-05 Thread Carl Huang
On 2020-11-05 16:35, Kalle Valo wrote: Brian Norris writes: + ath10k [ I realize I replied to the "wrong" RFC v1; I fell trap to Kalle's note: "When you submit a new version mark it as "v2". Otherwise people don't know what's the latest version." ] On Tue

Re: [RFC 1/2] nl80211: add common API to configure SAR power limitations.

2020-11-04 Thread Carl Huang
On 2020-09-28 20:36, Johannes Berg wrote: On Tue, 2020-09-22 at 13:49 +0800, Carl Huang wrote: NL80211_CMD_SET_SAR_SPECS is added to configure SAR from user space. NL80211_ATTR_SAR_SPEC is used to pass the SAR power specification when used with NL80211_CMD_SET_SAR_SPECS. Wireless driver needs

Re: [RFC 1/2] nl80211: add common API to configure SAR power limitations.

2020-11-03 Thread Carl Huang
On 2020-11-04 09:17, Abhishek Kumar wrote: On Tue, Nov 3, 2020 at 5:15 AM Johannes Berg wrote: On Tue, 2020-11-03 at 10:34 +0800, Carl Huang wrote: > On 2020-10-31 10:46, Abhishek Kumar wrote: > > From: kua...@chromium.org > > > > There are few more add

Re: [RFC 1/2] nl80211: add common API to configure SAR power limitations.

2020-11-03 Thread Carl Huang
On 2020-10-31 10:46, Abhishek Kumar wrote: From: kua...@chromium.org There are few more additional comments here. + * @NL80211_CMD_SET_SAR_SPECS: SAR power limitation configuration is + *     passed using %NL80211_ATTR_SAR_SPEC. + * This command requires NL80211_ATTR_IFINDEX, probably should

[RFC 1/2] nl80211: add common API to configure SAR power limitations.

2020-09-21 Thread Carl Huang
in 0.25dbm unit (18dbm) Signed-off-by: Carl Huang --- include/net/cfg80211.h | 52 + include/net/mac80211.h | 2 + include/uapi/linux/nl80211.h | 86 + net/mac80211/cfg.c | 12 +++ net/wireless/nl80211.c | 173

[RFC 2/2] ath10k: allow dynamic SAR power limits via common API

2020-09-21 Thread Carl Huang
the power to firmware to limit the TX power. This feature is controlled by hw parameter: dynamic_sar_support. Signed-off-by: Carl Huang --- drivers/net/wireless/ath/ath10k/core.c | 16 + drivers/net/wireless/ath/ath10k/core.h | 3 + drivers/net/wireless/ath/ath10k/hw.h | 2 + drivers

[PATCH V3] ath10k: allocate small size dma memory in ath10k_pci_diag_write_mem

2018-10-11 Thread Carl Huang
is to allocate a small size dma memory. In the loop, driver copies the data to the allocated dma memory and writes to the destination until all the data is written. Tested with QCA6174 PCI with firmware-6.bin_WLAN.RM.4.4.1-00119-QCARMSWP-1, this also affects QCA9377 PCI. Signed-off-by: Carl Huang Reviewed

[PATCH V2] ath10k: allocate small size dma memory in ath10k_pci_diag_write_mem

2018-10-10 Thread Carl Huang
is to allocate a small size dma memory. In the loop, driver copies the data to the allocated dma memory and writes to the destination until all the data is written. Tested with QCA6174 PCI with firmware-6.bin_WLAN.RM.4.4.1-00119-QCARMSWP-1, this also affects QCA9377 PCI. Signed-off-by: Carl Huang Reviewed

[PATCH] ath10k: allocate small size dma memory in ath10k_pci_diag_write_mem

2018-10-08 Thread Carl Huang
is to allocate a small size dma memory. In the loop, driver copies the data to the allocated dma memory and writes to the destination until all the data is written. Tested with QCA6174 PCI with firmware-6.bin_WLAN.RM.4.4.1-00119-QCARMSWP-1, this also affects QCA9377 PCI. Signed-off-by: Carl Huang

Re: [PATCH 3/3] ath10k: download firmware via diag Copy Engine for QCA6174 and QCA9377.

2018-09-25 Thread Carl Huang
On 2018-09-22 08:53, Brian Norris wrote: Hi again! One last (?) comment: On Thu, Aug 30, 2018 at 10:29:42AM +0800, Carl Huang wrote: diff --git a/drivers/net/wireless/ath/ath10k/hw.c b/drivers/net/wireless/ath/ath10k/hw.c index 677535b..25ee1c6 100644 --- a/drivers/net/wireless/ath/ath10k

Re: [PATCH 3/3] ath10k: download firmware via diag Copy Engine for QCA6174 and QCA9377.

2018-09-04 Thread Carl Huang
On 2018-09-05 12:52, Kalle Valo wrote: Carl Huang writes: Downloading firmware via BMI protocol takes too long time. For example, a ~700K bytes firmware takes about 500ms to download via BMI protocol. This is too long especially in suspend and resume scenario where firmware is re-downloaded

[PATCH 2/3] ath10k: support to access target space below 1M for qca6174 and qca9377

2018-08-29 Thread Carl Huang
and firmware-6.bin_WLAN.RM.4.4.1-00111-QCARMSWP-1. QCA9377 is also affected. Signed-off-by: Carl Huang --- drivers/net/wireless/ath/ath10k/pci.c | 19 +-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k

[PATCH 3/3] ath10k: download firmware via diag Copy Engine for QCA6174 and QCA9377.

2018-08-29 Thread Carl Huang
hw3.2 and firmware-6.bin_WLAN.RM.4.4.1-00111-QCARMSWP-1. QCA9377 is also affected. Signed-off-by: Carl Huang --- drivers/net/wireless/ath/ath10k/bmi.c | 23 drivers/net/wireless/ath/ath10k/bmi.h | 31 ++ drivers/net/wireless/ath/ath10k/core.c | 36 +-- drivers/net/wireless/ath

[PATCH 1/3] ath10k: optimize pci diag mem read & write operations

2018-08-29 Thread Carl Huang
-by: Carl Huang --- drivers/net/wireless/ath/ath10k/pci.c | 40 +++ drivers/net/wireless/ath/ath10k/pci.h | 3 ++- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c index

[PATCH 0/3] ath10k: download firmware via diag ce for qca6174 and qca9377

2018-08-29 Thread Carl Huang
Downloading firmware via diag ce can greatly reduce the downloading time to ~40ms from ~500ms for a 700k bytes firmware. Carl Huang (3): ath10k: optimize pci diag mem read & write operations ath10k: support to access target space below 1M for qca6174 and qca9377 ath10k: down

[PATCH 1/2] ath10k: Add WMI_SERVICE_AVAILABLE_EVENT support

2018-03-29 Thread Carl Huang
-off-by: Alan Liu <alan...@codeaurora.org> Signed-off-by: Carl Huang <cjhu...@codeaurora.org> --- drivers/net/wireless/ath/ath10k/wmi-ops.h | 24 +++ drivers/net/wireless/ath/ath10k/wmi-tlv.c | 38 drivers/net/wireless/ath/ath10k/wmi-tlv.h | 346 +-

[PATCH 0/2] ath10k: support MAC address randomization in scan

2018-03-29 Thread Carl Huang
The feature MAC address randomization depends on the firmware capability, if the firmware indicates WMI_SERVICE_SPOOF_MAC_SUPPORT service the host driver will report it to upper layer. The service bit is above the 128 bit limit so a new service check macro is needed. Carl Huang (2): ath10k: Add

[PATCH 2/2] ath10k: support MAC address randomization in scan

2018-03-29 Thread Carl Huang
-1, but QCA9377 is also affected. Signed-off-by: Carl Huang <cjhu...@codeaurora.org> --- drivers/net/wireless/ath/ath10k/mac.c | 17 + drivers/net/wireless/ath/ath10k/wmi-ops.h | 22 ++ drivers/net/wireless/ath/ath10k/wmi-tlv.

[PATCH v2] ath10k: fix use-after-free in ath10k_wmi_cmd_send_nowait

2018-03-04 Thread Carl Huang
this parameter too. Signed-off-by: Carl Huang <cjhu...@codeaurora.org> --- drivers/net/wireless/ath/ath10k/trace.h | 12 drivers/net/wireless/ath/ath10k/wmi.c | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/trace.h b/drive

RE: [PATCH] ath10k: fix use-after-free in ath10k_wmi_cmd_send_nowait

2018-02-11 Thread Carl Huang
> -Original Message- > From: ath10k [mailto:ath10k-boun...@lists.infradead.org] On Behalf Of Felix > Fietkau > Sent: Sunday, February 11, 2018 5:59 PM > To: Carl Huang <cjhu...@codeaurora.org>; ath10k@lists.infradead.org > Cc: linux-wirel...@vger.kernel.org >

[PATCH] ath10k: fix use-after-free in ath10k_wmi_cmd_send_nowait

2018-02-10 Thread Carl Huang
The skb may be freed in tx completion context before trace_ath10k_wmi_cmd is called. This can be easily captured when KASAN(Kernel Address Sanitizer) is enabled. The fix is to add a reference count to the skb and release it after trace_ath10k_wmi_cmd is called. Signed-off-by: Carl Huang <c