hermes.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520
  1. /* hermes.h
  2. *
  3. * Driver core for the "Hermes" wireless MAC controller, as used in
  4. * the Lucent Orinoco and Cabletron RoamAbout cards. It should also
  5. * work on the hfa3841 and hfa3842 MAC controller chips used in the
  6. * Prism I & II chipsets.
  7. *
  8. * This is not a complete driver, just low-level access routines for
  9. * the MAC controller itself.
  10. *
  11. * Based on the prism2 driver from Absolute Value Systems' linux-wlan
  12. * project, the Linux wvlan_cs driver, Lucent's HCF-Light
  13. * (wvlan_hcf.c) library, and the NetBSD wireless driver.
  14. *
  15. * Copyright (C) 2000, David Gibson, Linuxcare Australia.
  16. * (C) Copyright David Gibson, IBM Corp. 2001-2003.
  17. *
  18. * Portions taken from hfa384x.h.
  19. * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved.
  20. *
  21. * This file distributed under the GPL, version 2.
  22. */
  23. #ifndef _HERMES_H
  24. #define _HERMES_H
  25. /* Notes on locking:
  26. *
  27. * As a module of low level hardware access routines, there is no
  28. * locking. Users of this module should ensure that they serialize
  29. * access to the hermes structure, and to the hardware
  30. */
  31. #include <linux/if_ether.h>
  32. #include <linux/io.h>
  33. /*
  34. * Limits and constants
  35. */
  36. #define HERMES_ALLOC_LEN_MIN (4)
  37. #define HERMES_ALLOC_LEN_MAX (2400)
  38. #define HERMES_LTV_LEN_MAX (34)
  39. #define HERMES_BAP_DATALEN_MAX (4096)
  40. #define HERMES_BAP_OFFSET_MAX (4096)
  41. #define HERMES_PORTID_MAX (7)
  42. #define HERMES_NUMPORTS_MAX (HERMES_PORTID_MAX + 1)
  43. #define HERMES_PDR_LEN_MAX (260) /* in bytes, from EK */
  44. #define HERMES_PDA_RECS_MAX (200) /* a guess */
  45. #define HERMES_PDA_LEN_MAX (1024) /* in bytes, from EK */
  46. #define HERMES_SCANRESULT_MAX (35)
  47. #define HERMES_CHINFORESULT_MAX (8)
  48. #define HERMES_MAX_MULTICAST (16)
  49. #define HERMES_MAGIC (0x7d1f)
  50. /*
  51. * Hermes register offsets
  52. */
  53. #define HERMES_CMD (0x00)
  54. #define HERMES_PARAM0 (0x02)
  55. #define HERMES_PARAM1 (0x04)
  56. #define HERMES_PARAM2 (0x06)
  57. #define HERMES_STATUS (0x08)
  58. #define HERMES_RESP0 (0x0A)
  59. #define HERMES_RESP1 (0x0C)
  60. #define HERMES_RESP2 (0x0E)
  61. #define HERMES_INFOFID (0x10)
  62. #define HERMES_RXFID (0x20)
  63. #define HERMES_ALLOCFID (0x22)
  64. #define HERMES_TXCOMPLFID (0x24)
  65. #define HERMES_SELECT0 (0x18)
  66. #define HERMES_OFFSET0 (0x1C)
  67. #define HERMES_DATA0 (0x36)
  68. #define HERMES_SELECT1 (0x1A)
  69. #define HERMES_OFFSET1 (0x1E)
  70. #define HERMES_DATA1 (0x38)
  71. #define HERMES_EVSTAT (0x30)
  72. #define HERMES_INTEN (0x32)
  73. #define HERMES_EVACK (0x34)
  74. #define HERMES_CONTROL (0x14)
  75. #define HERMES_SWSUPPORT0 (0x28)
  76. #define HERMES_SWSUPPORT1 (0x2A)
  77. #define HERMES_SWSUPPORT2 (0x2C)
  78. #define HERMES_AUXPAGE (0x3A)
  79. #define HERMES_AUXOFFSET (0x3C)
  80. #define HERMES_AUXDATA (0x3E)
  81. /*
  82. * CMD register bitmasks
  83. */
  84. #define HERMES_CMD_BUSY (0x8000)
  85. #define HERMES_CMD_AINFO (0x7f00)
  86. #define HERMES_CMD_MACPORT (0x0700)
  87. #define HERMES_CMD_RECL (0x0100)
  88. #define HERMES_CMD_WRITE (0x0100)
  89. #define HERMES_CMD_PROGMODE (0x0300)
  90. #define HERMES_CMD_CMDCODE (0x003f)
  91. /*
  92. * STATUS register bitmasks
  93. */
  94. #define HERMES_STATUS_RESULT (0x7f00)
  95. #define HERMES_STATUS_CMDCODE (0x003f)
  96. /*
  97. * OFFSET register bitmasks
  98. */
  99. #define HERMES_OFFSET_BUSY (0x8000)
  100. #define HERMES_OFFSET_ERR (0x4000)
  101. #define HERMES_OFFSET_DATAOFF (0x0ffe)
  102. /*
  103. * Event register bitmasks (INTEN, EVSTAT, EVACK)
  104. */
  105. #define HERMES_EV_TICK (0x8000)
  106. #define HERMES_EV_WTERR (0x4000)
  107. #define HERMES_EV_INFDROP (0x2000)
  108. #define HERMES_EV_INFO (0x0080)
  109. #define HERMES_EV_DTIM (0x0020)
  110. #define HERMES_EV_CMD (0x0010)
  111. #define HERMES_EV_ALLOC (0x0008)
  112. #define HERMES_EV_TXEXC (0x0004)
  113. #define HERMES_EV_TX (0x0002)
  114. #define HERMES_EV_RX (0x0001)
  115. /*
  116. * Command codes
  117. */
  118. /*--- Controller Commands ----------------------------*/
  119. #define HERMES_CMD_INIT (0x0000)
  120. #define HERMES_CMD_ENABLE (0x0001)
  121. #define HERMES_CMD_DISABLE (0x0002)
  122. #define HERMES_CMD_DIAG (0x0003)
  123. /*--- Buffer Mgmt Commands ---------------------------*/
  124. #define HERMES_CMD_ALLOC (0x000A)
  125. #define HERMES_CMD_TX (0x000B)
  126. /*--- Regulate Commands ------------------------------*/
  127. #define HERMES_CMD_NOTIFY (0x0010)
  128. #define HERMES_CMD_INQUIRE (0x0011)
  129. /*--- Configure Commands -----------------------------*/
  130. #define HERMES_CMD_ACCESS (0x0021)
  131. #define HERMES_CMD_DOWNLD (0x0022)
  132. /*--- Serial I/O Commands ----------------------------*/
  133. #define HERMES_CMD_READMIF (0x0030)
  134. #define HERMES_CMD_WRITEMIF (0x0031)
  135. /*--- Debugging Commands -----------------------------*/
  136. #define HERMES_CMD_TEST (0x0038)
  137. /* Test command arguments */
  138. #define HERMES_TEST_SET_CHANNEL 0x0800
  139. #define HERMES_TEST_MONITOR 0x0b00
  140. #define HERMES_TEST_STOP 0x0f00
  141. /* Authentication algorithms */
  142. #define HERMES_AUTH_OPEN 1
  143. #define HERMES_AUTH_SHARED_KEY 2
  144. /* WEP settings */
  145. #define HERMES_WEP_PRIVACY_INVOKED 0x0001
  146. #define HERMES_WEP_EXCL_UNENCRYPTED 0x0002
  147. #define HERMES_WEP_HOST_ENCRYPT 0x0010
  148. #define HERMES_WEP_HOST_DECRYPT 0x0080
  149. /* Symbol hostscan options */
  150. #define HERMES_HOSTSCAN_SYMBOL_5SEC 0x0001
  151. #define HERMES_HOSTSCAN_SYMBOL_ONCE 0x0002
  152. #define HERMES_HOSTSCAN_SYMBOL_PASSIVE 0x0040
  153. #define HERMES_HOSTSCAN_SYMBOL_BCAST 0x0080
  154. /*
  155. * Frame structures and constants
  156. */
  157. #define HERMES_DESCRIPTOR_OFFSET 0
  158. #define HERMES_802_11_OFFSET (14)
  159. #define HERMES_802_3_OFFSET (14 + 32)
  160. #define HERMES_802_2_OFFSET (14 + 32 + 14)
  161. #define HERMES_TXCNTL2_OFFSET (HERMES_802_3_OFFSET - 2)
  162. #define HERMES_RXSTAT_ERR (0x0003)
  163. #define HERMES_RXSTAT_BADCRC (0x0001)
  164. #define HERMES_RXSTAT_UNDECRYPTABLE (0x0002)
  165. #define HERMES_RXSTAT_MIC (0x0010) /* Frame contains MIC */
  166. #define HERMES_RXSTAT_MACPORT (0x0700)
  167. #define HERMES_RXSTAT_PCF (0x1000) /* Frame was received in CF period */
  168. #define HERMES_RXSTAT_MIC_KEY_ID (0x1800) /* MIC key used */
  169. #define HERMES_RXSTAT_MSGTYPE (0xE000)
  170. #define HERMES_RXSTAT_1042 (0x2000) /* RFC-1042 frame */
  171. #define HERMES_RXSTAT_TUNNEL (0x4000) /* bridge-tunnel encoded frame */
  172. #define HERMES_RXSTAT_WMP (0x6000) /* Wavelan-II Management Protocol frame */
  173. /* Shift amount for key ID in RXSTAT and TXCTRL */
  174. #define HERMES_MIC_KEY_ID_SHIFT 11
  175. struct hermes_tx_descriptor {
  176. __le16 status;
  177. __le16 reserved1;
  178. __le16 reserved2;
  179. __le32 sw_support;
  180. u8 retry_count;
  181. u8 tx_rate;
  182. __le16 tx_control;
  183. } __packed;
  184. #define HERMES_TXSTAT_RETRYERR (0x0001)
  185. #define HERMES_TXSTAT_AGEDERR (0x0002)
  186. #define HERMES_TXSTAT_DISCON (0x0004)
  187. #define HERMES_TXSTAT_FORMERR (0x0008)
  188. #define HERMES_TXCTRL_TX_OK (0x0002) /* ?? interrupt on Tx complete */
  189. #define HERMES_TXCTRL_TX_EX (0x0004) /* ?? interrupt on Tx exception */
  190. #define HERMES_TXCTRL_802_11 (0x0008) /* We supply 802.11 header */
  191. #define HERMES_TXCTRL_MIC (0x0010) /* 802.3 + TKIP */
  192. #define HERMES_TXCTRL_MIC_KEY_ID (0x1800) /* MIC Key ID mask */
  193. #define HERMES_TXCTRL_ALT_RTRY (0x0020)
  194. /* Inquiry constants and data types */
  195. #define HERMES_INQ_TALLIES (0xF100)
  196. #define HERMES_INQ_SCAN (0xF101)
  197. #define HERMES_INQ_CHANNELINFO (0xF102)
  198. #define HERMES_INQ_HOSTSCAN (0xF103)
  199. #define HERMES_INQ_HOSTSCAN_SYMBOL (0xF104)
  200. #define HERMES_INQ_LINKSTATUS (0xF200)
  201. #define HERMES_INQ_SEC_STAT_AGERE (0xF202)
  202. struct hermes_tallies_frame {
  203. __le16 TxUnicastFrames;
  204. __le16 TxMulticastFrames;
  205. __le16 TxFragments;
  206. __le16 TxUnicastOctets;
  207. __le16 TxMulticastOctets;
  208. __le16 TxDeferredTransmissions;
  209. __le16 TxSingleRetryFrames;
  210. __le16 TxMultipleRetryFrames;
  211. __le16 TxRetryLimitExceeded;
  212. __le16 TxDiscards;
  213. __le16 RxUnicastFrames;
  214. __le16 RxMulticastFrames;
  215. __le16 RxFragments;
  216. __le16 RxUnicastOctets;
  217. __le16 RxMulticastOctets;
  218. __le16 RxFCSErrors;
  219. __le16 RxDiscards_NoBuffer;
  220. __le16 TxDiscardsWrongSA;
  221. __le16 RxWEPUndecryptable;
  222. __le16 RxMsgInMsgFragments;
  223. __le16 RxMsgInBadMsgFragments;
  224. /* Those last are probably not available in very old firmwares */
  225. __le16 RxDiscards_WEPICVError;
  226. __le16 RxDiscards_WEPExcluded;
  227. } __packed;
  228. /* Grabbed from wlan-ng - Thanks Mark... - Jean II
  229. * This is the result of a scan inquiry command */
  230. /* Structure describing info about an Access Point */
  231. struct prism2_scan_apinfo {
  232. __le16 channel; /* Channel where the AP sits */
  233. __le16 noise; /* Noise level */
  234. __le16 level; /* Signal level */
  235. u8 bssid[ETH_ALEN]; /* MAC address of the Access Point */
  236. __le16 beacon_interv; /* Beacon interval */
  237. __le16 capabilities; /* Capabilities */
  238. __le16 essid_len; /* ESSID length */
  239. u8 essid[32]; /* ESSID of the network */
  240. u8 rates[10]; /* Bit rate supported */
  241. __le16 proberesp_rate; /* Data rate of the response frame */
  242. __le16 atim; /* ATIM window time, Kus (hostscan only) */
  243. } __packed;
  244. /* Same stuff for the Lucent/Agere card.
  245. * Thanks to h1kari <h1kari AT dachb0den.com> - Jean II */
  246. struct agere_scan_apinfo {
  247. __le16 channel; /* Channel where the AP sits */
  248. __le16 noise; /* Noise level */
  249. __le16 level; /* Signal level */
  250. u8 bssid[ETH_ALEN]; /* MAC address of the Access Point */
  251. __le16 beacon_interv; /* Beacon interval */
  252. __le16 capabilities; /* Capabilities */
  253. /* bits: 0-ess, 1-ibss, 4-privacy [wep] */
  254. __le16 essid_len; /* ESSID length */
  255. u8 essid[32]; /* ESSID of the network */
  256. } __packed;
  257. /* Moustafa: Scan structure for Symbol cards */
  258. struct symbol_scan_apinfo {
  259. u8 channel; /* Channel where the AP sits */
  260. u8 unknown1; /* 8 in 2.9x and 3.9x f/w, 0 otherwise */
  261. __le16 noise; /* Noise level */
  262. __le16 level; /* Signal level */
  263. u8 bssid[ETH_ALEN]; /* MAC address of the Access Point */
  264. __le16 beacon_interv; /* Beacon interval */
  265. __le16 capabilities; /* Capabilities */
  266. /* bits: 0-ess, 1-ibss, 4-privacy [wep] */
  267. __le16 essid_len; /* ESSID length */
  268. u8 essid[32]; /* ESSID of the network */
  269. __le16 rates[5]; /* Bit rate supported */
  270. __le16 basic_rates; /* Basic rates bitmask */
  271. u8 unknown2[6]; /* Always FF:FF:FF:FF:00:00 */
  272. u8 unknown3[8]; /* Always 0, appeared in f/w 3.91-68 */
  273. } __packed;
  274. union hermes_scan_info {
  275. struct agere_scan_apinfo a;
  276. struct prism2_scan_apinfo p;
  277. struct symbol_scan_apinfo s;
  278. };
  279. /* Extended scan struct for HERMES_INQ_CHANNELINFO.
  280. * wl_lkm calls this an ACS scan (Automatic Channel Select).
  281. * Keep out of union hermes_scan_info because it is much bigger than
  282. * the older scan structures. */
  283. struct agere_ext_scan_info {
  284. __le16 reserved0;
  285. u8 noise;
  286. u8 level;
  287. u8 rx_flow;
  288. u8 rate;
  289. __le16 reserved1[2];
  290. __le16 frame_control;
  291. __le16 dur_id;
  292. u8 addr1[ETH_ALEN];
  293. u8 addr2[ETH_ALEN];
  294. u8 bssid[ETH_ALEN];
  295. __le16 sequence;
  296. u8 addr4[ETH_ALEN];
  297. __le16 data_length;
  298. /* Next 3 fields do not get filled in. */
  299. u8 daddr[ETH_ALEN];
  300. u8 saddr[ETH_ALEN];
  301. __le16 len_type;
  302. __le64 timestamp;
  303. __le16 beacon_interval;
  304. __le16 capabilities;
  305. u8 data[0];
  306. } __packed;
  307. #define HERMES_LINKSTATUS_NOT_CONNECTED (0x0000)
  308. #define HERMES_LINKSTATUS_CONNECTED (0x0001)
  309. #define HERMES_LINKSTATUS_DISCONNECTED (0x0002)
  310. #define HERMES_LINKSTATUS_AP_CHANGE (0x0003)
  311. #define HERMES_LINKSTATUS_AP_OUT_OF_RANGE (0x0004)
  312. #define HERMES_LINKSTATUS_AP_IN_RANGE (0x0005)
  313. #define HERMES_LINKSTATUS_ASSOC_FAILED (0x0006)
  314. struct hermes_linkstatus {
  315. __le16 linkstatus; /* Link status */
  316. } __packed;
  317. struct hermes_response {
  318. u16 status, resp0, resp1, resp2;
  319. };
  320. /* "ID" structure - used for ESSID and station nickname */
  321. struct hermes_idstring {
  322. __le16 len;
  323. __le16 val[16];
  324. } __packed;
  325. struct hermes_multicast {
  326. u8 addr[HERMES_MAX_MULTICAST][ETH_ALEN];
  327. } __packed;
  328. /* Timeouts */
  329. #define HERMES_BAP_BUSY_TIMEOUT (10000) /* In iterations of ~1us */
  330. struct hermes;
  331. /* Functions to access hardware */
  332. struct hermes_ops {
  333. int (*init)(struct hermes *hw);
  334. int (*cmd_wait)(struct hermes *hw, u16 cmd, u16 parm0,
  335. struct hermes_response *resp);
  336. int (*init_cmd_wait)(struct hermes *hw, u16 cmd,
  337. u16 parm0, u16 parm1, u16 parm2,
  338. struct hermes_response *resp);
  339. int (*allocate)(struct hermes *hw, u16 size, u16 *fid);
  340. int (*read_ltv)(struct hermes *hw, int bap, u16 rid, unsigned buflen,
  341. u16 *length, void *buf);
  342. int (*write_ltv)(struct hermes *hw, int bap, u16 rid,
  343. u16 length, const void *value);
  344. int (*bap_pread)(struct hermes *hw, int bap, void *buf, int len,
  345. u16 id, u16 offset);
  346. int (*bap_pwrite)(struct hermes *hw, int bap, const void *buf,
  347. int len, u16 id, u16 offset);
  348. int (*read_pda)(struct hermes *hw, __le16 *pda,
  349. u32 pda_addr, u16 pda_len);
  350. int (*program_init)(struct hermes *hw, u32 entry_point);
  351. int (*program_end)(struct hermes *hw);
  352. int (*program)(struct hermes *hw, const char *buf,
  353. u32 addr, u32 len);
  354. void (*lock_irqsave)(spinlock_t *lock, unsigned long *flags);
  355. void (*unlock_irqrestore)(spinlock_t *lock, unsigned long *flags);
  356. void (*lock_irq)(spinlock_t *lock);
  357. void (*unlock_irq)(spinlock_t *lock);
  358. };
  359. /* Basic control structure */
  360. struct hermes {
  361. void __iomem *iobase;
  362. int reg_spacing;
  363. #define HERMES_16BIT_REGSPACING 0
  364. #define HERMES_32BIT_REGSPACING 1
  365. u16 inten; /* Which interrupts should be enabled? */
  366. bool eeprom_pda;
  367. const struct hermes_ops *ops;
  368. void *priv;
  369. };
  370. /* Register access convenience macros */
  371. #define hermes_read_reg(hw, off) \
  372. (ioread16((hw)->iobase + ((off) << (hw)->reg_spacing)))
  373. #define hermes_write_reg(hw, off, val) \
  374. (iowrite16((val), (hw)->iobase + ((off) << (hw)->reg_spacing)))
  375. #define hermes_read_regn(hw, name) hermes_read_reg((hw), HERMES_##name)
  376. #define hermes_write_regn(hw, name, val) \
  377. hermes_write_reg((hw), HERMES_##name, (val))
  378. /* Function prototypes */
  379. void hermes_struct_init(struct hermes *hw, void __iomem *address,
  380. int reg_spacing);
  381. /* Inline functions */
  382. static inline int hermes_present(struct hermes *hw)
  383. {
  384. return hermes_read_regn(hw, SWSUPPORT0) == HERMES_MAGIC;
  385. }
  386. static inline void hermes_set_irqmask(struct hermes *hw, u16 events)
  387. {
  388. hw->inten = events;
  389. hermes_write_regn(hw, INTEN, events);
  390. }
  391. static inline int hermes_enable_port(struct hermes *hw, int port)
  392. {
  393. return hw->ops->cmd_wait(hw, HERMES_CMD_ENABLE | (port << 8),
  394. 0, NULL);
  395. }
  396. static inline int hermes_disable_port(struct hermes *hw, int port)
  397. {
  398. return hw->ops->cmd_wait(hw, HERMES_CMD_DISABLE | (port << 8),
  399. 0, NULL);
  400. }
  401. /* Initiate an INQUIRE command (tallies or scan). The result will come as an
  402. * information frame in __orinoco_ev_info() */
  403. static inline int hermes_inquire(struct hermes *hw, u16 rid)
  404. {
  405. return hw->ops->cmd_wait(hw, HERMES_CMD_INQUIRE, rid, NULL);
  406. }
  407. #define HERMES_BYTES_TO_RECLEN(n) ((((n) + 1) / 2) + 1)
  408. #define HERMES_RECLEN_TO_BYTES(n) (((n) - 1) * 2)
  409. /* Note that for the next two, the count is in 16-bit words, not bytes */
  410. static inline void hermes_read_words(struct hermes *hw, int off,
  411. void *buf, unsigned count)
  412. {
  413. off = off << hw->reg_spacing;
  414. ioread16_rep(hw->iobase + off, buf, count);
  415. }
  416. static inline void hermes_write_bytes(struct hermes *hw, int off,
  417. const char *buf, unsigned count)
  418. {
  419. off = off << hw->reg_spacing;
  420. iowrite16_rep(hw->iobase + off, buf, count >> 1);
  421. if (unlikely(count & 1))
  422. iowrite8(buf[count - 1], hw->iobase + off);
  423. }
  424. static inline void hermes_clear_words(struct hermes *hw, int off,
  425. unsigned count)
  426. {
  427. unsigned i;
  428. off = off << hw->reg_spacing;
  429. for (i = 0; i < count; i++)
  430. iowrite16(0, hw->iobase + off);
  431. }
  432. #define HERMES_READ_RECORD(hw, bap, rid, buf) \
  433. (hw->ops->read_ltv((hw), (bap), (rid), sizeof(*buf), NULL, (buf)))
  434. #define HERMES_WRITE_RECORD(hw, bap, rid, buf) \
  435. (hw->ops->write_ltv((hw), (bap), (rid), \
  436. HERMES_BYTES_TO_RECLEN(sizeof(*buf)), (buf)))
  437. static inline int hermes_read_wordrec(struct hermes *hw, int bap, u16 rid,
  438. u16 *word)
  439. {
  440. __le16 rec;
  441. int err;
  442. err = HERMES_READ_RECORD(hw, bap, rid, &rec);
  443. *word = le16_to_cpu(rec);
  444. return err;
  445. }
  446. static inline int hermes_write_wordrec(struct hermes *hw, int bap, u16 rid,
  447. u16 word)
  448. {
  449. __le16 rec = cpu_to_le16(word);
  450. return HERMES_WRITE_RECORD(hw, bap, rid, &rec);
  451. }
  452. #endif /* _HERMES_H */