Exemplo n.º 1
0
/*
 *  This routine is called to initialize the rate control parameters
 *  in the SIB. It is called initially during system initialization
 *  or when a station is associated with the AP.
 */
void
rcSibInit(struct atheros_node *pSib)
{
    struct TxRateCtrl_s *pRc        = &pSib->txRateCtrl;

#if 0
    /* NB: caller assumed to zero state */
    A_MEM_ZERO((char *)pSib, sizeof(*pSib));
#endif
    pRc->rssiDownTime = A_MS_TICKGET();
}
Exemplo n.º 2
0
A_STATUS
halAttach(WLAN_DEV_INFO *pDev)
{
    A_STATUS      status;
    unsigned int  i;
    A_UINT32      numDeviceIDs;

    ASSERT(pDev);

    halGetDeviceId(pDev);

    /* Find a matching DeviceID attach routine */
    numDeviceIDs = (sizeof(ar5kAttachData)/sizeof(DEVICE_ATTACH_DATA));
    for (i = 0; i < numDeviceIDs; i++) {
        if (pDev->pciInfo.DeviceID == ar5kAttachData[i].deviceID) {
            break;
        }
    }
    if (i == numDeviceIDs) {
        uiPrintf("halAttach: Failed to find an attachable driver for devid 0x%04X\n", pDev->pciInfo.DeviceID);
        return A_DEVICE_NOT_FOUND;
    }

    pDev->pHalInfo = (HAL_INFO *) A_DRIVER_MALLOC(sizeof(*pDev->pHalInfo));
    if (pDev->pHalInfo == NULL) {
        uiPrintf("halAttach: Error allocating memory for info struct\n");
        return A_ERROR;
    }
    A_MEM_ZERO(pDev->pHalInfo, sizeof(HAL_INFO));

    /* Call the device specific attach function */
    status = ar5kAttachData[i].hwAttach(pDev, pDev->pciInfo.DeviceID);

    /* If unsuccessful, free any allocated memory */
    if (status != A_OK) {
        A_DRIVER_FREE(pDev->pHalInfo, sizeof(HAL_INFO));
        pDev->pHalInfo = NULL;
    }

    return status;
}