From eac514c1a9744e21aa969ffa288f9048ce0a062d Mon Sep 17 00:00:00 2001 From: Naveen Rawat Date: Mon, 3 Jul 2017 13:00:48 -0700 Subject: [PATCH] qcacmn: Make ndp channel config parameter optional The ndp channel config has no meaning if ndp channel itself is optional. Host will send ndp channel config as "optional" to FW if it is missing in the ndp command. Change-Id: I59e245f3fb05ae35aa185fba7bad09608f5334c8 CRs-Fixed: 2072502 --- os_if/linux/nan/src/os_if_nan.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/os_if/linux/nan/src/os_if_nan.c b/os_if/linux/nan/src/os_if_nan.c index 31b7a00dde85..f4d92204f794 100644 --- a/os_if/linux/nan/src/os_if_nan.c +++ b/os_if/linux/nan/src/os_if_nan.c @@ -296,16 +296,17 @@ static int os_if_nan_process_ndp_initiator_req(struct wlan_objmgr_psoc *psoc, req.transaction_id = nla_get_u16(tb[QCA_WLAN_VENDOR_ATTR_NDP_TRANSACTION_ID]); - if (tb[QCA_WLAN_VENDOR_ATTR_NDP_CHANNEL]) + if (tb[QCA_WLAN_VENDOR_ATTR_NDP_CHANNEL]) { req.channel = nla_get_u32(tb[QCA_WLAN_VENDOR_ATTR_NDP_CHANNEL]); - if (tb[QCA_WLAN_VENDOR_ATTR_NDP_CHANNEL_CONFIG]) { - req.channel_cfg = - nla_get_u32(tb[QCA_WLAN_VENDOR_ATTR_NDP_CHANNEL_CONFIG]); - } else { - cfg80211_err("Channel config is unavailable"); - ret = -EINVAL; - goto initiator_req_failed; + if (tb[QCA_WLAN_VENDOR_ATTR_NDP_CHANNEL_CONFIG]) { + req.channel_cfg = nla_get_u32( + tb[QCA_WLAN_VENDOR_ATTR_NDP_CHANNEL_CONFIG]); + } else { + cfg80211_err("Channel config is unavailable"); + ret = -EINVAL; + goto initiator_req_failed; + } } if (!tb[QCA_WLAN_VENDOR_ATTR_NDP_SERVICE_INSTANCE_ID]) {