Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev cleanup headers: remove duplicate definition, split ...
details: https://anonhg.NetBSD.org/src/rev/5d2627accd55
branches: trunk
changeset: 500441:5d2627accd55
user: onoe <onoe%NetBSD.org@localhost>
date: Tue Dec 12 05:11:15 2000 +0000
description:
cleanup headers: remove duplicate definition, split reg.h/var.h.
diffstat:
sys/dev/ic/an.c | 8 +-
sys/dev/ic/anreg.h | 121 +--------
sys/dev/ic/anvar.h | 553 +++++------------------------------------
sys/dev/pcmcia/if_an_pcmcia.c | 4 +-
4 files changed, 88 insertions(+), 598 deletions(-)
diffs (truncated from 818 to 300 lines):
diff -r 65a372e7bef6 -r 5d2627accd55 sys/dev/ic/an.c
--- a/sys/dev/ic/an.c Tue Dec 12 04:08:40 2000 +0000
+++ b/sys/dev/ic/an.c Tue Dec 12 05:11:15 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: an.c,v 1.3 2000/12/12 01:32:34 thorpej Exp $ */
+/* $NetBSD: an.c,v 1.4 2000/12/12 05:11:15 onoe Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
* Bill Paul <wpaul%ctr.columbia.edu@localhost>. All rights reserved.
@@ -132,8 +132,8 @@
#include <net/bpf.h>
#endif
+#include <dev/ic/anreg.h>
#include <dev/ic/anvar.h>
-#include <dev/ic/anreg.h>
#if !defined(lint)
static const char rcsid[] =
@@ -886,7 +886,7 @@
sp = (struct an_ltv_gen *)areq;
sc->an_tx_rate = sp->an_val;
break;
- case AN_RID_WEP_TEMP:
+ case AN_RID_WEP_VOLATILE:
/* Disable the MAC. */
an_cmd(sc, AN_CMD_DISABLE, 0);
@@ -897,7 +897,7 @@
an_cmd(sc, AN_CMD_ENABLE, 0);
break;
- case AN_RID_WEP_PERM:
+ case AN_RID_WEP_PERSISTENT:
/* Disable the MAC. */
an_cmd(sc, AN_CMD_DISABLE, 0);
diff -r 65a372e7bef6 -r 5d2627accd55 sys/dev/ic/anreg.h
--- a/sys/dev/ic/anreg.h Tue Dec 12 04:08:40 2000 +0000
+++ b/sys/dev/ic/anreg.h Tue Dec 12 05:11:15 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: anreg.h,v 1.2 2000/12/11 23:58:55 onoe Exp $ */
+/* $NetBSD: anreg.h,v 1.3 2000/12/12 05:11:15 onoe Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
* Bill Paul <wpaul%ctr.columbia.edu@localhost>. All rights reserved.
@@ -33,30 +33,8 @@
* $FreeBSD: src/sys/dev/an/if_anreg.h,v 1.3 2000/11/13 23:04:12 wpaul Exp $
*/
-#define AN_TIMEOUT 65536
-
-/* Default network name: ANY */
-#define AN_DEFAULT_NETNAME ""
-
-/* The nodename must be less than 16 bytes */
-#define AN_DEFAULT_NODENAME "NetBSD"
-
-#define AN_DEFAULT_IBSS "NetBSD IBSS"
-
-/*
- * register space access macros
- */
-#define CSR_WRITE_2(sc, reg, val) \
- bus_space_write_2(sc->an_btag, sc->an_bhandle, reg, val)
-
-#define CSR_READ_2(sc, reg) \
- bus_space_read_2(sc->an_btag, sc->an_bhandle, reg)
-
-#define CSR_WRITE_1(sc, reg, val) \
- bus_space_write_1(sc->an_btag, sc->an_bhandle, reg, val)
-
-#define CSR_READ_1(sc, reg) \
- bus_space_read_1(sc->an_btag, sc->an_bhandle, reg)
+#ifndef _DEV_IC_ANREG_H
+#define _DEV_IC_ANREG_H
/*
* Size of Aironet I/O space.
@@ -322,6 +300,7 @@
#define AN_AUTHTYPE_OPEN 0x0001
#define AN_AUTHTYPE_SHAREDKEY 0x0002
#define AN_AUTHTYPE_EXCLUDE_UNENCRYPTED 0x0004
+#define AN_AUTHTYPE_MASK 0x00ff
#define AN_PSAVE_NONE 0x0000
#define AN_PSAVE_CAM 0x0001
@@ -420,9 +399,6 @@
#define AN_TXENCAP_RFC1024 0x0000
#define AN_TXENCAP_80211 0x0002
-#define AN_RID_WEP_TEMP 0xFF15
-#define AN_RID_WEP_PERM 0xFF16
-
/*
* Actual config, same structure as general config (read only).
*/
@@ -735,7 +711,6 @@
};
#define AN_RXGAP_MAX 8
-
struct an_txframe_802_3 {
/*
* Transmit 802.3 header structure.
@@ -777,79 +752,6 @@
(AN_TXCTL_TXOK_INTR|AN_TXCTL_TXERR_INTR|AN_HEADERTYPE_8023| \
AN_PAYLOADTYPE_ETHER|AN_TXCTL_NORELEASE)
-#define AN_TXGAP_80211 0
-#define AN_TXGAP_8023 0
-
-struct an_802_3_hdr {
- u_int16_t an_8023_status;
- u_int16_t an_8023_payload_len;
- u_int8_t an_8023_dst_addr[6];
- u_int8_t an_8023_src_addr[6];
- u_int16_t an_8023_dat[3]; /* SNAP header */
- u_int16_t an_8023_type;
-};
-
-struct an_snap_hdr {
- u_int16_t an_snap_dat[3]; /* SNAP header */
- u_int16_t an_snap_type;
-};
-
-#define AN_TX_RING_CNT 4
-#define AN_INC(x, y) (x) = (x + 1) % y
-
-struct an_tx_ring_data {
- u_int16_t an_tx_fids[AN_TX_RING_CNT];
- u_int16_t an_tx_ring[AN_TX_RING_CNT];
- int an_tx_prod;
- int an_tx_cons;
-};
-
-struct an_softc {
- struct device an_dev;
- struct ethercom arpcom;
- int (*sc_enable) __P((struct an_softc *));
- void (*sc_disable) __P((struct an_softc *));
- int sc_enabled;
- struct ifmedia sc_media;
-
- void* irq_handle; /* handle for irq handler */
-
- bus_space_handle_t an_bhandle;
- bus_space_tag_t an_btag;
- struct an_ltv_genconfig an_config;
- struct an_ltv_caps an_caps;
- struct an_ltv_ssidlist an_ssidlist;
- struct an_ltv_aplist an_aplist;
- struct an_ltv_key an_temp_keys;
- struct an_ltv_key an_perm_keys;
- int an_tx_rate;
- int an_rxmode;
- int an_if_flags;
- u_int8_t an_txbuf[1536];
- struct an_tx_ring_data an_rdata;
- struct an_ltv_stats an_stats;
- struct an_ltv_status an_status;
- u_int8_t an_associated;
-#ifdef ANCACHE
- int an_sigitems;
- struct an_sigcache an_sigcache[MAXANCACHE];
- int an_nextitem;
-#endif
- struct callout an_stat_ch;
-};
-
-void an_release_resources __P((struct device *));
-int an_alloc_port __P((struct device *, int, int));
-int an_alloc_memory __P((struct device *, int, int));
-int an_alloc_irq __P((struct device *, int, int));
-int an_probe __P((struct an_softc *));
-void an_shutdown __P((struct device *));
-int an_attach __P((struct an_softc *));
-int an_detach __P((struct an_softc *));
-int an_intr __P((void *));
-int an_activate __P((struct device *, enum devact));
-
-
#define AN_802_3_OFFSET 0x2E
#define AN_802_11_OFFSET 0x44
#define AN_802_11_OFFSET_RAW 0x3C
@@ -873,17 +775,4 @@
#define AN_TXCNTL_MACPORT 0x00FF
#define AN_TXCNTL_STRUCTTYPE 0xFF00
-/*
- * SNAP (sub-network access protocol) constants for transmission
- * of IP datagrams over IEEE 802 networks, taken from RFC1042.
- * We need these for the LLC/SNAP header fields in the TX/RX frame
- * structure.
- */
-#define AN_SNAP_K1 0xaa /* assigned global SAP for SNAP */
-#define AN_SNAP_K2 0x00
-#define AN_SNAP_CONTROL 0x03 /* unnumbered information format */
-#define AN_SNAP_WORD0 (AN_SNAP_K1 | (AN_SNAP_K1 << 8))
-#define AN_SNAP_WORD1 (AN_SNAP_K2 | (AN_SNAP_CONTROL << 8))
-#define AN_SNAPHDR_LEN 0x6
-
-
+#endif /* _DEV_IC_ANREG_H */
diff -r 65a372e7bef6 -r 5d2627accd55 sys/dev/ic/anvar.h
--- a/sys/dev/ic/anvar.h Tue Dec 12 04:08:40 2000 +0000
+++ b/sys/dev/ic/anvar.h Tue Dec 12 05:11:15 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: anvar.h,v 1.1 2000/12/11 23:16:50 onoe Exp $ */
+/* $NetBSD: anvar.h,v 1.2 2000/12/12 05:11:15 onoe Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
* Bill Paul <wpaul%ctr.columbia.edu@localhost>. All rights reserved.
@@ -33,8 +33,8 @@
* $FreeBSD: src/sys/dev/an/if_aironet_ieee.h,v 1.2 2000/11/13 23:04:12 wpaul Exp $
*/
-#ifndef _IF_AIRONET_IEEE_H
-#define _IF_AIRONET_IEEE_H
+#ifndef _DEV_IC_ANVAR_H
+#define _DEV_IC_ANVAR_H
/*
* This header defines a simple command interface to the FreeBSD
@@ -52,11 +52,30 @@
#define SIOCGAIRONET SIOCGIFGENERIC
#endif
+#define AN_TIMEOUT 65536
+
+/* Default network name: ANY */
+#define AN_DEFAULT_NETNAME ""
+
+/* The nodename must be less than 16 bytes */
+#define AN_DEFAULT_NODENAME "NetBSD"
+
+#define AN_DEFAULT_IBSS "NetBSD IBSS"
+
/*
- * This is a make-predend RID value used only by the driver
- * to allow the user to set the speed.
+ * register space access macros
*/
-#define AN_RID_TX_SPEED 0x1234
+#define CSR_WRITE_2(sc, reg, val) \
+ bus_space_write_2(sc->an_btag, sc->an_bhandle, reg, val)
+
+#define CSR_READ_2(sc, reg) \
+ bus_space_read_2(sc->an_btag, sc->an_bhandle, reg)
+
+#define CSR_WRITE_1(sc, reg, val) \
+ bus_space_write_1(sc->an_btag, sc->an_bhandle, reg, val)
+
+#define CSR_READ_1(sc, reg) \
+ bus_space_read_1(sc->an_btag, sc->an_bhandle, reg)
/*
* Technically I don't think there's a limit to a record
@@ -83,53 +102,7 @@
#define AN_RID_ZERO_CACHE 0x0300
#define AN_RID_READ_CACHE 0x0400
#endif
-
-struct an_80211_hdr {
- u_int16_t frame_ctl;
- u_int16_t dur_id;
- u_int8_t addr1[6];
- u_int8_t addr2[6];
- u_int8_t addr3[6];
- u_int16_t seq_ctl;
- u_int8_t addr4[6];
-};
-
-#define AN_FCTL_VERS 0x0002
-#define AN_FCTL_FTYPE 0x000C
-#define AN_FCTL_STYPE 0x00F0
-#define AN_FCTL_TODS 0x0100
-#define AN_FCTL_FROMDS 0x0200
-#define AN_FCTL_MOREFRAGS 0x0400
-#define AN_FCTL_RETRY 0x0800
-#define AN_FCTL_PM 0x1000
-#define AN_FCTL_MOREDATA 0x2000
-#define AN_FCTL_WEP 0x4000
-#define AN_FCTL_ORDER 0x8000
-
-#define AN_FTYPE_MGMT 0x0000
-#define AN_FTYPE_CTL 0x0004
-#define AN_FTYPE_DATA 0x0008
-
-#define AN_STYPE_MGMT_ASREQ 0x0000 /* association request */
-#define AN_STYPE_MGMT_ASRESP 0x0010 /* association response */
-#define AN_STYPE_MGMT_REASREQ 0x0020 /* reassociation request */
-#define AN_STYPE_MGMT_REASRESP 0x0030 /* reassociation response */
-#define AN_STYPE_MGMT_PROBEREQ 0x0040 /* probe request */
-#define AN_STYPE_MGMT_PROBERESP 0x0050 /* probe response */
-#define AN_STYPE_MGMT_BEACON 0x0080 /* beacon */
-#define AN_STYPE_MGMT_ATIM 0x0090 /* announcement traffic ind msg */
-#define AN_STYPE_MGMT_DISAS 0x00A0 /* disassociation */
-#define AN_STYPE_MGMT_AUTH 0x00B0 /* authentication */
-#define AN_STYPE_MGMT_DEAUTH 0x00C0 /* deauthentication */
Home |
Main Index |
Thread Index |
Old Index