예제 #1
0
int ccci_df_to_ccci_tx_callback(unsigned int txq_no)
{
    int space=hif_ul_swq_space(txq_no) - atomic_read(&ccci_tx_waitq[txq_no].reserve_space);
    
    DEBUG_LOG_FUNCTION_ENTRY;

    wake_up_nr(&ccci_tx_waitq[txq_no].tx_waitq, space);
    DBGLOG(CCCI, TRA, "ccci_tx_callback: txq_no=%d, wake task num=%d", txq_no, space);    

    DEBUG_LOG_FUNCTION_LEAVE;
    return KAL_SUCCESS;
}
예제 #2
0
KAL_UINT32 eemcs_ccci_boot_UL_write_room_check(void)
{
    KAL_UINT32   boot_port_id = 0;
    KAL_UINT32   tx_queue_idx=0;
    KAL_UINT32   ret = 0;

    boot_port_id = ccci_ch_to_port(CH_CTRL_TX);
    tx_queue_idx = ccci_port_info[boot_port_id].txq_id;
    ret = hif_ul_swq_space(tx_queue_idx);

    return ret;
}
예제 #3
0
KAL_UINT32 eemcs_ccci_UL_write_wait(CCCI_CHANNEL_T chn)
{
    KAL_UINT32   port_id = 0;
    KAL_UINT32   tx_queue_idx=0;
    KAL_UINT32   ret = 0;
    
    port_id = ccci_ch_to_port(chn);
    tx_queue_idx = ccci_port_info[port_id].txq_id;
    ret = wait_event_interruptible_exclusive(ccci_tx_waitq[tx_queue_idx].tx_waitq, (hif_ul_swq_space(tx_queue_idx) - atomic_read(&ccci_tx_waitq[tx_queue_idx].reserve_space) )> 0);

    DBGLOG(CCCI, TRA, "ccci_write_wait: wakeup port%d, txq=%d, ret=%d", port_id, tx_queue_idx, ret);
	return ret;
}
예제 #4
0
KAL_UINT32 eemcs_ccci_UL_write_room_alloc(CCCI_CHANNEL_T chn)
{
    KAL_UINT32   port_id = 0;
    KAL_UINT32   tx_queue_idx=0;
    KAL_UINT32   ret = 0;
#ifdef __EEMCS_EXPT_SUPPORT__
    EEMCS_EXCEPTION_STATE mode = EEMCS_EX_INVALID;
#endif
    
    port_id = ccci_ch_to_port(chn);
    
#ifdef __EEMCS_EXPT_SUPPORT__
    /*we just return 1 to bypass this check.
      exception check will be taken when writing SKB to swq */
    if(is_exception_mode(&mode))
    {
        return 1;
    }
#endif        

    tx_queue_idx = ccci_port_info[port_id].txq_id;

    // for poll
    if(atomic_read(&ccci_port_info[port_id].reserve_space) >= 1){
        DBGLOG(CCCI, TRA, "ccci_write_room_alloc: port%d write space has reserved",port_id);
        return 1;
    }
    
    ret = hif_ul_swq_space(tx_queue_idx) - atomic_read(&ccci_tx_waitq[tx_queue_idx].reserve_space);

    if (ret > 0){
        atomic_inc(&ccci_port_info[port_id].reserve_space);
        atomic_inc(&ccci_tx_waitq[tx_queue_idx].reserve_space);
    } else {
    	DBGLOG(CCCI, INF, "ccci_write_room_alloc: port%d, tx_qlen=%d, resv=%d, ret=%d", \
			port_id, mtlte_df_UL_pkt_in_swq(tx_queue_idx), atomic_read(&ccci_tx_waitq[tx_queue_idx].reserve_space), ret);
    }

    DBGLOG(CCCI, TRA, "ccci_write_room_alloc: txq=%d, size=%d",tx_queue_idx, ret);
    return ret;
}