Commit c0f72ca8 authored by Jouni Malinen's avatar Jouni Malinen Committed by Jeff Garzik

[PATCH] hostap: Replace hostap_ieee80211_hdr with ieee80211_hdr

Replace hostap-specific struct hostap_ieee80211_hdr with struct
ieee80211_hdr from net/ieee80211.h.
Signed-off-by: default avatarJouni Malinen <jkmaline@cc.hut.fi>
Signed-off-by: default avatarJeff Garzik <jgarzik@pobox.com>
parent 3ec0f485
#ifndef HOSTAP_80211_H #ifndef HOSTAP_80211_H
#define HOSTAP_80211_H #define HOSTAP_80211_H
struct hostap_ieee80211_hdr {
u16 frame_control;
u16 duration_id;
u8 addr1[6];
u8 addr2[6];
u8 addr3[6];
u16 seq_ctrl;
u8 addr4[6];
} __attribute__ ((packed));
struct hostap_ieee80211_mgmt { struct hostap_ieee80211_mgmt {
u16 frame_control; u16 frame_control;
u16 duration; u16 duration;
......
...@@ -6,10 +6,10 @@ ...@@ -6,10 +6,10 @@
void hostap_dump_rx_80211(const char *name, struct sk_buff *skb, void hostap_dump_rx_80211(const char *name, struct sk_buff *skb,
struct hostap_80211_rx_status *rx_stats) struct hostap_80211_rx_status *rx_stats)
{ {
struct hostap_ieee80211_hdr *hdr; struct ieee80211_hdr *hdr;
u16 fc; u16 fc;
hdr = (struct hostap_ieee80211_hdr *) skb->data; hdr = (struct ieee80211_hdr *) skb->data;
printk(KERN_DEBUG "%s: RX signal=%d noise=%d rate=%d len=%d " printk(KERN_DEBUG "%s: RX signal=%d noise=%d rate=%d len=%d "
"jiffies=%ld\n", "jiffies=%ld\n",
...@@ -19,7 +19,7 @@ void hostap_dump_rx_80211(const char *name, struct sk_buff *skb, ...@@ -19,7 +19,7 @@ void hostap_dump_rx_80211(const char *name, struct sk_buff *skb,
if (skb->len < 2) if (skb->len < 2)
return; return;
fc = le16_to_cpu(hdr->frame_control); fc = le16_to_cpu(hdr->frame_ctl);
printk(KERN_DEBUG " FC=0x%04x (type=%d:%d)%s%s", printk(KERN_DEBUG " FC=0x%04x (type=%d:%d)%s%s",
fc, HOSTAP_FC_GET_TYPE(fc), HOSTAP_FC_GET_STYPE(fc), fc, HOSTAP_FC_GET_TYPE(fc), HOSTAP_FC_GET_STYPE(fc),
fc & WLAN_FC_TODS ? " [ToDS]" : "", fc & WLAN_FC_TODS ? " [ToDS]" : "",
...@@ -31,7 +31,7 @@ void hostap_dump_rx_80211(const char *name, struct sk_buff *skb, ...@@ -31,7 +31,7 @@ void hostap_dump_rx_80211(const char *name, struct sk_buff *skb,
} }
printk(" dur=0x%04x seq=0x%04x\n", le16_to_cpu(hdr->duration_id), printk(" dur=0x%04x seq=0x%04x\n", le16_to_cpu(hdr->duration_id),
le16_to_cpu(hdr->seq_ctrl)); le16_to_cpu(hdr->seq_ctl));
printk(KERN_DEBUG " A1=" MACSTR " A2=" MACSTR " A3=" MACSTR, printk(KERN_DEBUG " A1=" MACSTR " A2=" MACSTR " A3=" MACSTR,
MAC2STR(hdr->addr1), MAC2STR(hdr->addr2), MAC2STR(hdr->addr3)); MAC2STR(hdr->addr1), MAC2STR(hdr->addr2), MAC2STR(hdr->addr3));
...@@ -51,7 +51,7 @@ int prism2_rx_80211(struct net_device *dev, struct sk_buff *skb, ...@@ -51,7 +51,7 @@ int prism2_rx_80211(struct net_device *dev, struct sk_buff *skb,
int hdrlen, phdrlen, head_need, tail_need; int hdrlen, phdrlen, head_need, tail_need;
u16 fc; u16 fc;
int prism_header, ret; int prism_header, ret;
struct hostap_ieee80211_hdr *hdr; struct ieee80211_hdr *hdr;
iface = netdev_priv(dev); iface = netdev_priv(dev);
local = iface->local; local = iface->local;
...@@ -70,8 +70,8 @@ int prism2_rx_80211(struct net_device *dev, struct sk_buff *skb, ...@@ -70,8 +70,8 @@ int prism2_rx_80211(struct net_device *dev, struct sk_buff *skb,
phdrlen = 0; phdrlen = 0;
} }
hdr = (struct hostap_ieee80211_hdr *) skb->data; hdr = (struct ieee80211_hdr *) skb->data;
fc = le16_to_cpu(hdr->frame_control); fc = le16_to_cpu(hdr->frame_ctl);
if (type == PRISM2_RX_MGMT && (fc & WLAN_FC_PVER)) { if (type == PRISM2_RX_MGMT && (fc & WLAN_FC_PVER)) {
printk(KERN_DEBUG "%s: dropped management frame with header " printk(KERN_DEBUG "%s: dropped management frame with header "
...@@ -215,21 +215,21 @@ prism2_frag_cache_find(local_info_t *local, unsigned int seq, ...@@ -215,21 +215,21 @@ prism2_frag_cache_find(local_info_t *local, unsigned int seq,
/* Called only as a tasklet (software IRQ) */ /* Called only as a tasklet (software IRQ) */
static struct sk_buff * static struct sk_buff *
prism2_frag_cache_get(local_info_t *local, struct hostap_ieee80211_hdr *hdr) prism2_frag_cache_get(local_info_t *local, struct ieee80211_hdr *hdr)
{ {
struct sk_buff *skb = NULL; struct sk_buff *skb = NULL;
u16 sc; u16 sc;
unsigned int frag, seq; unsigned int frag, seq;
struct prism2_frag_entry *entry; struct prism2_frag_entry *entry;
sc = le16_to_cpu(hdr->seq_ctrl); sc = le16_to_cpu(hdr->seq_ctl);
frag = WLAN_GET_SEQ_FRAG(sc); frag = WLAN_GET_SEQ_FRAG(sc);
seq = WLAN_GET_SEQ_SEQ(sc) >> 4; seq = WLAN_GET_SEQ_SEQ(sc) >> 4;
if (frag == 0) { if (frag == 0) {
/* Reserve enough space to fit maximum frame length */ /* Reserve enough space to fit maximum frame length */
skb = dev_alloc_skb(local->dev->mtu + skb = dev_alloc_skb(local->dev->mtu +
sizeof(struct hostap_ieee80211_hdr) + sizeof(struct ieee80211_hdr) +
8 /* LLC */ + 8 /* LLC */ +
2 /* alignment */ + 2 /* alignment */ +
8 /* WEP */ + ETH_ALEN /* WDS */); 8 /* WEP */ + ETH_ALEN /* WDS */);
...@@ -267,13 +267,13 @@ prism2_frag_cache_get(local_info_t *local, struct hostap_ieee80211_hdr *hdr) ...@@ -267,13 +267,13 @@ prism2_frag_cache_get(local_info_t *local, struct hostap_ieee80211_hdr *hdr)
/* Called only as a tasklet (software IRQ) */ /* Called only as a tasklet (software IRQ) */
static int prism2_frag_cache_invalidate(local_info_t *local, static int prism2_frag_cache_invalidate(local_info_t *local,
struct hostap_ieee80211_hdr *hdr) struct ieee80211_hdr *hdr)
{ {
u16 sc; u16 sc;
unsigned int seq; unsigned int seq;
struct prism2_frag_entry *entry; struct prism2_frag_entry *entry;
sc = le16_to_cpu(hdr->seq_ctrl); sc = le16_to_cpu(hdr->seq_ctl);
seq = WLAN_GET_SEQ_SEQ(sc) >> 4; seq = WLAN_GET_SEQ_SEQ(sc) >> 4;
entry = prism2_frag_cache_find(local, seq, -1, hdr->addr2, hdr->addr1); entry = prism2_frag_cache_find(local, seq, -1, hdr->addr2, hdr->addr1);
...@@ -441,7 +441,7 @@ hostap_rx_frame_mgmt(local_info_t *local, struct sk_buff *skb, ...@@ -441,7 +441,7 @@ hostap_rx_frame_mgmt(local_info_t *local, struct sk_buff *skb,
u16 stype) u16 stype)
{ {
if (local->iw_mode == IW_MODE_MASTER) { if (local->iw_mode == IW_MODE_MASTER) {
hostap_update_sta_ps(local, (struct hostap_ieee80211_hdr *) hostap_update_sta_ps(local, (struct ieee80211_hdr *)
skb->data); skb->data);
} }
...@@ -519,7 +519,7 @@ static inline struct net_device *prism2_rx_get_wds(local_info_t *local, ...@@ -519,7 +519,7 @@ static inline struct net_device *prism2_rx_get_wds(local_info_t *local,
static inline int static inline int
hostap_rx_frame_wds(local_info_t *local, struct hostap_ieee80211_hdr *hdr, hostap_rx_frame_wds(local_info_t *local, struct ieee80211_hdr *hdr,
u16 fc, struct net_device **wds) u16 fc, struct net_device **wds)
{ {
/* FIX: is this really supposed to accept WDS frames only in Master /* FIX: is this really supposed to accept WDS frames only in Master
...@@ -577,14 +577,14 @@ static int hostap_is_eapol_frame(local_info_t *local, struct sk_buff *skb) ...@@ -577,14 +577,14 @@ static int hostap_is_eapol_frame(local_info_t *local, struct sk_buff *skb)
{ {
struct net_device *dev = local->dev; struct net_device *dev = local->dev;
u16 fc, ethertype; u16 fc, ethertype;
struct hostap_ieee80211_hdr *hdr; struct ieee80211_hdr *hdr;
u8 *pos; u8 *pos;
if (skb->len < 24) if (skb->len < 24)
return 0; return 0;
hdr = (struct hostap_ieee80211_hdr *) skb->data; hdr = (struct ieee80211_hdr *) skb->data;
fc = le16_to_cpu(hdr->frame_control); fc = le16_to_cpu(hdr->frame_ctl);
/* check that the frame is unicast frame to us */ /* check that the frame is unicast frame to us */
if ((fc & (WLAN_FC_TODS | WLAN_FC_FROMDS)) == WLAN_FC_TODS && if ((fc & (WLAN_FC_TODS | WLAN_FC_FROMDS)) == WLAN_FC_TODS &&
...@@ -615,14 +615,14 @@ static inline int ...@@ -615,14 +615,14 @@ static inline int
hostap_rx_frame_decrypt(local_info_t *local, struct sk_buff *skb, hostap_rx_frame_decrypt(local_info_t *local, struct sk_buff *skb,
struct ieee80211_crypt_data *crypt) struct ieee80211_crypt_data *crypt)
{ {
struct hostap_ieee80211_hdr *hdr; struct ieee80211_hdr *hdr;
int res, hdrlen; int res, hdrlen;
if (crypt == NULL || crypt->ops->decrypt_mpdu == NULL) if (crypt == NULL || crypt->ops->decrypt_mpdu == NULL)
return 0; return 0;
hdr = (struct hostap_ieee80211_hdr *) skb->data; hdr = (struct ieee80211_hdr *) skb->data;
hdrlen = hostap_80211_get_hdrlen(le16_to_cpu(hdr->frame_control)); hdrlen = hostap_80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl));
if (local->tkip_countermeasures && if (local->tkip_countermeasures &&
strcmp(crypt->ops->name, "TKIP") == 0) { strcmp(crypt->ops->name, "TKIP") == 0) {
...@@ -654,14 +654,14 @@ static inline int ...@@ -654,14 +654,14 @@ static inline int
hostap_rx_frame_decrypt_msdu(local_info_t *local, struct sk_buff *skb, hostap_rx_frame_decrypt_msdu(local_info_t *local, struct sk_buff *skb,
int keyidx, struct ieee80211_crypt_data *crypt) int keyidx, struct ieee80211_crypt_data *crypt)
{ {
struct hostap_ieee80211_hdr *hdr; struct ieee80211_hdr *hdr;
int res, hdrlen; int res, hdrlen;
if (crypt == NULL || crypt->ops->decrypt_msdu == NULL) if (crypt == NULL || crypt->ops->decrypt_msdu == NULL)
return 0; return 0;
hdr = (struct hostap_ieee80211_hdr *) skb->data; hdr = (struct ieee80211_hdr *) skb->data;
hdrlen = hostap_80211_get_hdrlen(le16_to_cpu(hdr->frame_control)); hdrlen = hostap_80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl));
atomic_inc(&crypt->refcnt); atomic_inc(&crypt->refcnt);
res = crypt->ops->decrypt_msdu(skb, keyidx, hdrlen, crypt->priv); res = crypt->ops->decrypt_msdu(skb, keyidx, hdrlen, crypt->priv);
...@@ -685,7 +685,7 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb, ...@@ -685,7 +685,7 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
{ {
struct hostap_interface *iface; struct hostap_interface *iface;
local_info_t *local; local_info_t *local;
struct hostap_ieee80211_hdr *hdr; struct ieee80211_hdr *hdr;
size_t hdrlen; size_t hdrlen;
u16 fc, type, stype, sc; u16 fc, type, stype, sc;
struct net_device *wds = NULL; struct net_device *wds = NULL;
...@@ -712,16 +712,16 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb, ...@@ -712,16 +712,16 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
dev = local->ddev; dev = local->ddev;
iface = netdev_priv(dev); iface = netdev_priv(dev);
hdr = (struct hostap_ieee80211_hdr *) skb->data; hdr = (struct ieee80211_hdr *) skb->data;
stats = hostap_get_stats(dev); stats = hostap_get_stats(dev);
if (skb->len < 10) if (skb->len < 10)
goto rx_dropped; goto rx_dropped;
fc = le16_to_cpu(hdr->frame_control); fc = le16_to_cpu(hdr->frame_ctl);
type = HOSTAP_FC_GET_TYPE(fc); type = HOSTAP_FC_GET_TYPE(fc);
stype = HOSTAP_FC_GET_STYPE(fc); stype = HOSTAP_FC_GET_STYPE(fc);
sc = le16_to_cpu(hdr->seq_ctrl); sc = le16_to_cpu(hdr->seq_ctl);
frag = WLAN_GET_SEQ_FRAG(sc); frag = WLAN_GET_SEQ_FRAG(sc);
hdrlen = hostap_80211_get_hdrlen(fc); hdrlen = hostap_80211_get_hdrlen(fc);
...@@ -883,7 +883,7 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb, ...@@ -883,7 +883,7 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
if (local->host_decrypt && (fc & WLAN_FC_ISWEP) && if (local->host_decrypt && (fc & WLAN_FC_ISWEP) &&
(keyidx = hostap_rx_frame_decrypt(local, skb, crypt)) < 0) (keyidx = hostap_rx_frame_decrypt(local, skb, crypt)) < 0)
goto rx_dropped; goto rx_dropped;
hdr = (struct hostap_ieee80211_hdr *) skb->data; hdr = (struct ieee80211_hdr *) skb->data;
/* skb: hdr + (possibly fragmented) plaintext payload */ /* skb: hdr + (possibly fragmented) plaintext payload */
...@@ -935,7 +935,7 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb, ...@@ -935,7 +935,7 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
/* this was the last fragment and the frame will be /* this was the last fragment and the frame will be
* delivered, so remove skb from fragment cache */ * delivered, so remove skb from fragment cache */
skb = frag_skb; skb = frag_skb;
hdr = (struct hostap_ieee80211_hdr *) skb->data; hdr = (struct ieee80211_hdr *) skb->data;
prism2_frag_cache_invalidate(local, hdr); prism2_frag_cache_invalidate(local, hdr);
} }
...@@ -946,7 +946,7 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb, ...@@ -946,7 +946,7 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
hostap_rx_frame_decrypt_msdu(local, skb, keyidx, crypt)) hostap_rx_frame_decrypt_msdu(local, skb, keyidx, crypt))
goto rx_dropped; goto rx_dropped;
hdr = (struct hostap_ieee80211_hdr *) skb->data; hdr = (struct ieee80211_hdr *) skb->data;
if (crypt && !(fc & WLAN_FC_ISWEP) && !local->open_wep) { if (crypt && !(fc & WLAN_FC_ISWEP) && !local->open_wep) {
if (local->ieee_802_1x && if (local->ieee_802_1x &&
hostap_is_eapol_frame(local, skb)) { hostap_is_eapol_frame(local, skb)) {
......
void hostap_dump_tx_80211(const char *name, struct sk_buff *skb) void hostap_dump_tx_80211(const char *name, struct sk_buff *skb)
{ {
struct hostap_ieee80211_hdr *hdr; struct ieee80211_hdr *hdr;
u16 fc; u16 fc;
hdr = (struct hostap_ieee80211_hdr *) skb->data; hdr = (struct ieee80211_hdr *) skb->data;
printk(KERN_DEBUG "%s: TX len=%d jiffies=%ld\n", printk(KERN_DEBUG "%s: TX len=%d jiffies=%ld\n",
name, skb->len, jiffies); name, skb->len, jiffies);
...@@ -11,7 +11,7 @@ void hostap_dump_tx_80211(const char *name, struct sk_buff *skb) ...@@ -11,7 +11,7 @@ void hostap_dump_tx_80211(const char *name, struct sk_buff *skb)
if (skb->len < 2) if (skb->len < 2)
return; return;
fc = le16_to_cpu(hdr->frame_control); fc = le16_to_cpu(hdr->frame_ctl);
printk(KERN_DEBUG " FC=0x%04x (type=%d:%d)%s%s", printk(KERN_DEBUG " FC=0x%04x (type=%d:%d)%s%s",
fc, HOSTAP_FC_GET_TYPE(fc), HOSTAP_FC_GET_STYPE(fc), fc, HOSTAP_FC_GET_TYPE(fc), HOSTAP_FC_GET_STYPE(fc),
fc & WLAN_FC_TODS ? " [ToDS]" : "", fc & WLAN_FC_TODS ? " [ToDS]" : "",
...@@ -23,7 +23,7 @@ void hostap_dump_tx_80211(const char *name, struct sk_buff *skb) ...@@ -23,7 +23,7 @@ void hostap_dump_tx_80211(const char *name, struct sk_buff *skb)
} }
printk(" dur=0x%04x seq=0x%04x\n", le16_to_cpu(hdr->duration_id), printk(" dur=0x%04x seq=0x%04x\n", le16_to_cpu(hdr->duration_id),
le16_to_cpu(hdr->seq_ctrl)); le16_to_cpu(hdr->seq_ctl));
printk(KERN_DEBUG " A1=" MACSTR " A2=" MACSTR " A3=" MACSTR, printk(KERN_DEBUG " A1=" MACSTR " A2=" MACSTR " A3=" MACSTR,
MAC2STR(hdr->addr1), MAC2STR(hdr->addr2), MAC2STR(hdr->addr3)); MAC2STR(hdr->addr1), MAC2STR(hdr->addr2), MAC2STR(hdr->addr3));
...@@ -41,7 +41,7 @@ int hostap_data_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -41,7 +41,7 @@ int hostap_data_start_xmit(struct sk_buff *skb, struct net_device *dev)
struct hostap_interface *iface; struct hostap_interface *iface;
local_info_t *local; local_info_t *local;
int need_headroom, need_tailroom = 0; int need_headroom, need_tailroom = 0;
struct hostap_ieee80211_hdr hdr; struct ieee80211_hdr hdr;
u16 fc, ethertype = 0; u16 fc, ethertype = 0;
enum { enum {
WDS_NO = 0, WDS_OWN_FRAME, WDS_COMPLIANT_FRAME WDS_NO = 0, WDS_OWN_FRAME, WDS_COMPLIANT_FRAME
...@@ -180,7 +180,7 @@ int hostap_data_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -180,7 +180,7 @@ int hostap_data_start_xmit(struct sk_buff *skb, struct net_device *dev)
memcpy(&hdr.addr3, local->bssid, ETH_ALEN); memcpy(&hdr.addr3, local->bssid, ETH_ALEN);
} }
hdr.frame_control = cpu_to_le16(fc); hdr.frame_ctl = cpu_to_le16(fc);
skb_pull(skb, skip_header_bytes); skb_pull(skb, skip_header_bytes);
need_headroom = local->func->need_tx_headroom + hdr_len + encaps_len; need_headroom = local->func->need_tx_headroom + hdr_len + encaps_len;
...@@ -244,7 +244,7 @@ int hostap_mgmt_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -244,7 +244,7 @@ int hostap_mgmt_start_xmit(struct sk_buff *skb, struct net_device *dev)
struct hostap_interface *iface; struct hostap_interface *iface;
local_info_t *local; local_info_t *local;
struct hostap_skb_tx_data *meta; struct hostap_skb_tx_data *meta;
struct hostap_ieee80211_hdr *hdr; struct ieee80211_hdr *hdr;
u16 fc; u16 fc;
iface = netdev_priv(dev); iface = netdev_priv(dev);
...@@ -266,8 +266,8 @@ int hostap_mgmt_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -266,8 +266,8 @@ int hostap_mgmt_start_xmit(struct sk_buff *skb, struct net_device *dev)
meta->iface = iface; meta->iface = iface;
if (skb->len >= IEEE80211_DATA_HDR3_LEN + sizeof(rfc1042_header) + 2) { if (skb->len >= IEEE80211_DATA_HDR3_LEN + sizeof(rfc1042_header) + 2) {
hdr = (struct hostap_ieee80211_hdr *) skb->data; hdr = (struct ieee80211_hdr *) skb->data;
fc = le16_to_cpu(hdr->frame_control); fc = le16_to_cpu(hdr->frame_ctl);
if (HOSTAP_FC_GET_TYPE(fc) == WLAN_FC_TYPE_DATA && if (HOSTAP_FC_GET_TYPE(fc) == WLAN_FC_TYPE_DATA &&
HOSTAP_FC_GET_STYPE(fc) == WLAN_FC_STYPE_DATA) { HOSTAP_FC_GET_STYPE(fc) == WLAN_FC_STYPE_DATA) {
u8 *pos = &skb->data[IEEE80211_DATA_HDR3_LEN + u8 *pos = &skb->data[IEEE80211_DATA_HDR3_LEN +
...@@ -289,7 +289,7 @@ struct sk_buff * hostap_tx_encrypt(struct sk_buff *skb, ...@@ -289,7 +289,7 @@ struct sk_buff * hostap_tx_encrypt(struct sk_buff *skb,
{ {
struct hostap_interface *iface; struct hostap_interface *iface;
local_info_t *local; local_info_t *local;
struct hostap_ieee80211_hdr *hdr; struct ieee80211_hdr *hdr;
u16 fc; u16 fc;
int hdr_len, res; int hdr_len, res;
...@@ -303,7 +303,7 @@ struct sk_buff * hostap_tx_encrypt(struct sk_buff *skb, ...@@ -303,7 +303,7 @@ struct sk_buff * hostap_tx_encrypt(struct sk_buff *skb,
if (local->tkip_countermeasures && if (local->tkip_countermeasures &&
crypt && crypt->ops && strcmp(crypt->ops->name, "TKIP") == 0) { crypt && crypt->ops && strcmp(crypt->ops->name, "TKIP") == 0) {
hdr = (struct hostap_ieee80211_hdr *) skb->data; hdr = (struct ieee80211_hdr *) skb->data;
if (net_ratelimit()) { if (net_ratelimit()) {
printk(KERN_DEBUG "%s: TKIP countermeasures: dropped " printk(KERN_DEBUG "%s: TKIP countermeasures: dropped "
"TX packet to " MACSTR "\n", "TX packet to " MACSTR "\n",
...@@ -325,8 +325,8 @@ struct sk_buff * hostap_tx_encrypt(struct sk_buff *skb, ...@@ -325,8 +325,8 @@ struct sk_buff * hostap_tx_encrypt(struct sk_buff *skb,
return NULL; return NULL;
} }
hdr = (struct hostap_ieee80211_hdr *) skb->data; hdr = (struct ieee80211_hdr *) skb->data;
fc = le16_to_cpu(hdr->frame_control); fc = le16_to_cpu(hdr->frame_ctl);
hdr_len = hostap_80211_get_hdrlen(fc); hdr_len = hostap_80211_get_hdrlen(fc);
/* Host-based IEEE 802.11 fragmentation for TX is not yet supported, so /* Host-based IEEE 802.11 fragmentation for TX is not yet supported, so
...@@ -360,7 +360,7 @@ int hostap_master_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -360,7 +360,7 @@ int hostap_master_start_xmit(struct sk_buff *skb, struct net_device *dev)
ap_tx_ret tx_ret; ap_tx_ret tx_ret;
struct hostap_skb_tx_data *meta; struct hostap_skb_tx_data *meta;
int no_encrypt = 0; int no_encrypt = 0;
struct hostap_ieee80211_hdr *hdr; struct ieee80211_hdr *hdr;
iface = netdev_priv(dev); iface = netdev_priv(dev);
local = iface->local; local = iface->local;
...@@ -403,8 +403,8 @@ int hostap_master_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -403,8 +403,8 @@ int hostap_master_start_xmit(struct sk_buff *skb, struct net_device *dev)
tx_ret = hostap_handle_sta_tx(local, &tx); tx_ret = hostap_handle_sta_tx(local, &tx);
skb = tx.skb; skb = tx.skb;
meta = (struct hostap_skb_tx_data *) skb->cb; meta = (struct hostap_skb_tx_data *) skb->cb;
hdr = (struct hostap_ieee80211_hdr *) skb->data; hdr = (struct ieee80211_hdr *) skb->data;
fc = le16_to_cpu(hdr->frame_control); fc = le16_to_cpu(hdr->frame_ctl);
switch (tx_ret) { switch (tx_ret) {
case AP_TX_CONTINUE: case AP_TX_CONTINUE:
break; break;
...@@ -445,7 +445,7 @@ int hostap_master_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -445,7 +445,7 @@ int hostap_master_start_xmit(struct sk_buff *skb, struct net_device *dev)
/* remove special version from the frame header */ /* remove special version from the frame header */
fc &= ~WLAN_FC_PVER; fc &= ~WLAN_FC_PVER;
hdr->frame_control = cpu_to_le16(fc); hdr->frame_ctl = cpu_to_le16(fc);
} }
if (HOSTAP_FC_GET_TYPE(fc) != WLAN_FC_TYPE_DATA) { if (HOSTAP_FC_GET_TYPE(fc) != WLAN_FC_TYPE_DATA) {
...@@ -467,7 +467,7 @@ int hostap_master_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -467,7 +467,7 @@ int hostap_master_start_xmit(struct sk_buff *skb, struct net_device *dev)
/* Add ISWEP flag both for firmware and host based encryption /* Add ISWEP flag both for firmware and host based encryption
*/ */
fc |= WLAN_FC_ISWEP; fc |= WLAN_FC_ISWEP;
hdr->frame_control = cpu_to_le16(fc); hdr->frame_ctl = cpu_to_le16(fc);
} else if (local->drop_unencrypted && } else if (local->drop_unencrypted &&
HOSTAP_FC_GET_TYPE(fc) == WLAN_FC_TYPE_DATA && HOSTAP_FC_GET_TYPE(fc) == WLAN_FC_TYPE_DATA &&
meta->ethertype != ETH_P_PAE) { meta->ethertype != ETH_P_PAE) {
......
This diff is collapsed.
...@@ -233,8 +233,7 @@ struct hostap_tx_data { ...@@ -233,8 +233,7 @@ struct hostap_tx_data {
ap_tx_ret hostap_handle_sta_tx(local_info_t *local, struct hostap_tx_data *tx); ap_tx_ret hostap_handle_sta_tx(local_info_t *local, struct hostap_tx_data *tx);
void hostap_handle_sta_release(void *ptr); void hostap_handle_sta_release(void *ptr);
void hostap_handle_sta_tx_exc(local_info_t *local, struct sk_buff *skb); void hostap_handle_sta_tx_exc(local_info_t *local, struct sk_buff *skb);
int hostap_update_sta_ps(local_info_t *local, int hostap_update_sta_ps(local_info_t *local, struct ieee80211_hdr *hdr);
struct hostap_ieee80211_hdr *hdr);
typedef enum { typedef enum {
AP_RX_CONTINUE, AP_RX_DROP, AP_RX_EXIT, AP_RX_CONTINUE_NOT_AUTHORIZED AP_RX_CONTINUE, AP_RX_DROP, AP_RX_EXIT, AP_RX_CONTINUE_NOT_AUTHORIZED
} ap_rx_ret; } ap_rx_ret;
...@@ -242,15 +241,13 @@ ap_rx_ret hostap_handle_sta_rx(local_info_t *local, struct net_device *dev, ...@@ -242,15 +241,13 @@ ap_rx_ret hostap_handle_sta_rx(local_info_t *local, struct net_device *dev,
struct sk_buff *skb, struct sk_buff *skb,
struct hostap_80211_rx_status *rx_stats, struct hostap_80211_rx_status *rx_stats,
int wds); int wds);
int hostap_handle_sta_crypto(local_info_t *local, int hostap_handle_sta_crypto(local_info_t *local, struct ieee80211_hdr *hdr,
struct hostap_ieee80211_hdr *hdr,
struct ieee80211_crypt_data **crypt, struct ieee80211_crypt_data **crypt,
void **sta_ptr); void **sta_ptr);
int hostap_is_sta_assoc(struct ap_data *ap, u8 *sta_addr); int hostap_is_sta_assoc(struct ap_data *ap, u8 *sta_addr);
int hostap_is_sta_authorized(struct ap_data *ap, u8 *sta_addr); int hostap_is_sta_authorized(struct ap_data *ap, u8 *sta_addr);
int hostap_add_sta(struct ap_data *ap, u8 *sta_addr); int hostap_add_sta(struct ap_data *ap, u8 *sta_addr);
int hostap_update_rx_stats(struct ap_data *ap, int hostap_update_rx_stats(struct ap_data *ap, struct ieee80211_hdr *hdr,
struct hostap_ieee80211_hdr *hdr,
struct hostap_80211_rx_status *rx_stats); struct hostap_80211_rx_status *rx_stats);
void hostap_update_rates(local_info_t *local); void hostap_update_rates(local_info_t *local);
void hostap_add_wds_links(local_info_t *local); void hostap_add_wds_links(local_info_t *local);
......
...@@ -1817,7 +1817,6 @@ static int prism2_tx_80211(struct sk_buff *skb, struct net_device *dev) ...@@ -1817,7 +1817,6 @@ static int prism2_tx_80211(struct sk_buff *skb, struct net_device *dev)
struct hostap_interface *iface; struct hostap_interface *iface;
local_info_t *local; local_info_t *local;
struct hfa384x_tx_frame txdesc; struct hfa384x_tx_frame txdesc;
struct hostap_ieee80211_hdr *hdr;
struct hostap_skb_tx_data *meta; struct hostap_skb_tx_data *meta;
int hdr_len, data_len, idx, res, ret = -1; int hdr_len, data_len, idx, res, ret = -1;
u16 tx_control, fc; u16 tx_control, fc;
...@@ -1826,7 +1825,6 @@ static int prism2_tx_80211(struct sk_buff *skb, struct net_device *dev) ...@@ -1826,7 +1825,6 @@ static int prism2_tx_80211(struct sk_buff *skb, struct net_device *dev)
local = iface->local; local = iface->local;
meta = (struct hostap_skb_tx_data *) skb->cb; meta = (struct hostap_skb_tx_data *) skb->cb;
hdr = (struct hostap_ieee80211_hdr *) skb->data;
prism2_callback(local, PRISM2_CALLBACK_TX_START); prism2_callback(local, PRISM2_CALLBACK_TX_START);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment