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

cfg80211: remove cookies from callbacks

In "cfg80211: no cookies in cfg80211_send_XXX()"
Holger Schurig removed the cookies in the calls
from mac80211 to cfg80211, but the ones in the
other direction were left in. Remove them now.
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 4d94c157
...@@ -1587,11 +1587,9 @@ struct cfg80211_ops { ...@@ -1587,11 +1587,9 @@ struct cfg80211_ops {
int (*assoc)(struct wiphy *wiphy, struct net_device *dev, int (*assoc)(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_assoc_request *req); struct cfg80211_assoc_request *req);
int (*deauth)(struct wiphy *wiphy, struct net_device *dev, int (*deauth)(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_deauth_request *req, struct cfg80211_deauth_request *req);
void *cookie);
int (*disassoc)(struct wiphy *wiphy, struct net_device *dev, int (*disassoc)(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_disassoc_request *req, struct cfg80211_disassoc_request *req);
void *cookie);
int (*connect)(struct wiphy *wiphy, struct net_device *dev, int (*connect)(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_connect_params *sme); struct cfg80211_connect_params *sme);
......
...@@ -1595,19 +1595,15 @@ static int ieee80211_assoc(struct wiphy *wiphy, struct net_device *dev, ...@@ -1595,19 +1595,15 @@ static int ieee80211_assoc(struct wiphy *wiphy, struct net_device *dev,
} }
static int ieee80211_deauth(struct wiphy *wiphy, struct net_device *dev, static int ieee80211_deauth(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_deauth_request *req, struct cfg80211_deauth_request *req)
void *cookie)
{ {
return ieee80211_mgd_deauth(IEEE80211_DEV_TO_SUB_IF(dev), return ieee80211_mgd_deauth(IEEE80211_DEV_TO_SUB_IF(dev), req);
req, cookie);
} }
static int ieee80211_disassoc(struct wiphy *wiphy, struct net_device *dev, static int ieee80211_disassoc(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_disassoc_request *req, struct cfg80211_disassoc_request *req)
void *cookie)
{ {
return ieee80211_mgd_disassoc(IEEE80211_DEV_TO_SUB_IF(dev), return ieee80211_mgd_disassoc(IEEE80211_DEV_TO_SUB_IF(dev), req);
req, cookie);
} }
static int ieee80211_join_ibss(struct wiphy *wiphy, struct net_device *dev, static int ieee80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
......
...@@ -1150,11 +1150,9 @@ int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata, ...@@ -1150,11 +1150,9 @@ int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata,
int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata, int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,
struct cfg80211_assoc_request *req); struct cfg80211_assoc_request *req);
int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata, int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata,
struct cfg80211_deauth_request *req, struct cfg80211_deauth_request *req);
void *cookie);
int ieee80211_mgd_disassoc(struct ieee80211_sub_if_data *sdata, int ieee80211_mgd_disassoc(struct ieee80211_sub_if_data *sdata,
struct cfg80211_disassoc_request *req, struct cfg80211_disassoc_request *req);
void *cookie);
void ieee80211_send_pspoll(struct ieee80211_local *local, void ieee80211_send_pspoll(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata); struct ieee80211_sub_if_data *sdata);
void ieee80211_recalc_ps(struct ieee80211_local *local, s32 latency); void ieee80211_recalc_ps(struct ieee80211_local *local, s32 latency);
......
...@@ -612,8 +612,9 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata) ...@@ -612,8 +612,9 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata)
} }
static void ieee80211_send_deauth_disassoc(struct ieee80211_sub_if_data *sdata, static void ieee80211_send_deauth_disassoc(struct ieee80211_sub_if_data *sdata,
const u8 *bssid, u16 stype, u16 reason, const u8 *bssid, u16 stype,
void *cookie, bool send_frame) u16 reason, bool cfg80211_locked,
bool send_frame)
{ {
struct ieee80211_local *local = sdata->local; struct ieee80211_local *local = sdata->local;
struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
...@@ -637,12 +638,12 @@ static void ieee80211_send_deauth_disassoc(struct ieee80211_sub_if_data *sdata, ...@@ -637,12 +638,12 @@ 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)
if (cookie) if (cfg80211_locked)
__cfg80211_send_deauth(sdata->dev, (u8 *)mgmt, skb->len); __cfg80211_send_deauth(sdata->dev, (u8 *)mgmt, skb->len);
else else
cfg80211_send_deauth(sdata->dev, (u8 *)mgmt, skb->len); cfg80211_send_deauth(sdata->dev, (u8 *)mgmt, skb->len);
else else
if (cookie) if (cfg80211_locked)
__cfg80211_send_disassoc(sdata->dev, (u8 *)mgmt, skb->len); __cfg80211_send_disassoc(sdata->dev, (u8 *)mgmt, skb->len);
else else
cfg80211_send_disassoc(sdata->dev, (u8 *)mgmt, skb->len); cfg80211_send_disassoc(sdata->dev, (u8 *)mgmt, skb->len);
...@@ -1696,7 +1697,7 @@ static void __ieee80211_connection_loss(struct ieee80211_sub_if_data *sdata) ...@@ -1696,7 +1697,7 @@ static void __ieee80211_connection_loss(struct ieee80211_sub_if_data *sdata)
ieee80211_send_deauth_disassoc(sdata, bssid, ieee80211_send_deauth_disassoc(sdata, bssid,
IEEE80211_STYPE_DEAUTH, IEEE80211_STYPE_DEAUTH,
WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY, WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY,
NULL, true); false, true);
mutex_lock(&local->mtx); mutex_lock(&local->mtx);
ieee80211_recalc_idle(local); ieee80211_recalc_idle(local);
...@@ -2706,8 +2707,8 @@ static void ieee80211_sta_connection_lost(struct ieee80211_sub_if_data *sdata, ...@@ -2706,8 +2707,8 @@ static void ieee80211_sta_connection_lost(struct ieee80211_sub_if_data *sdata,
* but that's not a problem. * but that's not a problem.
*/ */
ieee80211_send_deauth_disassoc(sdata, bssid, ieee80211_send_deauth_disassoc(sdata, bssid,
IEEE80211_STYPE_DEAUTH, reason, IEEE80211_STYPE_DEAUTH,
NULL, true); reason, false, true);
mutex_lock(&local->mtx); mutex_lock(&local->mtx);
ieee80211_recalc_idle(local); ieee80211_recalc_idle(local);
...@@ -3439,8 +3440,7 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata, ...@@ -3439,8 +3440,7 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,
} }
int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata, int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata,
struct cfg80211_deauth_request *req, struct cfg80211_deauth_request *req)
void *cookie)
{ {
struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
bool assoc_bss = false; bool assoc_bss = false;
...@@ -3461,8 +3461,9 @@ int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata, ...@@ -3461,8 +3461,9 @@ int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata,
printk(KERN_DEBUG "%s: deauthenticating from %pM by local choice (reason=%d)\n", printk(KERN_DEBUG "%s: deauthenticating from %pM by local choice (reason=%d)\n",
sdata->name, req->bssid, req->reason_code); sdata->name, req->bssid, req->reason_code);
ieee80211_send_deauth_disassoc(sdata, req->bssid, IEEE80211_STYPE_DEAUTH, ieee80211_send_deauth_disassoc(sdata, req->bssid,
req->reason_code, cookie, true); IEEE80211_STYPE_DEAUTH,
req->reason_code, true, true);
if (assoc_bss) if (assoc_bss)
sta_info_flush(sdata->local, sdata); sta_info_flush(sdata->local, sdata);
...@@ -3474,8 +3475,7 @@ int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata, ...@@ -3474,8 +3475,7 @@ int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata,
} }
int ieee80211_mgd_disassoc(struct ieee80211_sub_if_data *sdata, int ieee80211_mgd_disassoc(struct ieee80211_sub_if_data *sdata,
struct cfg80211_disassoc_request *req, struct cfg80211_disassoc_request *req)
void *cookie)
{ {
struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
u8 bssid[ETH_ALEN]; u8 bssid[ETH_ALEN];
...@@ -3503,7 +3503,7 @@ int ieee80211_mgd_disassoc(struct ieee80211_sub_if_data *sdata, ...@@ -3503,7 +3503,7 @@ int ieee80211_mgd_disassoc(struct ieee80211_sub_if_data *sdata,
ieee80211_send_deauth_disassoc(sdata, req->bss->bssid, ieee80211_send_deauth_disassoc(sdata, req->bss->bssid,
IEEE80211_STYPE_DISASSOC, req->reason_code, IEEE80211_STYPE_DISASSOC, req->reason_code,
cookie, !req->local_state_change); true, !req->local_state_change);
sta_info_flush(sdata->local, sdata); sta_info_flush(sdata->local, sdata);
mutex_lock(&sdata->local->mtx); mutex_lock(&sdata->local->mtx);
......
...@@ -455,7 +455,7 @@ int __cfg80211_mlme_deauth(struct cfg80211_registered_device *rdev, ...@@ -455,7 +455,7 @@ int __cfg80211_mlme_deauth(struct cfg80211_registered_device *rdev,
return 0; return 0;
} }
return rdev->ops->deauth(&rdev->wiphy, dev, &req, wdev); return rdev->ops->deauth(&rdev->wiphy, dev, &req);
} }
int cfg80211_mlme_deauth(struct cfg80211_registered_device *rdev, int cfg80211_mlme_deauth(struct cfg80211_registered_device *rdev,
...@@ -500,7 +500,7 @@ static int __cfg80211_mlme_disassoc(struct cfg80211_registered_device *rdev, ...@@ -500,7 +500,7 @@ static int __cfg80211_mlme_disassoc(struct cfg80211_registered_device *rdev,
else else
return -ENOTCONN; return -ENOTCONN;
return rdev->ops->disassoc(&rdev->wiphy, dev, &req, wdev); return rdev->ops->disassoc(&rdev->wiphy, dev, &req);
} }
int cfg80211_mlme_disassoc(struct cfg80211_registered_device *rdev, int cfg80211_mlme_disassoc(struct cfg80211_registered_device *rdev,
...@@ -541,7 +541,7 @@ void cfg80211_mlme_down(struct cfg80211_registered_device *rdev, ...@@ -541,7 +541,7 @@ void cfg80211_mlme_down(struct cfg80211_registered_device *rdev,
memcpy(bssid, wdev->current_bss->pub.bssid, ETH_ALEN); memcpy(bssid, wdev->current_bss->pub.bssid, ETH_ALEN);
req.bssid = bssid; req.bssid = bssid;
rdev->ops->deauth(&rdev->wiphy, dev, &req, wdev); rdev->ops->deauth(&rdev->wiphy, dev, &req);
if (wdev->current_bss) { if (wdev->current_bss) {
cfg80211_unhold_bss(wdev->current_bss); cfg80211_unhold_bss(wdev->current_bss);
......
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