diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2004-11-23 02:40:35 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2004-11-23 02:40:35 +0000 |
commit | f7f6f0393c7de83daab692be2bac07a08c00d83a (patch) | |
tree | c80ad9208de08ccaf477be12686e67551eb81192 /sys/dev/usb | |
parent | ba067a5cf8c2c6a7cf5fcac2ebe46e5898182123 (diff) |
use ieee80211com to store the mac
Diffstat (limited to 'sys/dev/usb')
-rw-r--r-- | sys/dev/usb/if_atu.c | 23 | ||||
-rw-r--r-- | sys/dev/usb/if_atureg.h | 5 |
2 files changed, 14 insertions, 14 deletions
diff --git a/sys/dev/usb/if_atu.c b/sys/dev/usb/if_atu.c index 7a4e9374d29..43dec93d31a 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.25 2004/11/22 22:52:44 dlg Exp $ */ +/* $OpenBSD: if_atu.c,v 1.26 2004/11/23 02:40:34 dlg Exp $ */ /* * Copyright (c) 2003, 2004 * Daan Vreeken <Danovitsch@Vitsch.net>. All rights reserved. @@ -554,6 +554,7 @@ atu_switch_radio(struct atu_softc *sc, int state) int atu_initial_config(struct atu_softc *sc) { + struct ieee80211com *ic = &sc->sc_ic; usbd_status err; /* u_int8_t rates[4] = {0x82, 0x84, 0x8B, 0x96};*/ u_int8_t rates[4] = {0x82, 0x04, 0x0B, 0x16}; @@ -561,7 +562,7 @@ atu_initial_config(struct atu_softc *sc) u_int8_t reg_domain; DPRINTFN(10, ("%s: sending mac-addr\n", USBDEVNAME(sc->atu_dev))); - err = atu_send_mib(sc, MIB_MAC_ADDR__ADDR, sc->atu_mac_addr); + err = atu_send_mib(sc, MIB_MAC_ADDR__ADDR, ic->ic_myaddr); if (err) { DPRINTF(("%s: error setting mac-addr\n", USBDEVNAME(sc->atu_dev))); @@ -771,7 +772,8 @@ int atu_send_mgmt_packet(struct atu_softc *sc, struct atu_chain *c, u_int16_t length) { - struct atu_mgmt_packet *packet; + struct ieee80211com *ic = &sc->sc_ic; + struct atu_mgmt_packet *packet; packet = (struct atu_mgmt_packet *)c->atu_buf; @@ -782,7 +784,7 @@ atu_send_mgmt_packet(struct atu_softc *sc, struct atu_chain *c, packet->mgmt_hdr.duration = 0x8000; memcpy(packet->mgmt_hdr.dst_addr, sc->atu_bssid, ETHER_ADDR_LEN); - memcpy(packet->mgmt_hdr.src_addr, sc->atu_mac_addr, ETHER_ADDR_LEN); + memcpy(packet->mgmt_hdr.src_addr, ic->ic_myaddr, IEEE80211_ADDR_LEN); memcpy(packet->mgmt_hdr.bssid, sc->atu_bssid, ETHER_ADDR_LEN); packet->mgmt_hdr.seq_ctl = 0; @@ -1220,6 +1222,7 @@ atu_upload_external_firmware(struct atu_softc *sc) int atu_get_card_config(struct atu_softc *sc) { + struct ieee80211com *ic = &sc->sc_ic; struct atu_rfmd_conf rfmd_conf; struct atu_intersil_conf intersil_conf; int err; @@ -1237,7 +1240,7 @@ atu_get_card_config(struct atu_softc *sc) USBDEVNAME(sc->atu_dev))); return err; } - memcpy(sc->atu_mac_addr, rfmd_conf.MACAddr, ETHER_ADDR_LEN); + memcpy(ic->ic_myaddr, rfmd_conf.MACAddr, IEEE80211_ADDR_LEN); break; case RadioIntersil: @@ -1249,8 +1252,8 @@ atu_get_card_config(struct atu_softc *sc) USBDEVNAME(sc->atu_dev))); return err; } - memcpy(sc->atu_mac_addr, intersil_conf.MACAddr, - ETHER_ADDR_LEN); + memcpy(ic->ic_myaddr, intersil_conf.MACAddr, + IEEE80211_ADDR_LEN); break; } return 0; @@ -1687,7 +1690,7 @@ USB_ATTACH(atu) /* Show the world our MAC address */ printf("%s: address %s\n", USBDEVNAME(sc->atu_dev), - ether_sprintf(sc->atu_mac_addr)); + ether_sprintf(ic->ic_myaddr)); for (i=0; i<ATU_AVG_TIME; i++) sc->atu_signalarr[i] = 0; @@ -1716,7 +1719,6 @@ USB_ATTACH(atu) ic->ic_opmode = IEEE80211_M_STA; ic->ic_state = IEEE80211_S_INIT; ic->ic_caps = IEEE80211_C_IBSS | IEEE80211_C_PMGT | IEEE80211_C_WEP; - bcopy(sc->atu_mac_addr, &ic->ic_myaddr, IEEE80211_ADDR_LEN); i = 0; ic->ic_sup_rates[IEEE80211_MODE_11B].rs_rates[i++] = 2; @@ -2749,9 +2751,8 @@ atu_init(void *xsc) usbd_transfer(c->atu_xfer); } - //bcopy(&ic->ic_myaddr, sc->atu_mac_addr, ETHER_ADDR_LEN); DPRINTFN(10, ("%s: starting up using MAC=%s\n", - USBDEVNAME(sc->atu_dev), ether_sprintf(sc->atu_mac_addr))); + USBDEVNAME(sc->atu_dev), ether_sprintf(ic->ic_myaddr))); /* Do initial setup */ err = atu_initial_config(sc); diff --git a/sys/dev/usb/if_atureg.h b/sys/dev/usb/if_atureg.h index 7d29e2ce045..35edf43d607 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.7 2004/11/21 04:55:36 dlg Exp $ */ +/* $OpenBSD: if_atureg.h,v 1.8 2004/11/23 02:40:34 dlg Exp $ */ /* * Copyright (c) 2003 * Daan Vreeken <Danovitsch@Vitsch.net>. All rights reserved. @@ -32,7 +32,7 @@ * */ -/* $ATUWI: $Id: if_atureg.h,v 1.7 2004/11/21 04:55:36 dlg Exp $ */ +/* $ATUWI: $Id: if_atureg.h,v 1.8 2004/11/23 02:40:34 dlg Exp $ */ /************ driver options ************/ @@ -307,7 +307,6 @@ struct atu_softc { char atu_dying; struct timeval atu_rx_notice; - u_int8_t atu_mac_addr[ETHER_ADDR_LEN]; u_int8_t atu_bssid[ETHER_ADDR_LEN]; enum atu_radio_type atu_radio; u_int16_t atu_quirk; |