cfg80211: Add support to update connection parameters
Add functionality to update the connection parameters when in connected state, so that driver/firmware uses the updated parameters for subsequent roaming. This is for drivers that support internal BSS selection and roaming. The new command does not change the current association state, i.e., it can be used to update IE contents for future (re)associations without causing an immediate disassociation or reassociation with the current BSS. This commit implements the required functionality for updating IEs for (Re)Association Request frame only. Other parameters can be added in future when required. Signed-off-by: vamsi krishna <vamsin@qti.qualcomm.com> Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Git-commit: 088e8df82f91a24728d49d9532cab7ebdee5117f Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git Change-Id: I184b8e13bc5f7e2ed21e5337673c6ba82cd2f4fe CRs-Fixed: 1097836 [apati@codeaurora.org: backport to 4.4-This commit includes the changes from following commits in include/uapi/linux/nl80211.h to compile for msm-4.4. cb3b7d87652aeb37cfb5295a6157a3280dae10cb : cfg80211: add start / stop NAN commands. a442b761b24b6886f9a4e2ff5f8cb4824c96526b : cfg80211: add add_nan_func / del_nan_func. a5a9dcf291e1e541243878eed2d73a74006fa1f1 : cfg80211: allow the user space to change current NAN configuration. 50bcd31d9992e99c231820f5276e70346cbfbc51 : cfg80211: provide a function to report a match for NAN. ce0ce13a1c89ff8b94b7f8fb32eb4c43e111c82e : cfg80211: configure multicast to unicast for AP interfaces. c6e6a0c8be575c830a97b1942dabeab70f423fe0 : nl80211: Add API to support VHT MU-MIMO air sniffer. 1d76250bd34af86c6498fc51e50cab3bfbbeceaa : nl80211: support beacon report scanning. 7d27a0ba7adc8ef30c2aae7592fce4c162aee4df : cfg80211: Add mesh peer AID setting API. 348bd456699801920a309c66e382380809fbdf41 : cfg80211: Add KEK/nonces for FILS association frames.] Signed-off-by: Ashwini Patil<apati@codeaurora.org>
This commit is contained in:
parent
5142c18bae
commit
ad15e061fa
5 changed files with 227 additions and 0 deletions
|
@ -1965,6 +1965,18 @@ struct cfg80211_connect_params {
|
|||
const u8 *prev_bssid;
|
||||
};
|
||||
|
||||
/**
|
||||
* enum cfg80211_connect_params_changed - Connection parameters being updated
|
||||
*
|
||||
* This enum provides information of all connect parameters that
|
||||
* have to be updated as part of update_connect_params() call.
|
||||
*
|
||||
* @UPDATE_ASSOC_IES: Indicates whether association request IEs are updated
|
||||
*/
|
||||
enum cfg80211_connect_params_changed {
|
||||
UPDATE_ASSOC_IES = BIT(0),
|
||||
};
|
||||
|
||||
/**
|
||||
* enum wiphy_params_flags - set_wiphy_params bitfield values
|
||||
* @WIPHY_PARAM_RETRY_SHORT: wiphy->retry_short has changed
|
||||
|
@ -2380,6 +2392,14 @@ struct cfg80211_qos_map {
|
|||
* If the connection fails for some reason, call cfg80211_connect_result()
|
||||
* with the status from the AP.
|
||||
* (invoked with the wireless_dev mutex held)
|
||||
* @update_connect_params: Update the connect parameters while connected to a
|
||||
* BSS. The updated parameters can be used by driver/firmware for
|
||||
* subsequent BSS selection (roaming) decisions and to form the
|
||||
* Authentication/(Re)Association Request frames. This call does not
|
||||
* request an immediate disassociation or reassociation with the current
|
||||
* BSS, i.e., this impacts only subsequent (re)associations. The bits in
|
||||
* changed are defined in &enum cfg80211_connect_params_changed.
|
||||
* (invoked with the wireless_dev mutex held)
|
||||
* @disconnect: Disconnect from the BSS/ESS.
|
||||
* (invoked with the wireless_dev mutex held)
|
||||
*
|
||||
|
@ -2650,6 +2670,10 @@ struct cfg80211_ops {
|
|||
|
||||
int (*connect)(struct wiphy *wiphy, struct net_device *dev,
|
||||
struct cfg80211_connect_params *sme);
|
||||
int (*update_connect_params)(struct wiphy *wiphy,
|
||||
struct net_device *dev,
|
||||
struct cfg80211_connect_params *sme,
|
||||
u32 changed);
|
||||
int (*disconnect)(struct wiphy *wiphy, struct net_device *dev,
|
||||
u16 reason_code);
|
||||
|
||||
|
|
|
@ -826,6 +826,47 @@
|
|||
* not running. The driver indicates the status of the scan through
|
||||
* cfg80211_scan_done().
|
||||
*
|
||||
* @NL80211_CMD_START_NAN: Start NAN operation, identified by its
|
||||
* %NL80211_ATTR_WDEV interface. This interface must have been previously
|
||||
* created with %NL80211_CMD_NEW_INTERFACE. After it has been started, the
|
||||
* NAN interface will create or join a cluster. This command must have a
|
||||
* valid %NL80211_ATTR_NAN_MASTER_PREF attribute and optional
|
||||
* %NL80211_ATTR_NAN_DUAL attributes.
|
||||
* After this command NAN functions can be added.
|
||||
* @NL80211_CMD_STOP_NAN: Stop the NAN operation, identified by
|
||||
* its %NL80211_ATTR_WDEV interface.
|
||||
* @NL80211_CMD_ADD_NAN_FUNCTION: Add a NAN function. The function is defined
|
||||
* with %NL80211_ATTR_NAN_FUNC nested attribute. When called, this
|
||||
* operation returns the strictly positive and unique instance id
|
||||
* (%NL80211_ATTR_NAN_FUNC_INST_ID) and a cookie (%NL80211_ATTR_COOKIE)
|
||||
* of the function upon success.
|
||||
* Since instance ID's can be re-used, this cookie is the right
|
||||
* way to identify the function. This will avoid races when a termination
|
||||
* event is handled by the user space after it has already added a new
|
||||
* function that got the same instance id from the kernel as the one
|
||||
* which just terminated.
|
||||
* This cookie may be used in NAN events even before the command
|
||||
* returns, so userspace shouldn't process NAN events until it processes
|
||||
* the response to this command.
|
||||
* Look at %NL80211_ATTR_SOCKET_OWNER as well.
|
||||
* @NL80211_CMD_DEL_NAN_FUNCTION: Delete a NAN function by cookie.
|
||||
* This command is also used as a notification sent when a NAN function is
|
||||
* terminated. This will contain a %NL80211_ATTR_NAN_FUNC_INST_ID
|
||||
* and %NL80211_ATTR_COOKIE attributes.
|
||||
* @NL80211_CMD_CHANGE_NAN_CONFIG: Change current NAN configuration. NAN
|
||||
* must be operational (%NL80211_CMD_START_NAN was executed).
|
||||
* It must contain at least one of the following attributes:
|
||||
* %NL80211_ATTR_NAN_MASTER_PREF, %NL80211_ATTR_NAN_DUAL.
|
||||
* @NL80211_CMD_NAN_FUNC_MATCH: Notification sent when a match is reported.
|
||||
* This will contain a %NL80211_ATTR_NAN_MATCH nested attribute and
|
||||
* %NL80211_ATTR_COOKIE.
|
||||
*
|
||||
* @NL80211_CMD_UPDATE_CONNECT_PARAMS: Update one or more connect parameters
|
||||
* for subsequent roaming cases if the driver or firmware uses internal
|
||||
* BSS selection. This command can be issued only while connected and it
|
||||
* does not result in a change for the current association. Currently,
|
||||
* only the %NL80211_ATTR_IE data is used and updated with this command.
|
||||
*
|
||||
* @NL80211_CMD_MAX: highest used command number
|
||||
* @__NL80211_CMD_AFTER_LAST: internal use
|
||||
*/
|
||||
|
@ -1014,6 +1055,17 @@ enum nl80211_commands {
|
|||
|
||||
NL80211_CMD_ABORT_SCAN,
|
||||
|
||||
NL80211_CMD_START_NAN,
|
||||
NL80211_CMD_STOP_NAN,
|
||||
NL80211_CMD_ADD_NAN_FUNCTION,
|
||||
NL80211_CMD_DEL_NAN_FUNCTION,
|
||||
NL80211_CMD_CHANGE_NAN_CONFIG,
|
||||
NL80211_CMD_NAN_MATCH,
|
||||
|
||||
NL80211_CMD_SET_MULTICAST_TO_UNICAST,
|
||||
|
||||
NL80211_CMD_UPDATE_CONNECT_PARAMS,
|
||||
|
||||
/* add new commands above here */
|
||||
|
||||
/* used to define NL80211_CMD_MAX below */
|
||||
|
@ -1812,6 +1864,67 @@ enum nl80211_commands {
|
|||
* %NL80211_ATTR_EXT_CAPA_MASK, to specify the extended capabilities per
|
||||
* interface type.
|
||||
*
|
||||
* @NL80211_ATTR_MU_MIMO_GROUP_DATA: array of 24 bytes that defines a MU-MIMO
|
||||
* groupID for monitor mode.
|
||||
* The first 8 bytes are a mask that defines the membership in each
|
||||
* group (there are 64 groups, group 0 and 63 are reserved),
|
||||
* each bit represents a group and set to 1 for being a member in
|
||||
* that group and 0 for not being a member.
|
||||
* The remaining 16 bytes define the position in each group: 2 bits for
|
||||
* each group.
|
||||
* (smaller group numbers represented on most significant bits and bigger
|
||||
* group numbers on least significant bits.)
|
||||
* This attribute is used only if all interfaces are in monitor mode.
|
||||
* Set this attribute in order to monitor packets using the given MU-MIMO
|
||||
* groupID data.
|
||||
* to turn off that feature set all the bits of the groupID to zero.
|
||||
* @NL80211_ATTR_MU_MIMO_FOLLOW_MAC_ADDR: mac address for the sniffer to follow
|
||||
* when using MU-MIMO air sniffer.
|
||||
* to turn that feature off set an invalid mac address
|
||||
* (e.g. FF:FF:FF:FF:FF:FF)
|
||||
*
|
||||
* @NL80211_ATTR_SCAN_START_TIME_TSF: The time at which the scan was actually
|
||||
* started (u64). The time is the TSF of the BSS the interface that
|
||||
* requested the scan is connected to (if available, otherwise this
|
||||
* attribute must not be included).
|
||||
* @NL80211_ATTR_SCAN_START_TIME_TSF_BSSID: The BSS according to which
|
||||
* %NL80211_ATTR_SCAN_START_TIME_TSF is set.
|
||||
* @NL80211_ATTR_MEASUREMENT_DURATION: measurement duration in TUs (u16). If
|
||||
* %NL80211_ATTR_MEASUREMENT_DURATION_MANDATORY is not set, this is the
|
||||
* maximum measurement duration allowed. This attribute is used with
|
||||
* measurement requests. It can also be used with %NL80211_CMD_TRIGGER_SCAN
|
||||
* if the scan is used for beacon report radio measurement.
|
||||
* @NL80211_ATTR_MEASUREMENT_DURATION_MANDATORY: flag attribute that indicates
|
||||
* that the duration specified with %NL80211_ATTR_MEASUREMENT_DURATION is
|
||||
* mandatory. If this flag is not set, the duration is the maximum duration
|
||||
* and the actual measurement duration may be shorter.
|
||||
*
|
||||
* @NL80211_ATTR_MESH_PEER_AID: Association ID for the mesh peer (u16). This is
|
||||
* used to pull the stored data for mesh peer in power save state.
|
||||
*
|
||||
* @NL80211_ATTR_NAN_MASTER_PREF: the master preference to be used by
|
||||
* %NL80211_CMD_START_NAN and optionally with
|
||||
* %NL80211_CMD_CHANGE_NAN_CONFIG. Its type is u8 and it can't be 0.
|
||||
* Also, values 1 and 255 are reserved for certification purposes and
|
||||
* should not be used during a normal device operation.
|
||||
* @NL80211_ATTR_NAN_DUAL: NAN dual band operation config (see
|
||||
* &enum nl80211_nan_dual_band_conf). This attribute is used with
|
||||
* %NL80211_CMD_START_NAN and optionally with
|
||||
* %NL80211_CMD_CHANGE_NAN_CONFIG.
|
||||
* @NL80211_ATTR_NAN_FUNC: a function that can be added to NAN. See
|
||||
* &enum nl80211_nan_func_attributes for description of this nested
|
||||
* attribute.
|
||||
* @NL80211_ATTR_NAN_MATCH: used to report a match. This is a nested attribute.
|
||||
* See &enum nl80211_nan_match_attributes.
|
||||
* @NL80211_ATTR_FILS_KEK: KEK for FILS (Re)Association Request/Response frame
|
||||
* protection.
|
||||
* @NL80211_ATTR_FILS_NONCES: Nonces (part of AAD) for FILS (Re)Association
|
||||
* Request/Response frame protection. This attribute contains the 16 octet
|
||||
* STA Nonce followed by 16 octets of AP Nonce.
|
||||
*
|
||||
* @NL80211_ATTR_MULTICAST_TO_UNICAST_ENABLED: Indicates whether or not multicast
|
||||
* packets should be send out as unicast to all stations (flag attribute).
|
||||
*
|
||||
* @NUM_NL80211_ATTR: total number of nl80211_attrs available
|
||||
* @NL80211_ATTR_MAX: highest attribute number currently defined
|
||||
* @__NL80211_ATTR_AFTER_LAST: internal use
|
||||
|
@ -2196,6 +2309,26 @@ enum nl80211_attrs {
|
|||
|
||||
NL80211_ATTR_IFTYPE_EXT_CAPA,
|
||||
|
||||
NL80211_ATTR_MU_MIMO_GROUP_DATA,
|
||||
NL80211_ATTR_MU_MIMO_FOLLOW_MAC_ADDR,
|
||||
|
||||
NL80211_ATTR_SCAN_START_TIME_TSF,
|
||||
NL80211_ATTR_SCAN_START_TIME_TSF_BSSID,
|
||||
NL80211_ATTR_MEASUREMENT_DURATION,
|
||||
NL80211_ATTR_MEASUREMENT_DURATION_MANDATORY,
|
||||
|
||||
NL80211_ATTR_MESH_PEER_AID,
|
||||
|
||||
NL80211_ATTR_NAN_MASTER_PREF,
|
||||
NL80211_ATTR_NAN_DUAL,
|
||||
NL80211_ATTR_NAN_FUNC,
|
||||
NL80211_ATTR_NAN_MATCH,
|
||||
|
||||
NL80211_ATTR_FILS_KEK,
|
||||
NL80211_ATTR_FILS_NONCES,
|
||||
|
||||
NL80211_ATTR_MULTICAST_TO_UNICAST_ENABLED,
|
||||
|
||||
/* add attributes here, update the policy in nl80211.c */
|
||||
|
||||
__NL80211_ATTR_AFTER_LAST,
|
||||
|
|
|
@ -1551,6 +1551,7 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
|
|||
if (rdev->wiphy.features &
|
||||
NL80211_FEATURE_SUPPORTS_WMM_ADMISSION)
|
||||
CMD(add_tx_ts, ADD_TX_TS);
|
||||
CMD(update_connect_params, UPDATE_CONNECT_PARAMS);
|
||||
}
|
||||
/* add into the if now */
|
||||
#undef CMD
|
||||
|
@ -8329,6 +8330,37 @@ static int nl80211_connect(struct sk_buff *skb, struct genl_info *info)
|
|||
return err;
|
||||
}
|
||||
|
||||
static int nl80211_update_connect_params(struct sk_buff *skb,
|
||||
struct genl_info *info)
|
||||
{
|
||||
struct cfg80211_connect_params connect = {};
|
||||
struct cfg80211_registered_device *rdev = info->user_ptr[0];
|
||||
struct net_device *dev = info->user_ptr[1];
|
||||
struct wireless_dev *wdev = dev->ieee80211_ptr;
|
||||
u32 changed = 0;
|
||||
int ret;
|
||||
|
||||
if (!rdev->ops->update_connect_params)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
if (info->attrs[NL80211_ATTR_IE]) {
|
||||
if (!is_valid_ie_attr(info->attrs[NL80211_ATTR_IE]))
|
||||
return -EINVAL;
|
||||
connect.ie = nla_data(info->attrs[NL80211_ATTR_IE]);
|
||||
connect.ie_len = nla_len(info->attrs[NL80211_ATTR_IE]);
|
||||
changed |= UPDATE_ASSOC_IES;
|
||||
}
|
||||
|
||||
wdev_lock(dev->ieee80211_ptr);
|
||||
if (!wdev->current_bss)
|
||||
ret = -ENOLINK;
|
||||
else
|
||||
ret = rdev_update_connect_params(rdev, dev, &connect, changed);
|
||||
wdev_unlock(dev->ieee80211_ptr);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int nl80211_disconnect(struct sk_buff *skb, struct genl_info *info)
|
||||
{
|
||||
struct cfg80211_registered_device *rdev = info->user_ptr[0];
|
||||
|
@ -11205,6 +11237,14 @@ static const struct genl_ops nl80211_ops[] = {
|
|||
.internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
|
||||
NL80211_FLAG_NEED_RTNL,
|
||||
},
|
||||
{
|
||||
.cmd = NL80211_CMD_UPDATE_CONNECT_PARAMS,
|
||||
.doit = nl80211_update_connect_params,
|
||||
.policy = nl80211_policy,
|
||||
.flags = GENL_ADMIN_PERM,
|
||||
.internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
|
||||
NL80211_FLAG_NEED_RTNL,
|
||||
},
|
||||
{
|
||||
.cmd = NL80211_CMD_DISCONNECT,
|
||||
.doit = nl80211_disconnect,
|
||||
|
|
|
@ -489,6 +489,18 @@ static inline int rdev_connect(struct cfg80211_registered_device *rdev,
|
|||
return ret;
|
||||
}
|
||||
|
||||
static inline int
|
||||
rdev_update_connect_params(struct cfg80211_registered_device *rdev,
|
||||
struct net_device *dev,
|
||||
struct cfg80211_connect_params *sme, u32 changed)
|
||||
{
|
||||
int ret;
|
||||
trace_rdev_update_connect_params(&rdev->wiphy, dev, sme, changed);
|
||||
ret = rdev->ops->update_connect_params(&rdev->wiphy, dev, sme, changed);
|
||||
trace_rdev_return_int(&rdev->wiphy, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline int rdev_disconnect(struct cfg80211_registered_device *rdev,
|
||||
struct net_device *dev, u16 reason_code)
|
||||
{
|
||||
|
|
|
@ -1243,6 +1243,24 @@ TRACE_EVENT(rdev_connect,
|
|||
__entry->wpa_versions, __entry->flags, MAC_PR_ARG(prev_bssid))
|
||||
);
|
||||
|
||||
TRACE_EVENT(rdev_update_connect_params,
|
||||
TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
|
||||
struct cfg80211_connect_params *sme, u32 changed),
|
||||
TP_ARGS(wiphy, netdev, sme, changed),
|
||||
TP_STRUCT__entry(
|
||||
WIPHY_ENTRY
|
||||
NETDEV_ENTRY
|
||||
__field(u32, changed)
|
||||
),
|
||||
TP_fast_assign(
|
||||
WIPHY_ASSIGN;
|
||||
NETDEV_ASSIGN;
|
||||
__entry->changed = changed;
|
||||
),
|
||||
TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", parameters changed: %u",
|
||||
WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->changed)
|
||||
);
|
||||
|
||||
TRACE_EVENT(rdev_set_cqm_rssi_config,
|
||||
TP_PROTO(struct wiphy *wiphy,
|
||||
struct net_device *netdev, s32 rssi_thold,
|
||||
|
|
Loading…
Add table
Reference in a new issue