1*20657f89Smglocker /* $OpenBSD: if_maloreg.h,v 1.15 2007/10/08 22:08:12 mglocker Exp $ */ 2020dcea4Smglocker 3020dcea4Smglocker /* 4020dcea4Smglocker * Copyright (c) 2007 Marcus Glocker <mglocker@openbsd.org> 5020dcea4Smglocker * 6020dcea4Smglocker * Permission to use, copy, modify, and distribute this software for any 7020dcea4Smglocker * purpose with or without fee is hereby granted, provided that the above 8020dcea4Smglocker * copyright notice and this permission notice appear in all copies. 9020dcea4Smglocker * 10020dcea4Smglocker * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11020dcea4Smglocker * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12020dcea4Smglocker * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13020dcea4Smglocker * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14020dcea4Smglocker * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15020dcea4Smglocker * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16020dcea4Smglocker * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17020dcea4Smglocker */ 18020dcea4Smglocker 194eb858dcSmglocker /* registers */ 20020dcea4Smglocker #define MALO_REG_HOST_STATUS 0x00 21020dcea4Smglocker #define MALO_REG_CARD_INTR_CAUSE 0x02 22020dcea4Smglocker #define MALO_REG_HOST_INTR_MASK 0x04 234eb858dcSmglocker #define MALO_REG_DATA_READ 0x10 24020dcea4Smglocker #define MALO_REG_CMD_READ 0x12 25f32ec933Smglocker #define MALO_REG_DATA_WRITE_LEN 0x14 26f32ec933Smglocker #define MALO_REG_DATA_WRITE 0x16 27020dcea4Smglocker #define MALO_REG_CMD_WRITE_LEN 0x18 28020dcea4Smglocker #define MALO_REG_CMD_WRITE 0x1a 29020dcea4Smglocker #define MALO_REG_CARD_STATUS 0x20 30020dcea4Smglocker #define MALO_REG_HOST_INTR_CAUSE 0x22 314eb858dcSmglocker #define MALO_REG_DATA_READ_LEN 0x24 32020dcea4Smglocker #define MALO_REG_RBAL 0x28 33020dcea4Smglocker #define MALO_REG_CMD_READ_LEN 0x30 34020dcea4Smglocker #define MALO_REG_SCRATCH 0x3f 35020dcea4Smglocker #define MALO_REG_CARD_INTR_MASK 0x44 36020dcea4Smglocker 374eb858dcSmglocker /* register values */ 38020dcea4Smglocker #define MALO_VAL_SCRATCH_READY 0x00 39f32ec933Smglocker #define MALO_VAL_TX_DL_OVER 0x01 40f32ec933Smglocker #define MALO_VAL_RX_DL_OVER 0x02 414eb858dcSmglocker #define MALO_VAL_CMD_DL_OVER 0x04 4215de9f2cSmglocker #define MALO_VAL_SCRATCH_FW_LOADED 0x5a 4315de9f2cSmglocker #define MALO_VAL_HOST_INTR_MASK_ON 0x001f 444c9286c3Smglocker #define MALO_VAL_CARD_STATUS_MASK 0x7f00 45020dcea4Smglocker 46020dcea4Smglocker /* interrupt reasons */ 47f32ec933Smglocker #define MALO_VAL_HOST_INTR_TX (1 << 0) 484eb858dcSmglocker #define MALO_VAL_HOST_INTR_RX (1 << 1) 49020dcea4Smglocker #define MALO_VAL_HOST_INTR_CMD (1 << 3) 504c9286c3Smglocker #define MALO_VAL_HOST_INTR_EVENT (1 << 4) 51020dcea4Smglocker 52020dcea4Smglocker /* FW commands */ 5381a17163Smglocker #define MALO_CMD_RESP 0x8000 5481a17163Smglocker #define MALO_CMD_HWSPEC 0x0003 5581a17163Smglocker #define MALO_CMD_RESET 0x0005 56551bd1e5Smglocker #define MALO_CMD_SCAN 0x0006 5746ada075Smglocker #define MALO_CMD_AUTH 0x0011 580f042794Smglocker #define MALO_CMD_WEP 0x0013 5946ada075Smglocker #define MALO_CMD_SNMP 0x0016 6081a17163Smglocker #define MALO_CMD_RADIO 0x001c 6181a17163Smglocker #define MALO_CMD_CHANNEL 0x001d 6281a17163Smglocker #define MALO_CMD_TXPOWER 0x001e 6381a17163Smglocker #define MALO_CMD_ANTENNA 0x0020 6481a17163Smglocker #define MALO_CMD_MACCTRL 0x0028 65*20657f89Smglocker #define MALO_CMD_MACADDR 0x004d 66f32ec933Smglocker #define MALO_CMD_ASSOC 0x0050 674169bc66Smglocker #define MALO_CMD_80211D 0x005b 68fd37f28aSmglocker #define MALO_CMD_BGSCAN_CONFIG 0x006b 69fd37f28aSmglocker #define MALO_CMD_BGSCAN_QUERY 0x006c 7046ada075Smglocker #define MALO_CMD_RATE 0x0076 7181a17163Smglocker 7281a17163Smglocker /* FW command values */ 7381a17163Smglocker #define MALO_CMD_RADIO_OFF 0x0000 7481a17163Smglocker #define MALO_CMD_RADIO_ON 0x0001 7581a17163Smglocker #define MALO_CMD_RADIO_LONG_P 0x0000 7681a17163Smglocker #define MALO_CMD_RADIO_SHORT_P 0x0002 7781a17163Smglocker #define MALO_CMD_RADIO_AUTO_P 0x0004 7881a17163Smglocker #define MALO_CMD_MACCTRL_RX_ON 0x0001 7981a17163Smglocker #define MALO_CMD_MACCTRL_TX_ON 0x0002 804eb858dcSmglocker #define MALO_CMD_MACCTRL_PROMISC_ON 0x0080 814c9286c3Smglocker 824c9286c3Smglocker /* events */ 8362800c9dSmglocker #define MALO_EVENT_DEAUTH 0x0008 8462800c9dSmglocker #define MALO_EVENT_DISASSOC 0x0009 85