Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 134107
b: refs/heads/master
c: 63a5ab8
h: refs/heads/master
i:
  134105: 772b38c
  134103: 50a22dd
v: v3
  • Loading branch information
Jouni Malinen authored and John W. Linville committed Jan 29, 2009
1 parent c0097da commit 45320ab
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 4 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: 97ebe12a035e11f8af7a06a34f4d848f9b2f0b49
refs/heads/master: 63a5ab82255a4ff5d0783f16427210f1d45d7ec8
4 changes: 4 additions & 0 deletions trunk/include/linux/ieee80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,9 @@ enum ieee80211_statuscode {
/* 802.11g */
WLAN_STATUS_ASSOC_DENIED_NOSHORTTIME = 25,
WLAN_STATUS_ASSOC_DENIED_NODSSSOFDM = 26,
/* 802.11w */
WLAN_STATUS_ASSOC_REJECTED_TEMPORARILY = 30,
WLAN_STATUS_ROBUST_MGMT_FRAME_POLICY_VIOLATION = 31,
/* 802.11i */
WLAN_STATUS_INVALID_IE = 40,
WLAN_STATUS_INVALID_GROUP_CIPHER = 41,
Expand Down Expand Up @@ -1034,6 +1037,7 @@ enum ieee80211_eid {
/* 802.11i */
WLAN_EID_RSN = 48,
WLAN_EID_MMIE = 76 /* 802.11w */,
WLAN_EID_ASSOC_COMEBACK_TIME = 77,
WLAN_EID_WPA = 221,
WLAN_EID_GENERIC = 221,
WLAN_EID_VENDOR_SPECIFIC = 221,
Expand Down
2 changes: 2 additions & 0 deletions trunk/net/mac80211/ieee80211_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,7 @@ struct ieee802_11_elems {
u8 *country_elem;
u8 *pwr_constr_elem;
u8 *quiet_elem; /* first quite element */
u8 *assoc_comeback;

/* length of them, respectively */
u8 ssid_len;
Expand Down Expand Up @@ -847,6 +848,7 @@ struct ieee802_11_elems {
u8 pwr_constr_elem_len;
u8 quiet_elem_len;
u8 num_of_quiet_elem; /* can be more the one */
u8 assoc_comeback_len;
};

static inline struct ieee80211_local *hw_to_local(
Expand Down
20 changes: 17 additions & 3 deletions trunk/net/mac80211/mlme.c
Original file line number Diff line number Diff line change
Expand Up @@ -1275,6 +1275,23 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata,
sdata->dev->name, reassoc ? "Rea" : "A", mgmt->sa,
capab_info, status_code, (u16)(aid & ~(BIT(15) | BIT(14))));

pos = mgmt->u.assoc_resp.variable;
ieee802_11_parse_elems(pos, len - (pos - (u8 *) mgmt), &elems);

if (status_code == WLAN_STATUS_ASSOC_REJECTED_TEMPORARILY &&
elems.assoc_comeback && elems.assoc_comeback_len == 4) {
u32 tu, ms;
tu = get_unaligned_le32(elems.assoc_comeback);
ms = tu * 1024 / 1000;
printk(KERN_DEBUG "%s: AP rejected association temporarily; "
"comeback duration %u TU (%u ms)\n",
sdata->dev->name, tu, ms);
if (ms > IEEE80211_ASSOC_TIMEOUT)
mod_timer(&ifsta->timer,
jiffies + msecs_to_jiffies(ms));
return;
}

if (status_code != WLAN_STATUS_SUCCESS) {
printk(KERN_DEBUG "%s: AP denied association (code=%d)\n",
sdata->dev->name, status_code);
Expand All @@ -1290,9 +1307,6 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata,
"set\n", sdata->dev->name, aid);
aid &= ~(BIT(15) | BIT(14));

pos = mgmt->u.assoc_resp.variable;
ieee802_11_parse_elems(pos, len - (pos - (u8 *) mgmt), &elems);

if (!elems.supp_rates) {
printk(KERN_DEBUG "%s: no SuppRates element in AssocResp\n",
sdata->dev->name);
Expand Down
4 changes: 4 additions & 0 deletions trunk/net/mac80211/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,10 @@ void ieee802_11_parse_elems(u8 *start, size_t len,
elems->pwr_constr_elem = pos;
elems->pwr_constr_elem_len = elen;
break;
case WLAN_EID_ASSOC_COMEBACK_TIME:
elems->assoc_comeback = pos;
elems->assoc_comeback_len = elen;
break;
default:
break;
}
Expand Down

0 comments on commit 45320ab

Please sign in to comment.