summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/wil6210/wmi.c
diff options
context:
space:
mode:
authorVladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>2015-03-15 16:00:19 +0200
committerKalle Valo <kvalo@codeaurora.org>2015-03-20 08:33:19 +0200
commitc406ea7c7406f00aa1fb6c697d47d070fd222037 (patch)
tree6d47a0202ed18a8219011422c81de335be8ff25b /drivers/net/wireless/ath/wil6210/wmi.c
parentcec94d8cf5c2e5347ed9264cc94210e6376c7a46 (diff)
downloadlinux-c406ea7c7406f00aa1fb6c697d47d070fd222037.tar.gz
linux-c406ea7c7406f00aa1fb6c697d47d070fd222037.tar.bz2
linux-c406ea7c7406f00aa1fb6c697d47d070fd222037.zip
wil6210: Align Rx frames on 4*n+2 by having SNAP
For the networking code and for hardware network accelerators, it is better to have IP header 4*n aligned. On the other side, DMA on Rx path require buffer to be aligned on 4*n as well. Having 14 bytes of Ethernet header, these 2 alignment requests are in contradiction. To solve this, order hardware offload block to not remove SNAP header. This adds extra 6 bytes between addresses and ethertype, making it 20 bytes total. This way, both buffer and IP header are 4*n aligned. Remaining is only to remove SNAP by shifting addresses 6 bytes. This involves data copying, so this feature should be disabled unless required by the platform. Module parameter "rx_align_2" (bool, default - false) introduced to control this feature. Feature is completely disabled when parameter is false. Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/ath/wil6210/wmi.c')
-rw-r--r--drivers/net/wireless/ath/wil6210/wmi.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/wil6210/wmi.c b/drivers/net/wireless/ath/wil6210/wmi.c
index 021313524913..8c18a46582db 100644
--- a/drivers/net/wireless/ath/wil6210/wmi.c
+++ b/drivers/net/wireless/ath/wil6210/wmi.c
@@ -1109,6 +1109,11 @@ int wmi_rx_chain_add(struct wil6210_priv *wil, struct vring *vring)
*/
cmd.l3_l4_ctrl |= (1 << L3_L4_CTRL_TCPIP_CHECKSUM_EN_POS);
}
+
+ if (rx_align_2)
+ cmd.l2_802_3_offload_ctrl |=
+ L2_802_3_OFFLOAD_CTRL_SNAP_KEEP_MSK;
+
/* typical time for secure PCP is 840ms */
rc = wmi_call(wil, WMI_CFG_RX_CHAIN_CMDID, &cmd, sizeof(cmd),
WMI_CFG_RX_CHAIN_DONE_EVENTID, &evt, sizeof(evt), 2000);