?? dot11lib.c
字號:
DOT11_FW * pDot11 = (DOT11_FW *)pEnd; int i; DOT11_LOG(DOT11_DEBUG_INFO, DOT11_AREA_INIT, ("dot11EndStop: Stopping.\n", 0, 0, 0, 0, 0, 0)); if (pEnd == NULL) { return ERROR; } END_FLAGS_CLR (pEnd, (IFF_UP | IFF_RUNNING)); /* Stop the old SME mode */ if (pDot11->dot11Mode != DOT11_MODE_NONE) { for (i=0; i<DOT11_BSS_MAX; i++) { pDot11->sme->bss[i].linkStatus = DOT11_LINK_DOWN; } /* If there is an SME mode free function registered */ if (pDot11->sme->modeFree != NULL) { pDot11->sme->modeFree(pDot11); } /* Stop the HDD */ pDot11->hdd->stop(pDot11); pDot11->dot11Mode = DOT11_MODE_NONE; } dot11TimerDel(pDot11->oneSecTimer); dot11TimerDel(pDot11->sixteenSecTimer); /* Zero out the statistics */ bzero((char *)&pDot11->stats, sizeof(DOT11_STATS)); return OK; }/****************************************************************************** dot11EndUnload - END unload function** This function de-initializes the driver, freeing all memory allocated by* the mux LOAD routine.n After completion of this function, it is as if* the driver never existed. The hardware is stopped or shut down if possible.** RETURNS: OK or ERROR** ERRNO: N/A*/LOCAL STATUS dot11EndUnload ( END_OBJ * pEnd /* wireless END device to Unload*/ ) { DOT11_FW * pDot11 = (DOT11_FW *)pEnd; STATUS status = OK; DOT11_LOG(DOT11_DEBUG_INFO, DOT11_AREA_INIT, ("dot11EndUnload: Unloading.\n", 0, 0, 0, 0, 0, 0)); if (pEnd == NULL) { return ERROR; } if (pDot11->dot11Mode != DOT11_MODE_NONE) { status = dot11EndStop(pEnd); } END_OBJECT_UNLOAD (pEnd); /* Some versions of Tornado have a bug where the txSem is not freed on unload. Check if this is the case and do it here if it was not freed. */ if (pEnd->txSem != NULL) { semDelete (pEnd->txSem); pEnd->txSem = NULL; } /* De-initialize and free the children */ status |= pDot11->hdd->free(pDot11); status |= pDot11->sme->free(pDot11); status |= pDot11->dpe->free(pDot11); /* Free the network cluster pool */ status |= dot11MemFree(pDot11); status |= dot11TimerDestroy(); /* Free the DMA buffer that was allocated by sysDot11EndLoad() */ if (dot11BspFuncs.dmaMemFree != NULL) { dot11BspFuncs.dmaMemFree(pDot11->unitNum); } else { DOT11_LOG(DOT11_DEBUG_INFO, DOT11_AREA_INIT, ("dot11EndUnload: dmaMemFree not implemented.\n", 0, 0, 0, 0, 0, 0)); } /* We don't need to free the root object itself, since muxDevUnload() should do this for us */ return status; }#ifdef DOT11_DEBUG_GLOBAL/****************************************************************************** dot11DebugLevelGet - Returns the current debug level for the specified area** This function returns the debug level for the specified area. Note that* DOT11_AREA_ALL is not a valid option. This function can only be called * from the kernel.** RETURNS: The debug level of the current area. See DESCRIPTION.** ERRNO: N/A** \IFSET KERNEL**/INT32 dot11DebugLevelGet ( int area /* Debug area to get level for */ ) { return dot11DebugArray[area]; }/****************************************************************************** dot11DebugLevelSet - Sets the debug level for the specified area.** This function sets the debug level for the specified area. DOT11_AREA_ALL * is a valid area, and will set the debug level of all AREAs to the specified* value. This function can only be called from the kernel.** RETURNS: OK or ERROR** ERRNO: N/A** \IFSET KERNEL**/STATUS dot11DebugLevelSet ( int area, /* Debug area to get level for */ int level /* Debug level to set */ ) { int i; if (area == DOT11_AREA_ALL) { for (i=1; i<DOT11_MAX_DEBUG_AREAS; i++) { dot11DebugArray[i] = level; } } else if (area >= DOT11_MAX_DEBUG_AREAS) { return ERROR; } else { dot11DebugArray[area] = level; } return OK; }#endif/******************************************************************************* dot11Parse - Parses the initString and fills in the device structure** This function parses the init string, which is colon delimited. ** RETURNS: OK or ERROR** ERRNO: N/A*/LOCAL STATUS dot11Parse ( DOT11_FW * pDot11, /* Pointer to device structure */ char * initString /* Initialization string to parse */ ) { char * tok; char * holder = NULL; /* Unit number. */ tok = strtok_r (initString, ":", &holder); if (tok == NULL) return ERROR; pDot11->unitNum = atoi (tok); /* Address of BSP COntrol structure (in hex) */ tok = strtok_r (NULL, ":", &holder); if (tok == NULL) { return ERROR; } pDot11->pBsp = (DOT11_BSP_INFO *)strtoul (tok, NULL, 16); /* Ensure that we have the correct pointer */ if ((pDot11->pBsp == NULL) || (pDot11->pBsp->magicNum != DOT11_BSP_INFO_VER_0)) { DOT11_LOG(DOT11_DEBUG_FATAL, DOT11_AREA_INIT, ("dot11Parse: pBsp or magic number not found!\n", 0,0,0,0,0,0)); return ERROR; } /* This is the most critical addr. Make sure it's valid */ if ((pDot11->baseAddr = (UINT32)pDot11->pBsp->memBaseAddr) == (UINT32)NULL) { return ERROR; } DOT11_LOG(DOT11_DEBUG_INFO, DOT11_AREA_INIT, ("dot11Parse: memBaseAddr = %08x\n", pDot11->baseAddr,0,0,0,0,0)); /* Copy the entries over one by one. We don't want to use the original structure in place for forward compatability reasons */ pDot11->dmaBufAddr = pDot11->pBsp->dmaBuffAddr; DOT11_LOG(DOT11_DEBUG_INFO, DOT11_AREA_INIT, ("dot11Parse: dmaBufAddr = %08x\n", pDot11->dmaBufAddr,0,0,0,0,0)); pDot11->dmaBufSize = pDot11->pBsp->dmaBufSize; pDot11->dmaBufUsed = 0; DOT11_LOG(DOT11_DEBUG_INFO, DOT11_AREA_INIT, ("dot11Parse: dmaBufSize = %08x\n", pDot11->dmaBufSize,0,0,0,0,0)); if ((pDot11->dmaBufAddr == 0) || (pDot11->dmaBufAddr == 0xffffffff) || (pDot11->dmaBufSize == 0)) { DOT11_LOG(DOT11_DEBUG_FATAL, DOT11_AREA_INIT, ("dot11Parse: DMA buffer not provided!\n", 0,0,0,0,0,0)); return ERROR; } pDot11->intVector = pDot11->pBsp->ivec; pDot11->intLevel = pDot11->pBsp->ilevel; DOT11_LOG(DOT11_DEBUG_INFO, DOT11_AREA_INIT, ("dot11Parse: ivec/level = %d/%d\n", pDot11->intVector,pDot11->intLevel,0,0,0,0)); pDot11->cacheLineSize = pDot11->pBsp->cacheLineSz; DOT11_LOG(DOT11_DEBUG_INFO, DOT11_AREA_INIT, ("dot11Parse: CacheLineSize = %d\n", pDot11->cacheLineSize,0,0,0,0,0)); pDot11->pciVendorId = pDot11->pBsp->pciVendorId; DOT11_LOG(DOT11_DEBUG_INFO, DOT11_AREA_INIT, ("dot11Parse: Vendor ID = %04x\n", pDot11->pciVendorId,0,0,0,0,0)); pDot11->pciDeviceId = pDot11->pBsp->pciDeviceId; DOT11_LOG(DOT11_DEBUG_INFO, DOT11_AREA_INIT, ("dot11Parse: Device ID = %04x\n", pDot11->pciDeviceId,0,0,0,0,0)); pDot11->pciSubDeviceId = pDot11->pBsp->pciSubDeviceId; pDot11->pciSubVendorId = pDot11->pBsp->pciSubVendorId; pDot11->pciChipRevId = pDot11->pBsp->pciChipSetRev; /* Bind in all of the required BSP support functions */ dot11BspFuncs.cacheFlush = pDot11->pBsp->binding->sysCacheFlush; dot11BspFuncs.cacheInval = pDot11->pBsp->binding->sysCacheInvalidate; dot11BspFuncs.physToVirt = pDot11->pBsp->binding->sysPhysToVirt; dot11BspFuncs.virtToPhys = pDot11->pBsp->binding->sysVirtToPhys; dot11BspFuncs.sysUsDelay = pDot11->pBsp->binding->sysUsDelay; dot11BspFuncs.sysIntConnect = pDot11->pBsp->binding->sysIntConnect; dot11BspFuncs.sysIntDisconnect = pDot11->pBsp->binding->sysIntDisconnect; dot11BspFuncs.sysIntEnable = pDot11->pBsp->binding->sysIntEnable; dot11BspFuncs.sysIntDisable = pDot11->pBsp->binding->sysIntDisable; dot11BspFuncs.essInit = pDot11->pBsp->binding->essInit; dot11BspFuncs.ibssInit = pDot11->pBsp->binding->ibssInit; dot11BspFuncs.apInit = pDot11->pBsp->binding->apInit; dot11BspFuncs.rsnInit = pDot11->pBsp->binding->rsnInit; dot11BspFuncs.dmaMemFree = pDot11->pBsp->binding->sysDmaMemFree; /* If there are compile-time initialization items present, then
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -