Commit d041674d authored by James Ketrenos's avatar James Ketrenos Committed by Jeff Garzik

[PATCH] ieee80211: Updated hostap to be compatible with ieee80211_hdr changes

tree 8ec97d9056ceaf0f845ed51175dd842b700baadd
parent 329128457008ace3110c96971addf85a767dd5af
author James Ketrenos <jketreno@linux.intel.com> 1126714484 -0500
committer James Ketrenos <jketreno@linux.intel.com> 1127316636 -0500

Updated hostap to be compatible with ieee80211_hdr changes.

Change accomplished via:

for i in hostap_ap.{c,h} hostap_80211_{t,r}x.c; do
	sed -i -e "s:ieee80211_hdr\([^_]\):ieee80211_hdr_4addr\1:g" \
		drivers/net/wireless/hostap/$i
done

CC: Jouni Malinen <jkmaline@cc.hut.fi>
Signed-off-by: default avatarJames Ketrenos <jketreno@linux.intel.com>
Signed-off-by: default avatarJeff Garzik <jgarzik@pobox.com>
parent ebeaddcc
...@@ -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 ieee80211_hdr *hdr; struct ieee80211_hdr_4addr *hdr;
u16 fc; u16 fc;
hdr = (struct ieee80211_hdr *) skb->data; hdr = (struct ieee80211_hdr_4addr *) 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",
...@@ -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 ieee80211_hdr *hdr; struct ieee80211_hdr_4addr *hdr;
iface = netdev_priv(dev); iface = netdev_priv(dev);
local = iface->local; local = iface->local;
...@@ -70,7 +70,7 @@ int prism2_rx_80211(struct net_device *dev, struct sk_buff *skb, ...@@ -70,7 +70,7 @@ int prism2_rx_80211(struct net_device *dev, struct sk_buff *skb,
phdrlen = 0; phdrlen = 0;
} }
hdr = (struct ieee80211_hdr *) skb->data; hdr = (struct ieee80211_hdr_4addr *) skb->data;
fc = le16_to_cpu(hdr->frame_ctl); fc = le16_to_cpu(hdr->frame_ctl);
if (type == PRISM2_RX_MGMT && (fc & IEEE80211_FCTL_VERS)) { if (type == PRISM2_RX_MGMT && (fc & IEEE80211_FCTL_VERS)) {
...@@ -215,7 +215,7 @@ prism2_frag_cache_find(local_info_t *local, unsigned int seq, ...@@ -215,7 +215,7 @@ 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 ieee80211_hdr *hdr) prism2_frag_cache_get(local_info_t *local, struct ieee80211_hdr_4addr *hdr)
{ {
struct sk_buff *skb = NULL; struct sk_buff *skb = NULL;
u16 sc; u16 sc;
...@@ -229,7 +229,7 @@ prism2_frag_cache_get(local_info_t *local, struct ieee80211_hdr *hdr) ...@@ -229,7 +229,7 @@ prism2_frag_cache_get(local_info_t *local, struct ieee80211_hdr *hdr)
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 ieee80211_hdr) + sizeof(struct ieee80211_hdr_4addr) +
8 /* LLC */ + 8 /* LLC */ +
2 /* alignment */ + 2 /* alignment */ +
8 /* WEP */ + ETH_ALEN /* WDS */); 8 /* WEP */ + ETH_ALEN /* WDS */);
...@@ -267,7 +267,7 @@ prism2_frag_cache_get(local_info_t *local, struct ieee80211_hdr *hdr) ...@@ -267,7 +267,7 @@ prism2_frag_cache_get(local_info_t *local, struct 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 ieee80211_hdr *hdr) struct ieee80211_hdr_4addr *hdr)
{ {
u16 sc; u16 sc;
unsigned int seq; unsigned int seq;
...@@ -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 ieee80211_hdr *) hostap_update_sta_ps(local, (struct ieee80211_hdr_4addr *)
skb->data); skb->data);
} }
...@@ -520,7 +520,7 @@ static inline struct net_device *prism2_rx_get_wds(local_info_t *local, ...@@ -520,7 +520,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 ieee80211_hdr *hdr, hostap_rx_frame_wds(local_info_t *local, struct ieee80211_hdr_4addr *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
...@@ -579,13 +579,13 @@ static int hostap_is_eapol_frame(local_info_t *local, struct sk_buff *skb) ...@@ -579,13 +579,13 @@ 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 ieee80211_hdr *hdr; struct ieee80211_hdr_4addr *hdr;
u8 *pos; u8 *pos;
if (skb->len < 24) if (skb->len < 24)
return 0; return 0;
hdr = (struct ieee80211_hdr *) skb->data; hdr = (struct ieee80211_hdr_4addr *) skb->data;
fc = le16_to_cpu(hdr->frame_ctl); 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 */
...@@ -619,13 +619,13 @@ static inline int ...@@ -619,13 +619,13 @@ 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 ieee80211_hdr *hdr; struct ieee80211_hdr_4addr *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 ieee80211_hdr *) skb->data; hdr = (struct ieee80211_hdr_4addr *) skb->data;
hdrlen = hostap_80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl)); hdrlen = hostap_80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl));
if (local->tkip_countermeasures && if (local->tkip_countermeasures &&
...@@ -658,13 +658,13 @@ static inline int ...@@ -658,13 +658,13 @@ 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 ieee80211_hdr *hdr; struct ieee80211_hdr_4addr *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 ieee80211_hdr *) skb->data; hdr = (struct ieee80211_hdr_4addr *) skb->data;
hdrlen = hostap_80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl)); hdrlen = hostap_80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl));
atomic_inc(&crypt->refcnt); atomic_inc(&crypt->refcnt);
...@@ -689,7 +689,7 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb, ...@@ -689,7 +689,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 ieee80211_hdr *hdr; struct ieee80211_hdr_4addr *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;
...@@ -716,7 +716,7 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb, ...@@ -716,7 +716,7 @@ 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 ieee80211_hdr *) skb->data; hdr = (struct ieee80211_hdr_4addr *) skb->data;
stats = hostap_get_stats(dev); stats = hostap_get_stats(dev);
if (skb->len < 10) if (skb->len < 10)
...@@ -889,7 +889,7 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb, ...@@ -889,7 +889,7 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
if (local->host_decrypt && (fc & IEEE80211_FCTL_PROTECTED) && if (local->host_decrypt && (fc & IEEE80211_FCTL_PROTECTED) &&
(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 ieee80211_hdr *) skb->data; hdr = (struct ieee80211_hdr_4addr *) skb->data;
/* skb: hdr + (possibly fragmented) plaintext payload */ /* skb: hdr + (possibly fragmented) plaintext payload */
...@@ -941,7 +941,7 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb, ...@@ -941,7 +941,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 ieee80211_hdr *) skb->data; hdr = (struct ieee80211_hdr_4addr *) skb->data;
prism2_frag_cache_invalidate(local, hdr); prism2_frag_cache_invalidate(local, hdr);
} }
...@@ -952,7 +952,7 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb, ...@@ -952,7 +952,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 ieee80211_hdr *) skb->data; hdr = (struct ieee80211_hdr_4addr *) skb->data;
if (crypt && !(fc & IEEE80211_FCTL_PROTECTED) && !local->open_wep) { if (crypt && !(fc & IEEE80211_FCTL_PROTECTED) && !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 ieee80211_hdr *hdr; struct ieee80211_hdr_4addr *hdr;
u16 fc; u16 fc;
hdr = (struct ieee80211_hdr *) skb->data; hdr = (struct ieee80211_hdr_4addr *) 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);
...@@ -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 ieee80211_hdr hdr; struct ieee80211_hdr_4addr 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
...@@ -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 ieee80211_hdr *hdr; struct ieee80211_hdr_4addr *hdr;
u16 fc; u16 fc;
iface = netdev_priv(dev); iface = netdev_priv(dev);
...@@ -266,7 +266,7 @@ int hostap_mgmt_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -266,7 +266,7 @@ 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 ieee80211_hdr *) skb->data; hdr = (struct ieee80211_hdr_4addr *) skb->data;
fc = le16_to_cpu(hdr->frame_ctl); fc = le16_to_cpu(hdr->frame_ctl);
if (WLAN_FC_GET_TYPE(fc) == IEEE80211_FTYPE_DATA && if (WLAN_FC_GET_TYPE(fc) == IEEE80211_FTYPE_DATA &&
WLAN_FC_GET_STYPE(fc) == IEEE80211_STYPE_DATA) { WLAN_FC_GET_STYPE(fc) == IEEE80211_STYPE_DATA) {
...@@ -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 ieee80211_hdr *hdr; struct ieee80211_hdr_4addr *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 ieee80211_hdr *) skb->data; hdr = (struct ieee80211_hdr_4addr *) 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,7 +325,7 @@ struct sk_buff * hostap_tx_encrypt(struct sk_buff *skb, ...@@ -325,7 +325,7 @@ struct sk_buff * hostap_tx_encrypt(struct sk_buff *skb,
return NULL; return NULL;
} }
hdr = (struct ieee80211_hdr *) skb->data; hdr = (struct ieee80211_hdr_4addr *) skb->data;
fc = le16_to_cpu(hdr->frame_ctl); fc = le16_to_cpu(hdr->frame_ctl);
hdr_len = hostap_80211_get_hdrlen(fc); hdr_len = hostap_80211_get_hdrlen(fc);
...@@ -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 ieee80211_hdr *hdr; struct ieee80211_hdr_4addr *hdr;
iface = netdev_priv(dev); iface = netdev_priv(dev);
local = iface->local; local = iface->local;
...@@ -403,7 +403,7 @@ int hostap_master_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -403,7 +403,7 @@ 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 ieee80211_hdr *) skb->data; hdr = (struct ieee80211_hdr_4addr *) skb->data;
fc = le16_to_cpu(hdr->frame_ctl); fc = le16_to_cpu(hdr->frame_ctl);
switch (tx_ret) { switch (tx_ret) {
case AP_TX_CONTINUE: case AP_TX_CONTINUE:
......
...@@ -591,14 +591,14 @@ static void hostap_ap_tx_cb(struct sk_buff *skb, int ok, void *data) ...@@ -591,14 +591,14 @@ static void hostap_ap_tx_cb(struct sk_buff *skb, int ok, void *data)
{ {
struct ap_data *ap = data; struct ap_data *ap = data;
u16 fc; u16 fc;
struct ieee80211_hdr *hdr; struct ieee80211_hdr_4addr *hdr;
if (!ap->local->hostapd || !ap->local->apdev) { if (!ap->local->hostapd || !ap->local->apdev) {
dev_kfree_skb(skb); dev_kfree_skb(skb);
return; return;
} }
hdr = (struct ieee80211_hdr *) skb->data; hdr = (struct ieee80211_hdr_4addr *) skb->data;
fc = le16_to_cpu(hdr->frame_ctl); fc = le16_to_cpu(hdr->frame_ctl);
/* Pass the TX callback frame to the hostapd; use 802.11 header version /* Pass the TX callback frame to the hostapd; use 802.11 header version
...@@ -623,7 +623,7 @@ static void hostap_ap_tx_cb_auth(struct sk_buff *skb, int ok, void *data) ...@@ -623,7 +623,7 @@ static void hostap_ap_tx_cb_auth(struct sk_buff *skb, int ok, void *data)
{ {
struct ap_data *ap = data; struct ap_data *ap = data;
struct net_device *dev = ap->local->dev; struct net_device *dev = ap->local->dev;
struct ieee80211_hdr *hdr; struct ieee80211_hdr_4addr *hdr;
u16 fc, *pos, auth_alg, auth_transaction, status; u16 fc, *pos, auth_alg, auth_transaction, status;
struct sta_info *sta = NULL; struct sta_info *sta = NULL;
char *txt = NULL; char *txt = NULL;
...@@ -633,7 +633,7 @@ static void hostap_ap_tx_cb_auth(struct sk_buff *skb, int ok, void *data) ...@@ -633,7 +633,7 @@ static void hostap_ap_tx_cb_auth(struct sk_buff *skb, int ok, void *data)
return; return;
} }
hdr = (struct ieee80211_hdr *) skb->data; hdr = (struct ieee80211_hdr_4addr *) skb->data;
fc = le16_to_cpu(hdr->frame_ctl); fc = le16_to_cpu(hdr->frame_ctl);
if (WLAN_FC_GET_TYPE(fc) != IEEE80211_FTYPE_MGMT || if (WLAN_FC_GET_TYPE(fc) != IEEE80211_FTYPE_MGMT ||
WLAN_FC_GET_STYPE(fc) != IEEE80211_STYPE_AUTH || WLAN_FC_GET_STYPE(fc) != IEEE80211_STYPE_AUTH ||
...@@ -692,7 +692,7 @@ static void hostap_ap_tx_cb_assoc(struct sk_buff *skb, int ok, void *data) ...@@ -692,7 +692,7 @@ static void hostap_ap_tx_cb_assoc(struct sk_buff *skb, int ok, void *data)
{ {
struct ap_data *ap = data; struct ap_data *ap = data;
struct net_device *dev = ap->local->dev; struct net_device *dev = ap->local->dev;
struct ieee80211_hdr *hdr; struct ieee80211_hdr_4addr *hdr;
u16 fc, *pos, status; u16 fc, *pos, status;
struct sta_info *sta = NULL; struct sta_info *sta = NULL;
char *txt = NULL; char *txt = NULL;
...@@ -702,7 +702,7 @@ static void hostap_ap_tx_cb_assoc(struct sk_buff *skb, int ok, void *data) ...@@ -702,7 +702,7 @@ static void hostap_ap_tx_cb_assoc(struct sk_buff *skb, int ok, void *data)
return; return;
} }
hdr = (struct ieee80211_hdr *) skb->data; hdr = (struct ieee80211_hdr_4addr *) skb->data;
fc = le16_to_cpu(hdr->frame_ctl); fc = le16_to_cpu(hdr->frame_ctl);
if (WLAN_FC_GET_TYPE(fc) != IEEE80211_FTYPE_MGMT || if (WLAN_FC_GET_TYPE(fc) != IEEE80211_FTYPE_MGMT ||
(WLAN_FC_GET_STYPE(fc) != IEEE80211_STYPE_ASSOC_RESP && (WLAN_FC_GET_STYPE(fc) != IEEE80211_STYPE_ASSOC_RESP &&
...@@ -757,12 +757,12 @@ static void hostap_ap_tx_cb_assoc(struct sk_buff *skb, int ok, void *data) ...@@ -757,12 +757,12 @@ static void hostap_ap_tx_cb_assoc(struct sk_buff *skb, int ok, void *data)
static void hostap_ap_tx_cb_poll(struct sk_buff *skb, int ok, void *data) static void hostap_ap_tx_cb_poll(struct sk_buff *skb, int ok, void *data)
{ {
struct ap_data *ap = data; struct ap_data *ap = data;
struct ieee80211_hdr *hdr; struct ieee80211_hdr_4addr *hdr;
struct sta_info *sta; struct sta_info *sta;
if (skb->len < 24) if (skb->len < 24)
goto fail; goto fail;
hdr = (struct ieee80211_hdr *) skb->data; hdr = (struct ieee80211_hdr_4addr *) skb->data;
if (ok) { if (ok) {
spin_lock(&ap->sta_table_lock); spin_lock(&ap->sta_table_lock);
sta = ap_get_sta(ap, hdr->addr1); sta = ap_get_sta(ap, hdr->addr1);
...@@ -918,7 +918,7 @@ static void prism2_send_mgmt(struct net_device *dev, ...@@ -918,7 +918,7 @@ static void prism2_send_mgmt(struct net_device *dev,
{ {
struct hostap_interface *iface; struct hostap_interface *iface;
local_info_t *local; local_info_t *local;
struct ieee80211_hdr *hdr; struct ieee80211_hdr_4addr *hdr;
u16 fc; u16 fc;
struct sk_buff *skb; struct sk_buff *skb;
struct hostap_skb_tx_data *meta; struct hostap_skb_tx_data *meta;
...@@ -944,7 +944,7 @@ static void prism2_send_mgmt(struct net_device *dev, ...@@ -944,7 +944,7 @@ static void prism2_send_mgmt(struct net_device *dev,
fc = type_subtype; fc = type_subtype;
hdrlen = hostap_80211_get_hdrlen(fc); hdrlen = hostap_80211_get_hdrlen(fc);
hdr = (struct ieee80211_hdr *) skb_put(skb, hdrlen); hdr = (struct ieee80211_hdr_4addr *) skb_put(skb, hdrlen);
if (body) if (body)
memcpy(skb_put(skb, body_len), body, body_len); memcpy(skb_put(skb, body_len), body, body_len);
...@@ -1285,7 +1285,7 @@ static void handle_authen(local_info_t *local, struct sk_buff *skb, ...@@ -1285,7 +1285,7 @@ static void handle_authen(local_info_t *local, struct sk_buff *skb,
struct hostap_80211_rx_status *rx_stats) struct hostap_80211_rx_status *rx_stats)
{ {
struct net_device *dev = local->dev; struct net_device *dev = local->dev;
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; struct ieee80211_hdr_4addr *hdr = (struct ieee80211_hdr_4addr *) skb->data;
size_t hdrlen; size_t hdrlen;
struct ap_data *ap = local->ap; struct ap_data *ap = local->ap;
char body[8 + WLAN_AUTH_CHALLENGE_LEN], *challenge = NULL; char body[8 + WLAN_AUTH_CHALLENGE_LEN], *challenge = NULL;
...@@ -1498,7 +1498,7 @@ static void handle_assoc(local_info_t *local, struct sk_buff *skb, ...@@ -1498,7 +1498,7 @@ static void handle_assoc(local_info_t *local, struct sk_buff *skb,
struct hostap_80211_rx_status *rx_stats, int reassoc) struct hostap_80211_rx_status *rx_stats, int reassoc)
{ {
struct net_device *dev = local->dev; struct net_device *dev = local->dev;
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; struct ieee80211_hdr_4addr *hdr = (struct ieee80211_hdr_4addr *) skb->data;
char body[12], *p, *lpos; char body[12], *p, *lpos;
int len, left; int len, left;
u16 *pos; u16 *pos;
...@@ -1705,7 +1705,7 @@ static void handle_deauth(local_info_t *local, struct sk_buff *skb, ...@@ -1705,7 +1705,7 @@ static void handle_deauth(local_info_t *local, struct sk_buff *skb,
struct hostap_80211_rx_status *rx_stats) struct hostap_80211_rx_status *rx_stats)
{ {
struct net_device *dev = local->dev; struct net_device *dev = local->dev;
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; struct ieee80211_hdr_4addr *hdr = (struct ieee80211_hdr_4addr *) skb->data;
char *body = (char *) (skb->data + IEEE80211_MGMT_HDR_LEN); char *body = (char *) (skb->data + IEEE80211_MGMT_HDR_LEN);
int len; int len;
u16 reason_code, *pos; u16 reason_code, *pos;
...@@ -1746,7 +1746,7 @@ static void handle_disassoc(local_info_t *local, struct sk_buff *skb, ...@@ -1746,7 +1746,7 @@ static void handle_disassoc(local_info_t *local, struct sk_buff *skb,
struct hostap_80211_rx_status *rx_stats) struct hostap_80211_rx_status *rx_stats)
{ {
struct net_device *dev = local->dev; struct net_device *dev = local->dev;
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; struct ieee80211_hdr_4addr *hdr = (struct ieee80211_hdr_4addr *) skb->data;
char *body = skb->data + IEEE80211_MGMT_HDR_LEN; char *body = skb->data + IEEE80211_MGMT_HDR_LEN;
int len; int len;
u16 reason_code, *pos; u16 reason_code, *pos;
...@@ -1784,7 +1784,7 @@ static void handle_disassoc(local_info_t *local, struct sk_buff *skb, ...@@ -1784,7 +1784,7 @@ static void handle_disassoc(local_info_t *local, struct sk_buff *skb,
/* Called only as a scheduled task for pending AP frames. */ /* Called only as a scheduled task for pending AP frames. */
static void ap_handle_data_nullfunc(local_info_t *local, static void ap_handle_data_nullfunc(local_info_t *local,
struct ieee80211_hdr *hdr) struct ieee80211_hdr_4addr *hdr)
{ {
struct net_device *dev = local->dev; struct net_device *dev = local->dev;
...@@ -1801,7 +1801,7 @@ static void ap_handle_data_nullfunc(local_info_t *local, ...@@ -1801,7 +1801,7 @@ static void ap_handle_data_nullfunc(local_info_t *local,
/* Called only as a scheduled task for pending AP frames. */ /* Called only as a scheduled task for pending AP frames. */
static void ap_handle_dropped_data(local_info_t *local, static void ap_handle_dropped_data(local_info_t *local,
struct ieee80211_hdr *hdr) struct ieee80211_hdr_4addr *hdr)
{ {
struct net_device *dev = local->dev; struct net_device *dev = local->dev;
struct sta_info *sta; struct sta_info *sta;
...@@ -1860,7 +1860,7 @@ static void pspoll_send_buffered(local_info_t *local, struct sta_info *sta, ...@@ -1860,7 +1860,7 @@ static void pspoll_send_buffered(local_info_t *local, struct sta_info *sta,
/* Called only as a scheduled task for pending AP frames. */ /* Called only as a scheduled task for pending AP frames. */
static void handle_pspoll(local_info_t *local, static void handle_pspoll(local_info_t *local,
struct ieee80211_hdr *hdr, struct ieee80211_hdr_4addr *hdr,
struct hostap_80211_rx_status *rx_stats) struct hostap_80211_rx_status *rx_stats)
{ {
struct net_device *dev = local->dev; struct net_device *dev = local->dev;
...@@ -1979,7 +1979,7 @@ static void handle_wds_oper_queue(void *data) ...@@ -1979,7 +1979,7 @@ static void handle_wds_oper_queue(void *data)
static void handle_beacon(local_info_t *local, struct sk_buff *skb, static void handle_beacon(local_info_t *local, struct sk_buff *skb,
struct hostap_80211_rx_status *rx_stats) struct hostap_80211_rx_status *rx_stats)
{ {
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; struct ieee80211_hdr_4addr *hdr = (struct ieee80211_hdr_4addr *) skb->data;
char *body = skb->data + IEEE80211_MGMT_HDR_LEN; char *body = skb->data + IEEE80211_MGMT_HDR_LEN;
int len, left; int len, left;
u16 *pos, beacon_int, capability; u16 *pos, beacon_int, capability;
...@@ -2137,11 +2137,11 @@ static void handle_ap_item(local_info_t *local, struct sk_buff *skb, ...@@ -2137,11 +2137,11 @@ static void handle_ap_item(local_info_t *local, struct sk_buff *skb,
struct net_device *dev = local->dev; struct net_device *dev = local->dev;
#endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */ #endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */
u16 fc, type, stype; u16 fc, type, stype;
struct ieee80211_hdr *hdr; struct ieee80211_hdr_4addr *hdr;
/* FIX: should give skb->len to handler functions and check that the /* FIX: should give skb->len to handler functions and check that the
* buffer is long enough */ * buffer is long enough */
hdr = (struct ieee80211_hdr *) skb->data; hdr = (struct ieee80211_hdr_4addr *) skb->data;
fc = le16_to_cpu(hdr->frame_ctl); fc = le16_to_cpu(hdr->frame_ctl);
type = WLAN_FC_GET_TYPE(fc); type = WLAN_FC_GET_TYPE(fc);
stype = WLAN_FC_GET_STYPE(fc); stype = WLAN_FC_GET_STYPE(fc);
...@@ -2258,7 +2258,7 @@ void hostap_rx(struct net_device *dev, struct sk_buff *skb, ...@@ -2258,7 +2258,7 @@ void hostap_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;
u16 fc; u16 fc;
struct ieee80211_hdr *hdr; struct ieee80211_hdr_4addr *hdr;
iface = netdev_priv(dev); iface = netdev_priv(dev);
local = iface->local; local = iface->local;
...@@ -2268,7 +2268,7 @@ void hostap_rx(struct net_device *dev, struct sk_buff *skb, ...@@ -2268,7 +2268,7 @@ void hostap_rx(struct net_device *dev, struct sk_buff *skb,
local->stats.rx_packets++; local->stats.rx_packets++;
hdr = (struct ieee80211_hdr *) skb->data; hdr = (struct ieee80211_hdr_4addr *) skb->data;
fc = le16_to_cpu(hdr->frame_ctl); fc = le16_to_cpu(hdr->frame_ctl);
if (local->ap->ap_policy == AP_OTHER_AP_SKIP_ALL && if (local->ap->ap_policy == AP_OTHER_AP_SKIP_ALL &&
...@@ -2289,7 +2289,7 @@ void hostap_rx(struct net_device *dev, struct sk_buff *skb, ...@@ -2289,7 +2289,7 @@ void hostap_rx(struct net_device *dev, struct sk_buff *skb,
static void schedule_packet_send(local_info_t *local, struct sta_info *sta) static void schedule_packet_send(local_info_t *local, struct sta_info *sta)
{ {
struct sk_buff *skb; struct sk_buff *skb;
struct ieee80211_hdr *hdr; struct ieee80211_hdr_4addr *hdr;
struct hostap_80211_rx_status rx_stats; struct hostap_80211_rx_status rx_stats;
if (skb_queue_empty(&sta->tx_buf)) if (skb_queue_empty(&sta->tx_buf))
...@@ -2302,7 +2302,7 @@ static void schedule_packet_send(local_info_t *local, struct sta_info *sta) ...@@ -2302,7 +2302,7 @@ static void schedule_packet_send(local_info_t *local, struct sta_info *sta)
return; return;
} }
hdr = (struct ieee80211_hdr *) skb_put(skb, 16); hdr = (struct ieee80211_hdr_4addr *) skb_put(skb, 16);
/* Generate a fake pspoll frame to start packet delivery */ /* Generate a fake pspoll frame to start packet delivery */
hdr->frame_ctl = __constant_cpu_to_le16( hdr->frame_ctl = __constant_cpu_to_le16(
...@@ -2685,7 +2685,7 @@ ap_tx_ret hostap_handle_sta_tx(local_info_t *local, struct hostap_tx_data *tx) ...@@ -2685,7 +2685,7 @@ ap_tx_ret hostap_handle_sta_tx(local_info_t *local, struct hostap_tx_data *tx)
struct sta_info *sta = NULL; struct sta_info *sta = NULL;
struct sk_buff *skb = tx->skb; struct sk_buff *skb = tx->skb;
int set_tim, ret; int set_tim, ret;
struct ieee80211_hdr *hdr; struct ieee80211_hdr_4addr *hdr;
struct hostap_skb_tx_data *meta; struct hostap_skb_tx_data *meta;
meta = (struct hostap_skb_tx_data *) skb->cb; meta = (struct hostap_skb_tx_data *) skb->cb;
...@@ -2694,7 +2694,7 @@ ap_tx_ret hostap_handle_sta_tx(local_info_t *local, struct hostap_tx_data *tx) ...@@ -2694,7 +2694,7 @@ ap_tx_ret hostap_handle_sta_tx(local_info_t *local, struct hostap_tx_data *tx)
meta->iface->type == HOSTAP_INTERFACE_STA) meta->iface->type == HOSTAP_INTERFACE_STA)
goto out; goto out;
hdr = (struct ieee80211_hdr *) skb->data; hdr = (struct ieee80211_hdr_4addr *) skb->data;
if (hdr->addr1[0] & 0x01) { if (hdr->addr1[0] & 0x01) {
/* broadcast/multicast frame - no AP related processing */ /* broadcast/multicast frame - no AP related processing */
...@@ -2821,10 +2821,10 @@ void hostap_handle_sta_release(void *ptr) ...@@ -2821,10 +2821,10 @@ 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)
{ {
struct sta_info *sta; struct sta_info *sta;
struct ieee80211_hdr *hdr; struct ieee80211_hdr_4addr *hdr;
struct hostap_skb_tx_data *meta; struct hostap_skb_tx_data *meta;
hdr = (struct ieee80211_hdr *) skb->data; hdr = (struct ieee80211_hdr_4addr *) skb->data;
meta = (struct hostap_skb_tx_data *) skb->cb; meta = (struct hostap_skb_tx_data *) skb->cb;
spin_lock(&local->ap->sta_table_lock); spin_lock(&local->ap->sta_table_lock);
...@@ -2892,7 +2892,7 @@ static void hostap_update_sta_ps2(local_info_t *local, struct sta_info *sta, ...@@ -2892,7 +2892,7 @@ static void hostap_update_sta_ps2(local_info_t *local, struct sta_info *sta,
/* Called only as a tasklet (software IRQ). Called for each RX frame to update /* Called only as a tasklet (software IRQ). Called for each RX frame to update
* STA power saving state. pwrmgt is a flag from 802.11 frame_ctl field. */ * STA power saving state. pwrmgt is a flag from 802.11 frame_ctl field. */
int hostap_update_sta_ps(local_info_t *local, struct ieee80211_hdr *hdr) int hostap_update_sta_ps(local_info_t *local, struct ieee80211_hdr_4addr *hdr)
{ {
struct sta_info *sta; struct sta_info *sta;
u16 fc; u16 fc;
...@@ -2925,12 +2925,12 @@ ap_rx_ret hostap_handle_sta_rx(local_info_t *local, struct net_device *dev, ...@@ -2925,12 +2925,12 @@ ap_rx_ret hostap_handle_sta_rx(local_info_t *local, struct net_device *dev,
int ret; int ret;
struct sta_info *sta; struct sta_info *sta;
u16 fc, type, stype; u16 fc, type, stype;
struct ieee80211_hdr *hdr; struct ieee80211_hdr_4addr *hdr;
if (local->ap == NULL) if (local->ap == NULL)
return AP_RX_CONTINUE; return AP_RX_CONTINUE;
hdr = (struct ieee80211_hdr *) skb->data; hdr = (struct ieee80211_hdr_4addr *) skb->data;
fc = le16_to_cpu(hdr->frame_ctl); fc = le16_to_cpu(hdr->frame_ctl);
type = WLAN_FC_GET_TYPE(fc); type = WLAN_FC_GET_TYPE(fc);
...@@ -3058,7 +3058,7 @@ ap_rx_ret hostap_handle_sta_rx(local_info_t *local, struct net_device *dev, ...@@ -3058,7 +3058,7 @@ ap_rx_ret hostap_handle_sta_rx(local_info_t *local, struct net_device *dev,
/* Called only as a tasklet (software IRQ) */ /* Called only as a tasklet (software IRQ) */
int hostap_handle_sta_crypto(local_info_t *local, int hostap_handle_sta_crypto(local_info_t *local,
struct ieee80211_hdr *hdr, struct ieee80211_hdr_4addr *hdr,
struct ieee80211_crypt_data **crypt, struct ieee80211_crypt_data **crypt,
void **sta_ptr) void **sta_ptr)
{ {
...@@ -3160,7 +3160,7 @@ int hostap_add_sta(struct ap_data *ap, u8 *sta_addr) ...@@ -3160,7 +3160,7 @@ int hostap_add_sta(struct ap_data *ap, u8 *sta_addr)
/* Called only as a tasklet (software IRQ) */ /* Called only as a tasklet (software IRQ) */
int hostap_update_rx_stats(struct ap_data *ap, int hostap_update_rx_stats(struct ap_data *ap,
struct ieee80211_hdr *hdr, struct ieee80211_hdr_4addr *hdr,
struct hostap_80211_rx_status *rx_stats) struct hostap_80211_rx_status *rx_stats)
{ {
struct sta_info *sta; struct sta_info *sta;
......
...@@ -233,7 +233,7 @@ struct hostap_tx_data { ...@@ -233,7 +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, struct ieee80211_hdr *hdr); int hostap_update_sta_ps(local_info_t *local, struct ieee80211_hdr_4addr *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;
...@@ -241,13 +241,13 @@ ap_rx_ret hostap_handle_sta_rx(local_info_t *local, struct net_device *dev, ...@@ -241,13 +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, struct ieee80211_hdr *hdr, int hostap_handle_sta_crypto(local_info_t *local, struct ieee80211_hdr_4addr *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, struct ieee80211_hdr *hdr, int hostap_update_rx_stats(struct ap_data *ap, struct ieee80211_hdr_4addr *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);
......
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