Go to the documentation of this file.
34 #include <linux/if_ether.h>
40 #define HERMES_ALLOC_LEN_MIN (4)
41 #define HERMES_ALLOC_LEN_MAX (2400)
42 #define HERMES_LTV_LEN_MAX (34)
43 #define HERMES_BAP_DATALEN_MAX (4096)
44 #define HERMES_BAP_OFFSET_MAX (4096)
45 #define HERMES_PORTID_MAX (7)
46 #define HERMES_NUMPORTS_MAX (HERMES_PORTID_MAX + 1)
47 #define HERMES_PDR_LEN_MAX (260)
48 #define HERMES_PDA_RECS_MAX (200)
49 #define HERMES_PDA_LEN_MAX (1024)
50 #define HERMES_SCANRESULT_MAX (35)
51 #define HERMES_CHINFORESULT_MAX (8)
52 #define HERMES_MAX_MULTICAST (16)
53 #define HERMES_MAGIC (0x7d1f)
58 #define HERMES_CMD (0x00)
59 #define HERMES_PARAM0 (0x02)
60 #define HERMES_PARAM1 (0x04)
61 #define HERMES_PARAM2 (0x06)
62 #define HERMES_STATUS (0x08)
63 #define HERMES_RESP0 (0x0A)
64 #define HERMES_RESP1 (0x0C)
65 #define HERMES_RESP2 (0x0E)
66 #define HERMES_INFOFID (0x10)
67 #define HERMES_RXFID (0x20)
68 #define HERMES_ALLOCFID (0x22)
69 #define HERMES_TXCOMPLFID (0x24)
70 #define HERMES_SELECT0 (0x18)
71 #define HERMES_OFFSET0 (0x1C)
72 #define HERMES_DATA0 (0x36)
73 #define HERMES_SELECT1 (0x1A)
74 #define HERMES_OFFSET1 (0x1E)
75 #define HERMES_DATA1 (0x38)
76 #define HERMES_EVSTAT (0x30)
77 #define HERMES_INTEN (0x32)
78 #define HERMES_EVACK (0x34)
79 #define HERMES_CONTROL (0x14)
80 #define HERMES_SWSUPPORT0 (0x28)
81 #define HERMES_SWSUPPORT1 (0x2A)
82 #define HERMES_SWSUPPORT2 (0x2C)
83 #define HERMES_AUXPAGE (0x3A)
84 #define HERMES_AUXOFFSET (0x3C)
85 #define HERMES_AUXDATA (0x3E)
90 #define HERMES_CMD_BUSY (0x8000)
91 #define HERMES_CMD_AINFO (0x7f00)
92 #define HERMES_CMD_MACPORT (0x0700)
93 #define HERMES_CMD_RECL (0x0100)
94 #define HERMES_CMD_WRITE (0x0100)
95 #define HERMES_CMD_PROGMODE (0x0300)
96 #define HERMES_CMD_CMDCODE (0x003f)
101 #define HERMES_STATUS_RESULT (0x7f00)
102 #define HERMES_STATUS_CMDCODE (0x003f)
107 #define HERMES_OFFSET_BUSY (0x8000)
108 #define HERMES_OFFSET_ERR (0x4000)
109 #define HERMES_OFFSET_DATAOFF (0x0ffe)
114 #define HERMES_EV_TICK (0x8000)
115 #define HERMES_EV_WTERR (0x4000)
116 #define HERMES_EV_INFDROP (0x2000)
117 #define HERMES_EV_INFO (0x0080)
118 #define HERMES_EV_DTIM (0x0020)
119 #define HERMES_EV_CMD (0x0010)
120 #define HERMES_EV_ALLOC (0x0008)
121 #define HERMES_EV_TXEXC (0x0004)
122 #define HERMES_EV_TX (0x0002)
123 #define HERMES_EV_RX (0x0001)
129 #define HERMES_CMD_INIT (0x0000)
130 #define HERMES_CMD_ENABLE (0x0001)
131 #define HERMES_CMD_DISABLE (0x0002)
132 #define HERMES_CMD_DIAG (0x0003)
135 #define HERMES_CMD_ALLOC (0x000A)
136 #define HERMES_CMD_TX (0x000B)
139 #define HERMES_CMD_NOTIFY (0x0010)
140 #define HERMES_CMD_INQUIRE (0x0011)
143 #define HERMES_CMD_ACCESS (0x0021)
144 #define HERMES_CMD_DOWNLD (0x0022)
147 #define HERMES_CMD_READMIF (0x0030)
148 #define HERMES_CMD_WRITEMIF (0x0031)
151 #define HERMES_CMD_TEST (0x0038)
155 #define HERMES_TEST_SET_CHANNEL 0x0800
156 #define HERMES_TEST_MONITOR 0x0b00
157 #define HERMES_TEST_STOP 0x0f00
160 #define HERMES_AUTH_OPEN 1
161 #define HERMES_AUTH_SHARED_KEY 2
164 #define HERMES_WEP_PRIVACY_INVOKED 0x0001
165 #define HERMES_WEP_EXCL_UNENCRYPTED 0x0002
166 #define HERMES_WEP_HOST_ENCRYPT 0x0010
167 #define HERMES_WEP_HOST_DECRYPT 0x0080
170 #define HERMES_HOSTSCAN_SYMBOL_5SEC 0x0001
171 #define HERMES_HOSTSCAN_SYMBOL_ONCE 0x0002
172 #define HERMES_HOSTSCAN_SYMBOL_PASSIVE 0x0040
173 #define HERMES_HOSTSCAN_SYMBOL_BCAST 0x0080
179 #define HERMES_DESCRIPTOR_OFFSET 0
180 #define HERMES_802_11_OFFSET (14)
181 #define HERMES_802_3_OFFSET (14 + 32)
182 #define HERMES_802_2_OFFSET (14 + 32 + 14)
183 #define HERMES_TXCNTL2_OFFSET (HERMES_802_3_OFFSET - 2)
185 #define HERMES_RXSTAT_ERR (0x0003)
186 #define HERMES_RXSTAT_BADCRC (0x0001)
187 #define HERMES_RXSTAT_UNDECRYPTABLE (0x0002)
188 #define HERMES_RXSTAT_MIC (0x0010)
189 #define HERMES_RXSTAT_MACPORT (0x0700)
190 #define HERMES_RXSTAT_PCF (0x1000)
191 #define HERMES_RXSTAT_MIC_KEY_ID (0x1800)
192 #define HERMES_RXSTAT_MSGTYPE (0xE000)
193 #define HERMES_RXSTAT_1042 (0x2000)
194 #define HERMES_RXSTAT_TUNNEL (0x4000)
195 #define HERMES_RXSTAT_WMP (0x6000)
198 #define HERMES_MIC_KEY_ID_SHIFT 11
210 #define HERMES_TXSTAT_RETRYERR (0x0001)
211 #define HERMES_TXSTAT_AGEDERR (0x0002)
212 #define HERMES_TXSTAT_DISCON (0x0004)
213 #define HERMES_TXSTAT_FORMERR (0x0008)
215 #define HERMES_TXCTRL_TX_OK (0x0002)
216 #define HERMES_TXCTRL_TX_EX (0x0004)
217 #define HERMES_TXCTRL_802_11 (0x0008)
218 #define HERMES_TXCTRL_MIC (0x0010)
219 #define HERMES_TXCTRL_MIC_KEY_ID (0x1800)
220 #define HERMES_TXCTRL_ALT_RTRY (0x0020)
224 #define HERMES_INQ_TALLIES (0xF100)
225 #define HERMES_INQ_SCAN (0xF101)
226 #define HERMES_INQ_CHANNELINFO (0xF102)
227 #define HERMES_INQ_HOSTSCAN (0xF103)
228 #define HERMES_INQ_HOSTSCAN_SYMBOL (0xF104)
229 #define HERMES_INQ_LINKSTATUS (0xF200)
230 #define HERMES_INQ_SEC_STAT_AGERE (0xF202)
348 #define HERMES_LINKSTATUS_NOT_CONNECTED (0x0000)
349 #define HERMES_LINKSTATUS_CONNECTED (0x0001)
350 #define HERMES_LINKSTATUS_DISCONNECTED (0x0002)
351 #define HERMES_LINKSTATUS_AP_CHANGE (0x0003)
352 #define HERMES_LINKSTATUS_AP_OUT_OF_RANGE (0x0004)
353 #define HERMES_LINKSTATUS_AP_IN_RANGE (0x0005)
354 #define HERMES_LINKSTATUS_ASSOC_FAILED (0x0006)
375 #define HERMES_BAP_BUSY_TIMEOUT (10000)
397 u32 pda_addr,
u16 pda_len);
412 #define HERMES_16BIT_REGSPACING 0
413 #define HERMES_32BIT_REGSPACING 1
421 #define hermes_read_reg(hw, off) \
422 (ioread16((hw)->iobase + ((off) << (hw)->reg_spacing)))
423 #define hermes_write_reg(hw, off, val) \
424 (iowrite16((val), (hw)->iobase + ((off) << (hw)->reg_spacing)))
425 #define hermes_read_regn(hw, name) hermes_read_reg((hw), HERMES_##name)
426 #define hermes_write_regn(hw, name, val) \
427 hermes_write_reg((hw), HERMES_##name, (val))
435 static inline int hermes_present(
struct hermes *
hw)
446 static inline int hermes_enable_port(
struct hermes *
hw,
int port)
452 static inline int hermes_disable_port(
struct hermes *hw,
int port)
460 static inline int hermes_inquire(
struct hermes *hw,
u16 rid)
465 #define HERMES_BYTES_TO_RECLEN(n) ((((n) + 1) / 2) + 1)
466 #define HERMES_RECLEN_TO_BYTES(n) (((n) - 1) * 2)
469 static inline void hermes_read_words(
struct hermes *hw,
int off,
476 static inline void hermes_write_bytes(
struct hermes *hw,
int off,
485 static inline void hermes_clear_words(
struct hermes *hw,
int off,
492 for (i = 0; i <
count; i++)
496 #define HERMES_READ_RECORD(hw, bap, rid, buf) \
497 (hw->ops->read_ltv((hw), (bap), (rid), sizeof(*buf), NULL, (buf)))
498 #define HERMES_WRITE_RECORD(hw, bap, rid, buf) \
499 (hw->ops->write_ltv((hw), (bap), (rid), \
500 HERMES_BYTES_TO_RECLEN(sizeof(*buf)), (buf)))
502 static inline int hermes_read_wordrec(
struct hermes *hw,
int bap,
u16 rid,
513 static inline int hermes_write_wordrec(
struct hermes *hw,
int bap,
u16 rid,