.. | .. |
---|
1 | | -// SPDX-License-Identifier: GPL-2.0 |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0 */ |
---|
2 | 2 | /* |
---|
3 | 3 | * Copyright 2014-2016 Freescale Semiconductor Inc. |
---|
4 | 4 | * Copyright 2017-2018 NXP |
---|
.. | .. |
---|
73 | 73 | enum dpsw_component_type { |
---|
74 | 74 | DPSW_COMPONENT_TYPE_C_VLAN = 0, |
---|
75 | 75 | 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; |
---|
107 | 76 | }; |
---|
108 | 77 | |
---|
109 | 78 | int dpsw_enable(struct fsl_mc_io *mc_io, |
---|
.. | .. |
---|
496 | 465 | u16 fdb_id, |
---|
497 | 466 | const struct dpsw_fdb_unicast_cfg *cfg); |
---|
498 | 467 | |
---|
| 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 | + |
---|
499 | 493 | /** |
---|
500 | 494 | * struct dpsw_fdb_multicast_cfg - Multi-cast entry configuration |
---|
501 | 495 | * @type: Select static or dynamic entry |
---|
.. | .. |
---|
586 | 580 | u16 *major_ver, |
---|
587 | 581 | u16 *minor_ver); |
---|
588 | 582 | |
---|
| 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 | + |
---|
589 | 592 | #endif /* __FSL_DPSW_H */ |
---|