📄 wait_for exit execs
字号:
/* Lock the mutex that serializes accessing the roaming related */
/* information of this MAC. */
op_prg_mt_mutex_lock (roam_state_ptr->roam_info_mutex, 0);
/* First store the values of the bad packet and bad CTS-to-self */
/* received flags since their values are needed for the state */
/* transition and the call of the function */
/* wlan_interrupts_process() below may reset these flags. */
bad_packet_rcvd = wlan_flags->rcvd_bad_packet;
bad_cts_to_self_rcvd = wlan_flags->rcvd_bad_cts;
/* Determine the interrupt type and the stream index in the */
/* case of stream interrupt, since this information will be */
/* in the next if statement condition. */
intrpt_type = op_intrpt_type ();
if (intrpt_type == OPC_INTRPT_STRM)
i_strm = op_intrpt_strm ();
/* Clear the frame timeout interrupt once the receiver is busy */
/* or the frame is received (in case of collisions, the */
/* frames whose reception has started while we were */
/* transmitting are excluded in the FRAME_RCVD macro). */
if (((intrpt_type == OPC_INTRPT_STAT && op_intrpt_stat () < TRANSMITTER_BUSY_INSTAT &&
op_stat_local_read (op_intrpt_stat ()) > rx_power_threshold && !wlan_flags->receiver_busy) ||
FRAME_RCVD) &&
(op_ev_valid (frame_timeout_evh) == OPC_TRUE))
{
op_ev_cancel (frame_timeout_evh);
}
/* Call the interrupt processing routine for each interrupt */
/* request. */
// used to subtract the amount of time spent servicing an interrupt
// from the total time spent in this FSM
//wsn_receive_current_offset = op_sim_time();
wlan_interrupts_process ();
//wsn_receive_current_offset = wsn_receive_current_offset - op_sim_time();
/* Set the flag for state transition, if we received a bad CTS- */
/* to-self at this invocation. If the flag "rcvd_bad_cts" is */
/* cleared at this interrupt, then this is the case. */
bad_cts_to_self_rcvd = bad_cts_to_self_rcvd ^ wlan_flags->rcvd_bad_cts;
/* If expected frame is not received in the set duration or the */
/* there is a collision at the receiver then set the expected */
/* frame type to be none because the station needs to */
/* retransmit the frame. */
if (intrpt_type == OPC_INTRPT_SELF && intrpt_code == WlanC_Frame_Timeout)
{
/* Setting expected frame type to none frame. */
expected_frame_type = WlanC_None;
/* Set the flag that indicates collision. */
wlan_flags->wait_eifs_dur = OPC_TRUE;
/* If PCF is active, increment poll fail and the retry */
/* counter. */
if (wlan_flags->pcf_active == OPC_TRUE)
{
/* If last frame a data frame, Increment retry counter. */
if ((last_frametx_type == WlanC_Data_Poll) || (last_frametx_type == WlanC_Data_A_P))
{
pcf_retry_count++;
}
if (wlan_flags->active_poll == OPC_TRUE)
{
poll_fail_count++;
wlan_flags->active_poll = OPC_FALSE;
}
/* Check whether further retries are possible or the */
/* data frame needs to be discarded. */
// mib wlan_pcf_frame_discard();
}
else
{
/* Increment the appropriate retransmission count. If */
/* our RTS transmission or data transmission whose size */
/* is smaller than RTS/CTS threshold has failed, then */
/* increment short retry count; otherwise increment the */
/* long retry count. */
if (last_frametx_type == WlanC_Rts || wlan_flags->frame_size_req_rts == OPC_FALSE)
short_retry_count++;
else
long_retry_count++;
/* Also reset the rts_sent flag since we need to */
/* recontend for the medium. */
wlan_flags->rts_sent = OPC_FALSE;
/* Reset the NAV duration so that the retransmission is */
/* not unnecessarily delayed. */
nav_duration = current_time;
/* Check whether further retries are possible or the */
/* data frame needs to be discarded. */
wlan_frame_discard ();
}
}
// Updates energy on final transition out of BACKOFF State
if (FRAME_TIMEOUT || FRAME_RCVD)
{
#ifndef OPD_NO_DEBUG
if ((op_sim_time() > wsn_test_time) && (my_address == wsn_test_address || my_address == wsn_test_address_2) )
printf("Node <%d> is exiting WAIT_FOR_RESPONSE and NOT calculating E before FRM_END\n", my_address);
#endif
//Update_Energy();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -