Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Complete replacement of the old 802.11 layer with the new.



details:   https://anonhg.NetBSD.org/src/rev/d517a22c46f6
branches:  trunk
changeset: 553260:d517a22c46f6
user:      dyoung <dyoung%NetBSD.org@localhost>
date:      Mon Oct 13 08:34:15 2003 +0000

description:
Complete replacement of the old 802.11 layer with the new.

diffstat:

 distrib/sets/lists/comp/mi |     3 +-
 sys/conf/files             |    18 +-
 sys/net/Makefile           |     4 +-
 sys/net/if_ieee80211.h     |   636 -------
 sys/net/if_ieee80211subr.c |  3709 --------------------------------------------
 5 files changed, 19 insertions(+), 4351 deletions(-)

diffs (truncated from 4432 to 300 lines):

diff -r 6a5c4b58a478 -r d517a22c46f6 distrib/sets/lists/comp/mi
--- a/distrib/sets/lists/comp/mi        Mon Oct 13 08:29:48 2003 +0000
+++ b/distrib/sets/lists/comp/mi        Mon Oct 13 08:34:15 2003 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: mi,v 1.630 2003/10/13 07:29:28 dyoung Exp $
+#      $NetBSD: mi,v 1.631 2003/10/13 08:34:15 dyoung Exp $
 ./usr/bin/addr2line            comp-debug-bin
 ./usr/bin/ar                   comp-util-bin
 ./usr/bin/as                   comp-util-bin
@@ -382,7 +382,6 @@
 ./usr/include/net/if_gre.h             comp-c-include
 ./usr/include/net/if_hippi.h           comp-c-include
 ./usr/include/net/if_ieee1394.h                comp-c-include
-./usr/include/net/if_ieee80211.h       comp-c-include
 ./usr/include/net/if_llc.h             comp-c-include
 ./usr/include/net/if_media.h           comp-c-include
 ./usr/include/net/if_ppp.h             comp-c-include
diff -r 6a5c4b58a478 -r d517a22c46f6 sys/conf/files
--- a/sys/conf/files    Mon Oct 13 08:29:48 2003 +0000
+++ b/sys/conf/files    Mon Oct 13 08:34:15 2003 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files,v 1.640 2003/10/10 21:26:38 jdolecek Exp $
+#      $NetBSD: files,v 1.641 2003/10/13 08:34:15 dyoung Exp $
 
 #      @(#)files.newconf       7.5 (Berkeley) 5/10/93
 
@@ -462,6 +462,13 @@
 device wi: arp, wlan, ifnet
 file   dev/ic/wi.c                     wi
 
+# Atheros 5210/5211/5212 multi-mode 802.11
+#
+device ath: arp, wlan, ifnet
+file   dev/ic/ath.c                                    ath
+file   dev/ic/athcompat.c                              ath
+file   ../contrib/sys/dev/ic/athhal_osdep.c            ath
+
 # ADMtek ADM8211 802.11
 #
 device atw: arp, wlan, ifnet, smc93cx6
@@ -1200,7 +1207,6 @@
 file   net/if_gre.c                    gre                     needs-flag
 file   net/if_hippisubr.c              hippi                   needs-flag
 file   net/if_ieee1394subr.c           ieee1394
-file   net/if_ieee80211subr.c          wlan
 file   net/if_loop.c                   loop                    needs-count
 file   net/if_media.c
 file   net/if_ppp.c                    ppp                     needs-count
@@ -1222,6 +1228,14 @@
 file   net/rtsock.c
 file   net/slcompress.c                sl | ppp | strip | (irip & irip_vj)
 file   net/zlib.c                      (ppp & ppp_deflate) | ipsec | opencrypto
+file   net80211/ieee80211.c            wlan
+file   net80211/ieee80211_compat.c     wlan
+file   net80211/ieee80211_crypto.c     wlan
+file   net80211/ieee80211_input.c      wlan
+file   net80211/ieee80211_ioctl.c      wlan
+file   net80211/ieee80211_node.c       wlan
+file   net80211/ieee80211_output.c     wlan
+file   net80211/ieee80211_proto.c      wlan
 file   netinet/if_arp.c                arp | netatalk          needs-flag
 file   netinet/if_atm.c                atm
 file   netinet/in_gif.c                gif & inet
diff -r 6a5c4b58a478 -r d517a22c46f6 sys/net/Makefile
--- a/sys/net/Makefile  Mon Oct 13 08:29:48 2003 +0000
+++ b/sys/net/Makefile  Mon Oct 13 08:34:15 2003 +0000
@@ -1,10 +1,10 @@
-#      $NetBSD: Makefile,v 1.13 2002/11/26 23:30:32 lukem Exp $
+#      $NetBSD: Makefile,v 1.14 2003/10/13 08:34:15 dyoung Exp $
 
 INCSDIR= /usr/include/net
 
 INCS=  bpf.h bpfdesc.h dlt.h ethertypes.h if.h if_arc.h if_arp.h \
        if_atm.h if_bridgevar.h if_dl.h if_ether.h if_fddi.h if_gif.h \
-       if_gre.h if_hippi.h if_ieee1394.h if_ieee80211.h if_llc.h if_media.h \
+       if_gre.h if_hippi.h if_ieee1394.h if_llc.h if_media.h \
        if_ppp.h if_pppvar.h if_pppoe.h if_slvar.h if_sppp.h if_stf.h \
        if_stripvar.h if_token.h if_tun.h if_types.h if_vlanvar.h \
        netisr.h pfil.h pfkeyv2.h ppp-comp.h ppp_defs.h radix.h \
diff -r 6a5c4b58a478 -r d517a22c46f6 sys/net/if_ieee80211.h
--- a/sys/net/if_ieee80211.h    Mon Oct 13 08:29:48 2003 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,636 +0,0 @@
-/*     $NetBSD: if_ieee80211.h,v 1.36 2003/07/06 20:54:24 dyoung Exp $ */
-
-/*-
- * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
- * 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.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed by the NetBSD
- *        Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
- */
-
-#ifndef _NET_IF_IEEE80211_H_
-#define _NET_IF_IEEE80211_H_
-
-#include <net/if_ether.h>
-
-#define        IEEE80211_ADDR_LEN                      ETHER_ADDR_LEN
-
-/* IEEE 802.11 PLCP header */
-struct ieee80211_plcp_hdr {
-       u_int16_t       i_sfd;          /* IEEE80211_PLCP_SFD */
-       u_int8_t        i_signal;       /* MPDU data rate in 100Kb/s */
-       u_int8_t        i_service;      /* IEEE80211_PLCP_SERVICE */
-       u_int16_t       i_length;       /* MPDU duration in microseconds */
-       u_int16_t       i_crc;          /* CRC16 of i_signal, i_service,
-                                        * i_length
-                                        */
-} __attribute__((__packed__));
-
-#define IEEE80211_PLCP_SFD     0xF3A0
-#define IEEE80211_PLCP_SERVICE 0x00
-
-/*
- * generic definitions for IEEE 802.11 frames
- */
-struct ieee80211_frame {
-       u_int8_t        i_fc[2];
-       u_int8_t        i_dur[2];
-       u_int8_t        i_addr1[IEEE80211_ADDR_LEN];
-       u_int8_t        i_addr2[IEEE80211_ADDR_LEN];
-       u_int8_t        i_addr3[IEEE80211_ADDR_LEN];
-       u_int8_t        i_seq[2];
-       /* possibly followed by addr4[IEEE80211_ADDR_LEN]; */
-       /* see below */
-} __attribute__((__packed__));
-
-struct ieee80211_frame_addr4 {
-       u_int8_t        i_fc[2];
-       u_int8_t        i_dur[2];
-       u_int8_t        i_addr1[IEEE80211_ADDR_LEN];
-       u_int8_t        i_addr2[IEEE80211_ADDR_LEN];
-       u_int8_t        i_addr3[IEEE80211_ADDR_LEN];
-       u_int8_t        i_seq[2];
-       u_int8_t        i_addr4[IEEE80211_ADDR_LEN];
-} __attribute__((__packed__));
-
-#define        IEEE80211_FC0_VERSION_MASK              0x03
-#define        IEEE80211_FC0_VERSION_SHIFT             0
-#define        IEEE80211_FC0_VERSION_0                 0x00
-#define        IEEE80211_FC0_TYPE_MASK                 0x0c
-#define        IEEE80211_FC0_TYPE_SHIFT                2
-#define        IEEE80211_FC0_TYPE_MGT                  0x00
-#define        IEEE80211_FC0_TYPE_CTL                  0x04
-#define        IEEE80211_FC0_TYPE_DATA                 0x08
-
-#define        IEEE80211_FC0_SUBTYPE_MASK              0xf0
-#define        IEEE80211_FC0_SUBTYPE_SHIFT             4
-/* for TYPE_MGT */
-#define        IEEE80211_FC0_SUBTYPE_ASSOC_REQ         0x00
-#define        IEEE80211_FC0_SUBTYPE_ASSOC_RESP        0x10
-#define        IEEE80211_FC0_SUBTYPE_REASSOC_REQ       0x20
-#define        IEEE80211_FC0_SUBTYPE_REASSOC_RESP      0x30
-#define        IEEE80211_FC0_SUBTYPE_PROBE_REQ         0x40
-#define        IEEE80211_FC0_SUBTYPE_PROBE_RESP        0x50
-#define        IEEE80211_FC0_SUBTYPE_BEACON            0x80
-#define        IEEE80211_FC0_SUBTYPE_ATIM              0x90
-#define        IEEE80211_FC0_SUBTYPE_DISASSOC          0xa0
-#define        IEEE80211_FC0_SUBTYPE_AUTH              0xb0
-#define        IEEE80211_FC0_SUBTYPE_DEAUTH            0xc0
-/* for TYPE_CTL */
-#define        IEEE80211_FC0_SUBTYPE_PS_POLL           0xa0
-#define        IEEE80211_FC0_SUBTYPE_RTS               0xb0
-#define        IEEE80211_FC0_SUBTYPE_CTS               0xc0
-#define        IEEE80211_FC0_SUBTYPE_ACK               0xd0
-#define        IEEE80211_FC0_SUBTYPE_CF_END            0xe0
-#define        IEEE80211_FC0_SUBTYPE_CF_END_ACK        0xf0
-/* for TYPE_DATA (bit combination) */
-#define        IEEE80211_FC0_SUBTYPE_DATA              0x00
-#define        IEEE80211_FC0_SUBTYPE_CF_ACK            0x10
-#define        IEEE80211_FC0_SUBTYPE_CF_POLL           0x20
-#define        IEEE80211_FC0_SUBTYPE_CF_ACPL           0x30
-#define        IEEE80211_FC0_SUBTYPE_NODATA            0x40
-#define        IEEE80211_FC0_SUBTYPE_CFACK             0x50
-#define        IEEE80211_FC0_SUBTYPE_CFPOLL            0x60
-#define        IEEE80211_FC0_SUBTYPE_CF_ACK_CF_POLL    0x70
-
-#define        IEEE80211_FC1_DIR_MASK                  0x03
-#define        IEEE80211_FC1_DIR_NODS                  0x00    /* STA->STA */
-#define        IEEE80211_FC1_DIR_TODS                  0x01    /* STA->AP  */
-#define        IEEE80211_FC1_DIR_FROMDS                0x02    /* AP ->STA */
-#define        IEEE80211_FC1_DIR_DSTODS                0x03    /* AP ->AP  */
-
-#define        IEEE80211_FC1_MORE_FRAG                 0x04
-#define        IEEE80211_FC1_RETRY                     0x08
-#define        IEEE80211_FC1_PWR_MGT                   0x10
-#define        IEEE80211_FC1_MORE_DATA                 0x20
-#define        IEEE80211_FC1_WEP                       0x40
-#define        IEEE80211_FC1_ORDER                     0x80
-
-#define        IEEE80211_SEQ_FRAG_MASK                 0x000f
-#define        IEEE80211_SEQ_FRAG_SHIFT                0
-#define        IEEE80211_SEQ_SEQ_MASK                  0xfff0
-#define        IEEE80211_SEQ_SEQ_SHIFT                 4
-
-#define        IEEE80211_NWID_LEN                      32
-
-/*
- * BEACON management packets
- *
- *     octet timestamp[8]
- *     octet beacon interval[2]
- *     octet capability information[2]
- *     information element
- *             octet elemid
- *             octet length
- *             octet information[length]
- */
-
-typedef uint8_t *ieee80211_mgt_beacon_t;
-
-#define        IEEE80211_BEACON_INTERVAL(beacon) \
-       ((beacon)[8] | ((beacon)[9] << 8))
-#define        IEEE80211_BEACON_CAPABILITY(beacon) \
-       ((beacon)[10] | ((beacon)[11] << 8))
-
-#define        IEEE80211_CAPINFO_ESS                   0x0001
-#define        IEEE80211_CAPINFO_IBSS                  0x0002
-#define        IEEE80211_CAPINFO_CF_POLLABLE           0x0004
-#define        IEEE80211_CAPINFO_CF_POLLREQ            0x0008
-#define        IEEE80211_CAPINFO_PRIVACY               0x0010
-#define        IEEE80211_CAPINFO_SHORT_PREAMBLE        0x0020
-#define        IEEE80211_CAPINFO_PBCC                  0x0040
-#define        IEEE80211_CAPINFO_CHNL_AGILITY          0x0080
-
-#define        IEEE80211_RATE_BASIC                    0x80
-#define        IEEE80211_RATE_VAL                      0x7f
-
-/* One Time Unit (TU) is 1Kus = 1024 microseconds. */
-#define IEEE80211_DUR_TU               1024
-
-/* IEEE 802.11b durations for DSSS PHY in microseconds */
-#define IEEE80211_DUR_DS_LONG_PREAMBLE 144
-#define IEEE80211_DUR_DS_SHORT_PREAMBLE        72
-#define IEEE80211_DUR_DS_FAST_PLCPHDR  24
-#define IEEE80211_DUR_DS_SLOW_PLCPHDR  48
-#define IEEE80211_DUR_DS_SLOW_ACK      112
-#define IEEE80211_DUR_DS_FAST_ACK      56
-#define IEEE80211_DUR_DS_SLOW_CTS      112
-#define IEEE80211_DUR_DS_FAST_CTS      56
-#define IEEE80211_DUR_DS_SLOT          20
-#define IEEE80211_DUR_DS_SIFS          10
-#define IEEE80211_DUR_DS_PIFS  (IEEE80211_DUR_DS_SIFS + IEEE80211_DUR_DS_SLOT)
-#define IEEE80211_DUR_DS_DIFS  (IEEE80211_DUR_DS_SIFS + \
-                                2 * IEEE80211_DUR_DS_SLOT)
-#define IEEE80211_DUR_DS_EIFS  (IEEE80211_DUR_DS_SIFS + \
-                                IEEE80211_DUR_DS_SLOW_ACK + \
-                                IEEE80211_DUR_DS_LONG_PREAMBLE + \
-                                IEEE80211_DUR_DS_SLOW_PLCPHDR + \
-                                IEEE80211_DUR_DIFS)
-
-/*
- * Management information elements
- */
-
-struct ieee80211_information {
-       char    ssid[IEEE80211_NWID_LEN+1];
-       struct rates {
-               u_int8_t        *p;
-       } rates;
-       struct fh {
-               u_int16_t       dwell;
-               u_int8_t        set;
-               u_int8_t        pattern;
-               u_int8_t        index;
-       } fh;
-       struct ds {
-               u_int8_t        channel;
-       } ds;
-       struct cf {
-               u_int8_t        count;
-               u_int8_t        period;
-               u_int8_t        maxdur[2];
-               u_int8_t        dur[2];



Home | Main Index | Thread Index | Old Index