Пример #1
0
static int
bcm53000_pci_read_config(struct pci_bus *bus, unsigned int devfn,
             int where, int size, u32 * value)
{
    unsigned long flags;
    int ret;
    u8 val8;
    u16 val16;
    u32 *pval;

    spin_lock_irqsave(&sih_lock, flags);

    if (size == 1) {
        pval = &val8;
    } else if (size == 2) {
        pval = &val16;
    } else {
        pval = value;
    } 
    ret =
        hndpci_read_config(sih, bus->number, PCI_SLOT(devfn),
                  PCI_FUNC(devfn), where, pval, size);

    if (size == 1) {
        *value = (u32)val8;
    } else if (size == 2) {
        *value = (u32)val16;
    } 
    spin_unlock_irqrestore(&sih_lock, flags);
    return ret ? PCIBIOS_DEVICE_NOT_FOUND : PCIBIOS_SUCCESSFUL;

}
Пример #2
0
static int
sbpci_read_config_reg(struct pci_bus *bus, unsigned int devfn, int where,
                      int size, u32 *value)
{
	unsigned long flags;
	int ret;

	spin_lock_irqsave(&sih_lock, flags);
	ret = hndpci_read_config(sih, bus->number, PCI_SLOT(devfn),
	                        PCI_FUNC(devfn), where, value, size);
	spin_unlock_irqrestore(&sih_lock, flags);
	return ret ? PCIBIOS_DEVICE_NOT_FOUND : PCIBIOS_SUCCESSFUL;
}