📄 cisaironetioctl.c
字号:
status = EINVAL; break; } /* enable the MAC */ if ( cisAironetHwMacEnable (pDev) == ERROR ) { status = EINVAL; break; } /* Update the driver control structure */ pDev->ibssMode = ibssMode; break; } case EIOCGIBSSMODE: /* Get IBSS Mode */ { /* sanity check */ if (data == NULL) { status = EINVAL; break; } /* return the current ibss mode */ * (UINT16 *) data = (UINT16)pDev->ibssMode; break; } case EIOCSCTSRTS: /* Set CTS/RTS packet size threshold */ { CFG_RID_T cfg; CFG_RID_T * pCfg = (CFG_RID_T *) &cfg; UINT32 rtsThreshold = (UINT32) data; /* disable the MAC */ if ( cisAironetHwMacDisable (pDev) == ERROR ) { status = EINVAL; break; } /* Get the Cfg Rid */ if ( cisAironetHwRidActualConfigGet (pDev, (void *) pCfg) == ERROR ) { status = EINVAL; break; } /* Set the new CTS/RTS threshold value (in bytes) */ pCfg->rtsThres = rtsThreshold; /* Set the Cfg Rid */ if ( cisAironetHwRidConfigSet (pDev, (void *) pCfg) == ERROR ) { status = EINVAL; break; } /* enable the MAC */ if ( cisAironetHwMacEnable (pDev) == ERROR ) { status = EINVAL; break; } break; } case EIOCGCTSRTS: /* Get CTS/RTS packet size threshold (in bytes) */ { CFG_RID_T cfg; CFG_RID_T * pCfg = (CFG_RID_T *) &cfg; /* sanity check */ if (data == NULL) { status = EINVAL; break; } /* Get the Cfg Rid */ if ( cisAironetHwRidActualConfigGet (pDev, (void *) pCfg) == ERROR ) { status = EINVAL; break; } /* Get the CTS/RTS threshold */ * (UINT16 *) data = (UINT16)pCfg->rtsThres; break; } case EIOCSFRAGTHRESH: /* Set fragment size threshold (in bytes) */ { CFG_RID_T cfg; CFG_RID_T * pCfg = (CFG_RID_T *) &cfg; UINT32 fragThreshold = (UINT32) data; /* disable the MAC */ if ( cisAironetHwMacDisable (pDev) == ERROR ) { status = EINVAL; break; } /* Get the Cfg Rid */ if ( cisAironetHwRidActualConfigGet (pDev, (void *) pCfg) == ERROR ) { status = EINVAL; break; } /* Set the new fragment threshold value (in bytes) */ pCfg->fragThresh = fragThreshold; /* Set the Cfg Rid */ if ( cisAironetHwRidConfigSet (pDev, (void *) pCfg) == ERROR ) { status = EINVAL; break; } /* enable the MAC */ if ( cisAironetHwMacEnable (pDev) == ERROR ) { status = EINVAL; break; } break; } case EIOCGFRAGTHRESH: /* Get fragment size threshold (in bytes) */ { CFG_RID_T cfg; CFG_RID_T * pCfg = (CFG_RID_T *) &cfg; /* sanity check */ if (data == NULL) { status = EINVAL; break; } /* Get the Cfg Rid */ if ( cisAironetHwRidActualConfigGet (pDev, (void *) pCfg) == ERROR ) { status = EINVAL; break; } /* Get the fragment threshold */ * (UINT16 *) data = (UINT16)pCfg->fragThresh; break; } case EIOCSPREAMBLE: /* Set preamble length */ { CFG_RID_T cfg; CFG_RID_T * pCfg = (CFG_RID_T *) &cfg; UINT32 preamble = (UINT32) data; if (preamble > 3) { /* Non-valid value */ status = EINVAL; break; } /* disable the MAC */ if ( cisAironetHwMacDisable (pDev) == ERROR ) { status = EINVAL; break; } /* Get the Cfg Rid */ if ( cisAironetHwRidActualConfigGet (pDev, (void *) pCfg) == ERROR ) { status = EINVAL; break; } /* If _BIT0 and _BIT1 are set, convert to 0 (auto) */ if (preamble == 3) preamble = 0; /* Set the new preamble value (0=auto, 1=long, 2=short) */ pCfg->shortPreamble = preamble; /* Set the Cfg Rid */ if ( cisAironetHwRidConfigSet (pDev, (void *) pCfg) == ERROR ) { status = EINVAL; break; } /* enable the MAC */ if ( cisAironetHwMacEnable (pDev) == ERROR ) { status = EINVAL; break; } break; } case EIOCGPREAMBLE: /* Get preamble length */ { CFG_RID_T cfg; CFG_RID_T * pCfg = (CFG_RID_T *) &cfg; /* sanity check */ if (data == NULL) { status = EINVAL; break; } /* Get the Cfg Rid */ if ( cisAironetHwRidActualConfigGet (pDev, (void *) pCfg) == ERROR ) { status = EINVAL; break; } /* Get the preamble setting (0=auto 1=long 2=short) */ * (UINT16 *) data = (UINT16)pCfg->shortPreamble; if ( *(UINT16 *)data == 0) { * (UINT16 *) data = 3; /* convert to ioctl defined value */ } break; } case EIOCSAUTHRESPTO: /* Set authentication response timeout (Kus) */ { CFG_RID_T cfg; CFG_RID_T * pCfg = (CFG_RID_T *) &cfg; UINT32 authTimeout = (UINT32) data; /* disable the MAC */ if ( cisAironetHwMacDisable (pDev) == ERROR ) { status = EINVAL; break; } /* Get the Cfg Rid */ if ( cisAironetHwRidActualConfigGet (pDev, (void *) pCfg) == ERROR ) { status = EINVAL; break; } /* Set the new authentication response timeout value */ pCfg->authTimeout = authTimeout; /* Set the Cfg Rid */ if ( cisAironetHwRidConfigSet (pDev, (void *) pCfg) == ERROR ) { status = EINVAL; break; } /* enable the MAC */ if ( cisAironetHwMacEnable (pDev) == ERROR ) { status = EINVAL; break; } break; } case EIOCGAUTHRESPTO: /* Get authentication response timeout (Kus) */ { CFG_RID_T cfg; CFG_RID_T * pCfg = (CFG_RID_T *) &cfg; /* sanity check */ if (data == NULL) { status = EINVAL; break; } /* Get the Cfg Rid */ if ( cisAironetHwRidActualConfigGet (pDev, (void *) pCfg) == ERROR ) { status = EINVAL; break; } /* Get the authentication response timeout setting */ * (UINT16 *) data = (UINT16)pCfg->authTimeout; break; } /* Set multicast key slot */ case EIOCSMULTICASTKEYNUM: { pDev->broadcastKey = (UINT16) ((int)data); pDev->broadcastKey &= 0x3; break; } case EIOCGMULTICASTKEYNUM: /* Get multicast key slot */ { /* Sanity check */ if (data == NULL) { status = EINVAL; break; } /* Get the broadcast key */ *(UINT16 *)data = pDev->broadcastKey; break; } case EIOCSUNICASTKEYNUM: /* Set unicast key slot */ { pDev->defaultKey = (UINT16) ((int) data); break; } case EIOCGUNICASTKEYNUM: /* Get unicast key slot */ { /* Sanity check */ if (data == NULL) { status = EINVAL; break; } /* Get the broadcast key */ *(UINT16 *)data = pDev->defaultKey; } case EIOCSAUTHCALLBACK: /* Only supported by AP */ { status = EINVAL; break; } case EIOCS802DOT1XMODE: /* Set 802.1X mode on the card */ { CFG_RID_T cfg; CFG_RID_T * pCfg = (CFG_RID_T *) &cfg; UINT32 mode = (UINT32) data; /* disable the MAC */ if ( cisAironetHwMacDisable (pDev) == ERROR ) { status = EINVAL; break; } /* Get the Cfg Rid */ if ( cisAironetHwRidActualConfigGet (pDev, (void *) pCfg) == ERROR ) { status = EINVAL; break; } if (mode == 0) /* disable 802.1X mode */ { pCfg->authType &= ~DOT11_AUTHTYPE_DOT1X; pDev->authType &= ~DOT11_AUTHTYPE_DOT1X; pDev->dot1XStatus = ONEX_MODE_DISABLED; } else /* enable 802.1X mode */ { pCfg->authType |= DOT11_AUTHTYPE_DOT1X; pDev->authType |= DOT11_AUTHTYPE_DOT1X; pDev->dot1XStatus = ONEX_MODE_ENABLED; } /* Set the Cfg Rid */ if ( cisAironetHwRidConfigSet (pDev, (void *) pCfg) == ERROR ) { status = EINVAL; break; } /* enable the MAC */ if ( cisAironetHwMacEnable (pDev) == ERROR ) { status = EINVAL; break; } break; } case EIOCG802DOT1XMODE: /* Get the current state */ { /* Sanity check */ if (data == NULL) { status = EINVAL; break; } /* return the current mode of operation */ * (UINT16 *) data = (UINT16) pDev->dot1XStatus; break; } case EIOCGMIBAP: case EIOCSMIBAP: case EIOCGMIB2STA: case EIOCSMIB2STA: { status = cisAironetStMibIoctl(pDev, cmd, data); break; } default: status = EINVAL; } /* If there's an error, return that */ return (status); }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -