/linux/drivers/thunderbolt/ |
H A D | eeprom.c | 18 static int tb_eeprom_ctl_write(struct tb_switch *sw, struct tb_eeprom_ctl *ctl) in tb_eeprom_ctl_write() argument 20 return tb_sw_write(sw, ctl, TB_CFG_SWITCH, sw->cap_plug_events + ROUTER_CS_4, 1); in tb_eeprom_ctl_write() 26 static int tb_eeprom_ctl_read(struct tb_switch *sw, struct tb_eeprom_ctl *ctl) in tb_eeprom_ctl_read() argument 28 return tb_sw_read(sw, ctl, TB_CFG_SWITCH, sw->cap_plug_events + ROUTER_CS_4, 1); in tb_eeprom_ctl_read() 42 static int tb_eeprom_active(struct tb_switch *sw, bool enable) in tb_eeprom_active() argument 45 int res = tb_eeprom_ctl_read(sw, &ctl); in tb_eeprom_active() 50 res = tb_eeprom_ctl_write(sw, &ctl); in tb_eeprom_active() 54 return tb_eeprom_ctl_write(sw, &ctl); in tb_eeprom_active() 57 res = tb_eeprom_ctl_write(sw, &ctl); in tb_eeprom_active() 61 return tb_eeprom_ctl_write(sw, &ctl); in tb_eeprom_active() [all …]
|
H A D | switch.c | 37 static struct nvm_auth_status *__nvm_get_auth_status(const struct tb_switch *sw) in __nvm_get_auth_status() argument 42 if (uuid_equal(&st->uuid, sw->uuid)) in __nvm_get_auth_status() 49 static void nvm_get_auth_status(const struct tb_switch *sw, u32 *status) in nvm_get_auth_status() argument 54 st = __nvm_get_auth_status(sw); in nvm_get_auth_status() 60 static void nvm_set_auth_status(const struct tb_switch *sw, u32 status) in nvm_set_auth_status() argument 64 if (WARN_ON(!sw->uuid)) in nvm_set_auth_status() 68 st = __nvm_get_auth_status(sw); in nvm_set_auth_status() 75 memcpy(&st->uuid, sw->uuid, sizeof(st->uuid)); in nvm_set_auth_status() 85 static void nvm_clear_auth_status(const struct tb_switch *sw) in nvm_clear_auth_status() argument 90 st = __nvm_get_auth_status(sw); in nvm_clear_auth_status() [all …]
|
H A D | tmu.c | 58 static bool tb_switch_tmu_enhanced_is_supported(const struct tb_switch *sw) in tb_switch_tmu_enhanced_is_supported() argument 60 return usb4_switch_version(sw) > 1; in tb_switch_tmu_enhanced_is_supported() 63 static int tb_switch_set_tmu_mode_params(struct tb_switch *sw, in tb_switch_set_tmu_mode_params() argument 72 ret = tb_sw_read(sw, &val, TB_CFG_SWITCH, in tb_switch_set_tmu_mode_params() 73 sw->tmu.cap + TMU_RTR_CS_0, 1); in tb_switch_set_tmu_mode_params() 80 ret = tb_sw_write(sw, &val, TB_CFG_SWITCH, in tb_switch_set_tmu_mode_params() 81 sw->tmu.cap + TMU_RTR_CS_0, 1); in tb_switch_set_tmu_mode_params() 85 ret = tb_sw_read(sw, &val, TB_CFG_SWITCH, in tb_switch_set_tmu_mode_params() 86 sw->tmu.cap + TMU_RTR_CS_15, 1); in tb_switch_set_tmu_mode_params() 99 ret = tb_sw_write(sw, &val, TB_CFG_SWITCH, in tb_switch_set_tmu_mode_params() [all …]
|
H A D | lc.c | 15 * @sw: Switch whose UUID is read 18 int tb_lc_read_uuid(struct tb_switch *sw, u32 *uuid) in tb_lc_read_uuid() argument 20 if (!sw->cap_lc) in tb_lc_read_uuid() 22 return tb_sw_read(sw, uuid, TB_CFG_SWITCH, sw->cap_lc + TB_LC_FUSE, 4); in tb_lc_read_uuid() 25 static int read_lc_desc(struct tb_switch *sw, u32 *desc) in read_lc_desc() argument 27 if (!sw->cap_lc) in read_lc_desc() 29 return tb_sw_read(sw, desc, TB_CFG_SWITCH, sw->cap_lc + TB_LC_DESC, 1); in read_lc_desc() 34 struct tb_switch *sw = port->sw; in find_port_lc_cap() local 38 ret = read_lc_desc(sw, &desc); in find_port_lc_cap() 47 return sw->cap_lc + start + phys * size; in find_port_lc_cap() [all …]
|
H A D | clx.c | 81 if (tb_switch_is_usb4(port->sw)) { in tb_port_clx_supported() 179 * @sw: The router to check CLx support for 181 static bool tb_switch_clx_is_supported(const struct tb_switch *sw) in tb_switch_clx_is_supported() argument 186 if (sw->quirks & QUIRK_NO_CLX) in tb_switch_clx_is_supported() 193 if (tb_switch_is_tiger_lake(sw)) in tb_switch_clx_is_supported() 196 return tb_switch_is_usb4(sw) || tb_switch_is_titan_ridge(sw); in tb_switch_clx_is_supported() 201 * @sw: Router 208 int tb_switch_clx_init(struct tb_switch *sw) in tb_switch_clx_init() argument 213 if (tb_switch_is_icm(sw)) in tb_switch_clx_init() 216 if (!tb_route(sw)) in tb_switch_clx_init() [all …]
|
H A D | quirks.c | 10 static void quirk_force_power_link(struct tb_switch *sw) in quirk_force_power_link() argument 12 sw->quirks |= QUIRK_FORCE_POWER_LINK_CONTROLLER; in quirk_force_power_link() 13 tb_sw_dbg(sw, "forcing power to link controller\n"); in quirk_force_power_link() 16 static void quirk_dp_credit_allocation(struct tb_switch *sw) in quirk_dp_credit_allocation() argument 18 if (sw->credit_allocation && sw->min_dp_main_credits == 56) { in quirk_dp_credit_allocation() 19 sw->min_dp_main_credits = 18; in quirk_dp_credit_allocation() 20 tb_sw_dbg(sw, "quirked DP main: %u\n", sw->min_dp_main_credits); in quirk_dp_credit_allocation() 24 static void quirk_clx_disable(struct tb_switch *sw) in quirk_clx_disable() argument 26 sw->quirks |= QUIRK_NO_CLX; in quirk_clx_disable() 27 tb_sw_dbg(sw, "disabling CL states\n"); in quirk_clx_disable() [all …]
|
H A D | test.c | 39 struct tb_switch *sw; in alloc_switch() local 43 sw = kunit_kzalloc(test, sizeof(*sw), GFP_KERNEL); in alloc_switch() 44 if (!sw) in alloc_switch() 47 sw->config.upstream_port_number = upstream_port; in alloc_switch() 48 sw->config.depth = tb_route_length(route); in alloc_switch() 49 sw->config.route_hi = upper_32_bits(route); in alloc_switch() 50 sw->config.route_lo = lower_32_bits(route); in alloc_switch() 51 sw->config.enabled = 0; in alloc_switch() 52 sw->config.max_port_number = max_port_number; in alloc_switch() 54 size = (sw->config.max_port_number + 1) * sizeof(*sw->ports); in alloc_switch() [all …]
|
H A D | cap.c | 20 struct tb_switch *sw = port->sw; in tb_port_enable_tmu() local 28 if (tb_switch_is_light_ridge(sw)) in tb_port_enable_tmu() 30 else if (tb_switch_is_eagle_ridge(sw)) in tb_port_enable_tmu() 35 ret = tb_sw_read(sw, &value, TB_CFG_SWITCH, offset, 1); in tb_port_enable_tmu() 44 return tb_sw_write(sw, &value, TB_CFG_SWITCH, offset, 1); in tb_port_enable_tmu() 55 if (tb_switch_is_light_ridge(port->sw)) { in tb_port_dummy_read() 137 * @sw: Switch to find the capability for 145 int tb_switch_next_cap(struct tb_switch *sw, unsigned int offset) in tb_switch_next_cap() argument 151 return sw->config.first_cap_offset; in tb_switch_next_cap() 153 ret = tb_sw_read(sw, &header, TB_CFG_SWITCH, offset, 2); in tb_switch_next_cap() [all …]
|
H A D | dma_port.c | 49 * @sw: Switch the DMA port belongs to 55 struct tb_switch *sw; member 168 static int dma_find_port(struct tb_switch *sw) in dma_find_port() argument 181 ret = dma_port_read(sw->tb->ctl, &type, tb_route(sw), ports[i], in dma_find_port() 192 * @sw: Switch from where find the DMA port 201 struct tb_dma_port *dma_port_alloc(struct tb_switch *sw) in dma_port_alloc() argument 206 port = dma_find_port(sw); in dma_port_alloc() 220 dma->sw = sw; in dma_port_alloc() 243 struct tb_switch *sw = dma->sw; in dma_port_wait_for_completion() local 249 ret = dma_port_read(sw->tb->ctl, &in, tb_route(sw), dma->port, in dma_port_wait_for_completion() [all …]
|
/linux/drivers/platform/surface/ |
H A D | surface_aggregator_tabletsw.c | 29 int (*get_state)(struct ssam_tablet_sw *sw, struct ssam_tablet_sw_state *state); 30 const char *(*state_name)(struct ssam_tablet_sw *sw, 32 bool (*state_is_tablet_mode)(struct ssam_tablet_sw *sw, 55 int (*get_state)(struct ssam_tablet_sw *sw, struct ssam_tablet_sw_state *state); 56 const char *(*state_name)(struct ssam_tablet_sw *sw, 58 bool (*state_is_tablet_mode)(struct ssam_tablet_sw *sw, 72 struct ssam_tablet_sw *sw = dev_get_drvdata(dev); in state_show() local 73 const char *state = sw->ops.state_name(sw, &sw->state); in state_show() 90 struct ssam_tablet_sw *sw = container_of(work, struct ssam_tablet_sw, update_work); in ssam_tablet_sw_update_workfn() local 94 status = sw->ops.get_state(sw, &state); in ssam_tablet_sw_update_workfn() [all …]
|
/linux/drivers/net/ethernet/marvell/prestera/ |
H A D | prestera_router_hw.c | 54 static int prestera_nexthop_group_set(struct prestera_switch *sw, 57 prestera_nexthop_group_util_hw_state(struct prestera_switch *sw, 67 int prestera_router_hw_init(struct prestera_switch *sw) in prestera_router_hw_init() argument 71 err = rhashtable_init(&sw->router->nh_neigh_ht, in prestera_router_hw_init() 76 err = rhashtable_init(&sw->router->nexthop_group_ht, in prestera_router_hw_init() 81 err = rhashtable_init(&sw->router->fib_ht, in prestera_router_hw_init() 86 INIT_LIST_HEAD(&sw->router->vr_list); in prestera_router_hw_init() 87 INIT_LIST_HEAD(&sw->router->rif_entry_list); in prestera_router_hw_init() 92 rhashtable_destroy(&sw->router->nexthop_group_ht); in prestera_router_hw_init() 94 rhashtable_destroy(&sw->router->nh_neigh_ht); in prestera_router_hw_init() [all …]
|
H A D | prestera_main.c | 93 struct prestera_port *prestera_port_find_by_hwid(struct prestera_switch *sw, in prestera_port_find_by_hwid() argument 98 read_lock(&sw->port_list_lock); in prestera_port_find_by_hwid() 99 list_for_each_entry(tmp, &sw->port_list, list) { in prestera_port_find_by_hwid() 105 read_unlock(&sw->port_list_lock); in prestera_port_find_by_hwid() 110 struct prestera_port *prestera_find_port(struct prestera_switch *sw, u32 id) in prestera_find_port() argument 114 read_lock(&sw->port_list_lock); in prestera_find_port() 115 list_for_each_entry(tmp, &sw->port_list, list) { in prestera_find_port() 121 read_unlock(&sw->port_list_lock); in prestera_find_port() 131 return port ? port->sw : NULL; in prestera_switch_get() 371 struct prestera_switch *sw = port->sw; in prestera_port_sfp_bind() local [all …]
|
H A D | prestera_router.c | 106 static int prestera_util_nhc2nc_key(struct prestera_switch *sw, in prestera_util_nhc2nc_key() argument 133 prestera_util_nhc_eq_n_cache_key(struct prestera_switch *sw, in prestera_util_nhc_eq_n_cache_key() argument 140 err = prestera_util_nhc2nc_key(sw, nhc, &tk); in prestera_util_nhc_eq_n_cache_key() 151 prestera_util_neigh2nc_key(struct prestera_switch *sw, struct neighbour *n, in prestera_util_neigh2nc_key() argument 430 prestera_neigh_iface_init(struct prestera_switch *sw, in prestera_neigh_iface_init() argument 452 prestera_kern_neigh_cache_find(struct prestera_switch *sw, in prestera_kern_neigh_cache_find() argument 458 rhashtable_lookup_fast(&sw->router->kern_neigh_cache_ht, key, in prestera_kern_neigh_cache_find() 464 __prestera_kern_neigh_cache_destruct(struct prestera_switch *sw, in __prestera_kern_neigh_cache_destruct() argument 471 __prestera_kern_neigh_cache_destroy(struct prestera_switch *sw, in __prestera_kern_neigh_cache_destroy() argument 474 rhashtable_remove_fast(&sw->router->kern_neigh_cache_ht, in __prestera_kern_neigh_cache_destroy() [all …]
|
H A D | prestera_hw.h | 140 (struct prestera_switch *sw, struct prestera_event *evt, void *arg); 152 int prestera_hw_switch_init(struct prestera_switch *sw); 153 void prestera_hw_switch_fini(struct prestera_switch *sw); 154 int prestera_hw_switch_ageing_set(struct prestera_switch *sw, u32 ageing_ms); 155 int prestera_hw_switch_mac_set(struct prestera_switch *sw, const char *mac); 192 int prestera_hw_vlan_create(struct prestera_switch *sw, u16 vid); 193 int prestera_hw_vlan_delete(struct prestera_switch *sw, u16 vid); 205 int prestera_hw_fdb_flush_vlan(struct prestera_switch *sw, u16 vid, u32 mode); 210 int prestera_hw_bridge_create(struct prestera_switch *sw, u16 *bridge_id); 211 int prestera_hw_bridge_delete(struct prestera_switch *sw, u16 bridge_id); [all …]
|
H A D | prestera_hw.c | 813 static int __prestera_cmd_ret(struct prestera_switch *sw, in __prestera_cmd_ret() argument 819 struct prestera_device *dev = sw->dev; in __prestera_cmd_ret() 836 static int prestera_cmd_ret(struct prestera_switch *sw, in prestera_cmd_ret() argument 841 return __prestera_cmd_ret(sw, type, cmd, clen, ret, rlen, 0); in prestera_cmd_ret() 844 static int prestera_cmd_ret_wait(struct prestera_switch *sw, in prestera_cmd_ret_wait() argument 850 return __prestera_cmd_ret(sw, type, cmd, clen, ret, rlen, waitms); in prestera_cmd_ret_wait() 853 static int prestera_cmd(struct prestera_switch *sw, in prestera_cmd() argument 859 return prestera_cmd_ret(sw, type, cmd, clen, &resp.ret, sizeof(resp)); in prestera_cmd() 918 __find_event_handler(const struct prestera_switch *sw, in __find_event_handler() argument 923 list_for_each_entry_rcu(eh, &sw->event_handlers, list) { in __find_event_handler() [all …]
|
H A D | prestera_span.c | 21 struct prestera_switch *sw; member 37 list_add_tail(&entry->list, &port->sw->span->entries); in prestera_span_entry_create() 78 struct prestera_switch *sw = port->sw; in prestera_span_get() local 82 entry = prestera_span_entry_find_by_port(sw->span, port); in prestera_span_get() 95 prestera_hw_span_release(sw, new_span_id); in prestera_span_get() 103 static int prestera_span_put(struct prestera_switch *sw, u8 span_id) in prestera_span_put() argument 108 entry = prestera_span_entry_find_by_id(sw->span, span_id); in prestera_span_put() 115 err = prestera_hw_span_release(sw, span_id); in prestera_span_put() 127 struct prestera_switch *sw = binding->port->sw; in prestera_span_rule_add() local 141 prestera_span_put(sw, span_id); in prestera_span_rule_add() [all …]
|
H A D | prestera_devlink.c | 127 struct prestera_switch *sw; member 356 struct prestera_switch *sw = devlink_priv(dl); in prestera_dl_info_get() local 360 sw->dev->fw_rev.maj, in prestera_dl_info_get() 361 sw->dev->fw_rev.min, in prestera_dl_info_get() 362 sw->dev->fw_rev.sub); in prestera_dl_info_get() 394 void prestera_devlink_free(struct prestera_switch *sw) in prestera_devlink_free() argument 396 struct devlink *dl = priv_to_devlink(sw); in prestera_devlink_free() 401 void prestera_devlink_register(struct prestera_switch *sw) in prestera_devlink_register() argument 403 struct devlink *dl = priv_to_devlink(sw); in prestera_devlink_register() 408 void prestera_devlink_unregister(struct prestera_switch *sw) in prestera_devlink_unregister() argument [all …]
|
/linux/arch/mips/alchemy/common/ |
H A D | sleeper.S | 25 sw $1, PT_R1(sp) 26 sw $2, PT_R2(sp) 27 sw $3, PT_R3(sp) 28 sw $4, PT_R4(sp) 29 sw $5, PT_R5(sp) 30 sw $6, PT_R6(sp) 31 sw $7, PT_R7(sp) 32 sw $16, PT_R16(sp) 33 sw $17, PT_R17(sp) 34 sw $18, PT_R18(sp) [all …]
|
/linux/drivers/input/misc/ |
H A D | ad714x.c | 216 struct ad714x_button_drv *sw = &ad714x->sw->button[idx]; in ad714x_button_state_machine() local 218 switch (sw->state) { in ad714x_button_state_machine() 223 input_report_key(sw->input, hw->keycode, 1); in ad714x_button_state_machine() 224 input_sync(sw->input); in ad714x_button_state_machine() 225 sw->state = ACTIVE; in ad714x_button_state_machine() 233 input_report_key(sw->input, hw->keycode, 0); in ad714x_button_state_machine() 234 input_sync(sw->input); in ad714x_button_state_machine() 235 sw->state = IDLE; in ad714x_button_state_machine() 269 struct ad714x_slider_drv *sw = &ad714x->sw->slider[idx]; in ad714x_slider_cal_highest_stage() local 271 sw->highest_stage = ad714x_cal_highest_stage(ad714x, hw->start_stage, in ad714x_slider_cal_highest_stage() [all …]
|
/linux/drivers/input/joystick/ |
H A D | sidewinder.c | 95 struct sw { struct 196 #define GB(pos,num) sw_get_bits(buf, pos, num, sw->bits) 282 static int sw_parse(unsigned char *buf, struct sw *sw) in sw_parse() argument 287 switch (sw->type) { in sw_parse() 294 dev = sw->dev[0]; in sw_parse() 316 for (i = 0; i < sw->number; i ++) { in sw_parse() 321 input_report_abs(sw->dev[i], ABS_X, GB(i*15+3,1) - GB(i*15+2,1)); in sw_parse() 322 input_report_abs(sw->dev[i], ABS_Y, GB(i*15+0,1) - GB(i*15+1,1)); in sw_parse() 325 input_report_key(sw->dev[i], sw_btn[SW_ID_GP][j], !GB(i*15+j+4,1)); in sw_parse() 327 input_sync(sw->dev[i]); in sw_parse() [all …]
|
/linux/arch/openrisc/kernel/ |
H A D | entry.S | 46 l.sw -8(r1),r2 /* store frame pointer */ ;\ 47 l.sw -4(r1),r9 /* store return address */ ;\ 59 l.sw -12(r1),t1 /* save extra reg */ ;\ 60 l.sw -8(r1),r2 /* store frame pointer */ ;\ 61 l.sw -4(r1),r9 /* store return address */ ;\ 147 l.sw PT_GPR2(r1),r2 ;\ 148 l.sw PT_GPR3(r1),r3 ;\ 150 l.sw PT_GPR5(r1),r5 ;\ 151 l.sw PT_GPR6(r1),r6 ;\ 152 l.sw PT_GPR7(r1),r7 ;\ [all …]
|
/linux/drivers/gpu/drm/nouveau/nvkm/engine/sw/ |
H A D | base.c | 30 nvkm_sw_mthd(struct nvkm_sw *sw, int chid, int subc, u32 mthd, u32 data) in nvkm_sw_mthd() argument 36 spin_lock_irqsave(&sw->engine.lock, flags); in nvkm_sw_mthd() 37 list_for_each_entry(chan, &sw->chan, head) { in nvkm_sw_mthd() 41 list_add(&chan->head, &sw->chan); in nvkm_sw_mthd() 45 spin_unlock_irqrestore(&sw->engine.lock, flags); in nvkm_sw_mthd() 61 struct nvkm_sw *sw = nvkm_sw(oclass->engine); in nvkm_sw_oclass_get() local 64 while (sw->func->sclass[c].ctor) { in nvkm_sw_oclass_get() 66 oclass->engn = &sw->func->sclass[index]; in nvkm_sw_oclass_get() 67 oclass->base = sw->func->sclass[index].base; in nvkm_sw_oclass_get() 80 struct nvkm_sw *sw = nvkm_sw(oclass->engine); in nvkm_sw_cclass_get() local [all …]
|
/linux/drivers/soc/bcm/brcmstb/pm/ |
H A D | s3-mips.S | 26 sw ra, 0(t0) 27 sw s0, 4(t0) 28 sw s1, 8(t0) 29 sw s2, 12(t0) 30 sw s3, 16(t0) 31 sw s4, 20(t0) 32 sw s5, 24(t0) 33 sw s6, 28(t0) 34 sw s7, 32(t0) 35 sw gp, 36(t0) [all …]
|
/linux/tools/testing/selftests/drivers/net/bonding/ |
H A D | bond-lladdr-target.sh | 9 # | | | sw 25 sw="sw-$(mktemp -u XXXXXX)" 30 ip netns del $sw 46 ip netns add $sw 49 ip -n $host link add veth0 type veth peer name veth0 netns $sw 50 ip -n $host link add veth1 type veth peer name veth1 netns $sw 52 ip -n $sw link add br0 type bridge 53 ip -n $sw link set br0 up 54 sw_lladdr=$(ip -n $sw addr show br0 | awk '/fe80/{print $2}' | cut -d'/' -f1) 56 slowwait 2 wait_lladdr_dad ip -n $sw addr show br0 [all …]
|
/linux/drivers/block/ |
H A D | swim3.c | 274 struct swim3 __iomem *sw = fs->swim3; in swim3_select() local 276 out_8(&sw->select, RELAX); in swim3_select() 278 out_8(&sw->control_bis, SELECT); in swim3_select() 280 out_8(&sw->control_bic, SELECT); in swim3_select() 281 out_8(&sw->select, sel & CA_MASK); in swim3_select() 286 struct swim3 __iomem *sw = fs->swim3; in swim3_action() local 290 out_8(&sw->select, sw->select | LSTRB); in swim3_action() 292 out_8(&sw->select, sw->select & ~LSTRB); in swim3_action() 298 struct swim3 __iomem *sw = fs->swim3; in swim3_readbit() local 303 stat = in_8(&sw->status); in swim3_readbit() [all …]
|