📄 prism2mib.c
字号:
/* src/prism2/driver/prism2mib.c** Management request for mibset/mibget** Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved.* --------------------------------------------------------------------** linux-wlan** The contents of this file are subject to the Mozilla Public* License Version 1.1 (the "License"); you may not use this file* except in compliance with the License. You may obtain a copy of* the License at http://www.mozilla.org/MPL/** Software distributed under the License is distributed on an "AS* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or* implied. See the License for the specific language governing* rights and limitations under the License.** Alternatively, the contents of this file may be used under the* terms of the GNU Public License version 2 (the "GPL"), in which* case the provisions of the GPL are applicable instead of the* above. If you wish to allow the use of your version of this file* only under the terms of the GPL and not to allow others to use* your version of this file under the MPL, indicate your decision* by deleting the provisions above and replace them with the notice* and other provisions required by the GPL. If you do not delete* the provisions above, a recipient may use your version of this* file under either the MPL or the GPL.** --------------------------------------------------------------------** Inquiries regarding the linux-wlan Open Source project can be* made directly to:** AbsoluteValue Systems Inc.* info@linux-wlan.com* http://www.linux-wlan.com** --------------------------------------------------------------------** Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development.** --------------------------------------------------------------------** The functions in this file handle the mibset/mibget management* functions.** --------------------------------------------------------------------*//*================================================================*//* System Includes */#define WLAN_DBVAR prism2_debug#include <wlan/version.h>#include <linux/config.h>#include <linux/version.h>#include <linux/module.h>#include <linux/kernel.h>#include <linux/sched.h>#include <linux/types.h>#include <linux/slab.h>#include <linux/wireless.h>#include <linux/netdevice.h>#include <asm/io.h>#include <linux/delay.h>#include <asm/byteorder.h>#include <wlan/wlan_compat.h>#if (WLAN_HOSTIF == WLAN_PCMCIA)#include <pcmcia/version.h>#include <pcmcia/cs_types.h>#include <pcmcia/cs.h>#include <pcmcia/cistpl.h>#include <pcmcia/ds.h>#include <pcmcia/cisreg.h>#endif#if ((WLAN_HOSTIF == WLAN_PLX) || (WLAN_HOSTIF == WLAN_PCI))#include <linux/ioport.h>#include <linux/pci.h>#endif#if (WLAN_HOSTIF == WLAN_USB)#include <linux/usb.h>#endif#include <wlan/wlan_compat.h>/*================================================================*//* Project Includes */#include <wlan/p80211types.h>#include <wlan/p80211hdr.h>#include <wlan/p80211mgmt.h>#include <wlan/p80211conv.h>#include <wlan/p80211msg.h>#include <wlan/p80211netdev.h>#include <wlan/p80211metadef.h>#include <wlan/p80211metastruct.h>#include <prism2/hfa384x.h>#include <prism2/prism2mgmt.h>/*================================================================*//* Local Constants */#define MIB_TMP_MAXLEN 200 /* Max length of RID record (in bytes). *//*================================================================*//* Local Types */#define F_AP 0x1 /* MIB is supported on Access Points. */#define F_STA 0x2 /* MIB is supported on stations. */#define F_READ 0x4 /* MIB may be read. */#define F_WRITE 0x8 /* MIB may be written. */typedef struct mibrec{ UINT32 did; UINT16 flag; UINT16 parm1; UINT16 parm2; UINT16 parm3; int (*func)(struct mibrec *mib, int isget, wlandevice_t *wlandev, hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg, void *data);} mibrec_t;/*================================================================*//* Local Function Declarations */static int prism2mib_bytestr2pstr(mibrec_t *mib,int isget,wlandevice_t *wlandev,hfa384x_t *hw,p80211msg_dot11req_mibset_t *msg,void *data);static int prism2mib_bytearea2pstr(mibrec_t *mib,int isget,wlandevice_t *wlandev,hfa384x_t *hw,p80211msg_dot11req_mibset_t *msg,void *data);static int prism2mib_uint32(mibrec_t *mib,int isget,wlandevice_t *wlandev,hfa384x_t *hw,p80211msg_dot11req_mibset_t *msg,void *data);static int prism2mib_uint32array(mibrec_t *mib,int isget,wlandevice_t *wlandev,hfa384x_t *hw,p80211msg_dot11req_mibset_t *msg,void *data);static int prism2mib_uint32offset(mibrec_t *mib,int isget,wlandevice_t *wlandev,hfa384x_t *hw,p80211msg_dot11req_mibset_t *msg,void *data);static int prism2mib_truth(mibrec_t *mib,int isget,wlandevice_t *wlandev,hfa384x_t *hw,p80211msg_dot11req_mibset_t *msg,void *data);static int prism2mib_preamble(mibrec_t *mib,int isget,wlandevice_t *wlandev,hfa384x_t *hw,p80211msg_dot11req_mibset_t *msg,void *data);static int prism2mib_flag(mibrec_t *mib,int isget,wlandevice_t *wlandev,hfa384x_t *hw,p80211msg_dot11req_mibset_t *msg,void *data);static int prism2mib_appcfinfoflag(mibrec_t *mib,int isget,wlandevice_t *wlandev,hfa384x_t *hw,p80211msg_dot11req_mibset_t *msg,void *data);static int prism2mib_regulatorydomains(mibrec_t *mib,int isget,wlandevice_t *wlandev,hfa384x_t *hw,p80211msg_dot11req_mibset_t *msg,void *data);static int prism2mib_wepdefaultkey(mibrec_t *mib,int isget,wlandevice_t *wlandev,hfa384x_t *hw,p80211msg_dot11req_mibset_t *msg,void *data);static int prism2mib_powermanagement(mibrec_t *mib,int isget,wlandevice_t *wlandev,hfa384x_t *hw,p80211msg_dot11req_mibset_t *msg,void *data);static int prism2mib_privacyinvoked(mibrec_t *mib,int isget,wlandevice_t *wlandev,hfa384x_t *hw,p80211msg_dot11req_mibset_t *msg,void *data);static int prism2mib_excludeunencrypted(mibrec_t *mib,int isget,wlandevice_t *wlandev,hfa384x_t *hw,p80211msg_dot11req_mibset_t *msg,void *data);static int prism2mib_fragmentationthreshold(mibrec_t *mib,int isget,wlandevice_t *wlandev,hfa384x_t *hw,p80211msg_dot11req_mibset_t *msg,void *data);static int prism2mib_operationalrateset(mibrec_t *mib,int isget,wlandevice_t *wlandev,hfa384x_t *hw,p80211msg_dot11req_mibset_t *msg,void *data);static int prism2mib_groupaddress(mibrec_t *mib,int isget,wlandevice_t *wlandev,hfa384x_t *hw,p80211msg_dot11req_mibset_t *msg,void *data);static int prism2mib_fwid(mibrec_t *mib,int isget,wlandevice_t *wlandev,hfa384x_t *hw,p80211msg_dot11req_mibset_t *msg,void *data);static int prism2mib_authalg(mibrec_t *mib,int isget,wlandevice_t *wlandev,hfa384x_t *hw,p80211msg_dot11req_mibset_t *msg,void *data);static int prism2mib_authalgenable(mibrec_t *mib,int isget,wlandevice_t *wlandev,hfa384x_t *hw,p80211msg_dot11req_mibset_t *msg,void *data);static int prism2mib_priv(mibrec_t *mib,int isget,wlandevice_t *wlandev,hfa384x_t *hw,p80211msg_dot11req_mibset_t *msg,void *data);static void prism2mib_priv_authlist(hfa384x_t *hw,prism2sta_authlist_t *list);static void prism2mib_priv_accessmode(hfa384x_t *hw,UINT32 mode);static void prism2mib_priv_accessallow(hfa384x_t *hw,p80211macarray_t *macarray);static void prism2mib_priv_accessdeny(hfa384x_t *hw,p80211macarray_t *macarray);static void prism2mib_priv_deauthenticate(hfa384x_t *hw,UINT8 *addr);/*================================================================*//* Local Static Definitions */static mibrec_t mibtab[] = { /* dot11smt MIB's */ { DIDmib_dot11smt_dot11StationConfigTable_dot11StationID, F_AP | F_STA | F_READ | F_WRITE, HFA384x_RID_CNFOWNMACADDR, HFA384x_RID_CNFOWNMACADDR_LEN, 0, prism2mib_bytearea2pstr }, { DIDmib_dot11smt_dot11StationConfigTable_dot11MediumOccupancyLimit, F_AP | F_READ | F_WRITE, HFA384x_RID_CNFAPPCFINFO, HFA384x_RID_CNFAPPCFINFO_LEN, 0, prism2mib_uint32offset }, { DIDmib_dot11smt_dot11StationConfigTable_dot11CFPollable, F_STA | F_READ, HFA384x_RID_CFPOLLABLE, 0, 0, prism2mib_uint32 }, { DIDmib_dot11smt_dot11StationConfigTable_dot11CFPPeriod, F_AP | F_READ | F_WRITE, HFA384x_RID_CNFAPPCFINFO, HFA384x_RID_CNFAPPCFINFO_LEN, 1, prism2mib_uint32offset }, { DIDmib_dot11smt_dot11StationConfigTable_dot11CFPMaxDuration, F_AP | F_READ | F_WRITE, HFA384x_RID_CNFAPPCFINFO, HFA384x_RID_CNFAPPCFINFO_LEN, 2, prism2mib_uint32offset }, { DIDmib_dot11smt_dot11StationConfigTable_dot11AuthenticationResponseTimeOut, F_STA | F_READ | F_WRITE, HFA384x_RID_CNFAUTHRSPTIMEOUT, 0, 0, prism2mib_uint32 }, { DIDmib_dot11smt_dot11StationConfigTable_dot11PrivacyOptionImplemented, F_AP | F_STA | F_READ, HFA384x_RID_PRIVACYOPTIMP, 0, 0, prism2mib_uint32 }, { DIDmib_dot11smt_dot11StationConfigTable_dot11PowerManagementMode, F_STA | F_READ | F_WRITE, HFA384x_RID_CNFPMENABLED, 0, 0, prism2mib_powermanagement }, { DIDmib_dot11smt_dot11StationConfigTable_dot11DesiredSSID, F_STA | F_READ | F_WRITE, HFA384x_RID_CNFDESIREDSSID, HFA384x_RID_CNFDESIREDSSID_LEN, 0, prism2mib_bytestr2pstr }, { DIDmib_dot11smt_dot11StationConfigTable_dot11DesiredBSSType, F_STA | F_READ | F_WRITE, 0, 0, 0, prism2mib_priv }, { DIDmib_dot11smt_dot11StationConfigTable_dot11OperationalRateSet,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -