diff options
author | Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> | 2014-09-10 09:34:45 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-09-11 15:27:38 -0400 |
commit | e0106adade2dd16fb776f53f25ffe50da0793f3d (patch) | |
tree | 4918217c0a3cb8eea99627904d56048355b47fff | |
parent | 1bd922fce29168b8a7d5b53c7be89de87381896b (diff) |
wil6210: enlarge TX/RX buffer length
HW supports upto 2304 packet size on the air.
HW is responsible for adding (Tx) or removing (Rx) the following headers:
802.11 hdr: 26B
SNAP: 8B
CRC: 4B
Security (optional): 24B
HW adds max 62B to the payload passed from driver. It means driver can use
max packet size of 2304-62 = 2242B
Signed-off-by: Dedy Lansky <qca_dlansky@qca.qualcomm.com>
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/ath/wil6210/netdev.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/ath/wil6210/txrx.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/ath/wil6210/txrx.h | 6 |
3 files changed, 9 insertions, 5 deletions
diff --git a/drivers/net/wireless/ath/wil6210/netdev.c b/drivers/net/wireless/ath/wil6210/netdev.c index a995d9d59cb5..1c0c77d9a14f 100644 --- a/drivers/net/wireless/ath/wil6210/netdev.c +++ b/drivers/net/wireless/ath/wil6210/netdev.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/etherdevice.h> | 17 | #include <linux/etherdevice.h> |
18 | 18 | ||
19 | #include "wil6210.h" | 19 | #include "wil6210.h" |
20 | #include "txrx.h" | ||
20 | 21 | ||
21 | static int wil_open(struct net_device *ndev) | 22 | static int wil_open(struct net_device *ndev) |
22 | { | 23 | { |
@@ -40,8 +41,10 @@ static int wil_change_mtu(struct net_device *ndev, int new_mtu) | |||
40 | { | 41 | { |
41 | struct wil6210_priv *wil = ndev_to_wil(ndev); | 42 | struct wil6210_priv *wil = ndev_to_wil(ndev); |
42 | 43 | ||
43 | if (new_mtu < 68 || new_mtu > IEEE80211_MAX_DATA_LEN_DMG) | 44 | if (new_mtu < 68 || new_mtu > (TX_BUF_LEN - ETH_HLEN)) { |
45 | wil_err(wil, "invalid MTU %d\n", new_mtu); | ||
44 | return -EINVAL; | 46 | return -EINVAL; |
47 | } | ||
45 | 48 | ||
46 | wil_dbg_misc(wil, "change MTU %d -> %d\n", ndev->mtu, new_mtu); | 49 | wil_dbg_misc(wil, "change MTU %d -> %d\n", ndev->mtu, new_mtu); |
47 | ndev->mtu = new_mtu; | 50 | ndev->mtu = new_mtu; |
diff --git a/drivers/net/wireless/ath/wil6210/txrx.c b/drivers/net/wireless/ath/wil6210/txrx.c index 02fd43d264e4..2936ef0c18cb 100644 --- a/drivers/net/wireless/ath/wil6210/txrx.c +++ b/drivers/net/wireless/ath/wil6210/txrx.c | |||
@@ -668,7 +668,8 @@ int wil_vring_init_tx(struct wil6210_priv *wil, int id, int size, | |||
668 | struct vring *vring = &wil->vring_tx[id]; | 668 | struct vring *vring = &wil->vring_tx[id]; |
669 | struct vring_tx_data *txdata = &wil->vring_tx_data[id]; | 669 | struct vring_tx_data *txdata = &wil->vring_tx_data[id]; |
670 | 670 | ||
671 | wil_dbg_misc(wil, "%s()\n", __func__); | 671 | wil_dbg_misc(wil, "%s() max_mpdu_size %d\n", __func__, |
672 | cmd.vring_cfg.tx_sw_ring.max_mpdu_size); | ||
672 | 673 | ||
673 | if (vring->va) { | 674 | if (vring->va) { |
674 | wil_err(wil, "Tx ring [%d] already allocated\n", id); | 675 | wil_err(wil, "Tx ring [%d] already allocated\n", id); |
diff --git a/drivers/net/wireless/ath/wil6210/txrx.h b/drivers/net/wireless/ath/wil6210/txrx.h index 979edf221dd3..de046716d2b7 100644 --- a/drivers/net/wireless/ath/wil6210/txrx.h +++ b/drivers/net/wireless/ath/wil6210/txrx.h | |||
@@ -20,9 +20,9 @@ | |||
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. Rx packet */ | 23 | /* size of max. Tx/Rx buffers, as supported by FW */ |
24 | #define RX_BUF_LEN (2048) | 24 | #define RX_BUF_LEN (2242) |
25 | #define TX_BUF_LEN (2048) | 25 | #define TX_BUF_LEN (2242) |
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) |
28 | 28 | ||