|
@@ -4938,195 +4938,6 @@ QDF_STATUS wma_set_sw_retry_threshold(
|
|
|
return QDF_STATUS_SUCCESS;
|
|
|
}
|
|
|
|
|
|
-#ifdef FEATURE_P2P_LISTEN_OFFLOAD
|
|
|
-/**
|
|
|
- * wma_p2p_lo_start() - P2P listen offload start
|
|
|
- * @params: p2p listen offload parameters
|
|
|
- *
|
|
|
- * This function sends WMI command to start P2P listen offload.
|
|
|
- *
|
|
|
- * Return: QDF_STATUS enumeration
|
|
|
- */
|
|
|
-QDF_STATUS wma_p2p_lo_start(struct sir_p2p_lo_start *params)
|
|
|
-{
|
|
|
- wmi_buf_t buf;
|
|
|
- wmi_p2p_lo_start_cmd_fixed_param *cmd;
|
|
|
- int32_t len = sizeof(*cmd);
|
|
|
- tp_wma_handle wma = cds_get_context(QDF_MODULE_ID_WMA);
|
|
|
- uint8_t *buf_ptr;
|
|
|
- int ret;
|
|
|
- int device_types_len_aligned, probe_resp_len_aligned;
|
|
|
-
|
|
|
- if (NULL == wma) {
|
|
|
- WMA_LOGE("%s: wma context is NULL", __func__);
|
|
|
- return QDF_STATUS_E_INVAL;
|
|
|
- }
|
|
|
-
|
|
|
- device_types_len_aligned = qdf_roundup(params->dev_types_len,
|
|
|
- sizeof(A_UINT32));
|
|
|
- probe_resp_len_aligned = qdf_roundup(params->probe_resp_len,
|
|
|
- sizeof(A_UINT32));
|
|
|
-
|
|
|
- len += 2 * WMI_TLV_HDR_SIZE + device_types_len_aligned +
|
|
|
- probe_resp_len_aligned;
|
|
|
-
|
|
|
- buf = wmi_buf_alloc(wma->wmi_handle, len);
|
|
|
- if (!buf)
|
|
|
- return QDF_STATUS_E_NOMEM;
|
|
|
-
|
|
|
- cmd = (wmi_p2p_lo_start_cmd_fixed_param *)wmi_buf_data(buf);
|
|
|
- buf_ptr = (uint8_t *) wmi_buf_data(buf);
|
|
|
-
|
|
|
- WMITLV_SET_HDR(&cmd->tlv_header,
|
|
|
- WMITLV_TAG_STRUC_wmi_p2p_lo_start_cmd_fixed_param,
|
|
|
- WMITLV_GET_STRUCT_TLVLEN(
|
|
|
- wmi_p2p_lo_start_cmd_fixed_param));
|
|
|
-
|
|
|
- cmd->vdev_id = params->vdev_id;
|
|
|
- cmd->ctl_flags = params->ctl_flags;
|
|
|
- cmd->channel = params->freq;
|
|
|
- cmd->period = params->period;
|
|
|
- cmd->interval = params->interval;
|
|
|
- cmd->count = params->count;
|
|
|
- cmd->device_types_len = params->dev_types_len;
|
|
|
- cmd->prob_resp_len = params->probe_resp_len;
|
|
|
-
|
|
|
- buf_ptr += sizeof(wmi_p2p_lo_start_cmd_fixed_param);
|
|
|
- WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_BYTE,
|
|
|
- device_types_len_aligned);
|
|
|
- buf_ptr += WMI_TLV_HDR_SIZE;
|
|
|
- qdf_mem_copy(buf_ptr, params->device_types, params->dev_types_len);
|
|
|
-
|
|
|
- buf_ptr += device_types_len_aligned;
|
|
|
- WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_BYTE, probe_resp_len_aligned);
|
|
|
- buf_ptr += WMI_TLV_HDR_SIZE;
|
|
|
- qdf_mem_copy(buf_ptr, params->probe_resp_tmplt, params->probe_resp_len);
|
|
|
-
|
|
|
- WMA_LOGI("%s: Sending WMI_P2P_LO_START command, channel=%d, period=%d, interval=%d, count=%d",
|
|
|
- __func__, cmd->channel, cmd->period,
|
|
|
- cmd->interval, cmd->count);
|
|
|
-
|
|
|
- ret = wmi_unified_cmd_send(wma->wmi_handle,
|
|
|
- buf, len,
|
|
|
- WMI_P2P_LISTEN_OFFLOAD_START_CMDID);
|
|
|
- if (ret)
|
|
|
- wmi_buf_free(buf);
|
|
|
- else
|
|
|
- WMA_LOGI("%s: Successfully sent WMI_P2P_LO_START", __func__);
|
|
|
-
|
|
|
- wma->interfaces[params->vdev_id].p2p_lo_in_progress = true;
|
|
|
-
|
|
|
- return ret;
|
|
|
-}
|
|
|
-
|
|
|
-/**
|
|
|
- * wma_p2p_lo_stop() - P2P listen offload stop
|
|
|
- * @vdev_id: vdev identifier
|
|
|
- *
|
|
|
- * This function sends WMI command to stop P2P listen offload.
|
|
|
- *
|
|
|
- * Return: QDF_STATUS enumeration
|
|
|
- */
|
|
|
-QDF_STATUS wma_p2p_lo_stop(u_int32_t vdev_id)
|
|
|
-{
|
|
|
- wmi_buf_t buf;
|
|
|
- wmi_p2p_lo_stop_cmd_fixed_param *cmd;
|
|
|
- int32_t len;
|
|
|
- tp_wma_handle wma = cds_get_context(QDF_MODULE_ID_WMA);
|
|
|
- int ret;
|
|
|
-
|
|
|
- if (NULL == wma) {
|
|
|
- WMA_LOGE("%s: wma context is NULL", __func__);
|
|
|
- return QDF_STATUS_E_INVAL;
|
|
|
- }
|
|
|
-
|
|
|
- len = sizeof(*cmd);
|
|
|
- buf = wmi_buf_alloc(wma->wmi_handle, len);
|
|
|
- if (!buf)
|
|
|
- return QDF_STATUS_E_NOMEM;
|
|
|
-
|
|
|
- cmd = (wmi_p2p_lo_stop_cmd_fixed_param *)wmi_buf_data(buf);
|
|
|
-
|
|
|
- WMITLV_SET_HDR(&cmd->tlv_header,
|
|
|
- WMITLV_TAG_STRUC_wmi_p2p_lo_stop_cmd_fixed_param,
|
|
|
- WMITLV_GET_STRUCT_TLVLEN(
|
|
|
- wmi_p2p_lo_stop_cmd_fixed_param));
|
|
|
-
|
|
|
- cmd->vdev_id = vdev_id;
|
|
|
-
|
|
|
- WMA_LOGI("%s: Sending WMI_P2P_LO_STOP command", __func__);
|
|
|
-
|
|
|
- ret = wmi_unified_cmd_send(wma->wmi_handle,
|
|
|
- buf, len,
|
|
|
- WMI_P2P_LISTEN_OFFLOAD_STOP_CMDID);
|
|
|
- if (ret)
|
|
|
- wmi_buf_free(buf);
|
|
|
- else
|
|
|
- WMA_LOGI("%s: Successfully sent WMI_P2P_LO_STOP", __func__);
|
|
|
- wma->interfaces[vdev_id].p2p_lo_in_progress = false;
|
|
|
-
|
|
|
- return ret;
|
|
|
-}
|
|
|
-
|
|
|
-/**
|
|
|
- * wma_p2p_lo_event_handler() - p2p lo event
|
|
|
- * @handle: the WMA handle
|
|
|
- * @event_buf: buffer with the event parameters
|
|
|
- * @len: length of the buffer
|
|
|
- *
|
|
|
- * This function receives P2P listen offload stop event from FW and
|
|
|
- * pass the event information to upper layer.
|
|
|
- *
|
|
|
- * Return: 0 on success
|
|
|
- */
|
|
|
-int wma_p2p_lo_event_handler(void *handle, uint8_t *event_buf,
|
|
|
- uint32_t len)
|
|
|
-{
|
|
|
- tp_wma_handle wma = cds_get_context(QDF_MODULE_ID_WMA);
|
|
|
- struct sir_p2p_lo_event *event;
|
|
|
- WMI_P2P_LISTEN_OFFLOAD_STOPPED_EVENTID_param_tlvs *param_tlvs;
|
|
|
- wmi_p2p_lo_stopped_event_fixed_param *fix_param;
|
|
|
- struct mac_context *p_mac = cds_get_context(QDF_MODULE_ID_PE);
|
|
|
-
|
|
|
- if (!wma) {
|
|
|
- WMA_LOGE("%s: Invalid WMA Context", __func__);
|
|
|
- return -EINVAL;
|
|
|
- }
|
|
|
-
|
|
|
- if (!p_mac) {
|
|
|
- WMA_LOGE("%s: Invalid p_mac", __func__);
|
|
|
- return -EINVAL;
|
|
|
- }
|
|
|
-
|
|
|
- if (!p_mac->sme.p2p_lo_event_callback) {
|
|
|
- WMA_LOGE("%s: Callback not registered", __func__);
|
|
|
- return -EINVAL;
|
|
|
- }
|
|
|
-
|
|
|
- param_tlvs = (WMI_P2P_LISTEN_OFFLOAD_STOPPED_EVENTID_param_tlvs *)
|
|
|
- event_buf;
|
|
|
- fix_param = param_tlvs->fixed_param;
|
|
|
- if (fix_param->vdev_id >= wma->max_bssid) {
|
|
|
- WMA_LOGE("%s: received invalid vdev_id %d",
|
|
|
- __func__, fix_param->vdev_id);
|
|
|
- return -EINVAL;
|
|
|
- }
|
|
|
- event = qdf_mem_malloc(sizeof(*event));
|
|
|
- if (!event)
|
|
|
- return -ENOMEM;
|
|
|
-
|
|
|
- event->vdev_id = fix_param->vdev_id;
|
|
|
- event->reason_code = fix_param->reason;
|
|
|
-
|
|
|
- p_mac->sme.p2p_lo_event_callback(p_mac->sme.p2p_lo_event_context,
|
|
|
- event);
|
|
|
-
|
|
|
- wma->interfaces[event->vdev_id].p2p_lo_in_progress = false;
|
|
|
-
|
|
|
- return 0;
|
|
|
-}
|
|
|
-#endif /* FEATURE_P2P_LISTEN_OFFLOAD */
|
|
|
-
|
|
|
#ifndef QCA_SUPPORT_CP_STATS
|
|
|
/**
|
|
|
* wma_get_wakelock_stats() - Populates wake lock stats
|