📄 syswlanendppc.c
字号:
UINT32 sysWlanMemInLong ( UINT32 addr ) { UINT32 localData = 0; UINT32 data = 0; data = * (volatile UINT32 *) addr; localData = WLAN_SWAP_ENDIAN_32 (data); return (localData); }/****************************************************************************** sysWlanMemOutLong - write a 32 bit value to specified device address** RETURNS: N/A** NOMANUAL*/void sysWlanMemOutLong ( UINT32 addr, UINT32 data ) { UINT32 localData = 0; localData = WLAN_SWAP_ENDIAN_32 (data); * (volatile UINT32 *) addr = localData; }/****************************************************************************** sysWlanIOInByte - read an 8 bit value from specified device address ** RETURNS: 8 bit value form the specified device address** NOMANUAL*/UINT8 sysWlanIOInByte ( UINT32 addr ) { return sysWlanMemInByte(addr); }/****************************************************************************** sysWlanIOOutByte - write an 8 bit value to specified device address** RETURNS: N/A** NOMANUAL*/void sysWlanIOOutByte ( UINT32 addr, UINT8 data ) { sysWlanMemOutByte(addr, data); }/****************************************************************************** sysWlanIOInWord - read a 16 bit value from the specified device address ** RETURNS: 16 bit value from the specified device address.** NOMANUAL*/UINT16 sysWlanIOInWord ( UINT32 addr ) { return sysWlanMemInWord(addr); }/****************************************************************************** sysWlanIOOutWord - write a 16 bit value to specified device address** RETURNS: N/A** NOMANUAL*/void sysWlanIOOutWord ( UINT32 addr, UINT16 data ) { sysWlanMemOutWord(addr, data); }/****************************************************************************** sysWlanIOInLong - read a 32 bit value form the specified device address ** RETURNS: 32 bit value from the specified device address.** NOMANUAL*/UINT32 sysWlanIOInLong ( UINT32 addr ) { return sysWlanMemInLong(addr); }/****************************************************************************** sysWlanIOOutLong - write a 32 bit value to specified device address** RETURNS: N/A** NOMANUAL*/void sysWlanIOOutLong ( UINT32 addr, UINT32 data ) { sysWlanMemOutLong(addr, data); }/****************************************************************************** sysWlanIOEndianInWord - read a 16 bit value to specified device address* without swapping byte order (routine included for completeness, on PENTIUM * this is not an issue).** RETURNS: N/A** NOMANUAL*/UINT16 sysWlanIOEndianInWord ( UINT32 addr ) { UINT16 data = 0; data = * (volatile UINT16 *) addr; return (data); }/****************************************************************************** sysWlanIOEndianOutWord - write a 16 bit value to specified device address* without swapping byte order (routine include for completeness, on PENTIUM* this is not an issue).** RETURNS: N/A** NOMANUAL*/void sysWlanIOEndianOutWord ( UINT32 addr, UINT16 data ) { * (volatile UINT16 *) addr = data; }/****************************************************************************** sysWlanMemEndianInWord - read a 16 bit value from the specified device address * without swapping byte order (routine included for completeness, on PENITUM* this is not an issue).** RETURNS: 16 bit value from the specified device address.** NOMANUAL*/UINT16 sysWlanMemEndianInWord ( UINT32 addr ) { UINT16 data = 0; data = * (volatile UINT16 *) addr; return (data); }/****************************************************************************** sysWlanMemEndianOutWord - write a 16 bit value to specified device address* without swapping byte order (routine included for completeness, on PENTIUM* this is not an issue).** RETURNS: N/A** NOMANUAL*/void sysWlanMemEndianOutWord ( UINT32 addr, UINT16 data ) { * (volatile UINT16 *) addr = data; }/****************************************************************************** sysWlanDelay - x86 specific time delay (not used)** This routine is simply a wrapper to the API defined in sysLib.h.** RETURNS: N/A** NOMANUAL*/void sysWlanDelay (void) { (void) sysDelay (); }/***************************************************************************** sysWlanIntConnect - enable the system level interrupt** This routine enables the board level interrupt.** Be aware that using the intConnect() routine below usually allows only one* ISR per interrupt, and may result in interrupt conflicts with other* devices that may share the same interrupt.** RETURNS: N/A** NOMANUAL*/void sysWlanIntConnect ( INT32 vector, /* interrupt vector */ INT32 routine, /* interrupt service routine */ INT32 paramater, /* parameter used by the isr */ STATUS * result /* result of api call */ ) { *result = intConnect (INUM_TO_IVEC(vector), (VOIDFUNCPTR) routine, (int) paramater); }/****************************************************************************** sysWlanIntDisconnect - disable the system level interrupt** This routine disables the board level interrupt.** Be aware that using the intDisconnect() routine below (if supported) may* inadvertently disable interrupts to multiple devices, if these devices* share the same interrupt.** RETURNS: N/A** NOMANUAL*/void sysWlanIntDisconnect ( INT32 vector, /* interrupt vector */ INT32 routine, /* interrupt service routine */ INT32 paramater, /* parameter used by the isr */ STATUS * result /* result of api call */ ) { }/****************************************************************************** sysWlanIntEnable - enable the board level interrupt** This routine enables the board level interrupt.** Be aware that using the intEnable() routine below could have impact on other* devices which may be sharing the same interrupt. In some cases it may be* better to enable interrupts directly on the device instead of using* intEnable().** RETURNS: N/A** NOMANUAL*/void sysWlanIntEnable ( INT32 intLevel, /* interrupt request level */ STATUS * result /* result of API call */ ) { int immrVal = vxImmrGet (); /* Enable level 5 interrupt */ *PGCRA(immrVal) |= 0x04000000; *PER(immrVal) |= 0x00800000; *result = intEnable (intLevel); }/****************************************************************************** sysWlanIntDisable - disable the board level interrupt** This routine disables the board level interrupt.** Be aware that using the intDisable() routine below could have impact on other* devices which may be sharing the same interrupt. In some cases it may be* better to disable interrupts directly on the device instead of using* intDisable().** RETURNS: N/A** NOMANUAL*/void sysWlanIntDisable ( INT32 intLevel, /* interrupt request level */ STATUS * result /* result of API call */ ) { *result = intDisable (intLevel); }/****************************************************************************** sysWlanPccardEnable - enable I/O access mode on the pccard ** RETURNS: OK or ERROR if pccaard I/O space not enabled** NOMANUAL*/LOCAL STATUS sysWlanPccardEnable ( INT32 sock, /* socket to search */ UINT8 *name, /* device name (ie wln, elt etc...) */ UINT16 manfID, /* manufactures ID of the card */ UINT32 *ioBase, /* base I/O port of this board */ UINT32 *iVec, /* interrupt vector */ UINT32 *iLevel, /* interrupt level */ UINT16 corValue /* Enabling value to write to COR */ ) { /* Apply a soft reset to the card, for at least 1 ms */ sysWlanMemOutByte(PCMCIA_ATTRIBUTE_BA + COR_OFFSET, 0x80); sysMsDelay(1200); sysWlanMemOutByte(PCMCIA_ATTRIBUTE_BA + COR_OFFSET, 0x00); sysMsDelay(400); /* Enable IO space on card */ sysWlanMemOutByte(PCMCIA_ATTRIBUTE_BA + COR_OFFSET, corValue); /* Update the params */ *ioBase = (UINT32) PCMCIA_IO_BA; *iLevel = (UINT32) 11; *iVec = (UINT32) 11; return (OK); }#ifdef INCLUDE_AIRONET_SHOWIMPORT STATUS cisAironetShowInit (void);/****************************************************************************** sysWlanShowInit - Dummy routine used to get aironet show symbols into * image. ** RETURNS: ** NOMANUAL*/void sysWlanShowInit (void) { (void) cisAironetShowInit (); }#endif/****************************************************************************** sysWlanCfgParamGet - Routine used to get default card config parameters.** RETURNS: ** NOMANUAL*/ STATUS sysWlanCfgParamGet ( UINT32 cmd, INT32 data ) { /* Sanity check */ if (data == (INT32) NULL) { return (ERROR); } /* Get the config parameter */ switch (cmd) { case WLAN_SSID: (void) bcopy (WLAN_DEFAULT_SSID, (char *) data, strlen (WLAN_DEFAULT_SSID)); break; case WLAN_STATION_NAME: (void) bcopy (WLAN_DEFAULT_STATION_NAME, (char *) data, strlen (WLAN_DEFAULT_STATION_NAME)); break; case WLAN_STATION_MODE: * (UINT16 *) data = (UINT16) WLAN_DEFAULT_STATION_MODE; break; case WLAN_CHANNEL: * (UINT16 *) data = (UINT16) WLAN_DEFAULT_CHANNEL; break; case WLAN_TX_RATE: * (UINT16 *) data = (UINT16) WLAN_DEFAULT_TX_RATE; break; case WLAN_BRATES_ENABLE: * (UINT16 *) data = (UINT16) WLAN_DEFAULT_BRATES_ENABLE; break; case WLAN_BRATES: * (UINT16 *) data = (UINT16) WLAN_DEFAULT_BRATES; break; case WLAN_PMANAGE_ENABLE: * (UINT16 *) data = (UINT16) WLAN_DEFAULT_PMANAGE_ENABLE; break; case WLAN_AUTH_TYPE: * (UINT16 *) data = (UINT16) WLAN_DEFAULT_AUTH_TYPE; break; case WLAN_WEP_ENABLE: * (UINT16 *) data = (UINT16) WLAN_DEFAULT_WEP_ENABLE; break; case WLAN_WEP_TYPE: * (UINT16 *) data = (UINT16) WLAN_DEFAULT_WEP_TYPE; break; case WLAN_WEP_KEY0_64: (void) bcopy (WLAN_DEFAULT_WEP_KEY0_64, (char *) data, DOT11_40_BIT_KEY_SIZE); break; case WLAN_WEP_KEY1_64: (void) bcopy (WLAN_DEFAULT_WEP_KEY1_64, (char *) data, DOT11_40_BIT_KEY_SIZE); break; case WLAN_WEP_KEY2_64: (void) bcopy (WLAN_DEFAULT_WEP_KEY2_64, (char *) data, DOT11_40_BIT_KEY_SIZE); break; case WLAN_WEP_KEY3_64: (void) bcopy (WLAN_DEFAULT_WEP_KEY3_64, (char *) data, DOT11_40_BIT_KEY_SIZE); break; case WLAN_WEP_KEY0_128: (void) bcopy (WLAN_DEFAULT_WEP_KEY0_128, (char *) data, DOT11_128_BIT_KEY_SIZE); break; case WLAN_WEP_KEY_NUMBER: * (UINT16 *) data = (UINT16) WLAN_DEFAULT_WEP_KEY_NUMBER; break; case WLAN_BYTE_ORDER: * (UINT16 *) data = (UINT16) WLAN_DEFAULT_BYTE_ORDER; break; case WLAN_REGION: * (UINT16 *) data = (UINT16) WLAN_DEFAULT_REGION; break; default: return (ERROR); } return (OK); }/****************************************************************************** wlanIoctl - generic routine to call a wlan card specific ioctl handler** RETURNS: OK or EINVAL**/int wlanIoctl ( END_OBJ* pDrvCtrl, /* Device handle for this card */ int cmd, /* IOCTL command */ caddr_t data /* Generic data pointer */ ) { return (WLAN_IOCTL(pDrvCtrl, cmd, data)); }#endif /* INCLUDE_WLAN_END */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -