From d5320a9658d26d2034c949a302dad12212bd31b6 Mon Sep 17 00:00:00 2001 From: Govind Singh Date: Tue, 14 Jun 2016 19:00:37 +0530 Subject: [PATCH] Revert "qcacmn: Remove WMA header file dependency to fix WIN compilation" This change reverts Change-Id: I48978e51ca6bd4416420ee66746d5bfe7adae3c9 Change-Id: I8113e233b3477c7b35a5c35a1a1c6f5f32936d8c CRs-Fixed: 1008872 --- wmi/inc/wmi_unified_param.h | 78 ++++--------------------------------- wmi/src/wmi_tlv_platform.c | 1 + wmi/src/wmi_unified_tlv.c | 44 ++++++++++++++------- 3 files changed, 38 insertions(+), 85 deletions(-) diff --git a/wmi/inc/wmi_unified_param.h b/wmi/inc/wmi_unified_param.h index a150c8d933..88cf7a2d87 100644 --- a/wmi/inc/wmi_unified_param.h +++ b/wmi/inc/wmi_unified_param.h @@ -71,8 +71,6 @@ #define WMI_NOISE_FLOOR_DBM_DEFAULT (-96) #define WMI_MAC_IPV6_ADDR_LEN 16 #ifdef WLAN_NS_OFFLOAD -#define WMI_OFFLOAD_DISABLE 0 -#define WMI_OFFLOAD_ENABLE 1 /* support only one IPv6 offload */ #define WMI_MAC_NS_OFFLOAD_SIZE 1 /* Number of target IP V6 addresses for NS offload */ @@ -263,17 +261,6 @@ typedef enum { #define MAX_NUM_CHAN 128 -/* WME stream classes */ -#define WMI_AC_BE 0 /* best effort */ -#define WMI_AC_BK 1 /* background */ -#define WMI_AC_VI 2 /* video */ -#define WMI_AC_VO 3 /* voice */ -#define WMI_TID_TO_AC(_tid) (\ - (((_tid) == 0) || ((_tid) == 3)) ? WMI_AC_BE : \ - (((_tid) == 1) || ((_tid) == 2)) ? WMI_AC_BK : \ - (((_tid) == 4) || ((_tid) == 5)) ? WMI_AC_VI : \ - WMI_AC_VO) - /** * struct vdev_create_params - vdev create cmd parameter * @if_id: interface id @@ -1150,7 +1137,14 @@ struct wmi_mgmt_params { void *pdata; uint16_t desc_id; uint8_t *macaddr; +#ifndef WMI_NON_TLV_SUPPORT + /* Following elements should be moved to WMA + */ + void *tx_complete_cb; + void *tx_ota_post_proc_cb; + struct wmi_desc_t *wmi_desc; void *qdf_ctx; +#endif }; /** @@ -1668,14 +1662,6 @@ enum { WMI_STA_RX_DATA_OFFLOAD = 0x01, }; -/** - * enum extscan_configuration_flags - extscan config flags - * @WMI_EXTSCAN_LP_EXTENDED_BATCHING: extended batching - */ -enum wmi_extscan_configuration_flags { - WMI_EXTSCAN_LP_EXTENDED_BATCHING = 0x00000001, -}; - /** * enum extscan_report_events_type - extscan report events type * @EXTSCAN_REPORT_EVENTS_BUFFER_FULL: report only when scan history is % full @@ -2012,14 +1998,6 @@ struct wifi_scan_cmd_req_params { }; #define WMI_CFG_VALID_CHANNEL_LIST_LEN 100 -/* Occupied channel list remains static */ -#define WMI_CHANNEL_LIST_STATIC 1 -/* Occupied channel list can be learnt after init */ -#define WMI_CHANNEL_LIST_DYNAMIC_INIT 2 -/* Occupied channel list can be learnt after flush */ -#define WMI_CHANNEL_LIST_DYNAMIC_FLUSH 3 -/* Occupied channel list can be learnt after update */ -#define WMI_CHANNEL_LIST_DYNAMIC_UPDATE 4 /** * struct plm_req_params - plm req parameter @@ -6325,47 +6303,5 @@ struct wmi_power_dbg_params { uint32_t args[WMI_MAX_POWER_DBG_ARGS]; }; -/** - * struct wmi_fw_dump_seg_req - individual segment details - * @seg_id - segment id. - * @seg_start_addr_lo - lower address of the segment. - * @seg_start_addr_hi - higher address of the segment. - * @seg_length - length of the segment. - * @dst_addr_lo - lower address of the destination buffer. - * @dst_addr_hi - higher address of the destination buffer. - * - * This structure carries the information to firmware about the - * individual segments. This structure is part of firmware memory - * dump request. - */ -struct wmi_fw_dump_seg_req { - uint8_t seg_id; - uint32_t seg_start_addr_lo; - uint32_t seg_start_addr_hi; - uint32_t seg_length; - uint32_t dst_addr_lo; - uint32_t dst_addr_hi; -}; - -/** - * enum wmi_userspace_log_level - Log level at userspace - * @WMI_LOG_LEVEL_NO_COLLECTION: verbose_level 0 corresponds to no collection - * @WMI_LOG_LEVEL_NORMAL_COLLECT: verbose_level 1 correspond to normal log - * level with minimal user impact. This is the default value. - * @WMI_LOG_LEVEL_ISSUE_REPRO: verbose_level 2 are enabled when user is lazily - * trying to reproduce a problem, wifi performances and power can be impacted - * but device should not otherwise be significantly impacted - * @WMI_LOG_LEVEL_ACTIVE: verbose_level 3+ are used when trying to - * actively debug a problem - * - * Various log levels defined in the userspace for logging applications - */ -enum wmi_userspace_log_level { - WMI_LOG_LEVEL_NO_COLLECTION, - WMI_LOG_LEVEL_NORMAL_COLLECT, - WMI_LOG_LEVEL_ISSUE_REPRO, - WMI_LOG_LEVEL_ACTIVE, -}; - #endif /* _WMI_UNIFIED_PARAM_H_ */ diff --git a/wmi/src/wmi_tlv_platform.c b/wmi/src/wmi_tlv_platform.c index 22e0befccf..3a24a97582 100644 --- a/wmi/src/wmi_tlv_platform.c +++ b/wmi/src/wmi_tlv_platform.c @@ -34,6 +34,7 @@ #include #include "htc_api.h" #include "wmi.h" +#include "wma.h" /* Following macro definitions use OS or platform specific functions */ diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index 0ad734b649..307d42e7d7 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -28,8 +28,8 @@ #include "wmi_unified_tlv.h" #include "wmi_unified_api.h" #include "wmi.h" -#include "wmi_version.h" #include "wmi_unified_priv.h" +#include "wma.h" #include "wmi_version_whitelist.h" /** @@ -1573,6 +1573,7 @@ QDF_STATUS send_mgmt_cmd_tlv(wmi_unified_t wmi_handle, wmi_mgmt_tx_send_cmd_fixed_param *cmd; int32_t cmd_len; uint64_t dma_addr; + struct wmi_desc_t *wmi_desc = NULL; void *qdf_ctx = param->qdf_ctx; uint8_t *bufp; int32_t bufp_len = (param->frm_len < mgmt_tx_dl_frm_len) ? param->frm_len : @@ -1596,7 +1597,16 @@ QDF_STATUS send_mgmt_cmd_tlv(wmi_unified_t wmi_handle, cmd->vdev_id = param->vdev_id; - cmd->desc_id = param->desc_id; + wmi_desc = param->wmi_desc; + if (!wmi_desc) { + WMI_LOGE("%s: Failed to get wmi_desc", __func__); + goto err1; + } + wmi_desc->nbuf = param->tx_frame; + wmi_desc->tx_cmpl_cb = param->tx_complete_cb; + wmi_desc->ota_post_proc_cb = param->tx_ota_post_proc_cb; + + cmd->desc_id = wmi_desc->desc_id; cmd->chanfreq = param->chanfreq; bufp += sizeof(wmi_mgmt_tx_send_cmd_fixed_param); WMITLV_SET_HDR(bufp, WMITLV_TAG_ARRAY_BYTE, roundup(bufp_len, @@ -3126,6 +3136,12 @@ QDF_STATUS send_set_sta_keep_alive_cmd_tlv(wmi_unified_t wmi_handle, WMI_LOGD("%s: Enter", __func__); + if (params->timeperiod > WNI_CFG_INFRA_STA_KEEP_ALIVE_PERIOD_STAMAX) { + WMI_LOGE("Invalid period %d Max limit %d", params->timeperiod, + WNI_CFG_INFRA_STA_KEEP_ALIVE_PERIOD_STAMAX); + return QDF_STATUS_E_FAILURE; + } + len = sizeof(*cmd) + sizeof(*arp_rsp); buf = wmi_buf_alloc(wmi_handle, len); if (!buf) { @@ -4931,7 +4947,7 @@ QDF_STATUS wmi_get_buf_extscan_start_cmd(wmi_unified_t wmi_handle, cmd->base_period = pstart->basePeriod; cmd->num_buckets = nbuckets; cmd->configuration_flags = 0; - if (pstart->configuration_flags & WMI_EXTSCAN_LP_EXTENDED_BATCHING) + if (pstart->configuration_flags & EXTSCAN_LP_EXTENDED_BATCHING) cmd->configuration_flags |= WMI_EXTSCAN_EXTENDED_BATCHING_EN; WMI_LOGI("%s: configuration_flags: 0x%x", __func__, cmd->configuration_flags); @@ -7169,7 +7185,7 @@ QDF_STATUS send_aggr_qos_cmd_tlv(wmi_unified_t wmi_handle, (wmi_vdev_wmm_addts_cmd_fixed_param)); cmd->vdev_id = aggr_qos_rsp_msg->sessionId; cmd->ac = - WMI_TID_TO_AC(aggr_qos_rsp_msg->tspec[i].tsinfo. + TID_TO_WME_AC(aggr_qos_rsp_msg->tspec[i].tsinfo. traffic.userPrio); cmd->medium_time_us = aggr_qos_rsp_msg->tspec[i].mediumTime * 32; @@ -7410,7 +7426,8 @@ QDF_STATUS send_add_clear_mcbc_filter_cmd_tlv(wmi_unified_t wmi_handle, } WMI_LOGD("Action:%d; vdev_id:%d; clearList:%d", cmd->action, vdev_id, clearList); - WMI_LOGD("MCBC MAC Addr: %pM", multicast_addr.bytes); + WMI_LOGD("MCBC MAC Addr: "MAC_ADDRESS_STR, + MAC_ADDR_ARRAY(multicast_addr.bytes)); return 0; } @@ -8492,7 +8509,7 @@ QDF_STATUS send_process_fw_mem_dump_cmd_tlv(wmi_unified_t wmi_handle, { wmi_get_fw_mem_dump_fixed_param *cmd; wmi_fw_mem_dump *dump_params; - struct wmi_fw_dump_seg_req *seg_req; + struct fw_dump_seg_req *seg_req; int32_t len; wmi_buf_t buf; u_int8_t *buf_ptr; @@ -8535,7 +8552,7 @@ QDF_STATUS send_process_fw_mem_dump_cmd_tlv(wmi_unified_t wmi_handle, WMI_LOGI(FL("request_id:%d num_seg:%d"), mem_dump_req->request_id, mem_dump_req->num_seg); for (loop = 0; loop < cmd->num_fw_mem_dump_segs; loop++) { - seg_req = (struct wmi_fw_dump_seg_req *) + seg_req = (struct fw_dump_seg_req *) ((uint8_t *)(mem_dump_req->segment) + loop * sizeof(*seg_req)); WMITLV_SET_HDR(&dump_params->tlv_header, @@ -9149,7 +9166,7 @@ QDF_STATUS send_enable_specific_fw_logs_cmd_tlv(wmi_unified_t wmi_handle, cmd_args = (uint32_t *) (buf_ptr + WMI_TLV_HDR_SIZE); - if (start_log->verbose_level >= WMI_LOG_LEVEL_ACTIVE) + if (start_log->verbose_level >= LOG_LEVEL_ACTIVE) log_level = 1; else log_level = 0; @@ -9475,7 +9492,7 @@ QDF_STATUS send_enable_arp_ns_offload_cmd_tlv(wmi_unified_t wmi_handle, /* Fill data only for NS offload in the first ARP tuple for LA */ if (!arp_only && - ((param->enableOrDisable & WMI_OFFLOAD_ENABLE))) { + ((param->enableOrDisable & SIR_OFFLOAD_ENABLE))) { ns_tuple->flags |= WMI_NSOFF_FLAGS_VALID; #ifdef WLAN_NS_OFFLOAD @@ -9520,13 +9537,13 @@ QDF_STATUS send_enable_arp_ns_offload_cmd_tlv(wmi_unified_t wmi_handle, WMITLV_GET_STRUCT_TLVLEN(WMI_ARP_OFFLOAD_TUPLE)); /* Fill data for ARP and NS in the first tupple for LA */ - if ((wmi_handle->arp_info.enableOrDisable & WMI_OFFLOAD_ENABLE) + if ((wmi_handle->arp_info.enableOrDisable & SIR_OFFLOAD_ENABLE) && (i == 0)) { /*Copy the target ip addr and flags */ arp_tuple->flags = WMI_ARPOFF_FLAGS_VALID; A_MEMCPY(&arp_tuple->target_ipaddr, wmi_handle->arp_info.params.hostIpv4Addr, - WMI_IPV4_ADDR_LEN); + SIR_IPV4_ADDR_LEN); WMI_LOGD("ARPOffload IP4 address: %pI4", wmi_handle->arp_info.params.hostIpv4Addr); } @@ -9547,8 +9564,7 @@ QDF_STATUS send_enable_arp_ns_offload_cmd_tlv(wmi_unified_t wmi_handle, /* Fill data only for NS offload in the first ARP tuple for LA */ if (!arp_only && - ((param->enableOrDisable & - WMI_OFFLOAD_ENABLE))) { + ((param->enableOrDisable & SIR_OFFLOAD_ENABLE))) { ns_tuple->flags |= WMI_NSOFF_FLAGS_VALID; #ifdef WLAN_NS_OFFLOAD /*Copy the target/solicitation/remote ip addr */ @@ -10050,7 +10066,7 @@ QDF_STATUS send_roam_scan_offload_chan_list_cmd_tlv(wmi_unified_t wmi_handle, (wmi_roam_chan_list_fixed_param)); chan_list_fp->vdev_id = vdev_id; chan_list_fp->num_chan = chan_count; - if (chan_count > 0 && list_type == WMI_CHANNEL_LIST_STATIC) { + if (chan_count > 0 && list_type == CHANNEL_LIST_STATIC) { /* external app is controlling channel list */ chan_list_fp->chan_list_type = WMI_ROAM_SCAN_CHAN_LIST_TYPE_STATIC;