diff options
Diffstat (limited to 'drivers')
60 files changed, 909 insertions, 478 deletions
diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c index a2efae8a4c4..0c9f15c54e8 100644 --- a/drivers/acpi/numa.c +++ b/drivers/acpi/numa.c @@ -59,7 +59,7 @@ int node_to_pxm(int node) return node_to_pxm_map[node]; } -int __cpuinit acpi_map_pxm_to_node(int pxm) +int acpi_map_pxm_to_node(int pxm) { int node = pxm_to_node_map[pxm]; diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index b998340e23d..58ceb18ec99 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c @@ -33,6 +33,7 @@ #include <linux/interrupt.h> #include <linux/kmod.h> #include <linux/delay.h> +#include <linux/dmi.h> #include <linux/workqueue.h> #include <linux/nmi.h> #include <linux/acpi.h> @@ -73,6 +74,21 @@ static void *acpi_irq_context; static struct workqueue_struct *kacpid_wq; static struct workqueue_struct *kacpi_notify_wq; +#define OSI_STRING_LENGTH_MAX 64 /* arbitrary */ +static char osi_additional_string[OSI_STRING_LENGTH_MAX]; + +#define OSI_LINUX_ENABLED +#ifdef OSI_LINUX_ENABLED +int osi_linux = 1; /* enable _OSI(Linux) by default */ +#else +int osi_linux; /* disable _OSI(Linux) by default */ +#endif + + +#ifdef CONFIG_DMI +static struct __initdata dmi_system_id acpi_osl_dmi_table[]; +#endif + static void __init acpi_request_region (struct acpi_generic_address *addr, unsigned int length, char *desc) { @@ -121,8 +137,9 @@ static int __init acpi_reserve_resources(void) } device_initcall(acpi_reserve_resources); -acpi_status acpi_os_initialize(void) +acpi_status __init acpi_os_initialize(void) { + dmi_check_system(acpi_osl_dmi_table); return AE_OK; } @@ -960,20 +977,38 @@ static int __init acpi_os_name_setup(char *str) __setup("acpi_os_name=", acpi_os_name_setup); +static void enable_osi_linux(int enable) { + + if (osi_linux != enable) + printk(KERN_INFO PREFIX "%sabled _OSI(Linux)\n", + enable ? "En": "Dis"); + + osi_linux = enable; + return; +} + /* - * _OSI control + * Modify the list of "OS Interfaces" reported to BIOS via _OSI + * * empty string disables _OSI - * TBD additional string adds to _OSI + * string starting with '!' disables that string + * otherwise string is added to list, augmenting built-in strings */ static int __init acpi_osi_setup(char *str) { if (str == NULL || *str == '\0') { printk(KERN_INFO PREFIX "_OSI method disabled\n"); acpi_gbl_create_osi_method = FALSE; - } else { - /* TBD */ - printk(KERN_ERR PREFIX "_OSI additional string ignored -- %s\n", - str); + } else if (*str == '!') { + if (acpi_osi_invalidate(++str) == AE_OK) + printk(KERN_INFO PREFIX "Deleted _OSI(%s)\n", str); + } else if (!strcmp("!Linux", str)) { + enable_osi_linux(0); + } else if (!strcmp("Linux", str)) { + enable_osi_linux(1); + } else if (*osi_additional_string == '\0') { + strncpy(osi_additional_string, str, OSI_STRING_LENGTH_MAX); + printk(KERN_INFO PREFIX "Added _OSI(%s)\n", str); } return 1; @@ -1143,11 +1178,28 @@ acpi_status acpi_os_release_object(acpi_cache_t * cache, void *object) acpi_status acpi_os_validate_interface (char *interface) { - - return AE_SUPPORT; + if (!strncmp(osi_additional_string, interface, OSI_STRING_LENGTH_MAX)) + return AE_OK; + if (!strcmp("Linux", interface)) { + printk(KERN_WARNING PREFIX + "System BIOS is requesting _OSI(Linux)\n"); +#ifdef OSI_LINUX_ENABLED + printk(KERN_WARNING PREFIX + "Please test with \"acpi_osi=!Linux\"\n" + "Please send dmidecode " + "to linux-acpi@vger.kernel.org\n"); +#else + printk(KERN_WARNING PREFIX + "If \"acpi_osi=Linux\" works better,\n" + "Please send dmidecode " + "to linux-acpi@vger.kernel.org\n"); +#endif + if(osi_linux) + return AE_OK; + } + return AE_SUPPORT; } - /****************************************************************************** * * FUNCTION: acpi_os_validate_address @@ -1174,5 +1226,51 @@ acpi_os_validate_address ( return AE_OK; } +#ifdef CONFIG_DMI +#ifdef OSI_LINUX_ENABLED +static int dmi_osi_not_linux(struct dmi_system_id *d) +{ + printk(KERN_NOTICE "%s detected: requires not _OSI(Linux)\n", d->ident); + enable_osi_linux(0); + return 0; +} +#else +static int dmi_osi_linux(struct dmi_system_id *d) +{ + printk(KERN_NOTICE "%s detected: requires _OSI(Linux)\n", d->ident); + enable_osi_linux(1); + return 0; +} +#endif + +static struct dmi_system_id acpi_osl_dmi_table[] __initdata = { +#ifdef OSI_LINUX_ENABLED + /* + * Boxes that need NOT _OSI(Linux) + */ + { + .callback = dmi_osi_not_linux, + .ident = "Toshiba Satellite P100", + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "TOSHIBA"), + DMI_MATCH(DMI_BOARD_NAME, "Satellite P100"), + }, + }, +#else + /* + * Boxes that need _OSI(Linux) + */ + { + .callback = dmi_osi_linux, + .ident = "Intel Napa CRB", + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"), + DMI_MATCH(DMI_BOARD_NAME, "MPAD-MSAE Customer Reference Boards"), + }, + }, +#endif + {} +}; +#endif /* CONFIG_DMI */ #endif diff --git a/drivers/acpi/tables/tbinstal.c b/drivers/acpi/tables/tbinstal.c index 0e7b121a99c..3bc0c67a928 100644 --- a/drivers/acpi/tables/tbinstal.c +++ b/drivers/acpi/tables/tbinstal.c @@ -123,14 +123,14 @@ acpi_tb_add_table(struct acpi_table_desc *table_desc, } } - /* The table must be either an SSDT or a PSDT */ + /* The table must be either an SSDT or a PSDT or an OEMx */ if ((!ACPI_COMPARE_NAME(table_desc->pointer->signature, ACPI_SIG_PSDT)) && - (!ACPI_COMPARE_NAME(table_desc->pointer->signature, ACPI_SIG_SSDT))) - { + (!ACPI_COMPARE_NAME(table_desc->pointer->signature, ACPI_SIG_SSDT)) + && (strncmp(table_desc->pointer->signature, "OEM", 3))) { ACPI_ERROR((AE_INFO, - "Table has invalid signature [%4.4s], must be SSDT or PSDT", + "Table has invalid signature [%4.4s], must be SSDT, PSDT or OEMx", table_desc->pointer->signature)); return_ACPI_STATUS(AE_BAD_SIGNATURE); } diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index 1ada017d01e..194ecfe8b36 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c @@ -827,6 +827,7 @@ static int acpi_thermal_temp_open_fs(struct inode *inode, struct file *file) static int acpi_thermal_trip_seq_show(struct seq_file *seq, void *offset) { struct acpi_thermal *tz = seq->private; + struct acpi_device *device; int i = 0; int j = 0; @@ -849,9 +850,8 @@ static int acpi_thermal_trip_seq_show(struct seq_file *seq, void *offset) tz->trips.passive.tc1, tz->trips.passive.tc2, tz->trips.passive.tsp); for (j = 0; j < tz->trips.passive.devices.count; j++) { - - seq_printf(seq, "0x%p ", - tz->trips.passive.devices.handles[j]); + acpi_bus_get_device(tz->trips.passive.devices.handles[j], &device); + seq_printf(seq, "%4.4s ", acpi_device_bid(device)); } seq_puts(seq, "\n"); } @@ -862,9 +862,10 @@ static int acpi_thermal_trip_seq_show(struct seq_file *seq, void *offset) seq_printf(seq, "active[%d]: %ld C: devices=", i, KELVIN_TO_CELSIUS(tz->trips.active[i].temperature)); - for (j = 0; j < tz->trips.active[i].devices.count; j++) - seq_printf(seq, "0x%p ", - tz->trips.active[i].devices.handles[j]); + for (j = 0; j < tz->trips.active[i].devices.count; j++){ + acpi_bus_get_device(tz->trips.active[i].devices.handles[j], &device); + seq_printf(seq, "%4.4s ", acpi_device_bid(device)); + } seq_puts(seq, "\n"); } diff --git a/drivers/acpi/utilities/utcopy.c b/drivers/acpi/utilities/utcopy.c index 4c1e00874df..879eaa10d3a 100644 --- a/drivers/acpi/utilities/utcopy.c +++ b/drivers/acpi/utilities/utcopy.c @@ -68,6 +68,10 @@ acpi_ut_copy_esimple_to_isimple(union acpi_object *user_obj, union acpi_operand_object **return_obj); static acpi_status +acpi_ut_copy_epackage_to_ipackage(union acpi_object *external_object, + union acpi_operand_object **internal_object); + +static acpi_status acpi_ut_copy_simple_object(union acpi_operand_object *source_desc, union acpi_operand_object *dest_desc); @@ -518,77 +522,73 @@ acpi_ut_copy_esimple_to_isimple(union acpi_object *external_object, return_ACPI_STATUS(AE_NO_MEMORY); } -#ifdef ACPI_FUTURE_IMPLEMENTATION -/* Code to convert packages that are parameters to control methods */ - /******************************************************************************* * * FUNCTION: acpi_ut_copy_epackage_to_ipackage * - * PARAMETERS: *internal_object - Pointer to the object we are returning - * *Buffer - Where the object is returned - * *space_used - Where the length of the object is returned + * PARAMETERS: external_object - The external object to be converted + * internal_object - Where the internal object is returned * * RETURN: Status * - * DESCRIPTION: This function is called to place a package object in a user - * buffer. A package object by definition contains other objects. - * - * The buffer is assumed to have sufficient space for the object. - * The caller must have verified the buffer length needed using the - * acpi_ut_get_object_size function before calling this function. + * DESCRIPTION: Copy an external package object to an internal package. + * Handles nested packages. * ******************************************************************************/ static acpi_status -acpi_ut_copy_epackage_to_ipackage(union acpi_operand_object *internal_object, - u8 * buffer, u32 * space_used) +acpi_ut_copy_epackage_to_ipackage(union acpi_object *external_object, + union acpi_operand_object **internal_object) { - u8 *free_space; - union acpi_object *external_object; - u32 length = 0; - u32 this_index; - u32 object_space = 0; - union acpi_operand_object *this_internal_obj; - union acpi_object *this_external_obj; + acpi_status status = AE_OK; + union acpi_operand_object *package_object; + union acpi_operand_object **package_elements; + acpi_native_uint i; ACPI_FUNCTION_TRACE(ut_copy_epackage_to_ipackage); - /* - * First package at head of the buffer - */ - external_object = (union acpi_object *)buffer; + /* Create the package object */ - /* - * Free space begins right after the first package - */ - free_space = buffer + sizeof(union acpi_object); + package_object = + acpi_ut_create_package_object(external_object->package.count); + if (!package_object) { + return_ACPI_STATUS(AE_NO_MEMORY); + } - external_object->type = ACPI_GET_OBJECT_TYPE(internal_object); - external_object->package.count = internal_object->package.count; - external_object->package.elements = (union acpi_object *)free_space; + package_elements = package_object->package.elements; /* - * Build an array of ACPI_OBJECTS in the buffer - * and move the free space past it + * Recursive implementation. Probably ok, since nested external packages + * as parameters should be very rare. */ - free_space += - external_object->package.count * sizeof(union acpi_object); + for (i = 0; i < external_object->package.count; i++) { + status = + acpi_ut_copy_eobject_to_iobject(&external_object->package. + elements[i], + &package_elements[i]); + if (ACPI_FAILURE(status)) { - /* Call walk_package */ + /* Truncate package and delete it */ -} + package_object->package.count = i; + package_elements[i] = NULL; + acpi_ut_remove_reference(package_object); + return_ACPI_STATUS(status); + } + } -#endif /* Future implementation */ + *internal_object = package_object; + return_ACPI_STATUS(status); +} /******************************************************************************* * * FUNCTION: acpi_ut_copy_eobject_to_iobject * - * PARAMETERS: *internal_object - The external object to be converted - * *buffer_ptr - Where the internal object is returned + * PARAMETERS: external_object - The external object to be converted + * internal_object - Where the internal object is returned * - * RETURN: Status - the status of the call + * RETURN: Status - the status of the call * * DESCRIPTION: Converts an external object to an internal object. * @@ -603,16 +603,10 @@ acpi_ut_copy_eobject_to_iobject(union acpi_object *external_object, ACPI_FUNCTION_TRACE(ut_copy_eobject_to_iobject); if (external_object->type == ACPI_TYPE_PACKAGE) { - /* - * Packages as external input to control methods are not supported, - */ - ACPI_ERROR((AE_INFO, - "Packages as parameters not implemented!")); - - return_ACPI_STATUS(AE_NOT_IMPLEMENTED); - } - - else { + status = + acpi_ut_copy_epackage_to_ipackage(external_object, + internal_object); + } else { /* * Build a simple object (no nested objects) */ @@ -803,33 +797,19 @@ acpi_ut_copy_ielement_to_ielement(u8 object_type, * Create and build the package object */ target_object = - acpi_ut_create_internal_object(ACPI_TYPE_PACKAGE); + acpi_ut_create_package_object(source_object->package.count); if (!target_object) { return (AE_NO_MEMORY); } - target_object->package.count = source_object->package.count; target_object->common.flags = source_object->common.flags; - /* - * Create the object array - */ - target_object->package.elements = - ACPI_ALLOCATE_ZEROED(((acpi_size) source_object->package. - count + 1) * sizeof(void *)); - if (!target_object->package.elements) { - status = AE_NO_MEMORY; - goto error_exit; - } + /* Pass the new package object back to the package walk routine */ - /* - * Pass the new package object back to the package walk routine - */ state->pkg.this_target_obj = target_object; - /* - * Store the object pointer in the parent package object - */ + /* Store the object pointer in the parent package object */ + *this_target_ptr = target_object; break; diff --git a/drivers/acpi/utilities/uteval.c b/drivers/acpi/utilities/uteval.c index 13d5879cd98..8ec6f8e4813 100644 --- a/drivers/acpi/utilities/uteval.c +++ b/drivers/acpi/utilities/uteval.c @@ -59,10 +59,9 @@ acpi_ut_translate_one_cid(union acpi_operand_object *obj_desc, /* * Strings supported by the _OSI predefined (internal) method. */ -static const char *acpi_interfaces_supported[] = { +static char *acpi_interfaces_supported[] = { /* Operating System Vendor Strings */ - "Linux", "Windows 2000", "Windows 2001", "Windows 2001 SP0", @@ -158,6 +157,31 @@ acpi_status acpi_ut_osi_implementation(struct acpi_walk_state *walk_state) /******************************************************************************* * + * FUNCTION: acpi_osi_invalidate + * + * PARAMETERS: interface_string + * + * RETURN: Status + * + * DESCRIPTION: invalidate string in pre-defiend _OSI string list + * + ******************************************************************************/ + +acpi_status acpi_osi_invalidate(char *interface) +{ + int i; + + for (i = 0; i < ACPI_ARRAY_LENGTH(acpi_interfaces_supported); i++) { + if (!ACPI_STRCMP(interface, acpi_interfaces_supported[i])) { + *acpi_interfaces_supported[i] = '\0'; + return AE_OK; + } + } + return AE_NOT_FOUND; +} + +/******************************************************************************* + * * FUNCTION: acpi_ut_evaluate_object * * PARAMETERS: prefix_node - Starting node diff --git a/drivers/acpi/utilities/utobject.c b/drivers/acpi/utilities/utobject.c index 4696124759e..db0b9bac794 100644 --- a/drivers/acpi/utilities/utobject.c +++ b/drivers/acpi/utilities/utobject.c @@ -146,6 +146,48 @@ union acpi_operand_object *acpi_ut_create_internal_object_dbg(char *module_name, /******************************************************************************* * + * FUNCTION: acpi_ut_create_package_object + * + * PARAMETERS: Count - Number of package elements + * + * RETURN: Pointer to a new Package object, null on failure + * + * DESCRIPTION: Create a fully initialized package object + * + ******************************************************************************/ + +union acpi_operand_object *acpi_ut_create_package_object(u32 count) +{ + union acpi_operand_object *package_desc; + union acpi_operand_object **package_elements; + + ACPI_FUNCTION_TRACE_U32(ut_create_package_object, count); + + /* Create a new Package object */ + + package_desc = acpi_ut_create_internal_object(ACPI_TYPE_PACKAGE); + if (!package_desc) { + return_PTR(NULL); + } + + /* + * Create the element array. Count+1 allows the array to be null + * terminated. + */ + package_elements = ACPI_ALLOCATE_ZEROED((acpi_size) + (count + 1) * sizeof(void *)); + if (!package_elements) { + ACPI_FREE(package_desc); + return_PTR(NULL); + } + + package_desc->package.count = count; + package_desc->package.elements = package_elements; + return_PTR(package_desc); +} + +/******************************************************************************* + * * FUNCTION: acpi_ut_create_buffer_object * * PARAMETERS: buffer_size - Size of buffer to be created diff --git a/drivers/acpi/utilities/utxface.c b/drivers/acpi/utilities/utxface.c index e9a57806cd3..2d496918b3c 100644 --- a/drivers/acpi/utilities/utxface.c +++ b/drivers/acpi/utilities/utxface.c @@ -61,7 +61,7 @@ ACPI_MODULE_NAME("utxface") * called, so any early initialization belongs here. * ******************************************************************************/ -acpi_status acpi_initialize_subsystem(void) +acpi_status __init acpi_initialize_subsystem(void) { acpi_status status; @@ -108,8 +108,6 @@ acpi_status acpi_initialize_subsystem(void) return_ACPI_STATUS(status); } -ACPI_EXPORT_SYMBOL(acpi_initialize_subsystem) - /******************************************************************************* * * FUNCTION: acpi_enable_subsystem diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index af625147df6..4733f009c7c 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -3933,10 +3933,13 @@ static unsigned int ata_dev_set_xfermode(struct ata_device *dev) /* set up set-features taskfile */ DPRINTK("set features - xfer mode\n"); + /* Some controllers and ATAPI devices show flaky interrupt + * behavior after setting xfer mode. Use polling instead. + */ ata_tf_init(dev, &tf); tf.command = ATA_CMD_SET_FEATURES; tf.feature = SETFEATURES_XFER; - tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE; + tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE | ATA_TFLAG_POLLING; tf.protocol = ATA_PROT_NODATA; tf.nsect = dev->xfer_mode; @@ -5414,14 +5417,6 @@ unsigned int ata_qc_issue_prot(struct ata_queued_cmd *qc) } } - /* Some controllers show flaky interrupt behavior after - * setting xfer mode. Use polling instead. - */ - if (unlikely(qc->tf.command == ATA_CMD_SET_FEATURES && - qc->tf.feature == SETFEATURES_XFER) && - (ap->flags & ATA_FLAG_SETXFER_POLLING)) - qc->tf.flags |= ATA_TFLAG_POLLING; - /* select the device */ ata_dev_select(ap, qc->dev->devno, 1, 0); diff --git a/drivers/ata/pata_via.c b/drivers/ata/pata_via.c index a8462f1e890..63eca299c62 100644 --- a/drivers/ata/pata_via.c +++ b/drivers/ata/pata_via.c @@ -452,7 +452,7 @@ static int via_init_one(struct pci_dev *pdev, const struct pci_device_id *id) /* Early VIA without UDMA support */ static const struct ata_port_info via_mwdma_info = { .sht = &via_sht, - .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SETXFER_POLLING, + .flags = ATA_FLAG_SLAVE_POSS, .pio_mask = 0x1f, .mwdma_mask = 0x07, .port_ops = &via_port_ops @@ -460,7 +460,7 @@ static int via_init_one(struct pci_dev *pdev, const struct pci_device_id *id) /* Ditto with IRQ masking required */ static const struct ata_port_info via_mwdma_info_borked = { .sht = &via_sht, - .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SETXFER_POLLING, + .flags = ATA_FLAG_SLAVE_POSS, .pio_mask = 0x1f, .mwdma_mask = 0x07, .port_ops = &via_port_ops_noirq, @@ -468,7 +468,7 @@ static int via_init_one(struct pci_dev *pdev, const struct pci_device_id *id) /* VIA UDMA 33 devices (and borked 66) */ static const struct ata_port_info via_udma33_info = { .sht = &via_sht, - .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SETXFER_POLLING, + .flags = ATA_FLAG_SLAVE_POSS, .pio_mask = 0x1f, .mwdma_mask = 0x07, .udma_mask = 0x7, @@ -477,7 +477,7 @@ static int via_init_one(struct pci_dev *pdev, const struct pci_device_id *id) /* VIA UDMA 66 devices */ static const struct ata_port_info via_udma66_info = { .sht = &via_sht, - .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SETXFER_POLLING, + .flags = ATA_FLAG_SLAVE_POSS, .pio_mask = 0x1f, .mwdma_mask = 0x07, .udma_mask = 0x1f, @@ -486,7 +486,7 @@ static int via_init_one(struct pci_dev *pdev, const struct pci_device_id *id) /* VIA UDMA 100 devices */ static const struct ata_port_info via_udma100_info = { .sht = &via_sht, - .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SETXFER_POLLING, + .flags = ATA_FLAG_SLAVE_POSS, .pio_mask = 0x1f, .mwdma_mask = 0x07, .udma_mask = 0x3f, @@ -495,7 +495,7 @@ static int via_init_one(struct pci_dev *pdev, const struct pci_device_id *id) /* UDMA133 with bad AST (All current 133) */ static const struct ata_port_info via_udma133_info = { .sht = &via_sht, - .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SETXFER_POLLING, + .flags = ATA_FLAG_SLAVE_POSS, .pio_mask = 0x1f, .mwdma_mask = 0x07, .udma_mask = 0x7f, /* FIXME: should check north bridge */ diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c index 9c67df5ccfa..7f6d02ce1b5 100644 --- a/drivers/atm/firestream.c +++ b/drivers/atm/firestream.c @@ -1475,6 +1475,7 @@ static void top_off_fp (struct fs_dev *dev, struct freepool *fp, struct FS_BPENTRY *qe, *ne; struct sk_buff *skb; int n = 0; + u32 qe_tmp; fs_dprintk (FS_DEBUG_QUEUE, "Topping off queue at %x (%d-%d/%d)\n", fp->offset, read_fs (dev, FP_CNT (fp->offset)), fp->n, @@ -1502,10 +1503,16 @@ static void top_off_fp (struct fs_dev *dev, struct freepool *fp, ne->skb = skb; ne->fp = fp; - qe = (struct FS_BPENTRY *) (read_fs (dev, FP_EA(fp->offset))); - fs_dprintk (FS_DEBUG_QUEUE, "link at %p\n", qe); - if (qe) { - qe = bus_to_virt ((long) qe); + /* + * FIXME: following code encodes and decodes + * machine pointers (could be 64-bit) into a + * 32-bit register. + */ + + qe_tmp = read_fs (dev, FP_EA(fp->offset)); + fs_dprintk (FS_DEBUG_QUEUE, "link at %x\n", qe_tmp); + if (qe_tmp) { + qe = bus_to_virt ((long) qe_tmp); qe->next = virt_to_bus(ne); qe->flags &= ~FP_FLAGS_EPI; } else diff --git a/drivers/char/watchdog/Kconfig b/drivers/char/watchdog/Kconfig index 1cad32c62ed..53f5538c0c0 100644 --- a/drivers/char/watchdog/Kconfig +++ b/drivers/char/watchdog/Kconfig @@ -115,6 +115,13 @@ config IXP4XX_WATCHDOG Say N if you are unsure. +config KS8695_WATCHDOG + tristate "KS8695 watchdog" + depends on ARCH_KS8695 + help + Watchdog timer embedded into KS8695 processor. This will reboot your + system when the timeout is reached. + config S3C2410_WATCHDOG tristate "S3C2410 Watchdog" depends on ARCH_S3C2410 diff --git a/drivers/char/watchdog/Makefile b/drivers/char/watchdog/Makefile index 8bfc00cc7c2..d90f649038c 100644 --- a/drivers/char/watchdog/Makefile +++ b/drivers/char/watchdog/Makefile @@ -29,6 +29,7 @@ obj-$(CONFIG_21285_WATCHDOG) += wdt285.o obj-$(CONFIG_977_WATCHDOG) += wdt977.o obj-$(CONFIG_IXP2000_WATCHDOG) += ixp2000_wdt.o obj-$(CONFIG_IXP4XX_WATCHDOG) += ixp4xx_wdt.o +obj-$(CONFIG_KS8695_WATCHDOG) += ks8695_wdt.o obj-$(CONFIG_S3C2410_WATCHDOG) += s3c2410_wdt.o obj-$(CONFIG_SA1100_WATCHDOG) += sa1100_wdt.o obj-$(CONFIG_MPCORE_WATCHDOG) += mpcore_wdt.o diff --git a/drivers/char/watchdog/ks8695_wdt.c b/drivers/char/watchdog/ks8695_wdt.c new file mode 100644 index 00000000000..7150fb945ea --- /dev/null +++ b/drivers/char/watchdog/ks8695_wdt.c @@ -0,0 +1,308 @@ +/* + * Watchdog driver for Kendin/Micrel KS8695. + * + * (C) 2007 Andrew Victor + * + * 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. + */ + +#include <linux/errno.h> +#include <linux/fs.h> +#include <linux/init.h> +#include <linux/kernel.h> +#include <linux/miscdevice.h> +#include <linux/module.h> +#include <linux/moduleparam.h> +#include <linux/platform_device.h> +#include <linux/types.h> +#include <linux/watchdog.h> +#include <asm/bitops.h> +#include <asm/io.h> +#include <asm/uaccess.h> +#include <asm/arch/regs-timer.h> + + +#define WDT_DEFAULT_TIME 5 /* seconds */ +#define WDT_MAX_TIME 171 /* seconds */ + +static int wdt_time = WDT_DEFAULT_TIME; +static int nowayout = WATCHDOG_NOWAYOUT; + +module_param(wdt_time, int, 0); +MODULE_PARM_DESC(wdt_time, "Watchdog time in seconds. (default="__MODULE_STRING(WDT_DEFAULT_TIME) ")"); + +#ifdef CONFIG_WATCHDOG_NOWAYOUT +module_param(nowayout, int, 0); +MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); +#endif + + +static unsigned long ks8695wdt_busy; + +/* ......................................................................... */ + +/* + * Disable the watchdog. + */ +static void inline ks8695_wdt_stop(void) +{ + unsigned long tmcon; + + /* disable timer0 */ + tmcon = __raw_readl(KS8695_TMR_VA + KS8695_TMCON); + __raw_writel(tmcon & ~TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON); +} + +/* + * Enable and reset the watchdog. + */ +static void inline ks8695_wdt_start(void) +{ + unsigned long tmcon; + unsigned long tval = wdt_time * CLOCK_TICK_RATE; + + /* disable timer0 */ + tmcon = __raw_readl(KS8695_TMR_VA + KS8695_TMCON); + __raw_writel(tmcon & ~TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON); + + /* program timer0 */ + __raw_writel(tval | T0TC_WATCHDOG, KS8695_TMR_VA + KS8695_T0TC); + + /* re-enable timer0 */ + tmcon = __raw_readl(KS8695_TMR_VA + KS8695_TMCON); + __raw_writel(tmcon | TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON); +} + +/* + * Reload the watchdog timer. (ie, pat the watchdog) + */ +static void inline ks8695_wdt_reload(void) +{ + unsigned long tmcon; + + /* disable, then re-enable timer0 */ + tmcon = __raw_readl(KS8695_TMR_VA + KS8695_TMCON); + __raw_writel(tmcon & ~TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON); + __raw_writel(tmcon | TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON); +} + +/* + * Change the watchdog time interval. + */ +static int ks8695_wdt_settimeout(int new_time) +{ + /* + * All counting occurs at SLOW_CLOCK / 128 = 0.256 Hz + * + * Since WDV is a 16-bit counter, the maximum period is + * 65536 / 0.256 = 256 seconds. + */ + if ((new_time <= 0) || (new_time > WDT_MAX_TIME)) + return -EINVAL; + + /* Set new watchdog time. It will be used when ks8695_wdt_start() is called. */ + wdt_time = new_time; + return 0; +} + +/* ......................................................................... */ + +/* + * Watchdog device is opened, and watchdog starts running. + */ +static int ks8695_wdt_open(struct inode *inode, struct file *file) +{ + if (test_and_set_bit(0, &ks8695wdt_busy)) + return -EBUSY; + + ks8695_wdt_start(); + return nonseekable_open(inode, file); +} + +/* + * Close the watchdog device. + * If CONFIG_WATCHDOG_NOWAYOUT is NOT defined then the watchdog is also + * disabled. + */ +static int ks8695_wdt_close(struct inode *inode, struct file *file) +{ + if (!nowayout) + ks8695_wdt_stop(); /* Disable the watchdog when file is closed */ + + clear_bit(0, &ks8695wdt_busy); + return 0; +} + +static struct watchdog_info ks8695_wdt_info = { + .identity = "ks8695 watchdog", + .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING, +}; + +/* + * Handle commands from user-space. + */ +static int ks8695_wdt_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg) +{ + void __user *argp = (void __user *)arg; + int __user *p = argp; + int new_value; + + switch(cmd) { + case WDIOC_KEEPALIVE: + ks8695_wdt_reload(); /* pat the watchdog */ + return 0; + + case WDIOC_GETSUPPORT: + return copy_to_user(argp, &ks8695_wdt_info, sizeof(ks8695_wdt_info)) ? -EFAULT : 0; + + case WDIOC_SETTIMEOUT: + if (get_user(new_value, p)) + return -EFAULT; + + if (ks8695_wdt_settimeout(new_value)) + return -EINVAL; + + /* Enable new time value */ + ks8695_wdt_start(); + + /* Return current value */ + return put_user(wdt_time, p); + + case WDIOC_GETTIMEOUT: + return put_user(wdt_time, p); + + case WDIOC_GETSTATUS: + case WDIOC_GETBOOTSTATUS: + return put_user(0, p); + + case WDIOC_SETOPTIONS: + if (get_user(new_value, p)) + return -EFAULT; + + if (new_value & WDIOS_DISABLECARD) + ks8695_wdt_stop(); + if (new_value & WDIOS_ENABLECARD) + ks8695_wdt_start(); + return 0; + + default: + return -ENOTTY; + } +} + +/* + * Pat the watchdog whenever device is written to. + */ +static ssize_t ks8695_wdt_write(struct file *file, const char *data, size_t len, loff_t *ppos) +{ + ks8695_wdt_reload(); /* pat the watchdog */ + return len; +} + +/* ......................................................................... */ + +static const struct file_operations ks8695wdt_fops = { + .owner = THIS_MODULE, + .llseek = no_llseek, + .ioctl = ks8695_wdt_ioctl, + .open = ks8695_wdt_open, + .release = ks8695_wdt_close, + .write = ks8695_wdt_write, +}; + +static struct miscdevice ks8695wdt_miscdev = { + .minor = WATCHDOG_MINOR, + .name = "watchdog", + .fops = &ks8695wdt_fops, +}; + +static int __init ks8695wdt_probe(struct platform_device *pdev) +{ + int res; + + if (ks8695wdt_miscdev.parent) + return -EBUSY; + ks8695wdt_miscdev.parent = &pdev->dev; + + res = misc_register(&ks8695wdt_miscdev); + if (res) + return res; + + printk("KS8695 Watchdog Timer enabled (%d seconds%s)\n", wdt_time, nowayout ? ", nowayout" : ""); + return 0; +} + +static int __exit ks8695wdt_remove(struct platform_device *pdev) +{ + int res; + + res = misc_deregister(&ks8695wdt_miscdev); + if (!res) + ks8695wdt_miscdev.parent = NULL; + + return res; +} + +static void ks8695wdt_shutdown(struct platform_device *pdev) +{ + ks8695_wdt_stop(); +} + +#ifdef CONFIG_PM + +static int ks8695wdt_suspend(struct platform_device *pdev, pm_message_t message) +{ + ks8695_wdt_stop(); + return 0; +} + +static int ks8695wdt_resume(struct platform_device *pdev) +{ + if (ks8695wdt_busy) + ks8695_wdt_start(); + return 0; +} + +#else +#define ks8695wdt_suspend NULL +#define ks8695wdt_resume NULL +#endif + +static struct platform_driver ks8695wdt_driver = { + .probe = ks8695wdt_probe, + .remove = __exit_p(ks8695wdt_remove), + .shutdown = ks8695wdt_shutdown, + .suspend = ks8695wdt_suspend, + .resume = ks8695wdt_resume, + .driver = { + .name = "ks8695_wdt", + .owner = THIS_MODULE, + }, +}; + +static int __init ks8695_wdt_init(void) +{ + /* Check that the heartbeat value is within range; if not reset to the default */ + if (ks8695_wdt_settimeout(wdt_time)) { + ks8695_wdt_settimeout(WDT_DEFAULT_TIME); + pr_info("ks8695_wdt: wdt_time value must be 1 <= wdt_time <= %i, using %d\n", wdt_time, WDT_MAX_TIME); + } + + return platform_driver_register(&ks8695wdt_driver); +} + +static void __exit ks8695_wdt_exit(void) +{ + platform_driver_unregister(&ks8695wdt_driver); +} + +module_init(ks8695_wdt_init); +module_exit(ks8695_wdt_exit); + +MODULE_AUTHOR("Andrew Victor"); +MODULE_DESCRIPTION("Watchdog driver for KS8695"); +MODULE_LICENSE("GPL"); +MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c index b234729706b..be6b93c20f6 100644 --- a/drivers/input/evdev.c +++ b/drivers/input/evdev.c @@ -699,9 +699,9 @@ static void evdev_disconnect(struct input_handle *handle) if (evdev->open) { input_flush_device(handle, NULL); input_close_device(handle); - wake_up_interruptible(&evdev->wait); list_for_each_entry(client, &evdev->client_list, node) kill_fasync(&client->fasync, SIGIO, POLL_HUP); + wake_up_interruptible(&evdev->wait); } else evdev_free(evdev); } diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c index 06f0541b24d..10e3b7bc925 100644 --- a/drivers/input/joydev.c +++ b/drivers/input/joydev.c @@ -594,9 +594,9 @@ static void joydev_disconnect(struct input_handle *handle) if (joydev->open) { input_close_device(handle); - wake_up_interruptible(&joydev->wait); list_for_each_entry(client, &joydev->client_list, node) kill_fasync(&client->fasync, SIGIO, POLL_HUP); + wake_up_interruptible(&joydev->wait); } else joydev_free(joydev); } diff --git a/drivers/input/joystick/db9.c b/drivers/input/joystick/db9.c index 86ad1027e12..b069ee18e35 100644 --- a/drivers/input/joystick/db9.c +++ b/drivers/input/joystick/db9.c @@ -54,7 +54,7 @@ static struct db9_config db9_cfg[DB9_MAX_PORTS] __initdata; module_param_array_named(dev, db9_cfg[0].args, int, &db9_cfg[0].nargs, 0); MODULE_PARM_DESC(dev, "Describes first attached device (<parport#>,<type>)"); -module_param_array_named(dev2, db9_cfg[1].args, int, &db9_cfg[0].nargs, 0); +module_param_array_named(dev2, db9_cfg[1].args, int, &db9_cfg[1].nargs, 0); MODULE_PARM_DESC(dev2, "Describes second attached device (<parport#>,<type>)"); module_param_array_named(dev3, db9_cfg[2].args, int, &db9_cfg[2].nargs, 0); MODULE_PARM_DESC(dev3, "Describes third attached device (<parport#>,<type>)"); diff --git a/drivers/input/mouse/Kconfig b/drivers/input/mouse/Kconfig index eb0167e9f0c..50e06e8dd05 100644 --- a/drivers/input/mouse/Kconfig +++ b/drivers/input/mouse/Kconfig @@ -48,7 +48,7 @@ config MOUSE_PS2_ALPS If unsure, say Y. config MOUSE_PS2_LOGIPS2PP - bool "Logictech PS/2++ mouse protocol extension" if EMBEDDED + bool "Logitech PS/2++ mouse protocol extension" if EMBEDDED default y depends on MOUSE_PS2 help diff --git a/drivers/input/mousedev.c b/drivers/input/mousedev.c index 8675f950939..3f4866d8d18 100644 --- a/drivers/input/mousedev.c +++ b/drivers/input/mousedev.c @@ -766,9 +766,9 @@ static void mousedev_disconnect(struct input_handle *handle) if (mousedev->open) { input_close_device(handle); - wake_up_interruptible(&mousedev->wait); list_for_each_entry(client, &mousedev->client_list, node) kill_fasync(&client->fasync, SIGIO, POLL_HUP); + wake_up_interruptible(&mousedev->wait); } else mousedev_free(mousedev); } diff --git a/drivers/input/tsdev.c b/drivers/input/tsdev.c index 8238b13874c..2db364898e1 100644 --- a/drivers/input/tsdev.c +++ b/drivers/input/tsdev.c @@ -476,9 +476,9 @@ static void tsdev_disconnect(struct input_handle *handle) if (tsdev->open) { input_close_device(handle); - wake_up_interruptible(&tsdev->wait); list_for_each_entry(client, &tsdev->client_list, node) kill_fasync(&client->fasync, SIGIO, POLL_HUP); + wake_up_interruptible(&tsdev->wait); } else tsdev_free(tsdev); } diff --git a/drivers/macintosh/Kconfig b/drivers/macintosh/Kconfig index f44c94abd88..ee699a7d621 100644 --- a/drivers/macintosh/Kconfig +++ b/drivers/macintosh/Kconfig @@ -114,7 +114,7 @@ config PMAC_SMU config PMAC_APM_EMU tristate "APM emulation" select APM_EMULATION - depends on ADB_PMU && PM + depends on ADB_PMU && PM && PPC32 config PMAC_MEDIABAY bool "Support PowerBook hotswap media bay" diff --git a/drivers/mfd/ucb1x00-ts.c b/drivers/mfd/ucb1x00-ts.c index 7772bd1d92b..38e815a2e87 100644 --- a/drivers/mfd/ucb1x00-ts.c +++ b/drivers/mfd/ucb1x00-ts.c @@ -291,7 +291,7 @@ static void ucb1x00_ts_irq(int idx, void *id) static int ucb1x00_ts_open(struct input_dev *idev) { - struct ucb1x00_ts *ts = idev->private; + struct ucb1x00_ts *ts = input_get_drvdata(idev); int ret = 0; BUG_ON(ts->rtask); @@ -328,7 +328,7 @@ static int ucb1x00_ts_open(struct input_dev *idev) */ static void ucb1x00_ts_close(struct input_dev *idev) { - struct ucb1x00_ts *ts = idev->private; + struct ucb1x00_ts *ts = input_get_drvdata(idev); if (ts->rtask) kthread_stop(ts->rtask); @@ -380,7 +380,6 @@ static int ucb1x00_ts_add(struct ucb1x00_dev *dev) ts->idev = idev; ts->adcsync = adcsync ? UCB_SYNC : UCB_NOSYNC; - idev->private = ts; idev->name = "Touchscreen panel"; idev->id.product = ts->ucb->id; idev->open = ucb1x00_ts_open; @@ -391,6 +390,8 @@ static int ucb1x00_ts_add(struct ucb1x00_dev *dev) __set_bit(ABS_Y, idev->absbit); __set_bit(ABS_PRESSURE, idev->absbit); + input_set_drvdata(idev, ts); + err = input_register_device(idev); if (err) goto fail; diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c index 6c36a55cb3d..95c0b96e83f 100644 --- a/drivers/misc/thinkpad_acpi.c +++ b/drivers/misc/thinkpad_acpi.c @@ -740,7 +740,7 @@ static ssize_t hotkey_enable_store(struct device *dev, } static struct device_attribute dev_attr_hotkey_enable = - __ATTR(enable, S_IWUSR | S_IRUGO, + __ATTR(hotkey_enable, S_IWUSR | S_IRUGO, hotkey_enable_show, hotkey_enable_store); /* sysfs hotkey mask --------------------------------------------------- */ @@ -775,7 +775,7 @@ static ssize_t hotkey_mask_store(struct device *dev, } static struct device_attribute dev_attr_hotkey_mask = - __ATTR(mask, S_IWUSR | S_IRUGO, + __ATTR(hotkey_mask, S_IWUSR | S_IRUGO, hotkey_mask_show, hotkey_mask_store); /* sysfs hotkey bios_enabled ------------------------------------------- */ @@ -787,7 +787,7 @@ static ssize_t hotkey_bios_enabled_show(struct device *dev, } static struct device_attribute dev_attr_hotkey_bios_enabled = - __ATTR(bios_enabled, S_IRUGO, hotkey_bios_enabled_show, NULL); + __ATTR(hotkey_bios_enabled, S_IRUGO, hotkey_bios_enabled_show, NULL); /* sysfs hotkey bios_mask ---------------------------------------------- */ static ssize_t hotkey_bios_mask_show(struct device *dev, @@ -798,7 +798,7 @@ static ssize_t hotkey_bios_mask_show(struct device *dev, } static struct device_attribute dev_attr_hotkey_bios_mask = - __ATTR(bios_mask, S_IRUGO, hotkey_bios_mask_show, NULL); + __ATTR(hotkey_bios_mask, S_IRUGO, hotkey_bios_mask_show, NULL); /* --------------------------------------------------------------------- */ @@ -824,8 +824,7 @@ static int __init hotkey_init(struct ibm_init_struct *iibm) str_supported(tp_features.hotkey)); if (tp_features.hotkey) { - hotkey_dev_attributes = create_attr_set(4, - TPACPI_HOTKEY_SYSFS_GROUP); + hotkey_dev_attributes = create_attr_set(4, NULL); if (!hotkey_dev_attributes) return -ENOMEM; res = add_to_attr_set(hotkey_dev_attributes, @@ -1050,7 +1049,7 @@ static ssize_t bluetooth_enable_store(struct device *dev, } static struct device_attribute dev_attr_bluetooth_enable = - __ATTR(enable, S_IWUSR | S_IRUGO, + __ATTR(bluetooth_enable, S_IWUSR | S_IRUGO, bluetooth_enable_show, bluetooth_enable_store); /* --------------------------------------------------------------------- */ @@ -1061,7 +1060,6 @@ static struct attribute *bluetooth_attributes[] = { }; static const struct attribute_group bluetooth_attr_group = { - .name = TPACPI_BLUETH_SYSFS_GROUP, .attrs = bluetooth_attributes, }; @@ -1215,7 +1213,7 @@ static ssize_t wan_enable_store(struct device *dev, } static struct device_attribute dev_attr_wan_enable = - __ATTR(enable, S_IWUSR | S_IRUGO, + __ATTR(wwan_enable, S_IWUSR | S_IRUGO, wan_enable_show, wan_enable_store); /* --------------------------------------------------------------------- */ @@ -1226,7 +1224,6 @@ static struct attribute *wan_attributes[] = { }; static const struct attribute_group wan_attr_group = { - .name = TPACPI_WAN_SYSFS_GROUP, .attrs = wan_attributes, }; diff --git a/drivers/misc/thinkpad_acpi.h b/drivers/misc/thinkpad_acpi.h index 440145a0261..72d62f2dabb 100644 --- a/drivers/misc/thinkpad_acpi.h +++ b/drivers/misc/thinkpad_acpi.h @@ -278,8 +278,6 @@ static int beep_write(char *buf); * Bluetooth subdriver */ -#define TPACPI_BLUETH_SYSFS_GROUP "bluetooth" - enum { /* ACPI GBDC/SBDC bits */ TP_ACPI_BLUETOOTH_HWPRESENT = 0x01, /* Bluetooth hw available */ @@ -416,8 +414,6 @@ static int fan_write_cmd_watchdog(const char *cmd, int *rc); * Hotkey subdriver */ -#define TPACPI_HOTKEY_SYSFS_GROUP "hotkey" - static int hotkey_orig_status; static int hotkey_orig_mask; @@ -553,8 +549,6 @@ static int volume_write(char *buf); * Wan subdriver */ -#define TPACPI_WAN_SYSFS_GROUP "wwan" - enum { /* ACPI GWAN/SWAN bits */ TP_ACPI_WANCARD_HWPRESENT = 0x01, /* Wan hw available */ diff --git a/drivers/mtd/Makefile b/drivers/mtd/Makefile index 92055405cb3..451adcc52b3 100644 --- a/drivers/mtd/Makefile +++ b/drivers/mtd/Makefile @@ -1,10 +1,9 @@ # # Makefile for the memory technology device drivers. # -# $Id: Makefile.common,v 1.7 2005/07/11 10:39:27 gleixner Exp $ # Core functionality. -mtd-y := mtdcore.o +mtd-y := mtdcore.o mtdsuper.o mtd-$(CONFIG_MTD_PARTITIONS) += mtdpart.o obj-$(CONFIG_MTD) += $(mtd-y) diff --git a/drivers/mtd/maps/uclinux.c b/drivers/mtd/maps/uclinux.c index 389fea28b9a..14ffb1a9302 100644 --- a/drivers/mtd/maps/uclinux.c +++ b/drivers/mtd/maps/uclinux.c @@ -16,7 +16,6 @@ #include <linux/kernel.h> #include <linux/fs.h> #include <linux/major.h> -#include <linux/root_dev.h> #include <linux/mtd/mtd.h> #include <linux/mtd/map.h> #include <linux/mtd/partitions.h> @@ -89,10 +88,6 @@ int __init uclinux_mtd_init(void) uclinux_ram_mtdinfo = mtd; add_mtd_partitions(mtd, uclinux_romfs, NUM_PARTITIONS); - printk("uclinux[mtd]: set %s to be root filesystem\n", - uclinux_romfs[0].name); - ROOT_DEV = MKDEV(MTD_BLOCK_MAJOR, 0); - return(0); } diff --git a/drivers/mtd/mtdsuper.c b/drivers/mtd/mtdsuper.c new file mode 100644 index 00000000000..aca33197120 --- /dev/null +++ b/drivers/mtd/mtdsuper.c @@ -0,0 +1,232 @@ +/* MTD-based superblock management + * + * Copyright © 2001-2007 Red Hat, Inc. All Rights Reserved. + * Written by: David Howells <dhowells@redhat.com> + * David Woodhouse <dwmw2@infradead.org> + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ + +#include <linux/mtd/super.h> +#include <linux/namei.h> +#include <linux/ctype.h> + +/* + * compare superblocks to see if they're equivalent + * - they are if the underlying MTD device is the same + */ +static int get_sb_mtd_compare(struct super_block *sb, void *_mtd) +{ + struct mtd_info *mtd = _mtd; + + if (sb->s_mtd == mtd) { + DEBUG(2, "MTDSB: Match on device %d (\"%s\")\n", + mtd->index, mtd->name); + return 1; + } + + DEBUG(2, "MTDSB: No match, device %d (\"%s\"), device %d (\"%s\")\n", + sb->s_mtd->index, sb->s_mtd->name, mtd->index, mtd->name); + return 0; +} + +/* + * mark the superblock by the MTD device it is using + * - set the device number to be the correct MTD block device for pesuperstence + * of NFS exports + */ +static int get_sb_mtd_set(struct super_block *sb, void *_mtd) +{ + struct mtd_info *mtd = _mtd; + + sb->s_mtd = mtd; + sb->s_dev = MKDEV(MTD_BLOCK_MAJOR, mtd->index); + return 0; +} + +/* + * get a superblock on an MTD-backed filesystem + */ +static int get_sb_mtd_aux(struct file_system_type *fs_type, int flags, + const char *dev_name, void *data, + struct mtd_info *mtd, + int (*fill_super)(struct super_block *, void *, int), + struct vfsmount *mnt) +{ + struct super_block *sb; + int ret; + + sb = sget(fs_type, get_sb_mtd_compare, get_sb_mtd_set, mtd); + if (IS_ERR(sb)) + goto out_error; + + if (sb->s_root) + goto already_mounted; + + /* fresh new superblock */ + DEBUG(1, "MTDSB: New superblock for device %d (\"%s\")\n", + mtd->index, mtd->name); + + ret = fill_super(sb, data, flags & MS_SILENT ? 1 : 0); + if (ret < 0) { + up_write(&sb->s_umount); + deactivate_super(sb); + return ret; + } + + /* go */ + sb->s_flags |= MS_ACTIVE; + return simple_set_mnt(mnt, sb); + + /* new mountpoint for an already mounted superblock */ +already_mounted: + DEBUG(1, "MTDSB: Device %d (\"%s\") is already mounted\n", + mtd->index, mtd->name); + ret = simple_set_mnt(mnt, sb); + goto out_put; + +out_error: + ret = PTR_ERR(sb); +out_put: + put_mtd_device(mtd); + return ret; +} + +/* + * get a superblock on an MTD-backed filesystem by MTD device number + */ +static int get_sb_mtd_nr(struct file_system_type *fs_type, int flags, + const char *dev_name, void *data, int mtdnr, + int (*fill_super)(struct super_block *, void *, int), + struct vfsmount *mnt) +{ + struct mtd_info *mtd; + + mtd = get_mtd_device(NULL, mtdnr); + if (IS_ERR(mtd)) { + DEBUG(0, "MTDSB: Device #%u doesn't appear to exist\n", mtdnr); + return PTR_ERR(mtd); + } + + return get_sb_mtd_aux(fs_type, flags, dev_name, data, mtd, fill_super, + mnt); +} + +/* + * set up an MTD-based superblock + */ +int get_sb_mtd(struct file_system_type *fs_type, int flags, + const char *dev_name, void *data, + int (*fill_super)(struct super_block *, void *, int), + struct vfsmount *mnt) +{ + struct nameidata nd; + int mtdnr, ret; + + if (!dev_name) + return -EINVAL; + + DEBUG(2, "MTDSB: dev_name \"%s\"\n", dev_name); + + /* the preferred way of mounting in future; especially when + * CONFIG_BLOCK=n - we specify the underlying MTD device by number or + * by name, so that we don't require block device support to be present + * in the kernel. */ + if (dev_name[0] == 'm' && dev_name[1] == 't' && dev_name[2] == 'd') { + if (dev_name[3] == ':') { + struct mtd_info *mtd; + + /* mount by MTD device name */ + DEBUG(1, "MTDSB: mtd:%%s, name \"%s\"\n", + dev_name + 4); + + for (mtdnr = 0; mtdnr < MAX_MTD_DEVICES; mtdnr++) { + mtd = get_mtd_device(NULL, mtdnr); + if (!IS_ERR(mtd)) { + if (!strcmp(mtd->name, dev_name + 4)) + return get_sb_mtd_aux( + fs_type, flags, + dev_name, data, mtd, + fill_super, mnt); + + put_mtd_device(mtd); + } + } + + printk(KERN_NOTICE "MTD:" + " MTD device with name \"%s\" not found.\n", + dev_name + 4); + + } else if (isdigit(dev_name[3])) { + /* mount by MTD device number name */ + char *endptr; + + mtdnr = simple_strtoul(dev_name + 3, &endptr, 0); + if (!*endptr) { + /* It was a valid number */ + DEBUG(1, "MTDSB: mtd%%d, mtdnr %d\n", + mtdnr); + return get_sb_mtd_nr(fs_type, flags, + dev_name, data, + mtdnr, fill_super, mnt); + } + } + } + + /* try the old way - the hack where we allowed users to mount + * /dev/mtdblock$(n) but didn't actually _use_ the blockdev + */ + ret = path_lookup(dev_name, LOOKUP_FOLLOW, &nd); + + DEBUG(1, "MTDSB: path_lookup() returned %d, inode %p\n", + ret, nd.dentry ? nd.dentry->d_inode : NULL); + + if (ret) + return ret; + + ret = -EINVAL; + + if (!S_ISBLK(nd.dentry->d_inode->i_mode)) + goto out; + + if (nd.mnt->mnt_flags & MNT_NODEV) { + ret = -EACCES; + goto out; + } + + if (imajor(nd.dentry->d_inode) != MTD_BLOCK_MAJOR) + goto not_an_MTD_device; + + mtdnr = iminor(nd.dentry->d_inode); + path_release(&nd); + + return get_sb_mtd_nr(fs_type, flags, dev_name, data, mtdnr, fill_super, + mnt); + +not_an_MTD_device: + if (!(flags & MS_SILENT)) + printk(KERN_NOTICE + "MTD: Attempt to mount non-MTD device \"%s\"\n", + dev_name); +out: + path_release(&nd); + return ret; + +} + +EXPORT_SYMBOL_GPL(get_sb_mtd); + +/* + * destroy an MTD-based superblock + */ +void kill_mtd_super(struct super_block *sb) +{ + generic_shutdown_super(sb); + put_mtd_device(sb->s_mtd); + sb->s_mtd = NULL; +} + +EXPORT_SYMBOL_GPL(kill_mtd_super); diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c index e8c9f27817b..a804965e654 100644 --- a/drivers/net/8139cp.c +++ b/drivers/net/8139cp.c @@ -435,20 +435,12 @@ static void cp_vlan_rx_register(struct net_device *dev, struct vlan_group *grp) spin_lock_irqsave(&cp->lock, flags); cp->vlgrp = grp; - cp->cpcmd |= RxVlanOn; - cpw16(CpCmd, cp->cpcmd); - spin_unlock_irqrestore(&cp->lock, flags); -} - -static void cp_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) -{ - struct cp_private *cp = netdev_priv(dev); - unsigned long flags; + if (grp) + cp->cpcmd |= RxVlanOn; + else + cp->cpcmd &= ~RxVlanOn; - spin_lock_irqsave(&cp->lock, flags); - cp->cpcmd &= ~RxVlanOn; cpw16(CpCmd, cp->cpcmd); - vlan_group_set_device(cp->vlgrp, vid, NULL); spin_unlock_irqrestore(&cp->lock, flags); } #endif /* CP_VLAN_TAG_USED */ @@ -1944,7 +1936,6 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) #if CP_VLAN_TAG_USED dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; dev->vlan_rx_register = cp_vlan_rx_register; - dev->vlan_rx_kill_vid = cp_vlan_rx_kill_vid; #endif if (pci_using_dac) diff --git a/drivers/net/acenic.c b/drivers/net/acenic.c index 7122b7ba8d6..04382f979c9 100644 --- a/drivers/net/acenic.c +++ b/drivers/net/acenic.c @@ -480,12 +480,10 @@ static int __devinit acenic_probe_one(struct pci_dev *pdev, #if ACENIC_DO_VLAN dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; dev->vlan_rx_register = ace_vlan_rx_register; - dev->vlan_rx_kill_vid = ace_vlan_rx_kill_vid; #endif - if (1) { - dev->tx_timeout = &ace_watchdog; - dev->watchdog_timeo = 5*HZ; - } + + dev->tx_timeout = &ace_watchdog; + dev->watchdog_timeo = 5*HZ; dev->open = &ace_open; dev->stop = &ace_close; @@ -2283,19 +2281,6 @@ static void ace_vlan_rx_register(struct net_device *dev, struct vlan_group *grp) ace_unmask_irq(dev); local_irq_restore(flags); } - - -static void ace_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) -{ - struct ace_private *ap = netdev_priv(dev); - unsigned long flags; - - local_irq_save(flags); - ace_mask_irq(dev); - vlan_group_set_device(ap->vlgrp, vid, NULL); - ace_unmask_irq(dev); - local_irq_restore(flags); -} #endif /* ACENIC_DO_VLAN */ diff --git a/drivers/net/acenic.h b/drivers/net/acenic.h index 8ca8534d70b..60ed1837fa8 100644 --- a/drivers/net/acenic.h +++ b/drivers/net/acenic.h @@ -787,7 +787,6 @@ static struct net_device_stats *ace_get_stats(struct net_device *dev); static int read_eeprom_byte(struct net_device *dev, unsigned long offset); #if ACENIC_DO_VLAN static void ace_vlan_rx_register(struct net_device *dev, struct vlan_group *grp); -static void ace_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid); #endif #endif /* _ACENIC_H_ */ diff --git a/drivers/net/amd8111e.c b/drivers/net/amd8111e.c index 84b81642011..a61b2f89fc3 100644 --- a/drivers/net/amd8111e.c +++ b/drivers/net/amd8111e.c @@ -1728,15 +1728,8 @@ static void amd8111e_vlan_rx_register(struct net_device *dev, struct vlan_group lp->vlgrp = grp; spin_unlock_irq(&lp->lock); } - -static void amd8111e_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) -{ - struct amd8111e_priv *lp = netdev_priv(dev); - spin_lock_irq(&lp->lock); - vlan_group_set_device(lp->vlgrp, vid, NULL); - spin_unlock_irq(&lp->lock); -} #endif + static int amd8111e_enable_magicpkt(struct amd8111e_priv* lp) { writel( VAL1|MPPLBA, lp->mmio + CMD3); @@ -1996,7 +1989,6 @@ static int __devinit amd8111e_probe_one(struct pci_dev *pdev, #if AMD8111E_VLAN_TAG_USED dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX ; dev->vlan_rx_register =amd8111e_vlan_rx_register; - dev->vlan_rx_kill_vid = amd8111e_vlan_rx_kill_vid; #endif lp = netdev_priv(dev); @@ -2049,7 +2041,6 @@ static int __devinit amd8111e_probe_one(struct pci_dev *pdev, #if AMD8111E_VLAN_TAG_USED dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; dev->vlan_rx_register =amd8111e_vlan_rx_register; - dev->vlan_rx_kill_vid = amd8111e_vlan_rx_kill_vid; #endif /* Probe the external PHY */ amd8111e_probe_ext_phy(dev); diff --git a/drivers/net/atl1/atl1_main.c b/drivers/net/atl1/atl1_main.c index 78cf00ff3d3..6862c11ff86 100644 --- a/drivers/net/atl1/atl1_main.c +++ b/drivers/net/atl1/atl1_main.c @@ -1229,39 +1229,9 @@ static void atl1_vlan_rx_register(struct net_device *netdev, spin_unlock_irqrestore(&adapter->lock, flags); } -/* FIXME: justify or remove -- CHS */ -static void atl1_vlan_rx_add_vid(struct net_device *netdev, u16 vid) -{ - /* We don't do Vlan filtering */ - return; -} - -/* FIXME: this looks wrong too -- CHS */ -static void atl1_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) -{ - struct atl1_adapter *adapter = netdev_priv(netdev); - unsigned long flags; - - spin_lock_irqsave(&adapter->lock, flags); - /* atl1_irq_disable(adapter); */ - vlan_group_set_device(adapter->vlgrp, vid, NULL); - /* atl1_irq_enable(adapter); */ - spin_unlock_irqrestore(&adapter->lock, flags); - /* We don't do Vlan filtering */ - return; -} - static void atl1_restore_vlan(struct atl1_adapter *adapter) { atl1_vlan_rx_register(adapter->netdev, adapter->vlgrp); - if (adapter->vlgrp) { - u16 vid; - for (vid = 0; vid < VLAN_GROUP_ARRAY_LEN; vid++) { - if (!vlan_group_get_device(adapter->vlgrp, vid)) - continue; - atl1_vlan_rx_add_vid(adapter->netdev, vid); - } - } } static u16 tpd_avail(struct atl1_tpd_ring *tpd_ring) @@ -2203,8 +2173,7 @@ static int __devinit atl1_probe(struct pci_dev *pdev, netdev->poll_controller = atl1_poll_controller; #endif netdev->vlan_rx_register = atl1_vlan_rx_register; - netdev->vlan_rx_add_vid = atl1_vlan_rx_add_vid; - netdev->vlan_rx_kill_vid = atl1_vlan_rx_kill_vid; + netdev->ethtool_ops = &atl1_ethtool_ops; adapter->bd_number = cards_found; adapter->pci_using_64 = pci_using_64; diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index 88b33c6ddda..da7c3b0c533 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c @@ -4786,19 +4786,6 @@ bnx2_vlan_rx_register(struct net_device *dev, struct vlan_group *vlgrp) bnx2_netif_start(bp); } - -/* Called with rtnl_lock */ -static void -bnx2_vlan_rx_kill_vid(struct net_device *dev, uint16_t vid) -{ - struct bnx2 *bp = netdev_priv(dev); - - bnx2_netif_stop(bp); - vlan_group_set_device(bp->vlgrp, vid, NULL); - bnx2_set_rx_mode(dev); - - bnx2_netif_start(bp); -} #endif /* Called with netif_tx_lock. @@ -6453,7 +6440,6 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) dev->watchdog_timeo = TX_TIMEOUT; #ifdef BCM_VLAN dev->vlan_rx_register = bnx2_vlan_rx_register; - dev->vlan_rx_kill_vid = bnx2_vlan_rx_kill_vid; #endif dev->poll = bnx2_poll; dev->ethtool_ops = &bnx2_ethtool_ops; diff --git a/drivers/net/chelsio/cxgb2.c b/drivers/net/chelsio/cxgb2.c index 125c9b10586..231ce43b97c 100644 --- a/drivers/net/chelsio/cxgb2.c +++ b/drivers/net/chelsio/cxgb2.c @@ -883,15 +883,6 @@ static void vlan_rx_register(struct net_device *dev, t1_set_vlan_accel(adapter, grp != NULL); spin_unlock_irq(&adapter->async_lock); } - -static void vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) -{ - struct adapter *adapter = dev->priv; - - spin_lock_irq(&adapter->async_lock); - vlan_group_set_device(adapter->vlan_grp, vid, NULL); - spin_unlock_irq(&adapter->async_lock); -} #endif #ifdef CONFIG_NET_POLL_CONTROLLER @@ -1099,7 +1090,6 @@ static int __devinit init_one(struct pci_dev *pdev, netdev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; netdev->vlan_rx_register = vlan_rx_register; - netdev->vlan_rx_kill_vid = vlan_rx_kill_vid; #endif /* T204: disable TSO */ diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c index 67b4b219d92..1b20f4060e2 100644 --- a/drivers/net/cxgb3/cxgb3_main.c +++ b/drivers/net/cxgb3/cxgb3_main.c @@ -2067,11 +2067,6 @@ static void vlan_rx_register(struct net_device *dev, struct vlan_group *grp) t3_synchronize_rx(adapter, pi); } -static void vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) -{ - /* nothing */ -} - #ifdef CONFIG_NET_POLL_CONTROLLER static void cxgb_netpoll(struct net_device *dev) { @@ -2409,7 +2404,6 @@ static int __devinit init_one(struct pci_dev *pdev, netdev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; netdev->vlan_rx_register = vlan_rx_register; - netdev->vlan_rx_kill_vid = vlan_rx_kill_vid; netdev->open = cxgb_open; netdev->stop = cxgb_close; diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index 9ec35b7a820..cf8af928a69 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c @@ -1142,13 +1142,16 @@ e1000_probe(struct pci_dev *pdev, !e1000_check_mng_mode(&adapter->hw)) e1000_get_hw_control(adapter); - strcpy(netdev->name, "eth%d"); - if ((err = register_netdev(netdev))) - goto err_register; - /* tell the stack to leave us alone until e1000_open() is called */ netif_carrier_off(netdev); netif_stop_queue(netdev); +#ifdef CONFIG_E1000_NAPI + netif_poll_disable(netdev); +#endif + + strcpy(netdev->name, "eth%d"); + if ((err = register_netdev(netdev))) + goto err_register; DPRINTK(PROBE, INFO, "Intel(R) PRO/1000 Network Connection\n"); diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index 4154fd00074..32788ca40d2 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c @@ -4605,12 +4605,7 @@ static void nv_vlan_rx_register(struct net_device *dev, struct vlan_group *grp) writel(np->txrxctl_bits, get_hwbase(dev) + NvRegTxRxControl); spin_unlock_irq(&np->lock); -}; - -static void nv_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) -{ - /* nothing to do */ -}; +} /* The mgmt unit and driver use a semaphore to access the phy during init */ static int nv_mgmt_acquire_sema(struct net_device *dev) @@ -4956,7 +4951,6 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i np->vlanctl_bits = NVREG_VLANCONTROL_ENABLE; dev->features |= NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_TX; dev->vlan_rx_register = nv_vlan_rx_register; - dev->vlan_rx_kill_vid = nv_vlan_rx_kill_vid; } np->msi_flags = 0; diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c index f5b3cba23fc..6822bf14267 100644 --- a/drivers/net/gianfar.c +++ b/drivers/net/gianfar.c @@ -140,7 +140,6 @@ int gfar_clean_rx_ring(struct net_device *dev, int rx_work_limit); static int gfar_process_frame(struct net_device *dev, struct sk_buff *skb, int length); static void gfar_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp); -static void gfar_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid); void gfar_halt(struct net_device *dev); void gfar_start(struct net_device *dev); static void gfar_clear_exact_match(struct net_device *dev); @@ -284,7 +283,6 @@ static int gfar_probe(struct platform_device *pdev) if (priv->einfo->device_flags & FSL_GIANFAR_DEV_HAS_VLAN) { dev->vlan_rx_register = gfar_vlan_rx_register; - dev->vlan_rx_kill_vid = gfar_vlan_rx_kill_vid; dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; @@ -1133,20 +1131,6 @@ static void gfar_vlan_rx_register(struct net_device *dev, spin_unlock_irqrestore(&priv->rxlock, flags); } - -static void gfar_vlan_rx_kill_vid(struct net_device *dev, uint16_t vid) -{ - struct gfar_private *priv = netdev_priv(dev); - unsigned long flags; - - spin_lock_irqsave(&priv->rxlock, flags); - - vlan_group_set_device(priv->vlgrp, vid, NULL); - - spin_unlock_irqrestore(&priv->rxlock, flags); -} - - static int gfar_change_mtu(struct net_device *dev, int new_mtu) { int tempsize, tempval; diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index 5d14be7405a..b53b7ad999b 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c @@ -1472,6 +1472,7 @@ static const struct ethtool_ops myri10ge_ethtool_ops = { .set_sg = ethtool_op_set_sg, .get_tso = ethtool_op_get_tso, .set_tso = ethtool_op_set_tso, + .get_link = ethtool_op_get_link, .get_strings = myri10ge_get_strings, .get_stats_count = myri10ge_get_stats_count, .get_ethtool_stats = myri10ge_get_ethtool_stats, diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index 2c5c6d20e6e..c61181f23bd 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c @@ -654,8 +654,6 @@ static void __devexit netxen_nic_remove(struct pci_dev *pdev) if (adapter->portnum == 0) netxen_free_adapter_offload(adapter); - if (adapter->irq) - free_irq(adapter->irq, adapter); if(adapter->portnum == 0) { /* leave the hw in the same state as reboot */ writel(0, NETXEN_CRB_NORMALIZE(adapter, CRB_CMDPEG_STATE)); diff --git a/drivers/net/ns83820.c b/drivers/net/ns83820.c index 3439f8c649f..717d8e9b983 100644 --- a/drivers/net/ns83820.c +++ b/drivers/net/ns83820.c @@ -506,17 +506,6 @@ static void ns83820_vlan_rx_register(struct net_device *ndev, struct vlan_group spin_unlock(&dev->tx_lock); spin_unlock_irq(&dev->misc_lock); } - -static void ns83820_vlan_rx_kill_vid(struct net_device *ndev, unsigned short vid) -{ - struct ns83820 *dev = PRIV(ndev); - - spin_lock_irq(&dev->misc_lock); - spin_lock(&dev->tx_lock); - vlan_group_set_device(dev->vlgrp, vid, NULL); - spin_unlock(&dev->tx_lock); - spin_unlock_irq(&dev->misc_lock); -} #endif /* Packet Receiver @@ -2083,7 +2072,6 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_ /* We also support hardware vlan acceleration */ ndev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; ndev->vlan_rx_register = ns83820_vlan_rx_register; - ndev->vlan_rx_kill_vid = ns83820_vlan_rx_kill_vid; #endif if (using_dac) { diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c index d8766c0e825..585be044ebb 100755 --- a/drivers/net/qla3xxx.c +++ b/drivers/net/qla3xxx.c @@ -4044,7 +4044,7 @@ static int __devinit ql3xxx_probe(struct pci_dev *pdev, if (pci_using_dac) ndev->features |= NETIF_F_HIGHDMA; if (qdev->device_id == QL3032_DEVICE_ID) - ndev->features |= (NETIF_F_HW_CSUM | NETIF_F_SG); + ndev->features |= NETIF_F_IP_CSUM | NETIF_F_SG; qdev->mem_map_registers = ioremap_nocache(pci_resource_start(pdev, 1), diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index 45876a854f0..5ec7752caa4 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c @@ -886,16 +886,6 @@ static void rtl8169_vlan_rx_register(struct net_device *dev, spin_unlock_irqrestore(&tp->lock, flags); } -static void rtl8169_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) -{ - struct rtl8169_private *tp = netdev_priv(dev); - unsigned long flags; - - spin_lock_irqsave(&tp->lock, flags); - vlan_group_set_device(tp->vlgrp, vid, NULL); - spin_unlock_irqrestore(&tp->lock, flags); -} - static int rtl8169_rx_vlan_skb(struct rtl8169_private *tp, struct RxDesc *desc, struct sk_buff *skb) { @@ -1671,7 +1661,6 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) #ifdef CONFIG_R8169_VLAN dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; dev->vlan_rx_register = rtl8169_vlan_rx_register; - dev->vlan_rx_kill_vid = rtl8169_vlan_rx_kill_vid; #endif #ifdef CONFIG_NET_POLL_CONTROLLER diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c index e3e6d410d72..c6ba3dee8ae 100644 --- a/drivers/net/s2io.c +++ b/drivers/net/s2io.c @@ -340,17 +340,6 @@ static void s2io_vlan_rx_register(struct net_device *dev, /* A flag indicating whether 'RX_PA_CFG_STRIP_VLAN_TAG' bit is set or not */ static int vlan_strip_flag; -/* Unregister the vlan */ -static void s2io_vlan_rx_kill_vid(struct net_device *dev, unsigned long vid) -{ - struct s2io_nic *nic = dev->priv; - unsigned long flags; - - spin_lock_irqsave(&nic->tx_lock, flags); - vlan_group_set_device(nic->vlgrp, vid, NULL); - spin_unlock_irqrestore(&nic->tx_lock, flags); -} - /* * Constants to be programmed into the Xena's registers, to configure * the XAUI. @@ -7412,7 +7401,6 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre) SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; dev->vlan_rx_register = s2io_vlan_rx_register; - dev->vlan_rx_kill_vid = (void *)s2io_vlan_rx_kill_vid; /* * will use eth_mac_addr() for dev->set_mac_address diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index adfbe81693a..fe01b961b59 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c @@ -1049,26 +1049,22 @@ static void sky2_vlan_rx_register(struct net_device *dev, struct vlan_group *grp u16 port = sky2->port; netif_tx_lock_bh(dev); + netif_poll_disable(sky2->hw->dev[0]); - sky2_write32(hw, SK_REG(port, RX_GMF_CTRL_T), RX_VLAN_STRIP_ON); - sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), TX_VLAN_TAG_ON); sky2->vlgrp = grp; + if (grp) { + sky2_write32(hw, SK_REG(port, RX_GMF_CTRL_T), + RX_VLAN_STRIP_ON); + sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), + TX_VLAN_TAG_ON); + } else { + sky2_write32(hw, SK_REG(port, RX_GMF_CTRL_T), + RX_VLAN_STRIP_OFF); + sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), + TX_VLAN_TAG_OFF); + } - netif_tx_unlock_bh(dev); -} - -static void sky2_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) -{ - struct sky2_port *sky2 = netdev_priv(dev); - struct sky2_hw *hw = sky2->hw; - u16 port = sky2->port; - - netif_tx_lock_bh(dev); - - sky2_write32(hw, SK_REG(port, RX_GMF_CTRL_T), RX_VLAN_STRIP_OFF); - sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), TX_VLAN_TAG_OFF); - vlan_group_set_device(sky2->vlgrp, vid, NULL); - + netif_poll_enable(sky2->hw->dev[0]); netif_tx_unlock_bh(dev); } #endif @@ -3484,7 +3480,6 @@ static __devinit struct net_device *sky2_init_netdev(struct sky2_hw *hw, #ifdef SKY2_VLAN_TAG_USED dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; dev->vlan_rx_register = sky2_vlan_rx_register; - dev->vlan_rx_kill_vid = sky2_vlan_rx_kill_vid; #endif /* read the mac address */ diff --git a/drivers/net/smc91x.h b/drivers/net/smc91x.h index 111f23d0576..506bffcbc6d 100644 --- a/drivers/net/smc91x.h +++ b/drivers/net/smc91x.h @@ -281,17 +281,14 @@ SMC_outw(u16 val, void __iomem *ioaddr, int reg) #elif defined(CONFIG_SUPERH) -#if defined(CONFIG_SH_7780_SOLUTION_ENGINE) || defined(CONFIG_SH_7722_SOLUTION_ENGINE) +#ifdef CONFIG_SOLUTION_ENGINE #define SMC_CAN_USE_8BIT 0 #define SMC_CAN_USE_16BIT 1 #define SMC_CAN_USE_32BIT 0 #define SMC_IO_SHIFT 0 #define SMC_NOWAIT 1 -#define SMC_inb(a, r) (inw((a) + ((r)&~1)) >> (8*(r%2)))&0xff #define SMC_inw(a, r) inw((a) + (r)) -#define SMC_outb(v, a, r) outw(((inw((a)+((r)&~1))*(0xff<<8*(r%2)))) | ((v)<<(8*(r&2)))), (a) + ((r)&~1)) - #define SMC_outw(v, a, r) outw(v, (a) + (r)) #define SMC_insw(a, r, p, l) insw((a) + (r), p, l) #define SMC_outsw(a, r, p, l) outsw((a) + (r), p, l) diff --git a/drivers/net/spider_net.c b/drivers/net/spider_net.c index ef84d7c757a..b47ad1df2e0 100644 --- a/drivers/net/spider_net.c +++ b/drivers/net/spider_net.c @@ -1191,43 +1191,6 @@ spider_net_poll(struct net_device *netdev, int *budget) } /** - * spider_net_vlan_rx_reg - initializes VLAN structures in the driver and card - * @netdev: interface device structure - * @grp: vlan_group structure that is registered (NULL on destroying interface) - */ -static void -spider_net_vlan_rx_reg(struct net_device *netdev, struct vlan_group *grp) -{ - /* further enhancement... yet to do */ - return; -} - -/** - * spider_net_vlan_rx_add - adds VLAN id to the card filter - * @netdev: interface device structure - * @vid: VLAN id to add - */ -static void -spider_net_vlan_rx_add(struct net_device *netdev, uint16_t vid) -{ - /* further enhancement... yet to do */ - /* add vid to card's VLAN filter table */ - return; -} - -/** - * spider_net_vlan_rx_kill - removes VLAN id to the card filter - * @netdev: interface device structure - * @vid: VLAN id to remove - */ -static void -spider_net_vlan_rx_kill(struct net_device *netdev, uint16_t vid) -{ - /* further enhancement... yet to do */ - /* remove vid from card's VLAN filter table */ -} - -/** * spider_net_get_stats - get interface statistics * @netdev: interface device structure * @@ -2177,9 +2140,6 @@ spider_net_setup_netdev_ops(struct net_device *netdev) netdev->poll = &spider_net_poll; netdev->weight = SPIDER_NET_NAPI_WEIGHT; /* HW VLAN */ - netdev->vlan_rx_register = &spider_net_vlan_rx_reg; - netdev->vlan_rx_add_vid = &spider_net_vlan_rx_add; - netdev->vlan_rx_kill_vid = &spider_net_vlan_rx_kill; #ifdef CONFIG_NET_POLL_CONTROLLER /* poll controller */ netdev->poll_controller = &spider_net_poll_controller; diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 923b9c725cc..2f3184184ad 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c @@ -64,8 +64,8 @@ #define DRV_MODULE_NAME "tg3" #define PFX DRV_MODULE_NAME ": " -#define DRV_MODULE_VERSION "3.76" -#define DRV_MODULE_RELDATE "May 5, 2007" +#define DRV_MODULE_VERSION "3.77" +#define DRV_MODULE_RELDATE "May 31, 2007" #define TG3_DEF_MAC_MODE 0 #define TG3_DEF_RX_MODE 0 @@ -9121,21 +9121,6 @@ static void tg3_vlan_rx_register(struct net_device *dev, struct vlan_group *grp) if (netif_running(dev)) tg3_netif_start(tp); } - -static void tg3_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) -{ - struct tg3 *tp = netdev_priv(dev); - - if (netif_running(dev)) - tg3_netif_stop(tp); - - tg3_full_lock(tp, 0); - vlan_group_set_device(tp->vlgrp, vid, NULL); - tg3_full_unlock(tp); - - if (netif_running(dev)) - tg3_netif_start(tp); -} #endif static int tg3_get_coalesce(struct net_device *dev, struct ethtool_coalesce *ec) @@ -10976,6 +10961,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) * upon subsystem IDs. */ if (tp->pdev->subsystem_vendor == PCI_VENDOR_ID_DELL && + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701 && !(tp->tg3_flags2 & TG3_FLG2_PHY_SERDES)) { tp->tg3_flags |= (TG3_FLAG_USE_MI_INTERRUPT | TG3_FLAG_USE_LINKCHG_REG); @@ -11778,7 +11764,6 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, #if TG3_VLAN_TAG_USED dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; dev->vlan_rx_register = tg3_vlan_rx_register; - dev->vlan_rx_kill_vid = tg3_vlan_rx_kill_vid; #endif tp = netdev_priv(dev); diff --git a/drivers/net/typhoon.c b/drivers/net/typhoon.c index f7257359412..15b2fb8aa49 100644 --- a/drivers/net/typhoon.c +++ b/drivers/net/typhoon.c @@ -741,15 +741,6 @@ typhoon_vlan_rx_register(struct net_device *dev, struct vlan_group *grp) spin_unlock_bh(&tp->state_lock); } -static void -typhoon_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) -{ - struct typhoon *tp = netdev_priv(dev); - spin_lock_bh(&tp->state_lock); - vlan_group_set_device(tp->vlgrp, vid, NULL); - spin_unlock_bh(&tp->state_lock); -} - static inline void typhoon_tso_fill(struct sk_buff *skb, struct transmit_ring *txRing, u32 ring_dma) @@ -2542,7 +2533,7 @@ typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) dev->get_stats = typhoon_get_stats; dev->set_mac_address = typhoon_set_mac_address; dev->vlan_rx_register = typhoon_vlan_rx_register; - dev->vlan_rx_kill_vid = typhoon_vlan_rx_kill_vid; + SET_ETHTOOL_OPS(dev, &typhoon_ethtool_ops); /* We can handle scatter gather, up to 16 entries, and diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig index 572034ceb14..2b2f5c12019 100644 --- a/drivers/scsi/Kconfig +++ b/drivers/scsi/Kconfig @@ -1532,6 +1532,7 @@ source "drivers/scsi/arm/Kconfig" config JAZZ_ESP bool "MIPS JAZZ FAS216 SCSI support" depends on MACH_JAZZ && SCSI + select SCSI_SPI_ATTRS help This is the driver for the onboard SCSI host adapter of MIPS Magnum 4000, Acer PICA, Olivetti M700-10 and a few other identical OEM @@ -1756,6 +1757,7 @@ config SUN3X_ESP config SCSI_SUNESP tristate "Sparc ESP Scsi Driver" depends on SBUS && SCSI + select SCSI_SPI_ATTRS help This is the driver for the Sun ESP SCSI host adapter. The ESP chipset is present in most SPARC SBUS-based computers. diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c index 350ea7feb61..5c487ff096c 100644 --- a/drivers/scsi/aacraid/linit.c +++ b/drivers/scsi/aacraid/linit.c @@ -863,6 +863,14 @@ static struct scsi_host_template aac_driver_template = { .emulated = 1, }; +static void __aac_shutdown(struct aac_dev * aac) +{ + kthread_stop(aac->thread); + aac_send_shutdown(aac); + aac_adapter_disable_int(aac); + free_irq(aac->pdev->irq, aac); +} + static int __devinit aac_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) { @@ -1015,10 +1023,7 @@ static int __devinit aac_probe_one(struct pci_dev *pdev, return 0; out_deinit: - kthread_stop(aac->thread); - aac_send_shutdown(aac); - aac_adapter_disable_int(aac); - free_irq(pdev->irq, aac); + __aac_shutdown(aac); out_unmap: aac_fib_map_free(aac); pci_free_consistent(aac->pdev, aac->comm_size, aac->comm_addr, aac->comm_phys); @@ -1038,7 +1043,8 @@ static void aac_shutdown(struct pci_dev *dev) { struct Scsi_Host *shost = pci_get_drvdata(dev); struct aac_dev *aac = (struct aac_dev *)shost->hostdata; - aac_send_shutdown(aac); + scsi_block_requests(shost); + __aac_shutdown(aac); } static void __devexit aac_remove_one(struct pci_dev *pdev) @@ -1048,16 +1054,12 @@ static void __devexit aac_remove_one(struct pci_dev *pdev) scsi_remove_host(shost); - kthread_stop(aac->thread); - - aac_send_shutdown(aac); - aac_adapter_disable_int(aac); + __aac_shutdown(aac); aac_fib_map_free(aac); pci_free_consistent(aac->pdev, aac->comm_size, aac->comm_addr, aac->comm_phys); kfree(aac->queues); - free_irq(pdev->irq, aac); aac_adapter_ioremap(aac, 0); kfree(aac->fibs); diff --git a/drivers/scsi/atari_NCR5380.c b/drivers/scsi/atari_NCR5380.c index eff846ae0af..03dbe60c264 100644 --- a/drivers/scsi/atari_NCR5380.c +++ b/drivers/scsi/atari_NCR5380.c @@ -894,45 +894,6 @@ static int NCR5380_init(struct Scsi_Host *instance, int flags) } /* - * our own old-style timeout update - */ -/* - * The strategy is to cause the timer code to call scsi_times_out() - * when the soonest timeout is pending. - * The arguments are used when we are queueing a new command, because - * we do not want to subtract the time used from this time, but when we - * set the timer, we want to take this value into account. - */ - -int atari_scsi_update_timeout(Scsi_Cmnd * SCset, int timeout) -{ - int rtn; - - /* - * We are using the new error handling code to actually register/deregister - * timers for timeout. - */ - - if (!timer_pending(&SCset->eh_timeout)) - rtn = 0; - else - rtn = SCset->eh_timeout.expires - jiffies; - - if (timeout == 0) { - del_timer(&SCset->eh_timeout); - SCset->eh_timeout.data = (unsigned long)NULL; - SCset->eh_timeout.expires = 0; - } else { - if (SCset->eh_timeout.data != (unsigned long)NULL) - del_timer(&SCset->eh_timeout); - SCset->eh_timeout.data = (unsigned long)SCset; - SCset->eh_timeout.expires = jiffies + timeout; - add_timer(&SCset->eh_timeout); - } - return rtn; -} - -/* * Function : int NCR5380_queue_command (Scsi_Cmnd *cmd, * void (*done)(Scsi_Cmnd *)) * @@ -956,7 +917,6 @@ static int NCR5380_queue_command(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *)) Scsi_Cmnd *tmp; int oldto; unsigned long flags; - // extern int update_timeout(Scsi_Cmnd * SCset, int timeout); #if (NDEBUG & NDEBUG_NO_WRITE) switch (cmd->cmnd[0]) { @@ -1029,9 +989,9 @@ static int NCR5380_queue_command(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *)) * alter queues and touch the lock. */ if (!IS_A_TT()) { - oldto = atari_scsi_update_timeout(cmd, 0); + /* perhaps stop command timer here */ falcon_get_lock(); - atari_scsi_update_timeout(cmd, oldto); + /* perhaps restart command timer here */ } if (!(hostdata->issue_queue) || (cmd->cmnd[0] == REQUEST_SENSE)) { LIST(cmd, hostdata->issue_queue); diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index dd076da86a4..b98136adaaa 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -2590,7 +2590,7 @@ qla2x00_down_timeout(struct semaphore *sema, unsigned long timeout) return 0; if (msleep_interruptible(step)) break; - } while (--iterations >= 0); + } while (--iterations > 0); return -ETIMEDOUT; } diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index a67f315244d..662577fbe7a 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c @@ -184,6 +184,15 @@ int scsi_complete_async_scans(void) /* Only exported for the benefit of scsi_wait_scan */ EXPORT_SYMBOL_GPL(scsi_complete_async_scans); +#ifndef MODULE +/* + * For async scanning we need to wait for all the scans to complete before + * trying to mount the root fs. Otherwise non-modular drivers may not be ready + * yet. + */ +late_initcall(scsi_complete_async_scans); +#endif + /** * scsi_unlock_floptical - unlock device via a special MODE SENSE command * @sdev: scsi device to send command to diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index c3219b29b5a..4831edbae2d 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -411,7 +411,7 @@ EXPORT_SYMBOL_GPL(spi_alloc_master); */ int spi_register_master(struct spi_master *master) { - static atomic_t dyn_bus_id = ATOMIC_INIT((1<<16) - 1); + static atomic_t dyn_bus_id = ATOMIC_INIT((1<<15) - 1); struct device *dev = master->cdev.dev; int status = -ENODEV; int dynamic = 0; diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index 6e1f1ea21b3..403dac787eb 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -755,7 +755,7 @@ config FB_LEO config FB_IGA bool "IGA 168x display support" - depends on FB && SPARC32 + depends on (FB = y) && SPARC32 select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT @@ -765,7 +765,7 @@ config FB_IGA config FB_XVR500 bool "Sun XVR-500 3DLABS Wildcat support" - depends on FB && PCI && SPARC64 + depends on (FB = y) && PCI && SPARC64 select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT @@ -778,7 +778,7 @@ config FB_XVR500 config FB_XVR2500 bool "Sun XVR-2500 3DLABS Wildcat support" - depends on FB && PCI && SPARC64 + depends on (FB = y) && PCI && SPARC64 select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT diff --git a/drivers/video/console/Makefile b/drivers/video/console/Makefile index 9b26dda18a3..ac46cc3f6a2 100644 --- a/drivers/video/console/Makefile +++ b/drivers/video/console/Makefile @@ -47,7 +47,7 @@ targets := promcon_tbl.c quiet_cmd_conmakehash = CNMKHSH $@ cmd_conmakehash = scripts/conmakehash $< | \ sed -e '/\#include <[^>]*>/p' -e 's/types/init/' \ - -e 's/dfont\(_uni.*\]\)/promfont\1 __initdata/' > $@ + -e 's/dfont\(_uni.*\]\)/promfont\1 /' > $@ $(obj)/promcon_tbl.c: $(src)/prom.uni $(call cmd,conmakehash) diff --git a/drivers/video/ffb.c b/drivers/video/ffb.c index 1d4e8354b56..3f6c98fad43 100644 --- a/drivers/video/ffb.c +++ b/drivers/video/ffb.c @@ -656,7 +656,7 @@ static int ffb_setcolreg(unsigned regno, { u32 value; - if (regno >= 256) + if (regno >= 16) return 1; red >>= 8; @@ -903,7 +903,7 @@ ffb_init_fix(struct fb_info *info) struct all_info { struct fb_info info; struct ffb_par par; - u32 pseudo_palette[256]; + u32 pseudo_palette[16]; }; static int ffb_init_one(struct of_device *op) diff --git a/drivers/video/sunxvr2500.c b/drivers/video/sunxvr2500.c index 4316c7fe8e2..c3869a96ab5 100644 --- a/drivers/video/sunxvr2500.c +++ b/drivers/video/sunxvr2500.c @@ -28,7 +28,7 @@ struct s3d_info { unsigned int depth; unsigned int fb_size; - u32 pseudo_palette[256]; + u32 pseudo_palette[16]; }; static int __devinit s3d_get_props(struct s3d_info *sp) @@ -52,15 +52,14 @@ static int s3d_setcolreg(unsigned regno, { u32 value; - if (regno >= 256) - return 1; + if (regno < 16) { + red >>= 8; + green >>= 8; + blue >>= 8; - red >>= 8; - green >>= 8; - blue >>= 8; - - value = (blue << 24) | (green << 16) | (red << 8); - ((u32 *)info->pseudo_palette)[regno] = value; + value = (blue << 24) | (green << 16) | (red << 8); + ((u32 *)info->pseudo_palette)[regno] = value; + } return 0; } diff --git a/drivers/video/sunxvr500.c b/drivers/video/sunxvr500.c index 08880a62bfa..71bf3f1f00b 100644 --- a/drivers/video/sunxvr500.c +++ b/drivers/video/sunxvr500.c @@ -50,7 +50,7 @@ struct e3d_info { u32 fb8_0_off; u32 fb8_1_off; - u32 pseudo_palette[256]; + u32 pseudo_palette[16]; }; static int __devinit e3d_get_props(struct e3d_info *ep) @@ -126,7 +126,9 @@ static int e3d_setcolreg(unsigned regno, blue_8 = blue >> 8; value = (blue_8 << 24) | (green_8 << 16) | (red_8 << 8); - ((u32 *)info->pseudo_palette)[regno] = value; + + if (info->fix.visual == FB_VISUAL_TRUECOLOR && regno < 16) + ((u32 *)info->pseudo_palette)[regno] = value; red_10 = red >> 6; |