diff options
| author | Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> | 2006-05-12 00:39:45 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-06-19 17:13:23 -0400 |
| commit | 132066a9c84af6f5e8d893145a9c63f849143867 (patch) | |
| tree | b81ad81f65e79088e84666a98b0d53dcf2cb0b78 | |
| parent | 6e33706b191ff8687f103a86de842b690fd8fb9d (diff) | |
[PATCH] pciehp: Implement get_address callback
This patch implements .get_address callback of hotplug_slot_ops for
PCIEHP driver. With this patch, we can see bus address of hotplug
slots as follows:
# cat /sys/bus/pci/slots/0010_0000/address
0000:0a:00
Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Cc: Kristen Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| -rw-r--r-- | drivers/pci/hotplug/pciehp_core.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c index 601cf9045b20..c67b7c3f1ddf 100644 --- a/drivers/pci/hotplug/pciehp_core.c +++ b/drivers/pci/hotplug/pciehp_core.c | |||
| @@ -69,6 +69,7 @@ static int get_power_status (struct hotplug_slot *slot, u8 *value); | |||
| 69 | static int get_attention_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); | 70 | static int get_latch_status (struct hotplug_slot *slot, u8 *value); |
| 71 | static int get_adapter_status (struct hotplug_slot *slot, u8 *value); | 71 | static int get_adapter_status (struct hotplug_slot *slot, u8 *value); |
| 72 | static int get_address (struct hotplug_slot *slot, u32 *value); | ||
| 72 | static int get_max_bus_speed (struct hotplug_slot *slot, enum pci_bus_speed *value); | 73 | static int get_max_bus_speed (struct hotplug_slot *slot, enum pci_bus_speed *value); |
| 73 | static int get_cur_bus_speed (struct hotplug_slot *slot, enum pci_bus_speed *value); | 74 | static int get_cur_bus_speed (struct hotplug_slot *slot, enum pci_bus_speed *value); |
| 74 | 75 | ||
| @@ -81,6 +82,7 @@ static struct hotplug_slot_ops pciehp_hotplug_slot_ops = { | |||
| 81 | .get_attention_status = get_attention_status, | 82 | .get_attention_status = get_attention_status, |
| 82 | .get_latch_status = get_latch_status, | 83 | .get_latch_status = get_latch_status, |
| 83 | .get_adapter_status = get_adapter_status, | 84 | .get_adapter_status = get_adapter_status, |
| 85 | .get_address = get_address, | ||
| 84 | .get_max_bus_speed = get_max_bus_speed, | 86 | .get_max_bus_speed = get_max_bus_speed, |
| 85 | .get_cur_bus_speed = get_cur_bus_speed, | 87 | .get_cur_bus_speed = get_cur_bus_speed, |
| 86 | }; | 88 | }; |
| @@ -331,6 +333,18 @@ static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 *value) | |||
| 331 | return 0; | 333 | return 0; |
| 332 | } | 334 | } |
| 333 | 335 | ||
| 336 | static int get_address(struct hotplug_slot *hotplug_slot, u32 *value) | ||
| 337 | { | ||
| 338 | struct slot *slot = hotplug_slot->private; | ||
| 339 | struct pci_bus *bus = slot->ctrl->pci_dev->subordinate; | ||
| 340 | |||
| 341 | dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); | ||
| 342 | |||
| 343 | *value = (pci_domain_nr(bus) << 16) | (slot->bus << 8) | slot->device; | ||
| 344 | |||
| 345 | return 0; | ||
| 346 | } | ||
| 347 | |||
| 334 | static int get_max_bus_speed(struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value) | 348 | static int get_max_bus_speed(struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value) |
| 335 | { | 349 | { |
| 336 | struct slot *slot = hotplug_slot->private; | 350 | struct slot *slot = hotplug_slot->private; |
