A_STATUS _qcom_p2p_event_persistent_list(A_UINT8 device_id, A_UINT8 * pEvtBuffer, int len) { if (p2p_msg_area_ptr) { A_UINT32 status; if (pEvtBuffer) { /* Copy to common message area and then call tx_queue_send to wake up the * thread waiting on receive. No need for locking the message area. Race * condition between application threads is prevented by having a check on * tx_queue_create. If queue is already created (and in use), API will * return an error */ A_MEMCPY(p2p_msg_area_ptr, pEvtBuffer, P2P_NETWORK_LIST_SIZE); status = 1; } else { status = 0; } if (p2p_msg_queue.tx_queue_id == TX_QUEUE_ID) { tx_queue_send(&p2p_msg_queue, &status, TX_NO_WAIT); } return A_OK; } return A_ERROR; }
tSirRetStatus wdaPostCfgMsg(tpAniSirGlobal pMac, tSirMsgQ *pMsg) { tSirRetStatus rc = eSIR_SUCCESS; do { #ifdef ANI_OS_TYPE_RTAI_LINUX // Posts message to the queue if (tx_queue_send(&pMac->sys.gSirMntMsgQ, pMsg, TX_NO_WAIT) != TX_SUCCESS) { wdaLog(pMac, LOGP, FL("Queue send Failed! rc (%X)\n"), eSIR_SYS_TX_Q_SEND_FAILED); rc = eSIR_SYS_TX_Q_SEND_FAILED; break; } #else // For Windows based MAC, instead of posting message to different // queues we will call the handler routines directly cfgProcessMbMsg(pMac, (tSirMbMsg*)pMsg->bodyptr); rc = eSIR_SUCCESS; #endif } while (0); return rc; } // halMntPostMsg()
wwd_result_t host_rtos_push_to_queue( host_queue_type_t* queue, void* message, uint32_t timeout_ms ) { if ( tx_queue_send( queue, (VOID*) message, ( timeout_ms == NEVER_TIMEOUT ) ? TX_WAIT_FOREVER : (ULONG) ( timeout_ms * SYSTICK_FREQUENCY / 1000 ) ) != TX_SUCCESS ) { return WWD_QUEUE_ERROR; } return WWD_SUCCESS; }
tSirRetStatus halNimPTTPostMsgApi(tpAniSirGlobal pMac, tSirMsgQ *pMsg) { tSirRetStatus rc = eSIR_SUCCESS; do { #ifdef ANI_OS_TYPE_RTAI_LINUX // Posts message to the queue if (tx_queue_send(&pMac->sys.gSirNimRDMsgQ, pMsg, TX_NO_WAIT) != TX_SUCCESS) { rc = eSIR_FAILURE; wdaLog(pMac, LOGP, FL("Posting a Msg to nimMsgQ failed!\n")); break; } #else // For Windows based MAC, instead of posting message to different // queues, we will call the handler routines directly wdaLog(pMac, LOGE, "ERROR: Received PTT message in obsolete code path.\n"); wdaLog(pMac, LOGP, "This indicates that the wrong OID is being used - clean registry and previous inf files.\n"); /* tPttMsgbuffer *msgPtr = (tPttMsgbuffer *)(pMsg->body); //for some reason, body is actually being used as if it were a void * pttProcessMsg(pMac, msgPtr); */ //TODO: the resonse is now packaged in ((tPttMsgbuffer *)&pMsg->body)->msgResponse and needs to be sent back to the application rc = eSIR_SUCCESS; #endif } while (0); return rc; } // halNimPTTPostMsgApi()
void thread_1_entry(ULONG thread_input) { UINT status; /* This thread simply sends messages to a queue shared by thread 2. */ while(1) { /* Increment the thread counter. */ thread_1_counter++; /* Send message to queue 0. */ status = tx_queue_send(&queue_0, &thread_1_messages_sent, TX_WAIT_FOREVER); /* Check completion status. */ if (status != TX_SUCCESS) break; /* Increment the message sent. */ thread_1_messages_sent++; } }