summaryrefslogtreecommitdiff
path: root/sys/dev/usb
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2004-12-05 01:51:21 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2004-12-05 01:51:21 +0000
commite8115bde67eded09230b2d52bf3086351b532837 (patch)
treeb94c19e5e1c9f23d61f3a378304c815102a79be3 /sys/dev/usb
parent1d59e1ba8b4ebd26d2fc3ffcf18d58f62ea946b1 (diff)
clean up some more of the old state machine
Diffstat (limited to 'sys/dev/usb')
-rw-r--r--sys/dev/usb/if_atu.c22
-rw-r--r--sys/dev/usb/if_atureg.h53
2 files changed, 4 insertions, 71 deletions
diff --git a/sys/dev/usb/if_atu.c b/sys/dev/usb/if_atu.c
index fa0f0e741f4..6e750f183aa 100644
--- a/sys/dev/usb/if_atu.c
+++ b/sys/dev/usb/if_atu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_atu.c,v 1.33 2004/12/05 01:38:35 dlg Exp $ */
+/* $OpenBSD: if_atu.c,v 1.34 2004/12/05 01:51:20 dlg Exp $ */
/*
* Copyright (c) 2003, 2004
* Daan Vreeken <Danovitsch@Vitsch.net>. All rights reserved.
@@ -1289,7 +1289,6 @@ USB_ATTACH(atu)
sc->atu_encrypt = ATU_WEP_OFF;
sc->atu_wepkeylen = ATU_WEP_104BITS;
sc->atu_wepkey = 0;
- sc->atu_mgmt_flags = 0;
bzero(sc->atu_bssid, ETHER_ADDR_LEN);
sc->atu_ssidlen = strlen(ATU_DEFAULT_SSID);
@@ -1301,7 +1300,6 @@ USB_ATTACH(atu)
/* Initialise transfer lists */
SLIST_INIT(&sc->atu_cdata.atu_tx_free);
- SLIST_INIT(&sc->atu_cdata.atu_mgmt_free);
ic->ic_softc = sc;
ic->ic_phytype = IEEE80211_T_DS;
@@ -1941,13 +1939,6 @@ atu_init(struct ifnet *ifp)
printf("%s: rx list init failed\n", USBDEVNAME(sc->atu_dev));
}
- /* Init mgmt ring */
- if (atu_xfer_list_init(sc, cd->atu_mgmt_chain,
- ATU_MGMT_LIST_CNT, 0, ATU_MGMT_BUFSZ, &cd->atu_mgmt_free)) {
- DPRINTF(("%s: rx list init failed\n",
- USBDEVNAME(sc->atu_dev)));
- }
-
/* Load the multicast filter. */
/*atu_setmulti(sc); */
@@ -2003,8 +1994,6 @@ atu_init(struct ifnet *ifp)
sc->atu_rxfilt |= ATU_RXFILT_PROMISC;
*/
- sc->atu_mgmt_flags |= ATU_CHANGED_SETTINGS;
-
ifp->if_flags |= IFF_RUNNING;
ifp->if_flags &= ~IFF_OACTIVE;
splx(s);
@@ -2285,14 +2274,6 @@ atu_watchdog(struct ifnet *ifp)
atu_txeof(c->atu_xfer, c, stat);
}
}
- for (cnt = 0; cnt < ATU_MGMT_LIST_CNT; cnt++) {
- c = &sc->atu_cdata.atu_mgmt_chain[cnt];
- if (c->atu_in_xfer) {
- usbd_get_xfer_status(c->atu_xfer, NULL, NULL, NULL,
- &stat);
- atu_txeof(c->atu_xfer, c, stat);
- }
- }
if (ifp->if_snd.ifq_head != NULL)
atu_start(ifp);
@@ -2347,7 +2328,6 @@ atu_stop(struct ifnet *ifp, int disable)
cd = &sc->atu_cdata;
atu_xfer_list_free(sc, cd->atu_rx_chain, ATU_RX_LIST_CNT);
atu_xfer_list_free(sc, cd->atu_tx_chain, ATU_TX_LIST_CNT);
- atu_xfer_list_free(sc, cd->atu_mgmt_chain, ATU_MGMT_LIST_CNT);
/* Let's be nice and turn off the radio before we leave */
atu_switch_radio(sc, 0);
diff --git a/sys/dev/usb/if_atureg.h b/sys/dev/usb/if_atureg.h
index cbc36db3c0e..ce2b5c8fcca 100644
--- a/sys/dev/usb/if_atureg.h
+++ b/sys/dev/usb/if_atureg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_atureg.h,v 1.13 2004/12/05 00:16:14 dlg Exp $ */
+/* $OpenBSD: if_atureg.h,v 1.14 2004/12/05 01:51:20 dlg Exp $ */
/*
* Copyright (c) 2003
* Daan Vreeken <Danovitsch@Vitsch.net>. All rights reserved.
@@ -32,7 +32,7 @@
*
*/
-/* $ATUWI: $Id: if_atureg.h,v 1.13 2004/12/05 00:16:14 dlg Exp $ */
+/* $ATUWI: $Id: if_atureg.h,v 1.14 2004/12/05 01:51:20 dlg Exp $ */
/************ driver options ************/
@@ -87,9 +87,6 @@
*/
#define ATU_TX_LIST_CNT 8
-/* number of simultaniously MGMT TX transfers (always 1, don't change) */
-#define ATU_MGMT_LIST_CNT 1
-
/*
* Normally, when a packet arrives at the driver (with a call to atu_start)
* we start up a USB transfer and transfer the packet to the adapter. Then
@@ -170,7 +167,6 @@
/* BE CAREFULL! should add ATU_TX_PADDING */
#define ATU_TX_BUFSZ (ATU_TX_HDRLEN + \
sizeof(struct ieee80211_frame_addr4) + 2312)
-#define ATU_MGMT_BUFSZ (ATU_TX_HDRLEN + 300)
#define ATU_MIN_FRAMELEN 60
@@ -241,12 +237,10 @@ struct atu_chain {
struct atu_cdata {
struct atu_chain atu_tx_chain[ATU_TX_LIST_CNT];
struct atu_chain atu_rx_chain[ATU_RX_LIST_CNT];
- struct atu_chain atu_mgmt_chain[ATU_MGMT_LIST_CNT];
SLIST_HEAD(atu_list_head, atu_chain) atu_rx_free;
struct atu_list_head atu_tx_free;
- struct atu_list_head atu_mgmt_free;
-
+
u_int8_t atu_tx_inuse;
u_int8_t atu_tx_last_idx;
};
@@ -256,34 +250,6 @@ struct atu_cdata {
#define ATU_AVG_TIME 20
-
-enum atu_mgmt_state {
- STATE_NONE = 0,
- STATE_LISTENING,
- STATE_JOINING,
-
- STATE_AUTHENTICATING, /* infra mode */
- STATE_ASSOCIATING,
-
- STATE_CREATING_IBSS, /* adhoc mode */
-
- STATE_HAPPY_NETWORKING,
- STATE_GIVEN_UP
-};
-
-#ifdef ATU_DEBUG
-u_int8_t *atu_mgmt_statename[] = {"NONE", "LISTENING", "JOINING",
- "AUTHENTICATING", "ASSOCIATING", "CREATING IBSS", "HAPPY NETWORKING :)",
- "GIVEN UP"};
-#endif /* ATU_DEBUG */
-
-struct atu_mgmt {
- enum atu_mgmt_state state;
- int retry;
-};
-
-
-
struct atu_softc {
USBBASEDEVICE atu_dev;
@@ -336,19 +302,6 @@ struct atu_softc {
int atu_wepkey;
int atu_wepkeylen;
u_int8_t atu_wepkeys[4][13];
-
- struct proc *atu_mgmt_thread;
- struct atu_mgmt atu_mgmt_vars;
- u_int16_t atu_mgmt_flags;
-#define ATU_TASK_RUNNING 0x01
-#define ATU_CHANGED_SETTINGS 0x02
-#define ATU_SEARCHING 0x04
-#define ATU_FOUND_BSSID 0x08
-#define ATU_AUTH_OK 0x10
-#define ATU_RE_AUTH 0x20
-#define ATU_ASSOC_OK 0x40
-#define ATU_RE_ASSOC 0x80
-#define ATU_NETWORK_OK 0x100
};