diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-07-01 15:26:47 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-07-10 15:01:49 -0400 |
commit | e6d6e3420d511cd7552a95d1f04bd4c80a9ddb34 (patch) | |
tree | 35f34c9ef8fe4c201da36ca819045995a93eeb44 /net/mac80211 | |
parent | dad823302135a2d99efd40e35d94a6ff14961c93 (diff) |
cfg80211: use proper allocation flags
Instead of hardcoding GFP_ATOMIC everywhere, add a
new function parameter that gets the flags from the
caller. Obviously then I need to update all callers
(all of them in mac80211), and it turns out that now
it's ok to use GFP_KERNEL in almost all places.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/event.c | 5 | ||||
-rw-r--r-- | net/mac80211/ieee80211_i.h | 3 | ||||
-rw-r--r-- | net/mac80211/mlme.c | 30 | ||||
-rw-r--r-- | net/mac80211/rx.c | 3 | ||||
-rw-r--r-- | net/mac80211/wpa.c | 3 |
5 files changed, 28 insertions, 16 deletions
diff --git a/net/mac80211/event.c b/net/mac80211/event.c index 3ac636285fb1..01ae759518f6 100644 --- a/net/mac80211/event.c +++ b/net/mac80211/event.c | |||
@@ -16,11 +16,12 @@ | |||
16 | * driver or is still in the frame), it should provide that information. | 16 | * driver or is still in the frame), it should provide that information. |
17 | */ | 17 | */ |
18 | void mac80211_ev_michael_mic_failure(struct ieee80211_sub_if_data *sdata, int keyidx, | 18 | void mac80211_ev_michael_mic_failure(struct ieee80211_sub_if_data *sdata, int keyidx, |
19 | struct ieee80211_hdr *hdr, const u8 *tsc) | 19 | struct ieee80211_hdr *hdr, const u8 *tsc, |
20 | gfp_t gfp) | ||
20 | { | 21 | { |
21 | cfg80211_michael_mic_failure(sdata->dev, hdr->addr2, | 22 | cfg80211_michael_mic_failure(sdata->dev, hdr->addr2, |
22 | (hdr->addr1[0] & 0x01) ? | 23 | (hdr->addr1[0] & 0x01) ? |
23 | NL80211_KEYTYPE_GROUP : | 24 | NL80211_KEYTYPE_GROUP : |
24 | NL80211_KEYTYPE_PAIRWISE, | 25 | NL80211_KEYTYPE_PAIRWISE, |
25 | keyidx, tsc); | 26 | keyidx, tsc, gfp); |
26 | } | 27 | } |
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index c65c65a9e697..e0323e540a03 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
@@ -1088,7 +1088,8 @@ u8 *ieee80211_get_bssid(struct ieee80211_hdr *hdr, size_t len, | |||
1088 | int ieee80211_frame_duration(struct ieee80211_local *local, size_t len, | 1088 | int ieee80211_frame_duration(struct ieee80211_local *local, size_t len, |
1089 | int rate, int erp, int short_preamble); | 1089 | int rate, int erp, int short_preamble); |
1090 | void mac80211_ev_michael_mic_failure(struct ieee80211_sub_if_data *sdata, int keyidx, | 1090 | void mac80211_ev_michael_mic_failure(struct ieee80211_sub_if_data *sdata, int keyidx, |
1091 | struct ieee80211_hdr *hdr, const u8 *tsc); | 1091 | struct ieee80211_hdr *hdr, const u8 *tsc, |
1092 | gfp_t gfp); | ||
1092 | void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata); | 1093 | void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata); |
1093 | void ieee80211_tx_skb(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb, | 1094 | void ieee80211_tx_skb(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb, |
1094 | int encrypt); | 1095 | int encrypt); |
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 5e25d320deae..383392b04282 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -419,9 +419,11 @@ static void ieee80211_send_deauth_disassoc(struct ieee80211_sub_if_data *sdata, | |||
419 | mgmt->u.deauth.reason_code = cpu_to_le16(reason); | 419 | mgmt->u.deauth.reason_code = cpu_to_le16(reason); |
420 | 420 | ||
421 | if (stype == IEEE80211_STYPE_DEAUTH) | 421 | if (stype == IEEE80211_STYPE_DEAUTH) |
422 | cfg80211_send_deauth(sdata->dev, (u8 *) mgmt, skb->len); | 422 | cfg80211_send_deauth(sdata->dev, (u8 *) mgmt, skb->len, |
423 | GFP_KERNEL); | ||
423 | else | 424 | else |
424 | cfg80211_send_disassoc(sdata->dev, (u8 *) mgmt, skb->len); | 425 | cfg80211_send_disassoc(sdata->dev, (u8 *) mgmt, skb->len, |
426 | GFP_KERNEL); | ||
425 | ieee80211_tx_skb(sdata, skb, ifmgd->flags & IEEE80211_STA_MFP_ENABLED); | 427 | ieee80211_tx_skb(sdata, skb, ifmgd->flags & IEEE80211_STA_MFP_ENABLED); |
426 | } | 428 | } |
427 | 429 | ||
@@ -1006,7 +1008,8 @@ static void ieee80211_direct_probe(struct ieee80211_sub_if_data *sdata) | |||
1006 | sdata->dev->name, ifmgd->bssid); | 1008 | sdata->dev->name, ifmgd->bssid); |
1007 | ifmgd->state = IEEE80211_STA_MLME_DISABLED; | 1009 | ifmgd->state = IEEE80211_STA_MLME_DISABLED; |
1008 | ieee80211_recalc_idle(local); | 1010 | ieee80211_recalc_idle(local); |
1009 | cfg80211_send_auth_timeout(sdata->dev, ifmgd->bssid); | 1011 | cfg80211_send_auth_timeout(sdata->dev, ifmgd->bssid, |
1012 | GFP_KERNEL); | ||
1010 | 1013 | ||
1011 | /* | 1014 | /* |
1012 | * Most likely AP is not in the range so remove the | 1015 | * Most likely AP is not in the range so remove the |
@@ -1055,7 +1058,8 @@ static void ieee80211_authenticate(struct ieee80211_sub_if_data *sdata) | |||
1055 | sdata->dev->name, ifmgd->bssid); | 1058 | sdata->dev->name, ifmgd->bssid); |
1056 | ifmgd->state = IEEE80211_STA_MLME_DISABLED; | 1059 | ifmgd->state = IEEE80211_STA_MLME_DISABLED; |
1057 | ieee80211_recalc_idle(local); | 1060 | ieee80211_recalc_idle(local); |
1058 | cfg80211_send_auth_timeout(sdata->dev, ifmgd->bssid); | 1061 | cfg80211_send_auth_timeout(sdata->dev, ifmgd->bssid, |
1062 | GFP_KERNEL); | ||
1059 | ieee80211_rx_bss_remove(sdata, ifmgd->bssid, | 1063 | ieee80211_rx_bss_remove(sdata, ifmgd->bssid, |
1060 | sdata->local->hw.conf.channel->center_freq, | 1064 | sdata->local->hw.conf.channel->center_freq, |
1061 | ifmgd->ssid, ifmgd->ssid_len); | 1065 | ifmgd->ssid, ifmgd->ssid_len); |
@@ -1243,7 +1247,8 @@ static void ieee80211_associate(struct ieee80211_sub_if_data *sdata) | |||
1243 | sdata->dev->name, ifmgd->bssid); | 1247 | sdata->dev->name, ifmgd->bssid); |
1244 | ifmgd->state = IEEE80211_STA_MLME_DISABLED; | 1248 | ifmgd->state = IEEE80211_STA_MLME_DISABLED; |
1245 | ieee80211_recalc_idle(local); | 1249 | ieee80211_recalc_idle(local); |
1246 | cfg80211_send_assoc_timeout(sdata->dev, ifmgd->bssid); | 1250 | cfg80211_send_assoc_timeout(sdata->dev, ifmgd->bssid, |
1251 | GFP_KERNEL); | ||
1247 | ieee80211_rx_bss_remove(sdata, ifmgd->bssid, | 1252 | ieee80211_rx_bss_remove(sdata, ifmgd->bssid, |
1248 | sdata->local->hw.conf.channel->center_freq, | 1253 | sdata->local->hw.conf.channel->center_freq, |
1249 | ifmgd->ssid, ifmgd->ssid_len); | 1254 | ifmgd->ssid, ifmgd->ssid_len); |
@@ -1517,12 +1522,14 @@ static void ieee80211_rx_mgmt_auth(struct ieee80211_sub_if_data *sdata, | |||
1517 | case WLAN_AUTH_LEAP: | 1522 | case WLAN_AUTH_LEAP: |
1518 | case WLAN_AUTH_FT: | 1523 | case WLAN_AUTH_FT: |
1519 | ieee80211_auth_completed(sdata); | 1524 | ieee80211_auth_completed(sdata); |
1520 | cfg80211_send_rx_auth(sdata->dev, (u8 *) mgmt, len); | 1525 | cfg80211_send_rx_auth(sdata->dev, (u8 *) mgmt, len, |
1526 | GFP_KERNEL); | ||
1521 | break; | 1527 | break; |
1522 | case WLAN_AUTH_SHARED_KEY: | 1528 | case WLAN_AUTH_SHARED_KEY: |
1523 | if (ifmgd->auth_transaction == 4) { | 1529 | if (ifmgd->auth_transaction == 4) { |
1524 | ieee80211_auth_completed(sdata); | 1530 | ieee80211_auth_completed(sdata); |
1525 | cfg80211_send_rx_auth(sdata->dev, (u8 *) mgmt, len); | 1531 | cfg80211_send_rx_auth(sdata->dev, (u8 *) mgmt, len, |
1532 | GFP_KERNEL); | ||
1526 | } else | 1533 | } else |
1527 | ieee80211_auth_challenge(sdata, mgmt, len); | 1534 | ieee80211_auth_challenge(sdata, mgmt, len); |
1528 | break; | 1535 | break; |
@@ -1560,7 +1567,7 @@ static void ieee80211_rx_mgmt_deauth(struct ieee80211_sub_if_data *sdata, | |||
1560 | 1567 | ||
1561 | ieee80211_set_disassoc(sdata, true, false, 0); | 1568 | ieee80211_set_disassoc(sdata, true, false, 0); |
1562 | ifmgd->flags &= ~IEEE80211_STA_AUTHENTICATED; | 1569 | ifmgd->flags &= ~IEEE80211_STA_AUTHENTICATED; |
1563 | cfg80211_send_deauth(sdata->dev, (u8 *) mgmt, len); | 1570 | cfg80211_send_deauth(sdata->dev, (u8 *) mgmt, len, GFP_KERNEL); |
1564 | } | 1571 | } |
1565 | 1572 | ||
1566 | 1573 | ||
@@ -1591,7 +1598,7 @@ static void ieee80211_rx_mgmt_disassoc(struct ieee80211_sub_if_data *sdata, | |||
1591 | } | 1598 | } |
1592 | 1599 | ||
1593 | ieee80211_set_disassoc(sdata, false, false, reason_code); | 1600 | ieee80211_set_disassoc(sdata, false, false, reason_code); |
1594 | cfg80211_send_disassoc(sdata->dev, (u8 *) mgmt, len); | 1601 | cfg80211_send_disassoc(sdata->dev, (u8 *) mgmt, len, GFP_KERNEL); |
1595 | } | 1602 | } |
1596 | 1603 | ||
1597 | 1604 | ||
@@ -1660,7 +1667,8 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata, | |||
1660 | * association next time. This works around some broken APs | 1667 | * association next time. This works around some broken APs |
1661 | * which do not correctly reject reassociation requests. */ | 1668 | * which do not correctly reject reassociation requests. */ |
1662 | ifmgd->flags &= ~IEEE80211_STA_PREV_BSSID_SET; | 1669 | ifmgd->flags &= ~IEEE80211_STA_PREV_BSSID_SET; |
1663 | cfg80211_send_rx_assoc(sdata->dev, (u8 *) mgmt, len); | 1670 | cfg80211_send_rx_assoc(sdata->dev, (u8 *) mgmt, len, |
1671 | GFP_KERNEL); | ||
1664 | if (ifmgd->flags & IEEE80211_STA_EXT_SME) { | 1672 | if (ifmgd->flags & IEEE80211_STA_EXT_SME) { |
1665 | /* Wait for SME to decide what to do next */ | 1673 | /* Wait for SME to decide what to do next */ |
1666 | ifmgd->state = IEEE80211_STA_MLME_DISABLED; | 1674 | ifmgd->state = IEEE80211_STA_MLME_DISABLED; |
@@ -1823,7 +1831,7 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata, | |||
1823 | ifmgd->last_beacon = jiffies; | 1831 | ifmgd->last_beacon = jiffies; |
1824 | 1832 | ||
1825 | ieee80211_associated(sdata); | 1833 | ieee80211_associated(sdata); |
1826 | cfg80211_send_rx_assoc(sdata->dev, (u8 *) mgmt, len); | 1834 | cfg80211_send_rx_assoc(sdata->dev, (u8 *) mgmt, len, GFP_KERNEL); |
1827 | } | 1835 | } |
1828 | 1836 | ||
1829 | 1837 | ||
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 0563b6969a21..ec5acc6dc021 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -1863,7 +1863,8 @@ static void ieee80211_rx_michael_mic_report(struct net_device *dev, | |||
1863 | !ieee80211_is_auth(hdr->frame_control)) | 1863 | !ieee80211_is_auth(hdr->frame_control)) |
1864 | goto ignore; | 1864 | goto ignore; |
1865 | 1865 | ||
1866 | mac80211_ev_michael_mic_failure(rx->sdata, keyidx, hdr, NULL); | 1866 | mac80211_ev_michael_mic_failure(rx->sdata, keyidx, hdr, NULL, |
1867 | GFP_ATOMIC); | ||
1867 | ignore: | 1868 | ignore: |
1868 | dev_kfree_skb(rx->skb); | 1869 | dev_kfree_skb(rx->skb); |
1869 | rx->skb = NULL; | 1870 | rx->skb = NULL; |
diff --git a/net/mac80211/wpa.c b/net/mac80211/wpa.c index dcfae8884b86..70778694877b 100644 --- a/net/mac80211/wpa.c +++ b/net/mac80211/wpa.c | |||
@@ -122,7 +122,8 @@ ieee80211_rx_h_michael_mic_verify(struct ieee80211_rx_data *rx) | |||
122 | return RX_DROP_UNUSABLE; | 122 | return RX_DROP_UNUSABLE; |
123 | 123 | ||
124 | mac80211_ev_michael_mic_failure(rx->sdata, rx->key->conf.keyidx, | 124 | mac80211_ev_michael_mic_failure(rx->sdata, rx->key->conf.keyidx, |
125 | (void *) skb->data, NULL); | 125 | (void *) skb->data, NULL, |
126 | GFP_ATOMIC); | ||
126 | return RX_DROP_UNUSABLE; | 127 | return RX_DROP_UNUSABLE; |
127 | } | 128 | } |
128 | 129 | ||