📄 intprismend.c
字号:
/* intPrismEnd.c - END driver for Wireless LAN cards *//* Copyright 2001-2003 Wind River Systems, Inc. *//*modification history--------------------02t,18jul03,rb Added ARMARCH4 back to #ifdef for ARM integrator stability enhancements02s,17jun03,rb Minor cosmetic changes02r,12jun03,rb Made stability improvments for wrSbcPxa25002q,29may03,ggg Correct non-SNAP packet ISR handling02p,09may03,rb Removed warnings caused by IPv6 integration02o,08may03,rb Added RX Buffer chaining to improve flood performance and stability02n,30apr03,ss removed SUBEND references02m,29apr03,rb Fix for SPR 87953 - change ARMARCH4 workaround to XSCALE and STRONGARM02l,29apr03,rb Demote error message in intPrismFlags about prom. mode02k,25apr03,ss moved version info to BSP level file02j,22apr03,ss added version info02i,22apr03,ss update to use intPrismTertAp.h02h,28feb03,rb Fixed endian bug showing WDS links in intPrismShow()02g,26feb03,ss Fixed diab compiler warningses02f,13feb03,rb Added support for WDS links02e,03oct02,rb Minor bug fixes, updates for PCD release02d,18jul02,rb Made fix for SPR 79871 less general02c,18jul02,rb Prevent IFF_PROMISC from entering promiscuous mode if you're an AP - SPR 7987102b,18jul02,rb Removed dot1xEndAuthCallbackInstall() as per Gilbert's request02a,11jun02,rb Added direct call model for 802.1X01z,23may02,rb Filtered DTIM events out of warning message in intPrismShow()01y,21may02,rb Fixed endianness in unicast WEP key support01x,21may02,rb Fixed broadcast key transmission on Linksys01w,21may02,rb Fixed problems with the WEP keys01v,17may02,rb Fixed comments around unicast key support01u,16may02,rb Added unicast/multicast WEP key separation capability01t,15may02,dxb Updated comments.01s,08may02,dxb Removed "Connected SSID" element for 3Com from intPrismShow().01r,06may02,cjl Added volatile to frame in ISR for Diab01q,06may02,cjl Changes for diab compiler01p,06may02,rb Fixed bug in interrupt - lastSeq used before defined01o,06may02,rb More comment updates01n,06may02,rb Fixed Diab compile problems by adding volatile static variables in ISR01m,03may02,rb Updated comments as per doc review01l,20apr02,ss changed function ptr's for endian safe in/out routines01k,16apr02,rb Added WLAN_INT_LOCK to improve stability.01l,18apr02,eja Changed macro name for enabling sub-end to INCLUDE_WLAN_SUBEND.01k,16apr02,ss changed use of pBSP in intPrismLoad01j,10apr02,rb Added PM indicators to show routine; cleaned up showe routine.01i,09apr02,rb Expanded show routine01h,08apr02,rb Changed EIOCSAUTHCALLBACK parameters for 802.1X group01g,05apr02,rb Fixed 802.1x call in ISR to use WLAN_IN_16_ENDIAN01f,04apr02,dxb Added Prism 3 support.01e,03apr02,rb Removed unnecessary intPrismReset() in intPrismStart()01d,01apr02,rb Put card in WLAN_STATUS_DOWN mode in intPrismStop()01c,28mar02,rb Fix for SPR 73754 - Stability problems under high load01b,20mar02,rb Modified ISR and Send routine to handle END_ERR_BLOCKED correctly; updated authentication callback prototype01a,18mar02,ss Update show routine to identify card as Prism 2 or 2.5Improved stability of TX data path 02u,15feb02,rb Fixed 802.1x in intPrismSend()02t,12feb02,ss Removed IMPORT of intPrismApStart02s,08feb02,rb Fixed bug that called access control in non-AP mode02r,07feb02,rb Added host-AP to show routine. Removed unneeded .h files02q,06feb02,dxb More changes for wlanEnd.h.02p,05feb02,dxb Updated to include changes to wlanEnd.h.02o,04feb02,rb Added support for extensible IOCTL calls02n,30jan02,rb Fix for SPR 71871: ifAddrSet occasionally causes page fault02m,24jan02,rb Removed duplicate definitions02l,23jan02,rb Added 802.1x extensions02k,15jan02,rb Speed improvement when writing/reading data - only blocks once . . .02j,20nov01,rb Fixed endianness bug in intPrismMcastAdd(), intPrismMcastDel()02i,12nov01,rb Added intPrismReset() to intPrismStart for increased boot stability02h,08nov01,rb Changed default error level to FATAL, eliminating recoverable errors.02g,05nov01,rb Changed APIs to match file name change02f,02nov01,dxb Updated with new file name.02e,25oct01,rb Modified wlanShow to use new IOCTL EIOCGIBSSMODE. Fixed duplicate packet bug in wlanInt(). Added authentication type to show routine.02d,18oct01,rb Fixed bug in wlanMCastDel02c,16oct01,rb Changed calls to EIOCGNETNAME to EIOCGDESIREDSSID, etc02b,21sep01,ss Added call to handle results of a channel scan in ISR02a,19sep01,rb Added support for big-endian architectures - MIPs01z,16sep01,rb Added firmware version to show routine; check F/W on boot01y,16sep01,rb Fixed buffer overrun in wlanSend()01x,14sep01,rb Increased MTU for compatability, fixed packet length bug01w,12sep01,rb Fixed error in wlanMCastAdd, wlanMCastDelete01v,11sep01,eja Made changes to support MIPS and fixed bug with getting multicast address.01u,06sep01,rb Fixed problems with T2.02 - replaced muxIoctl calls with wlanIoctl01t,05sep01,rb Changed parameter to INT_CONNECT from iLevel to iVec01s,05sep01,rb Added flags for T2.02 compatibility01r,05sep01,ss Changed a call from wlanAuthenticateStation to wlanStationAuthenticate, to reflect API change in wlanAp01q,04sep01,rb Documentation update01p,04sep01,rb Changed header comment to right filename01o,30aug01,ss In case of an Authentication Request, call wlanApAuthenticateStation01n,28aug01,rb Debugging01m,27aug01,rb Fixed wlanShow to work with AP01l,20aug01,rb Expanded wlanShow; Implemented AP vs STA differentiation01k,20aug01,rb Make calls to INT_CONNECT, etc. more generic, and memory accesses endian aware01j,20aug01,rb Temporary fix for Stormpad - include keepalive thread based on CPU==ARMARCH401i,16aug01,rb Added correct path to wlanEnd.h01h,15aug01,rb Changed to wlanEnd.c; Added 3com support01g,15aug01,rb Fixed wlanPollSend to work with new buffer pool01f,19jul01,rb Added BSS scan to wlanShow. Modified send to use buffer pool Added keep-alive thread for Stormpad BSP01e,12jul01,rb Code review changes, uninitialized END_OBJ bug fixed01d,22jun01,rb Further development01c,20jun01,rb Resolved TX semaphore issues; added mcast and polled-mode 01b,11jun01,rb Re-wrote RX routine to accomodate level-sensitive interrupts01a,29may01,rb Created*//*DESCRIPTIONThis is the main module of the WindNet 802.11b END driver. This driver currently supports cards based on the PRISM-I (Agere Orinoco/WaveLan, 3Com AirConnect, Symbol Wireless Networker), PRISM-2 (SMC 2632W, Linksys WPC11), PRISM-2.5 (Linksys WPC11 v2.5, Linksys WMP11) and PRISM-3 (Linksys WPC11 v3) Any PCMCIA initialization required to power onand enable the card's I/O or memory space must be completed successfully in a lower level driver before this module is called by muxDevLoad().ACKNOWLEDGEMENTSSome of the RID definition macros in intPrismHw.h are based on the Lucent WaveLAN/IEEE 802.11 PCMCIA driver for FreeBSD by Bill Paul, Copyright (c) 1997, 1998, 1999 Bill Paul <wpaul@ctr.columbia.edu>END-DRIVER PARAMETERSThese parameters are passed to the intPrismLoad routine in an initializationstring of the form:<ioBase>:<iVector>:<iLevel>:<Offset> baseAddr: Base address for the card. To be determined by the PCI/PCMCIA module iVector : Interrupt vector for the card. System dependent iLevel : Interrupt level for the card. System dependent offset : a value of 2 enables word alignment. Always set to 2 for this driverSEE ALSOintPrismHw.c (Wind River Systems, Inc)intPrismIoctl.c (Wind River Systems, Inc)intPrismHw.h (Wind River Systems, Inc)intPrismEnd.h (Wind River Systems, Inc)Network Protocol Toolkit User's Guide (Wind River Systems, Inc)FreeBSD Wavelan/IEEE driverPRISM Driver Programmer's Manual (CHOICE-Intersil Corporation)*/#include <vxWorks.h>#include <string.h>#include "cacheLib.h" #include "intLib.h"#include "semLib.h"#include "logLib.h"#include "netLib.h"#include "stdio.h" #include "sysLib.h"#include "memLib.h"#include "end.h" /* Common END structures. */#include "endLib.h"#ifdef ETHER_MAP_IP_MULTICAST#undef ETHER_MAP_IP_MULTICAST#endif#include "etherMultiLib.h" /* multicast stuff. */#include "net/mbuf.h"#include <taskLib.h>#include "wrn/wlan/wlanEnd.h"#include "wrn/wlan/intPrismHw.h"#include "wrn/wlan/intPrismTertAp.h"#include "wrn/wlan/intPrismDownload.h"#ifdef WLANDBG#undef LOCAL#define LOCAL#endif/***************************************************************************** Debugging facilities - these may be enabled from the shell by changing* the value of WLANDebug. Error levels are defined in wlanEnd.h***************************************************************************/INT32 wlanDebug = DEBUG_ERROR;/***************************************************************************** Local variables***************************************************************************//* Pointer to a linked list of all instances of the driver */WLAN_DEV * pWlanHead = NULL; /* register offset's for the MiniPCI version of Prism card's (chipset ISL3874 and others) */const WLAN_REGISTERS miniPciRegisters = { 0x00, /* command */ 0x04, /* param0 */ 0x08, /* param1 */ 0x0C, /* param2 */ 0x10, /* status */ 0x14, /* resp0 */ 0x18, /* resp1 */ 0x1C, /* resp2 */ 0x20, /* infoFid */ 0x40, /* rxFid */ 0x44, /* allocFid */ 0x48, /* txCmpFid */ 0x30, /* sel0 */ 0x34, /* sel1 */ 0x38, /* off0 */ 0x3C, /* off1 */ 0x6C, /* data0 */ 0x70, /* data1 */ 0x60, /* eventStat */ 0x64, /* intEn */ 0x68, /* eventAck */ 0x50, /* sw0 */ 0x54, /* sw1 */ 0x58, /* sw2 */ 0x58, /* sw3 - does not actually exist for this card */ 0x28, /* cntl */ 0x74, /* auxPage */ 0x78, /* auxOffset */ 0x7C /* auxData */ };/* register offset's for the PCMCIA version of Prism card's (chipset HFA384x and others) */const WLAN_REGISTERS pcmciaRegisters = { 0x00, /* command */ 0x02, /* param0 */ 0x04, /* param1 */ 0x06, /* param2 */ 0x08, /* status */ 0x0A, /* resp0 */ 0x0C, /* resp1 */ 0x0E, /* resp2 */ 0x10, /* infoFid */ 0x20, /* rxFid */ 0x22, /* allocFid */ 0x24, /* txCmpFid */ 0x18, /* sel0 */ 0x1A, /* sel1 */ 0x1C, /* off0 */ 0x1E, /* off1 */ 0x36, /* data0 */ 0x38, /* data1 */ 0x30, /* eventStat */ 0x32, /* intEn */ 0x34, /* eventAck */ 0x28, /* sw0 */ 0x2A, /* sw1 */ 0x2C, /* sw2 */ 0x2E, /* sw3 */ 0x14, /* cntl */ 0x3A, /* auxPage */ 0x3C, /* auxOffset */ 0x3E /* auxData */ };/**************************************************************************** Local Prototypes**************************************************************************/LOCAL STATUS intPrismStart (END_OBJ * pDrvCtrl);STATUS intPrismStop(END_OBJ * pDrvCtrl);int intPrismIoctl(END_OBJ * pDrvCtrl, unsigned int cmd, caddr_t data);STATUS intPrismUnload (END_OBJ * pDrvCtrl);LOCAL STATUS intPrismSend (END_OBJ * pDrvCtrl, M_BLK_ID pBuf);STATUS intPrismMCastAdd (END_OBJ * pDrvCtrl, char * pAddress);STATUS intPrismMCastDel (END_OBJ * pDrvCtrl, char * pAddress);STATUS intPrismMCastGet (END_OBJ * pDrvCtrl, MULTI_TABLE * pTable);LOCAL STATUS intPrismPollStart (END_OBJ * pDrvCtrl);LOCAL STATUS intPrismPollStop (END_OBJ * pDrvCtrl);STATUS intPrismPollSend (END_OBJ * pDrvCtrl, M_BLK_ID pBuf);STATUS intPrismPollRcv (END_OBJ * pDrvCtrl, M_BLK_ID pBuf);LOCAL STATUS intPrismParse (WLAN_DEV * pWlanDev, char * initString);LOCAL STATUS intPrismMemInit(WLAN_DEV * pWlanDev); STATUS intPrismInt(WLAN_DEV * pWlanDev );LOCAL STATUS intPrismReceive(WLAN_DEV * pWlanDev, RX_PACKET * pData, int datalen);WLAN_DEV * intPrismDevGet(int unitnum);STATUS intPrismFlags (WLAN_DEV * pWlanDev );IMPORT int intPrismManage (WLAN_DEV * pWlanDev, int cmd, caddr_t data );IMPORT INT32 endMultiLstCnt (END_OBJ *);IMPORT STATUS sysWlanCfgParamGet (UINT32 cmd, INT32 data);#if (CPU==STRONGARM) || (CPU==XSCALE) || (CPU==ARMARCH4)LOCAL VOID intPrismKeepalive(WLAN_DEV * pWlanDev);#endif/**************************************************************************** External references**************************************************************************//* BSP specific card access routines */IMPORT UINT8 sysWlanIOInByte (UINT32);IMPORT void sysWlanIOOutByte (UINT32, UINT8);IMPORT UINT16 sysWlanIOInWord (UINT32);IMPORT void sysWlanIOOutWord (UINT32, UINT16);IMPORT UINT32 sysWlanIOInLong (UINT32);IMPORT void sysWlanIOOutLong (UINT32, UINT32);IMPORT UINT8 sysWlanMemInByte (UINT32);IMPORT void sysWlanMemOutByte (UINT32, UINT8);IMPORT UINT16 sysWlanMemInWord (UINT32);IMPORT void sysWlanMemOutWord (UINT32, UINT16);IMPORT UINT32 sysWlanMemInLong (UINT32);IMPORT void sysWlanMemOutLong (UINT32, UINT32);UINT16 sysWlanMemEndianInWord (UINT32);void sysWlanMemEndianOutWord (UINT32, UINT16);UINT16 sysWlanIOEndianInWord (UINT32);void sysWlanIOEndianOutWord (UINT32, UINT16);/****************************************************************************** Basic END functions* These are the basic functions that are required to implement an END driver****************************************************************************/NET_FUNCS intPrismFuncTable = {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -