From 8897b28595cdaec7d22d1136259c8c17b66b61a4 Mon Sep 17 00:00:00 2001 From: Mark Maule Date: Mon, 25 Apr 2005 11:26:03 -0700 Subject: [PATCH] --- yaml --- r: 495 b: refs/heads/master c: e955d82543fea76b02aa243b182e782f71bda82c h: refs/heads/master i: 493: fa079feeb3d79cba0d59fd0b7a7bbbf8310441cd 491: dd9360e5061c595f24bb2943a747db7d65f6c311 487: 327cfeeec3deb64f20862270bc362210984bb676 479: 823b2309cb8cf5c4da33418746c1168d6e2480bf v: v3 --- [refs] | 2 +- trunk/arch/arm/kernel/Makefile | 5 + trunk/arch/arm/kernel/asm-offsets.c | 20 - trunk/arch/arm/kernel/entry-armv.S | 67 +-- trunk/arch/arm/kernel/entry-common.S | 65 +-- trunk/arch/arm/kernel/entry-header.S | 143 +++++- trunk/arch/arm/kernel/traps.c | 11 +- trunk/arch/arm/mach-pxa/sleep.S | 56 +-- .../arch/ia64/sn/include/pci/pcibr_provider.h | 6 +- .../sn/include/pci/pcibus_provider_defs.h | 12 +- trunk/arch/ia64/sn/include/pci/pcidev.h | 4 + trunk/arch/ia64/sn/kernel/io_init.c | 72 ++- trunk/arch/ia64/sn/pci/pci_dma.c | 35 +- trunk/arch/ia64/sn/pci/pcibr/pcibr_dma.c | 103 +++-- trunk/arch/ia64/sn/pci/pcibr/pcibr_provider.c | 20 + trunk/arch/ppc64/kernel/rtas_flash.c | 12 +- trunk/arch/ppc64/kernel/scanlog.c | 4 +- trunk/arch/ppc64/xmon/ppc-opc.c | 119 +++-- trunk/arch/x86_64/kernel/signal.c | 2 +- trunk/drivers/char/tpm/tpm.c | 6 +- trunk/drivers/i2c/busses/i2c-mpc.c | 4 +- trunk/drivers/net/tg3.c | 73 ++- trunk/drivers/net/wan/pc300_drv.c | 22 +- trunk/drivers/oprofile/oprofile_files.c | 4 +- trunk/drivers/scsi/esp.c | 6 +- trunk/drivers/scsi/pluto.c | 2 +- trunk/drivers/scsi/qla2xxx/qla_sup.c | 2 +- trunk/drivers/serial/21285.c | 2 +- trunk/drivers/serial/8250_hp300.c | 53 ++- trunk/drivers/serial/amba-pl010.c | 2 +- trunk/drivers/serial/amba-pl011.c | 2 +- trunk/drivers/serial/clps711x.c | 65 +-- trunk/drivers/serial/mpsc.c | 14 +- trunk/drivers/serial/mpsc.h | 10 +- trunk/drivers/serial/s3c2410.c | 2 +- trunk/drivers/serial/sa1100.c | 65 ++- trunk/drivers/serial/serial_lh7a40x.c | 2 +- trunk/drivers/usb/core/usb.c | 6 +- trunk/drivers/usb/image/microtek.c | 2 +- trunk/drivers/usb/input/ati_remote.c | 2 +- trunk/drivers/usb/input/usbkbd.c | 3 +- trunk/drivers/usb/media/pwc/pwc-ctrl.c | 78 ++-- trunk/drivers/usb/media/pwc/pwc-if.c | 6 +- trunk/drivers/usb/media/pwc/pwc.h | 6 +- trunk/drivers/usb/media/sn9c102_core.c | 4 +- trunk/drivers/usb/media/sn9c102_sensor.h | 2 + trunk/drivers/usb/misc/sisusbvga/sisusb.c | 3 +- trunk/drivers/usb/net/pegasus.c | 4 +- trunk/drivers/usb/net/usbnet.c | 429 +++++++----------- trunk/drivers/usb/net/zd1201.c | 20 +- trunk/drivers/usb/serial/Kconfig | 9 - trunk/drivers/usb/serial/Makefile | 1 - trunk/drivers/usb/serial/hp4x.c | 85 ---- trunk/drivers/usb/storage/unusual_devs.h | 22 +- trunk/drivers/video/imsttfb.c | 4 +- trunk/drivers/video/savage/savagefb_driver.c | 6 +- trunk/fs/isofs/compress.c | 21 +- trunk/fs/isofs/dir.c | 13 +- trunk/fs/isofs/export.c | 6 +- trunk/fs/isofs/inode.c | 19 +- trunk/fs/isofs/isofs.h | 190 -------- trunk/fs/isofs/joliet.c | 6 +- trunk/fs/isofs/namei.c | 13 +- trunk/fs/isofs/rock.c | 8 +- trunk/fs/isofs/util.c | 5 +- trunk/include/asm-arm/arch-s3c2410/regs-iis.h | 10 - trunk/include/asm-arm/arch-s3c2410/regs-mem.h | 8 - trunk/include/asm-arm/arch-s3c2410/regs-spi.h | 2 - .../include/asm-arm/arch-s3c2410/uncompress.h | 6 +- trunk/include/asm-arm/string.h | 17 +- trunk/include/linux/iso_fs.h | 147 ++++++ trunk/include/linux/iso_fs_i.h | 27 ++ trunk/include/linux/iso_fs_sb.h | 34 ++ trunk/net/bluetooth/af_bluetooth.c | 1 + trunk/net/bluetooth/bnep/sock.c | 1 + trunk/net/bluetooth/cmtp/capi.c | 1 + trunk/net/bluetooth/cmtp/core.c | 1 + trunk/net/bluetooth/cmtp/sock.c | 1 + trunk/net/bluetooth/hci_conn.c | 1 + trunk/net/bluetooth/hci_core.c | 1 + trunk/net/bluetooth/hci_event.c | 1 + trunk/net/bluetooth/hci_sock.c | 1 + trunk/net/bluetooth/hidp/core.c | 1 + trunk/net/bluetooth/hidp/sock.c | 1 + trunk/net/bluetooth/l2cap.c | 1 + trunk/net/bluetooth/rfcomm/sock.c | 1 + trunk/net/bluetooth/sco.c | 1 + trunk/net/core/rtnetlink.c | 1 + trunk/net/core/scm.c | 1 + trunk/net/core/sock.c | 1 + trunk/net/ipv4/af_inet.c | 1 + trunk/net/ipv4/ip_output.c | 2 - trunk/net/ipv4/netfilter/ip_conntrack_ftp.c | 4 +- .../ipv4/netfilter/ip_conntrack_standalone.c | 7 + trunk/net/ipv4/tcp_input.c | 1 + trunk/net/ipv6/af_inet6.c | 1 + trunk/net/netlink/af_netlink.c | 1 + trunk/net/sched/simple.c | 18 +- trunk/net/unix/af_unix.c | 1 + trunk/scripts/mod/file2alias.c | 111 +---- trunk/sound/ppc/Kconfig | 2 +- 101 files changed, 1210 insertions(+), 1274 deletions(-) delete mode 100644 trunk/drivers/usb/serial/hp4x.c delete mode 100644 trunk/fs/isofs/isofs.h create mode 100644 trunk/include/linux/iso_fs_i.h create mode 100644 trunk/include/linux/iso_fs_sb.h diff --git a/[refs] b/[refs] index d3b69885bc3e..2e32bb05c3d3 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e8108c98dd6d65613fa0ec9d2300f89c48d554bf +refs/heads/master: e955d82543fea76b02aa243b182e782f71bda82c diff --git a/trunk/arch/arm/kernel/Makefile b/trunk/arch/arm/kernel/Makefile index 4a2af55e134b..07a56ff61494 100644 --- a/trunk/arch/arm/kernel/Makefile +++ b/trunk/arch/arm/kernel/Makefile @@ -31,3 +31,8 @@ head-y := head.o obj-$(CONFIG_DEBUG_LL) += debug.o extra-y := $(head-y) init_task.o vmlinux.lds + +# Spell out some dependencies that aren't automatically figured out +$(obj)/entry-armv.o: $(obj)/entry-header.S include/asm-arm/constants.h +$(obj)/entry-common.o: $(obj)/entry-header.S include/asm-arm/constants.h \ + $(obj)/calls.S diff --git a/trunk/arch/arm/kernel/asm-offsets.c b/trunk/arch/arm/kernel/asm-offsets.c index c1ff4d1f1bfd..99d43259ff89 100644 --- a/trunk/arch/arm/kernel/asm-offsets.c +++ b/trunk/arch/arm/kernel/asm-offsets.c @@ -64,26 +64,6 @@ int main(void) DEFINE(TI_VFPSTATE, offsetof(struct thread_info, vfpstate)); DEFINE(TI_IWMMXT_STATE, (offsetof(struct thread_info, fpstate)+4)&~7); BLANK(); - DEFINE(S_R0, offsetof(struct pt_regs, ARM_r0)); - DEFINE(S_R1, offsetof(struct pt_regs, ARM_r1)); - DEFINE(S_R2, offsetof(struct pt_regs, ARM_r2)); - DEFINE(S_R3, offsetof(struct pt_regs, ARM_r3)); - DEFINE(S_R4, offsetof(struct pt_regs, ARM_r4)); - DEFINE(S_R5, offsetof(struct pt_regs, ARM_r5)); - DEFINE(S_R6, offsetof(struct pt_regs, ARM_r6)); - DEFINE(S_R7, offsetof(struct pt_regs, ARM_r7)); - DEFINE(S_R8, offsetof(struct pt_regs, ARM_r8)); - DEFINE(S_R9, offsetof(struct pt_regs, ARM_r9)); - DEFINE(S_R10, offsetof(struct pt_regs, ARM_r10)); - DEFINE(S_FP, offsetof(struct pt_regs, ARM_fp)); - DEFINE(S_IP, offsetof(struct pt_regs, ARM_ip)); - DEFINE(S_SP, offsetof(struct pt_regs, ARM_sp)); - DEFINE(S_LR, offsetof(struct pt_regs, ARM_lr)); - DEFINE(S_PC, offsetof(struct pt_regs, ARM_pc)); - DEFINE(S_PSR, offsetof(struct pt_regs, ARM_cpsr)); - DEFINE(S_OLD_R0, offsetof(struct pt_regs, ARM_ORIG_r0)); - DEFINE(S_FRAME_SIZE, sizeof(struct pt_regs)); - BLANK(); #if __LINUX_ARM_ARCH__ >= 6 DEFINE(MM_CONTEXT_ID, offsetof(struct mm_struct, context.id)); BLANK(); diff --git a/trunk/arch/arm/kernel/entry-armv.S b/trunk/arch/arm/kernel/entry-armv.S index 2a5c3fe09a95..bb27c317d94b 100644 --- a/trunk/arch/arm/kernel/entry-armv.S +++ b/trunk/arch/arm/kernel/entry-armv.S @@ -14,12 +14,12 @@ * it to save wrong values... Be aware! */ #include +#include +#include #include +#include #include -#include @ should be moved into entry-macro.S -#include @ should be moved into entry-macro.S -#include #include "entry-header.S" @@ -118,7 +118,7 @@ __dabt_svc: @ @ IRQs off again before pulling preserved data off the stack @ - disable_irq + disable_irq r0 @ @ restore SPSR and restart the instruction @@ -198,7 +198,7 @@ __und_svc: @ @ IRQs off again before pulling preserved data off the stack @ -1: disable_irq +1: disable_irq r0 @ @ restore SPSR and restart the instruction @@ -232,7 +232,7 @@ __pabt_svc: @ @ IRQs off again before pulling preserved data off the stack @ - disable_irq + disable_irq r0 @ @ restore SPSR and restart the instruction @@ -316,7 +316,7 @@ __dabt_usr: @ @ IRQs on, then call the main handler @ - enable_irq + enable_irq r2 mov r2, sp adr lr, ret_from_exception b do_DataAbort @@ -418,7 +418,7 @@ call_fpe: movcss r7, r5, lsr #(TIF_USING_IWMMXT + 1) bcs iwmmxt_task_enable #endif - enable_irq + enable_irq r7 add pc, pc, r8, lsr #6 mov r0, r0 @@ -472,7 +472,7 @@ fpundefinstr: __pabt_usr: usr_entry abt - enable_irq @ Enable interrupts + enable_irq r0 @ Enable interrupts mov r0, r2 @ address (pc) mov r1, sp @ regs bl do_PrefetchAbort @ call abort handler @@ -522,9 +522,8 @@ ENTRY(__switch_to) /* * Vector stubs. * - * This code is copied to 0xffff0200 so we can use branches in the - * vectors, rather than ldr's. Note that this code must not - * exceed 0x300 bytes. + * This code is copied to 0x200 or 0xffff0200 so we can use branches in the + * vectors, rather than ldr's. * * Common stub entry macro: * Enter in IRQ mode, spsr = SVC/USR CPSR, lr = SVC/USR PC @@ -545,7 +544,7 @@ vector_\name: @ mrs r13, cpsr bic r13, r13, #MODE_MASK - orr r13, r13, #SVC_MODE + orr r13, r13, #MODE_SVC msr spsr_cxsf, r13 @ switch to SVC_32 mode and lr, lr, #15 @@ -553,7 +552,6 @@ vector_\name: movs pc, lr @ Changes mode and branches .endm - .globl __stubs_start __stubs_start: /* * Interrupt dispatcher @@ -688,24 +686,37 @@ vector_addrexcptn: .LCsabt: .word __temp_abt - .globl __stubs_end __stubs_end: - .equ stubs_offset, __vectors_start + 0x200 - __stubs_start + .equ __real_stubs_start, .LCvectors + 0x200 - .globl __vectors_start -__vectors_start: +.LCvectors: swi SYS_ERROR0 - b vector_und + stubs_offset - ldr pc, .LCvswi + stubs_offset - b vector_pabt + stubs_offset - b vector_dabt + stubs_offset - b vector_addrexcptn + stubs_offset - b vector_irq + stubs_offset - b vector_fiq + stubs_offset - - .globl __vectors_end -__vectors_end: + b __real_stubs_start + (vector_und - __stubs_start) + ldr pc, __real_stubs_start + (.LCvswi - __stubs_start) + b __real_stubs_start + (vector_pabt - __stubs_start) + b __real_stubs_start + (vector_dabt - __stubs_start) + b __real_stubs_start + (vector_addrexcptn - __stubs_start) + b __real_stubs_start + (vector_irq - __stubs_start) + b __real_stubs_start + (vector_fiq - __stubs_start) + +ENTRY(__trap_init) + stmfd sp!, {r4 - r6, lr} + + mov r0, #0xff000000 + orr r0, r0, #0x00ff0000 @ high vectors position + adr r1, .LCvectors @ set up the vectors + ldmia r1, {r1, r2, r3, r4, r5, r6, ip, lr} + stmia r0, {r1, r2, r3, r4, r5, r6, ip, lr} + + add r2, r0, #0x200 + adr r0, __stubs_start @ copy stubs to 0x200 + adr r1, __stubs_end +1: ldr r3, [r0], #4 + str r3, [r2], #4 + cmp r0, r1 + blt 1b + LOADREGS(fd, sp!, {r4 - r6, pc}) .data diff --git a/trunk/arch/arm/kernel/entry-common.S b/trunk/arch/arm/kernel/entry-common.S index 3f8d0e3aefab..53a7e0dea44d 100644 --- a/trunk/arch/arm/kernel/entry-common.S +++ b/trunk/arch/arm/kernel/entry-common.S @@ -9,10 +9,19 @@ */ #include +#include +#include #include #include "entry-header.S" +/* + * We rely on the fact that R0 is at the bottom of the stack (due to + * slow/fast restore user regs). + */ +#if S_R0 != 0 +#error "Please fix" +#endif .align 5 /* @@ -21,19 +30,11 @@ * stack. */ ret_fast_syscall: - disable_irq @ disable interrupts + disable_irq r1 @ disable interrupts ldr r1, [tsk, #TI_FLAGS] tst r1, #_TIF_WORK_MASK bne fast_work_pending - - @ fast_restore_user_regs - ldr r1, [sp, #S_OFF + S_PSR] @ get calling cpsr - ldr lr, [sp, #S_OFF + S_PC]! @ get pc - msr spsr_cxsf, r1 @ save in spsr_svc - ldmdb sp, {r1 - lr}^ @ get calling r1 - lr - mov r0, r0 - add sp, sp, #S_FRAME_SIZE - S_PC - movs pc, lr @ return & move spsr_svc into cpsr + fast_restore_user_regs /* * Ok, we need to do extra processing, enter the slow path. @@ -48,7 +49,7 @@ work_pending: mov r0, sp @ 'regs' mov r2, why @ 'syscall' bl do_notify_resume - disable_irq @ disable interrupts + disable_irq r1 @ disable interrupts b no_work_pending work_resched: @@ -58,19 +59,12 @@ work_resched: */ ENTRY(ret_to_user) ret_slow_syscall: - disable_irq @ disable interrupts + disable_irq r1 @ disable interrupts ldr r1, [tsk, #TI_FLAGS] tst r1, #_TIF_WORK_MASK bne work_pending no_work_pending: - @ slow_restore_user_regs - ldr r1, [sp, #S_PSR] @ get calling cpsr - ldr lr, [sp, #S_PC]! @ get pc - msr spsr_cxsf, r1 @ save in spsr_svc - ldmdb sp, {r0 - lr}^ @ get calling r1 - lr - mov r0, r0 - add sp, sp, #S_FRAME_SIZE - S_PC - movs pc, lr @ return & move spsr_svc into cpsr + slow_restore_user_regs /* * This is how we return from a fork. @@ -122,26 +116,9 @@ ENTRY(ret_from_fork) .align 5 ENTRY(vector_swi) - sub sp, sp, #S_FRAME_SIZE - stmia sp, {r0 - r12} @ Calling r0 - r12 - add r8, sp, #S_PC - stmdb r8, {sp, lr}^ @ Calling sp, lr - mrs r8, spsr @ called from non-FIQ mode, so ok. - str lr, [sp, #S_PC] @ Save calling PC - str r8, [sp, #S_PSR] @ Save CPSR - str r0, [sp, #S_OLD_R0] @ Save OLD_R0 + save_user_regs zero_fp - - /* - * Get the system call number. - */ -#ifdef CONFIG_ARM_THUMB - tst r8, #PSR_T_BIT @ this is SPSR from save_user_regs - addne scno, r7, #__NR_SYSCALL_BASE @ put OS number in - ldreq scno, [lr, #-4] -#else - ldr scno, [lr, #-4] @ get SWI instruction -#endif + get_scno arm710_bug_check scno, ip #ifdef CONFIG_ALIGNMENT_TRAP @@ -149,14 +126,14 @@ ENTRY(vector_swi) ldr ip, [ip] mcr p15, 0, ip, c1, c0 @ update control register #endif - enable_irq + enable_irq ip str r4, [sp, #-S_OFF]! @ push fifth arg get_thread_info tsk ldr ip, [tsk, #TI_FLAGS] @ check for syscall tracing bic scno, scno, #0xff000000 @ mask off SWI op-code - eor scno, scno, #__NR_SYSCALL_BASE @ check OS number + eor scno, scno, #OS_NUMBER << 20 @ check OS number adr tbl, sys_call_table @ load syscall table pointer tst ip, #_TIF_SYSCALL_TRACE @ are we tracing syscalls? bne __sys_trace @@ -167,8 +144,8 @@ ENTRY(vector_swi) add r1, sp, #S_OFF 2: mov why, #0 @ no longer a real syscall - cmp scno, #(__ARM_NR_BASE - __NR_SYSCALL_BASE) - eor r0, scno, #__NR_SYSCALL_BASE @ put OS number back + cmp scno, #ARMSWI_OFFSET + eor r0, scno, #OS_NUMBER << 20 @ put OS number back bcs arm_syscall b sys_ni_syscall @ not private func @@ -213,7 +190,7 @@ ENTRY(sys_call_table) @ r5 = syscall table .type sys_syscall, #function sys_syscall: - eor scno, r0, #__NR_SYSCALL_BASE + eor scno, r0, #OS_NUMBER << 20 cmp scno, #__NR_syscall - __NR_SYSCALL_BASE cmpne scno, #NR_syscalls @ check range stmloia sp, {r5, r6} @ shuffle args diff --git a/trunk/arch/arm/kernel/entry-header.S b/trunk/arch/arm/kernel/entry-header.S index a3d40a0e2b04..4039d8c120b5 100644 --- a/trunk/arch/arm/kernel/entry-header.S +++ b/trunk/arch/arm/kernel/entry-header.S @@ -1,11 +1,24 @@ -#include -#include +#include /* for CONFIG_ARCH_xxxx */ #include #include #include #include -#include +#include +#include +#include + +#ifndef MODE_SVC +#define MODE_SVC 0x13 +#endif + + .macro zero_fp +#ifdef CONFIG_FRAME_POINTER + mov fp, #0 +#endif + .endm + + .text @ Bad Abort numbers @ ----------------- @@ -16,44 +29,113 @@ #define BAD_IRQ 3 #define BAD_UNDEFINSTR 4 +#define PT_TRACESYS 0x00000002 + +@ OS version number used in SWIs +@ RISC OS is 0 +@ RISC iX is 8 @ -@ Most of the stack format comes from struct pt_regs, but with -@ the addition of 8 bytes for storing syscall args 5 and 6. +#define OS_NUMBER 9 +#define ARMSWI_OFFSET 0x000f0000 + @ -#define S_OFF 8 +@ Stack format (ensured by USER_* and SVC_*) +@ +#define S_FRAME_SIZE 72 +#define S_OLD_R0 68 +#define S_PSR 64 -/* - * The SWI code relies on the fact that R0 is at the bottom of the stack - * (due to slow/fast restore user regs). - */ -#if S_R0 != 0 -#error "Please fix" -#endif +#define S_PC 60 +#define S_LR 56 +#define S_SP 52 +#define S_IP 48 +#define S_FP 44 +#define S_R10 40 +#define S_R9 36 +#define S_R8 32 +#define S_R7 28 +#define S_R6 24 +#define S_R5 20 +#define S_R4 16 +#define S_R3 12 +#define S_R2 8 +#define S_R1 4 +#define S_R0 0 +#define S_OFF 8 - .macro zero_fp -#ifdef CONFIG_FRAME_POINTER - mov fp, #0 -#endif + .macro set_cpsr_c, reg, mode + msr cpsr_c, \mode .endm #if __LINUX_ARM_ARCH__ >= 6 - .macro disable_irq + .macro disable_irq, temp cpsid i .endm - .macro enable_irq + .macro enable_irq, temp cpsie i .endm #else - .macro disable_irq - msr cpsr_c, #PSR_I_BIT | SVC_MODE + .macro disable_irq, temp + set_cpsr_c \temp, #PSR_I_BIT | MODE_SVC .endm - .macro enable_irq - msr cpsr_c, #SVC_MODE + .macro enable_irq, temp + set_cpsr_c \temp, #MODE_SVC .endm #endif + .macro save_user_regs + sub sp, sp, #S_FRAME_SIZE + stmia sp, {r0 - r12} @ Calling r0 - r12 + add r8, sp, #S_PC + stmdb r8, {sp, lr}^ @ Calling sp, lr + mrs r8, spsr @ called from non-FIQ mode, so ok. + str lr, [sp, #S_PC] @ Save calling PC + str r8, [sp, #S_PSR] @ Save CPSR + str r0, [sp, #S_OLD_R0] @ Save OLD_R0 + .endm + + .macro restore_user_regs + ldr r1, [sp, #S_PSR] @ Get calling cpsr + disable_irq ip @ disable IRQs + ldr lr, [sp, #S_PC]! @ Get PC + msr spsr_cxsf, r1 @ save in spsr_svc + ldmdb sp, {r0 - lr}^ @ Get calling r0 - lr + mov r0, r0 + add sp, sp, #S_FRAME_SIZE - S_PC + movs pc, lr @ return & move spsr_svc into cpsr + .endm + +/* + * Must be called with IRQs already disabled. + */ + .macro fast_restore_user_regs + ldr r1, [sp, #S_OFF + S_PSR] @ get calling cpsr + ldr lr, [sp, #S_OFF + S_PC]! @ get pc + msr spsr_cxsf, r1 @ save in spsr_svc + ldmdb sp, {r1 - lr}^ @ get calling r1 - lr + mov r0, r0 + add sp, sp, #S_FRAME_SIZE - S_PC + movs pc, lr @ return & move spsr_svc into cpsr + .endm + +/* + * Must be called with IRQs already disabled. + */ + .macro slow_restore_user_regs + ldr r1, [sp, #S_PSR] @ get calling cpsr + ldr lr, [sp, #S_PC]! @ get pc + msr spsr_cxsf, r1 @ save in spsr_svc + ldmdb sp, {r0 - lr}^ @ get calling r1 - lr + mov r0, r0 + add sp, sp, #S_FRAME_SIZE - S_PC + movs pc, lr @ return & move spsr_svc into cpsr + .endm + + .macro mask_pc, rd, rm + .endm + .macro get_thread_info, rd mov \rd, sp, lsr #13 mov \rd, \rd, lsl #13 @@ -83,3 +165,18 @@ scno .req r7 @ syscall number tbl .req r8 @ syscall table pointer why .req r8 @ Linux syscall (!= 0) tsk .req r9 @ current thread_info + +/* + * Get the system call number. + */ + .macro get_scno +#ifdef CONFIG_ARM_THUMB + tst r8, #PSR_T_BIT @ this is SPSR from save_user_regs + addne scno, r7, #OS_NUMBER << 20 @ put OS number in + ldreq scno, [lr, #-4] + +#else + mask_pc lr, lr + ldr scno, [lr, #-4] @ get SWI instruction +#endif + .endm diff --git a/trunk/arch/arm/kernel/traps.c b/trunk/arch/arm/kernel/traps.c index 0078aeb85737..6e31718f6008 100644 --- a/trunk/arch/arm/kernel/traps.c +++ b/trunk/arch/arm/kernel/traps.c @@ -578,16 +578,9 @@ EXPORT_SYMBOL(abort); void __init trap_init(void) { - extern char __stubs_start[], __stubs_end[]; - extern char __vectors_start[], __vectors_end[]; + extern void __trap_init(void); - /* - * Copy the vectors and stubs (in entry-armv.S) into the - * vector page, mapped at 0xffff0000, and ensure these are - * visible to the instruction stream. - */ - memcpy((void *)0xffff0000, __vectors_start, __vectors_end - __vectors_start); - memcpy((void *)0xffff0200, __stubs_start, __stubs_end - __stubs_start); + __trap_init(); flush_icache_range(0xffff0000, 0xffff0000 + PAGE_SIZE); modify_domain(DOMAIN_USER, DOMAIN_CLIENT); } diff --git a/trunk/arch/arm/mach-pxa/sleep.S b/trunk/arch/arm/mach-pxa/sleep.S index 5786ccad938c..16cad2c2497c 100644 --- a/trunk/arch/arm/mach-pxa/sleep.S +++ b/trunk/arch/arm/mach-pxa/sleep.S @@ -18,11 +18,6 @@ #include -#ifdef CONFIG_PXA27x // workaround for Errata 50 -#define MDREFR_KDIV 0x200a4000 // all banks -#define CCCR_SLEEP 0x00000107 // L=7 2N=2 A=0 PPDIS=0 CPDIS=0 -#endif - .text /* @@ -33,9 +28,7 @@ ENTRY(pxa_cpu_suspend) -#ifndef CONFIG_IWMMXT mra r2, r3, acc0 -#endif stmfd sp!, {r2 - r12, lr} @ save registers on stack @ get coprocessor registers @@ -68,23 +61,14 @@ ENTRY(pxa_cpu_suspend) @ prepare value for sleep mode mov r1, #3 @ sleep mode - @ prepare pointer to physical address 0 (virtual mapping in generic.c) - mov r2, #UNCACHED_PHYS_0 - - @ prepare SDRAM refresh settings + @ prepare to put SDRAM into self-refresh manually ldr r4, =MDREFR ldr r5, [r4] - - @ enable SDRAM self-refresh mode orr r5, r5, #MDREFR_SLFRSH -#ifdef CONFIG_PXA27x - @ set SDCLKx divide-by-2 bits (this is part of a workaround for Errata 50) - ldr r6, =MDREFR_KDIV - orr r5, r5, r6 -#endif + @ prepare pointer to physical address 0 (virtual mapping in generic.c) + mov r2, #UNCACHED_PHYS_0 -#ifdef CONFIG_PXA25x @ Intel PXA255 Specification Update notes problems @ about suspending with PXBus operating above 133MHz @ (see Errata 31, GPIO output signals, ... unpredictable in sleep @@ -116,18 +100,6 @@ ENTRY(pxa_cpu_suspend) mov r0, #0 mcr p14, 0, r0, c6, c0, 0 orr r0, r0, #2 @ initiate change bit -#endif -#ifdef CONFIG_PXA27x - @ Intel PXA270 Specification Update notes problems sleeping - @ with core operating above 91 MHz - @ (see Errata 50, ...processor does not exit from sleep...) - - ldr r6, =CCCR - ldr r8, [r6] @ keep original value for resume - - ldr r7, =CCCR_SLEEP @ prepare CCCR sleep value - mov r0, #0x2 @ prepare value for CLKCFG -#endif @ align execution to a cache line b 1f @@ -139,7 +111,6 @@ ENTRY(pxa_cpu_suspend) @ All needed values are now in registers. @ These last instructions should be in cache -#if defined(CONFIG_PXA25x) || defined(CONFIG_PXA27x) @ initiate the frequency change... str r7, [r6] mcr p14, 0, r0, c6, c0, 0 @@ -147,27 +118,14 @@ ENTRY(pxa_cpu_suspend) @ restore the original cpu speed value for resume str r8, [r6] - @ need 6 13-MHz cycles before changing PWRMODE - @ just set frequency to 91-MHz... 6*91/13 = 42 - - mov r0, #42 -10: subs r0, r0, #1 - bne 10b -#endif - - @ Do not reorder... - @ Intel PXA270 Specification Update notes problems performing - @ external accesses after SDRAM is put in self-refresh mode - @ (see Errata 39 ...hangs when entering self-refresh mode) + @ put SDRAM into self-refresh + str r5, [r4] @ force address lines low by reading at physical address 0 ldr r3, [r2] - @ put SDRAM into self-refresh - str r5, [r4] - @ enter sleep mode - mcr p14, 0, r1, c7, c0, 0 @ PWRMODE + mcr p14, 0, r1, c7, c0, 0 20: b 20b @ loop waiting for sleep @@ -230,9 +188,7 @@ resume_after_mmu: bl cpu_xscale_proc_init #endif ldmfd sp!, {r2, r3} -#ifndef CONFIG_IWMMXT mar acc0, r2, r3 -#endif ldmfd sp!, {r4 - r12, pc} @ return to caller diff --git a/trunk/arch/ia64/sn/include/pci/pcibr_provider.h b/trunk/arch/ia64/sn/include/pci/pcibr_provider.h index b1f05ffec70b..1cd291d8badd 100644 --- a/trunk/arch/ia64/sn/include/pci/pcibr_provider.h +++ b/trunk/arch/ia64/sn/include/pci/pcibr_provider.h @@ -123,9 +123,11 @@ pcibr_lock(struct pcibus_info *pcibus_info) } #define pcibr_unlock(pcibus_info, flag) spin_unlock_irqrestore(&pcibus_info->pbi_lock, flag) +extern int pcibr_init_provider(void); extern void *pcibr_bus_fixup(struct pcibus_bussoft *); -extern uint64_t pcibr_dma_map(struct pcidev_info *, unsigned long, size_t, unsigned int); -extern void pcibr_dma_unmap(struct pcidev_info *, dma_addr_t, int); +extern dma_addr_t pcibr_dma_map(struct pci_dev *, unsigned long, size_t); +extern dma_addr_t pcibr_dma_map_consistent(struct pci_dev *, unsigned long, size_t); +extern void pcibr_dma_unmap(struct pci_dev *, dma_addr_t, int); /* * prototypes for the bridge asic register access routines in pcibr_reg.c diff --git a/trunk/arch/ia64/sn/include/pci/pcibus_provider_defs.h b/trunk/arch/ia64/sn/include/pci/pcibus_provider_defs.h index 07065615bbea..f546b4ece33c 100644 --- a/trunk/arch/ia64/sn/include/pci/pcibus_provider_defs.h +++ b/trunk/arch/ia64/sn/include/pci/pcibus_provider_defs.h @@ -18,6 +18,8 @@ #define PCIIO_ASIC_TYPE_PIC 2 #define PCIIO_ASIC_TYPE_TIOCP 3 +#define PCIIO_ASIC_MAX_TYPES 4 + /* * Common pciio bus provider data. There should be one of these as the * first field in any pciio based provider soft structure (e.g. pcibr_soft @@ -35,9 +37,15 @@ struct pcibus_bussoft { }; /* - * DMA mapping flags + * SN pci bus indirection */ -#define SN_PCIDMA_CONSISTENT 0x0001 +struct sn_pcibus_provider { + dma_addr_t (*dma_map)(struct pci_dev *, unsigned long, size_t); + dma_addr_t (*dma_map_consistent)(struct pci_dev *, unsigned long, size_t); + void (*dma_unmap)(struct pci_dev *, dma_addr_t, int); + void * (*bus_fixup)(struct pcibus_bussoft *); +}; +extern struct sn_pcibus_provider *sn_pci_provider[]; #endif /* _ASM_IA64_SN_PCI_PCIBUS_PROVIDER_H */ diff --git a/trunk/arch/ia64/sn/include/pci/pcidev.h b/trunk/arch/ia64/sn/include/pci/pcidev.h index 81eb95d3bf47..ed4031d80811 100644 --- a/trunk/arch/ia64/sn/include/pci/pcidev.h +++ b/trunk/arch/ia64/sn/include/pci/pcidev.h @@ -32,6 +32,9 @@ extern struct sn_irq_info **sn_irq; #define SN_PCIDEV_BUSSOFT(pci_dev) \ (SN_PCIDEV_INFO(pci_dev)->pdi_host_pcidev_info->pdi_pcibus_info) +#define SN_PCIDEV_BUSPROVIDER(pci_dev) \ + (SN_PCIDEV_INFO(pci_dev)->pdi_provider) + #define PCIIO_BUS_NONE 255 /* bus 255 reserved */ #define PCIIO_SLOT_NONE 255 #define PCIIO_FUNC_NONE 255 @@ -46,6 +49,7 @@ struct pcidev_info { struct pci_dev *pdi_linux_pcidev; /* Kernel pci_dev */ struct sn_irq_info *pdi_sn_irq_info; + struct sn_pcibus_provider *pdi_provider; /* sn pci ops */ }; extern void sn_irq_fixup(struct pci_dev *pci_dev, diff --git a/trunk/arch/ia64/sn/kernel/io_init.c b/trunk/arch/ia64/sn/kernel/io_init.c index 001880812b7c..3e5e4a901302 100644 --- a/trunk/arch/ia64/sn/kernel/io_init.c +++ b/trunk/arch/ia64/sn/kernel/io_init.c @@ -34,6 +34,37 @@ struct brick { int sn_ioif_inited = 0; /* SN I/O infrastructure initialized? */ +struct sn_pcibus_provider *sn_pci_provider[PCIIO_ASIC_MAX_TYPES]; /* indexed by asic type */ + +/* + * Hooks and struct for unsupported pci providers + */ + +static dma_addr_t +sn_default_pci_map(struct pci_dev *pdev, unsigned long paddr, size_t size) +{ + return 0; +} + +static void +sn_default_pci_unmap(struct pci_dev *pdev, dma_addr_t addr, int direction) +{ + return; +} + +static void * +sn_default_pci_bus_fixup(struct pcibus_bussoft *soft) +{ + return NULL; +} + +static struct sn_pcibus_provider sn_pci_default_provider = { + .dma_map = sn_default_pci_map, + .dma_map_consistent = sn_default_pci_map, + .dma_unmap = sn_default_pci_unmap, + .bus_fixup = sn_default_pci_bus_fixup, +}; + /* * Retrieve the DMA Flush List given nasid. This list is needed * to implement the WAR - Flush DMA data on PIO Reads. @@ -201,6 +232,7 @@ static void sn_pci_fixup_slot(struct pci_dev *dev) struct sn_irq_info *sn_irq_info; struct pci_dev *host_pci_dev; int status = 0; + struct pcibus_bussoft *bs; dev->sysdata = kmalloc(sizeof(struct pcidev_info), GFP_KERNEL); if (SN_PCIDEV_INFO(dev) <= 0) @@ -241,6 +273,7 @@ static void sn_pci_fixup_slot(struct pci_dev *dev) } /* set up host bus linkages */ + bs = SN_PCIBUS_BUSSOFT(dev->bus); host_pci_dev = pci_find_slot(SN_PCIDEV_INFO(dev)->pdi_slot_host_handle >> 32, SN_PCIDEV_INFO(dev)-> @@ -248,10 +281,16 @@ static void sn_pci_fixup_slot(struct pci_dev *dev) SN_PCIDEV_INFO(dev)->pdi_host_pcidev_info = SN_PCIDEV_INFO(host_pci_dev); SN_PCIDEV_INFO(dev)->pdi_linux_pcidev = dev; - SN_PCIDEV_INFO(dev)->pdi_pcibus_info = SN_PCIBUS_BUSSOFT(dev->bus); + SN_PCIDEV_INFO(dev)->pdi_pcibus_info = bs; + + if (bs && bs->bs_asic_type < PCIIO_ASIC_MAX_TYPES) { + SN_PCIDEV_BUSPROVIDER(dev) = sn_pci_provider[bs->bs_asic_type]; + } else { + SN_PCIDEV_BUSPROVIDER(dev) = &sn_pci_default_provider; + } /* Only set up IRQ stuff if this device has a host bus context */ - if (SN_PCIDEV_BUSSOFT(dev) && sn_irq_info->irq_irq) { + if (bs && sn_irq_info->irq_irq) { SN_PCIDEV_INFO(dev)->pdi_sn_irq_info = sn_irq_info; dev->irq = SN_PCIDEV_INFO(dev)->pdi_sn_irq_info->irq_irq; sn_irq_fixup(dev, sn_irq_info); @@ -271,6 +310,7 @@ static void sn_pci_controller_fixup(int segment, int busnum) struct pcibus_bussoft *prom_bussoft_ptr; struct hubdev_info *hubdev_info; void *provider_soft; + struct sn_pcibus_provider *provider; status = sal_get_pcibus_info((u64) segment, (u64) busnum, @@ -291,16 +331,22 @@ static void sn_pci_controller_fixup(int segment, int busnum) /* * Per-provider fixup. Copies the contents from prom to local * area and links SN_PCIBUS_BUSSOFT(). - * - * Note: Provider is responsible for ensuring that prom_bussoft_ptr - * represents an asic-type that it can handle. */ - if (prom_bussoft_ptr->bs_asic_type == PCIIO_ASIC_TYPE_PPB) { - return; /* no further fixup necessary */ + if (prom_bussoft_ptr->bs_asic_type >= PCIIO_ASIC_MAX_TYPES) { + return; /* unsupported asic type */ + } + + provider = sn_pci_provider[prom_bussoft_ptr->bs_asic_type]; + if (provider == NULL) { + return; /* no provider registerd for this asic */ + } + + provider_soft = NULL; + if (provider->bus_fixup) { + provider_soft = (*provider->bus_fixup) (prom_bussoft_ptr); } - provider_soft = pcibr_bus_fixup(prom_bussoft_ptr); if (provider_soft == NULL) { return; /* fixup failed or not applicable */ } @@ -338,6 +384,16 @@ static int __init sn_pci_init(void) if (!ia64_platform_is("sn2") || IS_RUNNING_ON_SIMULATOR()) return 0; + /* + * prime sn_pci_provider[]. Individial provider init routines will + * override their respective default entries. + */ + + for (i = 0; i < PCIIO_ASIC_MAX_TYPES; i++) + sn_pci_provider[i] = &sn_pci_default_provider; + + pcibr_init_provider(); + /* * This is needed to avoid bounce limit checks in the blk layer */ diff --git a/trunk/arch/ia64/sn/pci/pci_dma.c b/trunk/arch/ia64/sn/pci/pci_dma.c index f680824f819d..c2b92b94c563 100644 --- a/trunk/arch/ia64/sn/pci/pci_dma.c +++ b/trunk/arch/ia64/sn/pci/pci_dma.c @@ -14,7 +14,6 @@ #include #include "pci/pcibus_provider_defs.h" #include "pci/pcidev.h" -#include "pci/pcibr_provider.h" #define SG_ENT_VIRT_ADDRESS(sg) (page_address((sg)->page) + (sg)->offset) #define SG_ENT_PHYS_ADDRESS(SG) virt_to_phys(SG_ENT_VIRT_ADDRESS(SG)) @@ -79,7 +78,8 @@ void *sn_dma_alloc_coherent(struct device *dev, size_t size, { void *cpuaddr; unsigned long phys_addr; - struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(to_pci_dev(dev)); + struct pci_dev *pdev = to_pci_dev(dev); + struct sn_pcibus_provider *provider = SN_PCIDEV_BUSPROVIDER(pdev); BUG_ON(dev->bus != &pci_bus_type); @@ -102,8 +102,7 @@ void *sn_dma_alloc_coherent(struct device *dev, size_t size, * resources. */ - *dma_handle = pcibr_dma_map(pcidev_info, phys_addr, size, - SN_PCIDMA_CONSISTENT); + *dma_handle = provider->dma_map_consistent(pdev, phys_addr, size); if (!*dma_handle) { printk(KERN_ERR "%s: out of ATEs\n", __FUNCTION__); free_pages((unsigned long)cpuaddr, get_order(size)); @@ -127,11 +126,12 @@ EXPORT_SYMBOL(sn_dma_alloc_coherent); void sn_dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, dma_addr_t dma_handle) { - struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(to_pci_dev(dev)); + struct pci_dev *pdev = to_pci_dev(dev); + struct sn_pcibus_provider *provider = SN_PCIDEV_BUSPROVIDER(pdev); BUG_ON(dev->bus != &pci_bus_type); - pcibr_dma_unmap(pcidev_info, dma_handle, 0); + provider->dma_unmap(pdev, dma_handle, 0); free_pages((unsigned long)cpu_addr, get_order(size)); } EXPORT_SYMBOL(sn_dma_free_coherent); @@ -159,12 +159,13 @@ dma_addr_t sn_dma_map_single(struct device *dev, void *cpu_addr, size_t size, { dma_addr_t dma_addr; unsigned long phys_addr; - struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(to_pci_dev(dev)); + struct pci_dev *pdev = to_pci_dev(dev); + struct sn_pcibus_provider *provider = SN_PCIDEV_BUSPROVIDER(pdev); BUG_ON(dev->bus != &pci_bus_type); phys_addr = __pa(cpu_addr); - dma_addr = pcibr_dma_map(pcidev_info, phys_addr, size, 0); + dma_addr = provider->dma_map(pdev, phys_addr, size); if (!dma_addr) { printk(KERN_ERR "%s: out of ATEs\n", __FUNCTION__); return 0; @@ -187,10 +188,12 @@ EXPORT_SYMBOL(sn_dma_map_single); void sn_dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, int direction) { - struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(to_pci_dev(dev)); + struct pci_dev *pdev = to_pci_dev(dev); + struct sn_pcibus_provider *provider = SN_PCIDEV_BUSPROVIDER(pdev); BUG_ON(dev->bus != &pci_bus_type); - pcibr_dma_unmap(pcidev_info, dma_addr, direction); + + provider->dma_unmap(pdev, dma_addr, direction); } EXPORT_SYMBOL(sn_dma_unmap_single); @@ -207,12 +210,13 @@ void sn_dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries, int direction) { int i; - struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(to_pci_dev(dev)); + struct pci_dev *pdev = to_pci_dev(dev); + struct sn_pcibus_provider *provider = SN_PCIDEV_BUSPROVIDER(pdev); BUG_ON(dev->bus != &pci_bus_type); for (i = 0; i < nhwentries; i++, sg++) { - pcibr_dma_unmap(pcidev_info, sg->dma_address, direction); + provider->dma_unmap(pdev, sg->dma_address, direction); sg->dma_address = (dma_addr_t) NULL; sg->dma_length = 0; } @@ -233,7 +237,8 @@ int sn_dma_map_sg(struct device *dev, struct scatterlist *sg, int nhwentries, { unsigned long phys_addr; struct scatterlist *saved_sg = sg; - struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(to_pci_dev(dev)); + struct pci_dev *pdev = to_pci_dev(dev); + struct sn_pcibus_provider *provider = SN_PCIDEV_BUSPROVIDER(pdev); int i; BUG_ON(dev->bus != &pci_bus_type); @@ -243,8 +248,8 @@ int sn_dma_map_sg(struct device *dev, struct scatterlist *sg, int nhwentries, */ for (i = 0; i < nhwentries; i++, sg++) { phys_addr = SG_ENT_PHYS_ADDRESS(sg); - sg->dma_address = pcibr_dma_map(pcidev_info, phys_addr, - sg->length, 0); + sg->dma_address = provider->dma_map(pdev, + phys_addr, sg->length); if (!sg->dma_address) { printk(KERN_ERR "%s: out of ATEs\n", __FUNCTION__); diff --git a/trunk/arch/ia64/sn/pci/pcibr/pcibr_dma.c b/trunk/arch/ia64/sn/pci/pcibr/pcibr_dma.c index b1d66ac065c8..3c305f46417f 100644 --- a/trunk/arch/ia64/sn/pci/pcibr/pcibr_dma.c +++ b/trunk/arch/ia64/sn/pci/pcibr/pcibr_dma.c @@ -40,7 +40,7 @@ extern int sn_ioif_inited; * we do not have to allocate entries in the PMU. */ -static uint64_t +static dma_addr_t pcibr_dmamap_ate32(struct pcidev_info *info, uint64_t paddr, size_t req_size, uint64_t flags) { @@ -109,7 +109,7 @@ pcibr_dmamap_ate32(struct pcidev_info *info, return pci_addr; } -static uint64_t +static dma_addr_t pcibr_dmatrans_direct64(struct pcidev_info * info, uint64_t paddr, uint64_t dma_attributes) { @@ -141,7 +141,7 @@ pcibr_dmatrans_direct64(struct pcidev_info * info, uint64_t paddr, } -static uint64_t +static dma_addr_t pcibr_dmatrans_direct32(struct pcidev_info * info, uint64_t paddr, size_t req_size, uint64_t flags) { @@ -180,11 +180,11 @@ pcibr_dmatrans_direct32(struct pcidev_info * info, * DMA mappings for Direct 64 and 32 do not have any DMA maps. */ void -pcibr_dma_unmap(struct pcidev_info *pcidev_info, dma_addr_t dma_handle, - int direction) +pcibr_dma_unmap(struct pci_dev *hwdev, dma_addr_t dma_handle, int direction) { - struct pcibus_info *pcibus_info = (struct pcibus_info *)pcidev_info-> - pdi_pcibus_info; + struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(hwdev); + struct pcibus_info *pcibus_info = + (struct pcibus_info *)pcidev_info->pdi_pcibus_info; if (IS_PCI32_MAPPED(dma_handle)) { int ate_index; @@ -316,64 +316,63 @@ void sn_dma_flush(uint64_t addr) } /* - * Wrapper DMA interface. Called from pci_dma.c routines. + * DMA interfaces. Called from pci_dma.c routines. */ -uint64_t -pcibr_dma_map(struct pcidev_info * pcidev_info, unsigned long phys_addr, - size_t size, unsigned int flags) +dma_addr_t +pcibr_dma_map(struct pci_dev * hwdev, unsigned long phys_addr, size_t size) { dma_addr_t dma_handle; - struct pci_dev *pcidev = pcidev_info->pdi_linux_pcidev; - - if (flags & SN_PCIDMA_CONSISTENT) { - /* sn_pci_alloc_consistent interfaces */ - if (pcidev->dev.coherent_dma_mask == ~0UL) { - dma_handle = - pcibr_dmatrans_direct64(pcidev_info, phys_addr, - PCI64_ATTR_BAR); - } else { - dma_handle = - (dma_addr_t) pcibr_dmamap_ate32(pcidev_info, - phys_addr, size, - PCI32_ATE_BAR); - } - } else { - /* map_sg/map_single interfaces */ + struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(hwdev); - /* SN cannot support DMA addresses smaller than 32 bits. */ - if (pcidev->dma_mask < 0x7fffffff) { - return 0; - } + /* SN cannot support DMA addresses smaller than 32 bits. */ + if (hwdev->dma_mask < 0x7fffffff) { + return 0; + } - if (pcidev->dma_mask == ~0UL) { + if (hwdev->dma_mask == ~0UL) { + /* + * Handle the most common case: 64 bit cards. This + * call should always succeed. + */ + + dma_handle = pcibr_dmatrans_direct64(pcidev_info, phys_addr, + PCI64_ATTR_PREF); + } else { + /* Handle 32-63 bit cards via direct mapping */ + dma_handle = pcibr_dmatrans_direct32(pcidev_info, phys_addr, + size, 0); + if (!dma_handle) { /* - * Handle the most common case: 64 bit cards. This - * call should always succeed. + * It is a 32 bit card and we cannot do direct mapping, + * so we use an ATE. */ - dma_handle = - pcibr_dmatrans_direct64(pcidev_info, phys_addr, - PCI64_ATTR_PREF); - } else { - /* Handle 32-63 bit cards via direct mapping */ - dma_handle = - pcibr_dmatrans_direct32(pcidev_info, phys_addr, - size, 0); - if (!dma_handle) { - /* - * It is a 32 bit card and we cannot do direct mapping, - * so we use an ATE. - */ - - dma_handle = - pcibr_dmamap_ate32(pcidev_info, phys_addr, - size, PCI32_ATE_PREF); - } + dma_handle = pcibr_dmamap_ate32(pcidev_info, phys_addr, + size, PCI32_ATE_PREF); } } return dma_handle; } +dma_addr_t +pcibr_dma_map_consistent(struct pci_dev * hwdev, unsigned long phys_addr, + size_t size) +{ + dma_addr_t dma_handle; + struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(hwdev); + + if (hwdev->dev.coherent_dma_mask == ~0UL) { + dma_handle = pcibr_dmatrans_direct64(pcidev_info, phys_addr, + PCI64_ATTR_BAR); + } else { + dma_handle = (dma_addr_t) pcibr_dmamap_ate32(pcidev_info, + phys_addr, size, + PCI32_ATE_BAR); + } + + return dma_handle; +} + EXPORT_SYMBOL(sn_dma_flush); diff --git a/trunk/arch/ia64/sn/pci/pcibr/pcibr_provider.c b/trunk/arch/ia64/sn/pci/pcibr/pcibr_provider.c index 92bd278cf7ff..539ab1fdab21 100644 --- a/trunk/arch/ia64/sn/pci/pcibr/pcibr_provider.c +++ b/trunk/arch/ia64/sn/pci/pcibr/pcibr_provider.c @@ -168,3 +168,23 @@ void pcibr_change_devices_irq(struct sn_irq_info *sn_irq_info) pcibr_force_interrupt(sn_irq_info); } } + +/* + * Provider entries for PIC/CP + */ + +struct sn_pcibus_provider pcibr_provider = { + .dma_map = pcibr_dma_map, + .dma_map_consistent = pcibr_dma_map_consistent, + .dma_unmap = pcibr_dma_unmap, + .bus_fixup = pcibr_bus_fixup, +}; + +int +pcibr_init_provider(void) +{ + sn_pci_provider[PCIIO_ASIC_TYPE_PIC] = &pcibr_provider; + sn_pci_provider[PCIIO_ASIC_TYPE_TIOCP] = &pcibr_provider; + + return 0; +} diff --git a/trunk/arch/ppc64/kernel/rtas_flash.c b/trunk/arch/ppc64/kernel/rtas_flash.c index 923e2e201a70..3213837282ca 100644 --- a/trunk/arch/ppc64/kernel/rtas_flash.c +++ b/trunk/arch/ppc64/kernel/rtas_flash.c @@ -218,7 +218,7 @@ static void get_flash_status_msg(int status, char *buf) } /* Reading the proc file will show status (not the firmware contents) */ -static ssize_t rtas_flash_read(struct file *file, char __user *buf, +static ssize_t rtas_flash_read(struct file *file, char *buf, size_t count, loff_t *ppos) { struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); @@ -256,7 +256,7 @@ static ssize_t rtas_flash_read(struct file *file, char __user *buf, * count is. If the system is low on memory it will be just as well * that we fail.... */ -static ssize_t rtas_flash_write(struct file *file, const char __user *buffer, +static ssize_t rtas_flash_write(struct file *file, const char *buffer, size_t count, loff_t *off) { struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); @@ -356,7 +356,7 @@ static void manage_flash(struct rtas_manage_flash_t *args_buf) args_buf->status = rc; } -static ssize_t manage_flash_read(struct file *file, char __user *buf, +static ssize_t manage_flash_read(struct file *file, char *buf, size_t count, loff_t *ppos) { struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); @@ -386,7 +386,7 @@ static ssize_t manage_flash_read(struct file *file, char __user *buf, return msglen; } -static ssize_t manage_flash_write(struct file *file, const char __user *buf, +static ssize_t manage_flash_write(struct file *file, const char *buf, size_t count, loff_t *off) { struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); @@ -466,7 +466,7 @@ static int get_validate_flash_msg(struct rtas_validate_flash_t *args_buf, return n; } -static ssize_t validate_flash_read(struct file *file, char __user *buf, +static ssize_t validate_flash_read(struct file *file, char *buf, size_t count, loff_t *ppos) { struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); @@ -494,7 +494,7 @@ static ssize_t validate_flash_read(struct file *file, char __user *buf, return msglen; } -static ssize_t validate_flash_write(struct file *file, const char __user *buf, +static ssize_t validate_flash_write(struct file *file, const char *buf, size_t count, loff_t *off) { struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); diff --git a/trunk/arch/ppc64/kernel/scanlog.c b/trunk/arch/ppc64/kernel/scanlog.c index 4d70736619c7..189b81a41987 100644 --- a/trunk/arch/ppc64/kernel/scanlog.c +++ b/trunk/arch/ppc64/kernel/scanlog.c @@ -43,7 +43,7 @@ static int scanlog_debug; static unsigned int ibm_scan_log_dump; /* RTAS token */ static struct proc_dir_entry *proc_ppc64_scan_log_dump; /* The proc file */ -static ssize_t scanlog_read(struct file *file, char __user *buf, +static ssize_t scanlog_read(struct file *file, char *buf, size_t count, loff_t *ppos) { struct inode * inode = file->f_dentry->d_inode; @@ -129,7 +129,7 @@ static ssize_t scanlog_read(struct file *file, char __user *buf, /*NOTREACHED*/ } -static ssize_t scanlog_write(struct file * file, const char __user * buf, +static ssize_t scanlog_write(struct file * file, const char * buf, size_t count, loff_t *ppos) { char stkbuf[20]; diff --git a/trunk/arch/ppc64/xmon/ppc-opc.c b/trunk/arch/ppc64/xmon/ppc-opc.c index 5ee8fc32f824..1e4e7e319970 100644 --- a/trunk/arch/ppc64/xmon/ppc-opc.c +++ b/trunk/arch/ppc64/xmon/ppc-opc.c @@ -20,7 +20,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include #include "nonstdio.h" #include "ppc.h" @@ -111,12 +110,12 @@ const struct powerpc_operand powerpc_operands[] = /* The zero index is used to indicate the end of the list of operands. */ #define UNUSED 0 - { 0, 0, NULL, NULL, 0 }, + { 0, 0, 0, 0, 0 }, /* The BA field in an XL form instruction. */ #define BA UNUSED + 1 #define BA_MASK (0x1f << 16) - { 5, 16, NULL, NULL, PPC_OPERAND_CR }, + { 5, 16, 0, 0, PPC_OPERAND_CR }, /* The BA field in an XL form instruction when it must be the same as the BT field in the same instruction. */ @@ -126,7 +125,7 @@ const struct powerpc_operand powerpc_operands[] = /* The BB field in an XL form instruction. */ #define BB BAT + 1 #define BB_MASK (0x1f << 11) - { 5, 11, NULL, NULL, PPC_OPERAND_CR }, + { 5, 11, 0, 0, PPC_OPERAND_CR }, /* The BB field in an XL form instruction when it must be the same as the BA field in the same instruction. */ @@ -169,21 +168,21 @@ const struct powerpc_operand powerpc_operands[] = /* The BF field in an X or XL form instruction. */ #define BF BDPA + 1 - { 3, 23, NULL, NULL, PPC_OPERAND_CR }, + { 3, 23, 0, 0, PPC_OPERAND_CR }, /* An optional BF field. This is used for comparison instructions, in which an omitted BF field is taken as zero. */ #define OBF BF + 1 - { 3, 23, NULL, NULL, PPC_OPERAND_CR | PPC_OPERAND_OPTIONAL }, + { 3, 23, 0, 0, PPC_OPERAND_CR | PPC_OPERAND_OPTIONAL }, /* The BFA field in an X or XL form instruction. */ #define BFA OBF + 1 - { 3, 18, NULL, NULL, PPC_OPERAND_CR }, + { 3, 18, 0, 0, PPC_OPERAND_CR }, /* The BI field in a B form or XL form instruction. */ #define BI BFA + 1 #define BI_MASK (0x1f << 16) - { 5, 16, NULL, NULL, PPC_OPERAND_CR }, + { 5, 16, 0, 0, PPC_OPERAND_CR }, /* The BO field in a B form instruction. Certain values are illegal. */ @@ -198,36 +197,36 @@ const struct powerpc_operand powerpc_operands[] = /* The BT field in an X or XL form instruction. */ #define BT BOE + 1 - { 5, 21, NULL, NULL, PPC_OPERAND_CR }, + { 5, 21, 0, 0, PPC_OPERAND_CR }, /* The condition register number portion of the BI field in a B form or XL form instruction. This is used for the extended conditional branch mnemonics, which set the lower two bits of the BI field. This field is optional. */ #define CR BT + 1 - { 3, 18, NULL, NULL, PPC_OPERAND_CR | PPC_OPERAND_OPTIONAL }, + { 3, 18, 0, 0, PPC_OPERAND_CR | PPC_OPERAND_OPTIONAL }, /* The CRB field in an X form instruction. */ #define CRB CR + 1 - { 5, 6, NULL, NULL, 0 }, + { 5, 6, 0, 0, 0 }, /* The CRFD field in an X form instruction. */ #define CRFD CRB + 1 - { 3, 23, NULL, NULL, PPC_OPERAND_CR }, + { 3, 23, 0, 0, PPC_OPERAND_CR }, /* The CRFS field in an X form instruction. */ #define CRFS CRFD + 1 - { 3, 0, NULL, NULL, PPC_OPERAND_CR }, + { 3, 0, 0, 0, PPC_OPERAND_CR }, /* The CT field in an X form instruction. */ #define CT CRFS + 1 - { 5, 21, NULL, NULL, PPC_OPERAND_OPTIONAL }, + { 5, 21, 0, 0, PPC_OPERAND_OPTIONAL }, /* The D field in a D form instruction. This is a displacement off a register, and implies that the next operand is a register in parentheses. */ #define D CT + 1 - { 16, 0, NULL, NULL, PPC_OPERAND_PARENS | PPC_OPERAND_SIGNED }, + { 16, 0, 0, 0, PPC_OPERAND_PARENS | PPC_OPERAND_SIGNED }, /* The DE field in a DE form instruction. This is like D, but is 12 bits only. */ @@ -253,40 +252,40 @@ const struct powerpc_operand powerpc_operands[] = /* The E field in a wrteei instruction. */ #define E DS + 1 - { 1, 15, NULL, NULL, 0 }, + { 1, 15, 0, 0, 0 }, /* The FL1 field in a POWER SC form instruction. */ #define FL1 E + 1 - { 4, 12, NULL, NULL, 0 }, + { 4, 12, 0, 0, 0 }, /* The FL2 field in a POWER SC form instruction. */ #define FL2 FL1 + 1 - { 3, 2, NULL, NULL, 0 }, + { 3, 2, 0, 0, 0 }, /* The FLM field in an XFL form instruction. */ #define FLM FL2 + 1 - { 8, 17, NULL, NULL, 0 }, + { 8, 17, 0, 0, 0 }, /* The FRA field in an X or A form instruction. */ #define FRA FLM + 1 #define FRA_MASK (0x1f << 16) - { 5, 16, NULL, NULL, PPC_OPERAND_FPR }, + { 5, 16, 0, 0, PPC_OPERAND_FPR }, /* The FRB field in an X or A form instruction. */ #define FRB FRA + 1 #define FRB_MASK (0x1f << 11) - { 5, 11, NULL, NULL, PPC_OPERAND_FPR }, + { 5, 11, 0, 0, PPC_OPERAND_FPR }, /* The FRC field in an A form instruction. */ #define FRC FRB + 1 #define FRC_MASK (0x1f << 6) - { 5, 6, NULL, NULL, PPC_OPERAND_FPR }, + { 5, 6, 0, 0, PPC_OPERAND_FPR }, /* The FRS field in an X form instruction or the FRT field in a D, X or A form instruction. */ #define FRS FRC + 1 #define FRT FRS - { 5, 21, NULL, NULL, PPC_OPERAND_FPR }, + { 5, 21, 0, 0, PPC_OPERAND_FPR }, /* The FXM field in an XFX instruction. */ #define FXM FRS + 1 @@ -299,11 +298,11 @@ const struct powerpc_operand powerpc_operands[] = /* The L field in a D or X form instruction. */ #define L FXM4 + 1 - { 1, 21, NULL, NULL, PPC_OPERAND_OPTIONAL }, + { 1, 21, 0, 0, PPC_OPERAND_OPTIONAL }, /* The LEV field in a POWER SC form instruction. */ #define LEV L + 1 - { 7, 5, NULL, NULL, 0 }, + { 7, 5, 0, 0, 0 }, /* The LI field in an I form instruction. The lower two bits are forced to zero. */ @@ -317,24 +316,24 @@ const struct powerpc_operand powerpc_operands[] = /* The LS field in an X (sync) form instruction. */ #define LS LIA + 1 - { 2, 21, NULL, NULL, PPC_OPERAND_OPTIONAL }, + { 2, 21, 0, 0, PPC_OPERAND_OPTIONAL }, /* The MB field in an M form instruction. */ #define MB LS + 1 #define MB_MASK (0x1f << 6) - { 5, 6, NULL, NULL, 0 }, + { 5, 6, 0, 0, 0 }, /* The ME field in an M form instruction. */ #define ME MB + 1 #define ME_MASK (0x1f << 1) - { 5, 1, NULL, NULL, 0 }, + { 5, 1, 0, 0, 0 }, /* The MB and ME fields in an M form instruction expressed a single operand which is a bitmask indicating which bits to select. This is a two operand form using PPC_OPERAND_NEXT. See the description in opcode/ppc.h for what this means. */ #define MBE ME + 1 - { 5, 6, NULL, NULL, PPC_OPERAND_OPTIONAL | PPC_OPERAND_NEXT }, + { 5, 6, 0, 0, PPC_OPERAND_OPTIONAL | PPC_OPERAND_NEXT }, { 32, 0, insert_mbe, extract_mbe, 0 }, /* The MB or ME field in an MD or MDS form instruction. The high @@ -346,7 +345,7 @@ const struct powerpc_operand powerpc_operands[] = /* The MO field in an mbar instruction. */ #define MO MB6 + 1 - { 5, 21, NULL, NULL, 0 }, + { 5, 21, 0, 0, 0 }, /* The NB field in an X form instruction. The value 32 is stored as 0. */ @@ -362,34 +361,34 @@ const struct powerpc_operand powerpc_operands[] = /* The RA field in an D, DS, DQ, X, XO, M, or MDS form instruction. */ #define RA NSI + 1 #define RA_MASK (0x1f << 16) - { 5, 16, NULL, NULL, PPC_OPERAND_GPR }, + { 5, 16, 0, 0, PPC_OPERAND_GPR }, /* The RA field in the DQ form lq instruction, which has special value restrictions. */ #define RAQ RA + 1 - { 5, 16, insert_raq, NULL, PPC_OPERAND_GPR }, + { 5, 16, insert_raq, 0, PPC_OPERAND_GPR }, /* The RA field in a D or X form instruction which is an updating load, which means that the RA field may not be zero and may not equal the RT field. */ #define RAL RAQ + 1 - { 5, 16, insert_ral, NULL, PPC_OPERAND_GPR }, + { 5, 16, insert_ral, 0, PPC_OPERAND_GPR }, /* The RA field in an lmw instruction, which has special value restrictions. */ #define RAM RAL + 1 - { 5, 16, insert_ram, NULL, PPC_OPERAND_GPR }, + { 5, 16, insert_ram, 0, PPC_OPERAND_GPR }, /* The RA field in a D or X form instruction which is an updating store or an updating floating point load, which means that the RA field may not be zero. */ #define RAS RAM + 1 - { 5, 16, insert_ras, NULL, PPC_OPERAND_GPR }, + { 5, 16, insert_ras, 0, PPC_OPERAND_GPR }, /* The RB field in an X, XO, M, or MDS form instruction. */ #define RB RAS + 1 #define RB_MASK (0x1f << 11) - { 5, 11, NULL, NULL, PPC_OPERAND_GPR }, + { 5, 11, 0, 0, PPC_OPERAND_GPR }, /* The RB field in an X form instruction when it must be the same as the RS field in the instruction. This is used for extended @@ -403,22 +402,22 @@ const struct powerpc_operand powerpc_operands[] = #define RS RBS + 1 #define RT RS #define RT_MASK (0x1f << 21) - { 5, 21, NULL, NULL, PPC_OPERAND_GPR }, + { 5, 21, 0, 0, PPC_OPERAND_GPR }, /* The RS field of the DS form stq instruction, which has special value restrictions. */ #define RSQ RS + 1 - { 5, 21, insert_rsq, NULL, PPC_OPERAND_GPR }, + { 5, 21, insert_rsq, 0, PPC_OPERAND_GPR }, /* The RT field of the DQ form lq instruction, which has special value restrictions. */ #define RTQ RSQ + 1 - { 5, 21, insert_rtq, NULL, PPC_OPERAND_GPR }, + { 5, 21, insert_rtq, 0, PPC_OPERAND_GPR }, /* The SH field in an X or M form instruction. */ #define SH RTQ + 1 #define SH_MASK (0x1f << 11) - { 5, 11, NULL, NULL, 0 }, + { 5, 11, 0, 0, 0 }, /* The SH field in an MD form instruction. This is split. */ #define SH6 SH + 1 @@ -427,12 +426,12 @@ const struct powerpc_operand powerpc_operands[] = /* The SI field in a D form instruction. */ #define SI SH6 + 1 - { 16, 0, NULL, NULL, PPC_OPERAND_SIGNED }, + { 16, 0, 0, 0, PPC_OPERAND_SIGNED }, /* The SI field in a D form instruction when we accept a wide range of positive values. */ #define SISIGNOPT SI + 1 - { 16, 0, NULL, NULL, PPC_OPERAND_SIGNED | PPC_OPERAND_SIGNOPT }, + { 16, 0, 0, 0, PPC_OPERAND_SIGNED | PPC_OPERAND_SIGNOPT }, /* The SPR field in an XFX form instruction. This is flipped--the lower 5 bits are stored in the upper 5 and vice- versa. */ @@ -444,25 +443,25 @@ const struct powerpc_operand powerpc_operands[] = /* The BAT index number in an XFX form m[ft]ibat[lu] instruction. */ #define SPRBAT SPR + 1 #define SPRBAT_MASK (0x3 << 17) - { 2, 17, NULL, NULL, 0 }, + { 2, 17, 0, 0, 0 }, /* The SPRG register number in an XFX form m[ft]sprg instruction. */ #define SPRG SPRBAT + 1 #define SPRG_MASK (0x3 << 16) - { 2, 16, NULL, NULL, 0 }, + { 2, 16, 0, 0, 0 }, /* The SR field in an X form instruction. */ #define SR SPRG + 1 - { 4, 16, NULL, NULL, 0 }, + { 4, 16, 0, 0, 0 }, /* The STRM field in an X AltiVec form instruction. */ #define STRM SR + 1 #define STRM_MASK (0x3 << 21) - { 2, 21, NULL, NULL, 0 }, + { 2, 21, 0, 0, 0 }, /* The SV field in a POWER SC form instruction. */ #define SV STRM + 1 - { 14, 2, NULL, NULL, 0 }, + { 14, 2, 0, 0, 0 }, /* The TBR field in an XFX form instruction. This is like the SPR field, but it is optional. */ @@ -472,52 +471,52 @@ const struct powerpc_operand powerpc_operands[] = /* The TO field in a D or X form instruction. */ #define TO TBR + 1 #define TO_MASK (0x1f << 21) - { 5, 21, NULL, NULL, 0 }, + { 5, 21, 0, 0, 0 }, /* The U field in an X form instruction. */ #define U TO + 1 - { 4, 12, NULL, NULL, 0 }, + { 4, 12, 0, 0, 0 }, /* The UI field in a D form instruction. */ #define UI U + 1 - { 16, 0, NULL, NULL, 0 }, + { 16, 0, 0, 0, 0 }, /* The VA field in a VA, VX or VXR form instruction. */ #define VA UI + 1 #define VA_MASK (0x1f << 16) - { 5, 16, NULL, NULL, PPC_OPERAND_VR }, + { 5, 16, 0, 0, PPC_OPERAND_VR }, /* The VB field in a VA, VX or VXR form instruction. */ #define VB VA + 1 #define VB_MASK (0x1f << 11) - { 5, 11, NULL, NULL, PPC_OPERAND_VR }, + { 5, 11, 0, 0, PPC_OPERAND_VR }, /* The VC field in a VA form instruction. */ #define VC VB + 1 #define VC_MASK (0x1f << 6) - { 5, 6, NULL, NULL, PPC_OPERAND_VR }, + { 5, 6, 0, 0, PPC_OPERAND_VR }, /* The VD or VS field in a VA, VX, VXR or X form instruction. */ #define VD VC + 1 #define VS VD #define VD_MASK (0x1f << 21) - { 5, 21, NULL, NULL, PPC_OPERAND_VR }, + { 5, 21, 0, 0, PPC_OPERAND_VR }, /* The SIMM field in a VX form instruction. */ #define SIMM VD + 1 - { 5, 16, NULL, NULL, PPC_OPERAND_SIGNED}, + { 5, 16, 0, 0, PPC_OPERAND_SIGNED}, /* The UIMM field in a VX form instruction. */ #define UIMM SIMM + 1 - { 5, 16, NULL, NULL, 0 }, + { 5, 16, 0, 0, 0 }, /* The SHB field in a VA form instruction. */ #define SHB UIMM + 1 - { 4, 6, NULL, NULL, 0 }, + { 4, 6, 0, 0, 0 }, /* The other UIMM field in a EVX form instruction. */ #define EVUIMM SHB + 1 - { 5, 11, NULL, NULL, 0 }, + { 5, 11, 0, 0, 0 }, /* The other UIMM field in a half word EVX form instruction. */ #define EVUIMM_2 EVUIMM + 1 @@ -534,11 +533,11 @@ const struct powerpc_operand powerpc_operands[] = /* The WS field. */ #define WS EVUIMM_8 + 1 #define WS_MASK (0x7 << 11) - { 3, 11, NULL, NULL, 0 }, + { 3, 11, 0, 0, 0 }, /* The L field in an mtmsrd instruction */ #define MTMSRD_L WS + 1 - { 1, 16, NULL, NULL, PPC_OPERAND_OPTIONAL }, + { 1, 16, 0, 0, PPC_OPERAND_OPTIONAL }, }; diff --git a/trunk/arch/x86_64/kernel/signal.c b/trunk/arch/x86_64/kernel/signal.c index d439ced150c6..7760224cdfe3 100644 --- a/trunk/arch/x86_64/kernel/signal.c +++ b/trunk/arch/x86_64/kernel/signal.c @@ -83,7 +83,7 @@ sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, struct rt_sigframe { - char __user *pretcode; + char *pretcode; struct ucontext uc; struct siginfo info; }; diff --git a/trunk/drivers/char/tpm/tpm.c b/trunk/drivers/char/tpm/tpm.c index 87235330fdbe..ca36087d4f8a 100644 --- a/trunk/drivers/char/tpm/tpm.c +++ b/trunk/drivers/char/tpm/tpm.c @@ -143,7 +143,7 @@ static ssize_t tpm_transmit(struct tpm_chip *chip, const char *buf, return -ENODATA; if (count > bufsiz) { dev_err(&chip->pci_dev->dev, - "invalid count value %x %zx \n", count, bufsiz); + "invalid count value %x %x \n", count, bufsiz); return -E2BIG; } @@ -151,7 +151,7 @@ static ssize_t tpm_transmit(struct tpm_chip *chip, const char *buf, if ((len = chip->vendor->send(chip, (u8 *) buf, count)) < 0) { dev_err(&chip->pci_dev->dev, - "tpm_transmit: tpm_send: error %zd\n", len); + "tpm_transmit: tpm_send: error %d\n", len); return len; } @@ -188,7 +188,7 @@ static ssize_t tpm_transmit(struct tpm_chip *chip, const char *buf, len = chip->vendor->recv(chip, (u8 *) buf, bufsiz); if (len < 0) dev_err(&chip->pci_dev->dev, - "tpm_transmit: tpm_recv: error %zd\n", len); + "tpm_transmit: tpm_recv: error %d\n", len); up(&chip->tpm_mutex); return len; } diff --git a/trunk/drivers/i2c/busses/i2c-mpc.c b/trunk/drivers/i2c/busses/i2c-mpc.c index 6f33496d31c3..75b8d867dae1 100644 --- a/trunk/drivers/i2c/busses/i2c-mpc.c +++ b/trunk/drivers/i2c/busses/i2c-mpc.c @@ -55,7 +55,7 @@ #define CSR_RXAK 0x01 struct mpc_i2c { - void __iomem *base; + char *base; u32 interrupt; wait_queue_head_t queue; struct i2c_adapter adap; @@ -444,7 +444,7 @@ static int fsl_i2c_probe(struct device *device) fail_add: if (i2c->irq != 0) - free_irq(i2c->irq, NULL); + free_irq(i2c->irq, 0); fail_irq: iounmap(i2c->base); fail_map: diff --git a/trunk/drivers/net/tg3.c b/trunk/drivers/net/tg3.c index 903d0ced7ddb..10d476153ee0 100644 --- a/trunk/drivers/net/tg3.c +++ b/trunk/drivers/net/tg3.c @@ -426,30 +426,9 @@ static void tg3_enable_ints(struct tg3 *tp) tg3_cond_int(tp); } -static inline unsigned int tg3_has_work(struct tg3 *tp) -{ - struct tg3_hw_status *sblk = tp->hw_status; - unsigned int work_exists = 0; - - /* check for phy events */ - if (!(tp->tg3_flags & - (TG3_FLAG_USE_LINKCHG_REG | - TG3_FLAG_POLL_SERDES))) { - if (sblk->status & SD_STATUS_LINK_CHG) - work_exists = 1; - } - /* check for RX/TX work to do */ - if (sblk->idx[0].tx_consumer != tp->tx_cons || - sblk->idx[0].rx_producer != tp->rx_rcb_ptr) - work_exists = 1; - - return work_exists; -} - /* tg3_restart_ints - * similar to tg3_enable_ints, but it accurately determines whether there - * is new work pending and can return without flushing the PIO write - * which reenables interrupts + * similar to tg3_enable_ints, but it can return without flushing the + * PIO write which reenables interrupts */ static void tg3_restart_ints(struct tg3 *tp) { @@ -458,9 +437,7 @@ static void tg3_restart_ints(struct tg3 *tp) tw32_mailbox(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW, 0x00000000); mmiowb(); - if (tg3_has_work(tp)) - tw32(HOSTCC_MODE, tp->coalesce_mode | - (HOSTCC_MODE_ENABLE | HOSTCC_MODE_NOW)); + tg3_cond_int(tp); } static inline void tg3_netif_stop(struct tg3 *tp) @@ -2709,8 +2686,8 @@ static int tg3_vlan_rx(struct tg3 *tp, struct sk_buff *skb, u16 vlan_tag) static int tg3_rx(struct tg3 *tp, int budget) { u32 work_mask; - u32 sw_idx = tp->rx_rcb_ptr; - u16 hw_idx; + u32 rx_rcb_ptr = tp->rx_rcb_ptr; + u16 hw_idx, sw_idx; int received; hw_idx = tp->hw_status->idx[0].rx_producer; @@ -2719,6 +2696,7 @@ static int tg3_rx(struct tg3 *tp, int budget) * the opaque cookie. */ rmb(); + sw_idx = rx_rcb_ptr % TG3_RX_RCB_RING_SIZE(tp); work_mask = 0; received = 0; while (sw_idx != hw_idx && budget > 0) { @@ -2823,19 +2801,14 @@ static int tg3_rx(struct tg3 *tp, int budget) next_pkt: (*post_ptr)++; next_pkt_nopost: - sw_idx++; - sw_idx %= TG3_RX_RCB_RING_SIZE(tp); - - /* Refresh hw_idx to see if there is new work */ - if (sw_idx == hw_idx) { - hw_idx = tp->hw_status->idx[0].rx_producer; - rmb(); - } + rx_rcb_ptr++; + sw_idx = rx_rcb_ptr % TG3_RX_RCB_RING_SIZE(tp); } /* ACK the status ring. */ - tp->rx_rcb_ptr = sw_idx; - tw32_rx_mbox(MAILBOX_RCVRET_CON_IDX_0 + TG3_64BIT_REG_LOW, sw_idx); + tp->rx_rcb_ptr = rx_rcb_ptr; + tw32_rx_mbox(MAILBOX_RCVRET_CON_IDX_0 + TG3_64BIT_REG_LOW, + (rx_rcb_ptr % TG3_RX_RCB_RING_SIZE(tp))); /* Refill RX ring(s). */ if (work_mask & RXD_OPAQUE_RING_STD) { @@ -2914,6 +2887,26 @@ static int tg3_poll(struct net_device *netdev, int *budget) return (done ? 0 : 1); } +static inline unsigned int tg3_has_work(struct net_device *dev, struct tg3 *tp) +{ + struct tg3_hw_status *sblk = tp->hw_status; + unsigned int work_exists = 0; + + /* check for phy events */ + if (!(tp->tg3_flags & + (TG3_FLAG_USE_LINKCHG_REG | + TG3_FLAG_POLL_SERDES))) { + if (sblk->status & SD_STATUS_LINK_CHG) + work_exists = 1; + } + /* check for RX/TX work to do */ + if (sblk->idx[0].tx_consumer != tp->tx_cons || + sblk->idx[0].rx_producer != tp->rx_rcb_ptr) + work_exists = 1; + + return work_exists; +} + /* MSI ISR - No need to check for interrupt sharing and no need to * flush status block and interrupt mailbox. PCI ordering rules * guarantee that MSI will arrive after the status block. @@ -2937,7 +2930,7 @@ static irqreturn_t tg3_msi(int irq, void *dev_id, struct pt_regs *regs) tw32_mailbox(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW, 0x00000001); sblk->status &= ~SD_STATUS_UPDATED; - if (likely(tg3_has_work(tp))) + if (likely(tg3_has_work(dev, tp))) netif_rx_schedule(dev); /* schedule NAPI poll */ else { /* no work, re-enable interrupts @@ -2984,7 +2977,7 @@ static irqreturn_t tg3_interrupt(int irq, void *dev_id, struct pt_regs *regs) tr32(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW); sblk->status &= ~SD_STATUS_UPDATED; - if (likely(tg3_has_work(tp))) + if (likely(tg3_has_work(dev, tp))) netif_rx_schedule(dev); /* schedule NAPI poll */ else { /* no work, shared interrupt perhaps? re-enable diff --git a/trunk/drivers/net/wan/pc300_drv.c b/trunk/drivers/net/wan/pc300_drv.c index 3e7753b10717..d67be2587d4d 100644 --- a/trunk/drivers/net/wan/pc300_drv.c +++ b/trunk/drivers/net/wan/pc300_drv.c @@ -3427,7 +3427,7 @@ cpc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) { static int first_time = 1; ucchar cpc_rev_id; - int err, eeprom_outdated = 0; + int err = 0, eeprom_outdated = 0; ucshort device_id; pc300_t *card; @@ -3439,21 +3439,15 @@ cpc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) #endif } - if ((err = pci_enable_device(pdev)) < 0) - return err; - card = (pc300_t *) kmalloc(sizeof(pc300_t), GFP_KERNEL); if (card == NULL) { printk("PC300 found at RAM 0x%08lx, " "but could not allocate card structure.\n", pci_resource_start(pdev, 3)); - err = -ENOMEM; - goto err_disable_dev; + return -ENOMEM; } memset(card, 0, sizeof(pc300_t)); - err = -ENODEV; - /* read PCI configuration area */ device_id = ent->device; card->hw.irq = pdev->irq; @@ -3513,6 +3507,7 @@ cpc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) printk("PC300 found at RAM 0x%08x, " "but could not allocate PLX mem region.\n", card->hw.ramphys); + err = -ENODEV; goto err_release_io; } if (!request_mem_region(card->hw.ramphys, card->hw.alloc_ramsize, @@ -3520,6 +3515,7 @@ cpc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) printk("PC300 found at RAM 0x%08x, " "but could not allocate RAM mem region.\n", card->hw.ramphys); + err = -ENODEV; goto err_release_plx; } if (!request_mem_region(card->hw.scaphys, card->hw.scasize, @@ -3527,9 +3523,13 @@ cpc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) printk("PC300 found at RAM 0x%08x, " "but could not allocate SCA mem region.\n", card->hw.ramphys); + err = -ENODEV; goto err_release_ram; } + if ((err = pci_enable_device(pdev)) != 0) + goto err_release_sca; + card->hw.plxbase = ioremap(card->hw.plxphys, card->hw.plxsize); card->hw.rambase = ioremap(card->hw.ramphys, card->hw.alloc_ramsize); card->hw.scabase = ioremap(card->hw.scaphys, card->hw.scasize); @@ -3619,6 +3619,7 @@ cpc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) iounmap(card->hw.falcbase); release_mem_region(card->hw.falcphys, card->hw.falcsize); } +err_release_sca: release_mem_region(card->hw.scaphys, card->hw.scasize); err_release_ram: release_mem_region(card->hw.ramphys, card->hw.alloc_ramsize); @@ -3627,9 +3628,7 @@ cpc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) err_release_io: release_region(card->hw.iophys, card->hw.iosize); kfree(card); -err_disable_dev: - pci_disable_device(pdev); - return err; + return -ENODEV; } static void __devexit cpc_remove_one(struct pci_dev *pdev) @@ -3663,7 +3662,6 @@ static void __devexit cpc_remove_one(struct pci_dev *pdev) if (card->hw.irq) free_irq(card->hw.irq, card); kfree(card); - pci_disable_device(pdev); } } diff --git a/trunk/drivers/oprofile/oprofile_files.c b/trunk/drivers/oprofile/oprofile_files.c index a72006c08f2b..9abedeaa567c 100644 --- a/trunk/drivers/oprofile/oprofile_files.c +++ b/trunk/drivers/oprofile/oprofile_files.c @@ -18,13 +18,13 @@ unsigned long fs_buffer_size = 131072; unsigned long fs_cpu_buffer_size = 8192; unsigned long fs_buffer_watershed = 32768; /* FIXME: tune */ -static ssize_t depth_read(struct file * file, char __user * buf, size_t count, loff_t * offset) +static ssize_t depth_read(struct file * file, char * buf, size_t count, loff_t * offset) { return oprofilefs_ulong_to_user(backtrace_depth, buf, count, offset); } -static ssize_t depth_write(struct file * file, char const __user * buf, size_t count, loff_t * offset) +static ssize_t depth_write(struct file * file, char const * buf, size_t count, loff_t * offset) { unsigned long val; int retval; diff --git a/trunk/drivers/scsi/esp.c b/trunk/drivers/scsi/esp.c index f6900538be90..891f97f7881e 100644 --- a/trunk/drivers/scsi/esp.c +++ b/trunk/drivers/scsi/esp.c @@ -1147,7 +1147,7 @@ static int __init esp_detect(struct scsi_host_template *tpnt) static struct sbus_dev esp_dev; int esps_in_use = 0; - espchain = NULL; + espchain = 0; if (sun4_esp_physaddr) { memset (&esp_dev, 0, sizeof(esp_dev)); @@ -2513,7 +2513,7 @@ static inline void esp_reconnect(struct esp *esp, struct scsi_cmnd *sp) ESPLOG(("esp%d: Weird, being reselected but disconnected " "command queue is empty.\n", esp->esp_id)); esp->snip = 0; - esp->current_SC = NULL; + esp->current_SC = 0; sp->SCp.phase = not_issued; append_SC(&esp->issue_SC, sp); } @@ -4148,7 +4148,7 @@ static int esp_work_bus(struct esp *esp) } static espfunc_t isvc_vector[] = { - NULL, + 0, esp_do_phase_determine, esp_do_resetbus, esp_finish_reset, diff --git a/trunk/drivers/scsi/pluto.c b/trunk/drivers/scsi/pluto.c index c01b7191fcf5..7bb0a2e56743 100644 --- a/trunk/drivers/scsi/pluto.c +++ b/trunk/drivers/scsi/pluto.c @@ -45,7 +45,7 @@ static struct ctrl_inquiry { Scsi_Cmnd cmd; char inquiry[256]; fc_channel *fc; -} *fcs __initdata; +} *fcs __initdata = { 0 }; static int fcscount __initdata = 0; static atomic_t fcss __initdata = ATOMIC_INIT(0); DECLARE_MUTEX_LOCKED(fc_sem); diff --git a/trunk/drivers/scsi/qla2xxx/qla_sup.c b/trunk/drivers/scsi/qla2xxx/qla_sup.c index 32583bbb487f..0e75fbb77b6b 100644 --- a/trunk/drivers/scsi/qla2xxx/qla_sup.c +++ b/trunk/drivers/scsi/qla2xxx/qla_sup.c @@ -85,7 +85,7 @@ qla2x00_unlock_nvram_access(scsi_qla_host_t *ha) void qla2x00_release_nvram_protection(scsi_qla_host_t *ha) { - device_reg_t __iomem *reg; + device_reg_t *reg; uint32_t word; reg = ha->iobase; diff --git a/trunk/drivers/serial/21285.c b/trunk/drivers/serial/21285.c index 33fbda79f350..f8504b0adebc 100644 --- a/trunk/drivers/serial/21285.c +++ b/trunk/drivers/serial/21285.c @@ -110,7 +110,7 @@ static irqreturn_t serial21285_rx_chars(int irq, void *dev_id, struct pt_regs *r port->icount.rx++; rxs = *CSR_RXSTAT | RXSTAT_DUMMY_READ; - if (unlikely(rxs & RXSTAT_ANYERR)) { + if (rxs & RXSTAT_ANYERR) { if (rxs & RXSTAT_PARITY) port->icount.parity++; else if (rxs & RXSTAT_FRAME) diff --git a/trunk/drivers/serial/8250_hp300.c b/trunk/drivers/serial/8250_hp300.c index 4315afe9c080..b8d51eb56bff 100644 --- a/trunk/drivers/serial/8250_hp300.c +++ b/trunk/drivers/serial/8250_hp300.c @@ -9,15 +9,15 @@ #include #include #include +#include #include +#include #include #include #include #include #include -#include "8250.h" - #if !defined(CONFIG_HPDCA) && !defined(CONFIG_HPAPCI) #warning CONFIG_8250 defined but neither CONFIG_HPDCA nor CONFIG_HPAPCI defined, are you sure? #endif @@ -163,7 +163,7 @@ int __init hp300_setup_serial_console(void) static int __devinit hpdca_init_one(struct dio_dev *d, const struct dio_device_id *ent) { - struct uart_port port; + struct serial_struct serial_req; int line; #ifdef CONFIG_SERIAL_8250_CONSOLE @@ -172,22 +172,21 @@ static int __devinit hpdca_init_one(struct dio_dev *d, return 0; } #endif - memset(&port, 0, sizeof(struct uart_port)); + memset(&serial_req, 0, sizeof(struct serial_struct)); /* Memory mapped I/O */ - port.iotype = UPIO_MEM; - port.flags = UPF_SKIP_TEST | UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF; - port.irq = d->ipl; - port.uartclk = HPDCA_BAUD_BASE * 16; - port.mapbase = (d->resource.start + UART_OFFSET); - port.membase = (char *)(port.mapbase + DIO_VIRADDRBASE); - port.regshift = 1; - port.dev = &d->dev; - line = serial8250_register_port(&port); + serial_req.io_type = SERIAL_IO_MEM; + serial_req.flags = UPF_SKIP_TEST | UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF; + serial_req.irq = d->ipl; + serial_req.baud_base = HPDCA_BAUD_BASE; + serial_req.iomap_base = (d->resource.start + UART_OFFSET); + serial_req.iomem_base = (char *)(serial_req.iomap_base + DIO_VIRADDRBASE); + serial_req.iomem_reg_shift = 1; + line = register_serial(&serial_req); if (line < 0) { printk(KERN_NOTICE "8250_hp300: register_serial() DCA scode %d" - " irq %d failed\n", d->scode, port.irq); + " irq %d failed\n", d->scode, serial_req.irq); return -ENOMEM; } @@ -210,7 +209,7 @@ static int __init hp300_8250_init(void) #ifdef CONFIG_HPAPCI int line; unsigned long base; - struct uart_port uport; + struct serial_struct serial_req; struct hp300_port *port; int i; #endif @@ -252,25 +251,25 @@ static int __init hp300_8250_init(void) if (!port) return -ENOMEM; - memset(&uport, 0, sizeof(struct uart_port)); + memset(&serial_req, 0, sizeof(struct serial_struct)); base = (FRODO_BASE + FRODO_APCI_OFFSET(i)); /* Memory mapped I/O */ - uport.iotype = UPIO_MEM; - uport.flags = UPF_SKIP_TEST | UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF; + serial_req.io_type = SERIAL_IO_MEM; + serial_req.flags = UPF_SKIP_TEST | UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF; /* XXX - no interrupt support yet */ - uport.irq = 0; - uport.uartclk = HPAPCI_BAUD_BASE * 16; - uport.mapbase = base; - uport.membase = (char *)(base + DIO_VIRADDRBASE); - uport.regshift = 2; + serial_req.irq = 0; + serial_req.baud_base = HPAPCI_BAUD_BASE; + serial_req.iomap_base = base; + serial_req.iomem_base = (char *)(serial_req.iomap_base + DIO_VIRADDRBASE); + serial_req.iomem_reg_shift = 2; - line = serial8250_register_port(&uport); + line = register_serial(&serial_req); if (line < 0) { printk(KERN_NOTICE "8250_hp300: register_serial() APCI %d" - " irq %d failed\n", i, uport.irq); + " irq %d failed\n", i, serial_req.irq); kfree(port); continue; } @@ -300,7 +299,7 @@ static void __devexit hpdca_remove_one(struct dio_dev *d) /* Disable board-interrupts */ out_8(d->resource.start + DIO_VIRADDRBASE + DCA_IC, 0); } - serial8250_unregister_port(line); + unregister_serial(line); } #endif @@ -310,7 +309,7 @@ static void __exit hp300_8250_exit(void) struct hp300_port *port, *to_free; for (port = hp300_ports; port; ) { - serial8250_unregister_port(port->line); + unregister_serial(port->line); to_free = port; port = port->next; kfree(to_free); diff --git a/trunk/drivers/serial/amba-pl010.c b/trunk/drivers/serial/amba-pl010.c index f2a5e2933c47..484f6fb900b5 100644 --- a/trunk/drivers/serial/amba-pl010.c +++ b/trunk/drivers/serial/amba-pl010.c @@ -172,7 +172,7 @@ pl010_rx_chars(struct uart_port *port) * out of the main execution path */ rsr = UART_GET_RSR(port) | UART_DUMMY_RSR_RX; - if (unlikely(rsr & UART01x_RSR_ANY)) { + if (rsr & UART01x_RSR_ANY) { if (rsr & UART01x_RSR_BE) { rsr &= ~(UART01x_RSR_FE | UART01x_RSR_PE); port->icount.brk++; diff --git a/trunk/drivers/serial/amba-pl011.c b/trunk/drivers/serial/amba-pl011.c index d5cbef3fe8b6..ff658a830f34 100644 --- a/trunk/drivers/serial/amba-pl011.c +++ b/trunk/drivers/serial/amba-pl011.c @@ -137,7 +137,7 @@ pl011_rx_chars(struct uart_amba_port *uap) * out of the main execution path */ rsr = readw(uap->port.membase + UART01x_RSR) | UART_DUMMY_RSR_RX; - if (unlikely(rsr & UART01x_RSR_ANY)) { + if (rsr & UART01x_RSR_ANY) { if (rsr & UART01x_RSR_BE) { rsr &= ~(UART01x_RSR_FE | UART01x_RSR_PE); uap->port.icount.brk++; diff --git a/trunk/drivers/serial/clps711x.c b/trunk/drivers/serial/clps711x.c index 6242f3090a96..16592fae47f3 100644 --- a/trunk/drivers/serial/clps711x.c +++ b/trunk/drivers/serial/clps711x.c @@ -116,43 +116,54 @@ static irqreturn_t clps711xuart_int_rx(int irq, void *dev_id, struct pt_regs *re * Note that the error handling code is * out of the main execution path */ - if (unlikely(ch & UART_ANY_ERR)) { - if (ch & UARTDR_PARERR) - port->icount.parity++; - else if (ch & UARTDR_FRMERR) - port->icount.frame++; - if (ch & UARTDR_OVERR) - port->icount.overrun++; + if (ch & UART_ANY_ERR) + goto handle_error; - ch &= port->read_status_mask; + if (uart_handle_sysrq_char(port, ch, regs)) + goto ignore_char; - if (ch & UARTDR_PARERR) - flg = TTY_PARITY; - else if (ch & UARTDR_FRMERR) - flg = TTY_FRAME; + error_return: + tty_insert_flip_char(tty, ch, flg); + ignore_char: + status = clps_readl(SYSFLG(port)); + } + out: + tty_flip_buffer_push(tty); + return IRQ_HANDLED; -#ifdef SUPPORT_SYSRQ - port->sysrq = 0; -#endif - } + handle_error: + if (ch & UARTDR_PARERR) + port->icount.parity++; + else if (ch & UARTDR_FRMERR) + port->icount.frame++; + if (ch & UARTDR_OVERR) + port->icount.overrun++; + + if (ch & port->ignore_status_mask) { + if (++ignored > 100) + goto out; + goto ignore_char; + } + ch &= port->read_status_mask; - if (uart_handle_sysrq_char(port, ch, regs)) - goto ignore_char; + if (ch & UARTDR_PARERR) + flg = TTY_PARITY; + else if (ch & UARTDR_FRMERR) + flg = TTY_FRAME; + if (ch & UARTDR_OVERR) { /* * CHECK: does overrun affect the current character? * ASSUMPTION: it does not. */ - if ((ch & port->ignore_status_mask & ~RXSTAT_OVERRUN) == 0) - tty_insert_flip_char(tty, ch, flg); - if ((ch & ~port->ignore_status_mask & RXSTAT_OVERRUN) == 0) - tty_insert_flip_char(tty, 0, TTY_OVERRUN); - - ignore_char: - status = clps_readl(SYSFLG(port)); + tty_insert_flip_char(tty, ch, flg); + ch = 0; + flg = TTY_OVERRUN; } - tty_flip_buffer_push(tty); - return IRQ_HANDLED; +#ifdef SUPPORT_SYSRQ + port->sysrq = 0; +#endif + goto error_return; } static irqreturn_t clps711xuart_int_tx(int irq, void *dev_id, struct pt_regs *regs) diff --git a/trunk/drivers/serial/mpsc.c b/trunk/drivers/serial/mpsc.c index a8314aee2ab8..d0dfc3cf9245 100644 --- a/trunk/drivers/serial/mpsc.c +++ b/trunk/drivers/serial/mpsc.c @@ -329,8 +329,8 @@ mpsc_sdma_stop(struct mpsc_port_info *pi) mpsc_sdma_cmd(pi, SDMA_SDCM_AR | SDMA_SDCM_AT); /* Clear the SDMA current and first TX and RX pointers */ - mpsc_sdma_set_tx_ring(pi, NULL); - mpsc_sdma_set_rx_ring(pi, NULL); + mpsc_sdma_set_tx_ring(pi, 0); + mpsc_sdma_set_rx_ring(pi, 0); /* Disable interrupts */ mpsc_sdma_intr_mask(pi, 0xf); @@ -1540,8 +1540,8 @@ mpsc_shared_unmap_regs(void) MPSC_SDMA_INTR_REG_BLOCK_SIZE); } - mpsc_shared_regs.mpsc_routing_base = NULL; - mpsc_shared_regs.sdma_intr_base = NULL; + mpsc_shared_regs.mpsc_routing_base = 0; + mpsc_shared_regs.sdma_intr_base = 0; mpsc_shared_regs.mpsc_routing_base_p = 0; mpsc_shared_regs.sdma_intr_base_p = 0; @@ -1678,9 +1678,9 @@ mpsc_drv_unmap_regs(struct mpsc_port_info *pi) release_mem_region(pi->brg_base_p, MPSC_BRG_REG_BLOCK_SIZE); } - pi->mpsc_base = NULL; - pi->sdma_base = NULL; - pi->brg_base = NULL; + pi->mpsc_base = 0; + pi->sdma_base = 0; + pi->brg_base = 0; pi->mpsc_base_p = 0; pi->sdma_base_p = 0; diff --git a/trunk/drivers/serial/mpsc.h b/trunk/drivers/serial/mpsc.h index 678dbcf06c8f..1f7294b7095f 100644 --- a/trunk/drivers/serial/mpsc.h +++ b/trunk/drivers/serial/mpsc.h @@ -83,8 +83,8 @@ struct mpsc_shared_regs { phys_addr_t mpsc_routing_base_p; phys_addr_t sdma_intr_base_p; - void __iomem *mpsc_routing_base; - void __iomem *sdma_intr_base; + void *mpsc_routing_base; + void *sdma_intr_base; u32 MPSC_MRR_m; u32 MPSC_RCRR_m; @@ -120,9 +120,9 @@ struct mpsc_port_info { phys_addr_t brg_base_p; /* Virtual addresses of various blocks of registers (from platform) */ - void __iomem *mpsc_base; - void __iomem *sdma_base; - void __iomem *brg_base; + void *mpsc_base; + void *sdma_base; + void *brg_base; /* Descriptor ring and buffer allocations */ void *dma_region; diff --git a/trunk/drivers/serial/s3c2410.c b/trunk/drivers/serial/s3c2410.c index 435750d40a47..bd6782aeb831 100644 --- a/trunk/drivers/serial/s3c2410.c +++ b/trunk/drivers/serial/s3c2410.c @@ -364,7 +364,7 @@ s3c24xx_serial_rx_chars(int irq, void *dev_id, struct pt_regs *regs) flag = TTY_NORMAL; port->icount.rx++; - if (unlikely(uerstat & S3C2410_UERSTAT_ANY)) { + if (uerstat & S3C2410_UERSTAT_ANY) { dbg("rxerr: port ch=0x%02x, rxs=0x%08x\n", ch, uerstat); diff --git a/trunk/drivers/serial/sa1100.c b/trunk/drivers/serial/sa1100.c index 157218bc6c6f..086065210d1e 100644 --- a/trunk/drivers/serial/sa1100.c +++ b/trunk/drivers/serial/sa1100.c @@ -214,39 +214,56 @@ sa1100_rx_chars(struct sa1100_port *sport, struct pt_regs *regs) * note that the error handling code is * out of the main execution path */ - if (status & UTSR1_TO_SM(UTSR1_PRE | UTSR1_FRE | UTSR1_ROR)) { - if (status & UTSR1_TO_SM(UTSR1_PRE)) - sport->port.icount.parity++; - else if (status & UTSR1_TO_SM(UTSR1_FRE)) - sport->port.icount.frame++; - if (status & UTSR1_TO_SM(UTSR1_ROR)) - sport->port.icount.overrun++; - - status &= sport->port.read_status_mask; - - if (status & UTSR1_TO_SM(UTSR1_PRE)) - flg = TTY_PARITY; - else if (status & UTSR1_TO_SM(UTSR1_FRE)) - flg = TTY_FRAME; - -#ifdef SUPPORT_SYSRQ - sport->port.sysrq = 0; -#endif - } + if (status & UTSR1_TO_SM(UTSR1_PRE | UTSR1_FRE | UTSR1_ROR)) + goto handle_error; if (uart_handle_sysrq_char(&sport->port, ch, regs)) goto ignore_char; - if ((status & port->ignore_status_mask & ~UTSR1_TO_SM(UTSR1_ROR)) == 0) - tty_insert_flip_char(tty, ch, flg); - if (status & ~port->ignore_status_mask & UTSR1_TO_SM(UTSR1_ROR)) - tty_insert_flip_char(tty, 0, TTY_OVERRUN); - + error_return: + tty_insert_flip_char(tty, ch, flg); ignore_char: status = UTSR1_TO_SM(UART_GET_UTSR1(sport)) | UTSR0_TO_SM(UART_GET_UTSR0(sport)); } + out: tty_flip_buffer_push(tty); + return; + + handle_error: + if (status & UTSR1_TO_SM(UTSR1_PRE)) + sport->port.icount.parity++; + else if (status & UTSR1_TO_SM(UTSR1_FRE)) + sport->port.icount.frame++; + if (status & UTSR1_TO_SM(UTSR1_ROR)) + sport->port.icount.overrun++; + + if (status & sport->port.ignore_status_mask) { + if (++ignored > 100) + goto out; + goto ignore_char; + } + + status &= sport->port.read_status_mask; + + if (status & UTSR1_TO_SM(UTSR1_PRE)) + flg = TTY_PARITY; + else if (status & UTSR1_TO_SM(UTSR1_FRE)) + flg = TTY_FRAME; + + if (status & UTSR1_TO_SM(UTSR1_ROR)) { + /* + * overrun does *not* affect the character + * we read from the FIFO + */ + tty_insert_flip_char(tty, ch, flg); + ch = 0; + flg = TTY_OVERRUN; + } +#ifdef SUPPORT_SYSRQ + sport->port.sysrq = 0; +#endif + goto error_return; } static void sa1100_tx_chars(struct sa1100_port *sport) diff --git a/trunk/drivers/serial/serial_lh7a40x.c b/trunk/drivers/serial/serial_lh7a40x.c index 85cfa08d3bad..4ce3a41f1611 100644 --- a/trunk/drivers/serial/serial_lh7a40x.c +++ b/trunk/drivers/serial/serial_lh7a40x.c @@ -162,7 +162,7 @@ lh7a40xuart_rx_chars (struct uart_port* port) flag = TTY_NORMAL; ++port->icount.rx; - if (unlikely(data & RxError)) { /* Quick check, short-circuit */ + if (data & RxError) { /* Quick check, short-circuit */ if (data & RxBreak) { data &= ~(RxFramingError | RxParityError); ++port->icount.brk; diff --git a/trunk/drivers/usb/core/usb.c b/trunk/drivers/usb/core/usb.c index 25cf7e9eccfa..c231b4bef314 100644 --- a/trunk/drivers/usb/core/usb.c +++ b/trunk/drivers/usb/core/usb.c @@ -611,10 +611,11 @@ static int usb_hotplug (struct device *dev, char **envp, int num_envp, if (add_hotplug_env_var(envp, num_envp, &i, buffer, buffer_size, &length, - "MODALIAS=usb:v%04Xp%04Xd%04Xdc%02Xdsc%02Xdp%02Xic%02Xisc%02Xip%02X", + "MODALIAS=usb:v%04Xp%04Xdl%04Xdh%04Xdc%02Xdsc%02Xdp%02Xic%02Xisc%02Xip%02X", le16_to_cpu(usb_dev->descriptor.idVendor), le16_to_cpu(usb_dev->descriptor.idProduct), le16_to_cpu(usb_dev->descriptor.bcdDevice), + le16_to_cpu(usb_dev->descriptor.bcdDevice), usb_dev->descriptor.bDeviceClass, usb_dev->descriptor.bDeviceSubClass, usb_dev->descriptor.bDeviceProtocol, @@ -625,10 +626,11 @@ static int usb_hotplug (struct device *dev, char **envp, int num_envp, } else { if (add_hotplug_env_var(envp, num_envp, &i, buffer, buffer_size, &length, - "MODALIAS=usb:v%04Xp%04Xd%04Xdc%02Xdsc%02Xdp%02Xic*isc*ip*", + "MODALIAS=usb:v%04Xp%04Xdl%04Xdh%04Xdc%02Xdsc%02Xdp%02Xic*isc*ip*", le16_to_cpu(usb_dev->descriptor.idVendor), le16_to_cpu(usb_dev->descriptor.idProduct), le16_to_cpu(usb_dev->descriptor.bcdDevice), + le16_to_cpu(usb_dev->descriptor.bcdDevice), usb_dev->descriptor.bDeviceClass, usb_dev->descriptor.bDeviceSubClass, usb_dev->descriptor.bDeviceProtocol)) diff --git a/trunk/drivers/usb/image/microtek.c b/trunk/drivers/usb/image/microtek.c index 7d21a4f5c425..cab89a970c7f 100644 --- a/trunk/drivers/usb/image/microtek.c +++ b/trunk/drivers/usb/image/microtek.c @@ -335,7 +335,7 @@ static int mts_scsi_abort (Scsi_Cmnd *srb) mts_urb_abort(desc); - return FAILED; + return FAILURE; } static int mts_scsi_host_reset (Scsi_Cmnd *srb) diff --git a/trunk/drivers/usb/input/ati_remote.c b/trunk/drivers/usb/input/ati_remote.c index 860df26323b1..355add5c29f5 100644 --- a/trunk/drivers/usb/input/ati_remote.c +++ b/trunk/drivers/usb/input/ati_remote.c @@ -619,7 +619,7 @@ static void ati_remote_delete(struct ati_remote *ati_remote) if (ati_remote->outbuf) usb_buffer_free(ati_remote->udev, DATA_BUFSIZE, - ati_remote->outbuf, ati_remote->outbuf_dma); + ati_remote->inbuf, ati_remote->outbuf_dma); if (ati_remote->irq_urb) usb_free_urb(ati_remote->irq_urb); diff --git a/trunk/drivers/usb/input/usbkbd.c b/trunk/drivers/usb/input/usbkbd.c index 7038fb9d1ced..01514b0551b8 100644 --- a/trunk/drivers/usb/input/usbkbd.c +++ b/trunk/drivers/usb/input/usbkbd.c @@ -133,8 +133,7 @@ static void usb_kbd_irq(struct urb *urb, struct pt_regs *regs) kbd->usbdev->devpath, i); } -static int usb_kbd_event(struct input_dev *dev, unsigned int type, - unsigned int code, int value) +int usb_kbd_event(struct input_dev *dev, unsigned int type, unsigned int code, int value) { struct usb_kbd *kbd = dev->private; diff --git a/trunk/drivers/usb/media/pwc/pwc-ctrl.c b/trunk/drivers/usb/media/pwc/pwc-ctrl.c index 42352f531bc0..26aa914bc541 100644 --- a/trunk/drivers/usb/media/pwc/pwc-ctrl.c +++ b/trunk/drivers/usb/media/pwc/pwc-ctrl.c @@ -418,44 +418,6 @@ static inline int set_video_mode_Kiara(struct pwc_device *pdev, int size, int fr -static void pwc_set_image_buffer_size(struct pwc_device *pdev) -{ - int i, factor = 0, filler = 0; - - /* for PALETTE_YUV420P */ - switch(pdev->vpalette) - { - case VIDEO_PALETTE_YUV420P: - factor = 6; - filler = 128; - break; - case VIDEO_PALETTE_RAW: - factor = 6; /* can be uncompressed YUV420P */ - filler = 0; - break; - } - - /* Set sizes in bytes */ - pdev->image.size = pdev->image.x * pdev->image.y * factor / 4; - pdev->view.size = pdev->view.x * pdev->view.y * factor / 4; - - /* Align offset, or you'll get some very weird results in - YUV420 mode... x must be multiple of 4 (to get the Y's in - place), and y even (or you'll mixup U & V). This is less of a - problem for YUV420P. - */ - pdev->offset.x = ((pdev->view.x - pdev->image.x) / 2) & 0xFFFC; - pdev->offset.y = ((pdev->view.y - pdev->image.y) / 2) & 0xFFFE; - - /* Fill buffers with gray or black */ - for (i = 0; i < MAX_IMAGES; i++) { - if (pdev->image_ptr[i] != NULL) - memset(pdev->image_ptr[i], filler, pdev->view.size); - } -} - - - /** @pdev: device structure @width: viewport width @@ -513,6 +475,44 @@ int pwc_set_video_mode(struct pwc_device *pdev, int width, int height, int frame } +void pwc_set_image_buffer_size(struct pwc_device *pdev) +{ + int i, factor = 0, filler = 0; + + /* for PALETTE_YUV420P */ + switch(pdev->vpalette) + { + case VIDEO_PALETTE_YUV420P: + factor = 6; + filler = 128; + break; + case VIDEO_PALETTE_RAW: + factor = 6; /* can be uncompressed YUV420P */ + filler = 0; + break; + } + + /* Set sizes in bytes */ + pdev->image.size = pdev->image.x * pdev->image.y * factor / 4; + pdev->view.size = pdev->view.x * pdev->view.y * factor / 4; + + /* Align offset, or you'll get some very weird results in + YUV420 mode... x must be multiple of 4 (to get the Y's in + place), and y even (or you'll mixup U & V). This is less of a + problem for YUV420P. + */ + pdev->offset.x = ((pdev->view.x - pdev->image.x) / 2) & 0xFFFC; + pdev->offset.y = ((pdev->view.y - pdev->image.y) / 2) & 0xFFFE; + + /* Fill buffers with gray or black */ + for (i = 0; i < MAX_IMAGES; i++) { + if (pdev->image_ptr[i] != NULL) + memset(pdev->image_ptr[i], filler, pdev->view.size); + } +} + + + /* BRIGHTNESS */ int pwc_get_brightness(struct pwc_device *pdev) @@ -949,7 +949,7 @@ int pwc_set_leds(struct pwc_device *pdev, int on_value, int off_value) return SendControlMsg(SET_STATUS_CTL, LED_FORMATTER, 2); } -static int pwc_get_leds(struct pwc_device *pdev, int *on_value, int *off_value) +int pwc_get_leds(struct pwc_device *pdev, int *on_value, int *off_value) { unsigned char buf[2]; int ret; diff --git a/trunk/drivers/usb/media/pwc/pwc-if.c b/trunk/drivers/usb/media/pwc/pwc-if.c index c53e2263b7fb..100a5a4f03a3 100644 --- a/trunk/drivers/usb/media/pwc/pwc-if.c +++ b/trunk/drivers/usb/media/pwc/pwc-if.c @@ -129,7 +129,7 @@ static int default_mbufs = 2; /* Default number of mmap() buffers */ int pwc_trace = TRACE_MODULE | TRACE_FLOW | TRACE_PWCX; static int power_save = 0; static int led_on = 100, led_off = 0; /* defaults to LED that is on while in use */ -static int pwc_preferred_compression = 2; /* 0..3 = uncompressed..high */ + int pwc_preferred_compression = 2; /* 0..3 = uncompressed..high */ static struct { int type; char serial_number[30]; @@ -322,7 +322,7 @@ static int pwc_allocate_buffers(struct pwc_device *pdev) case 730: case 740: case 750: - Trace(TRACE_MEMORY,"private_data(%zu)\n",sizeof(struct pwc_dec23_private)); + Trace(TRACE_MEMORY,"private_data(%Zd)\n",sizeof(struct pwc_dec23_private)); kbuf = kmalloc(sizeof(struct pwc_dec23_private), GFP_KERNEL); /* Timon & Kiara */ break; case 645: @@ -1179,7 +1179,7 @@ static ssize_t pwc_video_read(struct file *file, char __user * buf, DECLARE_WAITQUEUE(wait, current); int bytes_to_read; - Trace(TRACE_READ, "video_read(0x%p, %p, %zu) called.\n", vdev, buf, count); + Trace(TRACE_READ, "video_read(0x%p, %p, %Zd) called.\n", vdev, buf, count); if (vdev == NULL) return -EFAULT; pdev = vdev->priv; diff --git a/trunk/drivers/usb/media/pwc/pwc.h b/trunk/drivers/usb/media/pwc/pwc.h index 267869dab185..53b516d29cf5 100644 --- a/trunk/drivers/usb/media/pwc/pwc.h +++ b/trunk/drivers/usb/media/pwc/pwc.h @@ -226,8 +226,9 @@ struct pwc_device extern "C" { #endif -/* Global variable */ +/* Global variables */ extern int pwc_trace; +extern int pwc_preferred_compression; /** functions in pwc-if.c */ int pwc_try_video_mode(struct pwc_device *pdev, int width, int height, int new_fps, int new_compression, int new_snapshot); @@ -242,6 +243,8 @@ void pwc_construct(struct pwc_device *pdev); /** Functions in pwc-ctrl.c */ /* Request a certain video mode. Returns < 0 if not possible */ extern int pwc_set_video_mode(struct pwc_device *pdev, int width, int height, int frames, int compression, int snapshot); +/* Calculate the number of bytes per image (not frame) */ +extern void pwc_set_image_buffer_size(struct pwc_device *pdev); /* Various controls; should be obvious. Value 0..65535, or < 0 on error */ extern int pwc_get_brightness(struct pwc_device *pdev); @@ -253,6 +256,7 @@ extern int pwc_set_gamma(struct pwc_device *pdev, int value); extern int pwc_get_saturation(struct pwc_device *pdev); extern int pwc_set_saturation(struct pwc_device *pdev, int value); extern int pwc_set_leds(struct pwc_device *pdev, int on_value, int off_value); +extern int pwc_get_leds(struct pwc_device *pdev, int *on_value, int *off_value); extern int pwc_get_cmos_sensor(struct pwc_device *pdev, int *sensor); /* Power down or up the camera; not supported by all models */ diff --git a/trunk/drivers/usb/media/sn9c102_core.c b/trunk/drivers/usb/media/sn9c102_core.c index 31d57400d5be..898401cf7dcc 100644 --- a/trunk/drivers/usb/media/sn9c102_core.c +++ b/trunk/drivers/usb/media/sn9c102_core.c @@ -429,7 +429,7 @@ sn9c102_i2c_try_read(struct sn9c102_device* cam, } -static int +int sn9c102_i2c_try_write(struct sn9c102_device* cam, struct sn9c102_sensor* sensor, u8 address, u8 value) { @@ -785,7 +785,7 @@ static int sn9c102_stop_transfer(struct sn9c102_device* cam) } -static int sn9c102_stream_interrupt(struct sn9c102_device* cam) +int sn9c102_stream_interrupt(struct sn9c102_device* cam) { int err = 0; diff --git a/trunk/drivers/usb/media/sn9c102_sensor.h b/trunk/drivers/usb/media/sn9c102_sensor.h index 6a7adebcb4bf..16f7483559f0 100644 --- a/trunk/drivers/usb/media/sn9c102_sensor.h +++ b/trunk/drivers/usb/media/sn9c102_sensor.h @@ -145,6 +145,8 @@ static const struct usb_device_id sn9c102_id_table[] = { \ */ /* The "try" I2C I/O versions are used when probing the sensor */ +extern int sn9c102_i2c_try_write(struct sn9c102_device*,struct sn9c102_sensor*, + u8 address, u8 value); extern int sn9c102_i2c_try_read(struct sn9c102_device*,struct sn9c102_sensor*, u8 address); diff --git a/trunk/drivers/usb/misc/sisusbvga/sisusb.c b/trunk/drivers/usb/misc/sisusbvga/sisusb.c index 2fd12264fd53..57b82d53a940 100644 --- a/trunk/drivers/usb/misc/sisusbvga/sisusb.c +++ b/trunk/drivers/usb/misc/sisusbvga/sisusb.c @@ -983,7 +983,7 @@ static int sisusb_write_mem_bulk(struct sisusb_usb_data *sisusb, u32 addr, msgcount++; if (msgcount < 500) printk(KERN_ERR - "sisusbvga[%d]: Wrote %zd of " + "sisusbvga[%d]: Wrote %Zd of " "%d bytes, error %d\n", sisusb->minor, *bytes_written, length, ret); @@ -3105,7 +3105,6 @@ static void sisusb_disconnect(struct usb_interface *intf) static struct usb_device_id sisusb_table [] = { { USB_DEVICE(0x0711, 0x0900) }, { USB_DEVICE(0x182d, 0x021c) }, - { USB_DEVICE(0x182d, 0x0269) }, { } }; diff --git a/trunk/drivers/usb/net/pegasus.c b/trunk/drivers/usb/net/pegasus.c index d976790312aa..a02be795d63e 100644 --- a/trunk/drivers/usb/net/pegasus.c +++ b/trunk/drivers/usb/net/pegasus.c @@ -1388,11 +1388,11 @@ static int pegasus_resume (struct usb_interface *intf) if (netif_running(pegasus->net)) { pegasus->rx_urb->status = 0; pegasus->rx_urb->actual_length = 0; - read_bulk_callback(pegasus->rx_urb, NULL); + read_bulk_callback(pegasus->rx_urb, 0); pegasus->intr_urb->status = 0; pegasus->intr_urb->actual_length = 0; - intr_callback(pegasus->intr_urb, NULL); + intr_callback(pegasus->intr_urb, 0); queue_delayed_work(pegasus_workqueue, &pegasus->carrier_check, CARRIER_CHECK_DELAY); diff --git a/trunk/drivers/usb/net/usbnet.c b/trunk/drivers/usb/net/usbnet.c index a45ea7c97356..bbaef047d532 100644 --- a/trunk/drivers/usb/net/usbnet.c +++ b/trunk/drivers/usb/net/usbnet.c @@ -1,6 +1,6 @@ /* * USB Networking Links - * Copyright (C) 2000-2005 by David Brownell + * Copyright (C) 2000-2003 by David Brownell * Copyright (C) 2002 Pavel Machek * Copyright (C) 2003-2005 David Hollis * Copyright (C) 2005 Phil Chang @@ -210,7 +210,6 @@ struct usbnet { # define EVENT_RX_HALT 1 # define EVENT_RX_MEMORY 2 # define EVENT_STS_SPLIT 3 -# define EVENT_LINK_RESET 4 }; // device-specific info used by the driver @@ -244,9 +243,6 @@ struct driver_info { /* for status polling */ void (*status)(struct usbnet *, struct urb *); - /* link reset handling, called from defer_kevent */ - int (*link_reset)(struct usbnet *); - /* fixup rx packet (strip framing) */ int (*rx_fixup)(struct usbnet *dev, struct sk_buff *skb); @@ -308,7 +304,6 @@ static void usbnet_get_drvinfo (struct net_device *, struct ethtool_drvinfo *); static u32 usbnet_get_link (struct net_device *); static u32 usbnet_get_msglevel (struct net_device *); static void usbnet_set_msglevel (struct net_device *, u32); -static void defer_kevent (struct usbnet *, int); /* mostly for PDA style devices, which are always connected if present */ static int always_connected (struct usbnet *dev) @@ -431,7 +426,7 @@ static void skb_return (struct usbnet *dev, struct sk_buff *skb) dev->stats.rx_bytes += skb->len; if (netif_msg_rx_status (dev)) - devdbg (dev, "< rx, len %zu, type 0x%x", + devdbg (dev, "< rx, len %zd, type 0x%x", skb->len + sizeof (struct ethhdr), skb->protocol); memset (skb->cb, 0, sizeof (struct skb_data)); status = netif_rx (skb); @@ -506,7 +501,6 @@ static const struct driver_info an2720_info = { #define AX_CMD_WRITE_MULTI_FILTER 0x16 #define AX_CMD_READ_NODE_ID 0x17 #define AX_CMD_READ_PHY_ID 0x19 -#define AX_CMD_READ_MEDIUM_STATUS 0x1a #define AX_CMD_WRITE_MEDIUM_MODE 0x1b #define AX_CMD_READ_MONITOR_MODE 0x1c #define AX_CMD_WRITE_MONITOR_MODE 0x1d @@ -521,14 +515,11 @@ static const struct driver_info an2720_info = { #define AX_MONITOR_MAGIC 0x04 #define AX_MONITOR_HSFS 0x10 -/* AX88172 Medium Status Register values */ -#define AX_MEDIUM_FULL_DUPLEX 0x02 -#define AX_MEDIUM_TX_ABORT_ALLOW 0x04 -#define AX_MEDIUM_FLOW_CONTROL_EN 0x10 - #define AX_MCAST_FILTER_SIZE 8 #define AX_MAX_MCAST 64 +#define AX_INTERRUPT_BUFSIZE 8 + #define AX_EEPROM_LEN 0x40 #define AX_SWRESET_CLEAR 0x00 @@ -544,33 +535,15 @@ static const struct driver_info an2720_info = { #define AX88772_IPG1_DEFAULT 0x0c #define AX88772_IPG2_DEFAULT 0x12 -#define AX88772_MEDIUM_FULL_DUPLEX 0x0002 -#define AX88772_MEDIUM_RESERVED 0x0004 -#define AX88772_MEDIUM_RX_FC_ENABLE 0x0010 -#define AX88772_MEDIUM_TX_FC_ENABLE 0x0020 -#define AX88772_MEDIUM_PAUSE_FORMAT 0x0080 -#define AX88772_MEDIUM_RX_ENABLE 0x0100 -#define AX88772_MEDIUM_100MB 0x0200 -#define AX88772_MEDIUM_DEFAULT \ - (AX88772_MEDIUM_FULL_DUPLEX | AX88772_MEDIUM_RX_FC_ENABLE | \ - AX88772_MEDIUM_TX_FC_ENABLE | AX88772_MEDIUM_100MB | \ - AX88772_MEDIUM_RESERVED | AX88772_MEDIUM_RX_ENABLE ) - #define AX_EEPROM_MAGIC 0xdeadbeef /* This structure cannot exceed sizeof(unsigned long [5]) AKA 20 bytes */ struct ax8817x_data { u8 multi_filter[AX_MCAST_FILTER_SIZE]; + struct urb *int_urb; + u8 *int_buf; }; -struct ax88172_int_data { - u16 res1; - u8 link; - u16 res2; - u8 status; - u16 res3; -} __attribute__ ((packed)); - static int ax8817x_read_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index, u16 size, void *data) { @@ -613,23 +586,25 @@ static void ax8817x_async_cmd_callback(struct urb *urb, struct pt_regs *regs) usb_free_urb(urb); } -static void ax8817x_status(struct usbnet *dev, struct urb *urb) +static void ax8817x_interrupt_complete(struct urb *urb, struct pt_regs *regs) { - struct ax88172_int_data *event; + struct usbnet *dev = (struct usbnet *)urb->context; + struct ax8817x_data *data = (struct ax8817x_data *)&dev->data; int link; - if (urb->actual_length < 8) - return; - - event = urb->transfer_buffer; - link = event->link & 0x01; - if (netif_carrier_ok(dev->net) != link) { - if (link) { - netif_carrier_on(dev->net); - defer_kevent (dev, EVENT_LINK_RESET ); - } else - netif_carrier_off(dev->net); - devdbg(dev, "ax8817x - Link Status is: %d", link); + if (urb->status < 0) { + devdbg(dev,"ax8817x_interrupt_complete() failed with %d", + urb->status); + } else { + link = data->int_buf[2] & 0x01; + if (netif_carrier_ok(dev->net) != link) { + if (link) + netif_carrier_on(dev->net); + else + netif_carrier_off(dev->net); + devdbg(dev, "ax8817x - Link Status is: %d", link); + } + usb_submit_urb(data->int_urb, GFP_ATOMIC); } } @@ -736,20 +711,6 @@ static void ax8817x_mdio_write(struct net_device *netdev, int phy_id, int loc, i ax8817x_write_cmd(dev, AX_CMD_SET_HW_MII, 0, 0, 0, &buf); } -static int ax88172_link_reset(struct usbnet *dev) -{ - u16 lpa; - u8 mode; - - mode = AX_MEDIUM_TX_ABORT_ALLOW | AX_MEDIUM_FLOW_CONTROL_EN; - lpa = ax8817x_mdio_read(dev->net, dev->mii.phy_id, MII_LPA); - if (lpa & LPA_DUPLEX) - mode |= AX_MEDIUM_FULL_DUPLEX; - ax8817x_write_cmd(dev, AX_CMD_WRITE_MEDIUM_MODE, mode, 0, 0, NULL); - - return 0; -} - static void ax8817x_get_wol(struct net_device *net, struct ethtool_wolinfo *wolinfo) { struct usbnet *dev = netdev_priv(net); @@ -863,13 +824,35 @@ static int ax8817x_bind(struct usbnet *dev, struct usb_interface *intf) void *buf; int i; unsigned long gpio_bits = dev->driver_info->data; + struct ax8817x_data *data = (struct ax8817x_data *)dev->data; get_endpoints(dev,intf); + if ((data->int_urb = usb_alloc_urb (0, GFP_KERNEL)) == NULL) { + dbg ("%s: cannot allocate interrupt URB", + dev->net->name); + ret = -ENOMEM; + goto out1; + } + + if ((data->int_buf = kmalloc(AX_INTERRUPT_BUFSIZE, GFP_KERNEL)) == NULL) { + dbg ("%s: cannot allocate memory for interrupt buffer", + dev->net->name); + ret = -ENOMEM; + goto out1; + } + memset(data->int_buf, 0, AX_INTERRUPT_BUFSIZE); + + usb_fill_int_urb (data->int_urb, dev->udev, + usb_rcvintpipe (dev->udev, 1), + data->int_buf, AX_INTERRUPT_BUFSIZE, + ax8817x_interrupt_complete, dev, + dev->udev->speed == USB_SPEED_HIGH ? 8 : 100); + buf = kmalloc(ETH_ALEN, GFP_KERNEL); if(!buf) { ret = -ENOMEM; - goto out1; + goto out2; } /* Toggle the GPIOs in a manufacturer/model specific way */ @@ -877,32 +860,32 @@ static int ax8817x_bind(struct usbnet *dev, struct usb_interface *intf) if ((ret = ax8817x_write_cmd(dev, AX_CMD_WRITE_GPIOS, (gpio_bits >> (i * 8)) & 0xff, 0, 0, buf)) < 0) - goto out2; + goto out3; msleep(5); } if ((ret = ax8817x_write_cmd(dev, AX_CMD_WRITE_RX_CTL, 0x80, 0, 0, buf)) < 0) { dbg("send AX_CMD_WRITE_RX_CTL failed: %d", ret); - goto out2; + goto out3; } /* Get the MAC address */ memset(buf, 0, ETH_ALEN); if ((ret = ax8817x_read_cmd(dev, AX_CMD_READ_NODE_ID, 0, 0, 6, buf)) < 0) { dbg("read AX_CMD_READ_NODE_ID failed: %d", ret); - goto out2; + goto out3; } memcpy(dev->net->dev_addr, buf, ETH_ALEN); /* Get the PHY id */ if ((ret = ax8817x_read_cmd(dev, AX_CMD_READ_PHY_ID, 0, 0, 2, buf)) < 0) { dbg("error on read AX_CMD_READ_PHY_ID: %02x", ret); - goto out2; + goto out3; } else if (ret < 2) { /* this should always return 2 bytes */ dbg("AX_CMD_READ_PHY_ID returned less than 2 bytes: ret=%02x", ret); ret = -EIO; - goto out2; + goto out3; } /* Initialize MII structure */ @@ -916,18 +899,36 @@ static int ax8817x_bind(struct usbnet *dev, struct usb_interface *intf) dev->net->set_multicast_list = ax8817x_set_multicast; dev->net->ethtool_ops = &ax8817x_ethtool_ops; - ax8817x_mdio_write(dev->net, dev->mii.phy_id, MII_BMCR, BMCR_RESET); + ax8817x_mdio_write(dev->net, dev->mii.phy_id, MII_BMCR, + cpu_to_le16(BMCR_RESET)); ax8817x_mdio_write(dev->net, dev->mii.phy_id, MII_ADVERTISE, - ADVERTISE_ALL | ADVERTISE_CSMA | ADVERTISE_PAUSE_CAP); + cpu_to_le16(ADVERTISE_ALL | ADVERTISE_CSMA | 0x0400)); mii_nway_restart(&dev->mii); + if((ret = usb_submit_urb(data->int_urb, GFP_KERNEL)) < 0) { + dbg("Failed to submit interrupt URB: %02x", ret); + goto out2; + } + return 0; -out2: +out3: kfree(buf); +out2: + kfree(data->int_buf); out1: + usb_free_urb(data->int_urb); return ret; } +static void ax8817x_unbind(struct usbnet *dev, struct usb_interface *intf) +{ + struct ax8817x_data *data = (struct ax8817x_data *)dev->data; + + usb_kill_urb(data->int_urb); + usb_free_urb(data->int_urb); + kfree(data->int_buf); +} + static struct ethtool_ops ax88772_ethtool_ops = { .get_drvinfo = ax8817x_get_drvinfo, .get_link = ethtool_op_get_link, @@ -945,44 +946,64 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf) { int ret; void *buf; + struct ax8817x_data *data = (struct ax8817x_data *)dev->data; get_endpoints(dev,intf); + if ((data->int_urb = usb_alloc_urb (0, GFP_KERNEL)) == 0) { + dbg ("Cannot allocate interrupt URB"); + ret = -ENOMEM; + goto out1; + } + + if ((data->int_buf = kmalloc(AX_INTERRUPT_BUFSIZE, GFP_KERNEL)) == NULL) { + dbg ("Cannot allocate memory for interrupt buffer"); + ret = -ENOMEM; + goto out1; + } + memset(data->int_buf, 0, AX_INTERRUPT_BUFSIZE); + + usb_fill_int_urb (data->int_urb, dev->udev, + usb_rcvintpipe (dev->udev, 1), + data->int_buf, AX_INTERRUPT_BUFSIZE, + ax8817x_interrupt_complete, dev, + dev->udev->speed == USB_SPEED_HIGH ? 8 : 100); + buf = kmalloc(6, GFP_KERNEL); if(!buf) { dbg ("Cannot allocate memory for buffer"); ret = -ENOMEM; - goto out1; + goto out2; } if ((ret = ax8817x_write_cmd(dev, AX_CMD_WRITE_GPIOS, 0x00B0, 0, 0, buf)) < 0) - goto out2; + goto out3; msleep(5); if ((ret = ax8817x_write_cmd(dev, AX_CMD_SW_PHY_SELECT, 0x0001, 0, 0, buf)) < 0) { dbg("Select PHY #1 failed: %d", ret); - goto out2; + goto out3; } if ((ret = ax8817x_write_cmd(dev, AX_CMD_SW_RESET, AX_SWRESET_IPPD, 0, 0, buf)) < 0) { dbg("Failed to power down internal PHY: %d", ret); - goto out2; + goto out3; } msleep(150); if ((ret = ax8817x_write_cmd(dev, AX_CMD_SW_RESET, AX_SWRESET_CLEAR, 0, 0, buf)) < 0) { dbg("Failed to perform software reset: %d", ret); - goto out2; + goto out3; } msleep(150); if ((ret = ax8817x_write_cmd(dev, AX_CMD_SW_RESET, AX_SWRESET_IPRL | AX_SWRESET_PRL, 0, 0, buf)) < 0) { dbg("Failed to set Internal/External PHY reset control: %d", ret); - goto out2; + goto out3; } msleep(150); @@ -990,27 +1011,27 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf) ax8817x_write_cmd(dev, AX_CMD_WRITE_RX_CTL, 0x0000, 0, 0, buf)) < 0) { dbg("Failed to reset RX_CTL: %d", ret); - goto out2; + goto out3; } /* Get the MAC address */ memset(buf, 0, ETH_ALEN); if ((ret = ax8817x_read_cmd(dev, AX88772_CMD_READ_NODE_ID, 0, 0, ETH_ALEN, buf)) < 0) { dbg("Failed to read MAC address: %d", ret); - goto out2; + goto out3; } memcpy(dev->net->dev_addr, buf, ETH_ALEN); if ((ret = ax8817x_write_cmd(dev, AX_CMD_SET_SW_MII, 0, 0, 0, buf)) < 0) { dbg("Enabling software MII failed: %d", ret); - goto out2; + goto out3; } if (((ret = ax8817x_read_cmd(dev, AX_CMD_READ_MII_REG, 0x0010, 2, 2, buf)) < 0) || (*((u16 *)buf) != 0x003b)) { dbg("Read PHY register 2 must be 0x3b00: %d", ret); - goto out2; + goto out3; } /* Initialize MII structure */ @@ -1023,26 +1044,26 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf) /* Get the PHY id */ if ((ret = ax8817x_read_cmd(dev, AX_CMD_READ_PHY_ID, 0, 0, 2, buf)) < 0) { dbg("Error reading PHY ID: %02x", ret); - goto out2; + goto out3; } else if (ret < 2) { /* this should always return 2 bytes */ dbg("AX_CMD_READ_PHY_ID returned less than 2 bytes: ret=%02x", ret); ret = -EIO; - goto out2; + goto out3; } dev->mii.phy_id = *((u8 *)buf + 1); if ((ret = ax8817x_write_cmd(dev, AX_CMD_SW_RESET, AX_SWRESET_PRL, 0, 0, buf)) < 0) { dbg("Set external PHY reset pin level: %d", ret); - goto out2; + goto out3; } msleep(150); if ((ret = ax8817x_write_cmd(dev, AX_CMD_SW_RESET, AX_SWRESET_IPRL | AX_SWRESET_PRL, 0, 0, buf)) < 0) { dbg("Set Internal/External PHY reset control: %d", ret); - goto out2; + goto out3; } msleep(150); @@ -1050,24 +1071,25 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf) dev->net->set_multicast_list = ax8817x_set_multicast; dev->net->ethtool_ops = &ax88772_ethtool_ops; - ax8817x_mdio_write(dev->net, dev->mii.phy_id, MII_BMCR, BMCR_RESET); + ax8817x_mdio_write(dev->net, dev->mii.phy_id, MII_BMCR, + cpu_to_le16(BMCR_RESET)); ax8817x_mdio_write(dev->net, dev->mii.phy_id, MII_ADVERTISE, - ADVERTISE_ALL | ADVERTISE_CSMA); + cpu_to_le16(ADVERTISE_ALL | ADVERTISE_CSMA)); mii_nway_restart(&dev->mii); - if ((ret = ax8817x_write_cmd(dev, AX_CMD_WRITE_MEDIUM_MODE, AX88772_MEDIUM_DEFAULT, 0, 0, buf)) < 0) { + if ((ret = ax8817x_write_cmd(dev, AX_CMD_WRITE_MEDIUM_MODE, 0x0336, 0, 0, buf)) < 0) { dbg("Write medium mode register: %d", ret); - goto out2; + goto out3; } if ((ret = ax8817x_write_cmd(dev, AX_CMD_WRITE_IPG0, AX88772_IPG0_DEFAULT | AX88772_IPG1_DEFAULT,AX88772_IPG2_DEFAULT, 0, buf)) < 0) { dbg("Write IPG,IPG1,IPG2 failed: %d", ret); - goto out2; + goto out3; } if ((ret = ax8817x_write_cmd(dev, AX_CMD_SET_HW_MII, 0, 0, 0, &buf)) < 0) { dbg("Failed to set hardware MII: %02x", ret); - goto out2; + goto out3; } /* Set RX_CTL to default values with 2k buffer, and enable cactus */ @@ -1075,16 +1097,25 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf) ax8817x_write_cmd(dev, AX_CMD_WRITE_RX_CTL, 0x0088, 0, 0, buf)) < 0) { dbg("Reset RX_CTL failed: %d", ret); - goto out2; + goto out3; + } + + if((ret = usb_submit_urb(data->int_urb, GFP_KERNEL)) < 0) { + dbg("Failed to submit interrupt URB: %02x", ret); + goto out3; } kfree(buf); return 0; -out2: +out3: kfree(buf); +out2: + kfree(data->int_buf); out1: + usb_free_urb(data->int_urb); + return ret; } @@ -1182,29 +1213,10 @@ static struct sk_buff *ax88772_tx_fixup(struct usbnet *dev, struct sk_buff *skb, return skb; } -static int ax88772_link_reset(struct usbnet *dev) -{ - u16 lpa; - u16 mode; - - mode = AX88772_MEDIUM_DEFAULT; - lpa = ax8817x_mdio_read(dev->net, dev->mii.phy_id, MII_LPA); - - if ((lpa & LPA_DUPLEX) == 0) - mode &= ~AX88772_MEDIUM_FULL_DUPLEX; - if ((lpa & LPA_100) == 0) - mode &= ~AX88772_MEDIUM_100MB; - ax8817x_write_cmd(dev, AX_CMD_WRITE_MEDIUM_MODE, mode, 0, 0, NULL); - - return 0; -} - static const struct driver_info ax8817x_info = { .description = "ASIX AX8817x USB 2.0 Ethernet", .bind = ax8817x_bind, - .status = ax8817x_status, - .link_reset = ax88172_link_reset, - .reset = ax88172_link_reset, + .unbind = ax8817x_unbind, .flags = FLAG_ETHER, .data = 0x00130103, }; @@ -1212,9 +1224,7 @@ static const struct driver_info ax8817x_info = { static const struct driver_info dlink_dub_e100_info = { .description = "DLink DUB-E100 USB Ethernet", .bind = ax8817x_bind, - .status = ax8817x_status, - .link_reset = ax88172_link_reset, - .reset = ax88172_link_reset, + .unbind = ax8817x_unbind, .flags = FLAG_ETHER, .data = 0x009f9d9f, }; @@ -1222,9 +1232,7 @@ static const struct driver_info dlink_dub_e100_info = { static const struct driver_info netgear_fa120_info = { .description = "Netgear FA-120 USB Ethernet", .bind = ax8817x_bind, - .status = ax8817x_status, - .link_reset = ax88172_link_reset, - .reset = ax88172_link_reset, + .unbind = ax8817x_unbind, .flags = FLAG_ETHER, .data = 0x00130103, }; @@ -1232,9 +1240,7 @@ static const struct driver_info netgear_fa120_info = { static const struct driver_info hawking_uf200_info = { .description = "Hawking UF200 USB Ethernet", .bind = ax8817x_bind, - .status = ax8817x_status, - .link_reset = ax88172_link_reset, - .reset = ax88172_link_reset, + .unbind = ax8817x_unbind, .flags = FLAG_ETHER, .data = 0x001f1d1f, }; @@ -1242,9 +1248,7 @@ static const struct driver_info hawking_uf200_info = { static const struct driver_info ax88772_info = { .description = "ASIX AX88772 USB 2.0 Ethernet", .bind = ax88772_bind, - .status = ax8817x_status, - .link_reset = ax88772_link_reset, - .reset = ax88772_link_reset, + .unbind = ax8817x_unbind, .flags = FLAG_ETHER | FLAG_FRAMING_AX, .rx_fixup = ax88772_rx_fixup, .tx_fixup = ax88772_tx_fixup, @@ -2657,7 +2661,7 @@ static const struct driver_info blob_info = { * All known Zaurii lie about their standards conformance. Most lie by * saying they support CDC Ethernet. Some lie and say they support CDC * MDLM (as if for access to cell phone modems). Someone, please beat - * on Sharp (and other such vendors) for a while with a cluestick. + * on Sharp for a while with a cluestick. * *-------------------------------------------------------------------------*/ @@ -2710,142 +2714,22 @@ static const struct driver_info zaurus_pxa_info = { }; #define ZAURUS_PXA_INFO ((unsigned long)&zaurus_pxa_info) -static const struct driver_info olympus_mxl_info = { - .description = "Olympus R1000", +static const struct driver_info zaurus_pxa_mdlm_info = { + .description = "Sharp Zaurus, PXA-255 based", .flags = FLAG_FRAMING_Z, .check_connect = always_connected, - .bind = generic_cdc_bind, - .unbind = cdc_unbind, .tx_fixup = zaurus_tx_fixup, }; -#define OLYMPUS_MXL_INFO ((unsigned long)&olympus_mxl_info) - - -/* Some more recent products using Lineo/Belcarra code will wrongly claim - * CDC MDLM conformance. They aren't conformant: data endpoints live - * in the control interface, there's no data interface, and it's not used - * to talk to a cell phone radio. But at least we can detect these two - * pseudo-classes, rather than growing this product list with entries for - * each new nonconformant product (sigh). - */ -static const u8 safe_guid[16] = { - 0x5d, 0x34, 0xcf, 0x66, 0x11, 0x18, 0x11, 0xd6, - 0xa2, 0x1a, 0x00, 0x01, 0x02, 0xca, 0x9a, 0x7f, -}; -static const u8 blan_guid[16] = { - 0x74, 0xf0, 0x3d, 0xbd, 0x1e, 0xc1, 0x44, 0x70, - 0xa3, 0x67, 0x71, 0x34, 0xc9, 0xf5, 0x54, 0x37, -}; - -static int blan_mdlm_bind (struct usbnet *dev, struct usb_interface *intf) -{ - u8 *buf = intf->cur_altsetting->extra; - int len = intf->cur_altsetting->extralen; - struct usb_cdc_mdlm_desc *desc = NULL; - struct usb_cdc_mdlm_detail_desc *detail = NULL; - - while (len > 3) { - if (buf [1] != USB_DT_CS_INTERFACE) - goto next_desc; - - /* use bDescriptorSubType, and just verify that we get a - * "BLAN" (or "SAFE") descriptor. - */ - switch (buf [2]) { - case USB_CDC_MDLM_TYPE: - if (desc) { - dev_dbg (&intf->dev, "extra MDLM\n"); - goto bad_desc; - } - desc = (void *) buf; - if (desc->bLength != sizeof *desc) { - dev_dbg (&intf->dev, "MDLM len %u\n", - desc->bLength); - goto bad_desc; - } - /* expect bcdVersion 1.0, ignore */ - if (memcmp(&desc->bGUID, blan_guid, 16) - || memcmp(&desc->bGUID, blan_guid, 16) ) { - /* hey, this one might _really_ be MDLM! */ - dev_dbg (&intf->dev, "MDLM guid\n"); - goto bad_desc; - } - break; - case USB_CDC_MDLM_DETAIL_TYPE: - if (detail) { - dev_dbg (&intf->dev, "extra MDLM detail\n"); - goto bad_desc; - } - detail = (void *) buf; - switch (detail->bGuidDescriptorType) { - case 0: /* "SAFE" */ - if (detail->bLength != (sizeof *detail + 2)) - goto bad_detail; - break; - case 1: /* "BLAN" */ - if (detail->bLength != (sizeof *detail + 3)) - goto bad_detail; - break; - default: - goto bad_detail; - } - - /* assuming we either noticed BLAN already, or will - * find it soon, there are some data bytes here: - * - bmNetworkCapabilities (unused) - * - bmDataCapabilities (bits, see below) - * - bPad (ignored, for PADAFTER -- BLAN-only) - * bits are: - * - 0x01 -- Zaurus framing (add CRC) - * - 0x02 -- PADBEFORE - * - 0x04 -- PADAFTER - * - 0x08 -- "fermat" packet mangling (for hw bugs) - */ - if (detail->bDetailData[1] != 0x01) { - /* bmDataCapabilites == 0 would be fine too, - * but framing is minidriver-coupled for now. - */ -bad_detail: - dev_dbg (&intf->dev, - "bad MDLM detail, %d %d %d\n", - detail->bLength, - detail->bDetailData[0], - detail->bDetailData[2]); - goto bad_desc; - } - break; - } -next_desc: - len -= buf [0]; /* bLength */ - buf += buf [0]; - } - - if (!desc || !detail) { - dev_dbg (&intf->dev, "missing cdc mdlm %s%sdescriptor\n", - desc ? "" : "func ", - detail ? "" : "detail "); - goto bad_desc; - } - - /* There's probably a CDC Ethernet descriptor there, but we can't - * rely on the Ethernet address it provides since not all vendors - * bother to make it unique. Likewise there's no point in tracking - * of the CDC event notifications. - */ - return get_endpoints (dev, intf); - -bad_desc: - dev_info (&dev->udev->dev, "unsupported MDLM descriptors\n"); - return -ENODEV; -} -static const struct driver_info bogus_mdlm_info = { - .description = "pseudo-MDLM (BLAN) device", +static const struct driver_info olympus_mxl_info = { + .description = "Olympus R1000", .flags = FLAG_FRAMING_Z, .check_connect = always_connected, + .bind = generic_cdc_bind, + .unbind = cdc_unbind, .tx_fixup = zaurus_tx_fixup, - .bind = blan_mdlm_bind, }; +#define OLYMPUS_MXL_INFO ((unsigned long)&olympus_mxl_info) #else @@ -3423,19 +3307,6 @@ kevent (void *data) } } - if (test_bit (EVENT_LINK_RESET, &dev->flags)) { - struct driver_info *info = dev->driver_info; - int retval = 0; - - clear_bit (EVENT_LINK_RESET, &dev->flags); - if(info->link_reset && (retval = info->link_reset(dev)) < 0) { - devinfo(dev, "link reset failed (%d) usbnet usb-%s-%s, %s", - retval, - dev->udev->bus->bus_name, dev->udev->devpath, - info->description); - } - } - if (dev->flags) devdbg (dev, "kevent done, flags = 0x%lx", dev->flags); @@ -4149,14 +4020,30 @@ static const struct usb_device_id products [] = { }, #ifdef CONFIG_USB_ZAURUS - /* At least some (reports vary) PXA units have very different lies - * about their standards support: they claim to be cell phones with - * direct access to their radios. (They don't conform to CDC MDLM.) + /* at least some (reports vary) PXA units have very different + * lies about their standards support: they claim to be cell + * phones giving direct radio access (which they aren't). */ { - USB_INTERFACE_INFO (USB_CLASS_COMM, USB_CDC_SUBCLASS_MDLM, - USB_CDC_PROTO_NONE), - .driver_info = (unsigned long) &bogus_mdlm_info, + .match_flags = USB_DEVICE_ID_MATCH_INT_INFO + | USB_DEVICE_ID_MATCH_DEVICE, + .idVendor = 0x04DD, + /* Sharp ROM v1.32 */ + .idProduct = 0x8006, /* SL-5600 */ + .bInterfaceClass = USB_CLASS_COMM, + .bInterfaceSubClass = USB_CDC_SUBCLASS_MDLM, + .bInterfaceProtocol = USB_CDC_PROTO_NONE, + .driver_info = (unsigned long) &zaurus_pxa_mdlm_info, +}, { + .match_flags = USB_DEVICE_ID_MATCH_INT_INFO + | USB_DEVICE_ID_MATCH_DEVICE, + .idVendor = 0x04DD, + /* reported with some C860 units */ + .idProduct = 0x9031, /* C-860 */ + .bInterfaceClass = USB_CLASS_COMM, + .bInterfaceSubClass = USB_CDC_SUBCLASS_MDLM, + .bInterfaceProtocol = USB_CDC_PROTO_NONE, + .driver_info = (unsigned long) &zaurus_pxa_mdlm_info, }, #endif diff --git a/trunk/drivers/usb/net/zd1201.c b/trunk/drivers/usb/net/zd1201.c index f98cb2af024e..c81cd0a619bf 100644 --- a/trunk/drivers/usb/net/zd1201.c +++ b/trunk/drivers/usb/net/zd1201.c @@ -45,7 +45,7 @@ MODULE_PARM_DESC(ap, "If non-zero Access Point firmware will be loaded"); MODULE_DEVICE_TABLE(usb, zd1201_table); -static int zd1201_fw_upload(struct usb_device *dev, int apfw) +int zd1201_fw_upload(struct usb_device *dev, int apfw) { const struct firmware *fw_entry; char* data; @@ -111,7 +111,7 @@ static int zd1201_fw_upload(struct usb_device *dev, int apfw) return err; } -static void zd1201_usbfree(struct urb *urb, struct pt_regs *regs) +void zd1201_usbfree(struct urb *urb, struct pt_regs *regs) { struct zd1201 *zd = urb->context; @@ -142,8 +142,7 @@ static void zd1201_usbfree(struct urb *urb, struct pt_regs *regs) total: 4 + 2 + 2 + 2 + 2 + 4 = 16 */ -static int zd1201_docmd(struct zd1201 *zd, int cmd, int parm0, - int parm1, int parm2) +int zd1201_docmd(struct zd1201 *zd, int cmd, int parm0, int parm1, int parm2) { unsigned char *command; int ret; @@ -176,7 +175,7 @@ static int zd1201_docmd(struct zd1201 *zd, int cmd, int parm0, } /* Callback after sending out a packet */ -static void zd1201_usbtx(struct urb *urb, struct pt_regs *regs) +void zd1201_usbtx(struct urb *urb, struct pt_regs *regs) { struct zd1201 *zd = urb->context; netif_wake_queue(zd->dev); @@ -184,7 +183,7 @@ static void zd1201_usbtx(struct urb *urb, struct pt_regs *regs) } /* Incomming data */ -static void zd1201_usbrx(struct urb *urb, struct pt_regs *regs) +void zd1201_usbrx(struct urb *urb, struct pt_regs *regs) { struct zd1201 *zd = urb->context; int free = 0; @@ -614,7 +613,7 @@ static inline int zd1201_setconfig16(struct zd1201 *zd, int rid, short val) return (zd1201_setconfig(zd, rid, &zdval, sizeof(__le16), 1)); } -static int zd1201_drvr_start(struct zd1201 *zd) +int zd1201_drvr_start(struct zd1201 *zd) { int err, i; short max; @@ -1740,8 +1739,7 @@ static const struct iw_handler_def zd1201_iw_handlers = { .private_args = (struct iw_priv_args *) zd1201_private_args, }; -static int zd1201_probe(struct usb_interface *interface, - const struct usb_device_id *id) +int zd1201_probe(struct usb_interface *interface, const struct usb_device_id *id) { struct zd1201 *zd; struct usb_device *usb; @@ -1853,7 +1851,7 @@ static int zd1201_probe(struct usb_interface *interface, return err; } -static void zd1201_disconnect(struct usb_interface *interface) +void zd1201_disconnect(struct usb_interface *interface) { struct zd1201 *zd=(struct zd1201 *)usb_get_intfdata(interface); struct hlist_node *node, *node2; @@ -1884,7 +1882,7 @@ static void zd1201_disconnect(struct usb_interface *interface) kfree(zd); } -static struct usb_driver zd1201_usb = { +struct usb_driver zd1201_usb = { .owner = THIS_MODULE, .name = "zd1201", .probe = zd1201_probe, diff --git a/trunk/drivers/usb/serial/Kconfig b/trunk/drivers/usb/serial/Kconfig index 0c4aa00bb39d..b869076d9c7c 100644 --- a/trunk/drivers/usb/serial/Kconfig +++ b/trunk/drivers/usb/serial/Kconfig @@ -395,15 +395,6 @@ config USB_SERIAL_PL2303 To compile this driver as a module, choose M here: the module will be called pl2303. -config USB_SERIAL_HP4X - tristate "USB HP4x Calculators support" - depends on USB_SERIAL - help - Say Y here if you want to use an Hewlett-Packard 4x Calculator. - - To compile this driver as a module, choose M here: the - module will be called hp4x. - config USB_SERIAL_SAFE tristate "USB Safe Serial (Encapsulated) Driver (EXPERIMENTAL)" depends on USB_SERIAL && EXPERIMENTAL diff --git a/trunk/drivers/usb/serial/Makefile b/trunk/drivers/usb/serial/Makefile index b0aac47d1959..351b81855b18 100644 --- a/trunk/drivers/usb/serial/Makefile +++ b/trunk/drivers/usb/serial/Makefile @@ -21,7 +21,6 @@ obj-$(CONFIG_USB_SERIAL_EDGEPORT_TI) += io_ti.o obj-$(CONFIG_USB_SERIAL_EMPEG) += empeg.o obj-$(CONFIG_USB_SERIAL_FTDI_SIO) += ftdi_sio.o obj-$(CONFIG_USB_SERIAL_GARMIN) += garmin_gps.o -obj-$(CONFIG_USB_SERIAL_HP4X) += hp4x.o obj-$(CONFIG_USB_SERIAL_IPAQ) += ipaq.o obj-$(CONFIG_USB_SERIAL_IPW) += ipw.o obj-$(CONFIG_USB_SERIAL_IR) += ir-usb.o diff --git a/trunk/drivers/usb/serial/hp4x.c b/trunk/drivers/usb/serial/hp4x.c deleted file mode 100644 index 64d55fbd206e..000000000000 --- a/trunk/drivers/usb/serial/hp4x.c +++ /dev/null @@ -1,85 +0,0 @@ -/* - * HP4x Calculators Serial USB driver - * - * Copyright (C) 2005 Arthur Huillet (ahuillet@users.sf.net) - * Copyright (C) 2001-2005 Greg Kroah-Hartman (greg@kroah.com) - * - * 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. - * - * See Documentation/usb/usb-serial.txt for more information on using this driver - */ - -#include -#include -#include -#include -#include -#include -#include "usb-serial.h" - -/* - * Version Information - */ -#define DRIVER_VERSION "v1.00" -#define DRIVER_DESC "HP4x (48/49) Generic Serial driver" - -#define HP_VENDOR_ID 0x03f0 -#define HP49GP_PRODUCT_ID 0x0121 - -static struct usb_device_id id_table [] = { - { USB_DEVICE(HP_VENDOR_ID, HP49GP_PRODUCT_ID) }, - { } /* Terminating entry */ -}; - -MODULE_DEVICE_TABLE(usb, id_table); - -static struct usb_driver hp49gp_driver = { - .owner = THIS_MODULE, - .name = "HP4X", - .probe = usb_serial_probe, - .disconnect = usb_serial_disconnect, - .id_table = id_table, -}; - -static struct usb_serial_device_type hp49gp_device = { - .owner = THIS_MODULE, - .name = "HP4X", - .id_table = id_table, - .num_interrupt_in = NUM_DONT_CARE, - .num_bulk_in = NUM_DONT_CARE, - .num_bulk_out = NUM_DONT_CARE, - .num_ports = 1, -}; - -static int __init hp49gp_init(void) -{ - int retval; - retval = usb_serial_register(&hp49gp_device); - if (retval) - goto failed_usb_serial_register; - retval = usb_register(&hp49gp_driver); - if (retval) - goto failed_usb_register; - info(DRIVER_DESC " " DRIVER_VERSION); - return 0; -failed_usb_register: - usb_serial_deregister(&hp49gp_device); -failed_usb_serial_register: - return retval; -} - -static void __exit hp49gp_exit(void) -{ - usb_deregister(&hp49gp_driver); - usb_serial_deregister(&hp49gp_device); -} - -module_init(hp49gp_init); -module_exit(hp49gp_exit); - -MODULE_DESCRIPTION(DRIVER_DESC); -MODULE_VERSION(DRIVER_VERSION); -MODULE_LICENSE("GPL"); diff --git a/trunk/drivers/usb/storage/unusual_devs.h b/trunk/drivers/usb/storage/unusual_devs.h index bbda63c24c4d..fa68dea6bc6f 100644 --- a/trunk/drivers/usb/storage/unusual_devs.h +++ b/trunk/drivers/usb/storage/unusual_devs.h @@ -517,32 +517,14 @@ UNUSUAL_DEV( 0x05ab, 0x5701, 0x0100, 0x0110, 0 ), #endif -/* Submitted by Sven Anderson - * There are at least four ProductIDs used for iPods, so I added 0x1202 and - * 0x1204. They just need the US_FL_FIX_CAPACITY. As the bcdDevice appears - * to change with firmware updates, I changed the range to maximum for all - * iPod entries. - */ -UNUSUAL_DEV( 0x05ac, 0x1202, 0x0000, 0x9999, - "Apple", - "iPod", - US_SC_DEVICE, US_PR_DEVICE, NULL, - US_FL_FIX_CAPACITY ), - /* Reported by Avi Kivity */ -UNUSUAL_DEV( 0x05ac, 0x1203, 0x0000, 0x9999, - "Apple", - "iPod", - US_SC_DEVICE, US_PR_DEVICE, NULL, - US_FL_FIX_CAPACITY ), - -UNUSUAL_DEV( 0x05ac, 0x1204, 0x0000, 0x9999, +UNUSUAL_DEV( 0x05ac, 0x1203, 0x0001, 0x0001, "Apple", "iPod", US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_FIX_CAPACITY ), -UNUSUAL_DEV( 0x05ac, 0x1205, 0x0000, 0x9999, +UNUSUAL_DEV( 0x05ac, 0x1205, 0x0001, 0x0001, "Apple", "iPod", US_SC_DEVICE, US_PR_DEVICE, NULL, diff --git a/trunk/drivers/video/imsttfb.c b/trunk/drivers/video/imsttfb.c index 7b9bf45ab6fe..5a72ca3c0138 100644 --- a/trunk/drivers/video/imsttfb.c +++ b/trunk/drivers/video/imsttfb.c @@ -1287,12 +1287,12 @@ imsttfb_ioctl(struct inode *inode, struct file *file, u_int cmd, case FBIMSTT_SETCMAPREG: if (copy_from_user(reg, argp, 8) || reg[0] > (0x1000 - sizeof(reg[0])) / sizeof(reg[0])) return -EFAULT; - write_reg_le32(((u_int __iomem *)par->cmap_regs), reg[0], reg[1]); + write_reg_le32(((u_int *)par->cmap_regs), reg[0], reg[1]); return 0; case FBIMSTT_GETCMAPREG: if (copy_from_user(reg, argp, 4) || reg[0] > (0x1000 - sizeof(reg[0])) / sizeof(reg[0])) return -EFAULT; - reg[1] = read_reg_le32(((u_int __iomem *)par->cmap_regs), reg[0]); + reg[1] = read_reg_le32(((u_int *)par->cmap_regs), reg[0]); if (copy_to_user((void __user *)(arg + 4), ®[1], 4)) return -EFAULT; return 0; diff --git a/trunk/drivers/video/savage/savagefb_driver.c b/trunk/drivers/video/savage/savagefb_driver.c index 03d74e8ee067..5bb8d60f35c4 100644 --- a/trunk/drivers/video/savage/savagefb_driver.c +++ b/trunk/drivers/video/savage/savagefb_driver.c @@ -1498,7 +1498,7 @@ static int __devinit savage_map_mmio (struct fb_info *info) info->fix.mmio_start = par->mmio.pbase; info->fix.mmio_len = par->mmio.len; - par->bci_base = (u32 __iomem *)(par->mmio.vbase + BCI_BUFFER_OFFSET); + par->bci_base = (u32*)(par->mmio.vbase + BCI_BUFFER_OFFSET); par->bci_ptr = 0; savage_enable_mmio (par); @@ -1514,7 +1514,7 @@ static void __devinit savage_unmap_mmio (struct fb_info *info) savage_disable_mmio(par); if (par->mmio.vbase) { - iounmap(par->mmio.vbase); + iounmap ((void *)par->mmio.vbase); par->mmio.vbase = NULL; } } @@ -1553,7 +1553,7 @@ static int __devinit savage_map_video (struct fb_info *info, #endif /* Clear framebuffer, it's all white in memory after boot */ - memset_io (par->video.vbase, 0, par->video.len); + memset (par->video.vbase, 0, par->video.len); return 0; } diff --git a/trunk/fs/isofs/compress.c b/trunk/fs/isofs/compress.c index 34a44e451689..fb42c3f3bf0d 100644 --- a/trunk/fs/isofs/compress.c +++ b/trunk/fs/isofs/compress.c @@ -18,12 +18,29 @@ #include #include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include +#include + +#include +#include +#include -#include "isofs.h" #include "zisofs.h" /* This should probably be global. */ diff --git a/trunk/fs/isofs/dir.c b/trunk/fs/isofs/dir.c index 6030956b894b..14d86de6637d 100644 --- a/trunk/fs/isofs/dir.c +++ b/trunk/fs/isofs/dir.c @@ -10,9 +10,20 @@ * * isofs directory handling functions */ +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include -#include "isofs.h" +#include + +#include static int isofs_readdir(struct file *, void *, filldir_t); diff --git a/trunk/fs/isofs/export.c b/trunk/fs/isofs/export.c index 4af856a7fda7..e4252c960871 100644 --- a/trunk/fs/isofs/export.c +++ b/trunk/fs/isofs/export.c @@ -13,7 +13,11 @@ * fs/exportfs/expfs.c. */ -#include "isofs.h" +#include +#include +#include +#include +#include static struct dentry * isofs_export_iget(struct super_block *sb, diff --git a/trunk/fs/isofs/inode.c b/trunk/fs/isofs/inode.c index abd7b12eeca7..b9256e65e144 100644 --- a/trunk/fs/isofs/inode.c +++ b/trunk/fs/isofs/inode.c @@ -12,18 +12,29 @@ */ #include -#include #include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include #include #include #include -#include -#include +#include +#include +#include #include +#include +#include -#include "isofs.h" #include "zisofs.h" #define BEQUIET diff --git a/trunk/fs/isofs/isofs.h b/trunk/fs/isofs/isofs.h deleted file mode 100644 index 9ce7b51fb614..000000000000 --- a/trunk/fs/isofs/isofs.h +++ /dev/null @@ -1,190 +0,0 @@ -#include -#include -#include -#include - -enum isofs_file_format { - isofs_file_normal = 0, - isofs_file_sparse = 1, - isofs_file_compressed = 2, -}; - -/* - * iso fs inode data in memory - */ -struct iso_inode_info { - unsigned long i_iget5_block; - unsigned long i_iget5_offset; - unsigned int i_first_extent; - unsigned char i_file_format; - unsigned char i_format_parm[3]; - unsigned long i_next_section_block; - unsigned long i_next_section_offset; - off_t i_section_size; - struct inode vfs_inode; -}; - -/* - * iso9660 super-block data in memory - */ -struct isofs_sb_info { - unsigned long s_ninodes; - unsigned long s_nzones; - unsigned long s_firstdatazone; - unsigned long s_log_zone_size; - unsigned long s_max_size; - - unsigned char s_high_sierra; /* A simple flag */ - unsigned char s_mapping; - int s_rock_offset; /* offset of SUSP fields within SU area */ - unsigned char s_rock; - unsigned char s_joliet_level; - unsigned char s_utf8; - unsigned char s_cruft; /* Broken disks with high - byte of length containing - junk */ - unsigned char s_unhide; - unsigned char s_nosuid; - unsigned char s_nodev; - unsigned char s_nocompress; - - mode_t s_mode; - gid_t s_gid; - uid_t s_uid; - struct nls_table *s_nls_iocharset; /* Native language support table */ -}; - -static inline struct isofs_sb_info *ISOFS_SB(struct super_block *sb) -{ - return sb->s_fs_info; -} - -static inline struct iso_inode_info *ISOFS_I(struct inode *inode) -{ - return container_of(inode, struct iso_inode_info, vfs_inode); -} - -static inline int isonum_711(char *p) -{ - return *(u8 *)p; -} -static inline int isonum_712(char *p) -{ - return *(s8 *)p; -} -static inline unsigned int isonum_721(char *p) -{ - return le16_to_cpu(get_unaligned((__le16 *)p)); -} -static inline unsigned int isonum_722(char *p) -{ - return be16_to_cpu(get_unaligned((__le16 *)p)); -} -static inline unsigned int isonum_723(char *p) -{ - /* Ignore bigendian datum due to broken mastering programs */ - return le16_to_cpu(get_unaligned((__le16 *)p)); -} -static inline unsigned int isonum_731(char *p) -{ - return le32_to_cpu(get_unaligned((__le32 *)p)); -} -static inline unsigned int isonum_732(char *p) -{ - return be32_to_cpu(get_unaligned((__le32 *)p)); -} -static inline unsigned int isonum_733(char *p) -{ - /* Ignore bigendian datum due to broken mastering programs */ - return le32_to_cpu(get_unaligned((__le32 *)p)); -} -extern int iso_date(char *, int); - -struct inode; /* To make gcc happy */ - -extern int parse_rock_ridge_inode(struct iso_directory_record *, struct inode *); -extern int get_rock_ridge_filename(struct iso_directory_record *, char *, struct inode *); -extern int isofs_name_translate(struct iso_directory_record *, char *, struct inode *); - -int get_joliet_filename(struct iso_directory_record *, unsigned char *, struct inode *); -int get_acorn_filename(struct iso_directory_record *, char *, struct inode *); - -extern struct dentry *isofs_lookup(struct inode *, struct dentry *, struct nameidata *); -extern struct buffer_head *isofs_bread(struct inode *, sector_t); -extern int isofs_get_blocks(struct inode *, sector_t, struct buffer_head **, unsigned long); - -extern struct inode *isofs_iget(struct super_block *sb, - unsigned long block, - unsigned long offset); - -/* Because the inode number is no longer relevant to finding the - * underlying meta-data for an inode, we are free to choose a more - * convenient 32-bit number as the inode number. The inode numbering - * scheme was recommended by Sergey Vlasov and Eric Lammerts. */ -static inline unsigned long isofs_get_ino(unsigned long block, - unsigned long offset, - unsigned long bufbits) -{ - return (block << (bufbits - 5)) | (offset >> 5); -} - -/* Every directory can have many redundant directory entries scattered - * throughout the directory tree. First there is the directory entry - * with the name of the directory stored in the parent directory. - * Then, there is the "." directory entry stored in the directory - * itself. Finally, there are possibly many ".." directory entries - * stored in all the subdirectories. - * - * In order for the NFS get_parent() method to work and for the - * general consistency of the dcache, we need to make sure the - * "i_iget5_block" and "i_iget5_offset" all point to exactly one of - * the many redundant entries for each directory. We normalize the - * block and offset by always making them point to the "." directory. - * - * Notice that we do not use the entry for the directory with the name - * that is located in the parent directory. Even though choosing this - * first directory is more natural, it is much easier to find the "." - * entry in the NFS get_parent() method because it is implicitly - * encoded in the "extent + ext_attr_length" fields of _all_ the - * redundant entries for the directory. Thus, it can always be - * reached regardless of which directory entry you have in hand. - * - * This works because the "." entry is simply the first directory - * record when you start reading the file that holds all the directory - * records, and this file starts at "extent + ext_attr_length" blocks. - * Because the "." entry is always the first entry listed in the - * directories file, the normalized "offset" value is always 0. - * - * You should pass the directory entry in "de". On return, "block" - * and "offset" will hold normalized values. Only directories are - * affected making it safe to call even for non-directory file - * types. */ -static inline void -isofs_normalize_block_and_offset(struct iso_directory_record* de, - unsigned long *block, - unsigned long *offset) -{ - /* Only directories are normalized. */ - if (de->flags[0] & 2) { - *offset = 0; - *block = (unsigned long)isonum_733(de->extent) - + (unsigned long)isonum_711(de->ext_attr_length); - } -} - -extern struct inode_operations isofs_dir_inode_operations; -extern struct file_operations isofs_dir_operations; -extern struct address_space_operations isofs_symlink_aops; -extern struct export_operations isofs_export_ops; - -/* The following macros are used to check for memory leaks. */ -#ifdef LEAK_CHECK -#define free_s leak_check_free_s -#define malloc leak_check_malloc -#define sb_bread leak_check_bread -#define brelse leak_check_brelse -extern void * leak_check_malloc(unsigned int size); -extern void leak_check_free_s(void * obj, int size); -extern struct buffer_head * leak_check_bread(struct super_block *sb, int block); -extern void leak_check_brelse(struct buffer_head * bh); -#endif /* LEAK_CHECK */ diff --git a/trunk/fs/isofs/joliet.c b/trunk/fs/isofs/joliet.c index 2931de7f1a6a..86c50e22fc87 100644 --- a/trunk/fs/isofs/joliet.c +++ b/trunk/fs/isofs/joliet.c @@ -6,9 +6,11 @@ * Joliet: Microsoft's Unicode extensions to iso9660 */ -#include +#include #include -#include "isofs.h" +#include +#include +#include /* * Convert Unicode 16 to UTF8 or ASCII. diff --git a/trunk/fs/isofs/namei.c b/trunk/fs/isofs/namei.c index 690edf37173c..9569fc44102d 100644 --- a/trunk/fs/isofs/namei.c +++ b/trunk/fs/isofs/namei.c @@ -6,9 +6,20 @@ * (C) 1991 Linus Torvalds - minix filesystem */ +#include +#include +#include +#include +#include +#include +#include +#include #include /* Joliet? */ #include -#include "isofs.h" +#include +#include + +#include /* * ok, we cannot use strncmp, as the name is not in our data space. diff --git a/trunk/fs/isofs/rock.c b/trunk/fs/isofs/rock.c index 089e79c65585..8bdd3e409543 100644 --- a/trunk/fs/isofs/rock.c +++ b/trunk/fs/isofs/rock.c @@ -6,11 +6,17 @@ * Rock Ridge Extensions to iso9660 */ +#include +#include +#include +#include +#include #include #include #include +#include +#include -#include "isofs.h" #include "rock.h" /* These functions are designed to read the system areas of a directory record diff --git a/trunk/fs/isofs/util.c b/trunk/fs/isofs/util.c index 01e1ee7a998b..3f6d9c1ac95a 100644 --- a/trunk/fs/isofs/util.c +++ b/trunk/fs/isofs/util.c @@ -2,7 +2,9 @@ * linux/fs/isofs/util.c */ -#include "isofs.h" +#include +#include +#include /* * We have to convert from a MM/DD/YY format to the Unix ctime format. @@ -78,3 +80,4 @@ int iso_date(char * p, int flag) } return crtime; } + diff --git a/trunk/include/asm-arm/arch-s3c2410/regs-iis.h b/trunk/include/asm-arm/arch-s3c2410/regs-iis.h index 385b07d510da..7ae8e1f45bc1 100644 --- a/trunk/include/asm-arm/arch-s3c2410/regs-iis.h +++ b/trunk/include/asm-arm/arch-s3c2410/regs-iis.h @@ -14,7 +14,6 @@ * 26-06-2003 BJD Finished off definitions for register addresses * 12-03-2004 BJD Updated include protection * 07-03-2005 BJD Added FIFO size flags and S3C2440 MPLL - * 05-04-2005 LCVR Added IISFCON definitions for the S3C2400 */ #ifndef __ASM_ARCH_REGS_IIS_H @@ -69,14 +68,5 @@ #define S3C2410_IISFCON_RXMASK (0x3f) #define S3C2410_IISFCON_RXSHIFT (0) -#define S3C2400_IISFCON_TXDMA (1<<11) -#define S3C2400_IISFCON_RXDMA (1<<10) -#define S3C2400_IISFCON_TXENABLE (1<<9) -#define S3C2400_IISFCON_RXENABLE (1<<8) -#define S3C2400_IISFCON_TXMASK (0x07 << 4) -#define S3C2400_IISFCON_TXSHIFT (4) -#define S3C2400_IISFCON_RXMASK (0x07) -#define S3C2400_IISFCON_RXSHIFT (0) - #define S3C2410_IISFIFO (0x10) #endif /* __ASM_ARCH_REGS_IIS_H */ diff --git a/trunk/include/asm-arm/arch-s3c2410/regs-mem.h b/trunk/include/asm-arm/arch-s3c2410/regs-mem.h index a2d7d0cec042..1a1328ac0d79 100644 --- a/trunk/include/asm-arm/arch-s3c2410/regs-mem.h +++ b/trunk/include/asm-arm/arch-s3c2410/regs-mem.h @@ -12,7 +12,6 @@ * Changelog: * 29-Sep-2004 BJD Initial include for Linux * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA - * 04-Apr-2005 LCVR Added S3C2400 DRAM/BANKSIZE_MASK definitions * */ @@ -184,12 +183,6 @@ #define S3C2410_REFRESH_TRP_3clk (1<<20) #define S3C2410_REFRESH_TRP_4clk (2<<20) -#define S3C2400_REFRESH_DRAM_TRP_MASK (3<<20) -#define S3C2400_REFRESH_DRAM_TRP_1_5clk (0<<20) -#define S3C2400_REFRESH_DRAM_TRP_2_5clk (1<<20) -#define S3C2400_REFRESH_DRAM_TRP_3_5clk (2<<20) -#define S3C2400_REFRESH_DRAM_TRP_4_5clk (3<<20) - #define S3C2410_REFRESH_TSRC_MASK (3<<18) #define S3C2410_REFRESH_TSRC_4clk (0<<18) #define S3C2410_REFRESH_TSRC_5clk (1<<18) @@ -212,7 +205,6 @@ #define S3C2410_BANKSIZE_4M (0x5 << 0) #define S3C2410_BANKSIZE_2M (0x4 << 0) #define S3C2410_BANKSIZE_MASK (0x7 << 0) -#define S3C2400_BANKSIZE_MASK (0x4 << 0) #define S3C2410_BANKSIZE_SCLK_EN (1<<4) #define S3C2410_BANKSIZE_SCKE_EN (1<<5) #define S3C2410_BANKSIZE_BURST (1<<7) diff --git a/trunk/include/asm-arm/arch-s3c2410/regs-spi.h b/trunk/include/asm-arm/arch-s3c2410/regs-spi.h index 338217858c73..cb502a88158b 100644 --- a/trunk/include/asm-arm/arch-s3c2410/regs-spi.h +++ b/trunk/include/asm-arm/arch-s3c2410/regs-spi.h @@ -12,7 +12,6 @@ * 20-04-2004 KF Created file * 04-10-2004 BJD Removed VA address (no longer mapped) * tidied file for submission - * 03-04-2005 LCVR Added S3C2400_SPPIN_nCS definition */ #ifndef __ASM_ARCH_REGS_SPI_H @@ -47,7 +46,6 @@ #define S3C2410_SPPIN_ENMUL (1<<2) /* Multi Master Error detect */ #define S3C2410_SPPIN_RESERVED (1<<1) -#define S3C2400_SPPIN_nCS (1<<1) /* SPI Card Select */ #define S3C2410_SPPIN_KEEP (1<<0) /* Master Out keep */ diff --git a/trunk/include/asm-arm/arch-s3c2410/uncompress.h b/trunk/include/asm-arm/arch-s3c2410/uncompress.h index d7a4a8354fa9..ad4252e27799 100644 --- a/trunk/include/asm-arm/arch-s3c2410/uncompress.h +++ b/trunk/include/asm-arm/arch-s3c2410/uncompress.h @@ -16,7 +16,6 @@ * 12-Oct-2004 BJD Take account of debug uart configuration * 15-Nov-2004 BJD Fixed uart configuration * 22-Feb-2005 BJD Added watchdog to uncompress - * 04-Apr-2005 LCVR Added support to S3C2400 (no cpuid at GSTATUS1) */ #ifndef __ASM_ARCH_UNCOMPRESS_H @@ -70,12 +69,9 @@ uart_rd(unsigned int reg) static void putc(char ch) { - int cpuid = S3C2410_GSTATUS1_2410; + int cpuid = *((volatile unsigned int *)S3C2410_GSTATUS1); -#ifndef CONFIG_CPU_S3C2400 - cpuid = *((volatile unsigned int *)S3C2410_GSTATUS1); cpuid &= S3C2410_GSTATUS1_IDMASK; -#endif if (ch == '\n') putc('\r'); /* expand newline to \r\n */ diff --git a/trunk/include/asm-arm/string.h b/trunk/include/asm-arm/string.h index e50c4a39b699..2a8ab162412f 100644 --- a/trunk/include/asm-arm/string.h +++ b/trunk/include/asm-arm/string.h @@ -29,22 +29,15 @@ extern void __memzero(void *ptr, __kernel_size_t n); #define memset(p,v,n) \ ({ \ - void *__p = (p); size_t __n = n; \ - if ((__n) != 0) { \ + if ((n) != 0) { \ if (__builtin_constant_p((v)) && (v) == 0) \ - __memzero((__p),(__n)); \ + __memzero((p),(n)); \ else \ - memset((__p),(v),(__n)); \ + memset((p),(v),(n)); \ } \ - (__p); \ + (p); \ }) -#define memzero(p,n) \ - ({ \ - void *__p = (p); size_t __n = n; \ - if ((__n) != 0) \ - __memzero((__p),(__n)); \ - (__p); \ - }) +#define memzero(p,n) ({ if ((n) != 0) __memzero((p),(n)); (p); }) #endif diff --git a/trunk/include/linux/iso_fs.h b/trunk/include/linux/iso_fs.h index 47967878bfef..099039d4b10d 100644 --- a/trunk/include/linux/iso_fs.h +++ b/trunk/include/linux/iso_fs.h @@ -1,3 +1,4 @@ + #ifndef _ISOFS_FS_H #define _ISOFS_FS_H @@ -162,4 +163,150 @@ struct iso_directory_record { #define ISOFS_SUPER_MAGIC 0x9660 +#ifdef __KERNEL__ +/* Number conversion inlines, named after the section in ISO 9660 + they correspond to. */ + +#include +#include +#include +#include + +static inline struct isofs_sb_info *ISOFS_SB(struct super_block *sb) +{ + return sb->s_fs_info; +} + +static inline struct iso_inode_info *ISOFS_I(struct inode *inode) +{ + return container_of(inode, struct iso_inode_info, vfs_inode); +} + +static inline int isonum_711(char *p) +{ + return *(u8 *)p; +} +static inline int isonum_712(char *p) +{ + return *(s8 *)p; +} +static inline unsigned int isonum_721(char *p) +{ + return le16_to_cpu(get_unaligned((__le16 *)p)); +} +static inline unsigned int isonum_722(char *p) +{ + return be16_to_cpu(get_unaligned((__le16 *)p)); +} +static inline unsigned int isonum_723(char *p) +{ + /* Ignore bigendian datum due to broken mastering programs */ + return le16_to_cpu(get_unaligned((__le16 *)p)); +} +static inline unsigned int isonum_731(char *p) +{ + return le32_to_cpu(get_unaligned((__le32 *)p)); +} +static inline unsigned int isonum_732(char *p) +{ + return be32_to_cpu(get_unaligned((__le32 *)p)); +} +static inline unsigned int isonum_733(char *p) +{ + /* Ignore bigendian datum due to broken mastering programs */ + return le32_to_cpu(get_unaligned((__le32 *)p)); +} +extern int iso_date(char *, int); + +struct inode; /* To make gcc happy */ + +extern int parse_rock_ridge_inode(struct iso_directory_record *, struct inode *); +extern int get_rock_ridge_filename(struct iso_directory_record *, char *, struct inode *); +extern int isofs_name_translate(struct iso_directory_record *, char *, struct inode *); + +int get_joliet_filename(struct iso_directory_record *, unsigned char *, struct inode *); +int get_acorn_filename(struct iso_directory_record *, char *, struct inode *); + +extern struct dentry *isofs_lookup(struct inode *, struct dentry *, struct nameidata *); +extern struct buffer_head *isofs_bread(struct inode *, sector_t); +extern int isofs_get_blocks(struct inode *, sector_t, struct buffer_head **, unsigned long); + +extern struct inode *isofs_iget(struct super_block *sb, + unsigned long block, + unsigned long offset); + +/* Because the inode number is no longer relevant to finding the + * underlying meta-data for an inode, we are free to choose a more + * convenient 32-bit number as the inode number. The inode numbering + * scheme was recommended by Sergey Vlasov and Eric Lammerts. */ +static inline unsigned long isofs_get_ino(unsigned long block, + unsigned long offset, + unsigned long bufbits) +{ + return (block << (bufbits - 5)) | (offset >> 5); +} + +/* Every directory can have many redundant directory entries scattered + * throughout the directory tree. First there is the directory entry + * with the name of the directory stored in the parent directory. + * Then, there is the "." directory entry stored in the directory + * itself. Finally, there are possibly many ".." directory entries + * stored in all the subdirectories. + * + * In order for the NFS get_parent() method to work and for the + * general consistency of the dcache, we need to make sure the + * "i_iget5_block" and "i_iget5_offset" all point to exactly one of + * the many redundant entries for each directory. We normalize the + * block and offset by always making them point to the "." directory. + * + * Notice that we do not use the entry for the directory with the name + * that is located in the parent directory. Even though choosing this + * first directory is more natural, it is much easier to find the "." + * entry in the NFS get_parent() method because it is implicitly + * encoded in the "extent + ext_attr_length" fields of _all_ the + * redundant entries for the directory. Thus, it can always be + * reached regardless of which directory entry you have in hand. + * + * This works because the "." entry is simply the first directory + * record when you start reading the file that holds all the directory + * records, and this file starts at "extent + ext_attr_length" blocks. + * Because the "." entry is always the first entry listed in the + * directories file, the normalized "offset" value is always 0. + * + * You should pass the directory entry in "de". On return, "block" + * and "offset" will hold normalized values. Only directories are + * affected making it safe to call even for non-directory file + * types. */ +static inline void +isofs_normalize_block_and_offset(struct iso_directory_record* de, + unsigned long *block, + unsigned long *offset) +{ + /* Only directories are normalized. */ + if (de->flags[0] & 2) { + *offset = 0; + *block = (unsigned long)isonum_733(de->extent) + + (unsigned long)isonum_711(de->ext_attr_length); + } +} + +extern struct inode_operations isofs_dir_inode_operations; +extern struct file_operations isofs_dir_operations; +extern struct address_space_operations isofs_symlink_aops; +extern struct export_operations isofs_export_ops; + +/* The following macros are used to check for memory leaks. */ +#ifdef LEAK_CHECK +#define free_s leak_check_free_s +#define malloc leak_check_malloc +#define sb_bread leak_check_bread +#define brelse leak_check_brelse +extern void * leak_check_malloc(unsigned int size); +extern void leak_check_free_s(void * obj, int size); +extern struct buffer_head * leak_check_bread(struct super_block *sb, int block); +extern void leak_check_brelse(struct buffer_head * bh); +#endif /* LEAK_CHECK */ + +#endif /* __KERNEL__ */ + #endif diff --git a/trunk/include/linux/iso_fs_i.h b/trunk/include/linux/iso_fs_i.h new file mode 100644 index 000000000000..59065e939eaa --- /dev/null +++ b/trunk/include/linux/iso_fs_i.h @@ -0,0 +1,27 @@ +#ifndef _ISO_FS_I +#define _ISO_FS_I + +#include + +enum isofs_file_format { + isofs_file_normal = 0, + isofs_file_sparse = 1, + isofs_file_compressed = 2, +}; + +/* + * iso fs inode data in memory + */ +struct iso_inode_info { + unsigned long i_iget5_block; + unsigned long i_iget5_offset; + unsigned int i_first_extent; + unsigned char i_file_format; + unsigned char i_format_parm[3]; + unsigned long i_next_section_block; + unsigned long i_next_section_offset; + off_t i_section_size; + struct inode vfs_inode; +}; + +#endif diff --git a/trunk/include/linux/iso_fs_sb.h b/trunk/include/linux/iso_fs_sb.h new file mode 100644 index 000000000000..043b97b55b8d --- /dev/null +++ b/trunk/include/linux/iso_fs_sb.h @@ -0,0 +1,34 @@ +#ifndef _ISOFS_FS_SB +#define _ISOFS_FS_SB + +/* + * iso9660 super-block data in memory + */ +struct isofs_sb_info { + unsigned long s_ninodes; + unsigned long s_nzones; + unsigned long s_firstdatazone; + unsigned long s_log_zone_size; + unsigned long s_max_size; + + unsigned char s_high_sierra; /* A simple flag */ + unsigned char s_mapping; + int s_rock_offset; /* offset of SUSP fields within SU area */ + unsigned char s_rock; + unsigned char s_joliet_level; + unsigned char s_utf8; + unsigned char s_cruft; /* Broken disks with high + byte of length containing + junk */ + unsigned char s_unhide; + unsigned char s_nosuid; + unsigned char s_nodev; + unsigned char s_nocompress; + + mode_t s_mode; + gid_t s_gid; + uid_t s_uid; + struct nls_table *s_nls_iocharset; /* Native language support table */ +}; + +#endif diff --git a/trunk/net/bluetooth/af_bluetooth.c b/trunk/net/bluetooth/af_bluetooth.c index 12b43345b54f..1650c6bf6997 100644 --- a/trunk/net/bluetooth/af_bluetooth.c +++ b/trunk/net/bluetooth/af_bluetooth.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/net/bluetooth/bnep/sock.c b/trunk/net/bluetooth/bnep/sock.c index 9778c6acd53b..9a8d99a39b6d 100644 --- a/trunk/net/bluetooth/bnep/sock.c +++ b/trunk/net/bluetooth/bnep/sock.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/net/bluetooth/cmtp/capi.c b/trunk/net/bluetooth/cmtp/capi.c index b2e7e38531c6..1e5c030b72ad 100644 --- a/trunk/net/bluetooth/cmtp/capi.c +++ b/trunk/net/bluetooth/cmtp/capi.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/net/bluetooth/cmtp/core.c b/trunk/net/bluetooth/cmtp/core.c index 2e341de3e763..20ce04f2be8b 100644 --- a/trunk/net/bluetooth/cmtp/core.c +++ b/trunk/net/bluetooth/cmtp/core.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/net/bluetooth/cmtp/sock.c b/trunk/net/bluetooth/cmtp/sock.c index beb045bf5714..4c7f9e20dade 100644 --- a/trunk/net/bluetooth/cmtp/sock.c +++ b/trunk/net/bluetooth/cmtp/sock.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/net/bluetooth/hci_conn.c b/trunk/net/bluetooth/hci_conn.c index a31244e58888..71762d7e9970 100644 --- a/trunk/net/bluetooth/hci_conn.c +++ b/trunk/net/bluetooth/hci_conn.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/net/bluetooth/hci_core.c b/trunk/net/bluetooth/hci_core.c index fb5524365bc2..860dba7bdd89 100644 --- a/trunk/net/bluetooth/hci_core.c +++ b/trunk/net/bluetooth/hci_core.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/net/bluetooth/hci_event.c b/trunk/net/bluetooth/hci_event.c index c4b592b4ef10..8ccba8ee9979 100644 --- a/trunk/net/bluetooth/hci_event.c +++ b/trunk/net/bluetooth/hci_event.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/net/bluetooth/hci_sock.c b/trunk/net/bluetooth/hci_sock.c index ebdcce5e7ca0..c9792ba75122 100644 --- a/trunk/net/bluetooth/hci_sock.c +++ b/trunk/net/bluetooth/hci_sock.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/net/bluetooth/hidp/core.c b/trunk/net/bluetooth/hidp/core.c index affbc55462e8..2cf98ceabcc7 100644 --- a/trunk/net/bluetooth/hidp/core.c +++ b/trunk/net/bluetooth/hidp/core.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/net/bluetooth/hidp/sock.c b/trunk/net/bluetooth/hidp/sock.c index f8986f881431..fabb36d4666b 100644 --- a/trunk/net/bluetooth/hidp/sock.c +++ b/trunk/net/bluetooth/hidp/sock.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/net/bluetooth/l2cap.c b/trunk/net/bluetooth/l2cap.c index 32fccfb5bfa5..c12babcf0b3c 100644 --- a/trunk/net/bluetooth/l2cap.c +++ b/trunk/net/bluetooth/l2cap.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/net/bluetooth/rfcomm/sock.c b/trunk/net/bluetooth/rfcomm/sock.c index f3f6355a2786..640028a2183c 100644 --- a/trunk/net/bluetooth/rfcomm/sock.c +++ b/trunk/net/bluetooth/rfcomm/sock.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/net/bluetooth/sco.c b/trunk/net/bluetooth/sco.c index 746c11fc017e..3e750ef09e60 100644 --- a/trunk/net/bluetooth/sco.c +++ b/trunk/net/bluetooth/sco.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/net/core/rtnetlink.c b/trunk/net/core/rtnetlink.c index d8c198e42f90..44dfaf8f04af 100644 --- a/trunk/net/core/rtnetlink.c +++ b/trunk/net/core/rtnetlink.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/net/core/scm.c b/trunk/net/core/scm.c index e887d19be506..a2ebf30f6aa8 100644 --- a/trunk/net/core/scm.c +++ b/trunk/net/core/scm.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/net/core/sock.c b/trunk/net/core/sock.c index 5c2f72fa1013..4df4fa3c5de0 100644 --- a/trunk/net/core/sock.c +++ b/trunk/net/core/sock.c @@ -97,6 +97,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/net/ipv4/af_inet.c b/trunk/net/ipv4/af_inet.c index cdad47642ae7..c34dab67e461 100644 --- a/trunk/net/ipv4/af_inet.c +++ b/trunk/net/ipv4/af_inet.c @@ -73,6 +73,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/net/ipv4/ip_output.c b/trunk/net/ipv4/ip_output.c index 38f69532a029..30ab7b6ab761 100644 --- a/trunk/net/ipv4/ip_output.c +++ b/trunk/net/ipv4/ip_output.c @@ -195,8 +195,6 @@ static inline int ip_finish_output2(struct sk_buff *skb) nf_debug_ip_finish_output2(skb); #endif /*CONFIG_NETFILTER_DEBUG*/ - nf_reset(skb); - if (hh) { int hh_alen; diff --git a/trunk/net/ipv4/netfilter/ip_conntrack_ftp.c b/trunk/net/ipv4/netfilter/ip_conntrack_ftp.c index dd86503aa788..12b88cbb11db 100644 --- a/trunk/net/ipv4/netfilter/ip_conntrack_ftp.c +++ b/trunk/net/ipv4/netfilter/ip_conntrack_ftp.c @@ -252,7 +252,7 @@ static int find_pattern(const char *data, size_t dlen, } /* Look up to see if we're just after a \n. */ -static int find_nl_seq(u32 seq, const struct ip_ct_ftp_master *info, int dir) +static int find_nl_seq(u16 seq, const struct ip_ct_ftp_master *info, int dir) { unsigned int i; @@ -263,7 +263,7 @@ static int find_nl_seq(u32 seq, const struct ip_ct_ftp_master *info, int dir) } /* We don't update if it's older than what we have. */ -static void update_nl_seq(u32 nl_seq, struct ip_ct_ftp_master *info, int dir) +static void update_nl_seq(u16 nl_seq, struct ip_ct_ftp_master *info, int dir) { unsigned int i, oldest = NUM_SEQ_TO_REMEMBER; diff --git a/trunk/net/ipv4/netfilter/ip_conntrack_standalone.c b/trunk/net/ipv4/netfilter/ip_conntrack_standalone.c index 46ca45f74d85..0c29ccf62a89 100644 --- a/trunk/net/ipv4/netfilter/ip_conntrack_standalone.c +++ b/trunk/net/ipv4/netfilter/ip_conntrack_standalone.c @@ -431,6 +431,13 @@ static unsigned int ip_conntrack_defrag(unsigned int hooknum, const struct net_device *out, int (*okfn)(struct sk_buff *)) { +#if !defined(CONFIG_IP_NF_NAT) && !defined(CONFIG_IP_NF_NAT_MODULE) + /* Previously seen (loopback)? Ignore. Do this before + fragment check. */ + if ((*pskb)->nfct) + return NF_ACCEPT; +#endif + /* Gather fragments. */ if ((*pskb)->nh.iph->frag_off & htons(IP_MF|IP_OFFSET)) { *pskb = ip_ct_gather_frags(*pskb, diff --git a/trunk/net/ipv4/tcp_input.c b/trunk/net/ipv4/tcp_input.c index 6984042c0927..250492735902 100644 --- a/trunk/net/ipv4/tcp_input.c +++ b/trunk/net/ipv4/tcp_input.c @@ -3517,6 +3517,7 @@ static void tcp_data_queue(struct sock *sk, struct sk_buff *skb) if (TCP_SKB_CB(skb)->seq == TCP_SKB_CB(skb)->end_seq) goto drop; + th = skb->h.th; __skb_pull(skb, th->doff*4); TCP_ECN_accept_cwr(tp, skb); diff --git a/trunk/net/ipv6/af_inet6.c b/trunk/net/ipv6/af_inet6.c index 2b193e3df49a..53a6680d540f 100644 --- a/trunk/net/ipv6/af_inet6.c +++ b/trunk/net/ipv6/af_inet6.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/net/netlink/af_netlink.c b/trunk/net/netlink/af_netlink.c index 29a5fd231eac..1d5905c90cd4 100644 --- a/trunk/net/netlink/af_netlink.c +++ b/trunk/net/netlink/af_netlink.c @@ -21,6 +21,7 @@ #include #include +#include #include #include #include diff --git a/trunk/net/sched/simple.c b/trunk/net/sched/simple.c index 3ab4c675ab5d..b0d3d15848ad 100644 --- a/trunk/net/sched/simple.c +++ b/trunk/net/sched/simple.c @@ -10,13 +10,27 @@ * */ +#include +#include +#include #include -#include -#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include +#include +#include +#include +#include #include #define TCA_ACT_SIMP 22 diff --git a/trunk/net/unix/af_unix.c b/trunk/net/unix/af_unix.c index c478fc8db776..acc73fe68698 100644 --- a/trunk/net/unix/af_unix.c +++ b/trunk/net/unix/af_unix.c @@ -85,6 +85,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/scripts/mod/file2alias.c b/trunk/scripts/mod/file2alias.c index 32197efe67ed..d54b52d3bb6f 100644 --- a/trunk/scripts/mod/file2alias.c +++ b/trunk/scripts/mod/file2alias.c @@ -47,31 +47,32 @@ do { \ sprintf(str + strlen(str), "*"); \ } while(0) -/* USB is special because the bcdDevice can be matched against a numeric range */ -/* Looks like "usb:vNpNdNdcNdscNdpNicNiscNipN" */ -static void do_usb_entry(struct usb_device_id *id, - unsigned int bcdDevice_initial, int bcdDevice_initial_digits, - unsigned char range_lo, unsigned char range_hi, - struct module *mod) +/* Looks like "usb:vNpNdlNdhNdcNdscNdpNicNiscNipN" */ +static int do_usb_entry(const char *filename, + struct usb_device_id *id, char *alias) { - char alias[500]; + id->match_flags = TO_NATIVE(id->match_flags); + id->idVendor = TO_NATIVE(id->idVendor); + id->idProduct = TO_NATIVE(id->idProduct); + id->bcdDevice_lo = TO_NATIVE(id->bcdDevice_lo); + id->bcdDevice_hi = TO_NATIVE(id->bcdDevice_hi); + + /* + * Some modules (visor) have empty slots as placeholder for + * run-time specification that results in catch-all alias + */ + if (!(id->idVendor | id->bDeviceClass | id->bInterfaceClass)) + return 1; + strcpy(alias, "usb:"); ADD(alias, "v", id->match_flags&USB_DEVICE_ID_MATCH_VENDOR, id->idVendor); ADD(alias, "p", id->match_flags&USB_DEVICE_ID_MATCH_PRODUCT, id->idProduct); - - strcat(alias, "d"); - if (bcdDevice_initial_digits) - sprintf(alias + strlen(alias), "%0*X", - bcdDevice_initial_digits, bcdDevice_initial); - if (range_lo == range_hi) - sprintf(alias + strlen(alias), "%u", range_lo); - else if (range_lo > 0 || range_hi < 9) - sprintf(alias + strlen(alias), "[%u-%u]", range_lo, range_hi); - if (bcdDevice_initial_digits < (sizeof(id->bcdDevice_lo) * 2 - 1)) - strcat(alias, "*"); - + ADD(alias, "dl", id->match_flags&USB_DEVICE_ID_MATCH_DEV_LO, + id->bcdDevice_lo); + ADD(alias, "dh", id->match_flags&USB_DEVICE_ID_MATCH_DEV_HI, + id->bcdDevice_hi); ADD(alias, "dc", id->match_flags&USB_DEVICE_ID_MATCH_DEV_CLASS, id->bDeviceClass); ADD(alias, "dsc", @@ -89,73 +90,7 @@ static void do_usb_entry(struct usb_device_id *id, ADD(alias, "ip", id->match_flags&USB_DEVICE_ID_MATCH_INT_PROTOCOL, id->bInterfaceProtocol); - - /* Always end in a wildcard, for future extension */ - if (alias[strlen(alias)-1] != '*') - strcat(alias, "*"); - buf_printf(&mod->dev_table_buf, - "MODULE_ALIAS(\"%s\");\n", alias); -} - -static void do_usb_entry_multi(struct usb_device_id *id, struct module *mod) -{ - unsigned int devlo, devhi; - unsigned char chi, clo; - int ndigits; - - id->match_flags = TO_NATIVE(id->match_flags); - id->idVendor = TO_NATIVE(id->idVendor); - id->idProduct = TO_NATIVE(id->idProduct); - - devlo = id->match_flags & USB_DEVICE_ID_MATCH_DEV_LO ? - TO_NATIVE(id->bcdDevice_lo) : 0x0U; - devhi = id->match_flags & USB_DEVICE_ID_MATCH_DEV_HI ? - TO_NATIVE(id->bcdDevice_hi) : ~0x0U; - - /* - * Some modules (visor) have empty slots as placeholder for - * run-time specification that results in catch-all alias - */ - if (!(id->idVendor | id->bDeviceClass | id->bInterfaceClass)) - return; - - /* Convert numeric bcdDevice range into fnmatch-able pattern(s) */ - for (ndigits = sizeof(id->bcdDevice_lo) * 2 - 1; devlo <= devhi; ndigits--) { - clo = devlo & 0xf; - chi = devhi & 0xf; - if (chi > 9) /* it's bcd not hex */ - chi = 9; - devlo >>= 4; - devhi >>= 4; - - if (devlo == devhi || !ndigits) { - do_usb_entry(id, devlo, ndigits, clo, chi, mod); - break; - } - - if (clo > 0) - do_usb_entry(id, devlo++, ndigits, clo, 9, mod); - - if (chi < 9) - do_usb_entry(id, devhi--, ndigits, 0, chi, mod); - } -} - -static void do_usb_table(void *symval, unsigned long size, - struct module *mod) -{ - unsigned int i; - const unsigned long id_size = sizeof(struct usb_device_id); - - if (size % id_size || size < id_size) { - fprintf(stderr, "*** Warning: %s ids %lu bad size " - "(each on %lu)\n", mod->name, size, id_size); - } - /* Leave last one: it's the terminator. */ - size -= id_size; - - for (i = 0; i < size; i += id_size) - do_usb_entry_multi(symval + i, mod); + return 1; } /* Looks like: ieee1394:venNmoNspNverN */ @@ -345,8 +280,8 @@ void handle_moddevtable(struct module *mod, struct elf_info *info, do_table(symval, sym->st_size, sizeof(struct pci_device_id), do_pci_entry, mod); else if (sym_is(symname, "__mod_usb_device_table")) - /* special case to handle bcdDevice ranges */ - do_usb_table(symval, sym->st_size, mod); + do_table(symval, sym->st_size, sizeof(struct usb_device_id), + do_usb_entry, mod); else if (sym_is(symname, "__mod_ieee1394_device_table")) do_table(symval, sym->st_size, sizeof(struct ieee1394_device_id), do_ieee1394_entry, mod); diff --git a/trunk/sound/ppc/Kconfig b/trunk/sound/ppc/Kconfig index 75213bf4d567..b0a9ebf8bf3b 100644 --- a/trunk/sound/ppc/Kconfig +++ b/trunk/sound/ppc/Kconfig @@ -11,7 +11,7 @@ comment "ALSA PowerMac requires INPUT" config SND_POWERMAC tristate "PowerMac (AWACS, DACA, Burgundy, Tumbler, Keywest)" - depends on SND && I2C && INPUT && PPC_PMAC + depends on SND && I2C && INPUT select SND_PCM help Say Y here to include support for the integrated sound device.