1 /* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */ 2 /* Copyright (c) 2020 Marvell International Ltd. All rights reserved. */ 3 4 #ifndef __PRESTERA_DSA_H_ 5 #define __PRESTERA_DSA_H_ 6 7 #include <linux/types.h> 8 9 #define PRESTERA_DSA_HLEN 16 10 11 enum prestera_dsa_cmd { 12 /* DSA command is "To CPU" */ 13 PRESTERA_DSA_CMD_TO_CPU = 0, 14 15 /* DSA command is "From CPU" */ 16 PRESTERA_DSA_CMD_FROM_CPU, 17 }; 18 19 struct prestera_dsa_vlan { 20 u16 vid; 21 u8 vpt; 22 u8 cfi_bit; 23 bool is_tagged; 24 }; 25 26 struct prestera_dsa { 27 struct prestera_dsa_vlan vlan; 28 u32 hw_dev_num; 29 u32 port_num; 30 }; 31 32 int prestera_dsa_parse(struct prestera_dsa *dsa, const u8 *dsa_buf); 33 int prestera_dsa_build(const struct prestera_dsa *dsa, u8 *dsa_buf); 34 35 #endif /* _PRESTERA_DSA_H_ */ 36