~ubuntu-branches/debian/experimental/linux-2.6/experimental

« back to all changes in this revision

Viewing changes to arch/ia64/pci/pci.c

  • Committer: Package Import Robot
  • Author(s): maximilian attems, maximilian attems, Ben Hutchings
  • Date: 2012-06-06 10:25:57 UTC
  • mfrom: (1.2.38)
  • Revision ID: package-import@ubuntu.com-20120606102557-b9j3506wcwrqrnx8
Tags: 3.4.1-1~experimental.1
* New upstream release: http://kernelnewbies.org/Linux_3.4
* New upstream stable update:
  http://www.kernel.org/pub/linux/kernel/v3.x/ChangeLog-3.4.1

[ maximilian attems ]
* Enable DM_VERITY, NF_CONNTRACK_TIMEOUT, NF_CT_NETLINK_TIMEOUT,
  IP_NF_MATCH_RPFILTER, IP6_NF_MATCH_RPFILTER, NETFILTER_NETLINK_ACCT,
  NETFILTER_XT_MATCH_NFACCT, NET_SCH_PLUG, SCSI_UFSHCD, SCSI_VIRTIO,
  NET_TEAM, ATH6KL.

[ Ben Hutchings ]
* DFSG: Remove the new vs6624 driver, which contains non-free firmware
* aufs: Update to aufs3.4-20120521
* [rt] Update to 3.4-rt8 and reenable

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 
25
25
#include <asm/machvec.h>
26
26
#include <asm/page.h>
27
 
#include <asm/system.h>
28
27
#include <asm/io.h>
29
28
#include <asm/sal.h>
30
29
#include <asm/smp.h>
320
319
         * Ignore these tiny memory ranges */
321
320
        if (!((window->resource.flags & IORESOURCE_MEM) &&
322
321
              (window->resource.end - window->resource.start < 16)))
323
 
                pci_add_resource(&info->resources, &window->resource);
 
322
                pci_add_resource_offset(&info->resources, &window->resource,
 
323
                                        window->offset);
324
324
 
325
325
        return AE_OK;
326
326
}
395
395
        return NULL;
396
396
}
397
397
 
398
 
void pcibios_resource_to_bus(struct pci_dev *dev,
399
 
                struct pci_bus_region *region, struct resource *res)
400
 
{
401
 
        struct pci_controller *controller = PCI_CONTROLLER(dev);
402
 
        unsigned long offset = 0;
403
 
        int i;
404
 
 
405
 
        for (i = 0; i < controller->windows; i++) {
406
 
                struct pci_window *window = &controller->window[i];
407
 
                if (!(window->resource.flags & res->flags))
408
 
                        continue;
409
 
                if (window->resource.start > res->start)
410
 
                        continue;
411
 
                if (window->resource.end < res->end)
412
 
                        continue;
413
 
                offset = window->offset;
414
 
                break;
415
 
        }
416
 
 
417
 
        region->start = res->start - offset;
418
 
        region->end = res->end - offset;
419
 
}
420
 
EXPORT_SYMBOL(pcibios_resource_to_bus);
421
 
 
422
 
void pcibios_bus_to_resource(struct pci_dev *dev,
423
 
                struct resource *res, struct pci_bus_region *region)
424
 
{
425
 
        struct pci_controller *controller = PCI_CONTROLLER(dev);
426
 
        unsigned long offset = 0;
427
 
        int i;
428
 
 
429
 
        for (i = 0; i < controller->windows; i++) {
430
 
                struct pci_window *window = &controller->window[i];
431
 
                if (!(window->resource.flags & res->flags))
432
 
                        continue;
433
 
                if (window->resource.start - window->offset > region->start)
434
 
                        continue;
435
 
                if (window->resource.end - window->offset < region->end)
436
 
                        continue;
437
 
                offset = window->offset;
438
 
                break;
439
 
        }
440
 
 
441
 
        res->start = region->start + offset;
442
 
        res->end = region->end + offset;
443
 
}
444
 
EXPORT_SYMBOL(pcibios_bus_to_resource);
445
 
 
446
398
static int __devinit is_valid_resource(struct pci_dev *dev, int idx)
447
399
{
448
400
        unsigned int i, type_mask = IORESOURCE_IO | IORESOURCE_MEM;
464
416
static void __devinit
465
417
pcibios_fixup_resources(struct pci_dev *dev, int start, int limit)
466
418
{
467
 
        struct pci_bus_region region;
468
419
        int i;
469
420
 
470
421
        for (i = start; i < limit; i++) {
471
422
                if (!dev->resource[i].flags)
472
423
                        continue;
473
 
                region.start = dev->resource[i].start;
474
 
                region.end = dev->resource[i].end;
475
 
                pcibios_bus_to_resource(dev, &dev->resource[i], &region);
476
424
                if ((is_valid_resource(dev, i)))
477
425
                        pci_claim_resource(dev, i);
478
426
        }