Lines Matching refs:adapter
1204 struct s390_io_adapter *adapter; in register_io_adapter() local
1215 adapter = kzalloc(sizeof(*adapter), GFP_KERNEL); in register_io_adapter()
1216 if (!adapter) in register_io_adapter()
1219 INIT_LIST_HEAD(&adapter->maps); in register_io_adapter()
1220 init_rwsem(&adapter->maps_lock); in register_io_adapter()
1221 atomic_set(&adapter->nr_maps, 0); in register_io_adapter()
1222 adapter->id = adapter_info.id; in register_io_adapter()
1223 adapter->isc = adapter_info.isc; in register_io_adapter()
1224 adapter->maskable = adapter_info.maskable; in register_io_adapter()
1225 adapter->masked = false; in register_io_adapter()
1226 adapter->swap = adapter_info.swap; in register_io_adapter()
1227 dev->kvm->arch.adapters[adapter->id] = adapter; in register_io_adapter()
1235 struct s390_io_adapter *adapter = get_io_adapter(kvm, id); in kvm_s390_mask_adapter() local
1237 if (!adapter || !adapter->maskable) in kvm_s390_mask_adapter()
1239 ret = adapter->masked; in kvm_s390_mask_adapter()
1240 adapter->masked = masked; in kvm_s390_mask_adapter()
1246 struct s390_io_adapter *adapter = get_io_adapter(kvm, id); in kvm_s390_adapter_map() local
1250 if (!adapter || !addr) in kvm_s390_adapter_map()
1269 down_write(&adapter->maps_lock); in kvm_s390_adapter_map()
1270 if (atomic_inc_return(&adapter->nr_maps) < MAX_S390_ADAPTER_MAPS) { in kvm_s390_adapter_map()
1271 list_add_tail(&map->list, &adapter->maps); in kvm_s390_adapter_map()
1277 up_write(&adapter->maps_lock); in kvm_s390_adapter_map()
1286 struct s390_io_adapter *adapter = get_io_adapter(kvm, id); in kvm_s390_adapter_unmap() local
1290 if (!adapter || !addr) in kvm_s390_adapter_unmap()
1293 down_write(&adapter->maps_lock); in kvm_s390_adapter_unmap()
1294 list_for_each_entry_safe(map, tmp, &adapter->maps, list) { in kvm_s390_adapter_unmap()
1297 atomic_dec(&adapter->nr_maps); in kvm_s390_adapter_unmap()
1304 up_write(&adapter->maps_lock); in kvm_s390_adapter_unmap()
1331 struct s390_io_adapter *adapter; in modify_io_adapter() local
1337 adapter = get_io_adapter(dev->kvm, req.id); in modify_io_adapter()
1338 if (!adapter) in modify_io_adapter()
1433 static struct s390_map_info *get_map_info(struct s390_io_adapter *adapter, in get_map_info() argument
1438 if (!adapter) in get_map_info()
1441 list_for_each_entry(map, &adapter->maps, list) { in get_map_info()
1449 struct s390_io_adapter *adapter, in adapter_indicators_set() argument
1457 info = get_map_info(adapter, adapter_int->ind_addr); in adapter_indicators_set()
1461 bit = get_ind_bit(info->addr, adapter_int->ind_offset, adapter->swap); in adapter_indicators_set()
1466 info = get_map_info(adapter, adapter_int->summary_addr); in adapter_indicators_set()
1473 adapter->swap); in adapter_indicators_set()
1491 struct s390_io_adapter *adapter; in set_adapter_int() local
1496 adapter = get_io_adapter(kvm, e->adapter.adapter_id); in set_adapter_int()
1497 if (!adapter) in set_adapter_int()
1499 down_read(&adapter->maps_lock); in set_adapter_int()
1500 ret = adapter_indicators_set(kvm, adapter, &e->adapter); in set_adapter_int()
1501 up_read(&adapter->maps_lock); in set_adapter_int()
1502 if ((ret > 0) && !adapter->masked) { in set_adapter_int()
1506 .parm64 = (adapter->isc << 27) | 0x80000000, in set_adapter_int()
1523 e->adapter.summary_addr = ue->u.adapter.summary_addr; in kvm_set_routing_entry()
1524 e->adapter.ind_addr = ue->u.adapter.ind_addr; in kvm_set_routing_entry()
1525 e->adapter.summary_offset = ue->u.adapter.summary_offset; in kvm_set_routing_entry()
1526 e->adapter.ind_offset = ue->u.adapter.ind_offset; in kvm_set_routing_entry()
1527 e->adapter.adapter_id = ue->u.adapter.adapter_id; in kvm_set_routing_entry()