c0208569b682b36b2e19285a3aead027c68d5bde
[dpdk.git] / drivers / net / atlantic / rte_pmd_atlantic.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2018 Aquantia Corporation
3  */
4
5 /**
6  * @file rte_pmd_atlantic.h
7  * atlantic PMD specific functions.
8  *
9  **/
10
11 #ifndef _PMD_ATLANTIC_H_
12 #define _PMD_ATLANTIC_H_
13
14 #include <rte_ethdev_driver.h>
15
16 /**
17  * @warning
18  * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
19  *
20  * Enable MACsec offload.
21  *
22  * @param port
23  *   The port identifier of the Ethernet device.
24  * @param encr
25  *    1 - Enable encryption (encrypt and add integrity signature).
26  *    0 - Disable encryption (only add integrity signature).
27  * @param repl_prot
28  *    1 - Enable replay protection.
29  *    0 - Disable replay protection.
30  * @return
31  *   - (0) if successful.
32  *   - (-ENODEV) if *port* invalid.
33  *   - (-ENOTSUP) if hardware doesn't support this feature.
34  */
35 __rte_experimental
36 int rte_pmd_atl_macsec_enable(uint16_t port, uint8_t encr, uint8_t repl_prot);
37
38 /**
39  * @warning
40  * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
41  *
42  * Disable MACsec offload.
43  *
44  * @param port
45  *   The port identifier of the Ethernet device.
46  * @return
47  *   - (0) if successful.
48  *   - (-ENODEV) if *port* invalid.
49  *   - (-ENOTSUP) if hardware doesn't support this feature.
50  */
51 __rte_experimental
52 int rte_pmd_atl_macsec_disable(uint16_t port);
53
54 /**
55  * @warning
56  * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
57  *
58  * Configure Tx SC (Secure Connection).
59  *
60  * @param port
61  *   The port identifier of the Ethernet device.
62  * @param mac
63  *   The MAC address on the local side.
64  * @return
65  *   - (0) if successful.
66  *   - (-ENODEV) if *port* invalid.
67  *   - (-ENOTSUP) if hardware doesn't support this feature.
68  */
69 __rte_experimental
70 int rte_pmd_atl_macsec_config_txsc(uint16_t port, uint8_t *mac);
71
72 /**
73  * @warning
74  * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
75  *
76  * Configure Rx SC (Secure Connection).
77  *
78  * @param port
79  *   The port identifier of the Ethernet device.
80  * @param mac
81  *   The MAC address on the remote side.
82  * @param pi
83  *   The PI (port identifier) on the remote side.
84  * @return
85  *   - (0) if successful.
86  *   - (-ENODEV) if *port* invalid.
87  *   - (-ENOTSUP) if hardware doesn't support this feature.
88  */
89 __rte_experimental
90 int rte_pmd_atl_macsec_config_rxsc(uint16_t port, uint8_t *mac, uint16_t pi);
91
92 /**
93  * @warning
94  * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
95  *
96  * Enable Tx SA (Secure Association).
97  *
98  * @param port
99  *   The port identifier of the Ethernet device.
100  * @param idx
101  *   The SA to be enabled (0 or 1).
102  * @param an
103  *   The association number on the local side.
104  * @param pn
105  *   The packet number on the local side.
106  * @param key
107  *   The key on the local side.
108  * @return
109  *   - (0) if successful.
110  *   - (-ENODEV) if *port* invalid.
111  *   - (-ENOTSUP) if hardware doesn't support this feature.
112  *   - (-EINVAL) if bad parameter.
113  */
114 __rte_experimental
115 int rte_pmd_atl_macsec_select_txsa(uint16_t port, uint8_t idx, uint8_t an,
116                                    uint32_t pn, uint8_t *key);
117
118 /**
119  * @warning
120  * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
121  *
122  * Enable Rx SA (Secure Association).
123  *
124  * @param port
125  *   The port identifier of the Ethernet device.
126  * @param idx
127  *   The SA to be enabled (0 or 1)
128  * @param an
129  *   The association number on the remote side.
130  * @param pn
131  *   The packet number on the remote side.
132  * @param key
133  *   The key on the remote side.
134  * @return
135  *   - (0) if successful.
136  *   - (-ENODEV) if *port* invalid.
137  *   - (-ENOTSUP) if hardware doesn't support this feature.
138  *   - (-EINVAL) if bad parameter.
139  */
140 __rte_experimental
141 int rte_pmd_atl_macsec_select_rxsa(uint16_t port, uint8_t idx, uint8_t an,
142                                    uint32_t pn, uint8_t *key);
143
144 #endif /* _PMD_ATLANTIC_H_ */