Lines Matching full:slot
52 static int enable_slot(struct hotplug_slot *slot);
53 static int disable_slot(struct hotplug_slot *slot);
54 static int set_attention_status(struct hotplug_slot *slot, u8 value);
55 static int get_power_status(struct hotplug_slot *slot, u8 *value);
56 static int get_attention_status(struct hotplug_slot *slot, u8 *value);
57 static int get_adapter_status(struct hotplug_slot *slot, u8 *value);
58 static int get_latch_status(struct hotplug_slot *slot, u8 *value);
73 struct slot *slot = to_slot(hotplug_slot); in enable_slot() local
76 dbg("%s - physical_slot = %s", __func__, slot_name(slot)); in enable_slot()
79 retval = controller->ops->set_power(slot, 1); in enable_slot()
86 struct slot *slot = to_slot(hotplug_slot); in disable_slot() local
89 dbg("%s - physical_slot = %s", __func__, slot_name(slot)); in disable_slot()
94 dbg("%s - unconfiguring slot %s", __func__, slot_name(slot)); in disable_slot()
95 retval = cpci_unconfigure_slot(slot); in disable_slot()
97 err("%s - could not unconfigure slot %s", in disable_slot()
98 __func__, slot_name(slot)); in disable_slot()
101 dbg("%s - finished unconfiguring slot %s", __func__, slot_name(slot)); in disable_slot()
104 if (cpci_clear_ext(slot)) { in disable_slot()
105 err("%s - could not clear EXT for slot %s", in disable_slot()
106 __func__, slot_name(slot)); in disable_slot()
110 cpci_led_on(slot); in disable_slot()
113 retval = controller->ops->set_power(slot, 0); in disable_slot()
118 slot->adapter_status = 0; in disable_slot()
120 if (slot->extracting) { in disable_slot()
121 slot->extracting = 0; in disable_slot()
130 cpci_get_power_status(struct slot *slot) in cpci_get_power_status() argument
135 power = controller->ops->get_power(slot); in cpci_get_power_status()
142 struct slot *slot = to_slot(hotplug_slot); in get_power_status() local
144 *value = cpci_get_power_status(slot); in get_power_status()
151 struct slot *slot = to_slot(hotplug_slot); in get_attention_status() local
153 *value = cpci_get_attention_status(slot); in get_attention_status()
166 struct slot *slot = to_slot(hotplug_slot); in get_adapter_status() local
168 *value = slot->adapter_status; in get_adapter_status()
175 struct slot *slot = to_slot(hotplug_slot); in get_latch_status() local
177 *value = slot->latch_status; in get_latch_status()
181 static void release_slot(struct slot *slot) in release_slot() argument
183 pci_dev_put(slot->dev); in release_slot()
184 kfree(slot); in release_slot()
192 struct slot *slot; in cpci_hp_register_bus() local
201 * Create a structure for each slot, and register that slot in cpci_hp_register_bus()
205 slot = kzalloc(sizeof(struct slot), GFP_KERNEL); in cpci_hp_register_bus()
206 if (!slot) { in cpci_hp_register_bus()
211 slot->bus = bus; in cpci_hp_register_bus()
212 slot->number = i; in cpci_hp_register_bus()
213 slot->devfn = PCI_DEVFN(i, 0); in cpci_hp_register_bus()
217 slot->hotplug_slot.ops = &cpci_hotplug_slot_ops; in cpci_hp_register_bus()
219 dbg("registering slot %s", name); in cpci_hp_register_bus()
220 status = pci_hp_register(&slot->hotplug_slot, bus, i, name); in cpci_hp_register_bus()
225 dbg("slot registered with name: %s", slot_name(slot)); in cpci_hp_register_bus()
227 /* Add slot to our internal list */ in cpci_hp_register_bus()
229 list_add(&slot->slot_list, &slot_list); in cpci_hp_register_bus()
235 kfree(slot); in cpci_hp_register_bus()
244 struct slot *slot; in cpci_hp_unregister_bus() local
245 struct slot *tmp; in cpci_hp_unregister_bus()
253 list_for_each_entry_safe(slot, tmp, &slot_list, slot_list) { in cpci_hp_unregister_bus()
254 if (slot->bus == bus) { in cpci_hp_unregister_bus()
255 list_del(&slot->slot_list); in cpci_hp_unregister_bus()
258 dbg("deregistering slot %s", slot_name(slot)); in cpci_hp_unregister_bus()
259 pci_hp_deregister(&slot->hotplug_slot); in cpci_hp_unregister_bus()
260 release_slot(slot); in cpci_hp_unregister_bus()
297 struct slot *slot; in init_slots() local
306 list_for_each_entry(slot, &slot_list, slot_list) { in init_slots()
307 dbg("%s - looking at slot %s", __func__, slot_name(slot)); in init_slots()
308 if (clear_ins && cpci_check_and_clear_ins(slot)) in init_slots()
309 dbg("%s - cleared INS for slot %s", in init_slots()
310 __func__, slot_name(slot)); in init_slots()
311 dev = pci_get_slot(slot->bus, PCI_DEVFN(slot->number, 0)); in init_slots()
313 slot->adapter_status = 1; in init_slots()
314 slot->latch_status = 1; in init_slots()
315 slot->dev = dev; in init_slots()
326 struct slot *slot; in check_slots() local
338 list_for_each_entry(slot, &slot_list, slot_list) { in check_slots()
339 dbg("%s - looking at slot %s", __func__, slot_name(slot)); in check_slots()
340 if (cpci_check_and_clear_ins(slot)) { in check_slots()
345 if (slot->dev) { in check_slots()
346 warn("slot %s already inserted", in check_slots()
347 slot_name(slot)); in check_slots()
353 dbg("%s - slot %s inserted", __func__, slot_name(slot)); in check_slots()
356 hs_csr = cpci_get_hs_csr(slot); in check_slots()
357 dbg("%s - slot %s HS_CSR (1) = %04x", in check_slots()
358 __func__, slot_name(slot), hs_csr); in check_slots()
361 dbg("%s - configuring slot %s", in check_slots()
362 __func__, slot_name(slot)); in check_slots()
363 if (cpci_configure_slot(slot)) { in check_slots()
364 err("%s - could not configure slot %s", in check_slots()
365 __func__, slot_name(slot)); in check_slots()
368 dbg("%s - finished configuring slot %s", in check_slots()
369 __func__, slot_name(slot)); in check_slots()
372 hs_csr = cpci_get_hs_csr(slot); in check_slots()
373 dbg("%s - slot %s HS_CSR (2) = %04x", in check_slots()
374 __func__, slot_name(slot), hs_csr); in check_slots()
376 slot->latch_status = 1; in check_slots()
377 slot->adapter_status = 1; in check_slots()
379 cpci_led_off(slot); in check_slots()
382 hs_csr = cpci_get_hs_csr(slot); in check_slots()
383 dbg("%s - slot %s HS_CSR (3) = %04x", in check_slots()
384 __func__, slot_name(slot), hs_csr); in check_slots()
387 } else if (cpci_check_ext(slot)) { in check_slots()
389 dbg("%s - slot %s extracted", in check_slots()
390 __func__, slot_name(slot)); in check_slots()
393 hs_csr = cpci_get_hs_csr(slot); in check_slots()
394 dbg("%s - slot %s HS_CSR = %04x", in check_slots()
395 __func__, slot_name(slot), hs_csr); in check_slots()
397 if (!slot->extracting) { in check_slots()
398 slot->latch_status = 0; in check_slots()
399 slot->extracting = 1; in check_slots()
403 } else if (slot->extracting) { in check_slots()
404 hs_csr = cpci_get_hs_csr(slot); in check_slots()
410 err("card in slot %s was improperly removed", in check_slots()
411 slot_name(slot)); in check_slots()
412 slot->adapter_status = 0; in check_slots()
413 slot->extracting = 0; in check_slots()
549 struct slot *slot; in cleanup_slots() local
550 struct slot *tmp; in cleanup_slots()
559 list_for_each_entry_safe(slot, tmp, &slot_list, slot_list) { in cleanup_slots()
560 list_del(&slot->slot_list); in cleanup_slots()
561 pci_hp_deregister(&slot->hotplug_slot); in cleanup_slots()
562 release_slot(slot); in cleanup_slots()