nl80211: Add plink_action_field to hostapd_sta_add_params

Signed-off-by: Javier Lopez <jlopex@gmail.com>
Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: Jason Mobarak <x@jason.mobarak.name>
Signed-off-by: Bob Copeland <me@bobcopeland.com>
This commit is contained in:
Bob Copeland 2014-09-01 00:23:23 -04:00 committed by Jouni Malinen
parent 0d391b03e7
commit 7c7e7877fc
3 changed files with 46 additions and 0 deletions

View file

@ -300,4 +300,14 @@ enum wpa_ctrl_req_type {
/* Maximum number of EAP methods to store for EAP server user information */
#define EAP_MAX_METHODS 8
enum mesh_plink_state {
PLINK_LISTEN = 1,
PLINK_OPEN_SENT,
PLINK_OPEN_RCVD,
PLINK_CNF_RCVD,
PLINK_ESTAB,
PLINK_HOLDING,
PLINK_BLOCKED,
};
#endif /* DEFS_H */

View file

@ -1145,6 +1145,9 @@ struct hostapd_sta_add_params {
u8 vht_opmode;
u32 flags; /* bitmask of WPA_STA_* flags */
u32 flags_mask; /* unset bits in flags */
#ifdef CONFIG_MESH
enum mesh_plink_state plink_state;
#endif /* CONFIG_MESH */
int set; /* Set STA parameters instead of add */
u8 qosinfo;
const u8 *ext_capab;

View file

@ -7877,6 +7877,33 @@ static u32 sta_flags_nl80211(int flags)
}
#ifdef CONFIG_MESH
static u32 sta_plink_state_nl80211(enum mesh_plink_state state)
{
switch (state) {
case PLINK_LISTEN:
return NL80211_PLINK_LISTEN;
case PLINK_OPEN_SENT:
return NL80211_PLINK_OPN_SNT;
case PLINK_OPEN_RCVD:
return NL80211_PLINK_OPN_RCVD;
case PLINK_CNF_RCVD:
return NL80211_PLINK_CNF_RCVD;
case PLINK_ESTAB:
return NL80211_PLINK_ESTAB;
case PLINK_HOLDING:
return NL80211_PLINK_HOLDING;
case PLINK_BLOCKED:
return NL80211_PLINK_BLOCKED;
default:
wpa_printf(MSG_ERROR, "nl80211: Invalid mesh plink state %d",
state);
}
return -1;
}
#endif /* CONFIG_MESH */
static int wpa_driver_nl80211_sta_add(void *priv,
struct hostapd_sta_add_params *params)
{
@ -7983,6 +8010,12 @@ static int wpa_driver_nl80211_sta_add(void *priv,
upd.set, upd.mask);
NLA_PUT(msg, NL80211_ATTR_STA_FLAGS2, sizeof(upd), &upd);
#ifdef CONFIG_MESH
if (params->plink_state)
NLA_PUT_U8(msg, NL80211_ATTR_STA_PLINK_STATE,
sta_plink_state_nl80211(params->plink_state));
#endif /* CONFIG_MESH */
if (params->flags & WPA_STA_WMM) {
struct nlattr *wme = nla_nest_start(msg, NL80211_ATTR_STA_WME);