|
@@ -756,7 +756,6 @@ static int os_if_nan_process_ndp_initiator_req(struct wlan_objmgr_psoc *psoc,
|
|
|
* Return: 0 on success or error code on failure
|
|
|
*/
|
|
|
static int __os_if_nan_process_ndp_responder_req(struct wlan_objmgr_psoc *psoc,
|
|
|
- char *iface_name,
|
|
|
struct nlattr **tb)
|
|
|
{
|
|
|
int ret = 0;
|
|
@@ -764,6 +763,8 @@ static int __os_if_nan_process_ndp_responder_req(struct wlan_objmgr_psoc *psoc,
|
|
|
enum nan_datapath_state state;
|
|
|
struct wlan_objmgr_vdev *nan_vdev = NULL;
|
|
|
struct nan_datapath_responder_req req = {0};
|
|
|
+ char *iface_name;
|
|
|
+ int errno;
|
|
|
|
|
|
if (!tb[QCA_WLAN_VENDOR_ATTR_NDP_RESPONSE_CODE]) {
|
|
|
osif_err("ndp_rsp is unavailable");
|
|
@@ -772,6 +773,13 @@ static int __os_if_nan_process_ndp_responder_req(struct wlan_objmgr_psoc *psoc,
|
|
|
req.ndp_rsp = nla_get_u32(tb[QCA_WLAN_VENDOR_ATTR_NDP_RESPONSE_CODE]);
|
|
|
|
|
|
if (req.ndp_rsp == NAN_DATAPATH_RESPONSE_ACCEPT) {
|
|
|
+ errno = osif_nla_str(tb, QCA_WLAN_VENDOR_ATTR_NDP_IFACE_STR,
|
|
|
+ &iface_name);
|
|
|
+
|
|
|
+ if (errno) {
|
|
|
+ osif_err("NAN data iface not provided");
|
|
|
+ return errno;
|
|
|
+ }
|
|
|
/* Check for an existing NAN interface */
|
|
|
nan_vdev = os_if_get_ndi_vdev_by_ifname(psoc, iface_name);
|
|
|
if (!nan_vdev) {
|
|
@@ -899,26 +907,17 @@ responder_req_failed:
|
|
|
}
|
|
|
|
|
|
static int os_if_nan_process_ndp_responder_req(struct wlan_objmgr_psoc *psoc,
|
|
|
- struct nlattr **tb)
|
|
|
+ struct nlattr **tb,
|
|
|
+ struct wireless_dev *wdev)
|
|
|
{
|
|
|
- struct net_device *net_dev;
|
|
|
struct osif_vdev_sync *vdev_sync;
|
|
|
- char *ifname;
|
|
|
int errno;
|
|
|
|
|
|
- errno = osif_nla_str(tb, QCA_WLAN_VENDOR_ATTR_NDP_IFACE_STR, &ifname);
|
|
|
- if (errno)
|
|
|
- return errno;
|
|
|
-
|
|
|
- errno = osif_net_dev_from_ifname(psoc, ifname, &net_dev);
|
|
|
- if (errno)
|
|
|
- return errno;
|
|
|
-
|
|
|
- errno = osif_vdev_sync_op_start(net_dev, &vdev_sync);
|
|
|
+ errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
|
|
|
if (errno)
|
|
|
return errno;
|
|
|
|
|
|
- errno = __os_if_nan_process_ndp_responder_req(psoc, ifname, tb);
|
|
|
+ errno = __os_if_nan_process_ndp_responder_req(psoc, tb);
|
|
|
|
|
|
osif_vdev_sync_op_stop(vdev_sync);
|
|
|
|
|
@@ -1018,7 +1017,8 @@ static int os_if_nan_process_ndp_end_req(struct wlan_objmgr_psoc *psoc,
|
|
|
|
|
|
int os_if_nan_process_ndp_cmd(struct wlan_objmgr_psoc *psoc,
|
|
|
const void *data, int data_len,
|
|
|
- bool is_ndp_allowed)
|
|
|
+ bool is_ndp_allowed,
|
|
|
+ struct wireless_dev *wdev)
|
|
|
{
|
|
|
uint32_t ndp_cmd_type;
|
|
|
uint16_t transaction_id;
|
|
@@ -1080,7 +1080,7 @@ int os_if_nan_process_ndp_cmd(struct wlan_objmgr_psoc *psoc,
|
|
|
osif_err("Unsupported concurrency for NAN datapath");
|
|
|
return -EOPNOTSUPP;
|
|
|
}
|
|
|
- return os_if_nan_process_ndp_responder_req(psoc, tb);
|
|
|
+ return os_if_nan_process_ndp_responder_req(psoc, tb, wdev);
|
|
|
case QCA_WLAN_VENDOR_ATTR_NDP_END_REQUEST:
|
|
|
if (!is_ndp_allowed) {
|
|
|
osif_err("Unsupported concurrency for NAN datapath");
|