📄 dot11hddlib.c
字号:
/* dot11HddLib.c - contains the generic Hardware Device Driver methods *//* Copyright 2004-2005 Wind River Systems, Inc. *//* Modification History--------------------02c,28sep05,rb Update header comments and copyright02b,27apr05,rb Updated routines with APIGEN tags02a,25aug04,rb Wind River Wireless Ethernet Driver 2.0 FCS*//*DESCRIPTIONSEE ALSOWind Net 802.11 Station 2.0 High Level Design Document\NOMANUAL*/#include <vxWorks.h>#include <muxLib.h>#include "drv/wlan/dot11Lib.h"#include "drv/wlan/dot11HddLib.h"#include "drv/wlan/dot11Bsp.h"#define MAX_HDD_OBJECTS (sizeof(hddDeviceTable) / sizeof(HDD_TABLE_ENTRY))typedef struct { UINT16 vendorId; UINT16 deviceId; FUNCPTR hddInitialize; } HDD_TABLE_ENTRY;HDD_TABLE_ENTRY hddDeviceTable[] = { {AR_PCI_VEN_ID, AR_PCI_DEV_AR5211, ar52Initialize }, {AR_PCI_VEN_ID, AR_PCI_DEV_AR5212, ar52Initialize }, {0, 0, NULL} };/***************************************************************************** dot11HddInit - Initialize the HDD structure** This routine calls the device initialization functions in the * hddDeviceTable[] above, hoping to find one that will match the vendor and* device IDs in the table. If this occurs, the routine is called. If the* routine succeeds, then the bringUp() function that is present in the * HDD_OBJ is called.** RETURNS: OK or ERROR** ERRNO: N/A*/STATUS dot11HddInit ( DOT11_FW * pDot11 /* Pointer to the dot11 Framework */ ) { STATUS status = ERROR; int i = 0; /* Perform the PCI initialization */ /* Figure out what type of card this is and fill in the HDD object appropriately */ DOT11_LOG(DOT11_DEBUG_INFO, DOT11_AREA_HDD, ("dot11HddInit: baseAddr = 0x%08x\n",pDot11->baseAddr, 0,0,0,0,0)); DOT11_LOG(DOT11_DEBUG_INFO, DOT11_AREA_HDD, ("dot11HddInit: PCI Vendor = 0x%04x\n",pDot11->pciVendorId, 0,0,0,0,0)); DOT11_LOG(DOT11_DEBUG_INFO, DOT11_AREA_HDD, ("dot11HddInit: PCI Device = 0x%04x\n",pDot11->pciDeviceId, 0,0,0,0,0)); /* Cycle through all of the hddDeviceTable */ while (hddDeviceTable[i].hddInitialize != NULL) { if ((hddDeviceTable[i].vendorId == pDot11->pciVendorId) && (hddDeviceTable[i].deviceId == pDot11->pciDeviceId)) { if ((status = hddDeviceTable[0].hddInitialize(pDot11)) == OK) { /* We found a working device. Exit */ break; } } i++; } /* Call the initialize routine to set up the rest of the HDD functions, making sure that it exists first */ if (status != OK) { DOT11_LOG(DOT11_DEBUG_INFO, DOT11_AREA_HDD, ("dot11HddInit: hddDeviceTable[] for vendor=%04x," "device=%04x does not have an initialize function. \n", pDot11->pciVendorId, pDot11->pciDeviceId,0,0,0,0)); return ERROR; } /* The initialize call in the loop above should have filled in the function table in the rest of the HDD */ if (pDot11->hdd->bringUp != NULL) { status = pDot11->hdd->bringUp(pDot11); } else { DOT11_LOG(DOT11_DEBUG_FATAL, DOT11_AREA_HDD, ("dot11HddInit: Unable to initialize driver\n",0,0,0,0,0,0)); return ERROR; } return status; }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -