Commit e6d6e3420d511cd7552a95d1f04bd4c80a9ddb34

Authored by Johannes Berg
Committed by John W. Linville
1 parent dad8233021

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>

Showing 9 changed files with 91 additions and 66 deletions Side-by-side Diff

include/net/cfg80211.h
... ... @@ -1572,64 +1572,70 @@
1572 1572 * @dev: network device
1573 1573 * @buf: authentication frame (header + body)
1574 1574 * @len: length of the frame data
  1575 + * @gfp: allocation flags
1575 1576 *
1576 1577 * This function is called whenever an authentication has been processed in
1577 1578 * station mode. The driver is required to call either this function or
1578 1579 * cfg80211_send_auth_timeout() to indicate the result of cfg80211_ops::auth()
1579 1580 * call.
1580 1581 */
1581   -void cfg80211_send_rx_auth(struct net_device *dev, const u8 *buf, size_t len);
  1582 +void cfg80211_send_rx_auth(struct net_device *dev, const u8 *buf, size_t len, gfp_t gfp);
1582 1583  
1583 1584 /**
1584 1585 * cfg80211_send_auth_timeout - notification of timed out authentication
1585 1586 * @dev: network device
1586 1587 * @addr: The MAC address of the device with which the authentication timed out
  1588 + * @gfp: allocation flags
1587 1589 */
1588   -void cfg80211_send_auth_timeout(struct net_device *dev, const u8 *addr);
  1590 +void cfg80211_send_auth_timeout(struct net_device *dev, const u8 *addr, gfp_t gfp);
1589 1591  
1590 1592 /**
1591 1593 * cfg80211_send_rx_assoc - notification of processed association
1592 1594 * @dev: network device
1593 1595 * @buf: (re)association response frame (header + body)
1594 1596 * @len: length of the frame data
  1597 + * @gfp: allocation flags
1595 1598 *
1596 1599 * This function is called whenever a (re)association response has been
1597 1600 * processed in station mode. The driver is required to call either this
1598 1601 * function or cfg80211_send_assoc_timeout() to indicate the result of
1599 1602 * cfg80211_ops::assoc() call.
1600 1603 */
1601   -void cfg80211_send_rx_assoc(struct net_device *dev, const u8 *buf, size_t len);
  1604 +void cfg80211_send_rx_assoc(struct net_device *dev, const u8 *buf, size_t len, gfp_t gfp);
1602 1605  
1603 1606 /**
1604 1607 * cfg80211_send_assoc_timeout - notification of timed out association
1605 1608 * @dev: network device
1606 1609 * @addr: The MAC address of the device with which the association timed out
  1610 + * @gfp: allocation flags
1607 1611 */
1608   -void cfg80211_send_assoc_timeout(struct net_device *dev, const u8 *addr);
  1612 +void cfg80211_send_assoc_timeout(struct net_device *dev, const u8 *addr, gfp_t gfp);
1609 1613  
1610 1614 /**
1611 1615 * cfg80211_send_deauth - notification of processed deauthentication
1612 1616 * @dev: network device
1613 1617 * @buf: deauthentication frame (header + body)
1614 1618 * @len: length of the frame data
  1619 + * @gfp: allocation flags
1615 1620 *
1616 1621 * This function is called whenever deauthentication has been processed in
1617 1622 * station mode. This includes both received deauthentication frames and
1618 1623 * locally generated ones.
1619 1624 */
1620   -void cfg80211_send_deauth(struct net_device *dev, const u8 *buf, size_t len);
  1625 +void cfg80211_send_deauth(struct net_device *dev, const u8 *buf, size_t len, gfp_t gfp);
1621 1626  
1622 1627 /**
1623 1628 * cfg80211_send_disassoc - notification of processed disassociation
1624 1629 * @dev: network device
1625 1630 * @buf: disassociation response frame (header + body)
1626 1631 * @len: length of the frame data
  1632 + * @gfp: allocation flags
1627 1633 *
1628 1634 * This function is called whenever disassociation has been processed in
1629 1635 * station mode. This includes both received disassociation frames and locally
1630 1636 * generated ones.
1631 1637 */
1632   -void cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, size_t len);
  1638 +void cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, size_t len, gfp_t gfp);
1633 1639  
1634 1640 /**
1635 1641 * cfg80211_hold_bss - exclude bss from expiration
... ... @@ -1655,6 +1661,7 @@
1655 1661 * @key_type: The key type that the received frame used
1656 1662 * @key_id: Key identifier (0..3)
1657 1663 * @tsc: The TSC value of the frame that generated the MIC failure (6 octets)
  1664 + * @gfp: allocation flags
1658 1665 *
1659 1666 * This function is called whenever the local MAC detects a MIC failure in a
1660 1667 * received frame. This matches with MLME-MICHAELMICFAILURE.indication()
... ... @@ -1662,7 +1669,7 @@
1662 1669 */
1663 1670 void cfg80211_michael_mic_failure(struct net_device *dev, const u8 *addr,
1664 1671 enum nl80211_key_type key_type, int key_id,
1665   - const u8 *tsc);
  1672 + const u8 *tsc, gfp_t gfp);
1666 1673  
1667 1674 /**
1668 1675 * cfg80211_ibss_joined - notify cfg80211 that device joined an IBSS
net/mac80211/event.c
... ... @@ -16,12 +16,13 @@
16 16 * driver or is still in the frame), it should provide that information.
17 17 */
18 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 22 cfg80211_michael_mic_failure(sdata->dev, hdr->addr2,
22 23 (hdr->addr1[0] & 0x01) ?
23 24 NL80211_KEYTYPE_GROUP :
24 25 NL80211_KEYTYPE_PAIRWISE,
25   - keyidx, tsc);
  26 + keyidx, tsc, gfp);
26 27 }
net/mac80211/ieee80211_i.h
... ... @@ -1088,7 +1088,8 @@
1088 1088 int ieee80211_frame_duration(struct ieee80211_local *local, size_t len,
1089 1089 int rate, int erp, int short_preamble);
1090 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 1093 void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata);
1093 1094 void ieee80211_tx_skb(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb,
1094 1095 int encrypt);
... ... @@ -419,9 +419,11 @@
419 419 mgmt->u.deauth.reason_code = cpu_to_le16(reason);
420 420  
421 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 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 427 ieee80211_tx_skb(sdata, skb, ifmgd->flags & IEEE80211_STA_MFP_ENABLED);
426 428 }
427 429  
... ... @@ -1006,7 +1008,8 @@
1006 1008 sdata->dev->name, ifmgd->bssid);
1007 1009 ifmgd->state = IEEE80211_STA_MLME_DISABLED;
1008 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 1015 * Most likely AP is not in the range so remove the
... ... @@ -1055,7 +1058,8 @@
1055 1058 sdata->dev->name, ifmgd->bssid);
1056 1059 ifmgd->state = IEEE80211_STA_MLME_DISABLED;
1057 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 1063 ieee80211_rx_bss_remove(sdata, ifmgd->bssid,
1060 1064 sdata->local->hw.conf.channel->center_freq,
1061 1065 ifmgd->ssid, ifmgd->ssid_len);
... ... @@ -1243,7 +1247,8 @@
1243 1247 sdata->dev->name, ifmgd->bssid);
1244 1248 ifmgd->state = IEEE80211_STA_MLME_DISABLED;
1245 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 1252 ieee80211_rx_bss_remove(sdata, ifmgd->bssid,
1248 1253 sdata->local->hw.conf.channel->center_freq,
1249 1254 ifmgd->ssid, ifmgd->ssid_len);
1250 1255  
... ... @@ -1517,12 +1522,14 @@
1517 1522 case WLAN_AUTH_LEAP:
1518 1523 case WLAN_AUTH_FT:
1519 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 1527 break;
1522 1528 case WLAN_AUTH_SHARED_KEY:
1523 1529 if (ifmgd->auth_transaction == 4) {
1524 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 1533 } else
1527 1534 ieee80211_auth_challenge(sdata, mgmt, len);
1528 1535 break;
... ... @@ -1560,7 +1567,7 @@
1560 1567  
1561 1568 ieee80211_set_disassoc(sdata, true, false, 0);
1562 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 @@
1591 1598 }
1592 1599  
1593 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 @@
1660 1667 * association next time. This works around some broken APs
1661 1668 * which do not correctly reject reassociation requests. */
1662 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 1672 if (ifmgd->flags & IEEE80211_STA_EXT_SME) {
1665 1673 /* Wait for SME to decide what to do next */
1666 1674 ifmgd->state = IEEE80211_STA_MLME_DISABLED;
... ... @@ -1823,7 +1831,7 @@
1823 1831 ifmgd->last_beacon = jiffies;
1824 1832  
1825 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  
... ... @@ -1863,7 +1863,8 @@
1863 1863 !ieee80211_is_auth(hdr->frame_control))
1864 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 1868 ignore:
1868 1869 dev_kfree_skb(rx->skb);
1869 1870 rx->skb = NULL;
... ... @@ -122,7 +122,8 @@
122 122 return RX_DROP_UNUSABLE;
123 123  
124 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 127 return RX_DROP_UNUSABLE;
127 128 }
128 129  
... ... @@ -12,35 +12,35 @@
12 12 #include "core.h"
13 13 #include "nl80211.h"
14 14  
15   -void cfg80211_send_rx_auth(struct net_device *dev, const u8 *buf, size_t len)
  15 +void cfg80211_send_rx_auth(struct net_device *dev, const u8 *buf, size_t len, gfp_t gfp)
