示例#1
0
/*
 * \brief	Read interrupt info from FW
 * 
 * \param   hFwEvent  - FwEvent Driver handle
 * \return  void
 * 
 * \par Description
 * 
 * Indicate the TwIf that HW is available and initiate transactions for reading
 *     the Interrupt status and the FW status.
 *
 * \sa
 */
static ETxnStatus fwEvent_SmReadIntrInfo (TfwEvent *pFwEvent)
{
    ETxnStatus eStatus;
    CL_TRACE_START_L4();

#ifdef HOST_INTR_MODE_EDGE
    /* Acknowledge the host interrupt for EDGE mode (must be before HINT_STT_CLR register clear on read) */
    os_InterruptServiced (pFwEvent->hOs);
#endif

    /* Indicate that the chip is awake (since it interrupted us) */
    twIf_HwAvailable(pFwEvent->hTwIf);

    /*
     * Read FW-Status structure from HW ==> Special mapping, see note!!
     *
     * Note: This structure actually includes two separate areas in the FW:
     *          1) Interrupt-Status register - a 32 bit register (clear on read).
     *          2) FW-Status structure - 64 bytes memory area
     *       The two areas are read in a single transaction thanks to a special memory 
     *           partition that maps them as contiguous memory.
     */
    TXN_FW_EVENT_SET_FW_STAT_ADDR(pFwEvent)
    eStatus = twIf_TransactReadFWStatus (pFwEvent->hTwIf, &(pFwEvent->tFwStatusTxn.tTxnStruct));

    CL_TRACE_END_L4("tiwlan_drv.ko", "CONTEXT", "FwEvent", "");

    /* Return the status of the FwStatus read (complete, pending or error) */
    return eStatus;
}
示例#2
0
TI_STATUS TWD_InitHw (TI_HANDLE hTWD,
                      TI_UINT8  *pbuf,
                      TI_UINT32 length,
                      TI_UINT32 uRxDmaBufLen,
                      TI_UINT32 uTxDmaBufLen)
{
    TTwd *pTWD = (TTwd *)hTWD;
    TI_STATUS eStatus;


    /* Provide bus related parameters to Xfer modules before any usage of the bus! */
    rxXfer_SetBusParams (pTWD->hRxXfer, uRxDmaBufLen);
    txXfer_SetBusParams (pTWD->hTxXfer, uTxDmaBufLen);

    hwInit_SetNvsImage (pTWD->hHwInit, pbuf, length);

    /*
     * Update the TwIf that the HW is awake
     * This will protect the initialization process from going to sleep
     * After the firmware initializations completed (TWD_EnableExternalEvents), the sleep will be enabled
     */
    twIf_Awake (pTWD->hTwIf);
    twIf_HwAvailable (pTWD->hTwIf);

    /* This initiates the HW init sequence */
    eStatus = hwInit_Boot(pTWD->hHwInit);
    if (eStatus == TXN_STATUS_ERROR)
    {
        return TI_NOK;
    }

    return TI_OK;
}