Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 6767
b: refs/heads/master
c: 4339d32
h: refs/heads/master
i:
  6765: 104edb1
  6763: 34881e2
  6759: 416a940
  6751: 21a9cac
v: v3
  • Loading branch information
Jouni Malinen authored and Jeff Garzik committed Aug 15, 2005
1 parent 95bbd07 commit 66b32b5
Show file tree
Hide file tree
Showing 9 changed files with 115 additions and 153 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c0f72ca8e4f1b459b5582c1c8dcaf7e53151f069
refs/heads/master: 4339d328631aa815fe2181b9164b3690ca2db4da
23 changes: 11 additions & 12 deletions trunk/drivers/net/wireless/hostap/hostap.c
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ void hostap_dump_rx_header(const char *name, const struct hfa384x_rx_frame *rx)
fc = __le16_to_cpu(rx->frame_control);
printk(KERN_DEBUG " FC=0x%04x (type=%d:%d) dur=0x%04x seq=0x%04x "
"data_len=%d%s%s\n",
fc, HOSTAP_FC_GET_TYPE(fc), HOSTAP_FC_GET_STYPE(fc),
fc, WLAN_FC_GET_TYPE(fc) >> 2, WLAN_FC_GET_STYPE(fc) >> 4,
__le16_to_cpu(rx->duration_id), __le16_to_cpu(rx->seq_ctrl),
__le16_to_cpu(rx->data_len),
fc & WLAN_FC_TODS ? " [ToDS]" : "",
Expand Down Expand Up @@ -623,7 +623,7 @@ void hostap_dump_tx_header(const char *name, const struct hfa384x_tx_frame *tx)
fc = __le16_to_cpu(tx->frame_control);
printk(KERN_DEBUG " FC=0x%04x (type=%d:%d) dur=0x%04x seq=0x%04x "
"data_len=%d%s%s\n",
fc, HOSTAP_FC_GET_TYPE(fc), HOSTAP_FC_GET_STYPE(fc),
fc, WLAN_FC_GET_TYPE(fc) >> 2, WLAN_FC_GET_STYPE(fc) >> 4,
__le16_to_cpu(tx->duration_id), __le16_to_cpu(tx->seq_ctrl),
__le16_to_cpu(tx->data_len),
fc & WLAN_FC_TODS ? " [ToDS]" : "",
Expand Down Expand Up @@ -666,15 +666,15 @@ int hostap_80211_get_hdrlen(u16 fc)
{
int hdrlen = 24;

switch (HOSTAP_FC_GET_TYPE(fc)) {
case WLAN_FC_TYPE_DATA:
switch (WLAN_FC_GET_TYPE(fc)) {
case IEEE80211_FTYPE_DATA:
if ((fc & WLAN_FC_FROMDS) && (fc & WLAN_FC_TODS))
hdrlen = 30; /* Addr4 */
break;
case WLAN_FC_TYPE_CTRL:
switch (HOSTAP_FC_GET_STYPE(fc)) {
case WLAN_FC_STYPE_CTS:
case WLAN_FC_STYPE_ACK:
case IEEE80211_FTYPE_CTL:
switch (WLAN_FC_GET_STYPE(fc)) {
case IEEE80211_STYPE_CTS:
case IEEE80211_STYPE_ACK:
hdrlen = 10;
break;
default:
Expand Down Expand Up @@ -1093,7 +1093,7 @@ int prism2_update_comms_qual(struct net_device *dev)
}


int prism2_sta_send_mgmt(local_info_t *local, u8 *dst, u8 stype,
int prism2_sta_send_mgmt(local_info_t *local, u8 *dst, u16 stype,
u8 *body, size_t bodylen)
{
struct sk_buff *skb;
Expand All @@ -1108,8 +1108,7 @@ int prism2_sta_send_mgmt(local_info_t *local, u8 *dst, u8 stype,
mgmt = (struct hostap_ieee80211_mgmt *)
skb_put(skb, IEEE80211_MGMT_HDR_LEN);
memset(mgmt, 0, IEEE80211_MGMT_HDR_LEN);
mgmt->frame_control =
cpu_to_le16((WLAN_FC_TYPE_MGMT << 2) | (stype << 4));
mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT | stype);
memcpy(mgmt->da, dst, ETH_ALEN);
memcpy(mgmt->sa, dev->dev_addr, ETH_ALEN);
memcpy(mgmt->bssid, dst, ETH_ALEN);
Expand Down Expand Up @@ -1140,7 +1139,7 @@ int prism2_sta_deauth(local_info_t *local, u16 reason)
return 0;

reason = cpu_to_le16(reason);
ret = prism2_sta_send_mgmt(local, local->bssid, WLAN_FC_STYPE_DEAUTH,
ret = prism2_sta_send_mgmt(local, local->bssid, IEEE80211_STYPE_DEAUTH,
(u8 *) &reason, 2);
memset(wrqu.ap_addr.sa_data, 0, ETH_ALEN);
wireless_send_event(local->dev, SIOCGIWAP, &wrqu, NULL);
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/wireless/hostap/hostap.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ struct net_device * hostap_add_interface(struct local_info *local,
void hostap_remove_interface(struct net_device *dev, int rtnl_locked,
int remove_from_list);
int prism2_update_comms_qual(struct net_device *dev);
int prism2_sta_send_mgmt(local_info_t *local, u8 *dst, u8 stype,
int prism2_sta_send_mgmt(local_info_t *local, u8 *dst, u16 stype,
u8 *body, size_t bodylen);
int prism2_sta_deauth(local_info_t *local, u16 reason);

Expand Down
46 changes: 24 additions & 22 deletions trunk/drivers/net/wireless/hostap/hostap_80211_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ void hostap_dump_rx_80211(const char *name, struct sk_buff *skb,

fc = le16_to_cpu(hdr->frame_ctl);
printk(KERN_DEBUG " FC=0x%04x (type=%d:%d)%s%s",
fc, HOSTAP_FC_GET_TYPE(fc), HOSTAP_FC_GET_STYPE(fc),
fc, WLAN_FC_GET_TYPE(fc) >> 2, WLAN_FC_GET_STYPE(fc) >> 4,
fc & WLAN_FC_TODS ? " [ToDS]" : "",
fc & WLAN_FC_FROMDS ? " [FromDS]" : "");

Expand Down Expand Up @@ -445,8 +445,8 @@ hostap_rx_frame_mgmt(local_info_t *local, struct sk_buff *skb,
skb->data);
}

if (local->hostapd && type == WLAN_FC_TYPE_MGMT) {
if (stype == WLAN_FC_STYPE_BEACON &&
if (local->hostapd && type == IEEE80211_FTYPE_MGMT) {
if (stype == IEEE80211_STYPE_BEACON &&
local->iw_mode == IW_MODE_MASTER) {
struct sk_buff *skb2;
/* Process beacon frames also in kernel driver to
Expand All @@ -467,31 +467,32 @@ hostap_rx_frame_mgmt(local_info_t *local, struct sk_buff *skb,
}

if (local->iw_mode == IW_MODE_MASTER) {
if (type != WLAN_FC_TYPE_MGMT && type != WLAN_FC_TYPE_CTRL) {
if (type != IEEE80211_FTYPE_MGMT &&
type != IEEE80211_FTYPE_CTL) {
printk(KERN_DEBUG "%s: unknown management frame "
"(type=0x%02x, stype=0x%02x) dropped\n",
skb->dev->name, type, stype);
skb->dev->name, type >> 2, stype >> 4);
return -1;
}

hostap_rx(skb->dev, skb, rx_stats);
return 0;
} else if (type == WLAN_FC_TYPE_MGMT &&
(stype == WLAN_FC_STYPE_BEACON ||
stype == WLAN_FC_STYPE_PROBE_RESP)) {
} else if (type == IEEE80211_FTYPE_MGMT &&
(stype == IEEE80211_STYPE_BEACON ||
stype == IEEE80211_STYPE_PROBE_RESP)) {
hostap_rx_sta_beacon(local, skb, stype);
return -1;
} else if (type == WLAN_FC_TYPE_MGMT &&
(stype == WLAN_FC_STYPE_ASSOC_RESP ||
stype == WLAN_FC_STYPE_REASSOC_RESP)) {
} else if (type == IEEE80211_FTYPE_MGMT &&
(stype == IEEE80211_STYPE_ASSOC_RESP ||
stype == IEEE80211_STYPE_REASSOC_RESP)) {
/* Ignore (Re)AssocResp silently since these are not currently
* needed but are still received when WPA/RSN mode is enabled.
*/
return -1;
} else {
printk(KERN_DEBUG "%s: hostap_rx_frame_mgmt: dropped unhandled"
" management frame in non-Host AP mode (type=%d:%d)\n",
skb->dev->name, type, stype);
skb->dev->name, type >> 2, stype >> 4);
return -1;
}
}
Expand Down Expand Up @@ -719,8 +720,8 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
goto rx_dropped;

fc = le16_to_cpu(hdr->frame_ctl);
type = HOSTAP_FC_GET_TYPE(fc);
stype = HOSTAP_FC_GET_STYPE(fc);
type = WLAN_FC_GET_TYPE(fc);
stype = WLAN_FC_GET_STYPE(fc);
sc = le16_to_cpu(hdr->seq_ctl);
frag = WLAN_GET_SEQ_FRAG(sc);
hdrlen = hostap_80211_get_hdrlen(fc);
Expand Down Expand Up @@ -784,8 +785,9 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
}
}

if (type != WLAN_FC_TYPE_DATA) {
if (type == WLAN_FC_TYPE_MGMT && stype == WLAN_FC_STYPE_AUTH &&
if (type != IEEE80211_FTYPE_DATA) {
if (type == IEEE80211_FTYPE_MGMT &&
stype == IEEE80211_STYPE_AUTH &&
fc & WLAN_FC_ISWEP && local->host_decrypt &&
(keyidx = hostap_rx_frame_decrypt(local, skb, crypt)) < 0)
{
Expand Down Expand Up @@ -867,14 +869,14 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,

/* Nullfunc frames may have PS-bit set, so they must be passed to
* hostap_handle_sta_rx() before being dropped here. */
if (stype != WLAN_FC_STYPE_DATA &&
stype != WLAN_FC_STYPE_DATA_CFACK &&
stype != WLAN_FC_STYPE_DATA_CFPOLL &&
stype != WLAN_FC_STYPE_DATA_CFACKPOLL) {
if (stype != WLAN_FC_STYPE_NULLFUNC)
if (stype != IEEE80211_STYPE_DATA &&
stype != IEEE80211_STYPE_DATA_CFACK &&
stype != IEEE80211_STYPE_DATA_CFPOLL &&
stype != IEEE80211_STYPE_DATA_CFACKPOLL) {
if (stype != IEEE80211_STYPE_NULLFUNC)
printk(KERN_DEBUG "%s: RX: dropped data frame "
"with no data (type=0x%02x, subtype=0x%02x)\n",
dev->name, type, stype);
dev->name, type >> 2, stype >> 4);
goto rx_dropped;
}

Expand Down
14 changes: 7 additions & 7 deletions trunk/drivers/net/wireless/hostap/hostap_80211_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ void hostap_dump_tx_80211(const char *name, struct sk_buff *skb)

fc = le16_to_cpu(hdr->frame_ctl);
printk(KERN_DEBUG " FC=0x%04x (type=%d:%d)%s%s",
fc, HOSTAP_FC_GET_TYPE(fc), HOSTAP_FC_GET_STYPE(fc),
fc, WLAN_FC_GET_TYPE(fc) >> 2, WLAN_FC_GET_STYPE(fc) >> 4,
fc & WLAN_FC_TODS ? " [ToDS]" : "",
fc & WLAN_FC_FROMDS ? " [FromDS]" : "");

Expand Down Expand Up @@ -115,7 +115,7 @@ int hostap_data_start_xmit(struct sk_buff *skb, struct net_device *dev)
skip_header_bytes -= 2;
}

fc = (WLAN_FC_TYPE_DATA << 2) | (WLAN_FC_STYPE_DATA << 4);
fc = IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA;
hdr_len = IEEE80211_DATA_HDR3_LEN;

if (use_wds != WDS_NO) {
Expand Down Expand Up @@ -268,8 +268,8 @@ int hostap_mgmt_start_xmit(struct sk_buff *skb, struct net_device *dev)
if (skb->len >= IEEE80211_DATA_HDR3_LEN + sizeof(rfc1042_header) + 2) {
hdr = (struct ieee80211_hdr *) skb->data;
fc = le16_to_cpu(hdr->frame_ctl);
if (HOSTAP_FC_GET_TYPE(fc) == WLAN_FC_TYPE_DATA &&
HOSTAP_FC_GET_STYPE(fc) == WLAN_FC_STYPE_DATA) {
if (WLAN_FC_GET_TYPE(fc) == IEEE80211_FTYPE_DATA &&
WLAN_FC_GET_STYPE(fc) == IEEE80211_STYPE_DATA) {
u8 *pos = &skb->data[IEEE80211_DATA_HDR3_LEN +
sizeof(rfc1042_header)];
meta->ethertype = (pos[0] << 8) | pos[1];
Expand Down Expand Up @@ -410,7 +410,7 @@ int hostap_master_start_xmit(struct sk_buff *skb, struct net_device *dev)
break;
case AP_TX_CONTINUE_NOT_AUTHORIZED:
if (local->ieee_802_1x &&
HOSTAP_FC_GET_TYPE(fc) == WLAN_FC_TYPE_DATA &&
WLAN_FC_GET_TYPE(fc) == IEEE80211_FTYPE_DATA &&
meta->ethertype != ETH_P_PAE &&
!(meta->flags & HOSTAP_TX_FLAGS_WDS)) {
printk(KERN_DEBUG "%s: dropped frame to unauthorized "
Expand Down Expand Up @@ -448,7 +448,7 @@ int hostap_master_start_xmit(struct sk_buff *skb, struct net_device *dev)
hdr->frame_ctl = cpu_to_le16(fc);
}

if (HOSTAP_FC_GET_TYPE(fc) != WLAN_FC_TYPE_DATA) {
if (WLAN_FC_GET_TYPE(fc) != IEEE80211_FTYPE_DATA) {
no_encrypt = 1;
tx.crypt = NULL;
}
Expand All @@ -469,7 +469,7 @@ int hostap_master_start_xmit(struct sk_buff *skb, struct net_device *dev)
fc |= WLAN_FC_ISWEP;
hdr->frame_ctl = cpu_to_le16(fc);
} else if (local->drop_unencrypted &&
HOSTAP_FC_GET_TYPE(fc) == WLAN_FC_TYPE_DATA &&
WLAN_FC_GET_TYPE(fc) == IEEE80211_FTYPE_DATA &&
meta->ethertype != ETH_P_PAE) {
if (net_ratelimit()) {
printk(KERN_DEBUG "%s: dropped unencrypted TX data "
Expand Down
Loading

0 comments on commit 66b32b5

Please sign in to comment.