* [PATCH 1/4] ath10k: Move ath10k_hw_params definition to hw.h
2016-07-27 12:36 [PATCH 0/4] ath10k: Padding related clean ups in rx Vasanthakumar Thiagarajan
@ 2016-07-27 12:36 ` Vasanthakumar Thiagarajan
2016-07-27 12:36 ` [PATCH 2/4] ath10k: Add provision for Rx descriptor abstraction Vasanthakumar Thiagarajan
` (3 subsequent siblings)
4 siblings, 0 replies; 9+ messages in thread
From: Vasanthakumar Thiagarajan @ 2016-07-27 12:36 UTC (permalink / raw)
To: ath10k; +Cc: Vasanthakumar Thiagarajan, linux-wireless
This is to prepare for rx descriptor abstraction where we'll
be dereferencing ath10k_hw_params member in hw.h. Moreover
hw.h looks more suitable to house ath10k_hw_params definition
than core.h
Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qti.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/core.h | 48 +---------------------------------
drivers/net/wireless/ath/ath10k/hw.h | 48 ++++++++++++++++++++++++++++++++++
2 files changed, 49 insertions(+), 47 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
index 30ae5bf..5ace413 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -715,53 +715,7 @@ struct ath10k {
struct ath10k_htc htc;
struct ath10k_htt htt;
- struct ath10k_hw_params {
- u32 id;
- u16 dev_id;
- const char *name;
- u32 patch_load_addr;
- int uart_pin;
- u32 otp_exe_param;
-
- /* Type of hw cycle counter wraparound logic, for more info
- * refer enum ath10k_hw_cc_wraparound_type.
- */
- enum ath10k_hw_cc_wraparound_type cc_wraparound_type;
-
- /* Some of chip expects fragment descriptor to be continuous
- * memory for any TX operation. Set continuous_frag_desc flag
- * for the hardware which have such requirement.
- */
- bool continuous_frag_desc;
-
- /* CCK hardware rate table mapping for the newer chipsets
- * like QCA99X0, QCA4019 got revised. The CCK h/w rate values
- * are in a proper order with respect to the rate/preamble
- */
- bool cck_rate_map_rev2;
-
- u32 channel_counters_freq_hz;
-
- /* Mgmt tx descriptors threshold for limiting probe response
- * frames.
- */
- u32 max_probe_resp_desc_thres;
-
- /* The padding bytes's location is different on various chips */
- enum ath10k_hw_4addr_pad hw_4addr_pad;
-
- u32 tx_chain_mask;
- u32 rx_chain_mask;
- u32 max_spatial_stream;
- u32 cal_data_len;
-
- struct ath10k_hw_params_fw {
- const char *dir;
- const char *board;
- size_t board_size;
- size_t board_ext_size;
- } fw;
- } hw_params;
+ struct ath10k_hw_params hw_params;
/* contains the firmware images used with ATH10K_FIRMWARE_MODE_NORMAL */
struct ath10k_fw_components normal_mode_fw;
diff --git a/drivers/net/wireless/ath/ath10k/hw.h b/drivers/net/wireless/ath/ath10k/hw.h
index e014cd7..1315557 100644
--- a/drivers/net/wireless/ath/ath10k/hw.h
+++ b/drivers/net/wireless/ath/ath10k/hw.h
@@ -363,6 +363,54 @@ enum ath10k_hw_cc_wraparound_type {
ATH10K_HW_CC_WRAP_SHIFTED_EACH = 2,
};
+struct ath10k_hw_params {
+ u32 id;
+ u16 dev_id;
+ const char *name;
+ u32 patch_load_addr;
+ int uart_pin;
+ u32 otp_exe_param;
+
+ /* Type of hw cycle counter wraparound logic, for more info
+ * refer enum ath10k_hw_cc_wraparound_type.
+ */
+ enum ath10k_hw_cc_wraparound_type cc_wraparound_type;
+
+ /* Some of chip expects fragment descriptor to be continuous
+ * memory for any TX operation. Set continuous_frag_desc flag
+ * for the hardware which have such requirement.
+ */
+ bool continuous_frag_desc;
+
+ /* CCK hardware rate table mapping for the newer chipsets
+ * like QCA99X0, QCA4019 got revised. The CCK h/w rate values
+ * are in a proper order with respect to the rate/preamble
+ */
+ bool cck_rate_map_rev2;
+
+ u32 channel_counters_freq_hz;
+
+ /* Mgmt tx descriptors threshold for limiting probe response
+ * frames.
+ */
+ u32 max_probe_resp_desc_thres;
+
+ /* The padding bytes's location is different on various chips */
+ enum ath10k_hw_4addr_pad hw_4addr_pad;
+
+ u32 tx_chain_mask;
+ u32 rx_chain_mask;
+ u32 max_spatial_stream;
+ u32 cal_data_len;
+
+ struct ath10k_hw_params_fw {
+ const char *dir;
+ const char *board;
+ size_t board_size;
+ size_t board_ext_size;
+ } fw;
+};
+
/* Target specific defines for MAIN firmware */
#define TARGET_NUM_VDEVS 8
#define TARGET_NUM_PEER_AST 2
--
1.9.1
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 2/4] ath10k: Add provision for Rx descriptor abstraction
2016-07-27 12:36 [PATCH 0/4] ath10k: Padding related clean ups in rx Vasanthakumar Thiagarajan
2016-07-27 12:36 ` [PATCH 1/4] ath10k: Move ath10k_hw_params definition to hw.h Vasanthakumar Thiagarajan
@ 2016-07-27 12:36 ` Vasanthakumar Thiagarajan
2016-07-27 12:43 ` Michal Kazior
2016-07-27 12:36 ` [PATCH 3/4] ath10k: Properly remove padding from the start of rx payload Vasanthakumar Thiagarajan
` (2 subsequent siblings)
4 siblings, 1 reply; 9+ messages in thread
From: Vasanthakumar Thiagarajan @ 2016-07-27 12:36 UTC (permalink / raw)
To: ath10k; +Cc: Vasanthakumar Thiagarajan, linux-wireless
There are slight differences in Rx hw descriptor information
among different chips. So far driver does not use those new
information for any functionalities, but there is one important
information which is available from QCA99X0 onwards to indicate
the number of bytes that hw padded at the begining of the rx
payload and this information is needed to undecap the rx
packet. Add an abstraction for Rx desc to make use of the
new desc information available. The callback that this patch
defines to retrieve the padding bytes will be used in follow-up
patch.
Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qti.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/core.c | 12 ++++++++++++
drivers/net/wireless/ath/ath10k/hw.c | 13 +++++++++++++
drivers/net/wireless/ath/ath10k/hw.h | 12 ++++++++++++
3 files changed, 37 insertions(+)
diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index e889829..9c5e93b 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -68,6 +68,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.board_size = QCA988X_BOARD_DATA_SZ,
.board_ext_size = QCA988X_BOARD_EXT_DATA_SZ,
},
+ .hw_rx_desc_ops = &qca988x_rx_desc_ops,
},
{
.id = QCA9887_HW_1_0_VERSION,
@@ -87,6 +88,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.board_size = QCA9887_BOARD_DATA_SZ,
.board_ext_size = QCA9887_BOARD_EXT_DATA_SZ,
},
+ .hw_rx_desc_ops = &qca988x_rx_desc_ops,
},
{
.id = QCA6174_HW_2_1_VERSION,
@@ -104,6 +106,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.board_size = QCA6174_BOARD_DATA_SZ,
.board_ext_size = QCA6174_BOARD_EXT_DATA_SZ,
},
+ .hw_rx_desc_ops = &qca988x_rx_desc_ops,
},
{
.id = QCA6174_HW_2_1_VERSION,
@@ -122,6 +125,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.board_size = QCA6174_BOARD_DATA_SZ,
.board_ext_size = QCA6174_BOARD_EXT_DATA_SZ,
},
+ .hw_rx_desc_ops = &qca988x_rx_desc_ops,
},
{
.id = QCA6174_HW_3_0_VERSION,
@@ -140,6 +144,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.board_size = QCA6174_BOARD_DATA_SZ,
.board_ext_size = QCA6174_BOARD_EXT_DATA_SZ,
},
+ .hw_rx_desc_ops = &qca988x_rx_desc_ops,
},
{
.id = QCA6174_HW_3_2_VERSION,
@@ -159,6 +164,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.board_size = QCA6174_BOARD_DATA_SZ,
.board_ext_size = QCA6174_BOARD_EXT_DATA_SZ,
},
+ .hw_rx_desc_ops = &qca988x_rx_desc_ops,
},
{
.id = QCA99X0_HW_2_0_DEV_VERSION,
@@ -182,6 +188,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.board_size = QCA99X0_BOARD_DATA_SZ,
.board_ext_size = QCA99X0_BOARD_EXT_DATA_SZ,
},
+ .hw_rx_desc_ops = &qca99x0_rx_desc_ops,
},
{
.id = QCA9984_HW_1_0_DEV_VERSION,
@@ -205,6 +212,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.board_size = QCA99X0_BOARD_DATA_SZ,
.board_ext_size = QCA99X0_BOARD_EXT_DATA_SZ,
},
+ .hw_rx_desc_ops = &qca99x0_rx_desc_ops,
},
{
.id = QCA9888_HW_2_0_DEV_VERSION,
@@ -227,6 +235,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.board_size = QCA99X0_BOARD_DATA_SZ,
.board_ext_size = QCA99X0_BOARD_EXT_DATA_SZ,
},
+ .hw_rx_desc_ops = &qca99x0_rx_desc_ops,
},
{
.id = QCA9377_HW_1_0_DEV_VERSION,
@@ -244,6 +253,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.board_size = QCA9377_BOARD_DATA_SZ,
.board_ext_size = QCA9377_BOARD_EXT_DATA_SZ,
},
+ .hw_rx_desc_ops = &qca988x_rx_desc_ops,
},
{
.id = QCA9377_HW_1_1_DEV_VERSION,
@@ -261,6 +271,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.board_size = QCA9377_BOARD_DATA_SZ,
.board_ext_size = QCA9377_BOARD_EXT_DATA_SZ,
},
+ .hw_rx_desc_ops = &qca988x_rx_desc_ops,
},
{
.id = QCA4019_HW_1_0_DEV_VERSION,
@@ -285,6 +296,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.board_size = QCA4019_BOARD_DATA_SZ,
.board_ext_size = QCA4019_BOARD_EXT_DATA_SZ,
},
+ .hw_rx_desc_ops = &qca99x0_rx_desc_ops,
},
};
diff --git a/drivers/net/wireless/ath/ath10k/hw.c b/drivers/net/wireless/ath/ath10k/hw.c
index f903d46..6149aa9 100644
--- a/drivers/net/wireless/ath/ath10k/hw.c
+++ b/drivers/net/wireless/ath/ath10k/hw.c
@@ -219,3 +219,16 @@ void ath10k_hw_fill_survey_time(struct ath10k *ar, struct survey_info *survey,
survey->time = CCNT_TO_MSEC(ar, cc);
survey->time_busy = CCNT_TO_MSEC(ar, rcc);
}
+
+const struct ath10k_hw_rx_desc_ops qca988x_rx_desc_ops = {
+};
+
+static int ath10k_qca99x0_rx_desc_get_l3_pad_bytes(struct htt_rx_desc *rxd)
+{
+ return MS(__le32_to_cpu(rxd->msdu_end.qca99x0.info1),
+ RX_MSDU_END_INFO1_L3_HDR_PAD);
+}
+
+const struct ath10k_hw_rx_desc_ops qca99x0_rx_desc_ops = {
+ .rx_desc_get_l3_pad_bytes = ath10k_qca99x0_rx_desc_get_l3_pad_bytes,
+};
diff --git a/drivers/net/wireless/ath/ath10k/hw.h b/drivers/net/wireless/ath/ath10k/hw.h
index 1315557..a281544 100644
--- a/drivers/net/wireless/ath/ath10k/hw.h
+++ b/drivers/net/wireless/ath/ath10k/hw.h
@@ -409,8 +409,20 @@ struct ath10k_hw_params {
size_t board_size;
size_t board_ext_size;
} fw;
+
+ const struct ath10k_hw_rx_desc_ops *hw_rx_desc_ops;
};
+struct htt_rx_desc;
+
+/* Defines needed for Rx descriptor abstraction */
+struct ath10k_hw_rx_desc_ops {
+ int (*rx_desc_get_l3_pad_bytes)(struct htt_rx_desc *rxd);
+};
+
+extern const struct ath10k_hw_rx_desc_ops qca988x_rx_desc_ops;
+extern const struct ath10k_hw_rx_desc_ops qca99x0_rx_desc_ops;
+
/* Target specific defines for MAIN firmware */
#define TARGET_NUM_VDEVS 8
#define TARGET_NUM_PEER_AST 2
--
1.9.1
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH 2/4] ath10k: Add provision for Rx descriptor abstraction
2016-07-27 12:36 ` [PATCH 2/4] ath10k: Add provision for Rx descriptor abstraction Vasanthakumar Thiagarajan
@ 2016-07-27 12:43 ` Michal Kazior
2016-07-27 12:59 ` Thiagarajan, Vasanthakumar
0 siblings, 1 reply; 9+ messages in thread
From: Michal Kazior @ 2016-07-27 12:43 UTC (permalink / raw)
To: Vasanthakumar Thiagarajan; +Cc: linux-wireless, ath10k@lists.infradead.org
On 27 July 2016 at 14:36, Vasanthakumar Thiagarajan
<vthiagar@qti.qualcomm.com> wrote:
> There are slight differences in Rx hw descriptor information
> among different chips. So far driver does not use those new
> information for any functionalities, but there is one important
> information which is available from QCA99X0 onwards to indicate
> the number of bytes that hw padded at the begining of the rx
> payload and this information is needed to undecap the rx
> packet. Add an abstraction for Rx desc to make use of the
> new desc information available. The callback that this patch
> defines to retrieve the padding bytes will be used in follow-up
> patch.
>
> Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qti.qualcomm.com>
> ---
> drivers/net/wireless/ath/ath10k/core.c | 12 ++++++++++++
> drivers/net/wireless/ath/ath10k/hw.c | 13 +++++++++++++
> drivers/net/wireless/ath/ath10k/hw.h | 12 ++++++++++++
> 3 files changed, 37 insertions(+)
>
> diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
> index e889829..9c5e93b 100644
> --- a/drivers/net/wireless/ath/ath10k/core.c
> +++ b/drivers/net/wireless/ath/ath10k/core.c
> @@ -68,6 +68,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
> .board_size = QCA988X_BOARD_DATA_SZ,
> .board_ext_size = QCA988X_BOARD_EXT_DATA_SZ,
> },
> + .hw_rx_desc_ops = &qca988x_rx_desc_ops,
[...]
> +struct ath10k_hw_rx_desc_ops {
> + int (*rx_desc_get_l3_pad_bytes)(struct htt_rx_desc *rxd);
> +};
Benjamin is trying to implement coverage class by poking hw registers
over firmware's head [1]. I'm thinking the hw_rx_desc_ops could be
generalized to hw_ops so it can be used for doing hw-specific hacks as
well. What do you think?
[1]: http://lists.infradead.org/pipermail/ath10k/2016-July/008107.html
Michał
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH 2/4] ath10k: Add provision for Rx descriptor abstraction
2016-07-27 12:43 ` Michal Kazior
@ 2016-07-27 12:59 ` Thiagarajan, Vasanthakumar
2016-07-27 13:12 ` Michal Kazior
0 siblings, 1 reply; 9+ messages in thread
From: Thiagarajan, Vasanthakumar @ 2016-07-27 12:59 UTC (permalink / raw)
To: michal.kazior@tieto.com; +Cc: linux-wireless, ath10k@lists.infradead.org
On Wednesday 27 July 2016 06:13 PM, Michal Kazior wrote:
> On 27 July 2016 at 14:36, Vasanthakumar Thiagarajan
> <vthiagar@qti.qualcomm.com> wrote:
>> There are slight differences in Rx hw descriptor information
>> among different chips. So far driver does not use those new
>> information for any functionalities, but there is one important
>> information which is available from QCA99X0 onwards to indicate
>> the number of bytes that hw padded at the begining of the rx
>> payload and this information is needed to undecap the rx
>> packet. Add an abstraction for Rx desc to make use of the
>> new desc information available. The callback that this patch
>> defines to retrieve the padding bytes will be used in follow-up
>> patch.
>>
>> Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qti.qualcomm.com>
>> ---
>> drivers/net/wireless/ath/ath10k/core.c | 12 ++++++++++++
>> drivers/net/wireless/ath/ath10k/hw.c | 13 +++++++++++++
>> drivers/net/wireless/ath/ath10k/hw.h | 12 ++++++++++++
>> 3 files changed, 37 insertions(+)
>>
>> diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
>> index e889829..9c5e93b 100644
>> --- a/drivers/net/wireless/ath/ath10k/core.c
>> +++ b/drivers/net/wireless/ath/ath10k/core.c
>> @@ -68,6 +68,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
>> .board_size = QCA988X_BOARD_DATA_SZ,
>> .board_ext_size = QCA988X_BOARD_EXT_DATA_SZ,
>> },
>> + .hw_rx_desc_ops = &qca988x_rx_desc_ops,
> [...]
>> +struct ath10k_hw_rx_desc_ops {
>> + int (*rx_desc_get_l3_pad_bytes)(struct htt_rx_desc *rxd);
>> +};
>
> Benjamin is trying to implement coverage class by poking hw registers
> over firmware's head [1]. I'm thinking the hw_rx_desc_ops could be
> generalized to hw_ops so it can be used for doing hw-specific hacks as
> well. What do you think?
Sure. Instead of reworking this patch set, can this be done in a separate patch?.
Vasanth
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH 2/4] ath10k: Add provision for Rx descriptor abstraction
2016-07-27 12:59 ` Thiagarajan, Vasanthakumar
@ 2016-07-27 13:12 ` Michal Kazior
0 siblings, 0 replies; 9+ messages in thread
From: Michal Kazior @ 2016-07-27 13:12 UTC (permalink / raw)
To: Thiagarajan, Vasanthakumar; +Cc: linux-wireless, ath10k@lists.infradead.org
On 27 July 2016 at 14:59, Thiagarajan, Vasanthakumar
<vthiagar@qti.qualcomm.com> wrote:
> On Wednesday 27 July 2016 06:13 PM, Michal Kazior wrote:
>> On 27 July 2016 at 14:36, Vasanthakumar Thiagarajan
[...]
>>> --- a/drivers/net/wireless/ath/ath10k/core.c
>>> +++ b/drivers/net/wireless/ath/ath10k/core.c
>>> @@ -68,6 +68,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
>>> .board_size = QCA988X_BOARD_DATA_SZ,
>>> .board_ext_size = QCA988X_BOARD_EXT_DATA_SZ,
>>> },
>>> + .hw_rx_desc_ops = &qca988x_rx_desc_ops,
>> [...]
>>> +struct ath10k_hw_rx_desc_ops {
>>> + int (*rx_desc_get_l3_pad_bytes)(struct htt_rx_desc *rxd);
>>> +};
>>
>> Benjamin is trying to implement coverage class by poking hw registers
>> over firmware's head [1]. I'm thinking the hw_rx_desc_ops could be
>> generalized to hw_ops so it can be used for doing hw-specific hacks as
>> well. What do you think?
>
> Sure. Instead of reworking this patch set, can this be done in a separate patch?.
I don't really mind especially since there's not much comments on his work yet.
Michał
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 3/4] ath10k: Properly remove padding from the start of rx payload
2016-07-27 12:36 [PATCH 0/4] ath10k: Padding related clean ups in rx Vasanthakumar Thiagarajan
2016-07-27 12:36 ` [PATCH 1/4] ath10k: Move ath10k_hw_params definition to hw.h Vasanthakumar Thiagarajan
2016-07-27 12:36 ` [PATCH 2/4] ath10k: Add provision for Rx descriptor abstraction Vasanthakumar Thiagarajan
@ 2016-07-27 12:36 ` Vasanthakumar Thiagarajan
2016-07-27 12:36 ` [PATCH 4/4] ath10k: Remove 4-addr padding related hw_param configuration Vasanthakumar Thiagarajan
2016-09-09 14:29 ` [PATCH 0/4] ath10k: Padding related clean ups in rx Valo, Kalle
4 siblings, 0 replies; 9+ messages in thread
From: Vasanthakumar Thiagarajan @ 2016-07-27 12:36 UTC (permalink / raw)
To: ath10k; +Cc: Vasanthakumar Thiagarajan, linux-wireless
In QCA99X0 (QCA99X0, QCA9984, QCA9888 and QCA4019) family chips,
hw adds padding at the begining of the rx payload to make L3
header 4-byte aligned. In the chips doing this type of padding,
the number of bytes padded will be indicated through msdu_end:info1.
Define a hw_rx_desc_ops wrapper to retrieve the number of padded
bytes and use this while doing undecap. This should fix padding
related issues with ethernt decap format with QCA99X0, QCA9984,
QCA9888 and QCA4019 hw.
Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qti.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/htt_rx.c | 36 +++++++++++++++++++-------------
drivers/net/wireless/ath/ath10k/hw.h | 9 ++++++++
2 files changed, 31 insertions(+), 14 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c
index 78db5d6..36c4809 100644
--- a/drivers/net/wireless/ath/ath10k/htt_rx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
@@ -1056,9 +1056,11 @@ static void ath10k_htt_rx_h_undecap_nwifi(struct ath10k *ar,
const u8 first_hdr[64])
{
struct ieee80211_hdr *hdr;
+ struct htt_rx_desc *rxd;
size_t hdr_len;
u8 da[ETH_ALEN];
u8 sa[ETH_ALEN];
+ int l3_pad_bytes;
/* Delivered decapped frame:
* [nwifi 802.11 header] <-- replaced with 802.11 hdr
@@ -1072,19 +1074,12 @@ static void ath10k_htt_rx_h_undecap_nwifi(struct ath10k *ar,
*/
/* pull decapped header and copy SA & DA */
- if ((ar->hw_params.hw_4addr_pad == ATH10K_HW_4ADDR_PAD_BEFORE) &&
- ieee80211_has_a4(((struct ieee80211_hdr *)first_hdr)->frame_control)) {
- /* The QCA99X0 4 address mode pad 2 bytes at the
- * beginning of MSDU
- */
- hdr = (struct ieee80211_hdr *)(msdu->data + 2);
- /* The skb length need be extended 2 as the 2 bytes at the tail
- * be excluded due to the padding
- */
- skb_put(msdu, 2);
- } else {
- hdr = (struct ieee80211_hdr *)(msdu->data);
- }
+ rxd = (void *)msdu->data - sizeof(*rxd);
+
+ l3_pad_bytes = ath10k_rx_desc_get_l3_pad_bytes(&ar->hw_params, rxd);
+ skb_put(msdu, l3_pad_bytes);
+
+ hdr = (struct ieee80211_hdr *)(msdu->data + l3_pad_bytes);
hdr_len = ath10k_htt_rx_nwifi_hdrlen(ar, hdr);
ether_addr_copy(da, ieee80211_get_DA(hdr));
@@ -1151,6 +1146,8 @@ static void ath10k_htt_rx_h_undecap_eth(struct ath10k *ar,
void *rfc1042;
u8 da[ETH_ALEN];
u8 sa[ETH_ALEN];
+ int l3_pad_bytes;
+ struct htt_rx_desc *rxd;
/* Delivered decapped frame:
* [eth header] <-- replaced with 802.11 hdr & rfc1042/llc
@@ -1161,6 +1158,11 @@ static void ath10k_htt_rx_h_undecap_eth(struct ath10k *ar,
if (WARN_ON_ONCE(!rfc1042))
return;
+ rxd = (void *)msdu->data - sizeof(*rxd);
+ l3_pad_bytes = ath10k_rx_desc_get_l3_pad_bytes(&ar->hw_params, rxd);
+ skb_put(msdu, l3_pad_bytes);
+ skb_pull(msdu, l3_pad_bytes);
+
/* pull decapped header and copy SA & DA */
eth = (struct ethhdr *)msdu->data;
ether_addr_copy(da, eth->h_dest);
@@ -1191,6 +1193,8 @@ static void ath10k_htt_rx_h_undecap_snap(struct ath10k *ar,
{
struct ieee80211_hdr *hdr;
size_t hdr_len;
+ int l3_pad_bytes;
+ struct htt_rx_desc *rxd;
/* Delivered decapped frame:
* [amsdu header] <-- replaced with 802.11 hdr
@@ -1198,7 +1202,11 @@ static void ath10k_htt_rx_h_undecap_snap(struct ath10k *ar,
* [payload]
*/
- skb_pull(msdu, sizeof(struct amsdu_subframe_hdr));
+ rxd = (void *)msdu->data - sizeof(*rxd);
+ l3_pad_bytes = ath10k_rx_desc_get_l3_pad_bytes(&ar->hw_params, rxd);
+
+ skb_put(msdu, l3_pad_bytes);
+ skb_pull(msdu, sizeof(struct amsdu_subframe_hdr) + l3_pad_bytes);
hdr = (struct ieee80211_hdr *)first_hdr;
hdr_len = ieee80211_hdrlen(hdr->frame_control);
diff --git a/drivers/net/wireless/ath/ath10k/hw.h b/drivers/net/wireless/ath/ath10k/hw.h
index a281544..cdd2ce4 100644
--- a/drivers/net/wireless/ath/ath10k/hw.h
+++ b/drivers/net/wireless/ath/ath10k/hw.h
@@ -423,6 +423,15 @@ struct ath10k_hw_rx_desc_ops {
extern const struct ath10k_hw_rx_desc_ops qca988x_rx_desc_ops;
extern const struct ath10k_hw_rx_desc_ops qca99x0_rx_desc_ops;
+static inline int
+ath10k_rx_desc_get_l3_pad_bytes(struct ath10k_hw_params *hw,
+ struct htt_rx_desc *rxd)
+{
+ if (hw->hw_rx_desc_ops->rx_desc_get_l3_pad_bytes)
+ return hw->hw_rx_desc_ops->rx_desc_get_l3_pad_bytes(rxd);
+ return 0;
+}
+
/* Target specific defines for MAIN firmware */
#define TARGET_NUM_VDEVS 8
#define TARGET_NUM_PEER_AST 2
--
1.9.1
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 4/4] ath10k: Remove 4-addr padding related hw_param configuration
2016-07-27 12:36 [PATCH 0/4] ath10k: Padding related clean ups in rx Vasanthakumar Thiagarajan
` (2 preceding siblings ...)
2016-07-27 12:36 ` [PATCH 3/4] ath10k: Properly remove padding from the start of rx payload Vasanthakumar Thiagarajan
@ 2016-07-27 12:36 ` Vasanthakumar Thiagarajan
2016-09-09 14:29 ` [PATCH 0/4] ath10k: Padding related clean ups in rx Valo, Kalle
4 siblings, 0 replies; 9+ messages in thread
From: Vasanthakumar Thiagarajan @ 2016-07-27 12:36 UTC (permalink / raw)
To: ath10k; +Cc: Vasanthakumar Thiagarajan, linux-wireless
hw_4addr_pad was added to handle different types of padding
in 4-address rx frame. But this padding is not very specific
to 4-address, it can happen even with three address + ethernet
decap mode. Since the padding information can be obtained
through Rx desc for QCA99X0 and newer chips, this hw_param
is not needed any more.
Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qti.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/core.c | 9 ---------
drivers/net/wireless/ath/ath10k/hw.h | 8 --------
2 files changed, 17 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index 9c5e93b..74d0ace 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -60,7 +60,6 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.otp_exe_param = 0,
.channel_counters_freq_hz = 88000,
.max_probe_resp_desc_thres = 0,
- .hw_4addr_pad = ATH10K_HW_4ADDR_PAD_AFTER,
.cal_data_len = 2116,
.fw = {
.dir = QCA988X_HW_2_0_FW_DIR,
@@ -80,7 +79,6 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.otp_exe_param = 0,
.channel_counters_freq_hz = 88000,
.max_probe_resp_desc_thres = 0,
- .hw_4addr_pad = ATH10K_HW_4ADDR_PAD_AFTER,
.cal_data_len = 2116,
.fw = {
.dir = QCA9887_HW_1_0_FW_DIR,
@@ -117,7 +115,6 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.otp_exe_param = 0,
.channel_counters_freq_hz = 88000,
.max_probe_resp_desc_thres = 0,
- .hw_4addr_pad = ATH10K_HW_4ADDR_PAD_AFTER,
.cal_data_len = 8124,
.fw = {
.dir = QCA6174_HW_2_1_FW_DIR,
@@ -136,7 +133,6 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.otp_exe_param = 0,
.channel_counters_freq_hz = 88000,
.max_probe_resp_desc_thres = 0,
- .hw_4addr_pad = ATH10K_HW_4ADDR_PAD_AFTER,
.cal_data_len = 8124,
.fw = {
.dir = QCA6174_HW_3_0_FW_DIR,
@@ -155,7 +151,6 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.otp_exe_param = 0,
.channel_counters_freq_hz = 88000,
.max_probe_resp_desc_thres = 0,
- .hw_4addr_pad = ATH10K_HW_4ADDR_PAD_AFTER,
.cal_data_len = 8124,
.fw = {
/* uses same binaries as hw3.0 */
@@ -177,7 +172,6 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.cck_rate_map_rev2 = true,
.channel_counters_freq_hz = 150000,
.max_probe_resp_desc_thres = 24,
- .hw_4addr_pad = ATH10K_HW_4ADDR_PAD_BEFORE,
.tx_chain_mask = 0xf,
.rx_chain_mask = 0xf,
.max_spatial_stream = 4,
@@ -201,7 +195,6 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.cck_rate_map_rev2 = true,
.channel_counters_freq_hz = 150000,
.max_probe_resp_desc_thres = 24,
- .hw_4addr_pad = ATH10K_HW_4ADDR_PAD_BEFORE,
.tx_chain_mask = 0xf,
.rx_chain_mask = 0xf,
.max_spatial_stream = 4,
@@ -224,7 +217,6 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.continuous_frag_desc = true,
.channel_counters_freq_hz = 150000,
.max_probe_resp_desc_thres = 24,
- .hw_4addr_pad = ATH10K_HW_4ADDR_PAD_BEFORE,
.tx_chain_mask = 3,
.rx_chain_mask = 3,
.max_spatial_stream = 2,
@@ -285,7 +277,6 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.cck_rate_map_rev2 = true,
.channel_counters_freq_hz = 125000,
.max_probe_resp_desc_thres = 24,
- .hw_4addr_pad = ATH10K_HW_4ADDR_PAD_BEFORE,
.tx_chain_mask = 0x3,
.rx_chain_mask = 0x3,
.max_spatial_stream = 2,
diff --git a/drivers/net/wireless/ath/ath10k/hw.h b/drivers/net/wireless/ath/ath10k/hw.h
index cdd2ce4..1620e76 100644
--- a/drivers/net/wireless/ath/ath10k/hw.h
+++ b/drivers/net/wireless/ath/ath10k/hw.h
@@ -338,11 +338,6 @@ enum ath10k_hw_rate_rev2_cck {
ATH10K_HW_RATE_REV2_CCK_SP_11M,
};
-enum ath10k_hw_4addr_pad {
- ATH10K_HW_4ADDR_PAD_AFTER,
- ATH10K_HW_4ADDR_PAD_BEFORE,
-};
-
enum ath10k_hw_cc_wraparound_type {
ATH10K_HW_CC_WRAP_DISABLED = 0,
@@ -395,9 +390,6 @@ struct ath10k_hw_params {
*/
u32 max_probe_resp_desc_thres;
- /* The padding bytes's location is different on various chips */
- enum ath10k_hw_4addr_pad hw_4addr_pad;
-
u32 tx_chain_mask;
u32 rx_chain_mask;
u32 max_spatial_stream;
--
1.9.1
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH 0/4] ath10k: Padding related clean ups in rx
2016-07-27 12:36 [PATCH 0/4] ath10k: Padding related clean ups in rx Vasanthakumar Thiagarajan
` (3 preceding siblings ...)
2016-07-27 12:36 ` [PATCH 4/4] ath10k: Remove 4-addr padding related hw_param configuration Vasanthakumar Thiagarajan
@ 2016-09-09 14:29 ` Valo, Kalle
4 siblings, 0 replies; 9+ messages in thread
From: Valo, Kalle @ 2016-09-09 14:29 UTC (permalink / raw)
To: Thiagarajan, Vasanthakumar
Cc: linux-wireless@vger.kernel.org, ath10k@lists.infradead.org
Vasanthakumar Thiagarajan <vthiagar@qti.qualcomm.com> writes:
> This patch set adds abstraction for rx_hw_desc processing so that
> we can make use of newer desc fields notifying padding information
> which is done on rx payload. "ath10k: Properly remove padding from
> the start of rx payload" fixes padding related bug in ethernet decap
> mode for QCA99X0, QCA9984 qnd QCA4019 but even fixing this bug will
> not make ethernet decap mode work, there needs to be some more fix
> wich would follow this patch series.
>
> Vasanthakumar Thiagarajan (4):
> ath10k: Move ath10k_hw_params definition to hw.h
> ath10k: Add provision for Rx descriptor abstraction
> ath10k: Properly remove padding from the start of rx payload
> ath10k: Remove 4-addr padding related hw_param configuration
As Benjamin has these patches on his own set I'm dropping this one.
--
Kalle Valo
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply [flat|nested] 9+ messages in thread