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

📄 intprismmibioctl.c

📁 vworks 下wlan的实现代码
💻 C
📖 第 1 页 / 共 3 页
字号:
                    break;                case SMT_DESIRED_SSID:                              if (cmd == EIOCGMIB2STA)                        {                        status = intPrismIoctl((END_OBJ *)pWlanDev,                                                EIOCGDESIREDSSID,                                               (caddr_t)&pInfo->dot11DesiredSSID[0]);                        }                    else /* Must be EIOCSMIB2STA */                        {                                                status = intPrismIoctl((END_OBJ *)pWlanDev, EIOCSSSID,                                  (caddr_t)&pInfo->dot11DesiredSSID[0]);                        }                    break;                case SMT_DESIRED_BSS_TYPE:                          /* Note: on the intersil cards, we can only force IBBS or BSS                    mode.  On Wavelan, only mode 3 exists */                    if (cmd == EIOCGMIB2STA)                        {                        if (pWlanDev->cardType != WLAN_CARDTYPE_WAVELAN)                            {                            status = intPrismIoctl((END_OBJ *)pWlanDev,                                                    EIOCGIBSSMODE,                                                   (caddr_t)&temp);                                                        if (temp == TRUE)                                {                                pInfo->dot11DesiredBSSType = 2;                                }                            else                                {                                pInfo->dot11DesiredBSSType = 1;                                }                            }                        else                            {                            /* Wavelan is only mode 3 */                            pInfo->dot11DesiredBSSType = 3;                            }                                                }                    else /* Must be EIOCSMIB2STA */                        {                        if (pWlanDev->cardType != WLAN_CARDTYPE_WAVELAN)                            {                            if (pInfo->dot11DesiredBSSType == 3)                                {                                WLAN_DEBUG(DEBUG_ERROR,                                            ("intPrismMibIoctl: Inter"                                            "sol cannot support mo"                                            "de 3\n"));                                status = ERROR;                                }                            else                                {                                temp = pInfo->dot11DesiredBSSType;                                DOT11BOOL_TO_VXBOOL(temp);                                                                status = intPrismIoctl((END_OBJ *)pWlanDev,                                                        EIOCSIBSSMODE,                                                       (caddr_t)(INT32)temp);                                }                            }                        else                            {                            if (pInfo->dot11DesiredBSSType != 3)                                {                                WLAN_DEBUG(DEBUG_ERROR,("intPrismMibIoctl: Wavel"                                                        "an can only support mo"                                                         "de 3\n"));                                status = ERROR;                                }                            }                        }                    break;                case SMT_OPER_RATE_SET:                             if (cmd == EIOCGMIB2STA)                        {                        bzero((char *) pInfo->dot11OperationalRateSet, 126);                         i = 0;                        temp = intPrismRIDWordRead(pWlanDev, WLAN_RID_TX_RATE);                        /* Note : values are in units of 500 kb/s */                        if ((temp & WLAN_1_MBIT) != 0)                            {                            pInfo->dot11OperationalRateSet[i++] = 2;                            }                        if ((temp & WLAN_2_MBIT) != 0)                            {                            pInfo->dot11OperationalRateSet[i++] = 4;                            }                        if ((temp & WLAN_5_MBIT) != 0)                            {                            pInfo->dot11OperationalRateSet[i++] = 11;                            }                        if ((temp & WLAN_11_MBIT) != 0)                            {                            pInfo->dot11OperationalRateSet[i++] = 22;                            }                        }                    else /* Must be EIOCSMIB2STA */                        {                        temp = 0;                        i = 0;                        while (pInfo->dot11OperationalRateSet[i] != 0x00)                            {                            switch (pInfo->dot11OperationalRateSet[i])                                {                                case 2:                                    temp &= WLAN_1_MBIT;                                    break;                                case 4:                                    temp &= WLAN_2_MBIT;                                    break;                                case 11:                                    temp &= WLAN_5_MBIT;                                    break;                                case 22:                                    temp &= WLAN_11_MBIT;                                    break;                                default:                                    WLAN_DEBUG(DEBUG_ERROR, ("intPrismMibIoctl: "                                              "Invalid rate 0x%02x\n",                                               pInfo->dot11OperationalRateSet[i]));                                    status = ERROR;                                    break;                                }                            }                        /* Doesn't need a reset since this is a dynamic RID */                        status |= intPrismIoctl((END_OBJ *)pWlanDev, EIOCSTXRATE,                                                 (caddr_t)(INT32)temp);                        }                    break;                case SMT_BEACON_PERIOD:                             if (cmd == EIOCGMIB2STA)                        {                        status = intPrismIoctl((END_OBJ *)pWlanDev,                                                EIOCGBEACONRATE,                                               (caddr_t)&temp);                        pInfo->dot11BeaconPeriod = temp;                        }                    else /* Must be EIOCSMIB2STA */                        {                        temp = pInfo->dot11BeaconPeriod;                        status = intPrismIoctl((END_OBJ *)pWlanDev,                                                EIOCSBEACONRATE,                                               (caddr_t)(INT32)temp);                       }                    break;                case SMT_DTIM_PERIOD:                               /***********************************************************                    * AP-Only                    ***********************************************************/                    if ( ((pWlanDev->cardType != WLAN_CARDTYPE_INTERSIL_2) &&                         (pWlanDev->cardType != WLAN_CARDTYPE_INTERSIL_2_5) &&                         (pWlanDev->cardType != WLAN_CARDTYPE_INTERSIL_3)) ||                         (pWlanDev->cardMode == WLAN_CARDMODE_STA) )                        {                        status = ERROR;                        WLAN_DEBUG(DEBUG_INFO, ("intPrismMIBIoctl: Cannot set "                                                "DTIM for non-Intersil cards\n"));                        break;                        }                    ltv.type = WLAN_RID_DTIM_PERIOD;                                        if (cmd == EIOCGMIB2STA)                        {                        status = intPrismLTVRead(pWlanDev, &ltv);                        pInfo->dot11DTIMPeriod = ltv.data[0];                        }                    else /* Must be EIOCSMIB2STA */                        {                        ltv.length = 1;                        ltv.data[0] = pInfo->dot11DTIMPeriod;                        status = intPrismLTVWrite(pWlanDev, &ltv);                        }                    break;                case SMT_ASSOC_RESP_TOUT:                    if (cmd == EIOCGMIB2STA)                        {                        status = ERROR;                        }                    else /* Must be EIOCSMIB2STA */                        {                        WLAN_DEBUG(DEBUG_INFO, ("intPrismMibIoctl: Cannot set"                                                 " MOL\n"));                        status = ERROR;                        }                    break;                default:                    WLAN_DEBUG(DEBUG_INFO, ("intPrismMibIoctl: Invalid MIB "                                             "leaf: 0x%04x\n", mibLeaf));                    status = ERROR;                    break;                }                   break;            }        case AUTH_ALGORITHM_ENTRY:            status = ERROR;            break;        case WEP_DEFAULT_KEY_ENTRY:            {            WEP_DEFAULT_KEY_ENTRY_T * pInfo = (WEP_DEFAULT_KEY_ENTRY_T *) pMib;            switch(mibLeaf)                {                case SMT_WEP_DEFAULT_KEY_VAL_1:                    status = intPrismIoctl((END_OBJ *)pWlanDev, EIOCSWEPKEY0,                                           (caddr_t) pInfo->dot11WEPDefaultKeyValue);                    break;                case SMT_WEP_DEFAULT_KEY_VAL_2:                    status = intPrismIoctl((END_OBJ *)pWlanDev, EIOCSWEPKEY1,                                           (caddr_t)pInfo->dot11WEPDefaultKeyValue);                    break;                case SMT_WEP_DEFAULT_KEY_VAL_3:                    status = intPrismIoctl((END_OBJ *)pWlanDev, EIOCSWEPKEY2,                                           (caddr_t)pInfo->dot11WEPDefaultKeyValue);                    break;                case SMT_WEP_DEFAULT_KEY_VAL_4:                    status = intPrismIoctl((END_OBJ *)pWlanDev, EIOCSWEPKEY3,                                           (caddr_t)pInfo->dot11WEPDefaultKeyValue);                    break;                default:                    WLAN_DEBUG(DEBUG_INFO, ("intPrismMibIoctl: Invalid MIB "                                             "leaf in WEP_DEFAULT_KEY: 0x%04x\n"                                             , mibLeaf));                    status = ERROR;                    break;                }            }            break;        case PRIVACY_ENTRY:            {            PRIVACY_ENTRY_T * pInfo;            UINT16 temp;            pInfo = &pMib->dot11Smt.privEntry;            switch(mibLeaf)                {                case SMT_PRIVACY_ENTRY_INVOKED:                    if (cmd == EIOCGMIB2STA)                        {                        if ((status = intPrismIoctl((END_OBJ *)pWlanDev,                                                    EIOCGWEPSTATUS,                                                    (caddr_t)&temp)) == OK)                            {                            pInfo->dot11PrivacyInvoked =                                 VXBOOL_TO_DOT11BOOL(temp);                            }                        }                    else /* Set the value */                        {                        temp = pInfo->dot11PrivacyInvoked;                        DOT11BOOL_TO_VXBOOL(temp);                        status = intPrismIoctl((END_OBJ *)pWlanDev,                                                EIOCSWEP,                                                (caddr_t)(INT32)temp);                         }                    break;                case SMT_PRIVACY_ENTRY_DEFKEY_ID:                                      if (cmd == EIOCGMIB2STA)                        {                        if (pWlanDev->cardType == WLAN_CARDTYPE_WAVELAN)

⌨️ 快捷键说明

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