瀏覽代碼

qcacld-3.0: Update NAN HDD APIs as per vendor definitions changes

This is qcacld-2.0 to qcacld-3.0 propagation.

Remove usage of following attributes from NAN HDD APIs:
1) QCA_WLAN_VENDOR_ATTR_NDP_APP_INFO_LEN
2) QCA_WLAN_VENDOR_ATTR_NDP_NUM_INSTANCE_ID
3) QCA_WLAN_VENDOR_ATTR_NDP_SCHEDULE_STATUS_CODE
4) ndp_cfg from NDP_CONFRIM
5) Remove mandatory check for ndp_app_info in data initiator

Change-Id: I17fe580661f836d45a518a330a63d2c6de8bcf28
CRs-Fixed: 962367
Naveen Rawat 8 年之前
父節點
當前提交
90ae3080de

+ 7 - 35
core/hdd/src/wlan_hdd_nan_datapath.c

@@ -49,12 +49,10 @@ qca_wlan_vendor_ndp_policy[QCA_WLAN_VENDOR_ATTR_NDP_PARAMS_MAX + 1] = {
 	[QCA_WLAN_VENDOR_ATTR_NDP_CONFIG_SECURITY] = { .type = NLA_U16 },
 	[QCA_WLAN_VENDOR_ATTR_NDP_CONFIG_QOS] = { .type = NLA_BINARY,
 					.len = NDP_QOS_INFO_LEN },
-	[QCA_WLAN_VENDOR_ATTR_NDP_APP_INFO_LEN] = { .type = NLA_U16 },
 	[QCA_WLAN_VENDOR_ATTR_NDP_APP_INFO] = { .type = NLA_BINARY,
 					.len = NDP_APP_INFO_LEN },
 	[QCA_WLAN_VENDOR_ATTR_NDP_INSTANCE_ID] = { .type = NLA_U32 },
 	[QCA_WLAN_VENDOR_ATTR_NDP_RESPONSE_CODE] = { .type = NLA_U16 },
-	[QCA_WLAN_VENDOR_ATTR_NDP_SCHEDULE_STATUS_CODE] = { .type = NLA_U16 },
 	[QCA_WLAN_VENDOR_ATTR_NDP_NDI_MAC_ADDR] = { .type = NLA_BINARY,
 					.len = QDF_MAC_ADDR_SIZE },
 	[QCA_WLAN_VENDOR_ATTR_NDP_INSTANCE_ID_ARRAY] = { .type = NLA_BINARY,
@@ -518,19 +516,12 @@ static int hdd_ndp_initiator_req_handler(hdd_context_t *hdd_ctx,
 		nla_data(tb[QCA_WLAN_VENDOR_ATTR_NDP_PEER_DISCOVERY_MAC_ADDR]),
 		QDF_MAC_ADDR_SIZE);
 
-	if (!tb[QCA_WLAN_VENDOR_ATTR_NDP_APP_INFO_LEN]) {
-		hdd_err(FL("NDP app info len is unavailable"));
-		return -EINVAL;
-	}
-	req.ndp_info.ndp_app_info_len =
-		nla_get_u16(tb[QCA_WLAN_VENDOR_ATTR_NDP_APP_INFO_LEN]);
-
-	if (!tb[QCA_WLAN_VENDOR_ATTR_NDP_APP_INFO]) {
-		hdd_err(FL("NDP app info is unavailable"));
-		return -EINVAL;
+	if (tb[QCA_WLAN_VENDOR_ATTR_NDP_APP_INFO]) {
+		req.ndp_info.ndp_app_info_len =
+			nla_len(tb[QCA_WLAN_VENDOR_ATTR_NDP_APP_INFO]);
+		req.ndp_info.ndp_app_info =
+			nla_data(tb[QCA_WLAN_VENDOR_ATTR_NDP_APP_INFO]);
 	}
-	req.ndp_info.ndp_app_info =
-		nla_data(tb[QCA_WLAN_VENDOR_ATTR_NDP_APP_INFO]);
 
 	if (tb[QCA_WLAN_VENDOR_ATTR_NDP_CONFIG_QOS]) {
 		/* at present ndp config stores 4 bytes QOS info only */
@@ -1228,7 +1219,7 @@ static void hdd_ndp_confirm_ind_handler(hdd_adapter_t *adapter,
 		ndp_ctx->active_ndp_sessions[idx]++;
 
 	data_len = (4 * sizeof(uint32_t)) + QDF_MAC_ADDR_SIZE + IFNAMSIZ +
-			sizeof(uint16_t) + NLMSG_HDRLEN + (8 * NLA_HDRLEN) +
+			+ NLMSG_HDRLEN + (7 * NLA_HDRLEN) +
 			ndp_confirm->ndp_info.ndp_app_info_len;
 
 	vendor_event = cfg80211_vendor_event_alloc(hdd_ctx->wiphy, NULL,
@@ -1255,25 +1246,12 @@ static void hdd_ndp_confirm_ind_handler(hdd_adapter_t *adapter,
 		    IFNAMSIZ, adapter->dev->name))
 		goto ndp_confirm_nla_failed;
 
-	if (nla_put_u16(vendor_event, QCA_WLAN_VENDOR_ATTR_NDP_APP_INFO_LEN,
-		    ndp_confirm->ndp_info.ndp_app_info_len))
-		goto ndp_confirm_nla_failed;
-
 	if (ndp_confirm->ndp_info.ndp_app_info_len && nla_put(vendor_event,
 				QCA_WLAN_VENDOR_ATTR_NDP_APP_INFO,
 				ndp_confirm->ndp_info.ndp_app_info_len,
 				ndp_confirm->ndp_info.ndp_app_info))
 		goto ndp_confirm_nla_failed;
 
-	if (ndp_confirm->ndp_config.ndp_cfg_len) {
-		ndp_qos_config = *((uint32_t *)ndp_confirm->ndp_config.ndp_cfg);
-		/* at present ndp config stores 4 bytes QOS info only */
-		if (nla_put_u32(vendor_event,
-				QCA_WLAN_VENDOR_ATTR_NDP_CONFIG_QOS,
-				ndp_qos_config))
-			goto ndp_confirm_nla_failed;
-	}
-
 	if (nla_put_u32(vendor_event,
 			QCA_WLAN_VENDOR_ATTR_NDP_RESPONSE_CODE,
 			ndp_confirm->rsp_code))
@@ -1615,7 +1593,6 @@ ndp_end_rsp_nla_failed:
  * Following vendor event is sent to cfg80211:
  * QCA_WLAN_VENDOR_ATTR_NDP_SUBCMD =
  *         QCA_WLAN_VENDOR_ATTR_NDP_END_IND (4 bytes)
- * QCA_WLAN_VENDOR_ATTR_NDP_NUM_INSTANCE_ID (1 byte)
  * QCA_WLAN_VENDOR_ATTR_NDP_INSTANCE_ID_ARRAY (4 * num of NDP Instances)
  *
  * Return: none
@@ -1667,8 +1644,7 @@ static void hdd_ndp_end_ind_handler(hdd_adapter_t *adapter,
 			end_ind->ndp_map[i].num_active_ndp_sessions;
 	}
 
-	data_len = (sizeof(uint32_t)) +
-			sizeof(uint8_t) + NLMSG_HDRLEN + (2 * NLA_HDRLEN) +
+	data_len = (sizeof(uint32_t)) + NLMSG_HDRLEN + (2 * NLA_HDRLEN) +
 			end_ind->num_ndp_ids * sizeof(*ndp_instance_array);
 
 	vendor_event = cfg80211_vendor_event_alloc(hdd_ctx->wiphy, NULL,
@@ -1683,10 +1659,6 @@ static void hdd_ndp_end_ind_handler(hdd_adapter_t *adapter,
 			QCA_WLAN_VENDOR_ATTR_NDP_END_IND))
 		goto ndp_end_ind_nla_failed;
 
-	if (nla_put_u8(vendor_event, QCA_WLAN_VENDOR_ATTR_NDP_NUM_INSTANCE_ID,
-			end_ind->num_ndp_ids))
-		goto ndp_end_ind_nla_failed;
-
 	if (nla_put(vendor_event, QCA_WLAN_VENDOR_ATTR_NDP_INSTANCE_ID_ARRAY,
 			end_ind->num_ndp_ids * sizeof(*ndp_instance_array),
 			ndp_instance_array))

+ 0 - 6
core/hdd/src/wlan_hdd_nan_datapath.h

@@ -66,13 +66,10 @@ struct wireless_dev;
  * @QCA_WLAN_VENDOR_ATTR_NDP_IFACE_STR: Iface name
  * @QCA_WLAN_VENDOR_ATTR_NDP_CONFIG_SECURITY: Security configuration
  * @QCA_WLAN_VENDOR_ATTR_NDP_CONFIG_QOS: Qos configuration
- * @QCA_WLAN_VENDOR_ATTR_NDP_APP_INFO_LEN: Application info length
  * @QCA_WLAN_VENDOR_ATTR_NDP_APP_INFO: Application info
  * @QCA_WLAN_VENDOR_ATTR_NDP_INSTANCE_ID: NDP instance id
- * @QCA_WLAN_VENDOR_ATTR_NDP_NUM_INSTANCE_ID: Number of NDP instance ids
  * @QCA_WLAN_VENDOR_ATTR_NDP_INSTANCE_ID_ARRAY: NDP instance id array
  * @QCA_WLAN_VENDOR_ATTR_NDP_RESPONSE_CODE: Schedule response
- * @QCA_WLAN_VENDOR_ATTR_NDP_SCHEDULE_STATUS_CODE: schedule status
  * @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
@@ -87,13 +84,10 @@ enum qca_wlan_vendor_attr_ndp_params {
 	QCA_WLAN_VENDOR_ATTR_NDP_IFACE_STR,
 	QCA_WLAN_VENDOR_ATTR_NDP_CONFIG_SECURITY,
 	QCA_WLAN_VENDOR_ATTR_NDP_CONFIG_QOS,
-	QCA_WLAN_VENDOR_ATTR_NDP_APP_INFO_LEN,
 	QCA_WLAN_VENDOR_ATTR_NDP_APP_INFO,
 	QCA_WLAN_VENDOR_ATTR_NDP_INSTANCE_ID,
-	QCA_WLAN_VENDOR_ATTR_NDP_NUM_INSTANCE_ID,
 	QCA_WLAN_VENDOR_ATTR_NDP_INSTANCE_ID_ARRAY,
 	QCA_WLAN_VENDOR_ATTR_NDP_RESPONSE_CODE,
-	QCA_WLAN_VENDOR_ATTR_NDP_SCHEDULE_STATUS_CODE,
 	QCA_WLAN_VENDOR_ATTR_NDP_NDI_MAC_ADDR,
 	QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_TYPE,
 	QCA_WLAN_VENDOR_ATTR_NDP_DRV_RETURN_VALUE,

+ 0 - 2
core/mac/inc/sir_api.h

@@ -6137,7 +6137,6 @@ struct ndp_responder_rsp_event {
  * @ndp_instance_id: ndp instance id for which confirm is being generated
  * @peer_ndi_mac_addr: peer NDI mac address
  * @rsp_code: ndp response code
- * @ndp_config: ndp configuration
  * @ndp_info: ndp application info
  *
  */
@@ -6146,7 +6145,6 @@ struct ndp_confirm_event {
 	uint32_t ndp_instance_id;
 	struct qdf_mac_addr peer_ndi_mac_addr;
 	enum ndp_response_code rsp_code;
-	struct ndp_cfg ndp_config;
 	struct ndp_app_info ndp_info;
 };
 

+ 0 - 17
core/wma/src/wma_nan_datapath.c

@@ -526,30 +526,13 @@ static int wma_ndp_confirm_event_handler(void *handle, uint8_t *event_info,
 	WMI_MAC_ADDR_TO_CHAR_ARRAY(&fixed_params->peer_ndi_mac_addr,
 				   ndp_confirm.peer_ndi_mac_addr.bytes);
 
-	qdf_mem_copy(&ndp_confirm.ndp_config, event->ndp_cfg,
-		     fixed_params->ndp_cfg_len);
-
-	ndp_confirm.ndp_config.ndp_cfg_len = fixed_params->ndp_cfg_len;
 	ndp_confirm.ndp_info.ndp_app_info_len = fixed_params->ndp_app_info_len;
 
-	if (ndp_confirm.ndp_config.ndp_cfg_len) {
-		ndp_confirm.ndp_config.ndp_cfg =
-			qdf_mem_malloc(ndp_confirm.ndp_config.ndp_cfg_len);
-		if (NULL == ndp_confirm.ndp_config.ndp_cfg) {
-			WMA_LOGE(FL("malloc failed"));
-			return QDF_STATUS_E_NOMEM;
-		}
-		qdf_mem_copy(ndp_confirm.ndp_config.ndp_cfg,
-			     event->ndp_cfg,
-			     ndp_confirm.ndp_config.ndp_cfg_len);
-	}
-
 	if (ndp_confirm.ndp_info.ndp_app_info_len) {
 		ndp_confirm.ndp_info.ndp_app_info =
 				qdf_mem_malloc(fixed_params->ndp_app_info_len);
 		if (NULL == ndp_confirm.ndp_info.ndp_app_info) {
 			WMA_LOGE(FL("malloc failed"));
-			qdf_mem_free(ndp_confirm.ndp_config.ndp_cfg);
 			return QDF_STATUS_E_NOMEM;
 		}
 		qdf_mem_copy(&ndp_confirm.ndp_info.ndp_app_info,