## Automatically generated incremental diff ## From: linux-2.4.22-bk22 ## To: linux-2.4.22-bk23 ## Robot: $Id: make-incremental-diff,v 1.11 2002/02/20 02:59:33 hpa Exp $ diff -urN linux-2.4.22-bk22/Documentation/networking/bonding.txt linux-2.4.22-bk23/Documentation/networking/bonding.txt --- linux-2.4.22-bk22/Documentation/networking/bonding.txt 2003-08-25 04:44:39.000000000 -0700 +++ linux-2.4.22-bk23/Documentation/networking/bonding.txt 2003-09-22 03:14:37.000000000 -0700 @@ -527,9 +527,9 @@ 1) Bonding information files ---------------------------- -The bonding driver information files reside in the /proc/net/bond* directories. +The bonding driver information files reside in the /proc/net/bonding directory. -Sample contents of /proc/net/bond0/info after the driver is loaded with +Sample contents of /proc/net/bonding/bond0 after the driver is loaded with parameters of mode=0 and miimon=1000 is shown below. Bonding Mode: load balancing (round-robin) diff -urN linux-2.4.22-bk22/Makefile linux-2.4.22-bk23/Makefile --- linux-2.4.22-bk22/Makefile 2003-09-22 03:13:25.000000000 -0700 +++ linux-2.4.22-bk23/Makefile 2003-09-22 03:14:37.000000000 -0700 @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 4 SUBLEVEL = 22 -EXTRAVERSION = -bk22 +EXTRAVERSION = -bk23 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) diff -urN linux-2.4.22-bk22/arch/i386/kernel/Makefile linux-2.4.22-bk23/arch/i386/kernel/Makefile --- linux-2.4.22-bk22/arch/i386/kernel/Makefile 2003-08-25 04:44:39.000000000 -0700 +++ linux-2.4.22-bk23/arch/i386/kernel/Makefile 2003-09-22 03:14:37.000000000 -0700 @@ -38,7 +38,6 @@ obj-$(CONFIG_APM) += apm.o obj-$(CONFIG_ACPI_BOOT) += acpi.o obj-$(CONFIG_ACPI_SLEEP) += acpi_wakeup.o -obj-$(CONFIG_ACPI_HT_ONLY) += acpitable.o obj-$(CONFIG_SMP) += smp.o smpboot.o trampoline.o obj-$(CONFIG_X86_LOCAL_APIC) += mpparse.o apic.o nmi.o obj-$(CONFIG_X86_IO_APIC) += io_apic.o diff -urN linux-2.4.22-bk22/arch/i386/kernel/acpitable.c linux-2.4.22-bk23/arch/i386/kernel/acpitable.c --- linux-2.4.22-bk22/arch/i386/kernel/acpitable.c 2003-08-25 04:44:39.000000000 -0700 +++ linux-2.4.22-bk23/arch/i386/kernel/acpitable.c 1969-12-31 16:00:00.000000000 -0800 @@ -1,553 +0,0 @@ -/* - * acpitable.c - IA32-specific ACPI boot-time initialization (Revision: 1) - * - * Copyright (C) 1999 Andrew Henroid - * Copyright (C) 2001 Richard Schaal - * Copyright (C) 2001 Paul Diefenbaugh - * Copyright (C) 2001 Jun Nakajima - * Copyright (C) 2001 Arjan van de Ven - * - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * - * 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. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * - * $Id: acpitable.c,v 1.7 2001/11/04 12:21:18 fenrus Exp $ - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "acpitable.h" - -static acpi_table_handler acpi_boot_ops[ACPI_TABLE_COUNT]; - -int acpi_lapic; - -static unsigned char __init -acpi_checksum(void *buffer, int length) -{ - int i; - unsigned char *bytebuffer; - unsigned char sum = 0; - - if (!buffer || length <= 0) - return 0; - - bytebuffer = (unsigned char *) buffer; - - for (i = 0; i < length; i++) - sum += *(bytebuffer++); - - return sum; -} - -static void __init -acpi_print_table_header(acpi_table_header * header) -{ - if (!header) - return; - - printk(KERN_INFO "ACPI table found: %.4s v%d [%.6s %.8s %d.%d]\n", - header->signature, header->revision, header->oem_id, - header->oem_table_id, header->oem_revision >> 16, - header->oem_revision & 0xffff); - - return; -} - -/******************************************************************************* - * - * FUNCTION: acpi_tb_scan_memory_for_rsdp - * - * PARAMETERS: address - Starting pointer for search - * length - Maximum length to search - * - * RETURN: Pointer to the RSDP if found and valid, otherwise NULL. - * - * DESCRIPTION: Search a block of memory for the RSDP signature - * - ******************************************************************************/ - -static void *__init -acpi_tb_scan_memory_for_rsdp(void *address, int length) -{ - int offset; - - if (length <= 0) - return NULL; - - /* Search from given start addr for the requested length */ - - offset = 0; - - while (offset < length) { - /* The signature must match and the checksum must be correct */ - if (strncmp(address, RSDP_SIG, sizeof(RSDP_SIG) - 1) == 0 && - acpi_checksum(address, RSDP_CHECKSUM_LENGTH) == 0) { - /* If so, we have found the RSDP */ - printk(KERN_INFO "ACPI: RSDP located at physical address %p\n", - address); - return address; - } - offset += RSDP_SCAN_STEP; - address += RSDP_SCAN_STEP; - } - - /* Searched entire block, no RSDP was found */ - dprintk(KERN_INFO "ACPI: Searched entire block 0x%x:0x%x, no RSDP was found.\n", - (int)address, (int)address + length); - return NULL; -} - -/******************************************************************************* - * - * FUNCTION: acpi_find_root_pointer - * - * PARAMETERS: none - * - * RETURN: physical address of the RSDP - * - * DESCRIPTION: Search lower 1_mbyte of memory for the root system descriptor - * pointer structure. If it is found, set *RSDP to point to it. - * - * NOTE: The RSDP must be either in the first 1_k of the Extended - * BIOS Data Area or between E0000 and FFFFF (ACPI 1.0 section - * 5.2.2; assertion #421). - * - ******************************************************************************/ - -static struct acpi_table_rsdp * __init -acpi_find_root_pointer(void) -{ - struct acpi_table_rsdp * rsdp; - - /* - * Physical address is given - */ - /* - * Region 1) Search EBDA (low memory) paragraphs - */ - rsdp = acpi_tb_scan_memory_for_rsdp(__va(LO_RSDP_WINDOW_BASE), - LO_RSDP_WINDOW_SIZE); - - if (rsdp) - return rsdp; - - /* - * Region 2) Search upper memory: 16-byte boundaries in E0000h-F0000h - */ - rsdp = acpi_tb_scan_memory_for_rsdp(__va(HI_RSDP_WINDOW_BASE), - HI_RSDP_WINDOW_SIZE); - - - - if (rsdp) - return rsdp; - - printk(KERN_ERR "ACPI: System description tables not found\n"); - return NULL; -} - - -/* - * Temporarily use the virtual area starting from FIX_IO_APIC_BASE_END, - * to map the target physical address. The problem is that set_fixmap() - * provides a single page, and it is possible that the page is not - * sufficient. - * By using this area, we can map up to MAX_IO_APICS pages temporarily, - * i.e. until the next __va_range() call. - * - * Important Safety Note: The fixed I/O APIC page numbers are *subtracted* - * from the fixed base. That's why we start at FIX_IO_APIC_BASE_END and - * count idx down while incrementing the phys address. - */ -static __init char * -__va_range(unsigned long phys, unsigned long size) -{ - unsigned long base, offset, mapped_size; - int idx; - - offset = phys & (PAGE_SIZE - 1); - mapped_size = PAGE_SIZE - offset; - set_fixmap(FIX_IO_APIC_BASE_END, phys); - base = fix_to_virt(FIX_IO_APIC_BASE_END); - dprintk("__va_range(0x%lx, 0x%lx): idx=%d mapped at %lx\n", phys, size, - FIX_IO_APIC_BASE_END, base); - - /* - * Most cases can be covered by the below. - */ - idx = FIX_IO_APIC_BASE_END; - while (mapped_size < size) { - if (--idx < FIX_IO_APIC_BASE_0) - return 0; /* cannot handle this */ - phys += PAGE_SIZE; - set_fixmap(idx, phys); - mapped_size += PAGE_SIZE; - } - - return ((unsigned char *) base + offset); -} - -static int __init acpi_tables_init(void) -{ - int result = -ENODEV; - acpi_table_header *header = NULL; - struct acpi_table_rsdp *rsdp = NULL; - struct acpi_table_rsdt *rsdt = NULL; - struct acpi_table_rsdt saved_rsdt; - int tables = 0; - int type = 0; - int i = 0; - - - rsdp = (struct acpi_table_rsdp *) acpi_find_root_pointer(); - - if (!rsdp) - return -ENODEV; - - printk(KERN_INFO "%.8s v%d [%.6s]\n", rsdp->signature, rsdp->revision, - rsdp->oem_id); - - if (strncmp(rsdp->signature, RSDP_SIG,strlen(RSDP_SIG))) { - printk(KERN_WARNING "RSDP table signature incorrect\n"); - return -EINVAL; - } - - rsdt = (struct acpi_table_rsdt *) - __va_range(rsdp->rsdt_address, sizeof(struct acpi_table_rsdt)); - - if (!rsdt) { - printk(KERN_WARNING "ACPI: Invalid root system description tables (RSDT)\n"); - return -ENODEV; - } - - header = & rsdt->header; - acpi_print_table_header(header); - - if (strncmp(header->signature, RSDT_SIG, strlen(RSDT_SIG))) { - printk(KERN_WARNING "ACPI: RSDT signature incorrect\n"); - return -ENODEV; - } - - /* - * The number of tables is computed by taking the - * size of all entries (header size minus total - * size of RSDT) divided by the size of each entry - * (4-byte table pointers). - */ - tables = (header->length - sizeof(acpi_table_header)) / 4; - - memcpy(&saved_rsdt, rsdt, sizeof(saved_rsdt)); - - if (saved_rsdt.header.length > sizeof(saved_rsdt)) { - printk(KERN_WARNING "ACPI: Too big length in RSDT: %d\n", saved_rsdt.header.length); - return -ENODEV; - } - - for (i = 0; i < tables; i++) { - /* Map in header, then map in full table length. */ - header = (acpi_table_header *) - __va_range(saved_rsdt.entry[i], - sizeof(acpi_table_header)); - if (!header) - break; - header = (acpi_table_header *) - __va_range(saved_rsdt.entry[i], header->length); - if (!header) - break; - - acpi_print_table_header(header); - - if (acpi_checksum(header,header->length)) { - printk(KERN_WARNING "ACPI %s has invalid checksum\n", - acpi_table_signatures[i]); - continue; - } - - for (type = 0; type < ACPI_TABLE_COUNT; type++) - if (!strncmp((char *) &header->signature, - acpi_table_signatures[type],strlen(acpi_table_signatures[type]))) - break; - - if (type >= ACPI_TABLE_COUNT) { - printk(KERN_WARNING "ACPI: Unsupported table %.4s\n", - header->signature); - continue; - } - - - if (!acpi_boot_ops[type]) - continue; - - result = acpi_boot_ops[type] (header, - (unsigned long) saved_rsdt. - entry[i]); - } - - return result; -} - -static int total_cpus __initdata = 0; -int have_acpi_tables; - -extern void __init MP_processor_info(struct mpc_config_processor *); - -static void __init -acpi_parse_lapic(struct acpi_table_lapic *local_apic) -{ - struct mpc_config_processor proc_entry; - int ix = 0; - - if (!local_apic) - return; - - printk(KERN_INFO "LAPIC (acpi_id[0x%04x] id[0x%x] enabled[%d])\n", - local_apic->acpi_id, local_apic->id, local_apic->flags.enabled); - - printk(KERN_INFO "CPU %d (0x%02x00)", total_cpus, local_apic->id); - - if (local_apic->flags.enabled) { - printk(" enabled\n"); - ix = local_apic->id; - if (ix >= MAX_APICS) { - printk(KERN_WARNING - "Processor #%d INVALID - (Max ID: %d).\n", ix, - MAX_APICS); - return; - } - /* - * Fill in the info we want to save. Not concerned about - * the processor ID. Processor features aren't present in - * the table. - */ - proc_entry.mpc_type = MP_PROCESSOR; - proc_entry.mpc_apicid = local_apic->id; - proc_entry.mpc_cpuflag = CPU_ENABLED; - if (proc_entry.mpc_apicid == boot_cpu_physical_apicid) { - printk(" (BSP)"); - proc_entry.mpc_cpuflag |= CPU_BOOTPROCESSOR; - } - proc_entry.mpc_cpufeature = - (boot_cpu_data.x86 << 8) | - (boot_cpu_data.x86_model << 4) | - boot_cpu_data.x86_mask; - proc_entry.mpc_featureflag = boot_cpu_data.x86_capability[0]; - proc_entry.mpc_reserved[0] = 0; - proc_entry.mpc_reserved[1] = 0; - proc_entry.mpc_apicver = 0x10; /* integrated APIC */ - MP_processor_info(&proc_entry); - } else { - printk(" disabled\n"); - } - - total_cpus++; - return; -} - -static void __init -acpi_parse_ioapic(struct acpi_table_ioapic *ioapic) -{ - - if (!ioapic) - return; - - printk(KERN_INFO - "IOAPIC (id[0x%x] address[0x%x] global_irq_base[0x%x])\n", - ioapic->id, ioapic->address, ioapic->global_irq_base); - - if (nr_ioapics >= MAX_IO_APICS) { - printk(KERN_WARNING - "Max # of I/O APICs (%d) exceeded (found %d).\n", - MAX_IO_APICS, nr_ioapics); -/* panic("Recompile kernel with bigger MAX_IO_APICS!\n"); */ - } -} - - -/* Interrupt source overrides inform the machine about exceptions - to the normal "PIC" mode interrupt routing */ - -static void __init -acpi_parse_int_src_ovr(struct acpi_table_int_src_ovr *intsrc) -{ - if (!intsrc) - return; - - printk(KERN_INFO - "INT_SRC_OVR (bus[%d] irq[0x%x] global_irq[0x%x] polarity[0x%x] trigger[0x%x])\n", - intsrc->bus, intsrc->bus_irq, intsrc->global_irq, - intsrc->flags.polarity, intsrc->flags.trigger); -} - -/* - * At this point, we look at the interrupt assignment entries in the MPS - * table. - */ - -static void __init acpi_parse_nmi_src(struct acpi_table_nmi_src *nmisrc) -{ - if (!nmisrc) - return; - - printk(KERN_INFO - "NMI_SRC (polarity[0x%x] trigger[0x%x] global_irq[0x%x])\n", - nmisrc->flags.polarity, nmisrc->flags.trigger, - nmisrc->global_irq); - -} -static void __init -acpi_parse_lapic_nmi(struct acpi_table_lapic_nmi *localnmi) -{ - if (!localnmi) - return; - - printk(KERN_INFO - "LAPIC_NMI (acpi_id[0x%04x] polarity[0x%x] trigger[0x%x] lint[0x%x])\n", - localnmi->acpi_id, localnmi->flags.polarity, - localnmi->flags.trigger, localnmi->lint); -} -static void __init -acpi_parse_lapic_addr_ovr(struct acpi_table_lapic_addr_ovr *lapic_addr_ovr) -{ - if (!lapic_addr_ovr) - return; - - printk(KERN_INFO "LAPIC_ADDR_OVR (address[0x%lx])\n", - (unsigned long) lapic_addr_ovr->address); - -} - -static void __init -acpi_parse_plat_int_src(struct acpi_table_plat_int_src *plintsrc) -{ - if (!plintsrc) - return; - - printk(KERN_INFO - "PLAT_INT_SRC (polarity[0x%x] trigger[0x%x] type[0x%x] id[0x%04x] eid[0x%x] iosapic_vector[0x%x] global_irq[0x%x]\n", - plintsrc->flags.polarity, plintsrc->flags.trigger, - plintsrc->type, plintsrc->id, plintsrc->eid, - plintsrc->iosapic_vector, plintsrc->global_irq); -} -static int __init -acpi_parse_madt(acpi_table_header * header, unsigned long phys) -{ - - struct acpi_table_madt *madt; - acpi_madt_entry_header *entry_header; - int table_size; - - madt = (struct acpi_table_madt *) __va_range(phys, header->length); - - if (!madt) - return -EINVAL; - - table_size = (int) (header->length - sizeof(*madt)); - entry_header = - (acpi_madt_entry_header *) ((void *) madt + sizeof(*madt)); - - while (entry_header && (table_size > 0)) { - switch (entry_header->type) { - case ACPI_MADT_LAPIC: - acpi_parse_lapic((struct acpi_table_lapic *) - entry_header); - break; - case ACPI_MADT_IOAPIC: - acpi_parse_ioapic((struct acpi_table_ioapic *) - entry_header); - break; - case ACPI_MADT_INT_SRC_OVR: - acpi_parse_int_src_ovr((struct acpi_table_int_src_ovr *) - entry_header); - break; - case ACPI_MADT_NMI_SRC: - acpi_parse_nmi_src((struct acpi_table_nmi_src *) - entry_header); - break; - case ACPI_MADT_LAPIC_NMI: - acpi_parse_lapic_nmi((struct acpi_table_lapic_nmi *) - entry_header); - break; - case ACPI_MADT_LAPIC_ADDR_OVR: - acpi_parse_lapic_addr_ovr((struct - acpi_table_lapic_addr_ovr *) - entry_header); - break; - case ACPI_MADT_PLAT_INT_SRC: - acpi_parse_plat_int_src((struct acpi_table_plat_int_src - *) entry_header); - break; - default: - printk(KERN_WARNING - "Unsupported MADT entry type 0x%x\n", - entry_header->type); - break; - } - table_size -= entry_header->length; - entry_header = - (acpi_madt_entry_header *) ((void *) entry_header + - entry_header->length); - } - - if (!total_cpus) { - printk("ACPI: No Processors found in the APCI table.\n"); - return -EINVAL; - } - - printk(KERN_INFO "%d CPUs total\n", total_cpus); - - if (madt->lapic_address) - mp_lapic_addr = madt->lapic_address; - else - mp_lapic_addr = APIC_DEFAULT_PHYS_BASE; - - printk(KERN_INFO "Local APIC address %x\n", madt->lapic_address); - - return 0; -} - - -/* - * Configure the processor info using MADT in the ACPI tables. If we fail to - * configure that, then we use the MPS tables. - */ -void __init -acpi_boot_init(void) -{ - - memset(&acpi_boot_ops, 0, sizeof(acpi_boot_ops)); - acpi_boot_ops[ACPI_APIC] = acpi_parse_madt; - - /* - * Only do this when requested, either because of CPU/Bios type or from the command line - */ - - if (!acpi_tables_init()) - acpi_lapic = 1; -} - diff -urN linux-2.4.22-bk22/arch/i386/kernel/acpitable.h linux-2.4.22-bk23/arch/i386/kernel/acpitable.h --- linux-2.4.22-bk22/arch/i386/kernel/acpitable.h 2003-08-25 04:44:39.000000000 -0700 +++ linux-2.4.22-bk23/arch/i386/kernel/acpitable.h 1969-12-31 16:00:00.000000000 -0800 @@ -1,262 +0,0 @@ -/* - * acpitable.c - IA32-specific ACPI boot-time initialization (Revision: 1) - * - * Copyright (C) 1999 Andrew Henroid - * Copyright (C) 2001 Richard Schaal - * Copyright (C) 2001 Paul Diefenbaugh - * Copyright (C) 2001 Jun Nakajima - * Copyright (C) 2001 Arjan van de Ven - * - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * - * 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. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * - * $Id: acpitable.h,v 1.3 2001/11/03 22:41:34 fenrus Exp $ - */ - -/* - * The following codes are cut&pasted from drivers/acpi. Part of the code - * there can be not updated or delivered yet. - * To avoid conflicts when CONFIG_ACPI is defined, the following codes are - * modified so that they are self-contained in this file. - * -- jun - */ - -#ifndef _HEADER_ACPITABLE_H_ -#define _HEADER_ACPITABLE_H_ - -//#define dprintk(s, args...) printk(s, ## args) -#define dprintk(s, args...) - -typedef unsigned int ACPI_TBLPTR; - -typedef struct { /* ACPI common table header */ - char signature[4]; /* identifies type of table */ - u32 length; /* length of table, - in bytes, * including header */ - u8 revision; /* specification minor version # */ - u8 checksum; /* to make sum of entire table == 0 */ - char oem_id[6]; /* OEM identification */ - char oem_table_id[8]; /* OEM table identification */ - u32 oem_revision; /* OEM revision number */ - char asl_compiler_id[4]; /* ASL compiler vendor ID */ - u32 asl_compiler_revision; /* ASL compiler revision number */ -} acpi_table_header __attribute__ ((packed));; - -enum { - ACPI_APIC = 0, - ACPI_BOOT, - ACPI_DBGP, - ACPI_DSDT, - ACPI_ECDT, - ACPI_ETDT, - ACPI_FACP, - ACPI_FACS, - ACPI_OEMX, - ACPI_PSDT, - ACPI_SBST, - ACPI_SLIT, - ACPI_SPCR, - ACPI_SRAT, - ACPI_SSDT, - ACPI_SPMI, - ACPI_XSDT, - ACPI_TABLE_COUNT -}; - -static char *acpi_table_signatures[ACPI_TABLE_COUNT] = { - "APIC", - "BOOT", - "DBGP", - "DSDT", - "ECDT", - "ETDT", - "FACP", - "FACS", - "OEM", - "PSDT", - "SBST", - "SLIT", - "SPCR", - "SRAT", - "SSDT", - "SPMI", - "XSDT" -}; - -struct acpi_table_madt { - acpi_table_header header; - u32 lapic_address; - struct { - u32 pcat_compat:1; - u32 reserved:31; - } flags __attribute__ ((packed)); -} __attribute__ ((packed));; - -enum { - ACPI_MADT_LAPIC = 0, - ACPI_MADT_IOAPIC, - ACPI_MADT_INT_SRC_OVR, - ACPI_MADT_NMI_SRC, - ACPI_MADT_LAPIC_NMI, - ACPI_MADT_LAPIC_ADDR_OVR, - ACPI_MADT_IOSAPIC, - ACPI_MADT_LSAPIC, - ACPI_MADT_PLAT_INT_SRC, - ACPI_MADT_ENTRY_COUNT -}; - -#define RSDP_SIG "RSD PTR " -#define RSDT_SIG "RSDT" - -#define ACPI_DEBUG_PRINT(pl) - -#define ACPI_MEMORY_MODE 0x01 -#define ACPI_LOGICAL_ADDRESSING 0x00 -#define ACPI_PHYSICAL_ADDRESSING 0x01 - -#define LO_RSDP_WINDOW_BASE 0 /* Physical Address */ -#define HI_RSDP_WINDOW_BASE 0xE0000 /* Physical Address */ -#define LO_RSDP_WINDOW_SIZE 0x400 -#define HI_RSDP_WINDOW_SIZE 0x20000 -#define RSDP_SCAN_STEP 16 -#define RSDP_CHECKSUM_LENGTH 20 - -typedef int (*acpi_table_handler) (acpi_table_header * header, unsigned long); - -struct acpi_table_rsdp { - char signature[8]; - u8 checksum; - char oem_id[6]; - u8 revision; - u32 rsdt_address; -} __attribute__ ((packed)); - -struct acpi_table_rsdt { - acpi_table_header header; - u32 entry[ACPI_TABLE_COUNT]; -} __attribute__ ((packed)); - -typedef struct { - u8 type; - u8 length; -} acpi_madt_entry_header __attribute__ ((packed)); - -typedef struct { - u16 polarity:2; - u16 trigger:2; - u16 reserved:12; -} acpi_madt_int_flags __attribute__ ((packed)); - -struct acpi_table_lapic { - acpi_madt_entry_header header; - u8 acpi_id; - u8 id; - struct { - u32 enabled:1; - u32 reserved:31; - } flags __attribute__ ((packed)); -} __attribute__ ((packed)); - -struct acpi_table_ioapic { - acpi_madt_entry_header header; - u8 id; - u8 reserved; - u32 address; - u32 global_irq_base; -} __attribute__ ((packed)); - -struct acpi_table_int_src_ovr { - acpi_madt_entry_header header; - u8 bus; - u8 bus_irq; - u32 global_irq; - acpi_madt_int_flags flags; -} __attribute__ ((packed)); - -struct acpi_table_nmi_src { - acpi_madt_entry_header header; - acpi_madt_int_flags flags; - u32 global_irq; -} __attribute__ ((packed)); - -struct acpi_table_lapic_nmi { - acpi_madt_entry_header header; - u8 acpi_id; - acpi_madt_int_flags flags; - u8 lint; -} __attribute__ ((packed)); - -struct acpi_table_lapic_addr_ovr { - acpi_madt_entry_header header; - u8 reserved[2]; - u64 address; -} __attribute__ ((packed)); - -struct acpi_table_iosapic { - acpi_madt_entry_header header; - u8 id; - u8 reserved; - u32 global_irq_base; - u64 address; -} __attribute__ ((packed)); - -struct acpi_table_lsapic { - acpi_madt_entry_header header; - u8 acpi_id; - u8 id; - u8 eid; - u8 reserved[3]; - struct { - u32 enabled:1; - u32 reserved:31; - } flags; -} __attribute__ ((packed)); - -struct acpi_table_plat_int_src { - acpi_madt_entry_header header; - acpi_madt_int_flags flags; - u8 type; - u8 id; - u8 eid; - u8 iosapic_vector; - u32 global_irq; - u32 reserved; -} __attribute__ ((packed)); - -/* - * ACPI Table Descriptor. One per ACPI table - */ -typedef struct acpi_table_desc { - struct acpi_table_desc *prev; - struct acpi_table_desc *next; - struct acpi_table_desc *installed_desc; - acpi_table_header *pointer; - void *base_pointer; - u8 *aml_pointer; - u64 physical_address; - u32 aml_length; - u32 length; - u32 count; - u16 table_id; - u8 type; - u8 allocation; - u8 loaded_into_namespace; - -} acpi_table_desc __attribute__ ((packed));; - -#endif diff -urN linux-2.4.22-bk22/arch/i386/kernel/mpparse.c linux-2.4.22-bk23/arch/i386/kernel/mpparse.c --- linux-2.4.22-bk22/arch/i386/kernel/mpparse.c 2003-09-22 03:13:26.000000000 -0700 +++ linux-2.4.22-bk23/arch/i386/kernel/mpparse.c 2003-09-22 03:14:38.000000000 -0700 @@ -1251,31 +1251,34 @@ while ((void *) entry < madt_end) { if (entry->header.type == ACPI_MADT_INT_SRC_OVR && - acpi_fadt.sci_int == entry->bus_irq) { - /* - * See the note at the end of ACPI 2.0b section - * 5.2.10.8 for what this is about. - */ - flags = entry->flags; - acpi_fadt.sci_int = entry->global_irq; - irq = entry->global_irq; - break; - } + acpi_fadt.sci_int == entry->bus_irq) + goto found; entry = (struct acpi_table_int_src_ovr *) ((unsigned long) entry + entry->header.length); } } + /* + * Although the ACPI spec says that the SCI should be level/low + * don't reprogram it unless there is an explicit MADT OVR entry + * instructing us to do so -- otherwise we break Tyan boards which + * have the SCI wired edge/high but no MADT OVR. + */ + return; + +found: + /* + * See the note at the end of ACPI 2.0b section + * 5.2.10.8 for what this is about. + */ + flags = entry->flags; + acpi_fadt.sci_int = entry->global_irq; + irq = entry->global_irq; ioapic = mp_find_ioapic(irq); ioapic_pin = irq - mp_ioapic_routing[ioapic].irq_start; - if (flags.polarity == 0) - flags.polarity = 0x3; /* Active low */ - if (flags.trigger == 0) - flags.trigger = 0x3; /* Level-triggered */ - io_apic_set_pci_routing(ioapic, ioapic_pin, irq, (flags.trigger >> 1) , (flags.polarity >> 1)); } @@ -1315,8 +1318,10 @@ } /* Don't set up the ACPI SCI because it's already set up */ - if (acpi_fadt.sci_int == irq) + if (acpi_fadt.sci_int == irq) { + entry->irq = irq; /*we still need to set entry's irq*/ continue; + } ioapic = mp_find_ioapic(irq); if (ioapic < 0) diff -urN linux-2.4.22-bk22/arch/i386/kernel/setup.c linux-2.4.22-bk23/arch/i386/kernel/setup.c --- linux-2.4.22-bk22/arch/i386/kernel/setup.c 2003-09-22 03:13:27.000000000 -0700 +++ linux-2.4.22-bk23/arch/i386/kernel/setup.c 2003-09-22 03:14:38.000000000 -0700 @@ -176,9 +176,9 @@ static u32 disabled_x86_caps[NCAPINTS] __initdata = { 0 }; #ifdef CONFIG_ACPI_INTERPRETER - int acpi_disabled __initdata = 0; + int acpi_disabled = 0; #else - int acpi_disabled __initdata = 1; + int acpi_disabled = 1; #endif EXPORT_SYMBOL(acpi_disabled); diff -urN linux-2.4.22-bk22/arch/x86_64/kernel/setup.c linux-2.4.22-bk23/arch/x86_64/kernel/setup.c --- linux-2.4.22-bk22/arch/x86_64/kernel/setup.c 2003-08-25 04:44:40.000000000 -0700 +++ linux-2.4.22-bk23/arch/x86_64/kernel/setup.c 2003-09-22 03:14:46.000000000 -0700 @@ -48,7 +48,7 @@ #include #include -int acpi_disabled __initdata = 0; +int acpi_disabled = 0; /* * Machine setup.. diff -urN linux-2.4.22-bk22/drivers/acpi/Config.in linux-2.4.22-bk23/drivers/acpi/Config.in --- linux-2.4.22-bk22/drivers/acpi/Config.in 2003-08-25 04:44:40.000000000 -0700 +++ linux-2.4.22-bk23/drivers/acpi/Config.in 2003-09-22 03:14:46.000000000 -0700 @@ -8,6 +8,9 @@ comment 'ACPI Support' bool 'ACPI Support' CONFIG_ACPI if [ "$CONFIG_ACPI" = "y" ]; then + + define_bool CONFIG_ACPI_BOOT y + if [ "$CONFIG_SMP" = "y" ]; then bool 'CPU Enumeration Only' CONFIG_ACPI_HT_ONLY else @@ -15,7 +18,6 @@ fi if [ "$CONFIG_ACPI_HT_ONLY" = "n" ]; then - define_bool CONFIG_ACPI_BOOT y define_bool CONFIG_ACPI_BUS y define_bool CONFIG_ACPI_INTERPRETER y define_bool CONFIG_ACPI_EC y diff -urN linux-2.4.22-bk22/drivers/acpi/pci_link.c linux-2.4.22-bk23/drivers/acpi/pci_link.c --- linux-2.4.22-bk22/drivers/acpi/pci_link.c 2003-09-22 03:13:42.000000000 -0700 +++ linux-2.4.22-bk23/drivers/acpi/pci_link.c 2003-09-22 03:14:47.000000000 -0700 @@ -559,10 +559,9 @@ return_VALUE(0); } - if (acpi_pci_link_allocate(link)) { - return -ENODEV; - } - + if (acpi_pci_link_allocate(link)) + return_VALUE(0); + if (!link->irq.active) { ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Link disabled\n")); return_VALUE(0); diff -urN linux-2.4.22-bk22/drivers/acpi/tables.c linux-2.4.22-bk23/drivers/acpi/tables.c --- linux-2.4.22-bk22/drivers/acpi/tables.c 2003-08-25 04:44:41.000000000 -0700 +++ linux-2.4.22-bk23/drivers/acpi/tables.c 2003-09-22 03:14:47.000000000 -0700 @@ -69,7 +69,8 @@ static unsigned long sdt_pa; /* Physical Address */ static unsigned long sdt_count; /* Table count */ -static struct acpi_table_sdt *sdt_entry; + +static struct acpi_table_sdt sdt_entry[ACPI_MAX_TABLES]; void acpi_table_print ( @@ -418,12 +419,6 @@ sdt_count = ACPI_MAX_TABLES; } - sdt_entry = alloc_bootmem(sdt_count * sizeof(struct acpi_table_sdt)); - if (!sdt_entry) { - printk(KERN_ERR "ACPI: Could not allocate mem for SDT entries!\n"); - return -ENOMEM; - } - for (i = 0; i < sdt_count; i++) sdt_entry[i].pa = (unsigned long) mapped_xsdt->entry[i]; } @@ -470,12 +465,6 @@ sdt_count = ACPI_MAX_TABLES; } - sdt_entry = alloc_bootmem(sdt_count * sizeof(struct acpi_table_sdt)); - if (!sdt_entry) { - printk(KERN_ERR "ACPI: Could not allocate mem for SDT entries!\n"); - return -ENOMEM; - } - for (i = 0; i < sdt_count; i++) sdt_entry[i].pa = (unsigned long) mapped_rsdt->entry[i]; } diff -urN linux-2.4.22-bk22/drivers/net/bonding/bond_main.c linux-2.4.22-bk23/drivers/net/bonding/bond_main.c --- linux-2.4.22-bk22/drivers/net/bonding/bond_main.c 2003-09-22 03:14:07.000000000 -0700 +++ linux-2.4.22-bk23/drivers/net/bonding/bond_main.c 2003-09-22 03:15:08.000000000 -0700 @@ -420,6 +420,12 @@ * HW address and MTU with proper unwind; Consolidate procfs code, * add CHANGENAME handler; Enhance netdev notification handling. * Version to 2.4.0. + * + * 2003/09/15 - Stephen Hemminger , + * Amir Noam + * - Convert /proc to seq_file interface. + * Change /proc/net/bondX/info to /proc/net/bonding/bondX. + * Set version to 2.4.1. */ #include @@ -453,6 +459,8 @@ #include #include #include +#include +#include #include #include @@ -464,8 +472,8 @@ #include "bond_3ad.h" #include "bond_alb.h" -#define DRV_VERSION "2.4.0" -#define DRV_RELDATE "August 7, 2003" +#define DRV_VERSION "2.4.1" +#define DRV_RELDATE "September 15, 2003" #define DRV_NAME "bonding" #define DRV_DESCRIPTION "Ethernet Channel Bonding Driver" @@ -553,6 +561,9 @@ }; static LIST_HEAD(bond_dev_list); +#ifdef CONFIG_PROC_FS +static struct proc_dir_entry *bond_proc_dir = NULL; +#endif MODULE_PARM(max_bonds, "i"); MODULE_PARM_DESC(max_bonds, "Max number of bonded devices"); @@ -980,8 +991,6 @@ add_timer(alb_timer); } - MOD_INC_USE_COUNT; - if (miimon > 0) { /* link check interval, in milliseconds. */ init_timer(timer); timer->expires = jiffies + (miimon * HZ / 1000); @@ -1055,7 +1064,6 @@ bond_alb_deinitialize(bond); } - MOD_DEC_USE_COUNT; return 0; } @@ -3351,172 +3359,218 @@ } #ifdef CONFIG_PROC_FS -static int bond_read_proc(char *buf, char **start, off_t off, int count, int *eof, void *data) + +#define SEQ_START_TOKEN ((void *)1) + +static void *bond_info_seq_start(struct seq_file *seq, loff_t *pos) { - struct bonding *bond = (struct bonding *) data; - int len = 0; - u16 link; - slave_t *slave = NULL; + struct bonding *bond = seq->private; + loff_t off = 0; + struct slave *slave; /* make sure the bond won't be taken away */ read_lock(&dev_base_lock); + read_lock_bh(&bond->lock); - len += sprintf(buf + len, "%s\n", version); + if (*pos == 0) { + return SEQ_START_TOKEN; + } - /* - * This function locks the mutex, so we can't lock it until - * afterwards - */ - link = bond_check_mii_link(bond); + for (slave = bond->prev; slave != (slave_t *)bond; + slave = slave->prev) { + + if (++off == *pos) { + return slave; + } + } + + return NULL; +} - len += sprintf(buf + len, "Bonding Mode: %s\n", - bond_mode_name()); +static void *bond_info_seq_next(struct seq_file *seq, void *v, loff_t *pos) +{ + struct bonding *bond = seq->private; + struct slave *slave = v; + + ++*pos; + if (v == SEQ_START_TOKEN) { + slave = bond->prev; + } else { + slave = slave->prev; + } + + return (slave == (struct slave *) bond) ? NULL : slave; +} + +static void bond_info_seq_stop(struct seq_file *seq, void *v) +{ + struct bonding *bond = seq->private; + + read_unlock_bh(&bond->lock); + read_unlock(&dev_base_lock); +} + +static void bond_info_show_master(struct seq_file *seq, struct bonding *bond) +{ + struct slave *curr; + + read_lock(&bond->ptrlock); + curr = bond->current_slave; + read_unlock(&bond->ptrlock); + + seq_printf(seq, "Bonding Mode: %s\n", bond_mode_name()); if (USES_PRIMARY(bond_mode)) { - read_lock_bh(&bond->lock); - read_lock(&bond->ptrlock); - if (bond->current_slave != NULL) { - len += sprintf(buf + len, - "Currently Active Slave: %s\n", - bond->current_slave->dev->name); + if (curr) { + seq_printf(seq, + "Currently Active Slave: %s\n", + curr->dev->name); } - read_unlock(&bond->ptrlock); - read_unlock_bh(&bond->lock); } - len += sprintf(buf + len, "MII Status: "); - len += sprintf(buf + len, - link == BMSR_LSTATUS ? "up\n" : "down\n"); - len += sprintf(buf + len, "MII Polling Interval (ms): %d\n", - miimon); - len += sprintf(buf + len, "Up Delay (ms): %d\n", - updelay * miimon); - len += sprintf(buf + len, "Down Delay (ms): %d\n", - downdelay * miimon); - len += sprintf(buf + len, "Multicast Mode: %s\n", - multicast_mode_name()); - - read_lock_bh(&bond->lock); + seq_printf(seq, "MII Status: %s\n", (curr) ? "up" : "down"); + seq_printf(seq, "MII Polling Interval (ms): %d\n", miimon); + seq_printf(seq, "Up Delay (ms): %d\n", updelay * miimon); + seq_printf(seq, "Down Delay (ms): %d\n", downdelay * miimon); + seq_printf(seq, "Multicast Mode: %s\n", multicast_mode_name()); if (bond_mode == BOND_MODE_8023AD) { struct ad_info ad_info; - len += sprintf(buf + len, "\n802.3ad info\n"); + seq_puts(seq, "\n802.3ad info\n"); if (bond_3ad_get_active_agg_info(bond, &ad_info)) { - len += sprintf(buf + len, "bond %s has no active aggregator\n", bond->device->name); + seq_printf(seq, "bond %s has no active aggregator\n", + bond->device->name); } else { - len += sprintf(buf + len, "Active Aggregator Info:\n"); + seq_printf(seq, "Active Aggregator Info:\n"); - len += sprintf(buf + len, "\tAggregator ID: %d\n", ad_info.aggregator_id); - len += sprintf(buf + len, "\tNumber of ports: %d\n", ad_info.ports); - len += sprintf(buf + len, "\tActor Key: %d\n", ad_info.actor_key); - len += sprintf(buf + len, "\tPartner Key: %d\n", ad_info.partner_key); - len += sprintf(buf + len, "\tPartner Mac Address: %02x:%02x:%02x:%02x:%02x:%02x\n", - ad_info.partner_system[0], - ad_info.partner_system[1], - ad_info.partner_system[2], - ad_info.partner_system[3], - ad_info.partner_system[4], - ad_info.partner_system[5]); + seq_printf(seq, "\tAggregator ID: %d\n", + ad_info.aggregator_id); + seq_printf(seq, "\tNumber of ports: %d\n", + ad_info.ports); + seq_printf(seq, "\tActor Key: %d\n", + ad_info.actor_key); + seq_printf(seq, "\tPartner Key: %d\n", + ad_info.partner_key); + seq_printf(seq, "\tPartner Mac Address: %02x:%02x:%02x:%02x:%02x:%02x\n", + ad_info.partner_system[0], + ad_info.partner_system[1], + ad_info.partner_system[2], + ad_info.partner_system[3], + ad_info.partner_system[4], + ad_info.partner_system[5]); } } +} - for (slave = bond->prev; slave != (slave_t *)bond; - slave = slave->prev) { - len += sprintf(buf + len, "\nSlave Interface: %s\n", slave->dev->name); - - len += sprintf(buf + len, "MII Status: "); - - len += sprintf(buf + len, - slave->link == BOND_LINK_UP ? - "up\n" : "down\n"); - len += sprintf(buf + len, "Link Failure Count: %d\n", - slave->link_failure_count); +static void bond_info_show_slave(struct seq_file *seq, const struct slave *slave) +{ + seq_printf(seq, "\nSlave Interface: %s\n", slave->dev->name); + seq_printf(seq, "MII Status: %s\n", + (slave->link == BOND_LINK_UP) ? "up" : "down"); + seq_printf(seq, "Link Failure Count: %d\n", + slave->link_failure_count); - if (app_abi_ver >= 1) { - len += sprintf(buf + len, - "Permanent HW addr: %02x:%02x:%02x:%02x:%02x:%02x\n", - slave->perm_hwaddr[0], - slave->perm_hwaddr[1], - slave->perm_hwaddr[2], - slave->perm_hwaddr[3], - slave->perm_hwaddr[4], - slave->perm_hwaddr[5]); - } + if (app_abi_ver >= 1) { + seq_printf(seq, + "Permanent HW addr: %02x:%02x:%02x:%02x:%02x:%02x\n", + slave->perm_hwaddr[0], + slave->perm_hwaddr[1], + slave->perm_hwaddr[2], + slave->perm_hwaddr[3], + slave->perm_hwaddr[4], + slave->perm_hwaddr[5]); + } - if (bond_mode == BOND_MODE_8023AD) { - struct aggregator *agg = SLAVE_AD_INFO(slave).port.aggregator; + if (bond_mode == BOND_MODE_8023AD) { + const struct aggregator *agg + = SLAVE_AD_INFO(slave).port.aggregator; - if (agg) { - len += sprintf(buf + len, "Aggregator ID: %d\n", - agg->aggregator_identifier); - } else { - len += sprintf(buf + len, "Aggregator ID: N/A\n"); - } + if (agg) { + seq_printf(seq, "Aggregator ID: %d\n", + agg->aggregator_identifier); + } else { + seq_puts(seq, "Aggregator ID: N/A\n"); } } - read_unlock_bh(&bond->lock); +} - /* - * Figure out the calcs for the /proc/net interface - */ - if (len <= off + count) { - *eof = 1; - } - *start = buf + off; - len -= off; - if (len > count) { - len = count; - } - if (len < 0) { - len = 0; +static int bond_info_seq_show(struct seq_file *seq, void *v) +{ + if (v == SEQ_START_TOKEN) { + seq_printf(seq, "%s\n", version); + bond_info_show_master(seq, seq->private); + } else { + bond_info_show_slave(seq, v); } - read_unlock(&dev_base_lock); - - return len; + return 0; } -#endif /* CONFIG_PROC_FS */ + +static struct seq_operations bond_info_seq_ops = { + .start = bond_info_seq_start, + .next = bond_info_seq_next, + .stop = bond_info_seq_stop, + .show = bond_info_seq_show, +}; + +static int bond_info_open(struct inode *inode, struct file *file) +{ + struct seq_file *seq; + struct proc_dir_entry *proc; + int rc; + + rc = seq_open(file, &bond_info_seq_ops); + if (!rc) { + /* recover the pointer buried in proc_dir_entry data */ + seq = file->private_data; + proc = PDE(inode); + seq->private = proc->data; + } + return rc; +} + +static struct file_operations bond_info_fops = { + .owner = THIS_MODULE, + .open = bond_info_open, + .read = seq_read, + .llseek = seq_lseek, + .release = seq_release, +}; static int bond_create_proc_info(struct bonding *bond) { -#ifdef CONFIG_PROC_FS struct net_device *dev = bond->device; - bond->bond_proc_dir = proc_mkdir(dev->name, proc_net); - if (bond->bond_proc_dir == NULL) { - printk(KERN_ERR "%s: Cannot init /proc/net/%s/\n", - dev->name, dev->name); - return -ENOMEM; - } - bond->bond_proc_dir->owner = THIS_MODULE; - - bond->bond_proc_info_file = - create_proc_read_entry("info", 0, bond->bond_proc_dir, - bond_read_proc, bond); - if (bond->bond_proc_info_file == NULL) { - printk(KERN_ERR "%s: Cannot init /proc/net/%s/info\n", - dev->name, dev->name); - remove_proc_entry(dev->name, proc_net); - return -ENOMEM; + if (bond_proc_dir) { + bond->bond_proc_file = create_proc_entry(dev->name, + S_IRUGO, + bond_proc_dir); + if (bond->bond_proc_file == NULL) { + printk(KERN_WARNING + "%s: Cannot create /proc/net/bonding/%s\n", + dev->name, dev->name); + } else { + bond->bond_proc_file->data = bond; + bond->bond_proc_file->proc_fops = &bond_info_fops; + bond->bond_proc_file->owner = THIS_MODULE; + memcpy(bond->procdir_name, dev->name, IFNAMSIZ); + } } - bond->bond_proc_info_file->owner = THIS_MODULE; - memcpy(bond->procdir_name, dev->name, IFNAMSIZ); -#endif /* CONFIG_PROC_FS */ return 0; } static void bond_destroy_proc_info(struct bonding *bond) { -#ifdef CONFIG_PROC_FS - remove_proc_entry("info", bond->bond_proc_dir); - remove_proc_entry(bond->procdir_name, proc_net); - memset(bond->procdir_name, 0, IFNAMSIZ); - bond->bond_proc_dir = NULL; -#endif /* CONFIG_PROC_FS */ + if (bond_proc_dir && bond->bond_proc_file) { + remove_proc_entry(bond->procdir_name, bond_proc_dir); + memset(bond->procdir_name, 0, IFNAMSIZ); + bond->bond_proc_file = NULL; + } } +#endif /* CONFIG_PROC_FS */ /* * Change HW address @@ -3648,13 +3702,11 @@ */ static inline int bond_event_changename(struct bonding *bond) { - int error; - +#ifdef CONFIG_PROC_FS bond_destroy_proc_info(bond); - error = bond_create_proc_info(bond); - if (error) { - return NOTIFY_BAD; - } + bond_create_proc_info(bond); +#endif + return NOTIFY_DONE; } @@ -3770,16 +3822,18 @@ } static struct notifier_block bond_netdev_notifier = { - notifier_call: bond_netdev_event, + .notifier_call = bond_netdev_event, }; -static void bond_deinit(struct net_device *dev) +static inline void bond_deinit(struct net_device *dev) { struct bonding *bond = dev->priv; list_del(&bond->bond_list); +#ifdef CONFIG_PROC_FS bond_destroy_proc_info(bond); +#endif } static void bond_free_all(void) @@ -3791,8 +3845,15 @@ unregister_netdev(dev); bond_deinit(dev); - kfree(dev); + free_netdev(dev); } + +#ifdef CONFIG_PROC_FS + if (bond_proc_dir) { + remove_proc_entry(DRV_NAME, proc_net); + bond_proc_dir = NULL; + } +#endif } /* @@ -3803,7 +3864,6 @@ { struct bonding *bond; int count; - int err = 0; #ifdef BONDING_DEBUG printk (KERN_INFO "Begin bond_init for %s\n", dev->name); @@ -3881,27 +3941,14 @@ } else { printk("out ARP monitoring\n"); } - - err = bond_create_proc_info(bond); - if (err) { - printk(KERN_ERR "%s: Failed to create proc entry\n", - dev->name); - return err; - } - - /* Future: - * If anything fails beyond this point - * make sure to destroy the proc entry - */ + +#ifdef CONFIG_PROC_FS + bond_create_proc_info(bond); +#endif list_add_tail(&bond->bond_list, &bond_dev_list); return 0; -/* -err_out: - bond_destroy_proc_info(bond); - return err; -*/ } /* @@ -4183,6 +4230,16 @@ primary = NULL; } +#ifdef CONFIG_PROC_FS + bond_proc_dir = proc_mkdir(DRV_NAME, proc_net); + if (bond_proc_dir == NULL) { + printk(KERN_WARNING + "bonding_init(): can not create /proc/net/" DRV_NAME); + } else { + bond_proc_dir->owner = THIS_MODULE; + } +#endif + rtnl_lock(); err = 0; @@ -4197,7 +4254,7 @@ err = dev_alloc_name(dev, "bond%d"); if (err < 0) { - kfree(dev); + free_netdev(dev); goto out_err; } @@ -4207,7 +4264,7 @@ */ err = bond_init(dev); if (err < 0) { - kfree(dev); + free_netdev(dev); goto out_err; } @@ -4216,7 +4273,7 @@ err = register_netdevice(dev); if (err < 0) { bond_deinit(dev); - kfree(dev); + free_netdev(dev); goto out_err; } } diff -urN linux-2.4.22-bk22/drivers/net/bonding/bonding.h linux-2.4.22-bk23/drivers/net/bonding/bonding.h --- linux-2.4.22-bk22/drivers/net/bonding/bonding.h 2003-09-22 03:14:07.000000000 -0700 +++ linux-2.4.22-bk23/drivers/net/bonding/bonding.h 2003-09-22 03:15:08.000000000 -0700 @@ -101,8 +101,7 @@ struct timer_list arp_timer; struct net_device_stats stats; #ifdef CONFIG_PROC_FS - struct proc_dir_entry *bond_proc_dir; - struct proc_dir_entry *bond_proc_info_file; + struct proc_dir_entry *bond_proc_file; char procdir_name[IFNAMSIZ]; #endif /* CONFIG_PROC_FS */ struct list_head bond_list; diff -urN linux-2.4.22-bk22/drivers/net/wireless/airo.c linux-2.4.22-bk23/drivers/net/wireless/airo.c --- linux-2.4.22-bk22/drivers/net/wireless/airo.c 2003-09-22 03:14:14.000000000 -0700 +++ linux-2.4.22-bk23/drivers/net/wireless/airo.c 2003-09-22 03:15:09.000000000 -0700 @@ -1440,7 +1440,7 @@ int i,j; u32 counter; - u8 *cipher; + u8 *cipher, plain[16]; struct scatterlist sg[1]; crypto_cipher_setkey(tfm, pkey, 16); @@ -1451,8 +1451,9 @@ aes_counter[13] = (u8)(counter >> 16); aes_counter[12] = (u8)(counter >> 24); counter++; - sg[0].page = virt_to_page(aes_counter); - sg[0].offset = ((long) aes_counter & ~PAGE_MASK); + memcpy (plain, aes_counter, 16); + sg[0].page = virt_to_page(plain); + sg[0].offset = ((long) plain & ~PAGE_MASK); sg[0].length = 16; crypto_cipher_encrypt(tfm, sg, sg, 16); cipher = kmap(sg[0].page) + sg[0].offset; diff -urN linux-2.4.22-bk22/drivers/sound/forte.c linux-2.4.22-bk23/drivers/sound/forte.c --- linux-2.4.22-bk22/drivers/sound/forte.c 2003-08-25 04:44:42.000000000 -0700 +++ linux-2.4.22-bk23/drivers/sound/forte.c 2003-09-22 03:15:10.000000000 -0700 @@ -50,7 +50,7 @@ #include #define DRIVER_NAME "forte" -#define DRIVER_VERSION "$Id: forte.c,v 1.63 2003/03/01 05:32:42 mkp Exp $" +#define DRIVER_VERSION "$Id: forte.c,v 1.65 2003/09/18 15:28:39 mkp Exp $" #define PFX DRIVER_NAME ": " #undef M_DEBUG @@ -157,7 +157,6 @@ void *buf; /* Buffer */ dma_addr_t buf_handle; /* Buffer handle */ - unsigned int record; unsigned int format; unsigned int rate; unsigned int stereo; @@ -367,11 +366,11 @@ static struct file_operations forte_mixer_fops = { - owner: THIS_MODULE, - llseek: no_llseek, - ioctl: forte_mixer_ioctl, - open: forte_mixer_open, - release: forte_mixer_release, + .owner = THIS_MODULE, + .llseek = no_llseek, + .ioctl = forte_mixer_ioctl, + .open = forte_mixer_open, + .release = forte_mixer_release, }; @@ -665,14 +664,14 @@ * Locking: Lock held. */ -static void +static int forte_channel_prep (struct forte_channel *channel) { struct page *page; int i; if (channel->buf) - return; + return 0; forte_channel_buffer (channel, channel->frag_sz, channel->frag_num); channel->buf_pages = channel->buf_sz >> PAGE_SHIFT; @@ -690,7 +689,7 @@ &channel->buf_handle); if (!channel->buf || !channel->buf_handle) - BUG(); + return -ENOMEM; page = virt_to_page (channel->buf); @@ -709,6 +708,8 @@ DPRINTK ("%s: %s buffer @ %p (%p)\n", __FUNCTION__, channel->name, channel->buf, channel->buf_handle); + + return 0; } @@ -789,7 +790,6 @@ else if (channel == &chip->rec) { channel->name = "PCM_IN"; channel->iobase = chip->iobase + FORTE_CAP_OFFSET; - channel->record = 1; DPRINTK ("%s: PCM-IN iobase @ %p\n", __FUNCTION__, (void *) channel->iobase); } @@ -800,12 +800,15 @@ /* Defaults: 48kHz, 16-bit, stereo */ channel->ctrl = inw (channel->iobase + FORTE_PLY_CTRL); + + channel->frag_sz = FORTE_DEF_FRAG_SIZE; + channel->frag_num = FORTE_DEF_FRAGMENTS; + channel->frag_msecs = 0; + forte_channel_reset (channel); forte_channel_stereo (channel, 1); forte_channel_format (channel, AFMT_S16_LE); forte_channel_rate (channel, 48000); - channel->frag_sz = FORTE_DEF_FRAG_SIZE; - channel->frag_num = FORTE_DEF_FRAGMENTS; chip->trigger = 0; spin_unlock_irq (&chip->lock); @@ -828,6 +831,9 @@ static void forte_channel_free (struct forte_chip *chip, struct forte_channel *channel) { + struct page *page; + int i; + DPRINTK ("%s: %s\n", __FUNCTION__, channel->name); if (!channel->buf_handle) @@ -835,7 +841,12 @@ pci_free_consistent (chip->pci_dev, channel->buf_pages * PAGE_SIZE, channel->buf, channel->buf_handle); - + + page = virt_to_page (channel->buf); + + for (i = 0; i < channel->buf_pages ; i++) + mem_map_unreserve (page++); + memset (channel, 0x0, sizeof (*channel)); } @@ -1071,7 +1082,7 @@ spin_unlock_irq (&chip->lock); - return copy_to_user ((void *) arg, &abi, sizeof (abi)); + return copy_to_user ((void *) arg, &abi, sizeof (abi)) ? -EFAULT : 0; case SNDCTL_DSP_GETIPTR: DPRINTK ("%s: GETIPTR\n", __FUNCTION__); @@ -1092,7 +1103,7 @@ spin_unlock_irq (&chip->lock); - return copy_to_user ((void *) arg, &cinfo, sizeof (cinfo)); + return copy_to_user ((void *) arg, &cinfo, sizeof (cinfo)) ? -EFAULT : 0; case SNDCTL_DSP_GETOSPACE: if (!wr) @@ -1120,7 +1131,7 @@ spin_unlock_irq (&chip->lock); - return copy_to_user ((void *) arg, &abi, sizeof (abi)); + return copy_to_user ((void *) arg, &abi, sizeof (abi)) ? -EFAULT : 0; case SNDCTL_DSP_GETOPTR: if (!wr) @@ -1139,7 +1150,7 @@ spin_unlock_irq (&chip->lock); - return copy_to_user ((void *) arg, &cinfo, sizeof (cinfo)); + return copy_to_user ((void *) arg, &cinfo, sizeof (cinfo)) ? -EFAULT : 0; case SNDCTL_DSP_GETODELAY: if (!wr) @@ -1189,7 +1200,12 @@ forte_channel_start (&chip->play); else { chip->trigger = 1; - forte_channel_prep (&chip->play); + + if (forte_channel_prep (&chip->play)) { + spin_unlock_irq (&chip->lock); + return -ENOMEM; + } + forte_channel_stop (&chip->play); } @@ -1202,7 +1218,12 @@ forte_channel_start (&chip->rec); else { chip->trigger = 1; - forte_channel_prep (&chip->rec); + + if (forte_channel_prep (&chip->rec)) { + spin_unlock_irq (&chip->lock); + return -ENOMEM; + } + forte_channel_stop (&chip->rec); } @@ -1397,7 +1418,11 @@ goto out; } - forte_channel_prep (channel); + if (forte_channel_prep (channel)) { + ret = -ENOMEM; + goto out; + } + channel->mapped = 1; if (vma->vm_pgoff != 0) { @@ -1461,7 +1486,10 @@ spin_lock_irqsave (&chip->lock, flags); /* Set up buffers with the right fragment size */ - forte_channel_prep (channel); + if (forte_channel_prep (channel)) { + spin_unlock_irqrestore (&chip->lock, flags); + return -ENOMEM; + } while (i) { /* All fragment buffers in use -> wait */ @@ -1569,7 +1597,10 @@ spin_lock_irqsave (&chip->lock, flags); /* Set up buffers with the right fragment size */ - forte_channel_prep (channel); + if (forte_channel_prep (channel)) { + spin_unlock_irqrestore (&chip->lock, flags); + return -ENOMEM; + } /* Start recording */ if (!chip->trigger) @@ -1637,15 +1668,15 @@ static struct file_operations forte_dsp_fops = { - owner: THIS_MODULE, - llseek: &no_llseek, - read: &forte_dsp_read, - write: &forte_dsp_write, - poll: &forte_dsp_poll, - ioctl: &forte_dsp_ioctl, - open: &forte_dsp_open, - release: &forte_dsp_release, - mmap: &forte_dsp_mmap, + .owner = THIS_MODULE, + .llseek = &no_llseek, + .read = &forte_dsp_read, + .write = &forte_dsp_write, + .poll = &forte_dsp_poll, + .ioctl = &forte_dsp_ioctl, + .open = &forte_dsp_open, + .release = &forte_dsp_release, + .mmap = &forte_dsp_mmap, }; @@ -2104,11 +2135,10 @@ static struct pci_driver forte_pci_driver = { - name: DRIVER_NAME, - id_table: forte_pci_ids, - probe: forte_probe, - remove: forte_remove, - + .name = DRIVER_NAME, + .id_table = forte_pci_ids, + .probe = forte_probe, + .remove = forte_remove, }; diff -urN linux-2.4.22-bk22/drivers/sound/i810_audio.c linux-2.4.22-bk23/drivers/sound/i810_audio.c --- linux-2.4.22-bk22/drivers/sound/i810_audio.c 2003-09-22 03:14:19.000000000 -0700 +++ linux-2.4.22-bk23/drivers/sound/i810_audio.c 2003-09-22 03:15:10.000000000 -0700 @@ -72,17 +72,16 @@ * * ICH 4 caveats * - * The ICH4 has the feature, that the codec ID doesn't have to be - * congruent with the IO connection. + * The ICH4 has the feature, that the codec ID doesn't have to be + * congruent with the IO connection. * - * Therefore, from driver version 0.23 on, there is a "codec ID" <-> - * "IO register base offset" mapping (card->ac97_id_map) field. + * Therefore, from driver version 0.23 on, there is a "codec ID" <-> + * "IO register base offset" mapping (card->ac97_id_map) field. * - * Juergen "George" Sawinski (jsaw) + * Juergen "George" Sawinski (jsaw) */ #include -#include #include #include #include @@ -92,6 +91,7 @@ #include #include #include +#include #include #include #include @@ -99,7 +99,6 @@ #include #include #include -#include #include #include @@ -143,10 +142,10 @@ #define PCI_DEVICE_ID_AMD_8111_AC97 0x746d #endif -static int ftsodell=0; -static int strict_clocking=0; -static unsigned int clocking=0; -static int spdif_locked=0; +static int ftsodell; +static int strict_clocking; +static unsigned int clocking; +static int spdif_locked; //#define DEBUG //#define DEBUG2 @@ -182,7 +181,7 @@ struct i810_channel { /* these sg guys should probably be allocated - seperately as nocache. Must be 8 byte aligned */ + separately as nocache. Must be 8 byte aligned */ struct sg_item sg[SG_LEN]; /* 32*8 */ u32 offset; /* 4 */ u32 port; /* 4 */ @@ -191,7 +190,7 @@ }; /* - * we have 3 seperate dma engines. pcm in, pcm out, and mic. + * we have 3 separate dma engines. pcm in, pcm out, and mic. * each dma engine has controlling registers. These goofy * names are from the datasheet, but make it easy to write * code while leafing through it. @@ -317,7 +316,7 @@ /*@FIXME to be verified*/ { 3, 0x0001 }, /* AMD8111 */ }; -static struct pci_device_id i810_pci_tbl [] __initdata = { +static struct pci_device_id i810_pci_tbl [] = { {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ICH82801AA}, {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82901, @@ -880,7 +879,7 @@ #define DMABUF_DEFAULTORDER (16-PAGE_SHIFT) #define DMABUF_MINORDER 1 -/* allocate DMA buffer, playback and recording buffer should be allocated seperately */ +/* allocate DMA buffer, playback and recording buffer should be allocated separately */ static int alloc_dmabuf(struct i810_state *state) { struct dmabuf *dmabuf = &state->dmabuf; @@ -922,7 +921,7 @@ /* now mark the pages as reserved; otherwise remap_page_range doesn't do what we want */ pend = virt_to_page(rawbuf + (PAGE_SIZE << order) - 1); for (page = virt_to_page(rawbuf); page <= pend; page++) - mem_map_reserve(page); + SetPageReserved(page); return 0; } @@ -937,7 +936,7 @@ /* undo marking the pages as reserved */ pend = virt_to_page(dmabuf->rawbuf + (PAGE_SIZE << dmabuf->buforder) - 1); for (page = virt_to_page(dmabuf->rawbuf); page <= pend; page++) - mem_map_unreserve(page); + ClearPageReserved(page); pci_free_consistent(state->card->pci_dev, PAGE_SIZE << dmabuf->buforder, dmabuf->rawbuf, dmabuf->dma_handle); } @@ -1370,7 +1369,7 @@ #endif } -static void i810_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t i810_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct i810_card *card = (struct i810_card *)dev_id; u32 status; @@ -1382,7 +1381,7 @@ if(!(status & INT_MASK)) { spin_unlock(&card->lock); - return; /* not for us */ + return IRQ_NONE; /* not for us */ } if(status & (INT_PO|INT_PI|INT_MC)) @@ -1391,6 +1390,7 @@ /* clear 'em */ outl(status & INT_MASK, card->iobase + GLOB_STA); spin_unlock(&card->lock); + return IRQ_HANDLED; } /* in this loop, dmabuf.count signifies the amount of data that is @@ -1800,7 +1800,8 @@ } if (c != NULL) { outb(2, state->card->iobase+c->port+OFF_CR); /* reset DMA machine */ - while ( inb(state->card->iobase+c->port+OFF_CR) & 2 ); + while ( inb(state->card->iobase+c->port+OFF_CR) & 2 ) + cpu_relax(); outl((u32)state->card->chandma + c->num*sizeof(struct i810_channel), state->card->iobase+c->port+OFF_BDBAR); @@ -2386,9 +2387,9 @@ i810_set_dac_channels ( state, channels ); /* check that they really got turned on */ - if ( !state->card->ac97_status & SURR_ON ) + if (!(state->card->ac97_status & SURR_ON)) val &= ~DSP_BIND_SURR; - if ( !state->card->ac97_status & CENTER_LFE_ON ) + if (!(state->card->ac97_status & CENTER_LFE_ON)) val &= ~DSP_BIND_CENTER_LFE; } } @@ -2537,15 +2538,15 @@ } static /*const*/ struct file_operations i810_audio_fops = { - owner: THIS_MODULE, - llseek: no_llseek, - read: i810_read, - write: i810_write, - poll: i810_poll, - ioctl: i810_ioctl, - mmap: i810_mmap, - open: i810_open, - release: i810_release, + .owner = THIS_MODULE, + .llseek = no_llseek, + .read = i810_read, + .write = i810_write, + .poll = i810_poll, + .ioctl = i810_ioctl, + .mmap = i810_mmap, + .open = i810_open, + .release = i810_release, }; /* Write AC97 codec registers */ @@ -2682,10 +2683,10 @@ } static /*const*/ struct file_operations i810_mixer_fops = { - owner: THIS_MODULE, - llseek: no_llseek, - ioctl: i810_ioctl_mixdev, - open: i810_open_mixdev, + .owner = THIS_MODULE, + .llseek = no_llseek, + .ioctl = i810_ioctl_mixdev, + .open = i810_open_mixdev, }; /* AC97 codec initialisation. These small functions exist so we don't @@ -3250,7 +3251,6 @@ out_pio: release_region(card->iobase, 64); release_region(card->ac97base, 256); -out_chan: pci_free_consistent(pci_dev, sizeof(struct i810_channel)*NR_HW_CH, card->channel, card->chandma); out_mem: @@ -3423,22 +3423,19 @@ #define I810_MODULE_NAME "intel810_audio" static struct pci_driver i810_pci_driver = { - name: I810_MODULE_NAME, - id_table: i810_pci_tbl, - probe: i810_probe, - remove: __devexit_p(i810_remove), + .name = I810_MODULE_NAME, + .id_table = i810_pci_tbl, + .probe = i810_probe, + .remove = __devexit_p(i810_remove), #ifdef CONFIG_PM - suspend: i810_pm_suspend, - resume: i810_pm_resume, + .suspend = i810_pm_suspend, + .resume = i810_pm_resume, #endif /* CONFIG_PM */ }; static int __init i810_init_module (void) { - if (!pci_present()) /* No PCI bus in this machine! */ - return -ENODEV; - printk(KERN_INFO "Intel 810 + AC97 Audio, version " DRIVER_VERSION ", " __TIME__ " " __DATE__ "\n"); diff -urN linux-2.4.22-bk22/include/asm-i386/acpi.h linux-2.4.22-bk23/include/asm-i386/acpi.h --- linux-2.4.22-bk22/include/asm-i386/acpi.h 2003-08-25 04:44:43.000000000 -0700 +++ linux-2.4.22-bk23/include/asm-i386/acpi.h 2003-09-22 03:15:12.000000000 -0700 @@ -106,12 +106,6 @@ :"0"(n_hi), "1"(n_lo)) -#ifdef CONFIG_ACPI_HT_ONLY -extern int acpi_lapic; -#define acpi_ioapic 0 - -#else /* CONFIG_ACPI_HT_ONLY */ - #ifdef CONFIG_ACPI_BOOT extern int acpi_lapic; extern int acpi_ioapic; @@ -144,7 +138,6 @@ # define acpi_ioapic 0 #endif -#endif /* !CONFIG_ACPI_HT_ONLY */ #ifdef CONFIG_ACPI_SLEEP diff -urN linux-2.4.22-bk22/include/linux/acpi.h linux-2.4.22-bk23/include/linux/acpi.h --- linux-2.4.22-bk22/include/linux/acpi.h 2003-08-25 04:44:44.000000000 -0700 +++ linux-2.4.22-bk23/include/linux/acpi.h 2003-09-22 03:15:12.000000000 -0700 @@ -369,16 +369,10 @@ #else /*!CONFIG_ACPI_BOOT*/ -#ifdef CONFIG_ACPI_HT_ONLY -int acpi_boot_init (void); - -#else /* !CONFIG_ACPI_HT_ONLY */ - static inline int acpi_boot_init(void) { return 0; } -#endif /* !CONFIG_ACPI_HT_ONLY */ #endif /*!CONFIG_ACPI_BOOT*/ diff -urN linux-2.4.22-bk22/include/linux/netdevice.h linux-2.4.22-bk23/include/linux/netdevice.h --- linux-2.4.22-bk22/include/linux/netdevice.h 2003-09-22 03:14:29.000000000 -0700 +++ linux-2.4.22-bk23/include/linux/netdevice.h 2003-09-22 03:15:12.000000000 -0700 @@ -49,6 +49,7 @@ #define HAVE_ALLOC_NETDEV /* feature macro: alloc_xxxdev functions are available. */ +#define HAVE_FREE_NETDEV #define NET_XMIT_SUCCESS 0 #define NET_XMIT_DROP 1 /* skb dropped */ @@ -871,6 +872,10 @@ extern void dev_clear_fastroute(struct net_device *dev); #endif +static inline void free_netdev(struct net_device *dev) +{ + kfree(dev); +} #endif /* __KERNEL__ */ diff -urN linux-2.4.22-bk22/include/linux/proc_fs.h linux-2.4.22-bk23/include/linux/proc_fs.h --- linux-2.4.22-bk22/include/linux/proc_fs.h 2002-08-02 17:39:45.000000000 -0700 +++ linux-2.4.22-bk23/include/linux/proc_fs.h 2003-09-22 03:15:12.000000000 -0700 @@ -209,4 +209,9 @@ #endif /* CONFIG_PROC_FS */ +static inline struct proc_dir_entry *PDE(const struct inode *inode) +{ + return (struct proc_dir_entry *)inode->u.generic_ip; +} + #endif /* _LINUX_PROC_FS_H */ diff -urN linux-2.4.22-bk22/mm/page_alloc.c linux-2.4.22-bk23/mm/page_alloc.c --- linux-2.4.22-bk22/mm/page_alloc.c 2003-09-22 03:14:30.000000000 -0700 +++ linux-2.4.22-bk23/mm/page_alloc.c 2003-09-22 03:15:13.000000000 -0700 @@ -317,7 +317,7 @@ } current->nr_local_pages = 0; } - out: + *freed = __freed; return page; } diff -urN linux-2.4.22-bk22/mm/vmscan.c linux-2.4.22-bk23/mm/vmscan.c --- linux-2.4.22-bk22/mm/vmscan.c 2003-09-22 03:14:30.000000000 -0700 +++ linux-2.4.22-bk23/mm/vmscan.c 2003-09-22 03:15:13.000000000 -0700 @@ -401,6 +401,8 @@ if (!memclass(page_zone(page), classzone)) continue; + max_scan--; + /* Racy check to avoid trylocking when not worthwhile */ if (!page->buffers && (page_count(page) != 1 || !page->mapping)) goto page_mapped;