xref: /dpdk/drivers/net/atlantic/rte_pmd_atlantic.h (revision 61ede39537f45e561dc80eaa23621ce3d2cf9e73)
1ec0dec44SPavel Belous /* SPDX-License-Identifier: BSD-3-Clause
2ec0dec44SPavel Belous  * Copyright(c) 2018 Aquantia Corporation
3ec0dec44SPavel Belous  */
4ec0dec44SPavel Belous 
5ec0dec44SPavel Belous /**
6ec0dec44SPavel Belous  * @file rte_pmd_atlantic.h
7ec0dec44SPavel Belous  * atlantic PMD specific functions.
8ec0dec44SPavel Belous  *
9ec0dec44SPavel Belous  **/
10ec0dec44SPavel Belous 
11ec0dec44SPavel Belous #ifndef _PMD_ATLANTIC_H_
12ec0dec44SPavel Belous #define _PMD_ATLANTIC_H_
13ec0dec44SPavel Belous 
14*61ede395SFerruh Yigit #include <rte_compat.h>
15ec0dec44SPavel Belous 
16ec0dec44SPavel Belous /**
17136ab94aSDavid Marchand  * @warning
18136ab94aSDavid Marchand  * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
19136ab94aSDavid Marchand  *
20ec0dec44SPavel Belous  * Enable MACsec offload.
21ec0dec44SPavel Belous  *
22ec0dec44SPavel Belous  * @param port
23ec0dec44SPavel Belous  *   The port identifier of the Ethernet device.
24ec0dec44SPavel Belous  * @param encr
25ec0dec44SPavel Belous  *    1 - Enable encryption (encrypt and add integrity signature).
26ec0dec44SPavel Belous  *    0 - Disable encryption (only add integrity signature).
27ec0dec44SPavel Belous  * @param repl_prot
28ec0dec44SPavel Belous  *    1 - Enable replay protection.
29ec0dec44SPavel Belous  *    0 - Disable replay protection.
30ec0dec44SPavel Belous  * @return
31ec0dec44SPavel Belous  *   - (0) if successful.
32ec0dec44SPavel Belous  *   - (-ENODEV) if *port* invalid.
33ec0dec44SPavel Belous  *   - (-ENOTSUP) if hardware doesn't support this feature.
34ec0dec44SPavel Belous  */
35136ab94aSDavid Marchand __rte_experimental
36ec0dec44SPavel Belous int rte_pmd_atl_macsec_enable(uint16_t port, uint8_t encr, uint8_t repl_prot);
37ec0dec44SPavel Belous 
38ec0dec44SPavel Belous /**
39136ab94aSDavid Marchand  * @warning
40136ab94aSDavid Marchand  * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
41136ab94aSDavid Marchand  *
42ec0dec44SPavel Belous  * Disable MACsec offload.
43ec0dec44SPavel Belous  *
44ec0dec44SPavel Belous  * @param port
45ec0dec44SPavel Belous  *   The port identifier of the Ethernet device.
46ec0dec44SPavel Belous  * @return
47ec0dec44SPavel Belous  *   - (0) if successful.
48ec0dec44SPavel Belous  *   - (-ENODEV) if *port* invalid.
49ec0dec44SPavel Belous  *   - (-ENOTSUP) if hardware doesn't support this feature.
50ec0dec44SPavel Belous  */
51136ab94aSDavid Marchand __rte_experimental
52ec0dec44SPavel Belous int rte_pmd_atl_macsec_disable(uint16_t port);
53ec0dec44SPavel Belous 
54ec0dec44SPavel Belous /**
55136ab94aSDavid Marchand  * @warning
56136ab94aSDavid Marchand  * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
57136ab94aSDavid Marchand  *
58ec0dec44SPavel Belous  * Configure Tx SC (Secure Connection).
59ec0dec44SPavel Belous  *
60ec0dec44SPavel Belous  * @param port
61ec0dec44SPavel Belous  *   The port identifier of the Ethernet device.
62ec0dec44SPavel Belous  * @param mac
63ec0dec44SPavel Belous  *   The MAC address on the local side.
64ec0dec44SPavel Belous  * @return
65ec0dec44SPavel Belous  *   - (0) if successful.
66ec0dec44SPavel Belous  *   - (-ENODEV) if *port* invalid.
67ec0dec44SPavel Belous  *   - (-ENOTSUP) if hardware doesn't support this feature.
68ec0dec44SPavel Belous  */
69136ab94aSDavid Marchand __rte_experimental
70ec0dec44SPavel Belous int rte_pmd_atl_macsec_config_txsc(uint16_t port, uint8_t *mac);
71ec0dec44SPavel Belous 
72ec0dec44SPavel Belous /**
73136ab94aSDavid Marchand  * @warning
74136ab94aSDavid Marchand  * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
75136ab94aSDavid Marchand  *
76ec0dec44SPavel Belous  * Configure Rx SC (Secure Connection).
77ec0dec44SPavel Belous  *
78ec0dec44SPavel Belous  * @param port
79ec0dec44SPavel Belous  *   The port identifier of the Ethernet device.
80ec0dec44SPavel Belous  * @param mac
81ec0dec44SPavel Belous  *   The MAC address on the remote side.
82ec0dec44SPavel Belous  * @param pi
83ec0dec44SPavel Belous  *   The PI (port identifier) on the remote side.
84ec0dec44SPavel Belous  * @return
85ec0dec44SPavel Belous  *   - (0) if successful.
86ec0dec44SPavel Belous  *   - (-ENODEV) if *port* invalid.
87ec0dec44SPavel Belous  *   - (-ENOTSUP) if hardware doesn't support this feature.
88ec0dec44SPavel Belous  */
89136ab94aSDavid Marchand __rte_experimental
90ec0dec44SPavel Belous int rte_pmd_atl_macsec_config_rxsc(uint16_t port, uint8_t *mac, uint16_t pi);
91ec0dec44SPavel Belous 
92ec0dec44SPavel Belous /**
93136ab94aSDavid Marchand  * @warning
94136ab94aSDavid Marchand  * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
95136ab94aSDavid Marchand  *
96ec0dec44SPavel Belous  * Enable Tx SA (Secure Association).
97ec0dec44SPavel Belous  *
98ec0dec44SPavel Belous  * @param port
99ec0dec44SPavel Belous  *   The port identifier of the Ethernet device.
100ec0dec44SPavel Belous  * @param idx
101ec0dec44SPavel Belous  *   The SA to be enabled (0 or 1).
102ec0dec44SPavel Belous  * @param an
103ec0dec44SPavel Belous  *   The association number on the local side.
104ec0dec44SPavel Belous  * @param pn
105ec0dec44SPavel Belous  *   The packet number on the local side.
106ec0dec44SPavel Belous  * @param key
107ec0dec44SPavel Belous  *   The key on the local side.
108ec0dec44SPavel Belous  * @return
109ec0dec44SPavel Belous  *   - (0) if successful.
110ec0dec44SPavel Belous  *   - (-ENODEV) if *port* invalid.
111ec0dec44SPavel Belous  *   - (-ENOTSUP) if hardware doesn't support this feature.
112ec0dec44SPavel Belous  *   - (-EINVAL) if bad parameter.
113ec0dec44SPavel Belous  */
114136ab94aSDavid Marchand __rte_experimental
115ec0dec44SPavel Belous int rte_pmd_atl_macsec_select_txsa(uint16_t port, uint8_t idx, uint8_t an,
116ec0dec44SPavel Belous 				   uint32_t pn, uint8_t *key);
117ec0dec44SPavel Belous 
118ec0dec44SPavel Belous /**
119136ab94aSDavid Marchand  * @warning
120136ab94aSDavid Marchand  * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
121136ab94aSDavid Marchand  *
122ec0dec44SPavel Belous  * Enable Rx SA (Secure Association).
123ec0dec44SPavel Belous  *
124ec0dec44SPavel Belous  * @param port
125ec0dec44SPavel Belous  *   The port identifier of the Ethernet device.
126ec0dec44SPavel Belous  * @param idx
127ec0dec44SPavel Belous  *   The SA to be enabled (0 or 1)
128ec0dec44SPavel Belous  * @param an
129ec0dec44SPavel Belous  *   The association number on the remote side.
130ec0dec44SPavel Belous  * @param pn
131ec0dec44SPavel Belous  *   The packet number on the remote side.
132ec0dec44SPavel Belous  * @param key
133ec0dec44SPavel Belous  *   The key on the remote side.
134ec0dec44SPavel Belous  * @return
135ec0dec44SPavel Belous  *   - (0) if successful.
136ec0dec44SPavel Belous  *   - (-ENODEV) if *port* invalid.
137ec0dec44SPavel Belous  *   - (-ENOTSUP) if hardware doesn't support this feature.
138ec0dec44SPavel Belous  *   - (-EINVAL) if bad parameter.
139ec0dec44SPavel Belous  */
140136ab94aSDavid Marchand __rte_experimental
141ec0dec44SPavel Belous int rte_pmd_atl_macsec_select_rxsa(uint16_t port, uint8_t idx, uint8_t an,
142ec0dec44SPavel Belous 				   uint32_t pn, uint8_t *key);
143ec0dec44SPavel Belous 
144ec0dec44SPavel Belous #endif /* _PMD_ATLANTIC_H_ */
145