if_maloreg.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /* $OpenBSD: if_maloreg.h,v 1.15 2007/10/08 22:08:12 mglocker Exp $ */
  2. /*
  3. * Copyright (c) 2007 Marcus Glocker <mglocker@openbsd.org>
  4. *
  5. * Permission to use, copy, modify, and distribute this software for any
  6. * purpose with or without fee is hereby granted, provided that the above
  7. * copyright notice and this permission notice appear in all copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  10. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  11. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  12. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  13. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  14. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  15. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  16. */
  17. /* registers */
  18. #define MALO_REG_HOST_STATUS 0x00
  19. #define MALO_REG_CARD_INTR_CAUSE 0x02
  20. #define MALO_REG_HOST_INTR_MASK 0x04
  21. #define MALO_REG_DATA_READ 0x10
  22. #define MALO_REG_CMD_READ 0x12
  23. #define MALO_REG_DATA_WRITE_LEN 0x14
  24. #define MALO_REG_DATA_WRITE 0x16
  25. #define MALO_REG_CMD_WRITE_LEN 0x18
  26. #define MALO_REG_CMD_WRITE 0x1a
  27. #define MALO_REG_CARD_STATUS 0x20
  28. #define MALO_REG_HOST_INTR_CAUSE 0x22
  29. #define MALO_REG_DATA_READ_LEN 0x24
  30. #define MALO_REG_RBAL 0x28
  31. #define MALO_REG_CMD_READ_LEN 0x30
  32. #define MALO_REG_SCRATCH 0x3f
  33. #define MALO_REG_CARD_INTR_MASK 0x44
  34. /* register values */
  35. #define MALO_VAL_SCRATCH_READY 0x00
  36. #define MALO_VAL_TX_DL_OVER 0x01
  37. #define MALO_VAL_RX_DL_OVER 0x02
  38. #define MALO_VAL_CMD_DL_OVER 0x04
  39. #define MALO_VAL_SCRATCH_FW_LOADED 0x5a
  40. #define MALO_VAL_HOST_INTR_MASK_ON 0x001f
  41. #define MALO_VAL_CARD_STATUS_MASK 0x7f00
  42. /* interrupt reasons */
  43. #define MALO_VAL_HOST_INTR_TX (1 << 0)
  44. #define MALO_VAL_HOST_INTR_RX (1 << 1)
  45. #define MALO_VAL_HOST_INTR_CMD (1 << 3)
  46. #define MALO_VAL_HOST_INTR_EVENT (1 << 4)
  47. /* FW commands */
  48. #define MALO_CMD_RESP 0x8000
  49. #define MALO_CMD_HWSPEC 0x0003
  50. #define MALO_CMD_RESET 0x0005
  51. #define MALO_CMD_SCAN 0x0006
  52. #define MALO_CMD_AUTH 0x0011
  53. #define MALO_CMD_WEP 0x0013
  54. #define MALO_CMD_SNMP 0x0016
  55. #define MALO_CMD_RADIO 0x001c
  56. #define MALO_CMD_CHANNEL 0x001d
  57. #define MALO_CMD_TXPOWER 0x001e
  58. #define MALO_CMD_ANTENNA 0x0020
  59. #define MALO_CMD_MACCTRL 0x0028
  60. #define MALO_CMD_MACADDR 0x004d
  61. #define MALO_CMD_ASSOC 0x0050
  62. #define MALO_CMD_80211D 0x005b
  63. #define MALO_CMD_BGSCAN_CONFIG 0x006b
  64. #define MALO_CMD_BGSCAN_QUERY 0x006c
  65. #define MALO_CMD_RATE 0x0076
  66. /* FW command values */
  67. #define MALO_CMD_RADIO_OFF 0x0000
  68. #define MALO_CMD_RADIO_ON 0x0001
  69. #define MALO_CMD_RADIO_LONG_P 0x0000
  70. #define MALO_CMD_RADIO_SHORT_P 0x0002
  71. #define MALO_CMD_RADIO_AUTO_P 0x0004
  72. #define MALO_CMD_MACCTRL_RX_ON 0x0001
  73. #define MALO_CMD_MACCTRL_TX_ON 0x0002
  74. #define MALO_CMD_MACCTRL_PROMISC_ON 0x0080
  75. /* events */
  76. #define MALO_EVENT_DEAUTH 0x0008
  77. #define MALO_EVENT_DISASSOC 0x0009