common.c (1ed7d32763857fbdc8e406352404538e41050d22) common.c (f7750a79568788473c5e8092ee58a52248f34329)
1/*
2 * Low-Level PCI Support for PC
3 *
4 * (c) 1999--2000 Martin Mares <mj@ucw.cz>
5 */
6
7#include <linux/sched.h>
8#include <linux/pci.h>

--- 660 unchanged lines hidden (view full) ---

669int pcibios_add_device(struct pci_dev *dev)
670{
671 struct setup_data *data;
672 struct pci_setup_rom *rom;
673 u64 pa_data;
674
675 pa_data = boot_params.hdr.setup_data;
676 while (pa_data) {
1/*
2 * Low-Level PCI Support for PC
3 *
4 * (c) 1999--2000 Martin Mares <mj@ucw.cz>
5 */
6
7#include <linux/sched.h>
8#include <linux/pci.h>

--- 660 unchanged lines hidden (view full) ---

669int pcibios_add_device(struct pci_dev *dev)
670{
671 struct setup_data *data;
672 struct pci_setup_rom *rom;
673 u64 pa_data;
674
675 pa_data = boot_params.hdr.setup_data;
676 while (pa_data) {
677 data = ioremap(pa_data, sizeof(*rom));
677 data = memremap(pa_data, sizeof(*rom), MEMREMAP_WB);
678 if (!data)
679 return -ENOMEM;
680
681 if (data->type == SETUP_PCI) {
682 rom = (struct pci_setup_rom *)data;
683
684 if ((pci_domain_nr(dev->bus) == rom->segment) &&
685 (dev->bus->number == rom->bus) &&
686 (PCI_SLOT(dev->devfn) == rom->device) &&
687 (PCI_FUNC(dev->devfn) == rom->function) &&
688 (dev->vendor == rom->vendor) &&
689 (dev->device == rom->devid)) {
690 dev->rom = pa_data +
691 offsetof(struct pci_setup_rom, romdata);
692 dev->romlen = rom->pcilen;
693 }
694 }
695 pa_data = data->next;
678 if (!data)
679 return -ENOMEM;
680
681 if (data->type == SETUP_PCI) {
682 rom = (struct pci_setup_rom *)data;
683
684 if ((pci_domain_nr(dev->bus) == rom->segment) &&
685 (dev->bus->number == rom->bus) &&
686 (PCI_SLOT(dev->devfn) == rom->device) &&
687 (PCI_FUNC(dev->devfn) == rom->function) &&
688 (dev->vendor == rom->vendor) &&
689 (dev->device == rom->devid)) {
690 dev->rom = pa_data +
691 offsetof(struct pci_setup_rom, romdata);
692 dev->romlen = rom->pcilen;
693 }
694 }
695 pa_data = data->next;
696 iounmap(data);
696 memunmap(data);
697 }
698 set_dma_domain_ops(dev);
699 set_dev_domain_options(dev);
700 return 0;
701}
702
703int pcibios_enable_device(struct pci_dev *dev, int mask)
704{

--- 32 unchanged lines hidden ---
697 }
698 set_dma_domain_ops(dev);
699 set_dev_domain_options(dev);
700 return 0;
701}
702
703int pcibios_enable_device(struct pci_dev *dev, int mask)
704{

--- 32 unchanged lines hidden ---