aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorGreg KH <greg@press.(none)>2005-06-28 01:07:56 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-06-28 01:07:56 -0400
commit8644d2a42bdba2d513f71c07eaf1b6f9b718b8eb (patch)
treec43b6c2fdf1b68b66906a2de69446dcec0f9af6b /include
parent1cde8a16815bd85c8137d1ea556398983c597c11 (diff)
parent99f95e5286df2f69edab8a04c7080d986ee4233b (diff)
Merge rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'include')
-rw-r--r--include/asm-arm/arch-ixp4xx/debug-macro.S2
-rw-r--r--include/asm-arm/arch-omap/usb.h9
-rw-r--r--include/asm-arm/ide.h2
-rw-r--r--include/asm-arm/io.h2
-rw-r--r--include/asm-arm/mach/time.h2
-rw-r--r--include/asm-i386/ide.h12
-rw-r--r--include/asm-i386/tlbflush.h12
-rw-r--r--include/asm-i386/unistd.h4
-rw-r--r--include/asm-ia64/kprobes.h14
-rw-r--r--include/asm-ia64/sections.h1
-rw-r--r--include/asm-ia64/unistd.h2
-rw-r--r--include/asm-ppc/open_pic.h6
-rw-r--r--include/asm-ppc/unistd.h4
-rw-r--r--include/asm-ppc64/kprobes.h5
-rw-r--r--include/asm-sparc64/auxio.h2
-rw-r--r--include/asm-sparc64/floppy.h16
-rw-r--r--include/asm-sparc64/irq.h7
-rw-r--r--include/asm-sparc64/rwsem.h3
-rw-r--r--include/asm-sparc64/spinlock.h29
-rw-r--r--include/asm-sparc64/spitfire.h1
-rw-r--r--include/asm-x86_64/tlbflush.h12
-rw-r--r--include/asm-x86_64/unistd.h6
-rw-r--r--include/linux/bio.h14
-rw-r--r--include/linux/blkdev.h25
-rw-r--r--include/linux/cciss_ioctl.h1
-rw-r--r--include/linux/elevator.h8
-rw-r--r--include/linux/fs.h19
-rw-r--r--include/linux/init_task.h2
-rw-r--r--include/linux/input.h4
-rw-r--r--include/linux/ioprio.h88
-rw-r--r--include/linux/joystick.h33
-rw-r--r--include/linux/kprobes.h30
-rw-r--r--include/linux/libps2.h1
-rw-r--r--include/linux/mod_devicetable.h46
-rw-r--r--include/linux/pci_ids.h7
-rw-r--r--include/linux/pmu.h6
-rw-r--r--include/linux/sched.h6
-rw-r--r--include/linux/seccomp.h10
-rw-r--r--include/linux/serial_8250.h1
-rw-r--r--include/linux/serio.h6
-rw-r--r--include/linux/usb_ch9.h183
-rw-r--r--include/linux/usb_gadget.h2
-rw-r--r--include/linux/usb_isp116x.h47
-rw-r--r--include/linux/writeback.h6
-rw-r--r--include/net/ieee80211.h882
-rw-r--r--include/pcmcia/ciscode.h2
-rw-r--r--include/pcmcia/cs.h2
-rw-r--r--include/pcmcia/device_id.h249
-rw-r--r--include/pcmcia/ds.h9
-rw-r--r--include/pcmcia/ss.h34
50 files changed, 1755 insertions, 121 deletions
diff --git a/include/asm-arm/arch-ixp4xx/debug-macro.S b/include/asm-arm/arch-ixp4xx/debug-macro.S
index 45a6c6cc29d..2e23651e217 100644
--- a/include/asm-arm/arch-ixp4xx/debug-macro.S
+++ b/include/asm-arm/arch-ixp4xx/debug-macro.S
@@ -14,8 +14,8 @@
14 mrc p15, 0, \rx, c1, c0 14 mrc p15, 0, \rx, c1, c0
15 tst \rx, #1 @ MMU enabled? 15 tst \rx, #1 @ MMU enabled?
16 moveq \rx, #0xc8000000 16 moveq \rx, #0xc8000000
17 orrne \rx, \rx, #0x00b00000
18 movne \rx, #0xff000000 17 movne \rx, #0xff000000
18 orrne \rx, \rx, #0x00b00000
19 add \rx,\rx,#3 @ Uart regs are at off set of 3 if 19 add \rx,\rx,#3 @ Uart regs are at off set of 3 if
20 @ byte writes used - Big Endian. 20 @ byte writes used - Big Endian.
21 .endm 21 .endm
diff --git a/include/asm-arm/arch-omap/usb.h b/include/asm-arm/arch-omap/usb.h
index 1438c6cef0c..054fb9a8e0c 100644
--- a/include/asm-arm/arch-omap/usb.h
+++ b/include/asm-arm/arch-omap/usb.h
@@ -47,6 +47,15 @@
47# define HMC_TLLATTACH (1 << 6) 47# define HMC_TLLATTACH (1 << 6)
48# define OTG_HMC(w) (((w)>>0)&0x3f) 48# define OTG_HMC(w) (((w)>>0)&0x3f)
49#define OTG_CTRL_REG OTG_REG32(0x0c) 49#define OTG_CTRL_REG OTG_REG32(0x0c)
50# define OTG_USB2_EN (1 << 29)
51# define OTG_USB2_DP (1 << 28)
52# define OTG_USB2_DM (1 << 27)
53# define OTG_USB1_EN (1 << 26)
54# define OTG_USB1_DP (1 << 25)
55# define OTG_USB1_DM (1 << 24)
56# define OTG_USB0_EN (1 << 23)
57# define OTG_USB0_DP (1 << 22)
58# define OTG_USB0_DM (1 << 21)
50# define OTG_ASESSVLD (1 << 20) 59# define OTG_ASESSVLD (1 << 20)
51# define OTG_BSESSEND (1 << 19) 60# define OTG_BSESSEND (1 << 19)
52# define OTG_BSESSVLD (1 << 18) 61# define OTG_BSESSVLD (1 << 18)
diff --git a/include/asm-arm/ide.h b/include/asm-arm/ide.h
index 2114acb3d23..4f68c8a5a19 100644
--- a/include/asm-arm/ide.h
+++ b/include/asm-arm/ide.h
@@ -5,7 +5,7 @@
5 */ 5 */
6 6
7/* 7/*
8 * This file contains the i386 architecture specific IDE code. 8 * This file contains the ARM architecture specific IDE code.
9 */ 9 */
10 10
11#ifndef __ASMARM_IDE_H 11#ifndef __ASMARM_IDE_H
diff --git a/include/asm-arm/io.h b/include/asm-arm/io.h
index cc4b5f5dbfc..cfa71a0dffb 100644
--- a/include/asm-arm/io.h
+++ b/include/asm-arm/io.h
@@ -82,7 +82,7 @@ extern void __readwrite_bug(const char *fn);
82 * only. Their primary purpose is to access PCI and ISA peripherals. 82 * only. Their primary purpose is to access PCI and ISA peripherals.
83 * 83 *
84 * Note that for a big endian machine, this implies that the following 84 * Note that for a big endian machine, this implies that the following
85 * big endian mode connectivity is in place, as described by numerious 85 * big endian mode connectivity is in place, as described by numerous
86 * ARM documents: 86 * ARM documents:
87 * 87 *
88 * PCI: D0-D7 D8-D15 D16-D23 D24-D31 88 * PCI: D0-D7 D8-D15 D16-D23 D24-D31
diff --git a/include/asm-arm/mach/time.h b/include/asm-arm/mach/time.h
index 047980ad18d..2cf279a4401 100644
--- a/include/asm-arm/mach/time.h
+++ b/include/asm-arm/mach/time.h
@@ -60,6 +60,8 @@ struct dyn_tick_timer {
60}; 60};
61 61
62void timer_dyn_reprogram(void); 62void timer_dyn_reprogram(void);
63#else
64#define timer_dyn_reprogram() do { } while (0)
63#endif 65#endif
64 66
65extern struct sys_timer *system_timer; 67extern struct sys_timer *system_timer;
diff --git a/include/asm-i386/ide.h b/include/asm-i386/ide.h
index 859ebf4da63..79dfab87135 100644
--- a/include/asm-i386/ide.h
+++ b/include/asm-i386/ide.h
@@ -41,13 +41,17 @@ static __inline__ int ide_default_irq(unsigned long base)
41 41
42static __inline__ unsigned long ide_default_io_base(int index) 42static __inline__ unsigned long ide_default_io_base(int index)
43{ 43{
44 if (pci_find_device(PCI_ANY_ID, PCI_ANY_ID, NULL) == NULL) {
45 switch(index) {
46 case 2: return 0x1e8;
47 case 3: return 0x168;
48 case 4: return 0x1e0;
49 case 5: return 0x160;
50 }
51 }
44 switch (index) { 52 switch (index) {
45 case 0: return 0x1f0; 53 case 0: return 0x1f0;
46 case 1: return 0x170; 54 case 1: return 0x170;
47 case 2: return 0x1e8;
48 case 3: return 0x168;
49 case 4: return 0x1e0;
50 case 5: return 0x160;
51 default: 55 default:
52 return 0; 56 return 0;
53 } 57 }
diff --git a/include/asm-i386/tlbflush.h b/include/asm-i386/tlbflush.h
index f22fab0cea2..ab216e1370e 100644
--- a/include/asm-i386/tlbflush.h
+++ b/include/asm-i386/tlbflush.h
@@ -22,16 +22,18 @@
22 */ 22 */
23#define __flush_tlb_global() \ 23#define __flush_tlb_global() \
24 do { \ 24 do { \
25 unsigned int tmpreg; \ 25 unsigned int tmpreg, cr4, cr4_orig; \
26 \ 26 \
27 __asm__ __volatile__( \ 27 __asm__ __volatile__( \
28 "movl %1, %%cr4; # turn off PGE \n" \ 28 "movl %%cr4, %2; # turn off PGE \n" \
29 "movl %2, %1; \n" \
30 "andl %3, %1; \n" \
31 "movl %1, %%cr4; \n" \
29 "movl %%cr3, %0; \n" \ 32 "movl %%cr3, %0; \n" \
30 "movl %0, %%cr3; # flush TLB \n" \ 33 "movl %0, %%cr3; # flush TLB \n" \
31 "movl %2, %%cr4; # turn PGE back on \n" \ 34 "movl %2, %%cr4; # turn PGE back on \n" \
32 : "=&r" (tmpreg) \ 35 : "=&r" (tmpreg), "=&r" (cr4), "=&r" (cr4_orig) \
33 : "r" (mmu_cr4_features & ~X86_CR4_PGE), \ 36 : "i" (~X86_CR4_PGE) \
34 "r" (mmu_cr4_features) \
35 : "memory"); \ 37 : "memory"); \
36 } while (0) 38 } while (0)
37 39
diff --git a/include/asm-i386/unistd.h b/include/asm-i386/unistd.h
index 176413fb9ae..e25e4c71a87 100644
--- a/include/asm-i386/unistd.h
+++ b/include/asm-i386/unistd.h
@@ -294,8 +294,10 @@
294#define __NR_add_key 286 294#define __NR_add_key 286
295#define __NR_request_key 287 295#define __NR_request_key 287
296#define __NR_keyctl 288 296#define __NR_keyctl 288
297#define __NR_ioprio_set 289
298#define __NR_ioprio_get 290
297 299
298#define NR_syscalls 289 300#define NR_syscalls 291
299 301
300/* 302/*
301 * user-visible error numbers are in the range -1 - -128: see 303 * user-visible error numbers are in the range -1 - -128: see
diff --git a/include/asm-ia64/kprobes.h b/include/asm-ia64/kprobes.h
index 7b700035e36..bf36a32e37e 100644
--- a/include/asm-ia64/kprobes.h
+++ b/include/asm-ia64/kprobes.h
@@ -28,6 +28,7 @@
28#include <linux/ptrace.h> 28#include <linux/ptrace.h>
29#include <asm/break.h> 29#include <asm/break.h>
30 30
31#define MAX_INSN_SIZE 16
31#define BREAK_INST (long)(__IA64_BREAK_KPROBE << 6) 32#define BREAK_INST (long)(__IA64_BREAK_KPROBE << 6)
32 33
33typedef union cmp_inst { 34typedef union cmp_inst {
@@ -63,6 +64,8 @@ typedef struct _bundle {
63 64
64#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry 65#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry
65 66
67#define ARCH_SUPPORTS_KRETPROBES
68
66#define SLOT0_OPCODE_SHIFT (37) 69#define SLOT0_OPCODE_SHIFT (37)
67#define SLOT1_p1_OPCODE_SHIFT (37 - (64-46)) 70#define SLOT1_p1_OPCODE_SHIFT (37 - (64-46))
68#define SLOT2_OPCODE_SHIFT (37) 71#define SLOT2_OPCODE_SHIFT (37)
@@ -94,11 +97,6 @@ struct arch_specific_insn {
94}; 97};
95 98
96/* ia64 does not need this */ 99/* ia64 does not need this */
97static inline void jprobe_return(void)
98{
99}
100
101/* ia64 does not need this */
102static inline void arch_copy_kprobe(struct kprobe *p) 100static inline void arch_copy_kprobe(struct kprobe *p)
103{ 101{
104} 102}
@@ -106,6 +104,12 @@ static inline void arch_copy_kprobe(struct kprobe *p)
106#ifdef CONFIG_KPROBES 104#ifdef CONFIG_KPROBES
107extern int kprobe_exceptions_notify(struct notifier_block *self, 105extern int kprobe_exceptions_notify(struct notifier_block *self,
108 unsigned long val, void *data); 106 unsigned long val, void *data);
107
108/* ia64 does not need this */
109static inline void jprobe_return(void)
110{
111}
112
109#else /* !CONFIG_KPROBES */ 113#else /* !CONFIG_KPROBES */
110static inline int kprobe_exceptions_notify(struct notifier_block *self, 114static inline int kprobe_exceptions_notify(struct notifier_block *self,
111 unsigned long val, void *data) 115 unsigned long val, void *data)
diff --git a/include/asm-ia64/sections.h b/include/asm-ia64/sections.h
index 8e3dbde1b42..e9eb7f62d32 100644
--- a/include/asm-ia64/sections.h
+++ b/include/asm-ia64/sections.h
@@ -17,6 +17,7 @@ extern char __start_gate_vtop_patchlist[], __end_gate_vtop_patchlist[];
17extern char __start_gate_fsyscall_patchlist[], __end_gate_fsyscall_patchlist[]; 17extern char __start_gate_fsyscall_patchlist[], __end_gate_fsyscall_patchlist[];
18extern char __start_gate_brl_fsys_bubble_down_patchlist[], __end_gate_brl_fsys_bubble_down_patchlist[]; 18extern char __start_gate_brl_fsys_bubble_down_patchlist[], __end_gate_brl_fsys_bubble_down_patchlist[];
19extern char __start_unwind[], __end_unwind[]; 19extern char __start_unwind[], __end_unwind[];
20extern char __start_ivt_text[], __end_ivt_text[];
20 21
21#endif /* _ASM_IA64_SECTIONS_H */ 22#endif /* _ASM_IA64_SECTIONS_H */
22 23
diff --git a/include/asm-ia64/unistd.h b/include/asm-ia64/unistd.h
index f7f43ec2483..517f1649ee6 100644
--- a/include/asm-ia64/unistd.h
+++ b/include/asm-ia64/unistd.h
@@ -263,6 +263,8 @@
263#define __NR_add_key 1271 263#define __NR_add_key 1271
264#define __NR_request_key 1272 264#define __NR_request_key 1272
265#define __NR_keyctl 1273 265#define __NR_keyctl 1273
266#define __NR_ioprio_set 1274
267#define __NR_ioprio_get 1275
266#define __NR_set_zone_reclaim 1276 268#define __NR_set_zone_reclaim 1276
267 269
268#ifdef __KERNEL__ 270#ifdef __KERNEL__
diff --git a/include/asm-ppc/open_pic.h b/include/asm-ppc/open_pic.h
index dbe85331974..7848aa610c0 100644
--- a/include/asm-ppc/open_pic.h
+++ b/include/asm-ppc/open_pic.h
@@ -25,6 +25,11 @@
25#define OPENPIC_VEC_IPI 118 /* and up */ 25#define OPENPIC_VEC_IPI 118 /* and up */
26#define OPENPIC_VEC_SPURIOUS 255 26#define OPENPIC_VEC_SPURIOUS 255
27 27
28/* Priorities */
29#define OPENPIC_PRIORITY_IPI_BASE 10
30#define OPENPIC_PRIORITY_DEFAULT 4
31#define OPENPIC_PRIORITY_NMI 9
32
28/* OpenPIC IRQ controller structure */ 33/* OpenPIC IRQ controller structure */
29extern struct hw_interrupt_type open_pic; 34extern struct hw_interrupt_type open_pic;
30 35
@@ -42,6 +47,7 @@ extern int epic_serial_mode;
42extern void openpic_set_sources(int first_irq, int num_irqs, void __iomem *isr); 47extern void openpic_set_sources(int first_irq, int num_irqs, void __iomem *isr);
43extern void openpic_init(int linux_irq_offset); 48extern void openpic_init(int linux_irq_offset);
44extern void openpic_init_nmi_irq(u_int irq); 49extern void openpic_init_nmi_irq(u_int irq);
50extern void openpic_set_irq_priority(u_int irq, u_int pri);
45extern void openpic_hookup_cascade(u_int irq, char *name, 51extern void openpic_hookup_cascade(u_int irq, char *name,
46 int (*cascade_fn)(struct pt_regs *)); 52 int (*cascade_fn)(struct pt_regs *));
47extern u_int openpic_irq(void); 53extern u_int openpic_irq(void);
diff --git a/include/asm-ppc/unistd.h b/include/asm-ppc/unistd.h
index cc51e5c9acc..e8b79220b29 100644
--- a/include/asm-ppc/unistd.h
+++ b/include/asm-ppc/unistd.h
@@ -277,8 +277,10 @@
277#define __NR_request_key 270 277#define __NR_request_key 270
278#define __NR_keyctl 271 278#define __NR_keyctl 271
279#define __NR_waitid 272 279#define __NR_waitid 272
280#define __NR_ioprio_set 273
281#define __NR_ioprio_get 274
280 282
281#define __NR_syscalls 273 283#define __NR_syscalls 275
282 284
283#define __NR(n) #n 285#define __NR(n) #n
284 286
diff --git a/include/asm-ppc64/kprobes.h b/include/asm-ppc64/kprobes.h
index 19b468bed05..0802919c323 100644
--- a/include/asm-ppc64/kprobes.h
+++ b/include/asm-ppc64/kprobes.h
@@ -42,10 +42,13 @@ typedef unsigned int kprobe_opcode_t;
42 42
43#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)((func_descr_t *)pentry) 43#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)((func_descr_t *)pentry)
44 44
45#define ARCH_SUPPORTS_KRETPROBES
46void kretprobe_trampoline(void);
47
45/* Architecture specific copy of original instruction */ 48/* Architecture specific copy of original instruction */
46struct arch_specific_insn { 49struct arch_specific_insn {
47 /* copy of original instruction */ 50 /* copy of original instruction */
48 kprobe_opcode_t insn[MAX_INSN_SIZE]; 51 kprobe_opcode_t *insn;
49}; 52};
50 53
51#ifdef CONFIG_KPROBES 54#ifdef CONFIG_KPROBES
diff --git a/include/asm-sparc64/auxio.h b/include/asm-sparc64/auxio.h
index 5eb01dd4715..81a590a50a1 100644
--- a/include/asm-sparc64/auxio.h
+++ b/include/asm-sparc64/auxio.h
@@ -75,6 +75,8 @@
75 75
76#ifndef __ASSEMBLY__ 76#ifndef __ASSEMBLY__
77 77
78extern void __iomem *auxio_register;
79
78#define AUXIO_LTE_ON 1 80#define AUXIO_LTE_ON 1
79#define AUXIO_LTE_OFF 0 81#define AUXIO_LTE_OFF 0
80 82
diff --git a/include/asm-sparc64/floppy.h b/include/asm-sparc64/floppy.h
index e071b4b4edf..49d49a28594 100644
--- a/include/asm-sparc64/floppy.h
+++ b/include/asm-sparc64/floppy.h
@@ -159,7 +159,7 @@ static void sun_82077_fd_outb(unsigned char value, unsigned long port)
159 * underruns. If non-zero, doing_pdma encodes the direction of 159 * underruns. If non-zero, doing_pdma encodes the direction of
160 * the transfer for debugging. 1=read 2=write 160 * the transfer for debugging. 1=read 2=write
161 */ 161 */
162char *pdma_vaddr; 162unsigned char *pdma_vaddr;
163unsigned long pdma_size; 163unsigned long pdma_size;
164volatile int doing_pdma = 0; 164volatile int doing_pdma = 0;
165 165
@@ -209,8 +209,7 @@ static void sun_fd_enable_dma(void)
209 pdma_areasize = pdma_size; 209 pdma_areasize = pdma_size;
210} 210}
211 211
212/* Our low-level entry point in arch/sparc/kernel/entry.S */ 212extern irqreturn_t sparc_floppy_irq(int, void *, struct pt_regs *);
213extern irqreturn_t floppy_hardint(int irq, void *unused, struct pt_regs *regs);
214 213
215static int sun_fd_request_irq(void) 214static int sun_fd_request_irq(void)
216{ 215{
@@ -220,8 +219,8 @@ static int sun_fd_request_irq(void)
220 if(!once) { 219 if(!once) {
221 once = 1; 220 once = 1;
222 221
223 error = request_fast_irq(FLOPPY_IRQ, floppy_hardint, 222 error = request_irq(FLOPPY_IRQ, sparc_floppy_irq,
224 SA_INTERRUPT, "floppy", NULL); 223 SA_INTERRUPT, "floppy", NULL);
225 224
226 return ((error == 0) ? 0 : -1); 225 return ((error == 0) ? 0 : -1);
227 } 226 }
@@ -615,7 +614,7 @@ static unsigned long __init sun_floppy_init(void)
615 struct linux_ebus *ebus; 614 struct linux_ebus *ebus;
616 struct linux_ebus_device *edev = NULL; 615 struct linux_ebus_device *edev = NULL;
617 unsigned long config = 0; 616 unsigned long config = 0;
618 unsigned long auxio_reg; 617 void __iomem *auxio_reg;
619 618
620 for_each_ebus(ebus) { 619 for_each_ebus(ebus) {
621 for_each_ebusdev(edev, ebus) { 620 for_each_ebusdev(edev, ebus) {
@@ -642,7 +641,7 @@ static unsigned long __init sun_floppy_init(void)
642 /* Make sure the high density bit is set, some systems 641 /* Make sure the high density bit is set, some systems
643 * (most notably Ultra5/Ultra10) come up with it clear. 642 * (most notably Ultra5/Ultra10) come up with it clear.
644 */ 643 */
645 auxio_reg = edev->resource[2].start; 644 auxio_reg = (void __iomem *) edev->resource[2].start;
646 writel(readl(auxio_reg)|0x2, auxio_reg); 645 writel(readl(auxio_reg)|0x2, auxio_reg);
647 646
648 sun_pci_ebus_dev = ebus->self; 647 sun_pci_ebus_dev = ebus->self;
@@ -650,7 +649,8 @@ static unsigned long __init sun_floppy_init(void)
650 spin_lock_init(&sun_pci_fd_ebus_dma.lock); 649 spin_lock_init(&sun_pci_fd_ebus_dma.lock);
651 650
652 /* XXX ioremap */ 651 /* XXX ioremap */
653 sun_pci_fd_ebus_dma.regs = edev->resource[1].start; 652 sun_pci_fd_ebus_dma.regs = (void __iomem *)
653 edev->resource[1].start;
654 if (!sun_pci_fd_ebus_dma.regs) 654 if (!sun_pci_fd_ebus_dma.regs)
655 return 0; 655 return 0;
656 656
diff --git a/include/asm-sparc64/irq.h b/include/asm-sparc64/irq.h
index 3aef0ca6775..018e2e46082 100644
--- a/include/asm-sparc64/irq.h
+++ b/include/asm-sparc64/irq.h
@@ -19,7 +19,7 @@
19/* You should not mess with this directly. That's the job of irq.c. 19/* You should not mess with this directly. That's the job of irq.c.
20 * 20 *
21 * If you make changes here, please update hand coded assembler of 21 * If you make changes here, please update hand coded assembler of
22 * SBUS/floppy interrupt handler in entry.S -DaveM 22 * the vectored interrupt trap handler in entry.S -DaveM
23 * 23 *
24 * This is currently one DCACHE line, two buckets per L2 cache 24 * This is currently one DCACHE line, two buckets per L2 cache
25 * line. Keep this in mind please. 25 * line. Keep this in mind please.
@@ -122,11 +122,6 @@ extern void enable_irq(unsigned int);
122extern unsigned int build_irq(int pil, int inofixup, unsigned long iclr, unsigned long imap); 122extern unsigned int build_irq(int pil, int inofixup, unsigned long iclr, unsigned long imap);
123extern unsigned int sbus_build_irq(void *sbus, unsigned int ino); 123extern unsigned int sbus_build_irq(void *sbus, unsigned int ino);
124 124
125extern int request_fast_irq(unsigned int irq,
126 irqreturn_t (*handler)(int, void *, struct pt_regs *),
127 unsigned long flags, __const__ char *devname,
128 void *dev_id);
129
130static __inline__ void set_softint(unsigned long bits) 125static __inline__ void set_softint(unsigned long bits)
131{ 126{
132 __asm__ __volatile__("wr %0, 0x0, %%set_softint" 127 __asm__ __volatile__("wr %0, 0x0, %%set_softint"
diff --git a/include/asm-sparc64/rwsem.h b/include/asm-sparc64/rwsem.h
index bf2ae90ed3d..a1cc94f9598 100644
--- a/include/asm-sparc64/rwsem.h
+++ b/include/asm-sparc64/rwsem.h
@@ -55,8 +55,9 @@ static __inline__ int rwsem_atomic_update(int delta, struct rw_semaphore *sem)
55 "add %%g1, %1, %%g7\n\t" 55 "add %%g1, %1, %%g7\n\t"
56 "cas [%2], %%g1, %%g7\n\t" 56 "cas [%2], %%g1, %%g7\n\t"
57 "cmp %%g1, %%g7\n\t" 57 "cmp %%g1, %%g7\n\t"
58 "membar #StoreLoad | #StoreStore\n\t"
58 "bne,pn %%icc, 1b\n\t" 59 "bne,pn %%icc, 1b\n\t"
59 " membar #StoreLoad | #StoreStore\n\t" 60 " nop\n\t"
60 "mov %%g7, %0\n\t" 61 "mov %%g7, %0\n\t"
61 : "=&r" (tmp) 62 : "=&r" (tmp)
62 : "0" (tmp), "r" (sem) 63 : "0" (tmp), "r" (sem)
diff --git a/include/asm-sparc64/spinlock.h b/include/asm-sparc64/spinlock.h
index db7581bdb53..9cb93a5c2b4 100644
--- a/include/asm-sparc64/spinlock.h
+++ b/include/asm-sparc64/spinlock.h
@@ -52,12 +52,14 @@ static inline void _raw_spin_lock(spinlock_t *lock)
52 52
53 __asm__ __volatile__( 53 __asm__ __volatile__(
54"1: ldstub [%1], %0\n" 54"1: ldstub [%1], %0\n"
55" membar #StoreLoad | #StoreStore\n"
55" brnz,pn %0, 2f\n" 56" brnz,pn %0, 2f\n"
56" membar #StoreLoad | #StoreStore\n" 57" nop\n"
57" .subsection 2\n" 58" .subsection 2\n"
58"2: ldub [%1], %0\n" 59"2: ldub [%1], %0\n"
60" membar #LoadLoad\n"
59" brnz,pt %0, 2b\n" 61" brnz,pt %0, 2b\n"
60" membar #LoadLoad\n" 62" nop\n"
61" ba,a,pt %%xcc, 1b\n" 63" ba,a,pt %%xcc, 1b\n"
62" .previous" 64" .previous"
63 : "=&r" (tmp) 65 : "=&r" (tmp)
@@ -95,16 +97,18 @@ static inline void _raw_spin_lock_flags(spinlock_t *lock, unsigned long flags)
95 97
96 __asm__ __volatile__( 98 __asm__ __volatile__(
97"1: ldstub [%2], %0\n" 99"1: ldstub [%2], %0\n"
98" brnz,pn %0, 2f\n"
99" membar #StoreLoad | #StoreStore\n" 100" membar #StoreLoad | #StoreStore\n"
101" brnz,pn %0, 2f\n"
102" nop\n"
100" .subsection 2\n" 103" .subsection 2\n"
101"2: rdpr %%pil, %1\n" 104"2: rdpr %%pil, %1\n"
102" wrpr %3, %%pil\n" 105" wrpr %3, %%pil\n"
103"3: ldub [%2], %0\n" 106"3: ldub [%2], %0\n"
104" brnz,pt %0, 3b\n"
105" membar #LoadLoad\n" 107" membar #LoadLoad\n"
108" brnz,pt %0, 3b\n"
109" nop\n"
106" ba,pt %%xcc, 1b\n" 110" ba,pt %%xcc, 1b\n"
107" wrpr %1, %%pil\n" 111" wrpr %1, %%pil\n"
108" .previous" 112" .previous"
109 : "=&r" (tmp1), "=&r" (tmp2) 113 : "=&r" (tmp1), "=&r" (tmp2)
110 : "r"(lock), "r"(flags) 114 : "r"(lock), "r"(flags)
@@ -162,12 +166,14 @@ static void inline __read_lock(rwlock_t *lock)
162"4: add %0, 1, %1\n" 166"4: add %0, 1, %1\n"
163" cas [%2], %0, %1\n" 167" cas [%2], %0, %1\n"
164" cmp %0, %1\n" 168" cmp %0, %1\n"
169" membar #StoreLoad | #StoreStore\n"
165" bne,pn %%icc, 1b\n" 170" bne,pn %%icc, 1b\n"
166" membar #StoreLoad | #StoreStore\n" 171" nop\n"
167" .subsection 2\n" 172" .subsection 2\n"
168"2: ldsw [%2], %0\n" 173"2: ldsw [%2], %0\n"
174" membar #LoadLoad\n"
169" brlz,pt %0, 2b\n" 175" brlz,pt %0, 2b\n"
170" membar #LoadLoad\n" 176" nop\n"
171" ba,a,pt %%xcc, 4b\n" 177" ba,a,pt %%xcc, 4b\n"
172" .previous" 178" .previous"
173 : "=&r" (tmp1), "=&r" (tmp2) 179 : "=&r" (tmp1), "=&r" (tmp2)
@@ -204,12 +210,14 @@ static void inline __write_lock(rwlock_t *lock)
204"4: or %0, %3, %1\n" 210"4: or %0, %3, %1\n"
205" cas [%2], %0, %1\n" 211" cas [%2], %0, %1\n"
206" cmp %0, %1\n" 212" cmp %0, %1\n"
213" membar #StoreLoad | #StoreStore\n"
207" bne,pn %%icc, 1b\n" 214" bne,pn %%icc, 1b\n"
208" membar #StoreLoad | #StoreStore\n" 215" nop\n"
209" .subsection 2\n" 216" .subsection 2\n"
210"2: lduw [%2], %0\n" 217"2: lduw [%2], %0\n"
218" membar #LoadLoad\n"
211" brnz,pt %0, 2b\n" 219" brnz,pt %0, 2b\n"
212" membar #LoadLoad\n" 220" nop\n"
213" ba,a,pt %%xcc, 4b\n" 221" ba,a,pt %%xcc, 4b\n"
214" .previous" 222" .previous"
215 : "=&r" (tmp1), "=&r" (tmp2) 223 : "=&r" (tmp1), "=&r" (tmp2)
@@ -240,8 +248,9 @@ static int inline __write_trylock(rwlock_t *lock)
240" or %0, %4, %1\n" 248" or %0, %4, %1\n"
241" cas [%3], %0, %1\n" 249" cas [%3], %0, %1\n"
242" cmp %0, %1\n" 250" cmp %0, %1\n"
251" membar #StoreLoad | #StoreStore\n"
243" bne,pn %%icc, 1b\n" 252" bne,pn %%icc, 1b\n"
244" membar #StoreLoad | #StoreStore\n" 253" nop\n"
245" mov 1, %2\n" 254" mov 1, %2\n"
246"2:" 255"2:"
247 : "=&r" (tmp1), "=&r" (tmp2), "=&r" (result) 256 : "=&r" (tmp1), "=&r" (tmp2), "=&r" (result)
diff --git a/include/asm-sparc64/spitfire.h b/include/asm-sparc64/spitfire.h
index 9d7613eea81..1aa932773af 100644
--- a/include/asm-sparc64/spitfire.h
+++ b/include/asm-sparc64/spitfire.h
@@ -111,7 +111,6 @@ static __inline__ void spitfire_put_dcache_tag(unsigned long addr, unsigned long
111 "membar #Sync" 111 "membar #Sync"
112 : /* No outputs */ 112 : /* No outputs */
113 : "r" (tag), "r" (addr), "i" (ASI_DCACHE_TAG)); 113 : "r" (tag), "r" (addr), "i" (ASI_DCACHE_TAG));
114 __asm__ __volatile__ ("membar #Sync" : : : "memory");
115} 114}
116 115
117/* The instruction cache lines are flushed with this, but note that 116/* The instruction cache lines are flushed with this, but note that
diff --git a/include/asm-x86_64/tlbflush.h b/include/asm-x86_64/tlbflush.h
index 2e811ac262a..06174238252 100644
--- a/include/asm-x86_64/tlbflush.h
+++ b/include/asm-x86_64/tlbflush.h
@@ -22,16 +22,18 @@
22 */ 22 */
23#define __flush_tlb_global() \ 23#define __flush_tlb_global() \
24 do { \ 24 do { \
25 unsigned long tmpreg; \ 25 unsigned long tmpreg, cr4, cr4_orig; \
26 \ 26 \
27 __asm__ __volatile__( \ 27 __asm__ __volatile__( \
28 "movq %1, %%cr4; # turn off PGE \n" \ 28 "movq %%cr4, %2; # turn off PGE \n" \
29 "movq %2, %1; \n" \
30 "andq %3, %1; \n" \
31 "movq %1, %%cr4; \n" \
29 "movq %%cr3, %0; # flush TLB \n" \ 32 "movq %%cr3, %0; # flush TLB \n" \
30 "movq %0, %%cr3; \n" \ 33 "movq %0, %%cr3; \n" \
31 "movq %2, %%cr4; # turn PGE back on \n" \ 34 "movq %2, %%cr4; # turn PGE back on \n" \
32 : "=&r" (tmpreg) \ 35 : "=&r" (tmpreg), "=&r" (cr4), "=&r" (cr4_orig) \
33 : "r" (mmu_cr4_features & ~X86_CR4_PGE), \ 36 : "i" (~X86_CR4_PGE) \
34 "r" (mmu_cr4_features) \
35 : "memory"); \ 37 : "memory"); \
36 } while (0) 38 } while (0)
37 39
diff --git a/include/asm-x86_64/unistd.h b/include/asm-x86_64/unistd.h
index d767adcbf0f..6560439a83e 100644
--- a/include/asm-x86_64/unistd.h
+++ b/include/asm-x86_64/unistd.h
@@ -561,8 +561,12 @@ __SYSCALL(__NR_add_key, sys_add_key)
561__SYSCALL(__NR_request_key, sys_request_key) 561__SYSCALL(__NR_request_key, sys_request_key)
562#define __NR_keyctl 250 562#define __NR_keyctl 250
563__SYSCALL(__NR_keyctl, sys_keyctl) 563__SYSCALL(__NR_keyctl, sys_keyctl)
564#define __NR_ioprio_set 251
565__SYSCALL(__NR_ioprio_set, sys_ioprio_set)
566#define __NR_ioprio_get 252
567__SYSCALL(__NR_ioprio_get, sys_ioprio_get)
564 568
565#define __NR_syscall_max __NR_keyctl 569#define __NR_syscall_max __NR_ioprio_get
566#ifndef __NO_STUBS 570#ifndef __NO_STUBS
567 571
568/* user-visible error numbers are in the range -1 - -4095 */ 572/* user-visible error numbers are in the range -1 - -4095 */
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 038022763f0..36ef29fa0d8 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -22,6 +22,7 @@
22 22
23#include <linux/highmem.h> 23#include <linux/highmem.h>
24#include <linux/mempool.h> 24#include <linux/mempool.h>
25#include <linux/ioprio.h>
25 26
26/* Platforms may set this to teach the BIO layer about IOMMU hardware. */ 27/* Platforms may set this to teach the BIO layer about IOMMU hardware. */
27#include <asm/io.h> 28#include <asm/io.h>
@@ -150,6 +151,19 @@ struct bio {
150#define BIO_RW_SYNC 4 151#define BIO_RW_SYNC 4
151 152
152/* 153/*
154 * upper 16 bits of bi_rw define the io priority of this bio
155 */
156#define BIO_PRIO_SHIFT (8 * sizeof(unsigned long) - IOPRIO_BITS)
157#define bio_prio(bio) ((bio)->bi_rw >> BIO_PRIO_SHIFT)
158#define bio_prio_valid(bio) ioprio_valid(bio_prio(bio))
159
160#define bio_set_prio(bio, prio) do { \
161 WARN_ON(prio >= (1 << IOPRIO_BITS)); \
162 (bio)->bi_rw &= ((1UL << BIO_PRIO_SHIFT) - 1); \
163 (bio)->bi_rw |= ((unsigned long) (prio) << BIO_PRIO_SHIFT); \
164} while (0)
165
166/*
153 * various member access, note that bio_data should of course not be used 167 * various member access, note that bio_data should of course not be used
154 * on highmem page vectors 168 * on highmem page vectors
155 */ 169 */
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index b54a0348a89..21a8674cd14 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -54,16 +54,23 @@ struct as_io_context {
54 54
55struct cfq_queue; 55struct cfq_queue;
56struct cfq_io_context { 56struct cfq_io_context {
57 void (*dtor)(struct cfq_io_context *);
58 void (*exit)(struct cfq_io_context *);
59
60 struct io_context *ioc;
61
62 /* 57 /*
63 * circular list of cfq_io_contexts belonging to a process io context 58 * circular list of cfq_io_contexts belonging to a process io context
64 */ 59 */
65 struct list_head list; 60 struct list_head list;
66 struct cfq_queue *cfqq; 61 struct cfq_queue *cfqq;
62 void *key;
63
64 struct io_context *ioc;
65
66 unsigned long last_end_request;
67 unsigned long last_queue;
68 unsigned long ttime_total;
69 unsigned long ttime_samples;
70 unsigned long ttime_mean;
71
72 void (*dtor)(struct cfq_io_context *);
73 void (*exit)(struct cfq_io_context *);
67}; 74};
68 75
69/* 76/*
@@ -73,7 +80,9 @@ struct cfq_io_context {
73 */ 80 */
74struct io_context { 81struct io_context {
75 atomic_t refcount; 82 atomic_t refcount;
76 pid_t pid; 83 struct task_struct *task;
84
85 int (*set_ioprio)(struct io_context *, unsigned int);
77 86
78 /* 87 /*
79 * For request batching 88 * For request batching
@@ -81,8 +90,6 @@ struct io_context {
81 unsigned long last_waited; /* Time last woken after wait for request */ 90 unsigned long last_waited; /* Time last woken after wait for request */
82 int nr_batch_requests; /* Number of requests left in the batch */ 91 int nr_batch_requests; /* Number of requests left in the batch */
83 92
84 spinlock_t lock;
85
86 struct as_io_context *aic; 93 struct as_io_context *aic;
87 struct cfq_io_context *cic; 94 struct cfq_io_context *cic;
88}; 95};
@@ -134,6 +141,8 @@ struct request {
134 141
135 void *elevator_private; 142 void *elevator_private;
136 143
144 unsigned short ioprio;
145
137 int rq_status; /* should split this into a few status bits */ 146 int rq_status; /* should split this into a few status bits */
138 struct gendisk *rq_disk; 147 struct gendisk *rq_disk;
139 int errors; 148 int errors;
diff --git a/include/linux/cciss_ioctl.h b/include/linux/cciss_ioctl.h
index ee0c6e8995d..424d5e622b4 100644
--- a/include/linux/cciss_ioctl.h
+++ b/include/linux/cciss_ioctl.h
@@ -10,6 +10,7 @@
10typedef struct _cciss_pci_info_struct 10typedef struct _cciss_pci_info_struct
11{ 11{
12 unsigned char bus; 12 unsigned char bus;
13 unsigned short domain;
13 unsigned char dev_fn; 14 unsigned char dev_fn;
14 __u32 board_id; 15 __u32 board_id;
15} cciss_pci_info_struct; 16} cciss_pci_info_struct;
diff --git a/include/linux/elevator.h b/include/linux/elevator.h
index ee54f81faad..ea6bbc2d740 100644
--- a/include/linux/elevator.h
+++ b/include/linux/elevator.h
@@ -16,9 +16,9 @@ typedef void (elevator_remove_req_fn) (request_queue_t *, struct request *);
16typedef void (elevator_requeue_req_fn) (request_queue_t *, struct request *); 16typedef void (elevator_requeue_req_fn) (request_queue_t *, struct request *);
17typedef struct request *(elevator_request_list_fn) (request_queue_t *, struct request *); 17typedef struct request *(elevator_request_list_fn) (request_queue_t *, struct request *);
18typedef void (elevator_completed_req_fn) (request_queue_t *, struct request *); 18typedef void (elevator_completed_req_fn) (request_queue_t *, struct request *);
19typedef int (elevator_may_queue_fn) (request_queue_t *, int); 19typedef int (elevator_may_queue_fn) (request_queue_t *, int, struct bio *);
20 20
21typedef int (elevator_set_req_fn) (request_queue_t *, struct request *, int); 21typedef int (elevator_set_req_fn) (request_queue_t *, struct request *, struct bio *, int);
22typedef void (elevator_put_req_fn) (request_queue_t *, struct request *); 22typedef void (elevator_put_req_fn) (request_queue_t *, struct request *);
23typedef void (elevator_deactivate_req_fn) (request_queue_t *, struct request *); 23typedef void (elevator_deactivate_req_fn) (request_queue_t *, struct request *);
24 24
@@ -96,9 +96,9 @@ extern struct request *elv_former_request(request_queue_t *, struct request *);
96extern struct request *elv_latter_request(request_queue_t *, struct request *); 96extern struct request *elv_latter_request(request_queue_t *, struct request *);
97extern int elv_register_queue(request_queue_t *q); 97extern int elv_register_queue(request_queue_t *q);
98extern void elv_unregister_queue(request_queue_t *q); 98extern void elv_unregister_queue(request_queue_t *q);
99extern int elv_may_queue(request_queue_t *, int); 99extern int elv_may_queue(request_queue_t *, int, struct bio *);
100extern void elv_completed_request(request_queue_t *, struct request *); 100extern void elv_completed_request(request_queue_t *, struct request *);
101extern int elv_set_request(request_queue_t *, struct request *, int); 101extern int elv_set_request(request_queue_t *, struct request *, struct bio *, int);
102extern void elv_put_request(request_queue_t *, struct request *); 102extern void elv_put_request(request_queue_t *, struct request *);
103 103
104/* 104/*
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 3ae8e37bdfc..047bde30836 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -213,6 +213,7 @@ extern int dir_notify_enable;
213#include <linux/radix-tree.h> 213#include <linux/radix-tree.h>
214#include <linux/prio_tree.h> 214#include <linux/prio_tree.h>
215#include <linux/init.h> 215#include <linux/init.h>
216#include <linux/sched.h>
216 217
217#include <asm/atomic.h> 218#include <asm/atomic.h>
218#include <asm/semaphore.h> 219#include <asm/semaphore.h>
@@ -822,16 +823,34 @@ enum {
822#define vfs_check_frozen(sb, level) \ 823#define vfs_check_frozen(sb, level) \
823 wait_event((sb)->s_wait_unfrozen, ((sb)->s_frozen < (level))) 824 wait_event((sb)->s_wait_unfrozen, ((sb)->s_frozen < (level)))
824 825
826static inline void get_fs_excl(void)
827{
828 atomic_inc(&current->fs_excl);
829}
830
831static inline void put_fs_excl(void)
832{
833 atomic_dec(&current->fs_excl);
834}
835
836static inline int has_fs_excl(void)
837{
838 return atomic_read(&current->fs_excl);
839}
840
841
825/* 842/*
826 * Superblock locking. 843 * Superblock locking.
827 */ 844 */
828static inline void lock_super(struct super_block * sb) 845static inline void lock_super(struct super_block * sb)
829{ 846{
847 get_fs_excl();
830 down(&sb->s_lock); 848 down(&sb->s_lock);
831} 849}
832 850
833static inline void unlock_super(struct super_block * sb) 851static inline void unlock_super(struct super_block * sb)
834{ 852{
853 put_fs_excl();
835 up(&sb->s_lock); 854 up(&sb->s_lock);
836} 855}
837 856
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index 03206a425d7..c727c195a91 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -81,6 +81,7 @@ extern struct group_info init_groups;
81 .mm = NULL, \ 81 .mm = NULL, \
82 .active_mm = &init_mm, \ 82 .active_mm = &init_mm, \
83 .run_list = LIST_HEAD_INIT(tsk.run_list), \ 83 .run_list = LIST_HEAD_INIT(tsk.run_list), \
84 .ioprio = 0, \
84 .time_slice = HZ, \ 85 .time_slice = HZ, \
85 .tasks = LIST_HEAD_INIT(tsk.tasks), \ 86 .tasks = LIST_HEAD_INIT(tsk.tasks), \
86 .ptrace_children= LIST_HEAD_INIT(tsk.ptrace_children), \ 87 .ptrace_children= LIST_HEAD_INIT(tsk.ptrace_children), \
@@ -110,6 +111,7 @@ extern struct group_info init_groups;
110 .proc_lock = SPIN_LOCK_UNLOCKED, \ 111 .proc_lock = SPIN_LOCK_UNLOCKED, \
111 .journal_info = NULL, \ 112 .journal_info = NULL, \
112 .cpu_timers = INIT_CPU_TIMERS(tsk.cpu_timers), \ 113 .cpu_timers = INIT_CPU_TIMERS(tsk.cpu_timers), \
114 .fs_excl = ATOMIC_INIT(0), \
113} 115}
114 116
115 117
diff --git a/include/linux/input.h b/include/linux/input.h
index 9d9598ed760..b9cc0ac71f4 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -859,6 +859,10 @@ struct input_dev {
859 int (*erase_effect)(struct input_dev *dev, int effect_id); 859 int (*erase_effect)(struct input_dev *dev, int effect_id);
860 860
861 struct input_handle *grab; 861 struct input_handle *grab;
862
863 struct semaphore sem; /* serializes open and close operations */
864 unsigned int users;
865
862 struct device *dev; 866 struct device *dev;
863 867
864 struct list_head h_list; 868 struct list_head h_list;
diff --git a/include/linux/ioprio.h b/include/linux/ioprio.h
new file mode 100644
index 00000000000..8a453a0b5e4
--- /dev/null
+++ b/include/linux/ioprio.h
@@ -0,0 +1,88 @@
1#ifndef IOPRIO_H
2#define IOPRIO_H
3
4#include <linux/sched.h>
5
6/*
7 * Gives us 8 prio classes with 13-bits of data for each class
8 */
9#define IOPRIO_BITS (16)
10#define IOPRIO_CLASS_SHIFT (13)
11#define IOPRIO_PRIO_MASK ((1UL << IOPRIO_CLASS_SHIFT) - 1)
12
13#define IOPRIO_PRIO_CLASS(mask) ((mask) >> IOPRIO_CLASS_SHIFT)
14#define IOPRIO_PRIO_DATA(mask) ((mask) & IOPRIO_PRIO_MASK)
15#define IOPRIO_PRIO_VALUE(class, data) (((class) << IOPRIO_CLASS_SHIFT) | data)
16
17#define ioprio_valid(mask) (IOPRIO_PRIO_CLASS((mask)) != IOPRIO_CLASS_NONE)
18
19/*
20 * These are the io priority groups as implemented by CFQ. RT is the realtime
21 * class, it always gets premium service. BE is the best-effort scheduling
22 * class, the default for any process. IDLE is the idle scheduling class, it
23 * is only served when no one else is using the disk.
24 */
25enum {
26 IOPRIO_CLASS_NONE,
27 IOPRIO_CLASS_RT,
28 IOPRIO_CLASS_BE,
29 IOPRIO_CLASS_IDLE,
30};
31
32/*
33 * 8 best effort priority levels are supported
34 */
35#define IOPRIO_BE_NR (8)
36
37asmlinkage int sys_ioprio_set(int, int, int);
38asmlinkage int sys_ioprio_get(int, int);
39
40enum {
41 IOPRIO_WHO_PROCESS = 1,
42 IOPRIO_WHO_PGRP,
43 IOPRIO_WHO_USER,
44};
45
46/*
47 * if process has set io priority explicitly, use that. if not, convert
48 * the cpu scheduler nice value to an io priority
49 */
50#define IOPRIO_NORM (4)
51static inline int task_ioprio(struct task_struct *task)
52{
53 WARN_ON(!ioprio_valid(task->ioprio));
54 return IOPRIO_PRIO_DATA(task->ioprio);
55}
56
57static inline int task_nice_ioprio(struct task_struct *task)
58{
59 return (task_nice(task) + 20) / 5;
60}
61
62/*
63 * For inheritance, return the highest of the two given priorities
64 */
65static inline int ioprio_best(unsigned short aprio, unsigned short bprio)
66{
67 unsigned short aclass = IOPRIO_PRIO_CLASS(aprio);
68 unsigned short bclass = IOPRIO_PRIO_CLASS(bprio);
69
70 if (!ioprio_valid(aprio))
71 return bprio;
72 if (!ioprio_valid(bprio))
73 return aprio;
74
75 if (aclass == IOPRIO_CLASS_NONE)
76 aclass = IOPRIO_CLASS_BE;
77 if (bclass == IOPRIO_CLASS_NONE)
78 bclass = IOPRIO_CLASS_BE;
79
80 if (aclass == bclass)
81 return min(aprio, bprio);
82 if (aclass > bclass)
83 return bprio;
84 else
85 return aprio;
86}
87
88#endif
diff --git a/include/linux/joystick.h b/include/linux/joystick.h
index b7e0ab622cd..06b9af77eb7 100644
--- a/include/linux/joystick.h
+++ b/include/linux/joystick.h
@@ -111,18 +111,35 @@ struct js_corr {
111#define JS_SET_ALL 8 111#define JS_SET_ALL 8
112 112
113struct JS_DATA_TYPE { 113struct JS_DATA_TYPE {
114 int buttons; 114 __s32 buttons;
115 int x; 115 __s32 x;
116 int y; 116 __s32 y;
117}; 117};
118 118
119struct JS_DATA_SAVE_TYPE { 119struct JS_DATA_SAVE_TYPE_32 {
120 int JS_TIMEOUT; 120 __s32 JS_TIMEOUT;
121 int BUSY; 121 __s32 BUSY;
122 long JS_EXPIRETIME; 122 __s32 JS_EXPIRETIME;
123 long JS_TIMELIMIT; 123 __s32 JS_TIMELIMIT;
124 struct JS_DATA_TYPE JS_SAVE; 124 struct JS_DATA_TYPE JS_SAVE;
125 struct JS_DATA_TYPE JS_CORR; 125 struct JS_DATA_TYPE JS_CORR;
126}; 126};
127 127
128struct JS_DATA_SAVE_TYPE_64 {
129 __s32 JS_TIMEOUT;
130 __s32 BUSY;
131 __s64 JS_EXPIRETIME;
132 __s64 JS_TIMELIMIT;
133 struct JS_DATA_TYPE JS_SAVE;
134 struct JS_DATA_TYPE JS_CORR;
135};
136
137#if BITS_PER_LONG == 64
138#define JS_DATA_SAVE_TYPE JS_DATA_SAVE_TYPE_64
139#elif BITS_PER_LONG == 32
140#define JS_DATA_SAVE_TYPE JS_DATA_SAVE_TYPE_32
141#else
142#error Unexpected BITS_PER_LONG
143#endif
144
128#endif /* _LINUX_JOYSTICK_H */ 145#endif /* _LINUX_JOYSTICK_H */
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h
index 5e1a7b0d7b3..b7a194c4362 100644
--- a/include/linux/kprobes.h
+++ b/include/linux/kprobes.h
@@ -104,33 +104,12 @@ struct jprobe {
104}; 104};
105 105
106#ifdef ARCH_SUPPORTS_KRETPROBES 106#ifdef ARCH_SUPPORTS_KRETPROBES
107extern int trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs);
108extern void trampoline_post_handler(struct kprobe *p, struct pt_regs *regs,
109 unsigned long flags);
110extern struct task_struct *arch_get_kprobe_task(void *ptr);
111extern void arch_prepare_kretprobe(struct kretprobe *rp, struct pt_regs *regs); 107extern void arch_prepare_kretprobe(struct kretprobe *rp, struct pt_regs *regs);
112extern void arch_kprobe_flush_task(struct task_struct *tk);
113#else /* ARCH_SUPPORTS_KRETPROBES */ 108#else /* ARCH_SUPPORTS_KRETPROBES */
114static inline void kretprobe_trampoline(void)
115{
116}
117static inline int trampoline_probe_handler(struct kprobe *p,
118 struct pt_regs *regs)
119{
120 return 0;
121}
122static inline void trampoline_post_handler(struct kprobe *p,
123 struct pt_regs *regs, unsigned long flags)
124{
125}
126static inline void arch_prepare_kretprobe(struct kretprobe *rp, 109static inline void arch_prepare_kretprobe(struct kretprobe *rp,
127 struct pt_regs *regs) 110 struct pt_regs *regs)
128{ 111{
129} 112}
130static inline void arch_kprobe_flush_task(struct task_struct *tk)
131{
132}
133#define arch_get_kprobe_task(ptr) ((struct task_struct *)NULL)
134#endif /* ARCH_SUPPORTS_KRETPROBES */ 113#endif /* ARCH_SUPPORTS_KRETPROBES */
135/* 114/*
136 * Function-return probe - 115 * Function-return probe -
@@ -155,8 +134,8 @@ struct kretprobe_instance {
155 struct hlist_node uflist; /* either on free list or used list */ 134 struct hlist_node uflist; /* either on free list or used list */
156 struct hlist_node hlist; 135 struct hlist_node hlist;
157 struct kretprobe *rp; 136 struct kretprobe *rp;
158 void *ret_addr; 137 kprobe_opcode_t *ret_addr;
159 void *stack_addr; 138 struct task_struct *task;
160}; 139};
161 140
162#ifdef CONFIG_KPROBES 141#ifdef CONFIG_KPROBES
@@ -176,7 +155,10 @@ extern void arch_copy_kprobe(struct kprobe *p);
176extern void arch_arm_kprobe(struct kprobe *p); 155extern void arch_arm_kprobe(struct kprobe *p);
177extern void arch_disarm_kprobe(struct kprobe *p); 156extern void arch_disarm_kprobe(struct kprobe *p);
178extern void arch_remove_kprobe(struct kprobe *p); 157extern void arch_remove_kprobe(struct kprobe *p);
158extern int arch_init(void);
179extern void show_registers(struct pt_regs *regs); 159extern void show_registers(struct pt_regs *regs);
160extern kprobe_opcode_t *get_insn_slot(void);
161extern void free_insn_slot(kprobe_opcode_t *slot);
180 162
181/* Get the kprobe at this addr (if any). Must have called lock_kprobes */ 163/* Get the kprobe at this addr (if any). Must have called lock_kprobes */
182struct kprobe *get_kprobe(void *addr); 164struct kprobe *get_kprobe(void *addr);
@@ -194,8 +176,6 @@ int register_kretprobe(struct kretprobe *rp);
194void unregister_kretprobe(struct kretprobe *rp); 176void unregister_kretprobe(struct kretprobe *rp);
195 177
196struct kretprobe_instance *get_free_rp_inst(struct kretprobe *rp); 178struct kretprobe_instance *get_free_rp_inst(struct kretprobe *rp);
197struct kretprobe_instance *get_rp_inst(void *sara);
198struct kretprobe_instance *get_rp_inst_tsk(struct task_struct *tk);
199void add_rp_inst(struct kretprobe_instance *ri); 179void add_rp_inst(struct kretprobe_instance *ri);
200void kprobe_flush_task(struct task_struct *tk); 180void kprobe_flush_task(struct task_struct *tk);
201void recycle_rp_inst(struct kretprobe_instance *ri); 181void recycle_rp_inst(struct kretprobe_instance *ri);
diff --git a/include/linux/libps2.h b/include/linux/libps2.h
index 923bdbc6d9e..a710bddda4e 100644
--- a/include/linux/libps2.h
+++ b/include/linux/libps2.h
@@ -41,6 +41,7 @@ struct ps2dev {
41 41
42void ps2_init(struct ps2dev *ps2dev, struct serio *serio); 42void ps2_init(struct ps2dev *ps2dev, struct serio *serio);
43int ps2_sendbyte(struct ps2dev *ps2dev, unsigned char byte, int timeout); 43int ps2_sendbyte(struct ps2dev *ps2dev, unsigned char byte, int timeout);
44void ps2_drain(struct ps2dev *ps2dev, int maxbytes, int timeout);
44int ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command); 45int ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command);
45int ps2_schedule_command(struct ps2dev *ps2dev, unsigned char *param, int command); 46int ps2_schedule_command(struct ps2dev *ps2dev, unsigned char *param, int command);
46int ps2_handle_ack(struct ps2dev *ps2dev, unsigned char data); 47int ps2_handle_ack(struct ps2dev *ps2dev, unsigned char data);
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index d6eb7b2efc0..9b6d05172ed 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -175,4 +175,50 @@ struct serio_device_id {
175}; 175};
176 176
177 177
178/* PCMCIA */
179
180struct pcmcia_device_id {
181 __u16 match_flags;
182
183 __u16 manf_id;
184 __u16 card_id;
185
186 __u8 func_id;
187
188 /* for real multi-function devices */
189 __u8 function;
190
191 /* for pseude multi-function devices */
192 __u8 device_no;
193
194 __u32 prod_id_hash[4];
195
196 /* not matched against in kernelspace*/
197#ifdef __KERNEL__
198 const char * prod_id[4];
199#else
200 kernel_ulong_t prod_id[4];
201#endif
202
203 /* not matched against */
204 kernel_ulong_t driver_info;
205#ifdef __KERNEL__
206 char * cisfile;
207#else
208 kernel_ulong_t cisfile;
209#endif
210};
211
212#define PCMCIA_DEV_ID_MATCH_MANF_ID 0x0001
213#define PCMCIA_DEV_ID_MATCH_CARD_ID 0x0002
214#define PCMCIA_DEV_ID_MATCH_FUNC_ID 0x0004
215#define PCMCIA_DEV_ID_MATCH_FUNCTION 0x0008
216#define PCMCIA_DEV_ID_MATCH_PROD_ID1 0x0010
217#define PCMCIA_DEV_ID_MATCH_PROD_ID2 0x0020
218#define PCMCIA_DEV_ID_MATCH_PROD_ID3 0x0040
219#define PCMCIA_DEV_ID_MATCH_PROD_ID4 0x0080
220#define PCMCIA_DEV_ID_MATCH_DEVICE_NO 0x0100
221#define PCMCIA_DEV_ID_MATCH_FAKE_CIS 0x0200
222#define PCMCIA_DEV_ID_MATCH_ANONYMOUS 0x0400
223
178#endif /* LINUX_MOD_DEVICETABLE_H */ 224#endif /* LINUX_MOD_DEVICETABLE_H */
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 810bbbcee40..c3ee1ae4545 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -714,8 +714,9 @@
714#define PCI_DEVICE_ID_HP_DIVA_AUX 0x1290 714#define PCI_DEVICE_ID_HP_DIVA_AUX 0x1290
715#define PCI_DEVICE_ID_HP_DIVA_RMP3 0x1301 715#define PCI_DEVICE_ID_HP_DIVA_RMP3 0x1301
716#define PCI_DEVICE_ID_HP_CISSA 0x3220 716#define PCI_DEVICE_ID_HP_CISSA 0x3220
717#define PCI_DEVICE_ID_HP_CISSB 0x3230 717#define PCI_DEVICE_ID_HP_CISSB 0x3222
718#define PCI_DEVICE_ID_HP_ZX2_IOC 0x4031 718#define PCI_DEVICE_ID_HP_ZX2_IOC 0x4031
719#define PCI_DEVICE_ID_HP_CISSC 0x3230
719 720
720#define PCI_VENDOR_ID_PCTECH 0x1042 721#define PCI_VENDOR_ID_PCTECH 0x1042
721#define PCI_DEVICE_ID_PCTECH_RZ1000 0x1000 722#define PCI_DEVICE_ID_PCTECH_RZ1000 0x1000
@@ -1286,6 +1287,8 @@
1286#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_GO5700_2 0x0348 1287#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_GO5700_2 0x0348
1287#define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_GO1000 0x034C 1288#define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_GO1000 0x034C
1288#define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_1100 0x034E 1289#define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_1100 0x034E
1290#define PCI_DEVICE_ID_NVIDIA_NVENET_14 0x0372
1291#define PCI_DEVICE_ID_NVIDIA_NVENET_15 0x0373
1289 1292
1290#define PCI_VENDOR_ID_IMS 0x10e0 1293#define PCI_VENDOR_ID_IMS 0x10e0
1291#define PCI_DEVICE_ID_IMS_8849 0x8849 1294#define PCI_DEVICE_ID_IMS_8849 0x8849
@@ -1814,6 +1817,8 @@
1814#define PCI_VENDOR_ID_ITE 0x1283 1817#define PCI_VENDOR_ID_ITE 0x1283
1815#define PCI_DEVICE_ID_ITE_IT8172G 0x8172 1818#define PCI_DEVICE_ID_ITE_IT8172G 0x8172
1816#define PCI_DEVICE_ID_ITE_IT8172G_AUDIO 0x0801 1819#define PCI_DEVICE_ID_ITE_IT8172G_AUDIO 0x0801
1820#define PCI_DEVICE_ID_ITE_8211 0x8211
1821#define PCI_DEVICE_ID_ITE_8212 0x8212
1817#define PCI_DEVICE_ID_ITE_8872 0x8872 1822#define PCI_DEVICE_ID_ITE_8872 0x8872
1818#define PCI_DEVICE_ID_ITE_IT8330G_0 0xe886 1823#define PCI_DEVICE_ID_ITE_IT8330G_0 0xe886
1819 1824
diff --git a/include/linux/pmu.h b/include/linux/pmu.h
index 6d73eada277..373bd3b9b33 100644
--- a/include/linux/pmu.h
+++ b/include/linux/pmu.h
@@ -166,7 +166,7 @@ extern int pmu_i2c_simple_read(int bus, int addr, u8* data, int len);
166extern int pmu_i2c_simple_write(int bus, int addr, u8* data, int len); 166extern int pmu_i2c_simple_write(int bus, int addr, u8* data, int len);
167 167
168 168
169#ifdef CONFIG_PMAC_PBOOK 169#ifdef CONFIG_PM
170/* 170/*
171 * Stuff for putting the powerbook to sleep and waking it again. 171 * Stuff for putting the powerbook to sleep and waking it again.
172 * 172 *
@@ -208,6 +208,8 @@ struct pmu_sleep_notifier
208int pmu_register_sleep_notifier(struct pmu_sleep_notifier* notifier); 208int pmu_register_sleep_notifier(struct pmu_sleep_notifier* notifier);
209int pmu_unregister_sleep_notifier(struct pmu_sleep_notifier* notifier); 209int pmu_unregister_sleep_notifier(struct pmu_sleep_notifier* notifier);
210 210
211#endif /* CONFIG_PM */
212
211#define PMU_MAX_BATTERIES 2 213#define PMU_MAX_BATTERIES 2
212 214
213/* values for pmu_power_flags */ 215/* values for pmu_power_flags */
@@ -235,6 +237,4 @@ extern int pmu_battery_count;
235extern struct pmu_battery_info pmu_batteries[PMU_MAX_BATTERIES]; 237extern struct pmu_battery_info pmu_batteries[PMU_MAX_BATTERIES];
236extern unsigned int pmu_power_flags; 238extern unsigned int pmu_power_flags;
237 239
238#endif /* CONFIG_PMAC_PBOOK */
239
240#endif /* __KERNEL__ */ 240#endif /* __KERNEL__ */
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 9530b190316..ff48815bd3a 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -608,6 +608,8 @@ struct task_struct {
608 struct list_head run_list; 608 struct list_head run_list;
609 prio_array_t *array; 609 prio_array_t *array;
610 610
611 unsigned short ioprio;
612
611 unsigned long sleep_avg; 613 unsigned long sleep_avg;
612 unsigned long long timestamp, last_ran; 614 unsigned long long timestamp, last_ran;
613 unsigned long long sched_time; /* sched_clock time spent running */ 615 unsigned long long sched_time; /* sched_clock time spent running */
@@ -763,6 +765,7 @@ struct task_struct {
763 nodemask_t mems_allowed; 765 nodemask_t mems_allowed;
764 int cpuset_mems_generation; 766 int cpuset_mems_generation;
765#endif 767#endif
768 atomic_t fs_excl; /* holding fs exclusive resources */
766}; 769};
767 770
768static inline pid_t process_group(struct task_struct *tsk) 771static inline pid_t process_group(struct task_struct *tsk)
@@ -1112,7 +1115,8 @@ extern void unhash_process(struct task_struct *p);
1112 1115
1113/* 1116/*
1114 * Protects ->fs, ->files, ->mm, ->ptrace, ->group_info, ->comm, keyring 1117 * Protects ->fs, ->files, ->mm, ->ptrace, ->group_info, ->comm, keyring
1115 * subscriptions and synchronises with wait4(). Also used in procfs. 1118 * subscriptions and synchronises with wait4(). Also used in procfs. Also
1119 * pins the final release of task.io_context.
1116 * 1120 *
1117 * Nests both inside and outside of read_lock(&tasklist_lock). 1121 * Nests both inside and outside of read_lock(&tasklist_lock).
1118 * It must not be nested with write_lock_irq(&tasklist_lock), 1122 * It must not be nested with write_lock_irq(&tasklist_lock),
diff --git a/include/linux/seccomp.h b/include/linux/seccomp.h
index 3a2702bbb1d..dc89116bb1c 100644
--- a/include/linux/seccomp.h
+++ b/include/linux/seccomp.h
@@ -19,6 +19,11 @@ static inline void secure_computing(int this_syscall)
19 __secure_computing(this_syscall); 19 __secure_computing(this_syscall);
20} 20}
21 21
22static inline int has_secure_computing(struct thread_info *ti)
23{
24 return unlikely(test_ti_thread_flag(ti, TIF_SECCOMP));
25}
26
22#else /* CONFIG_SECCOMP */ 27#else /* CONFIG_SECCOMP */
23 28
24#if (__GNUC__ > 2) 29#if (__GNUC__ > 2)
@@ -28,6 +33,11 @@ static inline void secure_computing(int this_syscall)
28#endif 33#endif
29 34
30#define secure_computing(x) do { } while (0) 35#define secure_computing(x) do { } while (0)
36/* static inline to preserve typechecking */
37static inline int has_secure_computing(struct thread_info *ti)
38{
39 return 0;
40}
31 41
32#endif /* CONFIG_SECCOMP */ 42#endif /* CONFIG_SECCOMP */
33 43
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
index 823181af6dd..3e3c1fa35b0 100644
--- a/include/linux/serial_8250.h
+++ b/include/linux/serial_8250.h
@@ -22,6 +22,7 @@ struct plat_serial8250_port {
22 unsigned int uartclk; /* UART clock rate */ 22 unsigned int uartclk; /* UART clock rate */
23 unsigned char regshift; /* register shift */ 23 unsigned char regshift; /* register shift */
24 unsigned char iotype; /* UPIO_* */ 24 unsigned char iotype; /* UPIO_* */
25 unsigned char hub6;
25 unsigned int flags; /* UPF_* flags */ 26 unsigned int flags; /* UPF_* flags */
26}; 27};
27 28
diff --git a/include/linux/serio.h b/include/linux/serio.h
index a2d3b9ae06f..aa4d6493a03 100644
--- a/include/linux/serio.h
+++ b/include/linux/serio.h
@@ -83,6 +83,7 @@ static inline void serio_register_port(struct serio *serio)
83} 83}
84 84
85void serio_unregister_port(struct serio *serio); 85void serio_unregister_port(struct serio *serio);
86void serio_unregister_child_port(struct serio *serio);
86void __serio_unregister_port_delayed(struct serio *serio, struct module *owner); 87void __serio_unregister_port_delayed(struct serio *serio, struct module *owner);
87static inline void serio_unregister_port_delayed(struct serio *serio) 88static inline void serio_unregister_port_delayed(struct serio *serio)
88{ 89{
@@ -153,6 +154,11 @@ static inline int serio_pin_driver(struct serio *serio)
153 return down_interruptible(&serio->drv_sem); 154 return down_interruptible(&serio->drv_sem);
154} 155}
155 156
157static inline void serio_pin_driver_uninterruptible(struct serio *serio)
158{
159 down(&serio->drv_sem);
160}
161
156static inline void serio_unpin_driver(struct serio *serio) 162static inline void serio_unpin_driver(struct serio *serio)
157{ 163{
158 up(&serio->drv_sem); 164 up(&serio->drv_sem);
diff --git a/include/linux/usb_ch9.h b/include/linux/usb_ch9.h
index f5fe94e09a0..39e7ff4ffd2 100644
--- a/include/linux/usb_ch9.h
+++ b/include/linux/usb_ch9.h
@@ -6,11 +6,14 @@
6 * 6 *
7 * - the master/host side Linux-USB kernel driver API; 7 * - the master/host side Linux-USB kernel driver API;
8 * - the "usbfs" user space API; and 8 * - the "usbfs" user space API; and
9 * - (eventually) a Linux "gadget" slave/device side driver API. 9 * - the Linux "gadget" slave/device/peripheral side driver API.
10 * 10 *
11 * USB 2.0 adds an additional "On The Go" (OTG) mode, which lets systems 11 * USB 2.0 adds an additional "On The Go" (OTG) mode, which lets systems
12 * act either as a USB master/host or as a USB slave/device. That means 12 * act either as a USB master/host or as a USB slave/device. That means
13 * the master and slave side APIs will benefit from working well together. 13 * the master and slave side APIs benefit from working well together.
14 *
15 * There's also "Wireless USB", using low power short range radios for
16 * peripheral interconnection but otherwise building on the USB framework.
14 */ 17 */
15 18
16#ifndef __LINUX_USB_CH9_H 19#ifndef __LINUX_USB_CH9_H
@@ -68,6 +71,18 @@
68#define USB_REQ_SET_INTERFACE 0x0B 71#define USB_REQ_SET_INTERFACE 0x0B
69#define USB_REQ_SYNCH_FRAME 0x0C 72#define USB_REQ_SYNCH_FRAME 0x0C
70 73
74#define USB_REQ_SET_ENCRYPTION 0x0D /* Wireless USB */
75#define USB_REQ_GET_ENCRYPTION 0x0E
76#define USB_REQ_SET_HANDSHAKE 0x0F
77#define USB_REQ_GET_HANDSHAKE 0x10
78#define USB_REQ_SET_CONNECTION 0x11
79#define USB_REQ_SET_SECURITY_DATA 0x12
80#define USB_REQ_GET_SECURITY_DATA 0x13
81#define USB_REQ_SET_WUSB_DATA 0x14
82#define USB_REQ_LOOPBACK_DATA_WRITE 0x15
83#define USB_REQ_LOOPBACK_DATA_READ 0x16
84#define USB_REQ_SET_INTERFACE_DS 0x17
85
71/* 86/*
72 * USB feature flags are written using USB_REQ_{CLEAR,SET}_FEATURE, and 87 * USB feature flags are written using USB_REQ_{CLEAR,SET}_FEATURE, and
73 * are read as a bit array returned by USB_REQ_GET_STATUS. (So there 88 * are read as a bit array returned by USB_REQ_GET_STATUS. (So there
@@ -75,10 +90,12 @@
75 */ 90 */
76#define USB_DEVICE_SELF_POWERED 0 /* (read only) */ 91#define USB_DEVICE_SELF_POWERED 0 /* (read only) */
77#define USB_DEVICE_REMOTE_WAKEUP 1 /* dev may initiate wakeup */ 92#define USB_DEVICE_REMOTE_WAKEUP 1 /* dev may initiate wakeup */
78#define USB_DEVICE_TEST_MODE 2 /* (high speed only) */ 93#define USB_DEVICE_TEST_MODE 2 /* (wired high speed only) */
79#define USB_DEVICE_B_HNP_ENABLE 3 /* dev may initiate HNP */ 94#define USB_DEVICE_BATTERY 2 /* (wireless) */
80#define USB_DEVICE_A_HNP_SUPPORT 4 /* RH port supports HNP */ 95#define USB_DEVICE_B_HNP_ENABLE 3 /* (otg) dev may initiate HNP */
81#define USB_DEVICE_A_ALT_HNP_SUPPORT 5 /* other RH port does */ 96#define USB_DEVICE_WUSB_DEVICE 3 /* (wireless)*/
97#define USB_DEVICE_A_HNP_SUPPORT 4 /* (otg) RH port supports HNP */
98#define USB_DEVICE_A_ALT_HNP_SUPPORT 5 /* (otg) other RH port does */
82#define USB_DEVICE_DEBUG_MODE 6 /* (special devices only) */ 99#define USB_DEVICE_DEBUG_MODE 6 /* (special devices only) */
83 100
84#define USB_ENDPOINT_HALT 0 /* IN/OUT will STALL */ 101#define USB_ENDPOINT_HALT 0 /* IN/OUT will STALL */
@@ -135,6 +152,13 @@ struct usb_ctrlrequest {
135#define USB_DT_OTG 0x09 152#define USB_DT_OTG 0x09
136#define USB_DT_DEBUG 0x0a 153#define USB_DT_DEBUG 0x0a
137#define USB_DT_INTERFACE_ASSOCIATION 0x0b 154#define USB_DT_INTERFACE_ASSOCIATION 0x0b
155/* these are from the Wireless USB spec */
156#define USB_DT_SECURITY 0x0c
157#define USB_DT_KEY 0x0d
158#define USB_DT_ENCRYPTION_TYPE 0x0e
159#define USB_DT_BOS 0x0f
160#define USB_DT_DEVICE_CAPABILITY 0x10
161#define USB_DT_WIRELESS_ENDPOINT_COMP 0x11
138 162
139/* conventional codes for class-specific descriptors */ 163/* conventional codes for class-specific descriptors */
140#define USB_DT_CS_DEVICE 0x21 164#define USB_DT_CS_DEVICE 0x21
@@ -192,6 +216,7 @@ struct usb_device_descriptor {
192#define USB_CLASS_CSCID 0x0b /* chip+ smart card */ 216#define USB_CLASS_CSCID 0x0b /* chip+ smart card */
193#define USB_CLASS_CONTENT_SEC 0x0d /* content security */ 217#define USB_CLASS_CONTENT_SEC 0x0d /* content security */
194#define USB_CLASS_VIDEO 0x0e 218#define USB_CLASS_VIDEO 0x0e
219#define USB_CLASS_WIRELESS_CONTROLLER 0xe0
195#define USB_CLASS_APP_SPEC 0xfe 220#define USB_CLASS_APP_SPEC 0xfe
196#define USB_CLASS_VENDOR_SPEC 0xff 221#define USB_CLASS_VENDOR_SPEC 0xff
197 222
@@ -223,6 +248,7 @@ struct usb_config_descriptor {
223#define USB_CONFIG_ATT_ONE (1 << 7) /* must be set */ 248#define USB_CONFIG_ATT_ONE (1 << 7) /* must be set */
224#define USB_CONFIG_ATT_SELFPOWER (1 << 6) /* self powered */ 249#define USB_CONFIG_ATT_SELFPOWER (1 << 6) /* self powered */
225#define USB_CONFIG_ATT_WAKEUP (1 << 5) /* can wakeup */ 250#define USB_CONFIG_ATT_WAKEUP (1 << 5) /* can wakeup */
251#define USB_CONFIG_ATT_BATTERY (1 << 4) /* battery powered */
226 252
227/*-------------------------------------------------------------------------*/ 253/*-------------------------------------------------------------------------*/
228 254
@@ -289,6 +315,7 @@ struct usb_endpoint_descriptor {
289#define USB_ENDPOINT_XFER_ISOC 1 315#define USB_ENDPOINT_XFER_ISOC 1
290#define USB_ENDPOINT_XFER_BULK 2 316#define USB_ENDPOINT_XFER_BULK 2
291#define USB_ENDPOINT_XFER_INT 3 317#define USB_ENDPOINT_XFER_INT 3
318#define USB_ENDPOINT_MAX_ADJUSTABLE 0x80
292 319
293 320
294/*-------------------------------------------------------------------------*/ 321/*-------------------------------------------------------------------------*/
@@ -352,12 +379,154 @@ struct usb_interface_assoc_descriptor {
352 379
353/*-------------------------------------------------------------------------*/ 380/*-------------------------------------------------------------------------*/
354 381
382/* USB_DT_SECURITY: group of wireless security descriptors, including
383 * encryption types available for setting up a CC/association.
384 */
385struct usb_security_descriptor {
386 __u8 bLength;
387 __u8 bDescriptorType;
388
389 __le16 wTotalLength;
390 __u8 bNumEncryptionTypes;
391};
392
393/*-------------------------------------------------------------------------*/
394
395/* USB_DT_KEY: used with {GET,SET}_SECURITY_DATA; only public keys
396 * may be retrieved.
397 */
398struct usb_key_descriptor {
399 __u8 bLength;
400 __u8 bDescriptorType;
401
402 __u8 tTKID[3];
403 __u8 bReserved;
404 __u8 bKeyData[0];
405};
406
407/*-------------------------------------------------------------------------*/
408
409/* USB_DT_ENCRYPTION_TYPE: bundled in DT_SECURITY groups */
410struct usb_encryption_descriptor {
411 __u8 bLength;
412 __u8 bDescriptorType;
413
414 __u8 bEncryptionType;
415#define USB_ENC_TYPE_UNSECURE 0
416#define USB_ENC_TYPE_WIRED 1 /* non-wireless mode */
417#define USB_ENC_TYPE_CCM_1 2 /* aes128/cbc session */
418#define USB_ENC_TYPE_RSA_1 3 /* rsa3072/sha1 auth */
419 __u8 bEncryptionValue; /* use in SET_ENCRYPTION */
420 __u8 bAuthKeyIndex;
421};
422
423
424/*-------------------------------------------------------------------------*/
425
426/* USB_DT_BOS: group of wireless capabilities */
427struct usb_bos_descriptor {
428 __u8 bLength;
429 __u8 bDescriptorType;
430
431 __le16 wTotalLength;
432 __u8 bNumDeviceCaps;
433};
434
435/*-------------------------------------------------------------------------*/
436
437/* USB_DT_DEVICE_CAPABILITY: grouped with BOS */
438struct usb_dev_cap_header {
439 __u8 bLength;
440 __u8 bDescriptorType;
441 __u8 bDevCapabilityType;
442};
443
444#define USB_CAP_TYPE_WIRELESS_USB 1
445
446struct usb_wireless_cap_descriptor { /* Ultra Wide Band */
447 __u8 bLength;
448 __u8 bDescriptorType;
449 __u8 bDevCapabilityType;
450
451 __u8 bmAttributes;
452#define USB_WIRELESS_P2P_DRD (1 << 1)
453#define USB_WIRELESS_BEACON_MASK (3 << 2)
454#define USB_WIRELESS_BEACON_SELF (1 << 2)
455#define USB_WIRELESS_BEACON_DIRECTED (2 << 2)
456#define USB_WIRELESS_BEACON_NONE (3 << 2)
457 __le16 wPHYRates; /* bit rates, Mbps */
458#define USB_WIRELESS_PHY_53 (1 << 0) /* always set */
459#define USB_WIRELESS_PHY_80 (1 << 1)
460#define USB_WIRELESS_PHY_107 (1 << 2) /* always set */
461#define USB_WIRELESS_PHY_160 (1 << 3)
462#define USB_WIRELESS_PHY_200 (1 << 4) /* always set */
463#define USB_WIRELESS_PHY_320 (1 << 5)
464#define USB_WIRELESS_PHY_400 (1 << 6)
465#define USB_WIRELESS_PHY_480 (1 << 7)
466 __u8 bmTFITXPowerInfo; /* TFI power levels */
467 __u8 bmFFITXPowerInfo; /* FFI power levels */
468 __le16 bmBandGroup;
469 __u8 bReserved;
470};
471
472/*-------------------------------------------------------------------------*/
473
474/* USB_DT_WIRELESS_ENDPOINT_COMP: companion descriptor associated with
475 * each endpoint descriptor for a wireless device
476 */
477struct usb_wireless_ep_comp_descriptor {
478 __u8 bLength;
479 __u8 bDescriptorType;
480
481 __u8 bMaxBurst;
482 __u8 bMaxSequence;
483 __le16 wMaxStreamDelay;
484 __le16 wOverTheAirPacketSize;
485 __u8 bOverTheAirInterval;
486 __u8 bmCompAttributes;
487#define USB_ENDPOINT_SWITCH_MASK 0x03 /* in bmCompAttributes */
488#define USB_ENDPOINT_SWITCH_NO 0
489#define USB_ENDPOINT_SWITCH_SWITCH 1
490#define USB_ENDPOINT_SWITCH_SCALE 2
491};
492
493/*-------------------------------------------------------------------------*/
494
495/* USB_REQ_SET_HANDSHAKE is a four-way handshake used between a wireless
496 * host and a device for connection set up, mutual authentication, and
497 * exchanging short lived session keys. The handshake depends on a CC.
498 */
499struct usb_handshake {
500 __u8 bMessageNumber;
501 __u8 bStatus;
502 __u8 tTKID[3];
503 __u8 bReserved;
504 __u8 CDID[16];
505 __u8 nonce[16];
506 __u8 MIC[8];
507};
508
509/*-------------------------------------------------------------------------*/
510
511/* USB_REQ_SET_CONNECTION modifies or revokes a connection context (CC).
512 * A CC may also be set up using non-wireless secure channels (including
513 * wired USB!), and some devices may support CCs with multiple hosts.
514 */
515struct usb_connection_context {
516 __u8 CHID[16]; /* persistent host id */
517 __u8 CDID[16]; /* device id (unique w/in host context) */
518 __u8 CK[16]; /* connection key */
519};
520
521/*-------------------------------------------------------------------------*/
522
355/* USB 2.0 defines three speeds, here's how Linux identifies them */ 523/* USB 2.0 defines three speeds, here's how Linux identifies them */
356 524
357enum usb_device_speed { 525enum usb_device_speed {
358 USB_SPEED_UNKNOWN = 0, /* enumerating */ 526 USB_SPEED_UNKNOWN = 0, /* enumerating */
359 USB_SPEED_LOW, USB_SPEED_FULL, /* usb 1.1 */ 527 USB_SPEED_LOW, USB_SPEED_FULL, /* usb 1.1 */
360 USB_SPEED_HIGH /* usb 2.0 */ 528 USB_SPEED_HIGH, /* usb 2.0 */
529 USB_SPEED_VARIABLE, /* wireless (usb 2.5) */
361}; 530};
362 531
363enum usb_device_state { 532enum usb_device_state {
diff --git a/include/linux/usb_gadget.h b/include/linux/usb_gadget.h
index 9bba9997947..b00f127cb44 100644
--- a/include/linux/usb_gadget.h
+++ b/include/linux/usb_gadget.h
@@ -711,7 +711,7 @@ usb_gadget_disconnect (struct usb_gadget *gadget)
711 * the hardware level driver. Most calls must be handled by 711 * the hardware level driver. Most calls must be handled by
712 * the gadget driver, including descriptor and configuration 712 * the gadget driver, including descriptor and configuration
713 * management. The 16 bit members of the setup data are in 713 * management. The 16 bit members of the setup data are in
714 * cpu order. Called in_interrupt; this may not sleep. Driver 714 * USB byte order. Called in_interrupt; this may not sleep. Driver
715 * queues a response to ep0, or returns negative to stall. 715 * queues a response to ep0, or returns negative to stall.
716 * @disconnect: Invoked after all transfers have been stopped, 716 * @disconnect: Invoked after all transfers have been stopped,
717 * when the host is disconnected. May be called in_interrupt; this 717 * when the host is disconnected. May be called in_interrupt; this
diff --git a/include/linux/usb_isp116x.h b/include/linux/usb_isp116x.h
new file mode 100644
index 00000000000..5f5a9d9bd6c
--- /dev/null
+++ b/include/linux/usb_isp116x.h
@@ -0,0 +1,47 @@
1
2/*
3 * Board initialization code should put one of these into dev->platform_data
4 * and place the isp116x onto platform_bus.
5 */
6
7struct isp116x_platform_data {
8 /* Enable internal resistors on downstream ports */
9 unsigned sel15Kres:1;
10 /* Chip's internal clock won't be stopped in suspended state.
11 Setting/unsetting this bit takes effect only if
12 'remote_wakeup_enable' below is not set. */
13 unsigned clknotstop:1;
14 /* On-chip overcurrent protection */
15 unsigned oc_enable:1;
16 /* INT output polarity */
17 unsigned int_act_high:1;
18 /* INT edge or level triggered */
19 unsigned int_edge_triggered:1;
20 /* WAKEUP pin connected - NOT SUPPORTED */
21 /* unsigned remote_wakeup_connected:1; */
22 /* Wakeup by devices on usb bus enabled */
23 unsigned remote_wakeup_enable:1;
24 /* Switch or not to switch (keep always powered) */
25 unsigned no_power_switching:1;
26 /* Ganged port power switching (0) or individual port
27 power switching (1) */
28 unsigned power_switching_mode:1;
29 /* Given port_power, msec/2 after power on till power good */
30 u8 potpg;
31 /* Hardware reset set/clear. If implemented, this function must:
32 if set == 0, deassert chip's HW reset pin
33 otherwise, assert chip's HW reset pin */
34 void (*reset) (struct device * dev, int set);
35 /* Hardware clock start/stop. If implemented, this function must:
36 if start == 0, stop the external clock
37 otherwise, start the external clock
38 */
39 void (*clock) (struct device * dev, int start);
40 /* Inter-io delay (ns). The chip is picky about access timings; it
41 expects at least:
42 150ns delay between consecutive accesses to DATA_REG,
43 300ns delay between access to ADDR_REG and DATA_REG
44 OE, WE MUST NOT be changed during these intervals
45 */
46 void (*delay) (struct device * dev, int delay);
47};
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index 1262cb43c3a..d5c3fe1bf33 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -14,11 +14,13 @@ extern struct list_head inode_unused;
14 * Yes, writeback.h requires sched.h 14 * Yes, writeback.h requires sched.h
15 * No, sched.h is not included from here. 15 * No, sched.h is not included from here.
16 */ 16 */
17static inline int current_is_pdflush(void) 17static inline int task_is_pdflush(struct task_struct *task)
18{ 18{
19 return current->flags & PF_FLUSHER; 19 return task->flags & PF_FLUSHER;
20} 20}
21 21
22#define current_is_pdflush() task_is_pdflush(current)
23
22/* 24/*
23 * fs/fs-writeback.c 25 * fs/fs-writeback.c
24 */ 26 */
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h
new file mode 100644
index 00000000000..7fe57f957a5
--- /dev/null
+++ b/include/net/ieee80211.h
@@ -0,0 +1,882 @@
1/*
2 * Merged with mainline ieee80211.h in Aug 2004. Original ieee802_11
3 * remains copyright by the original authors
4 *
5 * Portions of the merged code are based on Host AP (software wireless
6 * LAN access point) driver for Intersil Prism2/2.5/3.
7 *
8 * Copyright (c) 2001-2002, SSH Communications Security Corp and Jouni Malinen
9 * <jkmaline@cc.hut.fi>
10 * Copyright (c) 2002-2003, Jouni Malinen <jkmaline@cc.hut.fi>
11 *
12 * Adaption to a generic IEEE 802.11 stack by James Ketrenos
13 * <jketreno@linux.intel.com>
14 * Copyright (c) 2004, Intel Corporation
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License version 2 as
18 * published by the Free Software Foundation. See README and COPYING for
19 * more details.
20 */
21#ifndef IEEE80211_H
22#define IEEE80211_H
23
24#include <linux/if_ether.h> /* ETH_ALEN */
25#include <linux/kernel.h> /* ARRAY_SIZE */
26
27#if WIRELESS_EXT < 17
28#define IW_QUAL_QUAL_INVALID 0x10
29#define IW_QUAL_LEVEL_INVALID 0x20
30#define IW_QUAL_NOISE_INVALID 0x40
31#define IW_QUAL_QUAL_UPDATED 0x1
32#define IW_QUAL_LEVEL_UPDATED 0x2
33#define IW_QUAL_NOISE_UPDATED 0x4
34#endif
35
36#define IEEE80211_DATA_LEN 2304
37/* Maximum size for the MA-UNITDATA primitive, 802.11 standard section
38 6.2.1.1.2.
39
40 The figure in section 7.1.2 suggests a body size of up to 2312
41 bytes is allowed, which is a bit confusing, I suspect this
42 represents the 2304 bytes of real data, plus a possible 8 bytes of
43 WEP IV and ICV. (this interpretation suggested by Ramiro Barreiro) */
44
45
46#define IEEE80211_HLEN 30
47#define IEEE80211_FRAME_LEN (IEEE80211_DATA_LEN + IEEE80211_HLEN)
48
49struct ieee80211_hdr {
50 u16 frame_ctl;
51 u16 duration_id;
52 u8 addr1[ETH_ALEN];
53 u8 addr2[ETH_ALEN];
54 u8 addr3[ETH_ALEN];
55 u16 seq_ctl;
56 u8 addr4[ETH_ALEN];
57} __attribute__ ((packed));
58
59struct ieee80211_hdr_3addr {
60 u16 frame_ctl;
61 u16 duration_id;
62 u8 addr1[ETH_ALEN];
63 u8 addr2[ETH_ALEN];
64 u8 addr3[ETH_ALEN];
65 u16 seq_ctl;
66} __attribute__ ((packed));
67
68enum eap_type {
69 EAP_PACKET = 0,
70 EAPOL_START,
71 EAPOL_LOGOFF,
72 EAPOL_KEY,
73 EAPOL_ENCAP_ASF_ALERT
74};
75
76static const char *eap_types[] = {
77 [EAP_PACKET] = "EAP-Packet",
78 [EAPOL_START] = "EAPOL-Start",
79 [EAPOL_LOGOFF] = "EAPOL-Logoff",
80 [EAPOL_KEY] = "EAPOL-Key",
81 [EAPOL_ENCAP_ASF_ALERT] = "EAPOL-Encap-ASF-Alert"
82};
83
84static inline const char *eap_get_type(int type)
85{
86 return (type >= ARRAY_SIZE(eap_types)) ? "Unknown" : eap_types[type];
87}
88
89struct eapol {
90 u8 snap[6];
91 u16 ethertype;
92 u8 version;
93 u8 type;
94 u16 length;
95} __attribute__ ((packed));
96
97#define IEEE80211_3ADDR_LEN 24
98#define IEEE80211_4ADDR_LEN 30
99#define IEEE80211_FCS_LEN 4
100
101#define MIN_FRAG_THRESHOLD 256U
102#define MAX_FRAG_THRESHOLD 2346U
103
104/* Frame control field constants */
105#define IEEE80211_FCTL_VERS 0x0002
106#define IEEE80211_FCTL_FTYPE 0x000c
107#define IEEE80211_FCTL_STYPE 0x00f0
108#define IEEE80211_FCTL_TODS 0x0100
109#define IEEE80211_FCTL_FROMDS 0x0200
110#define IEEE80211_FCTL_MOREFRAGS 0x0400
111#define IEEE80211_FCTL_RETRY 0x0800
112#define IEEE80211_FCTL_PM 0x1000
113#define IEEE80211_FCTL_MOREDATA 0x2000
114#define IEEE80211_FCTL_WEP 0x4000
115#define IEEE80211_FCTL_ORDER 0x8000
116
117#define IEEE80211_FTYPE_MGMT 0x0000
118#define IEEE80211_FTYPE_CTL 0x0004
119#define IEEE80211_FTYPE_DATA 0x0008
120
121/* management */
122#define IEEE80211_STYPE_ASSOC_REQ 0x0000
123#define IEEE80211_STYPE_ASSOC_RESP 0x0010
124#define IEEE80211_STYPE_REASSOC_REQ 0x0020
125#define IEEE80211_STYPE_REASSOC_RESP 0x0030
126#define IEEE80211_STYPE_PROBE_REQ 0x0040
127#define IEEE80211_STYPE_PROBE_RESP 0x0050
128#define IEEE80211_STYPE_BEACON 0x0080
129#define IEEE80211_STYPE_ATIM 0x0090
130#define IEEE80211_STYPE_DISASSOC 0x00A0
131#define IEEE80211_STYPE_AUTH 0x00B0
132#define IEEE80211_STYPE_DEAUTH 0x00C0
133
134/* control */
135#define IEEE80211_STYPE_PSPOLL 0x00A0
136#define IEEE80211_STYPE_RTS 0x00B0
137#define IEEE80211_STYPE_CTS 0x00C0
138#define IEEE80211_STYPE_ACK 0x00D0
139#define IEEE80211_STYPE_CFEND 0x00E0
140#define IEEE80211_STYPE_CFENDACK 0x00F0
141
142/* data */
143#define IEEE80211_STYPE_DATA 0x0000
144#define IEEE80211_STYPE_DATA_CFACK 0x0010
145#define IEEE80211_STYPE_DATA_CFPOLL 0x0020
146#define IEEE80211_STYPE_DATA_CFACKPOLL 0x0030
147#define IEEE80211_STYPE_NULLFUNC 0x0040
148#define IEEE80211_STYPE_CFACK 0x0050
149#define IEEE80211_STYPE_CFPOLL 0x0060
150#define IEEE80211_STYPE_CFACKPOLL 0x0070
151
152#define IEEE80211_SCTL_FRAG 0x000F
153#define IEEE80211_SCTL_SEQ 0xFFF0
154
155
156/* debug macros */
157
158#ifdef CONFIG_IEEE80211_DEBUG
159extern u32 ieee80211_debug_level;
160#define IEEE80211_DEBUG(level, fmt, args...) \
161do { if (ieee80211_debug_level & (level)) \
162 printk(KERN_DEBUG "ieee80211: %c %s " fmt, \
163 in_interrupt() ? 'I' : 'U', __FUNCTION__ , ## args); } while (0)
164#else
165#define IEEE80211_DEBUG(level, fmt, args...) do {} while (0)
166#endif /* CONFIG_IEEE80211_DEBUG */
167
168/*
169 * To use the debug system;
170 *
171 * If you are defining a new debug classification, simply add it to the #define
172 * list here in the form of:
173 *
174 * #define IEEE80211_DL_xxxx VALUE
175 *
176 * shifting value to the left one bit from the previous entry. xxxx should be
177 * the name of the classification (for example, WEP)
178 *
179 * You then need to either add a IEEE80211_xxxx_DEBUG() macro definition for your
180 * classification, or use IEEE80211_DEBUG(IEEE80211_DL_xxxx, ...) whenever you want
181 * to send output to that classification.
182 *
183 * To add your debug level to the list of levels seen when you perform
184 *
185 * % cat /proc/net/ipw/debug_level
186 *
187 * you simply need to add your entry to the ipw_debug_levels array.
188 *
189 * If you do not see debug_level in /proc/net/ipw then you do not have
190 * CONFIG_IEEE80211_DEBUG defined in your kernel configuration
191 *
192 */
193
194#define IEEE80211_DL_INFO (1<<0)
195#define IEEE80211_DL_WX (1<<1)
196#define IEEE80211_DL_SCAN (1<<2)
197#define IEEE80211_DL_STATE (1<<3)
198#define IEEE80211_DL_MGMT (1<<4)
199#define IEEE80211_DL_FRAG (1<<5)
200#define IEEE80211_DL_EAP (1<<6)
201#define IEEE80211_DL_DROP (1<<7)
202
203#define IEEE80211_DL_TX (1<<8)
204#define IEEE80211_DL_RX (1<<9)
205
206#define IEEE80211_ERROR(f, a...) printk(KERN_ERR "ieee80211: " f, ## a)
207#define IEEE80211_WARNING(f, a...) printk(KERN_WARNING "ieee80211: " f, ## a)
208#define IEEE80211_DEBUG_INFO(f, a...) IEEE80211_DEBUG(IEEE80211_DL_INFO, f, ## a)
209
210#define IEEE80211_DEBUG_WX(f, a...) IEEE80211_DEBUG(IEEE80211_DL_WX, f, ## a)
211#define IEEE80211_DEBUG_SCAN(f, a...) IEEE80211_DEBUG(IEEE80211_DL_SCAN, f, ## a)
212#define IEEE80211_DEBUG_STATE(f, a...) IEEE80211_DEBUG(IEEE80211_DL_STATE, f, ## a)
213#define IEEE80211_DEBUG_MGMT(f, a...) IEEE80211_DEBUG(IEEE80211_DL_MGMT, f, ## a)
214#define IEEE80211_DEBUG_FRAG(f, a...) IEEE80211_DEBUG(IEEE80211_DL_FRAG, f, ## a)
215#define IEEE80211_DEBUG_EAP(f, a...) IEEE80211_DEBUG(IEEE80211_DL_EAP, f, ## a)
216#define IEEE80211_DEBUG_DROP(f, a...) IEEE80211_DEBUG(IEEE80211_DL_DROP, f, ## a)
217#define IEEE80211_DEBUG_TX(f, a...) IEEE80211_DEBUG(IEEE80211_DL_TX, f, ## a)
218#define IEEE80211_DEBUG_RX(f, a...) IEEE80211_DEBUG(IEEE80211_DL_RX, f, ## a)
219#include <linux/netdevice.h>
220#include <linux/wireless.h>
221#include <linux/if_arp.h> /* ARPHRD_ETHER */
222
223#ifndef WIRELESS_SPY
224#define WIRELESS_SPY // enable iwspy support
225#endif
226#include <net/iw_handler.h> // new driver API
227
228#ifndef ETH_P_PAE
229#define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */
230#endif /* ETH_P_PAE */
231
232#define ETH_P_PREAUTH 0x88C7 /* IEEE 802.11i pre-authentication */
233
234#ifndef ETH_P_80211_RAW
235#define ETH_P_80211_RAW (ETH_P_ECONET + 1)
236#endif
237
238/* IEEE 802.11 defines */
239
240#define P80211_OUI_LEN 3
241
242struct ieee80211_snap_hdr {
243
244 u8 dsap; /* always 0xAA */
245 u8 ssap; /* always 0xAA */
246 u8 ctrl; /* always 0x03 */
247 u8 oui[P80211_OUI_LEN]; /* organizational universal id */
248
249} __attribute__ ((packed));
250
251#define SNAP_SIZE sizeof(struct ieee80211_snap_hdr)
252
253#define WLAN_FC_GET_TYPE(fc) ((fc) & IEEE80211_FCTL_FTYPE)
254#define WLAN_FC_GET_STYPE(fc) ((fc) & IEEE80211_FCTL_STYPE)
255
256#define WLAN_GET_SEQ_FRAG(seq) ((seq) & IEEE80211_SCTL_FRAG)
257#define WLAN_GET_SEQ_SEQ(seq) ((seq) & IEEE80211_SCTL_SEQ)
258
259/* Authentication algorithms */
260#define WLAN_AUTH_OPEN 0
261#define WLAN_AUTH_SHARED_KEY 1
262
263#define WLAN_AUTH_CHALLENGE_LEN 128
264
265#define WLAN_CAPABILITY_BSS (1<<0)
266#define WLAN_CAPABILITY_IBSS (1<<1)
267#define WLAN_CAPABILITY_CF_POLLABLE (1<<2)
268#define WLAN_CAPABILITY_CF_POLL_REQUEST (1<<3)
269#define WLAN_CAPABILITY_PRIVACY (1<<4)
270#define WLAN_CAPABILITY_SHORT_PREAMBLE (1<<5)
271#define WLAN_CAPABILITY_PBCC (1<<6)
272#define WLAN_CAPABILITY_CHANNEL_AGILITY (1<<7)
273
274/* Status codes */
275#define WLAN_STATUS_SUCCESS 0
276#define WLAN_STATUS_UNSPECIFIED_FAILURE 1
277#define WLAN_STATUS_CAPS_UNSUPPORTED 10
278#define WLAN_STATUS_REASSOC_NO_ASSOC 11
279#define WLAN_STATUS_ASSOC_DENIED_UNSPEC 12
280#define WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG 13
281#define WLAN_STATUS_UNKNOWN_AUTH_TRANSACTION 14
282#define WLAN_STATUS_CHALLENGE_FAIL 15
283#define WLAN_STATUS_AUTH_TIMEOUT 16
284#define WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA 17
285#define WLAN_STATUS_ASSOC_DENIED_RATES 18
286/* 802.11b */
287#define WLAN_STATUS_ASSOC_DENIED_NOSHORT 19
288#define WLAN_STATUS_ASSOC_DENIED_NOPBCC 20
289#define WLAN_STATUS_ASSOC_DENIED_NOAGILITY 21
290
291/* Reason codes */
292#define WLAN_REASON_UNSPECIFIED 1
293#define WLAN_REASON_PREV_AUTH_NOT_VALID 2
294#define WLAN_REASON_DEAUTH_LEAVING 3
295#define WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY 4
296#define WLAN_REASON_DISASSOC_AP_BUSY 5
297#define WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA 6
298#define WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA 7
299#define WLAN_REASON_DISASSOC_STA_HAS_LEFT 8
300#define WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH 9
301
302
303/* Information Element IDs */
304#define WLAN_EID_SSID 0
305#define WLAN_EID_SUPP_RATES 1
306#define WLAN_EID_FH_PARAMS 2
307#define WLAN_EID_DS_PARAMS 3
308#define WLAN_EID_CF_PARAMS 4
309#define WLAN_EID_TIM 5
310#define WLAN_EID_IBSS_PARAMS 6
311#define WLAN_EID_CHALLENGE 16
312#define WLAN_EID_RSN 48
313#define WLAN_EID_GENERIC 221
314
315#define IEEE80211_MGMT_HDR_LEN 24
316#define IEEE80211_DATA_HDR3_LEN 24
317#define IEEE80211_DATA_HDR4_LEN 30
318
319
320#define IEEE80211_STATMASK_SIGNAL (1<<0)
321#define IEEE80211_STATMASK_RSSI (1<<1)
322#define IEEE80211_STATMASK_NOISE (1<<2)
323#define IEEE80211_STATMASK_RATE (1<<3)
324#define IEEE80211_STATMASK_WEMASK 0x7
325
326
327#define IEEE80211_CCK_MODULATION (1<<0)
328#define IEEE80211_OFDM_MODULATION (1<<1)
329
330#define IEEE80211_24GHZ_BAND (1<<0)
331#define IEEE80211_52GHZ_BAND (1<<1)
332
333#define IEEE80211_CCK_RATE_1MB 0x02
334#define IEEE80211_CCK_RATE_2MB 0x04
335#define IEEE80211_CCK_RATE_5MB 0x0B
336#define IEEE80211_CCK_RATE_11MB 0x16
337#define IEEE80211_OFDM_RATE_6MB 0x0C
338#define IEEE80211_OFDM_RATE_9MB 0x12
339#define IEEE80211_OFDM_RATE_12MB 0x18
340#define IEEE80211_OFDM_RATE_18MB 0x24
341#define IEEE80211_OFDM_RATE_24MB 0x30
342#define IEEE80211_OFDM_RATE_36MB 0x48
343#define IEEE80211_OFDM_RATE_48MB 0x60
344#define IEEE80211_OFDM_RATE_54MB 0x6C
345#define IEEE80211_BASIC_RATE_MASK 0x80
346
347#define IEEE80211_CCK_RATE_1MB_MASK (1<<0)
348#define IEEE80211_CCK_RATE_2MB_MASK (1<<1)
349#define IEEE80211_CCK_RATE_5MB_MASK (1<<2)
350#define IEEE80211_CCK_RATE_11MB_MASK (1<<3)
351#define IEEE80211_OFDM_RATE_6MB_MASK (1<<4)
352#define IEEE80211_OFDM_RATE_9MB_MASK (1<<5)
353#define IEEE80211_OFDM_RATE_12MB_MASK (1<<6)
354#define IEEE80211_OFDM_RATE_18MB_MASK (1<<7)
355#define IEEE80211_OFDM_RATE_24MB_MASK (1<<8)
356#define IEEE80211_OFDM_RATE_36MB_MASK (1<<9)
357#define IEEE80211_OFDM_RATE_48MB_MASK (1<<10)
358#define IEEE80211_OFDM_RATE_54MB_MASK (1<<11)
359
360#define IEEE80211_CCK_RATES_MASK 0x0000000F
361#define IEEE80211_CCK_BASIC_RATES_MASK (IEEE80211_CCK_RATE_1MB_MASK | \
362 IEEE80211_CCK_RATE_2MB_MASK)
363#define IEEE80211_CCK_DEFAULT_RATES_MASK (IEEE80211_CCK_BASIC_RATES_MASK | \
364 IEEE80211_CCK_RATE_5MB_MASK | \
365 IEEE80211_CCK_RATE_11MB_MASK)
366
367#define IEEE80211_OFDM_RATES_MASK 0x00000FF0
368#define IEEE80211_OFDM_BASIC_RATES_MASK (IEEE80211_OFDM_RATE_6MB_MASK | \
369 IEEE80211_OFDM_RATE_12MB_MASK | \
370 IEEE80211_OFDM_RATE_24MB_MASK)
371#define IEEE80211_OFDM_DEFAULT_RATES_MASK (IEEE80211_OFDM_BASIC_RATES_MASK | \
372 IEEE80211_OFDM_RATE_9MB_MASK | \
373 IEEE80211_OFDM_RATE_18MB_MASK | \
374 IEEE80211_OFDM_RATE_36MB_MASK | \
375 IEEE80211_OFDM_RATE_48MB_MASK | \
376 IEEE80211_OFDM_RATE_54MB_MASK)
377#define IEEE80211_DEFAULT_RATES_MASK (IEEE80211_OFDM_DEFAULT_RATES_MASK | \
378 IEEE80211_CCK_DEFAULT_RATES_MASK)
379
380#define IEEE80211_NUM_OFDM_RATES 8
381#define IEEE80211_NUM_CCK_RATES 4
382#define IEEE80211_OFDM_SHIFT_MASK_A 4
383
384
385
386
387/* NOTE: This data is for statistical purposes; not all hardware provides this
388 * information for frames received. Not setting these will not cause
389 * any adverse affects. */
390struct ieee80211_rx_stats {
391 u32 mac_time;
392 s8 rssi;
393 u8 signal;
394 u8 noise;
395 u16 rate; /* in 100 kbps */
396 u8 received_channel;
397 u8 control;
398 u8 mask;
399 u8 freq;
400 u16 len;
401};
402
403/* IEEE 802.11 requires that STA supports concurrent reception of at least
404 * three fragmented frames. This define can be increased to support more
405 * concurrent frames, but it should be noted that each entry can consume about
406 * 2 kB of RAM and increasing cache size will slow down frame reassembly. */
407#define IEEE80211_FRAG_CACHE_LEN 4
408
409struct ieee80211_frag_entry {
410 unsigned long first_frag_time;
411 unsigned int seq;
412 unsigned int last_frag;
413 struct sk_buff *skb;
414 u8 src_addr[ETH_ALEN];
415 u8 dst_addr[ETH_ALEN];
416};
417
418struct ieee80211_stats {
419 unsigned int tx_unicast_frames;
420 unsigned int tx_multicast_frames;
421 unsigned int tx_fragments;
422 unsigned int tx_unicast_octets;
423 unsigned int tx_multicast_octets;
424 unsigned int tx_deferred_transmissions;
425 unsigned int tx_single_retry_frames;
426 unsigned int tx_multiple_retry_frames;
427 unsigned int tx_retry_limit_exceeded;
428 unsigned int tx_discards;
429 unsigned int rx_unicast_frames;
430 unsigned int rx_multicast_frames;
431 unsigned int rx_fragments;
432 unsigned int rx_unicast_octets;
433 unsigned int rx_multicast_octets;
434 unsigned int rx_fcs_errors;
435 unsigned int rx_discards_no_buffer;
436 unsigned int tx_discards_wrong_sa;
437 unsigned int rx_discards_undecryptable;
438 unsigned int rx_message_in_msg_fragments;
439 unsigned int rx_message_in_bad_msg_fragments;
440};
441
442struct ieee80211_device;
443
444#define SEC_KEY_1 (1<<0)
445#define SEC_KEY_2 (1<<1)
446#define SEC_KEY_3 (1<<2)
447#define SEC_KEY_4 (1<<3)
448#define SEC_ACTIVE_KEY (1<<4)
449#define SEC_AUTH_MODE (1<<5)
450#define SEC_UNICAST_GROUP (1<<6)
451#define SEC_LEVEL (1<<7)
452#define SEC_ENABLED (1<<8)
453
454#define SEC_LEVEL_0 0 /* None */
455#define SEC_LEVEL_1 1 /* WEP 40 and 104 bit */
456#define SEC_LEVEL_2 2 /* Level 1 + TKIP */
457#define SEC_LEVEL_2_CKIP 3 /* Level 1 + CKIP */
458#define SEC_LEVEL_3 4 /* Level 2 + CCMP */
459
460#define WEP_KEYS 4
461#define WEP_KEY_LEN 13
462
463struct ieee80211_security {
464 u16 active_key:2,
465 enabled:1,
466 auth_mode:2,
467 auth_algo:4,
468 unicast_uses_group:1;
469 u8 key_sizes[WEP_KEYS];
470 u8 keys[WEP_KEYS][WEP_KEY_LEN];
471 u8 level;
472 u16 flags;
473} __attribute__ ((packed));
474
475
476/*
477
478 802.11 data frame from AP
479
480 ,-------------------------------------------------------------------.
481Bytes | 2 | 2 | 6 | 6 | 6 | 2 | 0..2312 | 4 |
482 |------|------|---------|---------|---------|------|---------|------|
483Desc. | ctrl | dura | DA/RA | TA | SA | Sequ | frame | fcs |
484 | | tion | (BSSID) | | | ence | data | |
485 `-------------------------------------------------------------------'
486
487Total: 28-2340 bytes
488
489*/
490
491struct ieee80211_header_data {
492 u16 frame_ctl;
493 u16 duration_id;
494 u8 addr1[6];
495 u8 addr2[6];
496 u8 addr3[6];
497 u16 seq_ctrl;
498};
499
500#define BEACON_PROBE_SSID_ID_POSITION 12
501
502/* Management Frame Information Element Types */
503#define MFIE_TYPE_SSID 0
504#define MFIE_TYPE_RATES 1
505#define MFIE_TYPE_FH_SET 2
506#define MFIE_TYPE_DS_SET 3
507#define MFIE_TYPE_CF_SET 4
508#define MFIE_TYPE_TIM 5
509#define MFIE_TYPE_IBSS_SET 6
510#define MFIE_TYPE_CHALLENGE 16
511#define MFIE_TYPE_RSN 48
512#define MFIE_TYPE_RATES_EX 50
513#define MFIE_TYPE_GENERIC 221
514
515struct ieee80211_info_element_hdr {
516 u8 id;
517 u8 len;
518} __attribute__ ((packed));
519
520struct ieee80211_info_element {
521 u8 id;
522 u8 len;
523 u8 data[0];
524} __attribute__ ((packed));
525
526/*
527 * These are the data types that can make up management packets
528 *
529 u16 auth_algorithm;
530 u16 auth_sequence;
531 u16 beacon_interval;
532 u16 capability;
533 u8 current_ap[ETH_ALEN];
534 u16 listen_interval;
535 struct {
536 u16 association_id:14, reserved:2;
537 } __attribute__ ((packed));
538 u32 time_stamp[2];
539 u16 reason;
540 u16 status;
541*/
542
543struct ieee80211_authentication {
544 struct ieee80211_header_data header;
545 u16 algorithm;
546 u16 transaction;
547 u16 status;
548 struct ieee80211_info_element info_element;
549} __attribute__ ((packed));
550
551
552struct ieee80211_probe_response {
553 struct ieee80211_header_data header;
554 u32 time_stamp[2];
555 u16 beacon_interval;
556 u16 capability;
557 struct ieee80211_info_element info_element;
558} __attribute__ ((packed));
559
560struct ieee80211_assoc_request_frame {
561 u16 capability;
562 u16 listen_interval;
563 u8 current_ap[ETH_ALEN];
564 struct ieee80211_info_element info_element;
565} __attribute__ ((packed));
566
567struct ieee80211_assoc_response_frame {
568 struct ieee80211_hdr_3addr header;
569 u16 capability;
570 u16 status;
571 u16 aid;
572 struct ieee80211_info_element info_element; /* supported rates */
573} __attribute__ ((packed));
574
575
576struct ieee80211_txb {
577 u8 nr_frags;
578 u8 encrypted;
579 u16 reserved;
580 u16 frag_size;
581 u16 payload_size;
582 struct sk_buff *fragments[0];
583};
584
585
586/* SWEEP TABLE ENTRIES NUMBER*/
587#define MAX_SWEEP_TAB_ENTRIES 42
588#define MAX_SWEEP_TAB_ENTRIES_PER_PACKET 7
589/* MAX_RATES_LENGTH needs to be 12. The spec says 8, and many APs
590 * only use 8, and then use extended rates for the remaining supported
591 * rates. Other APs, however, stick all of their supported rates on the
592 * main rates information element... */
593#define MAX_RATES_LENGTH ((u8)12)
594#define MAX_RATES_EX_LENGTH ((u8)16)
595#define MAX_NETWORK_COUNT 128
596
597#define CRC_LENGTH 4U
598
599#define MAX_WPA_IE_LEN 64
600
601#define NETWORK_EMPTY_ESSID (1<<0)
602#define NETWORK_HAS_OFDM (1<<1)
603#define NETWORK_HAS_CCK (1<<2)
604
605struct ieee80211_network {
606 /* These entries are used to identify a unique network */
607 u8 bssid[ETH_ALEN];
608 u8 channel;
609 /* Ensure null-terminated for any debug msgs */
610 u8 ssid[IW_ESSID_MAX_SIZE + 1];
611 u8 ssid_len;
612
613 /* These are network statistics */
614 struct ieee80211_rx_stats stats;
615 u16 capability;
616 u8 rates[MAX_RATES_LENGTH];
617 u8 rates_len;
618 u8 rates_ex[MAX_RATES_EX_LENGTH];
619 u8 rates_ex_len;
620 unsigned long last_scanned;
621 u8 mode;
622 u8 flags;
623 u32 last_associate;
624 u32 time_stamp[2];
625 u16 beacon_interval;
626 u16 listen_interval;
627 u16 atim_window;
628 u8 wpa_ie[MAX_WPA_IE_LEN];
629 size_t wpa_ie_len;
630 u8 rsn_ie[MAX_WPA_IE_LEN];
631 size_t rsn_ie_len;
632 struct list_head list;
633};
634
635enum ieee80211_state {
636 IEEE80211_UNINITIALIZED = 0,
637 IEEE80211_INITIALIZED,
638 IEEE80211_ASSOCIATING,
639 IEEE80211_ASSOCIATED,
640 IEEE80211_AUTHENTICATING,
641 IEEE80211_AUTHENTICATED,
642 IEEE80211_SHUTDOWN
643};
644
645#define DEFAULT_MAX_SCAN_AGE (15 * HZ)
646#define DEFAULT_FTS 2346
647#define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x"
648#define MAC_ARG(x) ((u8*)(x))[0],((u8*)(x))[1],((u8*)(x))[2],((u8*)(x))[3],((u8*)(x))[4],((u8*)(x))[5]
649
650
651extern inline int is_broadcast_ether_addr(const u8 *addr)
652{
653 return ((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) && \
654 (addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff));
655}
656
657#define CFG_IEEE80211_RESERVE_FCS (1<<0)
658#define CFG_IEEE80211_COMPUTE_FCS (1<<1)
659
660struct ieee80211_device {
661 struct net_device *dev;
662
663 /* Bookkeeping structures */
664 struct net_device_stats stats;
665 struct ieee80211_stats ieee_stats;
666
667 /* Probe / Beacon management */
668 struct list_head network_free_list;
669 struct list_head network_list;
670 struct ieee80211_network *networks;
671 int scans;
672 int scan_age;
673
674 int iw_mode; /* operating mode (IW_MODE_*) */
675
676 spinlock_t lock;
677
678 int tx_headroom; /* Set to size of any additional room needed at front
679 * of allocated Tx SKBs */
680 u32 config;
681
682 /* WEP and other encryption related settings at the device level */
683 int open_wep; /* Set to 1 to allow unencrypted frames */
684
685 int reset_on_keychange; /* Set to 1 if the HW needs to be reset on
686 * WEP key changes */
687
688 /* If the host performs {en,de}cryption, then set to 1 */
689 int host_encrypt;
690 int host_decrypt;
691 int ieee802_1x; /* is IEEE 802.1X used */
692
693 /* WPA data */
694 int wpa_enabled;
695 int drop_unencrypted;
696 int tkip_countermeasures;
697 int privacy_invoked;
698 size_t wpa_ie_len;
699 u8 *wpa_ie;
700
701 struct list_head crypt_deinit_list;
702 struct ieee80211_crypt_data *crypt[WEP_KEYS];
703 int tx_keyidx; /* default TX key index (crypt[tx_keyidx]) */
704 struct timer_list crypt_deinit_timer;
705
706 int bcrx_sta_key; /* use individual keys to override default keys even
707 * with RX of broad/multicast frames */
708
709 /* Fragmentation structures */
710 struct ieee80211_frag_entry frag_cache[IEEE80211_FRAG_CACHE_LEN];
711 unsigned int frag_next_idx;
712 u16 fts; /* Fragmentation Threshold */
713
714 /* Association info */
715 u8 bssid[ETH_ALEN];
716
717 enum ieee80211_state state;
718
719 int mode; /* A, B, G */
720 int modulation; /* CCK, OFDM */
721 int freq_band; /* 2.4Ghz, 5.2Ghz, Mixed */
722 int abg_ture; /* ABG flag */
723
724 /* Callback functions */
725 void (*set_security)(struct net_device *dev,
726 struct ieee80211_security *sec);
727 int (*hard_start_xmit)(struct ieee80211_txb *txb,
728 struct net_device *dev);
729 int (*reset_port)(struct net_device *dev);
730
731 /* This must be the last item so that it points to the data
732 * allocated beyond this structure by alloc_ieee80211 */
733 u8 priv[0];
734};
735
736#define IEEE_A (1<<0)
737#define IEEE_B (1<<1)
738#define IEEE_G (1<<2)
739#define IEEE_MODE_MASK (IEEE_A|IEEE_B|IEEE_G)
740
741extern inline void *ieee80211_priv(struct net_device *dev)
742{
743 return ((struct ieee80211_device *)netdev_priv(dev))->priv;
744}
745
746extern inline int ieee80211_is_empty_essid(const char *essid, int essid_len)
747{
748 /* Single white space is for Linksys APs */
749 if (essid_len == 1 && essid[0] == ' ')
750 return 1;
751
752 /* Otherwise, if the entire essid is 0, we assume it is hidden */
753 while (essid_len) {
754 essid_len--;
755 if (essid[essid_len] != '\0')
756 return 0;
757 }
758
759 return 1;
760}
761
762extern inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee, int mode)
763{
764 /*
765 * It is possible for both access points and our device to support
766 * combinations of modes, so as long as there is one valid combination
767 * of ap/device supported modes, then return success
768 *
769 */
770 if ((mode & IEEE_A) &&
771 (ieee->modulation & IEEE80211_OFDM_MODULATION) &&
772 (ieee->freq_band & IEEE80211_52GHZ_BAND))
773 return 1;
774
775 if ((mode & IEEE_G) &&
776 (ieee->modulation & IEEE80211_OFDM_MODULATION) &&
777 (ieee->freq_band & IEEE80211_24GHZ_BAND))
778 return 1;
779
780 if ((mode & IEEE_B) &&
781 (ieee->modulation & IEEE80211_CCK_MODULATION) &&
782 (ieee->freq_band & IEEE80211_24GHZ_BAND))
783 return 1;
784
785 return 0;
786}
787
788extern inline int ieee80211_get_hdrlen(u16 fc)
789{
790 int hdrlen = 24;
791
792 switch (WLAN_FC_GET_TYPE(fc)) {
793 case IEEE80211_FTYPE_DATA:
794 if ((fc & IEEE80211_FCTL_FROMDS) && (fc & IEEE80211_FCTL_TODS))
795 hdrlen = 30; /* Addr4 */
796 break;
797 case IEEE80211_FTYPE_CTL:
798 switch (WLAN_FC_GET_STYPE(fc)) {
799 case IEEE80211_STYPE_CTS:
800 case IEEE80211_STYPE_ACK:
801 hdrlen = 10;
802 break;
803 default:
804 hdrlen = 16;
805 break;
806 }
807 break;
808 }
809
810 return hdrlen;
811}
812
813
814
815/* ieee80211.c */
816extern void free_ieee80211(struct net_device *dev);
817extern struct net_device *alloc_ieee80211(int sizeof_priv);
818
819extern int ieee80211_set_encryption(struct ieee80211_device *ieee);
820
821/* ieee80211_tx.c */
822
823
824extern int ieee80211_xmit(struct sk_buff *skb,
825 struct net_device *dev);
826extern void ieee80211_txb_free(struct ieee80211_txb *);
827
828
829/* ieee80211_rx.c */
830extern int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
831 struct ieee80211_rx_stats *rx_stats);
832extern void ieee80211_rx_mgt(struct ieee80211_device *ieee,
833 struct ieee80211_hdr *header,
834 struct ieee80211_rx_stats *stats);
835
836/* iee80211_wx.c */
837extern int ieee80211_wx_get_scan(struct ieee80211_device *ieee,
838 struct iw_request_info *info,
839 union iwreq_data *wrqu, char *key);
840extern int ieee80211_wx_set_encode(struct ieee80211_device *ieee,
841 struct iw_request_info *info,
842 union iwreq_data *wrqu, char *key);
843extern int ieee80211_wx_get_encode(struct ieee80211_device *ieee,
844 struct iw_request_info *info,
845 union iwreq_data *wrqu, char *key);
846
847
848extern inline void ieee80211_increment_scans(struct ieee80211_device *ieee)
849{
850 ieee->scans++;
851}
852
853extern inline int ieee80211_get_scans(struct ieee80211_device *ieee)
854{
855 return ieee->scans;
856}
857
858static inline const char *escape_essid(const char *essid, u8 essid_len) {
859 static char escaped[IW_ESSID_MAX_SIZE * 2 + 1];
860 const char *s = essid;
861 char *d = escaped;
862
863 if (ieee80211_is_empty_essid(essid, essid_len)) {
864 memcpy(escaped, "<hidden>", sizeof("<hidden>"));
865 return escaped;
866 }
867
868 essid_len = min(essid_len, (u8)IW_ESSID_MAX_SIZE);
869 while (essid_len--) {
870 if (*s == '\0') {
871 *d++ = '\\';
872 *d++ = '0';
873 s++;
874 } else {
875 *d++ = *s++;
876 }
877 }
878 *d = '\0';
879 return escaped;
880}
881
882#endif /* IEEE80211_H */
diff --git a/include/pcmcia/ciscode.h b/include/pcmcia/ciscode.h
index 2000b43ece9..da19c297dd6 100644
--- a/include/pcmcia/ciscode.h
+++ b/include/pcmcia/ciscode.h
@@ -112,6 +112,8 @@
112 112
113#define MANFID_TDK 0x0105 113#define MANFID_TDK 0x0105
114#define PRODID_TDK_CF010 0x0900 114#define PRODID_TDK_CF010 0x0900
115#define PRODID_TDK_NP9610 0x0d0a
116#define PRODID_TDK_MN3200 0x0e0a
115#define PRODID_TDK_GN3410 0x4815 117#define PRODID_TDK_GN3410 0x4815
116 118
117#define MANFID_TOSHIBA 0x0098 119#define MANFID_TOSHIBA 0x0098
diff --git a/include/pcmcia/cs.h b/include/pcmcia/cs.h
index 8d8643adc78..b42ddc0c114 100644
--- a/include/pcmcia/cs.h
+++ b/include/pcmcia/cs.h
@@ -396,7 +396,6 @@ struct pcmcia_socket;
396int pcmcia_access_configuration_register(client_handle_t handle, conf_reg_t *reg); 396int pcmcia_access_configuration_register(client_handle_t handle, conf_reg_t *reg);
397int pcmcia_deregister_client(client_handle_t handle); 397int pcmcia_deregister_client(client_handle_t handle);
398int pcmcia_get_configuration_info(client_handle_t handle, config_info_t *config); 398int pcmcia_get_configuration_info(client_handle_t handle, config_info_t *config);
399int pcmcia_get_card_services_info(servinfo_t *info);
400int pcmcia_get_first_window(window_handle_t *win, win_req_t *req); 399int pcmcia_get_first_window(window_handle_t *win, win_req_t *req);
401int pcmcia_get_next_window(window_handle_t *win, win_req_t *req); 400int pcmcia_get_next_window(window_handle_t *win, win_req_t *req);
402int pcmcia_get_status(client_handle_t handle, cs_status_t *status); 401int pcmcia_get_status(client_handle_t handle, cs_status_t *status);
@@ -417,7 +416,6 @@ int pcmcia_suspend_card(struct pcmcia_socket *skt);
417int pcmcia_resume_card(struct pcmcia_socket *skt); 416int pcmcia_resume_card(struct pcmcia_socket *skt);
418int pcmcia_eject_card(struct pcmcia_socket *skt); 417int pcmcia_eject_card(struct pcmcia_socket *skt);
419int pcmcia_insert_card(struct pcmcia_socket *skt); 418int pcmcia_insert_card(struct pcmcia_socket *skt);
420int pcmcia_report_error(client_handle_t handle, error_info_t *err);
421 419
422struct pcmcia_socket * pcmcia_get_socket(struct pcmcia_socket *skt); 420struct pcmcia_socket * pcmcia_get_socket(struct pcmcia_socket *skt);
423void pcmcia_put_socket(struct pcmcia_socket *skt); 421void pcmcia_put_socket(struct pcmcia_socket *skt);
diff --git a/include/pcmcia/device_id.h b/include/pcmcia/device_id.h
new file mode 100644
index 00000000000..346d81ece28
--- /dev/null
+++ b/include/pcmcia/device_id.h
@@ -0,0 +1,249 @@
1/*
2 * Copyright (2003-2004) Dominik Brodowski <linux@brodo.de>
3 * David Woodhouse
4 *
5 * License: GPL v2
6 */
7
8#define PCMCIA_DEVICE_MANF_CARD(manf, card) { \
9 .match_flags = PCMCIA_DEV_ID_MATCH_MANF_ID| \
10 PCMCIA_DEV_ID_MATCH_CARD_ID, \
11 .manf_id = (manf), \
12 .card_id = (card), }
13
14#define PCMCIA_DEVICE_FUNC_ID(func) { \
15 .match_flags = PCMCIA_DEV_ID_MATCH_FUNC_ID, \
16 .func_id = (func), }
17
18#define PCMCIA_DEVICE_PROD_ID1(v1, vh1) { \
19 .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1, \
20 .prod_id = { (v1), NULL, NULL, NULL }, \
21 .prod_id_hash = { (vh1), 0, 0, 0 }, }
22
23#define PCMCIA_DEVICE_PROD_ID2(v2, vh2) { \
24 .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID2, \
25 .prod_id = { NULL, (v2), NULL, NULL }, \
26 .prod_id_hash = { 0, (vh2), 0, 0 }, }
27
28#define PCMCIA_DEVICE_PROD_ID12(v1, v2, vh1, vh2) { \
29 .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \
30 PCMCIA_DEV_ID_MATCH_PROD_ID2, \
31 .prod_id = { (v1), (v2), NULL, NULL }, \
32 .prod_id_hash = { (vh1), (vh2), 0, 0 }, }
33
34#define PCMCIA_DEVICE_PROD_ID13(v1, v3, vh1, vh3) { \
35 .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \
36 PCMCIA_DEV_ID_MATCH_PROD_ID3, \
37 .prod_id = { (v1), NULL, (v3), NULL }, \
38 .prod_id_hash = { (vh1), 0, (vh3), 0 }, }
39
40#define PCMCIA_DEVICE_PROD_ID14(v1, v4, vh1, vh4) { \
41 .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \
42 PCMCIA_DEV_ID_MATCH_PROD_ID4, \
43 .prod_id = { (v1), NULL, NULL, (v4) }, \
44 .prod_id_hash = { (vh1), 0, 0, (vh4) }, }
45
46#define PCMCIA_DEVICE_PROD_ID123(v1, v2, v3, vh1, vh2, vh3) { \
47 .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \
48 PCMCIA_DEV_ID_MATCH_PROD_ID2| \
49 PCMCIA_DEV_ID_MATCH_PROD_ID3, \
50 .prod_id = { (v1), (v2), (v3), NULL },\
51 .prod_id_hash = { (vh1), (vh2), (vh3), 0 }, }
52
53#define PCMCIA_DEVICE_PROD_ID124(v1, v2, v4, vh1, vh2, vh4) { \
54 .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \
55 PCMCIA_DEV_ID_MATCH_PROD_ID2| \
56 PCMCIA_DEV_ID_MATCH_PROD_ID4, \
57 .prod_id = { (v1), (v2), NULL, (v4) }, \
58 .prod_id_hash = { (vh1), (vh2), 0, (vh4) }, }
59
60#define PCMCIA_DEVICE_PROD_ID134(v1, v3, v4, vh1, vh3, vh4) { \
61 .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \
62 PCMCIA_DEV_ID_MATCH_PROD_ID3| \
63 PCMCIA_DEV_ID_MATCH_PROD_ID4, \
64 .prod_id = { (v1), NULL, (v3), (v4) }, \
65 .prod_id_hash = { (vh1), 0, (vh3), (vh4) }, }
66
67#define PCMCIA_DEVICE_PROD_ID1234(v1, v2, v3, v4, vh1, vh2, vh3, vh4) { \
68 .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \
69 PCMCIA_DEV_ID_MATCH_PROD_ID2| \
70 PCMCIA_DEV_ID_MATCH_PROD_ID3| \
71 PCMCIA_DEV_ID_MATCH_PROD_ID4, \
72 .prod_id = { (v1), (v2), (v3), (v4) }, \
73 .prod_id_hash = { (vh1), (vh2), (vh3), (vh4) }, }
74
75
76/* multi-function devices */
77
78#define PCMCIA_MFC_DEVICE_MANF_CARD(mfc, manf, card) { \
79 .match_flags = PCMCIA_DEV_ID_MATCH_MANF_ID| \
80 PCMCIA_DEV_ID_MATCH_CARD_ID| \
81 PCMCIA_DEV_ID_MATCH_FUNCTION, \
82 .manf_id = (manf), \
83 .card_id = (card), \
84 .function = (mfc), }
85
86#define PCMCIA_MFC_DEVICE_PROD_ID1(mfc, v1, vh1) { \
87 .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \
88 PCMCIA_DEV_ID_MATCH_FUNCTION, \
89 .prod_id = { (v1), NULL, NULL, NULL }, \
90 .prod_id_hash = { (vh1), 0, 0, 0 }, \
91 .function = (mfc), }
92
93#define PCMCIA_MFC_DEVICE_PROD_ID2(mfc, v2, vh2) { \
94 .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID2| \
95 PCMCIA_DEV_ID_MATCH_FUNCTION, \
96 .prod_id = { NULL, (v2), NULL, NULL }, \
97 .prod_id_hash = { 0, (vh2), 0, 0 }, \
98 .function = (mfc), }
99
100#define PCMCIA_MFC_DEVICE_PROD_ID12(mfc, v1, v2, vh1, vh2) { \
101 .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \
102 PCMCIA_DEV_ID_MATCH_PROD_ID2| \
103 PCMCIA_DEV_ID_MATCH_FUNCTION, \
104 .prod_id = { (v1), (v2), NULL, NULL }, \
105 .prod_id_hash = { (vh1), (vh2), 0, 0 }, \
106 .function = (mfc), }
107
108#define PCMCIA_MFC_DEVICE_PROD_ID13(mfc, v1, v3, vh1, vh3) { \
109 .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \
110 PCMCIA_DEV_ID_MATCH_PROD_ID3| \
111 PCMCIA_DEV_ID_MATCH_FUNCTION, \
112 .prod_id = { (v1), NULL, (v3), NULL }, \
113 .prod_id_hash = { (vh1), 0, (vh3), 0 }, \
114 .function = (mfc), }
115
116#define PCMCIA_MFC_DEVICE_PROD_ID123(mfc, v1, v2, v3, vh1, vh2, vh3) { \
117 .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \
118 PCMCIA_DEV_ID_MATCH_PROD_ID2| \
119 PCMCIA_DEV_ID_MATCH_PROD_ID3| \
120 PCMCIA_DEV_ID_MATCH_FUNCTION, \
121 .prod_id = { (v1), (v2), (v3), NULL },\
122 .prod_id_hash = { (vh1), (vh2), (vh3), 0 }, \
123 .function = (mfc), }
124
125/* pseudo multi-function devices */
126
127#define PCMCIA_PFC_DEVICE_MANF_CARD(mfc, manf, card) { \
128 .match_flags = PCMCIA_DEV_ID_MATCH_MANF_ID| \
129 PCMCIA_DEV_ID_MATCH_CARD_ID| \
130 PCMCIA_DEV_ID_MATCH_DEVICE_NO, \
131 .manf_id = (manf), \
132 .card_id = (card), \
133 .device_no = (mfc), }
134
135#define PCMCIA_PFC_DEVICE_PROD_ID1(mfc, v1, vh1) { \
136 .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \
137 PCMCIA_DEV_ID_MATCH_DEVICE_NO, \
138 .prod_id = { (v1), NULL, NULL, NULL }, \
139 .prod_id_hash = { (vh1), 0, 0, 0 }, \
140 .device_no = (mfc), }
141
142#define PCMCIA_PFC_DEVICE_PROD_ID2(mfc, v2, vh2) { \
143 .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID2| \
144 PCMCIA_DEV_ID_MATCH_DEVICE_NO, \
145 .prod_id = { NULL, (v2), NULL, NULL }, \
146 .prod_id_hash = { 0, (vh2), 0, 0 }, \
147 .device_no = (mfc), }
148
149#define PCMCIA_PFC_DEVICE_PROD_ID12(mfc, v1, v2, vh1, vh2) { \
150 .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \
151 PCMCIA_DEV_ID_MATCH_PROD_ID2| \
152 PCMCIA_DEV_ID_MATCH_DEVICE_NO, \
153 .prod_id = { (v1), (v2), NULL, NULL }, \
154 .prod_id_hash = { (vh1), (vh2), 0, 0 }, \
155 .device_no = (mfc), }
156
157#define PCMCIA_PFC_DEVICE_PROD_ID13(mfc, v1, v3, vh1, vh3) { \
158 .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \
159 PCMCIA_DEV_ID_MATCH_PROD_ID3| \
160 PCMCIA_DEV_ID_MATCH_DEVICE_NO, \
161 .prod_id = { (v1), NULL, (v3), NULL }, \
162 .prod_id_hash = { (vh1), 0, (vh3), 0 }, \
163 .device_no = (mfc), }
164
165#define PCMCIA_PFC_DEVICE_PROD_ID123(mfc, v1, v2, v3, vh1, vh2, vh3) { \
166 .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \
167 PCMCIA_DEV_ID_MATCH_PROD_ID2| \
168 PCMCIA_DEV_ID_MATCH_PROD_ID3| \
169 PCMCIA_DEV_ID_MATCH_DEVICE_NO, \
170 .prod_id = { (v1), (v2), (v3), NULL },\
171 .prod_id_hash = { (vh1), (vh2), (vh3), 0 }, \
172 .device_no = (mfc), }
173
174/* cards needing a CIS override */
175
176#define PCMCIA_DEVICE_CIS_MANF_CARD(manf, card, _cisfile) { \
177 .match_flags = PCMCIA_DEV_ID_MATCH_FAKE_CIS | \
178 PCMCIA_DEV_ID_MATCH_MANF_ID| \
179 PCMCIA_DEV_ID_MATCH_CARD_ID, \
180 .manf_id = (manf), \
181 .card_id = (card), \
182 .cisfile = (_cisfile)}
183
184#define PCMCIA_DEVICE_CIS_PROD_ID12(v1, v2, vh1, vh2, _cisfile) { \
185 .match_flags = PCMCIA_DEV_ID_MATCH_FAKE_CIS | \
186 PCMCIA_DEV_ID_MATCH_PROD_ID1| \
187 PCMCIA_DEV_ID_MATCH_PROD_ID2, \
188 .prod_id = { (v1), (v2), NULL, NULL }, \
189 .prod_id_hash = { (vh1), (vh2), 0, 0 }, \
190 .cisfile = (_cisfile)}
191
192#define PCMCIA_DEVICE_CIS_PROD_ID123(v1, v2, v3, vh1, vh2, vh3, _cisfile) { \
193 .match_flags = PCMCIA_DEV_ID_MATCH_FAKE_CIS | \
194 PCMCIA_DEV_ID_MATCH_PROD_ID1| \
195 PCMCIA_DEV_ID_MATCH_PROD_ID2| \
196 PCMCIA_DEV_ID_MATCH_PROD_ID3, \
197 .prod_id = { (v1), (v2), (v3), NULL },\
198 .prod_id_hash = { (vh1), (vh2), (vh3), 0 }, \
199 .cisfile = (_cisfile)}
200
201
202#define PCMCIA_DEVICE_CIS_PROD_ID2(v2, vh2, _cisfile) { \
203 .match_flags = PCMCIA_DEV_ID_MATCH_FAKE_CIS | \
204 PCMCIA_DEV_ID_MATCH_PROD_ID2, \
205 .prod_id = { NULL, (v2), NULL, NULL }, \
206 .prod_id_hash = { 0, (vh2), 0, 0 }, \
207 .cisfile = (_cisfile)}
208
209#define PCMCIA_PFC_DEVICE_CIS_PROD_ID12(mfc, v1, v2, vh1, vh2, _cisfile) { \
210 .match_flags = PCMCIA_DEV_ID_MATCH_FAKE_CIS | \
211 PCMCIA_DEV_ID_MATCH_PROD_ID1| \
212 PCMCIA_DEV_ID_MATCH_PROD_ID2| \
213 PCMCIA_DEV_ID_MATCH_DEVICE_NO, \
214 .prod_id = { (v1), (v2), NULL, NULL }, \
215 .prod_id_hash = { (vh1), (vh2), 0, 0 },\
216 .device_no = (mfc), \
217 .cisfile = (_cisfile)}
218
219#define PCMCIA_MFC_DEVICE_CIS_MANF_CARD(mfc, manf, card, _cisfile) { \
220 .match_flags = PCMCIA_DEV_ID_MATCH_FAKE_CIS | \
221 PCMCIA_DEV_ID_MATCH_MANF_ID| \
222 PCMCIA_DEV_ID_MATCH_CARD_ID| \
223 PCMCIA_DEV_ID_MATCH_FUNCTION, \
224 .manf_id = (manf), \
225 .card_id = (card), \
226 .function = (mfc), \
227 .cisfile = (_cisfile)}
228
229#define PCMCIA_MFC_DEVICE_CIS_PROD_ID12(mfc, v1, v2, vh1, vh2, _cisfile) { \
230 .match_flags = PCMCIA_DEV_ID_MATCH_FAKE_CIS | \
231 PCMCIA_DEV_ID_MATCH_PROD_ID1| \
232 PCMCIA_DEV_ID_MATCH_PROD_ID2| \
233 PCMCIA_DEV_ID_MATCH_FUNCTION, \
234 .prod_id = { (v1), (v2), NULL, NULL }, \
235 .prod_id_hash = { (vh1), (vh2), 0, 0 }, \
236 .function = (mfc), \
237 .cisfile = (_cisfile)}
238
239#define PCMCIA_MFC_DEVICE_CIS_PROD_ID4(mfc, v4, vh4, _cisfile) { \
240 .match_flags = PCMCIA_DEV_ID_MATCH_FAKE_CIS | \
241 PCMCIA_DEV_ID_MATCH_PROD_ID4| \
242 PCMCIA_DEV_ID_MATCH_FUNCTION, \
243 .prod_id = { NULL, NULL, NULL, (v4) }, \
244 .prod_id_hash = { 0, 0, 0, (vh4) }, \
245 .function = (mfc), \
246 .cisfile = (_cisfile)}
247
248
249#define PCMCIA_DEVICE_NULL { .match_flags = 0, }
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h
index 312fd958c90..2b52553f2d9 100644
--- a/include/pcmcia/ds.h
+++ b/include/pcmcia/ds.h
@@ -18,6 +18,8 @@
18 18
19#include <pcmcia/bulkmem.h> 19#include <pcmcia/bulkmem.h>
20#include <pcmcia/cs_types.h> 20#include <pcmcia/cs_types.h>
21#include <pcmcia/device_id.h>
22#include <linux/mod_devicetable.h>
21 23
22typedef struct tuple_parse_t { 24typedef struct tuple_parse_t {
23 tuple_t tuple; 25 tuple_t tuple;
@@ -129,12 +131,11 @@ typedef struct dev_link_t {
129 131
130struct pcmcia_socket; 132struct pcmcia_socket;
131 133
132extern struct bus_type pcmcia_bus_type;
133
134struct pcmcia_driver { 134struct pcmcia_driver {
135 dev_link_t *(*attach)(void); 135 dev_link_t *(*attach)(void);
136 void (*detach)(dev_link_t *); 136 void (*detach)(dev_link_t *);
137 struct module *owner; 137 struct module *owner;
138 struct pcmcia_device_id *id_table;
138 struct device_driver drv; 139 struct device_driver drv;
139}; 140};
140 141
@@ -173,7 +174,9 @@ struct pcmcia_device {
173 u8 has_manf_id:1; 174 u8 has_manf_id:1;
174 u8 has_card_id:1; 175 u8 has_card_id:1;
175 u8 has_func_id:1; 176 u8 has_func_id:1;
176 u8 reserved:5; 177
178 u8 allow_func_id_match:1;
179 u8 reserved:4;
177 180
178 u8 func_id; 181 u8 func_id;
179 u16 manf_id; 182 u16 manf_id;
diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h
index 67b867f31fe..0f7aacc33fe 100644
--- a/include/pcmcia/ss.h
+++ b/include/pcmcia/ss.h
@@ -15,10 +15,12 @@
15#ifndef _LINUX_SS_H 15#ifndef _LINUX_SS_H
16#define _LINUX_SS_H 16#define _LINUX_SS_H
17 17
18#include <linux/config.h>
19#include <linux/device.h>
20
18#include <pcmcia/cs_types.h> 21#include <pcmcia/cs_types.h>
19#include <pcmcia/cs.h> 22#include <pcmcia/cs.h>
20#include <pcmcia/bulkmem.h> 23#include <pcmcia/bulkmem.h>
21#include <linux/device.h>
22 24
23/* Definitions for card status flags for GetStatus */ 25/* Definitions for card status flags for GetStatus */
24#define SS_WRPROT 0x0001 26#define SS_WRPROT 0x0001
@@ -171,7 +173,7 @@ typedef struct window_t {
171 173
172struct config_t; 174struct config_t;
173struct pcmcia_callback; 175struct pcmcia_callback;
174 176struct user_info_t;
175 177
176struct pcmcia_socket { 178struct pcmcia_socket {
177 struct module *owner; 179 struct module *owner;
@@ -216,8 +218,9 @@ struct pcmcia_socket {
216 218
217 /* is set to one if resource setup is done using adjust_resource_info() */ 219 /* is set to one if resource setup is done using adjust_resource_info() */
218 u8 resource_setup_old:1; 220 u8 resource_setup_old:1;
221 u8 resource_setup_new:1;
219 222
220 u8 reserved:6; 223 u8 reserved:5;
221 224
222 /* socket operations */ 225 /* socket operations */
223 struct pccard_operations * ops; 226 struct pccard_operations * ops;
@@ -241,9 +244,32 @@ struct pcmcia_socket {
241 unsigned int thread_events; 244 unsigned int thread_events;
242 245
243 /* pcmcia (16-bit) */ 246 /* pcmcia (16-bit) */
244 struct pcmcia_bus_socket *pcmcia;
245 struct pcmcia_callback *callback; 247 struct pcmcia_callback *callback;
246 248
249#if defined(CONFIG_PCMCIA) || defined(CONFIG_PCMCIA_MODULE)
250 struct list_head devices_list; /* PCMCIA devices */
251 u8 device_count; /* the number of devices, used
252 * only internally and subject
253 * to incorrectness and change */
254
255 struct {
256 u8 present:1, /* PCMCIA card is present in socket */
257 busy:1, /* "master" ioctl is used */
258 dead:1, /* pcmcia module is being unloaded */
259 device_add_pending:1, /* a pseudo-multifunction-device
260 * add event is pending */
261 reserved:4;
262 } pcmcia_state;
263
264 struct work_struct device_add; /* for adding further pseudo-multifunction
265 * devices */
266
267#ifdef CONFIG_PCMCIA_IOCTL
268 struct user_info_t *user;
269 wait_queue_head_t queue;
270#endif
271#endif
272
247 /* cardbus (32-bit) */ 273 /* cardbus (32-bit) */
248#ifdef CONFIG_CARDBUS 274#ifdef CONFIG_CARDBUS
249 struct resource * cb_cis_res; 275 struct resource * cb_cis_res;