Lines Matching refs:dsa_switch
71 struct dsa_switch;
207 struct dsa_switch *ds;
254 struct dsa_switch {
339 static inline struct dsa_port *dsa_to_port(struct dsa_switch *ds, int p)
351 static inline bool dsa_is_unused_port(struct dsa_switch *ds, int p)
356 static inline bool dsa_is_cpu_port(struct dsa_switch *ds, int p)
361 static inline bool dsa_is_dsa_port(struct dsa_switch *ds, int p)
366 static inline bool dsa_is_user_port(struct dsa_switch *ds, int p)
371 static inline u32 dsa_user_ports(struct dsa_switch *ds)
384 static inline unsigned int dsa_routing_port(struct dsa_switch *ds, int device)
397 static inline unsigned int dsa_towards_port(struct dsa_switch *ds, int device,
407 static inline unsigned int dsa_upstream_port(struct dsa_switch *ds, int port)
420 const struct dsa_switch *ds = dp->ds;
431 enum dsa_tag_protocol (*get_tag_protocol)(struct dsa_switch *ds,
435 int (*setup)(struct dsa_switch *ds);
436 void (*teardown)(struct dsa_switch *ds);
437 u32 (*get_phy_flags)(struct dsa_switch *ds, int port);
442 int (*phy_read)(struct dsa_switch *ds, int port, int regnum);
443 int (*phy_write)(struct dsa_switch *ds, int port,
449 void (*adjust_link)(struct dsa_switch *ds, int port,
451 void (*fixed_link_update)(struct dsa_switch *ds, int port,
457 void (*phylink_validate)(struct dsa_switch *ds, int port,
460 int (*phylink_mac_link_state)(struct dsa_switch *ds, int port,
462 void (*phylink_mac_config)(struct dsa_switch *ds, int port,
465 void (*phylink_mac_an_restart)(struct dsa_switch *ds, int port);
466 void (*phylink_mac_link_down)(struct dsa_switch *ds, int port,
469 void (*phylink_mac_link_up)(struct dsa_switch *ds, int port,
475 void (*phylink_fixed_state)(struct dsa_switch *ds, int port,
480 void (*get_strings)(struct dsa_switch *ds, int port,
482 void (*get_ethtool_stats)(struct dsa_switch *ds,
484 int (*get_sset_count)(struct dsa_switch *ds, int port, int sset);
485 void (*get_ethtool_phy_stats)(struct dsa_switch *ds,
491 void (*get_wol)(struct dsa_switch *ds, int port,
493 int (*set_wol)(struct dsa_switch *ds, int port,
499 int (*get_ts_info)(struct dsa_switch *ds, int port,
505 int (*suspend)(struct dsa_switch *ds);
506 int (*resume)(struct dsa_switch *ds);
511 int (*port_enable)(struct dsa_switch *ds, int port,
513 void (*port_disable)(struct dsa_switch *ds, int port);
518 int (*set_mac_eee)(struct dsa_switch *ds, int port,
520 int (*get_mac_eee)(struct dsa_switch *ds, int port,
524 int (*get_eeprom_len)(struct dsa_switch *ds);
525 int (*get_eeprom)(struct dsa_switch *ds,
527 int (*set_eeprom)(struct dsa_switch *ds,
533 int (*get_regs_len)(struct dsa_switch *ds, int port);
534 void (*get_regs)(struct dsa_switch *ds, int port,
540 int (*set_ageing_time)(struct dsa_switch *ds, unsigned int msecs);
541 int (*port_bridge_join)(struct dsa_switch *ds, int port,
543 void (*port_bridge_leave)(struct dsa_switch *ds, int port,
545 void (*port_stp_state_set)(struct dsa_switch *ds, int port,
547 void (*port_fast_age)(struct dsa_switch *ds, int port);
548 int (*port_egress_floods)(struct dsa_switch *ds, int port,
554 int (*port_vlan_filtering)(struct dsa_switch *ds, int port,
557 int (*port_vlan_prepare)(struct dsa_switch *ds, int port,
559 void (*port_vlan_add)(struct dsa_switch *ds, int port,
561 int (*port_vlan_del)(struct dsa_switch *ds, int port,
566 int (*port_fdb_add)(struct dsa_switch *ds, int port,
568 int (*port_fdb_del)(struct dsa_switch *ds, int port,
570 int (*port_fdb_dump)(struct dsa_switch *ds, int port,
576 int (*port_mdb_prepare)(struct dsa_switch *ds, int port,
578 void (*port_mdb_add)(struct dsa_switch *ds, int port,
580 int (*port_mdb_del)(struct dsa_switch *ds, int port,
585 int (*get_rxnfc)(struct dsa_switch *ds, int port,
587 int (*set_rxnfc)(struct dsa_switch *ds, int port,
593 int (*cls_flower_add)(struct dsa_switch *ds, int port,
595 int (*cls_flower_del)(struct dsa_switch *ds, int port,
597 int (*cls_flower_stats)(struct dsa_switch *ds, int port,
599 int (*port_mirror_add)(struct dsa_switch *ds, int port,
602 void (*port_mirror_del)(struct dsa_switch *ds, int port,
604 int (*port_policer_add)(struct dsa_switch *ds, int port,
606 void (*port_policer_del)(struct dsa_switch *ds, int port);
607 int (*port_setup_tc)(struct dsa_switch *ds, int port,
613 int (*crosschip_bridge_join)(struct dsa_switch *ds, int tree_index,
616 void (*crosschip_bridge_leave)(struct dsa_switch *ds, int tree_index,
623 int (*port_hwtstamp_get)(struct dsa_switch *ds, int port,
625 int (*port_hwtstamp_set)(struct dsa_switch *ds, int port,
627 bool (*port_txtstamp)(struct dsa_switch *ds, int port,
629 bool (*port_rxtstamp)(struct dsa_switch *ds, int port,
633 int (*devlink_param_get)(struct dsa_switch *ds, u32 id,
635 int (*devlink_param_set)(struct dsa_switch *ds, u32 id,
637 int (*devlink_info_get)(struct dsa_switch *ds,
647 int (*port_change_mtu)(struct dsa_switch *ds, int port,
649 int (*port_max_mtu)(struct dsa_switch *ds, int port);
660 int dsa_devlink_params_register(struct dsa_switch *ds,
663 void dsa_devlink_params_unregister(struct dsa_switch *ds,
666 int dsa_devlink_resource_register(struct dsa_switch *ds,
673 void dsa_devlink_resources_unregister(struct dsa_switch *ds);
675 void dsa_devlink_resource_occ_get_register(struct dsa_switch *ds,
679 void dsa_devlink_resource_occ_get_unregister(struct dsa_switch *ds,
682 dsa_devlink_region_create(struct dsa_switch *ds,
686 dsa_devlink_port_region_create(struct dsa_switch *ds,
695 struct dsa_switch *ds;
698 static inline struct dsa_switch *dsa_devlink_to_ds(struct devlink *dl)
706 struct dsa_switch *dsa_devlink_port_to_ds(struct devlink_port *port)
806 void dsa_unregister_switch(struct dsa_switch *ds);
807 int dsa_register_switch(struct dsa_switch *ds);
808 struct dsa_switch *dsa_switch_find(int tree_index, int sw_index);
810 int dsa_switch_suspend(struct dsa_switch *ds);
811 int dsa_switch_resume(struct dsa_switch *ds);
813 static inline int dsa_switch_suspend(struct dsa_switch *ds)
817 static inline int dsa_switch_resume(struct dsa_switch *ds)
878 void dsa_port_phylink_mac_change(struct dsa_switch *ds, int port, bool up);