forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/drivers/staging/fsl-dpaa2/ethsw/dpsw.h
....@@ -1,4 +1,4 @@
1
-// SPDX-License-Identifier: GPL-2.0
1
+/* SPDX-License-Identifier: GPL-2.0 */
22 /*
33 * Copyright 2014-2016 Freescale Semiconductor Inc.
44 * Copyright 2017-2018 NXP
....@@ -73,37 +73,6 @@
7373 enum dpsw_component_type {
7474 DPSW_COMPONENT_TYPE_C_VLAN = 0,
7575 DPSW_COMPONENT_TYPE_S_VLAN
76
-};
77
-
78
-/**
79
- * struct dpsw_cfg - DPSW configuration
80
- * @num_ifs: Number of external and internal interfaces
81
- * @adv: Advanced parameters; default is all zeros;
82
- * use this structure to change default settings
83
- * @adv.options: Enable/Disable DPSW features (bitmap)
84
- * @adv.max_vlans: Maximum Number of VLAN's; 0 - indicates default 16
85
- * @adv.max_meters_per_if: Number of meters per interface
86
- * @adv.max_fdbs: Maximum Number of FDB's; 0 - indicates default 16
87
- * @adv.max_fdb_entries: Number of FDB entries for default FDB table;
88
- * 0 - indicates default 1024 entries.
89
- * @adv.fdb_aging_time: Default FDB aging time for default FDB table;
90
- * 0 - indicates default 300 seconds
91
- * @adv.max_fdb_mc_groups: Number of multicast groups in each FDB table;
92
- * 0 - indicates default 32
93
- * @adv.component_type: Indicates the component type of this bridge
94
- */
95
-struct dpsw_cfg {
96
- u16 num_ifs;
97
- struct {
98
- u64 options;
99
- u16 max_vlans;
100
- u8 max_meters_per_if;
101
- u8 max_fdbs;
102
- u16 max_fdb_entries;
103
- u16 fdb_aging_time;
104
- u16 max_fdb_mc_groups;
105
- enum dpsw_component_type component_type;
106
- } adv;
10776 };
10877
10978 int dpsw_enable(struct fsl_mc_io *mc_io,
....@@ -496,6 +465,31 @@
496465 u16 fdb_id,
497466 const struct dpsw_fdb_unicast_cfg *cfg);
498467
468
+#define DPSW_FDB_ENTRY_TYPE_DYNAMIC BIT(0)
469
+#define DPSW_FDB_ENTRY_TYPE_UNICAST BIT(1)
470
+
471
+/**
472
+ * struct fdb_dump_entry - fdb snapshot entry
473
+ * @mac_addr: MAC address
474
+ * @type: bit0 - DINAMIC(1)/STATIC(0), bit1 - UNICAST(1)/MULTICAST(0)
475
+ * @if_info: unicast - egress interface, multicast - number of egress interfaces
476
+ * @if_mask: multicast - egress interface mask
477
+ */
478
+struct fdb_dump_entry {
479
+ u8 mac_addr[6];
480
+ u8 type;
481
+ u8 if_info;
482
+ u8 if_mask[8];
483
+};
484
+
485
+int dpsw_fdb_dump(struct fsl_mc_io *mc_io,
486
+ u32 cmd_flags,
487
+ u16 token,
488
+ u16 fdb_id,
489
+ u64 iova_addr,
490
+ u32 iova_size,
491
+ u16 *num_entries);
492
+
499493 /**
500494 * struct dpsw_fdb_multicast_cfg - Multi-cast entry configuration
501495 * @type: Select static or dynamic entry
....@@ -586,4 +580,13 @@
586580 u16 *major_ver,
587581 u16 *minor_ver);
588582
583
+int dpsw_if_get_port_mac_addr(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token,
584
+ u16 if_id, u8 mac_addr[6]);
585
+
586
+int dpsw_if_get_primary_mac_addr(struct fsl_mc_io *mc_io, u32 cmd_flags,
587
+ u16 token, u16 if_id, u8 mac_addr[6]);
588
+
589
+int dpsw_if_set_primary_mac_addr(struct fsl_mc_io *mc_io, u32 cmd_flags,
590
+ u16 token, u16 if_id, u8 mac_addr[6]);
591
+
589592 #endif /* __FSL_DPSW_H */