1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2018 Aquantia Corporation
5 #include <rte_ethdev_driver.h>
7 #include "rte_pmd_atlantic.h"
8 #include "atl_ethdev.h"
12 rte_pmd_atl_macsec_enable(uint16_t port,
13 uint8_t encr, uint8_t repl_prot)
15 struct rte_eth_dev *dev;
17 RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
19 dev = &rte_eth_devices[port];
21 if (!is_atlantic_supported(dev))
24 return atl_macsec_enable(dev, encr, repl_prot);
28 rte_pmd_atl_macsec_disable(uint16_t port)
30 struct rte_eth_dev *dev;
32 RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
34 dev = &rte_eth_devices[port];
36 if (!is_atlantic_supported(dev))
39 return atl_macsec_disable(dev);
43 rte_pmd_atl_macsec_config_txsc(uint16_t port, uint8_t *mac)
45 struct rte_eth_dev *dev;
47 RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
49 dev = &rte_eth_devices[port];
51 if (!is_atlantic_supported(dev))
54 return atl_macsec_config_txsc(dev, mac);
58 rte_pmd_atl_macsec_config_rxsc(uint16_t port, uint8_t *mac, uint16_t pi)
60 struct rte_eth_dev *dev;
62 RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
64 dev = &rte_eth_devices[port];
66 if (!is_atlantic_supported(dev))
69 return atl_macsec_config_rxsc(dev, mac, pi);
73 rte_pmd_atl_macsec_select_txsa(uint16_t port, uint8_t idx, uint8_t an,
74 uint32_t pn, uint8_t *key)
76 struct rte_eth_dev *dev;
78 RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
80 dev = &rte_eth_devices[port];
82 if (!is_atlantic_supported(dev))
85 return atl_macsec_select_txsa(dev, idx, an, pn, key);
89 rte_pmd_atl_macsec_select_rxsa(uint16_t port, uint8_t idx, uint8_t an,
90 uint32_t pn, uint8_t *key)
92 struct rte_eth_dev *dev;
94 RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
96 dev = &rte_eth_devices[port];
98 if (!is_atlantic_supported(dev))
101 return atl_macsec_select_rxsa(dev, idx, an, pn, key);