diff --git a/os_if/linux/wifi_pos/src/os_if_wifi_pos.c b/os_if/linux/wifi_pos/src/os_if_wifi_pos.c index 0af520a2d9..2d684dbf4b 100644 --- a/os_if/linux/wifi_pos/src/os_if_wifi_pos.c +++ b/os_if/linux/wifi_pos/src/os_if_wifi_pos.c @@ -155,6 +155,7 @@ static int wifi_pos_parse_req(struct sk_buff *skb, struct wifi_pos_req_msg *req) /* NLMSG_DATA(nlh) contains ANI msg */ struct nlmsghdr *nlh; tAniMsgHdr *msg_hdr; + size_t field_info_len; nlh = (struct nlmsghdr *)skb->data; if (!nlh) { @@ -184,6 +185,15 @@ static int wifi_pos_parse_req(struct sk_buff *skb, struct wifi_pos_req_msg *req) req->buf_len = msg_hdr->length; req->buf = (uint8_t *)&msg_hdr[1]; req->pid = nlh->nlmsg_pid; + req->field_info_buf = NULL; + + field_info_len = nlh->nlmsg_len - + (NLMSG_LENGTH(sizeof(*msg_hdr) + msg_hdr->length)); + if (field_info_len) { + req->field_info_buf = (struct wifi_pos_field_info *) + (req->buf + req->buf_len); + req->field_info_buf_len = field_info_len; + } return 0; } diff --git a/target_if/wifi_pos/src/target_if_wifi_pos.c b/target_if/wifi_pos/src/target_if_wifi_pos.c index 3d30ec7a89..2e411f09eb 100644 --- a/target_if/wifi_pos/src/target_if_wifi_pos.c +++ b/target_if/wifi_pos/src/target_if_wifi_pos.c @@ -278,11 +278,11 @@ static int wifi_pos_oem_err_rpt_ev_handler(ol_scn_t scn, uint8_t *buf, * Return: QDF_STATUS */ static QDF_STATUS -target_if_wifi_pos_oem_data_req(struct wlan_objmgr_psoc *psoc, +target_if_wifi_pos_oem_data_req(struct wlan_objmgr_pdev *pdev, struct oem_data_req *req) { QDF_STATUS status; - wmi_unified_t wmi_hdl = get_wmi_unified_hdl_from_psoc(psoc); + wmi_unified_t wmi_hdl = get_wmi_unified_hdl_from_pdev(pdev); target_if_debug("Send oem data req to target"); diff --git a/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h b/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h index e769eca783..764349b66e 100644 --- a/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h +++ b/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h @@ -572,7 +572,7 @@ struct wlan_lmac_if_sptrl_tx_ops { * @wifi_pos_deregister_events: function pointer to deregister wifi_pos events */ struct wlan_lmac_if_wifi_pos_tx_ops { - QDF_STATUS (*data_req_tx)(struct wlan_objmgr_psoc *psoc, + QDF_STATUS (*data_req_tx)(struct wlan_objmgr_pdev *pdev, struct oem_data_req *req); QDF_STATUS (*wifi_pos_register_events)(struct wlan_objmgr_psoc *psoc); QDF_STATUS (*wifi_pos_deregister_events)(struct wlan_objmgr_psoc *psoc); diff --git a/umac/wifi_pos/src/wifi_pos_main.c b/umac/wifi_pos/src/wifi_pos_main.c index 16d8d85a84..de59510621 100644 --- a/umac/wifi_pos/src/wifi_pos_main.c +++ b/umac/wifi_pos/src/wifi_pos_main.c @@ -94,10 +94,11 @@ static QDF_STATUS wifi_pos_process_data_req(struct wlan_objmgr_psoc *psoc, uint8_t idx; uint32_t sub_type = 0; uint32_t channel_mhz = 0; - void *pdev_id = NULL; + uint32_t pdev_id = 0; uint32_t offset; struct oem_data_req data_req; struct wlan_lmac_if_wifi_pos_tx_ops *tx_ops; + struct wlan_objmgr_pdev *pdev; wifi_pos_debug("Received data req pid(%d), len(%d)", req->pid, req->buf_len); @@ -124,7 +125,14 @@ static QDF_STATUS wifi_pos_process_data_req(struct wlan_objmgr_psoc *psoc, if (req->field_info_buf->fields[idx].id == WMIRTT_FIELD_ID_pdev) { - pdev_id = &req->buf[offset]; + pdev_id = *((uint32_t *)&req->buf[offset]); + /* pdev_id in FW starts from 1. So convert it to + * host id by decrementing it. + * zero has special meaning due to backward + * compatibility. Dont change it. + */ + if (pdev_id) + pdev_id -= 1; continue; } } @@ -150,18 +158,22 @@ static QDF_STATUS wifi_pos_process_data_req(struct wlan_objmgr_psoc *psoc, break; default: wifi_pos_debug("invalid sub type or not passed"); - /* - * this is legacy MCL operation. pass whole msg to firmware as - * it is. - */ + tx_ops = wifi_pos_get_tx_ops(psoc); if (!tx_ops) { wifi_pos_err("tx ops null"); return QDF_STATUS_E_INVAL; } - data_req.data_len = req->buf_len; - data_req.data = req->buf; - tx_ops->data_req_tx(psoc, &data_req); + + pdev = wlan_objmgr_get_pdev_by_id(psoc, pdev_id, + WLAN_WIFI_POS_CORE_ID); + if (pdev) { + data_req.data_len = req->buf_len; + data_req.data = req->buf; + tx_ops->data_req_tx(pdev, &data_req); + wlan_objmgr_pdev_release_ref(pdev, + WLAN_WIFI_POS_CORE_ID); + } break; }