diff options
-rw-r--r-- | drivers/pci/hotplug/shpchp_sysfs.c | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/drivers/pci/hotplug/shpchp_sysfs.c b/drivers/pci/hotplug/shpchp_sysfs.c index b0e781dbcffb..ce41719a88f7 100644 --- a/drivers/pci/hotplug/shpchp_sysfs.c +++ b/drivers/pci/hotplug/shpchp_sysfs.c | |||
@@ -88,75 +88,7 @@ static ssize_t show_ctrl (struct device *dev, struct device_attribute *attr, cha | |||
88 | } | 88 | } |
89 | static DEVICE_ATTR (ctrl, S_IRUGO, show_ctrl, NULL); | 89 | static DEVICE_ATTR (ctrl, S_IRUGO, show_ctrl, NULL); |
90 | 90 | ||
91 | static ssize_t show_dev (struct device *dev, struct device_attribute *attr, char *buf) | ||
92 | { | ||
93 | struct pci_dev *pdev, *fdev; | ||
94 | struct controller *ctrl; | ||
95 | char * out = buf; | ||
96 | int index; | ||
97 | struct resource *res; | ||
98 | struct pci_func *new_slot; | ||
99 | struct slot *slot; | ||
100 | |||
101 | pdev = container_of (dev, struct pci_dev, dev); | ||
102 | ctrl = pci_get_drvdata(pdev); | ||
103 | |||
104 | slot=ctrl->slot; | ||
105 | |||
106 | while (slot) { | ||
107 | new_slot = shpchp_slot_find(slot->bus, slot->device, 0); | ||
108 | if (!new_slot) | ||
109 | break; | ||
110 | fdev = new_slot->pci_dev; | ||
111 | if (!fdev) | ||
112 | break; | ||
113 | out += sprintf(out, "assigned resources: memory\n"); | ||
114 | for (index=0; index <= PCI_NUM_RESOURCES; index++) { | ||
115 | res = &(fdev->resource[index]); | ||
116 | if (res && (res->flags & IORESOURCE_MEM) && | ||
117 | !(res->flags & IORESOURCE_PREFETCH)) { | ||
118 | out += sprintf(out, | ||
119 | "start = %8.8lx, length = %8.8lx\n", | ||
120 | res->start, (res->end - res->start)); | ||
121 | } | ||
122 | } | ||
123 | out += sprintf(out, "assigned resources: prefetchable memory\n"); | ||
124 | for (index=0; index <= PCI_NUM_RESOURCES; index++) { | ||
125 | res = &(fdev->resource[index]); | ||
126 | if (res && (res->flags & (IORESOURCE_MEM | | ||
127 | IORESOURCE_PREFETCH))) { | ||
128 | out += sprintf(out, | ||
129 | "start = %8.8lx, length = %8.8lx\n", | ||
130 | res->start, (res->end - res->start)); | ||
131 | } | ||
132 | } | ||
133 | out += sprintf(out, "assigned resources: IO\n"); | ||
134 | for (index=0; index <= PCI_NUM_RESOURCES; index++) { | ||
135 | res = &(fdev->resource[index]); | ||
136 | if (res && (res->flags & IORESOURCE_IO)) { | ||
137 | out += sprintf(out, | ||
138 | "start = %8.8lx, length = %8.8lx\n", | ||
139 | res->start, (res->end - res->start)); | ||
140 | } | ||
141 | } | ||
142 | out += sprintf(out, "assigned resources: bus numbers\n"); | ||
143 | if (fdev->subordinate) | ||
144 | out += sprintf(out, "start = %8.8x, length = %8.8x\n", | ||
145 | fdev->subordinate->secondary, | ||
146 | (fdev->subordinate->subordinate - | ||
147 | fdev->subordinate->secondary)); | ||
148 | else | ||
149 | out += sprintf(out, "start = %8.8x, length = %8.8x\n", | ||
150 | fdev->bus->number, 1); | ||
151 | slot=slot->next; | ||
152 | } | ||
153 | |||
154 | return out - buf; | ||
155 | } | ||
156 | static DEVICE_ATTR (dev, S_IRUGO, show_dev, NULL); | ||
157 | |||
158 | void shpchp_create_ctrl_files (struct controller *ctrl) | 91 | void shpchp_create_ctrl_files (struct controller *ctrl) |
159 | { | 92 | { |
160 | device_create_file (&ctrl->pci_dev->dev, &dev_attr_ctrl); | 93 | device_create_file (&ctrl->pci_dev->dev, &dev_attr_ctrl); |
161 | device_create_file (&ctrl->pci_dev->dev, &dev_attr_dev); | ||
162 | } | 94 | } |