Searched refs:slot (Results 1 - 200 of 1788) sorted by relevance

123456789

/linux-4.4.14/drivers/pci/hotplug/
H A Drpaphp_slot.c35 /* free up the memory used by a slot */ rpaphp_release_slot()
38 struct slot *slot = (struct slot *) hotplug_slot->private; rpaphp_release_slot() local
39 dealloc_slot_struct(slot); rpaphp_release_slot()
42 void dealloc_slot_struct(struct slot *slot) dealloc_slot_struct() argument
44 kfree(slot->hotplug_slot->info); dealloc_slot_struct()
45 kfree(slot->name); dealloc_slot_struct()
46 kfree(slot->hotplug_slot); dealloc_slot_struct()
47 kfree(slot); dealloc_slot_struct()
50 struct slot *alloc_slot_struct(struct device_node *dn, alloc_slot_struct()
53 struct slot *slot; alloc_slot_struct() local
55 slot = kzalloc(sizeof(struct slot), GFP_KERNEL); alloc_slot_struct()
56 if (!slot) alloc_slot_struct()
58 slot->hotplug_slot = kzalloc(sizeof(struct hotplug_slot), GFP_KERNEL); alloc_slot_struct()
59 if (!slot->hotplug_slot) alloc_slot_struct()
61 slot->hotplug_slot->info = kzalloc(sizeof(struct hotplug_slot_info), alloc_slot_struct()
63 if (!slot->hotplug_slot->info) alloc_slot_struct()
65 slot->name = kstrdup(drc_name, GFP_KERNEL); alloc_slot_struct()
66 if (!slot->name) alloc_slot_struct()
68 slot->dn = dn; alloc_slot_struct()
69 slot->index = drc_index; alloc_slot_struct()
70 slot->power_domain = power_domain; alloc_slot_struct()
71 slot->hotplug_slot->private = slot; alloc_slot_struct()
72 slot->hotplug_slot->ops = &rpaphp_hotplug_slot_ops; alloc_slot_struct()
73 slot->hotplug_slot->release = &rpaphp_release_slot; alloc_slot_struct()
75 return (slot); alloc_slot_struct()
78 kfree(slot->hotplug_slot->info); alloc_slot_struct()
80 kfree(slot->hotplug_slot); alloc_slot_struct()
82 kfree(slot); alloc_slot_struct()
87 static int is_registered(struct slot *slot) is_registered() argument
89 struct slot *tmp_slot; is_registered()
92 if (!strcmp(tmp_slot->name, slot->name)) is_registered()
98 int rpaphp_deregister_slot(struct slot *slot) rpaphp_deregister_slot() argument
101 struct hotplug_slot *php_slot = slot->hotplug_slot; rpaphp_deregister_slot()
103 dbg("%s - Entry: deregistering slot=%s\n", rpaphp_deregister_slot()
104 __func__, slot->name); rpaphp_deregister_slot()
106 list_del(&slot->rpaphp_slot_list); rpaphp_deregister_slot()
110 err("Problem unregistering a slot %s\n", slot->name); rpaphp_deregister_slot()
117 int rpaphp_register_slot(struct slot *slot) rpaphp_register_slot() argument
119 struct hotplug_slot *php_slot = slot->hotplug_slot; rpaphp_register_slot()
123 dbg("%s registering slot:path[%s] index[%x], name[%s] pdomain[%x] type[%d]\n", rpaphp_register_slot()
124 __func__, slot->dn->full_name, slot->index, slot->name, rpaphp_register_slot()
125 slot->power_domain, slot->type); rpaphp_register_slot()
127 /* should not try to register the same slot twice */ rpaphp_register_slot()
128 if (is_registered(slot)) { rpaphp_register_slot()
129 err("rpaphp_register_slot: slot[%s] is already registered\n", slot->name); rpaphp_register_slot()
133 if (slot->dn->child) rpaphp_register_slot()
134 slotno = PCI_SLOT(PCI_DN(slot->dn->child)->devfn); rpaphp_register_slot()
137 retval = pci_hp_register(php_slot, slot->bus, slotno, slot->name); rpaphp_register_slot()
143 /* add slot to our internal list */ rpaphp_register_slot()
144 list_add(&slot->rpaphp_slot_list, &rpaphp_slot_head); rpaphp_register_slot()
145 info("Slot [%s] registered\n", slot->name); rpaphp_register_slot()
H A Dcpci_hotplug_pci.c49 u8 cpci_get_attention_status(struct slot *slot) cpci_get_attention_status() argument
54 hs_cap = pci_bus_find_capability(slot->bus, cpci_get_attention_status()
55 slot->devfn, cpci_get_attention_status()
60 if (pci_bus_read_config_word(slot->bus, cpci_get_attention_status()
61 slot->devfn, cpci_get_attention_status()
69 int cpci_set_attention_status(struct slot *slot, int status) cpci_set_attention_status() argument
74 hs_cap = pci_bus_find_capability(slot->bus, cpci_set_attention_status()
75 slot->devfn, cpci_set_attention_status()
79 if (pci_bus_read_config_word(slot->bus, cpci_set_attention_status()
80 slot->devfn, cpci_set_attention_status()
88 if (pci_bus_write_config_word(slot->bus, cpci_set_attention_status()
89 slot->devfn, cpci_set_attention_status()
96 u16 cpci_get_hs_csr(struct slot *slot) cpci_get_hs_csr() argument
101 hs_cap = pci_bus_find_capability(slot->bus, cpci_get_hs_csr()
102 slot->devfn, cpci_get_hs_csr()
106 if (pci_bus_read_config_word(slot->bus, cpci_get_hs_csr()
107 slot->devfn, cpci_get_hs_csr()
114 int cpci_check_and_clear_ins(struct slot *slot) cpci_check_and_clear_ins() argument
120 hs_cap = pci_bus_find_capability(slot->bus, cpci_check_and_clear_ins()
121 slot->devfn, cpci_check_and_clear_ins()
125 if (pci_bus_read_config_word(slot->bus, cpci_check_and_clear_ins()
126 slot->devfn, cpci_check_and_clear_ins()
132 if (pci_bus_write_config_word(slot->bus, cpci_check_and_clear_ins()
133 slot->devfn, cpci_check_and_clear_ins()
143 int cpci_check_ext(struct slot *slot) cpci_check_ext() argument
149 hs_cap = pci_bus_find_capability(slot->bus, cpci_check_ext()
150 slot->devfn, cpci_check_ext()
154 if (pci_bus_read_config_word(slot->bus, cpci_check_ext()
155 slot->devfn, cpci_check_ext()
164 int cpci_clear_ext(struct slot *slot) cpci_clear_ext() argument
169 hs_cap = pci_bus_find_capability(slot->bus, cpci_clear_ext()
170 slot->devfn, cpci_clear_ext()
174 if (pci_bus_read_config_word(slot->bus, cpci_clear_ext()
175 slot->devfn, cpci_clear_ext()
181 if (pci_bus_write_config_word(slot->bus, cpci_clear_ext()
182 slot->devfn, cpci_clear_ext()
190 int cpci_led_on(struct slot *slot) cpci_led_on() argument
195 hs_cap = pci_bus_find_capability(slot->bus, cpci_led_on()
196 slot->devfn, cpci_led_on()
200 if (pci_bus_read_config_word(slot->bus, cpci_led_on()
201 slot->devfn, cpci_led_on()
207 if (pci_bus_write_config_word(slot->bus, cpci_led_on()
208 slot->devfn, cpci_led_on()
211 err("Could not set LOO for slot %s", cpci_led_on()
212 hotplug_slot_name(slot->hotplug_slot)); cpci_led_on()
219 int cpci_led_off(struct slot *slot) cpci_led_off() argument
224 hs_cap = pci_bus_find_capability(slot->bus, cpci_led_off()
225 slot->devfn, cpci_led_off()
229 if (pci_bus_read_config_word(slot->bus, cpci_led_off()
230 slot->devfn, cpci_led_off()
236 if (pci_bus_write_config_word(slot->bus, cpci_led_off()
237 slot->devfn, cpci_led_off()
240 err("Could not clear LOO for slot %s", cpci_led_off()
241 hotplug_slot_name(slot->hotplug_slot)); cpci_led_off()
253 int cpci_configure_slot(struct slot *slot) cpci_configure_slot() argument
263 if (slot->dev == NULL) { cpci_configure_slot()
265 slot->bus->number, PCI_SLOT(slot->devfn), PCI_FUNC(slot->devfn)); cpci_configure_slot()
266 slot->dev = pci_get_slot(slot->bus, slot->devfn); cpci_configure_slot()
270 if (slot->dev == NULL) { cpci_configure_slot()
278 n = pci_scan_slot(slot->bus, slot->devfn); cpci_configure_slot()
280 slot->dev = pci_get_slot(slot->bus, slot->devfn); cpci_configure_slot()
281 if (slot->dev == NULL) { cpci_configure_slot()
282 err("Could not find PCI device for slot %02x", slot->number); cpci_configure_slot()
287 parent = slot->dev->bus; cpci_configure_slot()
290 if (PCI_SLOT(dev->devfn) != PCI_SLOT(slot->devfn)) cpci_configure_slot()
307 int cpci_unconfigure_slot(struct slot *slot) cpci_unconfigure_slot() argument
312 if (!slot->dev) { cpci_unconfigure_slot()
313 err("No device for slot %02x\n", slot->number); cpci_unconfigure_slot()
319 list_for_each_entry_safe(dev, temp, &slot->bus->devices, bus_list) { cpci_unconfigure_slot()
320 if (PCI_SLOT(dev->devfn) != PCI_SLOT(slot->devfn)) cpci_unconfigure_slot()
326 pci_dev_put(slot->dev); cpci_unconfigure_slot()
327 slot->dev = NULL; cpci_unconfigure_slot()
H A Ds390_pci_hpc.c35 * struct slot - slot information for each *physical* slot
37 struct slot { struct
43 static inline int slot_configure(struct slot *slot) slot_configure() argument
45 int ret = sclp_pci_configure(slot->zdev->fid); slot_configure()
47 zpci_dbg(3, "conf fid:%x, rc:%d\n", slot->zdev->fid, ret); slot_configure()
49 slot->zdev->state = ZPCI_FN_STATE_CONFIGURED; slot_configure()
54 static inline int slot_deconfigure(struct slot *slot) slot_deconfigure() argument
56 int ret = sclp_pci_deconfigure(slot->zdev->fid); slot_deconfigure()
58 zpci_dbg(3, "deconf fid:%x, rc:%d\n", slot->zdev->fid, ret); slot_deconfigure()
60 slot->zdev->state = ZPCI_FN_STATE_STANDBY; slot_deconfigure()
67 struct slot *slot = hotplug_slot->private; enable_slot() local
70 if (slot->zdev->state != ZPCI_FN_STATE_STANDBY) enable_slot()
73 rc = slot_configure(slot); enable_slot()
77 rc = zpci_enable_device(slot->zdev); enable_slot()
81 pci_scan_slot(slot->zdev->bus, ZPCI_DEVFN); enable_slot()
83 pci_bus_add_devices(slot->zdev->bus); enable_slot()
89 slot_deconfigure(slot); enable_slot()
95 struct slot *slot = hotplug_slot->private; disable_slot() local
98 if (!zpci_fn_configured(slot->zdev->state)) disable_slot()
101 if (slot->zdev->pdev) disable_slot()
102 pci_stop_and_remove_bus_device_locked(slot->zdev->pdev); disable_slot()
104 rc = zpci_disable_device(slot->zdev); disable_slot()
108 return slot_deconfigure(slot); disable_slot()
113 struct slot *slot = hotplug_slot->private; get_power_status() local
115 switch (slot->zdev->state) { get_power_status()
128 /* if the slot exits it always contains a function */ get_adapter_status()
135 struct slot *slot = hotplug_slot->private; release_slot() local
137 kfree(slot->hotplug_slot->info); release_slot()
138 kfree(slot->hotplug_slot); release_slot()
139 kfree(slot); release_slot()
154 struct slot *slot; zpci_init_slot() local
160 slot = kzalloc(sizeof(*slot), GFP_KERNEL); zpci_init_slot()
161 if (!slot) zpci_init_slot()
167 hotplug_slot->private = slot; zpci_init_slot()
169 slot->hotplug_slot = hotplug_slot; zpci_init_slot()
170 slot->zdev = zdev; zpci_init_slot()
184 rc = pci_hp_register(slot->hotplug_slot, zdev->bus, zpci_init_slot()
189 list_add(&slot->slot_list, &s390_hotplug_slot_list); zpci_init_slot()
197 kfree(slot); zpci_init_slot()
205 struct slot *slot; zpci_exit_slot() local
208 slot = list_entry(tmp, struct slot, slot_list); zpci_exit_slot()
209 if (slot->zdev != zdev) zpci_exit_slot()
211 list_del(&slot->slot_list); zpci_exit_slot()
212 pci_hp_deregister(slot->hotplug_slot); zpci_exit_slot()
H A Dcpci_hotplug_core.c65 static int enable_slot(struct hotplug_slot *slot);
66 static int disable_slot(struct hotplug_slot *slot);
67 static int set_attention_status(struct hotplug_slot *slot, u8 value);
68 static int get_power_status(struct hotplug_slot *slot, u8 *value);
69 static int get_attention_status(struct hotplug_slot *slot, u8 *value);
70 static int get_adapter_status(struct hotplug_slot *slot, u8 *value);
71 static int get_latch_status(struct hotplug_slot *slot, u8 *value);
106 struct slot *slot = hotplug_slot->private; enable_slot() local
109 dbg("%s - physical_slot = %s", __func__, slot_name(slot)); enable_slot()
112 retval = controller->ops->set_power(slot, 1); enable_slot()
119 struct slot *slot = hotplug_slot->private; disable_slot() local
122 dbg("%s - physical_slot = %s", __func__, slot_name(slot)); disable_slot()
127 dbg("%s - unconfiguring slot %s", __func__, slot_name(slot)); disable_slot()
128 retval = cpci_unconfigure_slot(slot); disable_slot()
130 err("%s - could not unconfigure slot %s", disable_slot()
131 __func__, slot_name(slot)); disable_slot()
134 dbg("%s - finished unconfiguring slot %s", __func__, slot_name(slot)); disable_slot()
137 if (cpci_clear_ext(slot)) { disable_slot()
138 err("%s - could not clear EXT for slot %s", disable_slot()
139 __func__, slot_name(slot)); disable_slot()
143 cpci_led_on(slot); disable_slot()
146 retval = controller->ops->set_power(slot, 0); disable_slot()
151 if (update_adapter_status(slot->hotplug_slot, 0)) disable_slot()
154 if (slot->extracting) { disable_slot()
155 slot->extracting = 0; disable_slot()
164 cpci_get_power_status(struct slot *slot) cpci_get_power_status() argument
169 power = controller->ops->get_power(slot); cpci_get_power_status()
176 struct slot *slot = hotplug_slot->private; get_power_status() local
178 *value = cpci_get_power_status(slot); get_power_status()
185 struct slot *slot = hotplug_slot->private; get_attention_status() local
187 *value = cpci_get_attention_status(slot); get_attention_status()
213 struct slot *slot = hotplug_slot->private; release_slot() local
215 kfree(slot->hotplug_slot->info); release_slot()
216 kfree(slot->hotplug_slot); release_slot()
217 pci_dev_put(slot->dev); release_slot()
218 kfree(slot); release_slot()
226 struct slot *slot; cpci_hp_register_bus() local
237 * Create a structure for each slot, and register that slot cpci_hp_register_bus()
241 slot = kzalloc(sizeof (struct slot), GFP_KERNEL); cpci_hp_register_bus()
242 if (!slot) { cpci_hp_register_bus()
253 slot->hotplug_slot = hotplug_slot; cpci_hp_register_bus()
262 slot->bus = bus; cpci_hp_register_bus()
263 slot->number = i; cpci_hp_register_bus()
264 slot->devfn = PCI_DEVFN(i, 0); cpci_hp_register_bus()
268 hotplug_slot->private = slot; cpci_hp_register_bus()
273 * Initialize the slot info structure with some known cpci_hp_register_bus()
276 dbg("initializing slot %s", name); cpci_hp_register_bus()
277 info->power_status = cpci_get_power_status(slot); cpci_hp_register_bus()
278 info->attention_status = cpci_get_attention_status(slot); cpci_hp_register_bus()
280 dbg("registering slot %s", name); cpci_hp_register_bus()
281 status = pci_hp_register(slot->hotplug_slot, bus, i, name); cpci_hp_register_bus()
286 dbg("slot registered with name: %s", slot_name(slot)); cpci_hp_register_bus()
288 /* Add slot to our internal list */ cpci_hp_register_bus()
290 list_add(&slot->slot_list, &slot_list); cpci_hp_register_bus()
300 kfree(slot); cpci_hp_register_bus()
309 struct slot *slot; cpci_hp_unregister_bus() local
310 struct slot *tmp; cpci_hp_unregister_bus()
318 list_for_each_entry_safe(slot, tmp, &slot_list, slot_list) { cpci_hp_unregister_bus()
319 if (slot->bus == bus) { cpci_hp_unregister_bus()
320 list_del(&slot->slot_list); cpci_hp_unregister_bus()
323 dbg("deregistering slot %s", slot_name(slot)); cpci_hp_unregister_bus()
324 status = pci_hp_deregister(slot->hotplug_slot); cpci_hp_unregister_bus()
366 struct slot *slot; init_slots() local
375 list_for_each_entry(slot, &slot_list, slot_list) { init_slots()
376 dbg("%s - looking at slot %s", __func__, slot_name(slot)); init_slots()
377 if (clear_ins && cpci_check_and_clear_ins(slot)) init_slots()
378 dbg("%s - cleared INS for slot %s", init_slots()
379 __func__, slot_name(slot)); init_slots()
380 dev = pci_get_slot(slot->bus, PCI_DEVFN(slot->number, 0)); init_slots()
382 if (update_adapter_status(slot->hotplug_slot, 1)) init_slots()
384 if (update_latch_status(slot->hotplug_slot, 1)) init_slots()
386 slot->dev = dev; init_slots()
397 struct slot *slot; check_slots() local
409 list_for_each_entry(slot, &slot_list, slot_list) { check_slots()
410 dbg("%s - looking at slot %s", __func__, slot_name(slot)); check_slots()
411 if (cpci_check_and_clear_ins(slot)) { check_slots()
416 if (slot->dev) { check_slots()
417 warn("slot %s already inserted", check_slots()
418 slot_name(slot)); check_slots()
424 dbg("%s - slot %s inserted", __func__, slot_name(slot)); check_slots()
427 hs_csr = cpci_get_hs_csr(slot); check_slots()
428 dbg("%s - slot %s HS_CSR (1) = %04x", check_slots()
429 __func__, slot_name(slot), hs_csr); check_slots()
432 dbg("%s - configuring slot %s", check_slots()
433 __func__, slot_name(slot)); check_slots()
434 if (cpci_configure_slot(slot)) { check_slots()
435 err("%s - could not configure slot %s", check_slots()
436 __func__, slot_name(slot)); check_slots()
439 dbg("%s - finished configuring slot %s", check_slots()
440 __func__, slot_name(slot)); check_slots()
443 hs_csr = cpci_get_hs_csr(slot); check_slots()
444 dbg("%s - slot %s HS_CSR (2) = %04x", check_slots()
445 __func__, slot_name(slot), hs_csr); check_slots()
447 if (update_latch_status(slot->hotplug_slot, 1)) check_slots()
450 if (update_adapter_status(slot->hotplug_slot, 1)) check_slots()
453 cpci_led_off(slot); check_slots()
456 hs_csr = cpci_get_hs_csr(slot); check_slots()
457 dbg("%s - slot %s HS_CSR (3) = %04x", check_slots()
458 __func__, slot_name(slot), hs_csr); check_slots()
461 } else if (cpci_check_ext(slot)) { check_slots()
463 dbg("%s - slot %s extracted", check_slots()
464 __func__, slot_name(slot)); check_slots()
467 hs_csr = cpci_get_hs_csr(slot); check_slots()
468 dbg("%s - slot %s HS_CSR = %04x", check_slots()
469 __func__, slot_name(slot), hs_csr); check_slots()
471 if (!slot->extracting) { check_slots()
472 if (update_latch_status(slot->hotplug_slot, 0)) check_slots()
475 slot->extracting = 1; check_slots()
479 } else if (slot->extracting) { check_slots()
480 hs_csr = cpci_get_hs_csr(slot); check_slots()
486 err("card in slot %s was improperly removed", check_slots()
487 slot_name(slot)); check_slots()
488 if (update_adapter_status(slot->hotplug_slot, 0)) check_slots()
490 slot->extracting = 0; check_slots()
626 struct slot *slot; cleanup_slots() local
627 struct slot *tmp; cleanup_slots()
636 list_for_each_entry_safe(slot, tmp, &slot_list, slot_list) { cleanup_slots()
637 list_del(&slot->slot_list); cleanup_slots()
638 pci_hp_deregister(slot->hotplug_slot); cleanup_slots()
H A Dcpci_hotplug.h44 struct slot { struct
59 int (*hardware_test) (struct slot *slot, u32 value);
60 u8 (*get_power) (struct slot *slot);
61 int (*set_power) (struct slot *slot, int value);
73 static inline const char *slot_name(struct slot *slot) slot_name() argument
75 return hotplug_slot_name(slot->hotplug_slot); slot_name()
89 u8 cpci_get_attention_status(struct slot *slot);
90 u8 cpci_get_latch_status(struct slot *slot);
91 u8 cpci_get_adapter_status(struct slot *slot);
92 u16 cpci_get_hs_csr(struct slot *slot);
93 int cpci_set_attention_status(struct slot *slot, int status);
94 int cpci_check_and_clear_ins(struct slot *slot);
95 int cpci_check_ext(struct slot *slot);
96 int cpci_clear_ext(struct slot *slot);
97 int cpci_led_on(struct slot *slot);
98 int cpci_led_off(struct slot *slot);
99 int cpci_configure_slot(struct slot *slot);
100 int cpci_unconfigure_slot(struct slot *slot);
H A Dshpchp_core.c60 static int set_attention_status (struct hotplug_slot *slot, u8 value);
61 static int enable_slot (struct hotplug_slot *slot);
62 static int disable_slot (struct hotplug_slot *slot);
63 static int get_power_status (struct hotplug_slot *slot, u8 *value);
64 static int get_attention_status (struct hotplug_slot *slot, u8 *value);
65 static int get_latch_status (struct hotplug_slot *slot, u8 *value);
66 static int get_adapter_status (struct hotplug_slot *slot, u8 *value);
79 * release_slot - free up the memory used by a slot
80 * @hotplug_slot: slot to free
84 struct slot *slot = hotplug_slot->private; release_slot() local
86 ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n", release_slot()
87 __func__, slot_name(slot)); release_slot()
89 kfree(slot->hotplug_slot->info); release_slot()
90 kfree(slot->hotplug_slot); release_slot()
91 kfree(slot); release_slot()
96 struct slot *slot; init_slots() local
104 slot = kzalloc(sizeof(*slot), GFP_KERNEL); init_slots()
105 if (!slot) { init_slots()
115 slot->hotplug_slot = hotplug_slot; init_slots()
124 slot->hp_slot = i; init_slots()
125 slot->ctrl = ctrl; init_slots()
126 slot->bus = ctrl->pci_dev->subordinate->number; init_slots()
127 slot->device = ctrl->slot_device_offset + i; init_slots()
128 slot->hpc_ops = ctrl->hpc_ops; init_slots()
129 slot->number = ctrl->first_slot + (ctrl->slot_num_inc * i); init_slots()
131 slot->wq = alloc_workqueue("shpchp-%d", 0, 0, slot->number); init_slots()
132 if (!slot->wq) { init_slots()
137 mutex_init(&slot->lock); init_slots()
138 INIT_DELAYED_WORK(&slot->work, shpchp_queue_pushbutton_work); init_slots()
140 /* register this slot with the hotplug pci core */ init_slots()
141 hotplug_slot->private = slot; init_slots()
143 snprintf(name, SLOT_NAME_SIZE, "%d", slot->number); init_slots()
148 slot->bus, slot->device, slot->hp_slot, slot->number, init_slots()
150 retval = pci_hp_register(slot->hotplug_slot, init_slots()
151 ctrl->pci_dev->subordinate, slot->device, name); init_slots()
163 list_add(&slot->slot_list, &ctrl->slot_list); init_slots()
168 destroy_workqueue(slot->wq); init_slots()
174 kfree(slot); init_slots()
183 struct slot *slot; cleanup_slots() local
186 slot = list_entry(tmp, struct slot, slot_list); cleanup_slots()
187 list_del(&slot->slot_list); cleanup_slots()
188 cancel_delayed_work(&slot->work); cleanup_slots()
189 destroy_workqueue(slot->wq); cleanup_slots()
190 pci_hp_deregister(slot->hotplug_slot); cleanup_slots()
195 * set_attention_status - Turns the Amber LED for a slot on, off or blink
199 struct slot *slot = get_slot(hotplug_slot); set_attention_status() local
201 ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n", set_attention_status()
202 __func__, slot_name(slot)); set_attention_status()
205 slot->hpc_ops->set_attention_status(slot, status); set_attention_status()
212 struct slot *slot = get_slot(hotplug_slot); enable_slot() local
214 ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n", enable_slot()
215 __func__, slot_name(slot)); enable_slot()
217 return shpchp_sysfs_enable_slot(slot); enable_slot()
222 struct slot *slot = get_slot(hotplug_slot); disable_slot() local
224 ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n", disable_slot()
225 __func__, slot_name(slot)); disable_slot()
227 return shpchp_sysfs_disable_slot(slot); disable_slot()
232 struct slot *slot = get_slot(hotplug_slot); get_power_status() local
235 ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n", get_power_status()
236 __func__, slot_name(slot)); get_power_status()
238 retval = slot->hpc_ops->get_power_status(slot, value); get_power_status()
247 struct slot *slot = get_slot(hotplug_slot); get_attention_status() local
250 ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n", get_attention_status()
251 __func__, slot_name(slot)); get_attention_status()
253 retval = slot->hpc_ops->get_attention_status(slot, value); get_attention_status()
262 struct slot *slot = get_slot(hotplug_slot); get_latch_status() local
265 ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n", get_latch_status()
266 __func__, slot_name(slot)); get_latch_status()
268 retval = slot->hpc_ops->get_latch_status(slot, value); get_latch_status()
277 struct slot *slot = get_slot(hotplug_slot); get_adapter_status() local
280 ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n", get_adapter_status()
281 __func__, slot_name(slot)); get_adapter_status()
283 retval = slot->hpc_ops->get_adapter_status(slot, value); get_adapter_status()
325 /* Setup the slot information structures */ shpc_probe()
H A Dpcihp_skeleton.c40 struct slot { struct
75 static int enable_slot (struct hotplug_slot *slot);
76 static int disable_slot (struct hotplug_slot *slot);
77 static int set_attention_status (struct hotplug_slot *slot, u8 value);
78 static int hardware_test (struct hotplug_slot *slot, u32 value);
79 static int get_power_status (struct hotplug_slot *slot, u8 *value);
80 static int get_attention_status (struct hotplug_slot *slot, u8 *value);
81 static int get_latch_status (struct hotplug_slot *slot, u8 *value);
82 static int get_adapter_status (struct hotplug_slot *slot, u8 *value);
97 struct slot *slot = hotplug_slot->private; enable_slot() local
103 * Fill in code here to enable the specified slot enable_slot()
111 struct slot *slot = hotplug_slot->private; disable_slot() local
117 * Fill in code here to disable the specified slot disable_slot()
125 struct slot *slot = hotplug_slot->private; set_attention_status() local
150 struct slot *slot = hotplug_slot->private; hardware_test() local
169 struct slot *slot = hotplug_slot->private; get_power_status() local
176 * slot and store it in the *value location. get_power_status()
184 struct slot *slot = hotplug_slot->private; get_attention_status() local
191 * slot and store it in the *value location. get_attention_status()
199 struct slot *slot = hotplug_slot->private; get_latch_status() local
206 * slot and store it in the *value location. get_latch_status()
214 struct slot *slot = hotplug_slot->private; get_adapter_status() local
221 * slot and store it in the *value location. get_adapter_status()
229 struct slot *slot = hotplug_slot->private; release_slot() local
232 kfree(slot->hotplug_slot->info); release_slot()
233 kfree(slot->hotplug_slot); release_slot()
234 kfree(slot); release_slot()
237 static void make_slot_name(struct slot *slot) make_slot_name() argument
240 * Stupid way to make a filename out of the slot name. make_slot_name()
243 snprintf(slot->hotplug_slot->name, SLOT_NAME_SIZE, "%d", slot->number); make_slot_name()
247 * init_slots - initialize 'struct slot' structures for each slot
252 struct slot *slot; init_slots() local
259 * Create a structure for each slot, and register that slot init_slots()
263 slot = kzalloc(sizeof(*slot), GFP_KERNEL); init_slots()
264 if (!slot) { init_slots()
274 slot->hotplug_slot = hotplug_slot; init_slots()
283 slot->number = i; init_slots()
285 hotplug_slot->name = slot->name; init_slots()
286 hotplug_slot->private = slot; init_slots()
288 make_slot_name(slot); init_slots()
292 * Initialize the slot info structure with some known init_slots()
300 dbg("registering slot %d\n", i); init_slots()
301 retval = pci_hp_register(slot->hotplug_slot); init_slots()
307 /* add slot to our internal list */ init_slots()
308 list_add(&slot->slot_list, &slot_list); init_slots()
317 kfree(slot); init_slots()
326 struct slot *slot; cleanup_slots() local
330 * Memory will be freed in release_slot() callback after slot's cleanup_slots()
334 slot = list_entry(tmp, struct slot, slot_list); cleanup_slots()
335 list_del(&slot->slot_list); cleanup_slots()
336 pci_hp_deregister(slot->hotplug_slot); cleanup_slots()
H A Dpciehp_core.c65 static int set_attention_status (struct hotplug_slot *slot, u8 value);
66 static int enable_slot (struct hotplug_slot *slot);
67 static int disable_slot (struct hotplug_slot *slot);
68 static int get_power_status (struct hotplug_slot *slot, u8 *value);
69 static int get_attention_status (struct hotplug_slot *slot, u8 *value);
70 static int get_latch_status (struct hotplug_slot *slot, u8 *value);
71 static int get_adapter_status (struct hotplug_slot *slot, u8 *value);
72 static int reset_slot (struct hotplug_slot *slot, int probe);
75 * release_slot - free up the memory used by a slot
76 * @hotplug_slot: slot to free
87 struct slot *slot = ctrl->slot; init_slot() local
102 /* Setup hotplug slot ops */ init_slot()
119 /* register this slot with the hotplug pci core */ init_slot()
121 hotplug->private = slot; init_slot()
124 slot->hotplug_slot = hotplug; init_slot()
142 pci_hp_deregister(ctrl->slot->hotplug_slot); cleanup_slot()
146 * set_attention_status - Turns the Amber LED for a slot on, off or blink
150 struct slot *slot = hotplug_slot->private; set_attention_status() local
152 pciehp_set_attention_status(slot, status); set_attention_status()
159 struct slot *slot = hotplug_slot->private; enable_slot() local
161 return pciehp_sysfs_enable_slot(slot); enable_slot()
167 struct slot *slot = hotplug_slot->private; disable_slot() local
169 return pciehp_sysfs_disable_slot(slot); disable_slot()
174 struct slot *slot = hotplug_slot->private; get_power_status() local
176 pciehp_get_power_status(slot, value); get_power_status()
182 struct slot *slot = hotplug_slot->private; get_attention_status() local
184 pciehp_get_attention_status(slot, value); get_attention_status()
190 struct slot *slot = hotplug_slot->private; get_latch_status() local
192 pciehp_get_latch_status(slot, value); get_latch_status()
198 struct slot *slot = hotplug_slot->private; get_adapter_status() local
200 pciehp_get_adapter_status(slot, value); get_adapter_status()
206 struct slot *slot = hotplug_slot->private; reset_slot() local
208 return pciehp_reset_slot(slot, probe); reset_slot()
215 struct slot *slot; pciehp_probe() local
236 /* Setup the slot information structures */ pciehp_probe()
253 /* Check if slot is occupied */ pciehp_probe()
254 slot = ctrl->slot; pciehp_probe()
255 pciehp_get_adapter_status(slot, &occupied); pciehp_probe()
256 pciehp_get_power_status(slot, &poweron); pciehp_probe()
258 mutex_lock(&slot->hotplug_lock); pciehp_probe()
259 pciehp_enable_slot(slot); pciehp_probe()
260 mutex_unlock(&slot->hotplug_lock); pciehp_probe()
262 /* If empty slot's power status is on, turn power off */ pciehp_probe()
264 pciehp_power_off_slot(slot); pciehp_probe()
292 struct slot *slot; pciehp_resume() local
300 slot = ctrl->slot; pciehp_resume()
302 /* Check if slot is occupied */ pciehp_resume()
303 pciehp_get_adapter_status(slot, &status); pciehp_resume()
304 mutex_lock(&slot->hotplug_lock); pciehp_resume()
306 pciehp_enable_slot(slot); pciehp_resume()
308 pciehp_disable_slot(slot); pciehp_resume()
309 mutex_unlock(&slot->hotplug_lock); pciehp_resume()
H A Dacpiphp_core.c66 static int enable_slot (struct hotplug_slot *slot);
67 static int disable_slot (struct hotplug_slot *slot);
68 static int set_attention_status (struct hotplug_slot *slot, u8 value);
69 static int get_power_status (struct hotplug_slot *slot, u8 *value);
70 static int get_attention_status (struct hotplug_slot *slot, u8 *value);
71 static int get_latch_status (struct hotplug_slot *slot, u8 *value);
72 static int get_adapter_status (struct hotplug_slot *slot, u8 *value);
128 * enable_slot - power on and enable a slot
129 * @hotplug_slot: slot to enable
135 struct slot *slot = hotplug_slot->private; enable_slot() local
137 pr_debug("%s - physical_slot = %s\n", __func__, slot_name(slot)); enable_slot()
139 /* enable the specified slot */ enable_slot()
140 return acpiphp_enable_slot(slot->acpi_slot); enable_slot()
145 * disable_slot - disable and power off a slot
146 * @hotplug_slot: slot to disable
152 struct slot *slot = hotplug_slot->private; disable_slot() local
154 pr_debug("%s - physical_slot = %s\n", __func__, slot_name(slot)); disable_slot()
156 /* disable the specified slot */ disable_slot()
157 return acpiphp_disable_slot(slot->acpi_slot); disable_slot()
163 * @hotplug_slot: slot to set attention LED on
187 * get_power_status - get power status of a slot
188 * @hotplug_slot: slot to get status
196 struct slot *slot = hotplug_slot->private; get_power_status() local
198 pr_debug("%s - physical_slot = %s\n", __func__, slot_name(slot)); get_power_status()
200 *value = acpiphp_get_power_status(slot->acpi_slot); get_power_status()
208 * @hotplug_slot: slot to get status from
233 * get_latch_status - get latch status of a slot
234 * @hotplug_slot: slot to get status
242 struct slot *slot = hotplug_slot->private; get_latch_status() local
244 pr_debug("%s - physical_slot = %s\n", __func__, slot_name(slot)); get_latch_status()
246 *value = acpiphp_get_latch_status(slot->acpi_slot); get_latch_status()
253 * get_adapter_status - get adapter status of a slot
254 * @hotplug_slot: slot to get status
262 struct slot *slot = hotplug_slot->private; get_adapter_status() local
264 pr_debug("%s - physical_slot = %s\n", __func__, slot_name(slot)); get_adapter_status()
266 *value = acpiphp_get_adapter_status(slot->acpi_slot); get_adapter_status()
272 * release_slot - free up the memory used by a slot
273 * @hotplug_slot: slot to free
277 struct slot *slot = hotplug_slot->private; release_slot() local
279 pr_debug("%s - physical_slot = %s\n", __func__, slot_name(slot)); release_slot()
281 kfree(slot->hotplug_slot); release_slot()
282 kfree(slot); release_slot()
285 /* callback routine to initialize 'struct slot' for each slot */ acpiphp_register_hotplug_slot()
289 struct slot *slot; acpiphp_register_hotplug_slot() local
293 slot = kzalloc(sizeof(*slot), GFP_KERNEL); acpiphp_register_hotplug_slot()
294 if (!slot) acpiphp_register_hotplug_slot()
297 slot->hotplug_slot = kzalloc(sizeof(*slot->hotplug_slot), GFP_KERNEL); acpiphp_register_hotplug_slot()
298 if (!slot->hotplug_slot) acpiphp_register_hotplug_slot()
301 slot->hotplug_slot->info = &slot->info; acpiphp_register_hotplug_slot()
303 slot->hotplug_slot->private = slot; acpiphp_register_hotplug_slot()
304 slot->hotplug_slot->release = &release_slot; acpiphp_register_hotplug_slot()
305 slot->hotplug_slot->ops = &acpi_hotplug_slot_ops; acpiphp_register_hotplug_slot()
307 slot->acpi_slot = acpiphp_slot; acpiphp_register_hotplug_slot()
308 slot->hotplug_slot->info->power_status = acpiphp_get_power_status(slot->acpi_slot); acpiphp_register_hotplug_slot()
309 slot->hotplug_slot->info->attention_status = 0; acpiphp_register_hotplug_slot()
310 slot->hotplug_slot->info->latch_status = acpiphp_get_latch_status(slot->acpi_slot); acpiphp_register_hotplug_slot()
311 slot->hotplug_slot->info->adapter_status = acpiphp_get_adapter_status(slot->acpi_slot); acpiphp_register_hotplug_slot()
313 acpiphp_slot->slot = slot; acpiphp_register_hotplug_slot()
314 slot->sun = sun; acpiphp_register_hotplug_slot()
317 retval = pci_hp_register(slot->hotplug_slot, acpiphp_slot->bus, acpiphp_register_hotplug_slot()
326 pr_info("Slot [%s] registered\n", slot_name(slot)); acpiphp_register_hotplug_slot()
330 kfree(slot->hotplug_slot); acpiphp_register_hotplug_slot()
332 kfree(slot); acpiphp_register_hotplug_slot()
340 struct slot *slot = acpiphp_slot->slot; acpiphp_unregister_hotplug_slot() local
343 pr_info("Slot [%s] unregistered\n", slot_name(slot)); acpiphp_unregister_hotplug_slot()
345 retval = pci_hp_deregister(slot->hotplug_slot); acpiphp_unregister_hotplug_slot()
H A Dpciehp.h73 struct slot { struct
85 struct slot *p_slot;
92 struct slot *slot; member in struct:controller
127 int pciehp_sysfs_enable_slot(struct slot *slot);
128 int pciehp_sysfs_disable_slot(struct slot *slot);
129 void pciehp_queue_interrupt_event(struct slot *slot, u32 event_type);
130 int pciehp_configure_device(struct slot *p_slot);
131 int pciehp_unconfigure_device(struct slot *p_slot);
135 int pciehp_enable_slot(struct slot *p_slot);
136 int pciehp_disable_slot(struct slot *p_slot);
138 int pciehp_power_on_slot(struct slot *slot);
139 void pciehp_power_off_slot(struct slot *slot);
140 void pciehp_get_power_status(struct slot *slot, u8 *status);
141 void pciehp_get_attention_status(struct slot *slot, u8 *status);
143 void pciehp_set_attention_status(struct slot *slot, u8 status);
144 void pciehp_get_latch_status(struct slot *slot, u8 *status);
145 void pciehp_get_adapter_status(struct slot *slot, u8 *status);
146 int pciehp_query_power_fault(struct slot *slot);
147 void pciehp_green_led_on(struct slot *slot);
148 void pciehp_green_led_off(struct slot *slot);
149 void pciehp_green_led_blink(struct slot *slot);
153 int pciehp_reset_slot(struct slot *slot, int probe);
155 static inline const char *slot_name(struct slot *slot) slot_name() argument
157 return hotplug_slot_name(slot->hotplug_slot); slot_name()
H A Drpaphp_pci.c35 int rpaphp_get_sensor_state(struct slot *slot, int *state) rpaphp_get_sensor_state() argument
40 rc = rtas_get_sensor(DR_ENTITY_SENSE, slot->index, state); rpaphp_get_sensor_state()
44 dbg("%s: slot must be power up to get sensor-state\n", rpaphp_get_sensor_state()
50 rc = rtas_set_power_level(slot->power_domain, POWER_ON, rpaphp_get_sensor_state()
53 dbg("%s: power on slot[%s] failed rc=%d.\n", rpaphp_get_sensor_state()
54 __func__, slot->name, rc); rpaphp_get_sensor_state()
57 slot->index, state); rpaphp_get_sensor_state()
60 info("%s: slot is unusable\n", __func__); rpaphp_get_sensor_state()
68 * rpaphp_enable_slot - record slot state, config pci device
69 * @slot: target &slot
71 * Initialize values in the slot, and the hotplug_slot info
73 * the slot. If the slot is not empty, run the pcibios routine
76 int rpaphp_enable_slot(struct slot *slot) rpaphp_enable_slot() argument
80 struct hotplug_slot_info *info = slot->hotplug_slot->info; rpaphp_enable_slot()
83 slot->state = EMPTY; rpaphp_enable_slot()
85 /* Find out if the power is turned on for the slot */ rpaphp_enable_slot()
86 rc = rtas_get_power_level(slot->power_domain, &level); rpaphp_enable_slot()
91 /* Figure out if there is an adapter in the slot */ rpaphp_enable_slot()
92 rc = rpaphp_get_sensor_state(slot, &state); rpaphp_enable_slot()
96 bus = pcibios_find_pci_bus(slot->dn); rpaphp_enable_slot()
98 err("%s: no pci_bus for dn %s\n", __func__, slot->dn->full_name); rpaphp_enable_slot()
103 slot->bus = bus; rpaphp_enable_slot()
104 slot->pci_devs = &bus->devices; rpaphp_enable_slot()
106 /* if there's an adapter in the slot, go add the pci devices */ rpaphp_enable_slot()
109 slot->state = NOT_CONFIGURED; rpaphp_enable_slot()
111 /* non-empty slot has to have child */ rpaphp_enable_slot()
112 if (!slot->dn->child) { rpaphp_enable_slot()
113 err("%s: slot[%s]'s device_node doesn't have child for adapter\n", rpaphp_enable_slot()
114 __func__, slot->name); rpaphp_enable_slot()
123 slot->state = CONFIGURED; rpaphp_enable_slot()
128 dbg("%s: pci_devs of slot[%s]\n", __func__, slot->dn->full_name); rpaphp_enable_slot()
H A Drpaphp_core.c68 struct slot *slot = (struct slot *)hotplug_slot->private; set_attention_status() local
80 rc = rtas_set_indicator(DR_INDICATOR, slot->index, value); set_attention_status()
88 * get_power_status - get power status of a slot
89 * @hotplug_slot: slot to get status
95 struct slot *slot = (struct slot *)hotplug_slot->private; get_power_status() local
97 retval = rtas_get_power_level (slot->power_domain, &level); get_power_status()
105 * @hotplug_slot: slot to get status
110 struct slot *slot = (struct slot *)hotplug_slot->private; get_attention_status() local
111 *value = slot->hotplug_slot->info->attention_status; get_attention_status()
117 struct slot *slot = (struct slot *)hotplug_slot->private; get_adapter_status() local
120 rc = rpaphp_get_sensor_state(slot, &state); get_adapter_status()
129 *value = slot->state; get_adapter_status()
134 static enum pci_bus_speed get_max_bus_speed(struct slot *slot) get_max_bus_speed() argument
137 switch (slot->type) { get_max_bus_speed()
188 /* &drc_names[1] contains NULL terminated slot names */ get_children_props()
191 /* &drc_types[1] contains NULL terminated slot types */ get_children_props()
261 * is_php_dn() - return 1 if this is a hotpluggable pci slot, else 0
269 * a hotpluggable slot. This routine will return false
291 * rpaphp_add_slot -- declare a hotplug slot to the hotplug subsystem.
292 * @dn: device node of slot
294 * This subroutine will register a hotpluggable slot with the
297 * or is called later, by the dlpar add code, if the slot is
300 * If the device node points at an embedded (built-in) slot, this
304 * To remove a slot, it suffices to call rpaphp_deregister_slot().
308 struct slot *slot; rpaphp_add_slot() local
317 /* If this is not a hotplug slot, return without doing anything. */ rpaphp_add_slot()
330 slot = alloc_slot_struct(dn, index, name, rpaphp_add_slot()
332 if (!slot) rpaphp_add_slot()
335 slot->type = simple_strtoul(type, NULL, 10); rpaphp_add_slot()
340 retval = rpaphp_enable_slot(slot); rpaphp_add_slot()
342 retval = rpaphp_register_slot(slot); rpaphp_add_slot()
345 dealloc_slot_struct(slot); rpaphp_add_slot()
360 struct slot *slot; cleanup_slots() local
369 slot = list_entry(tmp, struct slot, rpaphp_slot_list); cleanup_slots()
370 list_del(&slot->rpaphp_slot_list); cleanup_slots()
371 pci_hp_deregister(slot->hotplug_slot); cleanup_slots()
395 struct slot *slot = (struct slot *)hotplug_slot->private; enable_slot() local
399 if (slot->state == CONFIGURED) enable_slot()
402 retval = rpaphp_get_sensor_state(slot, &state); enable_slot()
408 pcibios_add_pci_devices(slot->bus); enable_slot()
410 slot->state = CONFIGURED; enable_slot()
412 slot->state = EMPTY; enable_slot()
414 err("%s: slot[%s] is in invalid state\n", __func__, slot->name); enable_slot()
415 slot->state = NOT_VALID; enable_slot()
419 slot->bus->max_bus_speed = get_max_bus_speed(slot); enable_slot()
425 struct slot *slot = (struct slot *)hotplug_slot->private; disable_slot() local
426 if (slot->state == NOT_CONFIGURED) disable_slot()
430 pcibios_remove_pci_devices(slot->bus); disable_slot()
434 slot->state = NOT_CONFIGURED; disable_slot()
H A Dpci_hotplug_core.c67 static int get_##name(struct hotplug_slot *slot, type *value) \
69 struct hotplug_slot_ops *ops = slot->ops; \
74 retval = ops->get_##name(slot, value); \
76 *value = slot->info->name; \
101 struct hotplug_slot *slot = pci_slot->hotplug; power_write_file() local
110 if (!try_module_get(slot->ops->owner)) { power_write_file()
116 if (slot->ops->disable_slot) power_write_file()
117 retval = slot->ops->disable_slot(slot); power_write_file()
121 if (slot->ops->enable_slot) power_write_file()
122 retval = slot->ops->enable_slot(slot); power_write_file()
129 module_put(slot->ops->owner); power_write_file()
224 struct hotplug_slot *slot = pci_slot->hotplug; test_write_file() local
233 if (!try_module_get(slot->ops->owner)) { test_write_file()
237 if (slot->ops->hardware_test) test_write_file()
238 retval = slot->ops->hardware_test(slot, test); test_write_file()
239 module_put(slot->ops->owner); test_write_file()
254 struct hotplug_slot *slot = pci_slot->hotplug; has_power_file() local
256 if ((!slot) || (!slot->ops)) has_power_file()
258 if ((slot->ops->enable_slot) || has_power_file()
259 (slot->ops->disable_slot) || has_power_file()
260 (slot->ops->get_power_status)) has_power_file()
267 struct hotplug_slot *slot = pci_slot->hotplug; has_attention_file() local
269 if ((!slot) || (!slot->ops)) has_attention_file()
271 if ((slot->ops->set_attention_status) || has_attention_file()
272 (slot->ops->get_attention_status)) has_attention_file()
279 struct hotplug_slot *slot = pci_slot->hotplug; has_latch_file() local
281 if ((!slot) || (!slot->ops)) has_latch_file()
283 if (slot->ops->get_latch_status) has_latch_file()
290 struct hotplug_slot *slot = pci_slot->hotplug; has_adapter_file() local
292 if ((!slot) || (!slot->ops)) has_adapter_file()
294 if (slot->ops->get_adapter_status) has_adapter_file()
301 struct hotplug_slot *slot = pci_slot->hotplug; has_test_file() local
303 if ((!slot) || (!slot->ops)) has_test_file()
305 if (slot->ops->hardware_test) has_test_file()
398 struct hotplug_slot *slot; get_slot_from_name() local
402 slot = list_entry(tmp, struct hotplug_slot, slot_list); get_slot_from_name()
403 if (strcmp(hotplug_slot_name(slot), name) == 0) get_slot_from_name()
404 return slot; get_slot_from_name()
411 * @bus: bus this slot is on
412 * @slot: pointer to the &struct hotplug_slot to register
418 * Registers a hotplug slot with the pci hotplug subsystem, which will allow
419 * userspace interaction to the slot.
423 int __pci_hp_register(struct hotplug_slot *slot, struct pci_bus *bus, __pci_hp_register() argument
430 if (slot == NULL) __pci_hp_register()
432 if ((slot->info == NULL) || (slot->ops == NULL)) __pci_hp_register()
434 if (slot->release == NULL) { __pci_hp_register()
435 dbg("Why are you trying to register a hotplug slot without a proper release function?\n"); __pci_hp_register()
439 slot->ops->owner = owner; __pci_hp_register()
440 slot->ops->mod_name = mod_name; __pci_hp_register()
448 pci_slot = pci_create_slot(bus, devnr, name, slot); __pci_hp_register()
454 slot->pci_slot = pci_slot; __pci_hp_register()
455 pci_slot->hotplug = slot; __pci_hp_register()
457 list_add(&slot->slot_list, &pci_hotplug_slot_list); __pci_hp_register()
461 dbg("Added slot %s to the list\n", name); __pci_hp_register()
470 * @slot: pointer to the &struct hotplug_slot to deregister
472 * The @slot must have been registered with the pci hotplug subsystem
477 int pci_hp_deregister(struct hotplug_slot *slot) pci_hp_deregister() argument
482 if (!slot) pci_hp_deregister()
486 temp = get_slot_from_name(hotplug_slot_name(slot)); pci_hp_deregister()
487 if (temp != slot) { pci_hp_deregister()
492 list_del(&slot->slot_list); pci_hp_deregister()
494 pci_slot = slot->pci_slot; pci_hp_deregister()
496 dbg("Removed slot %s from the list\n", hotplug_slot_name(slot)); pci_hp_deregister()
498 slot->release(slot); pci_hp_deregister()
508 * pci_hp_change_slot_info - changes the slot's information structure in the core
509 * @slot: pointer to the slot whose info has changed
510 * @info: pointer to the info copy into the slot's info structure
512 * @slot must have been registered with the pci
517 int pci_hp_change_slot_info(struct hotplug_slot *slot, pci_hp_change_slot_info() argument
520 if (!slot || !info) pci_hp_change_slot_info()
523 memcpy(slot->info, info, sizeof(struct hotplug_slot_info)); pci_hp_change_slot_info()
H A Dacpiphp.h47 * struct slot - slot information for each *physical* slot
49 struct slot { struct
56 static inline const char *slot_name(struct slot *slot) slot_name() argument
58 return hotplug_slot_name(slot->hotplug_slot); slot_name()
86 * struct acpiphp_slot - PCI slot information
88 * PCI slot information for each *physical* PCI slot
93 struct list_head funcs; /* one slot may have different
95 struct slot *slot; member in struct:acpiphp_slot
106 * typically 8 objects per slot (i.e. for each PCI function)
110 struct acpiphp_slot *slot; member in struct:acpiphp_func
163 int (*set_attn)(struct hotplug_slot *slot, u8 status);
164 int (*get_attn)(struct hotplug_slot *slot, u8 *status);
171 /* slot flags */
186 int acpiphp_register_hotplug_slot(struct acpiphp_slot *slot, unsigned int sun);
187 void acpiphp_unregister_hotplug_slot(struct acpiphp_slot *slot);
190 typedef int (*acpiphp_callback)(struct acpiphp_slot *slot, void *data);
192 int acpiphp_enable_slot(struct acpiphp_slot *slot);
193 int acpiphp_disable_slot(struct acpiphp_slot *slot);
194 u8 acpiphp_get_power_status(struct acpiphp_slot *slot);
195 u8 acpiphp_get_attention_status(struct acpiphp_slot *slot);
196 u8 acpiphp_get_latch_status(struct acpiphp_slot *slot);
197 u8 acpiphp_get_adapter_status(struct acpiphp_slot *slot);
H A Dshpchp.h77 struct slot { struct
98 struct slot *p_slot;
113 u32 first_slot; /* First physical slot number */
173 int shpchp_sysfs_enable_slot(struct slot *slot);
174 int shpchp_sysfs_disable_slot(struct slot *slot);
179 int shpchp_configure_device(struct slot *p_slot);
180 int shpchp_unconfigure_device(struct slot *p_slot);
185 static inline const char *slot_name(struct slot *slot) slot_name() argument
187 return hotplug_slot_name(slot->hotplug_slot); slot_name()
234 static inline struct slot *get_slot(struct hotplug_slot *hotplug_slot) get_slot()
239 static inline struct slot *shpchp_find_slot(struct controller *ctrl, u8 device) shpchp_find_slot()
241 struct slot *slot; shpchp_find_slot() local
243 list_for_each_entry(slot, &ctrl->slot_list, slot_list) { list_for_each_entry()
244 if (slot->device == device) list_for_each_entry()
245 return slot; list_for_each_entry()
252 static inline void amd_pogo_errata_save_misc_reg(struct slot *p_slot) amd_pogo_errata_save_misc_reg()
270 static inline void amd_pogo_errata_restore_misc_reg(struct slot *p_slot) amd_pogo_errata_restore_misc_reg()
328 int (*power_on_slot)(struct slot *slot);
329 int (*slot_enable)(struct slot *slot);
330 int (*slot_disable)(struct slot *slot);
331 int (*set_bus_speed_mode)(struct slot *slot, enum pci_bus_speed speed);
332 int (*get_power_status)(struct slot *slot, u8 *status);
333 int (*get_attention_status)(struct slot *slot, u8 *status);
334 int (*set_attention_status)(struct slot *slot, u8 status);
335 int (*get_latch_status)(struct slot *slot, u8 *status);
336 int (*get_adapter_status)(struct slot *slot, u8 *status);
337 int (*get_adapter_speed)(struct slot *slot, enum pci_bus_speed *speed);
338 int (*get_mode1_ECC_cap)(struct slot *slot, u8 *mode);
339 int (*get_prog_int)(struct slot *slot, u8 *prog_int);
340 int (*query_power_fault)(struct slot *slot);
341 void (*green_led_on)(struct slot *slot);
342 void (*green_led_off)(struct slot *slot);
343 void (*green_led_blink)(struct slot *slot);
H A Drpaphp.h45 #define EMPTY 0 /* No card in slot */
46 #define PRESENT 1 /* Card in slot */
60 /* slot states */
68 * struct slot - slot information for each *physical* slot
70 struct slot { struct
89 int rpaphp_enable_slot(struct slot *slot);
90 int rpaphp_get_sensor_state(struct slot *slot, int *state);
98 void dealloc_slot_struct(struct slot *slot);
99 struct slot *alloc_slot_struct(struct device_node *dn, int drc_index, char *drc_name, int power_domain);
100 int rpaphp_register_slot(struct slot *slot);
101 int rpaphp_deregister_slot(struct slot *slot);
H A Dsgi_hotplug.c43 #define PCI_SLOT_ALREADY_UP 2 /* slot already up */
44 #define PCI_SLOT_ALREADY_DOWN 3 /* slot already down */
58 struct slot { struct
82 static int enable_slot(struct hotplug_slot *slot);
83 static int disable_slot(struct hotplug_slot *slot);
84 static inline int get_power_status(struct hotplug_slot *slot, u8 *value);
97 struct slot *slot = pci_slot->hotplug->private; path_show() local
99 if (!slot) path_show()
102 retval = sprintf (buf, "%s\n", slot->physical_path); path_show()
115 /* Check to see if this is a valid slot on 'pci_bus' */ sn_pci_slot_valid()
167 struct slot *slot; sn_hp_slot_private_alloc() local
171 slot = kzalloc(sizeof(*slot), GFP_KERNEL); sn_hp_slot_private_alloc()
172 if (!slot) sn_hp_slot_private_alloc()
174 bss_hotplug_slot->private = slot; sn_hp_slot_private_alloc()
176 slot->device_num = device; sn_hp_slot_private_alloc()
177 slot->pci_bus = pci_bus; sn_hp_slot_private_alloc()
183 sn_generate_path(pci_bus, slot->physical_path); sn_hp_slot_private_alloc()
185 slot->hotplug_slot = bss_hotplug_slot; sn_hp_slot_private_alloc()
186 list_add(&slot->hp_list, &sn_hp_list); sn_hp_slot_private_alloc()
193 struct slot *slot; sn_hp_destroy() local
197 list_for_each_entry(slot, &sn_hp_list, hp_list) { sn_hp_destroy()
198 bss_hotplug_slot = slot->hotplug_slot; sn_hp_destroy()
200 list_del(&((struct slot *)bss_hotplug_slot->private)-> sn_hp_destroy()
233 struct slot *slot = bss_hotplug_slot->private; sn_slot_enable() local
238 pcibus_info = SN_PCIBUS_BUSSOFT_INFO(slot->pci_bus); sn_slot_enable()
241 * Power-on and initialize the slot in the SN sn_slot_enable()
248 dev_dbg(&slot->pci_bus->self->dev, "is already active\n"); sn_slot_enable()
253 dev_dbg(&slot->pci_bus->self->dev, "L1 failure %d with message: %s", sn_slot_enable()
259 dev_dbg(&slot->pci_bus->self->dev, "insert failed with error %d sub-error %d\n", sn_slot_enable()
264 pcibus_info = SN_PCIBUS_BUSSOFT_INFO(slot->pci_bus); sn_slot_enable()
273 struct slot *slot = bss_hotplug_slot->private; sn_slot_disable() local
278 pcibus_info = SN_PCIBUS_BUSSOFT_INFO(slot->pci_bus); sn_slot_disable()
284 dev_dbg(&slot->pci_bus->self->dev, "Slot %s already inactive\n", slot->physical_path); sn_slot_disable()
289 dev_dbg(&slot->pci_bus->self->dev, "Cannot remove last 33MHz card\n"); sn_slot_disable()
294 dev_dbg(&slot->pci_bus->self->dev, "L1 failure %d with message \n%s\n", sn_slot_disable()
300 dev_dbg(&slot->pci_bus->self->dev, "remove failed with error %d sub-error %d\n", sn_slot_disable()
309 pcibus_info = SN_PCIBUS_BUSSOFT_INFO(slot->pci_bus); sn_slot_disable()
311 dev_dbg(&slot->pci_bus->self->dev, "remove successful\n"); sn_slot_disable()
316 dev_dbg(&slot->pci_bus->self->dev,"remove failed rc = %d\n", rc); sn_slot_disable()
323 * Power up and configure the slot via a SAL call to PROM.
324 * Scan slot (and any children), do any platform specific fixup,
329 struct slot *slot = bss_hotplug_slot->private; enable_slot() local
342 * Power-on and initialize the slot in the SN enable_slot()
344 * table for the slot (if ACPI capable PROM). enable_slot()
346 rc = sn_slot_enable(bss_hotplug_slot, slot->device_num, &ssdt); enable_slot()
354 /* Add the new SSDT for the slot to the ACPI namespace */ enable_slot()
366 num_funcs = pci_scan_slot(slot->pci_bus, enable_slot()
367 PCI_DEVFN(slot->device_num + 1, 0)); enable_slot()
369 dev_dbg(&slot->pci_bus->self->dev, "no device in slot\n"); enable_slot()
379 list_for_each_entry(dev, &slot->pci_bus->devices, bus_list) { enable_slot()
380 if (PCI_SLOT(dev->devfn) != slot->device_num + 1) enable_slot()
383 /* Need to do slot fixup on PPB before fixup of children enable_slot()
403 * Add the slot's devices to the ACPI infrastructure */ enable_slot()
412 phandle = acpi_device_handle(PCI_CONTROLLER(slot->pci_bus)->companion); enable_slot()
415 dev_dbg(&slot->pci_bus->self->dev, "no parent device, assuming NULL\n"); enable_slot()
422 * the slot's device node(s). There can be more than enable_slot()
440 (adr>>16) == (slot->device_num + 1)) { enable_slot()
444 printk(KERN_ERR "%s: acpi_bus_scan failed (0x%x) for slot %d func %d\n", enable_slot()
457 pci_bus_add_devices(slot->pci_bus); enable_slot()
466 dev_dbg(&slot->pci_bus->self->dev, "insert operation successful\n"); enable_slot()
468 dev_dbg(&slot->pci_bus->self->dev, "insert operation failed rc = %d\n", rc); enable_slot()
475 struct slot *slot = bss_hotplug_slot->private; disable_slot() local
483 /* is it okay to bring this slot down? */ disable_slot()
484 rc = sn_slot_disable(bss_hotplug_slot, slot->device_num, disable_slot()
489 /* free the ACPI resources for the slot */ disable_slot()
491 PCI_CONTROLLER(slot->pci_bus)->companion) { disable_slot()
500 phandle = acpi_device_handle(PCI_CONTROLLER(slot->pci_bus)->companion); disable_slot()
505 * the slot's device node(s). There can be more than disable_slot()
523 (adr>>16) == (slot->device_num + 1)) { disable_slot()
538 list_for_each_entry_safe(dev, temp, &slot->pci_bus->devices, bus_list) { disable_slot()
539 if (PCI_SLOT(dev->devfn) != slot->device_num + 1) disable_slot()
549 /* Remove the SSDT for the slot from the ACPI namespace */ disable_slot()
564 /* Deactivate slot */ disable_slot()
565 rc = sn_slot_disable(bss_hotplug_slot, slot->device_num, disable_slot()
577 struct slot *slot = bss_hotplug_slot->private; get_power_status() local
581 pcibus_info = SN_PCIBUS_BUSSOFT_INFO(slot->pci_bus); get_power_status()
583 power = pcibus_info->pbi_enabled_devices & (1 << slot->device_num); get_power_status()
H A Dcpqphp_core.c80 static inline int is_slot64bit(struct slot *slot) is_slot64bit() argument
82 return (readb(slot->p_sm_slot + SMBIOS_SLOT_WIDTH) == 0x06) ? 1 : 0; is_slot64bit()
85 static inline int is_slot66mhz(struct slot *slot) is_slot66mhz() argument
87 return (readb(slot->p_sm_slot + SMBIOS_SLOT_TYPE) == 0x0E) ? 1 : 0; is_slot66mhz()
129 * init_SERR - Initializes the per slot SERR generation.
184 dbg("bus dev func slot\n"); pci_print_IRQ_route()
188 tslot = cpqhp_routing_table->slots[loop].slot; pci_print_IRQ_route()
285 struct slot *slot = hotplug_slot->private; release_slot() local
287 dbg("%s - physical_slot = %s\n", __func__, slot_name(slot)); release_slot()
289 kfree(slot->hotplug_slot->info); release_slot()
290 kfree(slot->hotplug_slot); release_slot()
291 kfree(slot); release_slot()
296 struct slot *old_slot, *next_slot; ctrl_slot_cleanup()
298 old_slot = ctrl->slot; ctrl_slot_cleanup()
299 ctrl->slot = NULL; ctrl_slot_cleanup()
323 * get_slot_mapping - determine logical slot mapping for PCI device
325 * Won't work for more than one PCI-PCI bridge in a slot.
329 * @slot - Pointer to u8 where slot number will be returned
334 get_slot_mapping(struct pci_bus *bus, u8 bus_num, u8 dev_num, u8 *slot) get_slot_mapping() argument
342 dbg("%s: %p, %d, %d, %p\n", __func__, bus, bus_num, dev_num, slot); get_slot_mapping()
350 tslot = cpqhp_routing_table->slots[loop].slot; get_slot_mapping()
353 *slot = tslot; get_slot_mapping()
360 * to save the bridge's slot number. If I can not find get_slot_mapping()
363 * assign it the bridge's slot. get_slot_mapping()
383 * is on the other side of a PCI-to-PCI bridge, return the slot number get_slot_mapping()
387 *slot = bridgeSlot; get_slot_mapping()
396 * cpqhp_set_attention_status - Turns the Amber LED for a slot on or off
438 * set_attention_status - Turns the Amber LED for a slot on or off
439 * @hotplug_slot: slot to change LED on
445 struct slot *slot = hotplug_slot->private; set_attention_status() local
446 struct controller *ctrl = slot->ctrl; set_attention_status()
452 dbg("%s - physical_slot = %s\n", __func__, slot_name(slot)); set_attention_status()
454 if (cpqhp_get_bus_dev(ctrl, &bus, &devfn, slot->number) == -1) set_attention_status()
472 struct slot *slot = hotplug_slot->private; process_SI() local
473 struct controller *ctrl = slot->ctrl; process_SI()
479 dbg("%s - physical_slot = %s\n", __func__, slot_name(slot)); process_SI()
481 if (cpqhp_get_bus_dev(ctrl, &bus, &devfn, slot->number) == -1) process_SI()
504 struct slot *slot = hotplug_slot->private; process_SS() local
505 struct controller *ctrl = slot->ctrl; process_SS()
511 dbg("%s - physical_slot = %s\n", __func__, slot_name(slot)); process_SS()
513 if (cpqhp_get_bus_dev(ctrl, &bus, &devfn, slot->number) == -1) process_SS()
531 struct slot *slot = hotplug_slot->private; hardware_test() local
532 struct controller *ctrl = slot->ctrl; hardware_test()
534 dbg("%s - physical_slot = %s\n", __func__, slot_name(slot)); hardware_test()
542 struct slot *slot = hotplug_slot->private; get_power_status() local
543 struct controller *ctrl = slot->ctrl; get_power_status()
545 dbg("%s - physical_slot = %s\n", __func__, slot_name(slot)); get_power_status()
547 *value = get_slot_enabled(ctrl, slot); get_power_status()
553 struct slot *slot = hotplug_slot->private; get_attention_status() local
554 struct controller *ctrl = slot->ctrl; get_attention_status()
556 dbg("%s - physical_slot = %s\n", __func__, slot_name(slot)); get_attention_status()
558 *value = cpq_get_attention_status(ctrl, slot); get_attention_status()
564 struct slot *slot = hotplug_slot->private; get_latch_status() local
565 struct controller *ctrl = slot->ctrl; get_latch_status()
567 dbg("%s - physical_slot = %s\n", __func__, slot_name(slot)); get_latch_status()
569 *value = cpq_get_latch_status(ctrl, slot); get_latch_status()
576 struct slot *slot = hotplug_slot->private; get_adapter_status() local
577 struct controller *ctrl = slot->ctrl; get_adapter_status()
579 dbg("%s - physical_slot = %s\n", __func__, slot_name(slot)); get_adapter_status()
581 *value = get_presence_status(ctrl, slot); get_adapter_status()
603 struct slot *slot; ctrl_slot_setup() local
625 slot = kzalloc(sizeof(*slot), GFP_KERNEL); ctrl_slot_setup()
626 if (!slot) { ctrl_slot_setup()
631 slot->hotplug_slot = kzalloc(sizeof(*(slot->hotplug_slot)), ctrl_slot_setup()
633 if (!slot->hotplug_slot) { ctrl_slot_setup()
637 hotplug_slot = slot->hotplug_slot; ctrl_slot_setup()
647 slot->ctrl = ctrl; ctrl_slot_setup()
648 slot->bus = ctrl->bus; ctrl_slot_setup()
649 slot->device = slot_device; ctrl_slot_setup()
650 slot->number = slot_number; ctrl_slot_setup()
651 dbg("slot->number = %u\n", slot->number); ctrl_slot_setup()
657 slot->number)) { ctrl_slot_setup()
662 slot->p_sm_slot = slot_entry; ctrl_slot_setup()
664 init_timer(&slot->task_event); ctrl_slot_setup()
665 slot->task_event.expires = jiffies + 5 * HZ; ctrl_slot_setup()
666 slot->task_event.function = cpqhp_pushbutton_thread; ctrl_slot_setup()
671 slot->capabilities |= PCISLOT_REPLACE_SUPPORTED; ctrl_slot_setup()
672 slot->capabilities |= PCISLOT_INTERLOCK_SUPPORTED; ctrl_slot_setup()
674 if (is_slot64bit(slot)) ctrl_slot_setup()
675 slot->capabilities |= PCISLOT_64_BIT_SUPPORTED; ctrl_slot_setup()
676 if (is_slot66mhz(slot)) ctrl_slot_setup()
677 slot->capabilities |= PCISLOT_66_MHZ_SUPPORTED; ctrl_slot_setup()
679 slot->capabilities |= PCISLOT_66_MHZ_OPERATION; ctrl_slot_setup()
685 slot->capabilities |= ctrl_slot_setup()
689 slot->capabilities |= ctrl_slot_setup()
691 /* Check the slot enable */ ctrl_slot_setup()
692 slot->capabilities |= ctrl_slot_setup()
695 /* register this slot with the hotplug pci core */ ctrl_slot_setup()
697 hotplug_slot->private = slot; ctrl_slot_setup()
698 snprintf(name, SLOT_NAME_SIZE, "%u", slot->number); ctrl_slot_setup()
701 hotplug_slot_info->power_status = get_slot_enabled(ctrl, slot); ctrl_slot_setup()
703 cpq_get_attention_status(ctrl, slot); ctrl_slot_setup()
705 cpq_get_latch_status(ctrl, slot); ctrl_slot_setup()
707 get_presence_status(ctrl, slot); ctrl_slot_setup()
709 dbg("registering bus %d, dev %d, number %d, ctrl->slot_device_offset %d, slot %d\n", ctrl_slot_setup()
710 slot->bus, slot->device, ctrl_slot_setup()
711 slot->number, ctrl->slot_device_offset, ctrl_slot_setup()
715 slot->device, ctrl_slot_setup()
722 slot->next = ctrl->slot; ctrl_slot_setup()
723 ctrl->slot = slot; ctrl_slot_setup()
736 kfree(slot); ctrl_slot_setup()
764 dbg("Initialize slot lists\n"); one_time_init()
1009 /* Check for slot switch type (0=mechanical, 1=not mechanical) */ cpqhpc_probe()
1134 /* find the physical slot number of the first hot plug slot */ cpqhpc_probe()
1136 /* Get slot won't work for devices behind bridges, but cpqhpc_probe()
1138 * bus/dev/func of a slot. cpqhpc_probe()
1188 /* Setup the slot information structures */ cpqhpc_probe()
H A Dacpiphp_glue.c159 struct acpiphp_slot *slot, *next; free_bridge() local
166 list_for_each_entry_safe(slot, next, &bridge->slots, node) { free_bridge()
167 list_for_each_entry_safe(func, tmp, &slot->funcs, sibling) free_bridge()
170 kfree(slot); free_bridge()
204 bus = context->func.slot->bus; acpiphp_post_dock_fixup()
209 * secondary bridge on slot acpiphp_post_dock_fixup()
267 struct acpiphp_slot *slot; acpiphp_add_context() local
311 /* search for objects that share the same slot */ acpiphp_add_context()
312 list_for_each_entry(slot, &bridge->slots, node) acpiphp_add_context()
313 if (slot->device == device) acpiphp_add_context()
316 slot = kzalloc(sizeof(struct acpiphp_slot), GFP_KERNEL); acpiphp_add_context()
317 if (!slot) { acpiphp_add_context()
324 slot->bus = bridge->pci_bus; acpiphp_add_context()
325 slot->device = device; acpiphp_add_context()
326 INIT_LIST_HEAD(&slot->funcs); acpiphp_add_context()
328 list_add_tail(&slot->node, &bridge->slots); acpiphp_add_context()
346 pr_debug("found ACPI PCI Hotplug slot %llu at PCI %04x:%02x:%02x\n", acpiphp_add_context()
349 retval = acpiphp_register_hotplug_slot(slot, sun); acpiphp_add_context()
351 slot->slot = NULL; acpiphp_add_context()
358 /* Even if the slot registration fails, we can still use it. */ acpiphp_add_context()
362 newfunc->slot = slot; acpiphp_add_context()
363 list_add_tail(&newfunc->sibling, &slot->funcs); acpiphp_add_context()
367 slot->flags |= SLOT_ENABLED; acpiphp_add_context()
374 struct acpiphp_slot *slot; cleanup_bridge() local
377 list_for_each_entry(slot, &bridge->slots, node) { cleanup_bridge()
378 list_for_each_entry(func, &slot->funcs, sibling) { cleanup_bridge()
386 slot->flags |= SLOT_IS_GOING_AWAY; cleanup_bridge()
387 if (slot->slot) cleanup_bridge()
388 acpiphp_unregister_hotplug_slot(slot); cleanup_bridge()
427 static void acpiphp_set_acpi_region(struct acpiphp_slot *slot) acpiphp_set_acpi_region() argument
433 list_for_each_entry(func, &slot->funcs, sibling) { acpiphp_set_acpi_region()
446 static void check_hotplug_bridge(struct acpiphp_slot *slot, struct pci_dev *dev) check_hotplug_bridge() argument
454 list_for_each_entry(func, &slot->funcs, sibling) { check_hotplug_bridge()
462 static int acpiphp_rescan_slot(struct acpiphp_slot *slot) acpiphp_rescan_slot() argument
466 list_for_each_entry(func, &slot->funcs, sibling) { acpiphp_rescan_slot()
473 return pci_scan_slot(slot->bus, PCI_DEVFN(slot->device, 0)); acpiphp_rescan_slot()
477 * enable_slot - enable, configure a slot
478 * @slot: slot to be enabled
480 * This function should be called per *physical slot*,
481 * not per each slot object in ACPI namespace.
483 static void enable_slot(struct acpiphp_slot *slot) enable_slot() argument
486 struct pci_bus *bus = slot->bus; enable_slot()
491 acpiphp_rescan_slot(slot); enable_slot()
495 if (PCI_SLOT(dev->devfn) != slot->device) enable_slot()
501 check_hotplug_bridge(slot, dev); enable_slot()
513 acpiphp_set_acpi_region(slot); enable_slot()
523 slot->flags |= SLOT_ENABLED; enable_slot()
524 list_for_each_entry(func, &slot->funcs, sibling) { enable_slot()
525 dev = pci_get_slot(bus, PCI_DEVFN(slot->device, enable_slot()
530 slot->flags &= (~SLOT_ENABLED); enable_slot()
537 * disable_slot - disable a slot
538 * @slot: ACPI PHP slot
540 static void disable_slot(struct acpiphp_slot *slot) disable_slot() argument
542 struct pci_bus *bus = slot->bus; disable_slot()
553 if (PCI_SLOT(dev->devfn) == slot->device) disable_slot()
556 list_for_each_entry(func, &slot->funcs, sibling) disable_slot()
559 slot->flags &= (~SLOT_ENABLED); disable_slot()
562 static bool slot_no_hotplug(struct acpiphp_slot *slot) slot_no_hotplug() argument
564 struct pci_bus *bus = slot->bus; slot_no_hotplug()
568 if (PCI_SLOT(dev->devfn) == slot->device && dev->ignore_hotplug) slot_no_hotplug()
575 * get_slot_status - get ACPI slot status
576 * @slot: ACPI PHP slot
578 * If a slot has _STA for each function and if any one of them
581 * If a slot doesn't have _STA and if any one of its functions'
586 static unsigned int get_slot_status(struct acpiphp_slot *slot) get_slot_status() argument
591 list_for_each_entry(func, &slot->funcs, sibling) { get_slot_status()
602 pci_bus_read_config_dword(slot->bus, get_slot_status()
603 PCI_DEVFN(slot->device, get_slot_status()
672 struct acpiphp_slot *slot; acpiphp_check_bridge() local
678 list_for_each_entry(slot, &bridge->slots, node) { acpiphp_check_bridge()
679 struct pci_bus *bus = slot->bus; acpiphp_check_bridge()
682 if (slot_no_hotplug(slot)) { acpiphp_check_bridge()
684 } else if (device_status_valid(get_slot_status(slot))) { acpiphp_check_bridge()
688 if (PCI_SLOT(dev->devfn) == slot->device) acpiphp_check_bridge()
692 enable_slot(slot); acpiphp_check_bridge()
694 disable_slot(slot); acpiphp_check_bridge()
748 static int acpiphp_disable_and_eject_slot(struct acpiphp_slot *slot);
754 struct acpiphp_slot *slot = func->slot; hotplug_event() local
772 else if (!(slot->flags & SLOT_IS_GOING_AWAY)) hotplug_event()
773 enable_slot(slot); hotplug_event()
782 } else if (!(slot->flags & SLOT_IS_GOING_AWAY)) { hotplug_event()
784 * Check if anything has changed in the slot and rescan hotplug_event()
787 if (acpiphp_rescan_slot(slot)) hotplug_event()
795 acpiphp_disable_and_eject_slot(slot); hotplug_event()
821 * A "slot" is an object associated with a PCI device number. All functions
822 * (PCI devices) with the same bus and device number belong to the same slot.
892 /* register all slot objects under this bridge */ acpiphp_enumerate_slots()
927 * acpiphp_remove_slots - Remove slot objects associated with a given bus.
928 * @bus: PCI bus to remove the slot objects for.
949 * acpiphp_enable_slot - power on slot
950 * @slot: ACPI PHP slot
952 int acpiphp_enable_slot(struct acpiphp_slot *slot) acpiphp_enable_slot() argument
956 if (slot->flags & SLOT_IS_GOING_AWAY) { acpiphp_enable_slot()
962 if (!(slot->flags & SLOT_ENABLED)) acpiphp_enable_slot()
963 enable_slot(slot); acpiphp_enable_slot()
970 * acpiphp_disable_and_eject_slot - power off and eject slot
971 * @slot: ACPI PHP slot
973 static int acpiphp_disable_and_eject_slot(struct acpiphp_slot *slot) acpiphp_disable_and_eject_slot() argument
977 if (slot->flags & SLOT_IS_GOING_AWAY) acpiphp_disable_and_eject_slot()
981 disable_slot(slot); acpiphp_disable_and_eject_slot()
983 list_for_each_entry(func, &slot->funcs, sibling) acpiphp_disable_and_eject_slot()
996 int acpiphp_disable_slot(struct acpiphp_slot *slot) acpiphp_disable_slot() argument
1006 ret = acpiphp_disable_and_eject_slot(slot); acpiphp_disable_slot()
1013 * slot enabled: 1
1014 * slot disabled: 0
1016 u8 acpiphp_get_power_status(struct acpiphp_slot *slot) acpiphp_get_power_status() argument
1018 return (slot->flags & SLOT_ENABLED); acpiphp_get_power_status()
1025 u8 acpiphp_get_latch_status(struct acpiphp_slot *slot) acpiphp_get_latch_status() argument
1027 return !(get_slot_status(slot) & ACPI_STA_DEVICE_UI); acpiphp_get_latch_status()
1034 u8 acpiphp_get_adapter_status(struct acpiphp_slot *slot) acpiphp_get_adapter_status() argument
1036 return !!get_slot_status(slot); acpiphp_get_adapter_status()
H A Dpciehp_hpc.c222 * @cmd: command value written to slot control register
223 * @mask: bitmask of slot control register to be modified
358 void pciehp_get_attention_status(struct slot *slot, u8 *status) pciehp_get_attention_status() argument
360 struct controller *ctrl = slot->ctrl; pciehp_get_attention_status()
384 void pciehp_get_power_status(struct slot *slot, u8 *status) pciehp_get_power_status() argument
386 struct controller *ctrl = slot->ctrl; pciehp_get_power_status()
407 void pciehp_get_latch_status(struct slot *slot, u8 *status) pciehp_get_latch_status() argument
409 struct pci_dev *pdev = ctrl_dev(slot->ctrl); pciehp_get_latch_status()
416 void pciehp_get_adapter_status(struct slot *slot, u8 *status) pciehp_get_adapter_status() argument
418 struct pci_dev *pdev = ctrl_dev(slot->ctrl); pciehp_get_adapter_status()
425 int pciehp_query_power_fault(struct slot *slot) pciehp_query_power_fault() argument
427 struct pci_dev *pdev = ctrl_dev(slot->ctrl); pciehp_query_power_fault()
434 void pciehp_set_attention_status(struct slot *slot, u8 value) pciehp_set_attention_status() argument
436 struct controller *ctrl = slot->ctrl; pciehp_set_attention_status()
460 void pciehp_green_led_on(struct slot *slot) pciehp_green_led_on() argument
462 struct controller *ctrl = slot->ctrl; pciehp_green_led_on()
474 void pciehp_green_led_off(struct slot *slot) pciehp_green_led_off() argument
476 struct controller *ctrl = slot->ctrl; pciehp_green_led_off()
488 void pciehp_green_led_blink(struct slot *slot) pciehp_green_led_blink() argument
490 struct controller *ctrl = slot->ctrl; pciehp_green_led_blink()
502 int pciehp_power_on_slot(struct slot *slot) pciehp_power_on_slot() argument
504 struct controller *ctrl = slot->ctrl; pciehp_power_on_slot()
528 void pciehp_power_off_slot(struct slot *slot) pciehp_power_off_slot() argument
530 struct controller *ctrl = slot->ctrl; pciehp_power_off_slot()
544 struct slot *slot = ctrl->slot; pcie_isr() local
600 slot_name(slot)); pcie_isr()
601 pciehp_queue_interrupt_event(slot, INT_BUTTON_PRESS); pcie_isr()
606 pciehp_get_adapter_status(slot, &present); pcie_isr()
608 present ? "" : "not ", slot_name(slot)); pcie_isr()
609 pciehp_queue_interrupt_event(slot, present ? INT_PRESENCE_ON : pcie_isr()
616 ctrl_err(ctrl, "Power fault on slot %s\n", slot_name(slot)); pcie_isr()
617 pciehp_queue_interrupt_event(slot, INT_POWER_FAULT); pcie_isr()
622 ctrl_info(ctrl, "slot(%s): Link %s event\n", pcie_isr()
623 slot_name(slot), link ? "Up" : "Down"); pcie_isr()
624 pciehp_queue_interrupt_event(slot, link ? INT_LINK_UP : pcie_isr()
641 * bit in the slot status register was set again immediately pcie_enable_notification()
683 * pciehp has a 1:1 bus:slot relationship so we ultimately want a secondary
690 int pciehp_reset_slot(struct slot *slot, int probe) pciehp_reset_slot() argument
692 struct controller *ctrl = slot->ctrl; pciehp_reset_slot()
744 struct slot *slot; pcie_init_slot() local
746 slot = kzalloc(sizeof(*slot), GFP_KERNEL); pcie_init_slot()
747 if (!slot) pcie_init_slot()
750 slot->wq = alloc_workqueue("pciehp-%u", 0, 0, PSN(ctrl)); pcie_init_slot()
751 if (!slot->wq) pcie_init_slot()
754 slot->ctrl = ctrl; pcie_init_slot()
755 mutex_init(&slot->lock); pcie_init_slot()
756 mutex_init(&slot->hotplug_lock); pcie_init_slot()
757 INIT_DELAYED_WORK(&slot->work, pciehp_queue_pushbutton_work); pcie_init_slot()
758 ctrl->slot = slot; pcie_init_slot()
761 kfree(slot); pcie_init_slot()
767 struct slot *slot = ctrl->slot; pcie_cleanup_slot() local
768 cancel_delayed_work(&slot->work); pcie_cleanup_slot()
769 destroy_workqueue(slot->wq); pcie_cleanup_slot()
770 kfree(slot); pcie_cleanup_slot()
H A Dpciehp_ctrl.c40 void pciehp_queue_interrupt_event(struct slot *p_slot, u32 event_type) pciehp_queue_interrupt_event()
60 static void set_slot_off(struct controller *ctrl, struct slot *pslot) set_slot_off()
62 /* turn off slot, turn on Amber LED, turn off Green LED if supported*/ set_slot_off()
69 * removed from the slot/adapter. set_slot_off()
80 * @p_slot: &slot where board is added
85 static int board_added(struct slot *p_slot) board_added()
92 /* Power on slot */ board_added()
109 ctrl_err(ctrl, "Power fault on slot %s\n", slot_name(p_slot)); board_added()
131 * remove_board - Turns off slot and LEDs
132 * @p_slot: slot where board is being removed
134 static int remove_board(struct slot *p_slot) remove_board()
149 * removed from the slot/adapter. remove_board()
160 struct slot *p_slot;
178 struct slot *p_slot = info->p_slot; pciehp_power_thread()
207 static void pciehp_queue_power_work(struct slot *p_slot, int req) pciehp_queue_power_work()
227 struct slot *p_slot = container_of(work, struct slot, work.work); pciehp_queue_pushbutton_work()
244 * Note: This function must be called with slot->lock held
246 static void handle_button_press_event(struct slot *p_slot) handle_button_press_event()
256 ctrl_info(ctrl, "PCI slot #%s - powering off due to button press\n", handle_button_press_event()
260 ctrl_info(ctrl, "PCI slot #%s - powering on due to button press\n", handle_button_press_event()
282 ctrl_info(ctrl, "PCI slot #%s - action canceled due to button press\n", handle_button_press_event()
289 * Ignore if the slot is on power-on or power-off state; handle_button_press_event()
302 * Note: This function must be called with slot->lock held
304 static void handle_surprise_event(struct slot *p_slot) handle_surprise_event()
316 * Note: This function must be called with slot->lock held
318 static void handle_link_event(struct slot *p_slot, u32 event) handle_link_event()
334 "Link Up event ignored on slot(%s): already powering on\n", handle_link_event()
338 "Link Down event queued on slot(%s): currently getting powered on\n", handle_link_event()
346 "Link Up event queued on slot(%s): currently getting powered off\n", handle_link_event()
351 "Link Down event ignored on slot(%s): already powering off\n", handle_link_event()
356 ctrl_err(ctrl, "ignoring invalid state %#x on slot(%s)\n", handle_link_event()
365 struct slot *p_slot = info->p_slot; interrupt_event_handler()
402 * Note: This function must be called with slot->hotplug_lock held
404 int pciehp_enable_slot(struct slot *p_slot) pciehp_enable_slot()
412 ctrl_info(ctrl, "No adapter on slot(%s)\n", slot_name(p_slot)); pciehp_enable_slot()
418 ctrl_info(ctrl, "Latch open on slot(%s)\n", pciehp_enable_slot()
427 ctrl_info(ctrl, "Already enabled on slot(%s)\n", pciehp_enable_slot()
443 * Note: This function must be called with slot->hotplug_lock held
445 int pciehp_disable_slot(struct slot *p_slot) pciehp_disable_slot()
456 ctrl_info(ctrl, "Already disabled on slot(%s)\n", pciehp_disable_slot()
465 int pciehp_sysfs_enable_slot(struct slot *p_slot) pciehp_sysfs_enable_slot()
489 ctrl_info(ctrl, "Already enabled on slot %s\n", pciehp_sysfs_enable_slot()
493 ctrl_err(ctrl, "invalid state %#x on slot %s\n", pciehp_sysfs_enable_slot()
502 int pciehp_sysfs_disable_slot(struct slot *p_slot) pciehp_sysfs_disable_slot()
524 ctrl_info(ctrl, "Already disabled on slot %s\n", pciehp_sysfs_disable_slot()
528 ctrl_err(ctrl, "invalid state %#x on slot %s\n", pciehp_sysfs_disable_slot()
H A Drpadlpar_core.c107 * find_php_slot - return hotplug slot structure for device node
110 * This routine will return the hotplug slot structure
115 static struct slot *find_php_slot(struct device_node *dn) find_php_slot()
118 struct slot *slot; find_php_slot() local
121 slot = list_entry(tmp, struct slot, rpaphp_slot_list); find_php_slot()
122 if (slot->dn == dn) find_php_slot()
123 return slot; find_php_slot()
201 /* Add hotplug slot */ dlpar_add_pci_slot()
203 printk(KERN_ERR "%s: unable to add hotplug slot %s\n", dlpar_add_pci_slot()
212 struct slot *slot; dlpar_remove_phb() local
219 /* If pci slot is hotpluggable, use hotplug to remove it */ dlpar_remove_phb()
220 slot = find_php_slot(dn); dlpar_remove_phb()
221 if (slot && rpaphp_deregister_slot(slot)) { dlpar_remove_phb()
222 printk(KERN_ERR "%s: unable to remove hotplug slot %s\n", dlpar_remove_phb()
252 printk(KERN_ERR "%s: unable to add hotplug slot %s\n", dlpar_add_phb()
275 * @drc_name: drc-name of newly added slot
313 printk(KERN_INFO "%s: slot %s added\n", DLPAR_MODULE_NAME, drc_name); dlpar_add_slot()
321 * @drc_name: drc-name of newly added slot
343 * @drc_name: drc-name of newly added slot
355 struct slot *slot; dlpar_remove_pci_slot() local
366 pr_debug("PCI: Removing PCI slot below EADS bridge %s\n", dlpar_remove_pci_slot()
369 slot = find_php_slot(dn); dlpar_remove_pci_slot()
370 if (slot) { dlpar_remove_pci_slot()
371 pr_debug("PCI: Removing hotplug slot for %04x:%02x...\n", dlpar_remove_pci_slot()
374 if (rpaphp_deregister_slot(slot)) { dlpar_remove_pci_slot()
376 "%s: unable to remove hotplug slot %s\n", dlpar_remove_pci_slot()
383 /* Remove all devices below slot */ dlpar_remove_pci_slot()
406 * @drc_name: drc-name of newly added slot
444 printk(KERN_INFO "%s: slot %s removed\n", DLPAR_MODULE_NAME, drc_name); dlpar_remove_slot()
H A Dshpchp_ctrl.c39 static int shpchp_enable_slot(struct slot *p_slot);
40 static int shpchp_disable_slot(struct slot *p_slot);
42 static int queue_interrupt_event(struct slot *p_slot, u32 event_type) queue_interrupt_event()
61 struct slot *p_slot; shpchp_handle_attention_button()
84 struct slot *p_slot; shpchp_handle_switch_change()
122 struct slot *p_slot; shpchp_handle_presence_change()
157 struct slot *p_slot; shpchp_handle_power_fault()
192 static int change_bus_speed(struct controller *ctrl, struct slot *p_slot, change_bus_speed()
207 static int fix_bus_speed(struct controller *ctrl, struct slot *pslot, fix_bus_speed()
238 * @p_slot: target &slot
243 static int board_added(struct slot *p_slot) board_added()
257 /* Power on slot without connecting to bus */ board_added()
260 ctrl_err(ctrl, "Failed to power on slot\n"); board_added()
311 ctrl_dbg(ctrl, "%s: slot status = %x\n", __func__, p_slot->status); board_added()
336 /* turn off slot, turn on Amber LED, turn off Green LED */ board_added()
349 * remove_board - Turns off slot and LEDs
350 * @p_slot: target &slot
352 static int remove_board(struct slot *p_slot) remove_board()
370 /* turn off slot, turn on Amber LED, turn off Green LED */ remove_board()
392 struct slot *p_slot;
407 struct slot *p_slot = info->p_slot; shpchp_pushbutton_thread()
434 struct slot *p_slot = container_of(work, struct slot, work.work); shpchp_queue_pushbutton_work()
463 static int update_slot_info (struct slot *slot) update_slot_info() argument
472 slot->hpc_ops->get_power_status(slot, &(info->power_status)); update_slot_info()
473 slot->hpc_ops->get_attention_status(slot, &(info->attention_status)); update_slot_info()
474 slot->hpc_ops->get_latch_status(slot, &(info->latch_status)); update_slot_info()
475 slot->hpc_ops->get_adapter_status(slot, &(info->adapter_status)); update_slot_info()
477 result = pci_hp_change_slot_info(slot->hotplug_slot, info); update_slot_info()
483 * Note: This function must be called with slot->lock held
485 static void handle_button_press_event(struct slot *p_slot) handle_button_press_event()
495 ctrl_info(ctrl, "PCI slot #%s - powering off due to button press\n", handle_button_press_event()
499 ctrl_info(ctrl, "PCI slot #%s - powering on due to button press\n", handle_button_press_event()
523 ctrl_info(ctrl, "PCI slot #%s - action canceled due to button press\n", handle_button_press_event()
530 * Ignore if the slot is on power-on or power-off state; handle_button_press_event()
547 struct slot *p_slot = info->p_slot; interrupt_event_handler()
569 static int shpchp_enable_slot (struct slot *p_slot) shpchp_enable_slot()
579 ctrl_info(ctrl, "No adapter on slot(%s)\n", slot_name(p_slot)); shpchp_enable_slot()
584 ctrl_info(ctrl, "Latch open on slot(%s)\n", slot_name(p_slot)); shpchp_enable_slot()
589 ctrl_info(ctrl, "Already enabled on slot(%s)\n", shpchp_enable_slot()
626 static int shpchp_disable_slot (struct slot *p_slot) shpchp_disable_slot()
640 ctrl_info(ctrl, "No adapter on slot(%s)\n", slot_name(p_slot)); shpchp_disable_slot()
645 ctrl_info(ctrl, "Latch open on slot(%s)\n", slot_name(p_slot)); shpchp_disable_slot()
650 ctrl_info(ctrl, "Already disabled on slot(%s)\n", shpchp_disable_slot()
662 int shpchp_sysfs_enable_slot(struct slot *p_slot) shpchp_sysfs_enable_slot()
684 ctrl_info(ctrl, "Already enabled on slot %s\n", shpchp_sysfs_enable_slot()
688 ctrl_err(ctrl, "Not a valid state on slot %s\n", shpchp_sysfs_enable_slot()
697 int shpchp_sysfs_disable_slot(struct slot *p_slot) shpchp_sysfs_disable_slot()
719 ctrl_info(ctrl, "Already disabled on slot %s\n", shpchp_sysfs_disable_slot()
723 ctrl_err(ctrl, "Not a valid state on slot %s\n", shpchp_sysfs_disable_slot()
H A Dcpqphp.h223 /* offsets to the hotplug slot resource table registers based on the above
261 struct slot { struct
262 struct slot *next;
303 struct slot *slot; member in struct:controller
400 #define msg_button_on "PCI slot #%d - powering on due to button press.\n"
401 #define msg_button_off "PCI slot #%d - powering off due to button press.\n"
402 #define msg_button_cancel "PCI slot #%d - action canceled due to button press.\n"
403 #define msg_button_ignore "PCI slot #%d - button press ignored. (action in progress...)\n"
432 u8 slot);
460 static inline const char *slot_name(struct slot *slot) slot_name() argument
462 return hotplug_slot_name(slot->hotplug_slot); slot_name()
489 static inline void amber_LED_on(struct controller *ctrl, u8 slot) amber_LED_on() argument
494 led_control |= (0x01010000L << slot); amber_LED_on()
499 static inline void amber_LED_off(struct controller *ctrl, u8 slot) amber_LED_off() argument
504 led_control &= ~(0x01010000L << slot); amber_LED_off()
509 static inline int read_amber_LED(struct controller *ctrl, u8 slot) read_amber_LED() argument
514 led_control &= (0x01010000L << slot); read_amber_LED()
520 static inline void green_LED_on(struct controller *ctrl, u8 slot) green_LED_on() argument
525 led_control |= 0x0101L << slot; green_LED_on()
529 static inline void green_LED_off(struct controller *ctrl, u8 slot) green_LED_off() argument
534 led_control &= ~(0x0101L << slot); green_LED_off()
539 static inline void green_LED_blink(struct controller *ctrl, u8 slot) green_LED_blink() argument
544 led_control &= ~(0x0101L << slot); green_LED_blink()
545 led_control |= (0x0001L << slot); green_LED_blink()
550 static inline void slot_disable(struct controller *ctrl, u8 slot) slot_disable() argument
555 slot_enable &= ~(0x01 << slot); slot_disable()
560 static inline void slot_enable(struct controller *ctrl, u8 slot) slot_enable() argument
565 slot_enable |= (0x01 << slot); slot_enable()
570 static inline u8 is_slot_enabled(struct controller *ctrl, u8 slot) is_slot_enabled() argument
575 slot_enable &= (0x01 << slot); is_slot_enabled()
621 * @hp_slot: hotplug slot where adapter is installed.
628 dbg("slot: %d, PCIXCAP: %8x\n", hp_slot, temp_dword); get_adapter_speed()
642 static inline void enable_slot_power(struct controller *ctrl, u8 slot) enable_slot_power() argument
647 slot_power |= (0x01 << slot); enable_slot_power()
651 static inline void disable_slot_power(struct controller *ctrl, u8 slot) disable_slot_power() argument
656 slot_power &= ~(0x01 << slot); disable_slot_power()
661 static inline int cpq_get_attention_status(struct controller *ctrl, struct slot *slot) cpq_get_attention_status() argument
665 hp_slot = slot->device - ctrl->slot_device_offset; cpq_get_attention_status()
671 static inline int get_slot_enabled(struct controller *ctrl, struct slot *slot) get_slot_enabled() argument
675 hp_slot = slot->device - ctrl->slot_device_offset; get_slot_enabled()
682 struct slot *slot) cpq_get_latch_status()
687 hp_slot = slot->device - ctrl->slot_device_offset; cpq_get_latch_status()
688 dbg("%s: slot->device = %d, ctrl->slot_device_offset = %d \n", cpq_get_latch_status()
689 __func__, slot->device, ctrl->slot_device_offset); cpq_get_latch_status()
698 struct slot *slot) get_presence_status()
704 hp_slot = slot->device - ctrl->slot_device_offset; get_presence_status()
681 cpq_get_latch_status(struct controller *ctrl, struct slot *slot) cpq_get_latch_status() argument
697 get_presence_status(struct controller *ctrl, struct slot *slot) get_presence_status() argument
H A Dshpchp_hpc.c310 static int shpc_write_cmd(struct slot *slot, u8 t_slot, u8 cmd) shpc_write_cmd() argument
312 struct controller *ctrl = slot->ctrl; shpc_write_cmd()
317 mutex_lock(&slot->ctrl->cmd_lock); shpc_write_cmd()
338 retval = shpc_wait_cmd(slot->ctrl); shpc_write_cmd()
342 cmd_status = hpc_check_cmd_status(slot->ctrl); shpc_write_cmd()
349 mutex_unlock(&slot->ctrl->cmd_lock); shpc_write_cmd()
382 static int hpc_get_attention_status(struct slot *slot, u8 *status) hpc_get_attention_status() argument
384 struct controller *ctrl = slot->ctrl; hpc_get_attention_status()
385 u32 slot_reg = shpc_readl(ctrl, SLOT_REG(slot->hp_slot)); hpc_get_attention_status()
406 static int hpc_get_power_status(struct slot *slot, u8 *status) hpc_get_power_status() argument
408 struct controller *ctrl = slot->ctrl; hpc_get_power_status()
409 u32 slot_reg = shpc_readl(ctrl, SLOT_REG(slot->hp_slot)); hpc_get_power_status()
431 static int hpc_get_latch_status(struct slot *slot, u8 *status) hpc_get_latch_status() argument
433 struct controller *ctrl = slot->ctrl; hpc_get_latch_status()
434 u32 slot_reg = shpc_readl(ctrl, SLOT_REG(slot->hp_slot)); hpc_get_latch_status()
441 static int hpc_get_adapter_status(struct slot *slot, u8 *status) hpc_get_adapter_status() argument
443 struct controller *ctrl = slot->ctrl; hpc_get_adapter_status()
444 u32 slot_reg = shpc_readl(ctrl, SLOT_REG(slot->hp_slot)); hpc_get_adapter_status()
452 static int hpc_get_prog_int(struct slot *slot, u8 *prog_int) hpc_get_prog_int() argument
454 struct controller *ctrl = slot->ctrl; hpc_get_prog_int()
461 static int hpc_get_adapter_speed(struct slot *slot, enum pci_bus_speed *value) hpc_get_adapter_speed() argument
464 struct controller *ctrl = slot->ctrl; hpc_get_adapter_speed()
465 u32 slot_reg = shpc_readl(ctrl, SLOT_REG(slot->hp_slot)); hpc_get_adapter_speed()
469 retval = hpc_get_prog_int(slot, &pi); hpc_get_adapter_speed()
514 static int hpc_get_mode1_ECC_cap(struct slot *slot, u8 *mode) hpc_get_mode1_ECC_cap() argument
517 struct controller *ctrl = slot->ctrl; hpc_get_mode1_ECC_cap()
531 static int hpc_query_power_fault(struct slot *slot) hpc_query_power_fault() argument
533 struct controller *ctrl = slot->ctrl; hpc_query_power_fault()
534 u32 slot_reg = shpc_readl(ctrl, SLOT_REG(slot->hp_slot)); hpc_query_power_fault()
540 static int hpc_set_attention_status(struct slot *slot, u8 value) hpc_set_attention_status() argument
558 return shpc_write_cmd(slot, slot->hp_slot, slot_cmd); hpc_set_attention_status()
562 static void hpc_set_green_led_on(struct slot *slot) hpc_set_green_led_on() argument
564 shpc_write_cmd(slot, slot->hp_slot, SET_PWR_ON); hpc_set_green_led_on()
567 static void hpc_set_green_led_off(struct slot *slot) hpc_set_green_led_off() argument
569 shpc_write_cmd(slot, slot->hp_slot, SET_PWR_OFF); hpc_set_green_led_off()
572 static void hpc_set_green_led_blink(struct slot *slot) hpc_set_green_led_blink() argument
574 shpc_write_cmd(slot, slot->hp_slot, SET_PWR_BLINK); hpc_set_green_led_blink()
617 static int hpc_power_on_slot(struct slot *slot) hpc_power_on_slot() argument
621 retval = shpc_write_cmd(slot, slot->hp_slot, SET_SLOT_PWR); hpc_power_on_slot()
623 ctrl_err(slot->ctrl, "%s: Write command failed!\n", __func__); hpc_power_on_slot()
628 static int hpc_slot_enable(struct slot *slot) hpc_slot_enable() argument
633 retval = shpc_write_cmd(slot, slot->hp_slot, hpc_slot_enable()
636 ctrl_err(slot->ctrl, "%s: Write command failed!\n", __func__); hpc_slot_enable()
641 static int hpc_slot_disable(struct slot *slot) hpc_slot_disable() argument
646 retval = shpc_write_cmd(slot, slot->hp_slot, hpc_slot_disable()
649 ctrl_err(slot->ctrl, "%s: Write command failed!\n", __func__); hpc_slot_disable()
723 static int hpc_set_bus_speed_mode(struct slot *slot, enum pci_bus_speed value) hpc_set_bus_speed_mode() argument
726 struct controller *ctrl = slot->ctrl; hpc_set_bus_speed_mode()
780 retval = shpc_write_cmd(slot, 0, cmd); hpc_set_bus_speed_mode()
833 /* To find out which slot has interrupt pending */ shpc_isr()
838 ctrl_dbg(ctrl, "Slot %x with intr, slot register = %x\n", shpc_isr()
853 /* Clear all slot events */ shpc_isr()
968 ctrl_err(ctrl, "Cannot read slot config\n"); shpc_init()
1040 /* Mask the MRL sensor SERR Mask of individual slot in shpc_init()
H A Dibmphp_core.c75 static inline int get_cur_bus_info(struct slot **sl) get_cur_bus_info()
78 struct slot *slot_cur = *sl; get_cur_bus_info()
105 static inline int slot_update(struct slot **sl) slot_update()
118 struct slot *slot_cur; get_max_slots()
123 slot_cur = list_entry(tmp, struct slot, ibm_slot_list); get_max_slots()
130 /* This routine will put the correct slot->device information per slot. It's
131 * called from initialization of the slot structures. It will also assign
132 * interrupt numbers per each slot.
133 * Parameters: struct slot
136 int ibmphp_init_devno(struct slot **cur_slot) ibmphp_init_devno()
157 if ((*cur_slot)->number == rtable->slots[loop].slot && ibmphp_init_devno()
202 static inline int power_on(struct slot *slot_cur) power_on()
220 static inline int power_off(struct slot *slot_cur) power_off()
240 struct slot *pslot; set_attention_status()
284 struct slot *pslot; get_attention_status()
285 struct slot myslot; get_attention_status()
294 memcpy(&myslot, pslot, sizeof(struct slot)); get_attention_status()
315 struct slot *pslot; get_latch_status()
316 struct slot myslot; get_latch_status()
324 memcpy(&myslot, pslot, sizeof(struct slot)); get_latch_status()
342 struct slot *pslot; get_power_status()
343 struct slot myslot; get_power_status()
351 memcpy(&myslot, pslot, sizeof(struct slot)); get_power_status()
368 struct slot *pslot; get_adapter_present()
370 struct slot myslot; get_adapter_present()
378 memcpy(&myslot, pslot, sizeof(struct slot)); get_adapter_present()
396 static int get_max_bus_speed(struct slot *slot) get_max_bus_speed() argument
401 struct pci_bus *bus = slot->hotplug_slot->pci_slot->bus; get_max_bus_speed()
403 debug("%s - Entry slot[%p]\n", __func__, slot); get_max_bus_speed()
406 mode = slot->supported_bus_mode; get_max_bus_speed()
407 speed = slot->supported_speed; get_max_bus_speed()
437 struct slot *pslot;
438 struct slot myslot;
449 memcpy(&myslot, pslot, sizeof(struct slot));
475 struct slot *pslot = NULL;
503 struct slot *slot_cur; init_ops()
509 slot_cur = list_entry(tmp, struct slot, ibm_slot_list); init_ops()
514 debug("BEFORE GETTING SLOT STATUS, slot # %x\n", init_ops()
559 /* This operation will check whether the slot is within the bounds and
560 * the operation is valid to perform on that slot
561 * Parameters: slot, operation
564 static int validate(struct slot *slot_cur, int opn) validate()
602 * Parameters: struct slot
605 int ibmphp_update_slot_info(struct slot *slot_cur) ibmphp_update_slot_info()
671 struct slot *slot_cur; ibm_slot_find()
674 slot_cur = list_entry(tmp, struct slot, ibm_slot_list); ibm_slot_find()
690 * This routine frees up memory used by struct slot, including
696 struct slot *slot_cur; free_slots()
703 slot_cur = list_entry(tmp, struct slot, ibm_slot_list); free_slots()
830 static int is_bus_empty(struct slot *slot_cur) is_bus_empty()
833 struct slot *tmp_slot; is_bus_empty()
858 * Parameters: slot
861 static int set_bus(struct slot *slot_cur) set_bus()
872 debug("%s - entry slot # %d\n", __func__, slot_cur->number); set_bus()
889 /* if max slot/bus capability is 66 pci set_bus()
929 err("wrong slot speed\n"); set_bus()
932 debug("setting bus speed for slot %d, cmd %x\n", set_bus()
951 /* This routine checks the bus limitations that the slot is on from the BIOS.
952 * This is used in deciding whether or not to power up the slot.
955 * Parameters: slot
958 static int check_limitations(struct slot *slot_cur) check_limitations()
961 struct slot *tmp_slot; check_limitations()
997 static inline void print_card_capability(struct slot *slot_cur) print_card_capability()
1011 /* This routine will power on the slot, configure the device(s) and find the
1019 struct slot *slot_cur; enable_slot()
1189 struct slot *slot = hotplug_slot->private; ibmphp_disable_slot() local
1193 rc = ibmphp_do_disable_slot(slot); ibmphp_disable_slot()
1198 int ibmphp_do_disable_slot(struct slot *slot_cur) ibmphp_do_disable_slot()
1213 /* checking if powered off already & valid slot # */ ibmphp_do_disable_slot()
H A Dacpiphp_ibm.c58 #define hpslot_to_sun(A) (((struct slot *)((A)->private))->sun)
81 } slot; member in union:apci_descriptor
96 static int ibm_set_attention_status(struct hotplug_slot *slot, u8 status);
97 static int ibm_get_attention_status(struct hotplug_slot *slot, u8 *status);
127 * @id: the slot number that linux refers to the slot by
129 * Description: This method returns the aCPI slot descriptor
130 * corresponding to the Linux slot number. This descriptor
131 * has info about the aPCI slot id and attention status.
147 des->slot.slot_num != id)) { ibm_slot_from_id()
151 if (ind < size && des->slot.slot_num == id) ibm_slot_from_id()
165 * @slot: the hotplug_slot to work with
171 static int ibm_set_attention_status(struct hotplug_slot *slot, u8 status) ibm_set_attention_status() argument
179 ibm_slot = ibm_slot_from_id(hpslot_to_sun(slot)); ibm_set_attention_status()
181 pr_debug("%s: set slot %d (%d) attention status to %d\n", __func__, ibm_set_attention_status()
182 ibm_slot->slot.slot_num, ibm_slot->slot.slot_id, ibm_set_attention_status()
186 args[0].integer.value = ibm_slot->slot.slot_id; ibm_set_attention_status()
205 * @slot: the hotplug_slot to work with
213 * slot descriptor to read the status from that.
215 static int ibm_get_attention_status(struct hotplug_slot *slot, u8 *status) ibm_get_attention_status() argument
219 ibm_slot = ibm_slot_from_id(hpslot_to_sun(slot)); ibm_get_attention_status()
221 if (ibm_slot->slot.attn & 0xa0 || ibm_slot->slot.status[1] & 0x08) ibm_get_attention_status()
226 pr_debug("%s: get slot %d (%d) attention status is %d\n", __func__, ibm_get_attention_status()
227 ibm_slot->slot.slot_num, ibm_slot->slot.slot_id, ibm_get_attention_status()
245 * ID comes first and then the slot number that caused it. We report
H A Dibmphp_ebda.c48 * controllers (ctlr#, slot#, bus&slot features...)
186 struct slot *ptr; print_ibm_slot()
212 debug ("%s - physical slot#: %x\n", __func__, hpc_ptr->slots[index].slot_num); print_ebda_hpc()
213 debug ("%s - pci bus# of the slot: %x\n", __func__, hpc_ptr->slots[index].slot_bus_num); print_ebda_hpc()
215 debug ("%s - cap of the slot: %x\n", __func__, hpc_ptr->slots[index].slot_cap); print_ebda_hpc()
536 /* Since we don't know the max slot number per each chassis, hence go
538 * Arguments: slot_num, 1st slot number of the chassis we think we are on,
590 * the slot numbers for rxe100 would start from 1, and not from 7, or 6 etc
595 struct slot *slot_cur; calculate_first_slot()
609 static char *create_file_name (struct slot *slot_cur) create_file_name()
680 struct slot *slot; fillslotinfo() local
686 slot = hotplug_slot->private; fillslotinfo()
687 rc = ibmphp_hpc_readslot(slot, READ_ALLSTAT, NULL); fillslotinfo()
692 hotplug_slot->info->power_status = SLOT_POWER(slot->status); fillslotinfo()
695 hotplug_slot->info->attention_status = SLOT_ATTN(slot->status, slot->ext_status); fillslotinfo()
698 hotplug_slot->info->latch_status = SLOT_LATCH(slot->status); fillslotinfo()
701 if (SLOT_PRESENT (slot->status)) fillslotinfo()
706 if (slot->bus_on->supported_bus_mode fillslotinfo()
707 && (slot->bus_on->supported_speed == BUS_SPEED_66)) fillslotinfo()
710 hotplug_slot->info->max_bus_speed_status = slot->bus_on->supported_speed; fillslotinfo()
718 struct slot *slot; release_slot() local
723 slot = hotplug_slot->private; release_slot()
724 kfree(slot->hotplug_slot->info); release_slot()
725 kfree(slot->hotplug_slot); release_slot()
726 slot->ctrl = NULL; release_slot()
727 slot->bus_on = NULL; release_slot()
730 ibmphp_unconfigure_card(&slot, -1); release_slot()
732 kfree (slot); release_slot()
738 * map info (ctlr-id, slot count, slot#.. bus count, bus#, ctlr type...) of
746 u16 ctlr, slot, bus; ebda_rsrc_controller() local
754 struct slot *tmp_slot; ebda_rsrc_controller()
765 addr_slot = addr; /* offset of slot structure */ ebda_rsrc_controller()
792 /* init slot structure, fetch slot, bus, cap... */ ebda_rsrc_controller()
794 for (slot = 0; slot < slot_num; slot++) { ebda_rsrc_controller()
800 // create bus_info lined list --- if only one slot per bus: slot_min = slot_max ebda_rsrc_controller()
904 // register slots with hpc core as well as create linked list of ibm slot ebda_rsrc_controller()
964 rc = ibmphp_init_devno ((struct slot **) &hp_slot_ptr->private); ebda_rsrc_controller()
969 // end of registering ibm slot with hotplug core ebda_rsrc_controller()
971 list_add (& ((struct slot *)(hp_slot_ptr->private))->ibm_slot_list, &ibmphp_slot_head); ebda_rsrc_controller()
1076 struct slot *ibmphp_get_slot_from_physical_num (u8 physical_num) ibmphp_get_slot_from_physical_num()
1078 struct slot *slot; ibmphp_get_slot_from_physical_num() local
1080 list_for_each_entry(slot, &ibmphp_slot_head, ibm_slot_list) { ibmphp_get_slot_from_physical_num()
1081 if (slot->number == physical_num) ibmphp_get_slot_from_physical_num()
1082 return slot; ibmphp_get_slot_from_physical_num()
1088 * - the smallest slot number
1089 * - the largest slot number
1091 * (if only one slot per bus slot_min = slot_max )
/linux-4.4.14/arch/x86/pci/
H A Dearly.c10 u32 read_pci_config(u8 bus, u8 slot, u8 func, u8 offset) read_pci_config() argument
13 outl(0x80000000 | (bus<<16) | (slot<<11) | (func<<8) | offset, 0xcf8); read_pci_config()
18 u8 read_pci_config_byte(u8 bus, u8 slot, u8 func, u8 offset) read_pci_config_byte() argument
21 outl(0x80000000 | (bus<<16) | (slot<<11) | (func<<8) | offset, 0xcf8); read_pci_config_byte()
26 u16 read_pci_config_16(u8 bus, u8 slot, u8 func, u8 offset) read_pci_config_16() argument
29 outl(0x80000000 | (bus<<16) | (slot<<11) | (func<<8) | offset, 0xcf8); read_pci_config_16()
34 void write_pci_config(u8 bus, u8 slot, u8 func, u8 offset, write_pci_config() argument
37 outl(0x80000000 | (bus<<16) | (slot<<11) | (func<<8) | offset, 0xcf8); write_pci_config()
41 void write_pci_config_byte(u8 bus, u8 slot, u8 func, u8 offset, u8 val) write_pci_config_byte() argument
43 outl(0x80000000 | (bus<<16) | (slot<<11) | (func<<8) | offset, 0xcf8); write_pci_config_byte()
47 void write_pci_config_16(u8 bus, u8 slot, u8 func, u8 offset, u16 val) write_pci_config_16() argument
49 outl(0x80000000 | (bus<<16) | (slot<<11) | (func<<8) | offset, 0xcf8); write_pci_config_16()
59 void early_dump_pci_device(u8 bus, u8 slot, u8 func) early_dump_pci_device() argument
66 bus, slot, func); early_dump_pci_device()
72 val = read_pci_config(bus, slot, func, i); early_dump_pci_device()
83 unsigned bus, slot, func; early_dump_pci_devices() local
89 for (slot = 0; slot < 32; slot++) { early_dump_pci_devices()
94 class = read_pci_config(bus, slot, func, early_dump_pci_devices()
99 early_dump_pci_device(bus, slot, func); early_dump_pci_devices()
102 type = read_pci_config_byte(bus, slot, early_dump_pci_devices()
H A Dbroadcom_bus.c22 static void __init cnb20le_res(u8 bus, u8 slot, u8 func) cnb20le_res() argument
31 fbus = read_pci_config_byte(bus, slot, func, 0x44); cnb20le_res()
32 lbus = read_pci_config_byte(bus, slot, func, 0x45); cnb20le_res()
50 word1 = read_pci_config_16(bus, slot, func, 0xc0); cnb20le_res()
51 word2 = read_pci_config_16(bus, slot, func, 0xc2); cnb20le_res()
60 word1 = read_pci_config_16(bus, slot, func, 0xc4); cnb20le_res()
61 word2 = read_pci_config_16(bus, slot, func, 0xc6); cnb20le_res()
70 word1 = read_pci_config_16(bus, slot, func, 0xd0); cnb20le_res()
71 word2 = read_pci_config_16(bus, slot, func, 0xd2); cnb20le_res()
91 u8 bus = 0, slot = 0; broadcom_postcore_init() local
104 id = read_pci_config(bus, slot, 0, PCI_VENDOR_ID); broadcom_postcore_init()
110 cnb20le_res(bus, slot, 0); broadcom_postcore_init()
111 cnb20le_res(bus, slot, 1); broadcom_postcore_init()
H A Damd_bus.c23 u32 slot; member in struct:amd_hostbridge
63 unsigned slot; early_root_info_init() local
90 slot = hb_probes[i].slot; early_root_info_init()
91 id = read_pci_config(bus, slot, 0, PCI_VENDOR_ID); early_root_info_init()
115 reg = read_pci_config(bus, slot, 1, early_root_info_init()
142 reg = read_pci_config(bus, slot, 0, AMD_NB_F0_NODE_ID); early_root_info_init()
144 reg = read_pci_config(bus, slot, 0, AMD_NB_F0_UNIT_ID); early_root_info_init()
151 reg = read_pci_config(bus, slot, 1, 0xc0 + (i << 3)); early_root_info_init()
156 reg = read_pci_config(bus, slot, 1, 0xc4 + (i << 3)); early_root_info_init()
217 reg = read_pci_config(bus, slot, 1, 0x80 + (i << 3)); early_root_info_init()
223 reg = read_pci_config(bus, slot, 1, 0x84 + (i << 3)); early_root_info_init()
366 u8 slot = amd_nb_bus_dev_ranges[i].dev_base; pci_enable_pci_io_ecs() local
369 for (; slot < limit; ++slot) { pci_enable_pci_io_ecs()
370 u32 val = read_pci_config(bus, slot, 3, 0); pci_enable_pci_io_ecs()
375 val = read_pci_config(bus, slot, 3, 0x8c); pci_enable_pci_io_ecs()
378 write_pci_config(bus, slot, 3, 0x8c, val); pci_enable_pci_io_ecs()
H A Dbus_numa.h5 * root, so need to make sure we have enough slot there.
/linux-4.4.14/drivers/pci/
H A Dslot.c2 * drivers/pci/slot.c
22 struct pci_slot *slot = to_pci_slot(kobj); pci_slot_attr_show() local
24 return attribute->show ? attribute->show(slot, buf) : -EIO; pci_slot_attr_show()
30 struct pci_slot *slot = to_pci_slot(kobj); pci_slot_attr_store() local
32 return attribute->store ? attribute->store(slot, buf, len) : -EIO; pci_slot_attr_store()
40 static ssize_t address_read_file(struct pci_slot *slot, char *buf) address_read_file() argument
42 if (slot->number == 0xff) address_read_file()
44 pci_domain_nr(slot->bus), address_read_file()
45 slot->bus->number); address_read_file()
48 pci_domain_nr(slot->bus), address_read_file()
49 slot->bus->number, address_read_file()
50 slot->number); address_read_file()
92 static ssize_t max_speed_read_file(struct pci_slot *slot, char *buf) max_speed_read_file() argument
94 return bus_speed_read(slot->bus->max_bus_speed, buf); max_speed_read_file()
97 static ssize_t cur_speed_read_file(struct pci_slot *slot, char *buf) cur_speed_read_file() argument
99 return bus_speed_read(slot->bus->cur_bus_speed, buf); cur_speed_read_file()
105 struct pci_slot *slot = to_pci_slot(kobj); pci_slot_release() local
107 dev_dbg(&slot->bus->dev, "dev %02x, released physical slot %s\n", pci_slot_release()
108 slot->number, pci_slot_name(slot)); pci_slot_release()
111 list_for_each_entry(dev, &slot->bus->devices, bus_list) pci_slot_release()
112 if (PCI_SLOT(dev->devfn) == slot->number) pci_slot_release()
113 dev->slot = NULL; pci_slot_release()
116 list_del(&slot->list); pci_slot_release()
118 kfree(slot); pci_slot_release()
179 static int rename_slot(struct pci_slot *slot, const char *name) rename_slot() argument
184 if (strcmp(pci_slot_name(slot), name) == 0) rename_slot()
191 result = kobject_rename(&slot->kobj, slot_name); rename_slot()
199 struct pci_slot *slot; pci_dev_assign_slot() local
202 list_for_each_entry(slot, &dev->bus->slots, list) pci_dev_assign_slot()
203 if (PCI_SLOT(dev->devfn) == slot->number) pci_dev_assign_slot()
204 dev->slot = slot; pci_dev_assign_slot()
210 struct pci_slot *slot; get_slot() local
213 list_for_each_entry(slot, &parent->slots, list) get_slot()
214 if (slot->number == slot_nr) { get_slot()
215 kobject_get(&slot->kobj); get_slot()
216 return slot; get_slot()
223 * pci_create_slot - create or increment refcount for physical PCI slot
241 * The first slot is assigned N
242 * The second slot is assigned N-1
243 * The third slot is assigned N-2
248 * a slot. There is one notable exception - pSeries (rpaphp), where the
250 * the slot. In this scenario, the caller may pass -1 for @slot_nr.
258 * the 'placeholder' slot will not be displayed.
265 struct pci_slot *slot; pci_create_slot() local
275 * Hotplug drivers are allowed to rename an existing slot, pci_create_slot()
278 slot = get_slot(parent, slot_nr); pci_create_slot()
279 if (slot) { pci_create_slot()
281 if ((err = slot->hotplug ? -EBUSY : 0) pci_create_slot()
282 || (err = rename_slot(slot, name))) { pci_create_slot()
283 kobject_put(&slot->kobj); pci_create_slot()
284 slot = NULL; pci_create_slot()
292 slot = kzalloc(sizeof(*slot), GFP_KERNEL); pci_create_slot()
293 if (!slot) { pci_create_slot()
298 slot->bus = parent; pci_create_slot()
299 slot->number = slot_nr; pci_create_slot()
301 slot->kobj.kset = pci_slots_kset; pci_create_slot()
309 err = kobject_init_and_add(&slot->kobj, &pci_slot_ktype, NULL, pci_create_slot()
314 INIT_LIST_HEAD(&slot->list); pci_create_slot()
315 list_add(&slot->list, &parent->slots); pci_create_slot()
320 dev->slot = slot; pci_create_slot()
323 dev_dbg(&parent->dev, "dev %02x, created physical slot %s\n", pci_create_slot()
324 slot_nr, pci_slot_name(slot)); pci_create_slot()
329 return slot; pci_create_slot()
331 kfree(slot); pci_create_slot()
332 slot = ERR_PTR(err); pci_create_slot()
338 * pci_destroy_slot - decrement refcount for physical PCI slot
339 * @slot: struct pci_slot to decrement
345 void pci_destroy_slot(struct pci_slot *slot) pci_destroy_slot() argument
347 dev_dbg(&slot->bus->dev, "dev %02x, dec refcount to %d\n", pci_destroy_slot()
348 slot->number, atomic_read(&slot->kobj.kref.refcount) - 1); pci_destroy_slot()
351 kobject_put(&slot->kobj); pci_destroy_slot()
367 struct hotplug_slot *slot = pci_slot->hotplug; pci_hp_create_module_link() local
371 if (!slot || !slot->ops) pci_hp_create_module_link()
373 kobj = kset_find_obj(module_kset, slot->ops->mod_name); pci_hp_create_module_link()
H A Dsetup-irq.c29 u8 pin, slot; pdev_fixup_irq() local
33 which interrupt pin it will come in on. We know which slot it pdev_fixup_irq()
34 will come in on 'cos that slot is where the bridge is. Each pdev_fixup_irq()
45 slot = (*swizzle)(dev, &pin); pdev_fixup_irq()
47 irq = (*map_irq)(dev, slot, pin); pdev_fixup_irq()
/linux-4.4.14/drivers/mmc/host/
H A Dcb710-mmc.c30 struct cb710_slot *slot = cb710_mmc_to_slot(mmc); cb710_mmc_select_clock_divider() local
31 struct pci_dev *pdev = cb710_slot_to_chip(slot)->pdev; cb710_mmc_select_clock_divider()
57 dev_dbg(cb710_slot_dev(slot), cb710_mmc_select_clock_divider()
63 static void __cb710_mmc_enable_irq(struct cb710_slot *slot, __cb710_mmc_enable_irq() argument
75 enable = (cb710_read_port_16(slot, CB710_MMC_IRQ_ENABLE_PORT) __cb710_mmc_enable_irq()
81 cb710_write_port_16(slot, CB710_MMC_IRQ_ENABLE_PORT, enable); __cb710_mmc_enable_irq()
84 static void cb710_mmc_enable_irq(struct cb710_slot *slot, cb710_mmc_enable_irq() argument
87 struct cb710_mmc_reader *reader = mmc_priv(cb710_slot_to_mmc(slot)); cb710_mmc_enable_irq()
92 __cb710_mmc_enable_irq(slot, enable, mask); cb710_mmc_enable_irq()
96 static void cb710_mmc_reset_events(struct cb710_slot *slot) cb710_mmc_reset_events() argument
98 cb710_write_port_8(slot, CB710_MMC_STATUS0_PORT, 0xFF); cb710_mmc_reset_events()
99 cb710_write_port_8(slot, CB710_MMC_STATUS1_PORT, 0xFF); cb710_mmc_reset_events()
100 cb710_write_port_8(slot, CB710_MMC_STATUS2_PORT, 0xFF); cb710_mmc_reset_events()
103 static void cb710_mmc_enable_4bit_data(struct cb710_slot *slot, int enable) cb710_mmc_enable_4bit_data() argument
106 cb710_modify_port_8(slot, CB710_MMC_CONFIG1_PORT, cb710_mmc_enable_4bit_data()
109 cb710_modify_port_8(slot, CB710_MMC_CONFIG1_PORT, cb710_mmc_enable_4bit_data()
113 static int cb710_check_event(struct cb710_slot *slot, u8 what) cb710_check_event() argument
117 status = cb710_read_port_16(slot, CB710_MMC_STATUS_PORT); cb710_check_event()
121 dev_dbg(cb710_slot_dev(slot), cb710_check_event()
123 cb710_write_port_8(slot, CB710_MMC_STATUS0_PORT, cb710_check_event()
129 dev_dbg(cb710_slot_dev(slot), cb710_check_event()
131 cb710_write_port_8(slot, CB710_MMC_STATUS0_PORT, status & 0xFF); cb710_check_event()
132 cb710_write_port_8(slot, CB710_MMC_STATUS1_PORT, cb710_check_event()
139 cb710_write_port_8(slot, CB710_MMC_STATUS1_PORT, what); cb710_check_event()
146 static int cb710_wait_for_event(struct cb710_slot *slot, u8 what) cb710_wait_for_event() argument
153 e = cb710_read_port_32(slot, CB710_MMC_STATUS_PORT); cb710_wait_for_event()
156 while (!(err = cb710_check_event(slot, what))) { cb710_wait_for_event()
158 cb710_dump_regs(cb710_slot_to_chip(slot), cb710_wait_for_event()
167 x = cb710_read_port_32(slot, CB710_MMC_STATUS_PORT); cb710_wait_for_event()
171 dev_dbg(cb710_slot_dev(slot), cb710_wait_for_event()
179 static int cb710_wait_while_busy(struct cb710_slot *slot, uint8_t mask) cb710_wait_while_busy() argument
186 e = cb710_read_port_32(slot, CB710_MMC_STATUS_PORT); cb710_wait_while_busy()
189 while (cb710_read_port_8(slot, CB710_MMC_STATUS2_PORT) & mask) { cb710_wait_while_busy()
191 cb710_dump_regs(cb710_slot_to_chip(slot), cb710_wait_while_busy()
200 x = cb710_read_port_32(slot, CB710_MMC_STATUS_PORT); cb710_wait_while_busy()
204 dev_dbg(cb710_slot_dev(slot), cb710_wait_while_busy()
211 static void cb710_mmc_set_transfer_size(struct cb710_slot *slot, cb710_mmc_set_transfer_size() argument
214 cb710_wait_while_busy(slot, CB710_MMC_S2_BUSY_20); cb710_mmc_set_transfer_size()
215 cb710_write_port_32(slot, CB710_MMC_TRANSFER_SIZE_PORT, cb710_mmc_set_transfer_size()
218 dev_vdbg(cb710_slot_dev(slot), "set up for %zu block%s of %zu bytes\n", cb710_mmc_set_transfer_size()
222 static void cb710_mmc_fifo_hack(struct cb710_slot *slot) cb710_mmc_fifo_hack() argument
228 r1 = cb710_read_port_32(slot, CB710_MMC_DATA_PORT); cb710_mmc_fifo_hack()
229 r2 = cb710_read_port_32(slot, CB710_MMC_DATA_PORT); cb710_mmc_fifo_hack()
230 if (cb710_read_port_8(slot, CB710_MMC_STATUS0_PORT) cb710_mmc_fifo_hack()
232 cb710_write_port_8(slot, CB710_MMC_STATUS0_PORT, cb710_mmc_fifo_hack()
237 dev_dbg(cb710_slot_dev(slot), cb710_mmc_fifo_hack()
240 dev_dbg(cb710_slot_dev(slot), cb710_mmc_fifo_hack()
245 static int cb710_mmc_receive_pio(struct cb710_slot *slot, cb710_mmc_receive_pio() argument
248 if (!(cb710_read_port_8(slot, CB710_MMC_STATUS2_PORT) & CB710_MMC_S2_FIFO_READY)) { cb710_mmc_receive_pio()
249 int err = cb710_wait_for_event(slot, cb710_mmc_receive_pio()
256 slot->iobase + CB710_MMC_DATA_PORT, dw_count); cb710_mmc_receive_pio()
266 static int cb710_mmc_receive(struct cb710_slot *slot, struct mmc_data *data) cb710_mmc_receive() argument
279 cb710_modify_port_8(slot, CB710_MMC_CONFIG2_PORT, cb710_mmc_receive()
282 cb710_mmc_fifo_hack(slot); cb710_mmc_receive()
288 err = cb710_mmc_receive_pio(slot, &miter, 4); cb710_mmc_receive()
297 cb710_modify_port_8(slot, CB710_MMC_CONFIG2_PORT, cb710_mmc_receive()
301 err = cb710_mmc_receive_pio(slot, &miter, len); cb710_mmc_receive()
310 static int cb710_mmc_send(struct cb710_slot *slot, struct mmc_data *data) cb710_mmc_send() argument
323 cb710_modify_port_8(slot, CB710_MMC_CONFIG2_PORT, cb710_mmc_send()
329 if (!(cb710_read_port_8(slot, CB710_MMC_STATUS2_PORT) cb710_mmc_send()
331 err = cb710_wait_for_event(slot, cb710_mmc_send()
337 slot->iobase + CB710_MMC_DATA_PORT, 4); cb710_mmc_send()
396 static void cb710_receive_response(struct cb710_slot *slot, cb710_receive_response() argument
405 resp[0] = cb710_read_port_32(slot, CB710_MMC_RESPONSE3_PORT); cb710_receive_response()
406 resp[1] = cb710_read_port_32(slot, CB710_MMC_RESPONSE2_PORT); cb710_receive_response()
407 resp[2] = cb710_read_port_32(slot, CB710_MMC_RESPONSE1_PORT); cb710_receive_response()
408 resp[3] = cb710_read_port_32(slot, CB710_MMC_RESPONSE0_PORT); cb710_receive_response()
416 rsp_opcode = cb710_read_port_32(slot, CB710_MMC_RESPONSE1_PORT) & 0x3F; cb710_receive_response()
417 cmd->resp[0] = cb710_read_port_32(slot, CB710_MMC_RESPONSE0_PORT); cb710_receive_response()
425 static int cb710_mmc_transfer_data(struct cb710_slot *slot, cb710_mmc_transfer_data() argument
431 error = cb710_mmc_receive(slot, data); cb710_mmc_transfer_data()
433 error = cb710_mmc_send(slot, data); cb710_mmc_transfer_data()
435 to = cb710_wait_for_event(slot, CB710_MMC_S1_DATA_TRANSFER_DONE); cb710_mmc_transfer_data()
446 struct cb710_slot *slot = cb710_mmc_to_slot(mmc); cb710_mmc_command() local
451 dev_dbg(cb710_slot_dev(slot), "cmd request: 0x%04X\n", cb_cmd); cb710_mmc_command()
458 cb710_mmc_set_transfer_size(slot, data->blocks, data->blksz); cb710_mmc_command()
461 cb710_wait_while_busy(slot, CB710_MMC_S2_BUSY_20|CB710_MMC_S2_BUSY_10); cb710_mmc_command()
462 cb710_write_port_16(slot, CB710_MMC_CMD_TYPE_PORT, cb_cmd); cb710_mmc_command()
463 cb710_wait_while_busy(slot, CB710_MMC_S2_BUSY_20); cb710_mmc_command()
464 cb710_write_port_32(slot, CB710_MMC_CMD_PARAM_PORT, cmd->arg); cb710_mmc_command()
465 cb710_mmc_reset_events(slot); cb710_mmc_command()
466 cb710_wait_while_busy(slot, CB710_MMC_S2_BUSY_20); cb710_mmc_command()
467 cb710_modify_port_8(slot, CB710_MMC_CONFIG0_PORT, 0x01, 0); cb710_mmc_command()
469 cmd->error = cb710_wait_for_event(slot, CB710_MMC_S1_COMMAND_SENT); cb710_mmc_command()
474 cb710_receive_response(slot, cmd); cb710_mmc_command()
480 data->error = cb710_mmc_transfer_data(slot, data); cb710_mmc_command()
486 struct cb710_slot *slot = cb710_mmc_to_slot(mmc); cb710_mmc_request() local
492 cb710_mmc_enable_irq(slot, CB710_MMC_IE_TEST_MASK, 0); cb710_mmc_request()
500 static int cb710_mmc_powerup(struct cb710_slot *slot) cb710_mmc_powerup() argument
503 struct cb710_chip *chip = cb710_slot_to_chip(slot); cb710_mmc_powerup()
508 dev_dbg(cb710_slot_dev(slot), "bus powerup\n"); cb710_mmc_powerup()
510 err = cb710_wait_while_busy(slot, CB710_MMC_S2_BUSY_20); cb710_mmc_powerup()
513 cb710_modify_port_8(slot, CB710_MMC_CONFIG1_PORT, 0x80, 0); cb710_mmc_powerup()
514 cb710_modify_port_8(slot, CB710_MMC_CONFIG3_PORT, 0x80, 0); cb710_mmc_powerup()
517 dev_dbg(cb710_slot_dev(slot), "after delay 1\n"); cb710_mmc_powerup()
519 err = cb710_wait_while_busy(slot, CB710_MMC_S2_BUSY_20); cb710_mmc_powerup()
522 cb710_modify_port_8(slot, CB710_MMC_CONFIG1_PORT, 0x09, 0); cb710_mmc_powerup()
525 dev_dbg(cb710_slot_dev(slot), "after delay 2\n"); cb710_mmc_powerup()
527 err = cb710_wait_while_busy(slot, CB710_MMC_S2_BUSY_20); cb710_mmc_powerup()
530 cb710_modify_port_8(slot, CB710_MMC_CONFIG1_PORT, 0, 0x08); cb710_mmc_powerup()
533 dev_dbg(cb710_slot_dev(slot), "after delay 3\n"); cb710_mmc_powerup()
535 cb710_modify_port_8(slot, CB710_MMC_CONFIG0_PORT, 0x06, 0); cb710_mmc_powerup()
536 cb710_modify_port_8(slot, CB710_MMC_CONFIG1_PORT, 0x70, 0); cb710_mmc_powerup()
537 cb710_modify_port_8(slot, CB710_MMC_CONFIG2_PORT, 0x80, 0); cb710_mmc_powerup()
538 cb710_modify_port_8(slot, CB710_MMC_CONFIG3_PORT, 0x03, 0); cb710_mmc_powerup()
540 err = cb710_wait_while_busy(slot, CB710_MMC_S2_BUSY_20); cb710_mmc_powerup()
547 cb710_write_port_16(slot, CB710_MMC_CONFIGB_PORT, 0xFFFF); cb710_mmc_powerup()
548 cb710_modify_port_8(slot, CB710_MMC_CONFIG0_PORT, 0x06, 0); cb710_mmc_powerup()
550 dev_dbg(cb710_slot_dev(slot), "bus powerup finished\n"); cb710_mmc_powerup()
552 return cb710_check_event(slot, 0); cb710_mmc_powerup()
555 static void cb710_mmc_powerdown(struct cb710_slot *slot) cb710_mmc_powerdown() argument
557 cb710_modify_port_8(slot, CB710_MMC_CONFIG1_PORT, 0, 0x81); cb710_mmc_powerdown()
558 cb710_modify_port_8(slot, CB710_MMC_CONFIG3_PORT, 0, 0x80); cb710_mmc_powerdown()
563 struct cb710_slot *slot = cb710_mmc_to_slot(mmc); cb710_mmc_set_ios() local
572 err = cb710_mmc_powerup(slot); cb710_mmc_set_ios()
574 dev_warn(cb710_slot_dev(slot), cb710_mmc_set_ios()
576 cb710_mmc_powerdown(slot); cb710_mmc_set_ios()
578 err = cb710_mmc_powerup(slot); cb710_mmc_set_ios()
580 dev_warn(cb710_slot_dev(slot), cb710_mmc_set_ios()
587 cb710_mmc_powerdown(slot); cb710_mmc_set_ios()
595 cb710_mmc_enable_4bit_data(slot, ios->bus_width != MMC_BUS_WIDTH_1); cb710_mmc_set_ios()
597 cb710_mmc_enable_irq(slot, CB710_MMC_IE_TEST_MASK, 0); cb710_mmc_set_ios()
602 struct cb710_slot *slot = cb710_mmc_to_slot(mmc); cb710_mmc_get_ro() local
604 return cb710_read_port_8(slot, CB710_MMC_STATUS3_PORT) cb710_mmc_get_ro()
610 struct cb710_slot *slot = cb710_mmc_to_slot(mmc); cb710_mmc_get_cd() local
612 return cb710_read_port_8(slot, CB710_MMC_STATUS3_PORT) cb710_mmc_get_cd()
616 static int cb710_mmc_irq_handler(struct cb710_slot *slot) cb710_mmc_irq_handler() argument
618 struct mmc_host *mmc = cb710_slot_to_mmc(slot); cb710_mmc_irq_handler()
622 status = cb710_read_port_32(slot, CB710_MMC_STATUS_PORT); cb710_mmc_irq_handler()
623 irqen = cb710_read_port_32(slot, CB710_MMC_IRQ_ENABLE_PORT); cb710_mmc_irq_handler()
624 config2 = cb710_read_port_32(slot, CB710_MMC_CONFIGB_PORT); cb710_mmc_irq_handler()
625 config1 = cb710_read_port_32(slot, CB710_MMC_CONFIG_PORT); cb710_mmc_irq_handler()
627 dev_dbg(cb710_slot_dev(slot), "interrupt; status: %08X, " cb710_mmc_irq_handler()
633 cb710_write_port_8(slot, CB710_MMC_STATUS1_PORT, cb710_mmc_irq_handler()
639 dev_dbg(cb710_slot_dev(slot), "unknown interrupt (test)\n"); cb710_mmc_irq_handler()
641 __cb710_mmc_enable_irq(slot, 0, CB710_MMC_IE_TEST_MASK); cb710_mmc_irq_handler()
669 struct cb710_slot *slot = cb710_pdev_to_slot(pdev); cb710_mmc_suspend() local
671 cb710_mmc_enable_irq(slot, 0, ~0); cb710_mmc_suspend()
677 struct cb710_slot *slot = cb710_pdev_to_slot(pdev); cb710_mmc_resume() local
679 cb710_mmc_enable_irq(slot, 0, ~0); cb710_mmc_resume()
687 struct cb710_slot *slot = cb710_pdev_to_slot(pdev); cb710_mmc_init() local
688 struct cb710_chip *chip = cb710_slot_to_chip(slot); cb710_mmc_init()
694 mmc = mmc_alloc_host(sizeof(*reader), cb710_slot_dev(slot)); cb710_mmc_init()
703 dev_dbg(cb710_slot_dev(slot), "source frequency: %dMHz\n", val); cb710_mmc_init()
719 cb710_mmc_enable_irq(slot, 0, ~0); cb710_mmc_init()
720 cb710_set_irq_handler(slot, cb710_mmc_irq_handler); cb710_mmc_init()
726 dev_dbg(cb710_slot_dev(slot), "mmc_hostname is %s\n", cb710_mmc_init()
729 cb710_mmc_enable_irq(slot, CB710_MMC_IE_CARD_INSERTION_STATUS, 0); cb710_mmc_init()
734 dev_dbg(cb710_slot_dev(slot), "mmc_add_host() failed: %d\n", err); cb710_mmc_init()
736 cb710_set_irq_handler(slot, NULL); cb710_mmc_init()
743 struct cb710_slot *slot = cb710_pdev_to_slot(pdev); cb710_mmc_exit() local
744 struct mmc_host *mmc = cb710_slot_to_mmc(slot); cb710_mmc_exit()
747 cb710_mmc_enable_irq(slot, 0, CB710_MMC_IE_CARD_INSERTION_STATUS); cb710_mmc_exit()
752 cb710_mmc_enable_irq(slot, 0, ~0); cb710_mmc_exit()
753 cb710_set_irq_handler(slot, NULL); cb710_mmc_exit()
756 cb710_write_port_32(slot, CB710_MMC_CONFIG_PORT, 0); cb710_mmc_exit()
757 cb710_write_port_16(slot, CB710_MMC_CONFIGB_PORT, 0); cb710_mmc_exit()
H A Dsdhci-pci-core.c28 #include <linux/mmc/slot-gpio.h>
49 static int ricoh_mmc_probe_slot(struct sdhci_pci_slot *slot) ricoh_mmc_probe_slot() argument
51 slot->host->caps = ricoh_mmc_probe_slot()
112 static int mrst_hc_probe_slot(struct sdhci_pci_slot *slot) mrst_hc_probe_slot() argument
114 slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA; mrst_hc_probe_slot()
132 static int pch_hc_probe_slot(struct sdhci_pci_slot *slot) pch_hc_probe_slot() argument
134 slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA; pch_hc_probe_slot()
142 struct sdhci_pci_slot *slot = dev_id; sdhci_pci_sd_cd() local
143 struct sdhci_host *host = slot->host; sdhci_pci_sd_cd()
149 static void sdhci_pci_add_own_cd(struct sdhci_pci_slot *slot) sdhci_pci_add_own_cd() argument
151 int err, irq, gpio = slot->cd_gpio; sdhci_pci_add_own_cd()
153 slot->cd_gpio = -EINVAL; sdhci_pci_add_own_cd()
154 slot->cd_irq = -EINVAL; sdhci_pci_add_own_cd()
172 IRQF_TRIGGER_FALLING, "sd_cd", slot); sdhci_pci_add_own_cd()
176 slot->cd_gpio = gpio; sdhci_pci_add_own_cd()
177 slot->cd_irq = irq; sdhci_pci_add_own_cd()
184 dev_warn(&slot->chip->pdev->dev, "failed to setup card detect wake up\n"); sdhci_pci_add_own_cd()
187 static void sdhci_pci_remove_own_cd(struct sdhci_pci_slot *slot) sdhci_pci_remove_own_cd() argument
189 if (slot->cd_irq >= 0) sdhci_pci_remove_own_cd()
190 free_irq(slot->cd_irq, slot); sdhci_pci_remove_own_cd()
191 if (gpio_is_valid(slot->cd_gpio)) sdhci_pci_remove_own_cd()
192 gpio_free(slot->cd_gpio); sdhci_pci_remove_own_cd()
197 static inline void sdhci_pci_add_own_cd(struct sdhci_pci_slot *slot) sdhci_pci_add_own_cd() argument
201 static inline void sdhci_pci_remove_own_cd(struct sdhci_pci_slot *slot) sdhci_pci_remove_own_cd() argument
207 static int mfd_emmc_probe_slot(struct sdhci_pci_slot *slot) mfd_emmc_probe_slot() argument
209 slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE; mfd_emmc_probe_slot()
210 slot->host->mmc->caps2 |= MMC_CAP2_BOOTPART_NOACC | mfd_emmc_probe_slot()
215 static int mfd_sdio_probe_slot(struct sdhci_pci_slot *slot) mfd_sdio_probe_slot() argument
217 slot->host->mmc->caps |= MMC_CAP_POWER_OFF_CARD | MMC_CAP_NONREMOVABLE; mfd_sdio_probe_slot()
360 static int byt_emmc_probe_slot(struct sdhci_pci_slot *slot) byt_emmc_probe_slot() argument
362 slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE | byt_emmc_probe_slot()
365 slot->host->mmc->caps2 |= MMC_CAP2_HC_ERASE_SZ; byt_emmc_probe_slot()
366 slot->hw_reset = sdhci_pci_int_hw_reset; byt_emmc_probe_slot()
367 if (slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_BSW_EMMC) byt_emmc_probe_slot()
368 slot->host->timeout_clk = 1000; /* 1000 kHz i.e. 1 MHz */ byt_emmc_probe_slot()
369 if (slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_SPT_EMMC) { byt_emmc_probe_slot()
370 spt_read_drive_strength(slot->host); byt_emmc_probe_slot()
371 slot->select_drive_strength = spt_select_drive_strength; byt_emmc_probe_slot()
376 static int byt_sdio_probe_slot(struct sdhci_pci_slot *slot) byt_sdio_probe_slot() argument
378 slot->host->mmc->caps |= MMC_CAP_POWER_OFF_CARD | MMC_CAP_NONREMOVABLE | byt_sdio_probe_slot()
383 static int byt_sd_probe_slot(struct sdhci_pci_slot *slot) byt_sd_probe_slot() argument
385 slot->host->mmc->caps |= MMC_CAP_WAIT_WHILE_BUSY; byt_sd_probe_slot()
386 slot->cd_con_id = NULL; byt_sd_probe_slot()
387 slot->cd_idx = 0; byt_sd_probe_slot()
388 slot->cd_override_level = true; byt_sd_probe_slot()
389 if (slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_BXT_SD || byt_sd_probe_slot()
390 slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_BXTM_SD || byt_sd_probe_slot()
391 slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_APL_SD) byt_sd_probe_slot()
392 slot->host->mmc_host_ops.get_cd = bxt_get_cd; byt_sd_probe_slot()
428 static int intel_mrfl_mmc_probe_slot(struct sdhci_pci_slot *slot) intel_mrfl_mmc_probe_slot() argument
430 if ((PCI_FUNC(slot->chip->pdev->devfn) != INTEL_MRFL_EMMC_0) && intel_mrfl_mmc_probe_slot()
431 (PCI_FUNC(slot->chip->pdev->devfn) != INTEL_MRFL_EMMC_1)) intel_mrfl_mmc_probe_slot()
435 slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE | intel_mrfl_mmc_probe_slot()
561 static int jmicron_probe_slot(struct sdhci_pci_slot *slot) jmicron_probe_slot() argument
563 if (slot->chip->pdev->revision == 0) { jmicron_probe_slot()
566 version = readl(slot->host->ioaddr + SDHCI_HOST_VERSION); jmicron_probe_slot()
576 slot->host->quirks |= SDHCI_QUIRK_BROKEN_ADMA; jmicron_probe_slot()
580 if (slot->chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB388_ESD) { jmicron_probe_slot()
581 slot->host->ocr_avail_sd = MMC_VDD_32_33 | MMC_VDD_33_34 | jmicron_probe_slot()
584 slot->host->ocr_avail_mmc = MMC_VDD_32_33 | MMC_VDD_33_34 | jmicron_probe_slot()
592 if (slot->chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB38X_MMC || jmicron_probe_slot()
593 slot->chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB388_ESD) jmicron_probe_slot()
594 jmicron_enable_mmc(slot->host, 1); jmicron_probe_slot()
596 slot->host->mmc->caps |= MMC_CAP_BUS_WIDTH_TEST; jmicron_probe_slot()
601 static void jmicron_remove_slot(struct sdhci_pci_slot *slot, int dead) jmicron_remove_slot() argument
606 if (slot->chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB38X_MMC || jmicron_remove_slot()
607 slot->chip->pdev->device == PCI_DEVICE_ID_JMICRON_JMB388_ESD) jmicron_remove_slot()
608 jmicron_enable_mmc(slot->host, 0); jmicron_remove_slot()
689 static int syskt_probe_slot(struct sdhci_pci_slot *slot) syskt_probe_slot() argument
693 u8 board_rev = readb(slot->host->ioaddr + SYSKT_BOARD_REV); syskt_probe_slot()
694 u8 chip_rev = readb(slot->host->ioaddr + SYSKT_CHIP_REV); syskt_probe_slot()
695 dev_info(&slot->chip->pdev->dev, "SysKonnect CardBus2SDIO, " syskt_probe_slot()
700 slot->host->quirks |= SDHCI_QUIRK_FORCE_DMA; syskt_probe_slot()
702 writeb(SYSKT_POWER_330, slot->host->ioaddr + SYSKT_POWER_DATA); syskt_probe_slot()
703 writeb(SYSKT_POWER_START, slot->host->ioaddr + SYSKT_POWER_CMD); syskt_probe_slot()
707 ps = readw(slot->host->ioaddr + SYSKT_POWER_STATUS); syskt_probe_slot()
713 dev_err(&slot->chip->pdev->dev, syskt_probe_slot()
715 writeb(0, slot->host->ioaddr + SYSKT_POWER_CMD); syskt_probe_slot()
740 static int rtsx_probe_slot(struct sdhci_pci_slot *slot) rtsx_probe_slot() argument
742 slot->host->mmc->caps2 |= MMC_CAP2_HS200; rtsx_probe_slot()
1325 struct sdhci_pci_slot *slot; sdhci_pci_enable_dma() local
1329 slot = sdhci_priv(host); sdhci_pci_enable_dma()
1330 pdev = slot->chip->pdev; sdhci_pci_enable_dma()
1383 struct sdhci_pci_slot *slot = sdhci_priv(host); sdhci_pci_gpio_hw_reset() local
1384 int rst_n_gpio = slot->rst_n_gpio; sdhci_pci_gpio_hw_reset()
1398 struct sdhci_pci_slot *slot = sdhci_priv(host); sdhci_pci_hw_reset() local
1400 if (slot->hw_reset) sdhci_pci_hw_reset()
1401 slot->hw_reset(host); sdhci_pci_hw_reset()
1409 struct sdhci_pci_slot *slot = sdhci_priv(host); sdhci_pci_select_drive_strength() local
1411 if (!slot->select_drive_strength) sdhci_pci_select_drive_strength()
1414 return slot->select_drive_strength(host, card, max_dtr, host_drv, sdhci_pci_select_drive_strength()
1440 struct sdhci_pci_slot *slot; sdhci_pci_suspend() local
1450 slot = chip->slots[i]; sdhci_pci_suspend()
1451 if (!slot) sdhci_pci_suspend()
1454 ret = sdhci_suspend_host(slot->host); sdhci_pci_suspend()
1459 slot_pm_flags = slot->host->mmc->pm_flags; sdhci_pci_suspend()
1461 sdhci_enable_irq_wakeups(slot->host); sdhci_pci_suspend()
1492 struct sdhci_pci_slot *slot; sdhci_pci_resume() local
1506 slot = chip->slots[i]; sdhci_pci_resume()
1507 if (!slot) sdhci_pci_resume()
1510 ret = sdhci_resume_host(slot->host); sdhci_pci_resume()
1522 struct sdhci_pci_slot *slot; sdhci_pci_runtime_suspend() local
1530 slot = chip->slots[i]; sdhci_pci_runtime_suspend()
1531 if (!slot) sdhci_pci_runtime_suspend()
1534 ret = sdhci_runtime_suspend_host(slot->host); sdhci_pci_runtime_suspend()
1558 struct sdhci_pci_slot *slot; sdhci_pci_runtime_resume() local
1572 slot = chip->slots[i]; sdhci_pci_runtime_resume()
1573 if (!slot) sdhci_pci_runtime_resume()
1576 ret = sdhci_runtime_resume_host(slot->host); sdhci_pci_runtime_resume()
1608 struct sdhci_pci_slot *slot; sdhci_pci_probe_slot() local
1638 slot = sdhci_priv(host); sdhci_pci_probe_slot()
1640 slot->chip = chip; sdhci_pci_probe_slot()
1641 slot->host = host; sdhci_pci_probe_slot()
1642 slot->pci_bar = bar; sdhci_pci_probe_slot()
1643 slot->rst_n_gpio = -EINVAL; sdhci_pci_probe_slot()
1644 slot->cd_gpio = -EINVAL; sdhci_pci_probe_slot()
1645 slot->cd_idx = -1; sdhci_pci_probe_slot()
1649 slot->data = sdhci_pci_get_data(pdev, slotno); sdhci_pci_probe_slot()
1651 if (slot->data) { sdhci_pci_probe_slot()
1652 if (slot->data->setup) { sdhci_pci_probe_slot()
1653 ret = slot->data->setup(slot->data); sdhci_pci_probe_slot()
1659 slot->rst_n_gpio = slot->data->rst_n_gpio; sdhci_pci_probe_slot()
1660 slot->cd_gpio = slot->data->cd_gpio; sdhci_pci_probe_slot()
1684 ret = chip->fixes->probe_slot(slot); sdhci_pci_probe_slot()
1689 if (gpio_is_valid(slot->rst_n_gpio)) { sdhci_pci_probe_slot()
1690 if (!gpio_request(slot->rst_n_gpio, "eMMC_reset")) { sdhci_pci_probe_slot()
1691 gpio_direction_output(slot->rst_n_gpio, 1); sdhci_pci_probe_slot()
1692 slot->host->mmc->caps |= MMC_CAP_HW_RESET; sdhci_pci_probe_slot()
1693 slot->hw_reset = sdhci_pci_gpio_hw_reset; sdhci_pci_probe_slot()
1696 slot->rst_n_gpio = -EINVAL; sdhci_pci_probe_slot()
1704 if (slot->cd_idx >= 0 && sdhci_pci_probe_slot()
1705 mmc_gpiod_request_cd(host->mmc, slot->cd_con_id, slot->cd_idx, sdhci_pci_probe_slot()
1706 slot->cd_override_level, 0, NULL)) { sdhci_pci_probe_slot()
1708 slot->cd_idx = -1; sdhci_pci_probe_slot()
1715 sdhci_pci_add_own_cd(slot); sdhci_pci_probe_slot()
1720 * Note sdhci_pci_add_own_cd() sets slot->cd_gpio to -EINVAL on failure. sdhci_pci_probe_slot()
1723 !gpio_is_valid(slot->cd_gpio) && slot->cd_idx < 0) sdhci_pci_probe_slot()
1726 return slot; sdhci_pci_probe_slot()
1729 if (gpio_is_valid(slot->rst_n_gpio)) sdhci_pci_probe_slot()
1730 gpio_free(slot->rst_n_gpio); sdhci_pci_probe_slot()
1733 chip->fixes->remove_slot(slot, 0); sdhci_pci_probe_slot()
1742 if (slot->data && slot->data->cleanup) sdhci_pci_probe_slot()
1743 slot->data->cleanup(slot->data); sdhci_pci_probe_slot()
1751 static void sdhci_pci_remove_slot(struct sdhci_pci_slot *slot) sdhci_pci_remove_slot() argument
1756 sdhci_pci_remove_own_cd(slot); sdhci_pci_remove_slot()
1759 scratch = readl(slot->host->ioaddr + SDHCI_INT_STATUS); sdhci_pci_remove_slot()
1763 sdhci_remove_host(slot->host, dead); sdhci_pci_remove_slot()
1765 if (gpio_is_valid(slot->rst_n_gpio)) sdhci_pci_remove_slot()
1766 gpio_free(slot->rst_n_gpio); sdhci_pci_remove_slot()
1768 if (slot->chip->fixes && slot->chip->fixes->remove_slot) sdhci_pci_remove_slot()
1769 slot->chip->fixes->remove_slot(slot, dead); sdhci_pci_remove_slot()
1771 if (slot->data && slot->data->cleanup) sdhci_pci_remove_slot()
1772 slot->data->cleanup(slot->data); sdhci_pci_remove_slot()
1774 pci_release_region(slot->chip->pdev, slot->pci_bar); sdhci_pci_remove_slot()
1776 sdhci_free_host(slot->host); sdhci_pci_remove_slot()
1798 struct sdhci_pci_slot *slot; sdhci_pci_probe() local
1814 dev_dbg(&pdev->dev, "found %d slot(s)\n", slots); sdhci_pci_probe()
1861 slot = sdhci_pci_probe_slot(pdev, chip, first_bar, i); sdhci_pci_probe()
1862 if (IS_ERR(slot)) { sdhci_pci_probe()
1865 ret = PTR_ERR(slot); sdhci_pci_probe()
1869 chip->slots[i] = slot; sdhci_pci_probe()
H A Domap.c175 static void mmc_omap_fclk_offdelay(struct mmc_omap_slot *slot) mmc_omap_fclk_offdelay() argument
179 if (slot != NULL && slot->host->fclk_enabled && slot->fclk_freq > 0) { mmc_omap_fclk_offdelay()
180 tick_ns = DIV_ROUND_UP(NSEC_PER_SEC, slot->fclk_freq); mmc_omap_fclk_offdelay()
200 static void mmc_omap_select_slot(struct mmc_omap_slot *slot, int claimed) mmc_omap_select_slot() argument
202 struct mmc_omap_host *host = slot->host; mmc_omap_select_slot()
213 host->mmc = slot->mmc; mmc_omap_select_slot()
217 if (host->current_slot != slot || !claimed) mmc_omap_select_slot()
220 if (host->current_slot != slot) { mmc_omap_select_slot()
221 OMAP_MMC_WRITE(host, CON, slot->saved_con & 0xFC00); mmc_omap_select_slot()
223 host->pdata->switch_slot(mmc_dev(slot->mmc), slot->id); mmc_omap_select_slot()
224 host->current_slot = slot; mmc_omap_select_slot()
235 OMAP_MMC_WRITE(host, CON, slot->saved_con); mmc_omap_select_slot()
258 static void mmc_omap_release_slot(struct mmc_omap_slot *slot, int clk_enabled) mmc_omap_release_slot() argument
260 struct mmc_omap_host *host = slot->host; mmc_omap_release_slot()
264 BUG_ON(slot == NULL || host->mmc == NULL); mmc_omap_release_slot()
271 mmc_omap_fclk_offdelay(slot); mmc_omap_release_slot()
285 /* The current slot should not have a request in queue */ mmc_omap_release_slot()
301 int mmc_omap_cover_is_open(struct mmc_omap_slot *slot) mmc_omap_cover_is_open() argument
303 if (slot->pdata->get_cover_state) mmc_omap_cover_is_open()
304 return slot->pdata->get_cover_state(mmc_dev(slot->mmc), mmc_omap_cover_is_open()
305 slot->id); mmc_omap_cover_is_open()
314 struct mmc_omap_slot *slot = mmc_priv(mmc); mmc_omap_show_cover_switch() local
316 return sprintf(buf, "%s\n", mmc_omap_cover_is_open(slot) ? "open" : mmc_omap_show_cover_switch()
327 struct mmc_omap_slot *slot = mmc_priv(mmc); mmc_omap_show_slot_name() local
329 return sprintf(buf, "%s\n", slot->pdata->name); mmc_omap_show_slot_name()
434 struct mmc_omap_slot *slot = host->current_slot; mmc_omap_send_stop_work() local
438 tick_ns = DIV_ROUND_UP(NSEC_PER_SEC, slot->fclk_freq); mmc_omap_send_stop_work()
475 struct mmc_omap_slot *slot = host->current_slot; mmc_omap_send_abort() local
480 timeout = DIV_ROUND_UP(120 * USEC_PER_SEC, slot->fclk_freq); mmc_omap_send_abort()
793 struct mmc_omap_slot *slot = mmc_omap_irq() local
795 if (slot == NULL || mmc_omap_irq()
796 !mmc_omap_cover_is_open(slot)) mmc_omap_irq()
861 struct mmc_omap_slot *slot = host->slots[num]; omap_mmc_notify_cover_event() local
869 cover_open = mmc_omap_cover_is_open(slot); omap_mmc_notify_cover_event()
870 if (cover_open != slot->cover_open) { omap_mmc_notify_cover_event()
871 slot->cover_open = cover_open; omap_mmc_notify_cover_event()
872 sysfs_notify(&slot->mmc->class_dev.kobj, NULL, "cover_switch"); omap_mmc_notify_cover_event()
875 tasklet_hi_schedule(&slot->cover_tasklet); omap_mmc_notify_cover_event()
880 struct mmc_omap_slot *slot = (struct mmc_omap_slot *) arg; mmc_omap_cover_timer() local
881 tasklet_schedule(&slot->cover_tasklet); mmc_omap_cover_timer()
886 struct mmc_omap_slot *slot = (struct mmc_omap_slot *)param; mmc_omap_cover_handler() local
887 int cover_open = mmc_omap_cover_is_open(slot); mmc_omap_cover_handler()
889 mmc_detect_change(slot->mmc, 0); mmc_omap_cover_handler()
897 if (slot->mmc->card == NULL || !mmc_card_present(slot->mmc->card)) mmc_omap_cover_handler()
900 mod_timer(&slot->cover_timer, mmc_omap_cover_handler()
1086 struct mmc_omap_slot *slot = mmc_priv(mmc); mmc_omap_request() local
1087 struct mmc_omap_host *host = slot->host; mmc_omap_request()
1092 BUG_ON(slot->mrq != NULL); mmc_omap_request()
1093 slot->mrq = req; mmc_omap_request()
1099 mmc_omap_select_slot(slot, 1); mmc_omap_request()
1103 static void mmc_omap_set_power(struct mmc_omap_slot *slot, int power_on, mmc_omap_set_power() argument
1108 host = slot->host; mmc_omap_set_power()
1110 if (slot->pdata->set_power != NULL) mmc_omap_set_power()
1111 slot->pdata->set_power(mmc_dev(slot->mmc), slot->id, power_on, mmc_omap_set_power()
1128 struct mmc_omap_slot *slot = mmc_priv(mmc); mmc_omap_calc_divisor() local
1129 struct mmc_omap_host *host = slot->host; mmc_omap_calc_divisor()
1146 slot->fclk_freq = func_clk_rate / dsor; mmc_omap_calc_divisor()
1156 struct mmc_omap_slot *slot = mmc_priv(mmc); mmc_omap_set_ios() local
1157 struct mmc_omap_host *host = slot->host; mmc_omap_set_ios()
1161 mmc_omap_select_slot(slot, 0); mmc_omap_set_ios()
1165 if (ios->vdd != slot->vdd) mmc_omap_set_ios()
1166 slot->vdd = ios->vdd; mmc_omap_set_ios()
1171 mmc_omap_set_power(slot, 0, ios->vdd); mmc_omap_set_ios()
1175 mmc_omap_set_power(slot, 1, ios->vdd); mmc_omap_set_ios()
1184 if (slot->bus_mode != ios->bus_mode) { mmc_omap_set_ios()
1185 if (slot->pdata->set_bus_mode != NULL) mmc_omap_set_ios()
1186 slot->pdata->set_bus_mode(mmc_dev(mmc), slot->id, mmc_omap_set_ios()
1188 slot->bus_mode = ios->bus_mode; mmc_omap_set_ios()
1197 slot->saved_con = dsor; mmc_omap_set_ios()
1214 mmc_omap_release_slot(slot, clk_enabled); mmc_omap_set_ios()
1224 struct mmc_omap_slot *slot = NULL; mmc_omap_new_slot() local
1232 slot = mmc_priv(mmc); mmc_omap_new_slot()
1233 slot->host = host; mmc_omap_new_slot()
1234 slot->mmc = mmc; mmc_omap_new_slot()
1235 slot->id = id; mmc_omap_new_slot()
1236 slot->pdata = &host->pdata->slots[id]; mmc_omap_new_slot()
1238 host->slots[id] = slot; mmc_omap_new_slot()
1253 mmc->ocr_avail = slot->pdata->ocr_mask; mmc_omap_new_slot()
1265 if (slot->pdata->get_cover_state != NULL) { mmc_omap_new_slot()
1266 setup_timer(&slot->cover_timer, mmc_omap_cover_timer, mmc_omap_new_slot()
1267 (unsigned long)slot); mmc_omap_new_slot()
1268 tasklet_init(&slot->cover_tasklet, mmc_omap_cover_handler, mmc_omap_new_slot()
1269 (unsigned long)slot); mmc_omap_new_slot()
1276 if (slot->pdata->name != NULL) { mmc_omap_new_slot()
1283 if (slot->pdata->get_cover_state != NULL) { mmc_omap_new_slot()
1288 tasklet_schedule(&slot->cover_tasklet); mmc_omap_new_slot()
1294 if (slot->pdata->name != NULL) mmc_omap_new_slot()
1302 static void mmc_omap_remove_slot(struct mmc_omap_slot *slot) mmc_omap_remove_slot() argument
1304 struct mmc_host *mmc = slot->mmc; mmc_omap_remove_slot()
1306 if (slot->pdata->name != NULL) mmc_omap_remove_slot()
1308 if (slot->pdata->get_cover_state != NULL) mmc_omap_remove_slot()
1311 tasklet_kill(&slot->cover_tasklet); mmc_omap_remove_slot()
1312 del_timer_sync(&slot->cover_timer); mmc_omap_remove_slot()
1313 flush_workqueue(slot->host->mmc_omap_wq); mmc_omap_remove_slot()
H A Dsdhci-acpi.c42 #include <linux/mmc/slot-gpio.h>
75 const struct sdhci_acpi_slot *slot; member in struct:sdhci_acpi_host
83 return c->slot && (c->slot->flags & flag); sdhci_acpi_flag()
187 /* Platform specific code during emmc probe slot goes here */ sdhci_acpi_emmc_probe_slot()
208 /* Platform specific code during sdio probe slot goes here */ sdhci_acpi_sdio_probe_slot()
219 if (!c || !c->host || !c->slot) sdhci_acpi_sd_probe_slot()
224 /* Platform specific code during sd probe slot goes here */ sdhci_acpi_sd_probe_slot()
270 const struct sdhci_acpi_slot *slot; member in struct:sdhci_acpi_uid_slot
314 return u->slot; sdhci_acpi_get_slot()
316 return u->slot; sdhci_acpi_get_slot()
360 c->slot = sdhci_acpi_get_slot(hid, uid); sdhci_acpi_probe()
377 if (c->slot) { sdhci_acpi_probe()
378 if (c->slot->probe_slot) { sdhci_acpi_probe()
379 err = c->slot->probe_slot(pdev, hid, uid); sdhci_acpi_probe()
383 if (c->slot->chip) { sdhci_acpi_probe()
384 host->ops = c->slot->chip->ops; sdhci_acpi_probe()
385 host->quirks |= c->slot->chip->quirks; sdhci_acpi_probe()
386 host->quirks2 |= c->slot->chip->quirks2; sdhci_acpi_probe()
387 host->mmc->caps |= c->slot->chip->caps; sdhci_acpi_probe()
388 host->mmc->caps2 |= c->slot->chip->caps2; sdhci_acpi_probe()
389 host->mmc->pm_caps |= c->slot->chip->pm_caps; sdhci_acpi_probe()
391 host->quirks |= c->slot->quirks; sdhci_acpi_probe()
392 host->quirks2 |= c->slot->quirks2; sdhci_acpi_probe()
393 host->mmc->caps |= c->slot->caps; sdhci_acpi_probe()
394 host->mmc->caps2 |= c->slot->caps2; sdhci_acpi_probe()
395 host->mmc->pm_caps |= c->slot->pm_caps; sdhci_acpi_probe()
440 if (c->slot && c->slot->remove_slot) sdhci_acpi_remove()
441 c->slot->remove_slot(pdev); sdhci_acpi_remove()
H A Ddw_mmc.c40 #include <linux/mmc/slot-gpio.h>
112 struct dw_mci_slot *slot = s->private; dw_mci_req_show() local
119 spin_lock_bh(&slot->host->lock); dw_mci_req_show()
120 mrq = slot->mrq; dw_mci_req_show()
145 spin_unlock_bh(&slot->host->lock); dw_mci_req_show()
188 static void dw_mci_init_debugfs(struct dw_mci_slot *slot) dw_mci_init_debugfs() argument
190 struct mmc_host *mmc = slot->mmc; dw_mci_init_debugfs()
191 struct dw_mci *host = slot->host; dw_mci_init_debugfs()
204 node = debugfs_create_file("req", S_IRUSR, root, slot, dw_mci_init_debugfs()
226 dev_err(&mmc->class_dev, "failed to initialize debugfs for slot\n"); dw_mci_init_debugfs()
230 static void mci_send_cmd(struct dw_mci_slot *slot, u32 cmd, u32 arg);
235 struct dw_mci_slot *slot = mmc_priv(mmc); dw_mci_prepare_command() local
236 struct dw_mci *host = slot->host; dw_mci_prepare_command()
237 const struct dw_mci_drv_data *drv_data = slot->host->drv_data; dw_mci_prepare_command()
259 WARN_ON(slot->host->state != STATE_SENDING_CMD); dw_mci_prepare_command()
260 slot->host->state = STATE_SENDING_CMD11; dw_mci_prepare_command()
274 clk_en_a &= ~(SDMMC_CLKEN_LOW_PWR << slot->id); dw_mci_prepare_command()
276 mci_send_cmd(slot, SDMMC_CMD_UPD_CLK | dw_mci_prepare_command()
300 drv_data->prepare_command(slot->host, &cmdr); dw_mci_prepare_command()
828 struct dw_mci_slot *slot = mmc_priv(mmc); dw_mci_pre_req() local
831 if (!slot->host->use_dma || !data) dw_mci_pre_req()
839 if (dw_mci_pre_dma_transfer(slot->host, mrq->data, 1) < 0) dw_mci_pre_req()
847 struct dw_mci_slot *slot = mmc_priv(mmc); dw_mci_post_req() local
850 if (!slot->host->use_dma || !data) dw_mci_post_req()
854 dma_unmap_sg(slot->host->dev, dw_mci_post_req()
1058 static void mci_send_cmd(struct dw_mci_slot *slot, u32 cmd, u32 arg) mci_send_cmd() argument
1060 struct dw_mci *host = slot->host; mci_send_cmd()
1074 dev_err(&slot->mmc->class_dev, mci_send_cmd()
1079 static void dw_mci_setup_bus(struct dw_mci_slot *slot, bool force_clkinit) dw_mci_setup_bus() argument
1081 struct dw_mci *host = slot->host; dw_mci_setup_bus()
1082 unsigned int clock = slot->clock; dw_mci_setup_bus()
1093 mci_send_cmd(slot, sdmmc_cmd_bits, 0); dw_mci_setup_bus()
1105 if ((clock << div) != slot->__clk_old || force_clkinit) dw_mci_setup_bus()
1106 dev_info(&slot->mmc->class_dev, dw_mci_setup_bus()
1107 "Bus speed (slot %d) = %dHz (slot req %dHz, actual %dHZ div = %d)\n", dw_mci_setup_bus()
1108 slot->id, host->bus_hz, clock, dw_mci_setup_bus()
1117 mci_send_cmd(slot, sdmmc_cmd_bits, 0); dw_mci_setup_bus()
1123 mci_send_cmd(slot, sdmmc_cmd_bits, 0); dw_mci_setup_bus()
1126 clk_en_a = SDMMC_CLKEN_ENABLE << slot->id; dw_mci_setup_bus()
1127 if (!test_bit(DW_MMC_CARD_NO_LOW_PWR, &slot->flags)) dw_mci_setup_bus()
1128 clk_en_a |= SDMMC_CLKEN_LOW_PWR << slot->id; dw_mci_setup_bus()
1132 mci_send_cmd(slot, sdmmc_cmd_bits, 0); dw_mci_setup_bus()
1135 slot->__clk_old = clock << div; dw_mci_setup_bus()
1140 /* Set the current slot bus width */ dw_mci_setup_bus()
1141 mci_writel(host, CTYPE, (slot->ctype << slot->id)); dw_mci_setup_bus()
1145 struct dw_mci_slot *slot, __dw_mci_start_request()
1152 mrq = slot->mrq; __dw_mci_start_request()
1154 host->cur_slot = slot; __dw_mci_start_request()
1170 cmdflags = dw_mci_prepare_command(slot->mmc, cmd); __dw_mci_start_request()
1173 if (test_and_clear_bit(DW_MMC_CARD_NEED_INIT, &slot->flags)) __dw_mci_start_request()
1204 host->stop_cmdr = dw_mci_prepare_command(slot->mmc, mrq->stop); __dw_mci_start_request()
1210 struct dw_mci_slot *slot) dw_mci_start_request()
1212 struct mmc_request *mrq = slot->mrq; dw_mci_start_request()
1216 __dw_mci_start_request(host, slot, cmd); dw_mci_start_request()
1220 static void dw_mci_queue_request(struct dw_mci *host, struct dw_mci_slot *slot, dw_mci_queue_request() argument
1223 dev_vdbg(&slot->mmc->class_dev, "queue request: state=%d\n", dw_mci_queue_request()
1226 slot->mrq = mrq; dw_mci_queue_request()
1229 dev_warn(&slot->mmc->class_dev, dw_mci_queue_request()
1241 dw_mci_start_request(host, slot); dw_mci_queue_request()
1243 list_add_tail(&slot->queue_node, &host->queue); dw_mci_queue_request()
1249 struct dw_mci_slot *slot = mmc_priv(mmc); dw_mci_request() local
1250 struct dw_mci *host = slot->host; dw_mci_request()
1252 WARN_ON(slot->mrq); dw_mci_request()
1261 if (!test_bit(DW_MMC_CARD_PRESENT, &slot->flags)) { dw_mci_request()
1268 dw_mci_queue_request(host, slot, mrq); dw_mci_request()
1275 struct dw_mci_slot *slot = mmc_priv(mmc); dw_mci_set_ios() local
1276 const struct dw_mci_drv_data *drv_data = slot->host->drv_data; dw_mci_set_ios()
1282 slot->ctype = SDMMC_CTYPE_4BIT; dw_mci_set_ios()
1285 slot->ctype = SDMMC_CTYPE_8BIT; dw_mci_set_ios()
1289 slot->ctype = SDMMC_CTYPE_1BIT; dw_mci_set_ios()
1292 regs = mci_readl(slot->host, UHS_REG); dw_mci_set_ios()
1298 regs |= ((0x1 << slot->id) << 16); dw_mci_set_ios()
1300 regs &= ~((0x1 << slot->id) << 16); dw_mci_set_ios()
1302 mci_writel(slot->host, UHS_REG, regs); dw_mci_set_ios()
1303 slot->host->timing = ios->timing; dw_mci_set_ios()
1309 slot->clock = ios->clock; dw_mci_set_ios()
1312 drv_data->set_ios(slot->host, ios); dw_mci_set_ios()
1320 dev_err(slot->host->dev, dw_mci_set_ios()
1326 set_bit(DW_MMC_CARD_NEED_INIT, &slot->flags); dw_mci_set_ios()
1327 regs = mci_readl(slot->host, PWREN); dw_mci_set_ios()
1328 regs |= (1 << slot->id); dw_mci_set_ios()
1329 mci_writel(slot->host, PWREN, regs); dw_mci_set_ios()
1332 if (!slot->host->vqmmc_enabled) { dw_mci_set_ios()
1336 dev_err(slot->host->dev, dw_mci_set_ios()
1339 slot->host->vqmmc_enabled = true; dw_mci_set_ios()
1343 slot->host->vqmmc_enabled = true; dw_mci_set_ios()
1347 dw_mci_ctrl_reset(slot->host, dw_mci_set_ios()
1352 dw_mci_setup_bus(slot, false); dw_mci_set_ios()
1357 dw_mci_setup_bus(slot, false); dw_mci_set_ios()
1362 if (!IS_ERR(mmc->supply.vqmmc) && slot->host->vqmmc_enabled) dw_mci_set_ios()
1364 slot->host->vqmmc_enabled = false; dw_mci_set_ios()
1366 regs = mci_readl(slot->host, PWREN); dw_mci_set_ios()
1367 regs &= ~(1 << slot->id); dw_mci_set_ios()
1368 mci_writel(slot->host, PWREN, regs); dw_mci_set_ios()
1374 if (slot->host->state == STATE_WAITING_CMD11_DONE && ios->clock != 0) dw_mci_set_ios()
1375 slot->host->state = STATE_IDLE; dw_mci_set_ios()
1380 struct dw_mci_slot *slot = mmc_priv(mmc); dw_mci_card_busy() local
1387 status = mci_readl(slot->host, STATUS); dw_mci_card_busy()
1394 struct dw_mci_slot *slot = mmc_priv(mmc); dw_mci_switch_voltage() local
1395 struct dw_mci *host = slot->host; dw_mci_switch_voltage()
1398 u32 v18 = SDMMC_UHS_18V << slot->id; dw_mci_switch_voltage()
1433 struct dw_mci_slot *slot = mmc_priv(mmc); dw_mci_get_ro() local
1441 mci_readl(slot->host, WRTPRT) & (1 << slot->id) ? 1 : 0; dw_mci_get_ro()
1452 struct dw_mci_slot *slot = mmc_priv(mmc); dw_mci_get_cd() local
1453 struct dw_mci_board *brd = slot->host->pdata; dw_mci_get_cd()
1454 struct dw_mci *host = slot->host; dw_mci_get_cd()
1464 present = (mci_readl(slot->host, CDETECT) & (1 << slot->id)) dw_mci_get_cd()
1469 set_bit(DW_MMC_CARD_PRESENT, &slot->flags); dw_mci_get_cd()
1472 clear_bit(DW_MMC_CARD_PRESENT, &slot->flags); dw_mci_get_cd()
1482 struct dw_mci_slot *slot = mmc_priv(mmc); dw_mci_init_card() local
1483 struct dw_mci *host = slot->host; dw_mci_init_card()
1491 const u32 clken_low_pwr = SDMMC_CLKEN_LOW_PWR << slot->id; dw_mci_init_card()
1499 set_bit(DW_MMC_CARD_NO_LOW_PWR, &slot->flags); dw_mci_init_card()
1502 clear_bit(DW_MMC_CARD_NO_LOW_PWR, &slot->flags); dw_mci_init_card()
1508 mci_send_cmd(slot, SDMMC_CMD_UPD_CLK | dw_mci_init_card()
1516 struct dw_mci_slot *slot = mmc_priv(mmc); dw_mci_enable_sdio_irq() local
1517 struct dw_mci *host = slot->host; dw_mci_enable_sdio_irq()
1526 int_mask |= SDMMC_INT_SDIO(slot->sdio_id); dw_mci_enable_sdio_irq()
1528 int_mask &= ~SDMMC_INT_SDIO(slot->sdio_id); dw_mci_enable_sdio_irq()
1536 struct dw_mci_slot *slot = mmc_priv(mmc); dw_mci_execute_tuning() local
1537 struct dw_mci *host = slot->host; dw_mci_execute_tuning()
1542 err = drv_data->execute_tuning(slot, opcode); dw_mci_execute_tuning()
1549 struct dw_mci_slot *slot = mmc_priv(mmc); dw_mci_prepare_hs400_tuning() local
1550 struct dw_mci *host = slot->host; dw_mci_prepare_hs400_tuning()
1578 struct dw_mci_slot *slot; variable in typeref:struct:dw_mci_slot
1586 slot = list_entry(host->queue.next,
1588 list_del(&slot->queue_node);
1590 mmc_hostname(slot->mmc));
1592 dw_mci_start_request(host, slot);
2338 struct dw_mci_slot *slot = host->slot[i]; dw_mci_handle_cd() local
2340 if (!slot) dw_mci_handle_cd()
2343 if (slot->mmc->ops->card_event) dw_mci_handle_cd()
2344 slot->mmc->ops->card_event(slot->mmc); dw_mci_handle_cd()
2345 mmc_detect_change(slot->mmc, dw_mci_handle_cd()
2444 struct dw_mci_slot *slot = host->slot[i]; dw_mci_interrupt() local
2446 if (!slot) dw_mci_interrupt()
2449 if (pending & SDMMC_INT_SDIO(slot->sdio_id)) { dw_mci_interrupt()
2451 SDMMC_INT_SDIO(slot->sdio_id)); dw_mci_interrupt()
2452 mmc_signal_sdio_irq(slot->mmc); dw_mci_interrupt()
2484 /* given a slot, find out the device node representing that slot */ dw_mci_of_find_slot_node()
2485 static struct device_node *dw_mci_of_find_slot_node(struct dw_mci_slot *slot) dw_mci_of_find_slot_node() argument
2487 struct device *dev = slot->mmc->parent; dw_mci_of_find_slot_node()
2499 if (be32_to_cpup(addr) == slot->id) dw_mci_of_find_slot_node()
2505 static void dw_mci_slot_of_parse(struct dw_mci_slot *slot) dw_mci_slot_of_parse() argument
2507 struct device_node *np = dw_mci_of_find_slot_node(slot); dw_mci_slot_of_parse()
2513 slot->mmc->caps2 |= MMC_CAP2_NO_WRITE_PROTECT; dw_mci_slot_of_parse()
2514 dev_warn(slot->mmc->parent, dw_mci_slot_of_parse()
2519 static void dw_mci_slot_of_parse(struct dw_mci_slot *slot) dw_mci_slot_of_parse() argument
2527 struct dw_mci_slot *slot; dw_mci_init_slot() local
2536 slot = mmc_priv(mmc); dw_mci_init_slot()
2537 slot->id = id; dw_mci_init_slot()
2538 slot->sdio_id = host->sdio_id0 + id; dw_mci_init_slot()
2539 slot->mmc = mmc; dw_mci_init_slot()
2540 slot->host = host; dw_mci_init_slot()
2541 host->slot[id] = slot; dw_mci_init_slot()
2580 dw_mci_slot_of_parse(slot); dw_mci_init_slot()
2611 set_bit(DW_MMC_CARD_PRESENT, &slot->flags); dw_mci_init_slot()
2613 clear_bit(DW_MMC_CARD_PRESENT, &slot->flags); dw_mci_init_slot()
2620 dw_mci_init_debugfs(slot); dw_mci_init_slot()
2630 static void dw_mci_cleanup_slot(struct dw_mci_slot *slot, unsigned int id) dw_mci_cleanup_slot() argument
2633 mmc_remove_host(slot->mmc); dw_mci_cleanup_slot()
2634 slot->host->slot[id] = NULL; dw_mci_cleanup_slot()
2635 mmc_free_host(slot->mmc); dw_mci_cleanup_slot()
2886 "num-slots property not found, assuming 1 slot is available\n"); dw_mci_parse_dt()
2938 struct dw_mci_slot *slot = host->slot[i]; dw_mci_enable_cd() local
2940 if (IS_ERR_VALUE(mmc_gpio_get_cd(slot->mmc))) dw_mci_enable_cd()
3147 /* We need at least one slot to succeed */ dw_mci_probe()
3151 dev_dbg(host->dev, "slot %d init failed\n", i); dw_mci_probe()
3194 dev_dbg(host->dev, "remove slot %d\n", i); dw_mci_remove()
3195 if (host->slot[i]) dw_mci_remove()
3196 dw_mci_cleanup_slot(host->slot[i], i); dw_mci_remove()
3261 struct dw_mci_slot *slot = host->slot[i]; dw_mci_resume() local
3263 if (!slot) dw_mci_resume()
3265 if (slot->mmc->pm_flags & MMC_PM_KEEP_POWER) { dw_mci_resume()
3266 dw_mci_set_ios(slot->mmc, &slot->mmc->ios); dw_mci_resume()
3267 dw_mci_setup_bus(slot, true); dw_mci_resume()
1144 __dw_mci_start_request(struct dw_mci *host, struct dw_mci_slot *slot, struct mmc_command *cmd) __dw_mci_start_request() argument
1209 dw_mci_start_request(struct dw_mci *host, struct dw_mci_slot *slot) dw_mci_start_request() argument
H A Datmel-mci.c110 * @cur_slot: The slot which is currently using the controller.
143 * @slot: Slots sharing this MMC controller.
164 * and must always be written at the same time as the slot is added to
221 struct atmel_mci_slot *slot[ATMCI_MAX_NR_SLOTS]; member in struct:atmel_mci
231 * struct atmel_mci_slot - MMC slot state
232 * @mmc: The mmc_host representing this slot.
233 * @host: The MMC controller this slot is using.
234 * @sdc_reg: Value of SDCR to be written before using this slot.
235 * @sdio_irq: SDIO irq mask for this slot.
237 * processed, or NULL when the slot is idle.
241 * @flags: Random state bits associated with the slot.
285 struct atmel_mci_slot *slot = s->private; atmci_req_show() local
292 spin_lock_bh(&slot->host->lock); atmci_req_show()
293 mrq = slot->mrq; atmci_req_show()
318 spin_unlock_bh(&slot->host->lock); atmci_req_show()
473 static void atmci_init_debugfs(struct atmel_mci_slot *slot) atmci_init_debugfs() argument
475 struct mmc_host *mmc = slot->mmc; atmci_init_debugfs()
476 struct atmel_mci *host = slot->host; atmci_init_debugfs()
491 node = debugfs_create_file("req", S_IRUSR, root, slot, &atmci_req_fops); atmci_init_debugfs()
512 dev_err(&mmc->class_dev, "failed to initialize debugfs for slot\n"); atmci_init_debugfs()
556 &pdata->slot[slot_id].bus_width)) for_each_child_of_node()
557 pdata->slot[slot_id].bus_width = 1; for_each_child_of_node()
559 pdata->slot[slot_id].detect_pin = for_each_child_of_node()
562 pdata->slot[slot_id].detect_is_active_high = for_each_child_of_node()
565 pdata->slot[slot_id].non_removable = for_each_child_of_node()
568 pdata->slot[slot_id].wp_pin = for_each_child_of_node()
629 struct atmel_mci_slot *slot, struct mmc_data *data) atmci_set_timeout()
653 dev_vdbg(&slot->mmc->class_dev, "setting timeout to %u cycles\n", atmci_set_timeout()
1135 struct atmel_mci_slot *slot) atmci_start_request()
1143 mrq = slot->mrq; atmci_start_request()
1144 host->cur_slot = slot; atmci_start_request()
1165 atmci_writel(host, ATMCI_SDCR, slot->sdc_reg); atmci_start_request()
1169 dev_dbg(&slot->mmc->class_dev, "WARNING: IMR=0x%08x\n", atmci_start_request()
1172 if (unlikely(test_and_clear_bit(ATMCI_CARD_NEED_INIT, &slot->flags))) { atmci_start_request()
1181 atmci_set_timeout(host, slot, data); atmci_start_request()
1186 dev_vdbg(&slot->mmc->class_dev, "BLKR=0x%08x\n", atmci_start_request()
1194 cmdflags = atmci_prepare_command(slot->mmc, cmd); atmci_start_request()
1212 host->stop_cmdr = atmci_prepare_command(slot->mmc, mrq->stop); atmci_start_request()
1234 struct atmel_mci_slot *slot, struct mmc_request *mrq) atmci_queue_request()
1236 dev_vdbg(&slot->mmc->class_dev, "queue request: state=%d\n", atmci_queue_request()
1240 slot->mrq = mrq; atmci_queue_request()
1243 atmci_start_request(host, slot); atmci_queue_request()
1246 list_add_tail(&slot->queue_node, &host->queue); atmci_queue_request()
1253 struct atmel_mci_slot *slot = mmc_priv(mmc); atmci_request() local
1254 struct atmel_mci *host = slot->host; atmci_request()
1257 WARN_ON(slot->mrq); atmci_request()
1270 if (!test_bit(ATMCI_CARD_PRESENT, &slot->flags)) { atmci_request()
1283 atmci_queue_request(host, slot, mrq); atmci_request()
1288 struct atmel_mci_slot *slot = mmc_priv(mmc); atmci_set_ios() local
1289 struct atmel_mci *host = slot->host; atmci_set_ios()
1294 slot->sdc_reg &= ~ATMCI_SDCBUS_MASK; atmci_set_ios()
1297 slot->sdc_reg |= ATMCI_SDCBUS_1BIT; atmci_set_ios()
1300 slot->sdc_reg |= ATMCI_SDCBUS_4BIT; atmci_set_ios()
1320 slot->clock = ios->clock; atmci_set_ios()
1322 if (host->slot[i] && host->slot[i]->clock atmci_set_ios()
1323 && host->slot[i]->clock < clock_min) atmci_set_ios()
1324 clock_min = host->slot[i]->clock; atmci_set_ios()
1383 slot->clock = 0; atmci_set_ios()
1385 if (host->slot[i] && host->slot[i]->clock) { atmci_set_ios()
1406 set_bit(ATMCI_CARD_NEED_INIT, &slot->flags); atmci_set_ios()
1433 struct atmel_mci_slot *slot = mmc_priv(mmc); atmci_get_ro() local
1435 if (gpio_is_valid(slot->wp_pin)) { atmci_get_ro()
1436 read_only = gpio_get_value(slot->wp_pin); atmci_get_ro()
1447 struct atmel_mci_slot *slot = mmc_priv(mmc); atmci_get_cd() local
1449 if (gpio_is_valid(slot->detect_pin)) { atmci_get_cd()
1450 present = !(gpio_get_value(slot->detect_pin) ^ atmci_get_cd()
1451 slot->detect_is_active_high); atmci_get_cd()
1461 struct atmel_mci_slot *slot = mmc_priv(mmc); atmci_enable_sdio_irq() local
1462 struct atmel_mci *host = slot->host; atmci_enable_sdio_irq()
1465 atmci_writel(host, ATMCI_IER, slot->sdio_irq); atmci_enable_sdio_irq()
1467 atmci_writel(host, ATMCI_IDR, slot->sdio_irq); atmci_enable_sdio_irq()
1483 struct atmel_mci_slot *slot = NULL; variable in typeref:struct:atmel_mci_slot
1490 * necessary if set_ios() is called when a different slot is
1502 slot = list_entry(host->queue.next,
1504 list_del(&slot->queue_node);
1506 mmc_hostname(slot->mmc));
1508 atmci_start_request(host, slot);
1552 struct atmel_mci_slot *slot = (struct atmel_mci_slot *)data; atmci_detect_change() local
1563 if (test_bit(ATMCI_SHUTDOWN, &slot->flags)) atmci_detect_change()
1566 enable_irq(gpio_to_irq(slot->detect_pin)); atmci_detect_change()
1567 present = !(gpio_get_value(slot->detect_pin) ^ atmci_detect_change()
1568 slot->detect_is_active_high); atmci_detect_change()
1569 present_old = test_bit(ATMCI_CARD_PRESENT, &slot->flags); atmci_detect_change()
1571 dev_vdbg(&slot->mmc->class_dev, "detect change: %d (was %d)\n", atmci_detect_change()
1575 struct atmel_mci *host = slot->host; atmci_detect_change()
1578 dev_dbg(&slot->mmc->class_dev, "card %s\n", atmci_detect_change()
1584 clear_bit(ATMCI_CARD_PRESENT, &slot->flags); atmci_detect_change()
1586 set_bit(ATMCI_CARD_PRESENT, &slot->flags); atmci_detect_change()
1589 mrq = slot->mrq; atmci_detect_change()
1629 list_del(&slot->queue_node); atmci_detect_change()
1637 mmc_request_done(slot->mmc, mrq); atmci_detect_change()
1643 mmc_detect_change(slot->mmc, 0); atmci_detect_change()
1996 struct atmel_mci_slot *slot = host->slot[i]; atmci_sdio_interrupt() local
1997 if (slot && (status & slot->sdio_irq)) { atmci_sdio_interrupt()
1998 mmc_signal_sdio_irq(slot->mmc); atmci_sdio_interrupt()
2134 struct atmel_mci_slot *slot = dev_id; atmci_detect_interrupt() local
2142 mod_timer(&slot->detect_timer, jiffies + msecs_to_jiffies(20)); atmci_detect_interrupt()
2152 struct atmel_mci_slot *slot; atmci_init_slot() local
2158 slot = mmc_priv(mmc); atmci_init_slot()
2159 slot->mmc = mmc; atmci_init_slot()
2160 slot->host = host; atmci_init_slot()
2161 slot->detect_pin = slot_data->detect_pin; atmci_init_slot()
2162 slot->wp_pin = slot_data->wp_pin; atmci_init_slot()
2163 slot->detect_is_active_high = slot_data->detect_is_active_high; atmci_init_slot()
2164 slot->sdc_reg = sdc_reg; atmci_init_slot()
2165 slot->sdio_irq = sdio_irq; atmci_init_slot()
2168 "slot[%u]: bus_width=%u, detect_pin=%d, " atmci_init_slot()
2204 set_bit(ATMCI_CARD_PRESENT, &slot->flags); atmci_init_slot()
2205 if (gpio_is_valid(slot->detect_pin)) { atmci_init_slot()
2206 if (devm_gpio_request(&host->pdev->dev, slot->detect_pin, atmci_init_slot()
2209 slot->detect_pin = -EBUSY; atmci_init_slot()
2210 } else if (gpio_get_value(slot->detect_pin) ^ atmci_init_slot()
2211 slot->detect_is_active_high) { atmci_init_slot()
2212 clear_bit(ATMCI_CARD_PRESENT, &slot->flags); atmci_init_slot()
2216 if (!gpio_is_valid(slot->detect_pin)) { atmci_init_slot()
2223 if (gpio_is_valid(slot->wp_pin)) { atmci_init_slot()
2224 if (devm_gpio_request(&host->pdev->dev, slot->wp_pin, atmci_init_slot()
2227 slot->wp_pin = -EBUSY; atmci_init_slot()
2231 host->slot[id] = slot; atmci_init_slot()
2235 if (gpio_is_valid(slot->detect_pin)) { atmci_init_slot()
2238 setup_timer(&slot->detect_timer, atmci_detect_change, atmci_init_slot()
2239 (unsigned long)slot); atmci_init_slot()
2241 ret = request_irq(gpio_to_irq(slot->detect_pin), atmci_init_slot()
2244 "mmc-detect", slot); atmci_init_slot()
2248 gpio_to_irq(slot->detect_pin)); atmci_init_slot()
2249 slot->detect_pin = -EBUSY; atmci_init_slot()
2253 atmci_init_debugfs(slot); atmci_init_slot()
2258 static void atmci_cleanup_slot(struct atmel_mci_slot *slot, atmci_cleanup_slot() argument
2263 set_bit(ATMCI_SHUTDOWN, &slot->flags); atmci_cleanup_slot()
2266 mmc_remove_host(slot->mmc); atmci_cleanup_slot()
2268 if (gpio_is_valid(slot->detect_pin)) { atmci_cleanup_slot()
2269 int pin = slot->detect_pin; atmci_cleanup_slot()
2271 free_irq(gpio_to_irq(pin), slot); atmci_cleanup_slot() local
2272 del_timer_sync(&slot->detect_timer); atmci_cleanup_slot()
2275 slot->host->slot[id] = NULL; atmci_cleanup_slot()
2276 mmc_free_host(slot->mmc); atmci_cleanup_slot()
2443 /* We need at least one slot to succeed */ atmci_probe()
2446 if (pdata->slot[0].bus_width) { atmci_probe()
2447 ret = atmci_init_slot(host, &pdata->slot[0], atmci_probe()
2451 host->buf_size = host->slot[0]->mmc->max_req_size; atmci_probe()
2454 if (pdata->slot[1].bus_width) { atmci_probe()
2455 ret = atmci_init_slot(host, &pdata->slot[1], atmci_probe()
2459 if (host->slot[1]->mmc->max_req_size > host->buf_size) atmci_probe()
2461 host->slot[1]->mmc->max_req_size; atmci_probe()
2466 dev_err(&pdev->dev, "init failed: no slot defined\n"); atmci_probe()
2492 if (host->slot[i]) atmci_probe()
2493 atmci_cleanup_slot(host->slot[i], i); atmci_probe()
2521 if (host->slot[i]) atmci_remove()
2522 atmci_cleanup_slot(host->slot[i], i); atmci_remove()
628 atmci_set_timeout(struct atmel_mci *host, struct atmel_mci_slot *slot, struct mmc_data *data) atmci_set_timeout() argument
1134 atmci_start_request(struct atmel_mci *host, struct atmel_mci_slot *slot) atmci_start_request() argument
1233 atmci_queue_request(struct atmel_mci *host, struct atmel_mci_slot *slot, struct mmc_request *mrq) atmci_queue_request() argument
/linux-4.4.14/drivers/xen/xen-pciback/
H A Dvpci.c71 int err = 0, slot, func = -1; __xen_pcibk_add_pci_dev() local
99 for (slot = 0; slot < PCI_SLOT_MAX; slot++) { __xen_pcibk_add_pci_dev()
100 if (list_empty(&vpci_dev->dev_list[slot])) __xen_pcibk_add_pci_dev()
103 t = list_entry(list_first(&vpci_dev->dev_list[slot]), __xen_pcibk_add_pci_dev()
107 pr_info("vpci: %s: assign to virtual slot %d func %d\n", __xen_pcibk_add_pci_dev()
108 pci_name(dev), slot, __xen_pcibk_add_pci_dev()
111 &vpci_dev->dev_list[slot]); __xen_pcibk_add_pci_dev()
118 /* Assign to a new slot on the virtual PCI bus */ __xen_pcibk_add_pci_dev()
119 for (slot = 0; slot < PCI_SLOT_MAX; slot++) { __xen_pcibk_add_pci_dev()
120 if (list_empty(&vpci_dev->dev_list[slot])) { __xen_pcibk_add_pci_dev()
121 pr_info("vpci: %s: assign to virtual slot %d\n", __xen_pcibk_add_pci_dev()
122 pci_name(dev), slot); __xen_pcibk_add_pci_dev()
124 &vpci_dev->dev_list[slot]); __xen_pcibk_add_pci_dev()
139 err = publish_cb(pdev, 0, 0, PCI_DEVFN(slot, func), devid); __xen_pcibk_add_pci_dev()
150 int slot; __xen_pcibk_release_pci_dev() local
156 for (slot = 0; slot < PCI_SLOT_MAX; slot++) { __xen_pcibk_release_pci_dev()
159 list_for_each_entry(e, &vpci_dev->dev_list[slot], list) { __xen_pcibk_release_pci_dev()
183 int slot; __xen_pcibk_init_devices() local
192 for (slot = 0; slot < PCI_SLOT_MAX; slot++) __xen_pcibk_init_devices()
193 INIT_LIST_HEAD(&vpci_dev->dev_list[slot]); __xen_pcibk_init_devices()
209 int slot; __xen_pcibk_release_devices() local
212 for (slot = 0; slot < PCI_SLOT_MAX; slot++) { __xen_pcibk_release_devices()
214 list_for_each_entry_safe(e, tmp, &vpci_dev->dev_list[slot], __xen_pcibk_release_devices()
237 int found = 0, slot; __xen_pcibk_get_pcifront_dev() local
240 for (slot = 0; slot < PCI_SLOT_MAX; slot++) { __xen_pcibk_get_pcifront_dev()
242 &vpci_dev->dev_list[slot], __xen_pcibk_get_pcifront_dev()
252 *devfn = PCI_DEVFN(slot, __xen_pcibk_get_pcifront_dev()
/linux-4.4.14/arch/alpha/kernel/
H A Dsys_sx164.c72 * 8 Interrupt Line A from slot 3
73 * 9 Interrupt Line A from slot 2
74 *10 Interrupt Line A from slot 1
75 *11 Interrupt Line A from slot 0
76 *12 Interrupt Line B from slot 3
77 *13 Interrupt Line B from slot 2
78 *14 Interrupt Line B from slot 1
79 *15 Interrupt line B from slot 0
80 *16 Interrupt Line C from slot 3
81 *17 Interrupt Line C from slot 2
82 *18 Interrupt Line C from slot 1
83 *19 Interrupt Line C from slot 0
84 *20 Interrupt Line D from slot 3
85 *21 Interrupt Line D from slot 2
86 *22 Interrupt Line D from slot 1
87 *23 Interrupt Line D from slot 0
90 * 5 32 bit PCI option slot 2
91 * 6 64 bit PCI option slot 0
92 * 7 64 bit PCI option slot 1
94 * 9 32 bit PCI option slot 3
98 sx164_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) sx164_map_irq() argument
102 { 16+ 9, 16+ 9, 16+13, 16+17, 16+21}, /* IdSel 5 slot 2 J17 */ sx164_map_irq()
103 { 16+11, 16+11, 16+15, 16+19, 16+23}, /* IdSel 6 slot 0 J19 */ sx164_map_irq()
104 { 16+10, 16+10, 16+14, 16+18, 16+22}, /* IdSel 7 slot 1 J18 */ sx164_map_irq()
106 { 16+ 8, 16+ 8, 16+12, 16+16, 16+20} /* IdSel 9 slot 3 J15 */ sx164_map_irq()
H A Dsys_noritake.c147 * 2 Interrupt Line A from slot 0
148 * 3 Interrupt Line B from slot 0
149 * 4 Interrupt Line A from slot 1
150 * 5 Interrupt line B from slot 1
151 * 6 Interrupt Line A from slot 2
152 * 7 Interrupt Line B from slot 2
153 * 8 Interrupt Line A from slot 3
154 * 9 Interrupt Line B from slot 3
155 *10 Interrupt Line A from slot 4
156 *11 Interrupt Line B from slot 4
157 *12 Interrupt Line A from slot 5
158 *13 Interrupt Line B from slot 5
159 *14 Interrupt Line A from slot 6
160 *15 Interrupt Line B from slot 6
166 * 2 Interrupt Line C from slot 0
167 * 3 Interrupt Line D from slot 0
168 * 4 Interrupt Line C from slot 1
169 * 5 Interrupt line D from slot 1
170 * 6 Interrupt Line C from slot 2
171 * 7 Interrupt Line D from slot 2
172 * 8 Interrupt Line C from slot 3
173 * 9 Interrupt Line D from slot 3
174 *10 Interrupt Line C from slot 4
175 *11 Interrupt Line D from slot 4
176 *12 Interrupt Line C from slot 5
177 *13 Interrupt Line D from slot 5
178 *14 Interrupt Line C from slot 6
179 *15 Interrupt Line D from slot 6
181 * The device to slot mapping looks like:
186 * 11 PCI on board slot 0
187 * 12 PCI on board slot 1
188 * 13 PCI on board slot 2
197 noritake_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) noritake_map_irq() argument
208 { 16+2, 16+2, 16+3, 32+2, 32+3}, /* IdSel 22, slot 0 */ noritake_map_irq()
209 { 16+4, 16+4, 16+5, 32+4, 32+5}, /* IdSel 23, slot 1 */ noritake_map_irq()
210 { 16+6, 16+6, 16+7, 32+6, 32+7}, /* IdSel 24, slot 2 */ noritake_map_irq()
211 { 16+8, 16+8, 16+9, 32+8, 32+9}, /* IdSel 25, slot 3 */ noritake_map_irq()
215 { 16+8, 16+8, 16+9, 32+8, 32+9}, /* IdSel 17, slot 3 */ noritake_map_irq()
216 {16+10, 16+10, 16+11, 32+10, 32+11}, /* IdSel 18, slot 4 */ noritake_map_irq()
217 {16+12, 16+12, 16+13, 32+12, 32+13}, /* IdSel 19, slot 5 */ noritake_map_irq()
218 {16+14, 16+14, 16+15, 32+14, 32+15}, /* IdSel 20, slot 6 */ noritake_map_irq()
227 int slot, pin = *pinp; noritake_swizzle() local
230 slot = PCI_SLOT(dev->devfn); noritake_swizzle()
234 slot = PCI_SLOT(dev->devfn) + 15; /* WAG! */ noritake_swizzle()
241 slot = PCI_SLOT(dev->devfn) + 15; noritake_swizzle()
249 slot = PCI_SLOT(dev->devfn); noritake_swizzle()
253 return slot; noritake_swizzle()
H A Dsys_rawhide.c196 * 0 Interrupt Line A from slot 2 PCI0
197 * 1 Interrupt Line B from slot 2 PCI0
198 * 2 Interrupt Line C from slot 2 PCI0
199 * 3 Interrupt Line D from slot 2 PCI0
200 * 4 Interrupt Line A from slot 3 PCI0
201 * 5 Interrupt Line B from slot 3 PCI0
202 * 6 Interrupt Line C from slot 3 PCI0
203 * 7 Interrupt Line D from slot 3 PCI0
204 * 8 Interrupt Line A from slot 4 PCI0
205 * 9 Interrupt Line B from slot 4 PCI0
206 * 10 Interrupt Line C from slot 4 PCI0
207 * 11 Interrupt Line D from slot 4 PCI0
208 * 12 Interrupt Line A from slot 5 PCI0
209 * 13 Interrupt Line B from slot 5 PCI0
210 * 14 Interrupt Line C from slot 5 PCI0
211 * 15 Interrupt Line D from slot 5 PCI0
217 * 2 PCI option slot 2
218 * 3 PCI option slot 3
219 * 4 PCI option slot 4
220 * 5 PCI option slot 5
225 rawhide_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) rawhide_map_irq() argument
230 { 16+ 0, 16+ 0, 16+ 1, 16+ 2, 16+ 3}, /* IdSel 2 slot 2 */ rawhide_map_irq()
231 { 16+ 4, 16+ 4, 16+ 5, 16+ 6, 16+ 7}, /* IdSel 3 slot 3 */ rawhide_map_irq()
232 { 16+ 8, 16+ 8, 16+ 9, 16+10, 16+11}, /* IdSel 4 slot 4 */ rawhide_map_irq()
233 { 16+12, 16+12, 16+13, 16+14, 16+15} /* IdSel 5 slot 5 */ rawhide_map_irq()
H A Dsys_miata.c105 *12 Interrupt Line A from slot 4
106 *13 Interrupt Line B from slot 4
107 *14 Interrupt Line C from slot 4
108 *15 Interrupt Line D from slot 4
109 *16 Interrupt Line A from slot 5
110 *17 Interrupt line B from slot 5
111 *18 Interrupt Line C from slot 5
112 *19 Interrupt Line D from slot 5
113 *20 Interrupt Line A from slot 1
114 *21 Interrupt Line B from slot 1
115 *22 Interrupt Line C from slot 1
116 *23 Interrupt Line D from slot 1
117 *24 Interrupt Line A from slot 2
118 *25 Interrupt Line B from slot 2
119 *26 Interrupt Line C from slot 2
120 *27 Interrupt Line D from slot 2
121 *27 Interrupt Line A from slot 3
122 *29 Interrupt Line B from slot 3
123 *30 Interrupt Line C from slot 3
124 *31 Interrupt Line D from slot 3
126 * The device to slot mapping looks like:
137 * 11 PCI on board slot 4 (SBU Riser)
138 * 12 PCI on board slot 5 (SBU Riser)
142 * 13 PCI on board slot 1 (SBU Riser)
143 * 14 PCI on board slot 2 (SBU Riser)
144 * 15 PCI on board slot 3 (SBU Riser)
153 miata_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) miata_map_irq() argument
165 {16+12, 16+12, 16+13, 16+14, 16+15}, /* IdSel 22, slot 4 */ miata_map_irq()
166 {16+16, 16+16, 16+17, 16+18, 16+19}, /* IdSel 23, slot 5 */ miata_map_irq()
172 {16+20, 16+20, 16+21, 16+22, 16+23}, /* IdSel 28, slot 1 */ miata_map_irq()
173 {16+24, 16+24, 16+25, 16+26, 16+27}, /* IdSel 29, slot 2 */ miata_map_irq()
174 {16+28, 16+28, 16+29, 16+30, 16+31}, /* IdSel 30, slot 3 */ miata_map_irq()
183 if((slot == 7) && (PCI_FUNC(dev->devfn) == 3)) { miata_map_irq()
202 int slot, pin = *pinp; miata_swizzle() local
205 slot = PCI_SLOT(dev->devfn); miata_swizzle()
210 slot = PCI_SLOT(dev->devfn) + 9; miata_swizzle()
218 slot = PCI_SLOT(dev->devfn) + 9; miata_swizzle()
226 slot = PCI_SLOT(dev->devfn); miata_swizzle()
230 return slot; miata_swizzle()
H A Dsys_wildfire.c252 *36 builtin QLogic SCSI (or slot 0 if no IO module)
253 *40 Interrupt Line A from slot 2 PCI0
254 *41 Interrupt Line B from slot 2 PCI0
255 *42 Interrupt Line C from slot 2 PCI0
256 *43 Interrupt Line D from slot 2 PCI0
257 *44 Interrupt Line A from slot 3 PCI0
258 *45 Interrupt Line B from slot 3 PCI0
259 *46 Interrupt Line C from slot 3 PCI0
260 *47 Interrupt Line D from slot 3 PCI0
262 *48 Interrupt Line A from slot 4 PCI1
263 *49 Interrupt Line B from slot 4 PCI1
264 *50 Interrupt Line C from slot 4 PCI1
265 *51 Interrupt Line D from slot 4 PCI1
266 *52 Interrupt Line A from slot 5 PCI1
267 *53 Interrupt Line B from slot 5 PCI1
268 *54 Interrupt Line C from slot 5 PCI1
269 *55 Interrupt Line D from slot 5 PCI1
270 *56 Interrupt Line A from slot 6 PCI1
271 *57 Interrupt Line B from slot 6 PCI1
272 *58 Interrupt Line C from slot 6 PCI1
273 *50 Interrupt Line D from slot 6 PCI1
274 *60 Interrupt Line A from slot 7 PCI1
275 *61 Interrupt Line B from slot 7 PCI1
276 *62 Interrupt Line C from slot 7 PCI1
277 *63 Interrupt Line D from slot 7 PCI1
282 * 1 64 bit PCI 0 option slot 1 (SCSI QLogic builtin)
283 * 2 64 bit PCI 0 option slot 2
284 * 3 64 bit PCI 0 option slot 3
285 * 4 64 bit PCI 1 option slot 4
286 * 5 64 bit PCI 1 option slot 5
287 * 6 64 bit PCI 1 option slot 6
288 * 7 64 bit PCI 1 option slot 7
292 wildfire_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) wildfire_map_irq() argument
298 { 40, 40, 40+1, 40+2, 40+3}, /* IdSel 2 PCI 0 slot 2 */ wildfire_map_irq()
299 { 44, 44, 44+1, 44+2, 44+3}, /* IdSel 3 PCI 0 slot 3 */ wildfire_map_irq()
300 { 48, 48, 48+1, 48+2, 48+3}, /* IdSel 4 PCI 1 slot 4 */ wildfire_map_irq()
301 { 52, 52, 52+1, 52+2, 52+3}, /* IdSel 5 PCI 1 slot 5 */ wildfire_map_irq()
302 { 56, 56, 56+1, 56+2, 56+3}, /* IdSel 6 PCI 1 slot 6 */ wildfire_map_irq()
303 { 60, 60, 60+1, 60+2, 60+3}, /* IdSel 7 PCI 1 slot 7 */ wildfire_map_irq()
H A Dsys_sable.c66 * 0 PCI slot 0 34
70 * 4 PCI slot 1 35
71 * 5 PCI slot 2 36
172 * The device to slot mapping looks like:
181 * 6 PCI on board slot 0
182 * 7 PCI on board slot 1
183 * 8 PCI on board slot 2
196 sable_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) sable_map_irq() argument
206 { 32+2, 32+2, 32+2, 32+2, 32+2}, /* IdSel 6, slot 0 */ sable_map_irq()
207 { 32+3, 32+3, 32+3, 32+3, 32+3}, /* IdSel 7, slot 1 */ sable_map_irq()
208 { 32+4, 32+4, 32+4, 32+4, 32+4} /* IdSel 8, slot 2 */ sable_map_irq()
257 *32 PCI 0 slot 4 A primary bus 32
258 *33 PCI 0 slot 4 B primary bus 33
259 *34 PCI 0 slot 4 C primary bus 34
260 *35 PCI 0 slot 4 D primary bus
261 *36 PCI 0 slot 5 A primary bus
262 *37 PCI 0 slot 5 B primary bus
263 *38 PCI 0 slot 5 C primary bus
264 *39 PCI 0 slot 5 D primary bus
265 *40 PCI 0 slot 6 A primary bus
266 *41 PCI 0 slot 6 B primary bus
267 *42 PCI 0 slot 6 C primary bus
268 *43 PCI 0 slot 6 D primary bus
269 *44 PCI 0 slot 7 A primary bus
270 *45 PCI 0 slot 7 B primary bus
271 *46 PCI 0 slot 7 C primary bus
272 *47 PCI 0 slot 7 D primary bus
273 *48 PCI 0 slot 0 A secondary bus
274 *49 PCI 0 slot 0 B secondary bus
275 *50 PCI 0 slot 0 C secondary bus
276 *51 PCI 0 slot 0 D secondary bus
277 *52 PCI 0 slot 1 A secondary bus
278 *53 PCI 0 slot 1 B secondary bus
279 *54 PCI 0 slot 1 C secondary bus
280 *55 PCI 0 slot 1 D secondary bus
281 *56 PCI 0 slot 2 A secondary bus
282 *57 PCI 0 slot 2 B secondary bus
283 *58 PCI 0 slot 2 C secondary bus
284 *59 PCI 0 slot 2 D secondary bus
285 *60 PCI 0 slot 3 A secondary bus
286 *61 PCI 0 slot 3 B secondary bus
287 *62 PCI 0 slot 3 C secondary bus
288 *63 PCI 0 slot 3 D secondary bus
351 * The device to slot mapping looks like:
360 * 6 PCI on board slot 4
361 * 7 PCI on board slot 5
362 * 8 PCI on board slot 6
363 * 9 PCI on board slot 7
367 * 11 PCI on board slot 0
368 * 12 PCI on board slot 1
369 * 13 PCI on board slot 2
370 * 14 PCI on board slot 3
378 lynx_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) lynx_map_irq() argument
386 { 32, 32, 33, 34, 35}, /* IdSel 17, slot 4 */ lynx_map_irq()
387 { 36, 36, 37, 38, 39}, /* IdSel 18, slot 5 */ lynx_map_irq()
388 { 40, 40, 41, 42, 43}, /* IdSel 19, slot 6 */ lynx_map_irq()
389 { 44, 44, 45, 46, 47}, /* IdSel 20, slot 7 */ lynx_map_irq()
398 { 48, 48, 49, 50, 51}, /* IdSel 22 slot 0 */ lynx_map_irq()
399 { 52, 52, 53, 54, 55}, /* IdSel 23 slot 1 */ lynx_map_irq()
400 { 56, 56, 57, 58, 59}, /* IdSel 24 slot 2 */ lynx_map_irq()
401 { 60, 60, 61, 62, 63} /* IdSel 25 slot 3 */ lynx_map_irq()
410 int slot, pin = *pinp; lynx_swizzle() local
413 slot = PCI_SLOT(dev->devfn); lynx_swizzle()
417 slot = PCI_SLOT(dev->devfn) + 11; lynx_swizzle()
424 slot = PCI_SLOT(dev->devfn) + 11; lynx_swizzle()
432 slot = PCI_SLOT(dev->devfn); lynx_swizzle()
436 return slot; lynx_swizzle()
H A Dsys_takara.c153 * because the SIO ISA bridge can also be slot 7. However, the SIO
159 takara_map_irq_srm(const struct pci_dev *dev, u8 slot, u8 pin) takara_map_irq_srm() argument
162 { 16+3, 16+3, 16+3, 16+3, 16+3}, /* slot 6 == device 3 */ takara_map_irq_srm()
163 { 16+2, 16+2, 16+2, 16+2, 16+2}, /* slot 7 == device 2 */ takara_map_irq_srm()
164 { 16+1, 16+1, 16+1, 16+1, 16+1}, /* slot 8 == device 1 */ takara_map_irq_srm()
165 { -1, -1, -1, -1, -1}, /* slot 9 == nothing */ takara_map_irq_srm()
166 { -1, -1, -1, -1, -1}, /* slot 10 == nothing */ takara_map_irq_srm()
167 { -1, -1, -1, -1, -1}, /* slot 11 == nothing */ takara_map_irq_srm()
169 { 12, 12, 13, 14, 15}, /* slot 12 == nothing */ takara_map_irq_srm()
170 { 8, 8, 9, 19, 11}, /* slot 13 == nothing */ takara_map_irq_srm()
171 { 4, 4, 5, 6, 7}, /* slot 14 == nothing */ takara_map_irq_srm()
172 { 0, 0, 1, 2, 3}, /* slot 15 == nothing */ takara_map_irq_srm()
173 { -1, -1, -1, -1, -1}, /* slot 16 == nothing */ takara_map_irq_srm()
174 {64+ 0, 64+0, 64+1, 64+2, 64+3}, /* slot 17= device 4 */ takara_map_irq_srm()
175 {48+ 0, 48+0, 48+1, 48+2, 48+3}, /* slot 18= device 3 */ takara_map_irq_srm()
176 {32+ 0, 32+0, 32+1, 32+2, 32+3}, /* slot 19= device 2 */ takara_map_irq_srm()
177 {16+ 0, 16+0, 16+1, 16+2, 16+3}, /* slot 20= device 1 */ takara_map_irq_srm()
190 takara_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) takara_map_irq() argument
193 { 16+3, 16+3, 16+3, 16+3, 16+3}, /* slot 6 == device 3 */ takara_map_irq()
194 { 16+2, 16+2, 16+2, 16+2, 16+2}, /* slot 7 == device 2 */ takara_map_irq()
195 { 16+1, 16+1, 16+1, 16+1, 16+1}, /* slot 8 == device 1 */ takara_map_irq()
196 { -1, -1, -1, -1, -1}, /* slot 9 == nothing */ takara_map_irq()
197 { -1, -1, -1, -1, -1}, /* slot 10 == nothing */ takara_map_irq()
198 { -1, -1, -1, -1, -1}, /* slot 11 == nothing */ takara_map_irq()
199 { -1, -1, -1, -1, -1}, /* slot 12 == nothing */ takara_map_irq()
200 { -1, -1, -1, -1, -1}, /* slot 13 == nothing */ takara_map_irq()
201 { -1, -1, -1, -1, -1}, /* slot 14 == nothing */ takara_map_irq()
202 { -1, -1, -1, -1, -1}, /* slot 15 == nothing */ takara_map_irq()
203 { -1, -1, -1, -1, -1}, /* slot 16 == nothing */ takara_map_irq()
204 { -1, -1, -1, -1, -1}, /* slot 17 == nothing */ takara_map_irq()
205 { 16+3, 16+3, 16+3, 16+3, 16+3}, /* slot 18 == device 3 */ takara_map_irq()
206 { 16+2, 16+2, 16+2, 16+2, 16+2}, /* slot 19 == device 2 */ takara_map_irq()
207 { 16+1, 16+1, 16+1, 16+1, 16+1}, /* slot 20 == device 1 */ takara_map_irq()
216 int slot = PCI_SLOT(dev->devfn); takara_swizzle() local
222 return slot; takara_swizzle()
242 return slot; takara_swizzle()
H A Dsys_dp264.c312 *20 Interrupt Line D from slot 2 PCI0
313 *21 Interrupt Line C from slot 2 PCI0
314 *22 Interrupt Line B from slot 2 PCI0
315 *23 Interrupt Line A from slot 2 PCI0
316 *24 Interrupt Line D from slot 1 PCI0
317 *25 Interrupt Line C from slot 1 PCI0
318 *26 Interrupt Line B from slot 1 PCI0
319 *27 Interrupt Line A from slot 1 PCI0
320 *28 Interrupt Line D from slot 0 PCI0
321 *29 Interrupt Line C from slot 0 PCI0
322 *30 Interrupt Line B from slot 0 PCI0
323 *31 Interrupt Line A from slot 0 PCI0
325 *32 Interrupt Line D from slot 3 PCI1
326 *33 Interrupt Line C from slot 3 PCI1
327 *34 Interrupt Line B from slot 3 PCI1
328 *35 Interrupt Line A from slot 3 PCI1
329 *36 Interrupt Line D from slot 2 PCI1
330 *37 Interrupt Line C from slot 2 PCI1
331 *38 Interrupt Line B from slot 2 PCI1
332 *39 Interrupt Line A from slot 2 PCI1
333 *40 Interrupt Line D from slot 1 PCI1
334 *41 Interrupt Line C from slot 1 PCI1
335 *42 Interrupt Line B from slot 1 PCI1
336 *43 Interrupt Line A from slot 1 PCI1
337 *44 Interrupt Line D from slot 0 PCI1
338 *45 Interrupt Line C from slot 0 PCI1
339 *46 Interrupt Line B from slot 0 PCI1
340 *47 Interrupt Line A from slot 0 PCI1
353 * 7 64 bit PCI option slot 0 (all busses)
354 * 8 64 bit PCI option slot 1 (all busses)
355 * 9 64 bit PCI option slot 2 (all busses)
356 * 10 64 bit PCI option slot 3 (not bus 0)
376 dp264_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) dp264_map_irq() argument
382 { 16+15, 16+15, 16+14, 16+13, 16+12}, /* IdSel 7 slot 0 */ dp264_map_irq()
383 { 16+11, 16+11, 16+10, 16+ 9, 16+ 8}, /* IdSel 8 slot 1 */ dp264_map_irq()
384 { 16+ 7, 16+ 7, 16+ 6, 16+ 5, 16+ 4}, /* IdSel 9 slot 2 */ dp264_map_irq()
385 { 16+ 3, 16+ 3, 16+ 2, 16+ 1, 16+ 0} /* IdSel 10 slot 3 */ dp264_map_irq()
398 monet_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) monet_map_irq() argument
409 { 28, 28, 29, 30, 31}, /* IdSel 14 slot 4 PCI2*/ monet_map_irq()
410 { 24, 24, 25, 26, 27}, /* IdSel 15 slot 5 PCI2*/ monet_map_irq()
415 { 40, 40, 41, 42, 43}, /* IdSel 11 slot 1 PCI0*/ monet_map_irq()
416 { 36, 36, 37, 38, 39}, /* IdSel 12 slot 2 PCI0*/ monet_map_irq()
417 { 32, 32, 33, 34, 35}, /* IdSel 13 slot 3 PCI0*/ monet_map_irq()
418 { 28, 28, 29, 30, 31}, /* IdSel 14 slot 4 PCI2*/ monet_map_irq()
419 { 24, 24, 25, 26, 27} /* IdSel 15 slot 5 PCI2*/ monet_map_irq()
430 int slot, pin = *pinp; monet_swizzle() local
433 slot = PCI_SLOT(dev->devfn); monet_swizzle()
437 slot = PCI_SLOT(dev->devfn); monet_swizzle()
444 slot = PCI_SLOT(dev->devfn); monet_swizzle()
452 slot = PCI_SLOT(dev->devfn); monet_swizzle()
456 return slot; monet_swizzle()
460 webbrick_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) webbrick_map_irq() argument
471 { 35, 35, 34, 33, 32}, /* IdSel 14 slot 0 */ webbrick_map_irq()
472 { 39, 39, 38, 37, 36}, /* IdSel 15 slot 1 */ webbrick_map_irq()
473 { 43, 43, 42, 41, 40}, /* IdSel 16 slot 2 */ webbrick_map_irq()
474 { 47, 47, 46, 45, 44}, /* IdSel 17 slot 3 */ webbrick_map_irq()
482 clipper_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) clipper_map_irq() argument
486 { 16+ 8, 16+ 8, 16+ 9, 16+10, 16+11}, /* IdSel 1 slot 1 */ clipper_map_irq()
487 { 16+12, 16+12, 16+13, 16+14, 16+15}, /* IdSel 2 slot 2 */ clipper_map_irq()
488 { 16+16, 16+16, 16+17, 16+18, 16+19}, /* IdSel 3 slot 3 */ clipper_map_irq()
489 { 16+20, 16+20, 16+21, 16+22, 16+23}, /* IdSel 4 slot 4 */ clipper_map_irq()
490 { 16+24, 16+24, 16+25, 16+26, 16+27}, /* IdSel 5 slot 5 */ clipper_map_irq()
491 { 16+28, 16+28, 16+29, 16+30, 16+31}, /* IdSel 6 slot 6 */ clipper_map_irq()
H A Dsys_alcor.c144 * 0 Interrupt Line A from slot 2
145 * 1 Interrupt Line B from slot 2
146 * 2 Interrupt Line C from slot 2
147 * 3 Interrupt Line D from slot 2
148 * 4 Interrupt Line A from slot 1
149 * 5 Interrupt line B from slot 1
150 * 6 Interrupt Line C from slot 1
151 * 7 Interrupt Line D from slot 1
152 * 8 Interrupt Line A from slot 0
153 * 9 Interrupt Line B from slot 0
154 *10 Interrupt Line C from slot 0
155 *11 Interrupt Line D from slot 0
156 *12 Interrupt Line A from slot 4
157 *13 Interrupt Line B from slot 4
158 *14 Interrupt Line C from slot 4
159 *15 Interrupt Line D from slot 4
160 *16 Interrupt Line D from slot 3
161 *17 Interrupt Line D from slot 3
162 *18 Interrupt Line D from slot 3
163 *19 Interrupt Line D from slot 3
167 * The device to slot mapping looks like:
171 * 7 PCI on board slot 0
172 * 8 PCI on board slot 3
173 * 9 PCI on board slot 4
175 * 11 PCI on board slot 2
176 * 12 PCI on board slot 1
185 alcor_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) alcor_map_irq() argument
191 { 16+8, 16+8, 16+9, 16+10, 16+11}, /* IdSel 18, slot 0 */ alcor_map_irq()
192 {16+16, 16+16, 16+17, 16+18, 16+19}, /* IdSel 19, slot 3 */ alcor_map_irq()
193 {16+12, 16+12, 16+13, 16+14, 16+15}, /* IdSel 20, slot 4 */ alcor_map_irq()
195 { 16+0, 16+0, 16+1, 16+2, 16+3}, /* IdSel 22, slot 2 */ alcor_map_irq()
196 { 16+4, 16+4, 16+5, 16+6, 16+7}, /* IdSel 23, slot 1 */ alcor_map_irq()
235 * motherboard, by looking for a 21040 TULIP in slot 6, which is alcor_init_pci()
H A Dsys_rx164.c136 * 5 32 bit PCI option slot 0
137 * 6 64 bit PCI option slot 1
139 * 7 64 bit PCI option slot 2
140 * 9 32 bit PCI option slot 3
146 rx164_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) rx164_map_irq() argument
151 { 16+3, 16+3, 16+8, 16+13, 16+18}, /* IdSel 5, slot 2 */ rx164_map_irq()
152 { 16+5, 16+5, 16+10, 16+15, 16+20}, /* IdSel 6, slot 0 */ rx164_map_irq()
153 { 16+4, 16+4, 16+9, 16+14, 16+19}, /* IdSel 7, slot 1 */ rx164_map_irq()
155 { 16+2, 16+2, 16+7, 16+12, 16+17}, /* IdSel 9, slot 3 */ rx164_map_irq()
156 { 16+1, 16+1, 16+6, 16+11, 16+16}, /* IdSel 10, slot 4 */ rx164_map_irq()
161 { 16+0, 16+0, 16+6, 16+11, 16+16}, /* IdSel 5, slot 0 */ rx164_map_irq()
162 { 16+1, 16+1, 16+7, 16+12, 16+17}, /* IdSel 6, slot 1 */ rx164_map_irq()
164 { 16+2, 16+2, 16+8, 16+13, 16+18}, /* IdSel 8, slot 2 */ rx164_map_irq()
165 { 16+3, 16+3, 16+9, 16+14, 16+19}, /* IdSel 9, slot 3 */ rx164_map_irq()
H A Dsys_mikasa.c116 * 0 Interrupt Line A from slot 0
117 * 1 Interrupt Line B from slot 0
118 * 2 Interrupt Line C from slot 0
119 * 3 Interrupt Line D from slot 0
120 * 4 Interrupt Line A from slot 1
121 * 5 Interrupt line B from slot 1
122 * 6 Interrupt Line C from slot 1
123 * 7 Interrupt Line D from slot 1
124 * 8 Interrupt Line A from slot 2
125 * 9 Interrupt Line B from slot 2
126 *10 Interrupt Line C from slot 2
127 *11 Interrupt Line D from slot 2
133 * The device to slot mapping looks like:
138 * 11 PCI on board slot 0
139 * 12 PCI on board slot 1
140 * 13 PCI on board slot 2
149 mikasa_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) mikasa_map_irq() argument
158 { 16+0, 16+0, 16+1, 16+2, 16+3}, /* IdSel 22, slot 0 */ mikasa_map_irq()
159 { 16+4, 16+4, 16+5, 16+6, 16+7}, /* IdSel 23, slot 1 */ mikasa_map_irq()
160 { 16+8, 16+8, 16+9, 16+10, 16+11}, /* IdSel 24, slot 2 */ mikasa_map_irq()
H A Dsys_eb64p.c135 * 0 Interrupt Line A from slot 0
136 * 1 Interrupt Line A from slot 1
137 * 2 Interrupt Line B from slot 0
138 * 3 Interrupt Line B from slot 1
139 * 4 Interrupt Line C from slot 0
146 * 0 Interrupt Line C from slot 1
147 * 1 Interrupt Line D from slot 0
148 * 2 Interrupt Line D from slot 1
155 * The device to slot mapping looks like:
159 * 6 PCI on board slot 0
160 * 7 PCI on board slot 1
171 eb64p_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) eb64p_map_irq() argument
175 {16+7, 16+7, 16+7, 16+7, 16+7}, /* IdSel 5, slot ?, ?? */ eb64p_map_irq()
176 {16+0, 16+0, 16+2, 16+4, 16+9}, /* IdSel 6, slot ?, ?? */ eb64p_map_irq()
177 {16+1, 16+1, 16+3, 16+8, 16+10}, /* IdSel 7, slot ?, ?? */ eb64p_map_irq()
H A Dsys_ruffian.c121 ruffian_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) ruffian_map_irq() argument
129 {43, 43, 42, 41, 40}, /* IdSel 17, 64-bit slot */ ruffian_map_irq()
131 {19, 19, 18, 17, 16}, /* IdSel 8, slot 0 */ ruffian_map_irq()
132 {31, 31, 30, 29, 28}, /* IdSel 9, slot 1 */ ruffian_map_irq()
133 {27, 27, 26, 25, 24}, /* IdSel 10, slot 2 */ ruffian_map_irq()
134 {39, 39, 38, 37, 36}, /* IdSel 11, slot 3 */ ruffian_map_irq()
135 {35, 35, 34, 33, 32}, /* IdSel 12, slot 4 */ ruffian_map_irq()
145 int slot, pin = *pinp; ruffian_swizzle() local
148 slot = PCI_SLOT(dev->devfn); ruffian_swizzle()
152 slot = PCI_SLOT(dev->devfn) + 10; ruffian_swizzle()
159 slot = PCI_SLOT(dev->devfn) + 10; ruffian_swizzle()
167 slot = PCI_SLOT(dev->devfn); ruffian_swizzle()
171 return slot; ruffian_swizzle()
H A Dsys_cabriolet.c165 * slot number to refer to the id select line and *not* the slot
167 * I've given the slot number, the id select line and the Jxx number
177 eb66p_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) eb66p_map_irq() argument
181 {16+0, 16+0, 16+5, 16+9, 16+13}, /* IdSel 6, slot 0, J25 */ eb66p_map_irq()
182 {16+1, 16+1, 16+6, 16+10, 16+14}, /* IdSel 7, slot 1, J26 */ eb66p_map_irq()
184 {16+2, 16+2, 16+7, 16+11, 16+15}, /* IdSel 9, slot 2, J27 */ eb66p_map_irq()
185 {16+3, 16+3, 16+8, 16+12, 16+6} /* IdSel 10, slot 3, J28 */ eb66p_map_irq()
194 * are numbered differently. In the code below, I have used slot
195 * number to refer to the id select line and *not* the slot number
197 * given the slot number, the id select line and the Jxx number that's
207 cabriolet_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) cabriolet_map_irq() argument
211 { 16+2, 16+2, 16+7, 16+11, 16+15}, /* IdSel 5, slot 2, J21 */ cabriolet_map_irq()
212 { 16+0, 16+0, 16+5, 16+9, 16+13}, /* IdSel 6, slot 0, J19 */ cabriolet_map_irq()
213 { 16+1, 16+1, 16+6, 16+10, 16+14}, /* IdSel 7, slot 1, J20 */ cabriolet_map_irq()
215 { 16+3, 16+3, 16+8, 16+12, 16+16} /* IdSel 9, slot 3, J22 */ cabriolet_map_irq()
280 * 5 32 bit PCI option slot 2
281 * 6 64 bit PCI option slot 0
282 * 7 64 bit PCI option slot 1
284 * 9 32 bit PCI option slot 3
291 alphapc164_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) alphapc164_map_irq() argument
295 { 16+2, 16+2, 16+9, 16+13, 16+17}, /* IdSel 5, slot 2, J20 */ alphapc164_map_irq()
296 { 16+0, 16+0, 16+7, 16+11, 16+15}, /* IdSel 6, slot 0, J29 */ alphapc164_map_irq()
297 { 16+1, 16+1, 16+8, 16+12, 16+16}, /* IdSel 7, slot 1, J26 */ alphapc164_map_irq()
299 { 16+3, 16+3, 16+10, 16+14, 16+18}, /* IdSel 9, slot 3, J19 */ alphapc164_map_irq()
/linux-4.4.14/fs/efs/
H A Ddir.c26 int slot; efs_readdir() local
36 slot = ctx->pos & 0xff; efs_readdir()
60 for (; slot < dirblock->slots; slot++) { efs_readdir()
66 if (dirblock->space[slot] == 0) efs_readdir()
69 dirslot = (struct efs_dentry *) (((char *) bh->b_data) + EFS_SLOTAT(dirblock, slot)); efs_readdir()
74 pr_debug("%s(): block %d slot %d/%d: inode %u, name \"%s\", namelen %u\n", efs_readdir()
75 __func__, block, slot, dirblock->slots-1, efs_readdir()
80 ctx->pos = (block << EFS_DIRBSIZE_BITS) | slot; efs_readdir()
85 slot); efs_readdir()
97 slot = 0; efs_readdir()
100 ctx->pos = (block << EFS_DIRBSIZE_BITS) | slot; efs_readdir()
H A Dnamei.c19 int slot, namelen; efs_find_entry() local
47 for (slot = 0; slot < dirblock->slots; slot++) { efs_find_entry()
48 dirslot = (struct efs_dentry *) (((char *) bh->b_data) + EFS_SLOTAT(dirblock, slot)); efs_find_entry()
/linux-4.4.14/drivers/pcmcia/
H A Dvrc4171_card.c103 enum vrc4171_slot slot; member in struct:vrc4171_socket
171 static inline uint8_t exca_read_byte(int slot, uint8_t index) exca_read_byte() argument
173 if (slot == CARD_SLOTB) exca_read_byte()
180 static inline uint16_t exca_read_word(int slot, uint8_t index) exca_read_word() argument
184 if (slot == CARD_SLOTB) exca_read_word()
196 static inline uint8_t exca_write_byte(int slot, uint8_t index, uint8_t data) exca_write_byte() argument
198 if (slot == CARD_SLOTB) exca_write_byte()
207 static inline uint16_t exca_write_word(int slot, uint8_t index, uint16_t data) exca_write_word() argument
209 if (slot == CARD_SLOTB) exca_write_word()
238 unsigned int slot; pccard_init() local
245 slot = sock->sock; pccard_init()
246 socket = &vrc4171_sockets[slot]; pccard_init()
256 unsigned int slot; pccard_get_status() local
263 slot = sock->sock; pccard_get_status()
265 status = exca_read_byte(slot, I365_STATUS); pccard_get_status()
266 if (exca_read_byte(slot, I365_INTCTL) & I365_PC_IOCARD) { pccard_get_status()
284 sense = exca_read_byte(slot, CARD_VOLTAGE_SENSE); pccard_get_status()
321 unsigned int slot; pccard_set_socket() local
329 slot = sock->sock; pccard_set_socket()
330 socket = &vrc4171_sockets[slot]; pccard_set_socket()
335 exca_write_byte(slot, CARD_VOLTAGE_SELECT, voltage); pccard_set_socket()
342 exca_write_byte(slot, I365_POWER, power); pccard_set_socket()
353 exca_write_byte(slot, I365_INTCTL, control); pccard_set_socket()
356 exca_write_byte(slot, I365_CSCINT, cscint); pccard_set_socket()
357 exca_read_byte(slot, I365_CSC); /* clear CardStatus change */ pccard_set_socket()
373 exca_write_byte(slot, I365_CSCINT, cscint); pccard_set_socket()
382 unsigned int slot; pccard_set_io_map() local
391 slot = sock->sock; pccard_set_io_map()
394 addrwin = exca_read_byte(slot, I365_ADDRWIN); pccard_set_io_map()
397 exca_write_byte(slot, I365_ADDRWIN, addrwin); pccard_set_io_map()
400 exca_write_word(slot, I365_IO(map)+I365_W_START, io->start); pccard_set_io_map()
401 exca_write_word(slot, I365_IO(map)+I365_W_STOP, io->stop); pccard_set_io_map()
412 exca_write_byte(slot, I365_IOCTL, ioctl); pccard_set_io_map()
416 exca_write_byte(slot, I365_ADDRWIN, addrwin); pccard_set_io_map()
424 unsigned int slot; pccard_set_mem_map() local
438 slot = sock->sock; pccard_set_mem_map()
441 addrwin = exca_read_byte(slot, I365_ADDRWIN); pccard_set_mem_map()
444 exca_write_byte(slot, I365_ADDRWIN, addrwin); pccard_set_mem_map()
450 exca_write_word(slot, I365_MEM(map)+I365_W_START, start); pccard_set_mem_map()
466 exca_write_word(slot, I365_MEM(map)+I365_W_STOP, stop); pccard_set_mem_map()
473 exca_write_word(slot, I365_MEM(map)+I365_W_OFF, offset); pccard_set_mem_map()
477 exca_write_byte(slot, I365_ADDRWIN, addrwin); pccard_set_mem_map()
491 static inline unsigned int get_events(int slot) get_events() argument
496 status = exca_read_byte(slot, I365_STATUS); get_events()
497 csc = exca_read_byte(slot, I365_CSC); get_events()
499 if (exca_read_byte(slot, I365_INTCTL) & I365_PC_IOCARD) { get_events()
528 if (socket->slot == SLOT_INITIALIZED) { pccard_interrupt()
541 if (socket->slot == SLOT_INITIALIZED) { pccard_interrupt()
555 static inline void reserve_using_irq(int slot) reserve_using_irq() argument
559 irq = exca_read_byte(slot, I365_INTCTL); reserve_using_irq()
563 irq = exca_read_byte(slot, I365_CSCINT); reserve_using_irq()
571 int slot, retval; vrc4171_add_sockets() local
573 for (slot = 0; slot < CARD_MAX_SLOTS; slot++) { vrc4171_add_sockets()
574 if (slot == CARD_SLOTB && vrc4171_slotb == SLOTB_IS_NONE) vrc4171_add_sockets()
577 socket = &vrc4171_sockets[slot]; vrc4171_add_sockets()
578 if (socket->slot != SLOT_PROBE) { vrc4171_add_sockets()
581 switch (socket->slot) { vrc4171_add_sockets()
583 addrwin = exca_read_byte(slot, I365_ADDRWIN); vrc4171_add_sockets()
585 exca_write_byte(slot, I365_ADDRWIN, addrwin); vrc4171_add_sockets()
588 addrwin = exca_read_byte(slot, I365_ADDRWIN); vrc4171_add_sockets()
590 exca_write_byte(slot, I365_ADDRWIN, addrwin); vrc4171_add_sockets()
596 reserve_using_irq(slot); vrc4171_add_sockets()
600 sprintf(socket->name, "NEC VRC4171 Card Slot %1c", 'A' + slot); vrc4171_add_sockets()
609 exca_write_byte(slot, I365_ADDRWIN, 0); vrc4171_add_sockets()
610 exca_write_byte(slot, GLOBAL_CONTROL, 0); vrc4171_add_sockets()
612 socket->slot = SLOT_INITIALIZED; vrc4171_add_sockets()
621 int slot; vrc4171_remove_sockets() local
623 for (slot = 0; slot < CARD_MAX_SLOTS; slot++) { vrc4171_remove_sockets()
624 if (slot == CARD_SLOTB && vrc4171_slotb == SLOTB_IS_NONE) vrc4171_remove_sockets()
627 socket = &vrc4171_sockets[slot]; vrc4171_remove_sockets()
628 if (socket->slot == SLOT_INITIALIZED) vrc4171_remove_sockets()
631 socket->slot = SLOT_PROBE; vrc4171_remove_sockets()
656 vrc4171_sockets[CARD_SLOTA].slot = SLOT_NOPROBE_MEM; vrc4171_card_setup()
659 vrc4171_sockets[CARD_SLOTA].slot = SLOT_NOPROBE_IO; vrc4171_card_setup()
662 vrc4171_sockets[CARD_SLOTA].slot = SLOT_NOPROBE_ALL; vrc4171_card_setup()
696 vrc4171_sockets[CARD_SLOTB].slot = SLOT_NOPROBE_MEM; vrc4171_card_setup()
698 vrc4171_sockets[CARD_SLOTB].slot = SLOT_NOPROBE_IO; vrc4171_card_setup()
700 vrc4171_sockets[CARD_SLOTB].slot = SLOT_NOPROBE_ALL; vrc4171_card_setup()
H A Dsa1111_neponset.c30 * B0VPP ground (slot B is CF)
31 * B1VPP ground (slot B is CF)
36 * 12INB ground (slot B is CF)
74 printk(KERN_ERR "%s(): CF slot cannot support VPP %u\n", neponset_pcmcia_configure_socket()
/linux-4.4.14/arch/sh/drivers/pci/
H A Dfixups-sdk7786.c20 * time, and both appear on port 3 to the PCI bus scan. Enabling slot 4
21 * (the horizontal edge connector) will disable slot 3 entirely.
23 * Misconfigurations can be detected through the FPGA via the slot
43 * Enable slot #4 if it's been specified on the command line. sdk7786_pci_init()
45 * Optionally reroute if slot #4 has a card present while slot #3 sdk7786_pci_init()
52 pr_info("Activating PCIe slot#4 (disabling slot#3)\n"); sdk7786_pci_init()
57 /* Warn about forced rerouting if slot#3 is occupied */ sdk7786_pci_init()
59 pr_warning("Unreachable card detected in slot#3\n"); sdk7786_pci_init()
63 pr_info("PCIe slot#4 disabled\n"); sdk7786_pci_init()
H A Dfixups-cayman.c8 int __init pcibios_map_platform_irq(const struct pci_dev *dev, u8 slot, u8 pin) pcibios_map_platform_irq() argument
20 plugged into a 3.3V slot, and this changes the bus numbering. pcibios_map_platform_irq()
32 int slot; pcibios_map_platform_irq() member in struct:slot_pin
39 slot = path[i].slot = PCI_SLOT(dev->devfn); pcibios_map_platform_irq()
46 slot = PCI_SLOT(dev->devfn); pcibios_map_platform_irq()
47 /* This is the slot on bus 0 through which the device is eventually pcibios_map_platform_irq()
51 if ((slot < 3) || (i == 0)) { pcibios_map_platform_irq()
57 slot = path[i].slot; pcibios_map_platform_irq()
59 if (slot > 0) { pcibios_map_platform_irq()
65 slot = path[i].slot; pcibios_map_platform_irq()
67 /* 'pin' was swizzled earlier wrt slot, don't do it again. */ pcibios_map_platform_irq()
H A Dfixups-sh03.c7 int __init pcibios_map_platform_irq(const struct pci_dev *dev, u8 slot, u8 pin) pcibios_map_platform_irq() argument
12 switch (slot) { pcibios_map_platform_irq()
18 "for slot %d\n", slot); pcibios_map_platform_irq()
H A Dfixups-snapgear.c22 int __init pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin) pcibios_map_platform_irq() argument
26 switch (slot) { pcibios_map_platform_irq()
35 printk("PCI: Mapping SnapGear IRQ for slot %d, pin %c to irq %d\n", pcibios_map_platform_irq()
36 slot, pin - 1 + 'A', irq); pcibios_map_platform_irq()
H A Dfixups-titan.c30 int __init pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin) pcibios_map_platform_irq() argument
32 int irq = titan_irq_tab[slot]; pcibios_map_platform_irq()
34 printk("PCI: Mapping TITAN IRQ for slot %d, pin %c to irq %d\n", pcibios_map_platform_irq()
35 slot, pin - 1 + 'A', irq); pcibios_map_platform_irq()
H A Dfixups-r7780rp.c18 int __init pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin) pcibios_map_platform_irq() argument
20 return evt2irq(0xa20) + slot; pcibios_map_platform_irq()
H A Dfixups-landisk.c23 int pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin) pcibios_map_platform_irq() argument
31 int irq = ((slot + pin - 1) & 0x3) + evt2irq(0x2a0); pcibios_map_platform_irq()
33 if ((slot | (pin - 1)) > 0x3) { pcibios_map_platform_irq()
34 printk(KERN_WARNING "PCI: Bad IRQ mapping request for slot %d pin %c\n", pcibios_map_platform_irq()
35 slot, pin - 1 + 'A'); pcibios_map_platform_irq()
H A Dfixups-sdk7780.c40 int __init pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin) pcibios_map_platform_irq() argument
42 return sdk7780_irq_tab[pin-1][slot]; pcibios_map_platform_irq()
H A Dfixups-rts7751r2d.c34 int __init pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin) pcibios_map_platform_irq() argument
37 return lboxre2_irq_tab[slot]; pcibios_map_platform_irq()
39 return rts7751r2d_irq_tab[slot]; pcibios_map_platform_irq()
/linux-4.4.14/arch/x86/include/asm/
H A Dpci-direct.h9 extern u32 read_pci_config(u8 bus, u8 slot, u8 func, u8 offset);
10 extern u8 read_pci_config_byte(u8 bus, u8 slot, u8 func, u8 offset);
11 extern u16 read_pci_config_16(u8 bus, u8 slot, u8 func, u8 offset);
12 extern void write_pci_config(u8 bus, u8 slot, u8 func, u8 offset, u32 val);
13 extern void write_pci_config_byte(u8 bus, u8 slot, u8 func, u8 offset, u8 val);
14 extern void write_pci_config_16(u8 bus, u8 slot, u8 func, u8 offset, u16 val);
19 extern void early_dump_pci_device(u8 bus, u8 slot, u8 func);
/linux-4.4.14/arch/sparc/include/asm/
H A Dparport.h114 int slot, err; ecpp_probe() local
127 for (slot = 0; slot < PARPORT_PC_MAX_PORTS; slot++) { ecpp_probe()
128 if (!test_and_set_bit(slot, dma_slot_map)) ecpp_probe()
132 if (slot >= PARPORT_PC_MAX_PORTS) ecpp_probe()
135 spin_lock_init(&sparc_ebus_dmas[slot].info.lock); ecpp_probe()
138 sparc_ebus_dmas[slot].info.regs = ecpp_probe()
141 if (!sparc_ebus_dmas[slot].info.regs) ecpp_probe()
144 sparc_ebus_dmas[slot].info.flags = 0; ecpp_probe()
145 sparc_ebus_dmas[slot].info.callback = NULL; ecpp_probe()
146 sparc_ebus_dmas[slot].info.client_cookie = NULL; ecpp_probe()
147 sparc_ebus_dmas[slot].info.irq = 0xdeadbeef; ecpp_probe()
148 strcpy(sparc_ebus_dmas[slot].info.name, "parport"); ecpp_probe()
149 if (ebus_dma_register(&sparc_ebus_dmas[slot].info)) ecpp_probe()
152 ebus_dma_irq_enable(&sparc_ebus_dmas[slot].info, 1); ecpp_probe()
170 slot, ecpp_probe()
182 ebus_dma_irq_enable(&sparc_ebus_dmas[slot].info, 0); ecpp_probe()
183 ebus_dma_unregister(&sparc_ebus_dmas[slot].info); ecpp_probe()
186 of_iounmap(&op->resource[2], sparc_ebus_dmas[slot].info.regs, d_len); ecpp_probe()
189 clear_bit(slot, dma_slot_map); ecpp_probe()
198 int slot = p->dma; ecpp_remove() local
202 if (slot != PARPORT_DMA_NOFIFO) { ecpp_remove()
208 ebus_dma_irq_enable(&sparc_ebus_dmas[slot].info, 0); ecpp_remove()
209 ebus_dma_unregister(&sparc_ebus_dmas[slot].info); ecpp_remove()
211 sparc_ebus_dmas[slot].info.regs, ecpp_remove()
213 clear_bit(slot, dma_slot_map); ecpp_remove()
H A Dleon_pci.h16 int (*map_irq)(const struct pci_dev *dev, u8 slot, u8 pin);
H A Dsbi.h24 /* 0x0020 */ u32 stb0; /* Streaming buf control for slot 0 */
25 /* 0x0024 */ u32 stb1; /* Streaming buf control for slot 1 */
26 /* 0x0028 */ u32 stb2; /* Streaming buf control for slot 2 */
27 /* 0x002c */ u32 stb3; /* Streaming buf control for slot 3 */
/linux-4.4.14/net/sched/
H A Dsch_sfq.c107 sfq_index next; /* next slot in sfq RR chain */
110 short allot; /* credit for this slot */
124 u8 cur_depth; /* depth of longest slot */
133 struct sfq_slot *tail; /* current slot in round */
200 * x : slot number [0 .. SFQ_MAX_FLOWS - 1]
205 struct sfq_slot *slot = &q->slots[x]; sfq_link() local
206 int qlen = slot->qlen; sfq_link()
211 slot->dep.next = n; sfq_link()
212 slot->dep.prev = p; sfq_link()
255 /* remove one skb from tail of slot queue */ slot_dequeue_tail()
256 static inline struct sk_buff *slot_dequeue_tail(struct sfq_slot *slot) slot_dequeue_tail() argument
258 struct sk_buff *skb = slot->skblist_prev; slot_dequeue_tail()
260 slot->skblist_prev = skb->prev; slot_dequeue_tail()
261 skb->prev->next = (struct sk_buff *)slot; slot_dequeue_tail()
266 /* remove one skb from head of slot queue */ slot_dequeue_head()
267 static inline struct sk_buff *slot_dequeue_head(struct sfq_slot *slot) slot_dequeue_head() argument
269 struct sk_buff *skb = slot->skblist_next; slot_dequeue_head()
271 slot->skblist_next = skb->next; slot_dequeue_head()
272 skb->next->prev = (struct sk_buff *)slot; slot_dequeue_head()
277 static inline void slot_queue_init(struct sfq_slot *slot) slot_queue_init() argument
279 memset(slot, 0, sizeof(*slot)); slot_queue_init()
280 slot->skblist_prev = slot->skblist_next = (struct sk_buff *)slot; slot_queue_init()
283 /* add skb to slot queue (tail add) */ slot_queue_add()
284 static inline void slot_queue_add(struct sfq_slot *slot, struct sk_buff *skb) slot_queue_add() argument
286 skb->prev = slot->skblist_prev; slot_queue_add()
287 skb->next = (struct sk_buff *)slot; slot_queue_add()
288 slot->skblist_prev->next = skb; slot_queue_add()
289 slot->skblist_prev = skb; slot_queue_add()
298 struct sfq_slot *slot; sfq_drop() local
300 /* Queue is full! Find the longest slot and drop tail packet from it */ sfq_drop()
303 slot = &q->slots[x]; sfq_drop()
305 skb = q->headdrop ? slot_dequeue_head(slot) : slot_dequeue_tail(slot); sfq_drop()
307 slot->backlog -= len; sfq_drop()
319 slot = &q->slots[x]; sfq_drop()
320 q->tail->next = slot->next; sfq_drop()
321 q->ht[slot->hash] = SFQ_EMPTY_SLOT; sfq_drop()
351 struct sfq_slot *slot; sfq_enqueue() local
366 slot = &q->slots[x]; sfq_enqueue()
368 x = q->dep[0].next; /* get a free slot */ sfq_enqueue()
372 slot = &q->slots[x]; sfq_enqueue()
373 slot->hash = hash; sfq_enqueue()
374 slot->backlog = 0; /* should already be 0 anyway... */ sfq_enqueue()
375 red_set_vars(&slot->vars); sfq_enqueue()
379 slot->vars.qavg = red_calc_qavg_no_idle_time(q->red_parms, sfq_enqueue()
380 &slot->vars, sfq_enqueue()
381 slot->backlog); sfq_enqueue()
383 &slot->vars, sfq_enqueue()
384 slot->vars.qavg)) { sfq_enqueue()
393 INET_ECN_set_ce(slot->skblist_next)) { sfq_enqueue()
410 INET_ECN_set_ce(slot->skblist_next)) { sfq_enqueue()
424 if (slot->qlen >= q->maxdepth) { sfq_enqueue()
430 head = slot_dequeue_head(slot); sfq_enqueue()
433 slot->backlog -= delta; sfq_enqueue()
436 slot_queue_add(slot, skb); sfq_enqueue()
442 slot->backlog += qdisc_pkt_len(skb); sfq_enqueue()
443 slot_queue_add(slot, skb); sfq_enqueue()
445 if (slot->qlen == 1) { /* The flow is new */ sfq_enqueue()
447 slot->next = x; sfq_enqueue()
449 slot->next = q->tail->next; sfq_enqueue()
456 q->tail = slot; sfq_enqueue()
458 slot->allot = q->scaled_quantum; sfq_enqueue()
463 qlen = slot->qlen; sfq_enqueue()
468 if (qlen != slot->qlen) sfq_enqueue()
482 struct sfq_slot *slot; sfq_dequeue() local
490 slot = &q->slots[a]; sfq_dequeue()
491 if (slot->allot <= 0) { sfq_dequeue()
492 q->tail = slot; sfq_dequeue()
493 slot->allot += q->scaled_quantum; sfq_dequeue()
496 skb = slot_dequeue_head(slot); sfq_dequeue()
501 slot->backlog -= qdisc_pkt_len(skb); sfq_dequeue()
502 /* Is the slot empty? */ sfq_dequeue()
503 if (slot->qlen == 0) { sfq_dequeue()
504 q->ht[slot->hash] = SFQ_EMPTY_SLOT; sfq_dequeue()
505 next_a = slot->next; sfq_dequeue()
512 slot->allot -= SFQ_ALLOT_SIZE(qdisc_pkt_len(skb)); sfq_dequeue()
537 struct sfq_slot *slot; sfq_rehash() local
545 slot = &q->slots[i]; sfq_rehash()
546 if (!slot->qlen) sfq_rehash()
548 while (slot->qlen) { sfq_rehash()
549 skb = slot_dequeue_head(slot); sfq_rehash()
553 slot->backlog = 0; sfq_rehash()
554 red_set_vars(&slot->vars); sfq_rehash()
555 q->ht[slot->hash] = SFQ_EMPTY_SLOT; sfq_rehash()
563 slot = &q->slots[x]; sfq_rehash()
565 x = q->dep[0].next; /* get a free slot */ sfq_rehash()
575 slot = &q->slots[x]; sfq_rehash()
576 slot->hash = hash; sfq_rehash()
578 if (slot->qlen >= q->maxdepth) sfq_rehash()
580 slot_queue_add(slot, skb); sfq_rehash()
582 slot->vars.qavg = red_calc_qavg(q->red_parms, sfq_rehash()
583 &slot->vars, sfq_rehash()
584 slot->backlog); sfq_rehash()
585 slot->backlog += qdisc_pkt_len(skb); sfq_rehash()
587 if (slot->qlen == 1) { /* The flow is new */ sfq_rehash()
589 slot->next = x; sfq_rehash()
591 slot->next = q->tail->next; sfq_rehash()
594 q->tail = slot; sfq_rehash()
595 slot->allot = q->scaled_quantum; sfq_rehash()
847 const struct sfq_slot *slot = &q->slots[idx]; sfq_dump_class_stats() local
849 xstats.allot = slot->allot << SFQ_ALLOT_SHIFT; sfq_dump_class_stats()
850 qs.qlen = slot->qlen; sfq_dump_class_stats()
851 qs.backlog = slot->backlog; sfq_dump_class_stats()
H A Dsch_sfb.c71 u8 slot; /* current active bins (0 or 1) */ member in struct:sfb_sched_data
104 static u32 sfb_hash(const struct sk_buff *skb, u32 slot) sfb_hash() argument
106 return sfb_skb_cb(skb)->hashes[slot]; sfb_hash()
125 static void increment_one_qlen(u32 sfbhash, u32 slot, struct sfb_sched_data *q) increment_one_qlen() argument
128 struct sfb_bucket *b = &q->bins[slot].bins[0][0]; increment_one_qlen()
153 static void decrement_one_qlen(u32 sfbhash, u32 slot, decrement_one_qlen() argument
157 struct sfb_bucket *b = &q->bins[slot].bins[0][0]; decrement_one_qlen()
204 const struct sfb_bucket *b = &q->bins[q->slot].bins[0][0]; sfb_compute_qlen()
220 static void sfb_init_perturbation(u32 slot, struct sfb_sched_data *q) sfb_init_perturbation() argument
222 q->bins[slot].perturbation = prandom_u32(); sfb_init_perturbation()
227 sfb_init_perturbation(q->slot, q); sfb_swap_slot()
228 q->slot ^= 1; sfb_swap_slot()
288 u32 slot = q->slot; sfb_enqueue() local
316 sfbhash = jhash_1word(salt, q->bins[slot].perturbation); sfb_enqueue()
318 sfbhash = skb_get_hash_perturb(skb, q->bins[slot].perturbation); sfb_enqueue()
324 sfb_skb_cb(skb)->hashes[slot] = sfbhash; sfb_enqueue()
328 struct sfb_bucket *b = &q->bins[slot].bins[i][hash]; sfb_enqueue()
341 slot ^= 1; sfb_enqueue()
342 sfb_skb_cb(skb)->hashes[slot] = 0; sfb_enqueue()
354 q->bins[slot].perturbation); sfb_enqueue()
357 sfb_skb_cb(skb)->hashes[slot] = sfbhash; sfb_enqueue()
361 struct sfb_bucket *b = &q->bins[slot].bins[i][hash]; sfb_enqueue()
453 q->slot = 0; sfb_reset()
531 q->slot = 0; sfb_change()
/linux-4.4.14/drivers/media/dvb-core/
H A Ddvb_ca_en50221.c90 /* Information on a CA slot */
96 /* mutex used for serializing access to one CI slot */
120 /* timer used during various states of the slot */
139 /* information on each slot */
165 static int dvb_ca_en50221_read_data(struct dvb_ca_private *ca, int slot, u8 * ebuf, int ecount);
166 static int dvb_ca_en50221_write_data(struct dvb_ca_private *ca, int slot, u8 * ebuf, int ecount);
202 static int dvb_ca_en50221_check_camstatus(struct dvb_ca_private *ca, int slot) dvb_ca_en50221_check_camstatus() argument
210 return (atomic_read(&ca->slot_info[slot].camchange_count) != 0); dvb_ca_en50221_check_camstatus()
214 slot_status = ca->pub->poll_slot_status(ca->pub, slot, ca->open); dvb_ca_en50221_check_camstatus()
219 int cam_present_old = (ca->slot_info[slot].slot_state != DVB_CA_SLOTSTATE_NONE); dvb_ca_en50221_check_camstatus()
225 ca->slot_info[slot].camchange_type = DVB_CA_EN50221_CAMCHANGE_REMOVED; dvb_ca_en50221_check_camstatus()
227 ca->slot_info[slot].camchange_type = DVB_CA_EN50221_CAMCHANGE_INSERTED; dvb_ca_en50221_check_camstatus()
229 atomic_set(&ca->slot_info[slot].camchange_count, 1); dvb_ca_en50221_check_camstatus()
231 if ((ca->slot_info[slot].slot_state == DVB_CA_SLOTSTATE_WAITREADY) && dvb_ca_en50221_check_camstatus()
234 ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_VALIDATE; dvb_ca_en50221_check_camstatus()
247 * @slot: Slot on interface.
253 static int dvb_ca_en50221_wait_if_status(struct dvb_ca_private *ca, int slot, dvb_ca_en50221_wait_if_status() argument
266 int res = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_STATUS); dvb_ca_en50221_wait_if_status()
296 * @slot: Slot id.
300 static int dvb_ca_en50221_link_init(struct dvb_ca_private *ca, int slot) dvb_ca_en50221_link_init() argument
309 ca->slot_info[slot].da_irq_supported = 0; dvb_ca_en50221_link_init()
313 ca->slot_info[slot].link_buf_size = 2; dvb_ca_en50221_link_init()
316 if ((ret = ca->pub->write_cam_control(ca->pub, slot, CTRLIF_COMMAND, IRQEN | CMDREG_SR)) != 0) dvb_ca_en50221_link_init()
318 if ((ret = dvb_ca_en50221_wait_if_status(ca, slot, STATUSREG_DA, HZ / 10)) != 0) dvb_ca_en50221_link_init()
320 if ((ret = dvb_ca_en50221_read_data(ca, slot, buf, 2)) != 2) dvb_ca_en50221_link_init()
322 if ((ret = ca->pub->write_cam_control(ca->pub, slot, CTRLIF_COMMAND, IRQEN)) != 0) dvb_ca_en50221_link_init()
329 ca->slot_info[slot].link_buf_size = buf_size; dvb_ca_en50221_link_init()
335 if ((ret = ca->pub->write_cam_control(ca->pub, slot, CTRLIF_COMMAND, IRQEN | CMDREG_SW)) != 0) dvb_ca_en50221_link_init()
337 if ((ret = dvb_ca_en50221_wait_if_status(ca, slot, STATUSREG_FR, HZ / 10)) != 0) dvb_ca_en50221_link_init()
339 if ((ret = dvb_ca_en50221_write_data(ca, slot, buf, 2)) != 2) dvb_ca_en50221_link_init()
341 if ((ret = ca->pub->write_cam_control(ca->pub, slot, CTRLIF_COMMAND, IRQEN)) != 0) dvb_ca_en50221_link_init()
352 * @slot: Slot id.
360 static int dvb_ca_en50221_read_tuple(struct dvb_ca_private *ca, int slot, dvb_ca_en50221_read_tuple() argument
369 if ((_tupleType = ca->pub->read_attribute_mem(ca->pub, slot, _address)) < 0) dvb_ca_en50221_read_tuple()
378 if ((_tupleLength = ca->pub->read_attribute_mem(ca->pub, slot, _address + 2)) < 0) dvb_ca_en50221_read_tuple()
386 tuple[i] = ca->pub->read_attribute_mem(ca->pub, slot, _address + (i * 2)); dvb_ca_en50221_read_tuple()
406 * @slot: Slot id.
410 static int dvb_ca_en50221_parse_attributes(struct dvb_ca_private *ca, int slot) dvb_ca_en50221_parse_attributes() argument
428 dvb_ca_en50221_read_tuple(ca, slot, &address, &tupleType, &tupleLength, tuple)) < 0) dvb_ca_en50221_parse_attributes()
437 dvb_ca_en50221_read_tuple(ca, slot, &address, &tupleType, &tupleLength, tuple)) < 0) dvb_ca_en50221_parse_attributes()
446 dvb_ca_en50221_read_tuple(ca, slot, &address, &tupleType, &tupleLength, tuple)) < 0) dvb_ca_en50221_parse_attributes()
454 if ((status = dvb_ca_en50221_read_tuple(ca, slot, &address, &tupleType, dvb_ca_en50221_parse_attributes()
467 if ((status = dvb_ca_en50221_read_tuple(ca, slot, &address, &tupleType, dvb_ca_en50221_parse_attributes()
479 ca->slot_info[slot].config_base = 0; dvb_ca_en50221_parse_attributes()
481 ca->slot_info[slot].config_base |= (tuple[2 + i] << (8 * i)); dvb_ca_en50221_parse_attributes()
500 if ((status = dvb_ca_en50221_read_tuple(ca, slot, &address, &tupleType, dvb_ca_en50221_parse_attributes()
513 ca->slot_info[slot].config_option = tuple[0] & 0x3f; dvb_ca_en50221_parse_attributes()
541 manfid, devid, ca->slot_info[slot].config_base, ca->slot_info[slot].config_option); dvb_ca_en50221_parse_attributes()
552 * @slot: Slot containing the CAM.
554 static int dvb_ca_en50221_set_configoption(struct dvb_ca_private *ca, int slot) dvb_ca_en50221_set_configoption() argument
561 ca->pub->write_attribute_mem(ca->pub, slot, dvb_ca_en50221_set_configoption()
562 ca->slot_info[slot].config_base, dvb_ca_en50221_set_configoption()
563 ca->slot_info[slot].config_option); dvb_ca_en50221_set_configoption()
566 configoption = ca->pub->read_attribute_mem(ca->pub, slot, ca->slot_info[slot].config_base); dvb_ca_en50221_set_configoption()
568 ca->slot_info[slot].config_option, configoption & 0x3f); dvb_ca_en50221_set_configoption()
579 * be stored in a supplied buffer, or automatically be added to the slot's
583 * @slot: Slot to read from.
590 static int dvb_ca_en50221_read_data(struct dvb_ca_private *ca, int slot, u8 * ebuf, int ecount) dvb_ca_en50221_read_data() argument
603 if (ca->slot_info[slot].rx_buffer.data == NULL) { dvb_ca_en50221_read_data()
607 buf_free = dvb_ringbuffer_free(&ca->slot_info[slot].rx_buffer); dvb_ca_en50221_read_data()
609 if (buf_free < (ca->slot_info[slot].link_buf_size + DVB_RINGBUFFER_PKTHDRSIZE)) { dvb_ca_en50221_read_data()
616 if ((status = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_STATUS)) < 0) dvb_ca_en50221_read_data()
625 if ((status = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_SIZE_HIGH)) < 0) dvb_ca_en50221_read_data()
628 if ((status = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_SIZE_LOW)) < 0) dvb_ca_en50221_read_data()
634 if (bytes_read > ca->slot_info[slot].link_buf_size) { dvb_ca_en50221_read_data()
636 ca->dvbdev->adapter->num, bytes_read, ca->slot_info[slot].link_buf_size); dvb_ca_en50221_read_data()
637 ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_LINKINIT; dvb_ca_en50221_read_data()
644 ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_LINKINIT; dvb_ca_en50221_read_data()
660 if ((status = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_DATA)) < 0) dvb_ca_en50221_read_data()
668 if ((status = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_STATUS)) < 0) dvb_ca_en50221_read_data()
671 ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_LINKINIT; dvb_ca_en50221_read_data()
678 if (ca->slot_info[slot].rx_buffer.data == NULL) { dvb_ca_en50221_read_data()
682 dvb_ringbuffer_pkt_write(&ca->slot_info[slot].rx_buffer, buf, bytes_read); dvb_ca_en50221_read_data()
687 dprintk("Received CA packet for slot %i connection id 0x%x last_frag:%i size:0x%x\n", slot, dvb_ca_en50221_read_data()
706 * @slot: Slot to write to.
713 static int dvb_ca_en50221_write_data(struct dvb_ca_private *ca, int slot, u8 * buf, int bytes_write) dvb_ca_en50221_write_data() argument
722 if (bytes_write > ca->slot_info[slot].link_buf_size) dvb_ca_en50221_write_data()
729 if ((status = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_STATUS)) < 0) dvb_ca_en50221_write_data()
740 if ((status = ca->pub->write_cam_control(ca->pub, slot, CTRLIF_COMMAND, dvb_ca_en50221_write_data()
745 if ((status = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_STATUS)) < 0) dvb_ca_en50221_write_data()
754 if ((status = ca->pub->write_cam_control(ca->pub, slot, CTRLIF_SIZE_HIGH, bytes_write >> 8)) != 0) dvb_ca_en50221_write_data()
756 if ((status = ca->pub->write_cam_control(ca->pub, slot, CTRLIF_SIZE_LOW, dvb_ca_en50221_write_data()
762 if ((status = ca->pub->write_cam_control(ca->pub, slot, CTRLIF_DATA, buf[i])) != 0) dvb_ca_en50221_write_data()
767 if ((status = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_STATUS)) < 0) dvb_ca_en50221_write_data()
770 ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_LINKINIT; dvb_ca_en50221_write_data()
776 dprintk("Wrote CA packet for slot %i, connection id 0x%x last_frag:%i size:0x%x\n", slot, dvb_ca_en50221_write_data()
780 ca->pub->write_cam_control(ca->pub, slot, CTRLIF_COMMAND, IRQEN); dvb_ca_en50221_write_data()
797 * @slot: Slot to shut down.
799 static int dvb_ca_en50221_slot_shutdown(struct dvb_ca_private *ca, int slot) dvb_ca_en50221_slot_shutdown() argument
803 ca->pub->slot_shutdown(ca->pub, slot); dvb_ca_en50221_slot_shutdown()
804 ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_NONE; dvb_ca_en50221_slot_shutdown()
810 dprintk("Slot %i shutdown\n", slot); dvb_ca_en50221_slot_shutdown()
822 * @slot: Slot concerned.
825 void dvb_ca_en50221_camchange_irq(struct dvb_ca_en50221 *pubca, int slot, int change_type) dvb_ca_en50221_camchange_irq() argument
829 dprintk("CAMCHANGE IRQ slot:%i change_type:%i\n", slot, change_type); dvb_ca_en50221_camchange_irq()
840 ca->slot_info[slot].camchange_type = change_type; dvb_ca_en50221_camchange_irq()
841 atomic_inc(&ca->slot_info[slot].camchange_count); dvb_ca_en50221_camchange_irq()
851 * @slot: Slot concerned.
853 void dvb_ca_en50221_camready_irq(struct dvb_ca_en50221 *pubca, int slot) dvb_ca_en50221_camready_irq() argument
857 dprintk("CAMREADY IRQ slot:%i\n", slot); dvb_ca_en50221_camready_irq()
859 if (ca->slot_info[slot].slot_state == DVB_CA_SLOTSTATE_WAITREADY) { dvb_ca_en50221_camready_irq()
860 ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_VALIDATE; dvb_ca_en50221_camready_irq()
870 * @slot: Slot concerned.
872 void dvb_ca_en50221_frda_irq(struct dvb_ca_en50221 *pubca, int slot) dvb_ca_en50221_frda_irq() argument
877 dprintk("FR/DA IRQ slot:%i\n", slot); dvb_ca_en50221_frda_irq()
879 switch (ca->slot_info[slot].slot_state) { dvb_ca_en50221_frda_irq()
881 flags = ca->pub->read_cam_control(pubca, slot, CTRLIF_STATUS); dvb_ca_en50221_frda_irq()
884 ca->slot_info[slot].da_irq_supported = 1; dvb_ca_en50221_frda_irq()
924 int slot; dvb_ca_en50221_thread_update_delay() local
929 for (slot = 0; slot < ca->slot_count; slot++) { dvb_ca_en50221_thread_update_delay()
930 switch (ca->slot_info[slot].slot_state) { dvb_ca_en50221_thread_update_delay()
956 if ((!ca->slot_info[slot].da_irq_supported) || dvb_ca_en50221_thread_update_delay()
978 int slot; dvb_ca_en50221_thread() local
1001 for (slot = 0; slot < ca->slot_count; slot++) { dvb_ca_en50221_thread()
1003 mutex_lock(&ca->slot_info[slot].slot_lock); dvb_ca_en50221_thread()
1006 while (dvb_ca_en50221_check_camstatus(ca, slot)) { dvb_ca_en50221_thread()
1007 /* clear down an old CI slot if necessary */ dvb_ca_en50221_thread()
1008 if (ca->slot_info[slot].slot_state != DVB_CA_SLOTSTATE_NONE) dvb_ca_en50221_thread()
1009 dvb_ca_en50221_slot_shutdown(ca, slot); dvb_ca_en50221_thread()
1012 if (ca->slot_info[slot].camchange_type == DVB_CA_EN50221_CAMCHANGE_INSERTED) { dvb_ca_en50221_thread()
1013 ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_UNINITIALISED; dvb_ca_en50221_thread()
1018 atomic_dec(&ca->slot_info[slot].camchange_count); dvb_ca_en50221_thread()
1022 switch (ca->slot_info[slot].slot_state) { dvb_ca_en50221_thread()
1029 ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_WAITREADY; dvb_ca_en50221_thread()
1030 ca->pub->slot_reset(ca->pub, slot); dvb_ca_en50221_thread()
1031 ca->slot_info[slot].timeout = jiffies + (INIT_TIMEOUT_SECS * HZ); dvb_ca_en50221_thread()
1035 if (time_after(jiffies, ca->slot_info[slot].timeout)) { dvb_ca_en50221_thread()
1038 ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_INVALID; dvb_ca_en50221_thread()
1046 if (dvb_ca_en50221_parse_attributes(ca, slot) != 0) { dvb_ca_en50221_thread()
1050 status = ca->pub->poll_slot_status(ca->pub, slot, 0); dvb_ca_en50221_thread()
1052 ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_NONE; dvb_ca_en50221_thread()
1060 ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_INVALID; dvb_ca_en50221_thread()
1064 if (dvb_ca_en50221_set_configoption(ca, slot) != 0) { dvb_ca_en50221_thread()
1067 ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_INVALID; dvb_ca_en50221_thread()
1071 if (ca->pub->write_cam_control(ca->pub, slot, dvb_ca_en50221_thread()
1075 ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_INVALID; dvb_ca_en50221_thread()
1081 ca->slot_info[slot].timeout = jiffies + (INIT_TIMEOUT_SECS * HZ); dvb_ca_en50221_thread()
1082 ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_WAITFR; dvb_ca_en50221_thread()
1087 if (time_after(jiffies, ca->slot_info[slot].timeout)) { dvb_ca_en50221_thread()
1090 ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_INVALID; dvb_ca_en50221_thread()
1095 flags = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_STATUS); dvb_ca_en50221_thread()
1097 ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_LINKINIT; dvb_ca_en50221_thread()
1103 if (dvb_ca_en50221_link_init(ca, slot) != 0) { dvb_ca_en50221_thread()
1107 status = ca->pub->poll_slot_status(ca->pub, slot, 0); dvb_ca_en50221_thread()
1109 ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_NONE; dvb_ca_en50221_thread()
1116 ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_INVALID; dvb_ca_en50221_thread()
1121 if (ca->slot_info[slot].rx_buffer.data == NULL) { dvb_ca_en50221_thread()
1125 ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_INVALID; dvb_ca_en50221_thread()
1129 dvb_ringbuffer_init(&ca->slot_info[slot].rx_buffer, rxbuf, RX_BUFFER_SIZE); dvb_ca_en50221_thread()
1132 ca->pub->slot_ts_enable(ca->pub, slot); dvb_ca_en50221_thread()
1133 ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_RUNNING; dvb_ca_en50221_thread()
1144 while ((status = dvb_ca_en50221_read_data(ca, slot, NULL, 0)) > 0) { dvb_ca_en50221_thread()
1148 /* if a CAMCHANGE occurred at some point, do not do any more processing of this slot */ dvb_ca_en50221_thread()
1149 if (dvb_ca_en50221_check_camstatus(ca, slot)) { dvb_ca_en50221_thread()
1165 mutex_unlock(&ca->slot_info[slot].slot_lock); dvb_ca_en50221_thread()
1194 int slot; dvb_ca_en50221_io_do_ioctl() local
1203 for (slot = 0; slot < ca->slot_count; slot++) { dvb_ca_en50221_io_do_ioctl()
1204 mutex_lock(&ca->slot_info[slot].slot_lock); dvb_ca_en50221_io_do_ioctl()
1205 if (ca->slot_info[slot].slot_state != DVB_CA_SLOTSTATE_NONE) { dvb_ca_en50221_io_do_ioctl()
1206 dvb_ca_en50221_slot_shutdown(ca, slot); dvb_ca_en50221_io_do_ioctl()
1209 slot, dvb_ca_en50221_io_do_ioctl()
1212 mutex_unlock(&ca->slot_info[slot].slot_lock); dvb_ca_en50221_io_do_ioctl()
1291 u8 slot, connection_id; dvb_ca_en50221_io_write() local
1305 /* extract slot & connection id */ dvb_ca_en50221_io_write()
1306 if (copy_from_user(&slot, buf, 1)) dvb_ca_en50221_io_write()
1313 /* check if the slot is actually running */ dvb_ca_en50221_io_write()
1314 if (ca->slot_info[slot].slot_state != DVB_CA_SLOTSTATE_RUNNING) dvb_ca_en50221_io_write()
1319 fraglen = ca->slot_info[slot].link_buf_size - 2; dvb_ca_en50221_io_write()
1339 if (ca->slot_info[slot].slot_state != DVB_CA_SLOTSTATE_RUNNING) { dvb_ca_en50221_io_write()
1344 mutex_lock(&ca->slot_info[slot].slot_lock); dvb_ca_en50221_io_write()
1345 status = dvb_ca_en50221_write_data(ca, slot, fragbuf, fraglen + 2); dvb_ca_en50221_io_write()
1346 mutex_unlock(&ca->slot_info[slot].slot_lock); dvb_ca_en50221_io_write()
1376 int slot; dvb_ca_en50221_io_read_condition() local
1384 slot = ca->next_read_slot; dvb_ca_en50221_io_read_condition()
1386 if (ca->slot_info[slot].slot_state != DVB_CA_SLOTSTATE_RUNNING) dvb_ca_en50221_io_read_condition()
1389 if (ca->slot_info[slot].rx_buffer.data == NULL) { dvb_ca_en50221_io_read_condition()
1393 idx = dvb_ringbuffer_pkt_next(&ca->slot_info[slot].rx_buffer, -1, &fraglen); dvb_ca_en50221_io_read_condition()
1395 dvb_ringbuffer_pkt_read(&ca->slot_info[slot].rx_buffer, idx, 0, hdr, 2); dvb_ca_en50221_io_read_condition()
1399 *_slot = slot; dvb_ca_en50221_io_read_condition()
1404 idx = dvb_ringbuffer_pkt_next(&ca->slot_info[slot].rx_buffer, idx, &fraglen); dvb_ca_en50221_io_read_condition()
1408 slot = (slot + 1) % ca->slot_count; dvb_ca_en50221_io_read_condition()
1412 ca->next_read_slot = slot; dvb_ca_en50221_io_read_condition()
1435 int slot; dvb_ca_en50221_io_read() local
1450 if ((status = dvb_ca_en50221_io_read_condition(ca, &result, &slot)) == 0) { dvb_ca_en50221_io_read()
1459 (ca, &result, &slot)); dvb_ca_en50221_io_read()
1467 idx = dvb_ringbuffer_pkt_next(&ca->slot_info[slot].rx_buffer, -1, &fraglen); dvb_ca_en50221_io_read()
1476 dvb_ringbuffer_pkt_read(&ca->slot_info[slot].rx_buffer, idx, 0, hdr, 2); dvb_ca_en50221_io_read()
1487 if ((status = dvb_ringbuffer_pkt_read_user(&ca->slot_info[slot].rx_buffer, idx, 2, dvb_ca_en50221_io_read()
1499 idx2 = dvb_ringbuffer_pkt_next(&ca->slot_info[slot].rx_buffer, idx, &fraglen); dvb_ca_en50221_io_read()
1501 dvb_ringbuffer_pkt_dispose(&ca->slot_info[slot].rx_buffer, idx); dvb_ca_en50221_io_read()
1506 hdr[0] = slot; dvb_ca_en50221_io_read()
1606 int slot; dvb_ca_en50221_io_poll() local
1611 if (dvb_ca_en50221_io_read_condition(ca, &result, &slot) == 1) { dvb_ca_en50221_io_poll()
1622 if (dvb_ca_en50221_io_read_condition(ca, &result, &slot) == 1) { dvb_ca_en50221_io_poll()
1702 /* now initialise each slot */ dvb_ca_en50221_init()
H A Ddvb_ca_en50221.h44 * @slot_reset: function to reset the CAM slot
45 * @slot_shutdown: function to shutdown a CAM slot
46 * @slot_ts_enable: function to enable the Transport Stream on a CAM slot
47 * @poll_slot_status: function to poll slot status. Only necessary if
54 * and if appropriate. There will be no concurrent access to one slot.
60 int slot, int address);
62 int slot, int address, u8 value);
65 int slot, u8 address);
67 int slot, u8 address, u8 value);
69 int (*slot_reset)(struct dvb_ca_en50221 *ca, int slot);
70 int (*slot_shutdown)(struct dvb_ca_en50221 *ca, int slot);
71 int (*slot_ts_enable)(struct dvb_ca_en50221 *ca, int slot);
73 int (*poll_slot_status)(struct dvb_ca_en50221 *ca, int slot, int open);
88 * @slot: Slot concerned.
91 void dvb_ca_en50221_camchange_irq(struct dvb_ca_en50221 *pubca, int slot,
98 * @slot: Slot concerned.
100 void dvb_ca_en50221_camready_irq(struct dvb_ca_en50221 *pubca, int slot);
106 * @slot: Slot concerned.
108 void dvb_ca_en50221_frda_irq(struct dvb_ca_en50221 *ca, int slot);
/linux-4.4.14/arch/mips/pci/
H A Dfixup-rbtx4938.c16 int __init rbtx4938_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) rbtx4938_pci_map_irq() argument
18 int irq = tx4938_pcic1_map_irq(dev, slot); rbtx4938_pci_map_irq()
25 if (slot == TX4927_PCIC_IDSEL_AD_TO_SLOT(23)) { rbtx4938_pci_map_irq()
28 irq = (irq + 0 + slot) % 4; rbtx4938_pci_map_irq()
32 irq = (irq + 33 - slot) % 4; rbtx4938_pci_map_irq()
34 irq = (irq + 3 + slot) % 4; rbtx4938_pci_map_irq()
H A Dfixup-pmcmsp.c80 {0, IRQ4, IRQ4, 0, 0 }, /* 18 (AD[28]): slot 0 */
82 {0, IRQ5, IRQ5, 0, 0 }, /* 20 (AD[30]): slot 1 */
83 {0, IRQ6, IRQ6, 0, 0 } /* 21 (AD[31]): slot 2 */
107 {0, IRQ6, IRQ6, 0, 0 }, /* 6 (AD[16]): slot 3 (mini) */
108 {0, IRQ5, IRQ5, 0, 0 }, /* 7 (AD[17]): slot 2 (mini) */
109 {0, IRQ4, IRQ4, IRQ4, IRQ4}, /* 8 (AD[18]): slot 0 (PCI) */
110 {0, IRQ5, IRQ5, IRQ5, IRQ5}, /* 9 (AD[19]): slot 1 (PCI) */
194 * slot - PCI slot. Identified by which bit of the AD[] bus
196 * slot 21.
205 int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) pcibios_map_irq() argument
210 printk(KERN_WARNING "PCI: irq_tab returned %d for slot=%d pin=%d\n", pcibios_map_irq()
211 irq_tab[slot][pin], slot, pin); pcibios_map_irq()
213 return irq_tab[slot][pin]; pcibios_map_irq()
H A Dpci-tx4939.c51 int __init tx4939_pcic1_map_irq(const struct pci_dev *dev, u8 slot) tx4939_pcic1_map_irq() argument
54 switch (slot) { tx4939_pcic1_map_irq()
71 int __init tx4939_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) tx4939_pci_map_irq() argument
73 int irq = tx4939_pcic1_map_irq(dev, slot); tx4939_pci_map_irq()
80 irq = (irq + 33 - slot) % 4; tx4939_pci_map_irq()
H A Dfixup-jmr3927.c34 int __init jmr3927_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) jmr3927_pci_map_irq() argument
40 if (slot == TX3927_PCIC_IDSEL_AD_TO_SLOT(23)) { jmr3927_pci_map_irq()
45 } else if (slot == TX3927_PCIC_IDSEL_AD_TO_SLOT(22)) { jmr3927_pci_map_irq()
53 irq = (irq + 33 - slot) % 4; jmr3927_pci_map_irq()
55 irq = (irq + 3 + slot) % 4; jmr3927_pci_map_irq()
76 slot == TX3927_PCIC_IDSEL_AD_TO_SLOT(24)) jmr3927_pci_map_irq()
H A Dfixup-lantiq.c26 int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) pcibios_map_irq() argument
28 return of_irq_parse_and_map_pci(dev, slot, pin); pcibios_map_irq()
H A Dpci-ip27.c37 * Translate from irq to software PCI bus number and PCI slot.
50 int slot; bridge_probe() local
97 * Until otherwise set up, assume all interrupts are from slot 0 bridge_probe()
121 for (slot = 0; slot < 8; slot ++) { bridge_probe()
122 bridge->b_device[slot].reg |= BRIDGE_DEV_SWAP_DIR; bridge_probe()
123 bc->pci_int[slot] = -1; bridge_probe()
145 int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) pcibios_map_irq() argument
165 int slot = PCI_SLOT(rdev->devfn); pcibios_plat_dev_init() local
168 irq = bc->pci_int[slot]; pcibios_plat_dev_init()
174 bc->pci_int[slot] = irq; pcibios_plat_dev_init()
178 irq_to_slot[irq] = slot; pcibios_plat_dev_init()
187 * to find the slot number in sense of the bridge device register.
196 int slot = PCI_SLOT(dev->devfn); pci_disable_swapping() local
199 bridge->b_device[slot].reg &= ~BRIDGE_DEV_SWAP_DIR; pci_disable_swapping()
207 int slot = PCI_SLOT(dev->devfn); pci_enable_swapping() local
210 bridge->b_device[slot].reg |= BRIDGE_DEV_SWAP_DIR; pci_enable_swapping()
H A Dfixup-bcm63xx.c13 int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) pcibios_map_irq() argument
H A Dfixup-ip32.c11 * 2 expansion slot
36 * Given a PCI slot number (a la PCI_SLOT(...)) and the interrupt pin of
42 int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) pcibios_map_irq() argument
44 return irq_tab_mace[slot][pin]; pcibios_map_irq()
H A Dfixup-emma2rh.c37 * we fix up irqs based on the slot number.
40 * they all have different slot numbers (except for rockhopper slot 20
88 int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) pcibios_map_irq() argument
90 return irq_map[slot][pin]; pcibios_map_irq()
H A Dfixup-rbtx4927.c39 int __init rbtx4927_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) rbtx4927_pci_map_irq() argument
45 if (slot == TX4927_PCIC_IDSEL_AD_TO_SLOT(23)) { rbtx4927_pci_map_irq()
48 irq = (irq + 0 + slot) % 4; rbtx4927_pci_map_irq()
52 irq = (irq + 33 - slot) % 4; rbtx4927_pci_map_irq()
54 irq = (irq + 3 + slot) % 4; rbtx4927_pci_map_irq()
H A Dfixup-sni.c133 int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) pcibios_map_irq() argument
137 if (slot == 4) { pcibios_map_irq()
145 slot = 5; pcibios_map_irq()
147 return irq_tab_pcit_cplus[slot][pin]; pcibios_map_irq()
149 return irq_tab_pcit[slot][pin]; pcibios_map_irq()
153 return irq_tab_rm300d[slot][pin]; pcibios_map_irq()
157 return irq_tab_rm200[slot][pin]; pcibios_map_irq()
160 return irq_tab_rm300e[slot][pin]; pcibios_map_irq()
H A Dfixup-mpc30x.c37 int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) pcibios_map_irq() argument
39 if (slot == 30) pcibios_map_irq()
42 return irq_tab_mpc30x[slot]; pcibios_map_irq()
H A Dpci-lasat.c64 int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) pcibios_map_irq() argument
66 switch (slot) { pcibios_map_irq()
70 return LASAT_IRQ_PCIA + (((slot-1) + (pin-1)) % 4); pcibios_map_irq()
/linux-4.4.14/block/partitions/
H A Dkarma.c16 int slot = 1; karma_partition() local
45 if (slot == state->limit) karma_partition()
49 put_partition(state, slot, le32_to_cpu(p->p_offset), karma_partition()
52 slot++; karma_partition()
H A Dacorn.c32 unsigned long first_sector, int slot) adfs_partition()
53 put_partition(state, slot, first_sector, nr_sects); adfs_partition()
77 unsigned long first_sect, int slot, riscix_partition()
96 put_partition(state, slot++, first_sect, size); riscix_partition()
100 put_partition(state, slot++, riscix_partition()
111 put_partition(state, slot++, first_sect, nr_sects); riscix_partition()
115 return slot; riscix_partition()
132 unsigned long first_sect, int slot, linux_partition()
141 put_partition(state, slot++, first_sect, size); linux_partition()
150 if (slot == state->limit) linux_partition()
152 put_partition(state, slot++, first_sect + linux_partition()
160 return slot; linux_partition()
173 int slot = 1; adfspart_check_CUMANA() local
196 if (slot == state->limit) adfspart_check_CUMANA()
199 dr = adfs_partition(state, name, data, first_sector, slot++); adfspart_check_CUMANA()
224 slot = riscix_partition(state, first_sector, slot, adfspart_check_CUMANA()
230 slot = linux_partition(state, first_sector, slot, adfspart_check_CUMANA()
235 if (slot == -1) adfspart_check_CUMANA()
263 int slot = 1; adfspart_check_ADFS() local
269 dr = adfs_partition(state, "ADFS", data, 0, slot++); adfspart_check_ADFS()
291 slot = riscix_partition(state, start_sect, slot, adfspart_check_ADFS()
297 slot = linux_partition(state, start_sect, slot, adfspart_check_ADFS()
360 int slot; adfspart_check_ICS() local
377 for (slot = 1, p = (const struct ics_part *)data; p->size; p++) { adfspart_check_ICS()
381 if (slot == state->limit) adfspart_check_ICS()
405 put_partition(state, slot++, start, size); adfspart_check_ICS()
457 int slot = 1; adfspart_check_POWERTEC() local
476 put_partition(state, slot++, start, size); adfspart_check_POWERTEC()
520 int i, slot = 1; adfspart_check_EESOX() local
542 put_partition(state, slot++, start, next - start); adfspart_check_EESOX()
550 put_partition(state, slot++, start, size - start); adfspart_check_EESOX()
31 adfs_partition(struct parsed_partitions *state, char *name, char *data, unsigned long first_sector, int slot) adfs_partition() argument
76 riscix_partition(struct parsed_partitions *state, unsigned long first_sect, int slot, unsigned long nr_sects) riscix_partition() argument
131 linux_partition(struct parsed_partitions *state, unsigned long first_sect, int slot, unsigned long nr_sects) linux_partition() argument
H A Datari.c40 int slot; atari_partition() local
66 for (slot = 1; pi < &rs->part[4] && slot < state->limit; slot++, pi++) { atari_partition()
76 put_partition (state, slot, be32_to_cpu(pi->st), atari_partition()
101 put_partition(state, slot, atari_partition()
118 if (++slot == state->limit) { atari_partition()
131 for (; pi < &rs->icdpart[8] && slot < state->limit; slot++, pi++) { atari_partition()
136 put_partition (state, slot, atari_partition()
H A Dcmdline.c25 static int add_part(int slot, struct cmdline_subpart *subpart, void *param) add_part() argument
32 if (slot >= state->limit) add_part()
35 put_partition(state, slot, subpart->from >> 9, add_part()
38 info = &state->parts[slot].info; add_part()
48 state->parts[slot].has_info = true; add_part()
H A Dmac.c34 int slot, blocks_in_map; mac_partition() local
75 for (slot = 1; slot <= blocks_in_map; ++slot) { mac_partition()
76 int pos = slot * secsize; mac_partition()
84 put_partition(state, slot, mac_partition()
89 state->parts[slot].flags = ADDPART_FLAG_RAID; mac_partition()
127 found_root = slot; mac_partition()
H A Dosf.c18 int slot = 1; osf_partition() local
75 if (slot == state->limit) osf_partition()
78 put_partition(state, slot, osf_partition()
81 slot++; osf_partition()
H A Dsgi.c34 int slot = 1; sgi_partition() local
73 put_partition(state, slot, start, blocks); sgi_partition()
75 state->parts[slot].flags = ADDPART_FLAG_RAID; sgi_partition()
77 slot++; sgi_partition()
H A Dsysv68.c52 int slot = 1; sysv68_partition() local
81 if (slot == state->limit) sysv68_partition()
84 put_partition(state, slot, sysv68_partition()
90 slot++; sysv68_partition()
H A Dmsdos.c13 * /dev/hda *must* have a "DOS" type 0x51 partition in the first slot (hda1).
73 int slot, ret = 0; aix_magic_present() local
81 for (slot = 1; slot <= 4; slot++, pt++) { aix_magic_present()
98 static void set_info(struct parsed_partitions *state, int slot, set_info() argument
101 struct partition_meta_info *info = &state->parts[slot].info; set_info()
104 slot); set_info()
106 state->parts[slot].has_info = true; set_info()
454 int slot; msdos_partition() local
487 for (slot = 1; slot <= 4; slot++, p++) { msdos_partition()
495 if (slot == 1 && fb->reserved && fb->fats msdos_partition()
509 for (slot = 1 ; slot <= 4 ; slot++, p++) { msdos_partition()
528 for (slot = 1 ; slot <= 4 ; slot++, p++) { msdos_partition()
544 put_partition(state, slot, start, n); msdos_partition()
551 put_partition(state, slot, start, size); msdos_partition()
552 set_info(state, slot, disksig); msdos_partition()
554 state->parts[slot].flags = ADDPART_FLAG_RAID; msdos_partition()
565 for (slot = 1 ; slot <= 4 ; slot++, p++) { msdos_partition()
578 nr_sects(p) * sector_size, slot); msdos_partition()
H A Dsun.c17 int slot = 1; sun_partition() local
108 put_partition(state, slot, st_sector, num_sectors); sun_partition()
109 state->parts[slot].flags = 0; sun_partition()
112 state->parts[slot].flags |= ADDPART_FLAG_RAID; sun_partition()
114 state->parts[slot].flags |= ADDPART_FLAG_WHOLEDISK; sun_partition()
117 slot++; sun_partition()
/linux-4.4.14/sound/soc/blackfin/
H A Dbf5xx-ac97.h14 u16 ac97_tag; /* slot 0 */
15 u16 ac97_addr; /* slot 1 */
16 u16 ac97_data; /* slot 2 */
17 u16 ac97_pcm_l; /*slot 3:front left*/
18 u16 ac97_pcm_r; /*slot 4:front left*/
21 u16 ac97_center; /*slot 6:center*/
22 u16 ac97_sl; /*slot 7:surround left*/
23 u16 ac97_sr; /*slot 8:surround right*/
24 u16 ac97_lfe; /*slot 9:lfe*/
/linux-4.4.14/include/linux/input/
H A Dmt.h25 * struct input_mt_slot - represents the state of an input MT slot
26 * @abs: holds current values of ABS_MT axes for this slot
28 * @key: optional driver designation of this slot
40 * @slot: MT slot currently being transmitted
49 int slot; member in struct:input_mt
56 static inline void input_mt_set_value(struct input_mt_slot *slot, input_mt_set_value() argument
59 slot->abs[code - ABS_MT_FIRST] = value; input_mt_set_value()
62 static inline int input_mt_get_value(const struct input_mt_slot *slot, input_mt_get_value() argument
65 return slot->abs[code - ABS_MT_FIRST]; input_mt_get_value()
68 static inline bool input_mt_is_active(const struct input_mt_slot *slot) input_mt_is_active() argument
70 return input_mt_get_value(slot, ABS_MT_TRACKING_ID) >= 0; input_mt_is_active()
74 const struct input_mt_slot *slot) input_mt_is_used()
76 return slot->frame == mt->frame; input_mt_is_used()
88 static inline void input_mt_slot(struct input_dev *dev, int slot) input_mt_slot() argument
90 input_event(dev, EV_ABS, ABS_MT_SLOT, slot); input_mt_slot()
73 input_mt_is_used(const struct input_mt *mt, const struct input_mt_slot *slot) input_mt_is_used() argument
/linux-4.4.14/mm/
H A Dearly_ioremap.c104 int i, slot; __early_ioremap() local
108 slot = -1; __early_ioremap()
111 slot = i; __early_ioremap()
116 if (WARN(slot < 0, "%s(%08llx, %08lx) not found slot\n", __early_ioremap()
125 prev_size[slot] = size; __early_ioremap()
143 idx = FIX_BTMAP_BEGIN - NR_FIX_BTMAPS*slot; __early_ioremap()
154 __func__, (u64)phys_addr, size, slot, offset, slot_virt[slot]); __early_ioremap()
156 prev_map[slot] = (void __iomem *)(offset + slot_virt[slot]); __early_ioremap()
157 return prev_map[slot]; __early_ioremap()
166 int i, slot; early_iounmap() local
168 slot = -1; early_iounmap()
171 slot = i; early_iounmap()
176 if (WARN(slot < 0, "early_iounmap(%p, %08lx) not found slot\n", early_iounmap()
180 if (WARN(prev_size[slot] != size, early_iounmap()
182 addr, size, slot, prev_size[slot])) early_iounmap()
186 addr, size, slot); early_iounmap()
195 idx = FIX_BTMAP_BEGIN - NR_FIX_BTMAPS*slot; early_iounmap()
204 prev_map[slot] = NULL; early_iounmap()
/linux-4.4.14/sound/core/oss/
H A Dmixer_oss.c259 static int snd_mixer_oss_get_volume(struct snd_mixer_oss_file *fmixer, int slot) snd_mixer_oss_get_volume() argument
265 if (mixer == NULL || slot > 30) snd_mixer_oss_get_volume()
267 pslot = &mixer->slots[slot]; snd_mixer_oss_get_volume()
287 int slot, int volume) snd_mixer_oss_set_volume()
293 if (mixer == NULL || slot > 30) snd_mixer_oss_set_volume()
295 pslot = &mixer->slots[slot]; snd_mixer_oss_set_volume()
447 static void snd_mixer_oss_recsrce_set(struct snd_card *card, int slot)
451 mixer->mask_recsrc |= 1 << slot;
454 static int snd_mixer_oss_recsrce_get(struct snd_card *card, int slot)
457 if (mixer && (mixer->mask_recsrc & (1 << slot)))
491 struct slot { struct
595 struct slot *slot = pslot->private_data; snd_mixer_oss_get_volume1() local
598 if (slot->present & SNDRV_MIXER_OSS_PRESENT_PVOLUME) { snd_mixer_oss_get_volume1()
599 snd_mixer_oss_get_volume1_vol(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_PVOLUME], left, right); snd_mixer_oss_get_volume1()
600 } else if (slot->present & SNDRV_MIXER_OSS_PRESENT_GVOLUME) { snd_mixer_oss_get_volume1()
601 snd_mixer_oss_get_volume1_vol(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_GVOLUME], left, right); snd_mixer_oss_get_volume1()
602 } else if (slot->present & SNDRV_MIXER_OSS_PRESENT_GLOBAL) { snd_mixer_oss_get_volume1()
603 snd_mixer_oss_get_volume1_vol(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_GLOBAL], left, right); snd_mixer_oss_get_volume1()
605 if (slot->present & SNDRV_MIXER_OSS_PRESENT_PSWITCH) { snd_mixer_oss_get_volume1()
606 snd_mixer_oss_get_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_PSWITCH], left, right, 0); snd_mixer_oss_get_volume1()
607 } else if (slot->present & SNDRV_MIXER_OSS_PRESENT_GSWITCH) { snd_mixer_oss_get_volume1()
608 snd_mixer_oss_get_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_GSWITCH], left, right, 0); snd_mixer_oss_get_volume1()
609 } else if (slot->present & SNDRV_MIXER_OSS_PRESENT_PROUTE) { snd_mixer_oss_get_volume1()
610 snd_mixer_oss_get_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_PROUTE], left, right, 1); snd_mixer_oss_get_volume1()
611 } else if (slot->present & SNDRV_MIXER_OSS_PRESENT_GROUTE) { snd_mixer_oss_get_volume1()
612 snd_mixer_oss_get_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_GROUTE], left, right, 1); snd_mixer_oss_get_volume1()
706 struct slot *slot = pslot->private_data; snd_mixer_oss_put_volume1() local
708 if (slot->present & SNDRV_MIXER_OSS_PRESENT_PVOLUME) { snd_mixer_oss_put_volume1()
709 snd_mixer_oss_put_volume1_vol(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_PVOLUME], left, right); snd_mixer_oss_put_volume1()
710 if (slot->present & SNDRV_MIXER_OSS_PRESENT_CVOLUME) snd_mixer_oss_put_volume1()
711 snd_mixer_oss_put_volume1_vol(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_CVOLUME], left, right); snd_mixer_oss_put_volume1()
712 } else if (slot->present & SNDRV_MIXER_OSS_PRESENT_CVOLUME) { snd_mixer_oss_put_volume1()
714 slot->numid[SNDRV_MIXER_OSS_ITEM_CVOLUME], left, right); snd_mixer_oss_put_volume1()
715 } else if (slot->present & SNDRV_MIXER_OSS_PRESENT_GVOLUME) { snd_mixer_oss_put_volume1()
716 snd_mixer_oss_put_volume1_vol(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_GVOLUME], left, right); snd_mixer_oss_put_volume1()
717 } else if (slot->present & SNDRV_MIXER_OSS_PRESENT_GLOBAL) { snd_mixer_oss_put_volume1()
718 snd_mixer_oss_put_volume1_vol(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_GLOBAL], left, right); snd_mixer_oss_put_volume1()
721 if (slot->present & SNDRV_MIXER_OSS_PRESENT_PSWITCH) snd_mixer_oss_put_volume1()
722 snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_PSWITCH], left, right, 0); snd_mixer_oss_put_volume1()
723 if (slot->present & SNDRV_MIXER_OSS_PRESENT_CSWITCH) snd_mixer_oss_put_volume1()
724 snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_CSWITCH], left, right, 0); snd_mixer_oss_put_volume1()
725 if (slot->present & SNDRV_MIXER_OSS_PRESENT_GSWITCH) snd_mixer_oss_put_volume1()
726 snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_GSWITCH], left, right, 0); snd_mixer_oss_put_volume1()
727 if (slot->present & SNDRV_MIXER_OSS_PRESENT_PROUTE) snd_mixer_oss_put_volume1()
728 snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_PROUTE], left, right, 1); snd_mixer_oss_put_volume1()
729 if (slot->present & SNDRV_MIXER_OSS_PRESENT_CROUTE) snd_mixer_oss_put_volume1()
730 snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_CROUTE], left, right, 1); snd_mixer_oss_put_volume1()
731 if (slot->present & SNDRV_MIXER_OSS_PRESENT_GROUTE) snd_mixer_oss_put_volume1()
732 snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_GROUTE], left, right, 1); snd_mixer_oss_put_volume1()
734 if (slot->present & SNDRV_MIXER_OSS_PRESENT_PSWITCH) { snd_mixer_oss_put_volume1()
735 snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_PSWITCH], left, right, 0); snd_mixer_oss_put_volume1()
736 } else if (slot->present & SNDRV_MIXER_OSS_PRESENT_CSWITCH) { snd_mixer_oss_put_volume1()
737 snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_CSWITCH], left, right, 0); snd_mixer_oss_put_volume1()
738 } else if (slot->present & SNDRV_MIXER_OSS_PRESENT_GSWITCH) { snd_mixer_oss_put_volume1()
739 snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_GSWITCH], left, right, 0); snd_mixer_oss_put_volume1()
740 } else if (slot->present & SNDRV_MIXER_OSS_PRESENT_PROUTE) { snd_mixer_oss_put_volume1()
741 snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_PROUTE], left, right, 1); snd_mixer_oss_put_volume1()
742 } else if (slot->present & SNDRV_MIXER_OSS_PRESENT_CROUTE) { snd_mixer_oss_put_volume1()
743 snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_CROUTE], left, right, 1); snd_mixer_oss_put_volume1()
744 } else if (slot->present & SNDRV_MIXER_OSS_PRESENT_GROUTE) { snd_mixer_oss_put_volume1()
745 snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_GROUTE], left, right, 1); snd_mixer_oss_put_volume1()
755 struct slot *slot = pslot->private_data; snd_mixer_oss_get_recsrc1_sw() local
759 snd_mixer_oss_get_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_CSWITCH], &left, &right, 0); snd_mixer_oss_get_recsrc1_sw()
768 struct slot *slot = pslot->private_data; snd_mixer_oss_get_recsrc1_route() local
772 snd_mixer_oss_get_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_CROUTE], &left, &right, 1); snd_mixer_oss_get_recsrc1_route()
781 struct slot *slot = pslot->private_data; snd_mixer_oss_put_recsrc1_sw() local
783 snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_CSWITCH], active, active, 0); snd_mixer_oss_put_recsrc1_sw()
791 struct slot *slot = pslot->private_data; snd_mixer_oss_put_recsrc1_route() local
793 snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_CROUTE], active, active, 1); snd_mixer_oss_put_recsrc1_route()
803 struct slot *slot; snd_mixer_oss_get_recsrc2() local
828 slot = pslot->private_data; snd_mixer_oss_get_recsrc2()
829 if (slot->signature != SNDRV_MIXER_OSS_SIGNATURE) snd_mixer_oss_get_recsrc2()
831 if (!(slot->present & SNDRV_MIXER_OSS_PRESENT_CAPTURE)) snd_mixer_oss_get_recsrc2()
833 if (slot->capture_item == uctl->value.enumerated.item[0]) { snd_mixer_oss_get_recsrc2()
853 struct slot *slot = NULL; snd_mixer_oss_put_recsrc2() local
877 slot = pslot->private_data; snd_mixer_oss_put_recsrc2()
878 if (slot->signature != SNDRV_MIXER_OSS_SIGNATURE) snd_mixer_oss_put_recsrc2()
880 if (!(slot->present & SNDRV_MIXER_OSS_PRESENT_CAPTURE)) snd_mixer_oss_put_recsrc2()
884 slot = NULL; snd_mixer_oss_put_recsrc2()
886 if (! slot) snd_mixer_oss_put_recsrc2()
889 uctl->value.enumerated.item[idx] = slot->capture_item; snd_mixer_oss_put_recsrc2()
908 static int snd_mixer_oss_build_test(struct snd_mixer_oss *mixer, struct slot *slot, const char *name, int index, int item) snd_mixer_oss_build_test() argument
931 slot->numid[item] = kcontrol->id.numid; snd_mixer_oss_build_test()
933 if (info->count > slot->channels) snd_mixer_oss_build_test()
934 slot->channels = info->count; snd_mixer_oss_build_test()
935 slot->present |= 1 << item; snd_mixer_oss_build_test()
942 struct slot *p = chn->private_data; snd_mixer_oss_slot_free()
965 struct slot *slot) snd_mixer_oss_build_test_all()
970 err = snd_mixer_oss_build_test(mixer, slot, ptr->name, ptr->index, snd_mixer_oss_build_test_all()
975 err = snd_mixer_oss_build_test(mixer, slot, str, ptr->index, snd_mixer_oss_build_test_all()
980 err = snd_mixer_oss_build_test(mixer, slot, str, ptr->index, snd_mixer_oss_build_test_all()
985 err = snd_mixer_oss_build_test(mixer, slot, str, ptr->index, snd_mixer_oss_build_test_all()
990 err = snd_mixer_oss_build_test(mixer, slot, str, ptr->index, snd_mixer_oss_build_test_all()
995 err = snd_mixer_oss_build_test(mixer, slot, str, ptr->index, snd_mixer_oss_build_test_all()
1000 err = snd_mixer_oss_build_test(mixer, slot, str, ptr->index, snd_mixer_oss_build_test_all()
1005 err = snd_mixer_oss_build_test(mixer, slot, str, ptr->index, snd_mixer_oss_build_test_all()
1010 err = snd_mixer_oss_build_test(mixer, slot, str, ptr->index, snd_mixer_oss_build_test_all()
1015 err = snd_mixer_oss_build_test(mixer, slot, str, ptr->index, snd_mixer_oss_build_test_all()
1030 struct slot slot; snd_mixer_oss_build_input() local
1031 struct slot *pslot; snd_mixer_oss_build_input()
1040 memset(&slot, 0, sizeof(slot)); snd_mixer_oss_build_input()
1041 memset(slot.numid, 0xff, sizeof(slot.numid)); /* ID_UNKNOWN */ snd_mixer_oss_build_input()
1042 if (snd_mixer_oss_build_test_all(mixer, ptr, &slot)) snd_mixer_oss_build_input()
1064 slot.capture_item = 0; snd_mixer_oss_build_input()
1066 slot.present |= SNDRV_MIXER_OSS_PRESENT_CAPTURE; snd_mixer_oss_build_input()
1068 for (slot.capture_item = 1; slot.capture_item < uinfo->value.enumerated.items; slot.capture_item++) { snd_mixer_oss_build_input()
1069 uinfo->value.enumerated.item = slot.capture_item; snd_mixer_oss_build_input()
1076 slot.present |= SNDRV_MIXER_OSS_PRESENT_CAPTURE; snd_mixer_oss_build_input()
1084 if (slot.present != 0) { snd_mixer_oss_build_input()
1085 pslot = kmalloc(sizeof(slot), GFP_KERNEL); snd_mixer_oss_build_input()
1088 *pslot = slot; snd_mixer_oss_build_input()
1094 rslot->stereo = slot.channels > 1 ? 1 : 0; snd_mixer_oss_build_input()
1098 if (slot.present & SNDRV_MIXER_OSS_PRESENT_CSWITCH) { snd_mixer_oss_build_input()
1101 } else if (slot.present & SNDRV_MIXER_OSS_PRESENT_CROUTE) { snd_mixer_oss_build_input()
1104 } else if (slot.present & SNDRV_MIXER_OSS_PRESENT_CAPTURE) { snd_mixer_oss_build_input()
1158 struct slot *p; snd_mixer_oss_proc_read()
1162 p = (struct slot *)mixer->slots[i].private_data; snd_mixer_oss_proc_read()
1183 struct slot *slot; snd_mixer_oss_proc_write() local
1210 slot = (struct slot *)mixer->slots[ch].private_data; snd_mixer_oss_proc_write()
1211 if (slot && slot->assigned && snd_mixer_oss_proc_write()
1212 slot->assigned->index == idx && ! strcmp(slot->assigned->name, str)) snd_mixer_oss_proc_write()
286 snd_mixer_oss_set_volume(struct snd_mixer_oss_file *fmixer, int slot, int volume) snd_mixer_oss_set_volume() argument
963 snd_mixer_oss_build_test_all(struct snd_mixer_oss *mixer, struct snd_mixer_oss_assign_table *ptr, struct slot *slot) snd_mixer_oss_build_test_all() argument
/linux-4.4.14/include/linux/
H A Dpci_hotplug.h35 * @enable_slot: Called when the user wants to enable a specific pci slot
36 * @disable_slot: Called when the user wants to disable a specific pci slot
37 * @set_attention_status: Called to set the specific slot's attention LED to
40 * slot.
41 * @get_power_status: Called to get the current power status of a slot.
44 * @get_attention_status: Called to get the current attention status of a slot.
47 * @get_latch_status: Called to get the current latch status of a slot.
50 * @get_adapter_status: Called to get see if an adapter is present in the slot or not.
54 * slot for cases where a secondary bus reset can result in spurious
55 * hotplug events or where a slot can be reset independent of the bus.
59 * the user wants to do something to a specific slot (query it for information,
65 int (*enable_slot) (struct hotplug_slot *slot);
66 int (*disable_slot) (struct hotplug_slot *slot);
67 int (*set_attention_status) (struct hotplug_slot *slot, u8 value);
68 int (*hardware_test) (struct hotplug_slot *slot, u32 value);
69 int (*get_power_status) (struct hotplug_slot *slot, u8 *value);
70 int (*get_attention_status) (struct hotplug_slot *slot, u8 *value);
71 int (*get_latch_status) (struct hotplug_slot *slot, u8 *value);
72 int (*get_adapter_status) (struct hotplug_slot *slot, u8 *value);
73 int (*reset_slot) (struct hotplug_slot *slot, int probe);
77 * struct hotplug_slot_info - used to notify the hotplug pci core of the state of the slot
81 * @adapter_status: if there is a pci board present in the slot or not (1/0)
83 * Used to notify the hotplug pci core of the status of a specific slot.
93 * struct hotplug_slot - used to register a physical slot with the hotplug pci core
94 * @ops: pointer to the &struct hotplug_slot_ops to be used for this slot
96 * this slot.
105 void (*release) (struct hotplug_slot *slot);
113 static inline const char *hotplug_slot_name(const struct hotplug_slot *slot) hotplug_slot_name() argument
115 return pci_slot_name(slot->pci_slot); hotplug_slot_name()
118 int __pci_hp_register(struct hotplug_slot *slot, struct pci_bus *pbus, int nr,
121 int pci_hp_deregister(struct hotplug_slot *slot);
122 int __must_check pci_hp_change_slot_info(struct hotplug_slot *slot,
126 #define pci_hp_register(slot, pbus, devnr, name) \
127 __pci_hp_register(slot, pbus, devnr, name, THIS_MODULE, KBUILD_MODNAME)
H A Datmel-mci.h9 * struct mci_slot_pdata - board-specific per-slot configuration
10 * @bus_width: Number of data lines wired up the slot
14 * @non_removable: The slot is not removable, only detect once
16 * If a given slot is not present on the board, @bus_width should be
36 * @slot: Per-slot configuration data.
40 struct mci_slot_pdata slot[ATMCI_MAX_NR_SLOTS]; member in struct:mci_platform_data
H A Dradix-tree.h182 * radix_tree_deref_slot - dereference a slot
183 * @pslot: pointer to slot, returned by radix_tree_lookup_slot
184 * Returns: item that was stored in that slot with any direct pointer flag
188 * locked across slot lookup and dereference. Not required if write lock is
200 * radix_tree_deref_slot_protected - dereference a slot without RCU lock but with tree lock held
201 * @pslot: pointer to slot, returned by radix_tree_lookup_slot
202 * Returns: item that was stored in that slot with any direct pointer flag
250 * radix_tree_replace_slot - replace item in a slot
251 * @pslot: pointer to slot, returned by radix_tree_lookup_slot
252 * @item: new item to store in the slot.
255 * across slot lookup and replacement.
312 * @index: index of current slot
318 * described by a pointer to its first slot and a struct radix_tree_iter
362 * Returns: pointer to chunk first slot, or NULL if there no more left
365 * @iter->next_index. It returns a pointer to the chunk's first slot.
377 * against deletion or creation may result in seeing a slot for which
401 * radix_tree_next_slot - find next slot in chunk
403 * @slot: pointer to current slot
406 * Returns: pointer to next slot, or NULL if there no more left
412 radix_tree_next_slot(void **slot, struct radix_tree_iter *iter, unsigned flags) radix_tree_next_slot() argument
418 return slot + 1; radix_tree_next_slot()
425 return slot + offset + 1; radix_tree_next_slot()
431 slot++; radix_tree_next_slot()
433 if (likely(*slot)) radix_tree_next_slot()
434 return slot; radix_tree_next_slot()
448 * @slot: the void** variable for pointer to chunk first slot
456 #define radix_tree_for_each_chunk(slot, root, iter, start, flags) \
457 for (slot = radix_tree_iter_init(iter, start) ; \
458 (slot = radix_tree_next_chunk(root, iter, flags)) ;)
463 * @slot: the void** variable, at the beginning points to chunk first slot
468 * @slot points to the radix tree slot, @iter->index contains its index.
470 #define radix_tree_for_each_chunk_slot(slot, iter, flags) \
471 for (; slot ; slot = radix_tree_next_slot(slot, iter, flags))
476 * @slot: the void** variable for pointer to slot
481 * @slot points to radix tree slot, @iter->index contains its index.
483 #define radix_tree_for_each_slot(slot, root, iter, start) \
484 for (slot = radix_tree_iter_init(iter, start) ; \
485 slot || (slot = radix_tree_next_chunk(root, iter, 0)) ; \
486 slot = radix_tree_next_slot(slot, iter, 0))
491 * @slot: the void** variable for pointer to slot
496 * @slot points to radix tree slot, @iter->index contains its index.
498 #define radix_tree_for_each_contig(slot, root, iter, start) \
499 for (slot = radix_tree_iter_init(iter, start) ; \
500 slot || (slot = radix_tree_next_chunk(root, iter, \
502 slot = radix_tree_next_slot(slot, iter, \
508 * @slot: the void** variable for pointer to slot
514 * @slot points to radix tree slot, @iter->index contains its index.
516 #define radix_tree_for_each_tagged(slot, root, iter, start, tag) \
517 for (slot = radix_tree_iter_init(iter, start) ; \
518 slot || (slot = radix_tree_next_chunk(root, iter, \
520 slot = radix_tree_next_slot(slot, iter, \
H A Dcb710.h24 /* per-virtual-slot structure */
42 struct cb710_slot slot[0]; member in struct:cb710_chip
53 /* slot port accessors - so the logic is more clear in the code */
55 static inline void cb710_write_port_##t(struct cb710_slot *slot, \
58 iowrite##t(value, slot->iobase + port); \
61 static inline u##t cb710_read_port_##t(struct cb710_slot *slot, \
64 return ioread##t(slot->iobase + port); \
67 static inline void cb710_modify_port_##t(struct cb710_slot *slot, \
71 (ioread##t(slot->iobase + port) & ~clear)|set, \
72 slot->iobase + port); \
81 void cb710_set_irq_handler(struct cb710_slot *slot,
92 static inline struct cb710_chip *cb710_slot_to_chip(struct cb710_slot *slot) cb710_slot_to_chip() argument
94 return dev_get_drvdata(slot->pdev.dev.parent); cb710_slot_to_chip()
97 static inline struct device *cb710_slot_dev(struct cb710_slot *slot) cb710_slot_dev() argument
99 return &slot->pdev.dev; cb710_slot_dev()
H A Deisa.h31 * signature, slot number, and base address. dma_mask is set by
36 int slot; member in struct:eisa_device
96 int slots; /* Max slot number */
97 int force_probe; /* Probe even when no slot 0 */
/linux-4.4.14/arch/arm/mach-pxa/
H A Dcm-x2xx-pci.c80 static int __init cmx2xx_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) cmx2xx_pci_map_irq() argument
84 dev_dbg(&dev->dev, "%s: slot=%x, pin=%x\n", __func__, slot, pin); cmx2xx_pci_map_irq()
86 irq = it8152_pci_map_irq(dev, slot, pin); cmx2xx_pci_map_irq()
95 /* ATXBASE PCI slot */ cmx2xx_pci_map_irq()
96 if (slot == 7) cmx2xx_pci_map_irq()
100 if (slot == 8 || slot == 0) cmx2xx_pci_map_irq()
104 if (slot == 9) cmx2xx_pci_map_irq()
108 if (slot == 15) cmx2xx_pci_map_irq()
112 if (slot == 16) cmx2xx_pci_map_irq()
116 if ((slot == 17) || (slot == 19)) cmx2xx_pci_map_irq()
118 if ((slot == 18) || (slot == 20)) cmx2xx_pci_map_irq()
/linux-4.4.14/drivers/media/pci/cx23885/
H A Dcimax2.h27 int slot, int addr);
29 int slot, int addr, u8 data);
31 int slot, u8 addr);
33 int slot, u8 addr, u8 data);
34 extern int netup_ci_slot_reset(struct dvb_ca_en50221 *en50221, int slot);
35 extern int netup_ci_slot_shutdown(struct dvb_ca_en50221 *en50221, int slot);
36 extern int netup_ci_slot_ts_ctl(struct dvb_ca_en50221 *en50221, int slot);
39 int slot, int open);
H A Dcimax2.c177 static int netup_ci_op_cam(struct dvb_ca_en50221 *en50221, int slot, netup_ci_op_cam() argument
188 if (0 != slot) netup_ci_op_cam()
248 int slot, int addr) netup_ci_read_attribute_mem()
250 return netup_ci_op_cam(en50221, slot, 0, NETUP_CI_RD, addr, 0); netup_ci_read_attribute_mem()
254 int slot, int addr, u8 data) netup_ci_write_attribute_mem()
256 return netup_ci_op_cam(en50221, slot, 0, 0, addr, data); netup_ci_write_attribute_mem()
259 int netup_ci_read_cam_ctl(struct dvb_ca_en50221 *en50221, int slot, netup_ci_read_cam_ctl() argument
262 return netup_ci_op_cam(en50221, slot, NETUP_CI_CTL, netup_ci_read_cam_ctl()
266 int netup_ci_write_cam_ctl(struct dvb_ca_en50221 *en50221, int slot, netup_ci_write_cam_ctl() argument
269 return netup_ci_op_cam(en50221, slot, NETUP_CI_CTL, 0, addr, data); netup_ci_write_cam_ctl()
272 int netup_ci_slot_reset(struct dvb_ca_en50221 *en50221, int slot) netup_ci_slot_reset() argument
278 if (0 != slot) netup_ci_slot_reset()
301 int netup_ci_slot_shutdown(struct dvb_ca_en50221 *en50221, int slot) netup_ci_slot_shutdown() argument
328 int netup_ci_slot_ts_ctl(struct dvb_ca_en50221 *en50221, int slot) netup_ci_slot_ts_ctl() argument
333 if (0 != slot) netup_ci_slot_ts_ctl()
412 int slot, int open) netup_poll_ci_slot_status()
416 if (0 != slot) netup_poll_ci_slot_status()
247 netup_ci_read_attribute_mem(struct dvb_ca_en50221 *en50221, int slot, int addr) netup_ci_read_attribute_mem() argument
253 netup_ci_write_attribute_mem(struct dvb_ca_en50221 *en50221, int slot, int addr, u8 data) netup_ci_write_attribute_mem() argument
411 netup_poll_ci_slot_status(struct dvb_ca_en50221 *en50221, int slot, int open) netup_poll_ci_slot_status() argument
/linux-4.4.14/drivers/media/dvb-frontends/
H A Dsp2.h40 int slot, int addr);
42 int slot, int addr, u8 data);
44 int slot, u8 addr);
46 int slot, u8 addr, u8 data);
47 extern int sp2_ci_slot_reset(struct dvb_ca_en50221 *en50221, int slot);
48 extern int sp2_ci_slot_shutdown(struct dvb_ca_en50221 *en50221, int slot);
49 extern int sp2_ci_slot_ts_enable(struct dvb_ca_en50221 *en50221, int slot);
51 int slot, int open);
H A Dsp2.c101 static int sp2_ci_op_cam(struct dvb_ca_en50221 *en50221, int slot, u8 acs, sp2_ci_op_cam() argument
109 if (slot != 0) sp2_ci_op_cam()
143 dev_dbg(&s->client->dev, "%s: slot=%d, addr=0x%04x, %s, data=%x", sp2_ci_op_cam()
144 (read) ? "read" : "write", slot, addr, sp2_ci_op_cam()
156 int slot, int addr) sp2_ci_read_attribute_mem()
158 return sp2_ci_op_cam(en50221, slot, SP2_CI_ATTR_ACS, sp2_ci_read_attribute_mem()
163 int slot, int addr, u8 data) sp2_ci_write_attribute_mem()
165 return sp2_ci_op_cam(en50221, slot, SP2_CI_ATTR_ACS, sp2_ci_write_attribute_mem()
170 int slot, u8 addr) sp2_ci_read_cam_control()
172 return sp2_ci_op_cam(en50221, slot, SP2_CI_IO_ACS, sp2_ci_read_cam_control()
177 int slot, u8 addr, u8 data) sp2_ci_write_cam_control()
179 return sp2_ci_op_cam(en50221, slot, SP2_CI_IO_ACS, sp2_ci_write_cam_control()
183 int sp2_ci_slot_reset(struct dvb_ca_en50221 *en50221, int slot) sp2_ci_slot_reset() argument
189 dev_dbg(&s->client->dev, "slot: %d\n", slot); sp2_ci_slot_reset()
191 if (slot != 0) sp2_ci_slot_reset()
215 int sp2_ci_slot_shutdown(struct dvb_ca_en50221 *en50221, int slot) sp2_ci_slot_shutdown() argument
219 dev_dbg(&s->client->dev, "slot:%d\n", slot); sp2_ci_slot_shutdown()
225 int sp2_ci_slot_ts_enable(struct dvb_ca_en50221 *en50221, int slot) sp2_ci_slot_ts_enable() argument
230 dev_dbg(&s->client->dev, "slot:%d\n", slot); sp2_ci_slot_ts_enable()
232 if (slot != 0) sp2_ci_slot_ts_enable()
243 int slot, int open) sp2_ci_poll_slot_status()
249 dev_dbg(&s->client->dev, "slot:%d open:%d\n", slot, open); sp2_ci_poll_slot_status()
155 sp2_ci_read_attribute_mem(struct dvb_ca_en50221 *en50221, int slot, int addr) sp2_ci_read_attribute_mem() argument
162 sp2_ci_write_attribute_mem(struct dvb_ca_en50221 *en50221, int slot, int addr, u8 data) sp2_ci_write_attribute_mem() argument
169 sp2_ci_read_cam_control(struct dvb_ca_en50221 *en50221, int slot, u8 addr) sp2_ci_read_cam_control() argument
176 sp2_ci_write_cam_control(struct dvb_ca_en50221 *en50221, int slot, u8 addr, u8 data) sp2_ci_write_cam_control() argument
242 sp2_ci_poll_slot_status(struct dvb_ca_en50221 *en50221, int slot, int open) sp2_ci_poll_slot_status() argument
/linux-4.4.14/tools/power/cpupower/utils/helpers/
H A Dpci.c15 * slot: slot
26 int slot, int func, int vendor, int dev) pci_acc_init()
38 filter_nb_link.slot = slot; pci_acc_init()
54 /* Typically one wants to get a specific slot(device)/func of the root domain
56 struct pci_dev *pci_slot_func_init(struct pci_access **pacc, int slot, pci_slot_func_init() argument
59 return pci_acc_init(pacc, 0, 0, slot, func, -1, -1); pci_slot_func_init()
25 pci_acc_init(struct pci_access **pacc, int domain, int bus, int slot, int func, int vendor, int dev) pci_acc_init() argument
/linux-4.4.14/drivers/media/pci/mantis/
H A Dmantis_ca.c40 static int mantis_ca_read_attr_mem(struct dvb_ca_en50221 *en50221, int slot, int addr) mantis_ca_read_attr_mem() argument
45 dprintk(MANTIS_DEBUG, 1, "Slot(%d): Request Attribute Mem Read", slot); mantis_ca_read_attr_mem()
47 if (slot != 0) mantis_ca_read_attr_mem()
53 static int mantis_ca_write_attr_mem(struct dvb_ca_en50221 *en50221, int slot, int addr, u8 data) mantis_ca_write_attr_mem() argument
58 dprintk(MANTIS_DEBUG, 1, "Slot(%d): Request Attribute Mem Write", slot); mantis_ca_write_attr_mem()
60 if (slot != 0) mantis_ca_write_attr_mem()
66 static int mantis_ca_read_cam_ctl(struct dvb_ca_en50221 *en50221, int slot, u8 addr) mantis_ca_read_cam_ctl() argument
71 dprintk(MANTIS_DEBUG, 1, "Slot(%d): Request CAM control Read", slot); mantis_ca_read_cam_ctl()
73 if (slot != 0) mantis_ca_read_cam_ctl()
79 static int mantis_ca_write_cam_ctl(struct dvb_ca_en50221 *en50221, int slot, u8 addr, u8 data) mantis_ca_write_cam_ctl() argument
84 dprintk(MANTIS_DEBUG, 1, "Slot(%d): Request CAM control Write", slot); mantis_ca_write_cam_ctl()
86 if (slot != 0) mantis_ca_write_cam_ctl()
92 static int mantis_ca_slot_reset(struct dvb_ca_en50221 *en50221, int slot) mantis_ca_slot_reset() argument
97 dprintk(MANTIS_DEBUG, 1, "Slot(%d): Slot RESET", slot); mantis_ca_slot_reset()
108 static int mantis_ca_slot_shutdown(struct dvb_ca_en50221 *en50221, int slot) mantis_ca_slot_shutdown() argument
113 dprintk(MANTIS_DEBUG, 1, "Slot(%d): Slot shutdown", slot); mantis_ca_slot_shutdown()
118 static int mantis_ts_control(struct dvb_ca_en50221 *en50221, int slot) mantis_ts_control() argument
123 dprintk(MANTIS_DEBUG, 1, "Slot(%d): TS control", slot); mantis_ts_control()
129 static int mantis_slot_status(struct dvb_ca_en50221 *en50221, int slot, int open) mantis_slot_status() argument
134 dprintk(MANTIS_DEBUG, 1, "Slot(%d): Poll Slot status", slot); mantis_slot_status()
/linux-4.4.14/sound/pci/ac97/
H A Dac97_pcm.c49 AC97_PCM_FRONT_DAC_RATE, /* slot 3 */
50 AC97_PCM_FRONT_DAC_RATE, /* slot 4 */
51 0xff, /* slot 5 */
52 AC97_PCM_LFE_DAC_RATE, /* slot 6 */
53 AC97_PCM_SURR_DAC_RATE, /* slot 7 */
54 AC97_PCM_SURR_DAC_RATE, /* slot 8 */
55 AC97_PCM_LFE_DAC_RATE, /* slot 9 */
56 0xff, /* slot 10 */
57 0xff, /* slot 11 */
61 0xff, /* slot 3 */
62 0xff, /* slot 4 */
63 0xff, /* slot 5 */
64 AC97_PCM_SURR_DAC_RATE, /* slot 6 */
65 AC97_PCM_FRONT_DAC_RATE, /* slot 7 */
66 AC97_PCM_FRONT_DAC_RATE, /* slot 8 */
67 AC97_PCM_SURR_DAC_RATE, /* slot 9 */
68 AC97_PCM_LFE_DAC_RATE, /* slot 10 */
69 AC97_PCM_LFE_DAC_RATE, /* slot 11 */
73 AC97_PCM_LFE_DAC_RATE, /* slot 3 */
74 AC97_PCM_LFE_DAC_RATE, /* slot 4 */
75 0xff, /* slot 5 */
76 AC97_PCM_FRONT_DAC_RATE, /* slot 6 */
77 0xff, /* slot 7 */
78 0xff, /* slot 8 */
79 AC97_PCM_FRONT_DAC_RATE, /* slot 9 */
80 AC97_PCM_SURR_DAC_RATE, /* slot 10 */
81 AC97_PCM_SURR_DAC_RATE, /* slot 11 */
85 AC97_PCM_SURR_DAC_RATE, /* slot 3 */
86 AC97_PCM_SURR_DAC_RATE, /* slot 4 */
87 0xff, /* slot 5 */
88 0xff, /* slot 6 */
89 AC97_PCM_LFE_DAC_RATE, /* slot 7 */
90 AC97_PCM_LFE_DAC_RATE, /* slot 8 */
91 0xff, /* slot 9 */
92 AC97_PCM_FRONT_DAC_RATE, /* slot 10 */
93 AC97_PCM_FRONT_DAC_RATE, /* slot 11 */
100 AC97_PCM_FRONT_DAC_RATE, /* slot 3 */
101 AC97_PCM_FRONT_DAC_RATE, /* slot 4 */
102 0xff, /* slot 5 */
103 0xff, /* slot 6 */
104 AC97_PCM_FRONT_DAC_RATE, /* slot 7 */
105 AC97_PCM_FRONT_DAC_RATE, /* slot 8 */
106 0xff, /* slot 9 */
107 0xff, /* slot 10 */
108 0xff, /* slot 11 */
112 0xff, /* slot 3 */
113 0xff, /* slot 4 */
114 0xff, /* slot 5 */
115 0xff, /* slot 6 */
116 0xff, /* slot 7 */
117 0xff, /* slot 8 */
118 0xff, /* slot 9 */
119 0xff, /* slot 10 */
120 0xff, /* slot 11 */
123 0xff, /* slot 3 */
124 0xff, /* slot 4 */
125 0xff, /* slot 5 */
126 0xff, /* slot 6 */
127 0xff, /* slot 7 */
128 0xff, /* slot 8 */
129 0xff, /* slot 9 */
130 0xff, /* slot 10 */
131 0xff, /* slot 11 */
134 0xff, /* slot 3 */
135 0xff, /* slot 4 */
136 0xff, /* slot 5 */
137 0xff, /* slot 6 */
138 0xff, /* slot 7 */
139 0xff, /* slot 8 */
140 0xff, /* slot 9 */
141 0xff, /* slot 10 */
142 0xff, /* slot 11 */
160 unsigned short slot, int dbl) get_slot_reg()
162 if (slot < 3) get_slot_reg()
164 if (slot > 11) get_slot_reg()
169 return rate_reg_tables[dbl][pcm->r[dbl].rate_table[cidx]][slot - 3]; get_slot_reg()
171 return rate_cregs[slot - 3]; get_slot_reg()
608 "cannot find configuration for AC97 slot %i\n", snd_ac97_pcm_open()
624 "invalid AC97 slot %i?\n", i); snd_ac97_pcm_open()
159 get_slot_reg(struct ac97_pcm *pcm, unsigned short cidx, unsigned short slot, int dbl) get_slot_reg() argument
/linux-4.4.14/arch/sh/mm/
H A Dioremap_fixed.c53 int i, slot; ioremap_fixed() local
62 slot = -1; ioremap_fixed()
67 slot = i; ioremap_fixed()
72 if (slot < 0) ioremap_fixed()
85 idx0 = FIX_IOREMAP_BEGIN + slot; ioremap_fixed()
104 int i, slot; iounmap_fixed() local
106 slot = -1; iounmap_fixed()
110 slot = i; iounmap_fixed()
118 if (slot < 0) iounmap_fixed()
123 idx = FIX_IOREMAP_BEGIN + slot + nrpages - 1; iounmap_fixed()
/linux-4.4.14/drivers/misc/cb710/
H A Dcore.c71 struct cb710_slot *slot = &chip->slot[0]; cb710_irq_handler() local
77 for (nr = chip->slots; nr; ++slot, --nr) { cb710_irq_handler()
78 cb710_irq_handler_t handler_func = slot->irq_handler; cb710_irq_handler()
79 if (handler_func && handler_func(slot)) cb710_irq_handler()
91 struct cb710_slot *slot = cb710_pdev_to_slot(to_platform_device(dev)); cb710_release_slot() local
92 struct cb710_chip *chip = cb710_slot_to_chip(slot); cb710_release_slot()
94 /* slot struct can be freed now */ cb710_release_slot()
103 struct cb710_slot *slot = &chip->slot[nr]; cb710_register_slot() local
107 "register: %s.%d; slot %d; mask %d; IO offset: 0x%02X\n", cb710_register_slot()
110 /* slot->irq_handler == NULL here; this needs to be cb710_register_slot()
115 slot->iobase = chip->iobase + io_offset; cb710_register_slot()
116 slot->pdev.name = name; cb710_register_slot()
117 slot->pdev.id = chip->platform_id; cb710_register_slot()
118 slot->pdev.dev.parent = &chip->pdev->dev; cb710_register_slot()
119 slot->pdev.dev.release = cb710_release_slot; cb710_register_slot()
121 err = platform_device_register(&slot->pdev); cb710_register_slot()
130 platform_device_put(&slot->pdev); cb710_register_slot()
132 /* slot->irq_handler == NULL here anyway, so no lock needed */ cb710_register_slot()
150 platform_device_unregister(&chip->slot[nr].pdev); cb710_unregister_slot()
154 BUG_ON(chip->slot[nr].irq_handler != NULL); cb710_unregister_slot()
156 /* slot->irq_handler == NULL here, so no lock needed */ cb710_unregister_slot()
161 void cb710_set_irq_handler(struct cb710_slot *slot, cb710_set_irq_handler() argument
164 struct cb710_chip *chip = cb710_slot_to_chip(slot); cb710_set_irq_handler()
168 slot->irq_handler = handler; cb710_set_irq_handler()
236 sizeof(*chip) + n * sizeof(*chip->slot), GFP_KERNEL); cb710_probe()
275 if (val & CB710_SLOT_MMC) { /* MMC/SD slot */ cb710_probe()
282 if (val & CB710_SLOT_MS) { /* MemoryStick slot */ cb710_probe()
289 if (val & CB710_SLOT_SM) { /* SmartMedia slot */ cb710_probe()
/linux-4.4.14/arch/arm/mach-ixp4xx/
H A Dfsg-pci.c41 static int __init fsg_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) fsg_map_irq() argument
50 slot -= 11; fsg_map_irq()
52 if (slot >= 1 && slot <= MAX_DEV && pin >= 1 && pin <= IRQ_LINES) fsg_map_irq()
53 irq = pci_irq_table[slot - 1]; fsg_map_irq()
54 printk(KERN_INFO "%s: Mapped slot %d pin %d to IRQ %d\n", fsg_map_irq()
55 __func__, slot, pin, irq); fsg_map_irq()
H A Dgtwx5715-pci.c35 #define INTA 10 /* slot 1 has INTA and INTB crossed */
41 * slot populated or someone with good soldering skills has
52 static int __init gtwx5715_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) gtwx5715_map_irq() argument
56 if ((slot == SLOT0_DEVID && pin == 1) || gtwx5715_map_irq()
57 (slot == SLOT1_DEVID && pin == 2)) gtwx5715_map_irq()
59 else if ((slot == SLOT0_DEVID && pin == 2) || gtwx5715_map_irq()
60 (slot == SLOT1_DEVID && pin == 1)) gtwx5715_map_irq()
63 printk(KERN_INFO "%s: Mapped slot %d pin %d to IRQ %d\n", gtwx5715_map_irq()
64 __func__, slot, pin, rc); gtwx5715_map_irq()
H A Dixdpg425-pci.c34 static int __init ixdpg425_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) ixdpg425_map_irq() argument
36 if (slot == 12 || slot == 13) ixdpg425_map_irq()
38 else if (slot == 14) ixdpg425_map_irq()
H A Dcoyote-pci.c40 static int __init coyote_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) coyote_map_irq() argument
42 if (slot == SLOT0_DEVID) coyote_map_irq()
44 else if (slot == SLOT1_DEVID) coyote_map_irq()
H A Dgateway7001-pci.c38 static int __init gateway7001_map_irq(const struct pci_dev *dev, u8 slot, gateway7001_map_irq() argument
41 if (slot == 1) gateway7001_map_irq()
43 else if (slot == 2) gateway7001_map_irq()
H A Dwg302v2-pci.c38 static int __init wg302v2_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) wg302v2_map_irq() argument
40 if (slot == 1) wg302v2_map_irq()
42 else if (slot == 2) wg302v2_map_irq()
H A Davila-pci.c49 static int __init avila_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) avila_map_irq() argument
58 if (slot >= 1 && avila_map_irq()
59 slot <= (machine_is_loft() ? LOFT_MAX_DEV : AVILA_MAX_DEV) && avila_map_irq()
61 return pci_irq_table[(slot + pin - 2) % 4]; avila_map_irq()
H A Ddsmg600-pci.c47 static int __init dsmg600_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) dsmg600_map_irq() argument
57 if (slot >= 1 && slot <= MAX_DEV && pin >= 1 && pin <= IRQ_LINES) dsmg600_map_irq()
58 return pci_irq_table[slot - 1][pin - 1]; dsmg600_map_irq()
H A Dixdp425-pci.c46 static int __init ixdp425_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) ixdp425_map_irq() argument
55 if (slot >= 1 && slot <= MAX_DEV && pin >= 1 && pin <= IRQ_LINES) ixdp425_map_irq()
56 return pci_irq_table[(slot + pin - 2) % 4]; ixdp425_map_irq()
H A Dmiccpt-pci.c47 static int __init miccpt_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) miccpt_map_irq() argument
56 if (slot >= 1 && slot <= MAX_DEV && pin >= 1 && pin <= IRQ_LINES) miccpt_map_irq()
57 return pci_irq_table[(slot + pin - 2) % 4]; miccpt_map_irq()
H A Dnas100d-pci.c44 static int __init nas100d_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) nas100d_map_irq() argument
53 if (slot >= 1 && slot <= MAX_DEV && pin >= 1 && pin <= IRQ_LINES) nas100d_map_irq()
54 return pci_irq_table[slot - 1][pin - 1]; nas100d_map_irq()
H A Dnslu2-pci.c41 static int __init nslu2_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) nslu2_map_irq() argument
49 if (slot >= 1 && slot <= MAX_DEV && pin >= 1 && pin <= IRQ_LINES) nslu2_map_irq()
50 return pci_irq_table[(slot + pin - 2) % IRQ_LINES]; nslu2_map_irq()
H A Dvulcan-pci.c46 static int __init vulcan_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) vulcan_map_irq() argument
48 if (slot == 1) vulcan_map_irq()
51 if (slot == 2) vulcan_map_irq()
/linux-4.4.14/arch/x86/kernel/
H A Daperture_64.c95 static u32 __init find_cap(int bus, int slot, int func, int cap) find_cap() argument
100 if (!(read_pci_config_16(bus, slot, func, PCI_STATUS) & find_cap()
104 pos = read_pci_config_byte(bus, slot, func, PCI_CAPABILITY_LIST); find_cap()
109 id = read_pci_config_byte(bus, slot, func, pos+PCI_CAP_LIST_ID); find_cap()
114 pos = read_pci_config_byte(bus, slot, func, find_cap()
121 static u32 __init read_agp(int bus, int slot, int func, int cap, u32 *order) read_agp() argument
130 pr_info("pci 0000:%02x:%02x:%02x: AGP bridge\n", bus, slot, func); read_agp()
131 apsizereg = read_pci_config_16(bus, slot, func, cap + 0x14); read_agp()
134 bus, slot, func); read_agp()
150 aper_low = read_pci_config(bus, slot, func, 0x10); read_agp()
151 aper_hi = read_pci_config(bus, slot, func, 0x14); read_agp()
159 bus, slot, func, aper, aper + (32ULL << (old_order + 20)) - 1, read_agp()
163 bus, slot, func, 32 << *order, apsizereg); read_agp()
168 bus, slot, func, aper, aper + (32ULL << (*order + 20)) - 1, read_agp()
191 int bus, slot, func; search_agp_bridge() local
195 for (slot = 0; slot < 32; slot++) { search_agp_bridge()
199 class = read_pci_config(bus, slot, func, search_agp_bridge()
208 cap = find_cap(bus, slot, func, search_agp_bridge()
213 return read_agp(bus, slot, func, cap, search_agp_bridge()
218 type = read_pci_config_byte(bus, slot, func, search_agp_bridge()
259 int i, fix, slot, valid_agp = 0; early_gart_iommu_check() local
283 for (slot = dev_base; slot < dev_limit; slot++) { early_gart_iommu_check()
284 if (!early_is_amd_nb(read_pci_config(bus, slot, 3, 0x00))) early_gart_iommu_check()
287 ctl = read_pci_config(bus, slot, 3, AMD64_GARTAPERTURECTL); early_gart_iommu_check()
291 aper_base = read_pci_config(bus, slot, 3, AMD64_GARTAPERTUREBASE) & 0x7fff; early_gart_iommu_check()
339 for (slot = dev_base; slot < dev_limit; slot++) { early_gart_iommu_check()
340 if (!early_is_amd_nb(read_pci_config(bus, slot, 3, 0x00))) early_gart_iommu_check()
343 ctl = read_pci_config(bus, slot, 3, AMD64_GARTAPERTURECTL); early_gart_iommu_check()
345 write_pci_config(bus, slot, 3, AMD64_GARTAPERTURECTL, ctl); early_gart_iommu_check()
358 int fix, slot, valid_agp = 0; gart_iommu_hole_init() local
384 for (slot = dev_base; slot < dev_limit; slot++) { gart_iommu_hole_init()
385 if (!early_is_amd_nb(read_pci_config(bus, slot, 3, 0x00))) gart_iommu_hole_init()
392 ctl = read_pci_config(bus, slot, 3, gart_iommu_hole_init()
402 write_pci_config(bus, slot, 3, AMD64_GARTAPERTURECTL, ctl); gart_iommu_hole_init()
406 aper_base = read_pci_config(bus, slot, 3, AMD64_GARTAPERTUREBASE) & 0x7fff; gart_iommu_hole_init()
496 for (slot = dev_base; slot < dev_limit; slot++) { gart_iommu_hole_init()
497 if (!early_is_amd_nb(read_pci_config(bus, slot, 3, 0x00))) gart_iommu_hole_init()
500 write_pci_config(bus, slot, 3, AMD64_GARTAPERTURECTL, ctl); gart_iommu_hole_init()
501 write_pci_config(bus, slot, 3, AMD64_GARTAPERTUREBASE, aper_alloc >> 25); gart_iommu_hole_init()
H A Dearly-quirks.c25 static void __init fix_hypertransport_config(int num, int slot, int func) fix_hypertransport_config() argument
34 htcfg = read_pci_config(num, slot, func, 0x68); fix_hypertransport_config()
44 write_pci_config(num, slot, func, 0x68, htcfg); fix_hypertransport_config()
51 static void __init via_bugs(int num, int slot, int func) via_bugs() argument
74 static void __init nvidia_bugs(int num, int slot, int func) nvidia_bugs() argument
103 static u32 __init ati_ixp4x0_rev(int num, int slot, int func) ati_ixp4x0_rev() argument
108 b = read_pci_config_byte(num, slot, func, 0xac); ati_ixp4x0_rev()
110 write_pci_config_byte(num, slot, func, 0xac, b); ati_ixp4x0_rev()
112 d = read_pci_config(num, slot, func, 0x70); ati_ixp4x0_rev()
114 write_pci_config(num, slot, func, 0x70, d); ati_ixp4x0_rev()
116 d = read_pci_config(num, slot, func, 0x8); ati_ixp4x0_rev()
121 static void __init ati_bugs(int num, int slot, int func) ati_bugs() argument
129 d = ati_ixp4x0_rev(num, slot, func); ati_bugs()
147 static u32 __init ati_sbx00_rev(int num, int slot, int func) ati_sbx00_rev() argument
151 d = read_pci_config(num, slot, func, 0x8); ati_sbx00_rev()
157 static void __init ati_bugs_contd(int num, int slot, int func) ati_bugs_contd() argument
161 rev = ati_sbx00_rev(num, slot, func); ati_bugs_contd()
177 d = read_pci_config(num, slot, func, 0x64); ati_bugs_contd()
189 static void __init ati_bugs(int num, int slot, int func) ati_bugs() argument
193 static void __init ati_bugs_contd(int num, int slot, int func) ati_bugs_contd() argument
198 static void __init intel_remapping_check(int num, int slot, int func) intel_remapping_check() argument
203 device = read_pci_config_16(num, slot, func, PCI_DEVICE_ID); intel_remapping_check()
204 revision = read_pci_config_byte(num, slot, func, PCI_REVISION_ID); intel_remapping_check()
229 static u32 __init intel_stolen_base(int num, int slot, int func, size_t stolen_size) intel_stolen_base() argument
238 base = read_pci_config(num, slot, func, 0x5c); intel_stolen_base()
303 static u32 __init i830_stolen_base(int num, int slot, int func, size_t stolen_size) i830_stolen_base() argument
308 static u32 __init i845_stolen_base(int num, int slot, int func, size_t stolen_size) i845_stolen_base() argument
313 static u32 __init i85x_stolen_base(int num, int slot, int func, size_t stolen_size) i85x_stolen_base() argument
318 static u32 __init i865_stolen_base(int num, int slot, int func, size_t stolen_size) i865_stolen_base() argument
328 static size_t __init i830_stolen_size(int num, int slot, int func) i830_stolen_size() argument
356 static size_t __init gen3_stolen_size(int num, int slot, int func) gen3_stolen_size() argument
411 static size_t __init gen6_stolen_size(int num, int slot, int func) gen6_stolen_size() argument
415 gmch_ctrl = read_pci_config_16(num, slot, func, SNB_GMCH_CTRL); gen6_stolen_size()
422 static size_t __init gen8_stolen_size(int num, int slot, int func) gen8_stolen_size() argument
426 gmch_ctrl = read_pci_config_16(num, slot, func, SNB_GMCH_CTRL); gen8_stolen_size()
432 static size_t __init chv_stolen_size(int num, int slot, int func) chv_stolen_size() argument
436 gmch_ctrl = read_pci_config_16(num, slot, func, SNB_GMCH_CTRL); chv_stolen_size()
454 size_t (*size)(int num, int slot, int func);
455 u32 (*base)(int num, int slot, int func, size_t size);
458 static size_t __init gen9_stolen_size(int num, int slot, int func) gen9_stolen_size() argument
462 gmch_ctrl = read_pci_config_16(num, slot, func, SNB_GMCH_CTRL); gen9_stolen_size()
473 typedef size_t (*stolen_size_fn)(int num, int slot, int func);
552 static void __init intel_graphics_stolen(int num, int slot, int func) intel_graphics_stolen() argument
559 device = read_pci_config_16(num, slot, func, PCI_DEVICE_ID); intel_graphics_stolen()
560 subvendor = read_pci_config_16(num, slot, func, intel_graphics_stolen()
562 subdevice = read_pci_config_16(num, slot, func, PCI_SUBSYSTEM_ID); intel_graphics_stolen()
568 size = stolen_funcs->size(num, slot, func); intel_graphics_stolen()
569 start = stolen_funcs->base(num, slot, func, size); intel_graphics_stolen()
584 static void __init force_disable_hpet(int num, int slot, int func) force_disable_hpet() argument
602 void (*f)(int num, int slot, int func);
646 * @slot: slot number
654 static int __init check_dev_quirk(int num, int slot, int func) check_dev_quirk() argument
662 class = read_pci_config_16(num, slot, func, PCI_CLASS_DEVICE); check_dev_quirk()
667 vendor = read_pci_config_16(num, slot, func, PCI_VENDOR_ID); check_dev_quirk()
669 device = read_pci_config_16(num, slot, func, PCI_DEVICE_ID); check_dev_quirk()
680 early_qrk[i].f(num, slot, func); check_dev_quirk()
685 type = read_pci_config_byte(num, slot, func, check_dev_quirk()
695 int slot, func; early_quirks() local
702 for (slot = 0; slot < 32; slot++) early_quirks()
705 if (check_dev_quirk(0, slot, func)) early_quirks()
/linux-4.4.14/fs/nfs/
H A Dnfs4session.c35 * nfs4_shrink_slot_table - free retired slots from the slot table
47 struct nfs4_slot *slot = *p; nfs4_shrink_slot_table() local
49 *p = slot->next; nfs4_shrink_slot_table()
50 kfree(slot); nfs4_shrink_slot_table()
57 * @tbl - controlling slot table
67 * nfs4_free_slot - free a slot and efficiently update slot table.
69 * freeing a slot is trivially done by clearing its respective bit
72 * so that the server would be able to size down the slot table if needed,
81 void nfs4_free_slot(struct nfs4_slot_table *tbl, struct nfs4_slot *slot) nfs4_free_slot() argument
83 u32 slotid = slot->slot_nr; nfs4_free_slot()
105 struct nfs4_slot *slot; nfs4_new_slot() local
107 slot = kzalloc(sizeof(*slot), gfp_mask); nfs4_new_slot()
108 if (slot) { nfs4_new_slot()
109 slot->table = tbl; nfs4_new_slot()
110 slot->slot_nr = slotid; nfs4_new_slot()
111 slot->seq_nr = seq_init; nfs4_new_slot()
113 return slot; nfs4_new_slot()
119 struct nfs4_slot **p, *slot; nfs4_find_or_create_slot() local
130 slot = *p; nfs4_find_or_create_slot()
131 if (slot->slot_nr == slotid) nfs4_find_or_create_slot()
132 return slot; nfs4_find_or_create_slot()
133 p = &slot->next; nfs4_find_or_create_slot()
139 * nfs4_alloc_slot - efficiently look for a free slot
142 * If found, we mark the slot as used, update the highest_used_slotid,
206 * (re)Initialise a slot table
235 * nfs4_release_slot_table - release all slot table entries
243 * nfs4_shutdown_slot_table - release resources attached to a slot table
244 * @tbl: slot table to shut down
254 * nfs4_setup_slot_table - prepare a stand-alone slot table for use
255 * @tbl: slot table to set up
272 struct nfs4_slot *slot = pslot; nfs41_assign_slot() local
273 struct nfs4_slot_table *tbl = slot->table; nfs41_assign_slot()
277 slot->generation = tbl->generation; nfs41_assign_slot()
278 args->sa_slot = slot; nfs41_assign_slot()
280 res->sr_slot = slot; nfs41_assign_slot()
287 struct nfs4_slot *slot) __nfs41_wake_and_assign_slot()
289 if (rpc_wake_up_first(&tbl->slot_tbl_waitq, nfs41_assign_slot, slot)) __nfs41_wake_and_assign_slot()
295 struct nfs4_slot *slot) nfs41_wake_and_assign_slot()
297 if (slot->slot_nr > tbl->max_slotid) nfs41_wake_and_assign_slot()
299 return __nfs41_wake_and_assign_slot(tbl, slot); nfs41_wake_and_assign_slot()
304 struct nfs4_slot *slot = nfs4_alloc_slot(tbl); nfs41_try_wake_next_slot_table_entry() local
305 if (!IS_ERR(slot)) { nfs41_try_wake_next_slot_table_entry()
306 bool ret = __nfs41_wake_and_assign_slot(tbl, slot); nfs41_try_wake_next_slot_table_entry()
309 nfs4_free_slot(tbl, slot); nfs41_try_wake_next_slot_table_entry()
422 struct nfs4_slot *slot, nfs41_update_target_slotid()
428 if (tbl->generation == slot->generation) nfs41_update_target_slotid()
461 * both slot tables or neither */ nfs4_setup_session_slot_tables()
286 __nfs41_wake_and_assign_slot(struct nfs4_slot_table *tbl, struct nfs4_slot *slot) __nfs41_wake_and_assign_slot() argument
294 nfs41_wake_and_assign_slot(struct nfs4_slot_table *tbl, struct nfs4_slot *slot) nfs41_wake_and_assign_slot() argument
421 nfs41_update_target_slotid(struct nfs4_slot_table *tbl, struct nfs4_slot *slot, struct nfs4_sequence_res *res) nfs41_update_target_slotid() argument
/linux-4.4.14/arch/arm/mach-omap2/
H A Dboard-n8x0.c175 * VMMC slot 1 on both N800 and N810
176 * VDCDC3_APE and VMCS2_APE slot 2 on N800
177 * GPIO23 and GPIO9 slot 2 EMMC on N810
188 static int n8x0_mmc_switch_slot(struct device *dev, int slot) n8x0_mmc_switch_slot() argument
191 dev_dbg(dev, "Choose slot %d\n", slot + 1); n8x0_mmc_switch_slot()
193 gpio_set_value(N8X0_SLOT_SWITCH_GPIO, slot); n8x0_mmc_switch_slot()
197 static int n8x0_mmc_set_power_menelaus(struct device *dev, int slot, n8x0_mmc_set_power_menelaus() argument
203 dev_dbg(dev, "Set slot %d power: %s (vdd %d)\n", slot + 1, n8x0_mmc_set_power_menelaus()
206 if (slot == 0) { n8x0_mmc_set_power_menelaus()
284 static int n8x0_mmc_set_power(struct device *dev, int slot, int power_on, n8x0_mmc_set_power() argument
287 if (board_is_n800() || slot == 0) n8x0_mmc_set_power()
288 return n8x0_mmc_set_power_menelaus(dev, slot, power_on, vdd); n8x0_mmc_set_power()
295 static int n8x0_mmc_set_bus_mode(struct device *dev, int slot, int bus_mode) n8x0_mmc_set_bus_mode() argument
299 dev_dbg(dev, "Set slot %d bus mode %s\n", slot + 1, n8x0_mmc_set_bus_mode()
301 BUG_ON(slot != 0 && slot != 1); n8x0_mmc_set_bus_mode()
302 slot++; n8x0_mmc_set_bus_mode()
305 r = menelaus_set_mmc_opendrain(slot, 1); n8x0_mmc_set_bus_mode()
308 r = menelaus_set_mmc_opendrain(slot, 0); n8x0_mmc_set_bus_mode()
314 dev_err(dev, "MMC: unable to set bus mode for slot %d\n", n8x0_mmc_set_bus_mode()
315 slot); n8x0_mmc_set_bus_mode()
319 static int n8x0_mmc_get_cover_state(struct device *dev, int slot) n8x0_mmc_get_cover_state() argument
321 slot++; n8x0_mmc_get_cover_state()
322 BUG_ON(slot != 1 && slot != 2); n8x0_mmc_get_cover_state()
323 if (slot == 1) n8x0_mmc_get_cover_state()
398 /* All slot pin bits seem to be inversed until first switch change */ n8x0_mmc_late_init()
474 { N810_EMMC_VSD_GPIO, GPIOF_OUT_INIT_LOW, "MMC slot 2 Vddf" },
475 { N810_EMMC_VIO_GPIO, GPIOF_OUT_INIT_LOW, "MMC slot 2 Vdd" },
496 "MMC slot switch"); n8x0_mmc_init()
H A Dmmc.h12 extern void omap_mmc_notify_cover_event(struct device *dev, int slot,
/linux-4.4.14/drivers/mmc/core/
H A DMakefile10 quirks.o slot-gpio.o
H A Dslot-gpio.c17 #include <linux/mmc/slot-gpio.h>
21 #include "slot-gpio.h"
54 host->slot.handler_priv = ctx; mmc_gpio_alloc()
55 host->slot.cd_irq = -EINVAL; mmc_gpio_alloc()
63 struct mmc_gpio *ctx = host->slot.handler_priv; mmc_gpio_get_ro()
78 struct mmc_gpio *ctx = host->slot.handler_priv; mmc_gpio_get_cd()
103 struct mmc_gpio *ctx = host->slot.handler_priv; mmc_gpio_request_ro()
123 struct mmc_gpio *ctx = host->slot.handler_priv; mmc_gpiod_request_cd_irq()
126 if (host->slot.cd_irq >= 0 || !ctx || !ctx->cd_gpio) mmc_gpiod_request_cd_irq()
150 host->slot.cd_irq = irq; mmc_gpiod_request_cd_irq()
163 struct mmc_gpio *ctx = host->slot.handler_priv; mmc_gpio_set_cd_isr()
188 struct mmc_gpio *ctx = host->slot.handler_priv; mmc_gpio_request_cd()
196 * slot functions, in any case it will be freed, when the device mmc_gpio_request_cd()
234 struct mmc_gpio *ctx = host->slot.handler_priv; mmc_gpiod_request_cd()
280 struct mmc_gpio *ctx = host->slot.handler_priv; mmc_gpiod_request_ro()
/linux-4.4.14/drivers/nvdimm/
H A Dlabel.c271 static bool slot_valid(struct nd_namespace_label *nd_label, u32 slot) slot_valid() argument
274 if (slot != __le32_to_cpu(nd_label->slot)) slot_valid()
289 u32 nslot, slot; nd_label_reserve_dpa() local
294 for_each_clear_bit_le(slot, free, nslot) { for_each_clear_bit_le()
302 nd_label = nd_label_base(ndd) + slot; for_each_clear_bit_le()
304 if (!slot_valid(nd_label, slot)) for_each_clear_bit_le()
325 u32 nslot, slot; nd_label_active_count() local
331 for_each_clear_bit_le(slot, free, nslot) { for_each_clear_bit_le()
334 nd_label = nd_label_base(ndd) + slot; for_each_clear_bit_le()
336 if (!slot_valid(nd_label, slot)) { for_each_clear_bit_le()
337 u32 label_slot = __le32_to_cpu(nd_label->slot); for_each_clear_bit_le()
342 "%s: slot%d invalid slot: %d dpa: %llx size: %llx\n", for_each_clear_bit_le()
343 __func__, slot, label_slot, dpa, size); for_each_clear_bit_le()
355 u32 nslot, slot; nd_label_active() local
360 for_each_clear_bit_le(slot, free, nslot) { for_each_clear_bit_le()
363 nd_label = nd_label_base(ndd) + slot; for_each_clear_bit_le()
364 if (!slot_valid(nd_label, slot)) for_each_clear_bit_le()
368 return nd_label_base(ndd) + slot; for_each_clear_bit_le()
378 u32 nslot, slot; nd_label_alloc_slot() local
385 slot = find_next_bit_le(free, nslot, 0); nd_label_alloc_slot()
386 if (slot == nslot) nd_label_alloc_slot()
389 clear_bit_le(slot, free); nd_label_alloc_slot()
391 return slot; nd_label_alloc_slot()
394 bool nd_label_free_slot(struct nvdimm_drvdata *ndd, u32 slot) nd_label_free_slot() argument
405 if (slot < nslot) nd_label_free_slot()
406 return !test_and_set_bit_le(slot, free); nd_label_free_slot()
503 u32 nslot, slot; __pmem_label_update() local
511 slot = nd_label_alloc_slot(ndd); __pmem_label_update()
512 if (slot == UINT_MAX) __pmem_label_update()
514 dev_dbg(ndd->dev, "%s: allocated: %d\n", __func__, slot); __pmem_label_update()
516 nd_label = nd_label_base(ndd) + slot; __pmem_label_update()
529 nd_label->slot = __cpu_to_le32(slot); __pmem_label_update()
541 slot = to_slot(ndd, victim_label); __pmem_label_update()
542 nd_label_free_slot(ndd, slot); __pmem_label_update()
543 dev_dbg(ndd->dev, "%s: free: %d\n", __func__, slot); __pmem_label_update()
561 unsigned int slot; del_label() local
565 slot = to_slot(ndd, nd_label); del_label()
566 dev_vdbg(ndd->dev, "%s: clear: %d\n", __func__, slot); del_label()
618 u32 nslot, slot; __blk_label_update() local
645 /* convert old local-label-map to dimm-slot victim-map */
652 for_each_clear_bit_le(slot, free, nslot) { for_each_clear_bit_le()
653 nd_label = nd_label_base(ndd) + slot; for_each_clear_bit_le()
661 slot = to_slot(ndd, nd_label); for_each_clear_bit_le()
662 set_bit(slot, victim_map); for_each_clear_bit_le()
694 slot = nd_label_alloc_slot(ndd);
695 if (slot == UINT_MAX)
697 dev_dbg(ndd->dev, "%s: allocated: %d\n", __func__, slot);
699 nd_label = nd_label_base(ndd) + slot;
712 nd_label->slot = __cpu_to_le32(slot);
723 for_each_set_bit(slot, victim_map, victim_map ? nslot : 0) {
724 dev_dbg(ndd->dev, "%s: free: %d\n", __func__, slot);
725 nd_label_free_slot(ndd, slot);
758 for_each_clear_bit_le(slot, free, nslot) { for_each_clear_bit_le()
759 nd_label = nd_label_base(ndd) + slot; for_each_clear_bit_le()
765 dev_vdbg(&nsblk->common.dev, "assign label[%d] slot: %d\n", for_each_clear_bit_le()
766 l, slot); for_each_clear_bit_le()
845 u32 nslot, slot; del_labels() local
859 slot = to_slot(ndd, nd_label); del_labels()
860 nd_label_free_slot(ndd, slot); del_labels()
861 dev_dbg(ndd->dev, "%s: free: %d\n", __func__, slot); del_labels()
/linux-4.4.14/include/uapi/linux/
H A Dpci.h24 * devices. The slot/function address of each device is encoded
27 * 7:3 = slot
30 #define PCI_DEVFN(slot, func) ((((slot) & 0x1f) << 3) | ((func) & 0x07))
/linux-4.4.14/arch/arm/mach-footbridge/
H A Dnetwinder-pci.c17 * We now use the slot ID instead of the device identifiers to select
20 static int __init netwinder_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) netwinder_map_irq() argument
22 switch (slot) { netwinder_map_irq()
39 printk(KERN_ERR "PCI: unknown device in slot %s\n", netwinder_map_irq()
H A Debsa285-pci.c18 static int __init ebsa285_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) ebsa285_map_irq() argument
28 return irqmap_ebsa285[(slot + pin) & 3]; ebsa285_map_irq()
/linux-4.4.14/arch/arm/mach-iop32x/
H A Diq80321.c71 iq80321_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) iq80321_pci_map_irq() argument
75 if ((slot == 2 || slot == 6) && pin == 1) { iq80321_pci_map_irq()
78 } else if ((slot == 2 || slot == 6) && pin == 2) { iq80321_pci_map_irq()
81 } else if ((slot == 2 || slot == 6) && pin == 3) { iq80321_pci_map_irq()
84 } else if ((slot == 2 || slot == 6) && pin == 4) { iq80321_pci_map_irq()
87 } else if (slot == 4 || slot == 8) { iq80321_pci_map_irq()
/linux-4.4.14/drivers/zorro/
H A Dproc.c81 unsigned int slot = *(loff_t *)v; zorro_seq_show() local
82 struct zorro_dev *z = &zorro_autocon[slot]; zorro_seq_show()
84 seq_printf(m, "%02x\t%08x\t%08lx\t%08lx\t%02x\n", slot, z->id, zorro_seq_show()
113 static int __init zorro_proc_attach_device(unsigned int slot) zorro_proc_attach_device() argument
118 sprintf(name, "%02x", slot); zorro_proc_attach_device()
121 &zorro_autocon[slot]); zorro_proc_attach_device()
130 unsigned int slot; zorro_proc_init() local
136 for (slot = 0; slot < zorro_num_autocon; slot++) zorro_proc_init()
137 zorro_proc_attach_device(slot); zorro_proc_init()
/linux-4.4.14/fs/jfs/
H A Djfs_dtree.h38 * entry segment/slot
40 * an entry consists of type dependent head/only segment/slot and
45 * directory page slot
114 u8 slot; /* 1: slot within leaf page of entry */ member in struct:dir_table_slot
159 struct dtslot slot[9]; member in union:__anon11603
173 * entry slot array of 32 byte slot
175 * sorted entry slot index table (stbl):
176 * contiguous slots at slot specified by stblindex,
178 * 512 byte block: 16 entry tbl (1 slot)
179 * 1024 byte block: 32 entry tbl (1 slot)
180 * 2048 byte block: 64 entry tbl (2 slot)
181 * 4096 byte block: 128 entry tbl (4 slot)
184 * 512 byte block: 16 - 2 = 14 slot
185 * 1024 byte block: 32 - 2 = 30 slot
186 * 2048 byte block: 64 - 3 = 61 slot
187 * 4096 byte block: 128 - 5 = 123 slot
189 * N.B. index is 0-based; index fields refer to slot index
201 s8 freelist; /* 1: slot index of head of freelist */
203 u8 maxslot; /* 1: number of slots in page slot[] */
204 u8 stblindex; /* 1: slot index of start of stbl */
210 struct dtslot slot[128]; member in union:__anon11605
236 (s8 *)&(p)->slot[(p)->header.stblindex] )
/linux-4.4.14/arch/sh/include/asm/
H A Dtlb_64.h44 * __flush_tlb_slot - Flushes TLB slot @slot.
46 * @slot: Address of TLB slot.
48 static inline void __flush_tlb_slot(unsigned long long slot) __flush_tlb_slot() argument
50 __asm__ __volatile__ ("putcfg %0, 0, r63\n" : : "r" (slot)); __flush_tlb_slot()
/linux-4.4.14/arch/m68k/mac/
H A Dmacints.c10 * - slot 0: one second interrupt (CA2)
11 * - slot 1: VBlank (CA1)
12 * - slot 2: ADB data ready (SR full)
13 * - slot 3: ADB data (CB2)
14 * - slot 4: ADB clock (CB1)
15 * - slot 5: timer 2
16 * - slot 6: timer 1
17 * - slot 7: status of IRQ; signals 'any enabled int.'
20 * - slot 0: SCSI DRQ (CA2)
21 * - slot 1: NUBUS IRQ (CA1) need to read port A to find which
22 * - slot 2: /EXP IRQ (only on IIci)
23 * - slot 3: SCSI IRQ (CB2)
24 * - slot 4: ASC IRQ (CB1)
25 * - slot 5: timer 2 (not on IIci)
26 * - slot 6: timer 1 (not on IIci)
27 * - slot 7: status of IRQ; signals 'any enabled int.'
69 * - slot 0: MACE
72 * - slot 1: SCC channel A interrupt
73 * - slot 2: SCC channel B interrupt
74 * - slot 3: MACE DMA
98 * dispatcher. This dispatcher finds the interrupting slot number (9-F) and
99 * then forms a new machspec interrupt number as above with the slot number
105 * case. They're hidden behind the Nubus slot $C interrupt thus adding a
/linux-4.4.14/include/linux/platform_data/
H A Dmmc-omap.h26 /* switch the bus to a new slot */
27 int (*switch_slot)(struct device *dev, int slot);
89 int (*set_bus_mode)(struct device *dev, int slot, int bus_mode);
90 int (*set_power)(struct device *dev, int slot,
92 int (*get_ro)(struct device *dev, int slot);
93 void (*remux)(struct device *dev, int slot, int power_on);
95 void (*before_set_reg)(struct device *dev, int slot,
98 void (*after_set_reg)(struct device *dev, int slot,
109 int (*get_cover_state)(struct device *dev, int slot);
116 int (*card_detect)(struct device *dev, int slot);
H A Dmmc-mxcmmc.h20 /* board specific hook to (de)initialize the SD slot.
32 /* adjust slot voltage */
/linux-4.4.14/sound/arm/
H A Daaci.h37 #define AACI_SLFR 0x068 /* slot flags */
38 #define AACI_SLISTAT 0x06c /* slot interrupt status */
39 #define AACI_SLIEN 0x070 /* slot interrupt enable */
135 * slot flag register bits. P56
139 #define SLFR_12TXE (1 << 11) /* slot 12 tx empty */
140 #define SLFR_12RXV (1 << 10) /* slot 12 rx valid */
141 #define SLFR_2TXE (1 << 9) /* slot 2 tx empty */
142 #define SLFR_2RXV (1 << 8) /* slot 2 rx valid */
143 #define SLFR_1TXE (1 << 7) /* slot 1 tx empty */
144 #define SLFR_1RXV (1 << 6) /* slot 1 rx valid */
145 #define SLFR_12TXB (1 << 5) /* slot 12 tx busy */
146 #define SLFR_12RXB (1 << 4) /* slot 12 rx busy */
147 #define SLFR_2TXB (1 << 3) /* slot 2 tx busy */
148 #define SLFR_2RXB (1 << 2) /* slot 2 rx busy */
149 #define SLFR_1TXB (1 << 1) /* slot 1 tx busy */
150 #define SLFR_1RXB (1 << 0) /* slot 1 rx busy */
174 #define MAINCR_SL12TXEN (1 << 8) /* slot 12 transmit enable */
175 #define MAINCR_SL12RXEN (1 << 7) /* slot 12 receive enable */
176 #define MAINCR_SL2TXEN (1 << 6) /* slot 2 transmit enable */
177 #define MAINCR_SL2RXEN (1 << 5) /* slot 2 receive enable */
178 #define MAINCR_SL1TXEN (1 << 4) /* slot 1 transmit enable */
179 #define MAINCR_SL1RXEN (1 << 3) /* slot 1 receive enable */
/linux-4.4.14/arch/tile/include/gxio/
H A Ddma_queue.h49 * low 24 bits are the next egress "slot".
80 uint64_t slot; __gxio_dma_queue_reserve() local
110 /* The bottom 24 bits of old encode the "slot". */ __gxio_dma_queue_reserve()
111 slot = (old & 0xffffff); __gxio_dma_queue_reserve()
115 * A "completion_slot" is a "slot" which can be compared to __gxio_dma_queue_reserve()
117 * "slot" into a "completion_slot", we access "hw_complete_count" __gxio_dma_queue_reserve()
118 * once (knowing that we have reserved a slot, and thus, it will __gxio_dma_queue_reserve()
120 * the 24 bit "slot", and handle "wrapping" by adding "1 << 24" __gxio_dma_queue_reserve()
125 slot |= (complete & 0xffffffffff000000); __gxio_dma_queue_reserve()
126 if (slot < complete) __gxio_dma_queue_reserve()
127 slot += 0x1000000; __gxio_dma_queue_reserve()
146 return slot; __gxio_dma_queue_reserve()
153 /* Check whether a particular "completion slot" has completed.
155 * Note that this function requires a "completion slot", and thus
/linux-4.4.14/fs/dlm/
H A Dmember.c37 memb->slot = le16_to_cpu(rf->rf_our_slot); dlm_slot_save()
43 struct dlm_slot *slot; dlm_slots_copy_out() local
52 slot = &ls->ls_slots[i]; dlm_slots_copy_out()
53 if (!slot->nodeid) dlm_slots_copy_out()
55 ro->ro_nodeid = cpu_to_le32(slot->nodeid); dlm_slots_copy_out()
56 ro->ro_slot = cpu_to_le16(slot->slot); dlm_slots_copy_out()
80 array[i].slot, array[i].nodeid); log_slots()
135 memb->slot = ro->ro_slot; dlm_slots_copy_in()
136 memb->slot_prev = memb->slot; dlm_slots_copy_in()
141 if (ls->ls_slot && ls->ls_slot != memb->slot) { dlm_slots_copy_in()
142 log_error(ls, "dlm_slots_copy_in our slot " dlm_slots_copy_in()
144 memb->slot); dlm_slots_copy_in()
149 ls->ls_slot = memb->slot; dlm_slots_copy_in()
152 if (!memb->slot) { dlm_slots_copy_in()
153 log_error(ls, "dlm_slots_copy_in nodeid %d no slot", dlm_slots_copy_in()
162 /* for any nodes that do not support slots, we will not have set memb->slot
163 in wait_status_all(), so memb->slot will remain -1, and we will not
178 /* our own memb struct will have slot -1 gen 0 */ dlm_slots_assign()
182 memb->slot = ls->ls_slot; dlm_slots_assign()
194 if (memb->slot == -1) dlm_slots_assign()
197 /* node needs a slot assigned */ dlm_slots_assign()
199 if (!memb->slot) dlm_slots_assign()
202 /* node has a slot assigned */ dlm_slots_assign()
206 if (!max || max < memb->slot) dlm_slots_assign()
207 max = memb->slot; dlm_slots_assign()
209 /* sanity check, once slot is assigned it shouldn't change */ dlm_slots_assign()
211 if (memb->slot_prev && memb->slot && memb->slot_prev != memb->slot) { dlm_slots_assign()
212 log_error(ls, "nodeid %d slot changed %d %d", dlm_slots_assign()
213 memb->nodeid, memb->slot_prev, memb->slot); dlm_slots_assign()
216 memb->slot_prev = memb->slot; dlm_slots_assign()
230 if (!memb->slot) dlm_slots_assign()
233 if (memb->slot > array_size) { dlm_slots_assign()
234 log_error(ls, "invalid slot number %d", memb->slot); dlm_slots_assign()
239 array[memb->slot - 1].nodeid = memb->nodeid; dlm_slots_assign()
240 array[memb->slot - 1].slot = memb->slot; dlm_slots_assign()
247 if (memb->slot) dlm_slots_assign()
254 memb->slot = i + 1; dlm_slots_assign()
255 memb->slot_prev = memb->slot; dlm_slots_assign()
257 array[i].slot = memb->slot; dlm_slots_assign()
261 ls->ls_slot = memb->slot; dlm_slots_assign()
265 if (!memb->slot) { dlm_slots_assign()
266 log_error(ls, "no free slot found"); dlm_slots_assign()
461 struct dlm_slot slot; dlm_lsop_recover_slot() local
479 slot.nodeid = memb->nodeid; dlm_lsop_recover_slot()
480 slot.slot = memb->slot; dlm_lsop_recover_slot()
482 ls->ls_ops->recover_slot(ls->ls_ops_arg, &slot); dlm_lsop_recover_slot()
507 slots[i].slot = memb->slot; dlm_lsop_recover_done()
/linux-4.4.14/lib/
H A Dradix-tree.c127 * Returns 1 if any slot in the node has this tag set.
227 * can leave us with a non-NULL entry in the first slot, so clear radix_tree_node_rcu_free()
329 struct radix_tree_node *slot; radix_tree_extend() local
360 slot = root->rnode; radix_tree_extend()
362 slot = indirect_to_ptr(slot); radix_tree_extend()
363 slot->parent = node; radix_tree_extend()
365 node->slots[0] = slot; radix_tree_extend()
375 * __radix_tree_create - create a slot in a radix tree
379 * @slotp: returns slot
381 * Create, if necessary, and return the node and slot for an item
385 * allocated and @root->rnode is used as a direct slot instead of
393 struct radix_tree_node *node = NULL, *slot; __radix_tree_create() local
404 slot = indirect_to_ptr(root->rnode); __radix_tree_create()
411 if (slot == NULL) { __radix_tree_create()
413 if (!(slot = radix_tree_node_alloc(root))) __radix_tree_create()
415 slot->path = height; __radix_tree_create()
416 slot->parent = node; __radix_tree_create()
418 rcu_assign_pointer(node->slots[offset], slot); __radix_tree_create()
420 slot->path |= offset << RADIX_TREE_HEIGHT_SHIFT; __radix_tree_create()
422 rcu_assign_pointer(root->rnode, ptr_to_indirect(slot)); __radix_tree_create()
427 node = slot; __radix_tree_create()
428 slot = node->slots[offset]; __radix_tree_create()
452 void **slot; radix_tree_insert() local
457 error = __radix_tree_create(root, index, &node, &slot); radix_tree_insert()
460 if (*slot != NULL) radix_tree_insert()
462 rcu_assign_pointer(*slot, item); radix_tree_insert()
482 * @slotp: returns slot
488 * allocated and @root->rnode is used as a direct slot instead of
496 void **slot; __radix_tree_lookup() local
522 slot = node->slots + ((index >> shift) & RADIX_TREE_MAP_MASK); __radix_tree_lookup()
523 node = rcu_dereference_raw(*slot); __radix_tree_lookup()
534 *slotp = slot; __radix_tree_lookup()
539 * radix_tree_lookup_slot - lookup a slot in a radix tree
543 * Returns: the slot corresponding to the position @index in the
546 * This function can be called under rcu_read_lock iff the slot is not
548 * exclusive from other writers. Any dereference of the slot must be done
553 void **slot; radix_tree_lookup_slot() local
555 if (!__radix_tree_lookup(root, index, NULL, &slot)) radix_tree_lookup_slot()
557 return slot; radix_tree_lookup_slot()
596 struct radix_tree_node *slot; radix_tree_tag_set() local
601 slot = indirect_to_ptr(root->rnode); radix_tree_tag_set()
608 if (!tag_get(slot, tag, offset)) radix_tree_tag_set()
609 tag_set(slot, tag, offset); radix_tree_tag_set()
610 slot = slot->slots[offset]; radix_tree_tag_set()
611 BUG_ON(slot == NULL); radix_tree_tag_set()
617 if (slot && !root_tag_get(root, tag)) radix_tree_tag_set()
620 return slot; radix_tree_tag_set()
642 struct radix_tree_node *slot = NULL; radix_tree_tag_clear() local
651 slot = indirect_to_ptr(root->rnode); radix_tree_tag_clear()
654 if (slot == NULL) radix_tree_tag_clear()
659 node = slot; radix_tree_tag_clear()
660 slot = slot->slots[offset]; radix_tree_tag_clear()
663 if (slot == NULL) radix_tree_tag_clear()
683 return slot; radix_tree_tag_clear()
750 * Returns: pointer to chunk first slot, or NULL if iteration is over
779 /* Single-slot tree */ radix_tree_next_chunk()
895 struct radix_tree_node *slot; radix_tree_range_tag_if_tagged() local
916 slot = indirect_to_ptr(root->rnode); radix_tree_range_tag_if_tagged()
923 if (!slot->slots[offset]) radix_tree_range_tag_if_tagged()
925 if (!tag_get(slot, iftag, offset)) radix_tree_range_tag_if_tagged()
930 node = slot; radix_tree_range_tag_if_tagged()
931 slot = slot->slots[offset]; radix_tree_range_tag_if_tagged()
937 tag_set(slot, settag, offset); radix_tree_range_tag_if_tagged()
954 * Since all of this slot's ancestors now have the tag set radix_tree_range_tag_if_tagged()
956 * back up the tree setting tags, until we update slot to radix_tree_range_tag_if_tagged()
975 slot = slot->parent; radix_tree_range_tag_if_tagged()
1015 void **slot; radix_tree_gang_lookup() local
1021 radix_tree_for_each_slot(slot, root, &iter, first_index) { radix_tree_gang_lookup()
1022 results[ret] = rcu_dereference_raw(*slot); radix_tree_gang_lookup()
1026 slot = radix_tree_iter_retry(&iter); radix_tree_gang_lookup()
1038 * radix_tree_gang_lookup_slot - perform multiple slot lookup on radix tree
1061 void **slot; radix_tree_gang_lookup_slot() local
1067 radix_tree_for_each_slot(slot, root, &iter, first_index) { radix_tree_gang_lookup_slot()
1068 results[ret] = slot; radix_tree_gang_lookup_slot()
1098 void **slot; radix_tree_gang_lookup_tag() local
1104 radix_tree_for_each_tagged(slot, root, &iter, first_index, tag) { radix_tree_gang_lookup_tag()
1105 results[ret] = rcu_dereference_raw(*slot); radix_tree_gang_lookup_tag()
1109 slot = radix_tree_iter_retry(&iter); radix_tree_gang_lookup_tag()
1121 * radix_tree_gang_lookup_tag_slot - perform multiple slot lookup on a
1139 void **slot; radix_tree_gang_lookup_tag_slot() local
1145 radix_tree_for_each_tagged(slot, root, &iter, first_index, tag) { radix_tree_gang_lookup_tag_slot()
1146 results[ret] = slot; radix_tree_gang_lookup_tag_slot()
1161 static unsigned long __locate(struct radix_tree_node *slot, void *item, __locate() argument
1167 height = slot->path & RADIX_TREE_HEIGHT_MASK; __locate()
1173 if (slot->slots[i] != NULL) __locate()
1185 slot = rcu_dereference_raw(slot->slots[i]); __locate()
1186 if (slot == NULL) __locate()
1192 if (slot->slots[i] == item) { __locate()
1260 struct radix_tree_node *slot; radix_tree_shrink() local
1267 * is not at the leftmost slot, we cannot shrink. radix_tree_shrink()
1281 slot = to_free->slots[0]; radix_tree_shrink()
1283 slot->parent = NULL; radix_tree_shrink()
1284 slot = ptr_to_indirect(slot); radix_tree_shrink()
1286 root->rnode = slot; radix_tree_shrink()
1290 * We have a dilemma here. The node's slot[0] must not be radix_tree_shrink()
1293 * then it may be subject to the slot pointer being visible radix_tree_shrink()
1295 * slot[0] is subsequently deleted, these callers would expect radix_tree_shrink()
1296 * their slot to become empty sooner or later. radix_tree_shrink()
1298 * For example, lockless pagecache will look up a slot, deref radix_tree_shrink()
1302 * to retry the entire slot lookup -- the indirect pointer radix_tree_shrink()
1304 * also results in a stale slot). So tag the slot as indirect radix_tree_shrink()
1316 * __radix_tree_delete_node - try to free node after clearing a slot
1320 * After clearing the slot at @index in @node from radix tree
1381 void **slot; radix_tree_delete_item() local
1385 entry = __radix_tree_lookup(root, index, &node, &slot); radix_tree_delete_item()
H A Dassoc_array.c33 int slot, ret; assoc_array_subtree_iterate() local
47 slot = 0; assoc_array_subtree_iterate()
57 for (; slot < ASSOC_ARRAY_FAN_OUT; slot++) { assoc_array_subtree_iterate()
58 ptr = ACCESS_ONCE(node->slots[slot]); assoc_array_subtree_iterate()
79 * We are guaranteed to make progress, however, as the slot number for assoc_array_subtree_iterate()
85 slot = 0; assoc_array_subtree_iterate()
91 for (; slot < ASSOC_ARRAY_FAN_OUT; slot++) { assoc_array_subtree_iterate()
92 ptr = ACCESS_ONCE(node->slots[slot]); assoc_array_subtree_iterate()
102 slot = node->parent_slot; assoc_array_subtree_iterate()
111 slot = shortcut->parent_slot; assoc_array_subtree_iterate()
116 /* Ascend to next slot in parent node */ assoc_array_subtree_iterate()
118 slot++; assoc_array_subtree_iterate()
167 int slot; member in struct:assoc_array_walk_result::__anon14848
193 int slot; assoc_array_walk() local
205 * route to the destination. Eventually we'll come to a slot that is assoc_array_walk()
221 slot = segments >> (level & ASSOC_ARRAY_KEY_CHUNK_MASK); assoc_array_walk()
222 slot &= ASSOC_ARRAY_FAN_MASK; assoc_array_walk()
223 ptr = ACCESS_ONCE(node->slots[slot]); assoc_array_walk()
225 pr_devel("consider slot %x [ix=%d type=%lu]\n", assoc_array_walk()
226 slot, level, (unsigned long)ptr & 3); assoc_array_walk()
229 /* The node doesn't have a node/shortcut pointer in the slot assoc_array_walk()
234 result->terminal_node.slot = slot; assoc_array_walk()
240 /* There is a pointer to a node in the slot corresponding to assoc_array_walk()
250 /* There is a shortcut in the slot corresponding to the index key assoc_array_walk()
327 int slot; assoc_array_find() local
339 for (slot = 0; slot < ASSOC_ARRAY_FAN_OUT; slot++) { assoc_array_find()
340 ptr = ACCESS_ONCE(node->slots[slot]); assoc_array_find()
366 int slot = -1; assoc_array_destroy_subtree() local
379 pr_devel("[%d] shortcut\n", slot); assoc_array_destroy_subtree()
383 BUG_ON(slot != -1 && shortcut->parent_slot != slot); assoc_array_destroy_subtree()
386 slot = -1; assoc_array_destroy_subtree()
390 pr_devel("[%d] node\n", slot); assoc_array_destroy_subtree()
393 BUG_ON(slot != -1 && node->parent_slot != slot); assoc_array_destroy_subtree()
394 slot = 0; assoc_array_destroy_subtree()
398 for (; slot < ASSOC_ARRAY_FAN_OUT; slot++) { assoc_array_destroy_subtree()
399 struct assoc_array_ptr *ptr = node->slots[slot]; assoc_array_destroy_subtree()
409 pr_devel("[%d] free leaf\n", slot); assoc_array_destroy_subtree()
415 slot = node->parent_slot; assoc_array_destroy_subtree()
428 slot = shortcut->parent_slot; assoc_array_destroy_subtree()
437 /* Ascend to next slot in parent node */ assoc_array_destroy_subtree()
438 pr_devel("ascend to %p[%d]\n", parent, slot); assoc_array_destroy_subtree()
441 slot++; assoc_array_destroy_subtree()
503 int slot, next_slot, free_slot, i, j; assoc_array_insert_into_terminal_node() local
507 edit->segment_cache[ASSOC_ARRAY_FAN_OUT] = result->terminal_node.slot; assoc_array_insert_into_terminal_node()
530 pr_devel("replace in slot %d\n", i); assoc_array_insert_into_terminal_node()
538 /* If there is a free slot in this node then we can just insert the assoc_array_insert_into_terminal_node()
542 pr_devel("insert in free slot %d\n", free_slot); assoc_array_insert_into_terminal_node()
595 /* The old leaves all cluster in the same slot. We will need assoc_array_insert_into_terminal_node()
634 * would match a slot with a meta pointer in it must be somewhere assoc_array_insert_into_terminal_node()
639 slot = edit->segment_cache[i]; assoc_array_insert_into_terminal_node()
640 if (slot != 0xff) assoc_array_insert_into_terminal_node()
642 if (edit->segment_cache[j] == slot) assoc_array_insert_into_terminal_node()
646 pr_devel("same slot: %x %x [%02x]\n", i, j, slot); assoc_array_insert_into_terminal_node()
649 BUG_ON(slot >= ASSOC_ARRAY_FAN_OUT); assoc_array_insert_into_terminal_node()
651 new_n1->parent_slot = slot; assoc_array_insert_into_terminal_node()
653 /* Metadata pointers cannot change slot */ assoc_array_insert_into_terminal_node()
659 BUG_ON(new_n0->slots[slot] != NULL); assoc_array_insert_into_terminal_node()
660 new_n0->slots[slot] = assoc_array_node_to_ptr(new_n1); assoc_array_insert_into_terminal_node()
668 if (edit->segment_cache[i] == slot) { assoc_array_insert_into_terminal_node()
681 if (edit->segment_cache[ASSOC_ARRAY_FAN_OUT] != slot) { assoc_array_insert_into_terminal_node()
721 /* All the old leaves cluster in the same slot, but the new leaf wants assoc_array_insert_into_terminal_node()
722 * to go into a different slot, so we create a new node to hold the new assoc_array_insert_into_terminal_node()
749 * in the same slot, so we have to replace this node with a shortcut to assoc_array_insert_into_terminal_node()
914 /* We need to know which slot in the new node is going to take a assoc_array_insert_mid_shortcut()
920 pr_devel("new slot %lx >> %d -> %d\n", assoc_array_insert_mid_shortcut()
925 * shortcut if its parent slot number doesn't change - but that's a assoc_array_insert_mid_shortcut()
956 * use memory barriers to make sure the parent slot number is assoc_array_insert_mid_shortcut()
957 * changed before the back pointer (the parent slot number is assoc_array_insert_mid_shortcut()
967 /* Install the new leaf in a spare slot in the new node. */ assoc_array_insert_mid_shortcut()
1008 * allowed as they indicate an empty slot but we have to allow them assoc_array_insert()
1030 * the slot corresponding to the index key that we have to assoc_array_insert()
1039 /* We found a shortcut that didn't match our key in a slot we assoc_array_insert()
1072 int slot; member in struct:assoc_array_delete_collapse_context
1086 BUG_ON(collapse->slot >= ASSOC_ARRAY_FAN_OUT); assoc_array_delete_collapse_iterator()
1088 collapse->node->slots[collapse->slot++] = assoc_array_leaf_to_ptr(leaf); assoc_array_delete_collapse_iterator()
1121 int slot, i; assoc_array_delete() local
1140 for (slot = 0; slot < ASSOC_ARRAY_FAN_OUT; slot++) { assoc_array_delete()
1141 ptr = node->slots[slot]; assoc_array_delete()
1159 /* In the simplest form of deletion we just clear the slot and release assoc_array_delete()
1162 edit->dead_leaf = node->slots[slot]; assoc_array_delete()
1163 edit->set[0].ptr = &node->slots[slot]; assoc_array_delete()
1253 collapse.slot = 0; assoc_array_delete()
1258 pr_devel("collapsed %d,%lu\n", collapse.slot, new_n0->nr_leaves_on_branch); assoc_array_delete()
1259 BUG_ON(collapse.slot != new_n0->nr_leaves_on_branch - 1); assoc_array_delete()
1496 int keylen, slot, nr_free, next_slot, i; assoc_array_gc() local
1548 slot = 0; assoc_array_gc()
1552 for (; slot < ASSOC_ARRAY_FAN_OUT; slot++) { assoc_array_gc()
1553 ptr = node->slots[slot]; assoc_array_gc()
1563 new_n->slots[slot] = ptr; assoc_array_gc()
1567 new_ptr_pp = &new_n->slots[slot]; assoc_array_gc()
1579 for (slot = 0; slot < ASSOC_ARRAY_FAN_OUT; slot++) { assoc_array_gc()
1580 ptr = new_n->slots[slot]; assoc_array_gc()
1590 for (slot = 0; slot < ASSOC_ARRAY_FAN_OUT; slot++) { assoc_array_gc()
1594 ptr = new_n->slots[slot]; assoc_array_gc()
1610 slot, child->nr_leaves_on_branch, nr_free + 1, assoc_array_gc()
1618 new_n->slots[slot] = NULL; assoc_array_gc()
1620 if (slot < next_slot) assoc_array_gc()
1621 next_slot = slot; assoc_array_gc()
1636 slot, child->nr_leaves_on_branch, nr_free + 1, assoc_array_gc()
1647 for (slot = 0; slot < ASSOC_ARRAY_FAN_OUT; slot++) assoc_array_gc()
1648 if ((ptr = new_n->slots[slot])) assoc_array_gc()
1656 slot = new_n->parent_slot; assoc_array_gc()
1673 slot = new_s->parent_slot = s->parent_slot; assoc_array_gc()
1684 new_s->parent_slot = slot; assoc_array_gc()
1686 new_n->slots[slot] = ptr; assoc_array_gc()
1701 slot = new_s->parent_slot; assoc_array_gc()
1708 new_n->parent_slot = slot; assoc_array_gc()
1716 n->slots[slot] = assoc_array_node_to_ptr(new_n); assoc_array_gc()
1727 slot = shortcut->parent_slot; assoc_array_gc()
1732 slot = node->parent_slot; assoc_array_gc()
1737 slot++; assoc_array_gc()
H A Dnotifier-error-inject.h17 /* The last slot must be terminated with zero sentinel */
/linux-4.4.14/drivers/acpi/
H A Dpci_slot.c79 dbg("Checking slot on path: %s\n", (char *)buffer.pointer); check_slot()
94 /* No _SUN == not a slot == bail */ check_slot()
108 * Check whether handle has an associated slot and create PCI slot if it has.
116 struct acpi_pci_slot *slot; register_slot() local
125 * There may be multiple PCI functions associated with the same slot. register_slot()
126 * Check whether PCI slot has already been created for this PCI device. register_slot()
128 list_for_each_entry(slot, &slot_list, list) { register_slot()
129 pci_slot = slot->pci_slot; register_slot()
134 slot = kmalloc(sizeof(*slot), GFP_KERNEL); register_slot()
135 if (!slot) { register_slot()
144 kfree(slot); register_slot()
148 slot->pci_slot = pci_slot; register_slot()
149 list_add(&slot->list, &slot_list); register_slot()
173 struct acpi_pci_slot *slot, *tmp; acpi_pci_slot_remove() local
176 list_for_each_entry_safe(slot, tmp, &slot_list, list) { acpi_pci_slot_remove()
177 if (slot->pci_slot->bus == bus) { acpi_pci_slot_remove()
178 list_del(&slot->list); acpi_pci_slot_remove()
179 pci_destroy_slot(slot->pci_slot); acpi_pci_slot_remove()
181 kfree(slot); acpi_pci_slot_remove()
/linux-4.4.14/fs/btrfs/
H A Duuid-tree.c40 int slot; btrfs_uuid_tree_lookup() local
66 slot = path->slots[0]; btrfs_uuid_tree_lookup()
67 item_size = btrfs_item_size_nr(eb, slot); btrfs_uuid_tree_lookup()
68 offset = btrfs_item_ptr_offset(eb, slot); btrfs_uuid_tree_lookup()
101 int slot; btrfs_uuid_tree_add() local
127 slot = path->slots[0]; btrfs_uuid_tree_add()
128 offset = btrfs_item_ptr_offset(eb, slot); btrfs_uuid_tree_add()
136 slot = path->slots[0]; btrfs_uuid_tree_add()
137 offset = btrfs_item_ptr_offset(eb, slot); btrfs_uuid_tree_add()
138 offset += btrfs_item_size_nr(eb, slot) - sizeof(subid_le); btrfs_uuid_tree_add()
165 int slot; btrfs_uuid_tree_rem() local
197 slot = path->slots[0]; btrfs_uuid_tree_rem()
198 offset = btrfs_item_ptr_offset(eb, slot); btrfs_uuid_tree_rem()
199 item_size = btrfs_item_size_nr(eb, slot); btrfs_uuid_tree_rem()
221 item_size = btrfs_item_size_nr(eb, slot); btrfs_uuid_tree_rem()
229 move_len = item_size - (move_src - btrfs_item_ptr_offset(eb, slot)); btrfs_uuid_tree_rem()
267 int slot; btrfs_uuid_tree_iterate() local
292 slot = path->slots[0]; btrfs_uuid_tree_iterate()
293 btrfs_item_key_to_cpu(leaf, &key, slot); btrfs_uuid_tree_iterate()
299 offset = btrfs_item_ptr_offset(leaf, slot); btrfs_uuid_tree_iterate()
300 item_size = btrfs_item_size_nr(leaf, slot); btrfs_uuid_tree_iterate()
H A Dctree.c41 int level, int slot);
319 int slot; member in struct:tree_mod_elem
517 alloc_tree_mod_elem(struct extent_buffer *eb, int slot, alloc_tree_mod_elem() argument
528 btrfs_node_key(eb, &tm->key, slot); alloc_tree_mod_elem()
529 tm->blockptr = btrfs_node_blockptr(eb, slot); alloc_tree_mod_elem()
532 tm->slot = slot; alloc_tree_mod_elem()
533 tm->generation = btrfs_node_ptr_generation(eb, slot); alloc_tree_mod_elem()
541 struct extent_buffer *eb, int slot, tree_mod_log_insert_key()
550 tm = alloc_tree_mod_elem(eb, slot, op, flags); tree_mod_log_insert_key()
592 tm->slot = src_slot; tree_mod_log_insert_move()
883 struct extent_buffer *eb, int slot, int atomic) tree_mod_log_set_node_key()
887 ret = tree_mod_log_insert_key(fs_info, eb, slot, tree_mod_log_set_node_key()
1296 BUG_ON(tm->slot < n); __tree_mod_log_rewind()
1300 btrfs_set_node_key(eb, &tm->key, tm->slot); __tree_mod_log_rewind()
1301 btrfs_set_node_blockptr(eb, tm->slot, tm->blockptr); __tree_mod_log_rewind()
1302 btrfs_set_node_ptr_generation(eb, tm->slot, __tree_mod_log_rewind()
1307 BUG_ON(tm->slot >= n); __tree_mod_log_rewind()
1308 btrfs_set_node_key(eb, &tm->key, tm->slot); __tree_mod_log_rewind()
1309 btrfs_set_node_blockptr(eb, tm->slot, tm->blockptr); __tree_mod_log_rewind()
1310 btrfs_set_node_ptr_generation(eb, tm->slot, __tree_mod_log_rewind()
1318 o_dst = btrfs_node_key_ptr_offset(tm->slot); __tree_mod_log_rewind()
1374 BUG_ON(tm->slot != 0); tree_mod_log_rewind()
1747 * the slot in the array is returned via slot, and it points to
1751 * slot may point to max if the key is bigger than all of the keys
1756 int max, int *slot) generic_bin_search()
1802 *slot = mid; generic_bin_search()
1806 *slot = low; generic_bin_search()
1815 int level, int *slot) bin_search()
1822 slot); bin_search()
1828 slot); bin_search()
1832 int level, int *slot) btrfs_bin_search()
1834 return bin_search(eb, key, level, slot); btrfs_bin_search()
1853 /* given a node and slot number, this reads the blocks it points to. The
1858 struct extent_buffer *parent, int slot) read_node_slot()
1863 if (slot < 0) read_node_slot()
1865 if (slot >= btrfs_header_nritems(parent)) read_node_slot()
1870 eb = read_tree_block(root, btrfs_node_blockptr(parent, slot), read_node_slot()
1871 btrfs_node_ptr_generation(parent, slot)); read_node_slot()
2238 * to the block in 'slot', and triggering ra on them.
2242 int level, int slot, u64 objectid) reada_for_search()
2265 search = btrfs_node_blockptr(node, slot); reada_for_search()
2276 nr = slot; reada_for_search()
2309 int slot; reada_for_balance() local
2322 slot = path->slots[level + 1]; reada_for_balance()
2324 if (slot > 0) { reada_for_balance()
2325 block1 = btrfs_node_blockptr(parent, slot - 1); reada_for_balance()
2326 gen = btrfs_node_ptr_generation(parent, slot - 1); reada_for_balance()
2337 if (slot + 1 < nritems) { reada_for_balance()
2338 block2 = btrfs_node_blockptr(parent, slot + 1); reada_for_balance()
2339 gen = btrfs_node_ptr_generation(parent, slot + 1); reada_for_balance()
2355 * in the tree. The exceptions are when our path goes through slot 0, because
2360 * the lock if the path points to the last slot in the block. This is part of
2361 * walking through the tree, and selecting the next slot in the higher block.
2414 * corner cases, such as COW of the block at slot zero in the node. This
2446 struct extent_buffer **eb_ret, int level, int slot, read_block_for_search()
2455 blocknr = btrfs_node_blockptr(b, slot); read_block_for_search()
2456 gen = btrfs_node_ptr_generation(b, slot); read_block_for_search()
2497 reada_for_search(root, p, level, slot, key->objectid); read_block_for_search()
2609 int level, int *prev_cmp, int *slot) key_search()
2612 *prev_cmp = bin_search(b, key, level, slot); key_search()
2617 *slot = 0; key_search()
2662 * If the key isn't found, the path points to the slot where it should
2675 int slot; btrfs_search_slot() local
2812 * be changing slot zero, which may require changing the parent. btrfs_search_slot()
2813 * So, we can't drop the lock until after we know which slot btrfs_search_slot()
2825 ret = key_search(b, key, level, &prev_cmp, &slot); btrfs_search_slot()
2829 if (ret && slot > 0) { btrfs_search_slot()
2831 slot -= 1; btrfs_search_slot()
2833 p->slots[level] = slot; btrfs_search_slot()
2843 slot = p->slots[level]; btrfs_search_slot()
2846 * slot 0 is special, if we change the key btrfs_search_slot()
2851 if (slot == 0 && ins_len && btrfs_search_slot()
2868 &b, level, slot, key, 0); btrfs_search_slot()
2900 p->slots[level] = slot; btrfs_search_slot()
2954 int slot; btrfs_search_old_slot() local
2993 ret = key_search(b, key, level, &prev_cmp, &slot); btrfs_search_old_slot()
2997 if (ret && slot > 0) { btrfs_search_old_slot()
2999 slot -= 1; btrfs_search_old_slot()
3001 p->slots[level] = slot; btrfs_search_old_slot()
3011 slot, key, time_seq); btrfs_search_old_slot()
3035 p->slots[level] = slot; btrfs_search_old_slot()
3051 * helper to use instead of search slot if no exact match is needed but
3077 * to the first free slot in the previous leaf, i.e. at an invalid btrfs_search_slot_for_read()
3130 * fixing up pointers when a given leaf/node is not in slot 0 of the
3166 int slot; btrfs_set_item_key_safe() local
3169 slot = path->slots[0]; btrfs_set_item_key_safe()
3170 if (slot > 0) { btrfs_set_item_key_safe()
3171 btrfs_item_key(eb, &disk_key, slot - 1); btrfs_set_item_key_safe()
3174 if (slot < btrfs_header_nritems(eb) - 1) { btrfs_set_item_key_safe()
3175 btrfs_item_key(eb, &disk_key, slot + 1); btrfs_set_item_key_safe()
3180 btrfs_set_item_key(eb, &disk_key, slot); btrfs_set_item_key_safe()
3182 if (slot == 0) btrfs_set_item_key_safe()
3399 * slot and level indicate where you want the key to go, and
3405 int slot, int level) insert_ptr()
3415 BUG_ON(slot > nritems); insert_ptr()
3417 if (slot != nritems) { insert_ptr()
3419 tree_mod_log_eb_move(root->fs_info, lower, slot + 1, insert_ptr()
3420 slot, nritems - slot); insert_ptr()
3422 btrfs_node_key_ptr_offset(slot + 1), insert_ptr()
3423 btrfs_node_key_ptr_offset(slot), insert_ptr()
3424 (nritems - slot) * sizeof(struct btrfs_key_ptr)); insert_ptr()
3427 ret = tree_mod_log_insert_key(root->fs_info, lower, slot, insert_ptr()
3431 btrfs_set_node_key(lower, key, slot); insert_ptr()
3432 btrfs_set_node_blockptr(lower, slot, bytenr); insert_ptr()
3434 btrfs_set_node_ptr_generation(lower, slot, trans->transid); insert_ptr()
3589 * min slot controls the lowest index we're willing to push to the
3604 int slot; __push_leaf_right() local
3624 slot = path->slots[1]; __push_leaf_right()
3707 btrfs_set_node_key(upper, &disk_key, slot + 1); __push_leaf_right()
3739 * push any slot lower than min_slot
3749 int slot; push_leaf_right() local
3757 slot = path->slots[1]; push_leaf_right()
3759 if (slot >= btrfs_header_nritems(upper) - 1) push_leaf_right()
3764 right = read_node_slot(root, upper, slot + 1); push_leaf_right()
3777 slot + 1, &right); push_leaf_right()
3977 int slot; push_leaf_left() local
3982 slot = path->slots[1]; push_leaf_left()
3983 if (slot == 0) push_leaf_left()
3994 left = read_node_slot(root, path->nodes[1], slot - 1); push_leaf_left()
4009 path->nodes[1], slot - 1, &left); push_leaf_left()
4041 int slot, int mid, int nritems) copy_for_split()
4083 BUG_ON(path->slots[0] != slot); copy_for_split()
4085 if (mid <= slot) { copy_for_split()
4116 int slot; push_for_double_split() local
4120 slot = path->slots[0]; push_for_double_split()
4121 if (slot < btrfs_header_nritems(path->nodes[0])) push_for_double_split()
4125 * try to push all the items after our slot into the push_for_double_split()
4128 ret = push_leaf_right(trans, root, path, 1, space_needed, 0, slot); push_for_double_split()
4137 * our goal is to get our slot at the start or end of a leaf. If push_for_double_split()
4146 /* try to push all the items before our slot into the next leaf */ push_for_double_split()
4147 slot = path->slots[0]; push_for_double_split()
4148 ret = push_leaf_left(trans, root, path, 1, space_needed, 0, slot); push_for_double_split()
4176 int slot; split_leaf() local
4186 slot = path->slots[0]; split_leaf()
4187 if (extend && data_size + btrfs_item_size_nr(l, slot) + split_leaf()
4195 if (slot < btrfs_header_nritems(l)) split_leaf()
4223 slot = path->slots[0]; split_leaf()
4227 if (mid <= slot) { split_leaf()
4231 if (slot >= nritems) { split_leaf()
4234 mid = slot; split_leaf()
4247 if (!extend && data_size && slot == 0) { split_leaf()
4249 } else if ((extend || !data_size) && slot == 0) { split_leaf()
4252 mid = slot; split_leaf()
4290 if (mid <= slot) { split_leaf()
4314 copy_for_split(trans, root, path, l, right, slot, mid, nritems); split_leaf()
4408 int slot; split_item() local
4431 slot = path->slots[0] + 1; split_item()
4433 if (slot != nritems) { split_item()
4435 memmove_extent_buffer(leaf, btrfs_item_nr_offset(slot + 1), split_item()
4436 btrfs_item_nr_offset(slot), split_item()
4437 (nritems - slot) * sizeof(struct btrfs_item)); split_item()
4441 btrfs_set_item_key(leaf, &disk_key, slot); split_item()
4443 new_item = btrfs_item_nr(slot); split_item()
4461 btrfs_item_ptr_offset(leaf, slot), split_item()
4546 int slot; btrfs_truncate_item() local
4560 slot = path->slots[0]; btrfs_truncate_item()
4562 old_size = btrfs_item_size_nr(leaf, slot); btrfs_truncate_item()
4569 old_data_start = btrfs_item_offset_nr(leaf, slot); btrfs_truncate_item()
4573 BUG_ON(slot < 0); btrfs_truncate_item()
4574 BUG_ON(slot >= nritems); btrfs_truncate_item()
4580 for (i = slot; i < nritems; i++) { btrfs_truncate_item()
4598 btrfs_item_key(leaf, &disk_key, slot); btrfs_truncate_item()
4604 fi = btrfs_item_ptr(leaf, slot, btrfs_truncate_item()
4611 ptr = btrfs_item_ptr_offset(leaf, slot); btrfs_truncate_item()
4624 btrfs_set_item_key(leaf, &disk_key, slot); btrfs_truncate_item()
4625 if (slot == 0) btrfs_truncate_item()
4629 item = btrfs_item_nr(slot); btrfs_truncate_item()
4645 int slot; btrfs_extend_item() local
4666 slot = path->slots[0]; btrfs_extend_item()
4667 old_data = btrfs_item_end_nr(leaf, slot); btrfs_extend_item()
4669 BUG_ON(slot < 0); btrfs_extend_item()
4670 if (slot >= nritems) { btrfs_extend_item()
4672 btrfs_crit(root->fs_info, "slot %d too large, nritems %d", btrfs_extend_item()
4673 slot, nritems); btrfs_extend_item()
4681 for (i = slot; i < nritems; i++) { btrfs_extend_item()
4696 old_size = btrfs_item_size_nr(leaf, slot); btrfs_extend_item()
4697 item = btrfs_item_nr(slot); btrfs_extend_item()
4722 int slot; setup_items_for_insert() local
4734 slot = path->slots[0]; setup_items_for_insert()
4746 if (slot != nritems) { setup_items_for_insert()
4747 unsigned int old_data = btrfs_item_end_nr(leaf, slot); setup_items_for_insert()
4751 btrfs_crit(root->fs_info, "slot %d old_data %d data_end %d", setup_items_for_insert()
4752 slot, old_data, data_end); setup_items_for_insert()
4759 for (i = slot; i < nritems; i++) { setup_items_for_insert()
4768 memmove_extent_buffer(leaf, btrfs_item_nr_offset(slot + nr), setup_items_for_insert()
4769 btrfs_item_nr_offset(slot), setup_items_for_insert()
4770 (nritems - slot) * sizeof(struct btrfs_item)); setup_items_for_insert()
4782 btrfs_set_item_key(leaf, &disk_key, slot + i); setup_items_for_insert()
4783 item = btrfs_item_nr(slot + i); setup_items_for_insert()
4810 int slot; btrfs_insert_empty_items() local
4825 slot = path->slots[0]; btrfs_insert_empty_items()
4826 BUG_ON(slot < 0); btrfs_insert_empty_items()
4867 int level, int slot) del_ptr()
4874 if (slot != nritems - 1) { del_ptr()
4876 tree_mod_log_eb_move(root->fs_info, parent, slot, del_ptr()
4877 slot + 1, nritems - slot - 1); del_ptr()
4879 btrfs_node_key_ptr_offset(slot), del_ptr()
4880 btrfs_node_key_ptr_offset(slot + 1), del_ptr()
4882 (nritems - slot - 1)); del_ptr()
4884 ret = tree_mod_log_insert_key(root->fs_info, parent, slot, del_ptr()
4895 } else if (slot == 0) { del_ptr()
4939 struct btrfs_path *path, int slot, int nr) btrfs_del_items()
4954 last_off = btrfs_item_offset_nr(leaf, slot + nr - 1); btrfs_del_items()
4957 dsize += btrfs_item_size_nr(leaf, slot + i); btrfs_del_items()
4961 if (slot + nr != nritems) { btrfs_del_items()
4969 for (i = slot + nr; i < nritems; i++) { btrfs_del_items()
4978 memmove_extent_buffer(leaf, btrfs_item_nr_offset(slot), btrfs_del_items()
4979 btrfs_item_nr_offset(slot + nr), btrfs_del_items()
4981 (nritems - slot - nr)); btrfs_del_items()
4997 if (slot == 0) { btrfs_del_items()
5010 slot = path->slots[1]; btrfs_del_items()
5028 path->slots[1] = slot; btrfs_del_items()
5087 * item might have been pushed to the first slot (0) of the leaf we btrfs_prev_leaf()
5127 int slot; btrfs_search_forward() local
5149 sret = bin_search(cur, min_key, level, &slot); btrfs_search_forward()
5153 if (slot >= nritems) btrfs_search_forward()
5156 path->slots[level] = slot; btrfs_search_forward()
5157 btrfs_item_key_to_cpu(cur, &found_key, slot); btrfs_search_forward()
5160 if (sret && slot > 0) btrfs_search_forward()
5161 slot--; btrfs_search_forward()
5166 while (slot < nritems) { btrfs_search_forward()
5169 gen = btrfs_node_ptr_generation(cur, slot); btrfs_search_forward()
5171 slot++; btrfs_search_forward()
5181 if (slot >= nritems) { btrfs_search_forward()
5182 path->slots[level] = slot; btrfs_search_forward()
5194 btrfs_node_key_to_cpu(cur, &found_key, slot); btrfs_search_forward()
5195 path->slots[level] = slot; btrfs_search_forward()
5201 cur = read_node_slot(root, cur, slot); btrfs_search_forward()
5400 * If we are at level 0, try to go to the next slot. If that's not btrfs_compare_trees()
5402 * where we could go to the next slot. We may at this point be on a btrfs_compare_trees()
5408 * If we are not at level 0 and on shared tree blocks, go one slot to btrfs_compare_trees()
5587 int slot; btrfs_find_next_key() local
5595 slot = path->slots[level] + 1; btrfs_find_next_key()
5598 if (slot >= btrfs_header_nritems(c)) { btrfs_find_next_key()
5611 slot = btrfs_header_nritems(c) - 1; btrfs_find_next_key()
5613 btrfs_item_key_to_cpu(c, &cur_key, slot); btrfs_find_next_key()
5615 btrfs_node_key_to_cpu(c, &cur_key, slot); btrfs_find_next_key()
5627 slot = path->slots[level]; btrfs_find_next_key()
5629 slot++; btrfs_find_next_key()
5634 btrfs_item_key_to_cpu(c, key, slot); btrfs_find_next_key()
5636 u64 gen = btrfs_node_ptr_generation(c, slot); btrfs_find_next_key()
5639 slot++; btrfs_find_next_key()
5642 btrfs_node_key_to_cpu(c, key, slot); btrfs_find_next_key()
5662 int slot; btrfs_next_old_leaf() local
5718 * with ret > 0, the key isn't found, the path points to the slot btrfs_next_old_leaf()
5733 slot = path->slots[level] + 1; btrfs_next_old_leaf()
5735 if (slot >= btrfs_header_nritems(c)) { btrfs_next_old_leaf()
5752 slot, &key, 0); btrfs_next_old_leaf()
5786 path->slots[level] = slot; btrfs_next_old_leaf()
540 tree_mod_log_insert_key(struct btrfs_fs_info *fs_info, struct extent_buffer *eb, int slot, enum mod_log_op op, gfp_t flags) tree_mod_log_insert_key() argument
882 tree_mod_log_set_node_key(struct btrfs_fs_info *fs_info, struct extent_buffer *eb, int slot, int atomic) tree_mod_log_set_node_key() argument
1753 generic_bin_search(struct extent_buffer *eb, unsigned long p, int item_size, struct btrfs_key *key, int max, int *slot) generic_bin_search() argument
1814 bin_search(struct extent_buffer *eb, struct btrfs_key *key, int level, int *slot) bin_search() argument
1831 btrfs_bin_search(struct extent_buffer *eb, struct btrfs_key *key, int level, int *slot) btrfs_bin_search() argument
1857 read_node_slot(struct btrfs_root *root, struct extent_buffer *parent, int slot) read_node_slot() argument
2240 reada_for_search(struct btrfs_root *root, struct btrfs_path *path, int level, int slot, u64 objectid) reada_for_search() argument
2444 read_block_for_search(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct btrfs_path *p, struct extent_buffer **eb_ret, int level, int slot, struct btrfs_key *key, u64 time_seq) read_block_for_search() argument
2608 key_search(struct extent_buffer *b, struct btrfs_key *key, int level, int *prev_cmp, int *slot) key_search() argument
3402 insert_ptr(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct btrfs_path *path, struct btrfs_disk_key *key, u64 bytenr, int slot, int level) insert_ptr() argument
4036 copy_for_split(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct btrfs_path *path, struct extent_buffer *l, struct extent_buffer *right, int slot, int mid, int nritems) copy_for_split() argument
4866 del_ptr(struct btrfs_root *root, struct btrfs_path *path, int level, int slot) del_ptr() argument
4938 btrfs_del_items(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct btrfs_path *path, int slot, int nr) btrfs_del_items() argument
/linux-4.4.14/arch/ia64/include/asm/sn/
H A Dgeo.h22 #define MAX_SLABS 0xf /* slabs per slot */
30 slabid_t slab:4; /* slab (ASIC), 0 .. 15 within slot */
31 slotid_t slot:4; /* slot (Blade), 0 .. 15 within module */ member in struct:geo_common_s
50 char slot; /* PCI slot number */ member in struct:geo_pcicard_s
62 char memslot; /* The memory slot on the bus */
81 module/001c07/slab/5/node/memory/2/slot/4 */
121 INVALID_SLOT : g.common.slot; geo_slot()
H A Dtypes.h19 typedef unsigned char slotid_t; /* slot (blade) within module */
20 typedef unsigned char slabid_t; /* slab (asic) within slot */
/linux-4.4.14/drivers/gpu/drm/atmel-hlcdc/
H A Datmel_hlcdc_layer.c69 struct atmel_hlcdc_layer_update_slot *slot; atmel_hlcdc_layer_update_reset() local
74 slot = &upd->slots[id]; atmel_hlcdc_layer_update_reset()
75 bitmap_clear(slot->updated_configs, 0, layer->desc->nconfigs); atmel_hlcdc_layer_update_reset()
76 memset(slot->configs, 0, atmel_hlcdc_layer_update_reset()
77 sizeof(*slot->configs) * layer->desc->nconfigs); atmel_hlcdc_layer_update_reset()
79 if (slot->fb_flip) { atmel_hlcdc_layer_update_reset()
80 atmel_hlcdc_layer_fb_flip_release_queue(layer, slot->fb_flip); atmel_hlcdc_layer_update_reset()
81 slot->fb_flip = NULL; atmel_hlcdc_layer_update_reset()
91 struct atmel_hlcdc_layer_update_slot *slot; atmel_hlcdc_layer_update_apply() local
101 slot = &upd->slots[upd->pending]; atmel_hlcdc_layer_update_apply()
103 for_each_set_bit(cfg, slot->updated_configs, layer->desc->nconfigs) { atmel_hlcdc_layer_update_apply()
107 slot->configs[cfg]); atmel_hlcdc_layer_update_apply()
111 fb_flip = slot->fb_flip; atmel_hlcdc_layer_update_apply()
164 slot->fb_flip = NULL; atmel_hlcdc_layer_update_apply()
352 struct atmel_hlcdc_layer_update_slot *slot; atmel_hlcdc_layer_update_start() local
370 slot = &upd->slots[upd->next]; atmel_hlcdc_layer_update_start()
393 slot->fb_flip = fb_flip; atmel_hlcdc_layer_update_start()
396 memcpy(slot->configs, atmel_hlcdc_layer_update_start()
399 memcpy(slot->updated_configs, atmel_hlcdc_layer_update_start()
404 slot->fb_flip->fb = upd->slots[upd->pending].fb_flip->fb; atmel_hlcdc_layer_update_start()
406 slot->fb_flip->fb = atmel_hlcdc_layer_update_start()
408 slot->fb_flip->ngems = atmel_hlcdc_layer_update_start()
410 drm_framebuffer_reference(slot->fb_flip->fb); atmel_hlcdc_layer_update_start()
439 struct atmel_hlcdc_layer_update_slot *slot; atmel_hlcdc_layer_update_set_fb() local
454 slot = &upd->slots[upd->next]; atmel_hlcdc_layer_update_set_fb()
456 fb_flip = slot->fb_flip; atmel_hlcdc_layer_update_set_fb()
457 old_fb = slot->fb_flip->fb; atmel_hlcdc_layer_update_set_fb()
462 dscr = slot->fb_flip->dscrs[i]; atmel_hlcdc_layer_update_set_fb()
481 struct atmel_hlcdc_layer_update_slot *slot; atmel_hlcdc_layer_update_cfg() local
489 slot = &upd->slots[upd->next]; atmel_hlcdc_layer_update_cfg()
490 slot->configs[cfg] &= ~mask; atmel_hlcdc_layer_update_cfg()
491 slot->configs[cfg] |= (val & mask); atmel_hlcdc_layer_update_cfg()
492 set_bit(cfg, slot->updated_configs); atmel_hlcdc_layer_update_cfg()
499 struct atmel_hlcdc_layer_update_slot *slot; atmel_hlcdc_layer_update_commit() local
505 slot = &upd->slots[upd->next]; atmel_hlcdc_layer_update_commit()
/linux-4.4.14/drivers/scsi/
H A D53c700.c506 /* Pull a slot off the free list */
510 struct NCR_700_command_slot *slot = hostdata->free_list; find_empty_slot() local
512 if(slot == NULL) { find_empty_slot()
519 if(slot->state != NCR_700_SLOT_FREE) find_empty_slot()
524 hostdata->free_list = slot->ITL_forw; find_empty_slot()
525 slot->ITL_forw = NULL; find_empty_slot()
529 * indicates the slot is in use and cannot be run by the IRQ find_empty_slot()
532 slot->state = NCR_700_SLOT_BUSY; find_empty_slot()
533 slot->flags = 0; find_empty_slot()
536 return slot; find_empty_slot()
540 free_slot(struct NCR_700_command_slot *slot, free_slot() argument
543 if((slot->state & NCR_700_SLOT_MASK) != NCR_700_SLOT_MAGIC) { free_slot()
544 printk(KERN_ERR "53c700: SLOT %p is not MAGIC!!!\n", slot); free_slot()
546 if(slot->state == NCR_700_SLOT_FREE) { free_slot()
547 printk(KERN_ERR "53c700: SLOT %p is FREE!!!\n", slot); free_slot()
550 slot->resume_offset = 0; free_slot()
551 slot->cmnd = NULL; free_slot()
552 slot->state = NCR_700_SLOT_FREE; free_slot()
553 slot->ITL_forw = hostdata->free_list; free_slot()
554 hostdata->free_list = slot; free_slot()
567 struct NCR_700_command_slot *slot = save_for_reselection() local
570 slot->resume_offset = dsp; save_for_reselection()
578 struct NCR_700_command_slot *slot) NCR_700_unmap()
593 struct NCR_700_command_slot *slot = NCR_700_scsi_done() local
596 dma_unmap_single(hostdata->dev, slot->pCmd, NCR_700_scsi_done()
598 if (slot->flags == NCR_700_FLAG_AUTOSENSE) { NCR_700_scsi_done()
601 dma_unmap_single(hostdata->dev, slot->dma_handle, NCR_700_scsi_done()
610 NCR_700_unmap(hostdata, SCp, slot); NCR_700_scsi_done()
612 free_slot(slot, hostdata); NCR_700_scsi_done()
974 struct NCR_700_command_slot *slot = process_script_interrupt() local
976 if(slot->flags == NCR_700_FLAG_AUTOSENSE) { process_script_interrupt()
997 NCR_700_unmap(hostdata, SCp, slot); process_script_interrupt()
998 dma_unmap_single(hostdata->dev, slot->pCmd, process_script_interrupt()
1019 slot->pCmd = dma_map_single(hostdata->dev, cmnd, MAX_COMMAND_SIZE, DMA_TO_DEVICE); process_script_interrupt()
1020 slot->dma_handle = dma_map_single(hostdata->dev, SCp->sense_buffer, SCSI_SENSE_BUFFERSIZE, DMA_FROM_DEVICE); process_script_interrupt()
1021 slot->SG[0].ins = bS_to_host(SCRIPT_MOVE_DATA_IN | SCSI_SENSE_BUFFERSIZE); process_script_interrupt()
1022 slot->SG[0].pAddr = bS_to_host(slot->dma_handle); process_script_interrupt()
1023 slot->SG[1].ins = bS_to_host(SCRIPT_RETURN); process_script_interrupt()
1024 slot->SG[1].pAddr = 0; process_script_interrupt()
1025 slot->resume_offset = hostdata->pScript; process_script_interrupt()
1026 dma_cache_sync(hostdata->dev, slot->SG, sizeof(slot->SG[0])*2, DMA_TO_DEVICE); process_script_interrupt()
1030 slot->state = NCR_700_SLOT_QUEUED; process_script_interrupt()
1031 slot->flags = NCR_700_FLAG_AUTOSENSE; process_script_interrupt()
1044 // slot->dma_handle, process_script_interrupt()
1092 struct NCR_700_command_slot *slot; process_script_interrupt() local
1118 slot = (struct NCR_700_command_slot *)SCp->host_scribble; process_script_interrupt()
1120 "reselection is tag %d, slot %p(%d)\n", process_script_interrupt()
1121 hostdata->msgin[2], slot, slot->tag); process_script_interrupt()
1131 slot = (struct NCR_700_command_slot *)SCp->host_scribble; process_script_interrupt()
1134 if(slot == NULL) { process_script_interrupt()
1143 resume_offset = slot->resume_offset; process_script_interrupt()
1144 hostdata->cmd = slot->cmnd; process_script_interrupt()
1148 CommandAddress, slot->pCmd); process_script_interrupt()
1150 CommandCount, slot->cmnd->cmd_len); process_script_interrupt()
1153 to32bit(&slot->pSG[0].ins)); process_script_interrupt()
1168 dma_cache_sync(hostdata->dev, slot->cmnd->cmnd, process_script_interrupt()
1169 slot->cmnd->cmd_len, DMA_TO_DEVICE); process_script_interrupt()
1184 struct NCR_700_command_slot *slot; process_script_interrupt() local
1204 printk(KERN_INFO "IDENTIFIED SG segment as being %08x in slot %p, cmd %p, slot->resume_offset=%08x\n", SG, &hostdata->slots[i], hostdata->slots[i].cmnd, hostdata->slots[i].resume_offset); process_script_interrupt()
1209 slot = (struct NCR_700_command_slot *)SCp->host_scribble; process_script_interrupt()
1210 /* change slot from busy to queued to redo command */ process_script_interrupt()
1211 slot->state = NCR_700_SLOT_QUEUED; process_script_interrupt()
1241 * a return here will re-run the queued command slot process_script_interrupt()
1312 struct NCR_700_command_slot *slot = process_selection() local
1314 DEBUG((" ID %d WARNING: RESELECTION OF BUSY HOST, saving cmd %p, slot %p, addr %x [%04x], resume %x!\n", id, hostdata->cmd, slot, dsp, dsp - hostdata->pScript, resume_offset)); process_selection()
1339 slot->state = NCR_700_SLOT_QUEUED; process_selection()
1393 struct NCR_700_command_slot *slot = NCR_700_start_command() local
1404 slot->state = NCR_700_SLOT_QUEUED; NCR_700_start_command()
1406 DEBUG(("scsi%d: host busy, queueing command %p, slot %p\n", NCR_700_start_command()
1407 SCp->device->host->host_no, slot->cmnd, slot)); NCR_700_start_command()
1412 slot->state = NCR_700_SLOT_BUSY; NCR_700_start_command()
1417 slot->flags != NCR_700_FLAG_AUTOSENSE), NCR_700_start_command()
1423 slot->flags == NCR_700_FLAG_AUTOSENSE) { NCR_700_start_command()
1432 && (slot->tag != SCSI_NO_TAG && SCp->cmnd[0] != REQUEST_SENSE && NCR_700_start_command()
1433 slot->flags != NCR_700_FLAG_AUTOSENSE)) { NCR_700_start_command()
1452 slot->pCmd); NCR_700_start_command()
1458 SGScriptStartAddress, to32bit(&slot->pSG[0].ins)); NCR_700_start_command()
1461 if(slot->resume_offset == 0) NCR_700_start_command()
1462 slot->resume_offset = hostdata->pScript; NCR_700_start_command()
1473 NCR_700_writel(slot->temp, SCp->device->host, TEMP_REG); NCR_700_start_command()
1474 NCR_700_writel(slot->resume_offset, SCp->device->host, DSP_REG); NCR_700_start_command()
1540 printk(KERN_ERR "scsi%d: Bus Reset detected, executing command %p, slot %p, dsp %08x[%04x]\n", NCR_700_intr()
1552 struct NCR_700_command_slot *slot = __shost_for_each_device() local
1555 if(slot->state == NCR_700_SLOT_FREE) __shost_for_each_device()
1558 SCp = slot->cmnd; __shost_for_each_device()
1559 printk(KERN_ERR " failing command because of reset, slot %p, cmnd %p\n", __shost_for_each_device()
1560 slot, SCp); __shost_for_each_device()
1561 free_slot(slot, hostdata); __shost_for_each_device()
1587 struct NCR_700_command_slot *slot = (SCp == NULL) ? NULL : local
1599 } else if(dsp >= to32bit(&slot->pSG[0].ins) &&
1600 dsp <= to32bit(&slot->pSG[NCR_700_SG_SEGMENTS].ins)) {
1602 int SGcount = (dsp - to32bit(&slot->pSG[0].ins))/sizeof(struct NCR_700_SG_List);
1608 printk("scsi%d: (%d:%d) Expected phase mismatch in slot->SG[%d], transferred 0x%x\n",
1613 printk("scsi%d: (%d:%d) Expected phase mismatch in slot->SG[%d], transferred 0x%x, residual %d\n",
1626 count = (bS_to_cpu(slot->SG[SGcount].ins) & 0x00ffffff);
1628 slot->SG[SGcount].ins &= bS_to_host(0xff000000);
1629 slot->SG[SGcount].ins |= bS_to_host(data_transfer);
1630 pAddr = bS_to_cpu(slot->SG[SGcount].pAddr);
1637 slot->SG[SGcount].pAddr = bS_to_host(pAddr);
1641 slot->SG[i].ins = bS_to_host(SCRIPT_NOP);
1642 slot->SG[i].pAddr = 0;
1644 dma_cache_sync(hostdata->dev, slot->SG, sizeof(slot->SG), DMA_TO_DEVICE);
1737 DEBUG(("scsi%d: Issuing saved command slot %p, cmd %p\t\n",
1758 struct NCR_700_command_slot *slot; NCR_700_queuecommand_lck() local
1788 * ensures a slot is free */ NCR_700_queuecommand_lck()
1789 slot = find_empty_slot(hostdata); NCR_700_queuecommand_lck()
1791 slot->cmnd = SCp; NCR_700_queuecommand_lck()
1794 SCp->host_scribble = (unsigned char *)slot; NCR_700_queuecommand_lck()
1824 slot->tag = SCp->request->tag; NCR_700_queuecommand_lck()
1825 CDEBUG(KERN_DEBUG, SCp, "sending out tag %d, slot %p\n", NCR_700_queuecommand_lck()
1826 slot->tag, slot); NCR_700_queuecommand_lck()
1828 slot->tag = SCSI_NO_TAG; NCR_700_queuecommand_lck()
1887 slot->SG[i].ins = bS_to_host(move_ins | count); scsi_for_each_sg()
1889 i, count, slot->SG[i].ins, (unsigned long)vPtr)); scsi_for_each_sg()
1890 slot->SG[i].pAddr = bS_to_host(vPtr); scsi_for_each_sg()
1892 slot->SG[i].ins = bS_to_host(SCRIPT_RETURN);
1893 slot->SG[i].pAddr = 0;
1894 dma_cache_sync(hostdata->dev, slot->SG, sizeof(slot->SG), DMA_TO_DEVICE);
1896 (&slot->pSG[i].ins),
1897 slot->SG[i].ins));
1899 slot->resume_offset = 0;
1900 slot->pCmd = dma_map_single(hostdata->dev, SCp->cmnd,
1911 struct NCR_700_command_slot *slot; DEF_SCSI_QCMD() local
1915 slot = (struct NCR_700_command_slot *)SCp->host_scribble; DEF_SCSI_QCMD()
1917 if(slot == NULL) DEF_SCSI_QCMD()
1928 * occupying a slot. Rather than allow this to DEF_SCSI_QCMD()
577 NCR_700_unmap(struct NCR_700_Host_Parameters *hostdata, struct scsi_cmnd *SCp, struct NCR_700_command_slot *slot) NCR_700_unmap() argument
H A DNCR_D700.c49 * NCR_D700=slot:<n> [siop:<n>] id:<n> ....
130 int slot = -1, siop = -1; param_setup() local
135 if(!strncmp(pos, "slot:", 5)) param_setup()
136 slot = val; param_setup()
140 if(slot == -1) { param_setup()
141 printk(KERN_WARNING "NCR D700: Must specify slot for id parameter\n"); param_setup()
142 } else if(slot > MCA_MAX_SLOT_NR) { param_setup()
143 printk(KERN_WARNING "NCR D700: Illegal slot %d for id %d\n", slot, val); param_setup()
146 id_array[slot*2] = val; param_setup()
147 id_array[slot*2 + 1] =val; param_setup()
149 id_array[slot*2 + siop] = val; param_setup()
178 int slot, u32 region, int differential) NCR_D700_probe_one()
213 host->this_id = id_array[slot * 2 + siop]; NCR_D700_probe_one()
253 int slot = mca_dev->slot; NCR_D700_probe() local
290 printk(KERN_NOTICE "NCR D700: found in slot %d irq = %d I/O base = 0x%x\n", slot, irq, offset_addr); NCR_D700_probe()
332 if ((err = NCR_D700_probe_one(p, i, irq, slot, NCR_D700_probe()
177 NCR_D700_probe_one(struct NCR_D700_private *p, int siop, int irq, int slot, u32 region, int differential) NCR_D700_probe_one() argument
/linux-4.4.14/arch/powerpc/mm/
H A Dhugepage-hash64.c30 unsigned long vpn, hash, shift, slot; __hash_page_thp() local
81 * Find the slot index details for this ea, using base page size. __hash_page_thp()
107 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP; __hash_page_thp()
108 slot += hidx & _PTEIDX_GROUP_IX; __hash_page_thp()
110 ret = ppc_md.hpte_updatepp(slot, rflags, vpn, __hash_page_thp()
144 /* Insert into the hash table, primary slot */ __hash_page_thp()
145 slot = ppc_md.hpte_insert(hpte_group, vpn, pa, rflags, 0, __hash_page_thp()
150 if (unlikely(slot == -1)) { __hash_page_thp()
153 slot = ppc_md.hpte_insert(hpte_group, vpn, pa, __hash_page_thp()
156 if (slot == -1) { __hash_page_thp()
169 if (unlikely(slot == -2)) { __hash_page_thp()
180 mark_hpte_slot_valid(hpte_slot_array, index, slot); __hash_page_thp()
H A Dhugetlbpage-hash64.c28 long slot; __hash_page_huge() local
75 unsigned long hash, slot; __hash_page_huge() local
80 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP; __hash_page_huge()
81 slot += (old_pte & _PAGE_F_GIX) >> 12; __hash_page_huge()
83 if (ppc_md.hpte_updatepp(slot, rflags, vpn, mmu_psize, __hash_page_huge()
93 /* clear HPTE slot informations in new PTE */ __hash_page_huge()
107 slot = hpte_insert_repeating(hash, vpn, pa, rflags, 0, __hash_page_huge()
114 if (unlikely(slot == -2)) { __hash_page_huge()
121 new_pte |= (slot << 12) & (_PAGE_F_SECOND | _PAGE_F_GIX); __hash_page_huge()
/linux-4.4.14/arch/m68k/include/asm/
H A Dmac_baboon.h12 * bit 5 : slot 2 power control
13 * bit 6 : slot 1 power control
H A Dmcfclk.h21 u8 slot; member in struct:clk
37 .slot = clk_slot, \
/linux-4.4.14/drivers/net/wireless/b43/
H A Ddma.c86 int slot, op32_idx2desc()
91 *meta = &(ring->meta[slot]); op32_idx2desc()
93 desc = &(desc[slot]); op32_idx2desc()
104 int slot; op32_fill_descriptor() local
109 slot = (int)(&(desc->dma32) - descbase); op32_fill_descriptor()
110 B43_WARN_ON(!(slot >= 0 && slot < ring->nr_slots)); op32_fill_descriptor()
116 if (slot == ring->nr_slots - 1) op32_fill_descriptor()
131 static void op32_poke_tx(struct b43_dmaring *ring, int slot) op32_poke_tx() argument
134 (u32) (slot * sizeof(struct b43_dmadesc32))); op32_poke_tx()
159 static void op32_set_current_rxslot(struct b43_dmaring *ring, int slot) op32_set_current_rxslot() argument
162 (u32) (slot * sizeof(struct b43_dmadesc32))); op32_set_current_rxslot()
178 int slot, op64_idx2desc()
183 *meta = &(ring->meta[slot]); op64_idx2desc()
185 desc = &(desc[slot]); op64_idx2desc()
196 int slot; op64_fill_descriptor() local
201 slot = (int)(&(desc->dma64) - descbase); op64_fill_descriptor()
202 B43_WARN_ON(!(slot >= 0 && slot < ring->nr_slots)); op64_fill_descriptor()
208 if (slot == ring->nr_slots - 1) op64_fill_descriptor()
226 static void op64_poke_tx(struct b43_dmaring *ring, int slot) op64_poke_tx() argument
229 (u32) (slot * sizeof(struct b43_dmadesc64))); op64_poke_tx()
254 static void op64_set_current_rxslot(struct b43_dmaring *ring, int slot) op64_set_current_rxslot() argument
257 (u32) (slot * sizeof(struct b43_dmadesc64))); op64_set_current_rxslot()
275 static inline int next_slot(struct b43_dmaring *ring, int slot) next_slot() argument
277 B43_WARN_ON(!(slot >= -1 && slot <= ring->nr_slots - 1)); next_slot()
278 if (slot == ring->nr_slots - 1) next_slot()
280 return slot + 1; next_slot()
283 static inline int prev_slot(struct b43_dmaring *ring, int slot) prev_slot() argument
285 B43_WARN_ON(!(slot >= 0 && slot <= ring->nr_slots - 1)); prev_slot()
286 if (slot == 0) prev_slot()
288 return slot - 1; prev_slot()
312 /* Request a slot for usage. */ request_slot()
315 int slot; request_slot() local
321 slot = next_slot(ring, ring->current_slot); request_slot()
322 ring->current_slot = slot; request_slot()
327 return slot; request_slot()
1198 static u16 generate_cookie(struct b43_dmaring *ring, int slot) generate_cookie() argument
1203 * DMA controller ID and store the slot number generate_cookie()
1211 B43_WARN_ON(slot & ~0x0FFF); generate_cookie()
1212 cookie |= (u16)slot; generate_cookie()
1217 /* Inspect a cookie and find out to which controller/slot it belongs. */
1219 struct b43_dmaring *parse_cookie(struct b43_wldev *dev, u16 cookie, int *slot) parse_cookie() argument
1241 *slot = (cookie & 0x0FFF); parse_cookie()
1242 if (unlikely(!ring || *slot < 0 || *slot >= ring->nr_slots)) { parse_cookie()
1258 int slot, old_top_slot, old_used_slots; dma_tx_fragment() local
1274 /* Get a slot for the header. */ dma_tx_fragment()
1275 slot = request_slot(ring); dma_tx_fragment()
1276 desc = ops->idx2desc(ring, slot, &meta_hdr); dma_tx_fragment()
1279 header = &(ring->txhdr_cache[(slot / TX_SLOTS_PER_FRAME) * hdrsize]); dma_tx_fragment()
1280 cookie = generate_cookie(ring, slot); dma_tx_fragment()
1299 /* Get a slot for the payload. */ dma_tx_fragment()
1300 slot = request_slot(ring); dma_tx_fragment()
1301 desc = ops->idx2desc(ring, slot, &meta); dma_tx_fragment()
1341 ops->poke_tx(ring, next_slot(ring, slot)); dma_tx_fragment()
1484 int slot, firstused; b43_dma_handle_txstatus() local
1489 ring = parse_cookie(dev, status->cookie, &slot); b43_dma_handle_txstatus()
1495 * Check if the slot deduced from the cookie really is the first b43_dma_handle_txstatus()
1496 * used slot. */ b43_dma_handle_txstatus()
1502 if (unlikely(slot != firstused)) { b43_dma_handle_txstatus()
1506 if (slot == next_slot(ring, next_slot(ring, firstused))) { b43_dma_handle_txstatus()
1510 slot = firstused; b43_dma_handle_txstatus()
1515 "Skip on DMA ring %d slot %d.\n", b43_dma_handle_txstatus()
1516 ring->index, slot); b43_dma_handle_txstatus()
1526 ring->index, firstused, slot); b43_dma_handle_txstatus()
1534 B43_WARN_ON(slot < 0 || slot >= ring->nr_slots); b43_dma_handle_txstatus()
1536 ops->idx2desc(ring, slot, &meta); b43_dma_handle_txstatus()
1539 b43dbg(dev->wl, "Poisoned TX slot %d (first=%d) " b43_dma_handle_txstatus()
1541 slot, firstused, ring->index); b43_dma_handle_txstatus()
1566 "at slot %d (first=%d) on ring %d\n", b43_dma_handle_txstatus()
1567 slot, firstused, ring->index); b43_dma_handle_txstatus()
1605 "at slot %d (first=%d) on ring %d\n", b43_dma_handle_txstatus()
1606 slot, firstused, ring->index); b43_dma_handle_txstatus()
1619 slot = next_slot(ring, slot); b43_dma_handle_txstatus()
1642 static void dma_rx(struct b43_dmaring *ring, int *slot) dma_rx() argument
1653 desc = ops->idx2desc(ring, *slot, &meta); dma_rx()
1690 desc = ops->idx2desc(ring, *slot, &meta); dma_rx()
1695 *slot = next_slot(ring, *slot); dma_rx()
1750 int slot, current_slot; b43_dma_rx() local
1757 slot = ring->current_slot; b43_dma_rx()
1758 for (; slot != current_slot; slot = next_slot(ring, slot)) { b43_dma_rx()
1759 dma_rx(ring, &slot); b43_dma_rx()
1763 ops->set_current_rxslot(ring, slot); b43_dma_rx()
1764 ring->current_slot = slot; b43_dma_rx()
85 op32_idx2desc(struct b43_dmaring *ring, int slot, struct b43_dmadesc_meta **meta) op32_idx2desc() argument
177 op64_idx2desc(struct b43_dmaring *ring, int slot, struct b43_dmadesc_meta **meta) op64_idx2desc() argument
/linux-4.4.14/drivers/net/wireless/b43legacy/
H A Ddma.c46 int slot, op32_idx2desc()
51 *meta = &(ring->meta[slot]); op32_idx2desc()
53 desc = &(desc[slot]); op32_idx2desc()
64 int slot; op32_fill_descriptor() local
69 slot = (int)(desc - descbase); op32_fill_descriptor()
70 B43legacy_WARN_ON(!(slot >= 0 && slot < ring->nr_slots)); op32_fill_descriptor()
78 if (slot == ring->nr_slots - 1) op32_fill_descriptor()
93 static void op32_poke_tx(struct b43legacy_dmaring *ring, int slot) op32_poke_tx() argument
96 (u32)(slot * sizeof(struct b43legacy_dmadesc32))); op32_poke_tx()
124 int slot) op32_set_current_rxslot()
127 (u32)(slot * sizeof(struct b43legacy_dmadesc32))); op32_set_current_rxslot()
135 static inline int next_slot(struct b43legacy_dmaring *ring, int slot) next_slot() argument
137 B43legacy_WARN_ON(!(slot >= -1 && slot <= ring->nr_slots - 1)); next_slot()
138 if (slot == ring->nr_slots - 1) next_slot()
140 return slot + 1; next_slot()
143 static inline int prev_slot(struct b43legacy_dmaring *ring, int slot) prev_slot() argument
145 B43legacy_WARN_ON(!(slot >= 0 && slot <= ring->nr_slots - 1)); prev_slot()
146 if (slot == 0) prev_slot()
148 return slot - 1; prev_slot()
172 /* Request a slot for usage. */
176 int slot; request_slot() local
182 slot = next_slot(ring, ring->current_slot); request_slot()
183 ring->current_slot = slot; request_slot()
188 return slot; request_slot()
938 int slot) generate_cookie()
943 * DMA controller ID and store the slot number generate_cookie()
968 B43legacy_WARN_ON(!(((u16)slot & 0xF000) == 0x0000)); generate_cookie()
969 cookie |= (u16)slot; generate_cookie()
974 /* Inspect a cookie and find out to which controller/slot it belongs. */
977 u16 cookie, int *slot) parse_cookie()
1004 *slot = (cookie & 0x0FFF); parse_cookie()
1005 B43legacy_WARN_ON(!(ring && *slot >= 0 && *slot < ring->nr_slots)); parse_cookie()
1016 int slot, old_top_slot, old_used_slots; dma_tx_fragment() local
1029 /* Get a slot for the header. */ dma_tx_fragment()
1030 slot = request_slot(ring); dma_tx_fragment()
1031 desc = op32_idx2desc(ring, slot, &meta_hdr); dma_tx_fragment()
1034 header = &(ring->txhdr_cache[slot * sizeof( dma_tx_fragment()
1038 generate_cookie(ring, slot)); dma_tx_fragment()
1056 /* Get a slot for the payload. */ dma_tx_fragment()
1057 slot = request_slot(ring); dma_tx_fragment()
1058 desc = op32_idx2desc(ring, slot, &meta); dma_tx_fragment()
1099 op32_poke_tx(ring, next_slot(ring, slot)); dma_tx_fragment()
1192 int slot; b43legacy_dma_handle_txstatus() local
1195 ring = parse_cookie(dev, status->cookie, &slot); b43legacy_dma_handle_txstatus()
1201 * Check if the slot deduced from the cookie really is the first b43legacy_dma_handle_txstatus()
1202 * used slot. */ b43legacy_dma_handle_txstatus()
1206 if (unlikely(slot != firstused)) { b43legacy_dma_handle_txstatus()
1212 ring->index, firstused, slot); b43legacy_dma_handle_txstatus()
1217 B43legacy_WARN_ON(!(slot >= 0 && slot < ring->nr_slots)); b43legacy_dma_handle_txstatus()
1218 op32_idx2desc(ring, slot, &meta); b43legacy_dma_handle_txstatus()
1283 slot = next_slot(ring, slot); b43legacy_dma_handle_txstatus()
1306 int *slot) dma_rx()
1316 desc = op32_idx2desc(ring, *slot, &meta); dma_rx()
1368 desc = op32_idx2desc(ring, *slot, &meta); dma_rx()
1372 *slot = next_slot(ring, *slot); dma_rx()
1405 int slot; b43legacy_dma_rx() local
1414 slot = ring->current_slot; b43legacy_dma_rx()
1415 for (; slot != current_slot; slot = next_slot(ring, slot)) { b43legacy_dma_rx()
1416 dma_rx(ring, &slot); b43legacy_dma_rx()
1419 op32_set_current_rxslot(ring, slot); b43legacy_dma_rx()
1420 ring->current_slot = slot; b43legacy_dma_rx()
45 op32_idx2desc(struct b43legacy_dmaring *ring, int slot, struct b43legacy_dmadesc_meta **meta) op32_idx2desc() argument
123 op32_set_current_rxslot(struct b43legacy_dmaring *ring, int slot) op32_set_current_rxslot() argument
937 generate_cookie(struct b43legacy_dmaring *ring, int slot) generate_cookie() argument
976 parse_cookie(struct b43legacy_wldev *dev, u16 cookie, int *slot) parse_cookie() argument
1305 dma_rx(struct b43legacy_dmaring *ring, int *slot) dma_rx() argument
/linux-4.4.14/drivers/tc/
H A Dtc.c42 int i, slot, err; tc_bus_add_devices() local
46 for (slot = 0; slot < tbus->num_tcslots; slot++) { tc_bus_add_devices()
47 slotaddr = tbus->slot_base + slot * slotsize; tc_bus_add_devices()
48 extslotaddr = tbus->ext_slot_base + slot * extslotsize; tc_bus_add_devices()
86 pr_err("tc%x: unable to allocate tc_dev\n", slot); tc_bus_add_devices()
89 dev_set_name(&tdev->dev, "tc%x", slot); tc_bus_add_devices()
93 tdev->slot = slot; tc_bus_add_devices()
119 pr_err("%s: Cannot provide slot space " tc_bus_add_devices()
/linux-4.4.14/drivers/dma/
H A Dedma.c218 int slot[EDMA_MAX_SLOTS]; member in struct:edma_chan
240 * The slot_inuse bit for each PaRAM slot is clear unless the slot is
422 static void edma_set_chmap(struct edma_chan *echan, int slot) edma_set_chmap() argument
428 slot = EDMA_CHAN_SLOT(slot); edma_set_chmap()
429 edma_write_array(ecc, EDMA_DCHMAP, channel, (slot << 5)); edma_set_chmap()
450 * paRAM slot management functions
452 static void edma_write_slot(struct edma_cc *ecc, unsigned slot, edma_write_slot() argument
455 slot = EDMA_CHAN_SLOT(slot); edma_write_slot()
456 if (slot >= ecc->num_slots) edma_write_slot()
458 memcpy_toio(ecc->base + PARM_OFFSET(slot), param, PARM_SIZE); edma_write_slot()
461 static void edma_read_slot(struct edma_cc *ecc, unsigned slot, edma_read_slot() argument
464 slot = EDMA_CHAN_SLOT(slot); edma_read_slot()
465 if (slot >= ecc->num_slots) edma_read_slot()
467 memcpy_fromio(param, ecc->base + PARM_OFFSET(slot), PARM_SIZE); edma_read_slot()
473 * @slot: specific slot to allocate; negative for "any unused slot"
475 * This allocates a parameter RAM slot, initializing it to hold a
478 * linking to them from a slot associated with a DMA channel.
480 * Normal use is to pass EDMA_SLOT_ANY as the @slot, but specific
483 * Returns the number of the slot, else negative errno.
485 static int edma_alloc_slot(struct edma_cc *ecc, int slot) edma_alloc_slot() argument
487 if (slot > 0) { edma_alloc_slot()
488 slot = EDMA_CHAN_SLOT(slot); edma_alloc_slot()
489 /* Requesting entry paRAM slot for a HW triggered channel. */ edma_alloc_slot()
490 if (ecc->chmap_exist && slot < ecc->num_channels) edma_alloc_slot()
491 slot = EDMA_SLOT_ANY; edma_alloc_slot()
494 if (slot < 0) { edma_alloc_slot()
496 slot = 0; edma_alloc_slot()
498 slot = ecc->num_channels; edma_alloc_slot()
500 slot = find_next_zero_bit(ecc->slot_inuse, edma_alloc_slot()
502 slot); edma_alloc_slot()
503 if (slot == ecc->num_slots) edma_alloc_slot()
505 if (!test_and_set_bit(slot, ecc->slot_inuse)) edma_alloc_slot()
508 } else if (slot >= ecc->num_slots) { edma_alloc_slot()
510 } else if (test_and_set_bit(slot, ecc->slot_inuse)) { edma_alloc_slot()
514 edma_write_slot(ecc, slot, &dummy_paramset); edma_alloc_slot()
516 return EDMA_CTLR_CHAN(ecc->id, slot); edma_alloc_slot()
519 static void edma_free_slot(struct edma_cc *ecc, unsigned slot) edma_free_slot() argument
521 slot = EDMA_CHAN_SLOT(slot); edma_free_slot()
522 if (slot >= ecc->num_slots) edma_free_slot()
525 edma_write_slot(ecc, slot, &dummy_paramset); edma_free_slot()
526 clear_bit(slot, ecc->slot_inuse); edma_free_slot()
530 * edma_link - link one parameter RAM slot to another
532 * @from: parameter RAM slot originating the link
533 * @to: parameter RAM slot which is the link target
535 * The originating slot should not be part of any active DMA transfer.
554 * @slot: parameter RAM slot being examined
557 * Returns the position of the current active slot
559 static dma_addr_t edma_get_position(struct edma_cc *ecc, unsigned slot, edma_get_position() argument
564 slot = EDMA_CHAN_SLOT(slot); edma_get_position()
565 offs = PARM_OFFSET(slot); edma_get_position()
770 edma_write_slot(ecc, echan->slot[i], &edesc->pset[j].param); edma_execute()
775 " slot\t%d\n" edma_execute()
784 j, echan->ch_num, echan->slot[i], edma_execute()
793 /* Link to the previous slot if not the last set */ edma_execute()
795 edma_link(ecc, echan->slot[i], echan->slot[i + 1]); edma_execute()
802 * then setup a link to the dummy slot, this results in all future edma_execute()
807 edma_link(ecc, echan->slot[nslots - 1], echan->slot[1]); edma_execute()
809 edma_link(ecc, echan->slot[nslots - 1], edma_execute()
1072 /* Allocate a PaRAM slot, if needed */ edma_prep_slave_sg()
1076 if (echan->slot[i] < 0) { edma_prep_slave_sg()
1077 echan->slot[i] = edma_prep_slave_sg()
1079 if (echan->slot[i] < 0) { edma_prep_slave_sg()
1081 dev_err(dev, "%s: Failed to allocate slot\n", edma_prep_slave_sg()
1137 * slot and with one burst. edma_prep_dma_memcpy()
1152 * When the full_length is multibple of 32767 one slot can be edma_prep_dma_memcpy()
1157 /* One slot is enough for lengths multiple of (SZ_32K -1) */ edma_prep_dma_memcpy()
1190 /* Enable transfer complete chaining for the first slot */ edma_prep_dma_memcpy()
1193 if (echan->slot[1] < 0) { edma_prep_dma_memcpy()
1194 echan->slot[1] = edma_alloc_slot(echan->ecc, edma_prep_dma_memcpy()
1196 if (echan->slot[1] < 0) { edma_prep_dma_memcpy()
1198 dev_err(dev, "%s: Failed to allocate slot\n", edma_prep_dma_memcpy()
1292 /* Allocate a PaRAM slot, if needed */ edma_prep_dma_cyclic()
1293 if (echan->slot[i] < 0) { edma_prep_dma_cyclic()
1294 echan->slot[i] = edma_prep_dma_cyclic()
1296 if (echan->slot[i] < 0) { edma_prep_dma_cyclic()
1298 dev_err(dev, "%s: Failed to allocate slot\n", edma_prep_dma_cyclic()
1327 " slot\t%d\n" edma_prep_dma_cyclic()
1336 i, echan->ch_num, echan->slot[i], edma_prep_dma_cyclic()
1427 u32 slot; dma_irq_handler() local
1430 slot = __ffs(sh_ipr); dma_irq_handler()
1431 sh_ipr &= ~(BIT(slot)); dma_irq_handler()
1433 if (sh_ier & BIT(slot)) { dma_irq_handler()
1434 channel = (bank << 5) | slot; dma_irq_handler()
1436 edma_shadow0_write_array(ecc, SH_ICR, bank, BIT(slot)); dma_irq_handler()
1456 edma_read_slot(ecc, echan->slot[0], &p); edma_error_handler()
1460 * (1) we finished transmitting an intermediate slot and edma_error_handler()
1467 * slot. So we avoid doing so and set the missed flag. edma_error_handler()
1470 dev_dbg(dev, "Error on null slot, setting miss\n"); edma_error_handler()
1474 * The slot is already programmed but the event got edma_error_handler()
1610 echan->slot[0] = edma_alloc_slot(ecc, echan->ch_num); edma_alloc_chan_resources()
1611 if (echan->slot[0] < 0) { edma_alloc_chan_resources()
1612 dev_err(dev, "Entry slot allocation failed for channel %u\n", edma_alloc_chan_resources()
1617 /* Set up channel -> slot mapping for the entry slot */ edma_alloc_chan_resources()
1618 edma_set_chmap(echan, echan->slot[0]); edma_alloc_chan_resources()
1648 if (echan->slot[i] >= 0) { edma_free_chan_resources()
1649 edma_free_slot(echan->ecc, echan->slot[i]); edma_free_chan_resources()
1650 echan->slot[i] = -1; edma_free_chan_resources()
1654 /* Set entry slot to the dummy slot */ edma_free_chan_resources()
1694 pos = edma_get_position(edesc->echan->ecc, edesc->echan->slot[0], dst); edma_residue()
1851 echan->slot[j] = -1; edma_dma_init()
2014 prop = of_find_property(dev->of_node, "ti,edma-reserved-slot-ranges", edma_setup_info_from_dt()
2017 const char pname[] = "ti,edma-reserved-slot-ranges"; edma_setup_info_from_dt()
2263 dev_err(dev, "Can't allocate PaRAM dummy slot\n"); edma_probe()
2313 /* Set entry slot to the dummy slot */ edma_probe()
2399 /* Set up channel -> slot mapping for the entry slot */ edma_pm_resume()
2400 edma_set_chmap(&echan[i], echan[i].slot[0]); edma_pm_resume()
/linux-4.4.14/arch/ia64/kernel/
H A Dkprobes.c100 static void __kprobes update_kprobe_inst_flag(uint template, uint slot, update_kprobe_inst_flag() argument
107 p->ainsn.slot = slot; update_kprobe_inst_flag()
120 if (bundle_encoding[template][slot] == B) { update_kprobe_inst_flag()
136 } else if (bundle_encoding[template][slot] == X) { update_kprobe_inst_flag()
153 static uint __kprobes is_cmp_ctype_unc_inst(uint template, uint slot, is_cmp_ctype_unc_inst() argument
160 if (!((bundle_encoding[template][slot] == I) || is_cmp_ctype_unc_inst()
161 (bundle_encoding[template][slot] == M))) is_cmp_ctype_unc_inst()
189 static int __kprobes unsupported_inst(uint template, uint slot, unsupported_inst() argument
197 if (is_cmp_ctype_unc_inst(template, slot, major_opcode, kprobe_inst)) { unsupported_inst()
198 if (slot == 1 && qp) { unsupported_inst()
200 "instruction on slot 1 at <0x%lx> " unsupported_inst()
207 else if (bundle_encoding[template][slot] == I) { unsupported_inst()
237 if (slot == 1 && qp) { unsupported_inst()
239 "instruction on slot at <0x%lx> " unsupported_inst()
246 else if (bundle_encoding[template][slot] == B) { unsupported_inst()
268 else if (unlikely(bundle_encoding[template][slot] == F)) { unsupported_inst()
272 if (slot == 1 && qp) { unsupported_inst()
274 "instruction on slot at <0x%lx> " unsupported_inst()
284 if (slot == 1 && qp) { unsupported_inst()
298 * the break instruction at the given slot.
300 static void __kprobes prepare_break_inst(uint template, uint slot, prepare_break_inst() argument
315 switch (slot) { prepare_break_inst()
333 update_kprobe_inst_flag(template, slot, major_opcode, kprobe_inst, p); prepare_break_inst()
336 static void __kprobes get_kprobe_inst(bundle_t *bundle, uint slot, get_kprobe_inst() argument
344 switch (slot) { get_kprobe_inst()
369 static int __kprobes valid_kprobe_addr(int template, int slot, valid_kprobe_addr() argument
372 if ((slot > 2) || ((bundle_encoding[template][1] == L) && slot > 1)) { valid_kprobe_addr()
511 /* Check the instruction in the slot is break */ __is_ia64_break_inst()
512 static int __kprobes __is_ia64_break_inst(bundle_t *bundle, uint slot) __is_ia64_break_inst() argument
518 /* Move to slot 2, if bundle is MLX type and kprobe slot is 1 */ __is_ia64_break_inst()
519 if (slot == 1 && bundle_encoding[template][1] == L) __is_ia64_break_inst()
520 slot++; __is_ia64_break_inst()
522 /* Get Kprobe probe instruction at given slot*/ __is_ia64_break_inst()
523 get_kprobe_inst(bundle, slot, &kprobe_inst, &major_opcode); __is_ia64_break_inst()
543 static int __kprobes can_boost(bundle_t *bundle, uint slot, can_boost() argument
549 if (search_exception_tables(bundle_addr + slot) || can_boost()
550 __is_ia64_break_inst(bundle, slot)) can_boost()
552 } while ((++slot) < 3); can_boost()
566 unsigned int slot = (unsigned long)p->addr & 0xf; prepare_booster() local
569 if (can_boost(&p->ainsn.insn[0].bundle, slot, addr)) { prepare_booster()
587 unsigned int slot = addr & 0xf, template, major_opcode = 0; arch_prepare_kprobe() local
594 if(valid_kprobe_addr(template, slot, addr)) arch_prepare_kprobe()
597 /* Move to slot 2, if bundle is MLX type and kprobe slot is 1 */ arch_prepare_kprobe()
598 if (slot == 1 && bundle_encoding[template][1] == L) arch_prepare_kprobe()
599 slot++; arch_prepare_kprobe()
602 get_kprobe_inst(bundle, slot, &kprobe_inst, &major_opcode); arch_prepare_kprobe()
604 qp = unsupported_inst(template, slot, major_opcode, kprobe_inst, addr); arch_prepare_kprobe()
614 prepare_break_inst(template, slot, major_opcode, kprobe_inst, p, qp); arch_prepare_kprobe()
634 switch (p->ainsn.slot) { arch_arm_kprobe()
657 switch (p->ainsn.slot) { arch_disarm_kprobe()
692 int slot = ((unsigned long)p->addr & 0xf); resume_execution() local
696 if (slot == 1 && bundle_encoding[template][1] == L) resume_execution()
697 slot = 2; resume_execution()
740 if (slot == 2) { resume_execution()
758 unsigned long slot = (unsigned long)p->addr & 0xf; prepare_ss() local
766 if (slot > 2) prepare_ss()
767 slot = 0; prepare_ss()
769 ia64_psr(regs)->ri = slot; prepare_ss()
777 unsigned int slot = ia64_psr(regs)->ri; is_ia64_break_inst() local
783 return __is_ia64_break_inst(&bundle, slot); is_ia64_break_inst()
876 ia64_psr(regs)->ri = p->ainsn.slot; pre_kprobes_handler()
/linux-4.4.14/sound/atmel/
H A Dac97c.h66 #define AC97C_CH_MASK(slot) \
67 (0x7 << (3 * (AC97_SLOT_##slot - 3)))
68 #define AC97C_CH_ASSIGN(slot, channel) \
69 (AC97C_CHANNEL_##channel << (3 * (AC97_SLOT_##slot - 3)))
/linux-4.4.14/arch/mips/dec/
H A Dtc.c28 * Protected read byte from TURBOchannel slot space.
37 * the slot space base address and the number of slots.
68 * Get the IRQ for the specified slot.
72 switch (tdev->slot) { tc_device_get_irq()
/linux-4.4.14/arch/ia64/include/uapi/asm/
H A Drse.h21 * Return TRUE if ADDR is the address of an RNAT slot.
30 * Returns the address of the RNAT slot that covers the slot at
41 * ending at BSP. This isn't simply (BSP-BSPSTORE)/8 because every 64th slot stores
/linux-4.4.14/arch/arm/mach-versatile/
H A Dpci.c63 int slot; versatile_pci_slot_ignore() local
65 while ((retval = get_option(&str,&slot))) { versatile_pci_slot_ignore()
66 if ((slot < 0) || (slot > 31)) { versatile_pci_slot_ignore()
67 printk("Illegal slot value: %d\n",slot); versatile_pci_slot_ignore()
69 pci_slot_ignore |= (1 << slot); versatile_pci_slot_ignore()
102 int slot = PCI_SLOT(devfn); versatile_read_config() local
104 if (pci_slot_ignore & (1 << slot)) { versatile_read_config()
105 /* Ignore this slot */ versatile_read_config()
145 int slot = PCI_SLOT(devfn); versatile_write_config() local
147 if (pci_slot_ignore & (1 << slot)) { versatile_write_config()
281 printk("PCI core found (slot %d)\n",myslot); pci_versatile_setup()
337 * map the specified device/slot/pin to an IRQ. Different backplanes may need to modify this.
339 static int __init versatile_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) versatile_map_irq() argument
349 irq = IRQ_SIC_PCI0 + ((slot + 2 + pin - 1) & 3); versatile_map_irq()
/linux-4.4.14/arch/powerpc/platforms/ps3/
H A Dhtab.c111 static long ps3_hpte_updatepp(unsigned long slot, unsigned long newpp, ps3_hpte_updatepp() argument
125 result = lv1_read_htab_entries(PS3_LPAR_VAS_ID_CURRENT, slot & ~0x3UL, ps3_hpte_updatepp()
131 pr_info("%s: result=%s read vpn=%lx slot=%lx psize=%d\n", ps3_hpte_updatepp()
132 __func__, ps3_result(result), vpn, slot, psize); ps3_hpte_updatepp()
136 hpte_v = hpte_v_array[slot % 4]; ps3_hpte_updatepp()
151 slot, 0, 0); ps3_hpte_updatepp()
165 static void ps3_hpte_invalidate(unsigned long slot, unsigned long vpn, ps3_hpte_invalidate() argument
173 result = lv1_write_htab_entry(PS3_LPAR_VAS_ID_CURRENT, slot, 0, 0); ps3_hpte_invalidate()
176 pr_info("%s: result=%s vpn=%lx slot=%lx psize=%d\n", ps3_hpte_invalidate()
177 __func__, ps3_result(result), vpn, slot, psize); ps3_hpte_invalidate()
/linux-4.4.14/arch/powerpc/platforms/pseries/
H A Dlpar.c133 unsigned long slot; pSeries_lpar_hpte_insert() local
162 lpar_rc = plpar_pte_enter(flags, hpte_group, hpte_v, hpte_r, &slot); pSeries_lpar_hpte_insert()
180 pr_devel(" -> slot: %lu\n", slot & 7); pSeries_lpar_hpte_insert()
185 return (slot & 7) | (!!(vflags & HPTE_V_SECONDARY) << 3); pSeries_lpar_hpte_insert()
197 /* pick a random slot to start at */ pSeries_lpar_hpte_remove()
289 static long pSeries_lpar_hpte_updatepp(unsigned long slot, pSeries_lpar_hpte_updatepp() argument
302 want_v, slot, flags, psize); pSeries_lpar_hpte_updatepp()
304 lpar_rc = plpar_pte_protect(flags, slot, want_v); pSeries_lpar_hpte_updatepp()
318 static unsigned long pSeries_lpar_hpte_getword0(unsigned long slot) pSeries_lpar_hpte_getword0() argument
330 lpar_rc = plpar_pte_read(flags, slot, &dword0, &dummy_word1); pSeries_lpar_hpte_getword0()
341 long slot; pSeries_lpar_hpte_find() local
348 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP; pSeries_lpar_hpte_find()
350 hpte_v = pSeries_lpar_hpte_getword0(slot); pSeries_lpar_hpte_find()
354 return slot; pSeries_lpar_hpte_find()
355 ++slot; pSeries_lpar_hpte_find()
366 unsigned long lpar_rc, slot, vsid, flags; pSeries_lpar_hpte_updateboltedpp() local
371 slot = pSeries_lpar_hpte_find(vpn, psize, ssize); pSeries_lpar_hpte_updateboltedpp()
372 BUG_ON(slot == -1); pSeries_lpar_hpte_updateboltedpp()
375 lpar_rc = plpar_pte_protect(flags, slot, 0); pSeries_lpar_hpte_updateboltedpp()
380 static void pSeries_lpar_hpte_invalidate(unsigned long slot, unsigned long vpn, pSeries_lpar_hpte_invalidate() argument
388 pr_devel(" inval : slot=%lx, vpn=%016lx, psize: %d, local: %d\n", pSeries_lpar_hpte_invalidate()
389 slot, vpn, psize, local); pSeries_lpar_hpte_invalidate()
392 lpar_rc = plpar_pte_remove(H_AVPN, slot, want_v, &dummy1, &dummy2); pSeries_lpar_hpte_invalidate()
405 static void __pSeries_lpar_hugepage_invalidate(unsigned long *slot, __pSeries_lpar_hugepage_invalidate() argument
420 pSeries_lpar_hpte_invalidate(slot[i], vpn[i], psize, 0, __pSeries_lpar_hugepage_invalidate()
423 param[pix] = HBR_REQUEST | HBR_AVPN | slot[i]; __pSeries_lpar_hugepage_invalidate()
458 unsigned long shift, hidx, vpn = 0, hash, slot; pSeries_lpar_hugepage_invalidate() local
476 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP; pSeries_lpar_hugepage_invalidate()
477 slot += hidx & _PTEIDX_GROUP_IX; pSeries_lpar_hugepage_invalidate()
479 slot_array[index] = slot; pSeries_lpar_hugepage_invalidate()
502 unsigned long slot, vsid; pSeries_lpar_hpte_removebolted() local
507 slot = pSeries_lpar_hpte_find(vpn, psize, ssize); pSeries_lpar_hpte_removebolted()
508 BUG_ON(slot == -1); pSeries_lpar_hpte_removebolted()
512 pSeries_lpar_hpte_invalidate(slot, vpn, psize, 0, ssize, 0); pSeries_lpar_hpte_removebolted()
527 unsigned long hash, index, shift, hidx, slot; pSeries_lpar_flush_hash_range() local
545 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP; pte_iterate_hashed_subpages()
546 slot += hidx & _PTEIDX_GROUP_IX; pte_iterate_hashed_subpages()
551 pSeries_lpar_hpte_invalidate(slot, vpn, psize, pte_iterate_hashed_subpages()
554 param[pix] = HBR_REQUEST | HBR_AVPN | slot; pte_iterate_hashed_subpages()
/linux-4.4.14/arch/cris/arch-v32/mach-fs/
H A Darbiter.c70 int slot; crisv32_arbiter_config() local
77 * each slot with a suitable sentinel value outside the valid crisv32_arbiter_config()
83 for (slot = 0; slot < NBR_OF_SLOTS; slot++) crisv32_arbiter_config()
84 val[slot] = -1; crisv32_arbiter_config()
89 * also give clients with zero-requests one slot each crisv32_arbiter_config()
107 * Skip inactive clients. Also skip zero-slot crisv32_arbiter_config()
117 /* Only allocate one slot for this client. */ crisv32_arbiter_config()
135 for (slot = 0; slot < NBR_OF_SLOTS; slot++) { crisv32_arbiter_config()
142 if (val[slot] < 0) { crisv32_arbiter_config()
149 val[slot] = client; crisv32_arbiter_config()
153 REG_WR_INT_VECT(marb, regi_marb, rw_ext_slots, slot, crisv32_arbiter_config()
154 val[slot]); crisv32_arbiter_config()
156 REG_WR_INT_VECT(marb, regi_marb, rw_int_slots, slot, crisv32_arbiter_config()
157 val[slot]); crisv32_arbiter_config()
225 * of the slot-allocated clients doesn't claim their slot. crisv32_arbiter_allocate_bandwidth()
/linux-4.4.14/fs/ocfs2/
H A Dslot_map.c81 /* This version is for the extended slot map */ ocfs2_update_slot_info_extended()
104 * Post the slot information on disk into our slot_info struct.
125 * The slot data will have been refreshed when ocfs2_super_lock ocfs2_update_slot_info()
163 /* post the our slot info stuff into it's destination bh and write it
223 * Calculate how many bytes are needed by the slot map. Returns
224 * an error if the slot map file is too small.
249 /* try to find global node in the slot info. Returns -ENOENT
291 int slot; ocfs2_node_num_to_slot() local
295 slot = __ocfs2_node_num_to_slot(si, node_num); ocfs2_node_num_to_slot()
298 return slot; ocfs2_node_num_to_slot()
472 int slot; ocfs2_find_slot() local
480 /* search for ourselves first and take the slot if it already ocfs2_find_slot()
484 slot = __ocfs2_node_num_to_slot(si, osb->node_num); ocfs2_find_slot()
485 if (slot < 0) { ocfs2_find_slot()
486 /* if no slot yet, then just take 1st available ocfs2_find_slot()
488 slot = __ocfs2_find_empty_slot(si, osb->preferred_slot); ocfs2_find_slot()
489 if (slot < 0) { ocfs2_find_slot()
497 "allocated to this node!\n", slot, osb->dev_str); ocfs2_find_slot()
499 ocfs2_set_slot(si, slot, osb->node_num); ocfs2_find_slot()
500 osb->slot_num = slot; ocfs2_find_slot()
H A Dsysfile.c44 u32 slot);
58 u32 slot) get_local_system_inode()
63 BUG_ON(slot == OCFS2_INVALID_SLOT); get_local_system_inode()
97 index = (slot * NUM_LOCAL_SYSTEM_INODES) + get_local_system_inode()
105 u32 slot) ocfs2_get_system_file_inode()
114 arr = get_local_system_inode(osb, type, slot); ocfs2_get_system_file_inode()
127 inode = _ocfs2_get_system_file_inode(osb, type, slot); ocfs2_get_system_file_inode()
140 u32 slot) _ocfs2_get_system_file_inode()
149 type, slot); _ocfs2_get_system_file_inode()
56 get_local_system_inode(struct ocfs2_super *osb, int type, u32 slot) get_local_system_inode() argument
103 ocfs2_get_system_file_inode(struct ocfs2_super *osb, int type, u32 slot) ocfs2_get_system_file_inode() argument
138 _ocfs2_get_system_file_inode(struct ocfs2_super *osb, int type, u32 slot) _ocfs2_get_system_file_inode() argument
/linux-4.4.14/drivers/input/joystick/
H A Dgrip_mp.c73 #define IO_SLOT_CHANGE 0x0800 /* Multiport physical slot status changed */
350 * B21-B24 => multiport slot index (1-4)
362 int slot; get_and_decode_packet() local
380 slot = ((packet >> 21) & 0xf) - 1; get_and_decode_packet()
381 if ((slot < 0) || (slot > 3)) get_and_decode_packet()
384 port = grip->port[slot]; get_and_decode_packet()
395 printk(KERN_INFO "grip_mp: removing %s, slot %d\n", get_and_decode_packet()
396 grip_name[port->mode], slot); get_and_decode_packet()
400 dbg("Reset: grip multiport slot %d\n", slot); get_and_decode_packet()
422 dbg("New Grip pad in multiport slot %d.\n", slot); get_and_decode_packet()
423 if (register_slot(slot, grip)) { get_and_decode_packet()
445 * Returns true if all multiport slot states appear valid.
450 int flags, slot, invalid = 0, active = 0; slots_valid() local
456 for (slot = 0; slot < 4; slot++) { slots_valid()
457 if (grip->port[slot]->mode == GRIP_MODE_RESET) slots_valid()
459 if (grip->port[slot]->mode != GRIP_MODE_NONE) slots_valid()
463 /* Return true if no active slot but multiport sent all its data */ slots_valid()
509 static void report_slot(struct grip_mp *grip, int slot) report_slot() argument
511 struct grip_port *port = grip->port[slot]; report_slot()
583 static int register_slot(int slot, struct grip_mp *grip) register_slot() argument
585 struct grip_port *port = grip->port[slot]; register_slot()
624 report_slot(grip, slot); register_slot()
/linux-4.4.14/drivers/eisa/
H A Deisa-bus.c50 x = (root->bus_nr << 8) | edev->slot; is_forced_dev()
190 int slot) eisa_init_device()
196 sig_addr = SLOT_ADDRESS(root, slot) + EISA_VENDOR_ID_OFFSET; eisa_init_device()
203 edev->slot = slot; eisa_init_device()
204 edev->state = inb(SLOT_ADDRESS(root, slot) + EISA_CONFIG_OFFSET) eisa_init_device()
206 edev->base_addr = SLOT_ADDRESS(root, slot); eisa_init_device()
213 dev_set_name(&edev->dev, "%02X:%02X", root->bus_nr, slot); eisa_init_device()
263 int slot) eisa_request_resources()
268 /* Don't register resource for slot 0, since this is eisa_request_resources()
274 if (!slot && i > 0) { eisa_request_resources()
279 if (slot) { eisa_request_resources()
281 edev->res[i].start = SLOT_ADDRESS(root, slot) eisa_request_resources()
287 edev->res[i].start = SLOT_ADDRESS(root, slot) eisa_request_resources()
323 /* First try to get hold of slot 0. If there is no device eisa_probe()
328 dev_err(root->dev, "EISA: Couldn't allocate mainboard slot\n"); eisa_probe()
363 dev_err(root->dev, "EISA: Out of memory for slot %d\n", eisa_probe()
370 "Cannot allocate resource for EISA slot %d\n", eisa_probe()
391 dev_info(&edev->dev, "EISA: slot %d: %s detected%s\n", i, eisa_probe()
188 eisa_init_device(struct eisa_root_device *root, struct eisa_device *edev, int slot) eisa_init_device() argument
261 eisa_request_resources(struct eisa_root_device *root, struct eisa_device *edev, int slot) eisa_request_resources() argument
/linux-4.4.14/arch/mips/ath79/
H A Dpci.c30 .slot = 17,
34 .slot = 18,
38 .slot = 19,
46 .slot = 0,
55 .slot = 0,
61 .slot = 0,
67 int __init pcibios_map_irq(const struct pci_dev *dev, uint8_t slot, uint8_t pin) pcibios_map_irq() argument
97 entry->slot == slot && pcibios_map_irq()
/linux-4.4.14/arch/x86/kvm/
H A Diommu.c46 static pfn_t kvm_pin_pages(struct kvm_memory_slot *slot, gfn_t gfn, kvm_pin_pages() argument
52 pfn = gfn_to_pfn_memslot(slot, gfn); kvm_pin_pages()
60 gfn_to_pfn_memslot(slot, gfn++); kvm_pin_pages()
73 int kvm_iommu_map_pages(struct kvm *kvm, struct kvm_memory_slot *slot) kvm_iommu_map_pages() argument
85 gfn = slot->base_gfn; kvm_iommu_map_pages()
86 end_gfn = gfn + slot->npages; kvm_iommu_map_pages()
89 if (!(slot->flags & KVM_MEM_READONLY)) kvm_iommu_map_pages()
116 while (__gfn_to_hva_memslot(slot, gfn) & (page_size - 1)) kvm_iommu_map_pages()
123 pfn = kvm_pin_pages(slot, gfn, page_size >> PAGE_SHIFT); kvm_iommu_map_pages()
147 kvm_iommu_put_pages(kvm, slot->base_gfn, gfn - slot->base_gfn); kvm_iommu_map_pages()
316 void kvm_iommu_unmap_pages(struct kvm *kvm, struct kvm_memory_slot *slot) kvm_iommu_unmap_pages() argument
318 kvm_iommu_put_pages(kvm, slot->base_gfn, slot->npages); kvm_iommu_unmap_pages()
/linux-4.4.14/arch/arm/mach-iop33x/
H A Diq80331.c53 iq80331_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) iq80331_pci_map_irq() argument
57 if (slot == 1 && pin == 1) { iq80331_pci_map_irq()
60 } else if (slot == 1 && pin == 2) { iq80331_pci_map_irq()
63 } else if (slot == 1 && pin == 3) { iq80331_pci_map_irq()
66 } else if (slot == 1 && pin == 4) { iq80331_pci_map_irq()
69 } else if (slot == 2) { iq80331_pci_map_irq()
H A Diq80332.c53 iq80332_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) iq80332_pci_map_irq() argument
57 if (slot == 4 && pin == 1) { iq80332_pci_map_irq()
60 } else if (slot == 4 && pin == 2) { iq80332_pci_map_irq()
63 } else if (slot == 4 && pin == 3) { iq80332_pci_map_irq()
66 } else if (slot == 4 && pin == 4) { iq80332_pci_map_irq()
69 } else if (slot == 6) { iq80332_pci_map_irq()
/linux-4.4.14/fs/ocfs2/cluster/
H A Dheartbeat.c480 unsigned int slot; o2hb_issue_node_write() local
485 slot = o2nm_this_node(); o2hb_issue_node_write()
487 bio = o2hb_setup_one_bio(reg, write_wc, &slot, slot+1); o2hb_issue_node_write()
523 mlog(ML_ERROR, "Dump slot information: seq = 0x%llx, node = %u, " o2hb_dump_slot()
542 * Compare the slot data with what we wrote in the last iteration.
544 * detect errors like... another node hearting on the same slot,
550 struct o2hb_disk_slot *slot; o2hb_check_own_slot() local
554 slot = &reg->hr_slots[o2nm_this_node()]; o2hb_check_own_slot()
556 if (!slot->ds_last_time) o2hb_check_own_slot()
559 hb_block = slot->ds_raw_block; o2hb_check_own_slot()
560 if (le64_to_cpu(hb_block->hb_seq) == slot->ds_last_time && o2hb_check_own_slot()
561 le64_to_cpu(hb_block->hb_generation) == slot->ds_last_generation && o2hb_check_own_slot()
562 hb_block->hb_node == slot->ds_node_num) o2hb_check_own_slot()
569 if (hb_block->hb_node != slot->ds_node_num) o2hb_check_own_slot()
572 slot->ds_last_generation) o2hb_check_own_slot()
579 slot->ds_node_num, (unsigned long long)slot->ds_last_generation, o2hb_check_own_slot()
580 (unsigned long long)slot->ds_last_time, hb_block->hb_node, o2hb_check_own_slot()
592 struct o2hb_disk_slot *slot; o2hb_prepare_block() local
596 slot = &reg->hr_slots[node_num]; o2hb_prepare_block()
598 hb_block = (struct o2hb_disk_heartbeat_block *)slot->ds_raw_block; o2hb_prepare_block()
690 static void o2hb_shutdown_slot(struct o2hb_disk_slot *slot) o2hb_shutdown_slot() argument
697 node = o2nm_get_node_by_num(slot->ds_node_num); o2hb_shutdown_slot()
702 if (!list_empty(&slot->ds_live_item)) { o2hb_shutdown_slot()
704 slot->ds_node_num); o2hb_shutdown_slot()
706 list_del_init(&slot->ds_live_item); o2hb_shutdown_slot()
708 if (list_empty(&o2hb_live_slots[slot->ds_node_num])) { o2hb_shutdown_slot()
709 clear_bit(slot->ds_node_num, o2hb_live_node_bitmap); o2hb_shutdown_slot()
712 slot->ds_node_num); o2hb_shutdown_slot()
768 struct o2hb_disk_slot *slot) o2hb_check_slot()
781 memcpy(hb_block, slot->ds_raw_block, reg->hr_block_bytes); o2hb_check_slot()
787 node = o2nm_get_node_by_num(slot->ds_node_num); o2hb_check_slot()
790 tmp = test_bit(slot->ds_node_num, o2hb_live_node_bitmap); o2hb_check_slot()
804 if (list_empty(&slot->ds_live_item)) o2hb_check_slot()
811 slot->ds_node_num, reg->hr_dev_name); o2hb_check_slot()
814 slot->ds_equal_samples++; o2hb_check_slot()
821 if (slot->ds_last_time != cputime) o2hb_check_slot()
822 slot->ds_changed_samples++; o2hb_check_slot()
824 slot->ds_equal_samples++; o2hb_check_slot()
825 slot->ds_last_time = cputime; o2hb_check_slot()
832 if (slot->ds_last_generation != le64_to_cpu(hb_block->hb_generation)) { o2hb_check_slot()
834 slot->ds_equal_samples = 0; o2hb_check_slot()
836 "to 0x%llx)\n", slot->ds_node_num, o2hb_check_slot()
837 (long long)slot->ds_last_generation, o2hb_check_slot()
841 slot->ds_last_generation = le64_to_cpu(hb_block->hb_generation); o2hb_check_slot()
845 slot->ds_node_num, (long long)slot->ds_last_generation, o2hb_check_slot()
848 (unsigned long long)slot->ds_last_time, slot->ds_changed_samples, o2hb_check_slot()
849 slot->ds_equal_samples); o2hb_check_slot()
856 if (list_empty(&slot->ds_live_item) && o2hb_check_slot()
857 slot->ds_changed_samples >= O2HB_LIVE_THRESHOLD) { o2hb_check_slot()
859 slot->ds_node_num, (long long)slot->ds_last_generation); o2hb_check_slot()
861 set_bit(slot->ds_node_num, reg->hr_live_node_bitmap); o2hb_check_slot()
864 if (list_empty(&o2hb_live_slots[slot->ds_node_num])) { o2hb_check_slot()
866 "bitmap\n", slot->ds_node_num); o2hb_check_slot()
867 set_bit(slot->ds_node_num, o2hb_live_node_bitmap); o2hb_check_slot()
870 slot->ds_node_num); o2hb_check_slot()
876 list_add_tail(&slot->ds_live_item, o2hb_check_slot()
877 &o2hb_live_slots[slot->ds_node_num]); o2hb_check_slot()
879 slot->ds_equal_samples = 0; o2hb_check_slot()
894 slot->ds_node_num, reg->hr_dev_name, slot_dead_ms, o2hb_check_slot()
901 if (list_empty(&slot->ds_live_item)) o2hb_check_slot()
907 if (slot->ds_equal_samples >= o2hb_dead_threshold || gen_changed) { o2hb_check_slot()
909 slot->ds_node_num); o2hb_check_slot()
911 clear_bit(slot->ds_node_num, reg->hr_live_node_bitmap); o2hb_check_slot()
914 list_del_init(&slot->ds_live_item); o2hb_check_slot()
915 if (list_empty(&o2hb_live_slots[slot->ds_node_num])) { o2hb_check_slot()
917 "nodes bitmap\n", slot->ds_node_num); o2hb_check_slot()
918 clear_bit(slot->ds_node_num, o2hb_live_node_bitmap); o2hb_check_slot()
922 node, slot->ds_node_num); o2hb_check_slot()
931 slot->ds_changed_samples = 0; o2hb_check_slot()
934 if (slot->ds_changed_samples) { o2hb_check_slot()
935 slot->ds_changed_samples = 0; o2hb_check_slot()
936 slot->ds_equal_samples = 0; o2hb_check_slot()
971 * to read the slot so as to be able to remove it from the livemap. o2hb_do_disk_heartbeat()
989 * then we're reading an empty slot anyway... Consider this o2hb_do_disk_heartbeat()
999 * our slot. */ o2hb_do_disk_heartbeat()
1033 /* Skip disarming the timeout if own slot has stale/bad data */ o2hb_do_disk_heartbeat()
1596 struct o2hb_disk_slot *slot; o2hb_map_slot_data() local
1608 slot = &reg->hr_slots[i]; o2hb_map_slot_data()
1609 slot->ds_node_num = i; o2hb_map_slot_data()
1610 INIT_LIST_HEAD(&slot->ds_live_item); o2hb_map_slot_data()
1611 slot->ds_raw_block = NULL; o2hb_map_slot_data()
1638 slot = &reg->hr_slots[j + last_slot]; o2hb_map_slot_data()
1639 slot->ds_raw_block = o2hb_map_slot_data()
1655 struct o2hb_disk_slot *slot; o2hb_populate_slot_data() local
1663 * slot, so we do no verification - o2hb_check_slot will o2hb_populate_slot_data()
1664 * actually determine if each configured slot is valid and o2hb_populate_slot_data()
1667 slot = &reg->hr_slots[i]; o2hb_populate_slot_data()
1668 hb_block = (struct o2hb_disk_heartbeat_block *) slot->ds_raw_block; o2hb_populate_slot_data()
1672 slot->ds_last_time = le64_to_cpu(hb_block->hb_seq); o2hb_populate_slot_data()
1673 slot->ds_last_generation = le64_to_cpu(hb_block->hb_generation); o2hb_populate_slot_data()
767 o2hb_check_slot(struct o2hb_region *reg, struct o2hb_disk_slot *slot) o2hb_check_slot() argument
/linux-4.4.14/arch/mips/sgi-ip27/
H A Dip27-memory.c258 static unsigned long __init slot_getbasepfn(cnodeid_t cnode, int slot) slot_getbasepfn() argument
262 return ((unsigned long)nasid << PFN_NASIDSHFT) | (slot << SLOT_PFNSHIFT); slot_getbasepfn()
265 static unsigned long __init slot_psize_compute(cnodeid_t node, int slot) slot_psize_compute() argument
284 size = (unsigned long)banks->membnk_bnksz[slot/4]; slot_psize_compute()
288 if (slot % 4 == 0) { slot_psize_compute()
357 int slot; szmem() local
362 for (slot = 0; slot < MAX_MEM_SLOTS; slot++) { for_each_online_node()
363 slot_psize = slot_psize_compute(node, slot); for_each_online_node()
364 if (slot == 0) for_each_online_node()
377 printk("Ignoring slot %d onwards on node %d\n", for_each_online_node()
378 slot, node); for_each_online_node()
379 slot = MAX_MEM_SLOTS; for_each_online_node()
382 memblock_add_node(PFN_PHYS(slot_getbasepfn(node, slot)), for_each_online_node()
432 * Currently, the intranode memory hole support assumes that each slot
434 * fits on the first slot.
/linux-4.4.14/sound/pci/ctxfi/
H A Dctimap.h25 unsigned short slot; /* the id of the slot containing input data */ member in struct:imapper
/linux-4.4.14/include/linux/mfd/
H A Dmenelaus.h17 extern int menelaus_set_mmc_opendrain(int slot, int enable);
18 extern int menelaus_set_mmc_slot(int slot, int enable, int power, int cd_on);
/linux-4.4.14/drivers/media/usb/dvb-usb/
H A Dttusb2.c143 static int tt3650_ci_read_attribute_mem(struct dvb_ca_en50221 *ca, int slot, int address) tt3650_ci_read_attribute_mem() argument
148 if (slot) tt3650_ci_read_attribute_mem()
165 static int tt3650_ci_write_attribute_mem(struct dvb_ca_en50221 *ca, int slot, int address, u8 value) tt3650_ci_write_attribute_mem() argument
169 ci_dbg("%d 0x%04x 0x%02x", slot, address, value); tt3650_ci_write_attribute_mem()
171 if (slot) tt3650_ci_write_attribute_mem()
181 static int tt3650_ci_read_cam_control(struct dvb_ca_en50221 *ca, int slot, u8 address) tt3650_ci_read_cam_control() argument
186 if (slot) tt3650_ci_read_cam_control()
201 static int tt3650_ci_write_cam_control(struct dvb_ca_en50221 *ca, int slot, u8 address, u8 value) tt3650_ci_write_cam_control() argument
205 ci_dbg("%d 0x%02x 0x%02x", slot, address, value); tt3650_ci_write_cam_control()
207 if (slot) tt3650_ci_write_cam_control()
216 static int tt3650_ci_set_video_port(struct dvb_ca_en50221 *ca, int slot, int enable) tt3650_ci_set_video_port() argument
221 ci_dbg("%d %d", slot, enable); tt3650_ci_set_video_port()
223 if (slot) tt3650_ci_set_video_port()
240 static int tt3650_ci_slot_shutdown(struct dvb_ca_en50221 *ca, int slot) tt3650_ci_slot_shutdown() argument
242 return tt3650_ci_set_video_port(ca, slot, 0); tt3650_ci_slot_shutdown()
245 static int tt3650_ci_slot_ts_enable(struct dvb_ca_en50221 *ca, int slot) tt3650_ci_slot_ts_enable() argument
247 return tt3650_ci_set_video_port(ca, slot, 1); tt3650_ci_slot_ts_enable()
250 static int tt3650_ci_slot_reset(struct dvb_ca_en50221 *ca, int slot) tt3650_ci_slot_reset() argument
257 ci_dbg("%d", slot); tt3650_ci_slot_reset()
259 if (slot) tt3650_ci_slot_reset()
292 static int tt3650_ci_poll_slot_status(struct dvb_ca_en50221 *ca, int slot, int open) tt3650_ci_poll_slot_status() argument
297 if (slot) tt3650_ci_poll_slot_status()
/linux-4.4.14/arch/cris/arch-v32/mach-a3/
H A Darbiter.c133 int slot; crisv32_arbiter_config() local
140 * each slot with a suitable sentinel value outside the valid crisv32_arbiter_config()
146 for (slot = 0; slot < NBR_OF_SLOTS; slot++) crisv32_arbiter_config()
147 val[slot] = -1; crisv32_arbiter_config()
152 * also give clients with zero-requests one slot each crisv32_arbiter_config()
170 * Skip inactive clients. Also skip zero-slot crisv32_arbiter_config()
180 /* Only allocate one slot for this client. */ crisv32_arbiter_config()
198 for (slot = 0; slot < NBR_OF_SLOTS; slot++) { crisv32_arbiter_config()
205 if (val[slot] < 0) { crisv32_arbiter_config()
213 val[slot] = client; crisv32_arbiter_config()
219 rw_l2_slots, slot, val[slot]); crisv32_arbiter_config()
222 rw_intm_slots, slot, val[slot]); crisv32_arbiter_config()
225 rw_ddr2_slots, slot, val[slot]); crisv32_arbiter_config()
316 * of the slot-allocated clients doesn't claim their slot. crisv32_arbiter_allocate_bandwidth()
/linux-4.4.14/drivers/dca/
H A Ddca-sysfs.c36 int dca_sysfs_add_req(struct dca_provider *dca, struct device *dev, int slot) dca_sysfs_add_req() argument
41 cd = device_create(dca_class, dca->cd, MKDEV(0, slot + 1), NULL, dca_sysfs_add_req()
48 void dca_sysfs_remove_req(struct dca_provider *dca, int slot) dca_sysfs_remove_req() argument
50 device_destroy(dca_class, MKDEV(0, slot + 1)); dca_sysfs_remove_req()
/linux-4.4.14/arch/mips/include/asm/dec/
H A Dkn02.h20 * Address ranges decoded by the "system slot" logic for onboard devices.
70 #define KN02_CSR_INR_TC2 2 /* TURBOchannel slot #2 */
71 #define KN02_CSR_INR_TC1 1 /* TURBOchannel slot #1 */
72 #define KN02_CSR_INR_TC0 0 /* TURBOchannel slot #0 */
H A Dkn02ba.h23 #define KN02BA_CPU_INR_TC2 4 /* TURBOchannel slot #2 */
24 #define KN02BA_CPU_INR_TC1 3 /* TURBOchannel slot #1 */
25 #define KN02BA_CPU_INR_TC0 2 /* TURBOchannel slot #0 */
/linux-4.4.14/arch/mips/include/asm/sgi/
H A Dgio.h20 * There is 10MB of GIO address space for GIO64 slot devices
21 * slot# slot type address range size
39 * the slot undefined.
/linux-4.4.14/arch/m68k/coldfire/
H A Dclk.c44 __raw_writeb(clk->slot, MCFPM_PPMCR0); __clk_enable0()
49 __raw_writeb(clk->slot, MCFPM_PPMSR0); __clk_disable0()
60 __raw_writeb(clk->slot, MCFPM_PPMCR1); __clk_enable1()
65 __raw_writeb(clk->slot, MCFPM_PPMSR1); __clk_disable1()
/linux-4.4.14/arch/arm/mach-orion5x/
H A Dboard-rd88f5182.c74 static int __init rd88f5182_pci_map_irq(const struct pci_dev *dev, u8 slot, rd88f5182_pci_map_irq() argument
82 irq = orion5x_pci_map_irq(dev, slot, pin); rd88f5182_pci_map_irq()
89 switch (slot - RD88F5182_PCI_SLOT0_OFFS) { rd88f5182_pci_map_irq()
/linux-4.4.14/tools/arch/sparc/include/asm/
H A Dbarrier_64.h12 * delay slot, but a case has been traced recently wherein the memory barrier
13 * was one instruction after the branch delay slot and the chip still hung.
25 * delay slot to avoid the problem case.

Completed in 3801 milliseconds

123456789