diff options
author | Arik Nemtsov <arik@wizery.com> | 2012-05-18 00:46:36 -0400 |
---|---|---|
committer | Luciano Coelho <coelho@ti.com> | 2012-06-06 12:28:04 -0400 |
commit | 2c0133a437905591cdaa39cf65a3f7188d20a094 (patch) | |
tree | 2e48d9962c72af4454ee765e8d55c15db2faebd1 /drivers | |
parent | a4203c6453afcd21b3a6f0be592bf74951e80c72 (diff) |
wlcore/wl12xx/wl18xx: introduce quirk to remove TKIP header space
18xx chips do not require extra space in the TKIP header. Introduce a
new HW quirk to allow us to make this feature arch-specific. 12xx chip
will now have this quirk.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/ti/wl12xx/main.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/ti/wl18xx/tx.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/ti/wlcore/cmd.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/ti/wlcore/main.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/ti/wlcore/tx.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/ti/wlcore/wlcore.h | 3 |
6 files changed, 25 insertions, 12 deletions
diff --git a/drivers/net/wireless/ti/wl12xx/main.c b/drivers/net/wireless/ti/wl12xx/main.c index 77e0f318aa67..d33117efec79 100644 --- a/drivers/net/wireless/ti/wl12xx/main.c +++ b/drivers/net/wireless/ti/wl12xx/main.c | |||
@@ -625,7 +625,8 @@ static int wl12xx_identify_chip(struct wl1271 *wl) | |||
625 | wl1271_warning("chip id 0x%x (1271 PG10) support is obsolete", | 625 | wl1271_warning("chip id 0x%x (1271 PG10) support is obsolete", |
626 | wl->chip.id); | 626 | wl->chip.id); |
627 | 627 | ||
628 | wl->quirks |= WLCORE_QUIRK_LEGACY_NVS; | 628 | wl->quirks |= WLCORE_QUIRK_LEGACY_NVS | |
629 | WLCORE_QUIRK_TKIP_HEADER_SPACE; | ||
629 | wl->sr_fw_name = WL127X_FW_NAME_SINGLE; | 630 | wl->sr_fw_name = WL127X_FW_NAME_SINGLE; |
630 | wl->mr_fw_name = WL127X_FW_NAME_MULTI; | 631 | wl->mr_fw_name = WL127X_FW_NAME_MULTI; |
631 | memcpy(&wl->conf.mem, &wl12xx_default_priv_conf.mem_wl127x, | 632 | memcpy(&wl->conf.mem, &wl12xx_default_priv_conf.mem_wl127x, |
@@ -640,7 +641,8 @@ static int wl12xx_identify_chip(struct wl1271 *wl) | |||
640 | wl1271_debug(DEBUG_BOOT, "chip id 0x%x (1271 PG20)", | 641 | wl1271_debug(DEBUG_BOOT, "chip id 0x%x (1271 PG20)", |
641 | wl->chip.id); | 642 | wl->chip.id); |
642 | 643 | ||
643 | wl->quirks |= WLCORE_QUIRK_LEGACY_NVS; | 644 | wl->quirks |= WLCORE_QUIRK_LEGACY_NVS | |
645 | WLCORE_QUIRK_TKIP_HEADER_SPACE; | ||
644 | wl->plt_fw_name = WL127X_PLT_FW_NAME; | 646 | wl->plt_fw_name = WL127X_PLT_FW_NAME; |
645 | wl->sr_fw_name = WL127X_FW_NAME_SINGLE; | 647 | wl->sr_fw_name = WL127X_FW_NAME_SINGLE; |
646 | wl->mr_fw_name = WL127X_FW_NAME_MULTI; | 648 | wl->mr_fw_name = WL127X_FW_NAME_MULTI; |
@@ -660,7 +662,8 @@ static int wl12xx_identify_chip(struct wl1271 *wl) | |||
660 | wl->mr_fw_name = WL128X_FW_NAME_MULTI; | 662 | wl->mr_fw_name = WL128X_FW_NAME_MULTI; |
661 | 663 | ||
662 | /* wl128x requires TX blocksize alignment */ | 664 | /* wl128x requires TX blocksize alignment */ |
663 | wl->quirks |= WLCORE_QUIRK_TX_BLOCKSIZE_ALIGN; | 665 | wl->quirks |= WLCORE_QUIRK_TX_BLOCKSIZE_ALIGN | |
666 | WLCORE_QUIRK_TKIP_HEADER_SPACE; | ||
664 | 667 | ||
665 | break; | 668 | break; |
666 | case CHIP_ID_1283_PG10: | 669 | case CHIP_ID_1283_PG10: |
diff --git a/drivers/net/wireless/ti/wl18xx/tx.c b/drivers/net/wireless/ti/wl18xx/tx.c index 4de00b901505..5b1fb10d9fd7 100644 --- a/drivers/net/wireless/ti/wl18xx/tx.c +++ b/drivers/net/wireless/ti/wl18xx/tx.c | |||
@@ -75,7 +75,8 @@ static void wl18xx_tx_complete_packet(struct wl1271 *wl, u8 tx_stat_byte) | |||
75 | skb_pull(skb, sizeof(struct wl1271_tx_hw_descr)); | 75 | skb_pull(skb, sizeof(struct wl1271_tx_hw_descr)); |
76 | 76 | ||
77 | /* remove TKIP header space if present */ | 77 | /* remove TKIP header space if present */ |
78 | if (info->control.hw_key && | 78 | if ((wl->quirks & WLCORE_QUIRK_TKIP_HEADER_SPACE) && |
79 | info->control.hw_key && | ||
79 | info->control.hw_key->cipher == WLAN_CIPHER_SUITE_TKIP) { | 80 | info->control.hw_key->cipher == WLAN_CIPHER_SUITE_TKIP) { |
80 | int hdrlen = ieee80211_get_hdrlen_from_skb(skb); | 81 | int hdrlen = ieee80211_get_hdrlen_from_skb(skb); |
81 | memmove(skb->data + WL1271_EXTRA_SPACE_TKIP, skb->data, hdrlen); | 82 | memmove(skb->data + WL1271_EXTRA_SPACE_TKIP, skb->data, hdrlen); |
diff --git a/drivers/net/wireless/ti/wlcore/cmd.c b/drivers/net/wireless/ti/wlcore/cmd.c index df8d672b1f06..885364ca4344 100644 --- a/drivers/net/wireless/ti/wlcore/cmd.c +++ b/drivers/net/wireless/ti/wlcore/cmd.c | |||
@@ -1046,7 +1046,7 @@ out: | |||
1046 | 1046 | ||
1047 | int wl1271_cmd_build_arp_rsp(struct wl1271 *wl, struct wl12xx_vif *wlvif) | 1047 | int wl1271_cmd_build_arp_rsp(struct wl1271 *wl, struct wl12xx_vif *wlvif) |
1048 | { | 1048 | { |
1049 | int ret, extra; | 1049 | int ret, extra = 0; |
1050 | u16 fc; | 1050 | u16 fc; |
1051 | struct ieee80211_vif *vif = wl12xx_wlvif_to_vif(wlvif); | 1051 | struct ieee80211_vif *vif = wl12xx_wlvif_to_vif(wlvif); |
1052 | struct sk_buff *skb; | 1052 | struct sk_buff *skb; |
@@ -1085,7 +1085,8 @@ int wl1271_cmd_build_arp_rsp(struct wl1271 *wl, struct wl12xx_vif *wlvif) | |||
1085 | /* encryption space */ | 1085 | /* encryption space */ |
1086 | switch (wlvif->encryption_type) { | 1086 | switch (wlvif->encryption_type) { |
1087 | case KEY_TKIP: | 1087 | case KEY_TKIP: |
1088 | extra = WL1271_EXTRA_SPACE_TKIP; | 1088 | if (wl->quirks & WLCORE_QUIRK_TKIP_HEADER_SPACE) |
1089 | extra = WL1271_EXTRA_SPACE_TKIP; | ||
1089 | break; | 1090 | break; |
1090 | case KEY_AES: | 1091 | case KEY_AES: |
1091 | extra = WL1271_EXTRA_SPACE_AES; | 1092 | extra = WL1271_EXTRA_SPACE_AES; |
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c index 414fde41072c..5ac062831666 100644 --- a/drivers/net/wireless/ti/wlcore/main.c +++ b/drivers/net/wireless/ti/wlcore/main.c | |||
@@ -4975,9 +4975,11 @@ static int wl1271_init_ieee80211(struct wl1271 *wl) | |||
4975 | WL1271_CIPHER_SUITE_GEM, | 4975 | WL1271_CIPHER_SUITE_GEM, |
4976 | }; | 4976 | }; |
4977 | 4977 | ||
4978 | /* The tx descriptor buffer and the TKIP space. */ | 4978 | /* The tx descriptor buffer */ |
4979 | wl->hw->extra_tx_headroom = WL1271_EXTRA_SPACE_TKIP + | 4979 | wl->hw->extra_tx_headroom = sizeof(struct wl1271_tx_hw_descr); |
4980 | sizeof(struct wl1271_tx_hw_descr); | 4980 | |
4981 | if (wl->quirks & WLCORE_QUIRK_TKIP_HEADER_SPACE) | ||
4982 | wl->hw->extra_tx_headroom += WL1271_EXTRA_SPACE_TKIP; | ||
4981 | 4983 | ||
4982 | /* unit us */ | 4984 | /* unit us */ |
4983 | /* FIXME: find a proper value */ | 4985 | /* FIXME: find a proper value */ |
diff --git a/drivers/net/wireless/ti/wlcore/tx.c b/drivers/net/wireless/ti/wlcore/tx.c index e8a2998408b6..6b68e29a1e92 100644 --- a/drivers/net/wireless/ti/wlcore/tx.c +++ b/drivers/net/wireless/ti/wlcore/tx.c | |||
@@ -358,7 +358,8 @@ static int wl1271_prepare_tx_frame(struct wl1271 *wl, struct wl12xx_vif *wlvif, | |||
358 | /* TODO: handle dummy packets on multi-vifs */ | 358 | /* TODO: handle dummy packets on multi-vifs */ |
359 | is_dummy = wl12xx_is_dummy_packet(wl, skb); | 359 | is_dummy = wl12xx_is_dummy_packet(wl, skb); |
360 | 360 | ||
361 | if (info->control.hw_key && | 361 | if ((wl->quirks & WLCORE_QUIRK_TKIP_HEADER_SPACE) && |
362 | info->control.hw_key && | ||
362 | info->control.hw_key->cipher == WLAN_CIPHER_SUITE_TKIP) | 363 | info->control.hw_key->cipher == WLAN_CIPHER_SUITE_TKIP) |
363 | extra = WL1271_EXTRA_SPACE_TKIP; | 364 | extra = WL1271_EXTRA_SPACE_TKIP; |
364 | 365 | ||
@@ -852,7 +853,8 @@ static void wl1271_tx_complete_packet(struct wl1271 *wl, | |||
852 | skb_pull(skb, sizeof(struct wl1271_tx_hw_descr)); | 853 | skb_pull(skb, sizeof(struct wl1271_tx_hw_descr)); |
853 | 854 | ||
854 | /* remove TKIP header space if present */ | 855 | /* remove TKIP header space if present */ |
855 | if (info->control.hw_key && | 856 | if ((wl->quirks & WLCORE_QUIRK_TKIP_HEADER_SPACE) && |
857 | info->control.hw_key && | ||
856 | info->control.hw_key->cipher == WLAN_CIPHER_SUITE_TKIP) { | 858 | info->control.hw_key->cipher == WLAN_CIPHER_SUITE_TKIP) { |
857 | int hdrlen = ieee80211_get_hdrlen_from_skb(skb); | 859 | int hdrlen = ieee80211_get_hdrlen_from_skb(skb); |
858 | memmove(skb->data + WL1271_EXTRA_SPACE_TKIP, skb->data, | 860 | memmove(skb->data + WL1271_EXTRA_SPACE_TKIP, skb->data, |
@@ -1001,7 +1003,8 @@ void wl12xx_tx_reset(struct wl1271 *wl, bool reset_tx_queues) | |||
1001 | */ | 1003 | */ |
1002 | info = IEEE80211_SKB_CB(skb); | 1004 | info = IEEE80211_SKB_CB(skb); |
1003 | skb_pull(skb, sizeof(struct wl1271_tx_hw_descr)); | 1005 | skb_pull(skb, sizeof(struct wl1271_tx_hw_descr)); |
1004 | if (info->control.hw_key && | 1006 | if ((wl->quirks & WLCORE_QUIRK_TKIP_HEADER_SPACE) && |
1007 | info->control.hw_key && | ||
1005 | info->control.hw_key->cipher == | 1008 | info->control.hw_key->cipher == |
1006 | WLAN_CIPHER_SUITE_TKIP) { | 1009 | WLAN_CIPHER_SUITE_TKIP) { |
1007 | int hdrlen = ieee80211_get_hdrlen_from_skb(skb); | 1010 | int hdrlen = ieee80211_get_hdrlen_from_skb(skb); |
diff --git a/drivers/net/wireless/ti/wlcore/wlcore.h b/drivers/net/wireless/ti/wlcore/wlcore.h index 37a80f4bf5bb..16c28bbd1b20 100644 --- a/drivers/net/wireless/ti/wlcore/wlcore.h +++ b/drivers/net/wireless/ti/wlcore/wlcore.h | |||
@@ -411,6 +411,9 @@ int wlcore_free_hw(struct wl1271 *wl); | |||
411 | /* Some firmwares may not support ELP */ | 411 | /* Some firmwares may not support ELP */ |
412 | #define WLCORE_QUIRK_NO_ELP BIT(6) | 412 | #define WLCORE_QUIRK_NO_ELP BIT(6) |
413 | 413 | ||
414 | /* extra header space is required for TKIP */ | ||
415 | #define WLCORE_QUIRK_TKIP_HEADER_SPACE BIT(8) | ||
416 | |||
414 | /* TODO: move to the lower drivers when all usages are abstracted */ | 417 | /* TODO: move to the lower drivers when all usages are abstracted */ |
415 | #define CHIP_ID_1271_PG10 (0x4030101) | 418 | #define CHIP_ID_1271_PG10 (0x4030101) |
416 | #define CHIP_ID_1271_PG20 (0x4030111) | 419 | #define CHIP_ID_1271_PG20 (0x4030111) |