mirror of
https://github.com/joel16/android_kernel_sony_msm8994.git
synced 2025-03-03 02:46:14 +00:00
nl80211: fixes for event reordering.
Further to the change which added support for key management offload, this change adds definition for new event used in nl80211 internal queue and adds structure for information passed with the event. Adds definition for the processing routine for the event. Adds case for new event defined above. CRs-Fixed: 701055 Change-Id: I0e2d08d84c2331af4c16c272d2ba4e0c5a9b7e9b Signed-off-by: Ahmad Kholaif <akholaif@codeaurora.org>
This commit is contained in:
parent
269e7d4aee
commit
826d3568d5
@ -210,6 +210,7 @@ enum cfg80211_event_type {
|
||||
EVENT_ROAMED,
|
||||
EVENT_DISCONNECTED,
|
||||
EVENT_IBSS_JOINED,
|
||||
EVENT_AUTHORIZATION,
|
||||
};
|
||||
|
||||
struct cfg80211_event {
|
||||
@ -240,6 +241,10 @@ struct cfg80211_event {
|
||||
struct {
|
||||
u8 bssid[ETH_ALEN];
|
||||
} ij;
|
||||
struct {
|
||||
enum nl80211_authorization_status auth_status;
|
||||
u8 key_replay_ctr[NL80211_KEY_REPLAY_CTR_LEN];
|
||||
} au;
|
||||
};
|
||||
};
|
||||
|
||||
@ -396,6 +401,9 @@ void __cfg80211_roamed(struct wireless_dev *wdev,
|
||||
const u8 *resp_ie, size_t resp_ie_len);
|
||||
int cfg80211_mgd_wext_connect(struct cfg80211_registered_device *rdev,
|
||||
struct wireless_dev *wdev);
|
||||
void __cfg80211_authorization_event(struct net_device *dev,
|
||||
enum nl80211_authorization_status auth_status,
|
||||
const u8 *key_replay_ctr);
|
||||
|
||||
void cfg80211_conn_work(struct work_struct *work);
|
||||
void cfg80211_sme_failed_assoc(struct wireless_dev *wdev);
|
||||
|
@ -11250,10 +11250,9 @@ void cfg80211_ap_stopped(struct net_device *netdev, gfp_t gfp)
|
||||
}
|
||||
EXPORT_SYMBOL(cfg80211_ap_stopped);
|
||||
|
||||
void cfg80211_authorization_event(struct net_device *dev,
|
||||
enum nl80211_authorization_status auth_status,
|
||||
const u8 *key_replay_ctr,
|
||||
gfp_t gfp)
|
||||
void __cfg80211_authorization_event(struct net_device *dev,
|
||||
enum nl80211_authorization_status auth_status,
|
||||
const u8 *key_replay_ctr)
|
||||
{
|
||||
struct wireless_dev *wdev = dev->ieee80211_ptr;
|
||||
struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
|
||||
@ -11261,13 +11260,7 @@ void cfg80211_authorization_event(struct net_device *dev,
|
||||
void *hdr;
|
||||
int err;
|
||||
|
||||
/* Valid only in SME_CONNECTED state */
|
||||
if (wdev->sme_state != CFG80211_SME_CONNECTED)
|
||||
return;
|
||||
|
||||
trace_cfg80211_authorization_event(wdev->wiphy, dev, auth_status);
|
||||
|
||||
msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp);
|
||||
msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
|
||||
if (!msg)
|
||||
return;
|
||||
|
||||
@ -11291,13 +11284,44 @@ void cfg80211_authorization_event(struct net_device *dev,
|
||||
}
|
||||
|
||||
genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
|
||||
nl80211_mlme_mcgrp.id, gfp);
|
||||
nl80211_mlme_mcgrp.id, GFP_KERNEL);
|
||||
return;
|
||||
|
||||
nla_put_failure:
|
||||
genlmsg_cancel(msg, hdr);
|
||||
nlmsg_free(msg);
|
||||
}
|
||||
|
||||
void cfg80211_authorization_event(struct net_device *dev,
|
||||
enum nl80211_authorization_status auth_status,
|
||||
const u8 *key_replay_ctr,
|
||||
gfp_t gfp)
|
||||
{
|
||||
struct wireless_dev *wdev = dev->ieee80211_ptr;
|
||||
struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
|
||||
struct cfg80211_event *ev;
|
||||
unsigned long flags;
|
||||
|
||||
/* Valid only in SME_CONNECTED state */
|
||||
if (wdev->sme_state != CFG80211_SME_CONNECTED)
|
||||
return;
|
||||
|
||||
ev = kzalloc(sizeof(*ev), gfp);
|
||||
if (!ev)
|
||||
return;
|
||||
|
||||
trace_cfg80211_authorization_event(wdev->wiphy, dev, auth_status);
|
||||
|
||||
ev->type = EVENT_AUTHORIZATION;
|
||||
ev->au.auth_status = auth_status;
|
||||
memcpy(ev->au.key_replay_ctr, key_replay_ctr,
|
||||
NL80211_KEY_REPLAY_CTR_LEN);
|
||||
|
||||
spin_lock_irqsave(&wdev->event_lock, flags);
|
||||
list_add_tail(&ev->list, &wdev->event_list);
|
||||
spin_unlock_irqrestore(&wdev->event_lock, flags);
|
||||
queue_work(cfg80211_wq, &rdev->event_work);
|
||||
}
|
||||
EXPORT_SYMBOL(cfg80211_authorization_event);
|
||||
|
||||
/* initialisation/exit functions */
|
||||
|
@ -790,6 +790,10 @@ void cfg80211_process_wdev_events(struct wireless_dev *wdev)
|
||||
case EVENT_IBSS_JOINED:
|
||||
__cfg80211_ibss_joined(wdev->netdev, ev->ij.bssid);
|
||||
break;
|
||||
case EVENT_AUTHORIZATION:
|
||||
__cfg80211_authorization_event(wdev->netdev,
|
||||
ev->au.auth_status,
|
||||
ev->au.key_replay_ctr);
|
||||
}
|
||||
wdev_unlock(wdev);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user