dpni-cmd.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686
  1. /* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */
  2. /* Copyright 2013-2016 Freescale Semiconductor Inc.
  3. * Copyright 2016 NXP
  4. * Copyright 2020 NXP
  5. */
  6. #ifndef _FSL_DPNI_CMD_H
  7. #define _FSL_DPNI_CMD_H
  8. #include "dpni.h"
  9. /* DPNI Version */
  10. #define DPNI_VER_MAJOR 7
  11. #define DPNI_VER_MINOR 0
  12. #define DPNI_CMD_BASE_VERSION 1
  13. #define DPNI_CMD_2ND_VERSION 2
  14. #define DPNI_CMD_ID_OFFSET 4
  15. #define DPNI_CMD(id) (((id) << DPNI_CMD_ID_OFFSET) | DPNI_CMD_BASE_VERSION)
  16. #define DPNI_CMD_V2(id) (((id) << DPNI_CMD_ID_OFFSET) | DPNI_CMD_2ND_VERSION)
  17. #define DPNI_CMDID_OPEN DPNI_CMD(0x801)
  18. #define DPNI_CMDID_CLOSE DPNI_CMD(0x800)
  19. #define DPNI_CMDID_CREATE DPNI_CMD(0x901)
  20. #define DPNI_CMDID_DESTROY DPNI_CMD(0x900)
  21. #define DPNI_CMDID_GET_API_VERSION DPNI_CMD(0xa01)
  22. #define DPNI_CMDID_ENABLE DPNI_CMD(0x002)
  23. #define DPNI_CMDID_DISABLE DPNI_CMD(0x003)
  24. #define DPNI_CMDID_GET_ATTR DPNI_CMD(0x004)
  25. #define DPNI_CMDID_RESET DPNI_CMD(0x005)
  26. #define DPNI_CMDID_IS_ENABLED DPNI_CMD(0x006)
  27. #define DPNI_CMDID_SET_IRQ DPNI_CMD(0x010)
  28. #define DPNI_CMDID_GET_IRQ DPNI_CMD(0x011)
  29. #define DPNI_CMDID_SET_IRQ_ENABLE DPNI_CMD(0x012)
  30. #define DPNI_CMDID_GET_IRQ_ENABLE DPNI_CMD(0x013)
  31. #define DPNI_CMDID_SET_IRQ_MASK DPNI_CMD(0x014)
  32. #define DPNI_CMDID_GET_IRQ_MASK DPNI_CMD(0x015)
  33. #define DPNI_CMDID_GET_IRQ_STATUS DPNI_CMD(0x016)
  34. #define DPNI_CMDID_CLEAR_IRQ_STATUS DPNI_CMD(0x017)
  35. #define DPNI_CMDID_SET_POOLS DPNI_CMD(0x200)
  36. #define DPNI_CMDID_SET_ERRORS_BEHAVIOR DPNI_CMD(0x20B)
  37. #define DPNI_CMDID_GET_QDID DPNI_CMD(0x210)
  38. #define DPNI_CMDID_GET_TX_DATA_OFFSET DPNI_CMD(0x212)
  39. #define DPNI_CMDID_GET_LINK_STATE DPNI_CMD(0x215)
  40. #define DPNI_CMDID_SET_MAX_FRAME_LENGTH DPNI_CMD(0x216)
  41. #define DPNI_CMDID_GET_MAX_FRAME_LENGTH DPNI_CMD(0x217)
  42. #define DPNI_CMDID_SET_LINK_CFG DPNI_CMD(0x21A)
  43. #define DPNI_CMDID_SET_TX_SHAPING DPNI_CMD_V2(0x21B)
  44. #define DPNI_CMDID_SET_MCAST_PROMISC DPNI_CMD(0x220)
  45. #define DPNI_CMDID_GET_MCAST_PROMISC DPNI_CMD(0x221)
  46. #define DPNI_CMDID_SET_UNICAST_PROMISC DPNI_CMD(0x222)
  47. #define DPNI_CMDID_GET_UNICAST_PROMISC DPNI_CMD(0x223)
  48. #define DPNI_CMDID_SET_PRIM_MAC DPNI_CMD(0x224)
  49. #define DPNI_CMDID_GET_PRIM_MAC DPNI_CMD(0x225)
  50. #define DPNI_CMDID_ADD_MAC_ADDR DPNI_CMD(0x226)
  51. #define DPNI_CMDID_REMOVE_MAC_ADDR DPNI_CMD(0x227)
  52. #define DPNI_CMDID_CLR_MAC_FILTERS DPNI_CMD(0x228)
  53. #define DPNI_CMDID_SET_RX_TC_DIST DPNI_CMD(0x235)
  54. #define DPNI_CMDID_ENABLE_VLAN_FILTER DPNI_CMD(0x230)
  55. #define DPNI_CMDID_ADD_VLAN_ID DPNI_CMD_V2(0x231)
  56. #define DPNI_CMDID_REMOVE_VLAN_ID DPNI_CMD(0x232)
  57. #define DPNI_CMDID_SET_QOS_TBL DPNI_CMD(0x240)
  58. #define DPNI_CMDID_ADD_QOS_ENT DPNI_CMD(0x241)
  59. #define DPNI_CMDID_REMOVE_QOS_ENT DPNI_CMD(0x242)
  60. #define DPNI_CMDID_CLR_QOS_TBL DPNI_CMD(0x243)
  61. #define DPNI_CMDID_ADD_FS_ENT DPNI_CMD(0x244)
  62. #define DPNI_CMDID_REMOVE_FS_ENT DPNI_CMD(0x245)
  63. #define DPNI_CMDID_CLR_FS_ENT DPNI_CMD(0x246)
  64. #define DPNI_CMDID_GET_STATISTICS DPNI_CMD(0x25D)
  65. #define DPNI_CMDID_GET_QUEUE DPNI_CMD(0x25F)
  66. #define DPNI_CMDID_SET_QUEUE DPNI_CMD(0x260)
  67. #define DPNI_CMDID_GET_TAILDROP DPNI_CMD(0x261)
  68. #define DPNI_CMDID_SET_TAILDROP DPNI_CMD(0x262)
  69. #define DPNI_CMDID_GET_PORT_MAC_ADDR DPNI_CMD(0x263)
  70. #define DPNI_CMDID_GET_BUFFER_LAYOUT DPNI_CMD(0x264)
  71. #define DPNI_CMDID_SET_BUFFER_LAYOUT DPNI_CMD(0x265)
  72. #define DPNI_CMDID_SET_TX_CONFIRMATION_MODE DPNI_CMD(0x266)
  73. #define DPNI_CMDID_SET_CONGESTION_NOTIFICATION DPNI_CMD(0x267)
  74. #define DPNI_CMDID_GET_CONGESTION_NOTIFICATION DPNI_CMD(0x268)
  75. #define DPNI_CMDID_SET_EARLY_DROP DPNI_CMD(0x269)
  76. #define DPNI_CMDID_GET_EARLY_DROP DPNI_CMD(0x26A)
  77. #define DPNI_CMDID_GET_OFFLOAD DPNI_CMD(0x26B)
  78. #define DPNI_CMDID_SET_OFFLOAD DPNI_CMD(0x26C)
  79. #define DPNI_CMDID_SET_RX_FS_DIST DPNI_CMD(0x273)
  80. #define DPNI_CMDID_SET_RX_HASH_DIST DPNI_CMD(0x274)
  81. #define DPNI_CMDID_GET_LINK_CFG DPNI_CMD(0x278)
  82. #define DPNI_CMDID_SET_SINGLE_STEP_CFG DPNI_CMD(0x279)
  83. #define DPNI_CMDID_GET_SINGLE_STEP_CFG DPNI_CMD_V2(0x27a)
  84. /* Macros for accessing command fields smaller than 1byte */
  85. #define DPNI_MASK(field) \
  86. GENMASK(DPNI_##field##_SHIFT + DPNI_##field##_SIZE - 1, \
  87. DPNI_##field##_SHIFT)
  88. #define dpni_set_field(var, field, val) \
  89. ((var) |= (((val) << DPNI_##field##_SHIFT) & DPNI_MASK(field)))
  90. #define dpni_get_field(var, field) \
  91. (((var) & DPNI_MASK(field)) >> DPNI_##field##_SHIFT)
  92. struct dpni_cmd_open {
  93. __le32 dpni_id;
  94. };
  95. #define DPNI_BACKUP_POOL(val, order) (((val) & 0x1) << (order))
  96. struct dpni_cmd_set_pools {
  97. /* cmd word 0 */
  98. u8 num_dpbp;
  99. u8 backup_pool_mask;
  100. __le16 pad;
  101. /* cmd word 0..4 */
  102. __le32 dpbp_id[DPNI_MAX_DPBP];
  103. /* cmd word 4..6 */
  104. __le16 buffer_size[DPNI_MAX_DPBP];
  105. };
  106. /* The enable indication is always the least significant bit */
  107. #define DPNI_ENABLE_SHIFT 0
  108. #define DPNI_ENABLE_SIZE 1
  109. struct dpni_rsp_is_enabled {
  110. u8 enabled;
  111. };
  112. struct dpni_rsp_get_irq {
  113. /* response word 0 */
  114. __le32 irq_val;
  115. __le32 pad;
  116. /* response word 1 */
  117. __le64 irq_addr;
  118. /* response word 2 */
  119. __le32 irq_num;
  120. __le32 type;
  121. };
  122. struct dpni_cmd_set_irq_enable {
  123. u8 enable;
  124. u8 pad[3];
  125. u8 irq_index;
  126. };
  127. struct dpni_cmd_get_irq_enable {
  128. __le32 pad;
  129. u8 irq_index;
  130. };
  131. struct dpni_rsp_get_irq_enable {
  132. u8 enabled;
  133. };
  134. struct dpni_cmd_set_irq_mask {
  135. __le32 mask;
  136. u8 irq_index;
  137. };
  138. struct dpni_cmd_get_irq_mask {
  139. __le32 pad;
  140. u8 irq_index;
  141. };
  142. struct dpni_rsp_get_irq_mask {
  143. __le32 mask;
  144. };
  145. struct dpni_cmd_get_irq_status {
  146. __le32 status;
  147. u8 irq_index;
  148. };
  149. struct dpni_rsp_get_irq_status {
  150. __le32 status;
  151. };
  152. struct dpni_cmd_clear_irq_status {
  153. __le32 status;
  154. u8 irq_index;
  155. };
  156. struct dpni_rsp_get_attr {
  157. /* response word 0 */
  158. __le32 options;
  159. u8 num_queues;
  160. u8 num_tcs;
  161. u8 mac_filter_entries;
  162. u8 pad0;
  163. /* response word 1 */
  164. u8 vlan_filter_entries;
  165. u8 pad1;
  166. u8 qos_entries;
  167. u8 pad2;
  168. __le16 fs_entries;
  169. __le16 pad3;
  170. /* response word 2 */
  171. u8 qos_key_size;
  172. u8 fs_key_size;
  173. __le16 wriop_version;
  174. };
  175. #define DPNI_ERROR_ACTION_SHIFT 0
  176. #define DPNI_ERROR_ACTION_SIZE 4
  177. #define DPNI_FRAME_ANN_SHIFT 4
  178. #define DPNI_FRAME_ANN_SIZE 1
  179. struct dpni_cmd_set_errors_behavior {
  180. __le32 errors;
  181. /* from least significant bit: error_action:4, set_frame_annotation:1 */
  182. u8 flags;
  183. };
  184. /* There are 3 separate commands for configuring Rx, Tx and Tx confirmation
  185. * buffer layouts, but they all share the same parameters.
  186. * If one of the functions changes, below structure needs to be split.
  187. */
  188. #define DPNI_PASS_TS_SHIFT 0
  189. #define DPNI_PASS_TS_SIZE 1
  190. #define DPNI_PASS_PR_SHIFT 1
  191. #define DPNI_PASS_PR_SIZE 1
  192. #define DPNI_PASS_FS_SHIFT 2
  193. #define DPNI_PASS_FS_SIZE 1
  194. struct dpni_cmd_get_buffer_layout {
  195. u8 qtype;
  196. };
  197. struct dpni_rsp_get_buffer_layout {
  198. /* response word 0 */
  199. u8 pad0[6];
  200. /* from LSB: pass_timestamp:1, parser_result:1, frame_status:1 */
  201. u8 flags;
  202. u8 pad1;
  203. /* response word 1 */
  204. __le16 private_data_size;
  205. __le16 data_align;
  206. __le16 head_room;
  207. __le16 tail_room;
  208. };
  209. struct dpni_cmd_set_buffer_layout {
  210. /* cmd word 0 */
  211. u8 qtype;
  212. u8 pad0[3];
  213. __le16 options;
  214. /* from LSB: pass_timestamp:1, parser_result:1, frame_status:1 */
  215. u8 flags;
  216. u8 pad1;
  217. /* cmd word 1 */
  218. __le16 private_data_size;
  219. __le16 data_align;
  220. __le16 head_room;
  221. __le16 tail_room;
  222. };
  223. struct dpni_cmd_set_offload {
  224. u8 pad[3];
  225. u8 dpni_offload;
  226. __le32 config;
  227. };
  228. struct dpni_cmd_get_offload {
  229. u8 pad[3];
  230. u8 dpni_offload;
  231. };
  232. struct dpni_rsp_get_offload {
  233. __le32 pad;
  234. __le32 config;
  235. };
  236. struct dpni_cmd_get_qdid {
  237. u8 qtype;
  238. };
  239. struct dpni_rsp_get_qdid {
  240. __le16 qdid;
  241. };
  242. struct dpni_rsp_get_tx_data_offset {
  243. __le16 data_offset;
  244. };
  245. struct dpni_cmd_get_statistics {
  246. u8 page_number;
  247. };
  248. struct dpni_rsp_get_statistics {
  249. __le64 counter[DPNI_STATISTICS_CNT];
  250. };
  251. struct dpni_cmd_link_cfg {
  252. /* cmd word 0 */
  253. __le64 pad0;
  254. /* cmd word 1 */
  255. __le32 rate;
  256. __le32 pad1;
  257. /* cmd word 2 */
  258. __le64 options;
  259. };
  260. #define DPNI_LINK_STATE_SHIFT 0
  261. #define DPNI_LINK_STATE_SIZE 1
  262. struct dpni_rsp_get_link_state {
  263. /* response word 0 */
  264. __le32 pad0;
  265. /* from LSB: up:1 */
  266. u8 flags;
  267. u8 pad1[3];
  268. /* response word 1 */
  269. __le32 rate;
  270. __le32 pad2;
  271. /* response word 2 */
  272. __le64 options;
  273. };
  274. struct dpni_cmd_set_max_frame_length {
  275. __le16 max_frame_length;
  276. };
  277. struct dpni_rsp_get_max_frame_length {
  278. __le16 max_frame_length;
  279. };
  280. struct dpni_cmd_set_multicast_promisc {
  281. u8 enable;
  282. };
  283. struct dpni_rsp_get_multicast_promisc {
  284. u8 enabled;
  285. };
  286. struct dpni_cmd_set_unicast_promisc {
  287. u8 enable;
  288. };
  289. struct dpni_rsp_get_unicast_promisc {
  290. u8 enabled;
  291. };
  292. struct dpni_cmd_set_primary_mac_addr {
  293. __le16 pad;
  294. u8 mac_addr[6];
  295. };
  296. struct dpni_rsp_get_primary_mac_addr {
  297. __le16 pad;
  298. u8 mac_addr[6];
  299. };
  300. struct dpni_rsp_get_port_mac_addr {
  301. __le16 pad;
  302. u8 mac_addr[6];
  303. };
  304. struct dpni_cmd_add_mac_addr {
  305. __le16 pad;
  306. u8 mac_addr[6];
  307. };
  308. struct dpni_cmd_remove_mac_addr {
  309. __le16 pad;
  310. u8 mac_addr[6];
  311. };
  312. #define DPNI_UNICAST_FILTERS_SHIFT 0
  313. #define DPNI_UNICAST_FILTERS_SIZE 1
  314. #define DPNI_MULTICAST_FILTERS_SHIFT 1
  315. #define DPNI_MULTICAST_FILTERS_SIZE 1
  316. struct dpni_cmd_clear_mac_filters {
  317. /* from LSB: unicast:1, multicast:1 */
  318. u8 flags;
  319. };
  320. #define DPNI_DIST_MODE_SHIFT 0
  321. #define DPNI_DIST_MODE_SIZE 4
  322. #define DPNI_MISS_ACTION_SHIFT 4
  323. #define DPNI_MISS_ACTION_SIZE 4
  324. struct dpni_cmd_set_rx_tc_dist {
  325. /* cmd word 0 */
  326. __le16 dist_size;
  327. u8 tc_id;
  328. /* from LSB: dist_mode:4, miss_action:4 */
  329. u8 flags;
  330. __le16 pad0;
  331. __le16 default_flow_id;
  332. /* cmd word 1..5 */
  333. __le64 pad1[5];
  334. /* cmd word 6 */
  335. __le64 key_cfg_iova;
  336. };
  337. /* dpni_set_rx_tc_dist extension (structure of the DMA-able memory at
  338. * key_cfg_iova)
  339. */
  340. struct dpni_mask_cfg {
  341. u8 mask;
  342. u8 offset;
  343. };
  344. #define DPNI_EFH_TYPE_SHIFT 0
  345. #define DPNI_EFH_TYPE_SIZE 4
  346. #define DPNI_EXTRACT_TYPE_SHIFT 0
  347. #define DPNI_EXTRACT_TYPE_SIZE 4
  348. struct dpni_dist_extract {
  349. /* word 0 */
  350. u8 prot;
  351. /* EFH type stored in the 4 least significant bits */
  352. u8 efh_type;
  353. u8 size;
  354. u8 offset;
  355. __le32 field;
  356. /* word 1 */
  357. u8 hdr_index;
  358. u8 constant;
  359. u8 num_of_repeats;
  360. u8 num_of_byte_masks;
  361. /* Extraction type is stored in the 4 LSBs */
  362. u8 extract_type;
  363. u8 pad[3];
  364. /* word 2 */
  365. struct dpni_mask_cfg masks[4];
  366. };
  367. struct dpni_ext_set_rx_tc_dist {
  368. /* extension word 0 */
  369. u8 num_extracts;
  370. u8 pad[7];
  371. /* words 1..25 */
  372. struct dpni_dist_extract extracts[DPKG_MAX_NUM_OF_EXTRACTS];
  373. };
  374. struct dpni_cmd_get_queue {
  375. u8 qtype;
  376. u8 tc;
  377. u8 index;
  378. };
  379. #define DPNI_DEST_TYPE_SHIFT 0
  380. #define DPNI_DEST_TYPE_SIZE 4
  381. #define DPNI_STASH_CTRL_SHIFT 6
  382. #define DPNI_STASH_CTRL_SIZE 1
  383. #define DPNI_HOLD_ACTIVE_SHIFT 7
  384. #define DPNI_HOLD_ACTIVE_SIZE 1
  385. struct dpni_rsp_get_queue {
  386. /* response word 0 */
  387. __le64 pad0;
  388. /* response word 1 */
  389. __le32 dest_id;
  390. __le16 pad1;
  391. u8 dest_prio;
  392. /* From LSB: dest_type:4, pad:2, flc_stash_ctrl:1, hold_active:1 */
  393. u8 flags;
  394. /* response word 2 */
  395. __le64 flc;
  396. /* response word 3 */
  397. __le64 user_context;
  398. /* response word 4 */
  399. __le32 fqid;
  400. __le16 qdbin;
  401. };
  402. struct dpni_cmd_set_queue {
  403. /* cmd word 0 */
  404. u8 qtype;
  405. u8 tc;
  406. u8 index;
  407. u8 options;
  408. __le32 pad0;
  409. /* cmd word 1 */
  410. __le32 dest_id;
  411. __le16 pad1;
  412. u8 dest_prio;
  413. u8 flags;
  414. /* cmd word 2 */
  415. __le64 flc;
  416. /* cmd word 3 */
  417. __le64 user_context;
  418. };
  419. struct dpni_cmd_set_taildrop {
  420. /* cmd word 0 */
  421. u8 congestion_point;
  422. u8 qtype;
  423. u8 tc;
  424. u8 index;
  425. __le32 pad0;
  426. /* cmd word 1 */
  427. /* Only least significant bit is relevant */
  428. u8 enable;
  429. u8 pad1;
  430. u8 units;
  431. u8 pad2;
  432. __le32 threshold;
  433. };
  434. struct dpni_cmd_get_taildrop {
  435. u8 congestion_point;
  436. u8 qtype;
  437. u8 tc;
  438. u8 index;
  439. };
  440. struct dpni_rsp_get_taildrop {
  441. /* cmd word 0 */
  442. __le64 pad0;
  443. /* cmd word 1 */
  444. /* only least significant bit is relevant */
  445. u8 enable;
  446. u8 pad1;
  447. u8 units;
  448. u8 pad2;
  449. __le32 threshold;
  450. };
  451. struct dpni_rsp_get_api_version {
  452. __le16 major;
  453. __le16 minor;
  454. };
  455. #define DPNI_RX_FS_DIST_ENABLE_SHIFT 0
  456. #define DPNI_RX_FS_DIST_ENABLE_SIZE 1
  457. struct dpni_cmd_set_rx_fs_dist {
  458. __le16 dist_size;
  459. u8 enable;
  460. u8 tc;
  461. __le16 miss_flow_id;
  462. __le16 pad;
  463. __le64 key_cfg_iova;
  464. };
  465. #define DPNI_RX_HASH_DIST_ENABLE_SHIFT 0
  466. #define DPNI_RX_HASH_DIST_ENABLE_SIZE 1
  467. struct dpni_cmd_set_rx_hash_dist {
  468. __le16 dist_size;
  469. u8 enable;
  470. u8 tc;
  471. __le32 pad;
  472. __le64 key_cfg_iova;
  473. };
  474. struct dpni_cmd_add_fs_entry {
  475. /* cmd word 0 */
  476. __le16 options;
  477. u8 tc_id;
  478. u8 key_size;
  479. __le16 index;
  480. __le16 flow_id;
  481. /* cmd word 1 */
  482. __le64 key_iova;
  483. /* cmd word 2 */
  484. __le64 mask_iova;
  485. /* cmd word 3 */
  486. __le64 flc;
  487. };
  488. struct dpni_cmd_remove_fs_entry {
  489. /* cmd word 0 */
  490. __le16 pad0;
  491. u8 tc_id;
  492. u8 key_size;
  493. __le32 pad1;
  494. /* cmd word 1 */
  495. __le64 key_iova;
  496. /* cmd word 2 */
  497. __le64 mask_iova;
  498. };
  499. #define DPNI_DISCARD_ON_MISS_SHIFT 0
  500. #define DPNI_DISCARD_ON_MISS_SIZE 1
  501. struct dpni_cmd_set_qos_table {
  502. __le32 pad;
  503. u8 default_tc;
  504. /* only the LSB */
  505. u8 discard_on_miss;
  506. __le16 pad1[21];
  507. __le64 key_cfg_iova;
  508. };
  509. struct dpni_cmd_add_qos_entry {
  510. __le16 pad;
  511. u8 tc_id;
  512. u8 key_size;
  513. __le16 index;
  514. __le16 pad1;
  515. __le64 key_iova;
  516. __le64 mask_iova;
  517. };
  518. struct dpni_cmd_remove_qos_entry {
  519. u8 pad[3];
  520. u8 key_size;
  521. __le32 pad1;
  522. __le64 key_iova;
  523. __le64 mask_iova;
  524. };
  525. #define DPNI_DEST_TYPE_SHIFT 0
  526. #define DPNI_DEST_TYPE_SIZE 4
  527. #define DPNI_CONG_UNITS_SHIFT 4
  528. #define DPNI_CONG_UNITS_SIZE 2
  529. struct dpni_cmd_set_congestion_notification {
  530. /* cmd word 0 */
  531. u8 qtype;
  532. u8 tc;
  533. u8 pad[6];
  534. /* cmd word 1 */
  535. __le32 dest_id;
  536. __le16 notification_mode;
  537. u8 dest_priority;
  538. /* from LSB: dest_type: 4 units:2 */
  539. u8 type_units;
  540. /* cmd word 2 */
  541. __le64 message_iova;
  542. /* cmd word 3 */
  543. __le64 message_ctx;
  544. /* cmd word 4 */
  545. __le32 threshold_entry;
  546. __le32 threshold_exit;
  547. };
  548. #define DPNI_COUPLED_SHIFT 0
  549. #define DPNI_COUPLED_SIZE 1
  550. struct dpni_cmd_set_tx_shaping {
  551. __le16 tx_cr_max_burst_size;
  552. __le16 tx_er_max_burst_size;
  553. __le32 pad;
  554. __le32 tx_cr_rate_limit;
  555. __le32 tx_er_rate_limit;
  556. /* from LSB: coupled:1 */
  557. u8 coupled;
  558. };
  559. #define DPNI_PTP_ENABLE_SHIFT 0
  560. #define DPNI_PTP_ENABLE_SIZE 1
  561. #define DPNI_PTP_CH_UPDATE_SHIFT 1
  562. #define DPNI_PTP_CH_UPDATE_SIZE 1
  563. struct dpni_cmd_single_step_cfg {
  564. __le16 flags;
  565. __le16 offset;
  566. __le32 peer_delay;
  567. __le32 ptp_onestep_reg_base;
  568. __le32 pad0;
  569. };
  570. struct dpni_rsp_single_step_cfg {
  571. __le16 flags;
  572. __le16 offset;
  573. __le32 peer_delay;
  574. __le32 ptp_onestep_reg_base;
  575. __le32 pad0;
  576. };
  577. struct dpni_cmd_enable_vlan_filter {
  578. /* only the LSB */
  579. u8 en;
  580. };
  581. struct dpni_cmd_vlan_id {
  582. u8 flags;
  583. u8 tc_id;
  584. u8 flow_id;
  585. u8 pad;
  586. __le16 vlan_id;
  587. };
  588. #endif /* _FSL_DPNI_CMD_H */