⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 intprismioctl.c

📁 vworks 下wlan的实现代码
💻 C
📖 第 1 页 / 共 5 页
字号:
* array of 4 UINT16 values (3 for the MAC address of the STA, 1 for the auth. * type)** \i EIOCDSTA : Deletes a Station from the AP authentication list* Only Stations on the list will be authenticated, unless the list is empty, in* which case all STA's are authenticated by the AP. Data is a pointer to an * array of 4 UINT16 values (3 for the MAC address of the STA, 1 for the auth. * type)** \i EIOCGCHANNEL : Get channel used to create IBSS * Returns the channel used to create new IBSSs and APs** \i EIOCSCHANNEL : Set channel used to create IBSS * Sets the channel used to create new IBSSs and APs.  Allowed values (for North* America) are 1 - 11.  If the default channel is set to an invalid channel* the value on the card will be unaffected.** \i EIOCGWEPTYPE : Get WEP type - 64 bit or 128 bit * Returns the type of WEP in use - "64" for 40/64 bit and "128" for 104/128 bit** \i EIOCSWEPTYPE : Set WEP type - 128 bit or 128 bit * Sets the type of WEP used.  There is no way to determine if the card supports* 128 bit encryption; this must be done at the application layer.** \i EIOCGAUTHTYPE : Get authentication protocol * Returns the authentication protocol currently in use.  1 = Open System, 2 = * Shared Key, 3 = Both (AP only)** \i EIOCSAUTHTYPE : Set authentication protocol * Sets the currently used authentication protocol.  1=Open System, 2=Shared* Key, 3=Both (AP Only)   Note : Shared key cannot be enabled unless WEP is * enabled.** \i EIOCGCONNECTEDBSSID : Get connected BSSID* Returns the BSSID of the currently connected AP.  This is a six byte field * that is usually the MAC address of the wireless card in the AP.** \i EIOCSIBSSMODE : Set IBSS mode* Enables or disables IBSS mode.  If enabled, any SSID specified is assumed to* be an IBSS.  0 = disabled (ESS Mode)  1 = Enabled (IBSS mode)** \i EIOCGIBSSMODE : Get IBSS mode* Returns the current status of the card.  0 = ESS mode, 1 = IBSS mode** EIOCSAUTHCALLBACK : Register authentication callback* Registers a new function to replace the old callback routine.  This routine* will be called each time a new station authenticates.  No response is * required.  This routine is in addition to that used by EIOCASTA, although* to make full use of this extension, that list should be empty.* data is a function pointer to the function, NULL to disable.** EIOCS802DOT1XMODE : Set 802.1x mode* Enables 802.1x mode.  Note that this cannot be done unless WEP is enabled. * This mod is not supported on Lucent/Agere Orinoco cards.  In this mode, WEP* is configured so that all packets are received, both encrypted and non.  If* a non-encrypted packet in received, then the protocol type is checked.  If* it is an EAPOL packet (ethertype = 0x888e) then it is passed up the stack,* otherwise it is dropped.  In addition, all packets transmitted are monitored* and EAPOL packets are transmitted unencrypted.  <data> is a UINT16 that * is 1 to turn 802.1x mode on, and 0 to turn it off.* Note : WEP cannot be disabled until 802.1x mode is turned off.** EIOCG802DOT1XMODE : Get 802.1x mode status        * <data> is a UINT16 * that points to the location to store the 802.1x status.* If 802.1x mode is enabled, a '1' will be written, otherwise a '0' will be* written.** EIOCSBEACONRATE : Sets the AP beacon rate* Sets the beacon rate to the specified rate in ms.  This only has effect in an* IBSS or on a AP.  <data> is a UINT16** EIOCGBEACONRATE : Gets the AP beacon rate* Gets the currently set beacon rate and places it in <data>.  <data> is a* UINT16 *** EIOCSCTSRTS : Set CTS/RTS* Sets the CTS/RTS threshold.  If packets larger than this size are sent, then* they are protected with a CTS/RTS pair.  The default setting is 2304, which* effectively disables this feature (MTU==1500 bytes).  <data> is a UINT16** EIOCGCTSRTS : Get CTS/RTS* Returns the current CTS/RTS threshold.  <data> should be a UINT16 *** EIOCSFRAGTHRESH : Set Fragmentation threshold* Sets the fragmentation threshold.  If packets larger than this threshold are* sent, then they are fragmented into smaller packets (of this maximum size).* Note that this is 802.11 fragmentation and not IP fragmentation - reassembly* is performed by the receiving MAC.  The default settings is 2304, which * effectively disables this feature. (MTU==1500) <data> is a UINT16** EIOCGFRAGTHRESH : Get Fragmentation threshold* Returns the current CTS/RTS threshold.  <data> should be a UINT16 *** EIOCSPREAMBLE : Set preamble length* Set the premable length the card will use to transmit packets.  * Bit 0 = longPreamble, Bit 1 = shortPreamble.  If both bits are set, then * multi/broadcast packets will be sent with long preamble, unicast packets * will be sent with short preamble.  <data> is a UINT16 with one or both bits*  set.*** EIOCGPREAMBLE : Get preamble length* Returns the current preamble setting.  <data> is a UINT16 *** EIOCSAUTHRESPTO : Set Authentication response timeout* Sets the timeout for the supplicant to respond to an authentication request.* <data> is a UINT16 specifying the number of Kus.** EIOCGAUTHRESPTO : Get Authentication response timeout* Returns the current authentication response timeout.  <data> is a UINT16 *** EIOCSUNICASTKEYNUM : Set unicast key slot* Sets the key slot (0 to 3) used to encrypt outgoing unicast packets.  This * value overrides that set by EIOCSWEPDEFAULTKEY.  <data> is a UINT16* ** EIOCGUNICASTKEYNUM : Get unicast key slot* Returns the currently active unicast key slot.  <data> is a UINT16 **** EIOCSMULTICASTKEYNUM : Set multicast key slot* Sets the key slot (0 to 3) used to encrypt outgoing multicast or broadcast* packets.  This value overrides that set by EIOCSWEPDEFAULTKEY.  <data> is * a UINT16** EIOCGMULTICASTKEYNUM : Get multicast key slot* Returns the currently active broadcast key slot.  <data> is a UINT16 ** EIOCSADVSECURITY : Set advanced security options* Enables two advanced security features - hide SSID and block response to * "Unspecified SSID".  The hide SSID feature prevents the AP from broadcasting* its SSID in beacon frames.  The "block response to unspecified SSID" prevents* the AP from responding to a probe request with a null SSID.* Bit 0 - Hide SSID name in beacon frame* Bit 1 - Block response to, "Unspecified SSID"* Bit 2-15 Reserved (set to 0)** EIOCGADVSECURITY : Get advanced security options* Returns the status of the enhanced security features.  <data> is a UINT16 *.** \ie* RETURNS : OK or EINVAL on error** ERRNO : N/A** SEE ALSO:*/int intPrismManage    (    WLAN_DEV * pWlanDev,           /* Pointer to device control structure */    int cmd,                   /* ioctl command to execute */    caddr_t data               /* generic data pointer - varies by cmd */    )    {    LTV_RECORD ltv;    int status = OK;    int iLevel;    UINT16 auth;    UINT16 rate;    UINT16 param;    UINT16 region;        if (pWlanDev == NULL)        {        WLAN_DEBUG(DEBUG_ERROR, ("intPrismManage: NULL pWlanDev"));        return ERROR;        }    switch (cmd)        {        case EIOCGSTATS:            /* Request that the counters be updated NOW */            intPrismCommand(pWlanDev, WLAN_CMD_INQUIRE, WLAN_INFO_COUNTERS,0,0);            /* Delay for a bit to allow the counters to be updated, then            check the ISR to flush any INFO events.  A more thorough approach            would be to make this asynchronous, take a semaphore, but since             the card may frequently send off unsolicited info frames that look            identical, timing and synchronization issues become complicated.*/            taskDelay(sysClkRateGet() / 10); /* wait 100 msec */             iLevel = intLock();            intPrismInt(pWlanDev);            intUnlock(iLevel);                        if ( (char*)data == NULL)                {                status = EINVAL;                break;                }                        /* Copy them into the structure provided */            bcopy((char *)&pWlanDev->stats, (char *)data, sizeof(WLAN_STATS));            break;        case EIOCGLINKSTAT:            if (data != NULL)                {                *(UINT16*)data = intPrismRIDWordRead(pWlanDev,                                                      WLAN_RID_PORT_STAT);                }            else                {                WLAN_DEBUG(DEBUG_ERROR,("WLAN: Link status %d",                                         pWlanDev->linkStatus));                }            break;        case EIOCGDESIREDSSID:            if (data != NULL)                {                status = intPrismRIDStringRead(pWlanDev, WLAN_RID_DESIRED_SSID,                                           (char *)data);                }            else                {                status = EINVAL;                }            break;        case EIOCSSSID:             if (data != NULL)                {                status = intPrismBSSJoin(pWlanDev, (char *)data);                 /* reset the card */                status |= intPrismReset(pWlanDev);                }            else                {                status = EINVAL;                }            break;        case EIOCGCONNECTEDSSID:            if (data != NULL)                {                status = intPrismRIDStringRead(pWlanDev, WLAN_RID_CURRENT_SSID,                                           (char *)data);                }            else                {                status = EINVAL;                }            break;        case EIOCGSTNNAME:            if (data != NULL)                {                status = intPrismRIDStringRead(pWlanDev, WLAN_RID_STATION_NAME,                                           (char *)data);                }            else                {                status = EINVAL;                }            break;        case EIOCSSTNNAME:            if (data != NULL)                {                status = intPrismRIDStringWrite(pWlanDev, WLAN_RID_STATION_NAME,                                            (char *)data);                }            else                {                status = EINVAL;                }            intPrismReset(pWlanDev);            break;        case EIOCGTXRATE:            if (data != NULL)                {                rate = intPrismRIDWordRead(pWlanDev, WLAN_RID_CUR_TX_RATE);                                if (pWlanDev->cardType == WLAN_CARDTYPE_WAVELAN)                    {                    /* Convert from wavelan numbers to bitfield */                    switch(rate)                        {                        case 1:                            rate = WLAN_1_MBIT;                            break;                        case 2:                            rate = WLAN_2_MBIT;                            break;                        case 6:                            rate = WLAN_5_MBIT;                            break;                        case 11:                            rate = WLAN_11_MBIT;                            break;                        default:                            /*Just leave it alone, it's probably a                             mis-identification problem */                            break;                        }                    }                                                *(UINT16*)data = rate;                }            else                {                WLAN_DEBUG(DEBUG_ERROR, ("WLAN: Tx Rate returns %04x\n",                      intPrismRIDWordRead(pWlanDev, WLAN_RID_CUR_TX_RATE)));                }            break;        case EIOCSTXRATE:            if (pWlanDev->cardType == WLAN_CARDTYPE_WAVELAN)                {                /* If the card is a WaveLAN, then convert from nice clean                bitmap to their proprietary values */                switch ((INT32)data)                    { 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -