Commit 0f6c515f authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Merge kroah.com:/home/greg/linux/BK/bleeding_edge-2.5

into kroah.com:/home/greg/linux/BK/pci-2.5
parents b3819ec5 c4e4d47d
...@@ -1993,7 +1993,7 @@ int __init rp_init(void) ...@@ -1993,7 +1993,7 @@ int __init rp_init(void)
isa_boards_found++; isa_boards_found++;
} }
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
if (pcibios_present()) { if (pci_present()) {
if(isa_boards_found < NUM_BOARDS) if(isa_boards_found < NUM_BOARDS)
pci_boards_found = init_PCI(isa_boards_found); pci_boards_found = init_PCI(isa_boards_found);
} else { } else {
......
...@@ -70,9 +70,6 @@ MODULE_DEVICE_TABLE(pci, aironet4500_card_pci_tbl); ...@@ -70,9 +70,6 @@ MODULE_DEVICE_TABLE(pci, aironet4500_card_pci_tbl);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
static int reverse_probe;
static int awc_pci_init(struct net_device * dev, struct pci_dev *pdev, static int awc_pci_init(struct net_device * dev, struct pci_dev *pdev,
int ioaddr, int cis_addr, int mem_addr,u8 pci_irq_line) ; int ioaddr, int cis_addr, int mem_addr,u8 pci_irq_line) ;
...@@ -80,38 +77,29 @@ static int awc_pci_init(struct net_device * dev, struct pci_dev *pdev, ...@@ -80,38 +77,29 @@ static int awc_pci_init(struct net_device * dev, struct pci_dev *pdev,
int awc4500_pci_probe(struct net_device *dev) int awc4500_pci_probe(struct net_device *dev)
{ {
int cards_found = 0; int cards_found = 0;
static int pci_index; /* Static, for multiple probe calls. */
u8 pci_irq_line = 0; u8 pci_irq_line = 0;
// int p; // int p;
struct pci_dev *pdev = NULL;
unsigned char awc_pci_dev, awc_pci_bus;
if (!pci_present()) if (!pci_present())
return -1; return -1;
for (;pci_index < 0xff; pci_index++) { while ((pdev = pci_find_class (PCI_CLASS_NETWORK_OTHER << 8, pdev))) {
u16 vendor, device, pci_command, new_command; u16 pci_command, new_command;
u32 pci_memaddr; u32 pci_memaddr;
u32 pci_ioaddr; u32 pci_ioaddr;
u32 pci_cisaddr; u32 pci_cisaddr;
struct pci_dev *pdev;
if (pcibios_find_class (PCI_CLASS_NETWORK_OTHER << 8, if (pdev->vendor != PCI_VENDOR_ID_AIRONET)
reverse_probe ? 0xfe - pci_index : pci_index,
&awc_pci_bus, &awc_pci_dev) != PCIBIOS_SUCCESSFUL){
if (reverse_probe){
continue; continue;
} else { if ((pdev->device != PCI_DEVICE_AIRONET_4800_1) &&
break; (pdev->device != PCI_DEVICE_AIRONET_4800) &&
} (pdev->device != PCI_DEVICE_AIRONET_4500))
}
pdev = pci_find_slot(awc_pci_bus, awc_pci_dev);
if (!pdev)
continue; continue;
if (pci_enable_device(pdev)) if (pci_enable_device(pdev))
continue; continue;
vendor = pdev->vendor;
device = pdev->device;
pci_irq_line = pdev->irq; pci_irq_line = pdev->irq;
pci_memaddr = pci_resource_start (pdev, 0); pci_memaddr = pci_resource_start (pdev, 0);
pci_cisaddr = pci_resource_start (pdev, 1); pci_cisaddr = pci_resource_start (pdev, 1);
...@@ -120,13 +108,6 @@ int awc4500_pci_probe(struct net_device *dev) ...@@ -120,13 +108,6 @@ int awc4500_pci_probe(struct net_device *dev)
// printk("\n pci capabilities %x and ptr %x \n",pci_caps,pci_caps_ptr); // printk("\n pci capabilities %x and ptr %x \n",pci_caps,pci_caps_ptr);
/* Remove I/O space marker in bit 0. */ /* Remove I/O space marker in bit 0. */
if (vendor != PCI_VENDOR_ID_AIRONET)
continue;
if (device != PCI_DEVICE_AIRONET_4800_1 &&
device != PCI_DEVICE_AIRONET_4800 &&
device != PCI_DEVICE_AIRONET_4500 )
continue;
// if (check_region(pci_ioaddr, AIRONET4X00_IO_SIZE) || // if (check_region(pci_ioaddr, AIRONET4X00_IO_SIZE) ||
// check_region(pci_cisaddr, AIRONET4X00_CIS_SIZE) || // check_region(pci_cisaddr, AIRONET4X00_CIS_SIZE) ||
// check_region(pci_memaddr, AIRONET4X00_MEM_SIZE)) { // check_region(pci_memaddr, AIRONET4X00_MEM_SIZE)) {
...@@ -151,7 +132,7 @@ int awc4500_pci_probe(struct net_device *dev) ...@@ -151,7 +132,7 @@ int awc4500_pci_probe(struct net_device *dev)
udelay(1000); udelay(1000);
*/ */
if (device == PCI_DEVICE_AIRONET_4800) if (pdev->device == PCI_DEVICE_AIRONET_4800)
pci_write_config_dword(pdev, 0x40, 0x40000000); pci_write_config_dword(pdev, 0x40, 0x40000000);
if (awc_pci_init(dev, pdev, pci_ioaddr,pci_cisaddr,pci_memaddr,pci_irq_line)){ if (awc_pci_init(dev, pdev, pci_ioaddr,pci_cisaddr,pci_memaddr,pci_irq_line)){
......
...@@ -412,7 +412,7 @@ int __init hp100_probe(struct net_device *dev) ...@@ -412,7 +412,7 @@ int __init hp100_probe(struct net_device *dev)
/* First: scan PCI bus(es) */ /* First: scan PCI bus(es) */
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
if (pcibios_present()) { if (pci_present()) {
int pci_index; int pci_index;
struct pci_dev *pci_dev = NULL; struct pci_dev *pci_dev = NULL;
int pci_id_index; int pci_id_index;
...@@ -2960,7 +2960,7 @@ static int __init hp100_module_init(void) ...@@ -2960,7 +2960,7 @@ static int __init hp100_module_init(void)
{ {
int i, cards; int i, cards;
if (hp100_port == 0 && !EISA_bus && !pcibios_present()) if (hp100_port == 0 && !EISA_bus && !pci_present())
printk("hp100: You should not use auto-probing with insmod!\n"); printk("hp100: You should not use auto-probing with insmod!\n");
/* Loop on all possible base addresses */ /* Loop on all possible base addresses */
......
...@@ -2190,7 +2190,7 @@ pci_probe(struct net_device *dev, u_long ioaddr) ...@@ -2190,7 +2190,7 @@ pci_probe(struct net_device *dev, u_long ioaddr)
if (lastPCI == NO_MORE_PCI) return; if (lastPCI == NO_MORE_PCI) return;
if (!pcibios_present()) { if (!pci_present()) {
lastPCI = NO_MORE_PCI; lastPCI = NO_MORE_PCI;
return; /* No PCI bus in this machine! */ return; /* No PCI bus in this machine! */
} }
...@@ -5872,7 +5872,7 @@ count_adapters(void) ...@@ -5872,7 +5872,7 @@ count_adapters(void)
if (EISA_signature(name, EISA_ID)) j++; if (EISA_signature(name, EISA_ID)) j++;
} }
#endif #endif
if (!pcibios_present()) return j; if (!pci_present()) return j;
for (i=0; (pdev=pci_find_class(class, pdev))!= NULL; i++) { for (i=0; (pdev=pci_find_class(class, pdev))!= NULL; i++) {
vendor = pdev->vendor; vendor = pdev->vendor;
......
...@@ -1045,8 +1045,8 @@ int lmc_probe (struct net_device *dev) /*fold00*/ ...@@ -1045,8 +1045,8 @@ int lmc_probe (struct net_device *dev) /*fold00*/
unsigned int pci_irq_line; unsigned int pci_irq_line;
u16 vendor, subvendor, device, subdevice; u16 vendor, subvendor, device, subdevice;
u32 foundaddr = 0; u32 foundaddr = 0;
unsigned char pci_bus, pci_device_fn;
u8 intcf = 0; u8 intcf = 0;
struct pci_dev *pdev = NULL;
/* The card is only available on PCI, so if we don't have a /* The card is only available on PCI, so if we don't have a
* PCI bus, we are in trouble. * PCI bus, we are in trouble.
...@@ -1057,21 +1057,7 @@ int lmc_probe (struct net_device *dev) /*fold00*/ ...@@ -1057,21 +1057,7 @@ int lmc_probe (struct net_device *dev) /*fold00*/
return -1; return -1;
} }
/* Loop basically until we don't find anymore. */ /* Loop basically until we don't find anymore. */
while (pci_index < 0xff){ while ((pdev = pci_find_class (PCI_CLASS_NETWORK_ETHERNET << 8, pdev))) {
struct pci_dev *pdev;
/* The tulip is considered an ethernet class of card... */
if (pcibios_find_class (PCI_CLASS_NETWORK_ETHERNET << 8,
pci_index, &pci_bus,
&pci_device_fn) != PCIBIOS_SUCCESSFUL) {
/* No card found on this pass */
break;
}
/* Read the info we need to determine if this is
* our card or not
*/
pdev = pci_find_slot (pci_bus, pci_device_fn);
if (!pdev) break;
if (pci_enable_device(pdev)) if (pci_enable_device(pdev))
break; break;
......
...@@ -13,44 +13,6 @@ ...@@ -13,44 +13,6 @@
/* Obsolete functions, these will be going away... */ /* Obsolete functions, these will be going away... */
int
pcibios_present(void)
{
return !list_empty(&pci_devices);
}
int
pcibios_find_class(unsigned int class, unsigned short index, unsigned char *bus, unsigned char *devfn)
{
const struct pci_dev *dev = NULL;
int cnt = 0;
while ((dev = pci_find_class(class, dev)))
if (index == cnt++) {
*bus = dev->bus->number;
*devfn = dev->devfn;
return PCIBIOS_SUCCESSFUL;
}
return PCIBIOS_DEVICE_NOT_FOUND;
}
int
pcibios_find_device(unsigned short vendor, unsigned short device, unsigned short index,
unsigned char *bus, unsigned char *devfn)
{
const struct pci_dev *dev = NULL;
int cnt = 0;
while ((dev = pci_find_device(vendor, device, dev)))
if (index == cnt++) {
*bus = dev->bus->number;
*devfn = dev->devfn;
return PCIBIOS_SUCCESSFUL;
}
return PCIBIOS_DEVICE_NOT_FOUND;
}
#define PCI_OP(rw,size,type) \ #define PCI_OP(rw,size,type) \
int pcibios_##rw##_config_##size (unsigned char bus, unsigned char dev_fn, \ int pcibios_##rw##_config_##size (unsigned char bus, unsigned char dev_fn, \
unsigned char where, unsigned type val) \ unsigned char where, unsigned type val) \
...@@ -67,13 +29,9 @@ PCI_OP(write, byte, char) ...@@ -67,13 +29,9 @@ PCI_OP(write, byte, char)
PCI_OP(write, word, short) PCI_OP(write, word, short)
PCI_OP(write, dword, int) PCI_OP(write, dword, int)
EXPORT_SYMBOL(pcibios_present);
EXPORT_SYMBOL(pcibios_read_config_byte); EXPORT_SYMBOL(pcibios_read_config_byte);
EXPORT_SYMBOL(pcibios_read_config_word); EXPORT_SYMBOL(pcibios_read_config_word);
EXPORT_SYMBOL(pcibios_read_config_dword); EXPORT_SYMBOL(pcibios_read_config_dword);
EXPORT_SYMBOL(pcibios_write_config_byte); EXPORT_SYMBOL(pcibios_write_config_byte);
EXPORT_SYMBOL(pcibios_write_config_word); EXPORT_SYMBOL(pcibios_write_config_word);
EXPORT_SYMBOL(pcibios_write_config_dword); EXPORT_SYMBOL(pcibios_write_config_dword);
EXPORT_SYMBOL(pcibios_find_class);
EXPORT_SYMBOL(pcibios_find_device);
...@@ -98,7 +98,7 @@ sys_pciconfig_write(unsigned long bus, unsigned long dfn, ...@@ -98,7 +98,7 @@ sys_pciconfig_write(unsigned long bus, unsigned long dfn,
if (!capable(CAP_SYS_ADMIN)) if (!capable(CAP_SYS_ADMIN))
return -EPERM; return -EPERM;
if (!pcibios_present()) if (!pci_present())
return -ENOSYS; return -ENOSYS;
dev = pci_find_slot(bus, dfn); dev = pci_find_slot(bus, dfn);
......
...@@ -312,7 +312,7 @@ static int __init sbus_init(void) ...@@ -312,7 +312,7 @@ static int __init sbus_init(void)
nd = prom_searchsiblings(topnd, "sbus"); nd = prom_searchsiblings(topnd, "sbus");
if(nd == 0) { if(nd == 0) {
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
if (!pcibios_present()) { if (!pci_present()) {
prom_printf("Neither SBUS nor PCI found.\n"); prom_printf("Neither SBUS nor PCI found.\n");
prom_halt(); prom_halt();
} else { } else {
......
...@@ -1533,8 +1533,7 @@ NCR53c7xx_detect(Scsi_Host_Template *tpnt){ ...@@ -1533,8 +1533,7 @@ NCR53c7xx_detect(Scsi_Host_Template *tpnt){
int i; int i;
int current_override; int current_override;
int count; /* Number of boards detected */ int count; /* Number of boards detected */
unsigned char pci_bus, pci_device_fn; struct pci_dev *pdev = NULL;
static short pci_index=0; /* Device index to PCI BIOS calls */
tpnt->proc_name = "ncr53c7xx"; tpnt->proc_name = "ncr53c7xx";
...@@ -1563,13 +1562,11 @@ NCR53c7xx_detect(Scsi_Host_Template *tpnt){ ...@@ -1563,13 +1562,11 @@ NCR53c7xx_detect(Scsi_Host_Template *tpnt){
if (pci_present()) { if (pci_present()) {
for (i = 0; i < NPCI_CHIP_IDS; ++i) for (i = 0; i < NPCI_CHIP_IDS; ++i)
for (pci_index = 0; while ((pdev = pci_find_device (PCI_VENDOR_ID_NCR,
!pcibios_find_device (PCI_VENDOR_ID_NCR, pci_chip_ids[i].pci_device_id,
pci_chip_ids[i].pci_device_id, pci_index, &pci_bus, pdev)))
&pci_device_fn);
++pci_index)
if (!ncr_pci_init (tpnt, BOARD_GENERIC, pci_chip_ids[i].chip, if (!ncr_pci_init (tpnt, BOARD_GENERIC, pci_chip_ids[i].chip,
pci_bus, pci_device_fn, /* no options */ 0)) pdev->bus->number, pdev->devfn, /* no options */ 0))
++count; ++count;
} }
return count; return count;
......
...@@ -208,7 +208,7 @@ int orc_ReturnNumberOfAdapters(void) ...@@ -208,7 +208,7 @@ int orc_ReturnNumberOfAdapters(void)
/* /*
* PCI-bus probe. * PCI-bus probe.
*/ */
if (pcibios_present()) { if (pci_present()) {
/* /*
* Note: I removed the struct pci_device_list stuff since this * Note: I removed the struct pci_device_list stuff since this
* driver only cares about one device ID. If that changes in * driver only cares about one device ID. If that changes in
......
...@@ -322,15 +322,6 @@ enum pci_mmap_state { ...@@ -322,15 +322,6 @@ enum pci_mmap_state {
#define PCI_ANY_ID (~0) #define PCI_ANY_ID (~0)
#define pci_present pcibios_present
#define pci_for_each_dev_reverse(dev) \
for(dev = pci_dev_g(pci_devices.prev); dev != pci_dev_g(&pci_devices); dev = pci_dev_g(dev->global_list.prev))
#define pci_for_each_bus(bus) \
for(bus = pci_bus_b(pci_root_buses.next); bus != pci_bus_b(&pci_root_buses); bus = pci_bus_b(bus->node.next))
/* /*
* The pci_dev structure is used to describe both PCI and ISAPnP devices. * The pci_dev structure is used to describe both PCI and ISAPnP devices.
*/ */
...@@ -503,8 +494,17 @@ struct pci_driver { ...@@ -503,8 +494,17 @@ struct pci_driver {
/* these external functions are only available when PCI support is enabled */ /* these external functions are only available when PCI support is enabled */
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
static inline int pci_present(void)
{
return !list_empty(&pci_devices);
}
#define pci_for_each_dev(dev) \ #define pci_for_each_dev(dev) \
for(dev = pci_dev_g(pci_devices.next); dev != pci_dev_g(&pci_devices); dev = pci_dev_g(dev->global_list.next)) for(dev = pci_dev_g(pci_devices.next); dev != pci_dev_g(&pci_devices); dev = pci_dev_g(dev->global_list.next))
#define pci_for_each_dev_reverse(dev) \
for(dev = pci_dev_g(pci_devices.prev); dev != pci_dev_g(&pci_devices); dev = pci_dev_g(dev->global_list.prev))
#define pci_for_each_bus(bus) \
for(bus = pci_bus_b(pci_root_buses.next); bus != pci_bus_b(&pci_root_buses); bus = pci_bus_b(bus->node.next))
void pcibios_fixup_bus(struct pci_bus *); void pcibios_fixup_bus(struct pci_bus *);
int pcibios_enable_device(struct pci_dev *, int mask); int pcibios_enable_device(struct pci_dev *, int mask);
...@@ -520,7 +520,6 @@ void pcibios_fixup_pbus_ranges(struct pci_bus *, struct pbus_set_ranges_data *); ...@@ -520,7 +520,6 @@ void pcibios_fixup_pbus_ranges(struct pci_bus *, struct pbus_set_ranges_data *);
/* Backward compatibility, don't use in new code! */ /* Backward compatibility, don't use in new code! */
int pcibios_present(void);
int pcibios_read_config_byte (unsigned char bus, unsigned char dev_fn, int pcibios_read_config_byte (unsigned char bus, unsigned char dev_fn,
unsigned char where, unsigned char *val); unsigned char where, unsigned char *val);
int pcibios_read_config_word (unsigned char bus, unsigned char dev_fn, int pcibios_read_config_word (unsigned char bus, unsigned char dev_fn,
...@@ -533,10 +532,6 @@ int pcibios_write_config_word (unsigned char bus, unsigned char dev_fn, ...@@ -533,10 +532,6 @@ int pcibios_write_config_word (unsigned char bus, unsigned char dev_fn,
unsigned char where, unsigned short val); unsigned char where, unsigned short val);
int pcibios_write_config_dword (unsigned char bus, unsigned char dev_fn, int pcibios_write_config_dword (unsigned char bus, unsigned char dev_fn,
unsigned char where, unsigned int val); unsigned char where, unsigned int val);
int pcibios_find_class (unsigned int class_code, unsigned short index, unsigned char *bus, unsigned char *dev_fn);
int pcibios_find_device (unsigned short vendor, unsigned short dev_id,
unsigned short index, unsigned char *bus,
unsigned char *dev_fn);
/* Generic PCI functions used internally */ /* Generic PCI functions used internally */
...@@ -660,9 +655,7 @@ void pci_pool_free (struct pci_pool *pool, void *vaddr, dma_addr_t addr); ...@@ -660,9 +655,7 @@ void pci_pool_free (struct pci_pool *pool, void *vaddr, dma_addr_t addr);
*/ */
#ifndef CONFIG_PCI #ifndef CONFIG_PCI
static inline int pcibios_present(void) { return 0; } static inline int pci_present(void) { return 0; }
static inline int pcibios_find_class (unsigned int class_code, unsigned short index, unsigned char *bus, unsigned char *dev_fn)
{ return PCIBIOS_DEVICE_NOT_FOUND; }
#define _PCI_NOP(o,s,t) \ #define _PCI_NOP(o,s,t) \
static inline int pcibios_##o##_config_##s (u8 bus, u8 dfn, u8 where, t val) \ static inline int pcibios_##o##_config_##s (u8 bus, u8 dfn, u8 where, t val) \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment