Home
last modified time | relevance | path

Searched refs:lan966x (Results 1 – 25 of 44) sorted by relevance

12

/linux-6.12.1/drivers/net/ethernet/microchip/lan966x/
Dlan966x_vlan.c10 static int lan966x_vlan_get_status(struct lan966x *lan966x) in lan966x_vlan_get_status() argument
12 return lan_rd(lan966x, ANA_VLANACCESS); in lan966x_vlan_get_status()
15 static int lan966x_vlan_wait_for_completion(struct lan966x *lan966x) in lan966x_vlan_wait_for_completion() argument
20 lan966x, val, in lan966x_vlan_wait_for_completion()
26 static void lan966x_vlan_set_mask(struct lan966x *lan966x, u16 vid) in lan966x_vlan_set_mask() argument
28 u16 mask = lan966x->vlan_mask[vid]; in lan966x_vlan_set_mask()
38 lan966x, ANA_VLANTIDX); in lan966x_vlan_set_mask()
43 lan966x, ANA_VLAN_PORT_MASK); in lan966x_vlan_set_mask()
48 lan966x, ANA_VLANACCESS); in lan966x_vlan_set_mask()
50 if (lan966x_vlan_wait_for_completion(lan966x)) in lan966x_vlan_set_mask()
[all …]
Dlan966x_fdma.c12 struct lan966x *lan966x = (struct lan966x *)fdma->priv; in lan966x_fdma_rx_dataptr_cb() local
13 struct lan966x_rx *rx = &lan966x->rx; in lan966x_fdma_rx_dataptr_cb()
29 struct lan966x *lan966x = (struct lan966x *)fdma->priv; in lan966x_fdma_tx_dataptr_cb() local
31 *dataptr = lan966x->tx.dcbs_buf[dcb].dma_addr; in lan966x_fdma_tx_dataptr_cb()
39 struct lan966x *lan966x = (struct lan966x *)fdma->priv; in lan966x_fdma_xdp_tx_dataptr_cb() local
41 *dataptr = lan966x->tx.dcbs_buf[dcb].dma_addr + XDP_PACKET_HEADROOM; in lan966x_fdma_xdp_tx_dataptr_cb()
46 static int lan966x_fdma_channel_active(struct lan966x *lan966x) in lan966x_fdma_channel_active() argument
48 return lan_rd(lan966x, FDMA_CH_ACTIVE); in lan966x_fdma_channel_active()
77 struct lan966x *lan966x = rx->lan966x; in lan966x_fdma_rx_alloc_page_pool() local
83 .dev = lan966x->dev, in lan966x_fdma_rx_alloc_page_pool()
[all …]
Dlan966x_ethtool.c293 static void lan966x_stats_update(struct lan966x *lan966x) in lan966x_stats_update() argument
297 mutex_lock(&lan966x->stats_lock); in lan966x_stats_update()
299 for (i = 0; i < lan966x->num_phys_ports; i++) { in lan966x_stats_update()
300 uint idx = i * lan966x->num_stats; in lan966x_stats_update()
303 lan966x, SYS_STAT_CFG); in lan966x_stats_update()
305 for (j = 0; j < lan966x->num_stats; j++) { in lan966x_stats_update()
306 u32 offset = lan966x->stats_layout[j].offset; in lan966x_stats_update()
308 lan966x_add_cnt(&lan966x->stats[idx++], in lan966x_stats_update()
309 lan_rd(lan966x, SYS_CNT(offset))); in lan966x_stats_update()
313 mutex_unlock(&lan966x->stats_lock); in lan966x_stats_update()
[all …]
Dlan966x_main.c68 struct lan966x *lan966x) in lan966x_create_targets() argument
101 lan966x->regs[iomap->id] = begin[iomap->range] + iomap->offset; in lan966x_create_targets()
110 struct lan966x *lan966x = port->lan966x; in lan966x_port_unique_address() local
113 for (p = 0; p < lan966x->num_phys_ports; ++p) { in lan966x_port_unique_address()
114 port = lan966x->ports[p]; in lan966x_port_unique_address()
128 struct lan966x *lan966x = port->lan966x; in lan966x_port_set_mac_address() local
136 ret = lan966x_mac_cpu_learn(lan966x, addr->sa_data, HOST_PVID); in lan966x_port_set_mac_address()
147 ret = lan966x_mac_cpu_forget(lan966x, dev->dev_addr, HOST_PVID); in lan966x_port_set_mac_address()
172 struct lan966x *lan966x = port->lan966x; in lan966x_port_open() local
184 lan966x, ANA_PORT_CFG(port->chip_port)); in lan966x_port_open()
[all …]
Dlan966x_mac.c35 static int lan966x_mac_get_status(struct lan966x *lan966x) in lan966x_mac_get_status() argument
37 return lan_rd(lan966x, ANA_MACACCESS); in lan966x_mac_get_status()
40 static int lan966x_mac_wait_for_completion(struct lan966x *lan966x) in lan966x_mac_wait_for_completion() argument
45 lan966x, val, in lan966x_mac_wait_for_completion()
52 static void lan966x_mac_select(struct lan966x *lan966x, in lan966x_mac_select() argument
69 lan_wr(macl, lan966x, ANA_MACLDATA); in lan966x_mac_select()
70 lan_wr(mach, lan966x, ANA_MACHDATA); in lan966x_mac_select()
73 static int __lan966x_mac_learn_locked(struct lan966x *lan966x, int pgid, in __lan966x_mac_learn_locked() argument
79 lockdep_assert_held(&lan966x->mac_lock); in __lan966x_mac_learn_locked()
81 lan966x_mac_select(lan966x, mac, vid); in __lan966x_mac_learn_locked()
[all …]
Dlan966x_fdb.c12 struct lan966x *lan966x; member
24 lan966x_fdb_find_entry(struct lan966x *lan966x, in lan966x_fdb_find_entry() argument
29 list_for_each_entry(fdb_entry, &lan966x->fdb_entries, list) { in lan966x_fdb_find_entry()
38 static void lan966x_fdb_add_entry(struct lan966x *lan966x, in lan966x_fdb_add_entry() argument
43 fdb_entry = lan966x_fdb_find_entry(lan966x, fdb_info); in lan966x_fdb_add_entry()
56 list_add_tail(&fdb_entry->list, &lan966x->fdb_entries); in lan966x_fdb_add_entry()
59 static bool lan966x_fdb_del_entry(struct lan966x *lan966x, in lan966x_fdb_del_entry() argument
64 list_for_each_entry_safe(fdb_entry, tmp, &lan966x->fdb_entries, in lan966x_fdb_del_entry()
81 void lan966x_fdb_write_entries(struct lan966x *lan966x, u16 vid) in lan966x_fdb_write_entries() argument
85 list_for_each_entry(fdb_entry, &lan966x->fdb_entries, list) { in lan966x_fdb_write_entries()
[all …]
Dlan966x_mdb.c23 void lan966x_mdb_init(struct lan966x *lan966x) in lan966x_mdb_init() argument
25 INIT_LIST_HEAD(&lan966x->mdb_entries); in lan966x_mdb_init()
26 INIT_LIST_HEAD(&lan966x->pgid_entries); in lan966x_mdb_init()
29 static void lan966x_mdb_purge_mdb_entries(struct lan966x *lan966x) in lan966x_mdb_purge_mdb_entries() argument
33 list_for_each_entry_safe(mdb_entry, tmp, &lan966x->mdb_entries, list) { in lan966x_mdb_purge_mdb_entries()
39 static void lan966x_mdb_purge_pgid_entries(struct lan966x *lan966x) in lan966x_mdb_purge_pgid_entries() argument
43 list_for_each_entry_safe(pgid_entry, tmp, &lan966x->pgid_entries, list) { in lan966x_mdb_purge_pgid_entries()
49 void lan966x_mdb_deinit(struct lan966x *lan966x) in lan966x_mdb_deinit() argument
51 lan966x_mdb_purge_mdb_entries(lan966x); in lan966x_mdb_deinit()
52 lan966x_mdb_purge_pgid_entries(lan966x); in lan966x_mdb_deinit()
[all …]
Dlan966x_main.h195 struct lan966x *lan966x; member
231 struct lan966x *lan966x; member
251 struct lan966x *lan966x; member
265 struct lan966x { struct
390 struct lan966x *lan966x; member
433 bool lan966x_hw_offload(struct lan966x *lan966x, u32 port, struct sk_buff *skb);
442 int lan966x_stats_init(struct lan966x *lan966x);
457 int lan966x_mac_ip_learn(struct lan966x *lan966x,
462 int lan966x_mac_learn(struct lan966x *lan966x, int port,
466 int lan966x_mac_forget(struct lan966x *lan966x,
[all …]
Dlan966x_lag.c7 static void lan966x_lag_set_aggr_pgids(struct lan966x *lan966x) in lan966x_lag_set_aggr_pgids() argument
9 u32 visited = GENMASK(lan966x->num_phys_ports - 1, 0); in lan966x_lag_set_aggr_pgids()
13 for (p = 0; p < lan966x->num_phys_ports; ++p) in lan966x_lag_set_aggr_pgids()
15 lan966x, ANA_PGID(p)); in lan966x_lag_set_aggr_pgids()
19 lan966x, ANA_PGID(p)); in lan966x_lag_set_aggr_pgids()
29 for (p = 0; p < lan966x->num_phys_ports; ++p) { in lan966x_lag_set_aggr_pgids()
30 struct lan966x_port *port = lan966x->ports[p]; in lan966x_lag_set_aggr_pgids()
39 for (lag = 0; lag < lan966x->num_phys_ports; ++lag) { in lan966x_lag_set_aggr_pgids()
40 struct lan966x_port *port = lan966x->ports[lag]; in lan966x_lag_set_aggr_pgids()
50 bond_mask = lan966x_lag_get_mask(lan966x, bond); in lan966x_lag_set_aggr_pgids()
[all …]
Dlan966x_ptp.c57 struct lan966x *lan966x = port->lan966x; in lan966x_ptp_add_trap() local
61 vrule = vcap_get_rule(lan966x->vcap_ctrl, rule_id); in lan966x_ptp_add_trap()
76 vrule = vcap_alloc_rule(lan966x->vcap_ctrl, port->dev, in lan966x_ptp_add_trap()
103 struct lan966x *lan966x = port->lan966x; in lan966x_ptp_del_trap() local
108 vrule = vcap_get_rule(lan966x->vcap_ctrl, rule_id); in lan966x_ptp_del_trap()
116 if (mask == GENMASK(lan966x->num_phys_ports, 0)) { in lan966x_ptp_del_trap()
117 err = vcap_del_rule(lan966x->vcap_ctrl, port->dev, rule_id); in lan966x_ptp_del_trap()
264 struct lan966x *lan966x = port->lan966x; in lan966x_ptp_hwtstamp_set() local
307 mutex_lock(&lan966x->ptp_lock); in lan966x_ptp_hwtstamp_set()
308 phc = &lan966x->phc[LAN966X_PHC_PORT]; in lan966x_ptp_hwtstamp_set()
[all …]
Dlan966x_port.c27 struct lan966x *lan966x = port->lan966x; in lan966x_port_link_down() local
35 lan966x, AFI_PORT_CFG(port->chip_port)); in lan966x_port_link_down()
39 val = lan_rd(lan966x, AFI_PORT_FRM_OUT(port->chip_port)); in lan966x_port_link_down()
56 lan966x, DEV_CLOCK_CFG(port->chip_port)); in lan966x_port_link_down()
61 lan966x, DEV_MAC_ENA_CFG(port->chip_port)); in lan966x_port_link_down()
66 lan966x, QSYS_SW_PORT_MODE(port->chip_port)); in lan966x_port_link_down()
71 lan966x, QSYS_PORT_MODE(port->chip_port)); in lan966x_port_link_down()
76 lan966x, SYS_PAUSE_CFG(port->chip_port)); in lan966x_port_link_down()
81 lan966x, QSYS_SW_PORT_MODE(port->chip_port)); in lan966x_port_link_down()
89 lan966x, SYS_FRONT_PORT_MODE(port->chip_port)); in lan966x_port_link_down()
[all …]
Dlan966x_taprio.c48 struct lan966x *lan966x = port->lan966x; in lan966x_taprio_list_state_get() local
51 val = lan_rd(lan966x, QSYS_TAS_LST); in lan966x_taprio_list_state_get()
58 struct lan966x *lan966x = port->lan966x; in lan966x_taprio_list_index_state_get() local
62 lan966x, QSYS_TAS_CFG_CTRL); in lan966x_taprio_list_index_state_get()
70 struct lan966x *lan966x = port->lan966x; in lan966x_taprio_list_state_set() local
74 lan966x, QSYS_TAS_LST); in lan966x_taprio_list_state_set()
80 struct lan966x *lan966x = port->lan966x; in lan966x_taprio_list_shutdown() local
141 lan966x, QSYS_TAS_GS_CTRL); in lan966x_taprio_list_shutdown()
144 lan966x, QSYS_TAS_GATE_STATE); in lan966x_taprio_list_shutdown()
271 struct lan966x *lan966x = port->lan966x; in lan966x_taprio_gcl_free_get() local
[all …]
Dlan966x_vcap_impl.c58 struct lan966x *lan966x; member
64 return lan_rd(cb->lan966x, VCAP_UPDATE_CTRL(cb->instance)); in lan966x_vcap_read_update_ctrl()
67 static void lan966x_vcap_wait_update(struct lan966x *lan966x, int instance) in lan966x_vcap_wait_update() argument
69 const struct lan966x_vcap_cmd_cb cb = { .lan966x = lan966x, in lan966x_vcap_wait_update()
78 static void __lan966x_vcap_range_init(struct lan966x *lan966x, in __lan966x_vcap_range_init() argument
85 lan966x, VCAP_MV_CFG(admin->tgt_inst)); in __lan966x_vcap_range_init()
94 lan966x, VCAP_UPDATE_CTRL(admin->tgt_inst)); in __lan966x_vcap_range_init()
96 lan966x_vcap_wait_update(lan966x, admin->tgt_inst); in __lan966x_vcap_range_init()
129 struct lan966x *lan966x = port->lan966x; in lan966x_vcap_is1_get_port_keysets() local
132 val = lan_rd(lan966x, ANA_VCAP_S1_CFG(port->chip_port, lookup)); in lan966x_vcap_is1_get_port_keysets()
[all …]
Dlan966x_switchdev.c13 struct lan966x *lan966x = port->lan966x; in lan966x_port_set_mcast_ip_flood() local
16 flood_mask_ip = lan_rd(lan966x, ANA_PGID(pgid_ip)); in lan966x_port_set_mcast_ip_flood()
25 flood_mask = lan_rd(lan966x, ANA_PGID(PGID_MC)); in lan966x_port_set_mcast_ip_flood()
38 lan966x, ANA_PGID(pgid_ip)); in lan966x_port_set_mcast_ip_flood()
44 u32 val = lan_rd(port->lan966x, ANA_PGID(PGID_MC)); in lan966x_port_set_mcast_flood()
54 port->lan966x, ANA_PGID(PGID_MC)); in lan966x_port_set_mcast_flood()
65 u32 val = lan_rd(port->lan966x, ANA_PGID(PGID_UC)); in lan966x_port_set_ucast_flood()
75 port->lan966x, ANA_PGID(PGID_UC)); in lan966x_port_set_ucast_flood()
81 u32 val = lan_rd(port->lan966x, ANA_PGID(PGID_BC)); in lan966x_port_set_bcast_flood()
91 port->lan966x, ANA_PGID(PGID_BC)); in lan966x_port_set_bcast_flood()
[all …]
Dlan966x_mirror.c11 struct lan966x *lan966x = port->lan966x; in lan966x_mirror_port_add() local
22 if (lan966x->mirror_mask[ingress] & BIT(port->chip_port)) { in lan966x_mirror_port_add()
28 if (lan966x->mirror_monitor && in lan966x_mirror_port_add()
29 lan966x->mirror_monitor != monitor_port) { in lan966x_mirror_port_add()
41 lan966x->mirror_mask[ingress] |= BIT(port->chip_port); in lan966x_mirror_port_add()
43 lan966x->mirror_monitor = monitor_port; in lan966x_mirror_port_add()
44 lan_wr(BIT(monitor_port->chip_port), lan966x, ANA_MIRRORPORTS); in lan966x_mirror_port_add()
49 lan966x, ANA_PORT_CFG(port->chip_port)); in lan966x_mirror_port_add()
51 lan_wr(lan966x->mirror_mask[0], lan966x, in lan966x_mirror_port_add()
55 lan966x->mirror_count++; in lan966x_mirror_port_add()
[all …]
Dlan966x_xdp.c12 struct lan966x *lan966x = port->lan966x; in lan966x_xdp_setup() local
17 if (!lan966x->fdma) { in lan966x_xdp_setup()
23 old_xdp = lan966x_xdp_present(lan966x); in lan966x_xdp_setup()
25 new_xdp = lan966x_xdp_present(lan966x); in lan966x_xdp_setup()
30 err = lan966x_fdma_reload_page_pool(lan966x); in lan966x_xdp_setup()
78 struct lan966x *lan966x = port->lan966x; in lan966x_xdp_run() local
82 xdp_init_buff(&xdp, PAGE_SIZE << lan966x->rx.page_order, in lan966x_xdp_run()
111 bool lan966x_xdp_present(struct lan966x *lan966x) in lan966x_xdp_present() argument
113 for (int p = 0; p < lan966x->num_phys_ports; ++p) { in lan966x_xdp_present()
114 if (!lan966x->ports[p]) in lan966x_xdp_present()
[all …]
Dlan966x_police.c22 struct lan966x *lan966x = port->lan966x; in lan966x_police_add() local
40 lan966x, ANA_POL_MODE(pol_idx)); in lan966x_police_add()
43 lan966x, ANA_POL_PIR_STATE(pol_idx)); in lan966x_police_add()
47 lan966x, ANA_POL_PIR_CFG(pol_idx)); in lan966x_police_add()
54 struct lan966x *lan966x = port->lan966x; in lan966x_police_del() local
61 lan966x, ANA_POL_MODE(pol_idx)); in lan966x_police_del()
64 lan966x, ANA_POL_PIR_STATE(pol_idx)); in lan966x_police_del()
68 lan966x, ANA_POL_PIR_CFG(pol_idx)); in lan966x_police_del()
139 struct lan966x *lan966x = port->lan966x; in lan966x_police_port_add() local
166 lan966x, ANA_POL_CFG(port->chip_port)); in lan966x_police_port_add()
[all …]
Dlan966x_cbs.c8 struct lan966x *lan966x = port->lan966x; in lan966x_cbs_add() local
42 lan966x, QSYS_SE_CFG(se_idx)); in lan966x_cbs_add()
46 lan966x, QSYS_CIR_CFG(se_idx)); in lan966x_cbs_add()
54 struct lan966x *lan966x = port->lan966x; in lan966x_cbs_del() local
63 lan966x, QSYS_SE_CFG(se_idx)); in lan966x_cbs_del()
67 lan966x, QSYS_CIR_CFG(se_idx)); in lan966x_cbs_del()
Dlan966x_tbf.c8 struct lan966x *lan966x = port->lan966x; in lan966x_tbf_add() local
46 lan966x, QSYS_SE_CFG(se_idx)); in lan966x_tbf_add()
50 lan966x, QSYS_CIR_CFG(se_idx)); in lan966x_tbf_add()
58 struct lan966x *lan966x = port->lan966x; in lan966x_tbf_del() local
78 lan966x, QSYS_SE_CFG(se_idx)); in lan966x_tbf_del()
82 lan966x, QSYS_CIR_CFG(se_idx)); in lan966x_tbf_del()
Dlan966x_goto.c11 struct lan966x *lan966x = port->lan966x; in lan966x_goto_port_add() local
14 err = vcap_enable_lookups(lan966x->vcap_ctrl, port->dev, in lan966x_goto_port_add()
39 struct lan966x *lan966x = port->lan966x; in lan966x_goto_port_del() local
42 err = vcap_enable_lookups(lan966x->vcap_ctrl, port->dev, 0, 0, in lan966x_goto_port_del()
Dlan966x_ets.c22 struct lan966x *lan966x = port->lan966x; in lan966x_ets_add() local
65 lan966x, QSYS_SE_DWRR_CFG(se_idx, 7 - i)); in lan966x_ets_add()
72 lan966x, QSYS_SE_CFG(se_idx)); in lan966x_ets_add()
80 struct lan966x *lan966x = port->lan966x; in lan966x_ets_del() local
87 lan_wr(0, lan966x, QSYS_SE_DWRR_CFG(se_idx, i)); in lan966x_ets_del()
93 lan966x, QSYS_SE_CFG(se_idx)); in lan966x_ets_del()
Dlan966x_vcap_debugfs.c12 struct lan966x *lan966x = port->lan966x; in lan966x_vcap_is1_port_keys() local
18 val = lan_rd(lan966x, ANA_VCAP_CFG(port->chip_port)); in lan966x_vcap_is1_port_keys()
28 val = lan_rd(lan966x, ANA_VCAP_S1_CFG(port->chip_port, l)); in lan966x_vcap_is1_port_keys()
129 struct lan966x *lan966x = port->lan966x; in lan966x_vcap_is2_port_keys() local
135 val = lan_rd(lan966x, ANA_VCAP_S2_CFG(port->chip_port)); in lan966x_vcap_is2_port_keys()
199 struct lan966x *lan966x = port->lan966x; in lan966x_vcap_es0_port_keys() local
205 val = lan_rd(lan966x, REW_PORT_CFG(port->chip_port)); in lan966x_vcap_es0_port_keys()
220 struct lan966x *lan966x = port->lan966x; in lan966x_vcap_port_info() local
224 vctrl = lan966x->vcap_ctrl; in lan966x_vcap_port_info()
DMakefile6 obj-$(CONFIG_LAN966X_SWITCH) += lan966x-switch.o
8 lan966x-switch-objs := lan966x_main.o lan966x_phylink.o lan966x_port.o \
18 lan966x-switch-$(CONFIG_LAN966X_DCB) += lan966x_dcb.o
19 lan966x-switch-$(CONFIG_DEBUG_FS) += lan966x_vcap_debugfs.o
Dlan966x_dcb.c124 struct lan966x *lan966x = port->lan966x; in lan966x_dcb_ieee_dscp_setdel() local
128 port = lan966x->ports[i]; in lan966x_dcb_ieee_dscp_setdel()
345 void lan966x_dcb_init(struct lan966x *lan966x) in lan966x_dcb_init() argument
347 for (int p = 0; p < lan966x->num_phys_ports; ++p) { in lan966x_dcb_init()
350 port = lan966x->ports[p]; in lan966x_dcb_init()
/linux-6.12.1/arch/arm/boot/dts/microchip/
DMakefile95 lan966x-kontron-kswitch-d10-mmt-6g-2gs.dtb \
96 lan966x-kontron-kswitch-d10-mmt-8g.dtb \
97 lan966x-pcb8290.dtb \
98 lan966x-pcb8291.dtb \
99 lan966x-pcb8309.dtb

12