void vos_event_report_payload(v_U16_t event_Id, v_U16_t length, v_VOID_t *pPayload) { tAniHdr *wmsg = NULL; v_U8_t *pBuf; struct hdd_context_s *pHddCtx; v_CONTEXT_t pVosContext= NULL; event_report_t *pEvent_report; v_U16_t total_len; /*Get the global context */ pVosContext = vos_get_global_context(VOS_MODULE_ID_SYS, NULL); /*Get the Hdd Context */ pHddCtx = ((VosContextType*)(pVosContext))->pHDDContext; /* Send the log data to the ptt app only if it is registered with the wlan driver*/ if(pHddCtx->ptt_pid != INVALID_PID) { total_len = sizeof(tAniHdr)+sizeof(event_report_t)+length; pBuf = (v_U8_t*)vos_mem_malloc(total_len); if(!pBuf) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "vos_mem_malloc failed"); return; } wmsg = (tAniHdr*)pBuf; wmsg->type = PTT_MSG_DIAG_CMDS_TYPE; wmsg->length = total_len; wmsg->length = DIAG_SWAP16(wmsg->length); pBuf += sizeof(tAniHdr); pEvent_report = (event_report_t*)pBuf; pEvent_report->diag_type = DIAG_TYPE_EVENTS; pEvent_report->event_id = event_Id; pEvent_report->length = length; pBuf += sizeof(event_report_t); memcpy(pBuf, pPayload,length); if( ptt_sock_send_msg_to_app(wmsg, 0, ANI_NL_MSG_PUMAC, pHddCtx->ptt_pid) < 0) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, ("Ptt Socket error sending message to the app!!")); vos_mem_free((v_VOID_t*)wmsg); pHddCtx->ptt_pid = INVALID_PID; return; } vos_mem_free((v_VOID_t*)wmsg); } return; }
void host_diag_event_report_payload(uint16_t event_Id, uint16_t length, void *pPayload) { tAniHdr *wmsg = NULL; uint8_t *pBuf; event_report_t *pEvent_report; uint16_t total_len; if (cds_is_load_unload_in_progress()) { CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_INFO, "%s: Unloading/Loading in Progress. Ignore!!!", __func__); return; } if (nl_srv_is_initialized() != 0) return; if (cds_is_multicast_logging()) { total_len = sizeof(tAniHdr) + sizeof(event_report_t) + length; pBuf = (uint8_t *) cdf_mem_malloc(total_len); if (!pBuf) { CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR, "cdf_mem_malloc failed"); return; } wmsg = (tAniHdr *) pBuf; wmsg->type = PTT_MSG_DIAG_CMDS_TYPE; wmsg->length = total_len; wmsg->length = DIAG_SWAP16(wmsg->length); pBuf += sizeof(tAniHdr); pEvent_report = (event_report_t *) pBuf; pEvent_report->diag_type = DIAG_TYPE_EVENTS; pEvent_report->event_id = event_Id; pEvent_report->length = length; pBuf += sizeof(event_report_t); memcpy(pBuf, pPayload, length); if (ptt_sock_send_msg_to_app (wmsg, 0, ANI_NL_MSG_PUMAC, INVALID_PID) < 0) { CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR, "Ptt Socket error sending message to the app!!"); cdf_mem_free((void *)wmsg); return; } cdf_mem_free((void *)wmsg); } return; }
void host_diag_log_submit(void *plog_hdr_ptr) { log_hdr_type *pHdr = (log_hdr_type *) plog_hdr_ptr; tAniHdr *wmsg = NULL; uint8_t *pBuf; uint16_t data_len; uint16_t total_len; if (cds_is_load_unload_in_progress()) { CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_INFO, "%s: Unloading/Loading in Progress. Ignore!!!", __func__); return; } if (nl_srv_is_initialized() != 0) return; if (cds_is_multicast_logging()) { data_len = pHdr->len; total_len = sizeof(tAniHdr) + sizeof(uint32_t) + data_len; pBuf = (uint8_t *) cdf_mem_malloc(total_len); if (!pBuf) { CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR, "cdf_mem_malloc failed"); return; } cdf_mem_zero((void *)pBuf, total_len); wmsg = (tAniHdr *) pBuf; wmsg->type = PTT_MSG_DIAG_CMDS_TYPE; wmsg->length = total_len; wmsg->length = DIAG_SWAP16(wmsg->length); pBuf += sizeof(tAniHdr); /* Diag Type events or log */ *(uint32_t *) pBuf = DIAG_TYPE_LOGS; pBuf += sizeof(uint32_t); memcpy(pBuf, pHdr, data_len); ptt_sock_send_msg_to_app (wmsg, 0, ANI_NL_MSG_PUMAC, INVALID_PID); cdf_mem_free((void *)wmsg); } return; }
void vos_event_report_payload(v_U16_t event_Id, v_U16_t length, v_VOID_t *pPayload) { tAniHdr *wmsg = NULL; v_U8_t *pBuf; struct hdd_context_s *pHddCtx; v_CONTEXT_t pVosContext= NULL; event_report_t *pEvent_report; v_U16_t total_len; /*Get the global context */ pVosContext = vos_get_global_context(VOS_MODULE_ID_SYS, NULL); if (!pVosContext) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: vos context is NULL", __func__); return; } /*Get the Hdd Context */ pHddCtx = ((VosContextType*)(pVosContext))->pHDDContext; if (!pHddCtx) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: hdd context is NULL", __func__); return; } #ifdef WLAN_KD_READY_NOTIFIER /* NL is not ready yet, WLAN KO started first */ if ((pHddCtx->kd_nl_init) && (!pHddCtx->ptt_pid)) { nl_srv_nl_ready_indication(); } #endif /* WLAN_KD_READY_NOTIFIER */ if (nl_srv_is_initialized() != 0) return; /* Send the log data to the ptt app only if it is registered with the wlan driver*/ if(vos_is_multicast_logging()) { total_len = sizeof(tAniHdr)+sizeof(event_report_t)+length; pBuf = (v_U8_t*)vos_mem_malloc(total_len); if(!pBuf) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "vos_mem_malloc failed"); return; } wmsg = (tAniHdr*)pBuf; wmsg->type = PTT_MSG_DIAG_CMDS_TYPE; wmsg->length = total_len; wmsg->length = DIAG_SWAP16(wmsg->length); pBuf += sizeof(tAniHdr); pEvent_report = (event_report_t*)pBuf; pEvent_report->diag_type = DIAG_TYPE_EVENTS; pEvent_report->event_id = event_Id; pEvent_report->length = length; pBuf += sizeof(event_report_t); vos_mem_copy(pBuf, pPayload,length); if( ptt_sock_send_msg_to_app(wmsg, 0, ANI_NL_MSG_PUMAC, INVALID_PID, MSG_DONTWAIT) < 0) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, ("Ptt Socket error sending message to the app!!")); vos_mem_free((v_VOID_t*)wmsg); return; } vos_mem_free((v_VOID_t*)wmsg); } return; }
void vos_log_submit(v_VOID_t *plog_hdr_ptr) { log_hdr_type *pHdr = (log_hdr_type*) plog_hdr_ptr; tAniHdr *wmsg = NULL; v_U8_t *pBuf; struct hdd_context_s *pHddCtx; v_CONTEXT_t pVosContext= NULL; v_U16_t data_len; v_U16_t total_len; /*Get the global context */ pVosContext = vos_get_global_context(VOS_MODULE_ID_SYS, NULL); /*Get the Hdd Context */ pHddCtx = ((VosContextType*)(pVosContext))->pHDDContext; if (WLAN_HDD_IS_LOAD_UNLOAD_IN_PROGRESS(pHddCtx)) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: Unloading/Loading in Progress. Ignore!!!", __func__); return; } #ifdef WLAN_KD_READY_NOTIFIER /* NL is not ready yet, WLAN KO started first */ if ((pHddCtx->kd_nl_init) && (!pHddCtx->ptt_pid)) { nl_srv_nl_ready_indication(); } #endif /* WLAN_KD_READY_NOTIFIER */ if (nl_srv_is_initialized() != 0) return; /* Send the log data to the ptt app only if it is registered with the wlan driver*/ if(vos_is_multicast_logging()) { data_len = pHdr->len; total_len = sizeof(tAniHdr)+sizeof(v_U32_t)+data_len; pBuf = (v_U8_t*)vos_mem_malloc(total_len); if(!pBuf) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "vos_mem_malloc failed"); return; } vos_mem_zero((v_VOID_t*)pBuf,total_len); wmsg = (tAniHdr*)pBuf; wmsg->type = PTT_MSG_DIAG_CMDS_TYPE; wmsg->length = total_len; wmsg->length = DIAG_SWAP16(wmsg->length); pBuf += sizeof(tAniHdr); /* Diag Type events or log */ *(v_U32_t*)pBuf = DIAG_TYPE_LOGS; pBuf += sizeof(v_U32_t); vos_mem_copy(pBuf, pHdr,data_len); if (ptt_sock_send_msg_to_app(wmsg, 0, ANI_NL_MSG_PUMAC, INVALID_PID, MSG_DONTWAIT) < 0) { vos_mem_free((v_VOID_t *)wmsg); return; } vos_mem_free((v_VOID_t*)wmsg); } return; }
void vos_log_submit(v_VOID_t *plog_hdr_ptr) { log_hdr_type *pHdr = (log_hdr_type*) plog_hdr_ptr; tAniHdr *wmsg = NULL; v_U8_t *pBuf; struct hdd_context_s *pHddCtx; v_CONTEXT_t pVosContext= NULL; v_U16_t data_len; v_U16_t total_len; /*Get the global context */ pVosContext = vos_get_global_context(VOS_MODULE_ID_SYS, NULL); /*Get the Hdd Context */ pHddCtx = ((VosContextType*)(pVosContext))->pHDDContext; if ((pHddCtx->isLoadInProgress) || (pHddCtx->isUnloadInProgress)) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: Unloading/Loading in Progress. Ignore!!!", __func__); return; } /* Send the log data to the ptt app only if it is registered with the wlan driver*/ if(pHddCtx->ptt_pid) { data_len = pHdr->len; total_len = sizeof(tAniHdr)+sizeof(v_U32_t)+data_len; pBuf = (v_U8_t*)vos_mem_malloc(total_len); if(!pBuf) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "vos_mem_malloc failed"); return; } vos_mem_zero((v_VOID_t*)pBuf,total_len); wmsg = (tAniHdr*)pBuf; wmsg->type = PTT_MSG_DIAG_CMDS_TYPE; wmsg->length = total_len; wmsg->length = DIAG_SWAP16(wmsg->length); pBuf += sizeof(tAniHdr); /* Diag Type events or log */ *(v_U32_t*)pBuf = DIAG_TYPE_LOGS; pBuf += sizeof(v_U32_t); memcpy(pBuf, pHdr,data_len); if(pHddCtx->ptt_pid != INVALID_PID) { if( ptt_sock_send_msg_to_app(wmsg, 0, ANI_NL_MSG_PUMAC, pHddCtx->ptt_pid) < 0) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, ("Ptt Socket error sending message to the app!!")); vos_mem_free((v_VOID_t *)wmsg); pHddCtx->ptt_pid = INVALID_PID; return; } } vos_mem_free((v_VOID_t*)wmsg); } return; }