aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-05-10 06:32:47 -0400
committerJohannes Berg <johannes.berg@intel.com>2013-05-24 18:02:16 -0400
commit8d61ffa5e01c5f676431d12caba17db164a48a86 (patch)
treec3df0dc13fdc8d2327712db10c1c654f428f11a3 /include
parent5fe231e873729fa2f57cdc417d5c1f80871e2d7d (diff)
cfg80211/mac80211: use cfg80211 wdev mutex in mac80211
Using separate locks in cfg80211 and mac80211 has always caused issues, for example having to unlock in places in mac80211 to call cfg80211, which even needed a framework to make cfg80211 calls after some functions returned etc. Additionally, I suspect some issues people have reported with the cfg80211 state getting confused could be due to such issues, when cfg80211 is asking mac80211 to change state but mac80211 is in the process of telling cfg80211 that the state changed (in another way.) Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'include')
-rw-r--r--include/net/cfg80211.h51
1 files changed, 23 insertions, 28 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 5430f70c63b3..9f45d74ce3c2 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1867,7 +1867,9 @@ struct cfg80211_update_ft_ies_params {
1867 * @get_mpath: get a mesh path for the given parameters 1867 * @get_mpath: get a mesh path for the given parameters
1868 * @dump_mpath: dump mesh path callback -- resume dump at index @idx 1868 * @dump_mpath: dump mesh path callback -- resume dump at index @idx
1869 * @join_mesh: join the mesh network with the specified parameters 1869 * @join_mesh: join the mesh network with the specified parameters
1870 * (invoked with the wireless_dev mutex held)
1870 * @leave_mesh: leave the current mesh network 1871 * @leave_mesh: leave the current mesh network
1872 * (invoked with the wireless_dev mutex held)
1871 * 1873 *
1872 * @get_mesh_config: Get the current mesh configuration 1874 * @get_mesh_config: Get the current mesh configuration
1873 * 1875 *
@@ -1894,20 +1896,28 @@ struct cfg80211_update_ft_ies_params {
1894 * the scan/scan_done bracket too. 1896 * the scan/scan_done bracket too.
1895 * 1897 *
1896 * @auth: Request to authenticate with the specified peer 1898 * @auth: Request to authenticate with the specified peer
1899 * (invoked with the wireless_dev mutex held)
1897 * @assoc: Request to (re)associate with the specified peer 1900 * @assoc: Request to (re)associate with the specified peer
1901 * (invoked with the wireless_dev mutex held)
1898 * @deauth: Request to deauthenticate from the specified peer 1902 * @deauth: Request to deauthenticate from the specified peer
1903 * (invoked with the wireless_dev mutex held)
1899 * @disassoc: Request to disassociate from the specified peer 1904 * @disassoc: Request to disassociate from the specified peer
1905 * (invoked with the wireless_dev mutex held)
1900 * 1906 *
1901 * @connect: Connect to the ESS with the specified parameters. When connected, 1907 * @connect: Connect to the ESS with the specified parameters. When connected,
1902 * call cfg80211_connect_result() with status code %WLAN_STATUS_SUCCESS. 1908 * call cfg80211_connect_result() with status code %WLAN_STATUS_SUCCESS.
1903 * If the connection fails for some reason, call cfg80211_connect_result() 1909 * If the connection fails for some reason, call cfg80211_connect_result()
1904 * with the status from the AP. 1910 * with the status from the AP.
1911 * (invoked with the wireless_dev mutex held)
1905 * @disconnect: Disconnect from the BSS/ESS. 1912 * @disconnect: Disconnect from the BSS/ESS.
1913 * (invoked with the wireless_dev mutex held)
1906 * 1914 *
1907 * @join_ibss: Join the specified IBSS (or create if necessary). Once done, call 1915 * @join_ibss: Join the specified IBSS (or create if necessary). Once done, call
1908 * cfg80211_ibss_joined(), also call that function when changing BSSID due 1916 * cfg80211_ibss_joined(), also call that function when changing BSSID due
1909 * to a merge. 1917 * to a merge.
1918 * (invoked with the wireless_dev mutex held)
1910 * @leave_ibss: Leave the IBSS. 1919 * @leave_ibss: Leave the IBSS.
1920 * (invoked with the wireless_dev mutex held)
1911 * 1921 *
1912 * @set_mcast_rate: Set the specified multicast rate (only if vif is in ADHOC or 1922 * @set_mcast_rate: Set the specified multicast rate (only if vif is in ADHOC or
1913 * MESH mode) 1923 * MESH mode)
@@ -2851,7 +2861,8 @@ struct cfg80211_cached_keys;
2851 * by cfg80211 on change_interface 2861 * by cfg80211 on change_interface
2852 * @mgmt_registrations: list of registrations for management frames 2862 * @mgmt_registrations: list of registrations for management frames
2853 * @mgmt_registrations_lock: lock for the list 2863 * @mgmt_registrations_lock: lock for the list
2854 * @mtx: mutex used to lock data in this struct 2864 * @mtx: mutex used to lock data in this struct, may be used by drivers
2865 * and some API functions require it held
2855 * @cleanup_work: work struct used for cleanup that can't be done directly 2866 * @cleanup_work: work struct used for cleanup that can't be done directly
2856 * @beacon_interval: beacon interval used on this device for transmitting 2867 * @beacon_interval: beacon interval used on this device for transmitting
2857 * beacons, 0 when not valid 2868 * beacons, 0 when not valid
@@ -3424,7 +3435,8 @@ void cfg80211_unlink_bss(struct wiphy *wiphy, struct cfg80211_bss *bss);
3424 * This function is called whenever an authentication has been processed in 3435 * This function is called whenever an authentication has been processed in
3425 * station mode. The driver is required to call either this function or 3436 * station mode. The driver is required to call either this function or
3426 * cfg80211_send_auth_timeout() to indicate the result of cfg80211_ops::auth() 3437 * cfg80211_send_auth_timeout() to indicate the result of cfg80211_ops::auth()
3427 * call. This function may sleep. 3438 * call. This function may sleep. The caller must hold the corresponding wdev's
3439 * mutex.
3428 */ 3440 */
3429void cfg80211_send_rx_auth(struct net_device *dev, const u8 *buf, size_t len); 3441void cfg80211_send_rx_auth(struct net_device *dev, const u8 *buf, size_t len);
3430 3442
@@ -3433,7 +3445,8 @@ void cfg80211_send_rx_auth(struct net_device *dev, const u8 *buf, size_t len);
3433 * @dev: network device 3445 * @dev: network device
3434 * @addr: The MAC address of the device with which the authentication timed out 3446 * @addr: The MAC address of the device with which the authentication timed out
3435 * 3447 *
3436 * This function may sleep. 3448 * This function may sleep. The caller must hold the corresponding wdev's
3449 * mutex.
3437 */ 3450 */
3438void cfg80211_send_auth_timeout(struct net_device *dev, const u8 *addr); 3451void cfg80211_send_auth_timeout(struct net_device *dev, const u8 *addr);
3439 3452
@@ -3448,7 +3461,8 @@ void cfg80211_send_auth_timeout(struct net_device *dev, const u8 *addr);
3448 * This function is called whenever a (re)association response has been 3461 * This function is called whenever a (re)association response has been
3449 * processed in station mode. The driver is required to call either this 3462 * processed in station mode. The driver is required to call either this
3450 * function or cfg80211_send_assoc_timeout() to indicate the result of 3463 * function or cfg80211_send_assoc_timeout() to indicate the result of
3451 * cfg80211_ops::assoc() call. This function may sleep. 3464 * cfg80211_ops::assoc() call. This function may sleep. The caller must hold
3465 * the corresponding wdev's mutex.
3452 */ 3466 */
3453void cfg80211_send_rx_assoc(struct net_device *dev, struct cfg80211_bss *bss, 3467void cfg80211_send_rx_assoc(struct net_device *dev, struct cfg80211_bss *bss,
3454 const u8 *buf, size_t len); 3468 const u8 *buf, size_t len);
@@ -3458,7 +3472,7 @@ void cfg80211_send_rx_assoc(struct net_device *dev, struct cfg80211_bss *bss,
3458 * @dev: network device 3472 * @dev: network device
3459 * @addr: The MAC address of the device with which the association timed out 3473 * @addr: The MAC address of the device with which the association timed out
3460 * 3474 *
3461 * This function may sleep. 3475 * This function may sleep. The caller must hold the corresponding wdev's mutex.
3462 */ 3476 */
3463void cfg80211_send_assoc_timeout(struct net_device *dev, const u8 *addr); 3477void cfg80211_send_assoc_timeout(struct net_device *dev, const u8 *addr);
3464 3478
@@ -3470,21 +3484,12 @@ void cfg80211_send_assoc_timeout(struct net_device *dev, const u8 *addr);
3470 * 3484 *
3471 * This function is called whenever deauthentication has been processed in 3485 * This function is called whenever deauthentication has been processed in
3472 * station mode. This includes both received deauthentication frames and 3486 * station mode. This includes both received deauthentication frames and
3473 * locally generated ones. This function may sleep. 3487 * locally generated ones. This function may sleep. The caller must hold the
3488 * corresponding wdev's mutex.
3474 */ 3489 */
3475void cfg80211_send_deauth(struct net_device *dev, const u8 *buf, size_t len); 3490void cfg80211_send_deauth(struct net_device *dev, const u8 *buf, size_t len);
3476 3491
3477/** 3492/**
3478 * __cfg80211_send_deauth - notification of processed deauthentication
3479 * @dev: network device
3480 * @buf: deauthentication frame (header + body)
3481 * @len: length of the frame data
3482 *
3483 * Like cfg80211_send_deauth(), but doesn't take the wdev lock.
3484 */
3485void __cfg80211_send_deauth(struct net_device *dev, const u8 *buf, size_t len);
3486
3487/**
3488 * cfg80211_send_disassoc - notification of processed disassociation 3493 * cfg80211_send_disassoc - notification of processed disassociation
3489 * @dev: network device 3494 * @dev: network device
3490 * @buf: disassociation response frame (header + body) 3495 * @buf: disassociation response frame (header + body)
@@ -3492,22 +3497,12 @@ void __cfg80211_send_deauth(struct net_device *dev, const u8 *buf, size_t len);
3492 * 3497 *
3493 * This function is called whenever disassociation has been processed in 3498 * This function is called whenever disassociation has been processed in
3494 * station mode. This includes both received disassociation frames and locally 3499 * station mode. This includes both received disassociation frames and locally
3495 * generated ones. This function may sleep. 3500 * generated ones. This function may sleep. The caller must hold the
3501 * corresponding wdev's mutex.
3496 */ 3502 */
3497void cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, size_t len); 3503void cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, size_t len);
3498 3504
3499/** 3505/**
3500 * __cfg80211_send_disassoc - notification of processed disassociation
3501 * @dev: network device
3502 * @buf: disassociation response frame (header + body)
3503 * @len: length of the frame data
3504 *
3505 * Like cfg80211_send_disassoc(), but doesn't take the wdev lock.
3506 */
3507void __cfg80211_send_disassoc(struct net_device *dev, const u8 *buf,
3508 size_t len);
3509
3510/**
3511 * cfg80211_send_unprot_deauth - notification of unprotected deauthentication 3506 * cfg80211_send_unprot_deauth - notification of unprotected deauthentication
3512 * @dev: network device 3507 * @dev: network device
3513 * @buf: deauthentication frame (header + body) 3508 * @buf: deauthentication frame (header + body)