diff -Naur test-for-latech/arch/arm/config.in testqf-for-latech/arch/arm/config.in --- test-for-latech/arch/arm/config.in 2004-06-11 07:42:31.000000000 -0400 +++ testqf-for-latech/arch/arm/config.in 2004-06-11 07:49:18.000000000 -0400 @@ -654,4 +654,15 @@ dep_bool ' Kernel low-level debugging functions' CONFIG_DEBUG_LL $CONFIG_DEBUG_KERNEL dep_bool ' Kernel low-level debugging messages via footbridge serial port' CONFIG_DEBUG_DC21285_PORT $CONFIG_DEBUG_LL $CONFIG_FOOTBRIDGE dep_bool ' Kernel low-level debugging messages via UART2' CONFIG_DEBUG_CLPS711X_UART2 $CONFIG_DEBUG_LL $CONFIG_ARCH_CLPS711X + +#dep_bool 'modular DWCS scheduler' CONFIG_DWCS $CONFIG_PROC_FS +#dep_bool ' DFS Support' CONFIG_DWCS_DFS $CONFIG_DWCS + +bool 'Quality of Service Support (Q-Fabric)' CONFIG_QFABRIC +if [ "$CONFIG_QFABRIC" = "y" ] + define_bool CONFIG_DWCS + define_bool CONFIG_DWCS_DFS + define_bool CONFIG_PROC_FS +fi + endmenu diff -Naur test-for-latech/arch/arm/kernel/calls.S testqf-for-latech/arch/arm/kernel/calls.S --- test-for-latech/arch/arm/kernel/calls.S 2004-06-11 07:42:31.000000000 -0400 +++ testqf-for-latech/arch/arm/kernel/calls.S 2004-06-11 07:49:18.000000000 -0400 @@ -253,6 +253,28 @@ .long SYMBOL_NAME(sys_ni_syscall) /* sys_lremovexattr */ .long SYMBOL_NAME(sys_ni_syscall) /* sys_fremovexattr */ .long SYMBOL_NAME(sys_tkill) + .long SYMBOL_NAME(sys_load_scheduler) + .long SYMBOL_NAME(sys_unload_scheduler) + .long SYMBOL_NAME(sys_DWCS_scheduler) + .long SYMBOL_NAME(sys_update_utilization) + .long SYMBOL_NAME(sys_admission_control) + .long SYMBOL_NAME(sys_start_ecalls) + .long SYMBOL_NAME(sys_end_ecalls) + .long SYMBOL_NAME(sys_register_ecall) + .long SYMBOL_NAME(sys_do_downcall) + .long SYMBOL_NAME(sys_run_event_handler) + .long SYMBOL_NAME(sys_upcall_scheduler) + .long SYMBOL_NAME(sys_wake_up_ecalls) + .long SYMBOL_NAME(sys_download_code) + .long SYMBOL_NAME(sys_kecho_load) + .long SYMBOL_NAME(sys_KECho_syscall_echo) + .long SYMBOL_NAME(sys_KECho_syscall_cm) + .long SYMBOL_NAME(sys_KECho_syscall_cg) + .long SYMBOL_NAME(sys_KECho_syscall_atl) + .long SYMBOL_NAME(sys_KECho_sw_callback) + .long SYMBOL_NAME(sys_getsyscalls) + .long SYMBOL_NAME(sys_qos_configure) + .long SYMBOL_NAME(sys_change_clock) /* * Please check 2.5 _before_ adding calls here, * and copy changes to rmk@arm.linux.org.uk. Thanks. diff -Naur test-for-latech/arch/arm/kernel/init_task.c testqf-for-latech/arch/arm/kernel/init_task.c --- test-for-latech/arch/arm/kernel/init_task.c 2004-06-11 07:42:31.000000000 -0400 +++ testqf-for-latech/arch/arm/kernel/init_task.c 2004-06-11 07:49:18.000000000 -0400 @@ -13,6 +13,9 @@ static struct files_struct init_files = INIT_FILES; static struct signal_struct init_signals = INIT_SIGNALS; struct mm_struct init_mm = INIT_MM(init_mm); +#ifdef CONFIG_DWCS +struct dwcs_struct init_dwcs = INIT_DWCS; /* --FS-- Check linux/sched.h */ +#endif /* * Initial task structure. diff -Naur test-for-latech/arch/arm/kernel/process.c testqf-for-latech/arch/arm/kernel/process.c --- test-for-latech/arch/arm/kernel/process.c 2004-06-11 07:42:31.000000000 -0400 +++ testqf-for-latech/arch/arm/kernel/process.c 2004-06-11 07:49:18.000000000 -0400 @@ -369,6 +369,9 @@ pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags) { pid_t __ret; +#ifdef CONFIG_QFABRIC + struct task_struct *p; +#endif __asm__ __volatile__( "orr r0, %1, %2 @ kernel_thread sys_clone @@ -385,6 +388,12 @@ : "=r" (__ret) : "Ir" (flags), "I" (CLONE_VM), "r" (fn), "r" (arg) : "r0", "r1", "lr"); +#ifdef CONFIG_QFABRIC +#ifdef CONFIG_X86 + p = find_task_by_pid(retval); + p->kthread = 1; +#endif +#endif return __ret; } diff -Naur test-for-latech/arch/i386/config.in testqf-for-latech/arch/i386/config.in --- test-for-latech/arch/i386/config.in 2004-06-11 07:42:22.000000000 -0400 +++ testqf-for-latech/arch/i386/config.in 2004-06-11 07:49:01.000000000 -0400 @@ -425,4 +425,12 @@ bool ' Compile the kernel with frame pointers' CONFIG_FRAME_POINTER fi +#dep_bool 'modular DWCS scheduler' CONFIG_DWCS $CONFIG_PROC_FS + +bool 'Quality of Service Support (Q-Fabric)' CONFIG_QFABRIC +if [ "$CONFIG_QFABRIC" = "y" ]; then + define_bool CONFIG_DWCS y + define_bool CONFIG_PROC_FS y +fi + endmenu diff -Naur test-for-latech/arch/i386/kernel/entry.S testqf-for-latech/arch/i386/kernel/entry.S --- test-for-latech/arch/i386/kernel/entry.S 2004-06-11 07:42:23.000000000 -0400 +++ testqf-for-latech/arch/i386/kernel/entry.S 2004-06-11 07:49:01.000000000 -0400 @@ -202,6 +202,9 @@ call *SYMBOL_NAME(sys_call_table)(,%eax,4) movl %eax,EAX(%esp) # save the return value ENTRY(ret_from_sys_call) +#ifdef CONFIG_QFABRIC + call SYMBOL_NAME(inc_syscall_counter) +#endif cli # need_resched and signals atomic test cmpl $0,need_resched(%ebx) jne reschedule @@ -259,6 +262,85 @@ call SYMBOL_NAME(schedule) # test jmp ret_from_sys_call +#ifdef CONFIG_QFABRIC +ENTRY(fast_system_call) + pushl %eax # save orig_eax + SAVE_ALL + call *SYMBOL_NAME(fast_sys_call_table)(,%eax,4) + movl %eax,EAX(%esp) # save the return value + cmpl $0,%eax + jnz handle_return_value + RESTORE_ALL + +handle_return_value: + cmpl $-1,%eax + jz not_installed + testl $8,%eax + jnz do_slow_call + GET_CURRENT(%ebx) + testl $1,%eax + jnz do_bh +cont1: + testl $2,%eax + jnz do_reschedule +cont2: + testl $4,%eax + jnz handle_signal +cont3: + RESTORE_ALL + +not_installed: + RESTORE_ALL + +do_slow_call: + GET_CURRENT(%ebx) + testb $0x20,flags(%ebx) # PF_TRACESYS + jne tracesys + movl ORIG_EAX(%esp),%eax + call *SYMBOL_NAME(sys_call_table)(,%eax,4) + movl %eax,EAX(%esp) # save the return value + ALIGN + .globl ret_from_sys_call + .globl ret_from_intr + +do_bh: +#ifdef CONFIG_SMP + movl processor(%ebx),%eax + shll $CONFIG_X86_L1_CACHE_SHIFT,%eax + movl SYMBOL_NAME(irq_stat)(,%eax),%ecx # softirq_active + testl SYMBOL_NAME(irq_stat)+4(,%eax),%ecx # softirq_mask +#else + movl SYMBOL_NAME(irq_stat),%ecx # softirq_active + testl SYMBOL_NAME(irq_stat)+4,%ecx # softirq_mask +#endif + jne do_handle_bh + jmp cont1 + +do_handle_bh: + call SYMBOL_NAME(do_softirq) + jmp cont1 + +do_reschedule: + movl EFLAGS(%esp),%eax + movb CS(%esp),%al + testl $(VM_MASK | 3),%eax + je cont2 + cmpl $0,need_resched(%ebx) + je cont2 + call SYMBOL_NAME(schedule) + jmp ret_from_sys_call + +handle_signal: + cmpl $0,sigpending(%ebx) + je cont3 + testl $(VM_MASK),EFLAGS(%esp) + movl %esp,%eax + jne v86_signal_return + xorl %edx,%edx + call SYMBOL_NAME(do_signal) + jmp cont3 +#endif + ENTRY(divide_error) pushl $0 # no error code pushl $ SYMBOL_NAME(do_divide_error) @@ -639,7 +721,300 @@ .long SYMBOL_NAME(sys_ni_syscall) /* 240 reserved for futex */ .long SYMBOL_NAME(sys_ni_syscall) /* reserved for sched_setaffinity */ .long SYMBOL_NAME(sys_ni_syscall) /* reserved for sched_getaffinity */ - + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_update_utilization) + .long SYMBOL_NAME(sys_admission_control) + .long SYMBOL_NAME(sys_start_ecalls) + .long SYMBOL_NAME(sys_end_ecalls) + .long SYMBOL_NAME(sys_register_ecall) + .long SYMBOL_NAME(sys_do_downcall) + .long SYMBOL_NAME(sys_run_event_handler) + .long SYMBOL_NAME(sys_upcall_scheduler) + .long SYMBOL_NAME(sys_wake_up_ecalls) + .long SYMBOL_NAME(sys_download_code) + .long SYMBOL_NAME(sys_kecho_load) + .long SYMBOL_NAME(sys_KECho_syscall_echo) + .long SYMBOL_NAME(sys_KECho_syscall_cm) + .long SYMBOL_NAME(sys_KECho_syscall_cg) + .long SYMBOL_NAME(sys_KECho_syscall_atl) + .long SYMBOL_NAME(sys_KECho_sw_callback) + .long SYMBOL_NAME(sys_getsyscalls) + .long SYMBOL_NAME(sys_qos_configure) + .long SYMBOL_NAME(sys_change_clock) +#ifdef CONFIG_NET_QSOCKET + .long SYMBOL_NAME(sys_qsocketcall) +#endif + .rept NR_syscalls-(.-sys_call_table)/4 .long SYMBOL_NAME(sys_ni_syscall) .endr + +.data +ENTRY(fast_sys_call_table) + .long SYMBOL_NAME(sys_ni_syscall) /* 0 */ + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_fast_read) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) /* 5 */ + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) /* 10 */ + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) /* 15 */ + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) /* 20 */ + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) /* 25 */ + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) /* 30 */ + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) /* 35 */ + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) /* 40 */ + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) /* 45 */ + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) /* 50 */ + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) /* 55 */ + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) /* 60 */ + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) /* 65 */ + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) /* 70 */ + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) /* 75 */ + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) /* 80 */ + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) /* 85 */ + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) /* 90 */ + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) /* 95 */ + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) /* 100 */ + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) /* 105 */ + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) /* 110 */ + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) /* 115 */ + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) /* 120 */ + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) /* 125 */ + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) /* 130 */ + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) /* 135 */ + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) /* 140 */ + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) /* 145 */ + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) /* 150 */ + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) /* 155 */ + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) /* 160 */ + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) /* 165 */ + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) /* 170 */ + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) /* 175 */ + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) /* 180 */ + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) /* 185 */ + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) /* 190 */ + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) /* 195 */ + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) /* 200 */ + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) /* 205 */ + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) /* 210 */ + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) /* 215 */ + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) /* 220 */ + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) /* 225 */ + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) /* 230 */ + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_fast_do_downcall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_ni_syscall) + .long SYMBOL_NAME(sys_fast_KECho_syscall_echo) + .long SYMBOL_NAME(sys_fast_KECho_syscall_cm) + .long SYMBOL_NAME(sys_fast_KECho_syscall_cg) + .long SYMBOL_NAME(sys_fast_KECho_syscall_atl) + + .rept NR_syscalls-(.-fast_sys_call_table)/4 + .long SYMBOL_NAME(sys_ni_syscall) + .endr diff -Naur test-for-latech/arch/i386/kernel/i8259.c testqf-for-latech/arch/i386/kernel/i8259.c --- test-for-latech/arch/i386/kernel/i8259.c 2004-06-11 07:42:23.000000000 -0400 +++ testqf-for-latech/arch/i386/kernel/i8259.c 2004-06-11 07:49:01.000000000 -0400 @@ -456,8 +456,14 @@ */ for (i = 0; i < NR_IRQS; i++) { int vector = FIRST_EXTERNAL_VECTOR + i; +#ifdef CONFIG_QFABRIC + if ((vector != SYSCALL_VECTOR) && + (vector != FAST_SYSCALL_VECTOR)) + set_intr_gate(vector, interrupt[i]); +#else if (vector != SYSCALL_VECTOR) set_intr_gate(vector, interrupt[i]); +#endif } #ifdef CONFIG_SMP diff -Naur test-for-latech/arch/i386/kernel/init_task.c testqf-for-latech/arch/i386/kernel/init_task.c --- test-for-latech/arch/i386/kernel/init_task.c 2004-06-11 07:42:23.000000000 -0400 +++ testqf-for-latech/arch/i386/kernel/init_task.c 2004-06-11 07:49:01.000000000 -0400 @@ -10,6 +10,9 @@ static struct files_struct init_files = INIT_FILES; static struct signal_struct init_signals = INIT_SIGNALS; struct mm_struct init_mm = INIT_MM(init_mm); +#ifdef CONFIG_DWCS +struct dwcs_struct init_dwcs = INIT_DWCS; /* --RW-- Check linux/sched.h */ +#endif /* * Initial task structure. diff -Naur test-for-latech/arch/i386/kernel/process.c testqf-for-latech/arch/i386/kernel/process.c --- test-for-latech/arch/i386/kernel/process.c 2004-06-11 07:42:23.000000000 -0400 +++ testqf-for-latech/arch/i386/kernel/process.c 2004-06-11 07:49:01.000000000 -0400 @@ -488,6 +488,9 @@ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) { long retval, d0; +#ifdef CONFIG_QFABRIC + struct task_struct *p; +#endif __asm__ __volatile__( "movl %%esp,%%esi\n\t" @@ -508,6 +511,10 @@ "r" (arg), "r" (fn), "b" (flags | CLONE_VM) : "memory"); +#ifdef CONFIG_QFABRIC + p = find_task_by_pid(retval); + p->kthread = 1; +#endif return retval; } diff -Naur test-for-latech/arch/i386/kernel/ptrace.c testqf-for-latech/arch/i386/kernel/ptrace.c --- test-for-latech/arch/i386/kernel/ptrace.c 2004-06-11 07:42:23.000000000 -0400 +++ testqf-for-latech/arch/i386/kernel/ptrace.c 2004-06-11 07:49:01.000000000 -0400 @@ -452,3 +452,11 @@ current->exit_code = 0; } } + +#ifdef CONFIG_QFABRIC +asmlinkage void inc_syscall_counter() +{ + current->syscall_counter++; +} +EXPORT_SYMBOL(inc_syscall_counter); +#endif diff -Naur test-for-latech/arch/i386/kernel/traps.c testqf-for-latech/arch/i386/kernel/traps.c --- test-for-latech/arch/i386/kernel/traps.c 2004-06-11 07:42:22.000000000 -0400 +++ testqf-for-latech/arch/i386/kernel/traps.c 2004-06-11 07:49:01.000000000 -0400 @@ -51,6 +51,9 @@ #include asmlinkage int system_call(void); +#ifdef CONFIG_QFABRIC +asmlinkage int fast_system_call(void); +#endif asmlinkage void lcall7(void); asmlinkage void lcall27(void); @@ -985,6 +988,9 @@ set_trap_gate(19,&simd_coprocessor_error); set_system_gate(SYSCALL_VECTOR,&system_call); +#ifdef CONFIG_QFABRIC + set_system_gate(FAST_SYSCALL_VECTOR,&fast_system_call); +#endif /* * default LDT is a single-entry callgate to lcall7 for iBCS diff -Naur test-for-latech/arch/i386/lib/usercopy.c testqf-for-latech/arch/i386/lib/usercopy.c --- test-for-latech/arch/i386/lib/usercopy.c 2004-06-11 07:42:22.000000000 -0400 +++ testqf-for-latech/arch/i386/lib/usercopy.c 2004-06-11 07:49:01.000000000 -0400 @@ -27,6 +27,12 @@ unsigned long __generic_copy_from_user(void *to, const void *from, unsigned long n) { +#ifdef CONFIG_QFABRIC + if (current->uaccess_flag == 1) { + memcpy(to, from, n); + return 0; + } +#endif if (access_ok(VERIFY_READ, from, n)) { if(n<512) @@ -53,6 +59,12 @@ unsigned long __generic_copy_from_user(void *to, const void *from, unsigned long n) { +#ifdef CONFIG_QFABRIC + if (current->uaccess_flag == 1) { + memcpy(to, from, n); + return 0; + } +#endif prefetchw(to); if (access_ok(VERIFY_READ, from, n)) __copy_user_zeroing(to,from,n); diff -Naur test-for-latech/Documentation/Configure.help testqf-for-latech/Documentation/Configure.help --- test-for-latech/Documentation/Configure.help 2004-06-11 07:42:36.000000000 -0400 +++ testqf-for-latech/Documentation/Configure.help 2004-06-11 07:49:26.000000000 -0400 @@ -20527,6 +20527,36 @@ "Area6" will work for most boards. For ADX, select "Area5". +#modular DWCS process scheduler +#CONFIG_DWCS +# This option includes a kernel loadable module dwcs.o which implements +# a Dynamic Window-Constrained Scheduler instead of the regular Linux +# scheduler. Loading the module is not enough, you have to switch +# scheduling to the new scheduler. + +# To find out more about the scheduler, or to find out more about how +# to use it visit: http://www.cc.gatech.edu/~west/dwcs.html + +# This scheduler is for hacking purposes only, it seems to be stable on +# uniprocessor machines, but not on SMP boxes. You've been warned. This +# is still very experimental code, play with it _only_ if you know what +# you are doing. + +#DWCS /proc interface +#CONFIG_PROC_DWCS +# This option enables a pseudo file /proc/dwcs reading which will give +# you a snapshot of the current operating parameters of the DWCS +# scheduler. The file exists only when the scheduler is loaded. + +Quality of Service Support (Q-Fabric) +CONFIG_QFABRIC + If you say Y here, Artemis-enabled kernel extensions can be used by + applications. Artemis is a QoS infrastructure based on a distributed + event notification mechanism (called KECho). Saying Y here only adds + the necessary modifications to the kernel to support Artemis. The + actual Artemis modules are not part of the kernel, but are made + available in a software package available at http://www.cc.gatech.edu/~chris. + # # m68k-specific kernel options # Documented by Chris Lawrence et al. diff -Naur test-for-latech/fs/read_write.c testqf-for-latech/fs/read_write.c --- test-for-latech/fs/read_write.c 2004-06-11 07:39:57.000000000 -0400 +++ testqf-for-latech/fs/read_write.c 2004-06-11 07:47:19.000000000 -0400 @@ -425,3 +425,9 @@ bad_file: return ret; } + +asmlinkage int sys_fast_read(int fd, + void *buffer, int len) +{ + return 0; +} diff -Naur test-for-latech/include/asm-arm/current.h testqf-for-latech/include/asm-arm/current.h --- test-for-latech/include/asm-arm/current.h 2004-06-11 07:40:29.000000000 -0400 +++ testqf-for-latech/include/asm-arm/current.h 2004-06-11 07:47:34.000000000 -0400 @@ -1,14 +1,32 @@ #ifndef _ASMARM_CURRENT_H #define _ASMARM_CURRENT_H +#ifdef CONFIG_QFABRIC +extern int ECalls_current_flag; +extern struct task_struct *ECalls_current; +#endif + static inline struct task_struct *get_current(void) __attribute__ (( __const__ )); -static inline struct task_struct *get_current(void) +static inline struct task_struct *original_get_current(void) __attribute__ (( __const__ )); + +static inline struct task_struct *original_get_current(void) { register unsigned long sp asm ("sp"); return (struct task_struct *)(sp & ~0x1fff); } +#define original_current original_get_current() + +static inline struct task_struct *get_current(void) +{ +#ifdef CONFIG_QFABRIC + if (ECalls_current_flag == 1) + return ECalls_current; +#endif + return original_get_current(); +} + #define current (get_current()) #endif /* _ASMARM_CURRENT_H */ diff -Naur test-for-latech/include/asm-arm/errno.h testqf-for-latech/include/asm-arm/errno.h --- test-for-latech/include/asm-arm/errno.h 2004-06-11 07:40:29.000000000 -0400 +++ testqf-for-latech/include/asm-arm/errno.h 2004-06-11 07:47:34.000000000 -0400 @@ -129,4 +129,8 @@ #define ENOMEDIUM 123 /* No medium found */ #define EMEDIUMTYPE 124 /* Wrong medium type */ +#ifdef CONFIG_QFABRIC +#define EADMISSION 125 /* Task admission denied. */ +#endif + #endif diff -Naur test-for-latech/include/asm-arm/socket.h testqf-for-latech/include/asm-arm/socket.h --- test-for-latech/include/asm-arm/socket.h 2004-06-11 07:40:29.000000000 -0400 +++ testqf-for-latech/include/asm-arm/socket.h 2004-06-11 07:47:34.000000000 -0400 @@ -45,6 +45,11 @@ #define SO_ACCEPTCONN 30 +#ifdef CONFIG_QFABRIC +#define SO_QOS_PRIORITY 1000 +#define SO_QOS_DEADLINE 1001 +#endif + /* Nast libc5 fixup - bletch */ #if defined(__KERNEL__) /* Socket types. */ diff -Naur test-for-latech/include/asm-arm/uaccess.h testqf-for-latech/include/asm-arm/uaccess.h --- test-for-latech/include/asm-arm/uaccess.h 2004-06-11 07:40:29.000000000 -0400 +++ testqf-for-latech/include/asm-arm/uaccess.h 2004-06-11 07:47:34.000000000 -0400 @@ -23,6 +23,11 @@ * on our cache or tlb entries. */ +#ifdef CONFIG_QFABRIC +extern mm_segment_t kernel_get_fs(void); +extern int kernel_access_ok(int type, const void *addr, size_t size); +#endif + struct exception_table_entry { unsigned long insn, fixup; @@ -32,12 +37,28 @@ extern unsigned long search_exception_table(unsigned long); #define get_ds() (KERNEL_DS) +#ifdef CONFIG_QFABRIC +#ifdef MODULE +#define get_fs() (current->addr_limit) +#else +#define get_fs() kernel_get_fs() +#endif +#else #define get_fs() (current->addr_limit) +#endif #define segment_eq(a,b) ((a) == (b)) #include +#ifdef CONFIG_QFABRIC +#ifdef MODULE +#define access_ok(type,addr,size) (__range_ok(addr,size) == 0) +#else +#define access_ok(type,addr,size) kernel_access_ok(type,addr,size) +#endif +#else #define access_ok(type,addr,size) (__range_ok(addr,size) == 0) +#endif static inline int verify_area(int type, const void * addr, unsigned long size) { @@ -143,6 +164,12 @@ static __inline__ unsigned long copy_from_user(void *to, const void *from, unsigned long n) { +#ifdef CONFIG_QFABRIC + if (current->uaccess_flag == 1) { + memcpy(to, from, n); + return 0; + } +#endif if (access_ok(VERIFY_READ, from, n)) __do_copy_from_user(to, from, n); else /* security hole - plug it */ @@ -152,12 +179,24 @@ static __inline__ unsigned long __copy_from_user(void *to, const void *from, unsigned long n) { +#ifdef CONFIG_QFABRIC + if (current->uaccess_flag == 1) { + memcpy(to, from, n); + return 0; + } +#endif __do_copy_from_user(to, from, n); return n; } static __inline__ unsigned long copy_to_user(void *to, const void *from, unsigned long n) { +#ifdef CONFIG_QFABRIC + if (current->uaccess_flag == 1) { + memcpy(to, from, n); + return 0; + } +#endif if (access_ok(VERIFY_WRITE, to, n)) __do_copy_to_user(to, from, n); return n; @@ -165,6 +204,12 @@ static __inline__ unsigned long __copy_to_user(void *to, const void *from, unsigned long n) { +#ifdef CONFIG_QFABRIC + if (current->uaccess_flag == 1) { + memcpy(to, from, n); + return 0; + } +#endif __do_copy_to_user(to, from, n); return n; } diff -Naur test-for-latech/include/asm-arm/unistd.h testqf-for-latech/include/asm-arm/unistd.h --- test-for-latech/include/asm-arm/unistd.h 2004-06-11 07:40:27.000000000 -0400 +++ testqf-for-latech/include/asm-arm/unistd.h 2004-06-11 07:47:34.000000000 -0400 @@ -259,6 +259,44 @@ #define __NR_fremovexattr (__NR_SYSCALL_BASE+237) #endif #define __NR_tkill (__NR_SYSCALL_BASE+238) +/* DWCS related calls. */ +#define __NR_load_scheduler (__NR_SYSCALL_BASE+239) /* Added by Rich West --RW--. */ +#define __NR_unload_scheduler (__NR_SYSCALL_BASE+240) /* Added by Rich West --RW--. */ +#define __NR_DWCS_scheduler (__NR_SYSCALL_BASE+241) /* Added by Rich West --RW--. */ +#define __NR_update_utilization (__NR_SYSCALL_BASE+242) /* Added by C. Poellabauer --CP--. */ +#define __NR_admission_control (__NR_SYSCALL_BASE+243) /* Added by C. Poellabauer --CP--. */ + +/* Additional syscalls added for the ECalls mechanism. */ +#define __NR_start_ecalls (__NR_SYSCALL_BASE+244) /* Added by C. Poellabauer --CP--. */ +#define __NR_end_ecalls (__NR_SYSCALL_BASE+245) /* Added by C. Poellabauer --CP--. */ +#define __NR_register_ecall (__NR_SYSCALL_BASE+246) /* Added by C. Poellabauer --CP--. */ +#define __NR_do_downcall (__NR_SYSCALL_BASE+247) /* Added by C. Poellabauer --CP--. */ +#define __NR_run_event_handler (__NR_SYSCALL_BASE+248) /* Added by C. Poellabauer --CP--. */ +#define __NR_upcall_scheduler (__NR_SYSCALL_BASE+249) /* Added by C. Poellabauer --CP--. */ +#define __NR_wake_up_ecalls (__NR_SYSCALL_BASE+250) /* Added by C. Poellabauer --CP--. */ +#define __NR_download_code (__NR_SYSCALL_BASE+251) /* Added by C. Poellabauer --CP--. */ + +/* Syscalls for user-level usage of KECho. */ +#define __NR_kecho_load (__NR_SYSCALL_BASE+252) /* Added by C. Poellabauer --CP--. */ +#define __NR_KECho_syscall_echo (__NR_SYSCALL_BASE+253) /* Added by C. Poellabauer --CP--. */ +#define __NR_KECho_syscall_cm (__NR_SYSCALL_BASE+254) /* Added by C. Poellabauer --CP--. */ +#define __NR_KECho_syscall_cg (__NR_SYSCALL_BASE+255) /* Added by C. Poellabauer --CP--. */ +#define __NR_KECho_syscall_atl (__NR_SYSCALL_BASE+256) /* Added by C. Poellabauer --CP--. */ +#define __NR_KECho_sw_callback (__NR_SYSCALL_BASE+257) /* Added by C. Poellabauer --CP--. */ + +/* Syscalls for measurment purposes. */ +#define __NR_getsyscalls (__NR_SYSCALL_BASE+258) /* Added by C. Poellabauer --CP--. */ +#define __NR_qos_configure (__NR_SYSCALL_BASE+259) /* Added by C. Poellabauer --CP--. */ +#define __NR_change_clock (__NR_SYSCALL_BASE+260) /* Added by C. Poellabauer --CP--. */ + +/* Fast system call definitions. */ +#define __NR_fast_read (__NR_SYSCALL_BASE+3) /* Added by C. Poellabauer --CP--. */ +#define __NR_fast_do_downcall (__NR_SYSCALL_BASE+247) /* Added by C. Poellabauer --CP--. */ +#define __NR_fast_KECho_syscall_echo (__NR_SYSCALL_BASE+253) /* Added by C. Poellabauer --CP--. */ +#define __NR_fast_KECho_syscall_cm (__NR_SYSCALL_BASE+254) /* Added by C. Poellabauer --CP--. */ +#define __NR_fast_KECho_syscall_cg (__NR_SYSCALL_BASE+255) /* Added by C. Poellabauer --CP--. */ +#define __NR_fast_KECho_syscall_atl (__NR_SYSCALL_BASE+256) /* Added by C. Poellabauer --CP--. */ + /* * Please check 2.5 _before_ adding calls here, * and copy changes to rmk@arm.linux.org.uk. Thanks. diff -Naur test-for-latech/include/asm-i386/current.h testqf-for-latech/include/asm-i386/current.h --- test-for-latech/include/asm-i386/current.h 2004-06-11 07:40:12.000000000 -0400 +++ testqf-for-latech/include/asm-i386/current.h 2004-06-11 07:47:30.000000000 -0400 @@ -3,13 +3,35 @@ struct task_struct; +#ifdef CONFIG_QFABRIC +extern int ECalls_current_flag; +extern struct task_struct *ECalls_current; + +static inline struct task_struct * original_get_current(void) +{ + struct task_struct *current; + + __asm__("andl %%esp,%0; ":"=r" (current) : "0" (~8191UL)); + return current; +} + +#define original_current original_get_current() + +static inline struct task_struct * get_current(void) +{ + if (ECalls_current_flag == 1) + return ECalls_current; + return original_get_current(); +} +#else static inline struct task_struct * get_current(void) { struct task_struct *current; __asm__("andl %%esp,%0; ":"=r" (current) : "0" (~8191UL)); return current; - } - +} +#endif + #define current get_current() #endif /* !(_I386_CURRENT_H) */ diff -Naur test-for-latech/include/asm-i386/errno.h testqf-for-latech/include/asm-i386/errno.h --- test-for-latech/include/asm-i386/errno.h 2004-06-11 07:40:12.000000000 -0400 +++ testqf-for-latech/include/asm-i386/errno.h 2004-06-11 07:47:30.000000000 -0400 @@ -129,4 +129,8 @@ #define ENOMEDIUM 123 /* No medium found */ #define EMEDIUMTYPE 124 /* Wrong medium type */ +#ifdef CONFIG_DWCS +#define EADMISSION 125 /* Task admission denied. */ +#endif + #endif diff -Naur test-for-latech/include/asm-i386/hw_irq.h testqf-for-latech/include/asm-i386/hw_irq.h --- test-for-latech/include/asm-i386/hw_irq.h 2004-06-11 07:40:12.000000000 -0400 +++ testqf-for-latech/include/asm-i386/hw_irq.h 2004-06-11 07:47:30.000000000 -0400 @@ -23,6 +23,9 @@ #define FIRST_EXTERNAL_VECTOR 0x20 #define SYSCALL_VECTOR 0x80 +#ifdef CONFIG_QFABRIC +#define FAST_SYSCALL_VECTOR 0x60 +#endif /* * Vectors 0x20-0x2f are used for ISA interrupts. diff -Naur test-for-latech/include/asm-i386/ptrace.h testqf-for-latech/include/asm-i386/ptrace.h --- test-for-latech/include/asm-i386/ptrace.h 2004-06-11 07:40:12.000000000 -0400 +++ testqf-for-latech/include/asm-i386/ptrace.h 2004-06-11 07:47:30.000000000 -0400 @@ -1,6 +1,7 @@ #ifndef _I386_PTRACE_H #define _I386_PTRACE_H +#ifndef QFABRIC_DCG #define EBX 0 #define ECX 1 #define EDX 2 @@ -19,6 +20,7 @@ #define UESP 15 #define SS 16 #define FRAME_SIZE 17 +#endif /* this struct defines the way the registers are stored on the stack during a system call. */ diff -Naur test-for-latech/include/asm-i386/socket.h testqf-for-latech/include/asm-i386/socket.h --- test-for-latech/include/asm-i386/socket.h 2004-06-11 07:40:12.000000000 -0400 +++ testqf-for-latech/include/asm-i386/socket.h 2004-06-11 07:47:30.000000000 -0400 @@ -45,6 +45,11 @@ #define SO_ACCEPTCONN 30 +#ifdef CONFIG_QFABRIC +#define SO_QOS_PRIORITY 1000 +#define SO_QOS_DEADLINE 1001 +#endif + /* Nasty libc5 fixup - bletch */ #if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) /* Socket types. */ diff -Naur test-for-latech/include/asm-i386/uaccess.h testqf-for-latech/include/asm-i386/uaccess.h --- test-for-latech/include/asm-i386/uaccess.h 2004-06-11 07:40:12.000000000 -0400 +++ testqf-for-latech/include/asm-i386/uaccess.h 2004-06-11 07:47:30.000000000 -0400 @@ -7,10 +7,21 @@ #include #include #include +#ifdef CONFIG_QFABRIC +#include +#endif #include #define VERIFY_READ 0 #define VERIFY_WRITE 1 +#ifdef CONFIG_QFABRIC +#ifndef NR_THREADS +#define NR_THREADS 512 +#endif + +extern mm_segment_t kernel_get_fs(void); +extern int kernel_access_ok(int type, const void *addr, size_t size); +#endif /* * The fs value determines whether argument validity checking should be @@ -27,7 +38,15 @@ #define USER_DS MAKE_MM_SEG(PAGE_OFFSET) #define get_ds() (KERNEL_DS) +#ifdef CONFIG_QFABRIC +#ifdef MODULE +#define get_fs() (current->addr_limit) +#else +#define get_fs() kernel_get_fs() +#endif +#else #define get_fs() (current->addr_limit) +#endif #define set_fs(x) (current->addr_limit = (x)) #define segment_eq(a,b) ((a).seg == (b).seg) @@ -35,7 +54,7 @@ extern int __verify_write(const void *, unsigned long); #define __addr_ok(addr) ((unsigned long)(addr) < (current->addr_limit.seg)) - + /* * Uhhuh, this needs 33-bit arithmetic. We have a carry.. */ @@ -46,6 +65,24 @@ :"1" (addr),"g" ((int)(size)),"g" (current->addr_limit.seg)); \ flag; }) +#ifdef CONFIG_QFABRIC +#ifdef MODULE +#ifdef CONFIG_X86_WP_WORKS_OK + +#define access_ok(type,addr,size) (__range_ok(addr,size) == 0) + +#else + +#define access_ok(type,addr,size) ( (__range_ok(addr,size) == 0) && \ + ((type) == VERIFY_READ || boot_cpu_data.wp_works_ok || \ + segment_eq(get_fs(),KERNEL_DS) || \ + __verify_write((void *)(addr),(size)))) + +#endif +#else +#define access_ok(type,addr,size) kernel_access_ok(type,addr,size) +#endif +#else #ifdef CONFIG_X86_WP_WORKS_OK #define access_ok(type,addr,size) (__range_ok(addr,size) == 0) @@ -58,6 +95,7 @@ __verify_write((void *)(addr),(size)))) #endif +#endif static inline int verify_area(int type, const void * addr, unsigned long size) { @@ -149,12 +187,12 @@ #define __put_user_check(x,ptr,size) \ ({ \ - long __pu_err = -EFAULT; \ + long __pu_err = -EFAULT; \ __typeof__(*(ptr)) *__pu_addr = (ptr); \ if (access_ok(VERIFY_WRITE,__pu_addr,size)) \ __put_user_size((x),__pu_addr,(size),__pu_err); \ __pu_err; \ -}) +}) #define __put_user_u64(x, addr, err) \ __asm__ __volatile__( \ @@ -308,6 +346,12 @@ static inline unsigned long __generic_copy_from_user_nocheck(void *to, const void *from, unsigned long n) { +#ifdef CONFIG_QFABRIC + if (current->uaccess_flag == 1) { + memcpy(to, from, n); + return 0; + } +#endif __copy_user_zeroing(to,from,n); return n; } @@ -315,6 +359,12 @@ static inline unsigned long __generic_copy_to_user_nocheck(void *to, const void *from, unsigned long n) { +#ifdef CONFIG_QFABRIC + if (current->uaccess_flag == 1) { + memcpy(to, from, n); + return 0; + } +#endif __copy_user(to,from,n); return n; } @@ -546,6 +596,12 @@ static inline unsigned long __constant_copy_to_user(void *to, const void *from, unsigned long n) { +#ifdef CONFIG_QFABRIC + if (current->uaccess_flag == 1) { + memcpy(to, from, n); + return 0; + } +#endif prefetch(from); if (access_ok(VERIFY_WRITE, to, n)) __constant_copy_user(to,from,n); @@ -555,6 +611,12 @@ static inline unsigned long __constant_copy_from_user(void *to, const void *from, unsigned long n) { +#ifdef CONFIG_QFABRIC + if (current->uaccess_flag == 1) { + memcpy(to, from, n); + return 0; + } +#endif if (access_ok(VERIFY_READ, from, n)) __constant_copy_user_zeroing(to,from,n); else @@ -565,6 +627,12 @@ static inline unsigned long __constant_copy_to_user_nocheck(void *to, const void *from, unsigned long n) { +#ifdef CONFIG_QFABRIC + if (current->uaccess_flag == 1) { + memcpy(to, from, n); + return 0; + } +#endif __constant_copy_user(to,from,n); return n; } @@ -572,6 +640,12 @@ static inline unsigned long __constant_copy_from_user_nocheck(void *to, const void *from, unsigned long n) { +#ifdef CONFIG_QFABRIC + if (current->uaccess_flag == 1) { + memcpy(to, from, n); + return 0; + } +#endif __constant_copy_user_zeroing(to,from,n); return n; } diff -Naur test-for-latech/include/asm-i386/unistd.h testqf-for-latech/include/asm-i386/unistd.h --- test-for-latech/include/asm-i386/unistd.h 2004-06-11 07:40:12.000000000 -0400 +++ testqf-for-latech/include/asm-i386/unistd.h 2004-06-11 07:47:29.000000000 -0400 @@ -1,5 +1,12 @@ #ifndef _ASM_I386_UNISTD_H_ #define _ASM_I386_UNISTD_H_ +#ifdef CONFIG_QFABRIC +#include +#endif + +#ifdef CONFIG_DWCS +#define __NR_SYSCALL_BASE 0x00 +#endif /* * This file contains the system call numbers. @@ -248,6 +255,45 @@ #define __NR_sched_setaffinity 241 #define __NR_sched_getaffinity 242 +/* Additional syscalls added for the dionisys resource manager. */ +#define __NR_load_scheduler 243 /* Added by Rich West --RW--. */ +#define __NR_unload_scheduler 244 /* Added by Rich West --RW--. */ +#define __NR_DWCS_scheduler 245 /* Added by Rich West --RW--. */ +#define __NR_update_utilization 246 /* Added by C. Poellabauer --CP--. */ +#define __NR_admission_control 247 /* Added by C. Poellabauer --CP--. */ +/* Additional syscalls added for the ECalls mechanism. */ +#define __NR_start_ecalls 248 /* Added by C. Poellabauer --CP--. */ +#define __NR_end_ecalls 249 /* Added by C. Poellabauer --CP--. */ +#define __NR_register_ecall 250 /* Added by C. Poellabauer --CP--. */ +#define __NR_do_downcall 251 /* Added by C. Poellabauer --CP--. */ +#define __NR_run_event_handler 252 /* Added by C. Poellabauer --CP--. */ +#define __NR_upcall_scheduler 253 /* Added by C. Poellabauer --CP--. */ +#define __NR_wake_up_ecalls 254 /* Added by C. Poellabauer --CP--. */ +#define __NR_download_code 255 /* Added by C. Poellabauer --CP--. */ + +/* Syscalls for user-level usage of KECho. */ +#define __NR_kecho_load 256 /* --CP-- */ +#define __NR_KECho_syscall_echo 257 /* Added by C. Poellabauer --CP--. */ +#define __NR_KECho_syscall_cm 258 /* Added by C. Poellabauer --CP--. */ +#define __NR_KECho_syscall_cg 259 /* Added by C. Poellabauer --CP--. */ +#define __NR_KECho_syscall_atl 260 /* Added by C. Poellabauer --CP--. */ +#define __NR_KECho_sw_callback 261 /* Added by C. Poellabauer --CP--. */ + +#define __NR_getsyscalls 262 /* Added by C. Poellabauer --CP--. */ +#define __NR_qos_configure 263 /* Added by C. Poellabauer --CP--. */ +#define __NR_change_clock 264 /* Added by C. Poellabauer --CP--. */ + +/* QSocket changes. */ +#define __NR_qsocketcall 265 + +/* Fast system call definitions. */ +#define __NR_fast_read 3 /* Added by C. Poellabauer --CP--. */ +#define __NR_fast_do_downcall 251 /* Added by C. Poellabauer --CP--. */ +#define __NR_fast_KECho_syscall_echo 257 /* Added by C. Poellabauer --CP--. */ +#define __NR_fast_KECho_syscall_cm 258 /* Added by C. Poellabauer --CP--. */ +#define __NR_fast_KECho_syscall_cg 259 /* Added by C. Poellabauer --CP--. */ +#define __NR_fast_KECho_syscall_atl 260 /* Added by C. Poellabauer --CP--. */ + /* user-visible error numbers are in the range -1 - -124: see */ #define __syscall_return(type, res) \ @@ -337,6 +383,71 @@ __syscall_return(type,__res); \ } +/* Fast system calls. */ +#define _fast_syscall0(type,name) \ +type name(void) \ +{ \ +long __res; \ +__asm__ volatile ("int $0x60" \ + : "=a" (__res) \ + : "0" (__NR_##name)); \ +__syscall_return(type,__res); \ +} + +#define _fast_syscall1(type,name,type1,arg1) \ +type name(type1 arg1) \ +{ \ +long __res; \ +__asm__ volatile ("int $0x60" \ + : "=a" (__res) \ + : "0" (__NR_##name),"b" ((long)(arg1))); \ +__syscall_return(type,__res); \ +} + +#define _fast_syscall2(type,name,type1,arg1,type2,arg2) \ +type name(type1 arg1,type2 arg2) \ +{ \ +long __res; \ +__asm__ volatile ("int $0x60" \ + : "=a" (__res) \ + : "0" (__NR_##name),"b" ((long)(arg1)),"c" ((long)(arg2))); \ +__syscall_return(type,__res); \ +} + +#define _fast_syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \ +type name(type1 arg1,type2 arg2,type3 arg3) \ +{ \ +long __res; \ +__asm__ volatile ("int $0x60" \ + : "=a" (__res) \ + : "0" (__NR_##name),"b" ((long)(arg1)),"c" ((long)(arg2)), \ + "d" ((long)(arg3))); \ +__syscall_return(type,__res); \ +} + +#define _fast_syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \ +type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \ +{ \ +long __res; \ +__asm__ volatile ("int $0x60" \ + : "=a" (__res) \ + : "0" (__NR_##name),"b" ((long)(arg1)),"c" ((long)(arg2)), \ + "d" ((long)(arg3)),"S" ((long)(arg4))); \ +__syscall_return(type,__res); \ +} + +#define _fast_syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \ + type5,arg5) \ +type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \ +{ \ +long __res; \ +__asm__ volatile ("int $0x60" \ + : "=a" (__res) \ + : "0" (__NR_##name),"b" ((long)(arg1)),"c" ((long)(arg2)), \ + "d" ((long)(arg3)),"S" ((long)(arg4)),"D" ((long)(arg5))); \ +__syscall_return(type,__res); \ +} + #ifdef __KERNEL_SYSCALLS__ /* diff -Naur test-for-latech/include/linux/ecalls.h testqf-for-latech/include/linux/ecalls.h --- test-for-latech/include/linux/ecalls.h 1969-12-31 19:00:00.000000000 -0500 +++ testqf-for-latech/include/linux/ecalls.h 2004-06-11 07:47:29.000000000 -0400 @@ -0,0 +1,239 @@ +#ifndef __ECALLS__H__ +#define __ECALLS__H__ + +#include +#include + +/* system call: start_ecalls. */ +_syscall1(int, start_ecalls, + int, flag); + +/* system call: end_ecalls. */ +_syscall0(int, end_ecalls); + +/* system call: register_ecall. */ +_syscall4(int, register_ecall, + char *, service, + int, len, + struct ecall_down *, downcall, + struct ecall_up *, upcall); + +/* system call: download code. */ +_syscall5(int, download_code, + char *, hookname, + char *, parameter1, + int, parameter2, + int, parameter3, + char *, code); + +/* system call: do_downcall. */ +_syscall3(int, do_downcall, + struct ecall_down *, downcall, + void *, data, + int, len); + +#ifdef CONFIG_X86 +/* fast system call: fast_do_downcall. */ +_fast_syscall3(int, fast_do_downcall, + struct ecall_down *, downcall, + void *, data, + int, len); +#endif + +/* Start ECalls. */ +int ECalls_start(int flag) +{ + start_ecalls(flag); + + return 0; +} + +/* End ECalls. */ +int ECalls_cancel(struct ecall_down *downcall, struct ecall_up *upcall) +{ + end_ecalls(); + + return 0; +} + +/* Initialize downcall data structure. */ +int init_downcall(char *service_name, struct ecall_down *downcall, + void *down_ptr) +{ + if (down_ptr != NULL) { + if (downcall->size1 > 0) { + if (downcall->size2 > 0) { + downcall->flag = (unsigned long) down_ptr; + downcall->bitpattern = downcall->flag + sizeof(int); + downcall->front = 0; + downcall->back = 0; + downcall->data = (unsigned long) downcall->bitpattern + + sizeof(unsigned long)* + downcall->size2; + downcall->total_size = downcall->size1; + downcall->service_name = strdup(service_name); + downcall->string_len = strlen(service_name); + } else { + downcall->flag = (unsigned long) down_ptr; + downcall->bitpattern = 0; + downcall->front = (unsigned long) downcall->flag + sizeof(int); + downcall->back = (unsigned long) downcall->back + sizeof(int); + downcall->total_size = downcall->size1; + downcall->service_name = strdup(service_name); + downcall->string_len = strlen(service_name); + } + } else { + downcall->flag = 0; + downcall->bitpattern = 0; + downcall->front = 0; + downcall->back = 0; + downcall->data = 0; + downcall->total_size = sizeof(int); + downcall->service_name = strdup(service_name); + downcall->string_len = strlen(service_name); + } + } else { + downcall->flag = 0; + downcall->bitpattern = 0; + downcall->front = 0; + downcall->back = 0; + downcall->data = 0; + downcall->total_size = sizeof(int); + downcall->service_name = strdup(service_name); + downcall->string_len = strlen(service_name); + } + return 0; +} + +/* Initialize upcall data structure. */ +int init_upcall(char *service_name, struct ecall_up *upcall, void *up_ptr) +{ + if (up_ptr != NULL) { + if (upcall->size1 > 0) { + if (upcall->size2 > 0) { + upcall->flag = (unsigned long) up_ptr; + upcall->bitpattern = (unsigned long) upcall->flag + sizeof(int); + upcall->front = 0; + upcall->back = 0; + upcall->data = (unsigned long)upcall->bitpattern + + sizeof(unsigned long)*upcall->size2; + upcall->total_size = upcall->size1; + upcall->service_name = strdup(service_name); + upcall->string_len = strlen(service_name); + } else { + upcall->flag = (unsigned long) up_ptr; + upcall->bitpattern = 0; + upcall->front = (unsigned long) upcall->flag + sizeof(int); + upcall->back = (unsigned long) upcall->back + sizeof(int); + upcall->total_size = upcall->size1; + upcall->service_name = strdup(service_name); + upcall->string_len = strlen(service_name); + } + } else { + upcall->flag = 0; + upcall->bitpattern = 0; + upcall->front = 0; + upcall->back = 0; + upcall->data = 0; + upcall->total_size = 0; + } + } else { + upcall->flag = 0; + upcall->bitpattern = 0; + upcall->front = 0; + upcall->back = 0; + upcall->data = 0; + upcall->total_size = 0; + } + return 0; +} + +/* Initialize ECalls. */ +int ECalls_init(char *service_name, struct ecall_down *downcall, + struct ecall_up *upcall, int signal, int pid, void *u_handler, + void *k_handler) +{ + if (service_name == NULL) return -1; + + upcall->service_name = strdup(service_name); + upcall->string_len = strlen(service_name); + upcall->signal = signal; + upcall->process_id = pid; + upcall->handler_function = u_handler; + upcall->kernel_function = k_handler; + upcall->kfct_string_len = 0; + if (upcall->kernel_function != NULL) + upcall->kfct_string_len = strlen(upcall->kernel_function); + return 0; +} + +/* Unregister ECalls. */ +int ECalls_unsubscribe(char *service_name) +{ + register_ecall(service_name, + strlen(service_name),NULL, NULL); + return 0; +} + +/* Register ECalls. */ +int ECalls_subscribe(char *service_name, + struct ecall_down *downcall, void *down_ptr, + struct ecall_up *upcall, void *up_ptr) +{ + int id; + + if (service_name == NULL) return -1; + + if (downcall != NULL) + init_downcall(service_name, downcall, down_ptr); + + if (upcall != NULL) + init_upcall(service_name, upcall, up_ptr); + + if ((id = register_ecall(service_name, + strlen(service_name),downcall,upcall)) < 0) + return -1; + + if (downcall != NULL) { + if (downcall->total_size > 0) + downcall->service_id = id; + } + + if (upcall != NULL) { + if (upcall->total_size > 0) + upcall->service_id = id; + } + + return 0; +} + +/* Submit Event. */ +int ECalls_submit_event(struct ecall_down *downcall, void *event, int len, + int type) +{ + if ((type == DEFERRED) || (type == NORMAL)) { + (*(int *)downcall->flag)++; + } + else if (type == SYSCALL) { + do_downcall(downcall, event, len); + } +#ifdef CONFIG_X86 + else if (type == IMMEDIATE) { + (*(int *)downcall->flag)++; + fast_do_downcall(downcall, event, len); + } +#endif + + return 0; +} + +/* Download extension code. */ +int ECalls_download(char *hookname, char *parameter1, int parameter2, + int parameter3, char *code) +{ + download_code(hookname, parameter1, parameter2, parameter3, code); + + return 0; +} + +#endif /* __ECALLS__H__ */ diff -Naur test-for-latech/include/linux/ecalls-types.h testqf-for-latech/include/linux/ecalls-types.h --- test-for-latech/include/linux/ecalls-types.h 1969-12-31 19:00:00.000000000 -0500 +++ testqf-for-latech/include/linux/ecalls-types.h 2004-06-11 07:47:29.000000000 -0400 @@ -0,0 +1,70 @@ +#ifndef __ECALLS_TYPES__H__ +#define __ECALLS_TYPES__H__ + +#include +#include +#include +#include +#include +#include +#include +#include + +#define DEF_EVENT_NUM 32 +#define DEF_EVENT_SIZE sizeof(int) +#define DEF_MEM_SIZE 512 +#define FLAG_ONLY 0 +#define GENERAL_EVENTS 1 +#define PRIORITY_EVENTS 2 +#define NORMAL 0 +#define SYSCALL 1 +#define IMMEDIATE 2 +#define DEFERRED 3 + +struct ecall_down { + int service_id; + unsigned long flag; + unsigned long bitpattern; + unsigned long front; + unsigned long back; + unsigned long data; + char *service_name; + int string_len; + int total_size; + int size1; + int size2; +}; +typedef struct ecall_down *t_downcall_data; + +struct ecall_up { + int service_id; + unsigned long flag; + unsigned long bitpattern; + unsigned long front; + unsigned long back; + unsigned long data; + char *service_name; + int string_len; + int kfct_string_len; + int total_size; + int process_id; + int signal; + void *handler_function; + char *kernel_function; + int size1; + int size2; +}; +typedef struct ecall_up *t_upcall_data; + +extern int ECalls_start(int); +extern int ECalls_end(struct ecall_down *, struct ecall_up *); +extern int init_downcall(char *, struct ecall_down *, void *); +extern int init_upcall(char *, struct ecall_up *, void *); +extern int ECalls_subscribe(char *, struct ecall_down *, void *, + struct ecall_up *, void *); +extern int ECalls_cancel(struct ecall_down *, struct ecall_up *); +extern int ECalls_submit_event(struct ecall_down *, void *, int, + int); +extern int ECalls_init(char *, struct ecall_down *, + struct ecall_up *, int, int, void *, void *); +#endif /* __ECALLS_TYPES__H__ */ diff -Naur test-for-latech/include/linux/fastcalls.h testqf-for-latech/include/linux/fastcalls.h --- test-for-latech/include/linux/fastcalls.h 1969-12-31 19:00:00.000000000 -0500 +++ testqf-for-latech/include/linux/fastcalls.h 2004-06-11 07:47:29.000000000 -0400 @@ -0,0 +1,13 @@ +#ifndef __FASTCALLS__H__ +#define __FASTCALLS__H__ + +#include +#include +#include + +_fast_syscall3(int, fast_read, + int, fd, + void *, buffer, + int, len); + +#endif /* __FASTCALLS__H__ */ diff -Naur test-for-latech/include/linux/libqsocket.h testqf-for-latech/include/linux/libqsocket.h --- test-for-latech/include/linux/libqsocket.h 1969-12-31 19:00:00.000000000 -0500 +++ testqf-for-latech/include/linux/libqsocket.h 2004-06-11 07:47:29.000000000 -0400 @@ -0,0 +1,28 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +int qsocket(int, int, int, struct qos_params *); +int qclose(int); +int qchange(int, struct qos_params*); +int qsendto(int fd, void *buff, size_t len, unsigned int flags, + struct sockaddr *addr, int addr_len, + struct packet_flags *pflags); +int qsend(int fd, void *buff, size_t len, unsigned int flags, + struct packet_flags *pflags); +int qinfo(int fd, struct qsocket_info *info); +int qchannel(int fd, int server); +int qinit(struct qos_params *params); diff -Naur test-for-latech/include/linux/netdevice.h testqf-for-latech/include/linux/netdevice.h --- test-for-latech/include/linux/netdevice.h 2004-06-11 07:40:03.000000000 -0400 +++ testqf-for-latech/include/linux/netdevice.h 2004-06-11 07:47:24.000000000 -0400 @@ -431,6 +431,10 @@ /* this will get initialized at each interface type init routine */ struct divert_blk *divert; #endif /* CONFIG_NET_DIVERT */ +#ifdef CONFIG_QFABRIC + int rte_list; + int rte_list_len; +#endif }; @@ -579,6 +583,9 @@ #define HAVE_NETIF_RX 1 extern int netif_rx(struct sk_buff *skb); extern int dev_ioctl(unsigned int cmd, void *); +#ifdef CONFIG_QFABRIC +extern int dev_ioctl2(unsigned int cmd, void *, int flag); +#endif extern int dev_change_flags(struct net_device *, unsigned); extern void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev); diff -Naur test-for-latech/include/linux/net.h testqf-for-latech/include/linux/net.h --- test-for-latech/include/linux/net.h 2004-06-11 07:40:06.000000000 -0400 +++ testqf-for-latech/include/linux/net.h 2004-06-11 07:47:24.000000000 -0400 @@ -44,7 +44,9 @@ #define SYS_GETSOCKOPT 15 /* sys_getsockopt(2) */ #define SYS_SENDMSG 16 /* sys_sendmsg(2) */ #define SYS_RECVMSG 17 /* sys_recvmsg(2) */ - +#ifdef CONFIG_QFABRIC +#define SYS_RTSOCKET 18 /* sys_rtsocket */ +#endif typedef enum { SS_FREE = 0, /* not allocated */ @@ -76,6 +78,12 @@ short type; unsigned char passcred; + +#ifdef CONFIG_QFABRIC + int rt_sock; + int deadline; + int rt_flags; +#endif }; #define SOCK_INODE(S) ((S)->inode) @@ -134,8 +142,15 @@ extern int sock_unregister(int family); extern struct socket *sock_alloc(void); extern int sock_create(int family, int type, int proto, struct socket **); +#ifdef CONFIG_QFABRIC +extern int make_rt_sock(struct socket *); +#endif extern void sock_release(struct socket *); extern int sock_sendmsg(struct socket *, struct msghdr *m, int len); +#ifdef CONFIG_QFABRIC +extern int rt_sock_sendmsg(struct socket *, struct msghdr *m, int len, + int deadline, int flags); +#endif extern int sock_recvmsg(struct socket *, struct msghdr *m, int len, int flags); extern int sock_readv_writev(int type, struct inode * inode, struct file * file, const struct iovec * iov, long count, long size); diff -Naur test-for-latech/include/linux/pkt_cls.h testqf-for-latech/include/linux/pkt_cls.h --- test-for-latech/include/linux/pkt_cls.h 2004-06-11 07:40:08.000000000 -0400 +++ testqf-for-latech/include/linux/pkt_cls.h 2004-06-11 07:47:28.000000000 -0400 @@ -158,4 +158,16 @@ #define TCA_TCINDEX_MAX TCA_TCINDEX_POLICE +enum +{ + TCA_SOCKET_UNSPEC, + TCA_SOCKET_CLASSID, + TCA_SOCKET_PROCESSID, + TCA_SOCKET_FDID, + TCA_SOCKET_INODEID, + TCA_SOCKET_POLICE, +}; + +#define TCA_SOCKET_MAX TCA_SOCKET_POLICE + #endif diff -Naur test-for-latech/include/linux/pkt_sched.h testqf-for-latech/include/linux/pkt_sched.h --- test-for-latech/include/linux/pkt_sched.h 2004-06-11 07:40:08.000000000 -0400 +++ testqf-for-latech/include/linux/pkt_sched.h 2004-06-11 07:47:28.000000000 -0400 @@ -93,6 +93,26 @@ __u32 limit; /* Queue length: bytes for bfifo, packets for pfifo */ }; +/* DWCS section */ +struct tc_dwcs_qopt +{ + __u32 limit; +}; + +enum +{ + TCA_DWCS_UNSPEC, + TCA_DWCS_DEADLINE, + TCA_DWCS_OLN, + TCA_DWCS_OLD, +#define DWCS_FLAG1 0x00000002 +#define DWCS_FLAG2 0x00000004 + TCA_DWCS_FLAGS, + TCA_DWCS_POLICE, +}; + +#define TCA_DWCS_MAX TCA_DWCS_POLICE + /* PRIO section */ #define TCQ_PRIO_BANDS 16 diff -Naur test-for-latech/include/linux/qfabric.h testqf-for-latech/include/linux/qfabric.h --- test-for-latech/include/linux/qfabric.h 1969-12-31 19:00:00.000000000 -0500 +++ testqf-for-latech/include/linux/qfabric.h 2004-06-11 07:47:29.000000000 -0400 @@ -0,0 +1,75 @@ +#ifndef __QFABRIC__H__ +#define __QFABRIC__H__ + +#ifdef __KERNEL__ +#include + +extern struct socket *look_up_pseudofd(int fd, struct socket *fd_array[]); +extern int get_pseudofd(struct socket *sock, struct socket *fd_array[]); +extern int release_pseudofd(int fd, struct socket *fd_array[]); +extern void initialize_qfabric(void); + +#else + +#ifndef CONFIG_QFABRIC +#define CONFIG_QFABRIC +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern int query_module(const char *, int, void *, size_t, size_t); +extern int qfabric_config(char *app_id, char *group_id); + +/* system call: kecho_load. */ +_syscall2(int, kecho_load, + char *, module_name, + int, argument); + +_syscall1(int, KECho_syscall_echo, + void *, echo_data); + +#ifdef CONFIG_X86 +_fast_syscall1(int, fast_KECho_syscall_echo, + void *, echo_data); +#endif + +_syscall1(int, KECho_syscall_cm, + void *, cm_data); + +#ifdef CONFIG_X86 +_fast_syscall1(int, fast_KECho_syscall_cm, + void *, cm_data); +#endif + +_syscall1(int, KECho_syscall_cg, + void *, cm_data); + +#ifdef CONFIG_X86 +_fast_syscall1(int, fast_KECho_syscall_cg, + void *, cm_data); +#endif + +_syscall1(int, KECho_syscall_atl, + void *, atl_data); + +#ifdef CONFIG_X86 +_fast_syscall1(int, fast_KECho_syscall_atl, + void *, atl_data); +#endif + +_syscall2(int, qos_configure, + char *, app_id, + char *, group_id); + +#endif /* __KERNEL__ */ +#endif /* __QFABRIC__H__ */ diff -Naur test-for-latech/include/linux/qf_api.h testqf-for-latech/include/linux/qf_api.h --- test-for-latech/include/linux/qf_api.h 1969-12-31 19:00:00.000000000 -0500 +++ testqf-for-latech/include/linux/qf_api.h 2004-06-11 07:47:29.000000000 -0400 @@ -0,0 +1,24 @@ +#ifndef __QFAPI__H__ +#define __QFAPI__H__ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +_syscall2(int, change_clock, + int, flag, + int, value); + +_syscall2(int, qos_configure, + char *, app_id, + char *, group_id); + +#endif diff -Naur test-for-latech/include/linux/qos_conf.h testqf-for-latech/include/linux/qos_conf.h --- test-for-latech/include/linux/qos_conf.h 1969-12-31 19:00:00.000000000 -0500 +++ testqf-for-latech/include/linux/qos_conf.h 2004-06-11 07:47:29.000000000 -0400 @@ -0,0 +1,63 @@ +/*File :qos_conf.h + *Written by :Rabin Patra & Vibha Rathi + *Date :12 July 2001 + * + *Definations for: + *1.struct qos_request + *2.struct qos_msg + *3.struct qos_syscall_msg + */ + + +#ifndef __QOS_CONF_H__ +#define __QOS_CONF_H__ 1 + +#include +#include + +#define QOS_QDISC_ADD 10 +#define QOS_QDISC_CHANGE 11 +#define QOS_QDISC_DELETE 12 + +#define QOS_CLASS_ADD 14 +#define QOS_CLASS_CHANGE 15 +#define QOS_CLASS_DELETE 16 + +#define QOS_FILTER_ADD 18 +#define QOS_FILTER_CHANGE 19 +#define QOS_FILTER_DELETE 20 + +#define QOS_MAX_MSG 16 + +#define QOS_MAX_ATTRS 128 + +struct qos_request { + struct nlmsghdr n; + struct tcmsg t; + char buff[4096]; +}; + +struct qos_msg{ + struct qos_request req; + int action; +}; + +struct qos_syscall_msg { + struct qos_msg *msglist; + int no_of_msgs; +}; + +/*qos_get_all_args: + *function to copy from user to kernel space + */ +extern int qos_get_all_args(struct qos_syscall_msg *,struct qos_syscall_msg *); + +/*qos_do_conf: + *function which does the qos_configuration for one nessage + */ +extern int qos_do_conf(struct qos_msg *); + + + + +#endif diff -Naur test-for-latech/include/linux/qsocket.h testqf-for-latech/include/linux/qsocket.h --- test-for-latech/include/linux/qsocket.h 1969-12-31 19:00:00.000000000 -0500 +++ testqf-for-latech/include/linux/qsocket.h 2004-06-11 07:47:29.000000000 -0400 @@ -0,0 +1,177 @@ +/*File :qsocket.c + *Written by :Rabin Patra & Vibha Rathi + *Date :12 July 2001 + * + *Definations for + *1.struct qos_param + */ + +#include +//#include +//#include +//#include + +#ifndef __QSOCKET_H__ +#define __QSOCKET_H__ + +/* + * Only SYS_QSEND is used actually + */ + +#define SYS_QSOCKET 1 /* sys_qsocket(2) */ +#define SYS_QBIND 2 /* sys_qbind(2) */ +#define SYS_QCONNECT 3 /* sys_qconnect(2) */ +#define SYS_QLISTEN 4 /* sys_qlisten(2) */ +#define SYS_QACCEPT 5 /* sys_qaccept(2) */ +#define SYS_QGETSOCKNAME 6 /* sys_qgetsockname(2) */ +#define SYS_QGETPEERNAME 7 /* sys_qgetpeername(2) */ +#define SYS_QSOCKETPAIR 8 /* sys_qsocketpair(2) */ +#define SYS_QSEND 9 /* sys_qsend(2) */ +#define SYS_QSHUTDOWN 10 +#define SYS_QCHANGE 11 +#define SYS_QSENDTO 12 +#define SYS_QINFO 16 +#define SYS_QRECVMSG 17 /* sys_qrecvmesg */ +#define SYS_QINIT 20 + +#define MAX_QOS_PARAM_SIZE 128 + +struct qos_param{ + void * data; + int len; +}; + +#ifndef IFNAMSIZ +#define IFNAMSIZ 16 +#endif + +#ifndef DWCS_VIOLATION +/* --RW-- */ +#define DWCS_VIOLATION 0x00000001 /* Window-constraint violation. */ +#define DWCS_WORK_CONS 0x00000002 /* Does task support work-conservation? */ +#define DWCS_NON_DROPPABLE 0x00000008 /* Set when process is non-preemptive */ +#define DWCS_NON_PREEMPTIVE 0x00000004 /* Set when process is non-preemptive */ +#endif + +#define APP_MAX 128 + +#ifdef NEW_VERSION + +struct qos_params +{ + int qos_on; + int disable; + char dev[IFNAMSIZ]; + char name[IFNAMSIZ]; + char *app_id; + void *attributes; +}; + +#else + +struct qos_params +{ + int qos_on; + int disable; + char dev[IFNAMSIZ]; + char name[IFNAMSIZ]; + char *app_id; + void *attributes; + int ipg; + int old; + int oln; + int flags; /*work conserving or non work conserving*/ + int attribute; /*is the stream droppable or not?*/ + int server; + int use_cpu; + int use_net; +}; + +#endif + +struct packet_flags +{ + int drop_flag; + int urgent_flag; + int fragments; +}; + + +struct qsocket_info +{ + unsigned int input_qlen; + unsigned int output_qlen; + unsigned int missed_deadlines; + unsigned int cpu_time; + unsigned int delay_jif; + unsigned int sent_packets; +}; + +#ifdef __KERNEL__ + +struct qops +{ + char id[IFNAMSIZ]; + int (*create)(struct net_device *dev, void *attributes); + int (*add_stream)(struct Qdisc *q, void *attributes, int sock_fd); + int (*remove_stream)(struct Qdisc *q, int sock_fd); + int (*change_stream)(struct Qdisc *q, void *attributes, int i_ino); + int (*get_stream_info)(struct Qdisc *q, int i_ino, void *info); +}; + +struct qop_list +{ + struct qops *op; + struct qop_list *next; +}; + +extern struct qop_list *qop_base; + +static inline void register_qops(struct qops *ops) +{ + /*add to list*/ + struct qop_list *temp = kmalloc(sizeof(struct qop_list), GFP_KERNEL); + + if(ops == NULL) + printk("null passed damint\n"); + + temp->op = ops; + + temp->next = qop_base; + qop_base = temp; + + + printk(KERN_INFO "Registering qops = %s\n", qop_base->op->id); + +} + + +static inline void unregister_qops(struct qops *ops) +{ + /*remove from list*/ +} + +struct socket_head +{ + struct socket_filter *ht[256]; /* a hash table for socket_filters */ +}; + + +struct socket_filter +{ + struct socket_filter *next; + u32 id; + u32 pid; /* the pid, and */ + unsigned long fd; /* the fd to monitor for; or */ + unsigned long i_ino; /* the inode to monitor for */ + struct tcf_result res; +#ifdef CONFIG_NET_CLS_POLICE + struct tcf_police *police; +#endif +}; + + +#endif + +#endif + diff -Naur test-for-latech/include/linux/sch_dwcs.h testqf-for-latech/include/linux/sch_dwcs.h --- test-for-latech/include/linux/sch_dwcs.h 1969-12-31 19:00:00.000000000 -0500 +++ testqf-for-latech/include/linux/sch_dwcs.h 2004-06-11 07:47:29.000000000 -0400 @@ -0,0 +1,161 @@ +/* + * net/sched/sch_dwcs.h DWCS algorithm scheduler. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + * Authors: Gregory Losik + * Richard West + * Christian Poellabauer + * + * Changes: J.D. Hollis + * cleaned up the formatting and added some comments + * + */ + + +#define TRUE 1 +#define FALSE 0 +#define MAX_CONNS 255 // GL: Technically it should be 2^16 but lets risk it... + +#define DWCS_VIOLATION 0x00000001 /* Window-constraint violation. */ +#define DWCS_WORK_CONS 0x00000002 /* Does task support work-conservation? */ +#define DWCS_NON_DROPPABLE 0x00000008 + + + +#include + + +/* Scheduler attributes. Not all members are necessary for all scheduling policies. */ +typedef struct dwcs_class_attr { + // int cd; /* Class descriptor. */ + // unsigned cnt; /* Number pkts queued for this class. */ + + /* JDH: w, s, and f might not be needed as we've got a DWCS qdisc now */ + double w; /* Weight. (For SFQ) */ + double s; /* Start tag. (For SFQ) */ + double f; /* Finish tag. (For SFQ) */ + + /* these are the actual, user-definable attributes */ + long deadline; + long readytime;/* ok this requires a little explanation + this is to maintain a specific throughput from the class + thus a stream with packets to send, on an idle network + won't send packets until the ready time has elasped for the + stream + */ + + unsigned long ipg; /* Inter-packet/msg gap. */ + unsigned oln; /* Original loss numerator. */ + unsigned old; /* Original loss denominator. */ + + /* statistics */ + unsigned cln; /* Current loss numerator. */ + unsigned cld; /* Current loss denominator. */ + long clt; /* Current loss tolerance. */ + unsigned late; /* Stats - number late pkts. */ + unsigned sent; /* Stats - number pkts sent. */ + unsigned violations; /* Stats - number loss tolerance violations. */ + unsigned long delay; /* Cumulative delay for this class. */ + int t; /* Simulated time to process pkt. */ + unsigned window; /* Packet window size. */ + unsigned wlate; /* Count of late pkts in a time window. */ + unsigned long bytes; /* Total bytes serviced for this class. */ + // long start_time; /* Real-time this class started. */ + + /* GL: since there is no per packet flag, it needs to be per stream... */ + int droppable; /* TRUE if packets may be dropped. */ + unsigned int flags; /* Flags as specified by user */ +} dwcs_class_attr_t; + + +/* Deadline heap attributes. */ +struct dl_heap { + long deadline; /* Packet deadline. */ + // int stream; /* Stream number. */ + u32 stream; /* Stream number. */ +}; + +struct sl_heap +{ + long readytime; + u32 stream; +}; + + +/* Loss tolerance heap attributes. */ +struct lt_heap { + int stream; /* Stream number. */ + long deadline; /* Packet deadline. */ + int cln; /* Current loss numerator. */ + int cld; /* Current loss denominator. */ + int oln; /* Original loss numerator. */ + int wlate; /* Late packets in window. */ + unsigned long arr_time; /* Packet arrival time. */ + long clt; /* Current loss tolerance. */ +}; + +struct dwcs_sched_data; + +struct dwcs_class +{ + struct dwcs_class *next; /* hash table link */ + struct dwcs_class *next_alive; /* next class with backlog in this priority band */ + + /* Parameters */ + u32 classid; /* the major:minor class id */ + unsigned char priority; /* class priority */ + unsigned int *socket_num; /* to be a socket number.... */ +#ifdef CONFIG_NET_CLS_POLICE + unsigned char police; +#endif + struct Qdisc *qdisc; /* Ptr to DWCS discipline that class belongs to */ + struct Qdisc *q; /* Elementary queueing discipline */ + + /* Variables */ + struct tcf_proto *filter_list; + int refcnt; /* used by _get() and _put() reference tracking */ + int filters; /* for keeping track the number of filters */ + struct tc_stats stats; /* ??? used by _NET_ESTIMATOR */ + + /* DWCS specific parameters */ + struct dwcs_class_attr attr; /* Low level attributes of a class */ +}; + + + + +struct dwcs_sched_data +{ + struct dwcs_class *classes[ 16 ]; /* Hash table of all classes. This is where all new calsses get inserted in */ + struct dwcs_class *link; /* Default class for case when filters don't match */ + unsigned classcount; /* the counder for total # of classes; q->classes[i] has the actual list */ + + + /* DWCS specific attributes */ + struct dwcs_class *next_class; /* next class from which we will try to dequeue (to be deleted) */ + + struct lt_heap ltheap[MAX_CONNS]; /* Loss-Tolerance Heap */ + int ltheap_size; + struct dl_heap dlheap[MAX_CONNS]; /* Deadline Heap */ + int dlheap_size; + struct sl_heap slheap[MAX_CONNS]; + int slheap_size; + struct timer_list wd_timer; /* Watchdog timer */ + + +#ifdef CONFIG_PROC_FS + struct proc_dir_entry *ent; +#endif + +#ifdef CONFIG_NET_CLS_POLICE + struct dwcs_class *rx_class; +#endif + +}; + + + diff -Naur test-for-latech/include/linux/sched.h testqf-for-latech/include/linux/sched.h --- test-for-latech/include/linux/sched.h 2004-06-11 07:40:02.000000000 -0400 +++ testqf-for-latech/include/linux/sched.h 2004-06-11 07:47:24.000000000 -0400 @@ -46,6 +46,10 @@ #define CLONE_SIGNAL (CLONE_SIGHAND | CLONE_THREAD) +#ifdef CONFIG_QFABRIC +#define MAX_UTILIZATION 1000000 +#endif + /* * These are the constant used to fake the fixed-point load-average * counting. Some notes: @@ -119,13 +123,56 @@ #define SCHED_FIFO 1 #define SCHED_RR 2 +#ifdef CONFIG_DWCS +/* --RW-- */ +#define SCHED_DWCS 3 +#endif + +/* --CP-- */ +#ifdef CONFIG_QFABRIC +#define SCHED_UPCALL_OTHER 4 +#define SCHED_UPCALL_FIFO 5 +#define SCHED_UPCALL_RR 6 +extern struct wait_queue *global_wait_queue; +extern int upcall_sched_active; +extern int ECalls_current_flag; +extern struct task_struct *ECalls_current; +#endif + +#ifdef CONFIG_DWCS +/* --RW-- */ +#define DWCS_VIOLATION 0x00000001 /* Window-constraint violation. */ +#define DWCS_WORK_CONS 0x00000002 /* Does task support work-conservation? */ +#define DWCS_NON_PREEMPTIVE 0x00000004 /* Set when process is non-preemptive */ +#endif + /* * This is an additional bit set when we want to * yield the CPU for one re-schedule.. */ #define SCHED_YIELD 0x10 -struct sched_param { +#ifdef CONFIG_QFABRIC +#define NR_TASKS 512 +#define MAX_FDS 1024 +#endif + +#if defined(CONFIG_DWCS)||defined(CONFIG_QFABRIC) +struct dwcs_sched_param { + int pid; /* --FS-- The pid for which ioctl is done. */ + int policy; /* --FS-- The selected policy, -1 for unset. */ + int sched_priority; + unsigned long period; /* --RW-- Request period. Used for setting + DWCS deadlines. */ + unsigned int own; /* --RW-- Original window numerator. */ + unsigned int owd; /* --RW-- Original window denominator. */ + unsigned int flags; /* --RW-- Right now, work-conserving or not. */ + unsigned long service_time; /* --RW-- Time to service a process + every period. */ +}; +#endif + +struct sched_param{ int sched_priority; }; @@ -284,6 +331,70 @@ extern struct user_struct root_user; #define INIT_USER (&root_user) +/* --RW-- */ +#ifdef CONFIG_DWCS +struct dwcs_struct { + int cd; /* Class descriptor. */ + unsigned long deadline; + unsigned long period; /* Request period. */ + unsigned int own; /* Original window numerator. */ + unsigned int owd; /* Original window denominator. */ + unsigned int cwn; /* Current window numerator. */ + unsigned int cwd; /* Current window denominator. */ + unsigned int flags; /* Bitwise flags for future work. */ + unsigned long ready_time; /* Time when task can be serviced. */ + unsigned long service_time; /* Time to service a process every period. */ + unsigned long time_serviced; /* How much time process has been serviced + * so far, in the current processing period. + */ + /* Energy saving attributes */ + int cpu_speedup; /* Describes how much the clockrate can be lowered due + to not max. utilization of the processor scaled by + 100, e.g. if this proc. can be run at half + clockspeed it is 200 (clockrate * 100 / + cpu_speedup) */ + + /* Statistical attributes. */ + unsigned int wlate; /* Count of late tasks in a time window. */ + unsigned long late; /* Cumulative missed deadlines. */ + unsigned long on_time; /* Cumulative met deadlines. */ + unsigned long violations; /* Cumulative window-constraint violations. */ +}; +#endif + +/* --RW-- */ +#ifdef CONFIG_DWCS +#define INIT_DWCS { \ + 0, \ + (unsigned long)(-1), \ + (unsigned long)(-1), \ + 1, \ + 10, \ + 1, \ + 10, \ + DWCS_WORK_CONS, \ + 0, \ + 1, \ + 0, \ + 0, \ + 0, \ + 0, \ + 0 } +#endif +/* End of --RW-- */ + +/* Artemis */ +#ifdef CONFIG_QFABRIC +struct qfabric_struct { + void *fdqfabric; + int orig_weight; + int weight; + int sw_pending; + unsigned long sleep_queue; + wait_queue_head_t kecho_queue; +}; +#endif + struct task_struct { /* * offsets of these are hardcoded elsewhere - touch with care @@ -409,6 +520,10 @@ int (*notifier)(void *priv); void *notifier_data; sigset_t *notifier_mask; + +#ifdef CONFIG_DWCS + struct dwcs_struct *dwcs_params; /* --RW-- */ +#endif /* Thread group tracking */ u32 parent_exec_id; @@ -418,6 +533,17 @@ /* journalling filesystem info */ void *journal_info; + +/* Artemis */ +#ifdef CONFIG_QFABRIC + struct qfabric_struct *qfabric; + int kthread; + int suser_flag; + int uaccess_flag; + int ecalls_flag; +/* Useful Measurement Stuff */ + long syscall_counter; +#endif }; /* @@ -470,6 +596,7 @@ * INIT_TASK is used to set up the first task table, touch at * your own risk!. Base=0, limit=0x1fffff (=2MB) */ +#ifdef CONFIG_DWCS #define INIT_TASK(tsk) \ { \ state: 0, \ @@ -509,10 +636,54 @@ sig: &init_signals, \ pending: { NULL, &tsk.pending.head, {{0}}}, \ blocked: {{0}}, \ + dwcs_params: &init_dwcs, \ alloc_lock: SPIN_LOCK_UNLOCKED, \ journal_info: NULL, \ } - +#else +#define INIT_TASK(tsk) \ +{ \ + state: 0, \ + flags: 0, \ + sigpending: 0, \ + addr_limit: KERNEL_DS, \ + exec_domain: &default_exec_domain, \ + lock_depth: -1, \ + counter: DEF_COUNTER, \ + nice: DEF_NICE, \ + policy: SCHED_OTHER, \ + mm: NULL, \ + active_mm: &init_mm, \ + cpus_runnable: -1, \ + cpus_allowed: -1, \ + run_list: LIST_HEAD_INIT(tsk.run_list), \ + next_task: &tsk, \ + prev_task: &tsk, \ + p_opptr: &tsk, \ + p_pptr: &tsk, \ + thread_group: LIST_HEAD_INIT(tsk.thread_group), \ + wait_chldexit: __WAIT_QUEUE_HEAD_INITIALIZER(tsk.wait_chldexit),\ + real_timer: { \ + function: it_real_fn \ + }, \ + cap_effective: CAP_INIT_EFF_SET, \ + cap_inheritable: CAP_INIT_INH_SET, \ + cap_permitted: CAP_FULL_SET, \ + keep_capabilities: 0, \ + rlim: INIT_RLIMITS, \ + user: INIT_USER, \ + comm: "swapper", \ + thread: INIT_THREAD, \ + fs: &init_fs, \ + files: &init_files, \ + sigmask_lock: SPIN_LOCK_UNLOCKED, \ + sig: &init_signals, \ + pending: { NULL, &tsk.pending.head, {{0}}}, \ + blocked: {{0}}, \ + alloc_lock: SPIN_LOCK_UNLOCKED, \ + journal_info: NULL, \ +} +#endif #ifndef INIT_TASK_SIZE # define INIT_TASK_SIZE 2048*sizeof(long) @@ -718,6 +889,9 @@ */ static inline int suser(void) { +#ifdef CONFIG_QFABRIC + if (current->suser_flag == 1) return 1; +#endif if (!issecure(SECURE_NOROOT) && current->euid == 0) { current->flags |= PF_SUPERPRIV; return 1; @@ -727,6 +901,9 @@ static inline int fsuser(void) { +#ifdef CONFIG_QFABRIC + if (current->suser_flag == 1) return 1; +#endif if (!issecure(SECURE_NOROOT) && current->fsuid == 0) { current->flags |= PF_SUPERPRIV; return 1; @@ -742,6 +919,9 @@ static inline int capable(int cap) { +#ifdef CONFIG_QFABRIC + if (current->suser_flag == 1) return 1; +#endif #if 1 /* ok now */ if (cap_raised(current->cap_effective, cap)) #else @@ -884,6 +1064,25 @@ #define for_each_thread(task) \ for (task = next_thread(current) ; task != current ; task = next_thread(task)) + + +/* + * GANEV: This typedef and the external aligned_data symbol declaration + * are needed so that the "aligned_data" will be visible outside + * the kernel to loadable schedulers like DWCS. + */ +#ifdef CONFIG_DWCS +typedef union { + struct schedule_data { + struct task_struct * curr; + cycles_t last_schedule; + } schedule_data; + char __pad [SMP_CACHE_BYTES]; +} aligned_data_t; + +extern aligned_data_t aligned_data[NR_CPUS]; +#endif + #define next_thread(p) \ list_entry((p)->thread_group.next, struct task_struct, thread_group) @@ -945,5 +1144,4 @@ } #endif /* __KERNEL__ */ - #endif diff -Naur test-for-latech/include/linux/skbuff.h testqf-for-latech/include/linux/skbuff.h --- test-for-latech/include/linux/skbuff.h 2004-06-11 07:40:02.000000000 -0400 +++ testqf-for-latech/include/linux/skbuff.h 2004-06-11 07:47:24.000000000 -0400 @@ -193,6 +193,10 @@ unsigned char *tail; /* Tail pointer */ unsigned char *end; /* End pointer */ + int drop_flag; + int urgent_flag; + int fragments; + void (*destructor)(struct sk_buff *); /* Destruct function */ #ifdef CONFIG_NETFILTER /* Can be used for communication between hooks. */ @@ -215,6 +219,10 @@ #ifdef CONFIG_NET_SCHED __u32 tc_index; /* traffic control index */ #endif +#ifdef CONFIG_QFABRIC + int deadline; + int flags; +#endif }; #define SK_WMEM_MAX 65535 diff -Naur test-for-latech/include/linux/sys.h testqf-for-latech/include/linux/sys.h --- test-for-latech/include/linux/sys.h 2004-06-11 07:40:04.000000000 -0400 +++ testqf-for-latech/include/linux/sys.h 2004-06-11 07:47:24.000000000 -0400 @@ -4,7 +4,7 @@ /* * system call entry points ... but not all are defined */ -#define NR_syscalls 256 +#define NR_syscalls 280 /* * These are system calls that will be removed at some time diff -Naur test-for-latech/include/net/bpf.h testqf-for-latech/include/net/bpf.h --- test-for-latech/include/net/bpf.h 1969-12-31 19:00:00.000000000 -0500 +++ testqf-for-latech/include/net/bpf.h 2004-06-11 07:47:33.000000000 -0400 @@ -0,0 +1,463 @@ +/*- + * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from the Stanford/CMU enet packet filter, + * (net/enet.c) distributed as part of 4.3BSD, and code contributed + * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence + * Berkeley Laboratory. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)bpf.h 7.1 (Berkeley) 5/7/91 + * + * @(#) $Header: /tcpdump/master/libpcap/bpf/net/Attic/bpf.h,v 1.52.2.6 2002/06/07 04:31:57 guy Exp $ (LBL) + */ + +#ifndef BPF_MAJOR_VERSION + +#ifdef __cplusplus +extern "C" { +#endif + +/* BSD style release date */ +#define BPF_RELEASE 199606 + +typedef int bpf_int32; +typedef u_int bpf_u_int32; + +/* + * Alignment macros. BPF_WORDALIGN rounds up to the next + * even multiple of BPF_ALIGNMENT. + */ +#ifndef __NetBSD__ +#define BPF_ALIGNMENT sizeof(bpf_int32) +#else +#define BPF_ALIGNMENT sizeof(long) +#endif +#define BPF_WORDALIGN(x) (((x)+(BPF_ALIGNMENT-1))&~(BPF_ALIGNMENT-1)) + +#define BPF_MAXINSNS 512 +#define BPF_MAXBUFSIZE 0x8000 +#define BPF_MINBUFSIZE 32 + +/* + * Structure for BIOCSETF. + */ +struct bpf_program { + u_int bf_len; + struct bpf_insn *bf_insns; +}; + +/* + * Struct returned by BIOCGSTATS. + */ +struct bpf_stat { + u_int bs_recv; /* number of packets received */ + u_int bs_drop; /* number of packets dropped */ +}; + +/* + * Struct return by BIOCVERSION. This represents the version number of + * the filter language described by the instruction encodings below. + * bpf understands a program iff kernel_major == filter_major && + * kernel_minor >= filter_minor, that is, if the value returned by the + * running kernel has the same major number and a minor number equal + * equal to or less than the filter being downloaded. Otherwise, the + * results are undefined, meaning an error may be returned or packets + * may be accepted haphazardly. + * It has nothing to do with the source code version. + */ +struct bpf_version { + u_short bv_major; + u_short bv_minor; +}; +/* Current version number of filter architecture. */ +#define BPF_MAJOR_VERSION 1 +#define BPF_MINOR_VERSION 1 + +/* + * BPF ioctls + * + * The first set is for compatibility with Sun's pcc style + * header files. If your using gcc, we assume that you + * have run fixincludes so the latter set should work. + */ +#if (defined(sun) || defined(ibm032)) && !defined(__GNUC__) +#define BIOCGBLEN _IOR(B,102, u_int) +#define BIOCSBLEN _IOWR(B,102, u_int) +#define BIOCSETF _IOW(B,103, struct bpf_program) +#define BIOCFLUSH _IO(B,104) +#define BIOCPROMISC _IO(B,105) +#define BIOCGDLT _IOR(B,106, u_int) +#define BIOCGETIF _IOR(B,107, struct ifreq) +#define BIOCSETIF _IOW(B,108, struct ifreq) +#define BIOCSRTIMEOUT _IOW(B,109, struct timeval) +#define BIOCGRTIMEOUT _IOR(B,110, struct timeval) +#define BIOCGSTATS _IOR(B,111, struct bpf_stat) +#define BIOCIMMEDIATE _IOW(B,112, u_int) +#define BIOCVERSION _IOR(B,113, struct bpf_version) +#define BIOCSTCPF _IOW(B,114, struct bpf_program) +#define BIOCSUDPF _IOW(B,115, struct bpf_program) +#else +#define BIOCGBLEN _IOR('B',102, u_int) +#define BIOCSBLEN _IOWR('B',102, u_int) +#define BIOCSETF _IOW('B',103, struct bpf_program) +#define BIOCFLUSH _IO('B',104) +#define BIOCPROMISC _IO('B',105) +#define BIOCGDLT _IOR('B',106, u_int) +#define BIOCGETIF _IOR('B',107, struct ifreq) +#define BIOCSETIF _IOW('B',108, struct ifreq) +#define BIOCSRTIMEOUT _IOW('B',109, struct timeval) +#define BIOCGRTIMEOUT _IOR('B',110, struct timeval) +#define BIOCGSTATS _IOR('B',111, struct bpf_stat) +#define BIOCIMMEDIATE _IOW('B',112, u_int) +#define BIOCVERSION _IOR('B',113, struct bpf_version) +#define BIOCSTCPF _IOW('B',114, struct bpf_program) +#define BIOCSUDPF _IOW('B',115, struct bpf_program) +#endif + +/* + * Structure prepended to each packet. + */ +struct bpf_hdr { + struct timeval bh_tstamp; /* time stamp */ + bpf_u_int32 bh_caplen; /* length of captured portion */ + bpf_u_int32 bh_datalen; /* original length of packet */ + u_short bh_hdrlen; /* length of bpf header (this struct + plus alignment padding) */ +}; +/* + * Because the structure above is not a multiple of 4 bytes, some compilers + * will insist on inserting padding; hence, sizeof(struct bpf_hdr) won't work. + * Only the kernel needs to know about it; applications use bh_hdrlen. + */ +#if defined(KERNEL) || defined(_KERNEL) +#define SIZEOF_BPF_HDR 18 +#endif + +/* + * Data-link level type codes. + */ + +/* + * These are the types that are the same on all platforms; on other + * platforms, a should be supplied that defines the additional + * DLT_* codes appropriately for that platform (the BSDs, for example, + * should not just pick up this version of "bpf.h"; they should also define + * the additional DLT_* codes used by their kernels, as well as the values + * defined here - and, if the values they use for particular DLT_ types + * differ from those here, they should use their values, not the ones + * here). + */ +#define DLT_NULL 0 /* no link-layer encapsulation */ +#define DLT_EN10MB 1 /* Ethernet (10Mb) */ +#define DLT_EN3MB 2 /* Experimental Ethernet (3Mb) */ +#define DLT_AX25 3 /* Amateur Radio AX.25 */ +#define DLT_PRONET 4 /* Proteon ProNET Token Ring */ +#define DLT_CHAOS 5 /* Chaos */ +#define DLT_IEEE802 6 /* IEEE 802 Networks */ +#define DLT_ARCNET 7 /* ARCNET */ +#define DLT_SLIP 8 /* Serial Line IP */ +#define DLT_PPP 9 /* Point-to-point Protocol */ +#define DLT_FDDI 10 /* FDDI */ + +/* + * These are values from the traditional libpcap "bpf.h". + * Ports of this to particular platforms should replace these definitions + * with the ones appropriate to that platform, if the values are + * different on that platform. + */ +#define DLT_ATM_RFC1483 11 /* LLC/SNAP encapsulated atm */ +#define DLT_RAW 12 /* raw IP */ + +/* + * These are values from BSD/OS's "bpf.h". + * These are not the same as the values from the traditional libpcap + * "bpf.h"; however, these values shouldn't be generated by any + * OS other than BSD/OS, so the correct values to use here are the + * BSD/OS values. + * + * Platforms that have already assigned these values to other + * DLT_ codes, however, should give these codes the values + * from that platform, so that programs that use these codes will + * continue to compile - even though they won't correctly read + * files of these types. + */ +#ifdef __NetBSD__ +#ifndef DLT_SLIP_BSDOS +#define DLT_SLIP_BSDOS 13 /* BSD/OS Serial Line IP */ +#define DLT_PPP_BSDOS 14 /* BSD/OS Point-to-point Protocol */ +#endif +#else +#define DLT_SLIP_BSDOS 15 /* BSD/OS Serial Line IP */ +#define DLT_PPP_BSDOS 16 /* BSD/OS Point-to-point Protocol */ +#endif + +#define DLT_ATM_CLIP 19 /* Linux Classical-IP over ATM */ + +/* + * These values are defined by NetBSD; other platforms should refrain from + * using them for other purposes, so that NetBSD savefiles with link + * types of 50 or 51 can be read as this type on all platforms. + */ +#define DLT_PPP_SERIAL 50 /* PPP over serial with HDLC encapsulation */ +#define DLT_PPP_ETHER 51 /* PPP over Ethernet */ + +/* + * Values between 100 and 103 are used in capture file headers as + * link-layer types corresponding to DLT_ types that differ + * between platforms; don't use those values for new DLT_ new types. + */ + +/* + * This value was defined by libpcap 0.5; platforms that have defined + * it with a different value should define it here with that value - + * a link type of 104 in a save file will be mapped to DLT_C_HDLC, + * whatever value that happens to be, so programs will correctly + * handle files with that link type regardless of the value of + * DLT_C_HDLC. + * + * The name DLT_C_HDLC was used by BSD/OS; we use that name for source + * compatibility with programs written for BSD/OS. + * + * libpcap 0.5 defined it as DLT_CHDLC; we define DLT_CHDLC as well, + * for source compatibility with programs written for libpcap 0.5. + */ +#define DLT_C_HDLC 104 /* Cisco HDLC */ +#define DLT_CHDLC DLT_C_HDLC + +#define DLT_IEEE802_11 105 /* IEEE 802.11 wireless */ + +/* + * 106 is reserved for Linux Classical IP over ATM; it's like DLT_RAW, + * except when it isn't. (I.e., sometimes it's just raw IP, and + * sometimes it isn't.) We currently handle it as DLT_LINUX_SLL, + * so that we don't have to worry about the link-layer header.) + */ + +/* + * Reserved for Frame Relay; BSD/OS has a DLT_FR, with a value of 11, + * but that collides with other values. DLT_FR and DLT_FRELAY packets + * start with the Frame Relay header (DLCI, etc.). + */ +#define DLT_FRELAY 107 + +/* + * OpenBSD DLT_LOOP, for loopback devices; it's like DLT_NULL, except + * that the AF_ type in the link-layer header is in network byte order. + * + * OpenBSD defines it as 12, but that collides with DLT_RAW, so we + * define it as 108 here. If OpenBSD picks up this file, it should + * define DLT_LOOP as 12 in its version, as per the comment above - + * and should not use 108 as a DLT_ value. + */ +#define DLT_LOOP 108 + +/* + * Values between 109 and 112 are used in capture file headers as + * link-layer types corresponding to DLT_ types that might differ + * between platforms; don't use those values for new DLT_ types + * other than the corresponding DLT_ types. + */ + +/* + * This is for Linux cooked sockets. + */ +#define DLT_LINUX_SLL 113 + +/* + * Apple LocalTalk hardware. + */ +#define DLT_LTALK 114 + +/* + * Acorn Econet. + */ +#define DLT_ECONET 115 + +/* + * Reserved for use with OpenBSD ipfilter. + */ +#define DLT_IPFILTER 116 + +/* + * Reserved for use in capture-file headers as a link-layer type + * corresponding to OpenBSD DLT_PFLOG; DLT_PFLOG is 17 in OpenBSD, + * but that's DLT_LANE8023 in SuSE 6.3, so we can't use 17 for it + * in capture-file headers. + */ +#define DLT_PFLOG 117 + +/* + * Registered for Cisco-internal use. + */ +#define DLT_CISCO_IOS 118 + +/* + * Reserved for 802.11 cards using the Prism II chips, with a link-layer + * header including Prism monitor mode information plus an 802.11 + * header. + */ +#define DLT_PRISM_HEADER 119 + +/* + * Reserved for Aironet 802.11 cards, with an Aironet link-layer header + * (see Doug Ambrisko's FreeBSD patches). + */ +#define DLT_AIRONET_HEADER 120 + +/* + * Reserved for Siemens HiPath HDLC. + */ +#define DLT_HHDLC 121 + +/* + * Reserved for RFC 2625 IP-over-Fibre Channel, as per a request from + * Don Lee . + * + * This is not for use with raw Fibre Channel, where the link-layer + * header starts with a Fibre Channel frame header; it's for IP-over-FC, + * where the link-layer header starts with an RFC 2625 Network_Header + * field. + */ +#define DLT_IP_OVER_FC 122 + +/* + * Reserved for capturing on Solaris with SunATM. + */ +#define DLT_SUNATM 123 /* Solaris+SunATM */ + +/* + * The instruction encodings. + */ +/* instruction classes */ +#define BPF_CLASS(code) ((code) & 0x07) +#define BPF_LD 0x00 +#define BPF_LDX 0x01 +#define BPF_ST 0x02 +#define BPF_STX 0x03 +#define BPF_ALU 0x04 +#define BPF_JMP 0x05 +#define BPF_RET 0x06 +#define BPF_MISC 0x07 + +/* ld/ldx fields */ +#define BPF_SIZE(code) ((code) & 0x18) +#define BPF_W 0x00 +#define BPF_H 0x08 +#define BPF_B 0x10 +#define BPF_MODE(code) ((code) & 0xe0) +#define BPF_IMM 0x00 +#define BPF_ABS 0x20 +#define BPF_IND 0x40 +#define BPF_MEM 0x60 +#define BPF_LEN 0x80 +#define BPF_MSH 0xa0 + +/* alu/jmp fields */ +#define BPF_OP(code) ((code) & 0xf0) +#define BPF_ADD 0x00 +#define BPF_SUB 0x10 +#define BPF_MUL 0x20 +#define BPF_DIV 0x30 +#define BPF_OR 0x40 +#define BPF_AND 0x50 +#define BPF_LSH 0x60 +#define BPF_RSH 0x70 +#define BPF_NEG 0x80 +#define BPF_JA 0x00 +#define BPF_JEQ 0x10 +#define BPF_JGT 0x20 +#define BPF_JGE 0x30 +#define BPF_JSET 0x40 +#define BPF_SRC(code) ((code) & 0x08) +#define BPF_K 0x00 +#define BPF_X 0x08 + +/* ret - BPF_K and BPF_X also apply */ +#define BPF_RVAL(code) ((code) & 0x18) +#define BPF_A 0x10 + +/* misc */ +#define BPF_MISCOP(code) ((code) & 0xf8) +#define BPF_TAX 0x00 +#define BPF_TXA 0x80 + +/* + * The instruction data structure. + */ +struct bpf_insn { + u_short code; + u_char jt; + u_char jf; + bpf_int32 k; +}; + +/* + * Macros for insn array initializers. + */ +#define BPF_STMT(code, k) { (u_short)(code), 0, 0, k } +#define BPF_JUMP(code, k, jt, jf) { (u_short)(code), jt, jf, k } + +#if defined(BSD) && (defined(KERNEL) || defined(_KERNEL)) +/* + * Systems based on non-BSD kernels don't have ifnet's (or they don't mean + * anything if it is in ) and won't work like this. + */ +# if __STDC__ +extern void bpf_tap(struct ifnet *, u_char *, u_int); +extern void bpf_mtap(struct ifnet *, struct mbuf *); +extern void bpfattach(struct ifnet *, u_int, u_int); +extern void bpfilterattach(int); +# else +extern void bpf_tap(); +extern void bpf_mtap(); +extern void bpfattach(); +extern void bpfilterattach(); +# endif /* __STDC__ */ +#endif /* BSD && (_KERNEL || KERNEL) */ +#if __STDC__ || defined(__cplusplus) +extern int bpf_validate(struct bpf_insn *, int); +extern u_int bpf_filter(struct bpf_insn *, u_char *, u_int, u_int); +#else +extern int bpf_validate(); +extern u_int bpf_filter(); +#endif + +/* + * Number of scratch memory words (for BPF_LD|BPF_MEM and BPF_ST). + */ +#define BPF_MEMWORDS 16 + +#ifdef __cplusplus +} +#endif + +#endif diff -Naur test-for-latech/include/net/dwcs.h testqf-for-latech/include/net/dwcs.h --- test-for-latech/include/net/dwcs.h 1969-12-31 19:00:00.000000000 -0500 +++ testqf-for-latech/include/net/dwcs.h 2004-06-11 07:47:33.000000000 -0400 @@ -0,0 +1,39 @@ + +void watchdog(unsigned long arg) +{ + struct net_device *dev = (struct net_device*) arg; + if(dev) + { + netif_schedule(dev); + } +} + + + +void dwcs_init_timer(struct timer_list *wd_timer, struct net_device *dev) +{ + init_timer(wd_timer); + wd_timer->function = watchdog; + wd_timer->data = (unsigned long)dev; +} + +/* + * Helper function to return the address of the class + * by providing the classid (that includes major and minor ids), + * Returns NULL, if no class is found. + */ +static __inline__ struct dwcs_class * +dwcs_class_lookup ( struct dwcs_sched_data *q, + u32 classid ) +{ + struct dwcs_class *cl; + + for ( cl = q->classes[dwcs_hash ( classid )]; cl; cl = cl->next ) + if ( cl->classid == classid ) + { + return cl; + } + + return NULL; +} + diff -Naur test-for-latech/include/net/ethernet.h testqf-for-latech/include/net/ethernet.h --- test-for-latech/include/net/ethernet.h 1969-12-31 19:00:00.000000000 -0500 +++ testqf-for-latech/include/net/ethernet.h 2004-06-11 07:47:33.000000000 -0400 @@ -0,0 +1,76 @@ +/* Copyright (C) 1997, 1999, 2001 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +/* Based on the FreeBSD version of this file. Curiously, that file + lacks a copyright in the header. */ + +#ifndef __NET_ETHERNET_H +#define __NET_ETHERNET_H 1 + +#include +#include +#include /* IEEE 802.3 Ethernet constants */ + +__BEGIN_DECLS + +/* This is a name for the 48 bit ethernet address available on many + systems. */ +struct ether_addr +{ + u_int8_t ether_addr_octet[ETH_ALEN]; +} __attribute__ ((__packed__)); + +/* 10Mb/s ethernet header */ +struct ether_header +{ + u_int8_t ether_dhost[ETH_ALEN]; /* destination eth addr */ + u_int8_t ether_shost[ETH_ALEN]; /* source ether addr */ + u_int16_t ether_type; /* packet type ID field */ +} __attribute__ ((__packed__)); + +/* Ethernet protocol ID's */ +#define ETHERTYPE_PUP 0x0200 /* Xerox PUP */ +#define ETHERTYPE_IP 0x0800 /* IP */ +#define ETHERTYPE_ARP 0x0806 /* Address resolution */ +#define ETHERTYPE_REVARP 0x8035 /* Reverse ARP */ + +#define ETHER_ADDR_LEN ETH_ALEN /* size of ethernet addr */ +#define ETHER_TYPE_LEN 2 /* bytes in type field */ +#define ETHER_CRC_LEN 4 /* bytes in CRC field */ +#define ETHER_HDR_LEN ETH_HLEN /* total octets in header */ +#define ETHER_MIN_LEN (ETH_ZLEN + ETHER_CRC_LEN) /* min packet length */ +#define ETHER_MAX_LEN (ETH_FRAME_LEN + ETHER_CRC_LEN) /* max packet length */ + +/* make sure ethenet length is valid */ +#define ETHER_IS_VALID_LEN(foo) \ + ((foo) >= ETHER_MIN_LEN && (foo) <= ETHER_MAX_LEN) + +/* + * The ETHERTYPE_NTRAILER packet types starting at ETHERTYPE_TRAIL have + * (type-ETHERTYPE_TRAIL)*512 bytes of data followed + * by an ETHER type (as given above) and then the (variable-length) header. + */ +#define ETHERTYPE_TRAIL 0x1000 /* Trailer packet */ +#define ETHERTYPE_NTRAILER 16 + +#define ETHERMTU ETH_DATA_LEN +#define ETHERMIN (ETHER_MIN_LEN - ETHER_HDR_LEN - ETHER_CRC_LEN) + +__END_DECLS + +#endif /* net/ethernet.h */ diff -Naur test-for-latech/include/net/if_arp.h testqf-for-latech/include/net/if_arp.h --- test-for-latech/include/net/if_arp.h 1969-12-31 19:00:00.000000000 -0500 +++ testqf-for-latech/include/net/if_arp.h 2004-06-11 07:47:33.000000000 -0400 @@ -0,0 +1,173 @@ +/* Definitions for Address Resolution Protocol. + Copyright (C) 1997, 1999, 2001 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 1997. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +/* Based on the 4.4BSD and Linux version of this file. */ + +#ifndef _NET_IF_ARP_H + +#define _NET_IF_ARP_H 1 +#include + +#include +#include + +__BEGIN_DECLS + +/* Some internals from deep down in the kernel. */ +#define MAX_ADDR_LEN 7 + + +/* This structure defines an ethernet arp header. */ + +/* ARP protocol opcodes. */ +#define ARPOP_REQUEST 1 /* ARP request. */ +#define ARPOP_REPLY 2 /* ARP reply. */ +#define ARPOP_RREQUEST 3 /* RARP request. */ +#define ARPOP_RREPLY 4 /* RARP reply. */ +#define ARPOP_InREQUEST 8 /* InARP request. */ +#define ARPOP_InREPLY 9 /* InARP reply. */ +#define ARPOP_NAK 10 /* (ATM)ARP NAK. */ + +/* See RFC 826 for protocol description. ARP packets are variable + in size; the arphdr structure defines the fixed-length portion. + Protocol type values are the same as those for 10 Mb/s Ethernet. + It is followed by the variable-sized fields ar_sha, arp_spa, + arp_tha and arp_tpa in that order, according to the lengths + specified. Field names used correspond to RFC 826. */ + +struct arphdr + { + unsigned short int ar_hrd; /* Format of hardware address. */ + unsigned short int ar_pro; /* Format of protocol address. */ + unsigned char ar_hln; /* Length of hardware address. */ + unsigned char ar_pln; /* Length of protocol address. */ + unsigned short int ar_op; /* ARP opcode (command). */ +#if 0 + /* Ethernet looks like this : This bit is variable sized + however... */ + unsigned char __ar_sha[ETH_ALEN]; /* Sender hardware address. */ + unsigned char __ar_sip[4]; /* Sender IP address. */ + unsigned char __ar_tha[ETH_ALEN]; /* Target hardware address. */ + unsigned char __ar_tip[4]; /* Target IP address. */ +#endif + }; + + +/* ARP protocol HARDWARE identifiers. */ +#define ARPHRD_NETROM 0 /* From KA9Q: NET/ROM pseudo. */ +#define ARPHRD_ETHER 1 /* Ethernet 10/100Mbps. */ +#define ARPHRD_EETHER 2 /* Experimental Ethernet. */ +#define ARPHRD_AX25 3 /* AX.25 Level 2. */ +#define ARPHRD_PRONET 4 /* PROnet token ring. */ +#define ARPHRD_CHAOS 5 /* Chaosnet. */ +#define ARPHRD_IEEE802 6 /* IEEE 802.2 Ethernet/TR/TB. */ +#define ARPHRD_ARCNET 7 /* ARCnet. */ +#define ARPHRD_APPLETLK 8 /* APPLEtalk. */ +#define ARPHRD_DLCI 15 /* Frame Relay DLCI. */ +#define ARPHRD_ATM 19 /* ATM. */ +#define ARPHRD_METRICOM 23 /* Metricom STRIP (new IANA id). */ + +/* Dummy types for non ARP hardware */ +#define ARPHRD_SLIP 256 +#define ARPHRD_CSLIP 257 +#define ARPHRD_SLIP6 258 +#define ARPHRD_CSLIP6 259 +#define ARPHRD_RSRVD 260 /* Notional KISS type. */ +#define ARPHRD_ADAPT 264 +#define ARPHRD_ROSE 270 +#define ARPHRD_X25 271 /* CCITT X.25. */ +#define ARPHDR_HWX25 272 /* Boards with X.25 in firmware. */ +#define ARPHRD_PPP 512 +#define ARPHRD_CISCO 513 /* Cisco HDLC. */ +#define ARPHRD_HDLC ARPHRD_CISCO +#define ARPHRD_LAPB 516 /* LAPB. */ +#define ARPHRD_DDCMP 517 /* Digital's DDCMP. */ +#define ARPHRD_RAWHDLC 518 /* Raw HDLC. */ + +#define ARPHRD_TUNNEL 768 /* IPIP tunnel. */ +#define ARPHRD_TUNNEL6 769 /* IPIP6 tunnel. */ +#define ARPHRD_FRAD 770 /* Frame Relay Access Device. */ +#define ARPHRD_SKIP 771 /* SKIP vif. */ +#define ARPHRD_LOOPBACK 772 /* Loopback device. */ +#define ARPHRD_LOCALTLK 773 /* Localtalk device. */ +#define ARPHRD_FDDI 774 /* Fiber Distributed Data Interface. */ +#define ARPHRD_BIF 775 /* AP1000 BIF. */ +#define ARPHRD_SIT 776 /* sit0 device - IPv6-in-IPv4. */ +#define ARPHRD_IPDDP 777 /* IP-in-DDP tunnel. */ +#define ARPHRD_IPGRE 778 /* GRE over IP. */ +#define ARPHRD_PIMREG 779 /* PIMSM register interface. */ +#define ARPHRD_HIPPI 780 /* High Performance Parallel I'face. */ +#define ARPHRD_ASH 781 /* (Nexus Electronics) Ash. */ +#define ARPHRD_ECONET 782 /* Acorn Econet. */ +#define ARPHRD_IRDA 783 /* Linux-IrDA. */ +#define ARPHRD_FCPP 784 /* Point to point fibrechanel. */ +#define ARPHRD_FCAL 785 /* Fibrechanel arbitrated loop. */ +#define ARPHRD_FCPL 786 /* Fibrechanel public loop. */ +#define ARPHRD_FCPFABRIC 787 /* Fibrechanel fabric. */ +#define ARPHRD_IEEE802_TR 800 /* Magic type ident for TR. */ +#define ARPHRD_IEEE80211 801 /* IEEE 802.11. */ + +/* ARP ioctl request. */ +struct arpreq + { + struct sockaddr arp_pa; /* Protocol address. */ + struct sockaddr arp_ha; /* Hardware address. */ + int arp_flags; /* Flags. */ + struct sockaddr arp_netmask; /* Netmask (only for proxy arps). */ + char arp_dev[16]; + }; + +struct arpreq_old + { + struct sockaddr arp_pa; /* Protocol address. */ + struct sockaddr arp_ha; /* Hardware address. */ + int arp_flags; /* Flags. */ + struct sockaddr arp_netmask; /* Netmask (only for proxy arps). */ + }; + +/* ARP Flag values. */ +#define ATF_COM 0x02 /* Completed entry (ha valid). */ +#define ATF_PERM 0x04 /* Permanent entry. */ +#define ATF_PUBL 0x08 /* Publish entry. */ +#define ATF_USETRAILERS 0x10 /* Has requested trailers. */ +#define ATF_NETMASK 0x20 /* Want to use a netmask (only + for proxy entries). */ +#define ATF_DONTPUB 0x40 /* Don't answer this addresses. */ +#define ATF_MAGIC 0x80 /* Automatically added entry. */ + + +/* Support for the user space arp daemon, arpd. */ +#define ARPD_UPDATE 0x01 +#define ARPD_LOOKUP 0x02 +#define ARPD_FLUSH 0x03 + +struct arpd_request + { + unsigned short int req; /* Request type. */ + u_int32_t ip; /* IP address of entry. */ + unsigned long int dev; /* Device entry is tied to. */ + unsigned long int stamp; + unsigned long int updated; + unsigned char ha[MAX_ADDR_LEN]; /* Hardware address. */ + }; + +__END_DECLS + +#endif /* net/if_arp.h */ diff -Naur test-for-latech/include/net/if.h testqf-for-latech/include/net/if.h --- test-for-latech/include/net/if.h 1969-12-31 19:00:00.000000000 -0500 +++ testqf-for-latech/include/net/if.h 2004-06-11 07:47:33.000000000 -0400 @@ -0,0 +1,203 @@ +/* net/if.h -- declarations for inquiring about network interfaces + Copyright (C) 1997,98,99,2000,2001 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#ifndef _NET_IF_H +#define _NET_IF_H 1 + +#include + +#ifdef __USE_MISC +# include +# include +#endif + + +/* Length of interface name. */ +#define IF_NAMESIZE 16 + +struct if_nameindex + { + unsigned int if_index; /* 1, 2, ... */ + char *if_name; /* null terminated name: "eth0", ... */ + }; + + +#ifdef __USE_MISC +/* Standard interface flags. */ +enum + { + IFF_UP = 0x1, /* Interface is up. */ +# define IFF_UP IFF_UP + IFF_BROADCAST = 0x2, /* Broadcast address valid. */ +# define IFF_BROADCAST IFF_BROADCAST + IFF_DEBUG = 0x4, /* Turn on debugging. */ +# define IFF_DEBUG IFF_DEBUG + IFF_LOOPBACK = 0x8, /* Is a loopback net. */ +# define IFF_LOOPBACK IFF_LOOPBACK + IFF_POINTOPOINT = 0x10, /* Interface is point-to-point link. */ +# define IFF_POINTOPOINT IFF_POINTOPOINT + IFF_NOTRAILERS = 0x20, /* Avoid use of trailers. */ +# define IFF_NOTRAILERS IFF_NOTRAILERS + IFF_RUNNING = 0x40, /* Resources allocated. */ +# define IFF_RUNNING IFF_RUNNING + IFF_NOARP = 0x80, /* No address resolution protocol. */ +# define IFF_NOARP IFF_NOARP + IFF_PROMISC = 0x100, /* Receive all packets. */ +# define IFF_PROMISC IFF_PROMISC + + /* Not supported */ + IFF_ALLMULTI = 0x200, /* Receive all multicast packets. */ +# define IFF_ALLMULTI IFF_ALLMULTI + + IFF_MASTER = 0x400, /* Master of a load balancer. */ +# define IFF_MASTER IFF_MASTER + IFF_SLAVE = 0x800, /* Slave of a load balancer. */ +# define IFF_SLAVE IFF_SLAVE + + IFF_MULTICAST = 0x1000, /* Supports multicast. */ +# define IFF_MULTICAST IFF_MULTICAST + + IFF_PORTSEL = 0x2000, /* Can set media type. */ +# define IFF_PORTSEL IFF_PORTSEL + IFF_AUTOMEDIA = 0x4000 /* Auto media select active. */ +# define IFF_AUTOMEDIA IFF_AUTOMEDIA + }; + +/* The ifaddr structure contains information about one address of an + interface. They are maintained by the different address families, + are allocated and attached when an address is set, and are linked + together so all addresses for an interface can be located. */ + +struct ifaddr + { + struct sockaddr ifa_addr; /* Address of interface. */ + union + { + struct sockaddr ifu_broadaddr; + struct sockaddr ifu_dstaddr; + } ifa_ifu; + struct iface *ifa_ifp; /* Back-pointer to interface. */ + struct ifaddr *ifa_next; /* Next address for interface. */ + }; + +# define ifa_broadaddr ifa_ifu.ifu_broadaddr /* broadcast address */ +# define ifa_dstaddr ifa_ifu.ifu_dstaddr /* other end of link */ + +/* Device mapping structure. I'd just gone off and designed a + beautiful scheme using only loadable modules with arguments for + driver options and along come the PCMCIA people 8) + + Ah well. The get() side of this is good for WDSETUP, and it'll be + handy for debugging things. The set side is fine for now and being + very small might be worth keeping for clean configuration. */ + +struct ifmap + { + unsigned long int mem_start; + unsigned long int mem_end; + unsigned short int base_addr; + unsigned char irq; + unsigned char dma; + unsigned char port; + /* 3 bytes spare */ + }; + +/* Interface request structure used for socket ioctl's. All interface + ioctl's must have parameter definitions which begin with ifr_name. + The remainder may be interface specific. */ + +struct ifreq + { +# define IFHWADDRLEN 6 +# define IFNAMSIZ IF_NAMESIZE + union + { + char ifrn_name[IFNAMSIZ]; /* Interface name, e.g. "en0". */ + } ifr_ifrn; + + union + { + struct sockaddr ifru_addr; + struct sockaddr ifru_dstaddr; + struct sockaddr ifru_broadaddr; + struct sockaddr ifru_netmask; + struct sockaddr ifru_hwaddr; + short int ifru_flags; + int ifru_ivalue; + int ifru_mtu; + struct ifmap ifru_map; + char ifru_slave[IFNAMSIZ]; /* Just fits the size */ + char ifru_newname[IFNAMSIZ]; + __caddr_t ifru_data; + } ifr_ifru; + }; +# define ifr_name ifr_ifrn.ifrn_name /* interface name */ +# define ifr_hwaddr ifr_ifru.ifru_hwaddr /* MAC address */ +# define ifr_addr ifr_ifru.ifru_addr /* address */ +# define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-p lnk */ +# define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */ +# define ifr_netmask ifr_ifru.ifru_netmask /* interface net mask */ +# define ifr_flags ifr_ifru.ifru_flags /* flags */ +# define ifr_metric ifr_ifru.ifru_ivalue /* metric */ +# define ifr_mtu ifr_ifru.ifru_mtu /* mtu */ +# define ifr_map ifr_ifru.ifru_map /* device map */ +# define ifr_slave ifr_ifru.ifru_slave /* slave device */ +# define ifr_data ifr_ifru.ifru_data /* for use by interface */ +# define ifr_ifindex ifr_ifru.ifru_ivalue /* interface index */ +# define ifr_bandwidth ifr_ifru.ifru_ivalue /* link bandwidth */ +# define ifr_qlen ifr_ifru.ifru_ivalue /* queue length */ +# define ifr_newname ifr_ifru.ifru_newname /* New name */ +# define _IOT_ifreq _IOT(_IOTS(char),IFNAMSIZ,_IOTS(char),16,0,0) +# define _IOT_ifreq_short _IOT(_IOTS(char),IFNAMSIZ,_IOTS(short),1,0,0) +# define _IOT_ifreq_int _IOT(_IOTS(char),IFNAMSIZ,_IOTS(int),1,0,0) + + +/* Structure used in SIOCGIFCONF request. Used to retrieve interface + configuration for machine (useful for programs which must know all + networks accessible). */ + +struct ifconf + { + int ifc_len; /* Size of buffer. */ + union + { + __caddr_t ifcu_buf; + struct ifreq *ifcu_req; + } ifc_ifcu; + }; +# define ifc_buf ifc_ifcu.ifcu_buf /* Buffer address. */ +# define ifc_req ifc_ifcu.ifcu_req /* Array of structures. */ +# define _IOT_ifconf _IOT(_IOTS(struct ifconf),1,0,0,0,0) /* not right */ +#endif /* Misc. */ + +__BEGIN_DECLS + +/* Convert an interface name to an index, and vice versa. */ +extern unsigned int if_nametoindex (__const char *__ifname) __THROW; +extern char *if_indextoname (unsigned int __ifindex, char *__ifname) __THROW; + +/* Return a list of all interfaces and their indices. */ +extern struct if_nameindex *if_nameindex (void) __THROW; + +/* Free the data returned from if_nameindex. */ +extern void if_freenameindex (struct if_nameindex *__ptr) __THROW; + +__END_DECLS + +#endif /* net/if.h */ diff -Naur test-for-latech/include/net/if_packet.h testqf-for-latech/include/net/if_packet.h --- test-for-latech/include/net/if_packet.h 1969-12-31 19:00:00.000000000 -0500 +++ testqf-for-latech/include/net/if_packet.h 2004-06-11 07:47:33.000000000 -0400 @@ -0,0 +1,37 @@ +/* Definitions for use with Linux SOCK_PACKET sockets. + Copyright (C) 1997, 1998 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#ifndef __IF_PACKET_H +#define __IF_PACKET_H + +#include +#include + +/* This is the SOCK_PACKET address structure as used in Linux 2.0. + From Linux 2.1 the AF_PACKET interface is preferred and you should + consider using it in place of this one. */ + +struct sockaddr_pkt + { + __SOCKADDR_COMMON (spkt_); + unsigned char spkt_device[14]; + unsigned short spkt_protocol; + }; + +#endif diff -Naur test-for-latech/include/net/if_ppp.h testqf-for-latech/include/net/if_ppp.h --- test-for-latech/include/net/if_ppp.h 1969-12-31 19:00:00.000000000 -0500 +++ testqf-for-latech/include/net/if_ppp.h 2004-06-11 07:47:33.000000000 -0400 @@ -0,0 +1,169 @@ +/* From: if_ppp.h,v 1.3 1995/06/12 11:36:50 paulus Exp */ + +/* + * if_ppp.h - Point-to-Point Protocol definitions. + * + * Copyright (c) 1989 Carnegie Mellon University. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE UNIVERSITY OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +/* + * ==FILEVERSION 960926== + * + * NOTE TO MAINTAINERS: + * If you modify this file at all, please set the above date. + * if_ppp.h is shipped with a PPP distribution as well as with the kernel; + * if everyone increases the FILEVERSION number above, then scripts + * can do the right thing when deciding whether to install a new if_ppp.h + * file. Don't change the format of that line otherwise, so the + * installation script can recognize it. + */ + + +#ifndef __NET_IF_PPP_H +#define __NET_IF_PPP_H 1 + +#include +#include + +#include +#include +#include + +__BEGIN_DECLS + +/* + * Packet sizes + */ + +#define PPP_MTU 1500 /* Default MTU (size of Info field) */ +#define PPP_MAXMRU 65000 /* Largest MRU we allow */ +#define PPP_VERSION "2.2.0" +#define PPP_MAGIC 0x5002 /* Magic value for the ppp structure */ +#define PROTO_IPX 0x002b /* protocol numbers */ +#define PROTO_DNA_RT 0x0027 /* DNA Routing */ + + +/* + * Bit definitions for flags. + */ + +#define SC_COMP_PROT 0x00000001 /* protocol compression (output) */ +#define SC_COMP_AC 0x00000002 /* header compression (output) */ +#define SC_COMP_TCP 0x00000004 /* TCP (VJ) compression (output) */ +#define SC_NO_TCP_CCID 0x00000008 /* disable VJ connection-id comp. */ +#define SC_REJ_COMP_AC 0x00000010 /* reject adrs/ctrl comp. on input */ +#define SC_REJ_COMP_TCP 0x00000020 /* reject TCP (VJ) comp. on input */ +#define SC_CCP_OPEN 0x00000040 /* Look at CCP packets */ +#define SC_CCP_UP 0x00000080 /* May send/recv compressed packets */ +#define SC_ENABLE_IP 0x00000100 /* IP packets may be exchanged */ +#define SC_COMP_RUN 0x00001000 /* compressor has been inited */ +#define SC_DECOMP_RUN 0x00002000 /* decompressor has been inited */ +#define SC_DEBUG 0x00010000 /* enable debug messages */ +#define SC_LOG_INPKT 0x00020000 /* log contents of good pkts recvd */ +#define SC_LOG_OUTPKT 0x00040000 /* log contents of pkts sent */ +#define SC_LOG_RAWIN 0x00080000 /* log all chars received */ +#define SC_LOG_FLUSH 0x00100000 /* log all chars flushed */ +#define SC_MASK 0x0fE0ffff /* bits that user can change */ + +/* state bits */ +#define SC_ESCAPED 0x80000000 /* saw a PPP_ESCAPE */ +#define SC_FLUSH 0x40000000 /* flush input until next PPP_FLAG */ +#define SC_VJ_RESET 0x20000000 /* Need to reset the VJ decompressor */ +#define SC_XMIT_BUSY 0x10000000 /* ppp_write_wakeup is active */ +#define SC_RCV_ODDP 0x08000000 /* have rcvd char with odd parity */ +#define SC_RCV_EVNP 0x04000000 /* have rcvd char with even parity */ +#define SC_RCV_B7_1 0x02000000 /* have rcvd char with bit 7 = 1 */ +#define SC_RCV_B7_0 0x01000000 /* have rcvd char with bit 7 = 0 */ +#define SC_DC_FERROR 0x00800000 /* fatal decomp error detected */ +#define SC_DC_ERROR 0x00400000 /* non-fatal decomp error detected */ + +/* + * Ioctl definitions. + */ + +struct npioctl { + int protocol; /* PPP protocol, e.g. PPP_IP */ + enum NPmode mode; +}; + +/* Structure describing a CCP configuration option, for PPPIOCSCOMPRESS */ +struct ppp_option_data { + u_int8_t *ptr; + u_int32_t length; + int transmit; +}; + +struct ifpppstatsreq { + struct ifreq b; + struct ppp_stats stats; /* statistic information */ +}; + +struct ifpppcstatsreq { + struct ifreq b; + struct ppp_comp_stats stats; +}; + +#define ifr__name b.ifr_ifrn.ifrn_name +#define stats_ptr b.ifr_ifru.ifru_data + +/* + * Ioctl definitions. + */ + +#define PPPIOCGFLAGS _IOR('t', 90, int) /* get configuration flags */ +#define PPPIOCSFLAGS _IOW('t', 89, int) /* set configuration flags */ +#define PPPIOCGASYNCMAP _IOR('t', 88, int) /* get async map */ +#define PPPIOCSASYNCMAP _IOW('t', 87, int) /* set async map */ +#define PPPIOCGUNIT _IOR('t', 86, int) /* get ppp unit number */ +#define PPPIOCGRASYNCMAP _IOR('t', 85, int) /* get receive async map */ +#define PPPIOCSRASYNCMAP _IOW('t', 84, int) /* set receive async map */ +#define PPPIOCGMRU _IOR('t', 83, int) /* get max receive unit */ +#define PPPIOCSMRU _IOW('t', 82, int) /* set max receive unit */ +#define PPPIOCSMAXCID _IOW('t', 81, int) /* set VJ max slot ID */ +#define PPPIOCGXASYNCMAP _IOR('t', 80, ext_accm) /* get extended ACCM */ +#define PPPIOCSXASYNCMAP _IOW('t', 79, ext_accm) /* set extended ACCM */ +#define PPPIOCXFERUNIT _IO('t', 78) /* transfer PPP unit */ +#define PPPIOCSCOMPRESS _IOW('t', 77, struct ppp_option_data) +#define PPPIOCGNPMODE _IOWR('t', 76, struct npioctl) /* get NP mode */ +#define PPPIOCSNPMODE _IOW('t', 75, struct npioctl) /* set NP mode */ +#define PPPIOCGDEBUG _IOR('t', 65, int) /* Read debug level */ +#define PPPIOCSDEBUG _IOW('t', 64, int) /* Set debug level */ +#define PPPIOCGIDLE _IOR('t', 63, struct ppp_idle) /* get idle time */ + +#define SIOCGPPPSTATS (SIOCDEVPRIVATE + 0) +#define SIOCGPPPVER (SIOCDEVPRIVATE + 1) /* NEVER change this!! */ +#define SIOCGPPPCSTATS (SIOCDEVPRIVATE + 2) + +#if !defined(ifr_mtu) +#define ifr_mtu ifr_ifru.ifru_metric +#endif + +__END_DECLS + +#endif /* net/if_ppp.h */ diff -Naur test-for-latech/include/net/if_shaper.h testqf-for-latech/include/net/if_shaper.h --- test-for-latech/include/net/if_shaper.h 1969-12-31 19:00:00.000000000 -0500 +++ testqf-for-latech/include/net/if_shaper.h 2004-06-11 07:47:33.000000000 -0400 @@ -0,0 +1,59 @@ +/* Copyright (C) 1998 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#ifndef _NET_IF_SHAPER_H +#define _NET_IF_SHAPER_H 1 + +#include +#include +#include +#include + +__BEGIN_DECLS + +#define SHAPER_QLEN 10 +/* + * This is a bit speed dependant (read it shouldnt be a constant!) + * + * 5 is about right for 28.8 upwards. Below that double for every + * halving of speed or so. - ie about 20 for 9600 baud. + */ +#define SHAPER_LATENCY (5 * HZ) +#define SHAPER_MAXSLIP 2 +#define SHAPER_BURST (HZ / 50) /* Good for >128K then */ + +#define SHAPER_SET_DEV 0x0001 +#define SHAPER_SET_SPEED 0x0002 +#define SHAPER_GET_DEV 0x0003 +#define SHAPER_GET_SPEED 0x0004 + +struct shaperconf +{ + u_int16_t ss_cmd; + union + { + char ssu_name[14]; + u_int32_t ssu_speed; + } ss_u; +#define ss_speed ss_u.ssu_speed +#define ss_name ss_u.ssu_name +}; + +__END_DECLS + +#endif /* net/if_shaper.h */ diff -Naur test-for-latech/include/net/if_slip.h testqf-for-latech/include/net/if_slip.h --- test-for-latech/include/net/if_slip.h 1969-12-31 19:00:00.000000000 -0500 +++ testqf-for-latech/include/net/if_slip.h 2004-06-11 07:47:33.000000000 -0400 @@ -0,0 +1,25 @@ +/* Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#ifndef _NET_IF_SLIP_H +#define _NET_IF_SLIP_H 1 + +/* We can use the kernel header. */ +#include + +#endif /* net/if_slip.h. */ diff -Naur test-for-latech/include/net/pkt_cls.h testqf-for-latech/include/net/pkt_cls.h --- test-for-latech/include/net/pkt_cls.h 2004-06-11 07:40:23.000000000 -0400 +++ testqf-for-latech/include/net/pkt_cls.h 2004-06-11 07:47:33.000000000 -0400 @@ -81