diff options
author | Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> | 2014-12-23 02:47:11 -0500 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2015-01-15 07:31:25 -0500 |
commit | c44690a157719437d09c83eec393211e7fd65076 (patch) | |
tree | 70798217368751e4638f6250b0262f7675fb7a20 | |
parent | 26a359d914e977aeab582c868236b450762973f7 (diff) |
wil6210: fix max. MPDU size
When configuring Tx/Rx VRING's, driver need to specify max. MPDU size
It should take into account all overhead introduced by 802.3->208.11
transformation.
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
-rw-r--r-- | drivers/net/wireless/ath/wil6210/main.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/wil6210/txrx.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/wil6210/txrx.h | 4 | ||||
-rw-r--r-- | drivers/net/wireless/ath/wil6210/wil6210.h | 12 | ||||
-rw-r--r-- | drivers/net/wireless/ath/wil6210/wmi.c | 2 |
5 files changed, 16 insertions, 6 deletions
diff --git a/drivers/net/wireless/ath/wil6210/main.c b/drivers/net/wireless/ath/wil6210/main.c index 18a2eb5b5d66..0af51fc2d981 100644 --- a/drivers/net/wireless/ath/wil6210/main.c +++ b/drivers/net/wireless/ath/wil6210/main.c | |||
@@ -41,7 +41,7 @@ MODULE_PARM_DESC(itr_trsh, " Interrupt moderation threshold, usecs."); | |||
41 | /* We allow allocation of more than 1 page buffers to support large packets. | 41 | /* We allow allocation of more than 1 page buffers to support large packets. |
42 | * It is suboptimal behavior performance wise in case MTU above page size. | 42 | * It is suboptimal behavior performance wise in case MTU above page size. |
43 | */ | 43 | */ |
44 | unsigned int mtu_max = TXRX_BUF_LEN_DEFAULT - ETH_HLEN; | 44 | unsigned int mtu_max = TXRX_BUF_LEN_DEFAULT - WIL_MAX_MPDU_OVERHEAD; |
45 | static int mtu_max_set(const char *val, const struct kernel_param *kp) | 45 | static int mtu_max_set(const char *val, const struct kernel_param *kp) |
46 | { | 46 | { |
47 | int ret; | 47 | int ret; |
diff --git a/drivers/net/wireless/ath/wil6210/txrx.c b/drivers/net/wireless/ath/wil6210/txrx.c index b7ffcfb8f38f..f33ea577efb3 100644 --- a/drivers/net/wireless/ath/wil6210/txrx.c +++ b/drivers/net/wireless/ath/wil6210/txrx.c | |||
@@ -645,7 +645,7 @@ int wil_vring_init_tx(struct wil6210_priv *wil, int id, int size, | |||
645 | .vring_cfg = { | 645 | .vring_cfg = { |
646 | .tx_sw_ring = { | 646 | .tx_sw_ring = { |
647 | .max_mpdu_size = | 647 | .max_mpdu_size = |
648 | cpu_to_le16(mtu_max + ETH_HLEN), | 648 | cpu_to_le16(wil_mtu2macbuf(mtu_max)), |
649 | .ring_size = cpu_to_le16(size), | 649 | .ring_size = cpu_to_le16(size), |
650 | }, | 650 | }, |
651 | .ringid = id, | 651 | .ringid = id, |
diff --git a/drivers/net/wireless/ath/wil6210/txrx.h b/drivers/net/wireless/ath/wil6210/txrx.h index 630aeb5fa7f4..e7db35646cdd 100644 --- a/drivers/net/wireless/ath/wil6210/txrx.h +++ b/drivers/net/wireless/ath/wil6210/txrx.h | |||
@@ -20,8 +20,8 @@ | |||
20 | #define BUF_SW_OWNED (1) | 20 | #define BUF_SW_OWNED (1) |
21 | #define BUF_HW_OWNED (0) | 21 | #define BUF_HW_OWNED (0) |
22 | 22 | ||
23 | /* size of max. Tx/Rx buffers, as supported by FW */ | 23 | /* default size of MAC Tx/Rx buffers */ |
24 | #define TXRX_BUF_LEN_DEFAULT (2242) | 24 | #define TXRX_BUF_LEN_DEFAULT (2048) |
25 | 25 | ||
26 | /* how many bytes to reserve for rtap header? */ | 26 | /* how many bytes to reserve for rtap header? */ |
27 | #define WIL6210_RTAP_SIZE (128) | 27 | #define WIL6210_RTAP_SIZE (128) |
diff --git a/drivers/net/wireless/ath/wil6210/wil6210.h b/drivers/net/wireless/ath/wil6210/wil6210.h index 1b4efd2ea09f..bedb9ed372f4 100644 --- a/drivers/net/wireless/ath/wil6210/wil6210.h +++ b/drivers/net/wireless/ath/wil6210/wil6210.h | |||
@@ -62,11 +62,21 @@ static inline u32 WIL_GET_BITS(u32 x, int b0, int b1) | |||
62 | #define WIL_MAX_AGG_WSIZE (32) /* FW/HW limit */ | 62 | #define WIL_MAX_AGG_WSIZE (32) /* FW/HW limit */ |
63 | /* Hardware offload block adds the following: | 63 | /* Hardware offload block adds the following: |
64 | * 26 bytes - 3-address QoS data header | 64 | * 26 bytes - 3-address QoS data header |
65 | * 8 bytes - IV + EIV (for GCMP) | ||
65 | * 8 bytes - SNAP | 66 | * 8 bytes - SNAP |
67 | * 16 bytes - MIC (for GCMP) | ||
66 | * 4 bytes - CRC | 68 | * 4 bytes - CRC |
67 | * 24 bytes - security related (if connection is secure) | ||
68 | */ | 69 | */ |
69 | #define WIL_MAX_MPDU_OVERHEAD (62) | 70 | #define WIL_MAX_MPDU_OVERHEAD (62) |
71 | |||
72 | /* Calculate MAC buffer size for the firmware. It includes all overhead, | ||
73 | * as it will go over the air, and need to be 8 byte aligned | ||
74 | */ | ||
75 | static inline u32 wil_mtu2macbuf(u32 mtu) | ||
76 | { | ||
77 | return ALIGN(mtu + WIL_MAX_MPDU_OVERHEAD, 8); | ||
78 | } | ||
79 | |||
70 | /* Max supported by wil6210 value for interrupt threshold is 5sec. */ | 80 | /* Max supported by wil6210 value for interrupt threshold is 5sec. */ |
71 | #define WIL6210_ITR_TRSH_MAX (5000000) | 81 | #define WIL6210_ITR_TRSH_MAX (5000000) |
72 | #define WIL6210_ITR_TRSH_DEFAULT (300) /* usec */ | 82 | #define WIL6210_ITR_TRSH_DEFAULT (300) /* usec */ |
diff --git a/drivers/net/wireless/ath/wil6210/wmi.c b/drivers/net/wireless/ath/wil6210/wmi.c index af2ca461fd86..70b055c59a37 100644 --- a/drivers/net/wireless/ath/wil6210/wmi.c +++ b/drivers/net/wireless/ath/wil6210/wmi.c | |||
@@ -1083,7 +1083,7 @@ int wmi_rx_chain_add(struct wil6210_priv *wil, struct vring *vring) | |||
1083 | struct wmi_cfg_rx_chain_cmd cmd = { | 1083 | struct wmi_cfg_rx_chain_cmd cmd = { |
1084 | .action = WMI_RX_CHAIN_ADD, | 1084 | .action = WMI_RX_CHAIN_ADD, |
1085 | .rx_sw_ring = { | 1085 | .rx_sw_ring = { |
1086 | .max_mpdu_size = cpu_to_le16(mtu_max + ETH_HLEN), | 1086 | .max_mpdu_size = cpu_to_le16(wil_mtu2macbuf(mtu_max)), |
1087 | .ring_mem_base = cpu_to_le64(vring->pa), | 1087 | .ring_mem_base = cpu_to_le64(vring->pa), |
1088 | .ring_size = cpu_to_le16(vring->size), | 1088 | .ring_size = cpu_to_le16(vring->size), |
1089 | }, | 1089 | }, |