16 16 {
17 17 struct wiphy *wiphy = dev->ieee80211_ptr->wiphy;
18 18 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
19   - nl80211_send_rx_auth(rdev, dev, buf, len);
  19 + nl80211_send_rx_auth(rdev, dev, buf, len, gfp);
20 20 }
21 21 EXPORT_SYMBOL(cfg80211_send_rx_auth);
22 22  
23   -void cfg80211_send_rx_assoc(struct net_device *dev, const u8 *buf, size_t len)
  23 +void cfg80211_send_rx_assoc(struct net_device *dev, const u8 *buf, size_t len, gfp_t gfp)
24 24 {
25 25 struct wiphy *wiphy = dev->ieee80211_ptr->wiphy;
26 26 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
27   - nl80211_send_rx_assoc(rdev, dev, buf, len);
  27 + nl80211_send_rx_assoc(rdev, dev, buf, len, gfp);
28 28 }
29 29 EXPORT_SYMBOL(cfg80211_send_rx_assoc);
30 30  
31   -void cfg80211_send_deauth(struct net_device *dev, const u8 *buf, size_t len)
  31 +void cfg80211_send_deauth(struct net_device *dev, const u8 *buf, size_t len, gfp_t gfp)
32 32 {
33 33 struct wiphy *wiphy = dev->ieee80211_ptr->wiphy;
34 34 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
35   - nl80211_send_deauth(rdev, dev, buf, len);
  35 + nl80211_send_deauth(rdev, dev, buf, len, gfp);
36 36 }
37 37 EXPORT_SYMBOL(cfg80211_send_deauth);
38 38  
39   -void cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, size_t len)
  39 +void cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, size_t len, gfp_t gfp)
40 40 {
41 41 struct wiphy *wiphy = dev->ieee80211_ptr->wiphy;
42 42 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
43   - nl80211_send_disassoc(rdev, dev, buf, len);
  43 + nl80211_send_disassoc(rdev, dev, buf, len, gfp);
44 44 }
45 45 EXPORT_SYMBOL(cfg80211_send_disassoc);
46 46  
47 47  
48 48  
49 49  
50 50  
51 51  
... ... @@ -53,33 +53,33 @@
53 53 #endif
54 54 }
55 55  
56   -void cfg80211_send_auth_timeout(struct net_device *dev, const u8 *addr)
  56 +void cfg80211_send_auth_timeout(struct net_device *dev, const u8 *addr, gfp_t gfp)
57 57 {
58 58 struct wiphy *wiphy = dev->ieee80211_ptr->wiphy;
59 59 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
60   - nl80211_send_auth_timeout(rdev, dev, addr);
  60 + nl80211_send_auth_timeout(rdev, dev, addr, gfp);
61 61 cfg80211_wext_disconnected(dev);
62 62 }
63 63 EXPORT_SYMBOL(cfg80211_send_auth_timeout);
64 64  
65   -void cfg80211_send_assoc_timeout(struct net_device *dev, const u8 *addr)
  65 +void cfg80211_send_assoc_timeout(struct net_device *dev, const u8 *addr, gfp_t gfp)
66 66 {
67 67 struct wiphy *wiphy = dev->ieee80211_ptr->wiphy;
68 68 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
69   - nl80211_send_assoc_timeout(rdev, dev, addr);
  69 + nl80211_send_assoc_timeout(rdev, dev, addr, gfp);
70 70 cfg80211_wext_disconnected(dev);
71 71 }
72 72 EXPORT_SYMBOL(cfg80211_send_assoc_timeout);
73 73  
74 74 void cfg80211_michael_mic_failure(struct net_device *dev, const u8 *addr,
75 75 enum nl80211_key_type key_type, int key_id,
76   - const u8 *tsc)
  76 + const u8 *tsc, gfp_t gfp)
