Lines Matching refs:dsa_switch
65 struct dsa_switch;
133 struct dsa_switch *ds[DSA_MAX_SWITCHES];
183 struct dsa_switch *ds;
217 struct dsa_switch { struct
283 static inline const struct dsa_port *dsa_to_port(struct dsa_switch *ds, int p) in dsa_to_port() argument
288 static inline bool dsa_is_unused_port(struct dsa_switch *ds, int p) in dsa_is_unused_port()
293 static inline bool dsa_is_cpu_port(struct dsa_switch *ds, int p) in dsa_is_cpu_port()
298 static inline bool dsa_is_dsa_port(struct dsa_switch *ds, int p) in dsa_is_dsa_port()
303 static inline bool dsa_is_user_port(struct dsa_switch *ds, int p) in dsa_is_user_port()
308 static inline u32 dsa_user_ports(struct dsa_switch *ds) in dsa_user_ports()
321 static inline unsigned int dsa_towards_port(struct dsa_switch *ds, int device, in dsa_towards_port()
331 static inline unsigned int dsa_upstream_port(struct dsa_switch *ds, int port) in dsa_upstream_port()
344 const struct dsa_switch *ds = dp->ds; in dsa_port_is_vlan_filtering()
355 enum dsa_tag_protocol (*get_tag_protocol)(struct dsa_switch *ds,
358 int (*setup)(struct dsa_switch *ds);
359 void (*teardown)(struct dsa_switch *ds);
360 u32 (*get_phy_flags)(struct dsa_switch *ds, int port);
365 int (*phy_read)(struct dsa_switch *ds, int port, int regnum);
366 int (*phy_write)(struct dsa_switch *ds, int port,
372 void (*adjust_link)(struct dsa_switch *ds, int port,
374 void (*fixed_link_update)(struct dsa_switch *ds, int port,
380 void (*phylink_validate)(struct dsa_switch *ds, int port,
383 int (*phylink_mac_link_state)(struct dsa_switch *ds, int port,
385 void (*phylink_mac_config)(struct dsa_switch *ds, int port,
388 void (*phylink_mac_an_restart)(struct dsa_switch *ds, int port);
389 void (*phylink_mac_link_down)(struct dsa_switch *ds, int port,
392 void (*phylink_mac_link_up)(struct dsa_switch *ds, int port,
396 void (*phylink_fixed_state)(struct dsa_switch *ds, int port,
401 void (*get_strings)(struct dsa_switch *ds, int port,
403 void (*get_ethtool_stats)(struct dsa_switch *ds,
405 int (*get_sset_count)(struct dsa_switch *ds, int port, int sset);
406 void (*get_ethtool_phy_stats)(struct dsa_switch *ds,
412 void (*get_wol)(struct dsa_switch *ds, int port,
414 int (*set_wol)(struct dsa_switch *ds, int port,
420 int (*get_ts_info)(struct dsa_switch *ds, int port,
426 int (*suspend)(struct dsa_switch *ds);
427 int (*resume)(struct dsa_switch *ds);
432 int (*port_enable)(struct dsa_switch *ds, int port,
434 void (*port_disable)(struct dsa_switch *ds, int port);
439 int (*set_mac_eee)(struct dsa_switch *ds, int port,
441 int (*get_mac_eee)(struct dsa_switch *ds, int port,
445 int (*get_eeprom_len)(struct dsa_switch *ds);
446 int (*get_eeprom)(struct dsa_switch *ds,
448 int (*set_eeprom)(struct dsa_switch *ds,
454 int (*get_regs_len)(struct dsa_switch *ds, int port);
455 void (*get_regs)(struct dsa_switch *ds, int port,
461 int (*set_ageing_time)(struct dsa_switch *ds, unsigned int msecs);
462 int (*port_bridge_join)(struct dsa_switch *ds, int port,
464 void (*port_bridge_leave)(struct dsa_switch *ds, int port,
466 void (*port_stp_state_set)(struct dsa_switch *ds, int port,
468 void (*port_fast_age)(struct dsa_switch *ds, int port);
469 int (*port_egress_floods)(struct dsa_switch *ds, int port,
475 int (*port_vlan_filtering)(struct dsa_switch *ds, int port,
477 int (*port_vlan_prepare)(struct dsa_switch *ds, int port,
479 void (*port_vlan_add)(struct dsa_switch *ds, int port,
481 int (*port_vlan_del)(struct dsa_switch *ds, int port,
486 int (*port_fdb_add)(struct dsa_switch *ds, int port,
488 int (*port_fdb_del)(struct dsa_switch *ds, int port,
490 int (*port_fdb_dump)(struct dsa_switch *ds, int port,
496 int (*port_mdb_prepare)(struct dsa_switch *ds, int port,
498 void (*port_mdb_add)(struct dsa_switch *ds, int port,
500 int (*port_mdb_del)(struct dsa_switch *ds, int port,
505 int (*get_rxnfc)(struct dsa_switch *ds, int port,
507 int (*set_rxnfc)(struct dsa_switch *ds, int port,
513 int (*port_mirror_add)(struct dsa_switch *ds, int port,
516 void (*port_mirror_del)(struct dsa_switch *ds, int port,
518 int (*port_setup_tc)(struct dsa_switch *ds, int port,
524 int (*crosschip_bridge_join)(struct dsa_switch *ds, int sw_index,
526 void (*crosschip_bridge_leave)(struct dsa_switch *ds, int sw_index,
532 int (*port_hwtstamp_get)(struct dsa_switch *ds, int port,
534 int (*port_hwtstamp_set)(struct dsa_switch *ds, int port,
536 bool (*port_txtstamp)(struct dsa_switch *ds, int port,
538 bool (*port_rxtstamp)(struct dsa_switch *ds, int port,
544 netdev_tx_t (*port_deferred_xmit)(struct dsa_switch *ds, int port,
573 struct dsa_switch *dsa_switch_alloc(struct device *dev, size_t n);
574 void dsa_unregister_switch(struct dsa_switch *ds);
575 int dsa_register_switch(struct dsa_switch *ds);
577 int dsa_switch_suspend(struct dsa_switch *ds);
578 int dsa_switch_resume(struct dsa_switch *ds);
580 static inline int dsa_switch_suspend(struct dsa_switch *ds) in dsa_switch_suspend()
584 static inline int dsa_switch_resume(struct dsa_switch *ds) in dsa_switch_resume()
645 void dsa_port_phylink_mac_change(struct dsa_switch *ds, int port, bool up);