diff options
author | Arik Nemtsov <arik@wizery.com> | 2012-05-10 05:13:28 -0400 |
---|---|---|
committer | Luciano Coelho <coelho@ti.com> | 2012-06-05 08:55:23 -0400 |
commit | 169da04f523bafee46993b1efbddb913641aad56 (patch) | |
tree | 999b7a797dd977f2665556ab9ec433e2a46b4fbd /drivers/net/wireless/ti/wl18xx/main.c | |
parent | 2fc28de5989e1c40fee4e92e2a8f3bdd47b1b34a (diff) |
wlcore/wl18xx: add hw op for Rx HW checksum
Some chip families can checksum certain classes of Rx packets in FW.
Implement the Rx-checksum feature as a HW-op. For the 18xx chip-family,
set Rx-checsum according to indication from FW.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless/ti/wl18xx/main.c')
-rw-r--r-- | drivers/net/wireless/ti/wl18xx/main.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c index c47f52c81a72..90fccb775727 100644 --- a/drivers/net/wireless/ti/wl18xx/main.c +++ b/drivers/net/wireless/ti/wl18xx/main.c | |||
@@ -39,6 +39,8 @@ | |||
39 | #include "wl18xx.h" | 39 | #include "wl18xx.h" |
40 | 40 | ||
41 | 41 | ||
42 | #define WL18XX_RX_CHECKSUM_MASK 0x40 | ||
43 | |||
42 | static const u8 wl18xx_rate_to_idx_2ghz[] = { | 44 | static const u8 wl18xx_rate_to_idx_2ghz[] = { |
43 | /* MCS rates are used only with 11n */ | 45 | /* MCS rates are used only with 11n */ |
44 | 15, /* WL18XX_CONF_HW_RXTX_RATE_MCS15 */ | 46 | 15, /* WL18XX_CONF_HW_RXTX_RATE_MCS15 */ |
@@ -534,6 +536,14 @@ static void wl18xx_set_tx_desc_csum(struct wl1271 *wl, | |||
534 | desc->wl18xx_checksum_data |= (ip_hdr->protocol & 0x01); | 536 | desc->wl18xx_checksum_data |= (ip_hdr->protocol & 0x01); |
535 | } | 537 | } |
536 | 538 | ||
539 | static void wl18xx_set_rx_csum(struct wl1271 *wl, | ||
540 | struct wl1271_rx_descriptor *desc, | ||
541 | struct sk_buff *skb) | ||
542 | { | ||
543 | if (desc->status & WL18XX_RX_CHECKSUM_MASK) | ||
544 | skb->ip_summed = CHECKSUM_UNNECESSARY; | ||
545 | } | ||
546 | |||
537 | static struct wlcore_ops wl18xx_ops = { | 547 | static struct wlcore_ops wl18xx_ops = { |
538 | .identify_chip = wl18xx_identify_chip, | 548 | .identify_chip = wl18xx_identify_chip, |
539 | .boot = wl18xx_boot, | 549 | .boot = wl18xx_boot, |
@@ -548,6 +558,7 @@ static struct wlcore_ops wl18xx_ops = { | |||
548 | .tx_delayed_compl = NULL, | 558 | .tx_delayed_compl = NULL, |
549 | .hw_init = wl18xx_hw_init, | 559 | .hw_init = wl18xx_hw_init, |
550 | .set_tx_desc_csum = wl18xx_set_tx_desc_csum, | 560 | .set_tx_desc_csum = wl18xx_set_tx_desc_csum, |
561 | .set_rx_csum = wl18xx_set_rx_csum, | ||
551 | }; | 562 | }; |
552 | 563 | ||
553 | int __devinit wl18xx_probe(struct platform_device *pdev) | 564 | int __devinit wl18xx_probe(struct platform_device *pdev) |