diff options
author | Damien Bergamini <damien@cvs.openbsd.org> | 2006-08-05 09:07:36 +0000 |
---|---|---|
committer | Damien Bergamini <damien@cvs.openbsd.org> | 2006-08-05 09:07:36 +0000 |
commit | c75aa4bf25dd32fe6ecf535cc9ffcf99629820f8 (patch) | |
tree | 3f1342b0743a91199d30514801db85bd324ece42 /sys/dev/ic | |
parent | 652adc3c38037e3bb2b1641523df84d908369645 (diff) |
nuke latest remaining firmware ioctl bits.
ok jsg@
s/le32toh/letoh32/g and remove __offsetof definition while i'm here.
Diffstat (limited to 'sys/dev/ic')
-rw-r--r-- | sys/dev/ic/acx.c | 80 | ||||
-rw-r--r-- | sys/dev/ic/acxvar.h | 21 |
2 files changed, 5 insertions, 96 deletions
diff --git a/sys/dev/ic/acx.c b/sys/dev/ic/acx.c index d11fe593bcb..5af3ff831ef 100644 --- a/sys/dev/ic/acx.c +++ b/sys/dev/ic/acx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acx.c,v 1.18 2006/08/05 00:29:41 mglocker Exp $ */ +/* $OpenBSD: acx.c,v 1.19 2006/08/05 09:07:35 damien Exp $ */ /* * Copyright (c) 2006 Jonathan Gray <jsg@openbsd.org> @@ -199,10 +199,6 @@ int acx_set_beacon_tmplt(struct acx_softc *, const char *, int, int); int acx_read_eeprom(struct acx_softc *, uint32_t, uint8_t *); int acx_read_phyreg(struct acx_softc *, uint32_t, uint8_t *); -#if 0 -int acx_copyin_firmware(struct acx_softc *, struct ifreq *); -#endif -void acx_free_firmware(struct acx_softc *); int acx_load_firmware(struct acx_softc *, uint32_t, const uint8_t *, int); int acx_load_radio_firmware(struct acx_softc *, const char *); @@ -369,8 +365,6 @@ acx_detach(void *xsc) struct ifnet *ifp = &ic->ic_if; acx_stop(sc); - acx_free_firmware(sc); - ieee80211_ifdetach(ifp); acx_dma_free(sc); @@ -1397,78 +1391,6 @@ acx_write_phyreg(struct acx_softc *sc, uint32_t reg, uint8_t val) CSR_WRITE_4(sc, ACXREG_PHY_CTRL, ACXRV_PHY_WRITE); } -#if 0 -int -acx_copyin_firmware(struct acx_softc *sc, struct ifreq *req) -{ - struct acx_firmware ufw, *kfw; - uint8_t *base_fw, *radio_fw; - int error; - - kfw = &sc->sc_firmware; - base_fw = NULL; - radio_fw = NULL; - - error = copyin(req->ifr_data, &ufw, sizeof(ufw)); - if (error) - return error; - - /* - * For combined base firmware, there is no radio firmware. - * But base firmware must exist. - */ - if (ufw.base_fw_len <= 0 || ufw.radio_fw_len < 0) - return EINVAL; - - base_fw = malloc(ufw.base_fw_len, M_DEVBUF, M_INTWAIT); - error = copyin(ufw.base_fw, base_fw, ufw.base_fw_len); - if (error) - goto fail; - - if (ufw.radio_fw_len > 0) { - radio_fw = malloc(ufw.radio_fw_len, M_DEVBUF, M_INTWAIT); - error = copyin(ufw.radio_fw, radio_fw, ufw.radio_fw_len); - if (error) - goto fail; - } - - kfw->base_fw_len = ufw.base_fw_len; - if (kfw->base_fw != NULL) - free(kfw->base_fw, M_DEVBUF); - kfw->base_fw = base_fw; - - kfw->radio_fw_len = ufw.radio_fw_len; - if (kfw->radio_fw != NULL) - free(kfw->radio_fw, M_DEVBUF); - kfw->radio_fw = radio_fw; - - return 0; -fail: - if (base_fw != NULL) - free(base_fw, M_DEVBUF); - if (radio_fw != NULL) - free(radio_fw, M_DEVBUF); - return error; -} -#endif - -void -acx_free_firmware(struct acx_softc *sc) -{ - struct acx_firmware *fw = &sc->sc_firmware; - - if (fw->base_fw != NULL) { - free(fw->base_fw, M_DEVBUF); - fw->base_fw = NULL; - fw->base_fw_len = 0; - } - if (fw->radio_fw != NULL) { - free(fw->radio_fw, M_DEVBUF); - fw->radio_fw = NULL; - fw->radio_fw_len = 0; - } -} - int acx_load_base_firmware(struct acx_softc *sc, const char *name) { diff --git a/sys/dev/ic/acxvar.h b/sys/dev/ic/acxvar.h index 0d97bfbb39d..544a61dd49a 100644 --- a/sys/dev/ic/acxvar.h +++ b/sys/dev/ic/acxvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: acxvar.h,v 1.6 2006/08/04 11:58:26 jsg Exp $ */ +/* $OpenBSD: acxvar.h,v 1.7 2006/08/05 09:07:35 damien Exp $ */ /* * Copyright (c) 2006 Jonathan Gray <jsg@openbsd.org> @@ -63,10 +63,6 @@ extern int acxdebug; #define DPRINTFN(n,x) #endif -#ifndef __offsetof -#define __offsetof(type, field) ((size_t)(&((type *)0)->field)) -#endif - #define ACX_FRAME_HDRLEN sizeof(struct ieee80211_frame) #define ACX_MEMBLOCK_SIZE 256 @@ -117,11 +113,11 @@ extern int acxdebug; #define FW_TXDESC_SETFIELD(sc, mb, field, val, sz) \ DESC_WRITE_##sz((sc), (mb)->tb_fwdesc_ofs + \ - __offsetof(struct acx_fw_txdesc, field), (val)) + offsetof(struct acx_fw_txdesc, field), (val)) #define FW_TXDESC_GETFIELD(sc, mb, field, sz) \ DESC_READ_##sz((sc), (mb)->tb_fwdesc_ofs + \ - __offsetof(struct acx_fw_txdesc, field)) + offsetof(struct acx_fw_txdesc, field)) #define FW_TXDESC_SETFIELD_1(sc, mb, field, val) \ FW_TXDESC_SETFIELD(sc, mb, field, val, 1) @@ -133,7 +129,7 @@ extern int acxdebug; #define FW_TXDESC_GETFIELD_1(sc, mb, field) \ FW_TXDESC_GETFIELD(sc, mb, field, 1) #define FW_TXDESC_GETFIELD_4(sc, mb, field) \ - le32toh(FW_TXDESC_GETFIELD(sc, mb, field, 4)) + letoh32(FW_TXDESC_GETFIELD(sc, mb, field, 4)) /* * Firmware TX descriptor @@ -312,14 +308,6 @@ struct acx_node { int nd_txrate_sample; /* num of samples for specific rate */ }; -struct acx_firmware { - uint8_t *base_fw; - int base_fw_len; - - uint8_t *radio_fw; - int radio_fw_len; -}; - struct acx_config { uint8_t antenna; uint8_t regdom; @@ -350,7 +338,6 @@ struct acx_softc { struct timeout sc_chanscan_timer; uint32_t sc_flags; /* see ACX_FLAG_ */ - struct acx_firmware sc_firmware; uint32_t sc_firmware_ver; uint32_t sc_hardware_id; |