Lines Matching +full:port +full:- +full:specific

1 // SPDX-License-Identifier: GPL-2.0
3 * Thunderbolt driver - capabilities lookup
18 static int tb_port_enable_tmu(struct tb_port *port, bool enable) in tb_port_enable_tmu() argument
20 struct tb_switch *sw = port->sw; in tb_port_enable_tmu()
25 * Legacy devices need to have TMU access enabled before port in tb_port_enable_tmu()
47 static void tb_port_dummy_read(struct tb_port *port) in tb_port_dummy_read() argument
50 * When reading from next capability pointer location in port in tb_port_dummy_read()
53 * port capabilities are walked. in tb_port_dummy_read()
55 if (tb_switch_is_light_ridge(port->sw)) { in tb_port_dummy_read()
58 tb_port_read(port, &dummy, TB_CFG_PORT, 0, 1); in tb_port_dummy_read()
63 * tb_port_next_cap() - Return next capability in the linked list
64 * @port: Port to find the capability for
67 * Returns dword offset of the next capability in port config space
72 int tb_port_next_cap(struct tb_port *port, unsigned int offset) in tb_port_next_cap() argument
78 return port->config.first_cap_offset; in tb_port_next_cap()
80 ret = tb_port_read(port, &header, TB_CFG_PORT, offset, 1); in tb_port_next_cap()
87 static int __tb_port_find_cap(struct tb_port *port, enum tb_port_cap cap) in __tb_port_find_cap() argument
95 offset = tb_port_next_cap(port, offset); in __tb_port_find_cap()
99 ret = tb_port_read(port, &header, TB_CFG_PORT, offset, 1); in __tb_port_find_cap()
107 return -ENOENT; in __tb_port_find_cap()
111 * tb_port_find_cap() - Find port capability
112 * @port: Port to find the capability for
115 * Returns offset to start of capability or %-ENOENT if no such
119 int tb_port_find_cap(struct tb_port *port, enum tb_port_cap cap) in tb_port_find_cap() argument
123 ret = tb_port_enable_tmu(port, true); in tb_port_find_cap()
127 ret = __tb_port_find_cap(port, cap); in tb_port_find_cap()
129 tb_port_dummy_read(port); in tb_port_find_cap()
130 tb_port_enable_tmu(port, false); in tb_port_find_cap()
136 * tb_switch_next_cap() - Return next capability in the linked list
151 return sw->config.first_cap_offset; in tb_switch_next_cap()
172 ret = -EINVAL; in tb_switch_next_cap()
180 * tb_switch_find_cap() - Find switch capability
184 * Returns offset to start of capability or %-ENOENT if no such
208 return -ENOENT; in tb_switch_find_cap()
212 * tb_switch_find_vse_cap() - Find switch vendor specific capability
214 * @vsec: Vendor specific capability to look
216 * Functions enumerates vendor specific capabilities (VSEC) of a switch
218 * such capability is found returns %-ENOENT. In case of error returns
242 return -ENOENT; in tb_switch_find_vse_cap()