?? dot11lib.c
字號:
will search to determine the country advertised by APs in the area. Passive scans only will be performed until a country is decided upon, lengthening association times. <data> is a boolean indicating the new status of 802.11dmode.\i WIOCG80211D : Gets the status of 802.11d modeThis IOCTL returns the current status of 802.11d mode. <data> is a pointer toa BOOL into which the status will be written.\i WIOCGHWVERS : Return hardware version infoThis IOCTL is passed a pointer to a character buffer of minimum length 256. Itplaces information about the current hardware version as a text string intothe buffer. <data> is a poitner to the buffer.\i EIOCGADDR : Get MAC address of deviceThis standard Wind River IOCTL call will return the current MAC address of the device. <data> is a UINT8 * pointing to a buffer of at least size bytes intowhich the MAC address will be copied.\i EIOCSADDR : Set MAC address of deviceThis standard Wind River IOCTL call will change the MAC address of the currentdevice. This is a runtime operation only, and does not modify the MAC addressthat the device will boot into, as this is typically encoded in a read-only EEPROM on the wireless hardware. *** Extreme caution should be used that onlyvalid and UNIQUE MAC addresses as specified by IEEE 802. Non-unique MAC addresses have been known to crash or otherwise incapacitate network routers.Wind River Systems takes no responsibility for incorrect use of this feature on networks public or private ***\i WIOCSTXPOWERSCALE : Sets Transmit Power Scaling FactorThis IOCTL sets the amount of the maximum transmit power that will actually beused to transmit packets. Valid values are 100%=0, 66%=1, 50%=2, 33%=3, 25%=4. <data> is a UINT32 containing the value.\i WIOCGTXPOWERSCALE : Gets Transmit Power Scaling FactorThis IOCTL gets the amount of the maximum transmit power that will actually beused to transmit packets. Valid values are 100%=0, 66%=1, 50%=2, 33%=3, 25%=4. <data> is a UINT32 * into which the current value will be placed.\i WIOCGCHANNELLIST : Get a list of the supported channelsThis IOCTL gets a list of the current channels supported. This will varydepending on the country code set in the card. <data> is a pointer to apreallocated DOT11_CHANNEL_LIST structure in which the list is to be placed.\i WIOCSSSCANTYPE : Sets the currently allowed scan typesThis IOCTL affects the types of scans used by the ESS and IBSS modules. <data>is a UINT32 that represents the bitwise OR of all allowed scan types. At leastone scan type must be allowed. The available types are: DOT11_SCANTYPE_ACTIVE _BIT(0) DOT11_SCANTYPE_PASSIVE _BIT(1)An active scan is really quick - it involves sending a Probe Request on each channel and then waiting a short period for the reply. A Passive scan involvesmerely changing to a channel and waiting a long period, listening for a beacon.If passive scanning is allowed, the process of scanning for a BSS takes a lotlonger. Note that passive scanning cannot find APs that have the SSID "hidden"\i WIOCGSSCANTYPE : Gets the currently allowed scan typesThis IOCTL retrieves the setting set with WIOCSSCANTYPE\ie\i WIOCSBSS - Set the current BSS being configuredThis IOCTL sets the BSS number that is affected by all other configuration commands. Since the BSS number only applies to AP mode, this IOCTL will return ERROR in DOT11_MODE_ESS or DOT11_MODE_IBSS. Upon starting IBSS or ESSmode, the BSS number under configuration will be reset to 0, which is the onlysupported BSS in those modes. <data> is the BSS number to switch to. Note that you cannot switch to a BSS number that has not been created with WIOCABSS.\ie\i WIOCGBSS - Get the current BSS being configuredThis IOCTL returns the BSS that is currently set by WIOCSBSS. <data> is a pointer to a UINT32.\ie\i WIOCABSS - Create a new BSS and return it's numberThis function creates a new BSS for use with AP mode. Each BSS has a SSID (usually unique, but not necessarily). The BSS is set to a defaultconfiguration. The number of the new BSS is returnedin <data>, which is a pointer to a UINT32. \ie\i WIOCDBSS - Delete the specified BSSThis IOCTL deletes the specified BSS. <data> is a UINT32 containing the BSSnumber. Note that you cannot delete a BSS that has not been created, and youcannot delete BSS0. A BSS that is deleted does not retain any configurationinformation.\ie\i WIOCSMBSSADDRBITS - Set the bits used for mBSSIDsSets the place in the MAC address where the BSS address will be inserted. The BSS number is added to the BSSID starting at a user configurable bit. For example, for a maximum of four BSSs, two bits are needed and the default setting applies the changes to bits 3&4 of the MAC Address. Thus, if the MACaddress of the wireless interface is 00:04:12:3e:60:0f BSS Number BSSID BSS0 00:04:12:3e:60:0f BSS1 06:04:12:3e:60:0f BSS2 0a:04:12:3e:60:0f BSS3 0e:04:12:3e:60:0f\ie\i WIOCSVLAN - Sets the status of VLAN modeThis IOCTLs takes a BOOL value in <data> representing whether VLAN supportis enabled or disabled. If VLAN support is enabled, then the wireless deviceassumes that the network stack is expecting 802.1Q tagged packets, and willonly accept 802.1Q tagged packets from the wired interface. The specificVLAN IDs that the system is configured to use can be set using the standardEND IOCTLs EIOCVLANJOIN, EIOCVLANREMOVE, EIOCVLANFLUSH.\ie \i WIOCGVLAN - Gets the current status of VLAN modeThis IOCTL returns the status of vlan support in the driver. <data> is a pointer to a UINT32.\ieSEE ALSOWind Net 802.11 Station 2.0 High Level Design DocumentINCLUDE FILES: drv/wlan/dot11Lib.hdrv/wlan/dot11UsrLib.hdrv/wlan/dot11TimerLib.hdrv/wlan/dot11Bsp.h*//* includes */#include <vxWorks.h>#include <stdio.h>#include <muxLib.h>#include <cacheLib.h> /* for cacheDmaAlloc(), cacheDmaFree() */#include <stdlib.h>#include <endLib.h>#include "drv/wlan/dot11Lib.h"#include "drv/wlan/dot11TimerLib.h"#include "drv/wlan/dot11Bsp.h"/** Global variables - these are items that are either constant strings for the* show routines or do not vary between instances of the driver.*/const char * dot11Version = "2.3Beta";#ifdef DOT11_DEBUG_GLOBALINT32 dot11DebugArray[DOT11_MAX_DEBUG_AREAS] = { DOT11_DEBUG_FATAL, /* NULL area */ DOT11_DEBUG_ERROR, /* Initialization */ DOT11_DEBUG_ERROR, /* SME */ DOT11_DEBUG_ERROR, /* DPE */ DOT11_DEBUG_ERROR, /* HDD */ DOT11_DEBUG_ERROR, /* Interrupt */ DOT11_DEBUG_ERROR /* RSN */ };#endifconst char * dot11ModeStr[] = {"NONE", /* 00000b */ "802.11a", /* 00001b */ "802.11b", /* 00010b */ "802.11a/b", /* 00011b */ "802.11g", /* 00100b */ "802.11a/g", /* 00101b */ "802.11b/g", /* 00110b */ "802.11a/b/g", /* 00111b */ "turboG", /* 01000b */ "802.11a+tG", /* 01001b */ "802.11b+tG", /* 01010b */ "802.11a/b+tG", /* 01011b */ "802.11g+tG", /* 01100b */ "802.11a/g+tG", /* 01101b */ "802.11b/g+tG", /* 01110b */ "802.11a/b/g+tG", /* 01111b */ "turboA", /* 10000b */ "802.11a+tA", /* 10001b */ "802.11b+tA", /* 10010b */ "802.11a/b+tA", /* 10011b */ "802.11g+tA", /* 10100b */ "802.11a/g+tA", /* 10101b */ "802.11b/g+tA", /* 10110b */ "802.11a/b/g+tA", /* 10111b */ "turboG + turboA", /* 11000b */ "802.11a+tG+tA", /* 11001b */ "802.11b+tG+tA", /* 11010b */ "802.11a/b+tG+tA", /* 11011b */ "802.11g+tG+tA", /* 11100b */ "802.11a/g+tG+tA", /* 11101b */ "802.11b/g+tG+tA", /* 11110b */ "ANY"}; /* 11111b */ const char * dot11ExPolStr[] = {"UNENCRYPTED","DOT1X","NONE"};const char * dot11AuthTypeStr[] = {"OSA","SKA","?","ALL"};const char * dot11EncryptNames[] = {"NONE", /* 0000b */ "WEP40", /* 0001b */ "WEP104", /* 0010b */ "WEP40 + WEP104", /* 0011b */ "TKIP", /* 0100b */ "TKIP + WEP40", /* 0101b */ "TKIP + WEP104", /* 0110b */ "TKIP + WEP40 + WEP104", /* 0111b */ "AES", /* 1000b */ "AES + WEP40", /* 1001b */ "AES + WEP104", /* 1010b */ "AES + WEP40 + WEP104", /* 1011b */ "AES + TKIP", /* 1100b */ "AES + TKIP + WEP40", /* 1101b */ "AES + TKIP + WEP104", /* 1110b */ "AES + TKIP + WEP40 + WEP104"}; /* 1111b *//* Fill in pointer below, so we can ensure they are properly aligned */char * dot11BcastMAC = NULL;char * dot11NullMAC = NULL;const char * DOT11_IFNAME = "wls";const char * dot11ModeNames[] = {"NONE", "ESS", "IBSS", "AP"};const char * dot11LinkNames[] = {"DOWN", "UP", "SLEEP"};const char * dot114wayStateNames[] = {"Not assoc","Sent 1", "Got 2", "Sent 3", "Got 4", "INVALID", "Got 1", "Sent 2", "Got 3", "Sent 4", "Established"};const char * dot11SecPolNames[] = {"None", "INVALID-TSN ALONE", "WPA", "WPA + TSN", "802.11i", "802.11i + TSN", "802.11i + WPA", "802.11i + WPA + TSN"};const char * dot11AuthPolNames[] = {"None", "802.1X", "PSK", "802.1X + PSK"};DOT11_FW * pDebug = NULL;/* This is a global array of BSP pointers. Since they're declared on a per-BSP* basis, there's no harm in placing them in a global variable - they won't * change between driver instances. The advantage to declaring them in a * global variable is that functions that don't have access to pDot11 can still* use them */DOT11_BSP_FUNCS dot11BspFuncs = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL};/* forward declarations */LOCAL STATUS dot11EndStart (END_OBJ * pEnd);LOCAL STATUS dot11EndStop (END_OBJ * pEnd);LOCAL STATUS dot11EndUnload (END_OBJ * pEnd);LOCAL STATUS dot11Parse(DOT11_FW * pDot11, char * initString );LOCAL STATUS dot11MemInit(DOT11_FW * pDot11);LOCAL STATUS dot11MemFree(DOT11_FW * pDot11);LOCAL STATUS dot11StatsTimerInit(DOT11_FW * pDot11);LOCAL void dot11StatsTimer(DOT11_FW * pDot11);LOCAL void dot11StatsTimer16(DOT11_FW * pDot11);/****************************************************************************** dot11EndLoad - endLoad() routine for the dot11Fw** This is the endLoad() routine for the dot11 Framework. It is called by* muxDevLoad() during network initialization in order to bring up the* wireless driver. The initString passed to it should have the following* format (unitNum is filled in by muxDevLoad(), the rest is passed to * muxDevLoad as a parameter, usually from the endDevTbl[] or the dynamic * loader:* "unitnum:pBspInfo"** This function can only be called in the context of the kernel, usually * during network initialization.** RETURNS: Pointer to new END_OBJ (aka DOT11_FW) or NULL on error** ERRNO: N/A** \IFSET KERNEL**/END_OBJ * dot11EndLoad ( char * initString, /* Initial parameters for device */ void * pBSP /* Spare pointer */ ) { DOT11_FW * pDot11; /* Pointer to dot11 fw */ if (initString == NULL) { DOT11_LOG(DOT11_DEBUG_FATAL, DOT11_AREA_INIT, ("dot11EndLoad: NULL initstring\n",0,0,0,0,0,0)); return NULL; } /* First passs muxDevLoad passes in "" and expects to get the ifname back*/ if (initString[0] == 0) { DOT11_LOG(DOT11_DEBUG_INFO, DOT11_AREA_INIT, ("dot11EndLoad: called first pass\n",0,0,0,0,0,0)); bcopy(DOT11_IFNAME, initString, strlen(DOT11_IFNAME) + 1); return NULL; } /* On the second pass muxDevLoad, we get a real initstring */ DOT11_LOG(DOT11_DEBUG_INFO, DOT11_AREA_INIT, ("dot11EndLoad: Second pass: initString = \"%s\"\n", (int)initString,0,0,0,0,0)); DOT11_LOG_FLUSH; if ((pDot11 = (DOT11_FW *)calloc(1, sizeof(DOT11_FW))) == NULL)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -