cfg80211: P2P find phase offload
PATCH v4 1/2 cfg80211: P2P find phase offload
Allow to implement P2P find phase in the driver/firmware.
Offload scheme designed as follows:
- Driver provide methods start_p2p_find and stop_p2p_find in the cfg80211_ops;
- Driver indicate firmware or driver responds to the probe requests by setting feature NL80211_FEATURE_P2P_PROBE_RESP_OFFLOAD
- wpa_supplicant analyses methods supported to discover p2p offload support;
- wpa_supplicant analyses feature flags to discover p2p probe response offload support;
to perform p2p scan, wpa_supplicant:
- perform legacy scan, through driver's cfg80211_ops 'scan' method
- configure rx management filter to get probe-request and probe-response frames
- start p2p find via driver's cfg80211_ops start_p2p_find method
- driver start p2p find with hardware and notify wpa_supplicant with cfg80211_p2p_find_notify_start()
- driver/firmware toggle search/listen states. Received probe-request and probe-response frames passed to the wpa_supplicant via cfg80211_rx_mgmt
- when wpa_supplicant wants to stop p2p find, it calls driver's cfg80211_ops stop_p2p_find method. Alternatively, driver/firmware may decide to stop p2p find. In all cases, driver notifies wpa_supplicant using cfg80211_p2p_find_notify_end()
All driver to user space communication done through nl80211 layer.
Offloaded P2P find does not support variations like progressive scan.
--- include/net/cfg80211.h | 60 +++++++++++++++ include/uapi/linux/nl80211.h | 13 ++++ net/wireless/nl80211.c | 167 ++++++++++++++++++++++++++++++++++++++++++ net/wireless/rdev-ops.h | 19 +++++ net/wireless/trace.h | 34 +++++++++ 5 files changed, 293 insertions(+)
include/net/cfg80211.h +60 -0
@@ -1780,6 +1780,34 @@ struct cfg80211_update_ft_ies_params { };/** +* struct cfg80211_p2p_find_params - parameters for P2P find +* @probe_ie: extra IE's for probe frames +* @probe_ie_len: length, bytes, of @probe_ie +* @probe_resp_ie: extra IE's for probe response frames +* @probe_resp_ie_len: length, bytes, of @probe_resp_ie +* Driver/firmware may add additional IE's as well as modify +* provided ones; typical IE's to be added are +* WLAN_EID_EXT_SUPP_RATES, WLAN_EID_DS_PARAMS, +* WLAN_EID_HT_CAPABILITY. +* @min_discoverable_interval: and +* @max_discoverable_interval: min/max for random multiplier of 100TU's +* for the listen state duration +* @n_channels: number of channels to operate on +* @channels: channels to operate on +*/ +struct cfg80211_p2p_find_params { +const u8 *probe_ie; +size_t probe_ie_len; +const u8 *probe_resp_ie; +size_t probe_resp_ie_len; +u32 min_discoverable_interval; +u32 max_discoverable_interval; + +int n_channels; +struct ieee80211_channel **channels; +}; + +/** * struct cfg80211_ops - backend description for wireless configuration * * This struct is registered by fullmac card drivers and/or wireless stacks
@@ -1998,6 +2026,15 @@ struct cfg80211_update_ft_ies_params {* advertise the support for MAC based ACL have to implement this callback. * * @start_radar_detection: Start radar detection in the driver. +* +* start_p2p_find: start P2P find phase +* Parameters include IEs for probe/probe-resp frames; +* and channels to operate on. +* Parameters are not retained after call, driver need to copy data if +* it need it later. +* P2P find can't run concurrently with ROC or scan, and driver should +* check this. +* stop_p2p_find: stop P2P find phase */ struct cfg80211_ops {int (*suspend)(struct wiphy *wiphy,struct cfg80211_wowlan *wow);
@@ -2227,6 +2264,12 @@ struct cfg80211_ops { struct cfg80211_chan_def *chandef);int (*update_ft_ies)(struct wiphy *wiphy,struct net_device *dev,struct cfg80211_update_ft_ies_params *ftie); + +int (*start_p2p_find)(struct wiphy *wiphy, +struct wireless_dev *wdev, +struct cfg80211_p2p_find_params *params); +void (*stop_p2p_find)(struct wiphy *wiphy, +struct wireless_dev *wdev); };/*
@@ -4122,6 +4165,23 @@ void cfg80211_report_wowlan_wakeup(struct wireless_dev *wdev,struct cfg80211_wowlan_wakeup *wakeup, gfp_t gfp); +/** +* cfg80211_p2p_find_notify_start - report p2p find phase started +* @wdev: the wireless device reporting the event +* @gfp: allocation flags +*/ +void cfg80211_p2p_find_notify_start (struct wireless_dev *wdev,gfp_t gfp); + +/** +* cfg80211_p2p_find_notify_end - report p2p find phase ended +* @wdev: the wireless device reporting the event +* @gfp: allocation flags +* +* p2p find phase may be ended either unsolicited or in response to +* ops->p2p_stop_find +*/ +void cfg80211_p2p_find_notify_end (struct wireless_dev *wdev,gfp_t gfp); +/* Logging, debugging and troubleshooting/diagnostic helpers. */ /* wiphy_printk helpers, similar to dev_printk */
include/uapi/linux/nl80211.h +13 -0
@@ -798,6 +798,9 @@ enum nl80211_commands {NL80211_CMD_UPDATE_FT_IES ,NL80211_CMD_FT_EVENT , +NL80211_CMD_START_P2P_FIND , + NL80211_CMD_STOP_P2P_FIND, +/* add new commands above here */ /* used to define NL80211_CMD_MAX below */
@@ -1414,6 +1417,10 @@ enum nl80211_commands {* @NL80211_ATTR_IE_RIC: Resource Information Container Information * Element * +* @NL80211_ATTR_MIN_DISCOVERABLE_INTERVAL: +* @NL80211_ATTR_MAX_DISCOVERABLE_INTERVAL: min/max discoverable interval +* for the p2p find, represented as u32 +* * @NL80211_ATTR_MAX: highest attribute number currently defined * @__NL80211_ATTR_AFTER_LAST: internal use */
@@ -1709,6 +1716,9 @@ enum nl80211_attrs {NL80211_ATTR_MDID ,NL80211_ATTR_IE_RIC , +NL80211_ATTR_MIN_DISCOVERABLE_INTERVAL , +NL80211_ATTR_MAX_DISCOVERABLE_INTERVAL , +/* add attributes here, update the policy in nl80211.c */ __NL80211_ATTR_AFTER_LAST,
@@ -3538,6 +3548,8 @@ enum nl80211_ap_sme_features {* Peering Management entity which may be implemented by registering for * beacons or NL80211_CMD_NEW_PEER_CANDIDATE events. The mesh beacon is * still generated by the driver. +* @NL80211_FEATURE_P2P_PROBE_RESP_OFFLOAD: When in P2P find phase, +* the device responds to probe-requests in hardware. */ enum nl80211_feature_flags {NL80211_FEATURE_SK_TX_STATUS =1 <<0 ,
@@ -3557,6 +3569,7 @@ enum nl80211_feature_flags {NL80211_FEATURE_ADVERTISE_CHAN_LIMITS =1 <<14 ,NL80211_FEATURE_FULL_AP_CLIENT_STATE =1 <<15 ,NL80211_FEATURE_USERSPACE_MPM =1 <<16 , + NL80211_FEATURE_P2P_PROBE_RESP_OFFLOAD = 1 << 17, };/**
net/wireless/nl80211.c +167 -0
197 lines not on this page · raw message
net/wireless/rdev-ops.h +19 -0
@@ -901,4 +901,23 @@ static inline int rdev_update_ft_ies(struct cfg80211_registered_device *rdev, return ret; } +static inline int rdev_start_p2p_find (struct cfg80211_registered_device *rdev, +struct wireless_dev *wdev, +struct cfg80211_p2p_find_params *params) +{ +int ret; +trace_rdev_start_p2p_find (&rdev->wiphy, wdev, params); + ret = rdev->ops->start_p2p_find (&rdev->wiphy, wdev, params); +trace_rdev_return_int (&rdev->wiphy, ret); +return ret; +} + +static inline void rdev_stop_p2p_find (struct cfg80211_registered_device *rdev, +struct wireless_dev *wdev) +{ +trace_rdev_stop_p2p_find (&rdev->wiphy, wdev); + rdev->ops->stop_p2p_find (&rdev->wiphy, wdev); +trace_rdev_return_void (&rdev->wiphy); +} +#endif /* __CFG80211_RDEV_OPS */
net/wireless/trace.h +34 -0
@@ -1805,6 +1805,26 @@ TRACE_EVENT(rdev_update_ft_ies, WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->md) ); +TRACE_EVENT (rdev_start_p2p_find, + TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, + struct cfg80211_p2p_find_params *params), +TP_ARGS (wiphy, wdev, params), +TP_STRUCT__entry ( +WIPHY_ENTRY + WDEV_ENTRY + ), +TP_fast_assign ( + WIPHY_ASSIGN; + WDEV_ASSIGN; + ), +TP_printk (WIPHY_PR_FMT ", " WDEV_PR_FMT ,WIPHY_PR_ARG ,WDEV_PR_ARG ) +); + +DEFINE_EVENT (wiphy_wdev_evt, rdev_stop_p2p_find, + TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev), +TP_ARGS (wiphy, wdev) +); +/************************************************************* * cfg80211 exported functions traces * *************************************************************/
@@ -2459,6 +2479,20 @@ TRACE_EVENT(cfg80211_ft_event, WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(target_ap)) ); +TRACE_EVENT (cfg80211_p2p_find_notify, + TP_PROTO(struct wireless_dev *wdev, int cmd), +TP_ARGS (wdev, cmd), +TP_STRUCT__entry ( + WDEV_ENTRY +__field (int, cmd) + ), +TP_fast_assign ( + WDEV_ASSIGN; + __entry->cmd = cmd; + ), +TP_printk (WDEV_PR_FMT ", cmd: %d" ,WDEV_PR_ARG , __entry->cmd) +); +#endif /* !__RDEV_OPS_TRACE || TRACE_HEADER_MULTI_READ */ #undef TRACE_INCLUDE_PATH
Signature · 1 line
1.7.10.4
Quoted 27 lines · Vladimir Kondratiev
Allow to implement P2P find phase in the driver/firmware.
Offload scheme designed as follows:
- Driver provide methods
start_p2p_findandstop_p2p_findin thecfg80211_ops;
- Driver indicate firmware or driver responds to the probe requests by setting featureNL80211_FEATURE_P2P_PROBE_RESP_OFFLOAD
-wpa_supplicantanalyses methods supported to discover p2p offload support;
-wpa_supplicantanalyses feature flags to discover p2p probe response offload support;
to perform p2p scan,wpa_supplicant:
- perform legacy scan, through driver'scfg80211_ops'scan' method
- configure rx management filter to get probe-request and probe-response frames
- start p2p find via driver'scfg80211_opsstart_p2p_findmethod
- driver start p2p find with hardware and notifywpa_supplicantwithcfg80211_p2p_find_notify_start()
- driver/firmware toggle search/listen states. Received probe-request and probe-response frames passed to thewpa_supplicantviacfg80211_rx_mgmt
- whenwpa_supplicantwants to stop p2p find, it calls driver'scfg80211_opsstop_p2p_findmethod. Alternatively, driver/firmware may decide to stop p2p find. In all cases, driver notifieswpa_supplicantusingcfg80211_p2p_find_notify_end()All driver to user space communication done through nl80211 layer.
Offloaded P2P find does not support variations like progressive scan.
Quoted 9 lines
Signed-off-by Vladimir Kondratiev <[email protected]>--- include/net/cfg80211.h | 60 +++++++++++++++ include/uapi/linux/nl80211.h | 13 ++++ net/wireless/nl80211.c | 167 ++++++++++++++++++++++++++++++++++++++++++ net/wireless/rdev-ops.h | 19 +++++ net/wireless/trace.h | 34 +++++++++ 5 files changed, 293 insertions(+)
Hi Johannes,
Could you please comment on this patch status? I was under impression I did all as we discussed and it is going to be merged, but maybe I missed something. I was on long vacation.
Do you want me to rebase and resend?
Thanks, Vladimir
Johannes Berg
maintainerQuoted 23 lines · Vladimir Kondratiev
Allow to implement P2P find phase in the driver/firmware.
Offload scheme designed as follows:
- Driver provide methods
start_p2p_findandstop_p2p_findin thecfg80211_ops;
- Driver indicate firmware or driver responds to the probe requests by setting featureNL80211_FEATURE_P2P_PROBE_RESP_OFFLOAD
-wpa_supplicantanalyses methods supported to discover p2p offload support;
-wpa_supplicantanalyses feature flags to discover p2p probe response offload support;
to perform p2p scan,wpa_supplicant:
- perform legacy scan, through driver'scfg80211_ops'scan' method
- configure rx management filter to get probe-request and probe-response frames
- start p2p find via driver'scfg80211_opsstart_p2p_findmethod
- driver start p2p find with hardware and notifywpa_supplicantwithcfg80211_p2p_find_notify_start()
- driver/firmware toggle search/listen states. Received probe-request and probe-response frames passed to thewpa_supplicantviacfg80211_rx_mgmt
- whenwpa_supplicantwants to stop p2p find, it calls driver'scfg80211_opsstop_p2p_findmethod. Alternatively, driver/firmware may decide to stop p2p find. In all cases, driver notifieswpa_supplicantusingcfg80211_p2p_find_notify_end()
Quoted 3 lines
All driver to user space communication done through nl80211 layer.
Offloaded P2P find does not support variations like progressive scan.
Ok :)
I have a conceptual question: As I understand it, this is going to be required, ie. the device might not support P2P Find using remain-on-channel, if this offload is supported. Right?
Quoted 7 lines
+/**
+ *cfg80211_p2p_find_notify_end- report p2p find phase ended
+ * @wdev: the wireless device reporting the event
+ * @gfp: allocation flags
+ *
+ * p2p find phase may be ended either unsolicited or in response to
+ *ops->p2p_stop_find
Does that mean if the p2p_stop_find operation is called, this must also be called? I'm guessing so, but it'd be good to spell it out explicitly.
Quoted 3 lines
+ * @NL80211_ATTR_MIN_DISCOVERABLE_INTERVAL:
+ * @NL80211_ATTR_MAX_DISCOVERABLE_INTERVAL: min/max discoverable interval
+ * for the p2p find, represented as u32
Could you please also say here that it's a multiple of 100 TUs?
net/wireless/nl80211.c static int nl80211_send_wiphy(struct cfg80211_registered_device *dev, · line 1423
Quoted 6 lines
net/wireless/nl80211.c +2
-0@@ -1417,6 +1419,8 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *dev, }CMD (start_p2p_device,START_P2P_DEVICE );CMD (set_mcast_rate,SET_MCAST_RATE ); +CMD (start_p2p_find,START_P2P_FIND ); +CMD (stop_p2p_find,STOP_P2P_FIND );
For the wiphy size limitation thing, you need to put this into
if (split) {
CMD(...)
CMD(...)
}There's another patch pending that would then conflict here, but I can sort out that problem.
Quoted 4 lines
net/wireless/nl80211.c +4
-0+static int nl80211_start_p2p_find (struct sk_buff *skb,struct genl_info *info) +{ +struct cfg80211_registered_device *rdev = info->user_ptr[0 ]; +struct wireless_dev *wdev = info->user_ptr[1 ];
net/wireless/nl80211.c static int nl80211_update_ft_ies(struct sk_buff *skb, struct genl_info *info) · line 8216
Quoted 10 lines
net/wireless/nl80211.c +10
-0+struct wiphy *wiphy = &rdev->wiphy; +struct cfg80211_p2p_find_params params = {}; +struct nlattr *attr_freq = info->attrs[NL80211_ATTR_SCAN_FREQUENCIES ]; +struct nlattr *attr; +int err, tmp, n_channels, i =0 ; +struct ieee80211_channel **channels =NULL ; + +switch (wdev->iftype) { +case NL80211_IFTYPE_P2P_DEVICE : +case NL80211_IFTYPE_STATION :
I think we (Intel) would also require to use the P2P_DEVICE for this call, so maybe we should document in the nl80211 command that if P2P_DEVICE is supported, this command is only supported on the _P2P_DEVICE and not on _STATION? Anyway that'd be my assumption right now that it gets used on whichever is used for P2P Device functionality, so that shouldn't change anything in the supplicant just clarify the API a bit.
Btw, do you have supplicant patches already?
net/wireless/nl80211.c static int nl80211_update_ft_ies(struct sk_buff *skb, struct genl_info *info) · line 8234
Quoted 1 line
net/wireless/nl80211.c +1
-0+if (attr_freq) {
Is there value in supporting this call w/o any frequencies set? It seems to me that the driver would be confused if it got no channels at all?
Quoted 6 lines
net/wireless/nl80211.c +6
-0+ n_channels =validate_scan_freqs (attr_freq); +if (!n_channels) +return -EINVAL ; + + channels =kzalloc (n_channels *sizeof (*channels),GFP_KERNEL ); +if (!channels)
net/wireless/nl80211.c static int nl80211_update_ft_ies(struct sk_buff *skb, struct genl_info *info) · line 8250
Quoted 10 lines
net/wireless/nl80211.c +10
-0+return -ENOMEM ; + +/* user specified, bail out if channel not found */ +nla_for_each_nested (attr, attr_freq, tmp) { +struct ieee80211_channel *chan; + + chan =ieee80211_get_channel (wiphy,nla_get_u32 (attr)); + +if (!chan) +return -EINVAL ;
This leaks memory, no?
net/wireless/nl80211.c static int nl80211_update_ft_ies(struct sk_buff *skb, struct genl_info *info) · line 8262
Quoted 4 lines
net/wireless/nl80211.c +4
-0+if (!i) { + err = -EINVAL ; + goto out_free; + }
And here you refuse an empty channel list, but a not-present one still got accepted above, I think you should change that (which also saves you a level of indentation here :P)
net/wireless/trace.h TRACE_EVENT(rdev_update_ft_ies, · line 1821
Quoted 10 lines
net/wireless/trace.h +10
-0+TP_STRUCT__entry ( + WIPHY_ENTRY + WDEV_ENTRY + ), +TP_fast_assign ( + WIPHY_ASSIGN; +WDEV_ASSIGN ; + ), +TP_printk (WIPHY_PR_FMT ", " WDEV_PR_FMT ,WIPHY_PR_ARG ,WDEV_PR_ARG ) +);
I think it'd be worthwhile to trace a bit more data, like the timings for example? Maybe not the IEs and channel list (those are tricky anyway), but the easy ones?
johannes
A message that is not in the archive (sent off-list or not yet received): 1919054.NIDM1uk7ud@lx-vladimir
PATCH v5 1/1 cfg80211: P2P find phase offload
Sending updated version.
- all comments for v4; but not accept empty frequencies array if it is given. for "all frequencies" frequencies attribute should be omitted.
- rebase
patch follows
Quoted 1 line
From
3d5d4d841b42ac44feb892638637a82f00400fe1Mon Sep 17 00:00:00 2001
From: Vladimir Kondratiev <[email protected]>
Date: Sun, 10 Mar 2013 15:52:37 +0200
Subject: [PATCH v5] cfg80211: P2P find phase offload
To: Johannes Berg <[email protected]>
Cc: Luis R. Rodriguez <[email protected]>,
John W. Linville <[email protected]>, Jouni Malinen <[email protected]>, [email protected]
Allow to implement P2P find phase in the driver/firmware.
Offload scheme designed as follows:
- Driver provide methods start_p2p_find and stop_p2p_find in the cfg80211_ops;
- Driver indicate firmware or driver responds to the probe requests by setting feature NL80211_FEATURE_P2P_PROBE_RESP_OFFLOAD
- wpa_supplicant analyses methods supported to discover p2p offload support;
- wpa_supplicant analyses feature flags to discover p2p probe response offload support;
to perform p2p scan, wpa_supplicant:
- perform legacy scan, through driver's cfg80211_ops 'scan' method
- configure rx management filter to get probe-request and probe-response frames
- start p2p find via driver's cfg80211_ops start_p2p_find method
- driver start p2p find with hardware and notify wpa_supplicant with cfg80211_p2p_find_notify_start()
- driver/firmware toggle search/listen states. Received probe-request and probe-response frames passed to the wpa_supplicant via cfg80211_rx_mgmt
- when wpa_supplicant wants to stop p2p find, it calls driver's cfg80211_ops stop_p2p_find method. Alternatively, driver/firmware may decide to stop p2p find. In all cases, driver notifies wpa_supplicant using cfg80211_p2p_find_notify_end()
All driver to user space communication done through nl80211 layer.
Offloaded P2P find does not support variations like progressive scan.
--- include/net/cfg80211.h | 63 ++++++++++++++++ include/uapi/linux/nl80211.h | 13 ++++ net/wireless/nl80211.c | 169 ++++++++++++++++++++++++++++++++++++++++++ net/wireless/rdev-ops.h | 19 +++++ net/wireless/trace.h | 43 +++++++++++ 5 files changed, 307 insertions(+)
include/net/cfg80211.h +63 -0
@@ -1780,6 +1780,34 @@ struct cfg80211_update_ft_ies_params { };/** +* struct cfg80211_p2p_find_params - parameters for P2P find +* @probe_ie: extra IE's for probe frames +* @probe_ie_len: length, bytes, of @probe_ie +* @probe_resp_ie: extra IE's for probe response frames +* @probe_resp_ie_len: length, bytes, of @probe_resp_ie +* Driver/firmware may add additional IE's as well as modify +* provided ones; typical IE's to be added are +* WLAN_EID_EXT_SUPP_RATES, WLAN_EID_DS_PARAMS, +* WLAN_EID_HT_CAPABILITY. +* @min_discoverable_interval: and +* @max_discoverable_interval: min/max for random multiplier of 100TU's +* for the listen state duration +* @n_channels: number of channels to operate on +* @channels: channels to operate on +*/ +struct cfg80211_p2p_find_params { +const u8 *probe_ie; +size_t probe_ie_len; +const u8 *probe_resp_ie; +size_t probe_resp_ie_len; +u32 min_discoverable_interval; +u32 max_discoverable_interval; + +int n_channels; +struct ieee80211_channel **channels; +}; + +/** * struct cfg80211_ops - backend description for wireless configuration * * This struct is registered by fullmac card drivers and/or wireless stacks
@@ -2002,6 +2030,15 @@ struct cfg80211_update_ft_ies_params {* @update_ft_ies: Provide updated Fast BSS Transition information to the * driver. If the SME is in the driver/firmware, this information can be * used in building Authentication and Reassociation Request frames. +* +* start_p2p_find: start P2P find phase +* Parameters include IEs for probe/probe-resp frames; +* and channels to operate on. +* Parameters are not retained after call, driver need to copy data if +* it need it later. +* P2P find can't run concurrently with ROC or scan, and driver should +* check this. +* stop_p2p_find: stop P2P find phase */ struct cfg80211_ops {int (*suspend)(struct wiphy *wiphy,struct cfg80211_wowlan *wow);
@@ -2231,6 +2268,12 @@ struct cfg80211_ops { struct cfg80211_chan_def *chandef);int (*update_ft_ies)(struct wiphy *wiphy,struct net_device *dev,struct cfg80211_update_ft_ies_params *ftie); + +int (*start_p2p_find)(struct wiphy *wiphy, +struct wireless_dev *wdev, +struct cfg80211_p2p_find_params *params); +void (*stop_p2p_find)(struct wiphy *wiphy, +struct wireless_dev *wdev); };/*
@@ -4126,6 +4169,26 @@ void cfg80211_report_wowlan_wakeup(struct wireless_dev *wdev,struct cfg80211_wowlan_wakeup *wakeup, gfp_t gfp); +/** +* cfg80211_p2p_find_notify_start - report p2p find phase started +* @wdev: the wireless device reporting the event +* @gfp: allocation flags +*/ +void cfg80211_p2p_find_notify_start (struct wireless_dev *wdev,gfp_t gfp); + +/** +* cfg80211_p2p_find_notify_end - report p2p find phase ended +* @wdev: the wireless device reporting the event +* @gfp: allocation flags +* +* p2p find phase may be ended either unsolicited or in response to +* ops->p2p_stop_find +* +* In any case, if @start_p2p_find from driver's struct cfg80211_ops called, +* @cfg80211_p2p_find_notify_end should be eventually called +*/ +void cfg80211_p2p_find_notify_end (struct wireless_dev *wdev,gfp_t gfp); +/* Logging, debugging and troubleshooting/diagnostic helpers. */ /* wiphy_printk helpers, similar to dev_printk */
include/uapi/linux/nl80211.h +13 -0
@@ -798,6 +798,9 @@ enum nl80211_commands {NL80211_CMD_UPDATE_FT_IES ,NL80211_CMD_FT_EVENT , +NL80211_CMD_START_P2P_FIND , + NL80211_CMD_STOP_P2P_FIND, +/* add new commands above here */ /* used to define NL80211_CMD_MAX below */
@@ -1414,6 +1417,10 @@ enum nl80211_commands {* @NL80211_ATTR_IE_RIC: Resource Information Container Information * Element * +* @NL80211_ATTR_MIN_DISCOVERABLE_INTERVAL: +* @NL80211_ATTR_MAX_DISCOVERABLE_INTERVAL: min/max discoverable interval +* for the p2p find, multiple of 100 TUs, represented as u32 +* * @NL80211_ATTR_MAX: highest attribute number currently defined * @__NL80211_ATTR_AFTER_LAST: internal use */
@@ -1709,6 +1716,9 @@ enum nl80211_attrs {NL80211_ATTR_MDID ,NL80211_ATTR_IE_RIC , +NL80211_ATTR_MIN_DISCOVERABLE_INTERVAL , +NL80211_ATTR_MAX_DISCOVERABLE_INTERVAL , +/* add attributes here, update the policy in nl80211.c */ __NL80211_ATTR_AFTER_LAST,
@@ -3538,6 +3548,8 @@ enum nl80211_ap_sme_features {* Peering Management entity which may be implemented by registering for * beacons or NL80211_CMD_NEW_PEER_CANDIDATE events. The mesh beacon is * still generated by the driver. +* @NL80211_FEATURE_P2P_PROBE_RESP_OFFLOAD: When in P2P find phase, +* the device responds to probe-requests in hardware. */ enum nl80211_feature_flags {NL80211_FEATURE_SK_TX_STATUS =1 <<0 ,
@@ -3557,6 +3569,7 @@ enum nl80211_feature_flags {NL80211_FEATURE_ADVERTISE_CHAN_LIMITS =1 <<14 ,NL80211_FEATURE_FULL_AP_CLIENT_STATE =1 <<15 ,NL80211_FEATURE_USERSPACE_MPM =1 <<16 , + NL80211_FEATURE_P2P_PROBE_RESP_OFFLOAD = 1 << 17, };/**
net/wireless/nl80211.c +169 -0
199 lines not on this page · raw message
net/wireless/rdev-ops.h +19 -0
@@ -901,4 +901,23 @@ static inline int rdev_update_ft_ies(struct cfg80211_registered_device *rdev, return ret; } +static inline int rdev_start_p2p_find (struct cfg80211_registered_device *rdev, +struct wireless_dev *wdev, +struct cfg80211_p2p_find_params *params) +{ +int ret; +trace_rdev_start_p2p_find (&rdev->wiphy, wdev, params); + ret = rdev->ops->start_p2p_find (&rdev->wiphy, wdev, params); +trace_rdev_return_int (&rdev->wiphy, ret); +return ret; +} + +static inline void rdev_stop_p2p_find (struct cfg80211_registered_device *rdev, +struct wireless_dev *wdev) +{ +trace_rdev_stop_p2p_find (&rdev->wiphy, wdev); + rdev->ops->stop_p2p_find (&rdev->wiphy, wdev); +trace_rdev_return_void (&rdev->wiphy); +} +#endif /* __CFG80211_RDEV_OPS */
net/wireless/trace.h +43 -0
55 lines not on this page · raw message
Signature · 1 line
1.7.10.4
Johannes Berg
maintainerQuoted 8 lines · Vladimir Kondratiev
Quoted 6 lines
For the wiphy size limitation thing, you need to put this into
if (split) {
CMD(...)
CMD(...)
}OK, so do I need to handle this 'if (split)' or you will do so?
Please do. I'll handle the conflict later.
Quoted 11 lines
Quoted 4 lines
I think we (Intel) would also require to use the
P2P_DEVICEfor this call, so maybe we should document in the nl80211 command that ifP2P_DEVICEis supported, this command is only supported on the_P2P_DEVICEand not on_STATION? Anyway that'd be my assumptionright
Quoted 1 line
now that it gets used on whichever is used for P2P Device
functionality,
Quoted 1 line
so that shouldn't change anything in the supplicant just clarify the
API
Quoted 1 line
a bit.
Quoted 7 lines
I see now similar functionality called in
_STATIONmode. Do we need supplicant
changes for this? What is the concept with iftype, when device becoming_P2P_DEVICE- when discovery started or just before group formation? I can't draw conclusion looking on other driver's code. Is there some guide?
Well, I'll have to elaborate a bit.
So right now, P2P-Device functionality is implemented over the station interface (typically "wlan0"). This means that the P2P Device address is always the same as the wlan0 interface address, which is one reason for wanting to change it. Another is that internal handling, at least in our driver, becomes quite a bit simpler when the P2P_DEVICE "interface" (doesn't have a netdev) is exposed in this way.
There are some patches from David Spinadel for wpa_supplicant on the way to make it create and use a P2P_DEVICE virtual interface (wdev) for use for all P2P functionality. This interface can also be assigned a separate MAC address, which is then the P2P Device address.
At that point, drivers that support P2P_DEVICE functionality should use only that wdev for P2P-Device related functionality (discovery, GO negotiation, ...)
Quoted 4 lines
Quoted 1 line
Btw, do you have supplicant patches already?
I had initial discussion with Jouni about this design; but no patches yet.
Ok, I'd be interested in this -- particularly because we're also (more even) interested in offloading the extended listen phase for timing and power consumption reasons.
Quoted 7 lines
Quoted 1 line
Is there value in supporting this call w/o any frequencies set? It
seems
Quoted 1 line
to me that the driver would be confused if it got no channels at
all?
I assume no frequences is "all supported", as for scan. In this case, "all supported social channels"
Does that make much sense? For scan I think this makes more sense, but as the social channels are pretty much fixed I'd say it doesn't? OTOH, I guess they differ for 60 GHz...
Note that this also works differently -- for scan cfg80211 builds the channel list while here you don't, so you need to be very careful in the driver about this. For that reason I'd prefer cfg80211 to build the list, or just reject an empty one.
Btw, since only social channels are used etc. should we really ignore channels that aren't supported, rather than rejecting them?
Quoted 4 lines
Like say that passing empty array is same as not passing array at all? I thought that if one passes array of frequencies, it says "use only this"
like caller know what to do; and in this case I'd reject empty list.
Yeah, this makes some sense. The part I'm not sure about is not passing anything, see above.
johannes