diff options
| author | James Simmons <jsimmons@maxwell.earthlink.net> | 2002-09-14 22:09:04 -0700 |
|---|---|---|
| committer | James Simmons <jsimmons@maxwell.earthlink.net> | 2002-09-14 22:09:04 -0700 |
| commit | 2f0517d7dda0e8a8742e25a50315df956256994e (patch) | |
| tree | 0b1f345b5c7801ac981fe2e7847343445e42e0e5 /include | |
| parent | 3c1eb3f2135f72b7e5fe1fbf2e58f33f853b85d0 (diff) | |
| parent | c7ce0140c9cdde187646278559d7a13e740b86d1 (diff) | |
Merge bk://linus.bkbits.net/linux-2.5
into maxwell.earthlink.net:/usr/src/linus-2.5
Diffstat (limited to 'include')
30 files changed, 310 insertions, 413 deletions
diff --git a/include/asm-i386/apic.h b/include/asm-i386/apic.h index 3947866376d1..a99aa679923d 100644 --- a/include/asm-i386/apic.h +++ b/include/asm-i386/apic.h @@ -89,6 +89,7 @@ extern void apic_pm_unregister(struct pm_dev*); extern unsigned int apic_timer_irqs [NR_CPUS]; extern int check_nmi_watchdog (void); +extern void enable_NMI_through_LVT0 (void * dummy); extern unsigned int nmi_watchdog; #define NMI_NONE 0 diff --git a/include/asm-sparc/hardirq.h b/include/asm-sparc/hardirq.h index f77ee7e415cf..8057289e0f3e 100644 --- a/include/asm-sparc/hardirq.h +++ b/include/asm-sparc/hardirq.h @@ -39,8 +39,8 @@ typedef struct { * - ( bit 26 is the PREEMPT_ACTIVE flag. ) * * PREEMPT_MASK: 0x000000ff - * HARDIRQ_MASK: 0x0000ff00 - * SOFTIRQ_MASK: 0x00ff0000 + * SOFTIRQ_MASK: 0x0000ff00 + * HARDIRQ_MASK: 0x00ff0000 */ #define PREEMPT_BITS 8 @@ -90,8 +90,10 @@ typedef struct { #define irq_enter() (preempt_count() += HARDIRQ_OFFSET) #if CONFIG_PREEMPT +# define in_atomic() (preempt_count() != kernel_locked()) # define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1) #else +# define in_atomic() (preempt_count() != 0) # define IRQ_EXIT_OFFSET HARDIRQ_OFFSET #endif #define irq_exit() \ @@ -121,7 +123,7 @@ do { \ #ifndef CONFIG_SMP -#define synchronize_irq() barrier() +#define synchronize_irq(irq) barrier() #else /* (CONFIG_SMP) */ diff --git a/include/asm-sparc/highmem.h b/include/asm-sparc/highmem.h index 2ba438ea6111..e9bf972142f8 100644 --- a/include/asm-sparc/highmem.h +++ b/include/asm-sparc/highmem.h @@ -148,6 +148,19 @@ static inline void kunmap_atomic(void *kvaddr, enum km_type type) dec_preempt_count(); } +static inline struct page *kmap_atomic_to_page(void *ptr) +{ + unsigned long idx, vaddr = (unsigned long)ptr; + pte_t *pte; + + if (vaddr < FIX_KMAP_BEGIN) + return virt_to_page(ptr); + + idx = ((vaddr - FIX_KMAP_BEGIN) >> PAGE_SHIFT); + pte = kmap_pte + idx; + return pte_page(*pte); +} + #endif /* __KERNEL__ */ #endif /* _ASM_HIGHMEM_H */ diff --git a/include/asm-sparc/ide.h b/include/asm-sparc/ide.h index b2b585d3ca35..c8a97fd7ef6a 100644 --- a/include/asm-sparc/ide.h +++ b/include/asm-sparc/ide.h @@ -81,92 +81,30 @@ static __inline__ void ide_init_default_hwifs(void) * The following are not needed for the non-m68k ports */ #define ide_ack_intr(hwif) (1) -#define ide_fix_driveid(id) do {} while (0) #define ide_release_lock(lock) do {} while (0) #define ide_get_lock(lock, hdlr, data) do {} while (0) -/* From m68k code... */ - -#ifdef insl -#undef insl -#endif -#ifdef outsl -#undef outsl -#endif -#ifdef insw -#undef insw -#endif -#ifdef outsw -#undef outsw -#endif - -#define insl(data_reg, buffer, wcount) insw(data_reg, buffer, (wcount)<<1) -#define outsl(data_reg, buffer, wcount) outsw(data_reg, buffer, (wcount)<<1) - -#define insw(port, buf, nr) ide_insw((port), (buf), (nr)) -#define outsw(port, buf, nr) ide_outsw((port), (buf), (nr)) - -static __inline__ void ide_insw(unsigned long port, - void *dst, - unsigned long count) -{ - volatile unsigned short *data_port; - /* unsigned long end = (unsigned long)dst + (count << 1); */ /* P3 */ - u16 *ps = dst; - u32 *pi; - - data_port = (volatile unsigned short *)port; - - if(((unsigned long)ps) & 0x2) { - *ps++ = *data_port; - count--; - } - pi = (u32 *)ps; - while(count >= 2) { - u32 w; - - w = (*data_port) << 16; - w |= (*data_port); - *pi++ = w; - count -= 2; - } - ps = (u16 *)pi; - if(count) - *ps++ = *data_port; - - /* __flush_dcache_range((unsigned long)dst, end); */ /* P3 see hme */ -} - -static __inline__ void ide_outsw(unsigned long port, - const void *src, - unsigned long count) -{ - volatile unsigned short *data_port; - /* unsigned long end = (unsigned long)src + (count << 1); */ - const u16 *ps = src; - const u32 *pi; - - data_port = (volatile unsigned short *)port; - - if(((unsigned long)src) & 0x2) { - *data_port = *ps++; - count--; - } - pi = (const u32 *)ps; - while(count >= 2) { - u32 w; - - w = *pi++; - *data_port = (w >> 16); - *data_port = w; - count -= 2; - } - ps = (const u16 *)pi; - if(count) - *data_port = *ps; +/* XXX Known to be broken. Axboe will fix the problems this + * XXX has by making seperate IN/OUT macros for IDE_DATA + * XXX register and rest of IDE regs and also using + * XXX ide_ioreg_t instead of u32 for ports. -DaveM + */ - /* __flush_dcache_range((unsigned long)src, end); */ /* P3 see hme */ -} +#define HAVE_ARCH_IN_BYTE +#define IN_BYTE(p) (*((volatile u8 *)(p))) +#define IN_WORD(p) (*((volatile u16 *)(p))) +#define IN_LONG(p) (*((volatile u32 *)(p))) +#define IN_BYTE_P IN_BYTE +#define IN_WORD_P IN_WORD +#define IN_LONG_P IN_LONG + +#define HAVE_ARCH_OUT_BYTE +#define OUT_BYTE(b,p) ((*((volatile u8 *)(p))) = (b)) +#define OUT_WORD(w,p) ((*((volatile u16 *)(p))) = (w)) +#define OUT_LONG(l,p) ((*((volatile u32 *)(p))) = (l)) +#define OUT_BYTE_P OUT_BYTE +#define OUT_WORD_P OUT_WORD +#define OUT_LONG_P OUT_LONG #endif /* __KERNEL__ */ diff --git a/include/asm-sparc/irq.h b/include/asm-sparc/irq.h index 6008023a5651..0e8693264787 100644 --- a/include/asm-sparc/irq.h +++ b/include/asm-sparc/irq.h @@ -21,6 +21,8 @@ BTFIXUPDEF_CALL(char *, __irq_itoa, unsigned int) #define NR_IRQS 15 +#define irq_cannonicalize(irq) (irq) + /* Dave Redman (djhr@tadpole.co.uk) * changed these to function pointers.. it saves cycles and will allow * the irq dependencies to be split into different files at a later date diff --git a/include/asm-sparc/kmap_types.h b/include/asm-sparc/kmap_types.h index c5bb34018e95..82431edeb2a1 100644 --- a/include/asm-sparc/kmap_types.h +++ b/include/asm-sparc/kmap_types.h @@ -11,6 +11,8 @@ enum km_type { KM_BIO_DST_IRQ, KM_PTE0, KM_PTE1, + KM_IRQ0, + KM_IRQ1, KM_TYPE_NR }; diff --git a/include/asm-sparc/spinlock.h b/include/asm-sparc/spinlock.h index ae9016d0d7f4..99ee46411786 100644 --- a/include/asm-sparc/spinlock.h +++ b/include/asm-sparc/spinlock.h @@ -42,6 +42,7 @@ typedef struct _rwlock_debug rwlock_t; #define RW_LOCK_UNLOCKED (rwlock_t) { 0, 0, {0} } #define rwlock_init(lp) do { *(lp)= RW_LOCK_UNLOCKED; } while(0) +#define rwlock_is_locked(lp) ((lp)->lock != 0) extern void _do_read_lock(rwlock_t *rw, char *str); extern void _do_read_unlock(rwlock_t *rw, char *str); @@ -141,6 +142,7 @@ typedef struct { volatile unsigned int lock; } rwlock_t; #define RW_LOCK_UNLOCKED (rwlock_t) { 0 } #define rwlock_init(lp) do { *(lp)= RW_LOCK_UNLOCKED; } while(0) +#define rwlock_is_locked(lp) ((lp)->lock != 0) /* Sort of like atomic_t's on Sparc, but even more clever. diff --git a/include/asm-sparc/system.h b/include/asm-sparc/system.h index b9599127fad1..07e3a99188a2 100644 --- a/include/asm-sparc/system.h +++ b/include/asm-sparc/system.h @@ -56,6 +56,17 @@ extern unsigned long empty_zero_page; extern struct linux_romvec *romvec; #define halt() romvec->pv_halt() +extern void sun_do_break(void); +extern int serial_console; +extern int stop_a_enabled; + +static __inline__ int con_is_present(void) +{ + return serial_console ? 0 : 1; +} + +extern struct pt_regs *kbd_pt_regs; + /* When a context switch happens we must flush all user windows so that * the windows of the current process are flushed onto its stack. This * way the windows are all clean for the next process and the stack @@ -113,6 +124,7 @@ extern void fpsave(unsigned long *fpregs, unsigned long *fsr, "restore; restore; restore; restore; restore; restore; restore"); \ } while(0) #define finish_arch_switch(rq, next) do{ }while(0) +#define task_running(rq, p) ((rq)->curr == (p)) /* Much care has gone into this code, do not touch it. * @@ -263,6 +275,15 @@ extern __inline__ unsigned long read_psr_and_cli(void) #define local_irq_save(flags) ((flags) = read_psr_and_cli()) #define local_irq_restore(flags) setipl((flags)) +/* On sparc32 IRQ flags are the PSR register in the PSR_PIL + * field. + */ +#define irqs_disabled() \ +({ unsigned long flags; \ + local_save_flags(flags);\ + (flags & PSR_PIL) != 0; \ +}) + #ifdef CONFIG_SMP extern unsigned char global_irq_holder; @@ -282,9 +303,6 @@ extern void __global_restore_flags(unsigned long flags); #define cli() local_irq_disable() #define sti() local_irq_enable() -#define save_flags(x) local_save_flags(x) -#define restore_flags(x) local_irq_restore(x) -#define save_and_cli(x) local_irq_save(x) #endif diff --git a/include/asm-sparc/unistd.h b/include/asm-sparc/unistd.h index e89bb817c80f..5d3ba06ceb4c 100644 --- a/include/asm-sparc/unistd.h +++ b/include/asm-sparc/unistd.h @@ -203,7 +203,7 @@ #define __NR_setpgid 185 /* Common */ #define __NR_fremovexattr 186 /* SunOS: pathconf */ #define __NR_tkill 187 /* SunOS: fpathconf */ -/* #define __NR_sysconf 188 SunOS Specific */ +#define __NR_exit_group 188 /* Linux specific, sysconf undef SunOS */ #define __NR_uname 189 /* Linux Specific */ #define __NR_init_module 190 /* Linux Specific */ #define __NR_personality 191 /* Linux Specific */ diff --git a/include/asm-sparc64/hardirq.h b/include/asm-sparc64/hardirq.h index 88e27b030c6d..6b6e67e52372 100644 --- a/include/asm-sparc64/hardirq.h +++ b/include/asm-sparc64/hardirq.h @@ -85,8 +85,10 @@ typedef struct { #define irq_enter() (preempt_count() += HARDIRQ_OFFSET) #if CONFIG_PREEMPT +# define in_atomic() (preempt_count() != kernel_locked()) # define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1) #else +# define in_atomic() (preempt_count() != 0) # define IRQ_EXIT_OFFSET HARDIRQ_OFFSET #endif #define irq_exit() \ diff --git a/include/asm-sparc64/ide.h b/include/asm-sparc64/ide.h index fd1d19740f4b..8adfd4967c1c 100644 --- a/include/asm-sparc64/ide.h +++ b/include/asm-sparc64/ide.h @@ -78,112 +78,63 @@ static __inline__ void ide_init_default_hwifs(void) * The following are not needed for the non-m68k ports */ #define ide_ack_intr(hwif) (1) -#define ide_fix_driveid(id) do {} while (0) #define ide_release_lock(lock) do {} while (0) #define ide_get_lock(lock, hdlr, data) do {} while (0) -/* From m68k code... */ - -#ifdef insl -#undef insl -#endif -#ifdef outsl -#undef outsl -#endif -#ifdef insw -#undef insw -#endif -#ifdef outsw -#undef outsw -#endif - -#define insl(data_reg, buffer, wcount) insw(data_reg, buffer, (wcount)<<1) -#define outsl(data_reg, buffer, wcount) outsw(data_reg, buffer, (wcount)<<1) - -#define insw(port, buf, nr) ide_insw((port), (buf), (nr)) -#define outsw(port, buf, nr) ide_outsw((port), (buf), (nr)) - -static __inline__ unsigned int inw_be(unsigned long addr) -{ - unsigned int ret; +/* XXX Known to be broken. Axboe will fix the problems this + * XXX has by making seperate IN/OUT macros for IDE_DATA + * XXX register and rest of IDE regs and also using + * XXX ide_ioreg_t instead of u32 for ports. -DaveM + */ - __asm__ __volatile__("lduha [%1] %2, %0" +#define HAVE_ARCH_IN_BYTE +static __inline__ u8 IN_BYTE(ide_ioreg_t addr) +{ u8 ret; + __asm__ __volatile__("lduba [%1] %2, %0\t/* ide_in_byte */" : "=r" (ret) : "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E)); - return ret; } +static __inline__ u16 IN_WORD(ide_ioreg_t addr) +{ u16 ret; + __asm__ __volatile__("lduha [%1] %2, %0\t/* ide_in_word */" + : "=r" (ret) + : "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E)); + return ret; +} +static __inline__ u16 IN_LONG(ide_ioreg_t addr) +{ u32 ret; + __asm__ __volatile__("lduwa [%1] %2, %0\t/* ide_in_long */" + : "=r" (ret) + : "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E)); + return ret; +} +#define IN_BYTE_P IN_BYTE +#define IN_WORD_P IN_WORD +#define IN_LONG_P IN_LONG -static __inline__ void ide_insw(unsigned long port, - void *dst, - unsigned long count) +#define HAVE_ARCH_OUT_BYTE +static __inline__ void OUT_BYTE(u8 byte, ide_ioreg_t addr) { -#if (L1DCACHE_SIZE > PAGE_SIZE) /* is there D$ aliasing problem */ - unsigned long end = (unsigned long)dst + (count << 1); -#endif - u16 *ps = dst; - u32 *pi; - - if(((u64)ps) & 0x2) { - *ps++ = inw_be(port); - count--; - } - pi = (u32 *)ps; - while(count >= 2) { - u32 w; - - w = inw_be(port) << 16; - w |= inw_be(port); - *pi++ = w; - count -= 2; - } - ps = (u16 *)pi; - if(count) - *ps++ = inw_be(port); - -#if (L1DCACHE_SIZE > PAGE_SIZE) /* is there D$ aliasing problem */ - __flush_dcache_range((unsigned long)dst, end); -#endif + __asm__ __volatile__("stba %r0, [%1] %2\t/* ide_out_byte */" + : /* no outputs */ + : "Jr" (byte), "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E)); } - -static __inline__ void outw_be(unsigned short w, unsigned long addr) +static __inline__ void OUT_WORD(u16 word, ide_ioreg_t addr) { - __asm__ __volatile__("stha %0, [%1] %2" + __asm__ __volatile__("stha %r0, [%1] %2\t/* ide_out_word */" : /* no outputs */ - : "r" (w), "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E)); + : "Jr" (word), "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E)); } - -static __inline__ void ide_outsw(unsigned long port, - const void *src, - unsigned long count) +static __inline__ void OUT_LONG(u32 _long, ide_ioreg_t addr) { -#if (L1DCACHE_SIZE > PAGE_SIZE) /* is there D$ aliasing problem */ - unsigned long end = (unsigned long)src + (count << 1); -#endif - const u16 *ps = src; - const u32 *pi; - - if(((u64)src) & 0x2) { - outw_be(*ps++, port); - count--; - } - pi = (const u32 *)ps; - while(count >= 2) { - u32 w; - - w = *pi++; - outw_be((w >> 16), port); - outw_be(w, port); - count -= 2; - } - ps = (const u16 *)pi; - if(count) - outw_be(*ps, port); - -#if (L1DCACHE_SIZE > PAGE_SIZE) /* is there D$ aliasing problem */ - __flush_dcache_range((unsigned long)src, end); -#endif + __asm__ __volatile__("stwa %r0, [%1] %2\t/* ide_out_long */" + : /* no outputs */ + : "Jr" (_long), "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E)); } +#define OUT_BYTE_P OUT_BYTE +#define OUT_WORD_P OUT_WORD +#define OUT_LONG_P OUT_LONG #endif /* __KERNEL__ */ diff --git a/include/asm-sparc64/spinlock.h b/include/asm-sparc64/spinlock.h index 34c221d282a1..48c93f17bb4f 100644 --- a/include/asm-sparc64/spinlock.h +++ b/include/asm-sparc64/spinlock.h @@ -112,6 +112,7 @@ extern int _spin_trylock (spinlock_t *lock); typedef unsigned int rwlock_t; #define RW_LOCK_UNLOCKED 0 #define rwlock_init(lp) do { *(lp) = RW_LOCK_UNLOCKED; } while(0) +#define rwlock_is_locked(x) (*(x) != RW_LOCK_UNLOCKED) extern void __read_lock(rwlock_t *); extern void __read_unlock(rwlock_t *); @@ -132,6 +133,7 @@ typedef struct { } rwlock_t; #define RW_LOCK_UNLOCKED (rwlock_t) { 0, 0, 0xff, { 0, 0, 0, 0 } } #define rwlock_init(lp) do { *(lp) = RW_LOCK_UNLOCKED; } while(0) +#define rwlock_is_locked(x) ((x)->lock != 0) extern void _do_read_lock(rwlock_t *rw, char *str); extern void _do_read_unlock(rwlock_t *rw, char *str); diff --git a/include/asm-sparc64/unistd.h b/include/asm-sparc64/unistd.h index 2b09e8888220..d7eb4d220b79 100644 --- a/include/asm-sparc64/unistd.h +++ b/include/asm-sparc64/unistd.h @@ -203,7 +203,7 @@ #define __NR_setpgid 185 /* Common */ #define __NR_fremovexattr 186 /* SunOS: pathconf */ #define __NR_tkill 187 /* SunOS: fpathconf */ -/* #define __NR_sysconf 188 SunOS Specific */ +#define __NR_exit_group 188 /* Linux specific, sysconf undef SunOS */ #define __NR_uname 189 /* Linux Specific */ #define __NR_init_module 190 /* Linux Specific */ #define __NR_personality 191 /* Linux Specific */ diff --git a/include/linux/aio.h b/include/linux/aio.h index 04f710ac0cc2..c819f731e4a2 100644 --- a/include/linux/aio.h +++ b/include/linux/aio.h @@ -1,7 +1,6 @@ #ifndef __LINUX__AIO_H #define __LINUX__AIO_H -#include <linux/tqueue.h> #include <linux/list.h> #include <asm/atomic.h> @@ -21,10 +20,14 @@ struct kioctx; #define KIOCB_C_CANCELLED 0x01 #define KIOCB_C_COMPLETE 0x02 +#define KIOCB_SYNC_KEY (~0U) + #define KIOCB_PRIVATE_SIZE (16 * sizeof(long)) struct kiocb { int ki_users; + unsigned ki_key; /* id of this request */ + struct file *ki_filp; struct kioctx *ki_ctx; /* may be NULL for sync ops */ int (*ki_cancel)(struct kiocb *, struct io_event *); @@ -34,17 +37,19 @@ struct kiocb { void *ki_data; /* for use by the the file */ void *ki_user_obj; /* pointer to userland's iocb */ __u64 ki_user_data; /* user's data for completion */ - unsigned ki_key; /* id of this request */ long private[KIOCB_PRIVATE_SIZE/sizeof(long)]; }; -#define init_sync_kiocb(x, filp) \ - do { \ - (x)->ki_users = 1; \ - (x)->ki_filp = (filp); \ - (x)->ki_ctx = 0; \ - (x)->ki_cancel = NULL; \ +#define init_sync_kiocb(x, filp) \ + do { \ + struct task_struct *tsk = current; \ + (x)->ki_users = 1; \ + (x)->ki_key = KIOCB_SYNC_KEY; \ + (x)->ki_filp = (filp); \ + (x)->ki_ctx = &tsk->active_mm->default_kioctx; \ + (x)->ki_cancel = NULL; \ + (x)->ki_user_obj = tsk; \ } while (0) #define AIO_RING_MAGIC 0xa10a10a1 @@ -105,6 +110,7 @@ struct kioctx { /* prototypes */ extern unsigned aio_max_size; +extern ssize_t FASTCALL(wait_on_sync_kiocb(struct kiocb *iocb)); extern int FASTCALL(aio_put_req(struct kiocb *iocb)); extern int FASTCALL(aio_complete(struct kiocb *iocb, long res, long res2)); extern void FASTCALL(__put_ioctx(struct kioctx *ctx)); diff --git a/include/linux/fs.h b/include/linux/fs.h index d58cd8b88fa8..622481a00115 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -307,8 +307,7 @@ struct address_space_operations { int (*bmap)(struct address_space *, long); int (*invalidatepage) (struct page *, unsigned long); int (*releasepage) (struct page *, int); - int (*direct_IO)(int, struct inode *, char *buf, - loff_t offset, size_t count); + int (*direct_IO)(int, struct inode *, const struct iovec *iov, loff_t offset, unsigned long nr_segs); }; struct backing_dev_info; @@ -1245,14 +1244,18 @@ extern int generic_file_mmap(struct file *, struct vm_area_struct *); extern int file_read_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size); extern ssize_t generic_file_read(struct file *, char *, size_t, loff_t *); extern ssize_t generic_file_write(struct file *, const char *, size_t, loff_t *); -extern ssize_t generic_file_write_nolock(struct file *, const char *, size_t, loff_t *); +ssize_t generic_file_write_nolock(struct file *file, const struct iovec *iov, + unsigned long nr_segs, loff_t *ppos); extern ssize_t generic_file_sendfile(struct file *, struct file *, loff_t *, size_t); extern void do_generic_file_read(struct file *, loff_t *, read_descriptor_t *, read_actor_t); -ssize_t generic_file_direct_IO(int rw, struct inode *inode, char *buf, - loff_t offset, size_t count); -int generic_direct_IO(int rw, struct inode *inode, char *buf, - loff_t offset, size_t count, get_blocks_t *get_blocks); - +extern ssize_t generic_file_direct_IO(int rw, struct inode *inode, + const struct iovec *iov, loff_t offset, unsigned long nr_segs); +extern int generic_direct_IO(int rw, struct inode *inode, const struct iovec + *iov, loff_t offset, unsigned long nr_segs, get_blocks_t *get_blocks); +extern ssize_t generic_file_readv(struct file *filp, const struct iovec *iov, + unsigned long nr_segs, loff_t *ppos); +ssize_t generic_file_writev(struct file *filp, const struct iovec *iov, + unsigned long nr_segs, loff_t *ppos); extern loff_t no_llseek(struct file *file, loff_t offset, int origin); extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin); extern loff_t remote_llseek(struct file *file, loff_t offset, int origin); diff --git a/include/linux/init_task.h b/include/linux/init_task.h index bdf03241a009..4bd8a09d2bbc 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h @@ -18,15 +18,29 @@ .fd_array = { NULL, } \ } +#define INIT_KIOCTX(name, which_mm) \ +{ \ + .users = ATOMIC_INIT(1), \ + .dead = 0, \ + .mm = &which_mm, \ + .user_id = 0, \ + .next = NULL, \ + .wait = __WAIT_QUEUE_HEAD_INITIALIZER(name.wait), \ + .ctx_lock = SPIN_LOCK_UNLOCKED, \ + .reqs_active = 0U, \ + .max_reqs = ~0U, \ +} + #define INIT_MM(name) \ -{ \ - .mm_rb = RB_ROOT, \ - .pgd = swapper_pg_dir, \ - .mm_users = ATOMIC_INIT(2), \ - .mm_count = ATOMIC_INIT(1), \ - .mmap_sem = __RWSEM_INITIALIZER(name.mmap_sem), \ - .page_table_lock = SPIN_LOCK_UNLOCKED, \ - .mmlist = LIST_HEAD_INIT(name.mmlist), \ +{ \ + .mm_rb = RB_ROOT, \ + .pgd = swapper_pg_dir, \ + .mm_users = ATOMIC_INIT(2), \ + .mm_count = ATOMIC_INIT(1), \ + .mmap_sem = __RWSEM_INITIALIZER(name.mmap_sem), \ + .page_table_lock = SPIN_LOCK_UNLOCKED, \ + .mmlist = LIST_HEAD_INIT(name.mmlist), \ + .default_kioctx = INIT_KIOCTX(name.default_kioctx, name), \ } #define INIT_SIGNALS(sig) { \ @@ -61,6 +75,7 @@ .parent = &tsk, \ .children = LIST_HEAD_INIT(tsk.children), \ .sibling = LIST_HEAD_INIT(tsk.sibling), \ + .group_leader = &tsk, \ .thread_group = LIST_HEAD_INIT(tsk.thread_group), \ .wait_chldexit = __WAIT_QUEUE_HEAD_INITIALIZER(tsk.wait_chldexit),\ .real_timer = { \ diff --git a/include/linux/llc.h b/include/linux/llc.h index 824a149e9e6b..77ac5d9df544 100644 --- a/include/linux/llc.h +++ b/include/linux/llc.h @@ -78,17 +78,6 @@ enum llc_sockopts { #define LLC_SAP_DYN_STOP 0xDE #define LLC_SAP_DYN_TRIES 4 -struct sock; - -struct llc_ui_opt { - u16 link; /* network layer link number */ - struct llc_sap *sap; /* pointer to parent SAP */ - struct sock *core_sk; - struct net_device *dev; /* device to send to remote */ - struct sockaddr_llc addr; /* address sock is bound to */ -}; - -#define llc_ui_sk(__sk) ((struct llc_ui_opt *)(__sk)->protinfo) #define llc_ui_skb_cb(__skb) ((struct sockaddr_llc *)&((__skb)->cb[0])) #ifdef CONFIG_LLC_UI diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 5eea9545b69a..9a1ad256e2cc 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -1561,6 +1561,7 @@ #define PCI_DEVICE_ID_TIGON3_5701 0x1645 #define PCI_DEVICE_ID_TIGON3_5702 0x1646 #define PCI_DEVICE_ID_TIGON3_5703 0x1647 +#define PCI_DEVICE_ID_TIGON3_5704 0x1648 #define PCI_DEVICE_ID_TIGON3_5702FE 0x164d #define PCI_DEVICE_ID_TIGON3_5702X 0x16a6 #define PCI_DEVICE_ID_TIGON3_5703X 0x16a7 diff --git a/include/linux/sched.h b/include/linux/sched.h index bdce46f40af2..5a7e7c21009f 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -169,7 +169,8 @@ struct namespace; /* Maximum number of active map areas.. This is a random (large) number */ #define MAX_MAP_COUNT (65536) -struct kioctx; +#include <linux/aio.h> + struct mm_struct { struct vm_area_struct * mmap; /* list of VMAs */ rb_root_t mm_rb; @@ -202,6 +203,8 @@ struct mm_struct { /* aio bits */ rwlock_t ioctx_list_lock; struct kioctx *ioctx_list; + + struct kioctx default_kioctx; }; extern int mmlist_nr; @@ -219,8 +222,6 @@ struct signal_struct { /* thread group exit support */ int group_exit; int group_exit_code; - - struct completion group_exit_done; }; /* @@ -316,6 +317,7 @@ struct task_struct { struct task_struct *parent; /* parent process */ struct list_head children; /* list of my children */ struct list_head sibling; /* linkage in my parent's children list */ + struct task_struct *group_leader; struct list_head thread_group; /* PID hash table linkage. */ @@ -758,14 +760,16 @@ static inline void remove_wait_queue_locked(wait_queue_head_t *q, #define remove_parent(p) list_del_init(&(p)->sibling) #define add_parent(p, parent) list_add_tail(&(p)->sibling,&(parent)->children) -#define REMOVE_LINKS(p) do { \ - list_del_init(&(p)->tasks); \ - remove_parent(p); \ +#define REMOVE_LINKS(p) do { \ + if (thread_group_leader(p)) \ + list_del_init(&(p)->tasks); \ + remove_parent(p); \ } while (0) -#define SET_LINKS(p) do { \ - list_add_tail(&(p)->tasks,&init_task.tasks); \ - add_parent(p, (p)->parent); \ +#define SET_LINKS(p) do { \ + if (thread_group_leader(p)) \ + list_add_tail(&(p)->tasks,&init_task.tasks); \ + add_parent(p, (p)->parent); \ } while (0) static inline struct task_struct *eldest_child(struct task_struct *p) @@ -795,11 +799,18 @@ static inline struct task_struct *younger_sibling(struct task_struct *p) #define next_task(p) list_entry((p)->tasks.next, struct task_struct, tasks) #define prev_task(p) list_entry((p)->tasks.prev, struct task_struct, tasks) -#define for_each_task(p) \ +#define for_each_process(p) \ for (p = &init_task ; (p = next_task(p)) != &init_task ; ) -#define for_each_thread(task) \ - for (task = next_thread(current) ; task != current ; task = next_thread(task)) +/* + * Careful: do_each_thread/while_each_thread is a double loop so + * 'break' will not work as expected - use goto instead. + */ +#define do_each_thread(g, t) \ + for (g = t = &init_task ; (g = t = next_task(g)) != &init_task ; ) do + +#define while_each_thread(g, t) \ + while ((t = next_thread(t)) != g) static inline task_t *next_thread(task_t *p) { @@ -827,6 +838,9 @@ static inline task_t *prev_thread(task_t *p) #define thread_group_leader(p) (p->pid == p->tgid) +#define delay_group_leader(p) \ + (p->tgid == p->pid && !list_empty(&p->thread_group)) + extern void unhash_process(struct task_struct *p); /* Protects ->fs, ->files, ->mm, and synchronises with wait4(). Nests inside tasklist_lock */ diff --git a/include/linux/uio.h b/include/linux/uio.h index beaafffd3cfb..ec098c8e6793 100644 --- a/include/linux/uio.h +++ b/include/linux/uio.h @@ -34,4 +34,19 @@ struct iovec /* Beg pardon: BSD has 1024 --ANK */ #endif +/* + * Total number of bytes covered by an iovec + */ +static inline size_t iov_length(const struct iovec *iov, unsigned long nr_segs) +{ + unsigned long seg; + size_t ret = 0; + + for (seg = 0; seg < nr_segs; seg++) + ret += iov[seg].iov_len; + return ret; +} + +unsigned long iov_shorten(struct iovec *iov, unsigned long nr_segs, size_t to); + #endif diff --git a/include/net/llc_c_ev.h b/include/net/llc_c_ev.h index 44261460c560..5fe315ebcc7c 100644 --- a/include/net/llc_c_ev.h +++ b/include/net/llc_c_ev.h @@ -122,27 +122,14 @@ struct llc_conn_ev_prim_if { /* Event LLC_CONN_EV_TYPE_PDU interface */ struct llc_conn_ev_pdu_if { - u8 ev; - u8 reason; -}; - -/* Event interface for timer-generated events */ -struct llc_conn_ev_tmr_if { - struct sock *sk; - u32 component_handle; - void *timer_specific; -}; - -struct llc_conn_ev_rpt_sts_if { - u8 status; + u8 ev; + u8 reason; }; union llc_conn_ev_if { struct llc_conn_ev_simple_if a; /* 'a' for simple, easy ... */ struct llc_conn_ev_prim_if prim; struct llc_conn_ev_pdu_if pdu; - struct llc_conn_ev_tmr_if tmr; - struct llc_conn_ev_rpt_sts_if rsts; /* report status */ }; struct llc_conn_state_ev { diff --git a/include/net/llc_c_st.h b/include/net/llc_c_st.h index f0b40ed22754..0e79cfba4b3b 100644 --- a/include/net/llc_c_st.h +++ b/include/net/llc_c_st.h @@ -33,15 +33,15 @@ /* Connection state table structure */ struct llc_conn_state_trans { - llc_conn_ev_t ev; - u8 next_state; - llc_conn_ev_qfyr_t *ev_qualifiers; - llc_conn_action_t *ev_actions; + llc_conn_ev_t ev; + u8 next_state; + llc_conn_ev_qfyr_t *ev_qualifiers; + llc_conn_action_t *ev_actions; }; struct llc_conn_state { - u8 current_state; - struct llc_conn_state_trans **transitions; + u8 current_state; + struct llc_conn_state_trans **transitions; }; extern struct llc_conn_state llc_conn_state_table[]; diff --git a/include/net/llc_conn.h b/include/net/llc_conn.h index db42c7f6fc78..ac0a2bb7aa22 100644 --- a/include/net/llc_conn.h +++ b/include/net/llc_conn.h @@ -2,7 +2,7 @@ #define LLC_CONN_H /* * Copyright (c) 1997 by Procom Technology, Inc. - * 2001 by Arnaldo Carvalho de Melo <acme@conectiva.com.br> + * 2001, 2002 by Arnaldo Carvalho de Melo <acme@conectiva.com.br> * * This program can be redistributed or modified under the terms of the * GNU General Public License as published by the Free Software Foundation. @@ -13,19 +13,17 @@ */ #include <linux/timer.h> #include <net/llc_if.h> - -#undef DEBUG_LLC_CONN_ALLOC +#include <linux/llc.h> struct llc_timer { struct timer_list timer; - u8 running; /* timer is running or no */ u16 expire; /* timer expire time */ }; struct llc_opt { struct list_head node; /* entry in sap->sk_list.list */ struct sock *sk; /* sock that has this llc_opt */ - void *handler; /* for upper layers usage */ + struct sockaddr_llc addr; /* address sock is bound to */ u8 state; /* state of connection */ struct llc_sap *sap; /* pointer to parent SAP */ struct llc_addr laddr; /* lsap/mac pair */ @@ -80,63 +78,14 @@ struct llc_opt { struct llc_conn_state_ev; -extern struct sock *__llc_sock_alloc(void); -extern void __llc_sock_free(struct sock *sk, u8 free); - -#ifdef DEBUG_LLC_CONN_ALLOC -#define dump_stack() printk(KERN_INFO "call trace: %p, %p, %p\n", \ - __builtin_return_address(0), \ - __builtin_return_address(1), \ - __builtin_return_address(2)); -#define llc_sock_alloc() ({ \ - struct sock *__sk = __llc_sock_alloc(); \ - if (__sk) { \ - llc_sk(__sk)->f_alloc = __FUNCTION__; \ - llc_sk(__sk)->l_alloc = __LINE__; \ - } \ - __sk;}) -#define __llc_sock_assert(__sk) \ - if (llc_sk(__sk)->f_free) { \ - printk(KERN_ERR \ - "%p conn (alloc'd @ %s(%d)) " \ - "already freed @ %s(%d) " \ - "being used again @ %s(%d)\n", \ - llc_sk(__sk), \ - llc_sk(__sk)->f_alloc, llc_sk(__sk)->l_alloc, \ - llc_sk(__sk)->f_free, llc_sk(__sk)->l_free, \ - __FUNCTION__, __LINE__); \ - dump_stack(); -#define llc_sock_free(__sk) \ -{ \ - __llc_sock_assert(__sk) \ - } else { \ - __llc_sock_free(__sk, 0); \ - llc_sk(__sk)->f_free = __FUNCTION__; \ - llc_sk(__sk)->l_free = __LINE__; \ - } \ -} -#define llc_sock_assert(__sk) \ -{ \ - __llc_sock_assert(__sk); \ - return; } \ -} -#define llc_sock_assert_ret(__sk, __ret) \ -{ \ - __llc_sock_assert(__sk); \ - return __ret; } \ -} -#else /* DEBUG_LLC_CONN_ALLOC */ -#define llc_sock_alloc() __llc_sock_alloc() -#define llc_sock_free(__sk) __llc_sock_free(__sk, 1) -#define llc_sock_assert(__sk) -#define llc_sock_assert_ret(__sk) -#endif /* DEBUG_LLC_CONN_ALLOC */ +extern struct sock *llc_sk_alloc(int family, int priority); +extern void llc_sk_free(struct sock *sk); -extern void llc_sock_reset(struct sock *sk); -extern int llc_sock_init(struct sock *sk); +extern void llc_sk_reset(struct sock *sk); +extern int llc_sk_init(struct sock *sk); /* Access to a connection */ -extern int llc_conn_send_ev(struct sock *sk, struct sk_buff *skb); +extern int llc_conn_state_process(struct sock *sk, struct sk_buff *skb); extern void llc_conn_send_pdu(struct sock *sk, struct sk_buff *skb); extern void llc_conn_rtn_pdu(struct sock *sk, struct sk_buff *skb); extern void llc_conn_free_ev(struct sk_buff *skb); @@ -146,8 +95,11 @@ extern void llc_conn_resend_i_pdu_as_rsp(struct sock *sk, u8 nr, u8 first_f_bit); extern int llc_conn_remove_acked_pdus(struct sock *conn, u8 nr, u16 *how_many_unacked); -extern struct sock *llc_find_sock(struct llc_sap *sap, struct llc_addr *daddr, - struct llc_addr *laddr); +extern struct sock *llc_lookup_established(struct llc_sap *sap, + struct llc_addr *daddr, + struct llc_addr *laddr); +extern struct sock *llc_lookup_listener(struct llc_sap *sap, + struct llc_addr *laddr); extern u8 llc_data_accept_state(u8 state); extern void llc_build_offset_table(void); #endif /* LLC_CONN_H */ diff --git a/include/net/llc_evnt.h b/include/net/llc_evnt.h index 7029489d5f9e..b521be2a5582 100644 --- a/include/net/llc_evnt.h +++ b/include/net/llc_evnt.h @@ -43,29 +43,18 @@ struct llc_stat_ev_prim_if { struct llc_stat_ev_pdu_if { u8 reason; - struct sk_buff *skb; -}; - -struct llc_stat_ev_tmr_if { - void *timer_specific; -}; - -struct llc_stat_ev_rpt_sts_if { - u8 status; }; union llc_stat_ev_if { struct llc_stat_ev_simple_if a; /* 'a' for simple, easy ... */ struct llc_stat_ev_prim_if prim; struct llc_stat_ev_pdu_if pdu; - struct llc_stat_ev_tmr_if tmr; - struct llc_stat_ev_rpt_sts_if rsts; /* report status */ }; struct llc_station_state_ev { - u8 type; + u8 type; union llc_stat_ev_if data; - struct list_head node; /* node in station->ev_q.list */ + struct list_head node; /* node in station->ev_q.list */ }; static __inline__ struct llc_station_state_ev * diff --git a/include/net/llc_if.h b/include/net/llc_if.h index cc2348004161..b6f50717dd5c 100644 --- a/include/net/llc_if.h +++ b/include/net/llc_if.h @@ -14,13 +14,15 @@ /* Defines LLC interface to network layer */ /* Available primitives */ #include <linux/if.h> +#include <linux/if_arp.h> +#include <linux/llc.h> #define LLC_DATAUNIT_PRIM 0 #define LLC_CONN_PRIM 1 #define LLC_DATA_PRIM 2 #define LLC_DISC_PRIM 3 #define LLC_RESET_PRIM 4 -#define LLC_FLOWCONTROL_PRIM 5 +#define LLC_FLOWCONTROL_PRIM 5 /* Not supported at this time */ #define LLC_DISABLE_PRIM 6 #define LLC_XID_PRIM 7 #define LLC_TEST_PRIM 8 @@ -65,46 +67,12 @@ struct llc_addr { u8 mac[IFHWADDRLEN]; }; -/* Primitive-specific data */ -struct llc_prim_conn { - struct llc_addr saddr; /* used by request only */ - struct llc_addr daddr; /* used by request only */ - u8 status; /* reason for failure */ - u8 pri; /* service_class */ - struct net_device *dev; - struct sock *sk; /* returned from REQUEST */ - void *handler; /* upper layer use, - stored in llc_opt->handler */ - u16 link; - struct sk_buff *skb; /* received SABME */ -}; - -struct llc_prim_disc { - struct sock *sk; - u16 link; - u8 reason; /* not used by request */ -}; - struct llc_prim_reset { struct sock *sk; u16 link; u8 reason; /* used only by indicate */ }; -struct llc_prim_flow_ctrl { - struct sock *sk; - u16 link; - u32 amount; -}; - -struct llc_prim_data { - struct sock *sk; - u16 link; - u8 pri; - struct sk_buff *skb; /* pointer to frame */ - u8 status; /* reason */ -}; - /* Sending data in conection-less mode */ struct llc_prim_unit_data { struct llc_addr saddr; @@ -129,11 +97,7 @@ struct llc_prim_test { }; union llc_u_prim_data { - struct llc_prim_conn conn; - struct llc_prim_disc disc; struct llc_prim_reset res; - struct llc_prim_flow_ctrl fc; - struct llc_prim_data data; /* data */ struct llc_prim_unit_data udata; /* unit data */ struct llc_prim_xid xid; struct llc_prim_test test; @@ -152,4 +116,18 @@ typedef int (*llc_prim_call_t)(struct llc_prim_if_block *prim_if); extern struct llc_sap *llc_sap_open(llc_prim_call_t network_indicate, llc_prim_call_t network_confirm, u8 lsap); extern void llc_sap_close(struct llc_sap *sap); + +extern int llc_establish_connection(struct sock *sk, u8 *lmac, + u8 *dmac, u8 dsap); +extern int llc_build_and_send_pkt(struct sock *sk, struct sk_buff *skb); +extern void llc_build_and_send_ui_pkt(struct llc_sap *sap, + struct sk_buff *skb, + u8 *dmac, u8 dsap); +extern void llc_build_and_send_xid_pkt(struct llc_sap *sap, + struct sk_buff *skb, + u8 *dmac, u8 dsap); +extern void llc_build_and_send_test_pkt(struct llc_sap *sap, + struct sk_buff *skb, + u8 *dmac, u8 dsap); +extern int llc_send_disc(struct sock *sk); #endif /* LLC_IF_H */ diff --git a/include/net/llc_mac.h b/include/net/llc_mac.h index 9f2fb80ba98e..3ab584987448 100644 --- a/include/net/llc_mac.h +++ b/include/net/llc_mac.h @@ -2,7 +2,7 @@ #define LLC_MAC_H /* * Copyright (c) 1997 by Procom Technology, Inc. - * 2001 by Arnaldo Carvalho de Melo <acme@conectiva.com.br> + * 2001, 2002 by Arnaldo Carvalho de Melo <acme@conectiva.com.br> * * This program can be redistributed or modified under the terms of the * GNU General Public License as published by the Free Software Foundation. @@ -13,13 +13,12 @@ */ /* Defines MAC-layer interface to LLC layer */ extern int mac_send_pdu(struct sk_buff *skb); -extern int mac_indicate(struct sk_buff *skb, struct net_device *dev, - struct packet_type *pt); +extern int llc_rcv(struct sk_buff *skb, struct net_device *dev, + struct packet_type *pt); extern struct net_device *mac_dev_peer(struct net_device *current_dev, int type, u8 *mac); -extern int llc_pdu_router(struct llc_sap *sap, struct sock *sk, - struct sk_buff *skb, u8 type); extern u16 lan_hdrs_init(struct sk_buff *skb, u8 *sa, u8 *da); +extern int llc_conn_rcv(struct sock *sk, struct sk_buff *skb); static __inline__ void llc_set_backlog_type(struct sk_buff *skb, char type) { @@ -31,4 +30,36 @@ static __inline__ char llc_backlog_type(struct sk_buff *skb) return skb->cb[sizeof(skb->cb) - 1]; } +extern u8 llc_mac_null_var[IFHWADDRLEN]; + +/** + * llc_mac_null - determines if a address is a null mac address + * @mac: Mac address to test if null. + * + * Determines if a given address is a null mac address. Returns 0 if the + * address is not a null mac, 1 if the address is a null mac. + */ +static __inline__ int llc_mac_null(u8 *mac) +{ + return !memcmp(mac, llc_mac_null_var, IFHWADDRLEN); +} + +static __inline__ int llc_addrany(struct llc_addr *addr) +{ + return llc_mac_null(addr->mac) && !addr->lsap; +} + +/** + * llc_mac_match - determines if two mac addresses are the same + * @mac1: First mac address to compare. + * @mac2: Second mac address to compare. + * + * Determines if two given mac address are the same. Returns 0 if there + * is not a complete match up to len, 1 if a complete match up to len is + * found. + */ +static __inline__ int llc_mac_match(u8 *mac1, u8 *mac2) +{ + return !memcmp(mac1, mac2, IFHWADDRLEN); +} #endif /* LLC_MAC_H */ diff --git a/include/net/llc_main.h b/include/net/llc_main.h index e3aa4d2c7632..e3b0c7a09caa 100644 --- a/include/net/llc_main.h +++ b/include/net/llc_main.h @@ -30,7 +30,6 @@ * * @state - state of station * @xid_r_count - XID response PDU counter - * @ack_tmr_running - 1 or 0 * @mac_sa - MAC source address * @sap_list - list of related SAPs * @ev_q - events entering state mach. @@ -40,7 +39,6 @@ struct llc_station { u8 state; u8 xid_r_count; struct timer_list ack_timer; - u8 ack_tmr_running; u8 retry_count; u8 maximum_retry; u8 mac_sa[6]; @@ -61,8 +59,8 @@ extern void llc_sap_save(struct llc_sap *sap); extern void llc_free_sap(struct llc_sap *sap); extern struct llc_sap *llc_sap_find(u8 lsap); extern struct llc_station *llc_station_get(void); -extern void llc_station_send_ev(struct llc_station *station, - struct sk_buff *skb); +extern void llc_station_state_process(struct llc_station *station, + struct sk_buff *skb); extern void llc_station_send_pdu(struct llc_station *station, struct sk_buff *skb); extern struct sk_buff *llc_alloc_frame(void); diff --git a/include/net/llc_pdu.h b/include/net/llc_pdu.h index 6236c0cab669..02145e59174c 100644 --- a/include/net/llc_pdu.h +++ b/include/net/llc_pdu.h @@ -237,35 +237,35 @@ struct llc_frmr_info { extern void llc_pdu_set_cmd_rsp(struct sk_buff *skb, u8 type); extern void llc_pdu_set_pf_bit(struct sk_buff *skb, u8 bit_value); -extern int llc_pdu_decode_pf_bit(struct sk_buff *skb, u8 *pf_bit); -extern int llc_pdu_decode_cr_bit(struct sk_buff *skb, u8 *cr_bit); -extern int llc_pdu_decode_sa(struct sk_buff *skb, u8 *sa); -extern int llc_pdu_decode_da(struct sk_buff *skb, u8 *ds); -extern int llc_pdu_decode_dsap(struct sk_buff *skb, u8 *dsap); -extern int llc_pdu_decode_ssap(struct sk_buff *skb, u8 *ssap); -extern int llc_decode_pdu_type(struct sk_buff *skb, u8 *destination); +extern void llc_pdu_decode_pf_bit(struct sk_buff *skb, u8 *pf_bit); +extern void llc_pdu_decode_cr_bit(struct sk_buff *skb, u8 *cr_bit); +extern void llc_pdu_decode_sa(struct sk_buff *skb, u8 *sa); +extern void llc_pdu_decode_da(struct sk_buff *skb, u8 *ds); +extern void llc_pdu_decode_dsap(struct sk_buff *skb, u8 *dsap); +extern void llc_pdu_decode_ssap(struct sk_buff *skb, u8 *ssap); +extern void llc_decode_pdu_type(struct sk_buff *skb, u8 *destination); extern void llc_pdu_header_init(struct sk_buff *skb, u8 pdu_type, u8 ssap, u8 dsap, u8 cr); -extern int llc_pdu_init_as_ui_cmd(struct sk_buff *skb); -extern int llc_pdu_init_as_xid_cmd(struct sk_buff *skb, u8 svcs_supported, +extern void llc_pdu_init_as_ui_cmd(struct sk_buff *skb); +extern void llc_pdu_init_as_xid_cmd(struct sk_buff *skb, u8 svcs_supported, u8 rx_window); -extern int llc_pdu_init_as_test_cmd(struct sk_buff *skb); -extern int llc_pdu_init_as_disc_cmd(struct sk_buff *skb, u8 p_bit); -extern int llc_pdu_init_as_i_cmd(struct sk_buff *skb, u8 p_bit, u8 ns, u8 nr); -extern int llc_pdu_init_as_rej_cmd(struct sk_buff *skb, u8 p_bit, u8 nr); -extern int llc_pdu_init_as_rnr_cmd(struct sk_buff *skb, u8 p_bit, u8 nr); -extern int llc_pdu_init_as_rr_cmd(struct sk_buff *skb, u8 p_bit, u8 nr); -extern int llc_pdu_init_as_sabme_cmd(struct sk_buff *skb, u8 p_bit); -extern int llc_pdu_init_as_dm_rsp(struct sk_buff *skb, u8 f_bit); -extern int llc_pdu_init_as_xid_rsp(struct sk_buff *skb, u8 svcs_supported, - u8 rx_window); -extern int llc_pdu_init_as_test_rsp(struct sk_buff *skb, - struct sk_buff *ev_skb); -extern int llc_pdu_init_as_frmr_rsp(struct sk_buff *skb, - struct llc_pdu_sn *prev_pdu, - u8 f_bit, u8 vs, u8 vr, u8 vzyxw); -extern int llc_pdu_init_as_rr_rsp(struct sk_buff *skb, u8 f_bit, u8 nr); -extern int llc_pdu_init_as_rej_rsp(struct sk_buff *skb, u8 f_bit, u8 nr); -extern int llc_pdu_init_as_rnr_rsp(struct sk_buff *skb, u8 f_bit, u8 nr); -extern int llc_pdu_init_as_ua_rsp(struct sk_buff *skb, u8 f_bit); +extern void llc_pdu_init_as_test_cmd(struct sk_buff *skb); +extern void llc_pdu_init_as_disc_cmd(struct sk_buff *skb, u8 p_bit); +extern void llc_pdu_init_as_i_cmd(struct sk_buff *skb, u8 p_bit, u8 ns, u8 nr); +extern void llc_pdu_init_as_rej_cmd(struct sk_buff *skb, u8 p_bit, u8 nr); +extern void llc_pdu_init_as_rnr_cmd(struct sk_buff *skb, u8 p_bit, u8 nr); +extern void llc_pdu_init_as_rr_cmd(struct sk_buff *skb, u8 p_bit, u8 nr); +extern void llc_pdu_init_as_sabme_cmd(struct sk_buff *skb, u8 p_bit); +extern void llc_pdu_init_as_dm_rsp(struct sk_buff *skb, u8 f_bit); +extern void llc_pdu_init_as_xid_rsp(struct sk_buff *skb, u8 svcs_supported, + u8 rx_window); +extern void llc_pdu_init_as_test_rsp(struct sk_buff *skb, + struct sk_buff *ev_skb); +extern void llc_pdu_init_as_frmr_rsp(struct sk_buff *skb, + struct llc_pdu_sn *prev_pdu, + u8 f_bit, u8 vs, u8 vr, u8 vzyxw); +extern void llc_pdu_init_as_rr_rsp(struct sk_buff *skb, u8 f_bit, u8 nr); +extern void llc_pdu_init_as_rej_rsp(struct sk_buff *skb, u8 f_bit, u8 nr); +extern void llc_pdu_init_as_rnr_rsp(struct sk_buff *skb, u8 f_bit, u8 nr); +extern void llc_pdu_init_as_ua_rsp(struct sk_buff *skb, u8 f_bit); #endif /* LLC_PDU_H */ diff --git a/include/net/llc_s_ev.h b/include/net/llc_s_ev.h index 6127f960a986..c1f124f9d3c8 100644 --- a/include/net/llc_s_ev.h +++ b/include/net/llc_s_ev.h @@ -52,20 +52,10 @@ struct llc_sap_ev_pdu_if { u8 reason; }; -struct llc_sap_ev_tmr_if { - void *timer_specific; -}; - -struct llc_sap_ev_rpt_sts_if { - u8 status; -}; - union llc_sap_ev_if { struct llc_sap_ev_simple_if a; /* 'a' for simple, easy ... */ struct llc_sap_ev_prim_if prim; struct llc_sap_ev_pdu_if pdu; - struct llc_sap_ev_tmr_if tmr; - struct llc_sap_ev_rpt_sts_if rsts; /* report status */ }; struct llc_prim_if_block; diff --git a/include/net/llc_sap.h b/include/net/llc_sap.h index 3fd694a166e6..412798ab6c0e 100644 --- a/include/net/llc_sap.h +++ b/include/net/llc_sap.h @@ -17,8 +17,6 @@ * * @p_bit - only lowest-order bit used * @f_bit - only lowest-order bit used - * @req - provided by LLC layer - * @resp - provided by LLC layer * @ind - provided by network layer * @conf - provided by network layer * @laddr - SAP value in this 'lsap' @@ -31,8 +29,6 @@ struct llc_sap { u8 state; u8 p_bit; u8 f_bit; - llc_prim_call_t req; - llc_prim_call_t resp; llc_prim_call_t ind; llc_prim_call_t conf; struct llc_prim_if_block llc_ind_prim, llc_cfm_prim; @@ -49,7 +45,7 @@ struct llc_sap_state_ev; extern void llc_sap_assign_sock(struct llc_sap *sap, struct sock *sk); extern void llc_sap_unassign_sock(struct llc_sap *sap, struct sock *sk); -extern void llc_sap_send_ev(struct llc_sap *sap, struct sk_buff *skb); +extern void llc_sap_state_process(struct llc_sap *sap, struct sk_buff *skb); extern void llc_sap_rtn_pdu(struct llc_sap *sap, struct sk_buff *skb); extern void llc_sap_send_pdu(struct llc_sap *sap, struct sk_buff *skb); #endif /* LLC_SAP_H */ |
