1 1.9 rmind /* $NetBSD: ieee80211_sysctl.h,v 1.9 2009/10/19 23:19:39 rmind Exp $ */ 2 1.1 dyoung /*- 3 1.1 dyoung * Copyright (c) 2005 David Young. All rights reserved. 4 1.1 dyoung * 5 1.1 dyoung * Redistribution and use in source and binary forms, with or 6 1.1 dyoung * without modification, are permitted provided that the following 7 1.1 dyoung * conditions are met: 8 1.1 dyoung * 1. Redistributions of source code must retain the above copyright 9 1.1 dyoung * notice, this list of conditions and the following disclaimer. 10 1.1 dyoung * 2. Redistributions in binary form must reproduce the above 11 1.1 dyoung * copyright notice, this list of conditions and the following 12 1.1 dyoung * disclaimer in the documentation and/or other materials provided 13 1.1 dyoung * with the distribution. 14 1.1 dyoung * 15 1.1 dyoung * THIS SOFTWARE IS PROVIDED BY David Young ``AS IS'' AND ANY 16 1.1 dyoung * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 17 1.1 dyoung * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 1.1 dyoung * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL David 19 1.1 dyoung * Young BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 1.1 dyoung * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 1.1 dyoung * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 1.1 dyoung * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 1.1 dyoung * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 1.1 dyoung * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 1.1 dyoung * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 26 1.1 dyoung * OF SUCH DAMAGE. 27 1.1 dyoung */ 28 1.1 dyoung #ifndef _NET80211_IEEE80211_SYSCTL_H_ 29 1.1 dyoung #define _NET80211_IEEE80211_SYSCTL_H_ 30 1.1 dyoung 31 1.3 dyoung #include <net80211/_ieee80211.h> 32 1.1 dyoung 33 1.3 dyoung /* sysctl(9) interface to net80211 client/peer records */ 34 1.1 dyoung 35 1.1 dyoung /* Name index, offset from net.link.ieee80211.node. */ 36 1.1 dyoung 37 1.1 dyoung #define IEEE80211_SYSCTL_NODENAME_IF 0 38 1.1 dyoung #define IEEE80211_SYSCTL_NODENAME_OP 1 39 1.1 dyoung #define IEEE80211_SYSCTL_NODENAME_ARG 2 40 1.1 dyoung #define IEEE80211_SYSCTL_NODENAME_TYPE 3 41 1.1 dyoung #define IEEE80211_SYSCTL_NODENAME_ELTSIZE 4 42 1.1 dyoung #define IEEE80211_SYSCTL_NODENAME_ELTCOUNT 5 43 1.1 dyoung #define IEEE80211_SYSCTL_NODENAMELEN 6 44 1.1 dyoung 45 1.1 dyoung /* Record type numbers. */ 46 1.1 dyoung #define IEEE80211_SYSCTL_T_NODE 0 /* client/peer record */ 47 1.1 dyoung #define IEEE80211_SYSCTL_T_RSSADAPT 1 /* rssadapt(9) record 48 1.1 dyoung * (optional) 49 1.1 dyoung */ 50 1.1 dyoung #define IEEE80211_SYSCTL_T_DRVSPEC 2 /* driver-specific record 51 1.1 dyoung * (optional) 52 1.1 dyoung */ 53 1.1 dyoung 54 1.1 dyoung #define IEEE80211_SYSCTL_OP_ALL 0 55 1.3 dyoung 56 1.1 dyoung /* Every record begins with this information. */ 57 1.1 dyoung struct ieee80211_node_sysctlhdr { 58 1.1 dyoung /*00*/ u_int16_t sh_ifindex; 59 1.1 dyoung /*02*/ u_int8_t sh_macaddr[IEEE80211_ADDR_LEN]; 60 1.1 dyoung /*08*/ u_int8_t sh_bssid[IEEE80211_ADDR_LEN]; 61 1.1 dyoung }; 62 1.1 dyoung 63 1.1 dyoung /* Exportable node. */ 64 1.1 dyoung struct ieee80211_node_sysctl { 65 1.1 dyoung /*00*/ u_int16_t ns_ifindex; 66 1.1 dyoung /*02*/ u_int8_t ns_macaddr[IEEE80211_ADDR_LEN]; 67 1.1 dyoung /*08*/ u_int8_t ns_bssid[IEEE80211_ADDR_LEN]; 68 1.1 dyoung /*0e*/ u_int16_t ns_capinfo; /* capabilities */ 69 1.1 dyoung /*10*/ u_int32_t ns_flags; /* properties of this node, 70 1.1 dyoung * IEEE80211_NODE_SYSCTL_F_* 71 1.1 dyoung */ 72 1.1 dyoung /*14*/ u_int16_t ns_freq; 73 1.1 dyoung /*16*/ u_int16_t ns_chanflags; 74 1.1 dyoung /*18*/ u_int16_t ns_chanidx; 75 1.1 dyoung /*1a*/ u_int8_t ns_rssi; /* recv ssi */ 76 1.1 dyoung /*1b*/ u_int8_t ns_esslen; 77 1.1 dyoung /*1c*/ u_int8_t ns_essid[IEEE80211_NWID_LEN]; 78 1.3 dyoung /*3c*/ u_int8_t ns_rsvd0; /* reserved */ 79 1.1 dyoung /*3d*/ u_int8_t ns_erp; /* 11g only */ 80 1.1 dyoung /*3e*/ u_int16_t ns_associd; /* assoc response */ 81 1.1 dyoung /*40*/ u_int32_t ns_inact; /* inactivity mark count */ 82 1.1 dyoung /*44*/ u_int32_t ns_rstamp; /* recv timestamp */ 83 1.1 dyoung /*48*/ struct ieee80211_rateset ns_rates; /* negotiated rate set */ 84 1.1 dyoung /*58*/ u_int16_t ns_txrate; /* index to ns_rates[] */ 85 1.1 dyoung /*5a*/ u_int16_t ns_intval; /* beacon interval */ 86 1.1 dyoung /*5c*/ u_int8_t ns_tstamp[8]; /* from last rcv'd beacon */ 87 1.1 dyoung /*64*/ u_int16_t ns_txseq; /* seq to be transmitted */ 88 1.1 dyoung /*66*/ u_int16_t ns_rxseq; /* seq previous received */ 89 1.1 dyoung /*68*/ u_int16_t ns_fhdwell; /* FH only */ 90 1.1 dyoung /*6a*/ u_int8_t ns_fhindex; /* FH only */ 91 1.1 dyoung /*6b*/ u_int8_t ns_fails; /* failure count to associate */ 92 1.1 dyoung /*6c*/ 93 1.1 dyoung #ifdef notyet 94 1.1 dyoung /* DTIM and contention free period (CFP) */ 95 1.1 dyoung u_int8_t ns_dtimperiod; 96 1.1 dyoung u_int8_t ns_cfpperiod; /* # of DTIMs between CFPs */ 97 1.1 dyoung u_int16_t ns_cfpduremain; /* remaining cfp duration */ 98 1.1 dyoung u_int16_t ns_cfpmaxduration;/* max CFP duration in TU */ 99 1.1 dyoung u_int16_t ns_nextdtim; /* time to next DTIM */ 100 1.1 dyoung u_int16_t ns_timoffset; 101 1.1 dyoung #endif 102 1.8 perry } __packed; 103 1.1 dyoung 104 1.1 dyoung #ifdef __NetBSD__ 105 1.4 dyoung enum ieee80211_node_walk_state { 106 1.4 dyoung IEEE80211_WALK_BSS = 0, 107 1.4 dyoung IEEE80211_WALK_SCAN, 108 1.4 dyoung IEEE80211_WALK_STA 109 1.4 dyoung }; 110 1.4 dyoung 111 1.1 dyoung struct ieee80211_node_walk { 112 1.4 dyoung struct ieee80211com *nw_ic; 113 1.4 dyoung struct ieee80211_node_table *nw_nt; 114 1.4 dyoung struct ieee80211_node *nw_ni; 115 1.4 dyoung u_short nw_ifindex; 116 1.1 dyoung }; 117 1.1 dyoung #endif /* __NetBSD__ */ 118 1.1 dyoung 119 1.1 dyoung #define IEEE80211_NODE_SYSCTL_F_BSS 0x00000001 /* this node is the 120 1.1 dyoung * ic->ic_bss 121 1.1 dyoung */ 122 1.6 dyoung #define IEEE80211_NODE_SYSCTL_F_STA 0x00000002 /* this node is in 123 1.6 dyoung * the neighbor/sta 124 1.6 dyoung * table 125 1.6 dyoung */ 126 1.6 dyoung #define IEEE80211_NODE_SYSCTL_F_SCAN 0x00000004 /* this node is in 127 1.6 dyoung * the scan table 128 1.6 dyoung */ 129 1.7 elad #endif /* !_NET80211_IEEE80211_SYSCTL_H_ */ 130