Commit e6d6e342 authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville

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: default avatarJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent dad82330
...@@ -1572,64 +1572,70 @@ void cfg80211_unlink_bss(struct wiphy *wiphy, struct cfg80211_bss *bss); ...@@ -1572,64 +1572,70 @@ void cfg80211_unlink_bss(struct wiphy *wiphy, struct cfg80211_bss *bss);
* @dev: network device * @dev: network device
* @buf: authentication frame (header + body) * @buf: authentication frame (header + body)
* @len: length of the frame data * @len: length of the frame data
* @gfp: allocation flags
* *
* This function is called whenever an authentication has been processed in * This function is called whenever an authentication has been processed in
* station mode. The driver is required to call either this function or * station mode. The driver is required to call either this function or
* cfg80211_send_auth_timeout() to indicate the result of cfg80211_ops::auth() * cfg80211_send_auth_timeout() to indicate the result of cfg80211_ops::auth()
* call. * call.
*/ */
void cfg80211_send_rx_auth(struct net_device *dev, const u8 *buf, size_t len); void cfg80211_send_rx_auth(struct net_device *dev, const u8 *buf, size_t len, gfp_t gfp);
/** /**
* cfg80211_send_auth_timeout - notification of timed out authentication * cfg80211_send_auth_timeout - notification of timed out authentication
* @dev: network device * @dev: network device
* @addr: The MAC address of the device with which the authentication timed out * @addr: The MAC address of the device with which the authentication timed out
* @gfp: allocation flags
*/ */
void cfg80211_send_auth_timeout(struct net_device *dev, const u8 *addr); void cfg80211_send_auth_timeout(struct net_device *dev, const u8 *addr, gfp_t gfp);
/** /**
* cfg80211_send_rx_assoc - notification of processed association * cfg80211_send_rx_assoc - notification of processed association
* @dev: network device * @dev: network device
* @buf: (re)association response frame (header + body) * @buf: (re)association response frame (header + body)
* @len: length of the frame data * @len: length of the frame data
* @gfp: allocation flags
* *
* This function is called whenever a (re)association response has been * This function is called whenever a (re)association response has been
* processed in station mode. The driver is required to call either this * processed in station mode. The driver is required to call either this
* function or cfg80211_send_assoc_timeout() to indicate the result of * function or cfg80211_send_assoc_timeout() to indicate the result of
* cfg80211_ops::assoc() call. * cfg80211_ops::assoc() call.
*/ */
void cfg80211_send_rx_assoc(struct net_device *dev, const u8 *buf, size_t len); void cfg80211_send_rx_assoc(struct net_device *dev, const u8 *buf, size_t len, gfp_t gfp);
/** /**
* cfg80211_send_assoc_timeout - notification of timed out association * cfg80211_send_assoc_timeout - notification of timed out association
* @dev: network device * @dev: network device
* @addr: The MAC address of the device with which the association timed out * @addr: The MAC address of the device with which the association timed out
* @gfp: allocation flags
*/ */
void cfg80211_send_assoc_timeout(struct net_device *dev, const u8 *addr); void cfg80211_send_assoc_timeout(struct net_device *dev, const u8 *addr, gfp_t gfp);
/** /**
* cfg80211_send_deauth - notification of processed deauthentication * cfg80211_send_deauth - notification of processed deauthentication
* @dev: network device * @dev: network device
* @buf: deauthentication frame (header + body) * @buf: deauthentication frame (header + body)
* @len: length of the frame data * @len: length of the frame data
* @gfp: allocation flags
* *
* This function is called whenever deauthentication has been processed in * This function is called whenever deauthentication has been processed in
* station mode. This includes both received deauthentication frames and * station mode. This includes both received deauthentication frames and
* locally generated ones. * locally generated ones.
*/ */
void cfg80211_send_deauth(struct net_device *dev, const u8 *buf, size_t len); void cfg80211_send_deauth(struct net_device *dev, const u8 *buf, size_t len, gfp_t gfp);
/** /**
* cfg80211_send_disassoc - notification of processed disassociation * cfg80211_send_disassoc - notification of processed disassociation
* @dev: network device * @dev: network device
* @buf: disassociation response frame (header + body) * @buf: disassociation response frame (header + body)
* @len: length of the frame data * @len: length of the frame data
* @gfp: allocation flags
* *
* This function is called whenever disassociation has been processed in * This function is called whenever disassociation has been processed in
* station mode. This includes both received disassociation frames and locally * station mode. This includes both received disassociation frames and locally
* generated ones. * generated ones.
*/ */
void cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, size_t len); void cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, size_t len, gfp_t gfp);
/** /**
* cfg80211_hold_bss - exclude bss from expiration * cfg80211_hold_bss - exclude bss from expiration
...@@ -1655,6 +1661,7 @@ void cfg80211_unhold_bss(struct cfg80211_bss *bss); ...@@ -1655,6 +1661,7 @@ void cfg80211_unhold_bss(struct cfg80211_bss *bss);
* @key_type: The key type that the received frame used * @key_type: The key type that the received frame used
* @key_id: Key identifier (0..3) * @key_id: Key identifier (0..3)
* @tsc: The TSC value of the frame that generated the MIC failure (6 octets) * @tsc: The TSC value of the frame that generated the MIC failure (6 octets)
* @gfp: allocation flags
* *
* This function is called whenever the local MAC detects a MIC failure in a * This function is called whenever the local MAC detects a MIC failure in a
* received frame. This matches with MLME-MICHAELMICFAILURE.indication() * received frame. This matches with MLME-MICHAELMICFAILURE.indication()
...@@ -1662,7 +1669,7 @@ void cfg80211_unhold_bss(struct cfg80211_bss *bss); ...@@ -1662,7 +1669,7 @@ void cfg80211_unhold_bss(struct cfg80211_bss *bss);
*/ */
void cfg80211_michael_mic_failure(struct net_device *dev, const u8 *addr, void cfg80211_michael_mic_failure(struct net_device *dev, const u8 *addr,
enum nl80211_key_type key_type, int key_id, enum nl80211_key_type key_type, int key_id,
const u8 *tsc); const u8 *tsc, gfp_t gfp);
/** /**
* cfg80211_ibss_joined - notify cfg80211 that device joined an IBSS * cfg80211_ibss_joined - notify cfg80211 that device joined an IBSS
......
...@@ -16,11 +16,12 @@ ...@@ -16,11 +16,12 @@
* driver or is still in the frame), it should provide that information. * driver or is still in the frame), it should provide that information.
*/ */
void mac80211_ev_michael_mic_failure(struct ieee80211_sub_if_data *sdata, int keyidx, void mac80211_ev_michael_mic_failure(struct ieee80211_sub_if_data *sdata, int keyidx,
struct ieee80211_hdr *hdr, const u8 *tsc) struct ieee80211_hdr *hdr, const u8 *tsc,
gfp_t gfp)
{ {
cfg80211_michael_mic_failure(sdata->dev, hdr->addr2, cfg80211_michael_mic_failure(sdata->dev, hdr->addr2,
(hdr->addr1[0] & 0x01) ? (hdr->addr1[0] & 0x01) ?
NL80211_KEYTYPE_GROUP : NL80211_KEYTYPE_GROUP :
NL80211_KEYTYPE_PAIRWISE, NL80211_KEYTYPE_PAIRWISE,
keyidx, tsc); keyidx, tsc, gfp);
} }
...@@ -1088,7 +1088,8 @@ u8 *ieee80211_get_bssid(struct ieee80211_hdr *hdr, size_t len, ...@@ -1088,7 +1088,8 @@ u8 *ieee80211_get_bssid(struct ieee80211_hdr *hdr, size_t len,
int ieee80211_frame_duration(struct ieee80211_local *local, size_t len, int ieee80211_frame_duration(struct ieee80211_local *local, size_t len,
int rate, int erp, int short_preamble); int rate, int erp, int short_preamble);
void mac80211_ev_michael_mic_failure(struct ieee80211_sub_if_data *sdata, int keyidx, void mac80211_ev_michael_mic_failure(struct ieee80211_sub_if_data *sdata, int keyidx,
struct ieee80211_hdr *hdr, const u8 *tsc); struct ieee80211_hdr *hdr, const u8 *tsc,
gfp_t gfp);
void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata); void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata);
void ieee80211_tx_skb(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb, void ieee80211_tx_skb(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb,
int encrypt); int encrypt);
......
...@@ -419,9 +419,11 @@ static void ieee80211_send_deauth_disassoc(struct ieee80211_sub_if_data *sdata, ...@@ -419,9 +419,11 @@ static void ieee80211_send_deauth_disassoc(struct ieee80211_sub_if_data *sdata,
mgmt->u.deauth.reason_code = cpu_to_le16(reason); mgmt->u.deauth.reason_code = cpu_to_le16(reason);
if (stype == IEEE80211_STYPE_DEAUTH) if (stype == IEEE80211_STYPE_DEAUTH)
cfg80211_send_deauth(sdata->dev, (u8 *) mgmt, skb->len); cfg80211_send_deauth(sdata->dev, (u8 *) mgmt, skb->len,
GFP_KERNEL);
else else
cfg80211_send_disassoc(sdata->dev, (u8 *) mgmt, skb->len); cfg80211_send_disassoc(sdata->dev, (u8 *) mgmt, skb->len,
GFP_KERNEL);
ieee80211_tx_skb(sdata, skb, ifmgd->flags & IEEE80211_STA_MFP_ENABLED); ieee80211_tx_skb(sdata, skb, ifmgd->flags & IEEE80211_STA_MFP_ENABLED);
} }
...@@ -1006,7 +1008,8 @@ static void ieee80211_direct_probe(struct ieee80211_sub_if_data *sdata) ...@@ -1006,7 +1008,8 @@ static void ieee80211_direct_probe(struct ieee80211_sub_if_data *sdata)
sdata->dev->name, ifmgd->bssid); sdata->dev->name, ifmgd->bssid);
ifmgd->state = IEEE80211_STA_MLME_DISABLED; ifmgd->state = IEEE80211_STA_MLME_DISABLED;
ieee80211_recalc_idle(local); ieee80211_recalc_idle(local);
cfg80211_send_auth_timeout(sdata->dev, ifmgd->bssid); cfg80211_send_auth_timeout(sdata->dev, ifmgd->bssid,
GFP_KERNEL);
/* /*
* Most likely AP is not in the range so remove the * 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,7 +1058,8 @@ static void ieee80211_authenticate(struct ieee80211_sub_if_data *sdata)
sdata->dev->name, ifmgd->bssid); sdata->dev->name, ifmgd->bssid);
ifmgd->state = IEEE80211_STA_MLME_DISABLED; ifmgd->state = IEEE80211_STA_MLME_DISABLED;
ieee80211_recalc_idle(local); ieee80211_recalc_idle(local);
cfg80211_send_auth_timeout(sdata->dev, ifmgd->bssid); cfg80211_send_auth_timeout(sdata->dev, ifmgd->bssid,
GFP_KERNEL);
ieee80211_rx_bss_remove(sdata, ifmgd->bssid, ieee80211_rx_bss_remove(sdata, ifmgd->bssid,
sdata->local->hw.conf.channel->center_freq, sdata->local->hw.conf.channel->center_freq,
ifmgd->ssid, ifmgd->ssid_len); ifmgd->ssid, ifmgd->ssid_len);
...@@ -1243,7 +1247,8 @@ static void ieee80211_associate(struct ieee80211_sub_if_data *sdata) ...@@ -1243,7 +1247,8 @@ static void ieee80211_associate(struct ieee80211_sub_if_data *sdata)
sdata->dev->name, ifmgd->bssid); sdata->dev->name, ifmgd->bssid);
ifmgd->state = IEEE80211_STA_MLME_DISABLED; ifmgd->state = IEEE80211_STA_MLME_DISABLED;
ieee80211_recalc_idle(local); ieee80211_recalc_idle(local);
cfg80211_send_assoc_timeout(sdata->dev, ifmgd->bssid); cfg80211_send_assoc_timeout(sdata->dev, ifmgd->bssid,
GFP_KERNEL);
ieee80211_rx_bss_remove(sdata, ifmgd->bssid, ieee80211_rx_bss_remove(sdata, ifmgd->bssid,
sdata->local->hw.conf.channel->center_freq, sdata->local->hw.conf.channel->center_freq,
ifmgd->ssid, ifmgd->ssid_len); ifmgd->ssid, ifmgd->ssid_len);
...@@ -1517,12 +1522,14 @@ static void ieee80211_rx_mgmt_auth(struct ieee80211_sub_if_data *sdata, ...@@ -1517,12 +1522,14 @@ static void ieee80211_rx_mgmt_auth(struct ieee80211_sub_if_data *sdata,
case WLAN_AUTH_LEAP: case WLAN_AUTH_LEAP:
case WLAN_AUTH_FT: case WLAN_AUTH_FT:
ieee80211_auth_completed(sdata); ieee80211_auth_completed(sdata);
cfg80211_send_rx_auth(sdata->dev, (u8 *) mgmt, len); cfg80211_send_rx_auth(sdata->dev, (u8 *) mgmt, len,
GFP_KERNEL);
break; break;
case WLAN_AUTH_SHARED_KEY: case WLAN_AUTH_SHARED_KEY:
if (ifmgd->auth_transaction == 4) { if (ifmgd->auth_transaction == 4) {
ieee80211_auth_completed(sdata); ieee80211_auth_completed(sdata);
cfg80211_send_rx_auth(sdata->dev, (u8 *) mgmt, len); cfg80211_send_rx_auth(sdata->dev, (u8 *) mgmt, len,
GFP_KERNEL);
} else } else
ieee80211_auth_challenge(sdata, mgmt, len); ieee80211_auth_challenge(sdata, mgmt, len);
break; break;
...@@ -1560,7 +1567,7 @@ static void ieee80211_rx_mgmt_deauth(struct ieee80211_sub_if_data *sdata, ...@@ -1560,7 +1567,7 @@ static void ieee80211_rx_mgmt_deauth(struct ieee80211_sub_if_data *sdata,
ieee80211_set_disassoc(sdata, true, false, 0); ieee80211_set_disassoc(sdata, true, false, 0);
ifmgd->flags &= ~IEEE80211_STA_AUTHENTICATED; ifmgd->flags &= ~IEEE80211_STA_AUTHENTICATED;
cfg80211_send_deauth(sdata->dev, (u8 *) mgmt, len); cfg80211_send_deauth(sdata->dev, (u8 *) mgmt, len, GFP_KERNEL);
} }
...@@ -1591,7 +1598,7 @@ static void ieee80211_rx_mgmt_disassoc(struct ieee80211_sub_if_data *sdata, ...@@ -1591,7 +1598,7 @@ static void ieee80211_rx_mgmt_disassoc(struct ieee80211_sub_if_data *sdata,
} }
ieee80211_set_disassoc(sdata, false, false, reason_code); ieee80211_set_disassoc(sdata, false, false, reason_code);
cfg80211_send_disassoc(sdata->dev, (u8 *) mgmt, len); cfg80211_send_disassoc(sdata->dev, (u8 *) mgmt, len, GFP_KERNEL);
} }
...@@ -1660,7 +1667,8 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata, ...@@ -1660,7 +1667,8 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata,
* association next time. This works around some broken APs * association next time. This works around some broken APs
* which do not correctly reject reassociation requests. */ * which do not correctly reject reassociation requests. */
ifmgd->flags &= ~IEEE80211_STA_PREV_BSSID_SET; ifmgd->flags &= ~IEEE80211_STA_PREV_BSSID_SET;
cfg80211_send_rx_assoc(sdata->dev, (u8 *) mgmt, len); cfg80211_send_rx_assoc(sdata->dev, (u8 *) mgmt, len,
GFP_KERNEL);
if (ifmgd->flags & IEEE80211_STA_EXT_SME) { if (ifmgd->flags & IEEE80211_STA_EXT_SME) {
/* Wait for SME to decide what to do next */ /* Wait for SME to decide what to do next */
ifmgd->state = IEEE80211_STA_MLME_DISABLED; ifmgd->state = IEEE80211_STA_MLME_DISABLED;
...@@ -1823,7 +1831,7 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata, ...@@ -1823,7 +1831,7 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata,
ifmgd->last_beacon = jiffies; ifmgd->last_beacon = jiffies;
ieee80211_associated(sdata); ieee80211_associated(sdata);
cfg80211_send_rx_assoc(sdata->dev, (u8 *) mgmt, len); cfg80211_send_rx_assoc(sdata->dev, (u8 *) mgmt, len, GFP_KERNEL);
} }
......
...@@ -1863,7 +1863,8 @@ static void ieee80211_rx_michael_mic_report(struct net_device *dev, ...@@ -1863,7 +1863,8 @@ static void ieee80211_rx_michael_mic_report(struct net_device *dev,
!ieee80211_is_auth(hdr->frame_control)) !ieee80211_is_auth(hdr->frame_control))
goto ignore; goto ignore;
mac80211_ev_michael_mic_failure(rx->sdata, keyidx, hdr, NULL); mac80211_ev_michael_mic_failure(rx->sdata, keyidx, hdr, NULL,
GFP_ATOMIC);
ignore: ignore:
dev_kfree_skb(rx->skb); dev_kfree_skb(rx->skb);
rx->skb = NULL; rx->skb = NULL;
......
...@@ -122,7 +122,8 @@ ieee80211_rx_h_michael_mic_verify(struct ieee80211_rx_data *rx) ...@@ -122,7 +122,8 @@ ieee80211_rx_h_michael_mic_verify(struct ieee80211_rx_data *rx)
return RX_DROP_UNUSABLE; return RX_DROP_UNUSABLE;
mac80211_ev_michael_mic_failure(rx->sdata, rx->key->conf.keyidx, mac80211_ev_michael_mic_failure(rx->sdata, rx->key->conf.keyidx,
(void *) skb->data, NULL); (void *) skb->data, NULL,
GFP_ATOMIC);
return RX_DROP_UNUSABLE; return RX_DROP_UNUSABLE;
} }
......
...@@ -12,35 +12,35 @@ ...@@ -12,35 +12,35 @@
#include "core.h" #include "core.h"
#include "nl80211.h" #include "nl80211.h"
void cfg80211_send_rx_auth(struct net_device *dev, const u8 *buf, size_t len) void cfg80211_send_rx_auth(struct net_device *dev, const u8 *buf, size_t len, gfp_t gfp)
{ {
struct wiphy *wiphy = dev->ieee80211_ptr->wiphy; struct wiphy *wiphy = dev->ieee80211_ptr->wiphy;
struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
nl80211_send_rx_auth(rdev, dev, buf, len); nl80211_send_rx_auth(rdev, dev, buf, len, gfp);
} }
EXPORT_SYMBOL(cfg80211_send_rx_auth); EXPORT_SYMBOL(cfg80211_send_rx_auth);
void cfg80211_send_rx_assoc(struct net_device *dev, const u8 *buf, size_t len) void cfg80211_send_rx_assoc(struct net_device *dev, const u8 *buf, size_t len, gfp_t gfp)
{ {
struct wiphy *wiphy = dev->ieee80211_ptr->wiphy; struct wiphy *wiphy = dev->ieee80211_ptr->wiphy;
struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
nl80211_send_rx_assoc(rdev, dev, buf, len); nl80211_send_rx_assoc(rdev, dev, buf, len, gfp);
} }
EXPORT_SYMBOL(cfg80211_send_rx_assoc); EXPORT_SYMBOL(cfg80211_send_rx_assoc);
void cfg80211_send_deauth(struct net_device *dev, const u8 *buf, size_t len) void cfg80211_send_deauth(struct net_device *dev, const u8 *buf, size_t len, gfp_t gfp)
{ {
struct wiphy *wiphy = dev->ieee80211_ptr->wiphy; struct wiphy *wiphy = dev->ieee80211_ptr->wiphy;
struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
nl80211_send_deauth(rdev, dev, buf, len); nl80211_send_deauth(rdev, dev, buf, len, gfp);
} }
EXPORT_SYMBOL(cfg80211_send_deauth); EXPORT_SYMBOL(cfg80211_send_deauth);
void cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, size_t len) void cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, size_t len, gfp_t gfp)
{ {
struct wiphy *wiphy = dev->ieee80211_ptr->wiphy; struct wiphy *wiphy = dev->ieee80211_ptr->wiphy;
struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
nl80211_send_disassoc(rdev, dev, buf, len); nl80211_send_disassoc(rdev, dev, buf, len, gfp);
} }
EXPORT_SYMBOL(cfg80211_send_disassoc); EXPORT_SYMBOL(cfg80211_send_disassoc);
...@@ -53,33 +53,33 @@ static void cfg80211_wext_disconnected(struct net_device *dev) ...@@ -53,33 +53,33 @@ static void cfg80211_wext_disconnected(struct net_device *dev)
#endif #endif
} }
void cfg80211_send_auth_timeout(struct net_device *dev, const u8 *addr) void cfg80211_send_auth_timeout(struct net_device *dev, const u8 *addr, gfp_t gfp)
{ {
struct wiphy *wiphy = dev->ieee80211_ptr->wiphy; struct wiphy *wiphy = dev->ieee80211_ptr->wiphy;
struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
nl80211_send_auth_timeout(rdev, dev, addr); nl80211_send_auth_timeout(rdev, dev, addr, gfp);
cfg80211_wext_disconnected(dev); cfg80211_wext_disconnected(dev);
} }
EXPORT_SYMBOL(cfg80211_send_auth_timeout); EXPORT_SYMBOL(cfg80211_send_auth_timeout);
void cfg80211_send_assoc_timeout(struct net_device *dev, const u8 *addr) void cfg80211_send_assoc_timeout(struct net_device *dev, const u8 *addr, gfp_t gfp)
{ {
struct wiphy *wiphy = dev->ieee80211_ptr->wiphy; struct wiphy *wiphy = dev->ieee80211_ptr->wiphy;
struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
nl80211_send_assoc_timeout(rdev, dev, addr); nl80211_send_assoc_timeout(rdev, dev, addr, gfp);
cfg80211_wext_disconnected(dev); cfg80211_wext_disconnected(dev);
} }
EXPORT_SYMBOL(cfg80211_send_assoc_timeout); EXPORT_SYMBOL(cfg80211_send_assoc_timeout);
void cfg80211_michael_mic_failure(struct net_device *dev, const u8 *addr, void cfg80211_michael_mic_failure(struct net_device *dev, const u8 *addr,
enum nl80211_key_type key_type, int key_id, enum nl80211_key_type key_type, int key_id,
const u8 *tsc) const u8 *tsc, gfp_t gfp)
{ {
struct wiphy *wiphy = dev->ieee80211_ptr->wiphy; struct wiphy *wiphy = dev->ieee80211_ptr->wiphy;
struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
#ifdef CONFIG_WIRELESS_EXT #ifdef CONFIG_WIRELESS_EXT
union iwreq_data wrqu; union iwreq_data wrqu;
char *buf = kmalloc(128, GFP_ATOMIC); char *buf = kmalloc(128, gfp);
if (buf) { if (buf) {
sprintf(buf, "MLME-MICHAELMICFAILURE.indication(" sprintf(buf, "MLME-MICHAELMICFAILURE.indication("
...@@ -93,6 +93,6 @@ void cfg80211_michael_mic_failure(struct net_device *dev, const u8 *addr, ...@@ -93,6 +93,6 @@ void cfg80211_michael_mic_failure(struct net_device *dev, const u8 *addr,
} }
#endif #endif
nl80211_michael_mic_failure(rdev, dev, addr, key_type, key_id, tsc); nl80211_michael_mic_failure(rdev, dev, addr, key_type, key_id, tsc, gfp);
} }
EXPORT_SYMBOL(cfg80211_michael_mic_failure); EXPORT_SYMBOL(cfg80211_michael_mic_failure);
...@@ -3832,12 +3832,12 @@ void nl80211_send_reg_change_event(struct regulatory_request *request) ...@@ -3832,12 +3832,12 @@ void nl80211_send_reg_change_event(struct regulatory_request *request)
static void nl80211_send_mlme_event(struct cfg80211_registered_device *rdev, static void nl80211_send_mlme_event(struct cfg80211_registered_device *rdev,
struct net_device *netdev, struct net_device *netdev,
const u8 *buf, size_t len, const u8 *buf, size_t len,
enum nl80211_commands cmd) enum nl80211_commands cmd, gfp_t gfp)
{ {
struct sk_buff *msg; struct sk_buff *msg;
void *hdr; void *hdr;
msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC); msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp);
if (!msg) if (!msg)
return; return;
...@@ -3856,7 +3856,7 @@ static void nl80211_send_mlme_event(struct cfg80211_registered_device *rdev, ...@@ -3856,7 +3856,7 @@ static void nl80211_send_mlme_event(struct cfg80211_registered_device *rdev,
return; return;
} }
genlmsg_multicast(msg, 0, nl80211_mlme_mcgrp.id, GFP_ATOMIC); genlmsg_multicast(msg, 0, nl80211_mlme_mcgrp.id, gfp);
return; return;
nla_put_failure: nla_put_failure:
...@@ -3865,42 +3865,45 @@ static void nl80211_send_mlme_event(struct cfg80211_registered_device *rdev, ...@@ -3865,42 +3865,45 @@ static void nl80211_send_mlme_event(struct cfg80211_registered_device *rdev,
} }
void nl80211_send_rx_auth(struct cfg80211_registered_device *rdev, void nl80211_send_rx_auth(struct cfg80211_registered_device *rdev,
struct net_device *netdev, const u8 *buf, size_t len) struct net_device *netdev, const u8 *buf,
size_t len, gfp_t gfp)
{ {
nl80211_send_mlme_event(rdev, netdev, buf, len, nl80211_send_mlme_event(rdev, netdev, buf, len,
NL80211_CMD_AUTHENTICATE); NL80211_CMD_AUTHENTICATE, gfp);
} }
void nl80211_send_rx_assoc(struct cfg80211_registered_device *rdev, void nl80211_send_rx_assoc(struct cfg80211_registered_device *rdev,
struct net_device *netdev, const u8 *buf, struct net_device *netdev, const u8 *buf,
size_t len) size_t len, gfp_t gfp)
{ {
nl80211_send_mlme_event(rdev, netdev, buf, len, NL80211_CMD_ASSOCIATE); nl80211_send_mlme_event(rdev, netdev, buf, len,
NL80211_CMD_ASSOCIATE, gfp);
} }
void nl80211_send_deauth(struct cfg80211_registered_device *rdev, void nl80211_send_deauth(struct cfg80211_registered_device *rdev,
struct net_device *netdev, const u8 *buf, size_t len) struct net_device *netdev, const u8 *buf,
size_t len, gfp_t gfp)
{ {
nl80211_send_mlme_event(rdev, netdev, buf, len, nl80211_send_mlme_event(rdev, netdev, buf, len,
NL80211_CMD_DEAUTHENTICATE); NL80211_CMD_DEAUTHENTICATE, gfp);
} }
void nl80211_send_disassoc(struct cfg80211_registered_device *rdev, void nl80211_send_disassoc(struct cfg80211_registered_device *rdev,
struct net_device *netdev, const u8 *buf, struct net_device *netdev, const u8 *buf,
size_t len) size_t len, gfp_t gfp)
{ {
nl80211_send_mlme_event(rdev, netdev, buf, len, nl80211_send_mlme_event(rdev, netdev, buf, len,
NL80211_CMD_DISASSOCIATE); NL80211_CMD_DISASSOCIATE, gfp);
} }
static void nl80211_send_mlme_timeout(struct cfg80211_registered_device *rdev, static void nl80211_send_mlme_timeout(struct cfg80211_registered_device *rdev,
struct net_device *netdev, int cmd, struct net_device *netdev, int cmd,
const u8 *addr) const u8 *addr, gfp_t gfp)
{ {
struct sk_buff *msg; struct sk_buff *msg;
void *hdr; void *hdr;
msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC); msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp);
if (!msg) if (!msg)
return; return;
...@@ -3920,7 +3923,7 @@ static void nl80211_send_mlme_timeout(struct cfg80211_registered_device *rdev, ...@@ -3920,7 +3923,7 @@ static void nl80211_send_mlme_timeout(struct cfg80211_registered_device *rdev,
return; return;
} }
genlmsg_multicast(msg, 0, nl80211_mlme_mcgrp.id, GFP_ATOMIC); genlmsg_multicast(msg, 0, nl80211_mlme_mcgrp.id, gfp);
return; return;
nla_put_failure: nla_put_failure:
...@@ -3929,16 +3932,19 @@ static void nl80211_send_mlme_timeout(struct cfg80211_registered_device *rdev, ...@@ -3929,16 +3932,19 @@ static void nl80211_send_mlme_timeout(struct cfg80211_registered_device *rdev,
} }
void nl80211_send_auth_timeout(struct cfg80211_registered_device *rdev, void nl80211_send_auth_timeout(struct cfg80211_registered_device *rdev,
struct net_device *netdev, const u8 *addr) struct net_device *netdev, const u8 *addr,
gfp_t gfp)
{ {
nl80211_send_mlme_timeout(rdev, netdev, NL80211_CMD_AUTHENTICATE, nl80211_send_mlme_timeout(rdev, netdev, NL80211_CMD_AUTHENTICATE,
addr); addr, gfp);
} }
void nl80211_send_assoc_timeout(struct cfg80211_registered_device *rdev, void nl80211_send_assoc_timeout(struct cfg80211_registered_device *rdev,
struct net_device *netdev, const u8 *addr) struct net_device *netdev, const u8 *addr,
gfp_t gfp)
{ {
nl80211_send_mlme_timeout(rdev, netdev, NL80211_CMD_ASSOCIATE, addr); nl80211_send_mlme_timeout(rdev, netdev, NL80211_CMD_ASSOCIATE,
addr, gfp);
} }
void nl80211_send_ibss_bssid(struct cfg80211_registered_device *rdev, void nl80211_send_ibss_bssid(struct cfg80211_registered_device *rdev,
...@@ -3978,12 +3984,12 @@ void nl80211_send_ibss_bssid(struct cfg80211_registered_device *rdev, ...@@ -3978,12 +3984,12 @@ void nl80211_send_ibss_bssid(struct cfg80211_registered_device *rdev,
void nl80211_michael_mic_failure(struct cfg80211_registered_device *rdev, void nl80211_michael_mic_failure(struct cfg80211_registered_device *rdev,
struct net_device *netdev, const u8 *addr, struct net_device *netdev, const u8 *addr,
enum nl80211_key_type key_type, int key_id, enum nl80211_key_type key_type, int key_id,
const u8 *tsc) const u8 *tsc, gfp_t gfp)
{ {
struct sk_buff *msg; struct sk_buff *msg;
void *hdr; void *hdr;
msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC); msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp);
if (!msg) if (!msg)
return; return;
...@@ -4007,7 +4013,7 @@ void nl80211_michael_mic_failure(struct cfg80211_registered_device *rdev, ...@@ -4007,7 +4013,7 @@ void nl80211_michael_mic_failure(struct cfg80211_registered_device *rdev,
return; return;
} }
genlmsg_multicast(msg, 0, nl80211_mlme_mcgrp.id, GFP_ATOMIC); genlmsg_multicast(msg, 0, nl80211_mlme_mcgrp.id, gfp);
return; return;
nla_put_failure: nla_put_failure:
......
...@@ -15,27 +15,27 @@ void nl80211_send_scan_aborted(struct cfg80211_registered_device *rdev, ...@@ -15,27 +15,27 @@ void nl80211_send_scan_aborted(struct cfg80211_registered_device *rdev,
void nl80211_send_reg_change_event(struct regulatory_request *request); void nl80211_send_reg_change_event(struct regulatory_request *request);
void nl80211_send_rx_auth(struct cfg80211_registered_device *rdev, void nl80211_send_rx_auth(struct cfg80211_registered_device *rdev,
struct net_device *netdev, struct net_device *netdev,
const u8 *buf, size_t len); const u8 *buf, size_t len, gfp_t gfp);
void nl80211_send_rx_assoc(struct cfg80211_registered_device *rdev, void nl80211_send_rx_assoc(struct cfg80211_registered_device *rdev,
struct net_device *netdev, struct net_device *netdev,
const u8 *buf, size_t len); const u8 *buf, size_t len, gfp_t gfp);
void nl80211_send_deauth(struct cfg80211_registered_device *rdev, void nl80211_send_deauth(struct cfg80211_registered_device *rdev,
struct net_device *netdev, struct net_device *netdev,
const u8 *buf, size_t len); const u8 *buf, size_t len, gfp_t gfp);
void nl80211_send_disassoc(struct cfg80211_registered_device *rdev, void nl80211_send_disassoc(struct cfg80211_registered_device *rdev,
struct net_device *netdev, struct net_device *netdev,
const u8 *buf, size_t len); const u8 *buf, size_t len, gfp_t gfp);
void nl80211_send_auth_timeout(struct cfg80211_registered_device *rdev, void nl80211_send_auth_timeout(struct cfg80211_registered_device *rdev,
struct net_device *netdev, struct net_device *netdev,
const u8 *addr); const u8 *addr, gfp_t gfp);
void nl80211_send_assoc_timeout(struct cfg80211_registered_device *rdev, void nl80211_send_assoc_timeout(struct cfg80211_registered_device *rdev,
struct net_device *netdev, struct net_device *netdev,
const u8 *addr); const u8 *addr, gfp_t gfp);
void void
nl80211_michael_mic_failure(struct cfg80211_registered_device *rdev, nl80211_michael_mic_failure(struct cfg80211_registered_device *rdev,
struct net_device *netdev, const u8 *addr, struct net_device *netdev, const u8 *addr,
enum nl80211_key_type key_type, enum nl80211_key_type key_type,
int key_id, const u8 *tsc); int key_id, const u8 *tsc, gfp_t gfp);
void void
nl80211_send_beacon_hint_event(struct wiphy *wiphy, nl80211_send_beacon_hint_event(struct wiphy *wiphy,
......
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