diff options
author | Arik Nemtsov <arik@wizery.com> | 2012-05-10 05:13:27 -0400 |
---|---|---|
committer | Luciano Coelho <coelho@ti.com> | 2012-06-05 08:55:20 -0400 |
commit | 2fc28de5989e1c40fee4e92e2a8f3bdd47b1b34a (patch) | |
tree | 78db906825e679db86874d628881f0525e1ab8d3 /drivers/net/wireless/ti/wlcore | |
parent | b8422dcb865befc5d2d7c21e8427eedf32558fea (diff) |
wlcore/wl18xx: add hw op for setting Tx HW checksum
Some chip families are capable of checksumming certain classes of Tx
packets in HW. Indicate this fact in the netdev features and perform the
HW checksum by protocol type for the 18xx family.
Fix the location of the skb network header when we move it so we can
rely on it when setting the checksum.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless/ti/wlcore')
-rw-r--r-- | drivers/net/wireless/ti/wlcore/acx.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ti/wlcore/hw_ops.h | 11 | ||||
-rw-r--r-- | drivers/net/wireless/ti/wlcore/tx.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/ti/wlcore/tx.h | 11 | ||||
-rw-r--r-- | drivers/net/wireless/ti/wlcore/wlcore.h | 3 |
5 files changed, 27 insertions, 2 deletions
diff --git a/drivers/net/wireless/ti/wlcore/acx.h b/drivers/net/wireless/ti/wlcore/acx.h index 2d1302d23ac8..ff0c5ba8e8ff 100644 --- a/drivers/net/wireless/ti/wlcore/acx.h +++ b/drivers/net/wireless/ti/wlcore/acx.h | |||
@@ -1245,6 +1245,7 @@ enum { | |||
1245 | ACX_CONFIG_HANGOVER = 0x0042, | 1245 | ACX_CONFIG_HANGOVER = 0x0042, |
1246 | ACX_FEATURE_CFG = 0x0043, | 1246 | ACX_FEATURE_CFG = 0x0043, |
1247 | ACX_PROTECTION_CFG = 0x0044, | 1247 | ACX_PROTECTION_CFG = 0x0044, |
1248 | ACX_CHECKSUM_CONFIG = 0x0045, | ||
1248 | }; | 1249 | }; |
1249 | 1250 | ||
1250 | 1251 | ||
diff --git a/drivers/net/wireless/ti/wlcore/hw_ops.h b/drivers/net/wireless/ti/wlcore/hw_ops.h index 9384b4d56c24..4573249ea89f 100644 --- a/drivers/net/wireless/ti/wlcore/hw_ops.h +++ b/drivers/net/wireless/ti/wlcore/hw_ops.h | |||
@@ -119,4 +119,15 @@ static inline int wlcore_identify_fw(struct wl1271 *wl) | |||
119 | return 0; | 119 | return 0; |
120 | } | 120 | } |
121 | 121 | ||
122 | static inline void | ||
123 | wlcore_hw_set_tx_desc_csum(struct wl1271 *wl, | ||
124 | struct wl1271_tx_hw_descr *desc, | ||
125 | struct sk_buff *skb) | ||
126 | { | ||
127 | if (!wl->ops->set_tx_desc_csum) | ||
128 | BUG_ON(1); | ||
129 | |||
130 | wl->ops->set_tx_desc_csum(wl, desc, skb); | ||
131 | } | ||
132 | |||
122 | #endif | 133 | #endif |
diff --git a/drivers/net/wireless/ti/wlcore/tx.c b/drivers/net/wireless/ti/wlcore/tx.c index b4e02ef22fc5..44e4e7bb29bd 100644 --- a/drivers/net/wireless/ti/wlcore/tx.c +++ b/drivers/net/wireless/ti/wlcore/tx.c | |||
@@ -270,6 +270,7 @@ static void wl1271_tx_fill_hdr(struct wl1271 *wl, struct wl12xx_vif *wlvif, | |||
270 | if (extra) { | 270 | if (extra) { |
271 | int hdrlen = ieee80211_hdrlen(frame_control); | 271 | int hdrlen = ieee80211_hdrlen(frame_control); |
272 | memmove(frame_start, hdr, hdrlen); | 272 | memmove(frame_start, hdr, hdrlen); |
273 | skb_set_network_header(skb, skb_network_offset(skb) + extra); | ||
273 | } | 274 | } |
274 | 275 | ||
275 | /* configure packet life time */ | 276 | /* configure packet life time */ |
@@ -332,9 +333,9 @@ static void wl1271_tx_fill_hdr(struct wl1271 *wl, struct wl12xx_vif *wlvif, | |||
332 | ieee80211_has_protected(frame_control)) | 333 | ieee80211_has_protected(frame_control)) |
333 | tx_attr |= TX_HW_ATTR_HOST_ENCRYPT; | 334 | tx_attr |= TX_HW_ATTR_HOST_ENCRYPT; |
334 | 335 | ||
335 | desc->reserved = 0; | ||
336 | desc->tx_attr = cpu_to_le16(tx_attr); | 336 | desc->tx_attr = cpu_to_le16(tx_attr); |
337 | 337 | ||
338 | wlcore_hw_set_tx_desc_csum(wl, desc, skb); | ||
338 | wlcore_hw_set_tx_desc_data_len(wl, desc, skb); | 339 | wlcore_hw_set_tx_desc_data_len(wl, desc, skb); |
339 | } | 340 | } |
340 | 341 | ||
diff --git a/drivers/net/wireless/ti/wlcore/tx.h b/drivers/net/wireless/ti/wlcore/tx.h index 220727421fa2..e24c436bf65f 100644 --- a/drivers/net/wireless/ti/wlcore/tx.h +++ b/drivers/net/wireless/ti/wlcore/tx.h | |||
@@ -130,7 +130,16 @@ struct wl1271_tx_hw_descr { | |||
130 | u8 tid; | 130 | u8 tid; |
131 | /* host link ID (HLID) */ | 131 | /* host link ID (HLID) */ |
132 | u8 hlid; | 132 | u8 hlid; |
133 | u8 reserved; | 133 | |
134 | union { | ||
135 | u8 wl12xx_reserved; | ||
136 | |||
137 | /* | ||
138 | * bit 0 -> 0 = udp, 1 = tcp | ||
139 | * bit 1:7 -> IP header offset | ||
140 | */ | ||
141 | u8 wl18xx_checksum_data; | ||
142 | } __packed; | ||
134 | } __packed; | 143 | } __packed; |
135 | 144 | ||
136 | enum wl1271_tx_hw_res_status { | 145 | enum wl1271_tx_hw_res_status { |
diff --git a/drivers/net/wireless/ti/wlcore/wlcore.h b/drivers/net/wireless/ti/wlcore/wlcore.h index 0b3f0b586f4b..c062d304ab0d 100644 --- a/drivers/net/wireless/ti/wlcore/wlcore.h +++ b/drivers/net/wireless/ti/wlcore/wlcore.h | |||
@@ -61,6 +61,9 @@ struct wlcore_ops { | |||
61 | struct wl12xx_vif *wlvif); | 61 | struct wl12xx_vif *wlvif); |
62 | s8 (*get_pg_ver)(struct wl1271 *wl); | 62 | s8 (*get_pg_ver)(struct wl1271 *wl); |
63 | void (*get_mac)(struct wl1271 *wl); | 63 | void (*get_mac)(struct wl1271 *wl); |
64 | void (*set_tx_desc_csum)(struct wl1271 *wl, | ||
65 | struct wl1271_tx_hw_descr *desc, | ||
66 | struct sk_buff *skb); | ||
64 | }; | 67 | }; |
65 | 68 | ||
66 | enum wlcore_partitions { | 69 | enum wlcore_partitions { |