Lines Matching refs:slot

45 static int set_attention_status(struct hotplug_slot *slot, u8 value);
46 static int enable_slot(struct hotplug_slot *slot);
47 static int disable_slot(struct hotplug_slot *slot);
48 static int get_power_status(struct hotplug_slot *slot, u8 *value);
49 static int get_attention_status(struct hotplug_slot *slot, u8 *value);
50 static int get_latch_status(struct hotplug_slot *slot, u8 *value);
51 static int get_adapter_status(struct hotplug_slot *slot, u8 *value);
65 struct slot *slot;
72 slot = kzalloc(sizeof(*slot), GFP_KERNEL);
73 if (!slot) {
78 hotplug_slot = &slot->hotplug_slot;
80 slot->hp_slot = i;
81 slot->ctrl = ctrl;
82 slot->bus = ctrl->pci_dev->subordinate->number;
83 slot->device = ctrl->slot_device_offset + i;
84 slot->hpc_ops = ctrl->hpc_ops;
85 slot->number = ctrl->first_slot + (ctrl->slot_num_inc * i);
87 slot->wq = alloc_workqueue("shpchp-%d", 0, 0, slot->number);
88 if (!slot->wq) {
93 mutex_init(&slot->lock);
94 INIT_DELAYED_WORK(&slot->work, shpchp_queue_pushbutton_work);
96 /* register this slot with the hotplug pci core */
97 snprintf(name, SLOT_NAME_SIZE, "%d", slot->number);
102 slot->bus, slot->device, slot->hp_slot, slot->number,
105 ctrl->pci_dev->subordinate, slot->device, name);
112 get_power_status(hotplug_slot, &slot->pwr_save);
113 get_attention_status(hotplug_slot, &slot->attention_save);
114 get_latch_status(hotplug_slot, &slot->latch_save);
115 get_adapter_status(hotplug_slot, &slot->presence_save);
117 list_add(&slot->slot_list, &ctrl->slot_list);
122 destroy_workqueue(slot->wq);
124 kfree(slot);
131 struct slot *slot, *next;
133 list_for_each_entry_safe(slot, next, &ctrl->slot_list, slot_list) {
134 list_del(&slot->slot_list);
135 cancel_delayed_work(&slot->work);
136 destroy_workqueue(slot->wq);
137 pci_hp_deregister(&slot->hotplug_slot);
138 kfree(slot);
143 * set_attention_status - Turns the Amber LED for a slot on, off or blink
147 struct slot *slot = get_slot(hotplug_slot);
149 ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
150 __func__, slot_name(slot));
152 slot->attention_save = status;
153 slot->hpc_ops->set_attention_status(slot, status);
160 struct slot *slot = get_slot(hotplug_slot);
162 ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
163 __func__, slot_name(slot));
165 return shpchp_sysfs_enable_slot(slot);
170 struct slot *slot = get_slot(hotplug_slot);
172 ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
173 __func__, slot_name(slot));
175 return shpchp_sysfs_disable_slot(slot);
180 struct slot *slot = get_slot(hotplug_slot);
183 ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
184 __func__, slot_name(slot));
186 retval = slot->hpc_ops->get_power_status(slot, value);
188 *value = slot->pwr_save;
195 struct slot *slot = get_slot(hotplug_slot);
198 ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
199 __func__, slot_name(slot));
201 retval = slot->hpc_ops->get_attention_status(slot, value);
203 *value = slot->attention_save;
210 struct slot *slot = get_slot(hotplug_slot);
213 ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
214 __func__, slot_name(slot));
216 retval = slot->hpc_ops->get_latch_status(slot, value);
218 *value = slot->latch_save;
225 struct slot *slot = get_slot(hotplug_slot);
228 ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
229 __func__, slot_name(slot));
231 retval = slot->hpc_ops->get_adapter_status(slot, value);
233 *value = slot->presence_save;
279 /* Setup the slot information structures */