From c91ff16994710fc399d14deea577b0c464a42486 Mon Sep 17 00:00:00 2001 From: Matthew Dharm Date: Mon, 25 Apr 2005 21:46:29 -0700 Subject: [PATCH] --- yaml --- r: 871 b: refs/heads/master c: e2e66446e08a7a365a59e25bbc8dd320ab3da0a6 h: refs/heads/master i: 869: e0e898116578180db34880d976f57f57b4329a9e 867: 98fbaf975f0a86d8fefc5a701822a380d5d3d09b 863: ace91ee82934c08387fb04a2dbe81ef8e846e045 v: v3 --- [refs] | 2 +- trunk/Documentation/aoe/aoe.txt | 40 ++--------- trunk/Documentation/aoe/status.sh | 4 ++ trunk/Documentation/pci.txt | 1 - trunk/Documentation/power/pci.txt | 35 ++++++++- trunk/arch/arm/mach-ixp4xx/common-pci.c | 10 +++ trunk/arch/sparc64/kernel/irq.c | 6 +- trunk/drivers/block/aoe/aoe.h | 2 +- trunk/drivers/block/aoe/aoeblk.c | 13 ---- trunk/drivers/block/aoe/aoedev.c | 11 +-- trunk/drivers/block/aoe/aoenet.c | 17 +---- trunk/drivers/pci/hotplug/ibmphp.h | 2 +- trunk/drivers/pci/hotplug/ibmphp_hpc.c | 6 +- trunk/drivers/pci/hotplug/ibmphp_pci.c | 7 +- trunk/drivers/pci/hotplug/pci_hotplug.h | 2 +- trunk/drivers/pci/hotplug/pciehp_core.c | 23 ++---- trunk/drivers/pci/hotplug/pcihp_skeleton.c | 2 +- trunk/drivers/pci/msi.c | 6 +- trunk/drivers/pci/pci-acpi.c | 2 +- trunk/drivers/pci/pci-driver.c | 11 +-- trunk/drivers/pci/pci-sysfs.c | 82 +++++++--------------- trunk/drivers/pci/pci.c | 20 ++++-- trunk/drivers/pci/probe.c | 1 - trunk/drivers/pci/proc.c | 1 - trunk/drivers/pci/quirks.c | 2 - trunk/drivers/usb/storage/debug.c | 1 + trunk/include/linux/pci.h | 3 +- trunk/include/net/addrconf.h | 3 +- 28 files changed, 126 insertions(+), 189 deletions(-) diff --git a/[refs] b/[refs] index e882c22db61a..078329dc389e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a1d4ebdbb3806e9d2c37f32a043ec54f4534977c +refs/heads/master: e2e66446e08a7a365a59e25bbc8dd320ab3da0a6 diff --git a/trunk/Documentation/aoe/aoe.txt b/trunk/Documentation/aoe/aoe.txt index 3a4dbe4663c9..43e50108d0e2 100644 --- a/trunk/Documentation/aoe/aoe.txt +++ b/trunk/Documentation/aoe/aoe.txt @@ -4,16 +4,6 @@ The EtherDrive (R) HOWTO for users of 2.6 kernels is found at ... It has many tips and hints! -The aoetools are userland programs that are designed to work with this -driver. The aoetools are on sourceforge. - - http://aoetools.sourceforge.net/ - -The scripts in this Documentation/aoe directory are intended to -document the use of the driver and are not necessary if you install -the aoetools. - - CREATING DEVICE NODES Users of udev should find the block device nodes created @@ -45,15 +35,14 @@ USING DEVICE NODES "echo eth2 eth4 > /dev/etherd/interfaces" tells the aoe driver to limit ATA over Ethernet traffic to eth2 and eth4. AoE traffic from - untrusted networks should be ignored as a matter of security. See - also the aoe_iflist driver option described below. + untrusted networks should be ignored as a matter of security. "echo > /dev/etherd/discover" tells the driver to find out what AoE devices are available. These character devices may disappear and be replaced by sysfs - counterparts. Using the commands in aoetools insulates users from - these implementation details. + counterparts, so distribution maintainers are encouraged to create + scripts that use these devices. The block devices are named like this: @@ -77,8 +66,7 @@ USING SYSFS through which we are communicating with the remote AoE device. There is a script in this directory that formats this information - in a convenient way. Users with aoetools can use the aoe-stat - command. + in a convenient way. root@makki root# sh Documentation/aoe/status.sh e10.0 eth3 up @@ -101,23 +89,3 @@ USING SYSFS e4.7 eth1 up e4.8 eth1 up e4.9 eth1 up - - Use /sys/module/aoe/parameters/aoe_iflist (or better, the driver - option discussed below) instead of /dev/etherd/interfaces to limit - AoE traffic to the network interfaces in the given - whitespace-separated list. Unlike the old character device, the - sysfs entry can be read from as well as written to. - - It's helpful to trigger discovery after setting the list of allowed - interfaces. The aoetools package provides an aoe-discover script - for this purpose. You can also directly use the - /dev/etherd/discover special file described above. - -DRIVER OPTIONS - - There is a boot option for the built-in aoe driver and a - corresponding module parameter, aoe_iflist. Without this option, - all network interfaces may be used for ATA over Ethernet. Here is a - usage example for the module parameter. - - modprobe aoe_iflist="eth1 eth3" diff --git a/trunk/Documentation/aoe/status.sh b/trunk/Documentation/aoe/status.sh index 751f3be514b8..6628116d4a9f 100644 --- a/trunk/Documentation/aoe/status.sh +++ b/trunk/Documentation/aoe/status.sh @@ -14,6 +14,10 @@ test ! -d "$sysd/block" && { echo "$me Error: sysfs is not mounted" 1>&2 exit 1 } +test -z "`lsmod | grep '^aoe'`" && { + echo "$me Error: aoe module is not loaded" 1>&2 + exit 1 +} for d in `ls -d $sysd/block/etherd* 2>/dev/null | grep -v p` end; do # maybe ls comes up empty, so we use "end" diff --git a/trunk/Documentation/pci.txt b/trunk/Documentation/pci.txt index 62b1dc5d97e2..67514bf87ccd 100644 --- a/trunk/Documentation/pci.txt +++ b/trunk/Documentation/pci.txt @@ -279,7 +279,6 @@ pci_for_each_dev_reverse() Superseded by pci_find_device_reverse() pci_for_each_bus() Superseded by pci_find_next_bus() pci_find_device() Superseded by pci_get_device() pci_find_subsys() Superseded by pci_get_subsys() -pci_find_slot() Superseded by pci_get_slot() pcibios_find_class() Superseded by pci_get_class() pci_find_class() Superseded by pci_get_class() pci_(read|write)_*_nodev() Superseded by pci_bus_(read|write)_*() diff --git a/trunk/Documentation/power/pci.txt b/trunk/Documentation/power/pci.txt index 35b1a7dae342..c85428e7ad92 100644 --- a/trunk/Documentation/power/pci.txt +++ b/trunk/Documentation/power/pci.txt @@ -165,9 +165,40 @@ Description: These functions are intended for use by individual drivers, and are defined in struct pci_driver: - int (*suspend) (struct pci_dev *dev, pm_message_t state); + int (*save_state) (struct pci_dev *dev, u32 state); + int (*suspend) (struct pci_dev *dev, u32 state); int (*resume) (struct pci_dev *dev); - int (*enable_wake) (struct pci_dev *dev, pci_power_t state, int enable); + int (*enable_wake) (struct pci_dev *dev, u32 state, int enable); + + +save_state +---------- + +Usage: + +if (dev->driver && dev->driver->save_state) + dev->driver->save_state(dev,state); + +The driver should use this callback to save device state. It should take into +account the current state of the device and the requested state in order to +avoid any unnecessary operations. + +For example, a video card that supports all 4 states (D0-D3), all controller +context is preserved when entering D1, but the screen is placed into a low power +state (blanked). + +The driver can also interpret this function as a notification that it may be +entering a sleep state in the near future. If it knows that the device cannot +enter the requested state, either because of lack of support for it, or because +the device is middle of some critical operation, then it should fail. + +This function should not be used to set any state in the device or the driver +because the device may not actually enter the sleep state (e.g. another driver +later causes causes a global state transition to fail). + +Note that in intermediate low power states, a device's I/O and memory spaces may +be disabled and may not be available in subsequent transitions to lower power +states. suspend diff --git a/trunk/arch/arm/mach-ixp4xx/common-pci.c b/trunk/arch/arm/mach-ixp4xx/common-pci.c index aa92e3708838..94bcdb933e41 100644 --- a/trunk/arch/arm/mach-ixp4xx/common-pci.c +++ b/trunk/arch/arm/mach-ixp4xx/common-pci.c @@ -501,6 +501,15 @@ pci_set_dma_mask(struct pci_dev *dev, u64 mask) return -EIO; } +int +pci_dac_set_dma_mask(struct pci_dev *dev, u64 mask) +{ + if (mask >= SZ_64M - 1 ) + return 0; + + return -EIO; +} + int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask) { @@ -511,6 +520,7 @@ pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask) } EXPORT_SYMBOL(pci_set_dma_mask); +EXPORT_SYMBOL(pci_dac_set_dma_mask); EXPORT_SYMBOL(pci_set_consistent_dma_mask); EXPORT_SYMBOL(ixp4xx_pci_read); EXPORT_SYMBOL(ixp4xx_pci_write); diff --git a/trunk/arch/sparc64/kernel/irq.c b/trunk/arch/sparc64/kernel/irq.c index 4dcb8af94090..a38cb5036df0 100644 --- a/trunk/arch/sparc64/kernel/irq.c +++ b/trunk/arch/sparc64/kernel/irq.c @@ -756,7 +756,7 @@ void handler_irq(int irq, struct pt_regs *regs) clear_softint(clr_mask); } #else - int should_forward = 0; + int should_forward = 1; clear_softint(1 << irq); #endif @@ -1007,10 +1007,10 @@ static int retarget_one_irq(struct irqaction *p, int goal_cpu) } upa_writel(tid | IMAP_VALID, imap); - do { + while (!cpu_online(goal_cpu)) { if (++goal_cpu >= NR_CPUS) goal_cpu = 0; - } while (!cpu_online(goal_cpu)); + } return goal_cpu; } diff --git a/trunk/drivers/block/aoe/aoe.h b/trunk/drivers/block/aoe/aoe.h index 721ba8086043..aa8b547ffafa 100644 --- a/trunk/drivers/block/aoe/aoe.h +++ b/trunk/drivers/block/aoe/aoe.h @@ -1,5 +1,5 @@ /* Copyright (c) 2004 Coraid, Inc. See COPYING for GPL terms. */ -#define VERSION "10" +#define VERSION "6" #define AOE_MAJOR 152 #define DEVICE_NAME "aoe" diff --git a/trunk/drivers/block/aoe/aoeblk.c b/trunk/drivers/block/aoe/aoeblk.c index 0e97fcb9f3a1..4780f7926d42 100644 --- a/trunk/drivers/block/aoe/aoeblk.c +++ b/trunk/drivers/block/aoe/aoeblk.c @@ -37,13 +37,6 @@ static ssize_t aoedisk_show_netif(struct gendisk * disk, char *page) return snprintf(page, PAGE_SIZE, "%s\n", d->ifp->name); } -/* firmware version */ -static ssize_t aoedisk_show_fwver(struct gendisk * disk, char *page) -{ - struct aoedev *d = disk->private_data; - - return snprintf(page, PAGE_SIZE, "0x%04x\n", (unsigned int) d->fw_ver); -} static struct disk_attribute disk_attr_state = { .attr = {.name = "state", .mode = S_IRUGO }, @@ -57,10 +50,6 @@ static struct disk_attribute disk_attr_netif = { .attr = {.name = "netif", .mode = S_IRUGO }, .show = aoedisk_show_netif }; -static struct disk_attribute disk_attr_fwver = { - .attr = {.name = "firmware-version", .mode = S_IRUGO }, - .show = aoedisk_show_fwver -}; static void aoedisk_add_sysfs(struct aoedev *d) @@ -68,7 +57,6 @@ aoedisk_add_sysfs(struct aoedev *d) sysfs_create_file(&d->gd->kobj, &disk_attr_state.attr); sysfs_create_file(&d->gd->kobj, &disk_attr_mac.attr); sysfs_create_file(&d->gd->kobj, &disk_attr_netif.attr); - sysfs_create_file(&d->gd->kobj, &disk_attr_fwver.attr); } void aoedisk_rm_sysfs(struct aoedev *d) @@ -76,7 +64,6 @@ aoedisk_rm_sysfs(struct aoedev *d) sysfs_remove_link(&d->gd->kobj, "state"); sysfs_remove_link(&d->gd->kobj, "mac"); sysfs_remove_link(&d->gd->kobj, "netif"); - sysfs_remove_link(&d->gd->kobj, "firmware-version"); } static int diff --git a/trunk/drivers/block/aoe/aoedev.c b/trunk/drivers/block/aoe/aoedev.c index 6e231c5a1199..ec16c64dd114 100644 --- a/trunk/drivers/block/aoe/aoedev.c +++ b/trunk/drivers/block/aoe/aoedev.c @@ -109,22 +109,25 @@ aoedev_set(ulong sysminor, unsigned char *addr, struct net_device *ifp, ulong bu spin_lock_irqsave(&devlist_lock, flags); for (d=devlist; d; d=d->next) - if (d->sysminor == sysminor) + if (d->sysminor == sysminor + || memcmp(d->addr, addr, sizeof d->addr) == 0) break; if (d == NULL && (d = aoedev_newdev(bufcnt)) == NULL) { spin_unlock_irqrestore(&devlist_lock, flags); printk(KERN_INFO "aoe: aoedev_set: aoedev_newdev failure.\n"); return NULL; - } /* if newdev, (d->flags & DEVFL_UP) == 0 for below */ + } spin_unlock_irqrestore(&devlist_lock, flags); spin_lock_irqsave(&d->lock, flags); d->ifp = ifp; - memcpy(d->addr, addr, sizeof d->addr); - if ((d->flags & DEVFL_UP) == 0) { + + if (d->sysminor != sysminor + || (d->flags & DEVFL_UP) == 0) { aoedev_downdev(d); /* flushes outstanding frames */ + memcpy(d->addr, addr, sizeof d->addr); d->sysminor = sysminor; d->aoemajor = AOEMAJOR(sysminor); d->aoeminor = AOEMINOR(sysminor); diff --git a/trunk/drivers/block/aoe/aoenet.c b/trunk/drivers/block/aoe/aoenet.c index 9e6f51c528b0..bc92aacb6dad 100644 --- a/trunk/drivers/block/aoe/aoenet.c +++ b/trunk/drivers/block/aoe/aoenet.c @@ -7,7 +7,6 @@ #include #include #include -#include #include "aoe.h" #define NECODES 5 @@ -27,19 +26,6 @@ enum { }; static char aoe_iflist[IFLISTSZ]; -module_param_string(aoe_iflist, aoe_iflist, IFLISTSZ, 0600); -MODULE_PARM_DESC(aoe_iflist, "aoe_iflist=\"dev1 [dev2 ...]\"\n"); - -#ifndef MODULE -static int __init aoe_iflist_setup(char *str) -{ - strncpy(aoe_iflist, str, IFLISTSZ); - aoe_iflist[IFLISTSZ - 1] = '\0'; - return 1; -} - -__setup("aoe_iflist=", aoe_iflist_setup); -#endif int is_aoe_netif(struct net_device *ifp) @@ -50,8 +36,7 @@ is_aoe_netif(struct net_device *ifp) if (aoe_iflist[0] == '\0') return 1; - p = aoe_iflist + strspn(aoe_iflist, WHITESPACE); - for (; *p; p = q + strspn(q, WHITESPACE)) { + for (p = aoe_iflist; *p; p = q + strspn(q, WHITESPACE)) { q = p + strcspn(p, WHITESPACE); if (q != p) len = q - p; diff --git a/trunk/drivers/pci/hotplug/ibmphp.h b/trunk/drivers/pci/hotplug/ibmphp.h index c22e0284d7b1..5bc039da647f 100644 --- a/trunk/drivers/pci/hotplug/ibmphp.h +++ b/trunk/drivers/pci/hotplug/ibmphp.h @@ -196,7 +196,7 @@ struct ebda_hpc_bus { /******************************************************************** -* THREE TYPE OF HOT PLUG CONTROLLER * +* THREE TYPE OF HOT PLUG CONTROLER * ********************************************************************/ struct isa_ctlr_access { diff --git a/trunk/drivers/pci/hotplug/ibmphp_hpc.c b/trunk/drivers/pci/hotplug/ibmphp_hpc.c index 1a3eb8d3d4cb..6894b548c8ca 100644 --- a/trunk/drivers/pci/hotplug/ibmphp_hpc.c +++ b/trunk/drivers/pci/hotplug/ibmphp_hpc.c @@ -64,7 +64,7 @@ static int to_debug = FALSE; #define WPG_I2C_OR 0x2000 // I2C OR operation //---------------------------------------------------------------------------- -// Command set for I2C Master Operation Setup Register +// Command set for I2C Master Operation Setup Regisetr //---------------------------------------------------------------------------- #define WPG_READATADDR_MASK 0x00010000 // read,bytes,I2C shifted,index #define WPG_WRITEATADDR_MASK 0x40010000 // write,bytes,I2C shifted,index @@ -835,7 +835,7 @@ static void poll_hpc (void) if (ibmphp_shutdown) break; - /* try to get the lock to do some kind of hardware access */ + /* try to get the lock to do some kind of harware access */ down (&semOperations); switch (poll_state) { @@ -906,7 +906,7 @@ static void poll_hpc (void) poll_state = POLL_LATCH_REGISTER; break; } - /* give up the hardware semaphore */ + /* give up the harware semaphore */ up (&semOperations); /* sleep for a short time just for good measure */ msleep(100); diff --git a/trunk/drivers/pci/hotplug/ibmphp_pci.c b/trunk/drivers/pci/hotplug/ibmphp_pci.c index 8122fe734aa7..2335fac65fb4 100644 --- a/trunk/drivers/pci/hotplug/ibmphp_pci.c +++ b/trunk/drivers/pci/hotplug/ibmphp_pci.c @@ -1308,10 +1308,10 @@ static int unconfigure_boot_device (u8 busno, u8 device, u8 function) /* ????????? DO WE NEED TO WRITE ANYTHING INTO THE PCI CONFIG SPACE BACK ?????????? */ } else { /* This is Memory */ + start_address &= PCI_BASE_ADDRESS_MEM_MASK; if (start_address & PCI_BASE_ADDRESS_MEM_PREFETCH) { /* pfmem */ debug ("start address of pfmem is %x\n", start_address); - start_address &= PCI_BASE_ADDRESS_MEM_MASK; if (ibmphp_find_resource (bus, start_address, &pfmem, PFMEM) < 0) { err ("cannot find corresponding PFMEM resource to remove\n"); @@ -1325,8 +1325,6 @@ static int unconfigure_boot_device (u8 busno, u8 device, u8 function) } else { /* regular memory */ debug ("start address of mem is %x\n", start_address); - start_address &= PCI_BASE_ADDRESS_MEM_MASK; - if (ibmphp_find_resource (bus, start_address, &mem, MEM) < 0) { err ("cannot find corresponding MEM resource to remove\n"); return -EIO; @@ -1424,9 +1422,9 @@ static int unconfigure_boot_bridge (u8 busno, u8 device, u8 function) /* ????????? DO WE NEED TO WRITE ANYTHING INTO THE PCI CONFIG SPACE BACK ?????????? */ } else { /* This is Memory */ + start_address &= PCI_BASE_ADDRESS_MEM_MASK; if (start_address & PCI_BASE_ADDRESS_MEM_PREFETCH) { /* pfmem */ - start_address &= PCI_BASE_ADDRESS_MEM_MASK; if (ibmphp_find_resource (bus, start_address, &pfmem, PFMEM) < 0) { err ("cannot find corresponding PFMEM resource to remove\n"); return -EINVAL; @@ -1438,7 +1436,6 @@ static int unconfigure_boot_bridge (u8 busno, u8 device, u8 function) } } else { /* regular memory */ - start_address &= PCI_BASE_ADDRESS_MEM_MASK; if (ibmphp_find_resource (bus, start_address, &mem, MEM) < 0) { err ("cannot find corresponding MEM resource to remove\n"); return -EINVAL; diff --git a/trunk/drivers/pci/hotplug/pci_hotplug.h b/trunk/drivers/pci/hotplug/pci_hotplug.h index 88d44f7fef29..57ace325168d 100644 --- a/trunk/drivers/pci/hotplug/pci_hotplug.h +++ b/trunk/drivers/pci/hotplug/pci_hotplug.h @@ -150,7 +150,7 @@ struct hotplug_slot_info { * @name: the name of the slot being registered. This string must * be unique amoung slots registered on this system. * @ops: pointer to the &struct hotplug_slot_ops to be used for this slot - * @info: pointer to the &struct hotplug_slot_info for the initial values for + * @info: pointer to the &struct hotplug_slot_info for the inital values for * this slot. * @release: called during pci_hp_deregister to free memory allocated in a * hotplug_slot structure. diff --git a/trunk/drivers/pci/hotplug/pciehp_core.c b/trunk/drivers/pci/hotplug/pciehp_core.c index ed1fd8d6178d..72baf749e65e 100644 --- a/trunk/drivers/pci/hotplug/pciehp_core.c +++ b/trunk/drivers/pci/hotplug/pciehp_core.c @@ -90,22 +90,6 @@ static struct hotplug_slot_ops pciehp_hotplug_slot_ops = { .get_cur_bus_speed = get_cur_bus_speed, }; -/** - * release_slot - free up the memory used by a slot - * @hotplug_slot: slot to free - */ -static void release_slot(struct hotplug_slot *hotplug_slot) -{ - struct slot *slot = hotplug_slot->private; - - dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); - - kfree(slot->hotplug_slot->info); - kfree(slot->hotplug_slot->name); - kfree(slot->hotplug_slot); - kfree(slot); -} - static int init_slots(struct controller *ctrl) { struct slot *new_slot; @@ -155,8 +139,7 @@ static int init_slots(struct controller *ctrl) /* register this slot with the hotplug pci core */ new_slot->hotplug_slot->private = new_slot; - new_slot->hotplug_slot->release = &release_slot; - make_slot_name(new_slot->hotplug_slot->name, SLOT_NAME_SIZE, new_slot); + make_slot_name (new_slot->hotplug_slot->name, SLOT_NAME_SIZE, new_slot); new_slot->hotplug_slot->ops = &pciehp_hotplug_slot_ops; new_slot->hpc_ops->get_power_status(new_slot, &(new_slot->hotplug_slot->info->power_status)); @@ -205,6 +188,10 @@ static int cleanup_slots (struct controller * ctrl) while (old_slot) { next_slot = old_slot->next; pci_hp_deregister (old_slot->hotplug_slot); + kfree(old_slot->hotplug_slot->info); + kfree(old_slot->hotplug_slot->name); + kfree(old_slot->hotplug_slot); + kfree(old_slot); old_slot = next_slot; } diff --git a/trunk/drivers/pci/hotplug/pcihp_skeleton.c b/trunk/drivers/pci/hotplug/pcihp_skeleton.c index 3194d51c6ec9..6605d6bda529 100644 --- a/trunk/drivers/pci/hotplug/pcihp_skeleton.c +++ b/trunk/drivers/pci/hotplug/pcihp_skeleton.c @@ -297,7 +297,7 @@ static int __init init_slots(void) hotplug_slot->ops = &skel_hotplug_slot_ops; /* - * Initialize the slot info structure with some known + * Initilize the slot info structure with some known * good values. */ info->power_status = get_power_status(slot); diff --git a/trunk/drivers/pci/msi.c b/trunk/drivers/pci/msi.c index 30206ac43c44..22ecd3b058be 100644 --- a/trunk/drivers/pci/msi.c +++ b/trunk/drivers/pci/msi.c @@ -522,7 +522,7 @@ void pci_scan_msi_device(struct pci_dev *dev) * msi_capability_init - configure device's MSI capability structure * @dev: pointer to the pci_dev data structure of MSI device function * - * Setup the MSI capability structure of device function with a single + * Setup the MSI capability structure of device funtion with a single * MSI vector, regardless of device function is capable of handling * multiple messages. A return of zero indicates the successful setup * of an entry zero with the new MSI vector or non-zero for otherwise. @@ -599,7 +599,7 @@ static int msi_capability_init(struct pci_dev *dev) * msix_capability_init - configure device's MSI-X capability * @dev: pointer to the pci_dev data structure of MSI-X device function * - * Setup the MSI-X capability structure of device function with a + * Setup the MSI-X capability structure of device funtion with a * single MSI-X vector. A return of zero indicates the successful setup of * requested MSI-X entries with allocated vectors or non-zero for otherwise. **/ @@ -1074,7 +1074,7 @@ void pci_disable_msix(struct pci_dev* dev) * msi_remove_pci_irq_vectors - reclaim MSI(X) vectors to unused state * @dev: pointer to the pci_dev data structure of MSI(X) device function * - * Being called during hotplug remove, from which the device function + * Being called during hotplug remove, from which the device funciton * is hot-removed. All previous assigned MSI/MSI-X vectors, if * allocated for this device function, are reclaimed to unused state, * which may be used later on. diff --git a/trunk/drivers/pci/pci-acpi.c b/trunk/drivers/pci/pci-acpi.c index bc01d34e2634..968eb32f292d 100644 --- a/trunk/drivers/pci/pci-acpi.c +++ b/trunk/drivers/pci/pci-acpi.c @@ -19,7 +19,7 @@ static u32 ctrlset_buf[3] = {0, 0, 0}; static u32 global_ctrlsets = 0; -static u8 OSC_UUID[16] = {0x5B, 0x4D, 0xDB, 0x33, 0xF7, 0x1F, 0x1C, 0x40, 0x96, 0x57, 0x74, 0x41, 0xC0, 0x3D, 0xD7, 0x66}; +u8 OSC_UUID[16] = {0x5B, 0x4D, 0xDB, 0x33, 0xF7, 0x1F, 0x1C, 0x40, 0x96, 0x57, 0x74, 0x41, 0xC0, 0x3D, 0xD7, 0x66}; static acpi_status acpi_query_osc ( diff --git a/trunk/drivers/pci/pci-driver.c b/trunk/drivers/pci/pci-driver.c index fe98553c978f..37b7961efc44 100644 --- a/trunk/drivers/pci/pci-driver.c +++ b/trunk/drivers/pci/pci-driver.c @@ -318,14 +318,6 @@ static int pci_device_resume(struct device * dev) return 0; } -static void pci_device_shutdown(struct device *dev) -{ - struct pci_dev *pci_dev = to_pci_dev(dev); - struct pci_driver *drv = pci_dev->driver; - - if (drv && drv->shutdown) - drv->shutdown(pci_dev); -} #define kobj_to_pci_driver(obj) container_of(obj, struct device_driver, kobj) #define attr_to_driver_attribute(obj) container_of(obj, struct driver_attribute, attr) @@ -381,7 +373,7 @@ pci_populate_driver_dir(struct pci_driver *drv) * * Adds the driver structure to the list of registered drivers. * Returns a negative value on error, otherwise 0. - * If no error occurred, the driver remains registered even if + * If no error occured, the driver remains registered even if * no device was claimed during registration. */ int pci_register_driver(struct pci_driver *drv) @@ -393,7 +385,6 @@ int pci_register_driver(struct pci_driver *drv) drv->driver.bus = &pci_bus_type; drv->driver.probe = pci_device_probe; drv->driver.remove = pci_device_remove; - drv->driver.shutdown = pci_device_shutdown, drv->driver.owner = drv->owner; drv->driver.kobj.ktype = &pci_driver_kobj_type; pci_init_dynids(&drv->dynids); diff --git a/trunk/drivers/pci/pci-sysfs.c b/trunk/drivers/pci/pci-sysfs.c index 8568b207f189..d57ae71d32b1 100644 --- a/trunk/drivers/pci/pci-sysfs.c +++ b/trunk/drivers/pci/pci-sysfs.c @@ -91,7 +91,6 @@ pci_read_config(struct kobject *kobj, char *buf, loff_t off, size_t count) struct pci_dev *dev = to_pci_dev(container_of(kobj,struct device,kobj)); unsigned int size = 64; loff_t init_off = off; - u8 *data = (u8*) buf; /* Several chips lock up trying to read undefined config space */ if (capable(CAP_SYS_ADMIN)) { @@ -109,47 +108,30 @@ pci_read_config(struct kobject *kobj, char *buf, loff_t off, size_t count) size = count; } - if ((off & 1) && size) { - u8 val; + while (off & 3) { + unsigned char val; pci_read_config_byte(dev, off, &val); - data[off - init_off] = val; + buf[off - init_off] = val; off++; - size--; - } - - if ((off & 3) && size > 2) { - u16 val; - pci_read_config_word(dev, off, &val); - data[off - init_off] = val & 0xff; - data[off - init_off + 1] = (val >> 8) & 0xff; - off += 2; - size -= 2; + if (--size == 0) + break; } while (size > 3) { - u32 val; + unsigned int val; pci_read_config_dword(dev, off, &val); - data[off - init_off] = val & 0xff; - data[off - init_off + 1] = (val >> 8) & 0xff; - data[off - init_off + 2] = (val >> 16) & 0xff; - data[off - init_off + 3] = (val >> 24) & 0xff; + buf[off - init_off] = val & 0xff; + buf[off - init_off + 1] = (val >> 8) & 0xff; + buf[off - init_off + 2] = (val >> 16) & 0xff; + buf[off - init_off + 3] = (val >> 24) & 0xff; off += 4; size -= 4; } - if (size >= 2) { - u16 val; - pci_read_config_word(dev, off, &val); - data[off - init_off] = val & 0xff; - data[off - init_off + 1] = (val >> 8) & 0xff; - off += 2; - size -= 2; - } - - if (size > 0) { - u8 val; + while (size > 0) { + unsigned char val; pci_read_config_byte(dev, off, &val); - data[off - init_off] = val; + buf[off - init_off] = val; off++; --size; } @@ -163,7 +145,6 @@ pci_write_config(struct kobject *kobj, char *buf, loff_t off, size_t count) struct pci_dev *dev = to_pci_dev(container_of(kobj,struct device,kobj)); unsigned int size = count; loff_t init_off = off; - u8 *data = (u8*) buf; if (off > dev->cfg_size) return 0; @@ -171,41 +152,26 @@ pci_write_config(struct kobject *kobj, char *buf, loff_t off, size_t count) size = dev->cfg_size - off; count = size; } - - if ((off & 1) && size) { - pci_write_config_byte(dev, off, data[off - init_off]); + + while (off & 3) { + pci_write_config_byte(dev, off, buf[off - init_off]); off++; - size--; + if (--size == 0) + break; } - - if ((off & 3) && size > 2) { - u16 val = data[off - init_off]; - val |= (u16) data[off - init_off + 1] << 8; - pci_write_config_word(dev, off, val); - off += 2; - size -= 2; - } while (size > 3) { - u32 val = data[off - init_off]; - val |= (u32) data[off - init_off + 1] << 8; - val |= (u32) data[off - init_off + 2] << 16; - val |= (u32) data[off - init_off + 3] << 24; + unsigned int val = buf[off - init_off]; + val |= (unsigned int) buf[off - init_off + 1] << 8; + val |= (unsigned int) buf[off - init_off + 2] << 16; + val |= (unsigned int) buf[off - init_off + 3] << 24; pci_write_config_dword(dev, off, val); off += 4; size -= 4; } - - if (size >= 2) { - u16 val = data[off - init_off]; - val |= (u16) data[off - init_off + 1] << 8; - pci_write_config_word(dev, off, val); - off += 2; - size -= 2; - } - if (size) { - pci_write_config_byte(dev, off, data[off - init_off]); + while (size > 0) { + pci_write_config_byte(dev, off, buf[off - init_off]); off++; --size; } diff --git a/trunk/drivers/pci/pci.c b/trunk/drivers/pci/pci.c index f04b9ffe4153..bfbff8335268 100644 --- a/trunk/drivers/pci/pci.c +++ b/trunk/drivers/pci/pci.c @@ -16,7 +16,6 @@ #include #include #include /* isa_dma_bridge_buggy */ -#include "pci.h" /** @@ -399,10 +398,10 @@ pci_enable_device(struct pci_dev *dev) { int err; + dev->is_enabled = 1; if ((err = pci_enable_device_bars(dev, (1 << PCI_NUM_RESOURCES) - 1))) return err; pci_fixup_device(pci_fixup_enable, dev); - dev->is_enabled = 1; return 0; } @@ -428,15 +427,16 @@ pci_disable_device(struct pci_dev *dev) { u16 pci_command; + dev->is_enabled = 0; + dev->is_busmaster = 0; + pci_read_config_word(dev, PCI_COMMAND, &pci_command); if (pci_command & PCI_COMMAND_MASTER) { pci_command &= ~PCI_COMMAND_MASTER; pci_write_config_word(dev, PCI_COMMAND, pci_command); } - dev->is_busmaster = 0; pcibios_disable_device(dev); - dev->is_enabled = 0; } /** @@ -748,6 +748,17 @@ pci_set_dma_mask(struct pci_dev *dev, u64 mask) return 0; } +int +pci_dac_set_dma_mask(struct pci_dev *dev, u64 mask) +{ + if (!pci_dac_dma_supported(dev, mask)) + return -EIO; + + dev->dma_mask = mask; + + return 0; +} + int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask) { @@ -810,6 +821,7 @@ EXPORT_SYMBOL(pci_set_master); EXPORT_SYMBOL(pci_set_mwi); EXPORT_SYMBOL(pci_clear_mwi); EXPORT_SYMBOL(pci_set_dma_mask); +EXPORT_SYMBOL(pci_dac_set_dma_mask); EXPORT_SYMBOL(pci_set_consistent_dma_mask); EXPORT_SYMBOL(pci_assign_resource); EXPORT_SYMBOL(pci_find_parent_resource); diff --git a/trunk/drivers/pci/probe.c b/trunk/drivers/pci/probe.c index b7ae87823c69..6f0edadd132c 100644 --- a/trunk/drivers/pci/probe.c +++ b/trunk/drivers/pci/probe.c @@ -9,7 +9,6 @@ #include #include #include -#include "pci.h" #define CARDBUS_LATENCY_TIMER 176 /* secondary latency timer */ #define CARDBUS_RESERVE_BUSNR 3 diff --git a/trunk/drivers/pci/proc.c b/trunk/drivers/pci/proc.c index e68bbfb1e7c3..84cc4f620d8d 100644 --- a/trunk/drivers/pci/proc.c +++ b/trunk/drivers/pci/proc.c @@ -15,7 +15,6 @@ #include #include -#include "pci.h" static int proc_initialized; /* = 0 */ diff --git a/trunk/drivers/pci/quirks.c b/trunk/drivers/pci/quirks.c index 026aa04669a2..15a398051682 100644 --- a/trunk/drivers/pci/quirks.c +++ b/trunk/drivers/pci/quirks.c @@ -18,7 +18,6 @@ #include #include #include -#include "pci.h" /* Deal with broken BIOS'es that neglect to enable passive release, which can cause problems in combination with the 82441FX/PPro MTRRs */ @@ -329,7 +328,6 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_12, DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_0, quirk_ich4_lpc_acpi ); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_12, quirk_ich4_lpc_acpi ); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_0, quirk_ich4_lpc_acpi ); -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB_1, quirk_ich4_lpc_acpi ); /* * VIA ACPI: One IO region pointed to by longword at diff --git a/trunk/drivers/usb/storage/debug.c b/trunk/drivers/usb/storage/debug.c index d76483706bc9..5a9321705a74 100644 --- a/trunk/drivers/usb/storage/debug.c +++ b/trunk/drivers/usb/storage/debug.c @@ -47,6 +47,7 @@ #include #include #include +#include #include "debug.h" #include "scsi.h" diff --git a/trunk/include/linux/pci.h b/trunk/include/linux/pci.h index b5238bd18830..3c89148ae28a 100644 --- a/trunk/include/linux/pci.h +++ b/trunk/include/linux/pci.h @@ -671,7 +671,6 @@ struct pci_driver { int (*suspend) (struct pci_dev *dev, pm_message_t state); /* Device suspended */ int (*resume) (struct pci_dev *dev); /* Device woken up */ int (*enable_wake) (struct pci_dev *dev, pci_power_t state, int enable); /* Enable wake event */ - void (*shutdown) (struct pci_dev *dev); struct device_driver driver; struct pci_dynids dynids; @@ -811,6 +810,7 @@ void pci_set_master(struct pci_dev *dev); int pci_set_mwi(struct pci_dev *dev); void pci_clear_mwi(struct pci_dev *dev); int pci_set_dma_mask(struct pci_dev *dev, u64 mask); +int pci_dac_set_dma_mask(struct pci_dev *dev, u64 mask); int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask); int pci_assign_resource(struct pci_dev *dev, int i); @@ -941,6 +941,7 @@ static inline void pci_set_master(struct pci_dev *dev) { } static inline int pci_enable_device(struct pci_dev *dev) { return -EIO; } static inline void pci_disable_device(struct pci_dev *dev) { } static inline int pci_set_dma_mask(struct pci_dev *dev, u64 mask) { return -EIO; } +static inline int pci_dac_set_dma_mask(struct pci_dev *dev, u64 mask) { return -EIO; } static inline int pci_assign_resource(struct pci_dev *dev, int i) { return -EBUSY;} static inline int pci_register_driver(struct pci_driver *drv) { return 0;} static inline void pci_unregister_driver(struct pci_driver *drv) { } diff --git a/trunk/include/net/addrconf.h b/trunk/include/net/addrconf.h index a0ed93672176..f1e5af4be98e 100644 --- a/trunk/include/net/addrconf.h +++ b/trunk/include/net/addrconf.h @@ -17,8 +17,6 @@ #define IPV6_MAX_ADDRESSES 16 -#include - struct prefix_info { __u8 type; __u8 length; @@ -45,6 +43,7 @@ struct prefix_info { #ifdef __KERNEL__ +#include #include #include #include