wlc_pub.h
来自「wi-fi sources for asus wl138g v2 pci car」· C头文件 代码 · 共 554 行 · 第 1/2 页
H
554 行
bool promisc; /* promiscuous destination address */ bool up; /* interface up and running */ int _wme; /* WME QoS mode */ bool _mssid; /* true if multiple ssid configuration can be enabled */ bool allmulti; /* enable all multicasts */ bool led_blink_run; /* blink timer is running */ bool BSS; /* infrastructure or ad hoc */ bool associated; /* true:part of [I]BSS, false: not */ /* (union of sta_associated, aps_associated) */ bool phytest_on; /* whether a PHY test is running */ bool bf_preempt; /* True to enable 'darwin' mode */ bool txqstopped; /* tx flow control on */ osl_t *osh; /* pointer to os handle */ struct ether_addr cur_etheraddr; /* our local ethernet address */ struct ether_addr multicast[MAXMULTILIST]; /* multicast addresses */ uint nmulticast; /* # enabled multicast addresses */#ifdef BCMWPA2 pmkid_cand_t pmkid_cand[MAXPMKID]; /* PMKID candidate list */ uint npmkid_cand; /* num PMKID candidates */ pmkid_t pmkid[MAXPMKID]; /* PMKID cache */ uint npmkid; /* num cached PMKIDs */#endif /* BCMWPA2 */ uint _nbands; /* # bands supported */ struct wl_timer *led_blink_timer; /* 10ms led blink timer */ wlc_bss_info_t current_bss; /* STA BSS if active, else first AP BSS */ uint8 boardrev; /* version # of particular board */ uint8 sromrev; /* version # of the srom */ uint32 boardflags; /* Board specific flags from srom */ uint32 wlfeatureflag; /* Flags to control sw features from registry */ int psq_pkts_total; /* total num of ps pkts */ uint32 radar; /* radar info: just on or off for now */#ifdef WLCNT wl_cnt_t _cnt; /* monolithic counters struct */ wl_wme_cnt_t _wme_cnt; /* Counters for WMM */#endif /* WLCNT */ uint16 txmaxpkts; /* max number of large pkts allowed to be pending */ uint8 txpwr_percent; /* power output percentage */ /* Regulatory power limits */ uint8 txpwr_reg_max[MAXCHANNEL]; /* regulatory max txpwr in .25 dBm */ uint8 txpwr_reg_ofdm_max[WLC_MAX_2G_CHANNEL + 1]; /* regulatory max ofdm txpwr */ int8 txpwr_local_max; /* regulatory local txpwr max */ uint8 txpwr_local_constraint; /* local power contraint in dB */ /* s/w decryption counters */ int bcmerror; /* last bcm error */ uint now; /* # elapsed seconds */ mbool radio_disabled; /* bit vector for radio disabled reasons */ bool wakeforphyreg; /* force wake for phyreg access */ int antdiv_override;} wlc_pub_t;/* wl_monitor rx status per packet */typedef struct wl_rxsts{ uint pkterror; /* error flags per pkt */ uint phytype; /* 802.11 A/B/G ... */ uint channel; /* channel */ uint datarate; /* rate in 500kbps */ uint antenna; /* antenna pkts recieved on */ uint pktlength; /* pkt length minus bcm phy hdr */ uint32 mactime; /* time stamp from mac, count per 1us */ uint sq; /* signal quality */ int32 signal; /* in dbm */ int32 noise; /* in dbm */ uint preamble; /* Unknown, short, long */ uint encoding; /* Unknown, CCK, PBCC, OFDM */}wl_rxsts_t;/* status per error RX pkt */#define WL_RXS_CRC_ERROR 0x00000001 /* CRC Error in packet */#define WL_RXS_RUNT_ERROR 0x00000002 /* Runt packet */#define WL_RXS_ALIGN_ERROR 0x00000004 /* Misaligned packet */#define WL_RXS_OVERSIZE_ERROR 0x00000008 /* packet bigger than RX_LENGTH (usually 1518) */#define WL_RXS_WEP_ICV_ERROR 0x00000010 /* Integrity Check Value error */#define WL_RXS_WEP_ENCRYPTED 0x00000020 /* Encrypted with WEP */#define WL_RXS_PLCP_SHORT 0x00000040 /* Short PLCP error */#define WL_RXS_DECRYPT_ERR 0x00000080 /* Decryption error */#define WL_RXS_OTHER_ERR 0x80000000 /* Other errors *//* phy type */#define WL_RXS_PHY_A 0x00000000 /* A phy type */#define WL_RXS_PHY_B 0x00000001 /* B phy type */#define WL_RXS_PHY_G 0x00000002 /* G phy type *//* encoding */#define WL_RXS_ENCODING_CCK 0x00000000 /* CCK encoding */#define WL_RXS_ENCODING_OFDM 0x00000001 /* OFDM encoding *//* preamble */#define WL_RXS_PREAMBLE_SHORT 0x00000000 /* Short preamble */#define WL_RXS_PREAMBLE_LONG 0x00000001 /* Long preamble *//* forward declare and use the struct notation so we don't have to * have it defined if not necessary. */struct wlc_info;struct wlc_if;/* Structure for Pkttag area in a packet. * CAUTION: Pls carefully consider your design before adding any new fields to the pkttag * The size is limited to 32 bytes which on 64-bit machine allows only 4 fields * If adding a member, be sure to check if WLPKTTAG_INFO_MOVE should transfer it. */typedef struct { uint32 flags; /* Describe various packet properties */ uint8 callbackidx; /* Index into pkt_callback tables for callback function */ uint32 exptime; /* Time of expiry for the packet */ struct scb* _scb; /* Pointer to SCB for associated ea */} wlc_pkttag_t;#define WLPKTTAG(p) ((wlc_pkttag_t*)PKTTAG(p))/* Flags used in wlc_pkttag_t. * If adding a flag, be sure to check if WLPKTTAG_INFO_MOVE should transfer it. */#define WLF_PSMARK 0x00000001 /* PKT marking for PSQ ageing */#define WLF_PSDONTQ 0x00000002 /* PS-Poll response don't queue flag */#define WLF_MPDU 0x00000004 /* Set if pkt is a PDU as opposed to MSDU */#define WLF_NON8023 0x00000008 /* original pkt is not 8023 */#define WLF_8021X 0x00000010 /* original pkt is not 8023 */#define WLF_EXPTIME 0x00000200 /* pkttag has a valid expiration time for the pkt *//* Move callback functions from a packet to another * CAUTION: This is destructive operation for pkt_from */#define WLPKTTAG_INFO_MOVE(pkt_from, pkt_to) \ do { \ /* Make sure not moving to same packet! */ \ ASSERT(pkt_from != pkt_to); \ WLPKTTAG(pkt_to)->callbackidx = WLPKTTAG(pkt_from)->callbackidx; \ WLPKTTAG(pkt_from)->callbackidx = 0; \ } while (0)#define WLPKTTAGSCB(p) (WLPKTTAG(p)->_scb)#define WLC_PREC_COUNT 16 /* Max precedence level implemented *//* pri is PKTPRIO encoded in the packet. This maps the Packet priority to * enqueue precedence as defined in wlc_prec_map */extern const uint8 wlc_prio2prec_map[];#define WLC_PRIO_TO_PREC(pri) wlc_prio2prec_map[(pri) & 7]/* This maps priority to one precedence higher - Used by PS-Poll response packets to * simulate enqueue-at-head operation, but still maintain the order on the queue */#define WLC_PRIO_TO_HI_PREC(pri) MIN(WLC_PRIO_TO_PREC(pri) + 1, WLC_PREC_COUNT - 1)extern const uint8 wme_fifo2ac[];#define WME_PRIO2AC(prio) wme_fifo2ac[wme_prio2fifo[(prio)]]/* Map AC bitmap to precedence bitmap */extern uint wlc_acbitmap2precbitmap[16];#define WLC_ACBITMAP_TO_PRECBITMAP(ab) wlc_acbitmap2precbitmap[(ab) & 0xf]/* Mask to describe all precedence levels */#define WLC_PREC_BMP_ALL MAXBITVAL(WLC_PREC_COUNT)#ifdef WME#define WME_AUTO(wlc) ((wlc)->pub._wme == AUTO)#else#define WME_AUTO(wlc) (0)#endif/* common functions for every port */extern void * wlc_attach(void *wl, uint16 vendor, uint16 device, uint unit, bool piomode, osl_t *osh, void *regsva, uint bustype, void *btparam, uint *perr);extern uint wlc_detach(struct wlc_info *wlc);extern bool wlc_chipmatch(uint16 vendor, uint16 device);extern void wlc_init(struct wlc_info *wlc);extern void wlc_reset(struct wlc_info *wlc);extern void wlc_corereset(struct wlc_info *wlc);extern void wlc_corereset_flags(struct wlc_info *wlc, uint32 flags);extern int wlc_up(struct wlc_info *wlc);extern uint wlc_down(struct wlc_info *wlc);extern bool wlc_sendpkt(struct wlc_info *wlc, void *sdu, struct wlc_if *wlcif);extern bool wlc_isr(struct wlc_info *wlc, bool *wantdpc);extern bool wlc_dpc(struct wlc_info *wlc, bool bounded);/* * These are not interrupts on/off entry points, which are in every port. * These are workbee, called by port peers, not SMP safe */extern void wlc_intrson(struct wlc_info *wlc);extern uint32 wlc_intrsoff(struct wlc_info *wlc);extern void wlc_intrsrestore(struct wlc_info *wlc, uint32 macintmask);extern void wlc_intrsoff_isr(struct wlc_info *wlc);extern bool wlc_intrsupd(struct wlc_info *wlc);extern uint32 wlc_mhf(struct wlc_info *wlc, uint32 mask, uint32 val, bool allbands);extern void wlc_write_shm(struct wlc_info *wlc, uint offset, uint16 v);extern uint16 wlc_read_shm(struct wlc_info *wlc, uint offset);extern void wlc_write_template_ram(struct wlc_info *wlc, int offset, int len, void *buf);extern void wlc_update_txpwr_shmem(wlc_pub_t *pub);extern uint wlc_ctrupd(struct wlc_info *wlc, uint ucode_offset, uint offset);extern void wlc_rate_lookup_init(struct wlc_info *wlc, struct rateset *rateset);extern void wlc_default_rateset(struct wlc_info *wlc, struct rateset *rs);/* wlc_phy.c helper functions */extern bool wlc_scaninprog(struct wlc_info *wlc);extern bool wlc_rminprog(struct wlc_info *wlc);extern void *wlc_cur_phy(struct wlc_info *wlc);extern bool wlc_ofdm_restrict(struct wlc_info *wlc);extern int wlc_cur_bandtype(struct wlc_info *wlc);extern void wlc_set_ps_ctrl(struct wlc_info *wlc);extern void wlc_mctrl(struct wlc_info *wlc, uint32 mask, uint32 val);/* ioctl */extern int wlc_set(struct wlc_info *wlc, int cmd, int arg);extern int wlc_get(struct wlc_info *wlc, int cmd, int *arg);extern int wlc_iovar_getint(struct wlc_info *wlc, const char *name, int *arg);extern int wlc_iovar_setint(struct wlc_info *wlc, const char *name, int arg);extern int wlc_iovar_getint8(struct wlc_info *wlc, const char *name, int8 *arg);extern int wlc_iovar_getbool(struct wlc_info *wlc, const char *name, bool *arg);extern int wlc_iovar_op(struct wlc_info *wlc, const char *name, void *params, int p_len, void *arg, int len, bool set, struct wlc_if *wlcif);extern int wlc_iovar_check(wlc_pub_t *pub, const wlc_iovar_t *vi, void *arg, int len, bool set);extern int wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len, struct wlc_if *wlcif);extern int wlc_module_register(wlc_pub_t *pub, const wlc_iovar_t *iovars, char *name, void *hdl, iovar_fn_t iovar_fn, watchdog_fn_t watchdog_fn, down_fn_t down_fn);extern int wlc_module_unregister(wlc_pub_t *pub, const char *name, void *hdl);extern void wlc_suspend_mac_and_wait(struct wlc_info *wlc);extern void wlc_enable_mac(struct wlc_info *wlc);extern uint16 wlc_rate_shm_offset(struct wlc_info *wlc, uint8 rate);static INLINE int wlc_iovar_getuint(struct wlc_info *wlc, const char *name, uint *arg){ return wlc_iovar_getint(wlc, name, (int*)arg);}static INLINE int wlc_iovar_getuint8(struct wlc_info *wlc, const char *name, uint8 *arg){ return wlc_iovar_getint8(wlc, name, (int8*)arg);}static INLINE int wlc_iovar_setuint(struct wlc_info *wlc, const char *name, uint arg){ return wlc_iovar_setuint(wlc, name, (uint)arg);}/* ioctl helper */extern uint wlc_freq2channel(uint freq);extern uint wlc_channel2freq(uint channel);extern int wlc_iocbandchk(struct wlc_info *wlc, int *arg, int len, int *bands, bool clkchk);/* helper functions */extern void wlc_statsupd(struct wlc_info *wlc);extern void wlc_sendup_event(struct wlc_info *wlc, int bssid, const struct ether_addr *ea, const wlc_event_t *e, uint8 *data, uint32 len);extern void wlc_getrand(struct wlc_info *wlc, uint8 *buf, int len);struct scb;void wlc_ps_on(struct wlc_info *wlc, struct scb *scb);void wlc_ps_off(struct wlc_info *wlc, struct scb *scb, bool discard);void wlc_event(struct wlc_info *wlc, wlc_event_t *e);extern void wlc_mute(struct wlc_info *wlc, bool want);#ifdef BCMWPA2extern void wlc_pmkid_build_cand_list(struct wlc_info *wlc, bool check_SSID);extern void wlc_pmkid_event(struct wlc_info *wlc);#endif /* BCMWPA2 */extern void wlc_tinydump(struct wlc_info *wlc, char *buf);#endif /* _wlc_pub_h_ */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?