Commit 7afd6dff authored by David S. Miller's avatar David S. Miller

Merge nuts.ninka.net:/home/davem/src/BK/network-2.5

into nuts.ninka.net:/home/davem/src/BK/net-2.5
parents 5ce917a7 4445b58e
...@@ -307,7 +307,7 @@ if (result) { ...@@ -307,7 +307,7 @@ if (result) {
</programlisting> </programlisting>
<para> <para>
When the write urb is filled up with the proper information using the When the write urb is filled up with the proper information using the
FILL_BULK_URB function, we point the urb's completion callback to call our usb_fill_bulk_urb function, we point the urb's completion callback to call our
own skel_write_bulk_callback function. This function is called when the own skel_write_bulk_callback function. This function is called when the
urb is finished by the USB subsystem. The callback function is called in urb is finished by the USB subsystem. The callback function is called in
interrupt context, so caution must be taken not to do very much processing interrupt context, so caution must be taken not to do very much processing
......
...@@ -2667,7 +2667,7 @@ under /dev. These special filesystems provide kernel interfaces that ...@@ -2667,7 +2667,7 @@ under /dev. These special filesystems provide kernel interfaces that
cannot be provided with standard device nodes. cannot be provided with standard device nodes.
/dev/pts devpts PTY slave filesystem /dev/pts devpts PTY slave filesystem
/dev/shm shmfs POSIX shared memory maintenance access /dev/shm tmpfs POSIX shared memory maintenance access
**** TERMINAL DEVICES **** TERMINAL DEVICES
......
...@@ -47,10 +47,9 @@ tmpfs has the following uses: ...@@ -47,10 +47,9 @@ tmpfs has the following uses:
shared memory) shared memory)
3) Some people (including me) find it very convenient to mount it 3) Some people (including me) find it very convenient to mount it
e.g. on /tmp and /var/tmp and have a big swap partition. But be e.g. on /tmp and /var/tmp and have a big swap partition. And now
aware: loop mounts of tmpfs files do not work due to the internal loop mounts of tmpfs files do work, so mkinitrd shipped by most
design. So mkinitrd shipped by most distributions will fail with a distributions should succeed with a tmpfs /tmp.
tmpfs /tmp.
4) And probably a lot more I do not know about :-) 4) And probably a lot more I do not know about :-)
...@@ -90,13 +89,9 @@ TODOs: ...@@ -90,13 +89,9 @@ TODOs:
size=50% the tmpfs instance should be able to grow to 50 percent of size=50% the tmpfs instance should be able to grow to 50 percent of
RAM + swap. So the instance should adapt automatically if you add RAM + swap. So the instance should adapt automatically if you add
or remove swap space. or remove swap space.
2) loop mounts: This is difficult since loop.c relies on the readpage 2) Show the number of tmpfs RAM pages. (As shared?)
operation. This operation gets a page from the caller to be filled
with the content of the file at that position. But tmpfs always has
the page and thus cannot copy the content to the given page. So it
cannot provide this operation. The VM had to be changed seriously
to achieve this.
3) Show the number of tmpfs RAM pages. (As shared?)
Author: Author:
Christoph Rohland <cr@sap.com>, 1.12.01 Christoph Rohland <cr@sap.com>, 1.12.01
Updated:
Hugh Dickins <hugh@veritas.com>, 17 Oct 2002
...@@ -109,7 +109,7 @@ Take a look at the some existing drivers to see how they're used. ...@@ -109,7 +109,7 @@ Take a look at the some existing drivers to see how they're used.
Flags: Flags:
For ISO there are two startup behaviors: Specified start_frame or ASAP. For ISO there are two startup behaviors: Specified start_frame or ASAP.
For ASAP set USB_ISO_ASAP in transfer_flags. For ASAP set URB_ISO_ASAP in transfer_flags.
If short packets should NOT be tolerated, set URB_SHORT_NOT_OK in If short packets should NOT be tolerated, set URB_SHORT_NOT_OK in
transfer_flags. transfer_flags.
...@@ -156,7 +156,7 @@ usb_unlink_urb() returns with that status code, you can free the URB ...@@ -156,7 +156,7 @@ usb_unlink_urb() returns with that status code, you can free the URB
with usb_free_urb(). with usb_free_urb().
There is also an asynchronous unlink mode. To use this, set the There is also an asynchronous unlink mode. To use this, set the
the USB_ASYNC_UNLINK flag in urb->transfer flags before calling the URB_ASYNC_UNLINK flag in urb->transfer flags before calling
usb_unlink_urb(). When using async unlinking, the URB will not usb_unlink_urb(). When using async unlinking, the URB will not
normally be unlinked when usb_unlink_urb() returns. Instead, wait normally be unlinked when usb_unlink_urb() returns. Instead, wait
for the completion handler to be called. for the completion handler to be called.
......
The Linux kernel supports four overcommit handling modes The Linux kernel supports three overcommit handling modes
0 - Heuristic overcommit handling. Obvious overcommits of 0 - Heuristic overcommit handling. Obvious overcommits of
address space are refused. Used for a typical system. It address space are refused. Used for a typical system. It
......
...@@ -1210,6 +1210,12 @@ M: zwane@commfireservices.com ...@@ -1210,6 +1210,12 @@ M: zwane@commfireservices.com
L: linux-sound@vger.kernel.org L: linux-sound@vger.kernel.org
S: Maintained S: Maintained
OPROFILE
P: John Levon
M: levon@movementarian.org
L: oprofile-list@lists.sf.net
S: Maintained
ORINOCO DRIVER ORINOCO DRIVER
P: David Gibson P: David Gibson
M: hermes@gibson.dropbear.id.au M: hermes@gibson.dropbear.id.au
......
...@@ -22,24 +22,26 @@ LDFLAGS_vmlinux := -e stext ...@@ -22,24 +22,26 @@ LDFLAGS_vmlinux := -e stext
CFLAGS += -pipe CFLAGS += -pipe
check_gcc = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi)
# prevent gcc from keeping the stack 16 byte aligned # prevent gcc from keeping the stack 16 byte aligned
CFLAGS += $(shell if $(CC) -mpreferred-stack-boundary=2 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mpreferred-stack-boundary=2"; fi) CFLAGS += $(call check_gcc,-mpreferred-stack-boundary=2,)
cflags-$(CONFIG_M386) += -march=i386 cflags-$(CONFIG_M386) += -march=i386
cflags-$(CONFIG_M486) += -march=i486 cflags-$(CONFIG_M486) += -march=i486
cflags-$(CONFIG_M586) += -march=i586 cflags-$(CONFIG_M586) += -march=i586
cflags-$(CONFIG_M586TSC) += -march=i586 cflags-$(CONFIG_M586TSC) += -march=i586
cflags-$(CONFIG_M586MMX) += -march=i586 cflags-$(CONFIG_M586MMX) += $(call check_gcc,-march=pentium-mmx,-march=i586)
cflags-$(CONFIG_M686) += -march=i686 cflags-$(CONFIG_M686) += -march=i686
cflags-$(CONFIG_MPENTIUMIII) += -march=i686 cflags-$(CONFIG_MPENTIUMIII) += $(call check_gcc,-march=pentium3,-march=i686)
cflags-$(CONFIG_MPENTIUM4) += -march=i686 cflags-$(CONFIG_MPENTIUM4) += $(call check_gcc,-march=pentium4,-march=i686)
cflags-$(CONFIG_MK6) += $(shell if $(CC) -march=k6 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=k6"; else echo "-march=i586"; fi) cflags-$(CONFIG_MK6) += $(call check_gcc,-march=k6,-march=i586)
cflags-$(CONFIG_MK7) += $(shell if $(CC) -march=athlon -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=athlon"; else echo "-march=i686 -malign-functions=4"; fi) cflags-$(CONFIG_MK7) += $(call check_gcc,-march=athlon,-march=i686 -malign-functions=4)
cflags-$(CONFIG_MCRUSOE) += -march=i686 -malign-functions=0 -malign-jumps=0 -malign-loops=0 cflags-$(CONFIG_MCRUSOE) += -march=i686 -malign-functions=0 -malign-jumps=0 -malign-loops=0
cflags-$(CONFIG_MWINCHIPC6) += -march=i586 cflags-$(CONFIG_MWINCHIPC6) += $(call check_gcc,-march=winchip-c6,-march=i586)
cflags-$(CONFIG_MWINCHIP2) += -march=i586 cflags-$(CONFIG_MWINCHIP2) += $(call check_gcc,-march=winchip2,-march=i586)
cflags-$(CONFIG_MWINCHIP3D) += -march=i586 cflags-$(CONFIG_MWINCHIP3D) += -march=i586
cflags-$(CONFIG_MCYRIXIII) += -march=i586 cflags-$(CONFIG_MCYRIXIII) += $(call check_gcc,-march=c3,-march=i586)
CFLAGS += $(cflags-y) CFLAGS += $(cflags-y)
......
...@@ -83,6 +83,7 @@ if [ "$CONFIG_M586MMX" = "y" ]; then ...@@ -83,6 +83,7 @@ if [ "$CONFIG_M586MMX" = "y" ]; then
define_bool CONFIG_X86_GOOD_APIC y define_bool CONFIG_X86_GOOD_APIC y
define_bool CONFIG_X86_PPRO_FENCE y define_bool CONFIG_X86_PPRO_FENCE y
define_bool CONFIG_X86_F00F_BUG y define_bool CONFIG_X86_F00F_BUG y
define_bool CONFIG_X86_INTEL_USERCOPY y
fi fi
if [ "$CONFIG_M686" = "y" ]; then if [ "$CONFIG_M686" = "y" ]; then
define_int CONFIG_X86_L1_CACHE_SHIFT 5 define_int CONFIG_X86_L1_CACHE_SHIFT 5
...@@ -96,12 +97,14 @@ if [ "$CONFIG_MPENTIUMIII" = "y" ]; then ...@@ -96,12 +97,14 @@ if [ "$CONFIG_MPENTIUMIII" = "y" ]; then
define_bool CONFIG_X86_TSC y define_bool CONFIG_X86_TSC y
define_bool CONFIG_X86_GOOD_APIC y define_bool CONFIG_X86_GOOD_APIC y
define_bool CONFIG_X86_USE_PPRO_CHECKSUM y define_bool CONFIG_X86_USE_PPRO_CHECKSUM y
define_bool CONFIG_X86_INTEL_USERCOPY y
fi fi
if [ "$CONFIG_MPENTIUM4" = "y" ]; then if [ "$CONFIG_MPENTIUM4" = "y" ]; then
define_int CONFIG_X86_L1_CACHE_SHIFT 7 define_int CONFIG_X86_L1_CACHE_SHIFT 7
define_bool CONFIG_X86_TSC y define_bool CONFIG_X86_TSC y
define_bool CONFIG_X86_GOOD_APIC y define_bool CONFIG_X86_GOOD_APIC y
define_bool CONFIG_X86_USE_PPRO_CHECKSUM y define_bool CONFIG_X86_USE_PPRO_CHECKSUM y
define_bool CONFIG_X86_INTEL_USERCOPY y
fi fi
if [ "$CONFIG_MK6" = "y" ]; then if [ "$CONFIG_MK6" = "y" ]; then
define_int CONFIG_X86_L1_CACHE_SHIFT 5 define_int CONFIG_X86_L1_CACHE_SHIFT 5
......
...@@ -14,9 +14,11 @@ static int disable_x86_serial_nr __initdata = 1; ...@@ -14,9 +14,11 @@ static int disable_x86_serial_nr __initdata = 1;
static int disable_P4_HT __initdata = 0; static int disable_P4_HT __initdata = 0;
extern int trap_init_f00f_bug(void); extern int trap_init_f00f_bug(void);
#ifdef INTEL_MOVSL #ifdef CONFIG_X86_INTEL_USERCOPY
struct movsl_mask movsl_mask; /* alignment at which movsl is preferred for /*
bulk memory copies */ * Alignment at which movsl is preferred for bulk memory copies.
*/
struct movsl_mask movsl_mask;
#endif #endif
/* /*
...@@ -355,7 +357,7 @@ static void __init init_intel(struct cpuinfo_x86 *c) ...@@ -355,7 +357,7 @@ static void __init init_intel(struct cpuinfo_x86 *c)
/* Work around errata */ /* Work around errata */
Intel_errata_workarounds(c); Intel_errata_workarounds(c);
#ifdef INTEL_MOVSL #ifdef CONFIG_X86_INTEL_USERCOPY
/* /*
* Set up the preferred alignment for movsl bulk memory moves * Set up the preferred alignment for movsl bulk memory moves
*/ */
...@@ -372,7 +374,6 @@ static void __init init_intel(struct cpuinfo_x86 *c) ...@@ -372,7 +374,6 @@ static void __init init_intel(struct cpuinfo_x86 *c)
break; break;
} }
#endif #endif
} }
......
...@@ -72,7 +72,9 @@ EXPORT_SYMBOL(pfn_to_nid); ...@@ -72,7 +72,9 @@ EXPORT_SYMBOL(pfn_to_nid);
#ifdef CONFIG_X86_NUMAQ #ifdef CONFIG_X86_NUMAQ
EXPORT_SYMBOL(xquad_portio); EXPORT_SYMBOL(xquad_portio);
#endif #endif
#ifndef CONFIG_X86_WP_WORKS_OK
EXPORT_SYMBOL(__verify_write); EXPORT_SYMBOL(__verify_write);
#endif
EXPORT_SYMBOL(dump_thread); EXPORT_SYMBOL(dump_thread);
EXPORT_SYMBOL(dump_fpu); EXPORT_SYMBOL(dump_fpu);
EXPORT_SYMBOL(dump_extended_fpu); EXPORT_SYMBOL(dump_extended_fpu);
......
...@@ -375,12 +375,8 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) ...@@ -375,12 +375,8 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
break; break;
} }
ret = 0; ret = 0;
if ( !child->used_math ) { if (!child->used_math)
/* Simulate an empty FPU. */ init_fpu(child);
set_fpu_cwd(child, 0x037f);
set_fpu_swd(child, 0x0000);
set_fpu_twd(child, 0xffff);
}
get_fpregs((struct user_i387_struct *)data, child); get_fpregs((struct user_i387_struct *)data, child);
break; break;
} }
...@@ -403,13 +399,8 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) ...@@ -403,13 +399,8 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
ret = -EIO; ret = -EIO;
break; break;
} }
if ( !child->used_math ) { if (!child->used_math)
/* Simulate an empty FPU. */ init_fpu(child);
set_fpu_cwd(child, 0x037f);
set_fpu_swd(child, 0x0000);
set_fpu_twd(child, 0xffff);
set_fpu_mxcsr(child, 0x1f80);
}
ret = get_fpxregs((struct user_fxsr_struct *)data, child); ret = get_fpxregs((struct user_fxsr_struct *)data, child);
break; break;
} }
......
...@@ -54,10 +54,10 @@ static inline void save_processor_context (void) ...@@ -54,10 +54,10 @@ static inline void save_processor_context (void)
/* /*
* descriptor tables * descriptor tables
*/ */
asm volatile ("sgdt (%0)" : "=m" (saved_context.gdt_limit)); asm volatile ("sgdt %0" : "=m" (saved_context.gdt_limit));
asm volatile ("sidt (%0)" : "=m" (saved_context.idt_limit)); asm volatile ("sidt %0" : "=m" (saved_context.idt_limit));
asm volatile ("sldt (%0)" : "=m" (saved_context.ldt)); asm volatile ("sldt %0" : "=m" (saved_context.ldt));
asm volatile ("str (%0)" : "=m" (saved_context.tr)); asm volatile ("str %0" : "=m" (saved_context.tr));
/* /*
* save the general registers. * save the general registers.
...@@ -67,22 +67,22 @@ static inline void save_processor_context (void) ...@@ -67,22 +67,22 @@ static inline void save_processor_context (void)
* It's really not necessary, and kinda fishy (check the assembly output), * It's really not necessary, and kinda fishy (check the assembly output),
* so it's avoided. * so it's avoided.
*/ */
asm volatile ("movl %%esp, (%0)" : "=m" (saved_context.esp)); asm volatile ("movl %%esp, %0" : "=m" (saved_context.esp));
asm volatile ("movl %%eax, (%0)" : "=m" (saved_context.eax)); asm volatile ("movl %%eax, %0" : "=m" (saved_context.eax));
asm volatile ("movl %%ebx, (%0)" : "=m" (saved_context.ebx)); asm volatile ("movl %%ebx, %0" : "=m" (saved_context.ebx));
asm volatile ("movl %%ecx, (%0)" : "=m" (saved_context.ecx)); asm volatile ("movl %%ecx, %0" : "=m" (saved_context.ecx));
asm volatile ("movl %%edx, (%0)" : "=m" (saved_context.edx)); asm volatile ("movl %%edx, %0" : "=m" (saved_context.edx));
asm volatile ("movl %%ebp, (%0)" : "=m" (saved_context.ebp)); asm volatile ("movl %%ebp, %0" : "=m" (saved_context.ebp));
asm volatile ("movl %%esi, (%0)" : "=m" (saved_context.esi)); asm volatile ("movl %%esi, %0" : "=m" (saved_context.esi));
asm volatile ("movl %%edi, (%0)" : "=m" (saved_context.edi)); asm volatile ("movl %%edi, %0" : "=m" (saved_context.edi));
/* FIXME: Need to save XMM0..XMM15? */
/* /*
* segment registers * segment registers
*/ */
asm volatile ("movw %%es, %0" : "=r" (saved_context.es)); asm volatile ("movw %%es, %0" : "=m" (saved_context.es));
asm volatile ("movw %%fs, %0" : "=r" (saved_context.fs)); asm volatile ("movw %%fs, %0" : "=m" (saved_context.fs));
asm volatile ("movw %%gs, %0" : "=r" (saved_context.gs)); asm volatile ("movw %%gs, %0" : "=m" (saved_context.gs));
asm volatile ("movw %%ss, %0" : "=r" (saved_context.ss)); asm volatile ("movw %%ss, %0" : "=m" (saved_context.ss));
/* /*
* control registers * control registers
...@@ -95,7 +95,7 @@ static inline void save_processor_context (void) ...@@ -95,7 +95,7 @@ static inline void save_processor_context (void)
/* /*
* eflags * eflags
*/ */
asm volatile ("pushfl ; popl (%0)" : "=m" (saved_context.eflags)); asm volatile ("pushfl ; popl %0" : "=m" (saved_context.eflags));
} }
static void static void
...@@ -125,9 +125,7 @@ static inline void restore_processor_context (void) ...@@ -125,9 +125,7 @@ static inline void restore_processor_context (void)
/* /*
* first restore %ds, so we can access our data properly * first restore %ds, so we can access our data properly
*/ */
asm volatile (".align 4"); asm volatile ("movw %0, %%ds" :: "r" (__KERNEL_DS));
asm volatile ("movw %0, %%ds" :: "r" ((u16)__KERNEL_DS));
/* /*
* control registers * control registers
...@@ -167,9 +165,9 @@ static inline void restore_processor_context (void) ...@@ -167,9 +165,9 @@ static inline void restore_processor_context (void)
* now restore the descriptor tables to their proper values * now restore the descriptor tables to their proper values
* ltr is done i fix_processor_context(). * ltr is done i fix_processor_context().
*/ */
asm volatile ("lgdt (%0)" :: "m" (saved_context.gdt_limit)); asm volatile ("lgdt %0" :: "m" (saved_context.gdt_limit));
asm volatile ("lidt (%0)" :: "m" (saved_context.idt_limit)); asm volatile ("lidt %0" :: "m" (saved_context.idt_limit));
asm volatile ("lldt (%0)" :: "m" (saved_context.ldt)); asm volatile ("lldt %0" :: "m" (saved_context.ldt));
fix_processor_context(); fix_processor_context();
......
...@@ -9,21 +9,14 @@ ...@@ -9,21 +9,14 @@
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/mmx.h> #include <asm/mmx.h>
#ifdef INTEL_MOVSL
static inline int movsl_is_ok(const void *a1, const void *a2, unsigned long n) static inline int movsl_is_ok(const void *a1, const void *a2, unsigned long n)
{ {
if (n < 64) #ifdef CONFIG_X86_INTEL_USERCOPY
return 1; if (n >= 64 && (((const long)a1 ^ (const long)a2) & movsl_mask.mask))
if ((((const long)a1 ^ (const long)a2) & movsl_mask.mask) == 0)
return 1;
return 0; return 0;
} #endif
#else
static inline int movsl_is_ok(const void *a1, const void *a2, unsigned long n)
{
return 1; return 1;
} }
#endif
/* /*
* Copy a null terminated string from userspace. * Copy a null terminated string from userspace.
...@@ -151,8 +144,7 @@ long strnlen_user(const char *s, long n) ...@@ -151,8 +144,7 @@ long strnlen_user(const char *s, long n)
return res & mask; return res & mask;
} }
#ifdef INTEL_MOVSL #ifdef CONFIG_X86_INTEL_USERCOPY
static unsigned long static unsigned long
__copy_user_intel(void *to, const void *from,unsigned long size) __copy_user_intel(void *to, const void *from,unsigned long size)
{ {
...@@ -334,8 +326,7 @@ __copy_user_zeroing_intel(void *to, const void *from, unsigned long size) ...@@ -334,8 +326,7 @@ __copy_user_zeroing_intel(void *to, const void *from, unsigned long size)
: "eax", "edx", "memory"); : "eax", "edx", "memory");
return size; return size;
} }
#else /* INTEL_MOVSL */ #else
/* /*
* Leave these declared but undefined. They should not be any references to * Leave these declared but undefined. They should not be any references to
* them * them
...@@ -344,8 +335,7 @@ unsigned long ...@@ -344,8 +335,7 @@ unsigned long
__copy_user_zeroing_intel(void *to, const void *from, unsigned long size); __copy_user_zeroing_intel(void *to, const void *from, unsigned long size);
unsigned long unsigned long
__copy_user_intel(void *to, const void *from,unsigned long size); __copy_user_intel(void *to, const void *from,unsigned long size);
#endif /* CONFIG_X86_INTEL_USERCOPY */
#endif /* INTEL_MOVSL */
/* Generic arbitrary sized copy. */ /* Generic arbitrary sized copy. */
#define __copy_user(to,from,size) \ #define __copy_user(to,from,size) \
......
...@@ -30,17 +30,20 @@ extern void die(const char *,struct pt_regs *,long); ...@@ -30,17 +30,20 @@ extern void die(const char *,struct pt_regs *,long);
extern int console_loglevel; extern int console_loglevel;
#ifndef CONFIG_X86_WP_WORKS_OK
/* /*
* Ugly, ugly, but the goto's result in better assembly.. * Ugly, ugly, but the goto's result in better assembly..
*/ */
int __verify_write(const void * addr, unsigned long size) int __verify_write(const void * addr, unsigned long size)
{ {
struct mm_struct *mm = current->mm;
struct vm_area_struct * vma; struct vm_area_struct * vma;
unsigned long start = (unsigned long) addr; unsigned long start = (unsigned long) addr;
if (!size) if (!size || segment_eq(get_fs(),KERNEL_DS))
return 1; return 1;
down_read(&mm->mmap_sem);
vma = find_vma(current->mm, start); vma = find_vma(current->mm, start);
if (!vma) if (!vma)
goto bad_area; goto bad_area;
...@@ -80,6 +83,13 @@ int __verify_write(const void * addr, unsigned long size) ...@@ -80,6 +83,13 @@ int __verify_write(const void * addr, unsigned long size)
if (!(vma->vm_flags & VM_WRITE)) if (!(vma->vm_flags & VM_WRITE))
goto bad_area;; goto bad_area;;
} }
/*
* We really need to hold mmap_sem over the whole access to
* userspace, else another thread could change permissions.
* This is unfixable, so don't use i386-class machines for
* critical servers.
*/
up_read(&mm->mmap_sem);
return 1; return 1;
check_stack: check_stack:
...@@ -89,6 +99,7 @@ int __verify_write(const void * addr, unsigned long size) ...@@ -89,6 +99,7 @@ int __verify_write(const void * addr, unsigned long size)
goto good_area; goto good_area;
bad_area: bad_area:
up_read(&mm->mmap_sem);
return 0; return 0;
out_of_memory: out_of_memory:
...@@ -98,6 +109,7 @@ int __verify_write(const void * addr, unsigned long size) ...@@ -98,6 +109,7 @@ int __verify_write(const void * addr, unsigned long size)
} }
goto bad_area; goto bad_area;
} }
#endif
/* /*
* Unlock any spinlocks which will prevent us from getting the * Unlock any spinlocks which will prevent us from getting the
......
...@@ -378,15 +378,10 @@ void __init paging_init(void) ...@@ -378,15 +378,10 @@ void __init paging_init(void)
* This function cannot be __init, since exceptions don't work in that * This function cannot be __init, since exceptions don't work in that
* section. * section.
*/ */
static int do_test_wp_bit(unsigned long vaddr); static int do_test_wp_bit(void);
void __init test_wp_bit(void) void __init test_wp_bit(void)
{ {
const unsigned long vaddr = PAGE_OFFSET;
pgd_t *pgd;
pmd_t *pmd;
pte_t *pte, old_pte;
if (cpu_has_pse) { if (cpu_has_pse) {
/* Ok, all PSE-capable CPUs are definitely handling the WP bit right. */ /* Ok, all PSE-capable CPUs are definitely handling the WP bit right. */
boot_cpu_data.wp_works_ok = 1; boot_cpu_data.wp_works_ok = 1;
...@@ -395,17 +390,10 @@ void __init test_wp_bit(void) ...@@ -395,17 +390,10 @@ void __init test_wp_bit(void)
printk("Checking if this processor honours the WP bit even in supervisor mode... "); printk("Checking if this processor honours the WP bit even in supervisor mode... ");
pgd = swapper_pg_dir + __pgd_offset(vaddr); /* Any page-aligned address will do, the test is non-destructive */
pmd = pmd_offset(pgd, vaddr); __set_fixmap(FIX_WP_TEST, __pa(&swapper_pg_dir), PAGE_READONLY);
pte = pte_offset_kernel(pmd, vaddr); boot_cpu_data.wp_works_ok = do_test_wp_bit();
old_pte = *pte; clear_fixmap(FIX_WP_TEST);
*pte = pfn_pte(0, PAGE_READONLY);
local_flush_tlb();
boot_cpu_data.wp_works_ok = do_test_wp_bit(vaddr);
*pte = old_pte;
local_flush_tlb();
if (!boot_cpu_data.wp_works_ok) { if (!boot_cpu_data.wp_works_ok) {
printk("No.\n"); printk("No.\n");
...@@ -550,7 +538,7 @@ void __init pgtable_cache_init(void) ...@@ -550,7 +538,7 @@ void __init pgtable_cache_init(void)
#endif #endif
/* Put this after the callers, so that it cannot be inlined */ /* Put this after the callers, so that it cannot be inlined */
static int do_test_wp_bit(unsigned long vaddr) static int do_test_wp_bit(void)
{ {
char tmp_reg; char tmp_reg;
int flag; int flag;
...@@ -564,7 +552,7 @@ static int do_test_wp_bit(unsigned long vaddr) ...@@ -564,7 +552,7 @@ static int do_test_wp_bit(unsigned long vaddr)
" .align 4 \n" " .align 4 \n"
" .long 1b,2b \n" " .long 1b,2b \n"
".previous \n" ".previous \n"
:"=m" (*(char *) vaddr), :"=m" (*(char *)fix_to_virt(FIX_WP_TEST)),
"=q" (tmp_reg), "=q" (tmp_reg),
"=r" (flag) "=r" (flag)
:"2" (1) :"2" (1)
......
...@@ -289,7 +289,7 @@ void __init bt_iounmap(void *addr, unsigned long size) ...@@ -289,7 +289,7 @@ void __init bt_iounmap(void *addr, unsigned long size)
idx = FIX_BTMAP_BEGIN; idx = FIX_BTMAP_BEGIN;
while (nrpages > 0) { while (nrpages > 0) {
__set_fixmap(idx, 0, __pgprot(0)); clear_fixmap(idx);
--idx; --idx;
--nrpages; --nrpages;
} }
......
...@@ -95,17 +95,16 @@ static int athlon_check_ctrs(unsigned int const cpu, ...@@ -95,17 +95,16 @@ static int athlon_check_ctrs(unsigned int const cpu,
struct pt_regs * const regs) struct pt_regs * const regs)
{ {
unsigned int low, high; unsigned int low, high;
int handled = 0;
int i; int i;
for (i = 0 ; i < NUM_COUNTERS; ++i) { for (i = 0 ; i < NUM_COUNTERS; ++i) {
CTR_READ(low, high, msrs, i); CTR_READ(low, high, msrs, i);
if (CTR_OVERFLOWED(low)) { if (CTR_OVERFLOWED(low)) {
oprofile_add_sample(regs->eip, i, cpu); oprofile_add_sample(regs->eip, i, cpu);
CTR_WRITE(reset_value[i], msrs, i); CTR_WRITE(reset_value[i], msrs, i);
handled = 1; return 1;
} }
} }
return handled; return 0;
} }
......
...@@ -90,17 +90,16 @@ static int ppro_check_ctrs(unsigned int const cpu, ...@@ -90,17 +90,16 @@ static int ppro_check_ctrs(unsigned int const cpu,
{ {
unsigned int low, high; unsigned int low, high;
int i; int i;
int handled = 0;
for (i = 0 ; i < NUM_COUNTERS; ++i) { for (i = 0 ; i < NUM_COUNTERS; ++i) {
CTR_READ(low, high, msrs, i); CTR_READ(low, high, msrs, i);
if (CTR_OVERFLOWED(low)) { if (CTR_OVERFLOWED(low)) {
oprofile_add_sample(regs->eip, i, cpu); oprofile_add_sample(regs->eip, i, cpu);
CTR_WRITE(reset_value[i], msrs, i); CTR_WRITE(reset_value[i], msrs, i);
handled = 1; return 1;
} }
} }
return handled; return 0;
} }
......
...@@ -29,58 +29,6 @@ ...@@ -29,58 +29,6 @@
extern void die(const char *,struct pt_regs *,long); extern void die(const char *,struct pt_regs *,long);
/*
* Ugly, ugly, but the goto's result in better assembly..
*/
int __verify_write(const void * addr, unsigned long size)
{
struct vm_area_struct * vma;
unsigned long start = (unsigned long) addr;
if (!size)
return 1;
vma = find_vma(current->mm, start);
if (!vma)
goto bad_area;
if (vma->vm_start > start)
goto check_stack;
good_area:
if (!(vma->vm_flags & VM_WRITE))
goto bad_area;
size--;
size += start & ~PAGE_MASK;
size >>= PAGE_SHIFT;
start &= PAGE_MASK;
for (;;) {
if (handle_mm_fault(current->mm, vma, start, 1) <= 0)
goto bad_area;
if (!size)
break;
size--;
start += PAGE_SIZE;
if (start < vma->vm_end)
continue;
vma = vma->vm_next;
if (!vma || vma->vm_start != start)
goto bad_area;
if (!(vma->vm_flags & VM_WRITE))
goto bad_area;;
}
return 1;
check_stack:
if (!(vma->vm_flags & VM_GROWSDOWN))
goto bad_area;
if (expand_stack(vma, start) == 0)
goto good_area;
bad_area:
return 0;
}
/* /*
* This routine handles page faults. It determines the address, * This routine handles page faults. It determines the address,
* and the problem, and then passes it off to one of the appropriate * and the problem, and then passes it off to one of the appropriate
......
...@@ -1528,6 +1528,7 @@ static struct gendisk *floppy_find(dev_t dev, int *part, void *data) ...@@ -1528,6 +1528,7 @@ static struct gendisk *floppy_find(dev_t dev, int *part, void *data)
int drive = *part & 3; int drive = *part & 3;
if ((*part >> 2) > NUM_DISK_TYPES || drive >= FD_MAX_UNITS) if ((*part >> 2) > NUM_DISK_TYPES || drive >= FD_MAX_UNITS)
return NULL; return NULL;
*part = 0;
return get_disk(disks[drive]); return get_disk(disks[drive]);
} }
......
...@@ -22,10 +22,7 @@ if [ "$CONFIG_X86" = "y" ]; then ...@@ -22,10 +22,7 @@ if [ "$CONFIG_X86" = "y" ]; then
tristate ' Fan' CONFIG_ACPI_FAN tristate ' Fan' CONFIG_ACPI_FAN
tristate ' Processor' CONFIG_ACPI_PROCESSOR tristate ' Processor' CONFIG_ACPI_PROCESSOR
if [ "$CONFIG_ACPI_PROCESSOR" != "n" ]; then if [ "$CONFIG_ACPI_PROCESSOR" != "n" ]; then
bool ' Processor Performance States' CONFIG_ACPI_PROCESSOR_PERF dep_bool ' Processor Performance States' CONFIG_ACPI_PROCESSOR_PERF $CONFIG_CPU_FREQ
if [ "$CONFIG_CPU_FREQ" != "y" ]; then
define_bool CONFIG_CPU_FREQ $CONFIG_ACPI_PROCESSOR_PERF
fi
fi fi
dep_tristate ' Thermal Zone' CONFIG_ACPI_THERMAL $CONFIG_ACPI_PROCESSOR dep_tristate ' Thermal Zone' CONFIG_ACPI_THERMAL $CONFIG_ACPI_PROCESSOR
if [ "$CONFIG_NUMA" = "y" ]; then if [ "$CONFIG_NUMA" = "y" ]; then
......
...@@ -1765,6 +1765,7 @@ static struct gendisk *floppy_find(dev_t dev, int *part, void *data) ...@@ -1765,6 +1765,7 @@ static struct gendisk *floppy_find(dev_t dev, int *part, void *data)
int drive = *part & 3; int drive = *part & 3;
if (unit[drive].type->code == FD_NODRIVE) if (unit[drive].type->code == FD_NODRIVE)
return NULL; return NULL;
*part = 0;
return get_disk(unit[drive].gendisk); return get_disk(unit[drive].gendisk);
} }
......
...@@ -1919,6 +1919,7 @@ static struct gendisk *floppy_find(dev_t dev, int *part, void *data) ...@@ -1919,6 +1919,7 @@ static struct gendisk *floppy_find(dev_t dev, int *part, void *data)
int type = *part >> 2; int type = *part >> 2;
if (drive >= FD_MAX_UNITS || type > NUM_DISK_MINORS) if (drive >= FD_MAX_UNITS || type > NUM_DISK_MINORS)
return NULL; return NULL;
*part = 0;
return get_disk(unit[drive].disk); return get_disk(unit[drive].disk);
} }
......
...@@ -4210,6 +4210,7 @@ static struct gendisk *floppy_find(dev_t dev, int *part, void *data) ...@@ -4210,6 +4210,7 @@ static struct gendisk *floppy_find(dev_t dev, int *part, void *data)
!(allowed_drive_mask & (1 << drive)) || !(allowed_drive_mask & (1 << drive)) ||
fdc_state[FDC(drive)].version == FDC_NONE) fdc_state[FDC(drive)].version == FDC_NONE)
return NULL; return NULL;
*part = 0;
return get_disk(disks[drive]); return get_disk(disks[drive]);
} }
......
...@@ -92,9 +92,7 @@ EXPORT_SYMBOL(blk_unregister_region); ...@@ -92,9 +92,7 @@ EXPORT_SYMBOL(blk_unregister_region);
static struct gendisk *exact_match(dev_t dev, int *part, void *data) static struct gendisk *exact_match(dev_t dev, int *part, void *data)
{ {
struct gendisk *p = data; return data;
*part = MINOR(dev) - p->first_minor;
return p;
} }
static int exact_lock(dev_t dev, void *data) static int exact_lock(dev_t dev, void *data)
...@@ -363,7 +361,7 @@ void set_disk_ro(struct gendisk *disk, int flag) ...@@ -363,7 +361,7 @@ void set_disk_ro(struct gendisk *disk, int flag)
{ {
int i; int i;
disk->policy = flag; disk->policy = flag;
for (i = 0; i < disk->minors; i++) for (i = 0; i < disk->minors - 1; i++)
disk->part[i].policy = flag; disk->part[i].policy = flag;
} }
......
...@@ -338,15 +338,10 @@ lo_receive(struct loop_device *lo, struct bio *bio, int bsize, loff_t pos) ...@@ -338,15 +338,10 @@ lo_receive(struct loop_device *lo, struct bio *bio, int bsize, loff_t pos)
return ret; return ret;
} }
static inline int loop_get_bs(struct loop_device *lo)
{
return block_size(lo->lo_device);
}
static inline unsigned long loop_get_iv(struct loop_device *lo, static inline unsigned long loop_get_iv(struct loop_device *lo,
unsigned long sector) unsigned long sector)
{ {
int bs = loop_get_bs(lo); int bs = lo->lo_blocksize;
unsigned long offset, IV; unsigned long offset, IV;
IV = sector / (bs >> 9) + lo->lo_offset / bs; IV = sector / (bs >> 9) + lo->lo_offset / bs;
...@@ -366,9 +361,9 @@ static int do_bio_filebacked(struct loop_device *lo, struct bio *bio) ...@@ -366,9 +361,9 @@ static int do_bio_filebacked(struct loop_device *lo, struct bio *bio)
do { do {
if (bio_rw(bio) == WRITE) if (bio_rw(bio) == WRITE)
ret = lo_send(lo, bio, loop_get_bs(lo), pos); ret = lo_send(lo, bio, lo->lo_blocksize, pos);
else else
ret = lo_receive(lo, bio, loop_get_bs(lo), pos); ret = lo_receive(lo, bio, lo->lo_blocksize, pos);
} while (++bio->bi_idx < bio->bi_vcnt); } while (++bio->bi_idx < bio->bi_vcnt);
...@@ -442,7 +437,7 @@ static int loop_end_io_transfer(struct bio *bio, unsigned int bytes_done, int er ...@@ -442,7 +437,7 @@ static int loop_end_io_transfer(struct bio *bio, unsigned int bytes_done, int er
if (bio->bi_size) if (bio->bi_size)
return 1; return 1;
if (!err || bio_rw(bio) == WRITE) { if (err || bio_rw(bio) == WRITE) {
bio_endio(rbh, rbh->bi_size, err); bio_endio(rbh, rbh->bi_size, err);
if (atomic_dec_and_test(&lo->lo_pending)) if (atomic_dec_and_test(&lo->lo_pending))
up(&lo->lo_bh_mutex); up(&lo->lo_bh_mutex);
...@@ -650,7 +645,8 @@ static int loop_set_fd(struct loop_device *lo, struct file *lo_file, ...@@ -650,7 +645,8 @@ static int loop_set_fd(struct loop_device *lo, struct file *lo_file,
{ {
struct file *file; struct file *file;
struct inode *inode; struct inode *inode;
struct block_device *lo_device; struct block_device *lo_device = NULL;
unsigned lo_blocksize;
int lo_flags = 0; int lo_flags = 0;
int error; int error;
...@@ -677,6 +673,9 @@ static int loop_set_fd(struct loop_device *lo, struct file *lo_file, ...@@ -677,6 +673,9 @@ static int loop_set_fd(struct loop_device *lo, struct file *lo_file,
error = -EBUSY; error = -EBUSY;
goto out; goto out;
} }
lo_blocksize = block_size(lo_device);
if (bdev_read_only(lo_device))
lo_flags |= LO_FLAGS_READ_ONLY;
} else if (S_ISREG(inode->i_mode)) { } else if (S_ISREG(inode->i_mode)) {
struct address_space_operations *aops = inode->i_mapping->a_ops; struct address_space_operations *aops = inode->i_mapping->a_ops;
/* /*
...@@ -689,7 +688,7 @@ static int loop_set_fd(struct loop_device *lo, struct file *lo_file, ...@@ -689,7 +688,7 @@ static int loop_set_fd(struct loop_device *lo, struct file *lo_file,
if (!aops->prepare_write || !aops->commit_write) if (!aops->prepare_write || !aops->commit_write)
lo_flags |= LO_FLAGS_READ_ONLY; lo_flags |= LO_FLAGS_READ_ONLY;
lo_device = inode->i_sb->s_bdev; lo_blocksize = inode->i_blksize;
lo_flags |= LO_FLAGS_DO_BMAP; lo_flags |= LO_FLAGS_DO_BMAP;
error = 0; error = 0;
} else } else
...@@ -697,12 +696,12 @@ static int loop_set_fd(struct loop_device *lo, struct file *lo_file, ...@@ -697,12 +696,12 @@ static int loop_set_fd(struct loop_device *lo, struct file *lo_file,
get_file(file); get_file(file);
if (IS_RDONLY (inode) || bdev_read_only(lo_device) if (!(lo_file->f_mode & FMODE_WRITE))
|| !(lo_file->f_mode & FMODE_WRITE))
lo_flags |= LO_FLAGS_READ_ONLY; lo_flags |= LO_FLAGS_READ_ONLY;
set_device_ro(bdev, (lo_flags & LO_FLAGS_READ_ONLY) != 0); set_device_ro(bdev, (lo_flags & LO_FLAGS_READ_ONLY) != 0);
lo->lo_blocksize = lo_blocksize;
lo->lo_device = lo_device; lo->lo_device = lo_device;
lo->lo_flags = lo_flags; lo->lo_flags = lo_flags;
lo->lo_backing_file = file; lo->lo_backing_file = file;
...@@ -716,7 +715,7 @@ static int loop_set_fd(struct loop_device *lo, struct file *lo_file, ...@@ -716,7 +715,7 @@ static int loop_set_fd(struct loop_device *lo, struct file *lo_file,
lo->old_gfp_mask = inode->i_mapping->gfp_mask; lo->old_gfp_mask = inode->i_mapping->gfp_mask;
inode->i_mapping->gfp_mask = GFP_NOIO; inode->i_mapping->gfp_mask = GFP_NOIO;
set_blocksize(bdev, block_size(lo_device)); set_blocksize(bdev, lo_blocksize);
lo->lo_bio = lo->lo_biotail = NULL; lo->lo_bio = lo->lo_biotail = NULL;
...@@ -899,7 +898,7 @@ static int loop_get_status(struct loop_device *lo, struct loop_info *arg) ...@@ -899,7 +898,7 @@ static int loop_get_status(struct loop_device *lo, struct loop_info *arg)
info.lo_number = lo->lo_number; info.lo_number = lo->lo_number;
info.lo_device = stat.dev; info.lo_device = stat.dev;
info.lo_inode = stat.ino; info.lo_inode = stat.ino;
info.lo_rdevice = lo->lo_device->bd_dev; info.lo_rdevice = lo->lo_device ? stat.rdev : stat.dev;
info.lo_offset = lo->lo_offset; info.lo_offset = lo->lo_offset;
info.lo_flags = lo->lo_flags; info.lo_flags = lo->lo_flags;
strncpy(info.lo_name, lo->lo_name, LO_NAME_SIZE); strncpy(info.lo_name, lo->lo_name, LO_NAME_SIZE);
......
...@@ -432,7 +432,7 @@ static int __init rd_init (void) ...@@ -432,7 +432,7 @@ static int __init rd_init (void)
disk->first_minor = i; disk->first_minor = i;
disk->fops = &rd_bd_op; disk->fops = &rd_bd_op;
disk->queue = &rd_queue; disk->queue = &rd_queue;
sprintf(disk->disk_name, "rd%d", i); sprintf(disk->disk_name, "ram%d", i);
set_capacity(disk, rd_size * 2); set_capacity(disk, rd_size * 2);
} }
devfs_handle = devfs_mk_dir (NULL, "rd", NULL); devfs_handle = devfs_mk_dir (NULL, "rd", NULL);
......
...@@ -67,8 +67,8 @@ ...@@ -67,8 +67,8 @@
#endif #endif
#ifndef CONFIG_BT_USB_ZERO_PACKET #ifndef CONFIG_BT_USB_ZERO_PACKET
#undef USB_ZERO_PACKET #undef URB_ZERO_PACKET
#define USB_ZERO_PACKET 0 #define URB_ZERO_PACKET 0
#endif #endif
static struct usb_driver hci_usb_driver; static struct usb_driver hci_usb_driver;
...@@ -131,7 +131,7 @@ static int hci_usb_enable_intr(struct hci_usb *husb) ...@@ -131,7 +131,7 @@ static int hci_usb_enable_intr(struct hci_usb *husb)
pipe = usb_rcvintpipe(husb->udev, husb->intr_ep); pipe = usb_rcvintpipe(husb->udev, husb->intr_ep);
size = usb_maxpacket(husb->udev, pipe, usb_pipeout(pipe)); size = usb_maxpacket(husb->udev, pipe, usb_pipeout(pipe));
FILL_INT_URB(urb, husb->udev, pipe, buf, size, usb_fill_int_urb(urb, husb->udev, pipe, buf, size,
hci_usb_interrupt, husb, husb->intr_interval); hci_usb_interrupt, husb, husb->intr_interval);
return usb_submit_urb(urb, GFP_KERNEL); return usb_submit_urb(urb, GFP_KERNEL);
...@@ -182,7 +182,7 @@ static int hci_usb_rx_submit(struct hci_usb *husb, struct urb *urb) ...@@ -182,7 +182,7 @@ static int hci_usb_rx_submit(struct hci_usb *husb, struct urb *urb)
pipe = usb_rcvbulkpipe(husb->udev, husb->bulk_in_ep); pipe = usb_rcvbulkpipe(husb->udev, husb->bulk_in_ep);
FILL_BULK_URB(urb, husb->udev, pipe, skb->data, size, hci_usb_rx_complete, skb); usb_fill_bulk_urb(urb, husb->udev, pipe, skb->data, size, hci_usb_rx_complete, skb);
skb_queue_tail(&husb->pending_q, skb); skb_queue_tail(&husb->pending_q, skb);
err = usb_submit_urb(urb, GFP_ATOMIC); err = usb_submit_urb(urb, GFP_ATOMIC);
...@@ -299,7 +299,7 @@ static inline int hci_usb_send_ctrl(struct hci_usb *husb, struct sk_buff *skb) ...@@ -299,7 +299,7 @@ static inline int hci_usb_send_ctrl(struct hci_usb *husb, struct sk_buff *skb)
cr->wValue = 0; cr->wValue = 0;
cr->wLength = __cpu_to_le16(skb->len); cr->wLength = __cpu_to_le16(skb->len);
FILL_CONTROL_URB(urb, husb->udev, pipe, (void *) cr, usb_fill_control_urb(urb, husb->udev, pipe, (void *) cr,
skb->data, skb->len, hci_usb_tx_complete, skb); skb->data, skb->len, hci_usb_tx_complete, skb);
BT_DBG("%s urb %p len %d", husb->hdev.name, urb, skb->len); BT_DBG("%s urb %p len %d", husb->hdev.name, urb, skb->len);
...@@ -328,9 +328,9 @@ static inline int hci_usb_send_bulk(struct hci_usb *husb, struct sk_buff *skb) ...@@ -328,9 +328,9 @@ static inline int hci_usb_send_bulk(struct hci_usb *husb, struct sk_buff *skb)
pipe = usb_sndbulkpipe(husb->udev, husb->bulk_out_ep); pipe = usb_sndbulkpipe(husb->udev, husb->bulk_out_ep);
FILL_BULK_URB(urb, husb->udev, pipe, skb->data, skb->len, usb_fill_bulk_urb(urb, husb->udev, pipe, skb->data, skb->len,
hci_usb_tx_complete, skb); hci_usb_tx_complete, skb);
urb->transfer_flags = USB_ZERO_PACKET; urb->transfer_flags = URB_ZERO_PACKET;
BT_DBG("%s urb %p len %d", husb->hdev.name, urb, skb->len); BT_DBG("%s urb %p len %d", husb->hdev.name, urb, skb->len);
...@@ -629,13 +629,13 @@ static void hci_usb_destruct(struct hci_dev *hdev) ...@@ -629,13 +629,13 @@ static void hci_usb_destruct(struct hci_dev *hdev)
int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
{ {
struct usb_device *udev = interface_to_usbdev(intf); struct usb_device *udev = interface_to_usbdev(intf);
struct usb_endpoint_descriptor *bulk_out_ep[HCI_MAX_IFACE_NUM]; struct usb_host_endpoint *bulk_out_ep[HCI_MAX_IFACE_NUM];
struct usb_endpoint_descriptor *isoc_out_ep[HCI_MAX_IFACE_NUM]; struct usb_host_endpoint *isoc_out_ep[HCI_MAX_IFACE_NUM];
struct usb_endpoint_descriptor *bulk_in_ep[HCI_MAX_IFACE_NUM]; struct usb_host_endpoint *bulk_in_ep[HCI_MAX_IFACE_NUM];
struct usb_endpoint_descriptor *isoc_in_ep[HCI_MAX_IFACE_NUM]; struct usb_host_endpoint *isoc_in_ep[HCI_MAX_IFACE_NUM];
struct usb_endpoint_descriptor *intr_in_ep[HCI_MAX_IFACE_NUM]; struct usb_host_endpoint *intr_in_ep[HCI_MAX_IFACE_NUM];
struct usb_interface_descriptor *uif; struct usb_host_interface *uif;
struct usb_endpoint_descriptor *ep; struct usb_host_endpoint *ep;
struct usb_interface *iface, *isoc_iface; struct usb_interface *iface, *isoc_iface;
struct hci_usb *husb; struct hci_usb *husb;
struct hci_dev *hdev; struct hci_dev *hdev;
...@@ -648,7 +648,7 @@ int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) ...@@ -648,7 +648,7 @@ int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
return -EIO; return -EIO;
/* Check number of endpoints */ /* Check number of endpoints */
if (intf->altsetting[0].bNumEndpoints < 3) if (intf->altsetting[0].desc.bNumEndpoints < 3)
return -EIO; return -EIO;
memset(bulk_out_ep, 0, sizeof(bulk_out_ep)); memset(bulk_out_ep, 0, sizeof(bulk_out_ep));
...@@ -663,37 +663,37 @@ int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) ...@@ -663,37 +663,37 @@ int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
/* Find endpoints that we need */ /* Find endpoints that we need */
ifn = min_t(unsigned int, udev->actconfig->bNumInterfaces, HCI_MAX_IFACE_NUM); ifn = min_t(unsigned int, udev->actconfig->desc.bNumInterfaces, HCI_MAX_IFACE_NUM);
for (i = 0; i < ifn; i++) { for (i = 0; i < ifn; i++) {
iface = &udev->actconfig->interface[i]; iface = &udev->actconfig->interface[i];
for (a = 0; a < iface->num_altsetting; a++) { for (a = 0; a < iface->num_altsetting; a++) {
uif = &iface->altsetting[a]; uif = &iface->altsetting[a];
for (e = 0; e < uif->bNumEndpoints; e++) { for (e = 0; e < uif->desc.bNumEndpoints; e++) {
ep = &uif->endpoint[e]; ep = &uif->endpoint[e];
switch (ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) { switch (ep->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) {
case USB_ENDPOINT_XFER_INT: case USB_ENDPOINT_XFER_INT:
if (ep->bEndpointAddress & USB_DIR_IN) if (ep->desc.bEndpointAddress & USB_DIR_IN)
intr_in_ep[i] = ep; intr_in_ep[i] = ep;
break; break;
case USB_ENDPOINT_XFER_BULK: case USB_ENDPOINT_XFER_BULK:
if (ep->bEndpointAddress & USB_DIR_IN) if (ep->desc.bEndpointAddress & USB_DIR_IN)
bulk_in_ep[i] = ep; bulk_in_ep[i] = ep;
else else
bulk_out_ep[i] = ep; bulk_out_ep[i] = ep;
break; break;
case USB_ENDPOINT_XFER_ISOC: case USB_ENDPOINT_XFER_ISOC:
if (ep->wMaxPacketSize < size) if (ep->desc.wMaxPacketSize < size)
break; break;
size = ep->wMaxPacketSize; size = ep->desc.wMaxPacketSize;
isoc_iface = iface; isoc_iface = iface;
isoc_alts = a; isoc_alts = a;
isoc_ifnum = i; isoc_ifnum = i;
if (ep->bEndpointAddress & USB_DIR_IN) if (ep->desc.bEndpointAddress & USB_DIR_IN)
isoc_in_ep[i] = ep; isoc_in_ep[i] = ep;
else else
isoc_out_ep[i] = ep; isoc_out_ep[i] = ep;
...@@ -721,11 +721,11 @@ int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) ...@@ -721,11 +721,11 @@ int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
memset(husb, 0, sizeof(struct hci_usb)); memset(husb, 0, sizeof(struct hci_usb));
husb->udev = udev; husb->udev = udev;
husb->bulk_out_ep = bulk_out_ep[0]->bEndpointAddress; husb->bulk_out_ep = bulk_out_ep[0]->desc.bEndpointAddress;
husb->bulk_in_ep = bulk_in_ep[0]->bEndpointAddress; husb->bulk_in_ep = bulk_in_ep[0]->desc.bEndpointAddress;
husb->intr_ep = intr_in_ep[0]->bEndpointAddress; husb->intr_ep = intr_in_ep[0]->desc.bEndpointAddress;
husb->intr_interval = intr_in_ep[0]->bInterval; husb->intr_interval = intr_in_ep[0]->desc.bInterval;
if (isoc_iface) { if (isoc_iface) {
if (usb_set_interface(udev, isoc_ifnum, isoc_alts)) { if (usb_set_interface(udev, isoc_ifnum, isoc_alts)) {
...@@ -735,8 +735,8 @@ int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) ...@@ -735,8 +735,8 @@ int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
usb_driver_claim_interface(&hci_usb_driver, isoc_iface, husb); usb_driver_claim_interface(&hci_usb_driver, isoc_iface, husb);
husb->isoc_iface = isoc_iface; husb->isoc_iface = isoc_iface;
husb->isoc_in_ep = isoc_in_ep[1]->bEndpointAddress; husb->isoc_in_ep = isoc_in_ep[1]->desc.bEndpointAddress;
husb->isoc_out_ep = isoc_in_ep[1]->bEndpointAddress; husb->isoc_out_ep = isoc_in_ep[1]->desc.bEndpointAddress;
} }
husb->completion_lock = RW_LOCK_UNLOCKED; husb->completion_lock = RW_LOCK_UNLOCKED;
......
...@@ -1497,7 +1497,7 @@ int __init cm206_init(void) ...@@ -1497,7 +1497,7 @@ int __init cm206_init(void)
goto out_disk; goto out_disk;
disk->major = MAJOR_NR; disk->major = MAJOR_NR;
disk->first_minor = 0; disk->first_minor = 0;
sprintf(disk->disk_name, "cm206"); sprintf(disk->disk_name, "cm206cd");
disk->fops = &cm206_bdops; disk->fops = &cm206_bdops;
disk->flags = GENHD_FL_CD; disk->flags = GENHD_FL_CD;
cm206_gendisk = disk; cm206_gendisk = disk;
......
...@@ -40,3 +40,14 @@ CONFIG_HOTPLUG_PCI_IBM ...@@ -40,3 +40,14 @@ CONFIG_HOTPLUG_PCI_IBM
When in doubt, say N. When in doubt, say N.
CONFIG_HOTPLUG_PCI_ACPI
Say Y here if you have a system that supports PCI Hotplug using
ACPI.
This code is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
The module will be called acpiphp.o. If you want to compile it
as a module, say M here and read <file:Documentation/modules.txt>.
When in doubt, say N.
...@@ -11,5 +11,6 @@ dep_mbool ' Save configuration into NVRAM on Compaq servers' CONFIG_HOTPLUG_P ...@@ -11,5 +11,6 @@ dep_mbool ' Save configuration into NVRAM on Compaq servers' CONFIG_HOTPLUG_P
if [ "$CONFIG_X86_IO_APIC" = "y" ]; then if [ "$CONFIG_X86_IO_APIC" = "y" ]; then
dep_tristate ' IBM PCI Hotplug driver' CONFIG_HOTPLUG_PCI_IBM $CONFIG_HOTPLUG_PCI $CONFIG_X86_IO_APIC $CONFIG_X86 dep_tristate ' IBM PCI Hotplug driver' CONFIG_HOTPLUG_PCI_IBM $CONFIG_HOTPLUG_PCI $CONFIG_X86_IO_APIC $CONFIG_X86
fi fi
dep_tristate ' ACPI PCI Hotplug driver' CONFIG_HOTPLUG_PCI_ACPI $CONFIG_APCI $CONFIG_HOTPLUG_PCI
endmenu endmenu
...@@ -7,6 +7,7 @@ export-objs := pci_hotplug_core.o pci_hotplug_util.o ...@@ -7,6 +7,7 @@ export-objs := pci_hotplug_core.o pci_hotplug_util.o
obj-$(CONFIG_HOTPLUG_PCI) += pci_hotplug.o obj-$(CONFIG_HOTPLUG_PCI) += pci_hotplug.o
obj-$(CONFIG_HOTPLUG_PCI_COMPAQ) += cpqphp.o obj-$(CONFIG_HOTPLUG_PCI_COMPAQ) += cpqphp.o
obj-$(CONFIG_HOTPLUG_PCI_IBM) += ibmphp.o obj-$(CONFIG_HOTPLUG_PCI_IBM) += ibmphp.o
obj-$(CONFIG_HOTPLUG_PCI_ACPI) += acpiphp.o
pci_hotplug-objs := pci_hotplug_core.o \ pci_hotplug-objs := pci_hotplug_core.o \
pci_hotplug_util.o pci_hotplug_util.o
...@@ -22,6 +23,18 @@ ibmphp-objs := ibmphp_core.o \ ...@@ -22,6 +23,18 @@ ibmphp-objs := ibmphp_core.o \
ibmphp_res.o \ ibmphp_res.o \
ibmphp_hpc.o ibmphp_hpc.o
acpiphp-objs := acpiphp_core.o \
acpiphp_glue.o \
acpiphp_pci.o \
acpiphp_res.o
ifdef CONFIG_HOTPLUG_PCI_ACPI
EXTRA_CFLAGS += -D_LINUX -I$(TOPDIR)/drivers/acpi
ifdef CONFIG_ACPI_DEBUG
EXTRA_CFLAGS += -DACPI_DEBUG_OUTPUT
endif
endif
ifeq ($(CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM),y) ifeq ($(CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM),y)
cpqphp-objs += cpqphp_nvram.o cpqphp-objs += cpqphp_nvram.o
endif endif
......
/*
* ACPI PCI Hot Plug Controller Driver
*
* Copyright (c) 1995,2001 Compaq Computer Corporation
* Copyright (c) 2001 Greg Kroah-Hartman (greg@kroah.com)
* Copyright (c) 2001 IBM Corp.
* Copyright (c) 2002 Hiroshi Aono (h-aono@ap.jp.nec.com)
* Copyright (c) 2002 Takayoshi Kochi (t-kouchi@cq.jp.nec.com)
* Copyright (c) 2002 NEC Corporation
*
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
* NON INFRINGEMENT. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* Send feedback to <gregkh@us.ibm.com>,
* <h-aono@ap.jp.nec.com>,
* <t-kouchi@cq.jp.nec.com>
*
*/
#ifndef _ACPIPHP_H
#define _ACPIPHP_H
#include "include/acpi.h"
#include "pci_hotplug.h"
#include "acpi_bus.h"
#define dbg(format, arg...) \
do { \
if (acpiphp_debug) \
printk (KERN_DEBUG "%s: " format "\n", \
MY_NAME , ## arg); \
} while (0)
#define err(format, arg...) printk (KERN_ERR "%s: " format "\n", MY_NAME , ## arg)
#define info(format, arg...) printk (KERN_INFO "%s: " format "\n", MY_NAME , ## arg)
#define warn(format, arg...) printk (KERN_WARNING "%s: " format "\n", MY_NAME , ## arg)
#define SLOT_MAGIC 0x67267322
/* name size which is used for entries in pcihpfs */
#define SLOT_NAME_SIZE 32 /* ACPI{_SUN}-{BUS}:{DEV} */
struct acpiphp_bridge;
struct acpiphp_slot;
struct pci_resource;
/*
* struct slot - slot information for each *physical* slot
*/
struct slot {
u32 magic;
u8 number;
struct hotplug_slot *hotplug_slot;
struct list_head slot_list;
struct acpiphp_slot *acpi_slot;
};
/*
* struct pci_resource - describes pci resource (mem, pfmem, io, bus)
*/
struct pci_resource {
struct pci_resource * next;
u64 base;
u32 length;
};
/**
* struct hpp_param - ACPI 2.0 _HPP Hot Plug Parameters
* @cache_line_size in DWORD
* @latency_timer in PCI clock
* @enable_SERR 0 or 1
* @enable_PERR 0 or 1
*/
struct hpp_param {
u8 cache_line_size;
u8 latency_timer;
u8 enable_SERR;
u8 enable_PERR;
};
/**
* struct acpiphp_bridge - PCI bridge information
*
* for each bridge device in ACPI namespace
*/
struct acpiphp_bridge {
struct list_head list;
acpi_handle handle;
struct acpiphp_slot *slots;
int type;
int nr_slots;
u8 seg;
u8 bus;
u8 sub;
u32 flags;
/* This bus (host bridge) or Secondary bus (PCI-to-PCI bridge) */
struct pci_bus *pci_bus;
/* PCI-to-PCI bridge device */
struct pci_dev *pci_dev;
/* ACPI 2.0 _HPP parameters */
struct hpp_param hpp;
spinlock_t res_lock;
/* available resources on this bus */
struct pci_resource *mem_head;
struct pci_resource *p_mem_head;
struct pci_resource *io_head;
struct pci_resource *bus_head;
};
/**
* struct acpiphp_slot - PCI slot information
*
* PCI slot information for each *physical* PCI slot
*/
struct acpiphp_slot {
struct acpiphp_slot *next;
struct acpiphp_bridge *bridge; /* parent */
struct list_head funcs; /* one slot may have different
objects (i.e. for each function) */
struct semaphore crit_sect;
u32 id; /* slot id (serial #) for hotplug core */
u8 device; /* pci device# */
u32 sun; /* ACPI _SUN (slot unique number) */
u32 slotno; /* slot number relative to bridge */
u32 flags; /* see below */
};
/**
* struct acpiphp_func - PCI function information
*
* PCI function information for each object in ACPI namespace
* typically 8 objects per slot (i.e. for each PCI function)
*/
struct acpiphp_func {
struct acpiphp_slot *slot; /* parent */
struct list_head sibling;
struct pci_dev *pci_dev;
acpi_handle handle;
u8 function; /* pci function# */
u32 flags; /* see below */
/* resources used for this function */
struct pci_resource *mem_head;
struct pci_resource *p_mem_head;
struct pci_resource *io_head;
struct pci_resource *bus_head;
};
/* PCI bus bridge HID */
#define ACPI_PCI_HOST_HID "PNP0A03"
/* PCI BRIDGE type */
#define BRIDGE_TYPE_HOST 0
#define BRIDGE_TYPE_P2P 1
/* ACPI _STA method value (ignore bit 4; battery present) */
#define ACPI_STA_PRESENT (0x00000001)
#define ACPI_STA_ENABLED (0x00000002)
#define ACPI_STA_SHOW_IN_UI (0x00000004)
#define ACPI_STA_FUNCTIONING (0x00000008)
#define ACPI_STA_ALL (0x0000000f)
/* bridge flags */
#define BRIDGE_HAS_STA (0x00000001)
#define BRIDGE_HAS_EJ0 (0x00000002)
#define BRIDGE_HAS_HPP (0x00000004)
#define BRIDGE_HAS_PS0 (0x00000010)
#define BRIDGE_HAS_PS1 (0x00000020)
#define BRIDGE_HAS_PS2 (0x00000040)
#define BRIDGE_HAS_PS3 (0x00000080)
/* slot flags */
#define SLOT_POWEREDON (0x00000001)
#define SLOT_ENABLED (0x00000002)
#define SLOT_MULTIFUNCTION (x000000004)
/* function flags */
#define FUNC_HAS_STA (0x00000001)
#define FUNC_HAS_EJ0 (0x00000002)
#define FUNC_HAS_PS0 (0x00000010)
#define FUNC_HAS_PS1 (0x00000020)
#define FUNC_HAS_PS2 (0x00000040)
#define FUNC_HAS_PS3 (0x00000080)
/* not yet */
#define SLOT_SUPPORT_66MHZ (0x00010000)
#define SLOT_SUPPORT_100MHZ (0x00020000)
#define SLOT_SUPPORT_133MHZ (0x00040000)
#define SLOT_SUPPORT_PCIX (0x00080000)
/* function prototypes */
/* acpiphp_glue.c */
extern int acpiphp_glue_init (void);
extern void acpiphp_glue_exit (void);
extern int acpiphp_get_num_slots (void);
extern struct acpiphp_slot *get_slot_from_id (int id);
typedef int (*acpiphp_callback)(struct acpiphp_slot *slot, void *data);
extern int acpiphp_for_each_slot (acpiphp_callback fn, void *data);
extern int acpiphp_check_bridge (struct acpiphp_bridge *bridge);
extern int acpiphp_enable_slot (struct acpiphp_slot *slot);
extern int acpiphp_disable_slot (struct acpiphp_slot *slot);
extern u8 acpiphp_get_power_status (struct acpiphp_slot *slot);
extern u8 acpiphp_get_attention_status (struct acpiphp_slot *slot);
extern u8 acpiphp_get_latch_status (struct acpiphp_slot *slot);
extern u8 acpiphp_get_adapter_status (struct acpiphp_slot *slot);
/* acpiphp_pci.c */
extern struct pci_dev *acpiphp_allocate_pcidev (struct pci_bus *pbus, int dev, int fn);
extern int acpiphp_configure_slot (struct acpiphp_slot *slot);
extern int acpiphp_configure_function (struct acpiphp_func *func);
extern int acpiphp_unconfigure_function (struct acpiphp_func *func);
extern int acpiphp_detect_pci_resource (struct acpiphp_bridge *bridge);
extern int acpiphp_init_func_resource (struct acpiphp_func *func);
/* acpiphp_res.c */
extern struct pci_resource *acpiphp_get_io_resource (struct pci_resource **head, u32 size);
extern struct pci_resource *acpiphp_get_max_resource (struct pci_resource **head, u32 size);
extern struct pci_resource *acpiphp_get_resource (struct pci_resource **head, u32 size);
extern struct pci_resource *acpiphp_get_resource_with_base (struct pci_resource **head, u64 base, u32 size);
extern int acpiphp_resource_sort_and_combine (struct pci_resource **head);
extern struct pci_resource *acpiphp_make_resource (u64 base, u32 length);
extern void acpiphp_move_resource (struct pci_resource **from, struct pci_resource **to);
extern void acpiphp_free_resource (struct pci_resource **res);
extern void acpiphp_dump_resource (struct acpiphp_bridge *bridge); /* debug */
extern void acpiphp_dump_func_resource (struct acpiphp_func *func); /* debug */
/* variables */
extern int acpiphp_debug;
#endif /* _ACPIPHP_H */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -1110,6 +1110,9 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -1110,6 +1110,9 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
/* /*
* Get IO, memory, and IRQ resources for new devices * Get IO, memory, and IRQ resources for new devices
*/ */
// The next line is required for cpqhp_find_available_resources
ctrl->interrupt = pdev->irq;
rc = cpqhp_find_available_resources(ctrl, cpqhp_rom_start); rc = cpqhp_find_available_resources(ctrl, cpqhp_rom_start);
ctrl->add_support = !rc; ctrl->add_support = !rc;
if (rc) { if (rc) {
...@@ -1138,7 +1141,6 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -1138,7 +1141,6 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
writel(0xFFFFFFFFL, ctrl->hpc_reg + INT_MASK); writel(0xFFFFFFFFL, ctrl->hpc_reg + INT_MASK);
/* set up the interrupt */ /* set up the interrupt */
ctrl->interrupt = pdev->irq;
dbg("HPC interrupt = %d \n", ctrl->interrupt); dbg("HPC interrupt = %d \n", ctrl->interrupt);
if (request_irq(ctrl->interrupt, if (request_irq(ctrl->interrupt,
(void (*)(int, void *, struct pt_regs *)) &cpqhp_ctrl_intr, (void (*)(int, void *, struct pt_regs *)) &cpqhp_ctrl_intr,
......
...@@ -360,8 +360,8 @@ int cpqhp_set_irq (u8 bus_num, u8 dev_num, u8 int_pin, u8 irq_num) ...@@ -360,8 +360,8 @@ int cpqhp_set_irq (u8 bus_num, u8 dev_num, u8 int_pin, u8 irq_num)
__FUNCTION__, dev_num, bus_num, int_pin, irq_num); __FUNCTION__, dev_num, bus_num, int_pin, irq_num);
rc = pcibios_set_irq_routing(&fakedev, int_pin - 0x0a, irq_num); rc = pcibios_set_irq_routing(&fakedev, int_pin - 0x0a, irq_num);
dbg("%s: rc %d\n", __FUNCTION__, rc); dbg("%s: rc %d\n", __FUNCTION__, rc);
if (rc) if (!rc)
return rc; return !rc;
// set the Edge Level Control Register (ELCR) // set the Edge Level Control Register (ELCR)
temp_word = inb(0x4d0); temp_word = inb(0x4d0);
......
...@@ -686,9 +686,10 @@ static int validate (struct slot *slot_cur, int opn) ...@@ -686,9 +686,10 @@ static int validate (struct slot *slot_cur, int opn)
int ibmphp_update_slot_info (struct slot *slot_cur) int ibmphp_update_slot_info (struct slot *slot_cur)
{ {
struct hotplug_slot_info *info; struct hotplug_slot_info *info;
char buffer[10]; char buffer[30];
int rc; int rc;
// u8 bus_speed; u8 bus_speed;
u8 mode;
info = kmalloc (sizeof (struct hotplug_slot_info), GFP_KERNEL); info = kmalloc (sizeof (struct hotplug_slot_info), GFP_KERNEL);
if (!info) { if (!info) {
...@@ -696,7 +697,7 @@ int ibmphp_update_slot_info (struct slot *slot_cur) ...@@ -696,7 +697,7 @@ int ibmphp_update_slot_info (struct slot *slot_cur)
return -ENOMEM; return -ENOMEM;
} }
snprintf (buffer, 10, "%d", slot_cur->number); strncpy (buffer, slot_cur->hotplug_slot->name, 30);
info->power_status = SLOT_PWRGD (slot_cur->status); info->power_status = SLOT_PWRGD (slot_cur->status);
info->attention_status = SLOT_ATTN (slot_cur->status, slot_cur->ext_status); info->attention_status = SLOT_ATTN (slot_cur->status, slot_cur->ext_status);
info->latch_status = SLOT_LATCH (slot_cur->status); info->latch_status = SLOT_LATCH (slot_cur->status);
...@@ -707,21 +708,33 @@ int ibmphp_update_slot_info (struct slot *slot_cur) ...@@ -707,21 +708,33 @@ int ibmphp_update_slot_info (struct slot *slot_cur)
info->adapter_status = 1; info->adapter_status = 1;
// get_max_adapter_speed_1 (slot_cur->hotplug_slot, &info->max_adapter_speed_status, 0); // get_max_adapter_speed_1 (slot_cur->hotplug_slot, &info->max_adapter_speed_status, 0);
} }
/* !!!!!!!!!TO DO: THIS NEEDS TO CHANGE!!!!!!!!!!!!! */
/* bus_speed = slot_cur->bus_on->current_speed;
bus_speed &= 0x0f;
if (slot_cur->bus_on->current_bus_mode == BUS_MODE_PCIX) bus_speed = slot_cur->bus_on->current_speed;
bus_speed |= 0x80; mode = slot_cur->bus_on->current_bus_mode;
else if (slot_cur->bus_on->current_bus_mode == BUS_MODE_PCI)
bus_speed |= 0x40; switch (bus_speed) {
case BUS_SPEED_33:
break;
case BUS_SPEED_66:
if (mode == BUS_MODE_PCIX)
bus_speed += 0x01;
else if (mode == BUS_MODE_PCI)
;
else else
bus_speed |= 0x20; bus_speed = PCI_SPEED_UNKNOWN;
break;
case BUS_SPEED_100:
case BUS_SPEED_133:
bus_speed += 0x01;
break;
default:
bus_speed = PCI_SPEED_UNKNOWN;
}
info->cur_bus_speed_status = bus_speed; info->cur_bus_speed = bus_speed;
info->max_bus_speed_status = slot_cur->hotplug_slot->info->max_bus_speed_status; info->max_bus_speed = slot_cur->hotplug_slot->info->max_bus_speed;
// To do: bus_names // To do: bus_names
*/
rc = pci_hp_change_slot_info (buffer, info); rc = pci_hp_change_slot_info (buffer, info);
kfree (info); kfree (info);
return rc; return rc;
...@@ -989,7 +1002,7 @@ static u8 bus_structure_fixup (u8 busno) ...@@ -989,7 +1002,7 @@ static u8 bus_structure_fixup (u8 busno)
struct pci_dev *dev; struct pci_dev *dev;
u16 l; u16 l;
if (!find_bus (busno) || !(ibmphp_find_same_bus_num (busno))) if (find_bus (busno) || !(ibmphp_find_same_bus_num (busno)))
return 1; return 1;
bus = kmalloc (sizeof (*bus), GFP_KERNEL); bus = kmalloc (sizeof (*bus), GFP_KERNEL);
......
...@@ -982,7 +982,7 @@ static int ata_lock(dev_t dev, void *data) ...@@ -982,7 +982,7 @@ static int ata_lock(dev_t dev, void *data)
struct gendisk *ata_probe(dev_t dev, int *part, void *data) struct gendisk *ata_probe(dev_t dev, int *part, void *data)
{ {
ide_hwif_t *hwif = data; ide_hwif_t *hwif = data;
int unit = MINOR(dev) >> PARTN_BITS; int unit = *part >> PARTN_BITS;
ide_drive_t *drive = &hwif->drives[unit]; ide_drive_t *drive = &hwif->drives[unit];
if (!drive->present) if (!drive->present)
return NULL; return NULL;
...@@ -1000,6 +1000,7 @@ struct gendisk *ata_probe(dev_t dev, int *part, void *data) ...@@ -1000,6 +1000,7 @@ struct gendisk *ata_probe(dev_t dev, int *part, void *data)
} }
if (!drive->driver) if (!drive->driver)
return NULL; return NULL;
*part &= (1 << PARTN_BITS) - 1;
return get_disk(drive->disk); return get_disk(drive->disk);
} }
......
...@@ -106,8 +106,9 @@ static const char *amd7930_revision = "$Revision: 1.5.6.4 $"; ...@@ -106,8 +106,9 @@ static const char *amd7930_revision = "$Revision: 1.5.6.4 $";
static void Bchan_fill_fifo(struct BCState *, struct sk_buff *); static void Bchan_fill_fifo(struct BCState *, struct sk_buff *);
static void static void
Bchan_xmt_bh(struct BCState *bcs) Bchan_xmt_bh(void *data)
{ {
struct BCState *bcs = data;
struct sk_buff *skb; struct sk_buff *skb;
if (bcs->hw.amd7930.tx_skb != NULL) { if (bcs->hw.amd7930.tx_skb != NULL) {
...@@ -120,14 +121,14 @@ Bchan_xmt_bh(struct BCState *bcs) ...@@ -120,14 +121,14 @@ Bchan_xmt_bh(struct BCState *bcs)
} else { } else {
clear_bit(BC_FLG_BUSY, &bcs->Flag); clear_bit(BC_FLG_BUSY, &bcs->Flag);
bcs->event |= 1 << B_XMTBUFREADY; bcs->event |= 1 << B_XMTBUFREADY;
schedule_work(&bcs->tqueue); schedule_work(&bcs->work);
} }
} }
static void static void
Bchan_xmit_callback(struct BCState *bcs) Bchan_xmit_callback(struct BCState *bcs)
{ {
schedule_work(&bcs->hw.amd7930.tq_xmt); schedule_work(&bcs->hw.amd7930.xmt_work);
} }
/* B channel transmission: two modes (three, if you count L1_MODE_NULL) /* B channel transmission: two modes (three, if you count L1_MODE_NULL)
...@@ -259,12 +260,13 @@ Bchan_recv_callback(struct BCState *bcs) ...@@ -259,12 +260,13 @@ Bchan_recv_callback(struct BCState *bcs)
(void *) &Bchan_recv_callback, (void *) bcs); (void *) &Bchan_recv_callback, (void *) bcs);
} }
schedule_work(&hw->tq_rcv); schedule_work(&hw->rcv_work);
} }
static void static void
Bchan_rcv_bh(struct BCState *bcs) Bchan_rcv_bh(void *data)
{ {
struct BCState *bcs = data;
struct IsdnCardState *cs = bcs->cs; struct IsdnCardState *cs = bcs->cs;
struct amd7930_hw *hw = &bcs->hw.amd7930; struct amd7930_hw *hw = &bcs->hw.amd7930;
struct sk_buff *skb; struct sk_buff *skb;
...@@ -305,7 +307,7 @@ Bchan_rcv_bh(struct BCState *bcs) ...@@ -305,7 +307,7 @@ Bchan_rcv_bh(struct BCState *bcs)
skb_queue_tail(&bcs->rqueue, hw->rv_skb); skb_queue_tail(&bcs->rqueue, hw->rv_skb);
hw->rv_skb = skb; hw->rv_skb = skb;
bcs->event |= 1 << B_RCVBUFREADY; bcs->event |= 1 << B_RCVBUFREADY;
schedule_work(&bcs->tqueue); schedule_work(&bcs->work);
} }
} else if (len > 0) { } else if (len > 0) {
/* Small packet received */ /* Small packet received */
...@@ -316,7 +318,7 @@ Bchan_rcv_bh(struct BCState *bcs) ...@@ -316,7 +318,7 @@ Bchan_rcv_bh(struct BCState *bcs)
memcpy(skb_put(skb, len), hw->rv_skb->tail, len); memcpy(skb_put(skb, len), hw->rv_skb->tail, len);
skb_queue_tail(&bcs->rqueue, skb); skb_queue_tail(&bcs->rqueue, skb);
bcs->event |= 1 << B_RCVBUFREADY; bcs->event |= 1 << B_RCVBUFREADY;
schedule_work(&bcs->tqueue); schedule_work(&bcs->work);
} }
} else { } else {
/* Reception Error */ /* Reception Error */
...@@ -332,7 +334,7 @@ Bchan_rcv_bh(struct BCState *bcs) ...@@ -332,7 +334,7 @@ Bchan_rcv_bh(struct BCState *bcs)
RCV_BUFSIZE/RCV_BUFBLKS); RCV_BUFSIZE/RCV_BUFBLKS);
skb_queue_tail(&bcs->rqueue, skb); skb_queue_tail(&bcs->rqueue, skb);
bcs->event |= 1 << B_RCVBUFREADY; bcs->event |= 1 << B_RCVBUFREADY;
schedule_work(&bcs->tqueue); schedule_work(&bcs->work);
} }
} }
...@@ -416,12 +418,8 @@ Bchan_init(struct BCState *bcs) ...@@ -416,12 +418,8 @@ Bchan_init(struct BCState *bcs)
return; return;
} }
bcs->hw.amd7930.tq_rcv.sync = 0; INIT_WORK(&bcs->hw.amd7930.rcv_work, &Bchan_rcv_bh, bcs);
INIT_WORK(&bcs->hw.amd7930.tq_rcv, (void (*)(void *)) &Bchan_rcv_bh, INIT_WORK(&bcs->hw.amd7930.xmt_work, &Bchan_xmt_bh, bcs);
(void *) bcs);
INIT_WORK(&bcs->hw.amd7930.tq_xmt, (void (*)(void *)) &Bchan_xmt_bh,
(void *) bcs);
} }
static void static void
......
...@@ -232,9 +232,9 @@ Amd7930_new_ph(struct IsdnCardState *cs) ...@@ -232,9 +232,9 @@ Amd7930_new_ph(struct IsdnCardState *cs)
static void static void
Amd7930_bh(struct IsdnCardState *cs) Amd7930_bh(void *data)
{ {
struct IsdnCardState *cs = data;
struct PStack *stptr; struct PStack *stptr;
if (!cs) if (!cs)
...@@ -277,7 +277,7 @@ Amd7930_sched_event(struct IsdnCardState *cs, int event) // ok ...@@ -277,7 +277,7 @@ Amd7930_sched_event(struct IsdnCardState *cs, int event) // ok
} }
test_and_set_bit(event, &cs->event); test_and_set_bit(event, &cs->event);
schedule_work(&cs->tqueue); schedule_work(&cs->work);
} }
static void static void
...@@ -790,7 +790,7 @@ Amd7930_init(struct IsdnCardState *cs) ...@@ -790,7 +790,7 @@ Amd7930_init(struct IsdnCardState *cs)
cs->dc.amd7930.old_state = 0; cs->dc.amd7930.old_state = 0;
cs->dc.amd7930.lmr1 = 0x40; cs->dc.amd7930.lmr1 = 0x40;
cs->dc.amd7930.ph_command = Amd7930_ph_command; cs->dc.amd7930.ph_command = Amd7930_ph_command;
INIT_WORK(&cs->tqueue, (void *) (void *) Amd7930_bh, NULL); INIT_WORK(&cs->work, Amd7930_bh, cs);
cs->setstack_d = setstack_Amd7930; cs->setstack_d = setstack_Amd7930;
cs->DC_Close = DC_Close_Amd7930; cs->DC_Close = DC_Close_Amd7930;
cs->dbusytimer.function = (void *) dbusy_timer_handler; cs->dbusytimer.function = (void *) dbusy_timer_handler;
......
...@@ -24,6 +24,7 @@ extern const char *CardType[]; ...@@ -24,6 +24,7 @@ extern const char *CardType[];
const char *Asuscom_revision = "$Revision: 1.11.6.3 $"; const char *Asuscom_revision = "$Revision: 1.11.6.3 $";
static spinlock_t asuscom_lock = SPIN_LOCK_UNLOCKED;
#define byteout(addr,val) outb(val,addr) #define byteout(addr,val) outb(val,addr)
#define bytein(addr) inb(addr) #define bytein(addr) inb(addr)
...@@ -46,13 +47,12 @@ static inline u_char ...@@ -46,13 +47,12 @@ static inline u_char
readreg(unsigned int ale, unsigned int adr, u_char off) readreg(unsigned int ale, unsigned int adr, u_char off)
{ {
register u_char ret; register u_char ret;
long flags; unsigned long flags;
save_flags(flags); spin_lock_irqsave(&asuscom_lock, flags);
cli();
byteout(ale, off); byteout(ale, off);
ret = bytein(adr); ret = bytein(adr);
restore_flags(flags); spin_unlock_irqrestore(&asuscom_lock, flags);
return (ret); return (ret);
} }
...@@ -69,13 +69,12 @@ readfifo(unsigned int ale, unsigned int adr, u_char off, u_char * data, int size ...@@ -69,13 +69,12 @@ readfifo(unsigned int ale, unsigned int adr, u_char off, u_char * data, int size
static inline void static inline void
writereg(unsigned int ale, unsigned int adr, u_char off, u_char data) writereg(unsigned int ale, unsigned int adr, u_char off, u_char data)
{ {
long flags; unsigned long flags;
save_flags(flags); spin_lock_irqsave(&asuscom_lock, flags);
cli();
byteout(ale, off); byteout(ale, off);
byteout(adr, data); byteout(adr, data);
restore_flags(flags); spin_unlock_irqrestore(&asuscom_lock, flags);
} }
static inline void static inline void
...@@ -263,14 +262,10 @@ release_io_asuscom(struct IsdnCardState *cs) ...@@ -263,14 +262,10 @@ release_io_asuscom(struct IsdnCardState *cs)
static void static void
reset_asuscom(struct IsdnCardState *cs) reset_asuscom(struct IsdnCardState *cs)
{ {
long flags;
if (cs->subtyp == ASUS_IPAC) if (cs->subtyp == ASUS_IPAC)
writereg(cs->hw.asus.adr, cs->hw.asus.isac, IPAC_POTA2, 0x20); writereg(cs->hw.asus.adr, cs->hw.asus.isac, IPAC_POTA2, 0x20);
else else
byteout(cs->hw.asus.adr, ASUS_RESET); /* Reset On */ byteout(cs->hw.asus.adr, ASUS_RESET); /* Reset On */
save_flags(flags);
sti();
set_current_state(TASK_UNINTERRUPTIBLE); set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout((10*HZ)/1000); schedule_timeout((10*HZ)/1000);
if (cs->subtyp == ASUS_IPAC) if (cs->subtyp == ASUS_IPAC)
...@@ -286,7 +281,6 @@ reset_asuscom(struct IsdnCardState *cs) ...@@ -286,7 +281,6 @@ reset_asuscom(struct IsdnCardState *cs)
writereg(cs->hw.asus.adr, cs->hw.asus.isac, IPAC_MASK, 0xc0); writereg(cs->hw.asus.adr, cs->hw.asus.isac, IPAC_MASK, 0xc0);
writereg(cs->hw.asus.adr, cs->hw.asus.isac, IPAC_PCFG, 0x12); writereg(cs->hw.asus.adr, cs->hw.asus.isac, IPAC_PCFG, 0x12);
} }
restore_flags(flags);
} }
static int static int
......
...@@ -179,7 +179,6 @@ setup_avm_a1(struct IsdnCard *card) ...@@ -179,7 +179,6 @@ setup_avm_a1(struct IsdnCard *card)
{ {
u_char val; u_char val;
struct IsdnCardState *cs = card->cs; struct IsdnCardState *cs = card->cs;
long flags;
char tmp[64]; char tmp[64];
strcpy(tmp, avm_revision); strcpy(tmp, avm_revision);
...@@ -254,9 +253,7 @@ setup_avm_a1(struct IsdnCard *card) ...@@ -254,9 +253,7 @@ setup_avm_a1(struct IsdnCard *card)
release_ioregs(cs, 0x1f); release_ioregs(cs, 0x1f);
return (0); return (0);
} }
save_flags(flags);
byteout(cs->hw.avm.cfg_reg, 0x0); byteout(cs->hw.avm.cfg_reg, 0x0);
sti();
HZDELAY(HZ / 5 + 1); HZDELAY(HZ / 5 + 1);
byteout(cs->hw.avm.cfg_reg, 0x1); byteout(cs->hw.avm.cfg_reg, 0x1);
HZDELAY(HZ / 5 + 1); HZDELAY(HZ / 5 + 1);
...@@ -269,7 +266,6 @@ setup_avm_a1(struct IsdnCard *card) ...@@ -269,7 +266,6 @@ setup_avm_a1(struct IsdnCard *card)
HZDELAY(HZ / 5 + 1); HZDELAY(HZ / 5 + 1);
byteout(cs->hw.avm.cfg_reg, 0x0); byteout(cs->hw.avm.cfg_reg, 0x0);
HZDELAY(HZ / 5 + 1); HZDELAY(HZ / 5 + 1);
restore_flags(flags);
val = bytein(cs->hw.avm.cfg_reg); val = bytein(cs->hw.avm.cfg_reg);
printk(KERN_INFO "AVM A1: Byte at %x is %x\n", printk(KERN_INFO "AVM A1: Byte at %x is %x\n",
......
...@@ -57,116 +57,109 @@ ...@@ -57,116 +57,109 @@
#define bytein(addr) inb(addr) #define bytein(addr) inb(addr)
static const char *avm_revision = "$Revision: 2.7.6.2 $"; static const char *avm_revision = "$Revision: 2.7.6.2 $";
static spinlock_t avm_a1p_lock = SPIN_LOCK_UNLOCKED;
static inline u_char static inline u_char
ReadISAC(struct IsdnCardState *cs, u_char offset) ReadISAC(struct IsdnCardState *cs, u_char offset)
{ {
long flags; unsigned long flags;
u_char ret; u_char ret;
offset -= 0x20; offset -= 0x20;
save_flags(flags); spin_lock_irqsave(&avm_a1p_lock, flags);
cli();
byteout(cs->hw.avm.cfg_reg+ADDRREG_OFFSET,ISAC_REG_OFFSET+offset); byteout(cs->hw.avm.cfg_reg+ADDRREG_OFFSET,ISAC_REG_OFFSET+offset);
ret = bytein(cs->hw.avm.cfg_reg+DATAREG_OFFSET); ret = bytein(cs->hw.avm.cfg_reg+DATAREG_OFFSET);
restore_flags(flags); spin_unlock_irqrestore(&avm_a1p_lock, flags);
return ret; return ret;
} }
static inline void static inline void
WriteISAC(struct IsdnCardState *cs, u_char offset, u_char value) WriteISAC(struct IsdnCardState *cs, u_char offset, u_char value)
{ {
long flags; unsigned long flags;
offset -= 0x20; offset -= 0x20;
save_flags(flags); spin_lock_irqsave(&avm_a1p_lock, flags);
cli();
byteout(cs->hw.avm.cfg_reg+ADDRREG_OFFSET,ISAC_REG_OFFSET+offset); byteout(cs->hw.avm.cfg_reg+ADDRREG_OFFSET,ISAC_REG_OFFSET+offset);
byteout(cs->hw.avm.cfg_reg+DATAREG_OFFSET, value); byteout(cs->hw.avm.cfg_reg+DATAREG_OFFSET, value);
restore_flags(flags); spin_unlock_irqrestore(&avm_a1p_lock, flags);
} }
static inline void static inline void
ReadISACfifo(struct IsdnCardState *cs, u_char * data, int size) ReadISACfifo(struct IsdnCardState *cs, u_char * data, int size)
{ {
long flags; unsigned long flags;
save_flags(flags); spin_lock_irqsave(&avm_a1p_lock, flags);
cli();
byteout(cs->hw.avm.cfg_reg+ADDRREG_OFFSET,ISAC_FIFO_OFFSET); byteout(cs->hw.avm.cfg_reg+ADDRREG_OFFSET,ISAC_FIFO_OFFSET);
insb(cs->hw.avm.cfg_reg+DATAREG_OFFSET, data, size); insb(cs->hw.avm.cfg_reg+DATAREG_OFFSET, data, size);
restore_flags(flags); spin_unlock_irqrestore(&avm_a1p_lock, flags);
} }
static inline void static inline void
WriteISACfifo(struct IsdnCardState *cs, u_char * data, int size) WriteISACfifo(struct IsdnCardState *cs, u_char * data, int size)
{ {
long flags; unsigned long flags;
save_flags(flags); spin_lock_irqsave(&avm_a1p_lock, flags);
cli();
byteout(cs->hw.avm.cfg_reg+ADDRREG_OFFSET,ISAC_FIFO_OFFSET); byteout(cs->hw.avm.cfg_reg+ADDRREG_OFFSET,ISAC_FIFO_OFFSET);
outsb(cs->hw.avm.cfg_reg+DATAREG_OFFSET, data, size); outsb(cs->hw.avm.cfg_reg+DATAREG_OFFSET, data, size);
restore_flags(flags); spin_unlock_irqrestore(&avm_a1p_lock, flags);
} }
static inline u_char static inline u_char
ReadHSCX(struct IsdnCardState *cs, int hscx, u_char offset) ReadHSCX(struct IsdnCardState *cs, int hscx, u_char offset)
{ {
u_char ret; u_char ret;
long flags; unsigned long flags;
offset -= 0x20; offset -= 0x20;
save_flags(flags); spin_lock_irqsave(&avm_a1p_lock, flags);
cli();
byteout(cs->hw.avm.cfg_reg+ADDRREG_OFFSET, byteout(cs->hw.avm.cfg_reg+ADDRREG_OFFSET,
HSCX_REG_OFFSET+hscx*HSCX_CH_DIFF+offset); HSCX_REG_OFFSET+hscx*HSCX_CH_DIFF+offset);
ret = bytein(cs->hw.avm.cfg_reg+DATAREG_OFFSET); ret = bytein(cs->hw.avm.cfg_reg+DATAREG_OFFSET);
restore_flags(flags); spin_unlock_irqrestore(&avm_a1p_lock, flags);
return ret; return ret;
} }
static inline void static inline void
WriteHSCX(struct IsdnCardState *cs, int hscx, u_char offset, u_char value) WriteHSCX(struct IsdnCardState *cs, int hscx, u_char offset, u_char value)
{ {
long flags; unsigned long flags;
offset -= 0x20; offset -= 0x20;
save_flags(flags); spin_lock_irqsave(&avm_a1p_lock, flags);
cli();
byteout(cs->hw.avm.cfg_reg+ADDRREG_OFFSET, byteout(cs->hw.avm.cfg_reg+ADDRREG_OFFSET,
HSCX_REG_OFFSET+hscx*HSCX_CH_DIFF+offset); HSCX_REG_OFFSET+hscx*HSCX_CH_DIFF+offset);
byteout(cs->hw.avm.cfg_reg+DATAREG_OFFSET, value); byteout(cs->hw.avm.cfg_reg+DATAREG_OFFSET, value);
restore_flags(flags); spin_unlock_irqrestore(&avm_a1p_lock, flags);
} }
static inline void static inline void
ReadHSCXfifo(struct IsdnCardState *cs, int hscx, u_char * data, int size) ReadHSCXfifo(struct IsdnCardState *cs, int hscx, u_char * data, int size)
{ {
long flags; unsigned long flags;
save_flags(flags); spin_lock_irqsave(&avm_a1p_lock, flags);
cli();
byteout(cs->hw.avm.cfg_reg+ADDRREG_OFFSET, byteout(cs->hw.avm.cfg_reg+ADDRREG_OFFSET,
HSCX_FIFO_OFFSET+hscx*HSCX_CH_DIFF); HSCX_FIFO_OFFSET+hscx*HSCX_CH_DIFF);
insb(cs->hw.avm.cfg_reg+DATAREG_OFFSET, data, size); insb(cs->hw.avm.cfg_reg+DATAREG_OFFSET, data, size);
restore_flags(flags); spin_unlock_irqrestore(&avm_a1p_lock, flags);
} }
static inline void static inline void
WriteHSCXfifo(struct IsdnCardState *cs, int hscx, u_char * data, int size) WriteHSCXfifo(struct IsdnCardState *cs, int hscx, u_char * data, int size)
{ {
long flags; unsigned long flags;
save_flags(flags); spin_lock_irqsave(&avm_a1p_lock, flags);
cli();
byteout(cs->hw.avm.cfg_reg+ADDRREG_OFFSET, byteout(cs->hw.avm.cfg_reg+ADDRREG_OFFSET,
HSCX_FIFO_OFFSET+hscx*HSCX_CH_DIFF); HSCX_FIFO_OFFSET+hscx*HSCX_CH_DIFF);
outsb(cs->hw.avm.cfg_reg+DATAREG_OFFSET, data, size); outsb(cs->hw.avm.cfg_reg+DATAREG_OFFSET, data, size);
restore_flags(flags); spin_unlock_irqrestore(&avm_a1p_lock, flags);
} }
/* /*
...@@ -253,7 +246,6 @@ setup_avm_a1_pcmcia(struct IsdnCard *card) ...@@ -253,7 +246,6 @@ setup_avm_a1_pcmcia(struct IsdnCard *card)
{ {
u_char model, vers; u_char model, vers;
struct IsdnCardState *cs = card->cs; struct IsdnCardState *cs = card->cs;
long flags;
char tmp[64]; char tmp[64];
...@@ -267,9 +259,7 @@ setup_avm_a1_pcmcia(struct IsdnCard *card) ...@@ -267,9 +259,7 @@ setup_avm_a1_pcmcia(struct IsdnCard *card)
cs->irq = card->para[0]; cs->irq = card->para[0];
save_flags(flags);
outb(cs->hw.avm.cfg_reg+ASL1_OFFSET, ASL1_W_ENABLE_S0); outb(cs->hw.avm.cfg_reg+ASL1_OFFSET, ASL1_W_ENABLE_S0);
sti();
byteout(cs->hw.avm.cfg_reg+ASL0_OFFSET,0x00); byteout(cs->hw.avm.cfg_reg+ASL0_OFFSET,0x00);
HZDELAY(HZ / 5 + 1); HZDELAY(HZ / 5 + 1);
...@@ -279,8 +269,6 @@ setup_avm_a1_pcmcia(struct IsdnCard *card) ...@@ -279,8 +269,6 @@ setup_avm_a1_pcmcia(struct IsdnCard *card)
byteout(cs->hw.avm.cfg_reg+ASL0_OFFSET, ASL0_W_TDISABLE|ASL0_W_TRESET); byteout(cs->hw.avm.cfg_reg+ASL0_OFFSET, ASL0_W_TDISABLE|ASL0_W_TRESET);
restore_flags(flags);
model = bytein(cs->hw.avm.cfg_reg+MODREG_OFFSET); model = bytein(cs->hw.avm.cfg_reg+MODREG_OFFSET);
vers = bytein(cs->hw.avm.cfg_reg+VERREG_OFFSET); vers = bytein(cs->hw.avm.cfg_reg+VERREG_OFFSET);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -37,6 +37,7 @@ static void release_b_st(struct Channel *chanp); ...@@ -37,6 +37,7 @@ static void release_b_st(struct Channel *chanp);
static struct Fsm callcfsm; static struct Fsm callcfsm;
static int chancount; static int chancount;
static spinlock_t callc_lock = SPIN_LOCK_UNLOCKED;
/* experimental REJECT after ALERTING for CALLBACK to beat the 4s delay */ /* experimental REJECT after ALERTING for CALLBACK to beat the 4s delay */
#define ALERT_REJECT 0 #define ALERT_REJECT 0
...@@ -1803,8 +1804,7 @@ HiSax_writebuf_skb(int id, int chan, int ack, struct sk_buff *skb) ...@@ -1803,8 +1804,7 @@ HiSax_writebuf_skb(int id, int chan, int ack, struct sk_buff *skb)
return 0; return 0;
} else if (chanp->debug & 0x800) } else if (chanp->debug & 0x800)
link_debug(chanp, 1, "writebuf %d/%d/%d", len, chanp->bcs->tx_cnt,MAX_DATA_MEM); link_debug(chanp, 1, "writebuf %d/%d/%d", len, chanp->bcs->tx_cnt,MAX_DATA_MEM);
save_flags(flags); spin_lock_irqsave(&callc_lock, flags);
cli();
nskb = skb_clone(skb, GFP_ATOMIC); nskb = skb_clone(skb, GFP_ATOMIC);
if (nskb) { if (nskb) {
nskb->truesize = nskb->len; nskb->truesize = nskb->len;
...@@ -1819,7 +1819,7 @@ HiSax_writebuf_skb(int id, int chan, int ack, struct sk_buff *skb) ...@@ -1819,7 +1819,7 @@ HiSax_writebuf_skb(int id, int chan, int ack, struct sk_buff *skb)
dev_kfree_skb(skb); dev_kfree_skb(skb);
} else } else
len = 0; len = 0;
restore_flags(flags); spin_unlock_irqrestore(&callc_lock, flags);
} }
return (len); return (len);
} }
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment