mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
cfg80211: properly send NL80211_ATTR_DISCONNECTED_BY_AP in disconnect
When we disconnect from the AP, drivers call cfg80211_disconnect(). This doesn't know whether the disconnection was initiated locally or by the AP though, which can cause problems with the supplicant, for example with WPS. This issue obviously doesn't show up with any mac80211 based driver since mac80211 doesn't call this function. Fix this by requiring drivers to indicate whether the disconnect is locally generated or not. I've tried to update the drivers, but may not have gotten the values correct, and some drivers may currently not be able to report correct values. In case of doubt I left it at false, which is the current behaviour. For libertas, make adjustments as indicated by Dan Williams. Reported-by: Matthieu Mauger <[email protected]> Tested-by: Matthieu Mauger <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
This commit is contained in:
parent
c5a71688e1
commit
80279fb7ba
16 changed files with 37 additions and 27 deletions
|
|
@ -222,6 +222,7 @@ struct cfg80211_event {
|
|||
const u8 *ie;
|
||||
size_t ie_len;
|
||||
u16 reason;
|
||||
bool locally_generated;
|
||||
} dc;
|
||||
struct {
|
||||
u8 bssid[ETH_ALEN];
|
||||
|
|
|
|||
|
|
@ -938,7 +938,8 @@ void __cfg80211_disconnected(struct net_device *dev, const u8 *ie,
|
|||
}
|
||||
|
||||
void cfg80211_disconnected(struct net_device *dev, u16 reason,
|
||||
const u8 *ie, size_t ie_len, gfp_t gfp)
|
||||
const u8 *ie, size_t ie_len,
|
||||
bool locally_generated, gfp_t gfp)
|
||||
{
|
||||
struct wireless_dev *wdev = dev->ieee80211_ptr;
|
||||
struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy);
|
||||
|
|
@ -954,6 +955,7 @@ void cfg80211_disconnected(struct net_device *dev, u16 reason,
|
|||
ev->dc.ie_len = ie_len;
|
||||
memcpy((void *)ev->dc.ie, ie, ie_len);
|
||||
ev->dc.reason = reason;
|
||||
ev->dc.locally_generated = locally_generated;
|
||||
|
||||
spin_lock_irqsave(&wdev->event_lock, flags);
|
||||
list_add_tail(&ev->list, &wdev->event_list);
|
||||
|
|
|
|||
|
|
@ -887,7 +887,8 @@ void cfg80211_process_wdev_events(struct wireless_dev *wdev)
|
|||
case EVENT_DISCONNECTED:
|
||||
__cfg80211_disconnected(wdev->netdev,
|
||||
ev->dc.ie, ev->dc.ie_len,
|
||||
ev->dc.reason, true);
|
||||
ev->dc.reason,
|
||||
!ev->dc.locally_generated);
|
||||
break;
|
||||
case EVENT_IBSS_JOINED:
|
||||
__cfg80211_ibss_joined(wdev->netdev, ev->ij.bssid,
|
||||
|
|
|
|||
Loading…
Reference in a new issue