summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNaveen Rawat <naveenrawat@codeaurora.org>2016-10-19 14:17:07 -0700
committerqcabuildsw <qcabuildsw@localhost>2016-12-22 23:03:59 -0800
commit4ced39073fa084c9498423b406acf5abdb2d4bfe (patch)
treef943af8fd759f4f9f6a56132d5f4f99faab52861
parent16d9e955d87e68bba6e454436dc9d15809205617 (diff)
qcacld-3.0: Remove channel parameter check from ndp request
Parameter channel is not a mandatory argument for NDP requerst. 1) Do not fail NDP request if channel parameter is not present. 2) Add channel config parameter in NDP_Initiator_Request, which indicates if channel provided is optional, force or not provided at all. Change-Id: I4d8dc4b3104cfe36c4bb1fdd0d44da5c6406d6b7 CRs-Fixed: 1079900
-rw-r--r--core/hdd/src/wlan_hdd_nan_datapath.c14
-rw-r--r--core/hdd/src/wlan_hdd_nan_datapath.h2
-rw-r--r--core/mac/inc/sir_api.h2
-rw-r--r--core/wma/src/wma_nan_datapath.c1
4 files changed, 13 insertions, 6 deletions
diff --git a/core/hdd/src/wlan_hdd_nan_datapath.c b/core/hdd/src/wlan_hdd_nan_datapath.c
index ef5aae68a4b2..4d034f0e3382 100644
--- a/core/hdd/src/wlan_hdd_nan_datapath.c
+++ b/core/hdd/src/wlan_hdd_nan_datapath.c
@@ -57,6 +57,7 @@ qca_wlan_vendor_ndp_policy[QCA_WLAN_VENDOR_ATTR_NDP_PARAMS_MAX + 1] = {
.len = QDF_MAC_ADDR_SIZE },
[QCA_WLAN_VENDOR_ATTR_NDP_INSTANCE_ID_ARRAY] = { .type = NLA_BINARY,
.len = NDP_NUM_INSTANCE_ID },
+ [QCA_WLAN_VENDOR_ATTR_NDP_CHANNEL_CONFIG] = { .type = NLA_U32 },
};
/**
@@ -498,12 +499,13 @@ static int hdd_ndp_initiator_req_handler(hdd_context_t *hdd_ctx,
req.transaction_id =
nla_get_u16(tb[QCA_WLAN_VENDOR_ATTR_NDP_TRANSACTION_ID]);
- if (!tb[QCA_WLAN_VENDOR_ATTR_NDP_CHANNEL]) {
- hdd_err("NDP channel is unavailable");
- return -EINVAL;
- }
- req.channel =
- nla_get_u16(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]);
if (!tb[QCA_WLAN_VENDOR_ATTR_NDP_SERVICE_INSTANCE_ID]) {
hdd_err("NDP service instance ID is unavailable");
diff --git a/core/hdd/src/wlan_hdd_nan_datapath.h b/core/hdd/src/wlan_hdd_nan_datapath.h
index 7113243d6c2d..67684d6b1398 100644
--- a/core/hdd/src/wlan_hdd_nan_datapath.h
+++ b/core/hdd/src/wlan_hdd_nan_datapath.h
@@ -72,6 +72,7 @@ struct wireless_dev;
* @QCA_WLAN_VENDOR_ATTR_NDP_NDI_MAC_ADDR: NDI mac address
* @QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_TYPE: Driver return status
* @QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_VALUE: Driver return value
+ * @QCA_WLAN_VENDOR_ATTR_NDP_CHANNEL_CONFIG: Channel config request type
*/
enum qca_wlan_vendor_attr_ndp_params {
QCA_WLAN_VENDOR_ATTR_NDP_PARAM_INVALID = 0,
@@ -90,6 +91,7 @@ enum qca_wlan_vendor_attr_ndp_params {
QCA_WLAN_VENDOR_ATTR_NDP_NDI_MAC_ADDR,
QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_TYPE,
QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_VALUE,
+ QCA_WLAN_VENDOR_ATTR_NDP_CHANNEL_CONFIG,
QCA_WLAN_VENDOR_ATTR_NDP_PARAMS_AFTER_LAST,
QCA_WLAN_VENDOR_ATTR_NDP_PARAMS_MAX =
diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h
index d43321bf0643..425a2b5ff2ce 100644
--- a/core/mac/inc/sir_api.h
+++ b/core/mac/inc/sir_api.h
@@ -6358,6 +6358,7 @@ struct ndi_delete_rsp {
* @transaction_id: unique identifier
* @vdev_id: session id of the interface over which ndp is being created
* @channel: suggested channel for ndp creation
+ * @channel_cfg: channel config, 0=no channel, 1=optional, 2=mandatory
* @service_instance_id: Service identifier
* @peer_discovery_mac_addr: Peer's discovery mac address
* @self_ndi_mac_addr: self NDI mac address
@@ -6369,6 +6370,7 @@ struct ndp_initiator_req {
uint32_t transaction_id;
uint32_t vdev_id;
uint32_t channel;
+ uint32_t channel_cfg;
uint32_t service_instance_id;
struct qdf_mac_addr peer_discovery_mac_addr;
struct qdf_mac_addr self_ndi_mac_addr;
diff --git a/core/wma/src/wma_nan_datapath.c b/core/wma/src/wma_nan_datapath.c
index b5ab05a9c031..b2cda15cec90 100644
--- a/core/wma/src/wma_nan_datapath.c
+++ b/core/wma/src/wma_nan_datapath.c
@@ -97,6 +97,7 @@ QDF_STATUS wma_handle_ndp_initiator_req(tp_wma_handle wma_handle, void *req)
cmd->ndp_cfg_len = ndp_req->ndp_config.ndp_cfg_len;
cmd->ndp_app_info_len = ndp_req->ndp_info.ndp_app_info_len;
+ cmd->ndp_channel_cfg = ndp_req->channel_cfg;
ch_tlv = (wmi_channel *)&cmd[1];
WMITLV_SET_HDR(ch_tlv, WMITLV_TAG_STRUC_wmi_channel,