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)
isa_boards_found++;
}
#ifdef CONFIG_PCI
if (pcibios_present()) {
if (pci_present()) {
if(isa_boards_found < NUM_BOARDS)
pci_boards_found = init_PCI(isa_boards_found);
} else {
......
......@@ -70,9 +70,6 @@ MODULE_DEVICE_TABLE(pci, aironet4500_card_pci_tbl);
MODULE_LICENSE("GPL");
static int reverse_probe;
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) ;
......@@ -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 cards_found = 0;
static int pci_index; /* Static, for multiple probe calls. */
u8 pci_irq_line = 0;
// int p;
unsigned char awc_pci_dev, awc_pci_bus;
struct pci_dev *pdev = NULL;
if (!pci_present())
return -1;
for (;pci_index < 0xff; pci_index++) {
u16 vendor, device, pci_command, new_command;
while ((pdev = pci_find_class (PCI_CLASS_NETWORK_OTHER << 8, pdev))) {
u16 pci_command, new_command;
u32 pci_memaddr;
u32 pci_ioaddr;
u32 pci_cisaddr;
struct pci_dev *pdev;
if (pcibios_find_class (PCI_CLASS_NETWORK_OTHER << 8,
reverse_probe ? 0xfe - pci_index : pci_index,
&awc_pci_bus, &awc_pci_dev) != PCIBIOS_SUCCESSFUL){
if (reverse_probe){
continue;
} else {
break;
}
}
pdev = pci_find_slot(awc_pci_bus, awc_pci_dev);
if (!pdev)
if (pdev->vendor != PCI_VENDOR_ID_AIRONET)
continue;
if ((pdev->device != PCI_DEVICE_AIRONET_4800_1) &&
(pdev->device != PCI_DEVICE_AIRONET_4800) &&
(pdev->device != PCI_DEVICE_AIRONET_4500))
continue;
if (pci_enable_device(pdev))
continue;
vendor = pdev->vendor;
device = pdev->device;
pci_irq_line = pdev->irq;
pci_memaddr = pci_resource_start (pdev, 0);
pci_cisaddr = pci_resource_start (pdev, 1);
......@@ -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);
/* 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) ||
// check_region(pci_cisaddr, AIRONET4X00_CIS_SIZE) ||
// check_region(pci_memaddr, AIRONET4X00_MEM_SIZE)) {
......@@ -151,7 +132,7 @@ int awc4500_pci_probe(struct net_device *dev)
udelay(1000);
*/
if (device == PCI_DEVICE_AIRONET_4800)
if (pdev->device == PCI_DEVICE_AIRONET_4800)
pci_write_config_dword(pdev, 0x40, 0x40000000);
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)
/* First: scan PCI bus(es) */
#ifdef CONFIG_PCI
if (pcibios_present()) {
if (pci_present()) {
int pci_index;
struct pci_dev *pci_dev = NULL;
int pci_id_index;
......@@ -2960,7 +2960,7 @@ static int __init hp100_module_init(void)
{
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");
/* Loop on all possible base addresses */
......
......@@ -2190,7 +2190,7 @@ pci_probe(struct net_device *dev, u_long ioaddr)
if (lastPCI == NO_MORE_PCI) return;
if (!pcibios_present()) {
if (!pci_present()) {
lastPCI = NO_MORE_PCI;
return; /* No PCI bus in this machine! */
}
......@@ -5872,7 +5872,7 @@ count_adapters(void)
if (EISA_signature(name, EISA_ID)) j++;
}
#endif
if (!pcibios_present()) return j;
if (!pci_present()) return j;
for (i=0; (pdev=pci_find_class(class, pdev))!= NULL; i++) {
vendor = pdev->vendor;
......
......@@ -1045,8 +1045,8 @@ int lmc_probe (struct net_device *dev) /*fold00*/
unsigned int pci_irq_line;
u16 vendor, subvendor, device, subdevice;
u32 foundaddr = 0;
unsigned char pci_bus, pci_device_fn;
u8 intcf = 0;
struct pci_dev *pdev = NULL;
/* The card is only available on PCI, so if we don't have a
* PCI bus, we are in trouble.
......@@ -1057,21 +1057,7 @@ int lmc_probe (struct net_device *dev) /*fold00*/
return -1;
}
/* Loop basically until we don't find anymore. */
while (pci_index < 0xff){
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;
while ((pdev = pci_find_class (PCI_CLASS_NETWORK_ETHERNET << 8, pdev))) {
if (pci_enable_device(pdev))
break;
......
......@@ -13,44 +13,6 @@
/* 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) \
int pcibios_##rw##_config_##size (unsigned char bus, unsigned char dev_fn, \
unsigned char where, unsigned type val) \
......@@ -67,13 +29,9 @@ PCI_OP(write, byte, char)
PCI_OP(write, word, short)
PCI_OP(write, dword, int)
EXPORT_SYMBOL(pcibios_present);
EXPORT_SYMBOL(pcibios_read_config_byte);
EXPORT_SYMBOL(pcibios_read_config_word);
EXPORT_SYMBOL(pcibios_read_config_dword);
EXPORT_SYMBOL(pcibios_write_config_byte);
EXPORT_SYMBOL(pcibios_write_config_word);
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,
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
if (!pcibios_present())
if (!pci_present())
return -ENOSYS;
dev = pci_find_slot(bus, dfn);
......
......@@ -312,7 +312,7 @@ static int __init sbus_init(void)
nd = prom_searchsiblings(topnd, "sbus");
if(nd == 0) {
#ifdef CONFIG_PCI
if (!pcibios_present()) {
if (!pci_present()) {
prom_printf("Neither SBUS nor PCI found.\n");
prom_halt();
} else {
......
......@@ -1533,8 +1533,7 @@ NCR53c7xx_detect(Scsi_Host_Template *tpnt){
int i;
int current_override;
int count; /* Number of boards detected */
unsigned char pci_bus, pci_device_fn;
static short pci_index=0; /* Device index to PCI BIOS calls */
struct pci_dev *pdev = NULL;
tpnt->proc_name = "ncr53c7xx";
......@@ -1563,13 +1562,11 @@ NCR53c7xx_detect(Scsi_Host_Template *tpnt){
if (pci_present()) {
for (i = 0; i < NPCI_CHIP_IDS; ++i)
for (pci_index = 0;
!pcibios_find_device (PCI_VENDOR_ID_NCR,
pci_chip_ids[i].pci_device_id, pci_index, &pci_bus,
&pci_device_fn);
++pci_index)
while ((pdev = pci_find_device (PCI_VENDOR_ID_NCR,
pci_chip_ids[i].pci_device_id,
pdev)))
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;
}
return count;
......
......@@ -208,7 +208,7 @@ int orc_ReturnNumberOfAdapters(void)
/*
* PCI-bus probe.
*/
if (pcibios_present()) {
if (pci_present()) {
/*
* Note: I removed the struct pci_device_list stuff since this
* driver only cares about one device ID. If that changes in
......
......@@ -322,15 +322,6 @@ enum pci_mmap_state {
#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.
*/
......@@ -503,8 +494,17 @@ struct pci_driver {
/* these external functions are only available when PCI support is enabled */
#ifdef CONFIG_PCI
static inline int pci_present(void)
{
return !list_empty(&pci_devices);
}
#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))
#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 *);
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 *);
/* Backward compatibility, don't use in new code! */
int pcibios_present(void);
int pcibios_read_config_byte (unsigned char bus, unsigned char dev_fn,
unsigned char where, unsigned char *val);
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,
unsigned char where, unsigned short val);
int pcibios_write_config_dword (unsigned char bus, unsigned char dev_fn,
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 */
......@@ -660,9 +655,7 @@ void pci_pool_free (struct pci_pool *pool, void *vaddr, dma_addr_t addr);
*/
#ifndef CONFIG_PCI
static inline int pcibios_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; }
static inline int pci_present(void) { return 0; }
#define _PCI_NOP(o,s,t) \
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