77 77 {
78 78 struct wiphy *wiphy = dev->ieee80211_ptr->wiphy;
79 79 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
80 80 #ifdef CONFIG_WIRELESS_EXT
81 81 union iwreq_data wrqu;
82   - char *buf = kmalloc(128, GFP_ATOMIC);
  82 + char *buf = kmalloc(128, gfp);
83 83  
84 84 if (buf) {
85 85 sprintf(buf, "MLME-MICHAELMICFAILURE.indication("
... ... @@ -93,7 +93,7 @@
93 93 }
94 94 #endif
95 95  
96   - nl80211_michael_mic_failure(rdev, dev, addr, key_type, key_id, tsc);
  96 + nl80211_michael_mic_failure(rdev, dev, addr, key_type, key_id, tsc, gfp);
97 97 }
98 98 EXPORT_SYMBOL(cfg80211_michael_mic_failure);
net/wireless/nl80211.c
... ... @@ -3832,12 +3832,12 @@
3832 3832 static void nl80211_send_mlme_event(struct cfg80211_registered_device *rdev,
3833 3833 struct net_device *netdev,
3834 3834 const u8 *buf, size_t len,
3835   - enum nl80211_commands cmd)
  3835 + enum nl80211_commands cmd, gfp_t gfp)
3836 3836 {
3837 3837 struct sk_buff *msg;
3838 3838 void *hdr;
3839 3839  
3840   - msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC);
  3840 + msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp);
3841 3841 if (!msg)
3842 3842 return;
3843 3843  
... ... @@ -3856,7 +3856,7 @@
3856 3856 return;
3857 3857 }
3858 3858  
3859   - genlmsg_multicast(msg, 0, nl80211_mlme_mcgrp.id, GFP_ATOMIC);
  3859 + genlmsg_multicast(msg, 0, nl80211_mlme_mcgrp.id, gfp);
3860 3860 return;
3861 3861  
3862 3862 nla_put_failure:
3863 3863  
3864 3864  
3865 3865  
3866 3866  
3867 3867  
3868 3868  
3869 3869  
3870 3870  
3871 3871  
... ... @@ -3865,42 +3865,45 @@
3865 3865 }
3866 3866  
3867 3867 void nl80211_send_rx_auth(struct cfg80211_registered_device *rdev,
3868   - struct net_device *netdev, const u8 *buf, size_t len)
  3868 + struct net_device *netdev, const u8 *buf,
  3869 + size_t len, gfp_t gfp)
3869 3870 {
3870 3871 nl80211_send_mlme_event(rdev, netdev, buf, len,
3871   - NL80211_CMD_AUTHENTICATE);
  3872 + NL80211_CMD_AUTHENTICATE, gfp);
3872 3873 }
3873 3874  
3874 3875 void nl80211_send_rx_assoc(struct cfg80211_registered_device *rdev,
3875 3876 struct net_device *netdev, const u8 *buf,
3876   - size_t len)
  3877 + size_t len, gfp_t gfp)
3877 3878 {
3878   - nl80211_send_mlme_event(rdev, netdev, buf, len, NL80211_CMD_ASSOCIATE);
  3879 + nl80211_send_mlme_event(rdev, netdev, buf, len,
  3880 + NL80211_CMD_ASSOCIATE, gfp);
3879 3881 }
3880 3882  
3881 3883 void nl80211_send_deauth(struct cfg80211_registered_device *rdev,
3882   - struct net_device *netdev, const u8 *buf, size_t len)
  3884 + struct net_device *netdev, const u8 *buf,
  3885 + size_t len, gfp_t gfp)
3883 3886 {
3884 3887 nl80211_send_mlme_event(rdev, netdev, buf, len,
3885   - NL80211_CMD_DEAUTHENTICATE);
  3888 + NL80211_CMD_DEAUTHENTICATE, gfp);
3886 3889 }
3887 3890  
3888 3891 void nl80211_send_disassoc(struct cfg80211_registered_device *rdev,
3889 3892 struct net_device *netdev, const u8 *buf,
3890   - size_t len)
  3893 + size_t len, gfp_t gfp)
3891 3894 {
3892 3895 nl80211_send_mlme_event(rdev, netdev, buf, len,
3893   - NL80211_CMD_DISASSOCIATE);
  3896 + NL80211_CMD_DISASSOCIATE, gfp);
3894 3897 }
3895 3898  
3896 3899 static void nl80211_send_mlme_timeout(struct cfg80211_registered_device *rdev,
3897 3900 struct net_device *netdev, int cmd,
3898   - const u8 *addr)
  3901 + const u8 *addr, gfp_t gfp)
3899 3902 {
3900 3903 struct sk_buff *msg;
3901 3904 void *hdr;
3902 3905  
3903   - msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC);
  3906 + msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp);
3904 3907 if (!msg)
3905 3908 return;
3906 3909  
... ... @@ -3920,7 +3923,7 @@
3920 3923 return;
3921 3924 }
3922 3925  
3923   - genlmsg_multicast(msg, 0, nl80211_mlme_mcgrp.id, GFP_ATOMIC);
  3926 + genlmsg_multicast(msg, 0, nl80211_mlme_mcgrp.id, gfp);
