1185377Ssam/*
2185377Ssam * Copyright (c) 2002-2008 Sam Leffler, Errno Consulting
3185377Ssam * Copyright (c) 2002-2008 Atheros Communications, Inc.
4185377Ssam *
5185377Ssam * Permission to use, copy, modify, and/or distribute this software for any
6185377Ssam * purpose with or without fee is hereby granted, provided that the above
7185377Ssam * copyright notice and this permission notice appear in all copies.
8185377Ssam *
9185377Ssam * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10185377Ssam * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11185377Ssam * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12185377Ssam * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13185377Ssam * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14185377Ssam * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15185377Ssam * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16185377Ssam *
17204644Srpaulo * $FreeBSD$
18185377Ssam */
19185377Ssam#include "opt_ah.h"
20185377Ssam
21185377Ssam
22185377Ssam#ifdef AH_SUPPORT_AR5312
23185377Ssam
24185377Ssam#include "ah.h"
25185377Ssam#include "ah_internal.h"
26185377Ssam
27185377Ssam#include "ar5312/ar5312.h"
28185377Ssam#include "ar5312/ar5312reg.h"
29185377Ssam#include "ar5212/ar5212desc.h"
30185377Ssam
31185377Ssam/*
32185377Ssam * Read 16 bits of data from offset into *data
33185377Ssam */
34185377SsamHAL_BOOL
35185377Ssamar5312EepromRead(struct ath_hal *ah, u_int off, uint16_t *dataIn)
36185377Ssam{
37185377Ssam        int i,offset;
38185377Ssam	const char *eepromAddr = AR5312_RADIOCONFIG(ah);
39185377Ssam	uint8_t *data;
40185377Ssam
41185377Ssam	data = (uint8_t *) dataIn;
42185377Ssam	for (i=0,offset=2*off; i<2; i++,offset++) {
43185377Ssam		data[i] = eepromAddr[offset];
44185377Ssam	}
45185377Ssam        return AH_TRUE;
46185377Ssam}
47185377Ssam#endif /* AH_SUPPORT_AR5312 */
48