summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ti/wl18xx
diff options
context:
space:
mode:
authorLuciano Coelho <coelho@ti.com>2012-05-10 09:13:53 (GMT)
committerLuciano Coelho <coelho@ti.com>2012-06-05 12:56:53 (GMT)
commit102165c6d2b8d73a25a1567fcac496addc15aba7 (patch)
treea03777e8c9d4267440c11a4690741f7af3ba8df9 /drivers/net/wireless/ti/wl18xx
parente9258815a8e21e34395d5b6a4da27f1bfcbdca11 (diff)
downloadlinux-fsl-qoriq-102165c6d2b8d73a25a1567fcac496addc15aba7.tar.xz
wl18xx: add module parameter to disable TCP checksum
Add a new module parameter to disable TCP checksum offload. Signed-off-by: Luciano Coelho <coelho@ti.com> Signed-off-by: Arik Nemtsov <arik@wizery.com>
Diffstat (limited to 'drivers/net/wireless/ti/wl18xx')
-rw-r--r--drivers/net/wireless/ti/wl18xx/main.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c
index 2f0cbf8..b76b6ac 100644
--- a/drivers/net/wireless/ti/wl18xx/main.c
+++ b/drivers/net/wireless/ti/wl18xx/main.c
@@ -47,6 +47,7 @@ static char *board_type_param;
static bool dc2dc_param = false;
static int n_antennas_2_param = 1;
static int n_antennas_5_param = 1;
+static bool checksum_param = true;
static const u8 wl18xx_rate_to_idx_2ghz[] = {
/* MCS rates are used only with 11n */
@@ -865,9 +866,11 @@ static int wl18xx_hw_init(struct wl1271 *wl)
if (ret < 0)
return ret;
- ret = wl18xx_acx_set_checksum_state(wl);
- if (ret != 0)
- return ret;
+ if (checksum_param) {
+ ret = wl18xx_acx_set_checksum_state(wl);
+ if (ret != 0)
+ return ret;
+ }
return ret;
}
@@ -879,6 +882,11 @@ static void wl18xx_set_tx_desc_csum(struct wl1271 *wl,
u32 ip_hdr_offset;
struct iphdr *ip_hdr;
+ if (!checksum_param) {
+ desc->wl18xx_checksum_data = 0;
+ return;
+ }
+
if (skb->ip_summed != CHECKSUM_PARTIAL) {
desc->wl18xx_checksum_data = 0;
return;
@@ -1065,6 +1073,11 @@ int __devinit wl18xx_probe(struct platform_device *pdev)
return -EINVAL;
}
+ if (!checksum_param) {
+ wl18xx_ops.set_rx_csum = NULL;
+ wl18xx_ops.init_vif = NULL;
+ }
+
wl18xx_conf_init(wl);
return wlcore_probe(wl, pdev);
@@ -1114,6 +1127,9 @@ MODULE_PARM_DESC(n_antennas_2, "Number of installed 2.4GHz antennas: 1 (default)
module_param_named(n_antennas_5, n_antennas_5_param, uint, S_IRUSR);
MODULE_PARM_DESC(n_antennas_5, "Number of installed 5GHz antennas: 1 (default) or 2");
+module_param_named(checksum, checksum_param, bool, S_IRUSR);
+MODULE_PARM_DESC(checksum, "Enable TCP checksum: boolean (defaults to true)");
+
MODULE_LICENSE("GPL v2");
MODULE_AUTHOR("Luciano Coelho <coelho@ti.com>");
MODULE_FIRMWARE(WL18XX_FW_NAME);