diff options
author | Felix Fietkau <nbd@openwrt.org> | 2013-02-22 11:28:49 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-03-06 10:35:45 -0500 |
commit | b8a31c9a5afff257cc5dd637cda5fef03e12d67b (patch) | |
tree | 0b8555a584440f1c194b05680339d04b8c0a5107 /include | |
parent | 9a886586c82aa02cb49f8c85e961595716884545 (diff) |
ieee80211: mark 802.11 related structs as being 2-byte aligned
Regardless of what header features they use, or if they align the IP
header or not, 802.11 packets from all drivers guarantee a 2-byte
alignment (and there's a debug WARN_ON in case they don't).
Annotate packet structs with __aligned(2) to allow the compiler to use
16-bit load/store operations on platforms with extremely inefficient
unaligned access (e.g. MIPS).
This reduces code size and improves performance on affected platforms
and causes no binary code change on others.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/ieee80211.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index a0c550fb65a6..6e352c31fee0 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h | |||
@@ -213,7 +213,7 @@ struct ieee80211_hdr { | |||
213 | u8 addr3[6]; | 213 | u8 addr3[6]; |
214 | __le16 seq_ctrl; | 214 | __le16 seq_ctrl; |
215 | u8 addr4[6]; | 215 | u8 addr4[6]; |
216 | } __packed; | 216 | } __packed __aligned(2); |
217 | 217 | ||
218 | struct ieee80211_hdr_3addr { | 218 | struct ieee80211_hdr_3addr { |
219 | __le16 frame_control; | 219 | __le16 frame_control; |
@@ -222,7 +222,7 @@ struct ieee80211_hdr_3addr { | |||
222 | u8 addr2[6]; | 222 | u8 addr2[6]; |
223 | u8 addr3[6]; | 223 | u8 addr3[6]; |
224 | __le16 seq_ctrl; | 224 | __le16 seq_ctrl; |
225 | } __packed; | 225 | } __packed __aligned(2); |
226 | 226 | ||
227 | struct ieee80211_qos_hdr { | 227 | struct ieee80211_qos_hdr { |
228 | __le16 frame_control; | 228 | __le16 frame_control; |
@@ -232,7 +232,7 @@ struct ieee80211_qos_hdr { | |||
232 | u8 addr3[6]; | 232 | u8 addr3[6]; |
233 | __le16 seq_ctrl; | 233 | __le16 seq_ctrl; |
234 | __le16 qos_ctrl; | 234 | __le16 qos_ctrl; |
235 | } __packed; | 235 | } __packed __aligned(2); |
236 | 236 | ||
237 | /** | 237 | /** |
238 | * ieee80211_has_tods - check if IEEE80211_FCTL_TODS is set | 238 | * ieee80211_has_tods - check if IEEE80211_FCTL_TODS is set |
@@ -609,7 +609,7 @@ struct ieee80211s_hdr { | |||
609 | __le32 seqnum; | 609 | __le32 seqnum; |
610 | u8 eaddr1[6]; | 610 | u8 eaddr1[6]; |
611 | u8 eaddr2[6]; | 611 | u8 eaddr2[6]; |
612 | } __packed; | 612 | } __packed __aligned(2); |
613 | 613 | ||
614 | /* Mesh flags */ | 614 | /* Mesh flags */ |
615 | #define MESH_FLAGS_AE_A4 0x1 | 615 | #define MESH_FLAGS_AE_A4 0x1 |
@@ -903,7 +903,7 @@ struct ieee80211_mgmt { | |||
903 | } u; | 903 | } u; |
904 | } __packed action; | 904 | } __packed action; |
905 | } u; | 905 | } u; |
906 | } __packed; | 906 | } __packed __aligned(2); |
907 | 907 | ||
908 | /* Supported Rates value encodings in 802.11n-2009 7.3.2.2 */ | 908 | /* Supported Rates value encodings in 802.11n-2009 7.3.2.2 */ |
909 | #define BSS_MEMBERSHIP_SELECTOR_HT_PHY 127 | 909 | #define BSS_MEMBERSHIP_SELECTOR_HT_PHY 127 |
@@ -934,20 +934,20 @@ struct ieee80211_rts { | |||
934 | __le16 duration; | 934 | __le16 duration; |
935 | u8 ra[6]; | 935 | u8 ra[6]; |
936 | u8 ta[6]; | 936 | u8 ta[6]; |
937 | } __packed; | 937 | } __packed __aligned(2); |
938 | 938 | ||
939 | struct ieee80211_cts { | 939 | struct ieee80211_cts { |
940 | __le16 frame_control; | 940 | __le16 frame_control; |
941 | __le16 duration; | 941 | __le16 duration; |
942 | u8 ra[6]; | 942 | u8 ra[6]; |
943 | } __packed; | 943 | } __packed __aligned(2); |
944 | 944 | ||
945 | struct ieee80211_pspoll { | 945 | struct ieee80211_pspoll { |
946 | __le16 frame_control; | 946 | __le16 frame_control; |
947 | __le16 aid; | 947 | __le16 aid; |
948 | u8 bssid[6]; | 948 | u8 bssid[6]; |
949 | u8 ta[6]; | 949 | u8 ta[6]; |
950 | } __packed; | 950 | } __packed __aligned(2); |
951 | 951 | ||
952 | /* TDLS */ | 952 | /* TDLS */ |
953 | 953 | ||