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