forked from rubenslte/android_kernel_samsung_msm8226
Merge "cfg80211: Extend support for IEEE 802.11r Fast BSS Transition"
This commit is contained in:
committed by
Gerrit - the friendly Code Review server
commit
4533f151eb
@@ -170,6 +170,9 @@
|
||||
* %NL80211_ATTR_CIPHER_GROUP, %NL80211_ATTR_WPA_VERSIONS,
|
||||
* %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY,
|
||||
* %NL80211_ATTR_AUTH_TYPE and %NL80211_ATTR_INACTIVITY_TIMEOUT.
|
||||
* %NL80211_ATTR_ACL_POLICY and %NL80211_ATTR_MAC_ADDRS.
|
||||
* The channel to use can be set on the interface or be given using the
|
||||
* %NL80211_ATTR_WIPHY_FREQ and the attributes determining channel width.
|
||||
* @NL80211_CMD_NEW_BEACON: old alias for %NL80211_CMD_START_AP
|
||||
* @NL80211_CMD_STOP_AP: Stop AP operation on the given interface
|
||||
* @NL80211_CMD_DEL_BEACON: old alias for %NL80211_CMD_STOP_AP
|
||||
@@ -554,6 +557,57 @@
|
||||
* @NL80211_CMD_SET_NOACK_MAP: sets a bitmap for the individual TIDs whether
|
||||
* No Acknowledgement Policy should be applied.
|
||||
*
|
||||
* @NL80211_CMD_CH_SWITCH_NOTIFY: An AP or GO may decide to switch channels
|
||||
* independently of the userspace SME, send this event indicating
|
||||
* %NL80211_ATTR_IFINDEX is now on %NL80211_ATTR_WIPHY_FREQ and the
|
||||
* attributes determining channel width.
|
||||
*
|
||||
* @NL80211_CMD_START_P2P_DEVICE: Start the given P2P Device, identified by
|
||||
* its %NL80211_ATTR_WDEV identifier. It must have been created with
|
||||
* %NL80211_CMD_NEW_INTERFACE previously. After it has been started, the
|
||||
* P2P Device can be used for P2P operations, e.g. remain-on-channel and
|
||||
* public action frame TX.
|
||||
* @NL80211_CMD_STOP_P2P_DEVICE: Stop the given P2P Device, identified by
|
||||
* its %NL80211_ATTR_WDEV identifier.
|
||||
*
|
||||
* @NL80211_CMD_CONN_FAILED: connection request to an AP failed; used to
|
||||
* notify userspace that AP has rejected the connection request from a
|
||||
* station, due to particular reason. %NL80211_ATTR_CONN_FAILED_REASON
|
||||
* is used for this.
|
||||
*
|
||||
* @NL80211_CMD_SET_MCAST_RATE: Change the rate used to send multicast frames
|
||||
* for IBSS or MESH vif.
|
||||
*
|
||||
* @NL80211_CMD_SET_MAC_ACL: sets ACL for MAC address based access control.
|
||||
* This is to be used with the drivers advertising the support of MAC
|
||||
* address based access control. List of MAC addresses is passed in
|
||||
* %NL80211_ATTR_MAC_ADDRS and ACL policy is passed in
|
||||
* %NL80211_ATTR_ACL_POLICY. Driver will enable ACL with this list, if it
|
||||
* is not already done. The new list will replace any existing list. Driver
|
||||
* will clear its ACL when the list of MAC addresses passed is empty. This
|
||||
* command is used in AP/P2P GO mode. Driver has to make sure to clear its
|
||||
* ACL list during %NL80211_CMD_STOP_AP.
|
||||
*
|
||||
* @NL80211_CMD_RADAR_DETECT: Start a Channel availability check (CAC). Once
|
||||
* a radar is detected or the channel availability scan (CAC) has finished
|
||||
* or was aborted, or a radar was detected, usermode will be notified with
|
||||
* this event. This command is also used to notify userspace about radars
|
||||
* while operating on this channel.
|
||||
* %NL80211_ATTR_RADAR_EVENT is used to inform about the type of the
|
||||
* event.
|
||||
*
|
||||
* @NL80211_CMD_GET_PROTOCOL_FEATURES: Get global nl80211 protocol features,
|
||||
* i.e. features for the nl80211 protocol rather than device features.
|
||||
* Returns the features in the %NL80211_ATTR_PROTOCOL_FEATURES bitmap.
|
||||
*
|
||||
* @NL80211_CMD_UPDATE_FT_IES: Pass down the most up-to-date Fast Transition
|
||||
* Information Element to the WLAN driver
|
||||
*
|
||||
* @NL80211_CMD_FT_EVENT: Send a Fast transition event from the WLAN driver
|
||||
* to the supplicant. This will carry the target AP's MAC address along
|
||||
* with the relevant Information Elements. This event is used to report
|
||||
* received FT IEs (MDIE, FTIE, RSN IE, TIE, RICIE).
|
||||
*
|
||||
* @NL80211_CMD_MAX: highest used command number
|
||||
* @__NL80211_CMD_AFTER_LAST: internal use
|
||||
*/
|
||||
@@ -695,6 +749,25 @@ enum nl80211_commands {
|
||||
|
||||
NL80211_CMD_SET_NOACK_MAP,
|
||||
|
||||
|
||||
NL80211_CMD_CH_SWITCH_NOTIFY,
|
||||
|
||||
NL80211_CMD_START_P2P_DEVICE,
|
||||
NL80211_CMD_STOP_P2P_DEVICE,
|
||||
|
||||
NL80211_CMD_CONN_FAILED,
|
||||
|
||||
NL80211_CMD_SET_MCAST_RATE,
|
||||
|
||||
NL80211_CMD_SET_MAC_ACL,
|
||||
|
||||
NL80211_CMD_RADAR_DETECT,
|
||||
|
||||
NL80211_CMD_GET_PROTOCOL_FEATURES,
|
||||
|
||||
NL80211_CMD_UPDATE_FT_IES,
|
||||
NL80211_CMD_FT_EVENT,
|
||||
|
||||
/* add new commands above here */
|
||||
|
||||
/* used to define NL80211_CMD_MAX below */
|
||||
@@ -1275,6 +1348,18 @@ enum nl80211_commands {
|
||||
* advertised to the driver, e.g., to enable TDLS off channel operations
|
||||
* and PU-APSD.
|
||||
*
|
||||
* @NL80211_ATTR_PROTOCOL_FEATURES: global nl80211 feature flags, see
|
||||
* &enum nl80211_protocol_features, the attribute is a u32.
|
||||
*
|
||||
* @NL80211_ATTR_SPLIT_WIPHY_DUMP: flag attribute, userspace supports
|
||||
* receiving the data for a single wiphy split across multiple
|
||||
* messages, given with wiphy dump message
|
||||
*
|
||||
* @NL80211_ATTR_MDID: Mobility Domain Identifier
|
||||
*
|
||||
* @NL80211_ATTR_IE_RIC: Resource Information Container Information
|
||||
* Element
|
||||
*
|
||||
* @NL80211_ATTR_MAX: highest attribute number currently defined
|
||||
* @__NL80211_ATTR_AFTER_LAST: internal use
|
||||
*/
|
||||
@@ -1561,6 +1646,15 @@ enum nl80211_attrs {
|
||||
NL80211_ATTR_STA_CAPABILITY,
|
||||
NL80211_ATTR_STA_EXT_CAPABILITY,
|
||||
|
||||
NL80211_ATTR_PROTOCOL_FEATURES,
|
||||
NL80211_ATTR_SPLIT_WIPHY_DUMP,
|
||||
|
||||
NL80211_ATTR_DISABLE_VHT,
|
||||
NL80211_ATTR_VHT_CAPABILITY_MASK,
|
||||
|
||||
NL80211_ATTR_MDID,
|
||||
NL80211_ATTR_IE_RIC,
|
||||
|
||||
/* add attributes here, update the policy in nl80211.c */
|
||||
|
||||
__NL80211_ATTR_AFTER_LAST,
|
||||
|
||||
@@ -1360,6 +1360,21 @@ struct cfg80211_gtk_rekey_data {
|
||||
u8 replay_ctr[NL80211_REPLAY_CTR_LEN];
|
||||
};
|
||||
|
||||
/**
|
||||
* struct cfg80211_update_ft_ies_params - FT IE Information
|
||||
*
|
||||
* This structure provides information needed to update the fast transition IE
|
||||
*
|
||||
* @md: The Mobility Domain ID, 2 Octet value
|
||||
* @ie: Fast Transition IEs
|
||||
* @ie_len: Length of ft_ie in octets
|
||||
*/
|
||||
struct cfg80211_update_ft_ies_params {
|
||||
u16 md;
|
||||
const u8 *ie;
|
||||
size_t ie_len;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct cfg80211_ops - backend description for wireless configuration
|
||||
*
|
||||
@@ -1740,6 +1755,8 @@ struct cfg80211_ops {
|
||||
u16 noack_map);
|
||||
|
||||
struct ieee80211_channel *(*get_channel)(struct wiphy *wiphy);
|
||||
int (*update_ft_ies)(struct wiphy *wiphy, struct net_device *dev,
|
||||
struct cfg80211_update_ft_ies_params *ftie);
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -3410,6 +3427,31 @@ void cfg80211_tdls_oper_request(struct net_device *dev, const u8 *peer,
|
||||
*/
|
||||
u16 cfg80211_calculate_bitrate(struct rate_info *rate);
|
||||
|
||||
/**
|
||||
* struct cfg80211_ft_event - FT Information Elements
|
||||
* @ies: FT IEs
|
||||
* @ies_len: length of the FT IE in bytes
|
||||
* @target_ap: target AP's MAC address
|
||||
* @ric_ies: RIC IE
|
||||
* @ric_ies_len: length of the RIC IE in bytes
|
||||
*/
|
||||
struct cfg80211_ft_event_params {
|
||||
const u8 *ies;
|
||||
size_t ies_len;
|
||||
const u8 *target_ap;
|
||||
const u8 *ric_ies;
|
||||
size_t ric_ies_len;
|
||||
};
|
||||
|
||||
/**
|
||||
* cfg80211_ft_event - notify userspace about FT IE and RIC IE
|
||||
* @netdev: network device
|
||||
* @ft_event: IE information
|
||||
*/
|
||||
void cfg80211_ft_event(struct net_device *netdev,
|
||||
struct cfg80211_ft_event_params *ft_event);
|
||||
|
||||
|
||||
/* Logging, debugging and troubleshooting/diagnostic helpers. */
|
||||
|
||||
/* wiphy_printk helpers, similar to dev_printk */
|
||||
|
||||
@@ -212,6 +212,14 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = {
|
||||
[NL80211_ATTR_VHT_CAPABILITY] = { .len = NL80211_VHT_CAPABILITY_LEN },
|
||||
[NL80211_ATTR_STA_CAPABILITY] = { .type = NLA_U16 },
|
||||
[NL80211_ATTR_STA_EXT_CAPABILITY] = { .type = NLA_BINARY, },
|
||||
[NL80211_ATTR_SPLIT_WIPHY_DUMP] = { .type = NLA_FLAG, },
|
||||
[NL80211_ATTR_DISABLE_VHT] = { .type = NLA_FLAG },
|
||||
[NL80211_ATTR_VHT_CAPABILITY_MASK] = {
|
||||
.len = NL80211_VHT_CAPABILITY_LEN,
|
||||
},
|
||||
[NL80211_ATTR_MDID] = { .type = NLA_U16 },
|
||||
[NL80211_ATTR_IE_RIC] = { .type = NLA_BINARY,
|
||||
.len = IEEE80211_MAX_DATA_LEN },
|
||||
};
|
||||
|
||||
/* policy for the key attributes */
|
||||
@@ -6445,6 +6453,27 @@ static int nl80211_register_beacons(struct sk_buff *skb, struct genl_info *info)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int nl80211_update_ft_ies(struct sk_buff *skb, struct genl_info *info)
|
||||
{
|
||||
struct cfg80211_registered_device *rdev = info->user_ptr[0];
|
||||
struct cfg80211_update_ft_ies_params ft_params;
|
||||
struct net_device *dev = info->user_ptr[1];
|
||||
|
||||
if (!rdev->ops->update_ft_ies)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
if (!info->attrs[NL80211_ATTR_MDID] ||
|
||||
!is_valid_ie_attr(info->attrs[NL80211_ATTR_IE]))
|
||||
return -EINVAL;
|
||||
|
||||
memset(&ft_params, 0, sizeof(ft_params));
|
||||
ft_params.md = nla_get_u16(info->attrs[NL80211_ATTR_MDID]);
|
||||
ft_params.ie = nla_data(info->attrs[NL80211_ATTR_IE]);
|
||||
ft_params.ie_len = nla_len(info->attrs[NL80211_ATTR_IE]);
|
||||
|
||||
return rdev->ops->update_ft_ies(&rdev->wiphy, dev, &ft_params);
|
||||
}
|
||||
|
||||
#define NL80211_FLAG_NEED_WIPHY 0x01
|
||||
#define NL80211_FLAG_NEED_NETDEV 0x02
|
||||
#define NL80211_FLAG_NEED_RTNL 0x04
|
||||
@@ -7033,6 +7062,14 @@ static struct genl_ops nl80211_ops[] = {
|
||||
.internal_flags = NL80211_FLAG_NEED_NETDEV |
|
||||
NL80211_FLAG_NEED_RTNL,
|
||||
},
|
||||
{
|
||||
.cmd = NL80211_CMD_UPDATE_FT_IES,
|
||||
.doit = nl80211_update_ft_ies,
|
||||
.policy = nl80211_policy,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
.internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
|
||||
NL80211_FLAG_NEED_RTNL,
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
@@ -8270,6 +8307,48 @@ static struct notifier_block nl80211_netlink_notifier = {
|
||||
.notifier_call = nl80211_netlink_notify,
|
||||
};
|
||||
|
||||
void cfg80211_ft_event(struct net_device *netdev,
|
||||
struct cfg80211_ft_event_params *ft_event)
|
||||
{
|
||||
struct wiphy *wiphy = netdev->ieee80211_ptr->wiphy;
|
||||
struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
|
||||
struct sk_buff *msg;
|
||||
void *hdr;
|
||||
int err;
|
||||
|
||||
if (!ft_event->target_ap)
|
||||
return;
|
||||
|
||||
msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
|
||||
if (!msg)
|
||||
return;
|
||||
|
||||
hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_FT_EVENT);
|
||||
if (!hdr) {
|
||||
nlmsg_free(msg);
|
||||
return;
|
||||
}
|
||||
|
||||
nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx);
|
||||
nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex);
|
||||
nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, ft_event->target_ap);
|
||||
if (ft_event->ies)
|
||||
nla_put(msg, NL80211_ATTR_IE, ft_event->ies_len, ft_event->ies);
|
||||
if (ft_event->ric_ies)
|
||||
nla_put(msg, NL80211_ATTR_IE_RIC, ft_event->ric_ies_len,
|
||||
ft_event->ric_ies);
|
||||
|
||||
err = genlmsg_end(msg, hdr);
|
||||
if (err < 0) {
|
||||
nlmsg_free(msg);
|
||||
return;
|
||||
}
|
||||
|
||||
genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
|
||||
nl80211_mlme_mcgrp.id, GFP_KERNEL);
|
||||
}
|
||||
EXPORT_SYMBOL(cfg80211_ft_event);
|
||||
|
||||
/* initialisation/exit functions */
|
||||
|
||||
int nl80211_init(void)
|
||||
|
||||
Reference in New Issue
Block a user