Release 4.11 drivers/pcmcia/cardbus.c
/*
* cardbus.c -- 16-bit PCMCIA core support
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* The initial developer of the original code is David A. Hinds
* <dahinds@users.sourceforge.net>. Portions created by David A. Hinds
* are Copyright (C) 1999 David A. Hinds. All Rights Reserved.
*
* (C) 1999 David A. Hinds
*/
/*
* Cardbus handling has been re-written to be more of a PCI bridge thing,
* and the PCI code basically does all the resource handling.
*
* Linus, Jan 2000
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <pcmcia/ss.h>
static void cardbus_config_irq_and_cls(struct pci_bus *bus, int irq)
{
struct pci_dev *dev;
list_for_each_entry(dev, &bus->devices, bus_list) {
u8 irq_pin;
/*
* Since there is only one interrupt available to
* CardBus devices, all devices downstream of this
* device must be using this IRQ.
*/
pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &irq_pin);
if (irq_pin) {
dev->irq = irq;
pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
}
/*
* Some controllers transfer very slowly with 0 CLS.
* Configure it. This may fail as CLS configuration
* is mandatory only for MWI.
*/
pci_set_cacheline_size(dev);
if (dev->subordinate)
cardbus_config_irq_and_cls(dev->subordinate, irq);
}
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds (pre-git) | 41 | 47.13% | 3 | 50.00% |
Russell King | 37 | 42.53% | 2 | 33.33% |
Tejun Heo | 9 | 10.34% | 1 | 16.67% |
Total | 87 | 100.00% | 6 | 100.00% |
/**
* cb_alloc() - add CardBus device
* @s: the pcmcia_socket where the CardBus device is located
*
* cb_alloc() allocates the kernel data structures for a Cardbus device
* and handles the lowest level PCI device setup issues.
*/
int __ref cb_alloc(struct pcmcia_socket *s)
{
struct pci_bus *bus = s->cb_dev->subordinate;
struct pci_dev *dev;
unsigned int max, pass;
pci_lock_rescan_remove();
s->functions = pci_scan_slot(bus, PCI_DEVFN(0, 0));
pci_fixup_cardbus(bus);
max = bus->busn_res.start;
for (pass = 0; pass < 2; pass++)
list_for_each_entry(dev, &bus->devices, bus_list)
if (pci_is_bridge(dev))
max = pci_scan_bridge(bus, dev, max, pass);
/*
* Size all resources below the CardBus controller.
*/
pci_bus_size_bridges(bus);
pci_bus_assign_resources(bus);
cardbus_config_irq_and_cls(bus, s->pci_irq);
/* socket specific tune function */
if (s->tune_bridge)
s->tune_bridge(s, bus);
pci_bus_add_devices(bus);
pci_unlock_rescan_remove();
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Russell King | 75 | 49.02% | 2 | 11.76% |
Linus Torvalds (pre-git) | 36 | 23.53% | 4 | 23.53% |
Daniel Ritz | 16 | 10.46% | 1 | 5.88% |
Rafael J. Wysocki | 6 | 3.92% | 1 | 5.88% |
Benjamin Herrenschmidt | 5 | 3.27% | 1 | 5.88% |
Dominik Brodowski | 3 | 1.96% | 2 | 11.76% |
Yijing Wang | 3 | 1.96% | 1 | 5.88% |
Yinghai Lu | 3 | 1.96% | 1 | 5.88% |
Peter Osterlund | 2 | 1.31% | 1 | 5.88% |
Patrick Mochel | 2 | 1.31% | 1 | 5.88% |
Sam Ravnborg | 1 | 0.65% | 1 | 5.88% |
Tejun Heo | 1 | 0.65% | 1 | 5.88% |
Total | 153 | 100.00% | 17 | 100.00% |
/**
* cb_free() - remove CardBus device
* @s: the pcmcia_socket where the CardBus device was located
*
* cb_free() handles the lowest level PCI device cleanup.
*/
void cb_free(struct pcmcia_socket *s)
{
struct pci_dev *bridge, *dev, *tmp;
struct pci_bus *bus;
bridge = s->cb_dev;
if (!bridge)
return;
bus = bridge->subordinate;
if (!bus)
return;
pci_lock_rescan_remove();
list_for_each_entry_safe(dev, tmp, &bus->devices, bus_list)
pci_stop_and_remove_bus_device(dev);
pci_unlock_rescan_remove();
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Björn Helgaas | 41 | 57.75% | 1 | 12.50% |
Linus Torvalds (pre-git) | 16 | 22.54% | 3 | 37.50% |
Rafael J. Wysocki | 6 | 8.45% | 1 | 12.50% |
Russell King | 6 | 8.45% | 2 | 25.00% |
Dominik Brodowski | 2 | 2.82% | 1 | 12.50% |
Total | 71 | 100.00% | 8 | 100.00% |
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Russell King | 119 | 36.39% | 4 | 17.39% |
Linus Torvalds (pre-git) | 104 | 31.80% | 5 | 21.74% |
Björn Helgaas | 41 | 12.54% | 1 | 4.35% |
Daniel Ritz | 16 | 4.89% | 1 | 4.35% |
Rafael J. Wysocki | 12 | 3.67% | 1 | 4.35% |
Tejun Heo | 10 | 3.06% | 1 | 4.35% |
Dominik Brodowski | 9 | 2.75% | 4 | 17.39% |
Benjamin Herrenschmidt | 5 | 1.53% | 1 | 4.35% |
Yinghai Lu | 3 | 0.92% | 1 | 4.35% |
Yijing Wang | 3 | 0.92% | 1 | 4.35% |
Patrick Mochel | 2 | 0.61% | 1 | 4.35% |
Peter Osterlund | 2 | 0.61% | 1 | 4.35% |
Sam Ravnborg | 1 | 0.31% | 1 | 4.35% |
Total | 327 | 100.00% | 23 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.