diff options
author | Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> | 2005-12-05 05:31:00 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-01-09 15:13:18 -0500 |
commit | 81f154427c0c50b6492d454abf98e15c1c2e354e (patch) | |
tree | 5143314ec7f399b58f2bf98a63c3be7c97d004aa | |
parent | cd5b50be8d8e8e6170da3a261fc625fd603f9dc4 (diff) |
[PATCH] shpchp: Implement get_address callback
The following patch implements .get_address callback of
hotplug_slot_ops for SHPCHP driver. With this patch, we
can see bus address of hotplug slots as follows:
$ cat address
0000:0b:01
Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/pci/hotplug/shpchp_core.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/pci/hotplug/shpchp_core.c b/drivers/pci/hotplug/shpchp_core.c index d81f8a75b49..a2b3f0010ce 100644 --- a/drivers/pci/hotplug/shpchp_core.c +++ b/drivers/pci/hotplug/shpchp_core.c | |||
@@ -65,6 +65,7 @@ static int get_power_status (struct hotplug_slot *slot, u8 *value); | |||
65 | static int get_attention_status (struct hotplug_slot *slot, u8 *value); | 65 | static int get_attention_status (struct hotplug_slot *slot, u8 *value); |
66 | static int get_latch_status (struct hotplug_slot *slot, u8 *value); | 66 | static int get_latch_status (struct hotplug_slot *slot, u8 *value); |
67 | static int get_adapter_status (struct hotplug_slot *slot, u8 *value); | 67 | static int get_adapter_status (struct hotplug_slot *slot, u8 *value); |
68 | static int get_address (struct hotplug_slot *slot, u32 *value); | ||
68 | static int get_max_bus_speed (struct hotplug_slot *slot, enum pci_bus_speed *value); | 69 | static int get_max_bus_speed (struct hotplug_slot *slot, enum pci_bus_speed *value); |
69 | static int get_cur_bus_speed (struct hotplug_slot *slot, enum pci_bus_speed *value); | 70 | static int get_cur_bus_speed (struct hotplug_slot *slot, enum pci_bus_speed *value); |
70 | 71 | ||
@@ -77,6 +78,7 @@ static struct hotplug_slot_ops shpchp_hotplug_slot_ops = { | |||
77 | .get_attention_status = get_attention_status, | 78 | .get_attention_status = get_attention_status, |
78 | .get_latch_status = get_latch_status, | 79 | .get_latch_status = get_latch_status, |
79 | .get_adapter_status = get_adapter_status, | 80 | .get_adapter_status = get_adapter_status, |
81 | .get_address = get_address, | ||
80 | .get_max_bus_speed = get_max_bus_speed, | 82 | .get_max_bus_speed = get_max_bus_speed, |
81 | .get_cur_bus_speed = get_cur_bus_speed, | 83 | .get_cur_bus_speed = get_cur_bus_speed, |
82 | }; | 84 | }; |
@@ -314,6 +316,18 @@ static int get_adapter_status (struct hotplug_slot *hotplug_slot, u8 *value) | |||
314 | return 0; | 316 | return 0; |
315 | } | 317 | } |
316 | 318 | ||
319 | static int get_address (struct hotplug_slot *hotplug_slot, u32 *value) | ||
320 | { | ||
321 | struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); | ||
322 | struct pci_bus *bus = slot->ctrl->pci_dev->subordinate; | ||
323 | |||
324 | dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); | ||
325 | |||
326 | *value = (pci_domain_nr(bus) << 16) | (slot->bus << 8) | slot->device; | ||
327 | |||
328 | return 0; | ||
329 | } | ||
330 | |||
317 | static int get_max_bus_speed (struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value) | 331 | static int get_max_bus_speed (struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value) |
318 | { | 332 | { |
319 | struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); | 333 | struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); |