From ff66a890e4594f818c3bde7c7740e14fa41fb876 Mon Sep 17 00:00:00 2001 From: Hiten Pandya Date: Tue, 27 Jul 2004 14:50:56 +0000 Subject: [PATCH] Add the ieee80211(9) API manual pages. Obtained from FreeBSD with my modifications. --- share/man/man9/Makefile | 51 ++++- share/man/man9/ieee80211.9 | 261 ++++++++++++++++++++++++ share/man/man9/ieee80211_crypto.9 | 103 ++++++++++ share/man/man9/ieee80211_input.9 | 114 +++++++++++ share/man/man9/ieee80211_ioctl.9 | 100 ++++++++++ share/man/man9/ieee80211_node.9 | 294 ++++++++++++++++++++++++++++ share/man/man9/ieee80211_output.9 | 152 ++++++++++++++ share/man/man9/ieee80211_proto.9 | 76 +++++++ share/man/man9/ieee80211_radiotap.9 | 236 ++++++++++++++++++++++ 9 files changed, 1386 insertions(+), 1 deletion(-) create mode 100644 share/man/man9/ieee80211.9 create mode 100644 share/man/man9/ieee80211_crypto.9 create mode 100644 share/man/man9/ieee80211_input.9 create mode 100644 share/man/man9/ieee80211_ioctl.9 create mode 100644 share/man/man9/ieee80211_node.9 create mode 100644 share/man/man9/ieee80211_output.9 create mode 100644 share/man/man9/ieee80211_proto.9 create mode 100644 share/man/man9/ieee80211_radiotap.9 diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 302ad2becf..02c15d19d2 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -1,5 +1,5 @@ # $FreeBSD: src/share/man/man9/Makefile,v 1.60.2.26 2003/06/13 01:04:17 hmp Exp $ -# $DragonFly: src/share/man/man9/Makefile,v 1.12 2004/06/03 19:26:36 hmp Exp $ +# $DragonFly: src/share/man/man9/Makefile,v 1.13 2004/07/27 14:50:56 hmp Exp $ MAN= DECLARE_MODULE.9 DELAY.9 DEV_MODULE.9 KASSERT.9 MD5.9 \ MODULE_DEPEND.9 MODULE_VERSION.9 SPLASSERT.9 SYSCALL_MODULE.9 \ @@ -19,6 +19,9 @@ MAN= DECLARE_MODULE.9 DELAY.9 DEV_MODULE.9 KASSERT.9 MD5.9 \ crypto.9 devstat.9 \ devtoname.9 fetch.9 \ hash.9 \ + ieee80211.9 ieee80211_crypto.9 ieee80211_input.9 ieee80211_ioctl.9 \ + ieee80211_node.9 ieee80211_output.9 ieee80211_proto.9 \ + ieee80211_radiotap.9 \ ifnet.9 inittodr.9 intro.9 kernacc.9 lock.9 \ malloc.9 make_dev.9 mbuf.9 microseq.9 mi_switch.9 module.9 namei.9 \ pci.9 panic.9 physio.9 posix4.9 psignal.9 \ @@ -91,6 +94,52 @@ MLINKS+=devstat.9 devstat_remove_entry.9 devstat.9 devstat_start_transaction.9 MLINKS+=devstat.9 devstat_end_transaction.9 MLINKS+=fetch.9 fubyte.9 fetch.9 fuswintr.9 fetch.9 fusword.9 fetch.9 fuword.9 MLINKS+=hash.9 hashinit.9 hash.9 phashinit.9 +MLINKS+=ieee80211.9 ieee80211_attach.9 \ + ieee80211.9 ieee80211_chan2ieee.9 \ + ieee80211.9 ieee80211_chan2mode.9 \ + ieee80211.9 ieee80211_ieee2mhz.9 \ + ieee80211.9 ieee80211_ifattach.9 \ + ieee80211.9 ieee80211_ifdetach.9 \ + ieee80211.9 ieee80211_media2rate.9 \ + ieee80211.9 ieee80211_media_change.9 \ + ieee80211.9 ieee80211_media_init.9 \ + ieee80211.9 ieee80211_media_status.9 \ + ieee80211.9 ieee80211_mhz2ieee.9 \ + ieee80211.9 ieee80211_rate2media.9 \ + ieee80211.9 ieee80211_setmode.9 \ + ieee80211.9 ieee80211_watchdog.9 +MLINKS+=ieee80211_crypto.9 ieee80211_crypto_attach.9 \ + ieee80211_crypto.9 ieee80211_crypto_detach.9 \ + ieee80211_crypto.9 ieee80211_wep_crypt.9 +MLINKS+=ieee80211_input.9 ieee80211_decap.9 \ + ieee80211_input.9 ieee80211_recv_mgmt.9 +MLINKS+=ieee80211_ioctl.9 ieee80211_cfgget.9 \ + ieee80211_ioctl.9 ieee80211_cfgset.9 +MLINKS+=ieee80211_node.9 ieee80211_alloc_node.9 \ + ieee80211_node.9 ieee80211_begin_scan.9 \ + ieee80211_node.9 ieee80211_create_ibss.9 \ + ieee80211_node.9 ieee80211_dup_bss.9 \ + ieee80211_node.9 ieee80211_end_scan.9 \ + ieee80211_node.9 ieee80211_find_node.9 \ + ieee80211_node.9 ieee80211_free_allnodes.9 \ + ieee80211_node.9 ieee80211_free_node.9 \ + ieee80211_node.9 ieee80211_iterate_nodes.9 \ + ieee80211_node.9 ieee80211_lookup_node.9 \ + ieee80211_node.9 ieee80211_next_scan.9 \ + ieee80211_node.9 ieee80211_node_attach.9 \ + ieee80211_node.9 ieee80211_node_detach.9 \ + ieee80211_node.9 ieee80211_node_lateattach.9 \ + ieee80211_node.9 ieee80211_timeout_nodes.9 +MLINKS+=ieee80211_output.9 ieee80211_add_rates.9 \ + ieee80211_output.9 ieee80211_add_xrates.9 \ + ieee80211_output.9 ieee80211_encap.9 \ + ieee80211_output.9 ieee80211_send_mgmt.9 +MLINKS+=ieee80211_proto.9 ieee80211_dump_pkt.9 \ + ieee80211_proto.9 ieee80211_fix_rate.9 \ + ieee80211_proto.9 ieee80211_print_essid.9 \ + ieee80211_proto.9 ieee80211_proto_attach.9 \ + ieee80211_proto.9 ieee80211_proto_detach.9 +MLINKS+=ieee80211_radiotap.9 radiotap.9 MLINKS+=ifnet.9 if_data.9 ifnet.9 ifaddr.9 ifnet.9 ifqueue.9 MLINKS+=kernacc.9 useracc.9 MLINKS+=make_dev.9 destroy_dev.9 diff --git a/share/man/man9/ieee80211.9 b/share/man/man9/ieee80211.9 new file mode 100644 index 0000000000..eba716653e --- /dev/null +++ b/share/man/man9/ieee80211.9 @@ -0,0 +1,261 @@ +.\" +.\" Copyright (c) 2004 Bruce M. Simpson +.\" Copyright (c) 2004 Darron Broad +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" $DragonFly: src/share/man/man9/ieee80211.9,v 1.1 2004/07/27 14:50:56 hmp Exp $ +.\" $Id: ieee80211.9,v 1.3 2004/07/07 12:59:39 ru Exp $ +.\" +.Dd March 2, 2004 +.Dt IEEE80211 9 +.Os +.Sh NAME +.Nm ieee80211_ifattach , ieee80211_ifdetach , +.Nm ieee80211_mhz2ieee , ieee80211_chan2ieee , ieee80211_ieee2mhz , +.Nm ieee80211_media_init , ieee80211_media_change , ieee80211_media_status , +.Nm ieee80211_watchdog , +.Nm ieee80211_setmode , ieee80211_chan2mode , +.Nm ieee80211_rate2media , ieee80211_media2rate +.Nd core 802.11 network stack functions +.Sh SYNOPSIS +.In net80211/ieee80211_var.h +.In net80211/ieee80211_proto.h +.Ft void +.Fn ieee80211_ifattach "struct ifnet *ifp" +.Ft void +.Fn ieee80211_ifdetach "struct ifnet *ifp" +.Ft u_int +.Fn ieee80211_mhz2ieee "u_int freq" "u_int flags" +.Ft u_int +.Fn ieee80211_chan2ieee "struct ieee80211com *ic" "struct ieee80211_channel *c" +.Ft u_int +.Fn ieee80211_ieee2mhz "u_int chan" "u_int flags" +.Ft void +.Fo ieee80211_media_init +.Fa "struct ifnet *ifp" "ifm_change_cb_t media_change" +.Fa "ifm_stat_cb_t media_stat" +.Fc +.Fa int +.Fn ieee80211_media_change "struct ifnet *ifp" +.Fa void +.Fn ieee80211_media_status "struct ifnet *ifp" "struct ifmediareq *imr" +.Ft void +.Fn ieee80211_watchdog "struct ifnet *ifp" +.Ft int +.Fn ieee80211_setmode "struct ieee80211com *ic" "enum ieee80211_phymode mode" +.Ft enum ieee80211_phymode +.Fo ieee80211_chan2mode +.Fa "struct ieee80211com *ic" "struct ieee80211_channel *chan" +.Fc +.Ft int +.Fo ieee80211_rate2media +.Fa "struct ieee80211com *ic" "int rate" "enum ieee80211_phymode mode" +.Fc +.Ft int +.Fn ieee80211_media2rate "int mword" +.Sh DESCRIPTION +The +.Nm ieee80211 +collection of functions are used to manage wireless network interfaces in the +system which use the system's software 802.11 network stack. +Most of these functions require that attachment to the stack is performed +before calling. +Several utility functions are also provided; these are safe to call from +any driver without prior initialization. +.Pp +.\" +The +.Fn ieee80211_ifattach +function attaches the network interface +.Fa ifp +to the 802.11 network stack layer. +This function must be called before using any of the +.Nm ieee80211 +functions which need to store driver state across invocations; +The +.Vt struct ifnet +instance pointed to by +.Fa ifp +MUST be an instance of +.Vt struct ieee80211com , +with various fields initialized to tell +.Nm ieee80211 +about its capabilities. +This function performs Ethernet and BPF attachment (by calling +.Fn ether_ifattach +and +.Fn bpfattach2 ) +on behalf of the caller. +It also implements the +.Vt ifmedia +interface. +.Pp +.\" +The +.Fn ieee80211_ifdetach +function frees any +.Nm ieee80211 +structures associated with the driver, and performs Ethernet and BPF +detachment on behalf of the caller. +.Pp +.\" +The +.Fn ieee80211_mhz2ieee +utility function converts the frequency +.Fa freq +(specified in MHz) to an IEEE 802.11 channel number. +The +.Fa flags +argument is a hint which specifies whether the frequency is in +the 2GHz ISM band +.Pq Vt IEEE80211_CHAN_2GHZ +or the 5GHz band +.Pq Vt IEEE80211_CHAN_5GHZ ; +appropriate clipping of the result is then performed. +.Pp +.\" +The +.Fn ieee80211_chan2ieee +function converts the channel specified in +.Fa *c +to an IEEE channel number for the driver +.Fa ic . +If the conversion would be invalid, an error message is printed to the +system console. +This function REQUIRES that the driver is hooked up to the +.Nm ieee80211 +subsystem. +.Pp +.\" +The +.Fn ieee80211_ieee2mhz +utility function converts the IEEE channel number +.Ft chan +to a frequency (in MHz). +The +.Fa flags +argument is a hint which specifies whether the frequency is in +the 2GHz ISM band +.Pq Vt IEEE80211_CHAN_2GHZ +or the 5GHz band +.Pq Vt IEEE80211_CHAN_5GHZ ; +appropriate clipping of the result is then performed. +.Pp +.\" +The +.Fn ieee80211_media_init +function initializes media data structures used by the +.Vt ifmedia +interface, for the driver +.Fa ifp . +It must be called by the driver after calling +.Fn ieee80211_attach +and before calling most +.Nm ieee80211 +functions. +The +.Fa media_change +and +.Fa media_stat +arguments specify helper functions which will be invoked by the +.Vt ifmedia +framework when the user changes or queries media options, +using a command such as +.Xr ifconfig 8 . +.Pp +.\" +The +.Fn ieee80211_media_status +and +.Fn ieee80211_media_change +functions are device-independent handlers for +.Vt ifmedia +commands and are not intended to be called directly. +.Pp +.\" +The +.Fn ieee80211_watchdog +function is intended to be called from a driver's +.Va if_watchdog +routine. +It is used to perform periodic cleanup of state within the software 802.11 +stack, as well as timing out scans. +.Pp +.\" +The +.Fn ieee80211_setmode +function is called from within the 802.11 stack to change the mode +of the driver's PHY; it is not intended to be called directly. +.Pp +.\" +The +.Fn ieee80211_chan2mode +function returns the PHY mode required for use with the channel +.Fa chan +on the device +.Fa ic . +This is typically used when selecting a rate set, to be advertised in +beacons, for example. +.Pp +.\" +The +.Fn ieee80211_rate2media +function converts the bit rate +.Fa rate +(measured in units of 0.5Mbps) to an +.Vt ifmedia +sub-type, for the device +.Fa ic +running in PHY mode +.Fa mode . +The +.Fn ieee80211_media2rate +performs the reverse of this conversion, returning the bit rate (in 0.5Mbps +units) corresponding to an +.Vt ifmedia +sub-type. +.\" +.Sh SEE ALSO +.Xr ieee80211_crypto 9 , +.Xr ieee80211_input 9 , +.Xr ieee80211_ioctl 9 , +.Xr ieee80211_node 9 , +.Xr ieee80211_output 9 , +.Xr ieee80211_proto 9 , +.Xr ieee80211_radiotap 9 , +.Xr ifnet 9 +.Sh HISTORY +The +.Nm ieee80211 +series of functions first appeared in +.Nx 1.5 , +and were later ported to +.Fx 4.6 . +.Sh AUTHORS +.An -nosplit +This man page was written by +.An Bruce M. Simpson Aq bms@FreeBSD.org +and +.An Darron Broad Aq darron@kewl.org . diff --git a/share/man/man9/ieee80211_crypto.9 b/share/man/man9/ieee80211_crypto.9 new file mode 100644 index 0000000000..48df91dbf8 --- /dev/null +++ b/share/man/man9/ieee80211_crypto.9 @@ -0,0 +1,103 @@ +.\" +.\" Copyright (c) 2004 Bruce M. Simpson +.\" Copyright (c) 2004 Darron Broad +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" $DragonFly: src/share/man/man9/ieee80211_crypto.9,v 1.1 2004/07/27 14:50:56 hmp Exp $ +.\" $Id: ieee80211_crypto.9,v 1.2 2004/07/07 12:59:39 ru Exp $ +.\" +.Dd March 2, 2004 +.Dt IEEE80211_CRYPTO 9 +.Os +.Sh NAME +.Nm ieee80211_crypto_attach , ieee80211_crypto_detach , ieee80211_wep_crypt +.Nd 802.11 WEP encryption functions +.Sh SYNOPSIS +.Ft void +.Fn ieee80211_crypto_attach "struct ifnet *ifp" +.Ft void +.Fn ieee80211_crypto_detach "struct ifnet *ifp" +.Ft struct mbuf * +.Fn ieee80211_wep_crypt "struct ifnet *ifp" "struct mbuf *m0" "int txflag" +.Sh DESCRIPTION +These functions provide software encryption support +for 802.11 device drivers. +.Pp +.\" +The +.Fn ieee80211_crypto_attach +function initializes crypto support for the interface +.Fa ifp , +and sets the initialization vector (IV) for WEP encryption to +a random number derived from a secure PRNG. +.Pp +.\" +The +.Fn ieee80211_crypto_detach +function frees data structures associated with crypto support +for the interface +.Fa ifp . +.Pp +.\" +The +.Fn ieee80211_wep_crypt +function runs the appropriate WEP encryption algorithm over the 802.11 +encapsulated frame held in the mbuf chain +.Fa m0 , +for transmission or reception on the interface +.Fa ifp . +The +.Fa txflag +argument specifies whether the frame is being received or transmitted. +A value of 0 indicates that the frame is being received and should +therefore be decrypted; a non-zero value indicates that the frame +is being transmitted +and should be encrypted. +.\" +.Sh IMPLEMENTATION NOTES +The +.Fn ieee80211_wep_crypt +function stores its IV in the interface's embedded +.Vt struct ieee80211com +instance. +.Sh SEE ALSO +.Xr awi 4 , +.Xr wi 4 , +.Xr arc4random 9 , +.Xr ieee80211 9 , +.Xr ifnet 9 +.Sh HISTORY +The +.Nm ieee80211 +series of functions first appeared in +.Nx 1.5 , +and were later ported to +.Fx 4.6 . +.Sh AUTHORS +.An -nosplit +This man page was written by +.An Bruce M. Simpson Aq bms@FreeBSD.org +and +.An Darron Broad Aq darron@kewl.org . diff --git a/share/man/man9/ieee80211_input.9 b/share/man/man9/ieee80211_input.9 new file mode 100644 index 0000000000..0b48850d65 --- /dev/null +++ b/share/man/man9/ieee80211_input.9 @@ -0,0 +1,114 @@ +.\" +.\" Copyright (c) 2004 Bruce M. Simpson +.\" Copyright (c) 2004 Darron Broad +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" $DragonFly: src/share/man/man9/ieee80211_input.9,v 1.1 2004/07/27 14:50:56 hmp Exp $ +.\" $Id: ieee80211_input.9,v 1.2 2004/07/07 12:59:39 ru Exp $ +.\" +.Dd March 2, 2004 +.Dt IEEE80211_INPUT 9 +.Os +.Sh NAME +.Nm ieee80211_input , ieee80211_decap , ieee80211_recv_mgmt +.Nd software 802.11 stack input functions +.Sh SYNOPSIS +.In net80211/ieee80211_var.h +.In net80211/ieee80211_proto.h +.Ft void +.Fo ieee80211_input +.Fa "struct ifnet *ifp" "struct mbuf *m" "struct ieee80211_node *ni" +.Fa "int rssi" "u_int32_t rstamp" +.Fc +.Ft struct mbuf * +.Fn ieee80211_decap "struct ifnet *ifp" "struct mbuf *m" +.Ft void +.Fo ieee80211_recv_mgmt +.Fa "struct ieee80211com *ic" "struct mbuf *m0" "struct ieee80211_node *ni" +.Fa "int subtype" "int rssi" "u_int32_t rstamp" +.Fc +.Sh DESCRIPTION +These +functions process received 802.11 frames. +.Pp +.\" +The +.Fn ieee80211_input +function takes an mbuf chain +.Fa m +containing a complete 802.11 frame from the driver +.Fa ifp +and passes it to the software 802.11 stack for input processing. +The +.Fa ni +argument specifies an instance of +.Vt struct ieee80211_node +(which may be driver-specific) representing the node from which the +frame was received. +The arguments +.Fa rssi +and +.Fa stamp +are typically derived from on-card data structures; they are used for +recording the signal strength and time received of the frame respectively. +.Pp +.\" +The +.Fn ieee80211_decap +function performs decapsulation of the 802.11 frame in the mbuf chain +.Fa m +received by the device +.Fa ifp , +taking the form of the 802.11 address fields into account; +the structure of 802.11 addresses vary according to the intended +source and destination of the frame. +It is typically called from within +.Fn ieee80211_input . +.Pp +.\" +The +.Fn ieee80211_recv_mgmt +performs input processing for 802.11 management frames. +It is typically called from within +.Fn ieee80211_input . +.\" +.Sh SEE ALSO +.Xr ieee80211 9 , +.Xr ifnet 9 +.Sh HISTORY +The +.Nm ieee80211 +series of functions first appeared in +.Nx 1.5 , +and were later ported to +.Fx 4.6 . +.Sh AUTHORS +.An -nosplit +This man page was written by +.An Bruce M. Simpson Aq bms@FreeBSD.org +and +.An Darron Broad Aq darron@kewl.org . +.Sh BUGS +There is no netisr queue specifically for the software 802.11 stack yet. diff --git a/share/man/man9/ieee80211_ioctl.9 b/share/man/man9/ieee80211_ioctl.9 new file mode 100644 index 0000000000..cae6957802 --- /dev/null +++ b/share/man/man9/ieee80211_ioctl.9 @@ -0,0 +1,100 @@ +.\" +.\" Copyright (c) 2004 Bruce M. Simpson +.\" Copyright (c) 2004 Darron Broad +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" $DragonFly: src/share/man/man9/ieee80211_ioctl.9,v 1.1 2004/07/27 14:50:56 hmp Exp $ +.\" $Id: ieee80211_ioctl.9,v 1.2 2004/07/07 12:59:39 ru Exp $ +.\" +.Dd March 2, 2004 +.Dt IEEE80211_IOCTL 9 +.Os +.Sh NAME +.Nm ieee80211_cfgget , ieee80211_cfgset , ieee80211_ioctl +.Nd 802.11 interface ioctl commands +.Sh SYNOPSIS +.In net80211/ieee80211_var.h +.In net80211/ieee80211_proto.h +.In net80211/ieee80211_ioctl.h +.Ft int +.Fn ieee80211_cfgget "struct ifnet *ifp" "u_long cmd" "caddr_t data" +.Ft int +.Fn ieee80211_cfgset "struct ifnet *ifp" "u_long cmd" "caddr_t data" +.Ft int +.Fn ieee80211_ioctl "struct ifnet *ifp" "u_long cmd" "caddr_t data" +.Sh DESCRIPTION +These +functions are typically invoked by drivers in response to requests +for information or to change settings from the userland. +.Pp +.\" +The +.Fn ieee80211_cfgget +and +.Fn ieee80211_cfgset +functions implement a legacy interface for getting and setting 802.11 +interface attributes respectively. +The interface is compatible with the RIDs implemented by the legacy +.Xr owi 4 +driver and used by the +.Xr wicontrol 8 +utility. +.Pp +.\" +The +.Fn ieee80211_ioctl +function provides a default implementation of the +.Dv SIOCS80211 +and +.Dv SIOCG80211 +ifioctls commands for 802.11 drivers. +The call signature is identical to that of the +.Va if_ioctl +member found in +.Vt struct ifnet , +however, many drivers store attributes such as +.Dv IEEE80211_IOC_STATIONNAME +in the driver's private soft state structure, so driver writers may prefer +to use this as the catch-all in a switch statement to avoid code duplication. +.\" +.Sh SEE ALSO +.Xr owi 4 , +.Xr ifconfig 8 , +.Xr wicontrol 8 , +.Xr ieee80211 9 , +.Xr ifnet 9 +.Sh HISTORY +The +.Nm ieee80211 +series of functions first appeared in +.Nx 1.5 , +and were later ported to +.Fx 4.6 . +.Sh AUTHORS +.An -nosplit +This man page was written by +.An Bruce M. Simpson Aq bms@FreeBSD.org +and +.An Darron Broad Aq darron@kewl.org . diff --git a/share/man/man9/ieee80211_node.9 b/share/man/man9/ieee80211_node.9 new file mode 100644 index 0000000000..f40701cffe --- /dev/null +++ b/share/man/man9/ieee80211_node.9 @@ -0,0 +1,294 @@ +.\" +.\" Copyright (c) 2004 Bruce M. Simpson +.\" Copyright (c) 2004 Darron Broad +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" $DragonFly: src/share/man/man9/ieee80211_node.9,v 1.1 2004/07/27 14:50:56 hmp Exp $ +.\" $Id: ieee80211_node.9,v 1.3 2004/07/07 12:59:39 ru Exp $ +.\" +.Dd July 4, 2004 +.Dt IEEE80211_NODE 9 +.Os +.Sh NAME +.Nm ieee80211_node_attach , +.Nm ieee80211_node_lateattach , +.Nm ieee80211_node_detach , +.Nm ieee80211_begin_scan , +.Nm ieee80211_next_scan , +.Nm ieee80211_create_ibss , +.Nm ieee80211_end_scan , +.Nm ieee80211_alloc_node , +.Nm ieee80211_dup_bss , +.Nm ieee80211_find_node , +.Nm ieee80211_lookup_node , +.Nm ieee80211_free_node , +.Nm ieee80211_free_allnodes , +.Nm ieee80211_timeout_nodes , +.Nm ieee80211_iterate_nodes +.Nd software 802.11 stack node management functions +.Sh SYNOPSIS +.In net80211/ieee80211_var.h +.In net80211/ieee80211_proto.h +.In net80211/ieee80211_node.h +.Ft void +.Fn ieee80211_node_attach "struct ifnet *ifp" +.Ft void +.Fn ieee80211_node_lateattach "struct ifnet *ifp" +.Ft void +.Fn ieee80211_node_detach "struct ifnet *ifp" +.Ft void +.Fn ieee80211_begin_scan "struct ifnet *ifp" +.Ft void +.Fn ieee80211_next_scan "struct ifnet *ifp" +.Ft void +.Fo ieee80211_create_ibss +.Fa "struct ieee80211com *ic" "struct ieee80211_channel *chan" +.Fc +.Ft void +.Fn ieee80211_end_scan "struct ifnet *ifp" +.Ft struct ieee80211_node * +.Fn ieee80211_alloc_node "struct ieee80211com *ic" "u_int8_t *macaddr" +.Ft struct ieee80211_node * +.Fn ieee80211_dup_bss "struct ieee80211com *ic" "u_int8_t *macaddr" +.Ft struct ieee80211_node * +.Fn ieee80211_find_node "struct ieee80211com *ic" "u_int8_t *macaddr" +.Ft struct ieee80211_node * +.Fo ieee80211_lookup_node +.Fa "struct ieee80211com *ic" "u_int8_t *macaddr" +.Fa "struct ieee80211_channel *chan" +.Fc +.Ft void +.Fn ieee80211_free_node "struct ieee80211com *ic" "struct ieee80211_node *ni" +.Ft void +.Fn ieee80211_free_allnodes "struct ieee80211com *ic" +.Ft void +.Fn ieee80211_timeout_nodes "struct ieee80211com *ic" +.Ft void +.Fo ieee80211_iterate_nodes +.Fa "struct ieee80211com *ic" "ieee80211_iter_func *f" "void *arg" +.Fc +.Sh DESCRIPTION +These functions are used to manage node lists within the software +802.11 stack. +These lists are typically used for implementing host-mode AP functionality, +or providing signal quality information about neighbouring nodes. +.Pp +.\" +The +.Fn ieee80211_node_attach +function is called from +.Xr ieee80211_ifattach 9 +to initialize node database management callbacks for the interface +.Fa ifp +(specifically for memory allocation, node copying and node +signal inspection). +These functions may be overridden in special circumstances, +as long as this is done after calling +.Xr ieee80211_ifattach 9 +and prior to any other call which may allocate a node. +.Pp +.\" +The +.Fn ieee80211_node_lateattach +function initialises the +.Va ic_bss +node element of the interface +.Fa ifp +during +.Xr ieee80211_media_init 9 . +This late attachment is to account for certain special cases described under +.Fn ieee80211_node_attach . +.Pp +.\" +The +.Fn ieee80211_node_detach +function destroys all node database state associated with the interface +.Fa ifp , +and is usually called during device detach. +.Pp +.\" +The +.Fn ieee80211_begin_scan +function initialises the node database in preparation of an active +scan for an access point on the interface +.Fa ifp . +The scan begins on the next radio channel by calling +.Fn ieee80211_next_scan +internally. +The actual scanning for an access point is not automated; +the device driver itself only handles setting the radio frequency +of the card and stepping through the channels. +.Pp +.\" +The +.Fn ieee80211_next_scan +function is used to inform the +.Xr ieee80211 9 +layer that the interface +.Fa ifp +is now scanning for an access point on the next radio channel. +A device driver is expected to first call +.Fn ieee80211_begin_scan , +to initialize the node database, +then set the radio channel on the device; +then, after a certain time has elapsed (200ms for example), call +.Fn ieee80211_next_scan +to move to the next channel. +Typically, a callout is used to automate this process; see +.Xr callout_init 9 +for more information on how to use callouts. +.Pp +.\" +The +.Fn ieee80211_create_ibss +function sets up the net80211-specific portion of an interface's softc, +.Fa ic , +for use in IBSS mode. +.Pp +.\" +The +.Fn ieee80211_end_scan +function is called by +.Fn ieee80211_next_scan +when the state machine has peformed a full cycle of scanning on +all available radio channels. +Internally, +.Fn ieee80211_end_scan +will inspect the node cache associated with the interface +.Fa ifp +for suitable access points found during scanning, and associate with one, +should the parameters of the node match those of the configuration +requested from userland. +.Pp +.\" +The +.Fn ieee80211_alloc_node +function allocates an instance of +.Vt "struct ieee80211_node" +for a node having the MAC address +.Fa macaddr , +and associates it with the interface +.Fa ic . +If the allocation is successful, the node structure is initialised by +.Fn ieee80211_setup_node ; +otherwise, +.Dv NULL +is returned. +.Pp +.\" +The +.Fn ieee80211_dup_bss +function is similar to +.Fn ieee80211_alloc_node , +but is instead used to create a node database entry for the BSSID +.Fa macaddr +associated with the interface +.Fa ic . +If the allocation is successful, the node structure is initialised by +.Fn ieee80211_setup_node ; +otherwise, +.Dv NULL +is returned. +.Pp +.\" +The +.Fn ieee80211_find_node +function will iterate through the node list associated with the interface +.Fa ic , +searching for a node entry which matches +.Fa macaddr . +If the entry is found, its reference count is incremented, and +a pointer to the node is returned; otherwise, +.Dv NULL +will be returned. +.Pp +.\" +The +.Fn ieee80211_lookup_node +function is similar to +.Fn ieee80211_find_node , +with an additional argument +.Fa chan +which is used to specify a channel for the match. +If the entry is found, its reference count is incremented, and +a pointer to the node is returned; otherwise, +.Dv NULL +will be returned. +.Pp +.\" +The +.Fn ieee80211_free_node +function will remove the node +.Fa ni +from the node database entries associated with the interface +.Fa ic , +and free any memory associated with the node. +This private method can be overridden in +.Fn ieee80211_node_attach . +.\" +.Pp +The +.Fn ieee80211_free_allnodes +function will iterate through the node list calling +.Fn ieee80211_free_node +for all nodes associated with the interface +.Fa ic . +.Pp +.\" +The +.Fn ieee80211_timeout_nodes +checks if the inactivity timer of each node associated with the interface +.Fa ic +has exceeded the pre-defined constant +.Dv IEEE80211_INACT_MAX . +If so, then the node is freed, after sending a deauthentication message. +.Pp +.\" +The +.Fn ieee80211_iterate_nodes +function will call the user-defined callback function +.Fa f +for all nodes in the node database associated with the interface +.Fa ic . +The callback is invoked with the with the user-supplied value +.Fa arg +and a pointer to the current node. +.\" +.Sh SEE ALSO +.Xr ieee80211 9 , +.Xr ifnet 9 +.Sh HISTORY +The +.Nm ieee80211 +series of functions first appeared in +.Nx 1.5 , +and were later ported to +.Fx 4.6 . +.Sh AUTHORS +.An -nosplit +This man page was written by +.An Bruce M. Simpson Aq bms@FreeBSD.org +and +.An Darron Broad Aq darron@kewl.org . diff --git a/share/man/man9/ieee80211_output.9 b/share/man/man9/ieee80211_output.9 new file mode 100644 index 0000000000..406a0db353 --- /dev/null +++ b/share/man/man9/ieee80211_output.9 @@ -0,0 +1,152 @@ +.\" +.\" Copyright (c) 2004 Bruce M. Simpson +.\" Copyright (c) 2004 Darron Broad +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" $DragonFly: src/share/man/man9/ieee80211_output.9,v 1.1 2004/07/27 14:50:56 hmp Exp $ +.\" $Id: ieee80211_output.9,v 1.2 2004/07/07 12:59:39 ru Exp $ +.\" +.Dd March 2, 2004 +.Dt IEEE80211_OUTPUT 9 +.Os +.Sh NAME +.Nm ieee80211_encap , ieee80211_add_rates , +.Nm ieee80211_add_xrates , ieee80211_send_mgmt +.Nd software 802.11 stack output functions +.Sh SYNOPSIS +.In net80211/ieee80211_var.h +.In net80211/ieee80211_proto.h +.Ft struct mbuf * +.Fo ieee80211_encap +.Fa "struct ifnet *ifp" "struct mbuf *m" "struct ieee80211_node **pni" +.Fc +.Ft u_int8_t * +.Fn ieee80211_add_rates "u_int8_t *frm" "const struct ieee80211_rateset *rs" +.Ft u_int8_t * +.Fn ieee80211_add_xrates "u_int8_t *frm" "const struct ieee80211_rateset *rs" +.Ft int +.Fo ieee80211_send_mgmt +.Fa "struct ieee80211com *ic" "struct ieee80211_node *ni" "int type" "int arg" +.Fc +.Sh DESCRIPTION +These functions handle the encapsulation and transmission of 802.11 frames +within the software 802.11 stack. +.Pp +The +.Fn ieee80211_encap +function encapsulates an outbound data frame contained within the +mbuf chain +.Fa m +from the interface +.Fa ifp . +The argument +.Fa *pni +is a reference to the destination node. +.Pp +If the function is successful, the mbuf chain is updated with the +802.11 frame header prepended, and a pointer to the head of the chain +is returned. +If an error occurs, +.Dv NULL +will be returned, and +.Fa *pni +is also set to +.Dv NULL . +The caller is responsible for freeing the node reference if +.Fa *pni +is +.Pf non- Dv NULL +on return. +The convention is that +.Va ic_bss +is not reference counted; the caller is responsible for maintaining this +reference count. +.Pp +.\" +The +.Fn ieee80211_add_rates +utility function is used to add the rate set element +.Fa *rs +to the frame +.Fa frm . +A pointer to the location in the buffer after the addition of the rate set +is returned. +It is typically used when constructing management frames from within the +software 802.11 stack. +.Pp +.\" +The +.Fn ieee80211_add_xrates +utility function is used to add the extended rate set element +.Fa *rs +to the frame +.Fa frm . +A pointer to the location in the buffer after the addition of the rate set +is returned. +It is typically used when constructing management frames from within the +software 802.11 stack in 802.11g mode. +.Pp +.\" +The +.Fn ieee80211_send_mgmt +function transmits a management frame on the interface +.Fa ic +to the destination node +.Fa ni +of type +.Fa type . +.Pp +The argument +.Fa arg +specifies either a sequence number for authentication operations, +a status code for [re]association operations, +or a reason for deauthentication and deassociation operations. +.Pp +Nodes other than +.Va ic_bss +have their reference count incremented to reflect their use for an +indeterminate amount of time. +This reference is freed when the function returns. +.Pp +The function returns 0 if successful; if temporary buffer space is not +available, the function returns +.Er ENOMEM . +.\" +.Sh SEE ALSO +.Xr ieee80211 9 , +.Xr ifnet 9 +.Sh HISTORY +The +.Nm ieee80211 +series of functions first appeared in +.Nx 1.5 , +and were later ported to +.Fx 4.6 . +.Sh AUTHORS +.An -nosplit +This man page was written by +.An Bruce M. Simpson Aq bms@FreeBSD.org +and +.An Darron Broad Aq darron@kewl.org . diff --git a/share/man/man9/ieee80211_proto.9 b/share/man/man9/ieee80211_proto.9 new file mode 100644 index 0000000000..43a6db0f78 --- /dev/null +++ b/share/man/man9/ieee80211_proto.9 @@ -0,0 +1,76 @@ +.\" +.\" Copyright (c) 2004 Bruce M. Simpson +.\" Copyright (c) 2004 Darron Broad +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" $DragonFly: src/share/man/man9/ieee80211_proto.9,v 1.1 2004/07/27 14:50:56 hmp Exp $ +.\" $Id: ieee80211_proto.9,v 1.2 2004/07/07 12:59:39 ru Exp $ +.\" +.Dd March 2, 2004 +.Dt IEEE80211_PROTO 9 +.Os +.Sh NAME +.Nm ieee80211_proto_attach , +.Nm ieee80211_proto_detach , +.Nm ieee80211_print_essid , +.Nm ieee80211_dump_pkt , +.Nm ieee80211_fix_rate , +.Nm ieee80211_proto +.Nd software 802.11 stack protocol helper functions +.Sh SYNOPSIS +.In net80211/ieee80211_var.h +.In net80211/ieee80211_proto.h +.Ft void +.Fn ieee80211_proto_attach "struct ifnet *ifp" +.Ft void +.Fn ieee80211_proto_detach "struct ifnet *ifp" +.Ft void +.Fn ieee80211_print_essid "u_int8_t *essid" "int len" +.Ft void +.Fn ieee80211_dump_pkt "u_int8_t *buf" "int len" "int rate" "int rssi" +.Ft int +.Fo ieee80211_fix_rate +.Fa "struct ieee80211com *ic" "struct ieee80211_node *ni" "int flags" +.Fc +.Sh DESCRIPTION +These +functions are helper functions used throughout the software 802.11 protocol +stack. +.Sh SEE ALSO +.Xr ieee80211 9 , +.Xr ifnet 9 +.Sh HISTORY +The +.Nm ieee80211 +series of functions first appeared in +.Nx 1.5 , +and were later ported to +.Fx 4.6 . +.Sh AUTHORS +.An -nosplit +This man page was written by +.An Bruce M. Simpson Aq bms@FreeBSD.org +and +.An Darron Broad Aq darron@kewl.org . diff --git a/share/man/man9/ieee80211_radiotap.9 b/share/man/man9/ieee80211_radiotap.9 new file mode 100644 index 0000000000..2c983ad22d --- /dev/null +++ b/share/man/man9/ieee80211_radiotap.9 @@ -0,0 +1,236 @@ +.\" +.\" Copyright (c) 2004 Bruce M. Simpson , +.\" Darron Broad , +.\" David Young . +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\: $DragonFly: src/share/man/man9/ieee80211_radiotap.9,v 1.1 2004/07/27 14:50:56 hmp Exp $ +.\" $Id: ieee80211_radiotap.9,v 1.3 2004/07/07 12:59:39 ru Exp $ +.\" +.Dd March 2, 2004 +.Dt IEEE80211_RADIOTAP 9 +.Os +.Sh NAME +.Nm ieee80211_radiotap +.Nd software 802.11 stack packet capture definitions +.Sh SYNOPSIS +.In net80211/ieee80211_var.h +.In net80211/ieee80211_ioctl.h +.In net80211/ieee80211_radiotap.h +.In net/bpf.h +.\" +.Sh DESCRIPTION +The +.Nm +definitions provide a device-independent +.Xr bpf 4 +attachment for the +capture of information about 802.11 traffic which is not part of +the 802.11 frame structure. +.Pp +Radiotap was designed to balance the desire for a capture format +that conserved CPU and memory bandwidth on embedded systems, +with the desire for a hardware-independent, extensible format +that would support the diverse capabilities of virtually all +802.11 +radios. +.Pp +These considerations led radiotap to settle on a format consisting of +a standard preamble followed by an extensible bitmap indicating the +presence of optional capture fields. +.Pp +The capture fields were packed into the header as compactly as possible, +modulo the requirements that they had to be packed swiftly, +with suitable alignment, in the same order as the bits indicating +their presence. +.Pp +This typically includes information such as signal quality and +timestamps. +This information may be used by a variety of user agents, including +.Xr tcpdump 1 . +It is requested by using the +.Xr bpf 4 +data-link type +.Dv DLT_IEEE_80211_RADIO . +.Pp +.\" +Each frame using this attachment has the following header prepended to it: +.Bd -literal -offset indent +struct ieee80211_radiotap_header { + u_int8_t it_version; /* set to 0 */ + u_int8_t it_pad; + u_int16_t it_len; /* entire length */ + u_int32_t it_present; /* fields present */ +} __attribute__((__packed__)); +.Ed +.Pp +.\" +A device driver implementing +.Vt radiotap +typically defines a packed structure embedding an instance of +.Vt "struct ieee80211_radiotap_header" +at the beginning, +with subsequent fields in the appropriate order, +and a macro to set the bits of the +.Va it_present +bitmap to indicate which fields exist and are filled in by the driver. +.\" +.Pp +Radiotap headers are copied to the userland via a separate bpf attachment. +It is necessary for the driver to create this attachment after calling +.Xr ieee80211_ifattach 9 +by calling +.Fn bpfattach2 +with the data-link type set to +.Dv DLT_IEEE_80211_RADIO . +.Pp +.\" +When the the information is available, +usually immediately before a link-layer transmission or after a receive, +the driver copies it to the bpf layer using the +.Fn bpf_mtap2 +function. +.Pp +.\" +The following extension fields are defined for +.Vt radiotap , +in the order in which they should appear in the buffer copied to userland: +.Bl -tag -width indent +.It Dv IEEE80211_RADIOTAP_TSFT +This field contains the unsigned 64-bit value, in microseconds, +of the MAC's 802.11 Time Synchronization Function timer, +when the first bit of the MPDU arrived at the MAC. +This field should be present for received frames only. +.It Dv IEEE80211_RADIOTAP_FLAGS +This field contains a single unsigned 8-bit value, containing a bitmap +of flags specifying properties of the frame being transmitted or received. +.It Dv IEEE80211_RADIOTAP_RATE +This field contains a single unsigned 8-bit value, which is the data rate in +use in units of 500Kbps. +.It Dv IEEE80211_RADIOTAP_CHANNEL +This field contains two unsigned 16-bit values. +The first value is the frequency upon which this PDU was transmitted +or received. +The second value is a bitmap containing flags which specify properties of +the channel in use. +These are documented within the header file, +.Pa net80211/ieee80211_radiotap.h . +.It Dv IEEE80211_RADIOTAP_FHSS +This field contains two 8-bit values. +This field should be present for frequency-hopping radios only. +The first byte is the hop set. +The second byte is the pattern in use. +.It Dv IEEE80211_RADIOTAP_DBM_ANTSIGNAL +This field contains a single signed 8-bit value, which indicates the +RF signal power at the antenna, in decibels difference from 1mW. +.It Dv IEEE80211_RADIOTAP_DBM_ANTNOISE +This field contains a single signed 8-bit value, which indicates the +RF noise power at the antenna, in decibels difference from 1mW. +.It Dv IEEE80211_RADIOTAP_LOCK_QUALITY +This field contains a single unsigned 16-bit value, indicating the +quality of the Barker Code lock. +No unit is specified for this field. +There does not appear to be a standard way of measuring this at this time; +this quantity is often referred to as +.Dq "Signal Quality" +in some datasheets. +.It Dv IEEE80211_RADIOTAP_TX_ATTENUATION +This field contains a single unsigned 16-bit value, expressing transmit +power as unitless distance from maximum power set at factory calibration. +0 indicates maximum transmit power. +Monotonically nondecreasing with lower power levels. +.It Dv IEEE80211_RADIOTAP_DB_TX_ATTENUATION +This field contains a single unsigned 16-bit value, expressing transmit +power as decibel distance from maximum power set at factory calibration. +0 indicates maximum transmit power. +Monotonically nondecreasing with lower power levels. +.It Dv IEEE80211_RADIOTAP_DBM_TX_POWER +Transmit power expressed as decibels from a 1mW reference. +This field is a single signed 8-bit value. +This is the absolute power level measured at the antenna port. +.It Dv IEEE80211_RADIOTAP_ANTENNA +For radios which support antenna diversity, this field contains a single +unsigned 8-bit value specifying which antenna is being used to transmit +or receive this frame. +The first antenna is antenna 0. +.It Dv IEEE80211_RADIOTAP_DB_ANTSIGNAL +This field contains a single unsigned 8-bit value, which indicates the +RF signal power at the antenna, in decibels difference from an +arbitrary, fixed reference. +.It Dv IEEE80211_RADIOTAP_DB_ANTNOISE +This field contains a single unsigned 8-bit value, which indicates the +RF noise power at the antenna, in decibels difference from an +arbitrary, fixed reference. +.It Dv IEEE80211_RADIOTAP_EXT +This bit is reserved for any future extensions to the +.Vt radiotap +structure. +It should not be used at this time. +.El +.Sh EXAMPLES +Radiotap header for the Cisco Aironet driver: +.Bd -literal -offset indent +struct an_rx_radiotap_header { + struct ieee80211_radiotap_header ar_ihdr; + u_int8_t ar_flags; + u_int8_t ar_rate; + u_int16_t ar_chan_freq; + u_int16_t ar_chan_flags; + u_int8_t ar_antsignal; + u_int8_t ar_antnoise; +} __attribute__((__packed__)); +.Ed +.Pp +Bitmap indicating which fields are present in the above structure: +.Bd -literal -offset indent +#define AN_RX_RADIOTAP_PRESENT \\ + ((1 << IEEE80211_RADIOTAP_FLAGS) | \\ + (1 << IEEE80211_RADIOTAP_RATE) | \\ + (1 << IEEE80211_RADIOTAP_CHANNEL) | \\ + (1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL) | \\ + (1 << IEEE80211_RADIOTAP_DBM_ANTNOISE)) +.Ed +.Sh SEE ALSO +.Xr bpf 4 , +.Xr ieee80211 9 +.Sh HISTORY +The +.Nm +definitions first appeared in +.Nx 1.5 , +and were later ported to +.Fx 4.6 . +.\" +.Sh AUTHORS +.An -nosplit +The +.Nm +interface was designed and implemented by +.An David Young Aq dyoung@pobox.com . +.Pp +This manual page was written by +.An Bruce M. Simpson Aq bms@FreeBSD.org +and +.An Darron Broad Aq darron@kewl.org . -- 2.41.0