if_ath_ahb.c (221163) | if_ath_ahb.c (223032) |
---|---|
1/*- 2 * Copyright (c) 2002-2008 Sam Leffler, Errno Consulting 3 * Copyright (c) 2010-2011 Adrian Chadd, Xenion Pty Ltd 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 15 unchanged lines hidden (view full) --- 24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 * THE POSSIBILITY OF SUCH DAMAGES. 29 */ 30 31#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2002-2008 Sam Leffler, Errno Consulting 3 * Copyright (c) 2010-2011 Adrian Chadd, Xenion Pty Ltd 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 15 unchanged lines hidden (view full) --- 24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 * THE POSSIBILITY OF SUCH DAMAGES. 29 */ 30 31#include <sys/cdefs.h> |
32__FBSDID("$FreeBSD: head/sys/dev/ath/if_ath_ahb.c 221163 2011-04-28 12:47:40Z adrian $"); | 32__FBSDID("$FreeBSD: head/sys/dev/ath/if_ath_ahb.c 223032 2011-06-13 04:31:57Z adrian $"); |
33 34/* 35 * AHB bus front-end for the Atheros Wireless LAN controller driver. 36 */ 37 38#include <sys/param.h> 39#include <sys/systm.h> 40#include <sys/module.h> --- 77 unchanged lines hidden (view full) --- 118 "eepromaddr", &eepromaddr) != 0) { 119 device_printf(dev, "cannot fetch 'eepromaddr' from hints\n"); 120 goto bad0; 121 } 122 rid = 0; 123 device_printf(sc->sc_dev, "eeprom @ %p\n", (void *) eepromaddr); 124 psc->sc_eeprom = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, (uintptr_t) eepromaddr, 125 (uintptr_t) eepromaddr + (uintptr_t) ((ATH_EEPROM_DATA_SIZE * 2) - 1), 0, RF_ACTIVE); | 33 34/* 35 * AHB bus front-end for the Atheros Wireless LAN controller driver. 36 */ 37 38#include <sys/param.h> 39#include <sys/systm.h> 40#include <sys/module.h> --- 77 unchanged lines hidden (view full) --- 118 "eepromaddr", &eepromaddr) != 0) { 119 device_printf(dev, "cannot fetch 'eepromaddr' from hints\n"); 120 goto bad0; 121 } 122 rid = 0; 123 device_printf(sc->sc_dev, "eeprom @ %p\n", (void *) eepromaddr); 124 psc->sc_eeprom = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, (uintptr_t) eepromaddr, 125 (uintptr_t) eepromaddr + (uintptr_t) ((ATH_EEPROM_DATA_SIZE * 2) - 1), 0, RF_ACTIVE); |
126 if (psc->sc_sr == NULL) { | 126 if (psc->sc_eeprom == NULL) { |
127 device_printf(dev, "cannot map eeprom space\n"); 128 goto bad0; 129 } 130 131 /* XXX uintptr_t is a bandaid for ia64; to be fixed */ 132 sc->sc_st = (HAL_BUS_TAG)(uintptr_t) rman_get_bustag(psc->sc_sr); 133 sc->sc_sh = (HAL_BUS_HANDLE) rman_get_bushandle(psc->sc_sr); 134 /* 135 * Mark device invalid so any interrupts (shared or otherwise) 136 * that arrive before the HAL is setup are discarded. 137 */ 138 sc->sc_invalid = 1; 139 140 /* Copy the EEPROM data out */ 141 sc->sc_eepromdata = malloc(ATH_EEPROM_DATA_SIZE * 2, M_TEMP, M_NOWAIT | M_ZERO); | 127 device_printf(dev, "cannot map eeprom space\n"); 128 goto bad0; 129 } 130 131 /* XXX uintptr_t is a bandaid for ia64; to be fixed */ 132 sc->sc_st = (HAL_BUS_TAG)(uintptr_t) rman_get_bustag(psc->sc_sr); 133 sc->sc_sh = (HAL_BUS_HANDLE) rman_get_bushandle(psc->sc_sr); 134 /* 135 * Mark device invalid so any interrupts (shared or otherwise) 136 * that arrive before the HAL is setup are discarded. 137 */ 138 sc->sc_invalid = 1; 139 140 /* Copy the EEPROM data out */ 141 sc->sc_eepromdata = malloc(ATH_EEPROM_DATA_SIZE * 2, M_TEMP, M_NOWAIT | M_ZERO); |
142 if (sc->sc_eepromdata == NULL) { 143 device_printf(dev, "cannot allocate memory for eeprom data\n"); 144 goto bad1; 145 } |
|
142 device_printf(sc->sc_dev, "eeprom data @ %p\n", (void *) rman_get_bushandle(psc->sc_eeprom)); 143 /* XXX why doesn't this work? -adrian */ 144#if 0 145 bus_space_read_multi_1( 146 rman_get_bustag(psc->sc_eeprom), 147 rman_get_bushandle(psc->sc_eeprom), 148 0, (u_int8_t *) sc->sc_eepromdata, ATH_EEPROM_DATA_SIZE * 2); 149#endif --- 138 unchanged lines hidden --- | 146 device_printf(sc->sc_dev, "eeprom data @ %p\n", (void *) rman_get_bushandle(psc->sc_eeprom)); 147 /* XXX why doesn't this work? -adrian */ 148#if 0 149 bus_space_read_multi_1( 150 rman_get_bustag(psc->sc_eeprom), 151 rman_get_bushandle(psc->sc_eeprom), 152 0, (u_int8_t *) sc->sc_eepromdata, ATH_EEPROM_DATA_SIZE * 2); 153#endif --- 138 unchanged lines hidden --- |