diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-07 18:41:01 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-07 18:41:01 -0500 |
commit | b424e8d3b438e841cd1700f6433a100a5d611e4a (patch) | |
tree | 545638d0b925de4c7f740286760767cca86cb91e /drivers/pci/proc.c | |
parent | 7c7758f99d39d529a64d4f60d22129bbf2f16d74 (diff) | |
parent | f6dc1e5e3d4b523e1616b43beddb04e4fb1d376a (diff) |
Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6
* 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6: (98 commits)
PCI PM: Put PM callbacks in the order of execution
PCI PM: Run default PM callbacks for all devices using new framework
PCI PM: Register power state of devices during initialization
PCI PM: Call pci_fixup_device from legacy routines
PCI PM: Rearrange code in pci-driver.c
PCI PM: Avoid touching devices behind bridges in unknown state
PCI PM: Move pci_has_legacy_pm_support
PCI PM: Power-manage devices without drivers during suspend-resume
PCI PM: Add suspend counterpart of pci_reenable_device
PCI PM: Fix poweroff and restore callbacks
PCI: Use msleep instead of cpu_relax during ASPM link retraining
PCI: PCIe portdrv: Add kerneldoc comments to remining core funtions
PCI: PCIe portdrv: Rearrange code so that related things are together
PCI: PCIe portdrv: Fix suspend and resume of PCI Express port services
PCI: PCIe portdrv: Add kerneldoc comments to some core functions
x86/PCI: Do not use interrupt links for devices using MSI-X
net: sfc: Use pci_clear_master() to disable bus mastering
PCI: Add pci_clear_master() as opposite of pci_set_master()
PCI hotplug: remove redundant test in cpq hotplug
PCI: pciehp: cleanup register and field definitions
...
Diffstat (limited to 'drivers/pci/proc.c')
-rw-r--r-- | drivers/pci/proc.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/pci/proc.c b/drivers/pci/proc.c index e1098c302c45..593bb844b8db 100644 --- a/drivers/pci/proc.c +++ b/drivers/pci/proc.c | |||
@@ -252,11 +252,20 @@ static int proc_bus_pci_mmap(struct file *file, struct vm_area_struct *vma) | |||
252 | const struct proc_dir_entry *dp = PDE(inode); | 252 | const struct proc_dir_entry *dp = PDE(inode); |
253 | struct pci_dev *dev = dp->data; | 253 | struct pci_dev *dev = dp->data; |
254 | struct pci_filp_private *fpriv = file->private_data; | 254 | struct pci_filp_private *fpriv = file->private_data; |
255 | int ret; | 255 | int i, ret; |
256 | 256 | ||
257 | if (!capable(CAP_SYS_RAWIO)) | 257 | if (!capable(CAP_SYS_RAWIO)) |
258 | return -EPERM; | 258 | return -EPERM; |
259 | 259 | ||
260 | /* Make sure the caller is mapping a real resource for this device */ | ||
261 | for (i = 0; i < PCI_ROM_RESOURCE; i++) { | ||
262 | if (pci_mmap_fits(dev, i, vma)) | ||
263 | break; | ||
264 | } | ||
265 | |||
266 | if (i >= PCI_ROM_RESOURCE) | ||
267 | return -ENODEV; | ||
268 | |||
260 | ret = pci_mmap_page_range(dev, vma, | 269 | ret = pci_mmap_page_range(dev, vma, |
261 | fpriv->mmap_state, | 270 | fpriv->mmap_state, |
262 | fpriv->write_combine); | 271 | fpriv->write_combine); |
@@ -352,15 +361,16 @@ static int show_device(struct seq_file *m, void *v) | |||
352 | dev->vendor, | 361 | dev->vendor, |
353 | dev->device, | 362 | dev->device, |
354 | dev->irq); | 363 | dev->irq); |
355 | /* Here should be 7 and not PCI_NUM_RESOURCES as we need to preserve compatibility */ | 364 | |
356 | for (i=0; i<7; i++) { | 365 | /* only print standard and ROM resources to preserve compatibility */ |
366 | for (i = 0; i <= PCI_ROM_RESOURCE; i++) { | ||
357 | resource_size_t start, end; | 367 | resource_size_t start, end; |
358 | pci_resource_to_user(dev, i, &dev->resource[i], &start, &end); | 368 | pci_resource_to_user(dev, i, &dev->resource[i], &start, &end); |
359 | seq_printf(m, "\t%16llx", | 369 | seq_printf(m, "\t%16llx", |
360 | (unsigned long long)(start | | 370 | (unsigned long long)(start | |
361 | (dev->resource[i].flags & PCI_REGION_FLAG_MASK))); | 371 | (dev->resource[i].flags & PCI_REGION_FLAG_MASK))); |
362 | } | 372 | } |
363 | for (i=0; i<7; i++) { | 373 | for (i = 0; i <= PCI_ROM_RESOURCE; i++) { |
364 | resource_size_t start, end; | 374 | resource_size_t start, end; |
365 | pci_resource_to_user(dev, i, &dev->resource[i], &start, &end); | 375 | pci_resource_to_user(dev, i, &dev->resource[i], &start, &end); |
366 | seq_printf(m, "\t%16llx", | 376 | seq_printf(m, "\t%16llx", |