Lines Matching refs:ds

146 	struct dsa_switch	*ds[DSA_MAX_SWITCHES];  member
195 struct dsa_switch *ds; member
270 static inline const struct dsa_port *dsa_to_port(struct dsa_switch *ds, int p) in dsa_to_port() argument
272 return &ds->ports[p]; in dsa_to_port()
275 static inline bool dsa_is_unused_port(struct dsa_switch *ds, int p) in dsa_is_unused_port() argument
277 return dsa_to_port(ds, p)->type == DSA_PORT_TYPE_UNUSED; in dsa_is_unused_port()
280 static inline bool dsa_is_cpu_port(struct dsa_switch *ds, int p) in dsa_is_cpu_port() argument
282 return dsa_to_port(ds, p)->type == DSA_PORT_TYPE_CPU; in dsa_is_cpu_port()
285 static inline bool dsa_is_dsa_port(struct dsa_switch *ds, int p) in dsa_is_dsa_port() argument
287 return dsa_to_port(ds, p)->type == DSA_PORT_TYPE_DSA; in dsa_is_dsa_port()
290 static inline bool dsa_is_user_port(struct dsa_switch *ds, int p) in dsa_is_user_port() argument
292 return dsa_to_port(ds, p)->type == DSA_PORT_TYPE_USER; in dsa_is_user_port()
295 static inline u32 dsa_user_ports(struct dsa_switch *ds) in dsa_user_ports() argument
300 for (p = 0; p < ds->num_ports; p++) in dsa_user_ports()
301 if (dsa_is_user_port(ds, p)) in dsa_user_ports()
308 static inline unsigned int dsa_towards_port(struct dsa_switch *ds, int device, in dsa_towards_port() argument
311 if (device == ds->index) in dsa_towards_port()
314 return ds->rtable[device]; in dsa_towards_port()
318 static inline unsigned int dsa_upstream_port(struct dsa_switch *ds, int port) in dsa_upstream_port() argument
320 const struct dsa_port *dp = dsa_to_port(ds, port); in dsa_upstream_port()
326 return dsa_towards_port(ds, cpu_dp->ds->index, cpu_dp->index); in dsa_upstream_port()
341 enum dsa_tag_protocol (*get_tag_protocol)(struct dsa_switch *ds,
344 int (*setup)(struct dsa_switch *ds);
345 u32 (*get_phy_flags)(struct dsa_switch *ds, int port);
350 int (*phy_read)(struct dsa_switch *ds, int port, int regnum);
351 int (*phy_write)(struct dsa_switch *ds, int port,
357 void (*adjust_link)(struct dsa_switch *ds, int port,
359 void (*fixed_link_update)(struct dsa_switch *ds, int port,
365 void (*phylink_validate)(struct dsa_switch *ds, int port,
368 int (*phylink_mac_link_state)(struct dsa_switch *ds, int port,
370 void (*phylink_mac_config)(struct dsa_switch *ds, int port,
373 void (*phylink_mac_an_restart)(struct dsa_switch *ds, int port);
374 void (*phylink_mac_link_down)(struct dsa_switch *ds, int port,
377 void (*phylink_mac_link_up)(struct dsa_switch *ds, int port,
381 void (*phylink_fixed_state)(struct dsa_switch *ds, int port,
386 void (*get_strings)(struct dsa_switch *ds, int port,
388 void (*get_ethtool_stats)(struct dsa_switch *ds,
390 int (*get_sset_count)(struct dsa_switch *ds, int port, int sset);
391 void (*get_ethtool_phy_stats)(struct dsa_switch *ds,
397 void (*get_wol)(struct dsa_switch *ds, int port,
399 int (*set_wol)(struct dsa_switch *ds, int port,
405 int (*get_ts_info)(struct dsa_switch *ds, int port,
411 int (*suspend)(struct dsa_switch *ds);
412 int (*resume)(struct dsa_switch *ds);
417 int (*port_enable)(struct dsa_switch *ds, int port,
419 void (*port_disable)(struct dsa_switch *ds, int port,
425 int (*set_mac_eee)(struct dsa_switch *ds, int port,
427 int (*get_mac_eee)(struct dsa_switch *ds, int port,
431 int (*get_eeprom_len)(struct dsa_switch *ds);
432 int (*get_eeprom)(struct dsa_switch *ds,
434 int (*set_eeprom)(struct dsa_switch *ds,
440 int (*get_regs_len)(struct dsa_switch *ds, int port);
441 void (*get_regs)(struct dsa_switch *ds, int port,
447 int (*set_ageing_time)(struct dsa_switch *ds, unsigned int msecs);
448 int (*port_bridge_join)(struct dsa_switch *ds, int port,
450 void (*port_bridge_leave)(struct dsa_switch *ds, int port,
452 void (*port_stp_state_set)(struct dsa_switch *ds, int port,
454 void (*port_fast_age)(struct dsa_switch *ds, int port);
459 int (*port_vlan_filtering)(struct dsa_switch *ds, int port,
461 int (*port_vlan_prepare)(struct dsa_switch *ds, int port,
463 void (*port_vlan_add)(struct dsa_switch *ds, int port,
465 int (*port_vlan_del)(struct dsa_switch *ds, int port,
470 int (*port_fdb_add)(struct dsa_switch *ds, int port,
472 int (*port_fdb_del)(struct dsa_switch *ds, int port,
474 int (*port_fdb_dump)(struct dsa_switch *ds, int port,
480 int (*port_mdb_prepare)(struct dsa_switch *ds, int port,
482 void (*port_mdb_add)(struct dsa_switch *ds, int port,
484 int (*port_mdb_del)(struct dsa_switch *ds, int port,
489 int (*get_rxnfc)(struct dsa_switch *ds, int port,
491 int (*set_rxnfc)(struct dsa_switch *ds, int port,
497 int (*port_mirror_add)(struct dsa_switch *ds, int port,
500 void (*port_mirror_del)(struct dsa_switch *ds, int port,
506 int (*crosschip_bridge_join)(struct dsa_switch *ds, int sw_index,
508 void (*crosschip_bridge_leave)(struct dsa_switch *ds, int sw_index,
514 int (*port_hwtstamp_get)(struct dsa_switch *ds, int port,
516 int (*port_hwtstamp_set)(struct dsa_switch *ds, int port,
518 bool (*port_txtstamp)(struct dsa_switch *ds, int port,
520 bool (*port_rxtstamp)(struct dsa_switch *ds, int port,
555 void dsa_unregister_switch(struct dsa_switch *ds);
556 int dsa_register_switch(struct dsa_switch *ds);
558 int dsa_switch_suspend(struct dsa_switch *ds);
559 int dsa_switch_resume(struct dsa_switch *ds);
561 static inline int dsa_switch_suspend(struct dsa_switch *ds) in dsa_switch_suspend() argument
565 static inline int dsa_switch_resume(struct dsa_switch *ds) in dsa_switch_resume() argument
625 void dsa_port_phylink_mac_change(struct dsa_switch *ds, int port, bool up);