staging: rtl8712u: Fix endian settings for structs describing network packets

The headers describing a number of network packets do not have the
correct endian settings for several types of data.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Larry Finger 2017-02-10 21:30:25 -06:00 committed by Greg Kroah-Hartman
parent e2288bce8e
commit 221c46d289

View file

@ -138,51 +138,51 @@ struct ieee_ibss_seq {
}; };
struct ieee80211_hdr { struct ieee80211_hdr {
u16 frame_ctl; __le16 frame_ctl;
u16 duration_id; __le16 duration_id;
u8 addr1[ETH_ALEN]; u8 addr1[ETH_ALEN];
u8 addr2[ETH_ALEN]; u8 addr2[ETH_ALEN];
u8 addr3[ETH_ALEN]; u8 addr3[ETH_ALEN];
u16 seq_ctl; __le16 seq_ctl;
u8 addr4[ETH_ALEN]; u8 addr4[ETH_ALEN];
} __packed; } __packed __aligned(2);
struct ieee80211_hdr_3addr { struct ieee80211_hdr_3addr {
u16 frame_ctl; __le16 frame_ctl;
u16 duration_id; __le16 duration_id;
u8 addr1[ETH_ALEN]; u8 addr1[ETH_ALEN];
u8 addr2[ETH_ALEN]; u8 addr2[ETH_ALEN];
u8 addr3[ETH_ALEN]; u8 addr3[ETH_ALEN];
u16 seq_ctl; __le16 seq_ctl;
} __packed; } __packed __aligned(2);
struct ieee80211_hdr_qos { struct ieee80211_hdr_qos {
u16 frame_ctl; __le16 frame_ctl;
u16 duration_id; __le16 duration_id;
u8 addr1[ETH_ALEN]; u8 addr1[ETH_ALEN];
u8 addr2[ETH_ALEN]; u8 addr2[ETH_ALEN];
u8 addr3[ETH_ALEN]; u8 addr3[ETH_ALEN];
u16 seq_ctl; __le16 seq_ctl;
u8 addr4[ETH_ALEN]; u8 addr4[ETH_ALEN];
u16 qc; __le16 qc;
} __packed; } __packed __aligned(2);
struct ieee80211_hdr_3addr_qos { struct ieee80211_hdr_3addr_qos {
u16 frame_ctl; __le16 frame_ctl;
u16 duration_id; __le16 duration_id;
u8 addr1[ETH_ALEN]; u8 addr1[ETH_ALEN];
u8 addr2[ETH_ALEN]; u8 addr2[ETH_ALEN];
u8 addr3[ETH_ALEN]; u8 addr3[ETH_ALEN];
u16 seq_ctl; __le16 seq_ctl;
u16 qc; __le16 qc;
} __packed; } __packed;
struct eapol { struct eapol {
u8 snap[6]; u8 snap[6];
u16 ethertype; __be16 ethertype;
u8 version; u8 version;
u8 type; u8 type;
u16 length; __le16 length;
} __packed; } __packed;
enum eap_type { enum eap_type {
@ -514,13 +514,13 @@ struct ieee80211_security {
*/ */
struct ieee80211_header_data { struct ieee80211_header_data {
u16 frame_ctl; __le16 frame_ctl;
u16 duration_id; __le16 duration_id;
u8 addr1[6]; u8 addr1[6];
u8 addr2[6]; u8 addr2[6];
u8 addr3[6]; u8 addr3[6];
u16 seq_ctrl; __le16 seq_ctrl;
}; } __packed __aligned(2);
#define BEACON_PROBE_SSID_ID_POSITION 12 #define BEACON_PROBE_SSID_ID_POSITION 12
@ -552,18 +552,18 @@ struct ieee80211_info_element {
/* /*
* These are the data types that can make up management packets * These are the data types that can make up management packets
* *
u16 auth_algorithm; __le16 auth_algorithm;
u16 auth_sequence; __le16 auth_sequence;
u16 beacon_interval; __le16 beacon_interval;
u16 capability; __le16 capability;
u8 current_ap[ETH_ALEN]; u8 current_ap[ETH_ALEN];
u16 listen_interval; __le16 listen_interval;
struct { struct {
u16 association_id:14, reserved:2; u16 association_id:14, reserved:2;
} __packed; } __packed;
u32 time_stamp[2]; __le32 time_stamp[2];
u16 reason; __le16 reason;
u16 status; __le16 status;
*/ */
#define IEEE80211_DEFAULT_TX_ESSID "Penguin" #define IEEE80211_DEFAULT_TX_ESSID "Penguin"
@ -571,16 +571,16 @@ struct ieee80211_info_element {
struct ieee80211_authentication { struct ieee80211_authentication {
struct ieee80211_header_data header; struct ieee80211_header_data header;
u16 algorithm; __le16 algorithm;
u16 transaction; __le16 transaction;
u16 status; __le16 status;
} __packed; } __packed;
struct ieee80211_probe_response { struct ieee80211_probe_response {
struct ieee80211_header_data header; struct ieee80211_header_data header;
u32 time_stamp[2]; __le32 time_stamp[2];
u16 beacon_interval; __le16 beacon_interval;
u16 capability; __le16 capability;
struct ieee80211_info_element info_element; struct ieee80211_info_element info_element;
} __packed; } __packed;
@ -590,16 +590,16 @@ struct ieee80211_probe_request {
struct ieee80211_assoc_request_frame { struct ieee80211_assoc_request_frame {
struct ieee80211_hdr_3addr header; struct ieee80211_hdr_3addr header;
u16 capability; __le16 capability;
u16 listen_interval; __le16 listen_interval;
struct ieee80211_info_element_hdr info_element; struct ieee80211_info_element_hdr info_element;
} __packed; } __packed;
struct ieee80211_assoc_response_frame { struct ieee80211_assoc_response_frame {
struct ieee80211_hdr_3addr header; struct ieee80211_hdr_3addr header;
u16 capability; __le16 capability;
u16 status; __le16 status;
u16 aid; __le16 aid;
} __packed; } __packed;
struct ieee80211_txb { struct ieee80211_txb {