wlc_pub.h

来自「wi-fi sources for asus wl138g v2 pci car」· C头文件 代码 · 共 554 行 · 第 1/2 页

H
554
字号
/* * Common (OS-independent) definitions for * Broadcom 802.11abg Networking Device Driver * * Copyright 2005-2006, Broadcom Corporation * All Rights Reserved.                 *                                      * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE. * * $Id$ */#ifndef _wlc_pub_h_#define _wlc_pub_h_#define WLC_MAX_2G_CHANNEL	14	/* Max channe in 2G band */#define	WLC_NUMRATES		16	/* max # of rates in a rateset */#define	MAX_TIMERS		15	/* max # wl timers */#define	MAXMULTILIST		32	/* max # multicast addresses */#define	D11_PHY_HDR_LEN		6	/* Phy header length - 6 bytes *//* phy types */#define	PHY_TYPE_A              0	/* Phy type A */#define	PHY_TYPE_B              1	/* Phy type B */#define	PHY_TYPE_G              2	/* Phy type G */#define WLC_PHYTYPE(_x) (_x) /* macro to perform WLC PHY -> D11 PHY TYPE, currently 1:1 */#define	IS4303(pub)	((((wlc_pub_t *)pub)->sbh->chip == BCM4306_CHIP_ID) && \			 (((wlc_pub_t *)pub)->sbh->chippkg == BCM4303_PKG_ID))#define	WLC_RSSI_MINVAL		-200	/* Low value, e.g. for forcing roam */#define	WLC_RSSI_NO_SIGNAL	-91	/* NDIS RSSI link quality cutoffs */#define	WLC_RSSI_VERY_LOW	-80	/* Very low quality cutoffs */#define	WLC_RSSI_LOW		-70	/* Low quality cutoffs */#define	WLC_RSSI_GOOD		-68	/* Good quality cutoffs */#define	WLC_RSSI_VERY_GOOD	-58	/* Very good quality cutoffs */#define	WLC_RSSI_EXCELLENT	-57	/* Excellent quality cutoffs */#define MA_WINDOW_SZ		8	/* moving average window size *//* a large TX Power as an init value to factor out of MIN() calculations, * keep low enough to fit in an int8, units are .25 dBm */#define WLC_TXPWR_MAX		(127)	/* ~32 dBm = 1,500 mW */#define	INVCHANNEL		255	/* invalid channel *//* Rx Antenna diversity control values */#define	ANTDIV_FORCE_0		0	/* Use antenna 0 */#define	ANTDIV_FORCE_1		1	/* Use antenna 1 */#define	ANTDIV_START_1		2	/* Choose starting with 1 */#define	ANTDIV_START_0		3	/* Choose starting with 0 */#define	ANTDIV_ENABLE		3	/* APHY bbConfig Enable RX Diversity *//* Tx Antenna control values */#define TXANT_0			0	/* Tx on antenna 1, "Main" */#define TXANT_1			1	/* Tx on antenna 1, "Aux" */#define TXANT_LAST_RX		3	/* Tx on phy's last good Rx antenna */#define TXANT_DEF		3	/* driver's default tx antenna setting *//* 32-bit version of d11.h's macstat_t */typedef struct macstat32 {	uint32	txallfrm;	uint32	txrtsfrm;	uint32	txctsfrm;	uint32	txackfrm;	uint32	txdnlfrm;	uint32	txbcnfrm;	uint32	txfunfl[8];	uint32	txtplunfl;	uint32	txphyerr;	uint32	rxfrmtoolong;	uint32	rxfrmtooshrt;	uint32	rxinvmachdr;	uint32	rxbadfcs;	uint32	rxbadplcp;	uint32	rxcrsglitch;	uint32	rxstrt;	uint32	rxdfrmucastmbss;	uint32	rxmfrmucastmbss;	uint32	rxcfrmucast;	uint32	rxrtsucast;	uint32	rxctsucast;	uint32	rxackucast;	uint32	rxdfrmocast;	uint32	rxmfrmocast;	uint32	rxcfrmocast;	uint32	rxrtsocast;	uint32	rxctsocast;	uint32	rxdfrmmcast;	uint32	rxmfrmmcast;	uint32	rxcfrmmcast;	uint32	rxbeaconmbss;	uint32	rxdfrmucastobss;	uint32	rxbeaconobss;	uint32	rxrsptmout;	uint32	bcntxcancl;	uint32	rxf0ovfl;	uint32	rxf1ovfl;	uint32	rxf2ovfl;	uint32	txsfovfl;	uint32	pmqovfl;	uint32	rxcgprqfrm;	uint32	rxcgprsqovfl;	uint32	txcgprsfail;	uint32	txcgprssuc;	uint32	prs_timeout;	uint32	rxnack;	uint32	frmscons;	uint32	txnack;	uint32	txglitch_nack;	uint32	txburst;	uint32	rxburst;} macstat32_t;typedef struct rateset {	uint	count;			/* # rates in this set */	uint8	rates[WLC_NUMRATES];	/* rates in 500kbps units w/hi bit set if basic */	uint8	mcs[16];	/* supported mcs index bit map */} rateset_t;struct rsn_parms {	uint8 flags;		/* misc booleans (e.g., supported) */	uint8 multicast;	/* multicast cipher */	uint8 ucount;		/* count of unicast ciphers */	uint8 unicast[4];	/* unicast ciphers */	uint8 acount;		/* count of auth modes */	uint8 auth[4];		/* Authentication modes */};/* * buffer length needed for wlc_format_ssid * 32 SSID chars, max of 4 chars for each SSID char "\xFF", plus NULL. */#define SSID_FMT_BUF_LEN	((4 * DOT11_MAX_SSID_LEN) + 1)#define RSN_FLAGS_SUPPORTED		0x1 /* Flag for rsn_params */#ifdef BCMWPA2#define RSN_FLAGS_PREAUTH		0x2 /* Flag for WPA2 rsn_params */#endif /* BCMWPA2 *//* wlc internal bss_info, wl external one is in wlioctl.h */typedef struct wlc_bss_info{	struct ether_addr BSSID;	/* network BSSID */	uint8		flags;		/* flags for internal attibutes */	uint8		SSID_len;	/* the length of SSID */	uint8		SSID[32];	/* SSID string */	int16		RSSI;		/* receive signal strength (in dBm) */	uint16		beacon_period;	/* units are Kusec */	uint16		atim_window;	/* units are Kusec */	uint8		channel;	/* Channel no. */	int8		infra;		/* 0=IBSS, 1=infrastructure, 2=unknown */	rateset_t	rateset;	/* supported rates */	uint8		dtim_period;	/* DTIM period */	int8		phy_noise;	/* noise right after tx (in dBm) */	uint16		capability;	/* Capability information */	struct dot11_bcn_prb *bcn_prb;	/* beacon/probe response frame (ioctl na) */	uint16		bcn_prb_len;	/* beacon/probe response frame length (ioctl na) */	uint8		wme_qosinfo;	/* QoS Info from WME IE; valid if WLC_BSS_WME flag set */	struct rsn_parms wpa;#ifdef BCMWPA2	struct rsn_parms wpa2;#endif /* BCMWPA2 */	uint16		qbss_load_aac;	/* qbss load available admission capacity */	/* qbss_load_chan_free <- (0xff - channel_utilization of qbss_load_ie_t) */	uint8		qbss_load_chan_free;	/* indicates how free the channel is */	uint8		mcipher;	/* multicast cipher */	uint8		wpacfg;		/* wpa config index */} wlc_bss_info_t;/* forward declarations */struct wlc_if;/* wlc_ioctl error codes */#define WLC_ENOIOCTL	1 /* No such Ioctl */#define WLC_EINVAL	2 /* Invalid value */#define WLC_ETOOSMALL	3 /* Value too small */#define WLC_ETOOBIG	4 /* Value too big */#define WLC_ERANGE	5 /* Out of range */#define WLC_EDOWN	6 /* Down */#define WLC_EUP		7 /* Up */#define WLC_ENOMEM	8 /* No Memory */#define WLC_EBUSY	9 /* Busy *//* Radar detect scratchpad area */#define RDR_NTIERS  3	   /* Number of tiers */#define RDR_TIER_SIZE 64   /* Size per tier */#define RDR_LIST_SIZE 256  /* Size of the list */typedef struct {	int length;	int tstart_list[RDR_LIST_SIZE];	int width_list[RDR_LIST_SIZE];	int epoch_start[40];	int epoch_finish[40];	int tiern_list[RDR_NTIERS][RDR_TIER_SIZE];	int nepochs;} radar_work_t;/* IOVar structure */typedef struct wlc_iovar {	const char *name;	/* name for lookup and display */	uint16 varid;		/* id (wlc_varid_t) for switch */	uint16 flags;		/* operational flag bits */	uint16 type;		/* base type of argument */	uint16 minlen;		/* min length for buffer vars */} wlc_iovar_t;/* Flags for common error checks */#define IOVF_WHL	(1<<4)	/* value must be whole (0-max) */#define IOVF_NTRL	(1<<5)	/* value must be natural (1-max) */#define IOVF_SET_UP	(1<<6)	/* set requires driver be up */#define IOVF_SET_DOWN	(1<<7)	/* set requires driver be down */#define IOVF_SET_CLK	(1<<8)	/* set requires core clock */#define IOVF_SET_BAND	(1<<9)	/* set requires fixed band */#define IOVF_GET_CLK	(1<<10)	/* get requires core clock */#define IOVF_GET_BAND	(1<<11)	/* get requires fixed band *//* Base type definitions */#define IOVT_VOID	0	/* no value (implictly set only) */#define IOVT_BOOL	1	/* any value ok (zero/nonzero) */#define IOVT_INT8	2	/* integer values are range-checked */#define IOVT_UINT8	3	/* unsigned int 8 bits */#define IOVT_INT16	4	/* int 16 bits */#define IOVT_UINT16	5	/* unsigned int 16 bits */#define IOVT_INT32	6	/* int 32 bits */#define IOVT_UINT32	7	/* unsigned int 32 bits */#define IOVT_BUFFER	8	/* buffer is size-checked as per minlen *//* Actions for wlc_iovar_op() */#define IOV_GET 0 /* Get an iovar */#define IOV_SET 1 /* Set an iovar *//* Varid to actionid mapping */#define IOV_GVAL(id)		((id)*2)#define IOV_SVAL(id)		(((id)*2)+1)#define IOV_ISSET(actionid)	((actionid & IOV_SET) == IOV_SET)/* watchdog and down callback function proto's */typedef int (*watchdog_fn_t)(void *handle);typedef int (*down_fn_t)(void *handle);/* IOVar handler * * handle - a pointer value registered with the function * vi - iovar_info that was looked up * actionid - action ID, calculated by IOV_GVAL() and IOV_SVAL() based on varid. * name - the actual iovar name * params/plen - parameters and length for a get, input only. * arg/len - buffer and length for value to be set or retrieved, input or output. * vsize - value size, valid for integer type only. * wlcif - interface context (wlc_if pointer) * * All pointers may point into the same buffer. */typedef int (*iovar_fn_t)(void *handle, const wlc_iovar_t *vi, uint32 actionid,	const char *name, void *params, uint plen, void *arg, int alen,	int vsize, struct wlc_if *wlcif);/* * Public portion of "common" os-independent state structure. * The wlc handle points at this. */typedef struct wlc_pub {	uint		unit;			/* device instance number */	uint		corerev;		/* core revision */	sb_t		*sbh;			/* SB handle (cookie for sbutils calls) */	char		*vars;			/* "environment" name=value */

⌨️ 快捷键说明

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