Lines Matching refs:tb
138 ret = tb_domain_disconnect_all_paths(sw->tb); in nvm_authenticate_host_dma_port()
221 root_port = pcie_find_root_port(sw->tb->nhi->pdev); in nvm_authenticate_start_dma_port()
230 root_port = pcie_find_root_port(sw->tb->nhi->pdev); in nvm_authenticate_complete_dma_port()
312 if (!mutex_trylock(&sw->tb->lock)) { in nvm_read()
318 mutex_unlock(&sw->tb->lock); in nvm_read()
333 if (!mutex_trylock(&sw->tb->lock)) in nvm_write()
343 mutex_unlock(&sw->tb->lock); in nvm_write()
444 static void tb_dump_port(struct tb *tb, const struct tb_port *port) in tb_dump_port() argument
448 tb_dbg(tb, in tb_dump_port()
453 tb_dbg(tb, " Max hop id (in/out): %d/%d\n", in tb_dump_port()
455 tb_dbg(tb, " Max counters: %d\n", regs->max_counters); in tb_dump_port()
456 tb_dbg(tb, " NFC Credits: %#x\n", regs->nfc_credits); in tb_dump_port()
457 tb_dbg(tb, " Credits (total/control): %u/%u\n", port->total_credits, in tb_dump_port()
708 tb_dbg(port->sw->tb, " Port %d: not implemented\n", in tb_init_port()
753 tb_dump_port(port->sw->tb, port); in tb_init_port()
1526 static void tb_dump_switch(const struct tb *tb, const struct tb_switch *sw) in tb_dump_switch() argument
1530 tb_dbg(tb, " %s Switch: %x:%x (Revision: %d, TB Version: %d)\n", in tb_dump_switch()
1533 tb_dbg(tb, " Max Port Number: %d\n", regs->max_port_number); in tb_dump_switch()
1534 tb_dbg(tb, " Config:\n"); in tb_dump_switch()
1535 tb_dbg(tb, in tb_dump_switch()
1540 tb_dbg(tb, " unknown1: %#x unknown4: %#x\n", in tb_dump_switch()
1593 res = tb_cfg_reset(sw->tb->ctl, tb_route(sw)); in tb_switch_reset_host()
1768 ret = tb_domain_disapprove_switch(sw->tb, sw); in disapprove_switch()
1785 if (!mutex_trylock(&sw->tb->lock)) in tb_switch_set_authorized()
1803 ret = tb_domain_approve_switch_key(sw->tb, sw); in tb_switch_set_authorized()
1805 ret = tb_domain_approve_switch(sw->tb, sw); in tb_switch_set_authorized()
1811 ret = tb_domain_challenge_switch_key(sw->tb, sw); in tb_switch_set_authorized()
1829 mutex_unlock(&sw->tb->lock); in tb_switch_set_authorized()
1898 if (!mutex_trylock(&sw->tb->lock)) in key_show()
1906 mutex_unlock(&sw->tb->lock); in key_show()
1923 if (!mutex_trylock(&sw->tb->lock)) in key_store()
1939 mutex_unlock(&sw->tb->lock); in key_store()
2029 if (!mutex_trylock(&sw->tb->lock)) { in nvm_authenticate_sysfs()
2079 mutex_unlock(&sw->tb->lock); in nvm_authenticate_sysfs()
2119 if (!mutex_trylock(&sw->tb->lock)) in nvm_version_show()
2129 mutex_unlock(&sw->tb->lock); in nvm_version_show()
2189 if (sw->tb->security_level == TB_SECURITY_NOPCIE || in switch_attr_is_visible()
2190 sw->tb->security_level == TB_SECURITY_DPONLY) in switch_attr_is_visible()
2206 sw->tb->security_level == TB_SECURITY_SECURE && in switch_attr_is_visible()
2310 const struct tb_cm_ops *cm_ops = sw->tb->cm_ops; in tb_switch_runtime_suspend()
2321 const struct tb_cm_ops *cm_ops = sw->tb->cm_ops; in tb_switch_runtime_resume()
2390 (sw->tb->root_switch && tb_switch_is_usb4(sw->tb->root_switch))) in tb_switch_exceeds_max_depth()
2412 struct tb_switch *tb_switch_alloc(struct tb *tb, struct device *parent, in tb_switch_alloc() argument
2430 upstream_port = tb_cfg_get_upstream_port(tb->ctl, route); in tb_switch_alloc()
2438 sw->tb = tb; in tb_switch_alloc()
2439 ret = tb_cfg_read(tb->ctl, &sw->config, route, 0, TB_CFG_SWITCH, 0, 5); in tb_switch_alloc()
2445 tb_dbg(tb, "current switch config:\n"); in tb_switch_alloc()
2446 tb_dump_switch(tb, sw); in tb_switch_alloc()
2506 dev_set_name(&sw->dev, "%u-%llx", tb->index, tb_route(sw)); in tb_switch_alloc()
2532 tb_switch_alloc_safe_mode(struct tb *tb, struct device *parent, u64 route) in tb_switch_alloc_safe_mode() argument
2540 sw->tb = tb; in tb_switch_alloc_safe_mode()
2551 dev_set_name(&sw->dev, "%u-%llx", tb->index, tb_route(sw)); in tb_switch_alloc_safe_mode()
2569 struct tb *tb = sw->tb; in tb_switch_configure() local
2575 tb_dbg(tb, "%s Switch at %#llx (depth: %d, up port: %d)\n", in tb_switch_configure()
3423 if (sw == sw->tb->root_switch) { in tb_sw_set_unplugged()
3490 err = tb_cfg_get_upstream_port(sw->tb->ctl, tb_route(sw)); in tb_switch_resume()
3681 struct tb *tb; member
3695 if (sw->tb != lookup->tb) in tb_switch_match()
3722 struct tb_switch *tb_switch_find_by_link_depth(struct tb *tb, u8 link, u8 depth) in tb_switch_find_by_link_depth() argument
3728 lookup.tb = tb; in tb_switch_find_by_link_depth()
3747 struct tb_switch *tb_switch_find_by_uuid(struct tb *tb, const uuid_t *uuid) in tb_switch_find_by_uuid() argument
3753 lookup.tb = tb; in tb_switch_find_by_uuid()
3771 struct tb_switch *tb_switch_find_by_route(struct tb *tb, u64 route) in tb_switch_find_by_route() argument
3777 return tb_switch_get(tb->root_switch); in tb_switch_find_by_route()
3780 lookup.tb = tb; in tb_switch_find_by_route()