IxEthNpe.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671
  1. #ifndef __doxygen_HIDE /* This file is not part of the API */
  2. /**
  3. * @file IxEthNpe.h
  4. *
  5. * @par
  6. * IXP400 SW Release version 2.0
  7. *
  8. * -- Copyright Notice --
  9. *
  10. * @par
  11. * Copyright 2001-2005, Intel Corporation.
  12. * All rights reserved.
  13. *
  14. * @par
  15. * SPDX-License-Identifier: BSD-3-Clause
  16. * @par
  17. * -- End of Copyright Notice --
  18. */
  19. /**
  20. * @defgroup IxEthNpe IXP400 Ethernet NPE (IxEthNpe) API
  21. *
  22. * @brief Contains the API for Ethernet NPE.
  23. *
  24. * All messages given to NPE, get back an acknowledgment. The acknowledgment
  25. * is identical to the message sent to the NPE (except for NPE_GETSTATUS message).
  26. *
  27. * @{
  28. */
  29. /*--------------------------------------------------------------------------
  30. * APB Message IDs - XScale->NPE
  31. *------------------------------------------------------------------------*/
  32. /**
  33. * @def IX_ETHNPE_NPE_GETSTATUS
  34. *
  35. * @brief Request from the XScale client for the NPE to return the firmware
  36. * version of the currently executing image.
  37. *
  38. * Acknowledgment message id is same as the request message id.
  39. * NPE returns the firmware version ID to XScale.
  40. */
  41. #define IX_ETHNPE_NPE_GETSTATUS 0x00
  42. /**
  43. * @def IX_ETHNPE_EDB_SETPORTADDRESS
  44. *
  45. * @brief Request from the XScale client for the NPE to set the Ethernet
  46. * port's port ID and MAC address.
  47. */
  48. #define IX_ETHNPE_EDB_SETPORTADDRESS 0x01
  49. /**
  50. * @def IX_ETHNPE_EDB_GETMACADDRESSDATABASE
  51. *
  52. * @brief Request from XScale client to the NPE requesting upload of
  53. * Ethernet Filtering Database or Header Conversion Database from NPE's
  54. * data memory to XScale accessible SDRAM.
  55. */
  56. #define IX_ETHNPE_EDB_GETMACADDRESSDATABASE 0x02
  57. /**
  58. * @def IX_ETHNPE_EDB_SETMACADDRESSSDATABASE
  59. *
  60. * @brief Request from XScale client to the NPE requesting download of
  61. * Ethernet Filtering Database or Header Conversion Database from SDRAM
  62. * to the NPE's datamemory.
  63. */
  64. #define IX_ETHNPE_EDB_SETMACADDRESSSDATABASE 0x03
  65. /**
  66. * @def IX_ETHNPE_GETSTATS
  67. *
  68. * @brief Request from the XScale client for the current MAC port statistics
  69. * data to be written to the (empty) statistics structure and the specified
  70. * location in externa memory.
  71. */
  72. #define IX_ETHNPE_GETSTATS 0x04
  73. /**
  74. * @def IX_ETHNPE_RESETSTATS
  75. *
  76. * @brief Request from the XScale client to the NPE to reset all of its internal
  77. * MAC port statistics state variables.
  78. *
  79. * As a side effect, this message entails an implicit request that the NPE
  80. * write the current MAC port statistics into the MAC statistics structure
  81. * at the specified location in external memory.
  82. */
  83. #define IX_ETHNPE_RESETSTATS 0x05
  84. /**
  85. * @def IX_ETHNPE_SETMAXFRAMELENGTHS
  86. *
  87. * @brief Request from the XScale client to the NPE to configure maximum framelengths
  88. * and block sizes in receive and transmit direction.
  89. */
  90. #define IX_ETHNPE_SETMAXFRAMELENGTHS 0x06
  91. /**
  92. * @def IX_ETHNPE_VLAN_SETRXTAGMODE
  93. *
  94. * @brief Request from the XScale client to the NPE to configure VLAN frame type
  95. * filtering and VLAN the tagging mode for the receiver.
  96. */
  97. #define IX_ETHNPE_VLAN_SETRXTAGMODE 0x07
  98. /**
  99. * @def IX_ETHNPE_VLAN_SETDEFAULTRXVID
  100. *
  101. * @brief Request from the XScale client to the NPE to set receiver's default
  102. * VLAN tag (PVID)and internal traffic class.
  103. */
  104. #define IX_ETHNPE_VLAN_SETDEFAULTRXVID 0x08
  105. /**
  106. * @def IX_ETHNPE_VLAN_SETPORTVLANTABLEENTRY
  107. *
  108. * @brief Request from the XScale client to the NPE to configure VLAN Port
  109. * membership and Tx tagging for 8 consecutive VLANID's.
  110. */
  111. #define IX_ETHNPE_VLAN_SETPORTVLANTABLEENTRY 0x09
  112. /**
  113. * @def IX_ETHNPE_VLAN_SETPORTVLANTABLERANGE
  114. *
  115. * @brief Request from the XScale client to the NPE to configure VLAN Port
  116. * membership and Tx tagging for a range of VLANID's.
  117. */
  118. #define IX_ETHNPE_VLAN_SETPORTVLANTABLERANGE 0x0A
  119. /**
  120. * @def IX_ETHNPE_VLAN_SETRXQOSENTRY
  121. *
  122. * @brief Request from the XScale client to the NPE to map a user priority
  123. * to QoS class and an AQM queue number.
  124. */
  125. #define IX_ETHNPE_VLAN_SETRXQOSENTRY 0x0B
  126. /**
  127. * @def IX_ETHNPE_VLAN_SETPORTIDEXTRACTIONMODE
  128. *
  129. * @brief Request from the XScale client to the NPE to enable or disable
  130. * portID extraction from VLAN-tagged frames for the specified port.
  131. */
  132. #define IX_ETHNPE_VLAN_SETPORTIDEXTRACTIONMODE 0x0C
  133. /**
  134. * @def IX_ETHNPE_STP_SETBLOCKINGSTATE
  135. *
  136. * @brief Request from the XScale client to the NPE to block or unblock
  137. * forwarding for spanning tree BPDUs.
  138. */
  139. #define IX_ETHNPE_STP_SETBLOCKINGSTATE 0x0D
  140. /**
  141. * @def IX_ETHNPE_FW_SETFIREWALLMODE
  142. *
  143. * @brief Request from the XScale client to the NPE to configure firewall
  144. * services modes of operation and/or download Ethernet Firewall Database from
  145. * SDRAM to NPE.
  146. */
  147. #define IX_ETHNPE_FW_SETFIREWALLMODE 0x0E
  148. /**
  149. * @def IX_ETHNPE_PC_SETFRAMECONTROLDURATIONID
  150. *
  151. * @brief Request from the XScale client to the NPE to set global frame control
  152. * and duration/ID field for the 802.3 to 802.11 protocol header conversion
  153. * service.
  154. */
  155. #define IX_ETHNPE_PC_SETFRAMECONTROLDURATIONID 0x0F
  156. /**
  157. * @def IX_ETHNPE_PC_SETBBSID
  158. *
  159. * @brief Request from the XScale client to the NPE to set global BBSID field
  160. * value for the 802.3 to 802.11 protocol header conversion service.
  161. */
  162. #define IX_ETHNPE_PC_SETBBSID 0x10
  163. /**
  164. * @def IX_ETHNPE_PC_SETAPMACTABLE
  165. *
  166. * @brief Request from the XScale client to the NPE to update a block/section/
  167. * range of the AP MAC Address Table.
  168. */
  169. #define IX_ETHNPE_PC_SETAPMACTABLE 0x11
  170. /**
  171. * @def IX_ETHNPE_SETLOOPBACK_MODE
  172. *
  173. * @brief Turn on or off the NPE frame loopback.
  174. */
  175. #define IX_ETHNPE_SETLOOPBACK_MODE (0x12)
  176. /*--------------------------------------------------------------------------
  177. * APB Message IDs - NPE->XScale
  178. *------------------------------------------------------------------------*/
  179. /**
  180. * @def IX_ETHNPE_NPE_GETSTATUS_ACK
  181. *
  182. * @brief Acknowledgment to IX_ETHNPE_NPE_GETSTATUS message. NPE firmware version
  183. * id is returned in the message.
  184. */
  185. #define IX_ETHNPE_NPE_GETSTATUS_ACK 0x00
  186. /**
  187. * @def IX_ETHNPE_EDB_SETPORTADDRESS_ACK
  188. *
  189. * @brief Acknowledgment to IX_ETHNPE_EDB_SETPORTADDRESS message.
  190. */
  191. #define IX_ETHNPE_EDB_SETPORTADDRESS_ACK 0x01
  192. /**
  193. * @def IX_ETHNPE_EDB_GETMACADDRESSDATABASE_ACK
  194. *
  195. * @brief Acknowledgment to IX_ETHNPE_EDB_GETMACADDRESSDATABASE message
  196. */
  197. #define IX_ETHNPE_EDB_GETMACADDRESSDATABASE_ACK 0x02
  198. /**
  199. * @def IX_ETHNPE_EDB_SETMACADDRESSSDATABASE_ACK
  200. *
  201. * @brief Acknowledgment to IX_ETHNPE_EDB_SETMACADDRESSSDATABASE message.
  202. */
  203. #define IX_ETHNPE_EDB_SETMACADDRESSSDATABASE_ACK 0x03
  204. /**
  205. * @def IX_ETHNPE_GETSTATS_ACK
  206. *
  207. * @brief Acknowledgment to IX_ETHNPE_GETSTATS message.
  208. */
  209. #define IX_ETHNPE_GETSTATS_ACK 0x04
  210. /**
  211. * @def IX_ETHNPE_RESETSTATS_ACK
  212. *
  213. * @brief Acknowledgment to IX_ETHNPE_RESETSTATS message.
  214. */
  215. #define IX_ETHNPE_RESETSTATS_ACK 0x05
  216. /**
  217. * @def IX_ETHNPE_SETMAXFRAMELENGTHS_ACK
  218. *
  219. * @brief Acknowledgment to IX_ETHNPE_SETMAXFRAMELENGTHS message.
  220. */
  221. #define IX_ETHNPE_SETMAXFRAMELENGTHS_ACK 0x06
  222. /**
  223. * @def IX_ETHNPE_VLAN_SETRXTAGMODE_ACK
  224. *
  225. * @brief Acknowledgment to IX_ETHNPE_VLAN_SETRXTAGMODE message.
  226. */
  227. #define IX_ETHNPE_VLAN_SETRXTAGMODE_ACK 0x07
  228. /**
  229. * @def IX_ETHNPE_VLAN_SETDEFAULTRXVID_ACK
  230. *
  231. * @brief Acknowledgment to IX_ETHNPE_VLAN_SETDEFAULTRXVID message.
  232. */
  233. #define IX_ETHNPE_VLAN_SETDEFAULTRXVID_ACK 0x08
  234. /**
  235. * @def IX_ETHNPE_VLAN_SETPORTVLANTABLEENTRY_ACK
  236. *
  237. * @brief Acknowledgment to IX_ETHNPE_VLAN_SETPORTVLANTABLEENTRY message.
  238. */
  239. #define IX_ETHNPE_VLAN_SETPORTVLANTABLEENTRY_ACK 0x09
  240. /**
  241. * @def IX_ETHNPE_VLAN_SETPORTVLANTABLERANGE_ACK
  242. *
  243. * @brief Acknowledgment to IX_ETHNPE_VLAN_SETPORTVLANTABLERANGE message.
  244. */
  245. #define IX_ETHNPE_VLAN_SETPORTVLANTABLERANGE_ACK 0x0A
  246. /**
  247. * @def IX_ETHNPE_VLAN_SETRXQOSENTRY_ACK
  248. *
  249. * @brief Acknowledgment to IX_ETHNPE_VLAN_SETRXQOSENTRY message.
  250. */
  251. #define IX_ETHNPE_VLAN_SETRXQOSENTRY_ACK 0x0B
  252. /**
  253. * @def IX_ETHNPE_VLAN_SETPORTIDEXTRACTIONMODE_ACK
  254. *
  255. * @brief Acknowledgment to IX_ETHNPE_VLAN_SETPORTIDEXTRACTIONMODE message.
  256. */
  257. #define IX_ETHNPE_VLAN_SETPORTIDEXTRACTIONMODE_ACK 0x0C
  258. /**
  259. * @def IX_ETHNPE_STP_SETBLOCKINGSTATE_ACK
  260. *
  261. * @brief Acknowledgment to IX_ETHNPE_STP_SETBLOCKINGSTATE message.
  262. */
  263. #define IX_ETHNPE_STP_SETBLOCKINGSTATE_ACK 0x0D
  264. /**
  265. * @def IX_ETHNPE_FW_SETFIREWALLMODE_ACK
  266. *
  267. * @brief Acknowledgment to IX_ETHNPE_FW_SETFIREWALLMODE message.
  268. */
  269. #define IX_ETHNPE_FW_SETFIREWALLMODE_ACK 0x0E
  270. /**
  271. * @def IX_ETHNPE_PC_SETFRAMECONTROLDURATIONID_ACK
  272. *
  273. * @brief Acknowledgment to IX_ETHNPE_PC_SETFRAMECONTROLDURATIONID message.
  274. */
  275. #define IX_ETHNPE_PC_SETFRAMECONTROLDURATIONID_ACK 0x0F
  276. /**
  277. * @def IX_ETHNPE_PC_SETBBSID_ACK
  278. *
  279. * @brief Acknowledgment to IX_ETHNPE_PC_SETBBSID message.
  280. */
  281. #define IX_ETHNPE_PC_SETBBSID_ACK 0x10
  282. /**
  283. * @def IX_ETHNPE_PC_SETAPMACTABLE_ACK
  284. *
  285. * @brief Acknowledgment to IX_ETHNPE_PC_SETAPMACTABLE message.
  286. */
  287. #define IX_ETHNPE_PC_SETAPMACTABLE_ACK 0x11
  288. /**
  289. * @def IX_ETHNPE_SETLOOPBACK_MODE_ACK
  290. *
  291. * @brief Acknowledgment to IX_ETHNPE_SETLOOPBACK_MODE message.
  292. */
  293. #define IX_ETHNPE_SETLOOPBACK_MODE_ACK (0x12)
  294. /*--------------------------------------------------------------------------
  295. * Queue Manager Queue entry bit field boundary definitions
  296. *------------------------------------------------------------------------*/
  297. /**
  298. * @def MASK(hi,lo)
  299. *
  300. * @brief Macro for mask
  301. */
  302. #define MASK(hi,lo) (((1 << (1 + ((hi) - (lo)))) - 1) << (lo))
  303. /**
  304. * @def BITS(x,hi,lo)
  305. *
  306. * @brief Macro for bits
  307. */
  308. #define BITS(x,hi,lo) (((x) & MASK(hi,lo)) >> (lo))
  309. /**
  310. * @def IX_ETHNPE_QM_Q_RXENET_LENGTH_MASK
  311. *
  312. * @brief QMgr Queue LENGTH field mask
  313. */
  314. #define IX_ETHNPE_QM_Q_RXENET_LENGTH_MASK 0x3fff
  315. /**
  316. * @def IX_ETHNPE_QM_Q_FIELD_FLAG_R
  317. *
  318. * @brief QMgr Queue FLAG field right boundary
  319. */
  320. #define IX_ETHNPE_QM_Q_FIELD_FLAG_R 20
  321. /**
  322. * @def IX_ETHNPE_QM_Q_FIELD_FLAG_MASK
  323. *
  324. * @brief QMgr Queue FLAG field mask
  325. *
  326. * Multicast bit : BIT(4)
  327. * Broadcast bit : BIT(5)
  328. * IP bit : BIT(6) (linux only)
  329. *
  330. */
  331. #ifdef __vxworks
  332. #define IX_ETHNPE_QM_Q_FIELD_FLAG_MASK 0x30
  333. #else
  334. #define IX_ETHNPE_QM_Q_FIELD_FLAG_MASK 0x70
  335. #endif
  336. /**
  337. * @def IX_ETHNPE_QM_Q_FIELD_NPEID_L
  338. *
  339. * @brief QMgr Queue NPE ID field left boundary
  340. */
  341. #define IX_ETHNPE_QM_Q_FIELD_NPEID_L 1
  342. /**
  343. * @def IX_ETHNPE_QM_Q_FIELD_NPEID_R
  344. *
  345. * @brief QMgr Queue NPE ID field right boundary
  346. */
  347. #define IX_ETHNPE_QM_Q_FIELD_NPEID_R 0
  348. /**
  349. * @def IX_ETHNPE_QM_Q_FIELD_PRIOR_L
  350. *
  351. * @brief QMgr Queue Priority field left boundary
  352. */
  353. #define IX_ETHNPE_QM_Q_FIELD_PRIOR_L 2
  354. /**
  355. * @def IX_ETHNPE_QM_Q_FIELD_PRIOR_R
  356. *
  357. * @brief QMgr Queue Priority field right boundary
  358. */
  359. #define IX_ETHNPE_QM_Q_FIELD_PRIOR_R 0
  360. /**
  361. * @def IX_ETHNPE_QM_Q_FIELD_ADDR_L
  362. *
  363. * @brief QMgr Queue Address field left boundary
  364. */
  365. #define IX_ETHNPE_QM_Q_FIELD_ADDR_L 31
  366. /**
  367. * @def IX_ETHNPE_QM_Q_FIELD_ADDR_R
  368. *
  369. * @brief QMgr Queue Address field right boundary
  370. */
  371. #define IX_ETHNPE_QM_Q_FIELD_ADDR_R 5
  372. /*--------------------------------------------------------------------------
  373. * Queue Manager Queue entry bit field masks
  374. *------------------------------------------------------------------------*/
  375. /**
  376. * @def IX_ETHNPE_QM_Q_FREEENET_ADDR_MASK
  377. *
  378. * @brief Macro to mask the Address field of the FreeEnet Queue Manager Entry
  379. */
  380. #define IX_ETHNPE_QM_Q_FREEENET_ADDR_MASK \
  381. MASK (IX_ETHNPE_QM_Q_FIELD_ADDR_L, \
  382. IX_ETHNPE_QM_Q_FIELD_ADDR_R)
  383. /**
  384. * @def IX_ETHNPE_QM_Q_RXENET_NPEID_MASK
  385. *
  386. * @brief Macro to mask the NPE ID field of the RxEnet Queue Manager Entry
  387. */
  388. #define IX_ETHNPE_QM_Q_RXENET_NPEID_MASK \
  389. MASK (IX_ETHNPE_QM_Q_FIELD_NPEID_L, \
  390. IX_ETHNPE_QM_Q_FIELD_NPEID_R)
  391. /**
  392. * @def IX_ETHNPE_QM_Q_RXENET_ADDR_MASK
  393. *
  394. * @brief Macro to mask the Mbuf Address field of the RxEnet Queue Manager Entry
  395. */
  396. #define IX_ETHNPE_QM_Q_RXENET_ADDR_MASK \
  397. MASK (IX_ETHNPE_QM_Q_FIELD_ADDR_L, \
  398. IX_ETHNPE_QM_Q_FIELD_ADDR_R)
  399. /**
  400. * @def IX_ETHNPE_QM_Q_TXENET_PRIOR_MASK
  401. *
  402. * @brief Macro to mask the Priority field of the TxEnet Queue Manager Entry
  403. */
  404. #define IX_ETHNPE_QM_Q_TXENET_PRIOR_MASK \
  405. MASK (IX_ETHNPE_QM_Q_FIELD_PRIOR_L, \
  406. IX_ETHNPE_QM_Q_FIELD_PRIOR_R)
  407. /**
  408. * @def IX_ETHNPE_QM_Q_TXENET_ADDR_MASK
  409. *
  410. * @brief Macro to mask the Mbuf Address field of the TxEnet Queue Manager Entry
  411. */
  412. #define IX_ETHNPE_QM_Q_TXENET_ADDR_MASK \
  413. MASK (IX_ETHNPE_QM_Q_FIELD_ADDR_L, \
  414. IX_ETHNPE_QM_Q_FIELD_ADDR_R)
  415. /**
  416. * @def IX_ETHNPE_QM_Q_TXENETDONE_NPEID_MASK
  417. *
  418. * @brief Macro to mask the NPE ID field of the TxEnetDone Queue Manager Entry
  419. */
  420. #define IX_ETHNPE_QM_Q_TXENETDONE_NPEID_MASK \
  421. MASK (IX_ETHNPE_QM_Q_FIELD_NPEID_L, \
  422. IX_ETHNPE_QM_Q_FIELD_NPEID_R)
  423. /**
  424. * @def IX_ETHNPE_QM_Q_TXENETDONE_ADDR_MASK
  425. *
  426. * @brief Macro to mask the Mbuf Address field of the TxEnetDone Queue Manager
  427. * Entry
  428. */
  429. #define IX_ETHNPE_QM_Q_TXENETDONE_ADDR_MASK \
  430. MASK (IX_ETHNPE_QM_Q_FIELD_ADDR_L, \
  431. IX_ETHNPE_QM_Q_FIELD_ADDR_R)
  432. /*--------------------------------------------------------------------------
  433. * Queue Manager Queue entry bit field value extraction macros
  434. *------------------------------------------------------------------------*/
  435. /**
  436. * @def IX_ETHNPE_QM_Q_FREEENET_ADDR_VAL(x)
  437. *
  438. * @brief Extraction macro for Address field of FreeNet Queue Manager Entry
  439. *
  440. * Pointer to an mbuf buffer descriptor
  441. */
  442. #define IX_ETHNPE_QM_Q_FREEENET_ADDR_VAL(x) \
  443. ((x) & IX_ETHNPE_QM_Q_FREEENET_ADDR_MASK)
  444. /**
  445. * @def IX_ETHNPE_QM_Q_RXENET_NPEID_VAL(x)
  446. *
  447. * @brief Extraction macro for NPE ID field of RxEnet Queue Manager Entry
  448. *
  449. * Set to 0 for entries originating from the Eth0 NPE;
  450. * Set to 1 for entries originating from the Eth1 NPE.
  451. */
  452. #define IX_ETHNPE_QM_Q_RXENET_NPEID_VAL(x) \
  453. BITS (x, IX_ETHNPE_QM_Q_FIELD_NPEID_L, \
  454. IX_ETHNPE_QM_Q_FIELD_NPEID_R)
  455. /**
  456. * @def IX_ETHNPE_QM_Q_RXENET_PORTID_VAL(x)
  457. *
  458. * @brief Extraction macro for Port ID field of RxEnet Queue Manager Entry
  459. *
  460. * 0-5: Assignable (by the XScale client) to any of the physical ports.
  461. * 6: It is reserved
  462. * 7: Indication that the NPE did not find the associated frame's destination MAC address within
  463. * its internal filtering database.
  464. */
  465. #define IX_ETHNPE_QM_Q_RXENET_PORTID_VAL(x) \
  466. BITS (x, IX_ETHNPE_QM_Q_FIELD_PORTID_L, \
  467. IX_ETHNPE_QM_Q_Field_PortID_R)
  468. /**
  469. * @def IX_ETHNPE_QM_Q_RXENET_ADDR_VAL(x)
  470. *
  471. * @brief Extraction macro for Address field of RxEnet Queue Manager Entry
  472. *
  473. * Pointer to an mbuf buffer descriptor
  474. */
  475. #define IX_ETHNPE_QM_Q_RXENET_ADDR_VAL(x) \
  476. ((x) & IX_ETHNPE_QM_Q_RXENET_ADDR_MASK)
  477. /**
  478. * @def IX_ETHNPE_QM_Q_TXENET_PRIOR_VAL(x)
  479. *
  480. * @brief Extraction macro for Priority field of TxEnet Queue Manager Entry
  481. *
  482. * Priority of the packet (as described in IEEE 802.1D). This field is
  483. * cleared upon return from the Ethernet NPE to the TxEnetDone queue.
  484. */
  485. #define IX_ETHNPE_QM_Q_TXENET_PRIOR_VAL(x) \
  486. BITS (x, IX_ETHNPE_QM_Q_FIELD_PRIOR_L, \
  487. IX_ETHNPE_QM_Q_FIELD_PRIOR_R)
  488. /**
  489. * @def IX_ETHNPE_QM_Q_TXENET_ADDR_VAL(x)
  490. *
  491. * @brief Extraction macro for Address field of Queue Manager TxEnet Queue
  492. * Manager Entry
  493. *
  494. * Pointer to an mbuf buffer descriptor
  495. */
  496. #define IX_ETHNPE_QM_Q_TXENET_ADDR_VAL(x) \
  497. ((x) & IX_ETHNPE_QM_Q_TXENET_ADDR_MASK)
  498. /**
  499. * @def IX_ETHNPE_QM_Q_TXENETDONE_NPEID_VAL(x)
  500. *
  501. * @brief Extraction macro for NPE ID field of TxEnetDone Queue Manager Entry
  502. *
  503. * Set to 0 for entries originating from the Eth0 NPE; set to 1 for en-tries
  504. * originating from the Eth1 NPE.
  505. */
  506. #define IX_ETHNPE_QM_Q_TXENETDONE_NPEID_VAL(x) \
  507. BITS (x, IX_ETHNPE_QM_Q_FIELD_NPEID_L, \
  508. IX_ETHNPE_QM_Q_FIELD_NPEID_R)
  509. /**
  510. * @def IX_ETHNPE_QM_Q_TXENETDONE_ADDR_VAL(x)
  511. *
  512. * @brief Extraction macro for Address field of TxEnetDone Queue Manager Entry
  513. *
  514. * Pointer to an mbuf buffer descriptor
  515. */
  516. #define IX_ETHNPE_QM_Q_TXENETDONE_ADDR_VAL(x) \
  517. ((x) & IX_ETHNPE_QM_Q_TXENETDONE_ADDR_MASK)
  518. /*--------------------------------------------------------------------------
  519. * NPE limits
  520. *------------------------------------------------------------------------*/
  521. /**
  522. * @def IX_ETHNPE_ACC_RXFREE_BUFFER_LENGTH_MIN
  523. *
  524. * @brief Macro to check the minimum length of a rx free buffer
  525. */
  526. #define IX_ETHNPE_ACC_RXFREE_BUFFER_LENGTH_MIN (64)
  527. /**
  528. * @def IX_ETHNPE_ACC_RXFREE_BUFFER_LENGTH_MASK
  529. *
  530. * @brief Mask to apply to the mbuf length before submitting it to the NPE
  531. * (the NPE handles only rx free mbufs which are multiple of 64)
  532. *
  533. * @sa IX_ETHNPE_ACC_RXFREE_BUFFER_LENGTH_MASK
  534. */
  535. #define IX_ETHNPE_ACC_RXFREE_BUFFER_LENGTH_MASK (~63)
  536. /**
  537. * @def IX_ETHNPE_ACC_RXFREE_BUFFER_ROUND_UP(size)
  538. *
  539. * @brief Round up to get the size necessary to receive without chaining
  540. * the frames which are (size) bytes (the NPE operates by multiple of 64)
  541. * e.g. To receive 1514 bytes frames, the size of the buffers in replenish
  542. * has to be at least (1514+63)&(~63) = 1536 bytes.
  543. *
  544. */
  545. #define IX_ETHNPE_ACC_RXFREE_BUFFER_ROUND_UP(size) (((size) + 63) & ~63)
  546. /**
  547. * @def IX_ETHNPE_ACC_RXFREE_BUFFER_ROUND_DOWN(size)
  548. *
  549. * @brief Round down to apply to the mbuf length before submitting
  550. * it to the NPE. (the NPE operates by multiple of 64)
  551. *
  552. */
  553. #define IX_ETHNPE_ACC_RXFREE_BUFFER_ROUND_DOWN(size) ((size) & ~63)
  554. /**
  555. * @def IX_ETHNPE_ACC_FRAME_LENGTH_MAX
  556. *
  557. * @brief maximum mbuf length supported by the NPE
  558. *
  559. * @sa IX_ETHNPE_ACC_FRAME_LENGTH_MAX
  560. */
  561. #define IX_ETHNPE_ACC_FRAME_LENGTH_MAX (16320)
  562. /**
  563. * @def IX_ETHNPE_ACC_FRAME_LENGTH_DEFAULT
  564. *
  565. * @brief default mbuf length supported by the NPE
  566. *
  567. * @sa IX_ETHNPE_ACC_FRAME_LENGTH_DEFAULT
  568. */
  569. #define IX_ETHNPE_ACC_FRAME_LENGTH_DEFAULT (1522)
  570. /**
  571. * @def IX_ETHNPE_ACC_LENGTH_OFFSET
  572. *
  573. * @brief Offset of the cluster length field in the word shared with the NPEs
  574. */
  575. #define IX_ETHNPE_ACC_LENGTH_OFFSET 16
  576. /**
  577. * @def IX_ETHNPE_ACC_PKTLENGTH_MASK
  578. *
  579. * @brief Mask of the cluster length field in the word shared with the NPEs
  580. */
  581. #define IX_ETHNPE_ACC_PKTLENGTH_MASK 0x3fff
  582. /**
  583. *@}
  584. */
  585. #endif /* __doxygen_HIDE */