Deleted Added
full compact
ah_osdep.c (191909) ah_osdep.c (195418)
1/*-
2 * Copyright (c) 2002-2008 Sam Leffler, Errno Consulting
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 12 unchanged lines hidden (view full) ---

21 * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
22 * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
25 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
27 * THE POSSIBILITY OF SUCH DAMAGES.
28 *
1/*-
2 * Copyright (c) 2002-2008 Sam Leffler, Errno Consulting
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 12 unchanged lines hidden (view full) ---

21 * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
22 * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
25 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
27 * THE POSSIBILITY OF SUCH DAMAGES.
28 *
29 * $FreeBSD: head/sys/dev/ath/ah_osdep.c 191909 2009-05-08 00:23:00Z sam $
29 * $FreeBSD: head/sys/dev/ath/ah_osdep.c 195418 2009-07-06 20:51:54Z sam $
30 */
31#include "opt_ah.h"
32
33#include <sys/param.h>
34#include <sys/systm.h>
35#include <sys/kernel.h>
36#include <sys/module.h>
37#include <sys/sysctl.h>

--- 211 unchanged lines hidden (view full) ---

249 struct athregrec *r = (struct athregrec *) ale->ae_data;
250 r->op = OP_WRITE;
251 r->reg = reg;
252 r->val = val;
253 alq_post(ath_hal_alq, ale);
254 }
255 }
256#if _BYTE_ORDER == _BIG_ENDIAN
30 */
31#include "opt_ah.h"
32
33#include <sys/param.h>
34#include <sys/systm.h>
35#include <sys/kernel.h>
36#include <sys/module.h>
37#include <sys/sysctl.h>

--- 211 unchanged lines hidden (view full) ---

249 struct athregrec *r = (struct athregrec *) ale->ae_data;
250 r->op = OP_WRITE;
251 r->reg = reg;
252 r->val = val;
253 alq_post(ath_hal_alq, ale);
254 }
255 }
256#if _BYTE_ORDER == _BIG_ENDIAN
257 if (reg >= 0x4000 && reg < 0x5000)
257 if (OS_REG_UNSWAPPED(reg))
258 bus_space_write_4(tag, h, reg, val);
259 else
260#endif
261 bus_space_write_stream_4(tag, h, reg, val);
262}
263
264u_int32_t
265ath_hal_reg_read(struct ath_hal *ah, u_int32_t reg)
266{
267 bus_space_tag_t tag = BUSTAG(ah);
268 bus_space_handle_t h = ah->ah_sh;
269 u_int32_t val;
270
271#if _BYTE_ORDER == _BIG_ENDIAN
258 bus_space_write_4(tag, h, reg, val);
259 else
260#endif
261 bus_space_write_stream_4(tag, h, reg, val);
262}
263
264u_int32_t
265ath_hal_reg_read(struct ath_hal *ah, u_int32_t reg)
266{
267 bus_space_tag_t tag = BUSTAG(ah);
268 bus_space_handle_t h = ah->ah_sh;
269 u_int32_t val;
270
271#if _BYTE_ORDER == _BIG_ENDIAN
272 if (reg >= 0x4000 && reg < 0x5000)
272 if (OS_REG_UNSWAPPED(reg))
273 val = bus_space_read_4(tag, h, reg);
274 else
275#endif
276 val = bus_space_read_stream_4(tag, h, reg);
277 if (ath_hal_alq) {
278 struct ale *ale = ath_hal_alq_get(ah);
279 if (ale) {
280 struct athregrec *r = (struct athregrec *) ale->ae_data;

--- 34 unchanged lines hidden (view full) ---

315
316void
317ath_hal_reg_write(struct ath_hal *ah, u_int32_t reg, u_int32_t val)
318{
319 bus_space_tag_t tag = BUSTAG(ah);
320 bus_space_handle_t h = ah->ah_sh;
321
322#if _BYTE_ORDER == _BIG_ENDIAN
273 val = bus_space_read_4(tag, h, reg);
274 else
275#endif
276 val = bus_space_read_stream_4(tag, h, reg);
277 if (ath_hal_alq) {
278 struct ale *ale = ath_hal_alq_get(ah);
279 if (ale) {
280 struct athregrec *r = (struct athregrec *) ale->ae_data;

--- 34 unchanged lines hidden (view full) ---

315
316void
317ath_hal_reg_write(struct ath_hal *ah, u_int32_t reg, u_int32_t val)
318{
319 bus_space_tag_t tag = BUSTAG(ah);
320 bus_space_handle_t h = ah->ah_sh;
321
322#if _BYTE_ORDER == _BIG_ENDIAN
323 if (reg >= 0x4000 && reg < 0x5000)
323 if (OS_REG_UNSWAPPED(reg))
324 bus_space_write_4(tag, h, reg, val);
325 else
326#endif
327 bus_space_write_stream_4(tag, h, reg, val);
328}
329
330u_int32_t
331ath_hal_reg_read(struct ath_hal *ah, u_int32_t reg)
332{
333 bus_space_tag_t tag = BUSTAG(ah);
334 bus_space_handle_t h = ah->ah_sh;
335 u_int32_t val;
336
337#if _BYTE_ORDER == _BIG_ENDIAN
324 bus_space_write_4(tag, h, reg, val);
325 else
326#endif
327 bus_space_write_stream_4(tag, h, reg, val);
328}
329
330u_int32_t
331ath_hal_reg_read(struct ath_hal *ah, u_int32_t reg)
332{
333 bus_space_tag_t tag = BUSTAG(ah);
334 bus_space_handle_t h = ah->ah_sh;
335 u_int32_t val;
336
337#if _BYTE_ORDER == _BIG_ENDIAN
338 if (reg >= 0x4000 && reg < 0x5000)
338 if (OS_REG_UNSWAPPED(reg))
339 val = bus_space_read_4(tag, h, reg);
340 else
341#endif
342 val = bus_space_read_stream_4(tag, h, reg);
343 return val;
344}
345#endif /* AH_DEBUG || AH_REGOPS_FUNC */
346
347#ifdef AH_ASSERT
348void
349ath_hal_assert_failed(const char* filename, int lineno, const char *msg)
350{
351 printf("Atheros HAL assertion failure: %s: line %u: %s\n",
352 filename, lineno, msg);
353 panic("ath_hal_assert");
354}
355#endif /* AH_ASSERT */
339 val = bus_space_read_4(tag, h, reg);
340 else
341#endif
342 val = bus_space_read_stream_4(tag, h, reg);
343 return val;
344}
345#endif /* AH_DEBUG || AH_REGOPS_FUNC */
346
347#ifdef AH_ASSERT
348void
349ath_hal_assert_failed(const char* filename, int lineno, const char *msg)
350{
351 printf("Atheros HAL assertion failure: %s: line %u: %s\n",
352 filename, lineno, msg);
353 panic("ath_hal_assert");
354}
355#endif /* AH_ASSERT */