Lines Matching refs:sw

33 	struct tb_switch *sw;  member
130 static inline struct tb_port *tb_upstream_port(struct tb_switch *sw) in tb_upstream_port() argument
132 return &sw->ports[sw->config.upstream_port_number]; in tb_upstream_port()
135 static inline u64 tb_route(struct tb_switch *sw) in tb_route() argument
137 return ((u64) sw->config.route_hi) << 32 | sw->config.route_lo; in tb_route()
140 static inline int tb_sw_read(struct tb_switch *sw, void *buffer, in tb_sw_read() argument
143 return tb_cfg_read(sw->tb->ctl, in tb_sw_read()
145 tb_route(sw), in tb_sw_read()
152 static inline int tb_sw_write(struct tb_switch *sw, void *buffer, in tb_sw_write() argument
155 return tb_cfg_write(sw->tb->ctl, in tb_sw_write()
157 tb_route(sw), in tb_sw_write()
167 return tb_cfg_read(port->sw->tb->ctl, in tb_port_read()
169 tb_route(port->sw), in tb_port_read()
179 return tb_cfg_write(port->sw->tb->ctl, in tb_port_write()
181 tb_route(port->sw), in tb_port_write()
194 #define __TB_SW_PRINT(level, sw, fmt, arg...) \ argument
196 struct tb_switch *__sw = (sw); \
200 #define tb_sw_WARN(sw, fmt, arg...) __TB_SW_PRINT(tb_WARN, sw, fmt, ##arg) argument
201 #define tb_sw_warn(sw, fmt, arg...) __TB_SW_PRINT(tb_warn, sw, fmt, ##arg) argument
202 #define tb_sw_info(sw, fmt, arg...) __TB_SW_PRINT(tb_info, sw, fmt, ##arg) argument
208 level(__port->sw->tb, "%llx:%x: " fmt, \
209 tb_route(__port->sw), __port->port, ## arg); \
225 void tb_switch_free(struct tb_switch *sw);
226 void tb_switch_suspend(struct tb_switch *sw);
227 int tb_switch_resume(struct tb_switch *sw);
229 void tb_sw_set_unpplugged(struct tb_switch *sw);
230 struct tb_switch *get_switch_at_route(struct tb_switch *sw, u64 route);
244 int tb_drom_read(struct tb_switch *sw);
245 int tb_drom_read_uid_only(struct tb_switch *sw, u64 *uid);
255 return port == tb_upstream_port(port->sw); in tb_is_upstream_port()
267 return tb_route(port->sw) in tb_downstream_route()
268 | ((u64) port->port << (port->sw->config.depth * 8)); in tb_downstream_route()