diff options
author | 2017-10-18 15:45:38 +0000 | |
---|---|---|
committer | 2017-10-18 15:45:38 +0000 | |
commit | 8a566dbaa0409d200bd076d2ea78e5e586002c8c (patch) | |
tree | f7a800cf6f05fa0715c8caeb6647e1a6cd4a2168 | |
parent | The return value of this function isn't used. (diff) | |
download | wireguard-openbsd-8a566dbaa0409d200bd076d2ea78e5e586002c8c.tar.xz wireguard-openbsd-8a566dbaa0409d200bd076d2ea78e5e586002c8c.zip |
It turns out that using the packed attribute on most structs was a bad
idea since the brcmfmac implementation relies on the compiler generated
padding. Removing the packed attribute allows reading correct data from
the BSS info. As a next step it might be a good idea to pad the structs
manually.
Diffstat (limited to '')
-rw-r--r-- | sys/dev/ic/bwfmreg.h | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/sys/dev/ic/bwfmreg.h b/sys/dev/ic/bwfmreg.h index 4208c221274..cad0a58c4a6 100644 --- a/sys/dev/ic/bwfmreg.h +++ b/sys/dev/ic/bwfmreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bwfmreg.h,v 1.5 2017/10/18 12:58:45 patrick Exp $ */ +/* $OpenBSD: bwfmreg.h,v 1.6 2017/10/18 15:45:38 patrick Exp $ */ /* * Copyright (c) 2010-2016 Broadcom Corporation * Copyright (c) 2016,2017 Patrick Wildt <patrick@blueri.se> @@ -244,7 +244,7 @@ struct bwfm_proto_bcdc_dcmd { uint32_t status; } hdr; char buf[8192]; -} __packed; +}; struct bwfm_proto_bcdc_hdr { uint8_t flags; @@ -257,7 +257,7 @@ struct bwfm_proto_bcdc_hdr { uint8_t flags2; #define BWFM_BCDC_FLAG2_IF_MASK 0xf uint8_t data_offset; -} __packed; +}; #define BWFM_MCSSET_LEN 16 #define BWFM_MAX_SSID_LEN 32 @@ -286,12 +286,12 @@ struct bwfm_bss_info { uint16_t ie_offset; uint32_t ie_length; uint16_t snr; -} __packed; +}; struct bwfm_ssid { uint32_t len; uint8_t ssid[BWFM_MAX_SSID_LEN]; -} __packed; +}; struct bwfm_scan_params { struct bwfm_ssid ssid; @@ -305,14 +305,14 @@ struct bwfm_scan_params { uint32_t home_time; uint32_t channel_num; uint16_t channel_list[]; -} __packed; +}; struct bwfm_scan_results { uint32_t buflen; uint32_t version; uint32_t count; struct bwfm_bss_info bss_info[]; -} __packed; +}; struct bwfm_escan_params { uint32_t version; @@ -323,7 +323,7 @@ struct bwfm_escan_params { #define WL_ESCAN_ACTION_ABORT 3 uint16_t sync_id; struct bwfm_scan_params scan_params; -} __packed; +}; struct bwfm_escan_results { uint32_t buflen; @@ -331,13 +331,13 @@ struct bwfm_escan_results { uint16_t sync_id; uint16_t bss_count; struct bwfm_bss_info bss_info[]; -} __packed; +}; struct bwfm_assoc_params { uint8_t bssid[ETHER_ADDR_LEN]; uint32_t chanspec_num; uint16_t chanspec_list[]; -} __packed; +}; struct bwfm_join_pref_params { uint8_t type; @@ -353,12 +353,12 @@ struct bwfm_join_pref_params { #define BWFM_JOIN_PREF_BAND_5G 1 #define BWFM_JOIN_PREF_BAND_2G 2 #define BWFM_JOIN_PREF_BAND_ALL 3 -} __packed; +}; struct bwfm_join_params { struct bwfm_ssid ssid; struct bwfm_assoc_params assoc; -} __packed; +}; struct bwfm_join_scan_params { uint8_t scan_type; @@ -366,13 +366,13 @@ struct bwfm_join_scan_params { uint32_t active_time; uint32_t passive_time; uint32_t home_time; -} __packed; +}; struct bwfm_ext_join_params { struct bwfm_ssid ssid; struct bwfm_join_scan_params scan; struct bwfm_assoc_params assoc; -} __packed; +}; struct bwfm_wsec_pmk { uint16_t key_len; @@ -380,7 +380,7 @@ struct bwfm_wsec_pmk { uint16_t flags; #define BWFM_WSEC_PASSPHRASE (1 << 0) uint8_t key[2 * BWFM_WSEC_MAX_PSK_LEN + 1]; -} __packed; +}; /* Event handling */ enum bwfm_fweh_event_code { |