diff options
author | Johannes Berg <johannes.berg@intel.com> | 2013-05-15 18:55:00 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-06-04 07:03:10 -0400 |
commit | 6ff57cf88807dd81300b5b9c623dc5eb6422b9f6 (patch) | |
tree | 8819fea1f493077ff311208986ebfe27bd327623 /include | |
parent | 51217cee3a94d5409d6ee2ac090ae96bc9a06757 (diff) |
cfg80211/mac80211: clean up cfg80211 SME APIs
Do some cleanups in the cfg80211 SME APIs, which are
only used by mac80211.
Most of these functions get a frame passed, and there
isn't really any reason to export multiple functions
as cfg80211 can check the frame type instead, do that.
Additionally, the API functions have confusing names
like cfg80211_send_...() which was meant to indicate
that it sends an event to userspace, but gets a bit
confusing when there's both TX and RX and they're not
all clearly labeled.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/cfg80211.h | 91 |
1 files changed, 36 insertions, 55 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 6169fca216b4..195330d4ef34 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -3432,59 +3432,66 @@ void cfg80211_put_bss(struct wiphy *wiphy, struct cfg80211_bss *bss); | |||
3432 | void cfg80211_unlink_bss(struct wiphy *wiphy, struct cfg80211_bss *bss); | 3432 | void cfg80211_unlink_bss(struct wiphy *wiphy, struct cfg80211_bss *bss); |
3433 | 3433 | ||
3434 | /** | 3434 | /** |
3435 | * cfg80211_send_rx_auth - notification of processed authentication | 3435 | * cfg80211_rx_mlme_mgmt - notification of processed MLME management frame |
3436 | * @dev: network device | 3436 | * @dev: network device |
3437 | * @buf: authentication frame (header + body) | 3437 | * @buf: authentication frame (header + body) |
3438 | * @len: length of the frame data | 3438 | * @len: length of the frame data |
3439 | * | 3439 | * |
3440 | * This function is called whenever an authentication has been processed in | 3440 | * This function is called whenever an authentication, disassociation or |
3441 | * station mode. The driver is required to call either this function or | 3441 | * deauthentication frame has been received and processed in station mode. |
3442 | * cfg80211_send_auth_timeout() to indicate the result of cfg80211_ops::auth() | 3442 | * After being asked to authenticate via cfg80211_ops::auth() the driver must |
3443 | * call. This function may sleep. The caller must hold the corresponding wdev's | 3443 | * call either this function or cfg80211_auth_timeout(). |
3444 | * mutex. | 3444 | * After being asked to associate via cfg80211_ops::assoc() the driver must |
3445 | * call either this function or cfg80211_auth_timeout(). | ||
3446 | * While connected, the driver must calls this for received and processed | ||
3447 | * disassociation and deauthentication frames. If the frame couldn't be used | ||
3448 | * because it was unprotected, the driver must call the function | ||
3449 | * cfg80211_rx_unprot_mlme_mgmt() instead. | ||
3450 | * | ||
3451 | * This function may sleep. The caller must hold the corresponding wdev's mutex. | ||
3445 | */ | 3452 | */ |
3446 | void cfg80211_send_rx_auth(struct net_device *dev, const u8 *buf, size_t len); | 3453 | void cfg80211_rx_mlme_mgmt(struct net_device *dev, const u8 *buf, size_t len); |
3447 | 3454 | ||
3448 | /** | 3455 | /** |
3449 | * cfg80211_send_auth_timeout - notification of timed out authentication | 3456 | * cfg80211_auth_timeout - notification of timed out authentication |
3450 | * @dev: network device | 3457 | * @dev: network device |
3451 | * @addr: The MAC address of the device with which the authentication timed out | 3458 | * @addr: The MAC address of the device with which the authentication timed out |
3452 | * | 3459 | * |
3453 | * This function may sleep. The caller must hold the corresponding wdev's | 3460 | * This function may sleep. The caller must hold the corresponding wdev's |
3454 | * mutex. | 3461 | * mutex. |
3455 | */ | 3462 | */ |
3456 | void cfg80211_send_auth_timeout(struct net_device *dev, const u8 *addr); | 3463 | void cfg80211_auth_timeout(struct net_device *dev, const u8 *addr); |
3457 | 3464 | ||
3458 | /** | 3465 | /** |
3459 | * cfg80211_send_rx_assoc - notification of processed association | 3466 | * cfg80211_rx_assoc_resp - notification of processed association response |
3460 | * @dev: network device | 3467 | * @dev: network device |
3461 | * @bss: the BSS struct association was requested for, the struct reference | 3468 | * @bss: the BSS that association was requested with, ownership of the pointer |
3462 | * is owned by cfg80211 after this call | 3469 | * moves to cfg80211 in this call |
3463 | * @buf: (re)association response frame (header + body) | 3470 | * @buf: authentication frame (header + body) |
3464 | * @len: length of the frame data | 3471 | * @len: length of the frame data |
3465 | * | 3472 | * |
3466 | * This function is called whenever a (re)association response has been | 3473 | * After being asked to associate via cfg80211_ops::assoc() the driver must |
3467 | * processed in station mode. The driver is required to call either this | 3474 | * call either this function or cfg80211_auth_timeout(). |
3468 | * function or cfg80211_send_assoc_timeout() to indicate the result of | 3475 | * |
3469 | * cfg80211_ops::assoc() call. This function may sleep. The caller must hold | 3476 | * This function may sleep. The caller must hold the corresponding wdev's mutex. |
3470 | * the corresponding wdev's mutex. | ||
3471 | */ | 3477 | */ |
3472 | void cfg80211_send_rx_assoc(struct net_device *dev, struct cfg80211_bss *bss, | 3478 | void cfg80211_rx_assoc_resp(struct net_device *dev, |
3479 | struct cfg80211_bss *bss, | ||
3473 | const u8 *buf, size_t len); | 3480 | const u8 *buf, size_t len); |
3474 | 3481 | ||
3475 | /** | 3482 | /** |
3476 | * cfg80211_send_assoc_timeout - notification of timed out association | 3483 | * cfg80211_assoc_timeout - notification of timed out association |
3477 | * @dev: network device | 3484 | * @dev: network device |
3478 | * @addr: The MAC address of the device with which the association timed out | 3485 | * @addr: The MAC address of the device with which the association timed out |
3479 | * | 3486 | * |
3480 | * This function may sleep. The caller must hold the corresponding wdev's mutex. | 3487 | * This function may sleep. The caller must hold the corresponding wdev's mutex. |
3481 | */ | 3488 | */ |
3482 | void cfg80211_send_assoc_timeout(struct net_device *dev, const u8 *addr); | 3489 | void cfg80211_assoc_timeout(struct net_device *dev, const u8 *addr); |
3483 | 3490 | ||
3484 | /** | 3491 | /** |
3485 | * cfg80211_send_deauth - notification of processed deauthentication | 3492 | * cfg80211_tx_mlme_mgmt - notification of transmitted deauth/disassoc frame |
3486 | * @dev: network device | 3493 | * @dev: network device |
3487 | * @buf: deauthentication frame (header + body) | 3494 | * @buf: 802.11 frame (header + body) |
3488 | * @len: length of the frame data | 3495 | * @len: length of the frame data |
3489 | * | 3496 | * |
3490 | * This function is called whenever deauthentication has been processed in | 3497 | * This function is called whenever deauthentication has been processed in |
@@ -3492,46 +3499,20 @@ void cfg80211_send_assoc_timeout(struct net_device *dev, const u8 *addr); | |||
3492 | * locally generated ones. This function may sleep. The caller must hold the | 3499 | * locally generated ones. This function may sleep. The caller must hold the |
3493 | * corresponding wdev's mutex. | 3500 | * corresponding wdev's mutex. |
3494 | */ | 3501 | */ |
3495 | void cfg80211_send_deauth(struct net_device *dev, const u8 *buf, size_t len); | 3502 | void cfg80211_tx_mlme_mgmt(struct net_device *dev, const u8 *buf, size_t len); |
3496 | 3503 | ||
3497 | /** | 3504 | /** |
3498 | * cfg80211_send_disassoc - notification of processed disassociation | 3505 | * cfg80211_rx_unprot_mlme_mgmt - notification of unprotected mlme mgmt frame |
3499 | * @dev: network device | ||
3500 | * @buf: disassociation response frame (header + body) | ||
3501 | * @len: length of the frame data | ||
3502 | * | ||
3503 | * This function is called whenever disassociation has been processed in | ||
3504 | * station mode. This includes both received disassociation frames and locally | ||
3505 | * generated ones. This function may sleep. The caller must hold the | ||
3506 | * corresponding wdev's mutex. | ||
3507 | */ | ||
3508 | void cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, size_t len); | ||
3509 | |||
3510 | /** | ||
3511 | * cfg80211_send_unprot_deauth - notification of unprotected deauthentication | ||
3512 | * @dev: network device | 3506 | * @dev: network device |
3513 | * @buf: deauthentication frame (header + body) | 3507 | * @buf: deauthentication frame (header + body) |
3514 | * @len: length of the frame data | 3508 | * @len: length of the frame data |
3515 | * | 3509 | * |
3516 | * This function is called whenever a received Deauthentication frame has been | 3510 | * This function is called whenever a received deauthentication or dissassoc |
3517 | * dropped in station mode because of MFP being used but the Deauthentication | 3511 | * frame has been dropped in station mode because of MFP being used but the |
3518 | * frame was not protected. This function may sleep. | ||
3519 | */ | ||
3520 | void cfg80211_send_unprot_deauth(struct net_device *dev, const u8 *buf, | ||
3521 | size_t len); | ||
3522 | |||
3523 | /** | ||
3524 | * cfg80211_send_unprot_disassoc - notification of unprotected disassociation | ||
3525 | * @dev: network device | ||
3526 | * @buf: disassociation frame (header + body) | ||
3527 | * @len: length of the frame data | ||
3528 | * | ||
3529 | * This function is called whenever a received Disassociation frame has been | ||
3530 | * dropped in station mode because of MFP being used but the Disassociation | ||
3531 | * frame was not protected. This function may sleep. | 3512 | * frame was not protected. This function may sleep. |
3532 | */ | 3513 | */ |
3533 | void cfg80211_send_unprot_disassoc(struct net_device *dev, const u8 *buf, | 3514 | void cfg80211_rx_unprot_mlme_mgmt(struct net_device *dev, |
3534 | size_t len); | 3515 | const u8 *buf, size_t len); |
3535 | 3516 | ||
3536 | /** | 3517 | /** |
3537 | * cfg80211_michael_mic_failure - notification of Michael MIC failure (TKIP) | 3518 | * cfg80211_michael_mic_failure - notification of Michael MIC failure (TKIP) |