Commit 71ddc43e authored by Philipp Hortmann's avatar Philipp Hortmann Committed by Greg Kroah-Hartman
Browse files

staging: rtl8192e: Replace struct rtllib_hdr_3addr in structs of rtllib.h



Replace struct rtllib_hdr_3addr with struct ieee80211_hdr_3addr to avoid
proprietary struct in structs of rtllib.h.

Signed-off-by: default avatarPhilipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/e327712027b022561759d7cadcf51bf8274ab05a.1694792595.git.philipp.g.hortmann@gmail.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a8550ee7
Loading
Loading
Loading
Loading
+7 −17
Original line number Diff line number Diff line
@@ -685,16 +685,6 @@ struct rtllib_hdr {
	u8 payload[];
} __packed;

struct rtllib_hdr_3addr {
	__le16 frame_ctl;
	__le16 duration_id;
	u8 addr1[ETH_ALEN];
	u8 addr2[ETH_ALEN];
	u8 addr3[ETH_ALEN];
	__le16 seq_ctl;
	u8 payload[];
} __packed;

struct rtllib_hdr_4addr {
	__le16 frame_ctl;
	__le16 duration_id;
@@ -736,7 +726,7 @@ struct rtllib_info_element {
} __packed;

struct rtllib_authentication {
	struct rtllib_hdr_3addr header;
	struct ieee80211_hdr_3addr header;
	__le16 algorithm;
	__le16 transaction;
	__le16 status;
@@ -745,23 +735,23 @@ struct rtllib_authentication {
} __packed;

struct rtllib_disauth {
	struct rtllib_hdr_3addr header;
	struct ieee80211_hdr_3addr header;
	__le16 reason;
} __packed;

struct rtllib_disassoc {
	struct rtllib_hdr_3addr header;
	struct ieee80211_hdr_3addr header;
	__le16 reason;
} __packed;

struct rtllib_probe_request {
	struct rtllib_hdr_3addr header;
	struct ieee80211_hdr_3addr header;
	/* SSID, supported rates */
	struct rtllib_info_element info_element[];
} __packed;

struct rtllib_probe_response {
	struct rtllib_hdr_3addr header;
	struct ieee80211_hdr_3addr header;
	u32 time_stamp[2];
	__le16 beacon_interval;
	__le16 capability;
@@ -775,7 +765,7 @@ struct rtllib_probe_response {
#define rtllib_beacon rtllib_probe_response

struct rtllib_assoc_request_frame {
	struct rtllib_hdr_3addr header;
	struct ieee80211_hdr_3addr header;
	__le16 capability;
	__le16 listen_interval;
	/* SSID, supported rates, RSN */
@@ -783,7 +773,7 @@ struct rtllib_assoc_request_frame {
} __packed;

struct rtllib_assoc_response_frame {
	struct rtllib_hdr_3addr header;
	struct ieee80211_hdr_3addr header;
	__le16 capability;
	__le16 status;
	__le16 aid;
+1 −1
Original line number Diff line number Diff line
@@ -2483,7 +2483,7 @@ static inline void rtllib_process_probe_response(
	short renew;
	struct rtllib_network *network = kzalloc(sizeof(struct rtllib_network),
						 GFP_ATOMIC);
	__le16 frame_ctl = beacon->header.frame_ctl;
	__le16 frame_ctl = beacon->header.frame_control;

	if (!network)
		return;
+9 −9
Original line number Diff line number Diff line
@@ -331,7 +331,7 @@ static inline struct sk_buff *rtllib_probe_req(struct rtllib_device *ieee)
	skb_reserve(skb, ieee->tx_headroom);

	req = skb_put(skb, sizeof(struct rtllib_probe_request));
	req->header.frame_ctl = cpu_to_le16(RTLLIB_STYPE_PROBE_REQ);
	req->header.frame_control = cpu_to_le16(RTLLIB_STYPE_PROBE_REQ);
	req->header.duration_id = 0;

	eth_broadcast_addr(req->header.addr1);
@@ -739,9 +739,9 @@ rtllib_authentication_req(struct rtllib_network *beacon,

	auth = skb_put(skb, sizeof(struct rtllib_authentication));

	auth->header.frame_ctl = cpu_to_le16(RTLLIB_STYPE_AUTH);
	auth->header.frame_control = cpu_to_le16(RTLLIB_STYPE_AUTH);
	if (challengelen)
		auth->header.frame_ctl |= cpu_to_le16(RTLLIB_FCTL_WEP);
		auth->header.frame_control |= cpu_to_le16(RTLLIB_FCTL_WEP);

	auth->header.duration_id = cpu_to_le16(0x013a);
	ether_addr_copy(auth->header.addr1, beacon->bssid);
@@ -860,7 +860,7 @@ static struct sk_buff *rtllib_probe_resp(struct rtllib_device *ieee,
	if (encrypt)
		beacon_buf->capability |= cpu_to_le16(WLAN_CAPABILITY_PRIVACY);

	beacon_buf->header.frame_ctl = cpu_to_le16(RTLLIB_STYPE_PROBE_RESP);
	beacon_buf->header.frame_control = cpu_to_le16(RTLLIB_STYPE_PROBE_RESP);
	beacon_buf->info_element[0].id = MFIE_TYPE_SSID;
	beacon_buf->info_element[0].len = ssid_len;

@@ -1076,7 +1076,7 @@ rtllib_association_req(struct rtllib_network *beacon,

	hdr = skb_put(skb, sizeof(struct rtllib_assoc_request_frame) + 2);

	hdr->header.frame_ctl = cpu_to_le16(RTLLIB_STYPE_ASSOC_REQ);
	hdr->header.frame_control = cpu_to_le16(RTLLIB_STYPE_ASSOC_REQ);
	hdr->header.duration_id = cpu_to_le16(37);
	ether_addr_copy(hdr->header.addr1, beacon->bssid);
	ether_addr_copy(hdr->header.addr2, ieee->dev->dev_addr);
@@ -2488,7 +2488,7 @@ static struct sk_buff *rtllib_get_beacon_(struct rtllib_device *ieee)
		return NULL;

	b = (struct rtllib_probe_response *)skb->data;
	b->header.frame_ctl = cpu_to_le16(RTLLIB_STYPE_BEACON);
	b->header.frame_control = cpu_to_le16(RTLLIB_STYPE_BEACON);

	return skb;
}
@@ -2503,7 +2503,7 @@ struct sk_buff *rtllib_get_beacon(struct rtllib_device *ieee)
		return NULL;

	b = (struct rtllib_probe_response *)skb->data;
	b->header.seq_ctl = cpu_to_le16(ieee->seq_ctrl[0] << 4);
	b->header.seq_ctrl = cpu_to_le16(ieee->seq_ctrl[0] << 4);

	if (ieee->seq_ctrl[0] == 0xFFF)
		ieee->seq_ctrl[0] = 0;
@@ -2730,7 +2730,7 @@ rtllib_disauth_skb(struct rtllib_network *beacon,
	skb_reserve(skb, ieee->tx_headroom);

	disauth = skb_put(skb, sizeof(struct rtllib_disauth));
	disauth->header.frame_ctl = cpu_to_le16(RTLLIB_STYPE_DEAUTH);
	disauth->header.frame_control = cpu_to_le16(RTLLIB_STYPE_DEAUTH);
	disauth->header.duration_id = 0;

	ether_addr_copy(disauth->header.addr1, beacon->bssid);
@@ -2757,7 +2757,7 @@ rtllib_disassociate_skb(struct rtllib_network *beacon,
	skb_reserve(skb, ieee->tx_headroom);

	disass = skb_put(skb, sizeof(struct rtllib_disassoc));
	disass->header.frame_ctl = cpu_to_le16(RTLLIB_STYPE_DISASSOC);
	disass->header.frame_control = cpu_to_le16(RTLLIB_STYPE_DISASSOC);
	disass->header.duration_id = 0;

	ether_addr_copy(disass->header.addr1, beacon->bssid);