3 * Copyright (c) 2009-2010 Alexander Egorenkov <egorenar@gmail.com>
4 * Copyright (c) 2009 Damien Bergamini <damien.bergamini@free.fr>
6 * Permission to use, copy, modify, and distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 #include "rt2860_softc.h"
24 #define RT2860_IO_MCU_CMD_SLEEP 0x30
25 #define RT2860_IO_MCU_CMD_WAKEUP 0x31
26 #define RT2860_IO_MCU_CMD_RADIOOFF 0x35
27 #define RT2860_IO_MCU_CMD_LEDS 0x50
28 #define RT2860_IO_MCU_CMD_LED_BRIGHTNESS 0x51
29 #define RT2860_IO_MCU_CMD_LED1 0x52
30 #define RT2860_IO_MCU_CMD_LED2 0x53
31 #define RT2860_IO_MCU_CMD_LED3 0x54
32 #define RT2860_IO_MCU_CMD_BOOT 0x72
33 #define RT2860_IO_MCU_CMD_BBP 0x80
34 #define RT2860_IO_MCU_CMD_POWERSAVE_LEVEL 0x83
36 uint32_t rt2860_io_mac_read(struct rt2860_softc
*sc
, uint16_t reg
);
38 void rt2860_io_mac_read_multi(struct rt2860_softc
*sc
,
39 uint16_t reg
, void *buf
, size_t len
);
41 void rt2860_io_mac_write(struct rt2860_softc
*sc
,
42 uint16_t reg
, uint32_t val
);
44 void rt2860_io_mac_write_multi(struct rt2860_softc
*sc
,
45 uint16_t reg
, const void *buf
, size_t len
);
47 void rt2860_io_mac_set_region_4(struct rt2860_softc
*sc
,
48 uint16_t reg
, uint32_t val
, size_t len
);
50 uint16_t rt2860_io_eeprom_read(struct rt2860_softc
*sc
, uint16_t addr
);
52 void rt2860_io_eeprom_read_multi(struct rt2860_softc
*sc
,
53 uint16_t addr
, void *buf
, size_t len
);
55 uint8_t rt2860_io_bbp_read(struct rt2860_softc
*sc
, uint8_t reg
);
57 void rt2860_io_bbp_write(struct rt2860_softc
*sc
, uint8_t reg
, uint8_t val
);
59 void rt2860_io_rf_write(struct rt2860_softc
*sc
, uint8_t reg
, uint32_t val
);
61 void rt2860_io_mcu_cmd(struct rt2860_softc
*sc
, uint8_t cmd
,
62 uint8_t token
, uint16_t arg
);
64 int rt2860_io_mcu_cmd_check(struct rt2860_softc
*sc
, uint8_t cid
);
66 int rt2860_io_mcu_load_ucode(struct rt2860_softc
*sc
,
67 const uint8_t *ucode
, size_t len
);
69 #endif /* #ifndef _RT2860_IO_H_ */