diff options
author | Pandiyarajan Pitchaimuthu <c_ppitch@qca.qualcomm.com> | 2012-09-18 07:20:49 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2012-09-18 13:54:06 -0400 |
commit | ed44a951c72ab409f932b1c15914488308e86da2 (patch) | |
tree | 74ee8c115663e2d48d610401dd7f95a8bcd05898 /include | |
parent | 30d08a46ea2a4e44bc1a1f15f243af29c9150282 (diff) |
cfg80211/nl80211: Notify connection request failure in AP mode
In AP mode, when a station requests connection to an AP and if the
request is failed for particular reason, userspace is notified about the
failure through NL80211_CMD_CONN_FAILED command. Reason for the failure
is sent through the attribute NL80211_ATTR_CONN_FAILED_REASON.
Signed-off-by: Pandiyarajan Pitchaimuthu <c_ppitch@qca.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/nl80211.h | 24 | ||||
-rw-r--r-- | include/net/cfg80211.h | 19 |
2 files changed, 43 insertions, 0 deletions
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index 458416279347..7df9b500c804 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h | |||
@@ -573,6 +573,11 @@ | |||
573 | * @NL80211_CMD_STOP_P2P_DEVICE: Stop the given P2P Device, identified by | 573 | * @NL80211_CMD_STOP_P2P_DEVICE: Stop the given P2P Device, identified by |
574 | * its %NL80211_ATTR_WDEV identifier. | 574 | * its %NL80211_ATTR_WDEV identifier. |
575 | * | 575 | * |
576 | * @NL80211_CMD_CONN_FAILED: connection request to an AP failed; used to | ||
577 | * notify userspace that AP has rejected the connection request from a | ||
578 | * station, due to particular reason. %NL80211_ATTR_CONN_FAILED_REASON | ||
579 | * is used for this. | ||
580 | * | ||
576 | * @NL80211_CMD_MAX: highest used command number | 581 | * @NL80211_CMD_MAX: highest used command number |
577 | * @__NL80211_CMD_AFTER_LAST: internal use | 582 | * @__NL80211_CMD_AFTER_LAST: internal use |
578 | */ | 583 | */ |
@@ -719,6 +724,8 @@ enum nl80211_commands { | |||
719 | NL80211_CMD_START_P2P_DEVICE, | 724 | NL80211_CMD_START_P2P_DEVICE, |
720 | NL80211_CMD_STOP_P2P_DEVICE, | 725 | NL80211_CMD_STOP_P2P_DEVICE, |
721 | 726 | ||
727 | NL80211_CMD_CONN_FAILED, | ||
728 | |||
722 | /* add new commands above here */ | 729 | /* add new commands above here */ |
723 | 730 | ||
724 | /* used to define NL80211_CMD_MAX below */ | 731 | /* used to define NL80211_CMD_MAX below */ |
@@ -1262,6 +1269,10 @@ enum nl80211_commands { | |||
1262 | * was used to provide the hint. For the different types of | 1269 | * was used to provide the hint. For the different types of |
1263 | * allowed user regulatory hints see nl80211_user_reg_hint_type. | 1270 | * allowed user regulatory hints see nl80211_user_reg_hint_type. |
1264 | * | 1271 | * |
1272 | * @NL80211_ATTR_CONN_FAILED_REASON: The reason for which AP has rejected | ||
1273 | * the connection request from a station. nl80211_connect_failed_reason | ||
1274 | * enum has different reasons of connection failure. | ||
1275 | * | ||
1265 | * @NL80211_ATTR_MAX: highest attribute number currently defined | 1276 | * @NL80211_ATTR_MAX: highest attribute number currently defined |
1266 | * @__NL80211_ATTR_AFTER_LAST: internal use | 1277 | * @__NL80211_ATTR_AFTER_LAST: internal use |
1267 | */ | 1278 | */ |
@@ -1517,6 +1528,8 @@ enum nl80211_attrs { | |||
1517 | 1528 | ||
1518 | NL80211_ATTR_USER_REG_HINT_TYPE, | 1529 | NL80211_ATTR_USER_REG_HINT_TYPE, |
1519 | 1530 | ||
1531 | NL80211_ATTR_CONN_FAILED_REASON, | ||
1532 | |||
1520 | /* add attributes here, update the policy in nl80211.c */ | 1533 | /* add attributes here, update the policy in nl80211.c */ |
1521 | 1534 | ||
1522 | __NL80211_ATTR_AFTER_LAST, | 1535 | __NL80211_ATTR_AFTER_LAST, |
@@ -3045,4 +3058,15 @@ enum nl80211_probe_resp_offload_support_attr { | |||
3045 | NL80211_PROBE_RESP_OFFLOAD_SUPPORT_80211U = 1<<3, | 3058 | NL80211_PROBE_RESP_OFFLOAD_SUPPORT_80211U = 1<<3, |
3046 | }; | 3059 | }; |
3047 | 3060 | ||
3061 | /** | ||
3062 | * enum nl80211_connect_failed_reason - connection request failed reasons | ||
3063 | * @NL80211_CONN_FAIL_MAX_CLIENTS: Maximum number of clients that can be | ||
3064 | * handled by the AP is reached. | ||
3065 | * @NL80211_CONN_FAIL_BLOCKED_CLIENT: Client's MAC is in the AP's blocklist. | ||
3066 | */ | ||
3067 | enum nl80211_connect_failed_reason { | ||
3068 | NL80211_CONN_FAIL_MAX_CLIENTS, | ||
3069 | NL80211_CONN_FAIL_BLOCKED_CLIENT, | ||
3070 | }; | ||
3071 | |||
3048 | #endif /* __LINUX_NL80211_H */ | 3072 | #endif /* __LINUX_NL80211_H */ |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 1a3fe9ae4c49..80051ffc2755 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -3361,6 +3361,25 @@ void cfg80211_new_sta(struct net_device *dev, const u8 *mac_addr, | |||
3361 | void cfg80211_del_sta(struct net_device *dev, const u8 *mac_addr, gfp_t gfp); | 3361 | void cfg80211_del_sta(struct net_device *dev, const u8 *mac_addr, gfp_t gfp); |
3362 | 3362 | ||
3363 | /** | 3363 | /** |
3364 | * cfg80211_conn_failed - connection request failed notification | ||
3365 | * | ||
3366 | * @dev: the netdev | ||
3367 | * @mac_addr: the station's address | ||
3368 | * @reason: the reason for connection failure | ||
3369 | * @gfp: allocation flags | ||
3370 | * | ||
3371 | * Whenever a station tries to connect to an AP and if the station | ||
3372 | * could not connect to the AP as the AP has rejected the connection | ||
3373 | * for some reasons, this function is called. | ||
3374 | * | ||
3375 | * The reason for connection failure can be any of the value from | ||
3376 | * nl80211_connect_failed_reason enum | ||
3377 | */ | ||
3378 | void cfg80211_conn_failed(struct net_device *dev, const u8 *mac_addr, | ||
3379 | enum nl80211_connect_failed_reason reason, | ||
3380 | gfp_t gfp); | ||
3381 | |||
3382 | /** | ||
3364 | * cfg80211_rx_mgmt - notification of received, unprocessed management frame | 3383 | * cfg80211_rx_mgmt - notification of received, unprocessed management frame |
3365 | * @wdev: wireless device receiving the frame | 3384 | * @wdev: wireless device receiving the frame |
3366 | * @freq: Frequency on which the frame was received in MHz | 3385 | * @freq: Frequency on which the frame was received in MHz |