Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (43 commits) net: Fix 'Re: PACKET_TX_RING: packet size is too long' netdev: usb: dm9601.c can drive a device not supported yet, add support for it qlge: Fix firmware mailbox command timeout. qlge: Fix EEH handling. AF_RAW: Augment raw_send_hdrinc to expand skb to fit iphdr->ihl (v2) bonding: fix a race condition in calls to slave MII ioctls virtio-net: fix data corruption with OOM sfc: Set ip_summed correctly for page buffers passed to GRO cnic: Fix L2CTX_STATUSB_NUM offset in context memory. MAINTAINERS: rt2x00 list is moderated airo: Reorder tests, check bounds before element mac80211: fix for incorrect sequence number on hostapd injected frames libertas spi: fix sparse errors mac80211: trivial: fix spelling in mesh_hwmp cfg80211: sme: deauthenticate on assoc failure mac80211: keep auth state when assoc fails mac80211: fix ibss joining b43: add 'struct b43_wl' missing declaration b43: Fix Bugzilla #14181 and the bug from the previous 'fix' rt2x00: Fix crypto in TX frame for rt2800usb ...
This commit is contained in:
@@ -358,6 +358,7 @@ int cfg80211_mgd_wext_connect(struct cfg80211_registered_device *rdev,
|
||||
struct wireless_dev *wdev);
|
||||
|
||||
void cfg80211_conn_work(struct work_struct *work);
|
||||
void cfg80211_sme_failed_assoc(struct wireless_dev *wdev);
|
||||
bool cfg80211_sme_failed_reassoc(struct wireless_dev *wdev);
|
||||
|
||||
/* internal helpers */
|
||||
|
@@ -62,6 +62,7 @@ void cfg80211_send_rx_assoc(struct net_device *dev, const u8 *buf, size_t len)
|
||||
u8 *ie = mgmt->u.assoc_resp.variable;
|
||||
int i, ieoffs = offsetof(struct ieee80211_mgmt, u.assoc_resp.variable);
|
||||
struct cfg80211_internal_bss *bss = NULL;
|
||||
bool need_connect_result = true;
|
||||
|
||||
wdev_lock(wdev);
|
||||
|
||||
@@ -94,6 +95,14 @@ void cfg80211_send_rx_assoc(struct net_device *dev, const u8 *buf, size_t len)
|
||||
}
|
||||
|
||||
WARN_ON(!bss);
|
||||
} else if (wdev->conn) {
|
||||
cfg80211_sme_failed_assoc(wdev);
|
||||
need_connect_result = false;
|
||||
/*
|
||||
* do not call connect_result() now because the
|
||||
* sme will schedule work that does it later.
|
||||
*/
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!wdev->conn && wdev->sme_state == CFG80211_SME_IDLE) {
|
||||
|
@@ -26,6 +26,7 @@ struct cfg80211_conn {
|
||||
CFG80211_CONN_AUTHENTICATING,
|
||||
CFG80211_CONN_ASSOCIATE_NEXT,
|
||||
CFG80211_CONN_ASSOCIATING,
|
||||
CFG80211_CONN_DEAUTH_ASSOC_FAIL,
|
||||
} state;
|
||||
u8 bssid[ETH_ALEN], prev_bssid[ETH_ALEN];
|
||||
u8 *ie;
|
||||
@@ -148,6 +149,12 @@ static int cfg80211_conn_do_work(struct wireless_dev *wdev)
|
||||
NULL, 0,
|
||||
WLAN_REASON_DEAUTH_LEAVING);
|
||||
return err;
|
||||
case CFG80211_CONN_DEAUTH_ASSOC_FAIL:
|
||||
__cfg80211_mlme_deauth(rdev, wdev->netdev, params->bssid,
|
||||
NULL, 0,
|
||||
WLAN_REASON_DEAUTH_LEAVING);
|
||||
/* return an error so that we call __cfg80211_connect_result() */
|
||||
return -EINVAL;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
@@ -158,6 +165,7 @@ void cfg80211_conn_work(struct work_struct *work)
|
||||
struct cfg80211_registered_device *rdev =
|
||||
container_of(work, struct cfg80211_registered_device, conn_work);
|
||||
struct wireless_dev *wdev;
|
||||
u8 bssid[ETH_ALEN];
|
||||
|
||||
rtnl_lock();
|
||||
cfg80211_lock_rdev(rdev);
|
||||
@@ -173,10 +181,10 @@ void cfg80211_conn_work(struct work_struct *work)
|
||||
wdev_unlock(wdev);
|
||||
continue;
|
||||
}
|
||||
memcpy(bssid, wdev->conn->params.bssid, ETH_ALEN);
|
||||
if (cfg80211_conn_do_work(wdev))
|
||||
__cfg80211_connect_result(
|
||||
wdev->netdev,
|
||||
wdev->conn->params.bssid,
|
||||
wdev->netdev, bssid,
|
||||
NULL, 0, NULL, 0,
|
||||
WLAN_STATUS_UNSPECIFIED_FAILURE,
|
||||
false, NULL);
|
||||
@@ -337,6 +345,15 @@ bool cfg80211_sme_failed_reassoc(struct wireless_dev *wdev)
|
||||
return true;
|
||||
}
|
||||
|
||||
void cfg80211_sme_failed_assoc(struct wireless_dev *wdev)
|
||||
{
|
||||
struct wiphy *wiphy = wdev->wiphy;
|
||||
struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
|
||||
|
||||
wdev->conn->state = CFG80211_CONN_DEAUTH_ASSOC_FAIL;
|
||||
schedule_work(&rdev->conn_work);
|
||||
}
|
||||
|
||||
void __cfg80211_connect_result(struct net_device *dev, const u8 *bssid,
|
||||
const u8 *req_ie, size_t req_ie_len,
|
||||
const u8 *resp_ie, size_t resp_ie_len,
|
||||
|
Reference in New Issue
Block a user