3924 3927 return;
3925 3928  
3926 3929 nla_put_failure:
3927 3930  
3928 3931  
3929 3932  
... ... @@ -3929,16 +3932,19 @@
3929 3932 }
3930 3933  
3931 3934 void nl80211_send_auth_timeout(struct cfg80211_registered_device *rdev,
3932   - struct net_device *netdev, const u8 *addr)
  3935 + struct net_device *netdev, const u8 *addr,
  3936 + gfp_t gfp)
3933 3937 {
3934 3938 nl80211_send_mlme_timeout(rdev, netdev, NL80211_CMD_AUTHENTICATE,
3935   - addr);
  3939 + addr, gfp);
3936 3940 }
3937 3941  
3938 3942 void nl80211_send_assoc_timeout(struct cfg80211_registered_device *rdev,
3939   - struct net_device *netdev, const u8 *addr)
  3943 + struct net_device *netdev, const u8 *addr,
  3944 + gfp_t gfp)
3940 3945 {
3941   - nl80211_send_mlme_timeout(rdev, netdev, NL80211_CMD_ASSOCIATE, addr);
  3946 + nl80211_send_mlme_timeout(rdev, netdev, NL80211_CMD_ASSOCIATE,
  3947 + addr, gfp);
3942 3948 }
3943 3949  
3944 3950 void nl80211_send_ibss_bssid(struct cfg80211_registered_device *rdev,
3945 3951  
... ... @@ -3978,12 +3984,12 @@
3978 3984 void nl80211_michael_mic_failure(struct cfg80211_registered_device *rdev,
3979 3985 struct net_device *netdev, const u8 *addr,
3980 3986 enum nl80211_key_type key_type, int key_id,
3981   - const u8 *tsc)
  3987 + const u8 *tsc, gfp_t gfp)
3982 3988 {
3983 3989 struct sk_buff *msg;
3984 3990 void *hdr;
3985 3991  
3986   - msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC);
  3992 + msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp);
3987 3993 if (!msg)
3988 3994 return;
3989 3995  
... ... @@ -4007,7 +4013,7 @@
4007 4013 return;
4008 4014 }
4009 4015  
4010   - genlmsg_multicast(msg, 0, nl80211_mlme_mcgrp.id, GFP_ATOMIC);
  4016 + genlmsg_multicast(msg, 0, nl80211_mlme_mcgrp.id, gfp);
4011 4017 return;
4012 4018  
4013 4019 nla_put_failure:
net/wireless/nl80211.h
... ... @@ -15,27 +15,27 @@
15 15 void nl80211_send_reg_change_event(struct regulatory_request *request);
16 16 void nl80211_send_rx_auth(struct cfg80211_registered_device *rdev,
17 17 struct net_device *netdev,
18   - const u8 *buf, size_t len);
  18 + const u8 *buf, size_t len, gfp_t gfp);
19 19 void nl80211_send_rx_assoc(struct cfg80211_registered_device *rdev,
20 20 struct net_device *netdev,
21   - const u8 *buf, size_t len);
  21 + const u8 *buf, size_t len, gfp_t gfp);
22 22 void nl80211_send_deauth(struct cfg80211_registered_device *rdev,
23 23 struct net_device *netdev,
24   - const u8 *buf, size_t len);
  24 + const u8 *buf, size_t len, gfp_t gfp);
25 25 void nl80211_send_disassoc(struct cfg80211_registered_device *rdev,
26 26 struct net_device *netdev,
27   - const u8 *buf, size_t len);
  27 + const u8 *buf, size_t len, gfp_t gfp);
28 28 void nl80211_send_auth_timeout(struct cfg80211_registered_device *rdev,
29 29 struct net_device *netdev,
30   - const u8 *addr);
  30 + const u8 *addr, gfp_t gfp);
31 31 void nl80211_send_assoc_timeout(struct cfg80211_registered_device *rdev,
32 32 struct net_device *netdev,
33   - const u8 *addr);
  33 + const u8 *addr, gfp_t gfp);
34 34 void
35 35 nl80211_michael_mic_failure(struct cfg80211_registered_device *rdev,
36 36 struct net_device *netdev, const u8 *addr,
37 37 enum nl80211_key_type key_type,
38   - int key_id, const u8 *tsc);
  38 + int key_id, const u8 *tsc, gfp_t gfp);
39 39  
40 40 void
41 41 nl80211_send_beacon_hint_event(struct wiphy *wiphy,