From owner-p4-projects@FreeBSD.ORG Sun Sep 10 09:56:14 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A13A016A412; Sun, 10 Sep 2006 09:56:14 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5410216A403 for ; Sun, 10 Sep 2006 09:56:14 +0000 (UTC) (envelope-from netchild@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id CAD4043D5D for ; Sun, 10 Sep 2006 09:56:13 +0000 (GMT) (envelope-from netchild@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8A9uDEq094642 for ; Sun, 10 Sep 2006 09:56:13 GMT (envelope-from netchild@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8A9uD0P094639 for perforce@freebsd.org; Sun, 10 Sep 2006 09:56:13 GMT (envelope-from netchild@freebsd.org) Date: Sun, 10 Sep 2006 09:56:13 GMT Message-Id: <200609100956.k8A9uD0P094639@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to netchild@freebsd.org using -f From: Alexander Leidinger To: Perforce Change Reviews Cc: Subject: PERFORCE change 105930 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Sep 2006 09:56:14 -0000 http://perforce.freebsd.org/chv.cgi?CH=105930 Change 105930 by netchild@netchild_magellan on 2006/09/10 09:55:14 From the submitter: ---snip--- DESIGN NOTES: 1. Linux permits a process to own multiple AIO queues (distinguished by "context"), but FreeBSD creates only one single AIO queue per process. My code maintains a request queue (STAILQ of queue(3)) per "context", and throws all AIO requests of all contexts owned by a process into the single FreeBSD per-process AIO queue. When the process calls io_destroy(2), io_getevents(2), io_submit(2) and io_cancel(2), my code can pick out requests owned by the specified context from the single FreeBSD per-process AIO queue according to the per-context request queues maintained by my code. 2. The request queue maintained by my code stores contrast information between Linux IO control blocks (struct linux_iocb) and FreeBSD IO control blocks (struct aiocb). FreeBSD IO control block actually exists in userland memory space, required by FreeBSD native aio_XXXXXX(2). 3. It is quite troubling that the function io_getevents() of libaio-0.3.105 needs to use Linux-specific "struct aio_ring", which is a partial mirror of context in user space. I would rather take the address of context in kernel as the context ID, but the io_getevents() of libaio forces me to take the address of the "ring" in user space as the context ID. To my surprise, one comment line in the file "io_getevents.c" of libaio-0.3.105 reads: Ben will hate me for this PROBLEMS: 1. Why does uma_zdestroy(9) print message like: Freed UMA keg was not empty (100 items). Lost 2 pages of memory. Does it represent any problems? 2. FreeBSD-Linux errno transformation table "bsd_to_linux_errno" in "/sys/i386/linux/linux_sysvec.c" should be updated now. I cannot even find correct Linux's -ECANCELED (-125) in it. REFERENCE: 1. Linux kernel source code: http://www.kernel.org/pub/linux/kernel/v2.6/ (include/linux/aio_abi.h, fs/aio.c) 2. Linux manual pages: http://www.kernel.org/pub/linux/docs/manpages/ (io_setup(2), io_destroy(2), io_getevents(2), io_submit(2), io_cancel(2)) 3. Linux Scalability Effort: http://lse.sourceforge.net/io/aio.html The design notes: http://lse.sourceforge.net/io/aionotes.txt 4. The package libaio, both source and binary: http://rpmfind.net/linux/rpm2html/search.php?query=libaio Simple transparent interface to Linux AIO system calls. 5. Libaio-oracle: http://oss.oracle.com/projects/libaio-oracle/ POSIX AIO implementation based on Linux AIO system calls (depending on libaio). ---snip--- Submitted by: Intron Affected files ... .. //depot/projects/linuxolator/src/sys/amd64/linux32/linux.h#3 edit .. //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_proto.h#2 edit .. //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_syscall.h#2 edit .. //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_sysent.c#2 edit .. //depot/projects/linuxolator/src/sys/amd64/linux32/syscalls.master#2 edit .. //depot/projects/linuxolator/src/sys/compat/linux/linux_aio.c#1 add .. //depot/projects/linuxolator/src/sys/compat/linux/linux_aio.h#1 add .. //depot/projects/linuxolator/src/sys/conf/files.amd64#2 edit .. //depot/projects/linuxolator/src/sys/conf/files.i386#2 edit .. //depot/projects/linuxolator/src/sys/i386/linux/linux.h#3 edit .. //depot/projects/linuxolator/src/sys/i386/linux/linux_proto.h#2 edit .. //depot/projects/linuxolator/src/sys/i386/linux/linux_syscall.h#2 edit .. //depot/projects/linuxolator/src/sys/i386/linux/linux_sysent.c#2 edit .. //depot/projects/linuxolator/src/sys/kern/vfs_aio.c#2 edit .. //depot/projects/linuxolator/src/sys/modules/aio/Makefile#2 edit .. //depot/projects/linuxolator/src/sys/modules/linux/Makefile#2 edit Differences ... ==== //depot/projects/linuxolator/src/sys/amd64/linux32/linux.h#3 (text+ko) ==== @@ -840,4 +840,6 @@ #define THREADING_FLAGS (CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND) +#include + #endif /* !_AMD64_LINUX_LINUX_H_ */ ==== //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_proto.h#2 (text+ko) ==== @@ -2,7 +2,7 @@ * System call prototypes. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/amd64/linux32/linux32_proto.h,v 1.22 2006/08/27 08:58:00 netchild Exp $ + * $FreeBSD$ * created from FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.20 2006/08/27 08:56:53 netchild Exp */ @@ -724,6 +724,30 @@ char uaddr2_l_[PADL_(void *)]; void * uaddr2; char uaddr2_r_[PADR_(void *)]; char val3_l_[PADL_(int)]; int val3; char val3_r_[PADR_(int)]; }; +struct linux_io_setup_args { + char nr_reqs_l_[PADL_(l_uint)]; l_uint nr_reqs; char nr_reqs_r_[PADR_(l_uint)]; + char ctxp_l_[PADL_(linux_aio_context_t *)]; linux_aio_context_t * ctxp; char ctxp_r_[PADR_(linux_aio_context_t *)]; +}; +struct linux_io_destroy_args { + char ctx_l_[PADL_(linux_aio_context_t)]; linux_aio_context_t ctx; char ctx_r_[PADR_(linux_aio_context_t)]; +}; +struct linux_io_getevents_args { + char ctx_id_l_[PADL_(linux_aio_context_t)]; linux_aio_context_t ctx_id; char ctx_id_r_[PADR_(linux_aio_context_t)]; + char min_nr_l_[PADL_(l_long)]; l_long min_nr; char min_nr_r_[PADR_(l_long)]; + char nr_l_[PADL_(l_long)]; l_long nr; char nr_r_[PADR_(l_long)]; + char events_l_[PADL_(struct linux_io_event *)]; struct linux_io_event * events; char events_r_[PADR_(struct linux_io_event *)]; + char timeout_l_[PADL_(struct l_timespec *)]; struct l_timespec * timeout; char timeout_r_[PADR_(struct l_timespec *)]; +}; +struct linux_io_submit_args { + char ctx_id_l_[PADL_(linux_aio_context_t)]; linux_aio_context_t ctx_id; char ctx_id_r_[PADR_(linux_aio_context_t)]; + char nr_l_[PADL_(l_long)]; l_long nr; char nr_r_[PADR_(l_long)]; + char iocbpp_l_[PADL_(struct linux_iocb **)]; struct linux_iocb ** iocbpp; char iocbpp_r_[PADR_(struct linux_iocb **)]; +}; +struct linux_io_cancel_args { + char ctx_id_l_[PADL_(linux_aio_context_t)]; linux_aio_context_t ctx_id; char ctx_id_r_[PADR_(linux_aio_context_t)]; + char iocb_l_[PADL_(struct linux_iocb *)]; struct linux_iocb * iocb; char iocb_r_[PADR_(struct linux_iocb *)]; + char result_l_[PADL_(struct linux_io_event *)]; struct linux_io_event * result; char result_r_[PADR_(struct linux_io_event *)]; +}; struct linux_fadvise64_args { register_t dummy; }; @@ -1081,6 +1105,11 @@ int linux_fremovexattr(struct thread *, struct linux_fremovexattr_args *); int linux_tkill(struct thread *, struct linux_tkill_args *); int linux_sys_futex(struct thread *, struct linux_sys_futex_args *); +int linux_io_setup(struct thread *, struct linux_io_setup_args *); +int linux_io_destroy(struct thread *, struct linux_io_destroy_args *); +int linux_io_getevents(struct thread *, struct linux_io_getevents_args *); +int linux_io_submit(struct thread *, struct linux_io_submit_args *); +int linux_io_cancel(struct thread *, struct linux_io_cancel_args *); int linux_fadvise64(struct thread *, struct linux_fadvise64_args *); int linux_exit_group(struct thread *, struct linux_exit_group_args *); int linux_lookup_dcookie(struct thread *, struct linux_lookup_dcookie_args *); @@ -1326,6 +1355,11 @@ #define LINUX_SYS_AUE_linux_fremovexattr AUE_NULL #define LINUX_SYS_AUE_linux_tkill AUE_NULL #define LINUX_SYS_AUE_linux_sys_futex AUE_NULL +#define LINUX_SYS_AUE_linux_io_setup AUE_NULL +#define LINUX_SYS_AUE_linux_io_destroy AUE_NULL +#define LINUX_SYS_AUE_linux_io_getevents AUE_NULL +#define LINUX_SYS_AUE_linux_io_submit AUE_NULL +#define LINUX_SYS_AUE_linux_io_cancel AUE_NULL #define LINUX_SYS_AUE_linux_fadvise64 AUE_NULL #define LINUX_SYS_AUE_linux_exit_group AUE_EXIT #define LINUX_SYS_AUE_linux_lookup_dcookie AUE_NULL ==== //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_syscall.h#2 (text+ko) ==== @@ -2,7 +2,7 @@ * System call numbers. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/amd64/linux32/linux32_syscall.h,v 1.22 2006/08/27 08:58:00 netchild Exp $ + * $FreeBSD$ * created from FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.20 2006/08/27 08:56:53 netchild Exp */ @@ -221,6 +221,11 @@ #define LINUX_SYS_linux_fremovexattr 237 #define LINUX_SYS_linux_tkill 238 #define LINUX_SYS_linux_sys_futex 240 +#define LINUX_SYS_linux_io_setup 245 +#define LINUX_SYS_linux_io_destroy 246 +#define LINUX_SYS_linux_io_getevents 247 +#define LINUX_SYS_linux_io_submit 248 +#define LINUX_SYS_linux_io_cancel 249 #define LINUX_SYS_linux_fadvise64 250 #define LINUX_SYS_linux_exit_group 252 #define LINUX_SYS_linux_lookup_dcookie 253 ==== //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_sysent.c#2 (text+ko) ==== @@ -2,7 +2,7 @@ * System call switch table. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/amd64/linux32/linux32_sysent.c,v 1.22 2006/08/27 08:58:00 netchild Exp $ + * $FreeBSD$ * created from FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.20 2006/08/27 08:56:53 netchild Exp */ @@ -265,11 +265,11 @@ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 242 = linux_sched_getaffinity */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 243 = linux_set_thread_area */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 244 = linux_get_thread_area */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 245 = linux_io_setup */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 246 = linux_io_destroy */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 247 = linux_io_getevents */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 248 = linux_io_submit */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 249 = linux_io_cancel */ + { AS(linux_io_setup_args), (sy_call_t *)linux_io_setup, AUE_NULL, NULL, 0, 0 }, /* 245 = linux_io_setup */ + { AS(linux_io_destroy_args), (sy_call_t *)linux_io_destroy, AUE_NULL, NULL, 0, 0 }, /* 246 = linux_io_destroy */ + { AS(linux_io_getevents_args), (sy_call_t *)linux_io_getevents, AUE_NULL, NULL, 0, 0 }, /* 247 = linux_io_getevents */ + { AS(linux_io_submit_args), (sy_call_t *)linux_io_submit, AUE_NULL, NULL, 0, 0 }, /* 248 = linux_io_submit */ + { AS(linux_io_cancel_args), (sy_call_t *)linux_io_cancel, AUE_NULL, NULL, 0, 0 }, /* 249 = linux_io_cancel */ { 0, (sy_call_t *)linux_fadvise64, AUE_NULL, NULL, 0, 0 }, /* 250 = linux_fadvise64 */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 251 = */ { AS(linux_exit_group_args), (sy_call_t *)linux_exit_group, AUE_EXIT, NULL, 0, 0 }, /* 252 = linux_exit_group */ ==== //depot/projects/linuxolator/src/sys/amd64/linux32/syscalls.master#2 (text+ko) ==== @@ -406,11 +406,11 @@ 242 AUE_NULL UNIMPL linux_sched_getaffinity 243 AUE_NULL UNIMPL linux_set_thread_area 244 AUE_NULL UNIMPL linux_get_thread_area -245 AUE_NULL UNIMPL linux_io_setup -246 AUE_NULL UNIMPL linux_io_destroy -247 AUE_NULL UNIMPL linux_io_getevents -248 AUE_NULL UNIMPL linux_io_submit -249 AUE_NULL UNIMPL linux_io_cancel +245 AUE_NULL STD { int linux_io_setup(l_uint nr_reqs, linux_aio_context_t *ctxp); } +246 AUE_NULL STD { int linux_io_destroy(linux_aio_context_t ctx); } +247 AUE_NULL STD { int linux_io_getevents(linux_aio_context_t ctx_id, l_long min_nr, l_long nr, struct linux_io_event *events, struct l_timespec *timeout); } +248 AUE_NULL STD { int linux_io_submit(linux_aio_context_t ctx_id, l_long nr, struct linux_iocb **iocbpp); } +249 AUE_NULL STD { int linux_io_cancel(linux_aio_context_t ctx_id, struct linux_iocb *iocb, struct linux_io_event *result); } 250 AUE_NULL STD { int linux_fadvise64(void); } 251 AUE_NULL UNIMPL 252 AUE_EXIT STD { int linux_exit_group(int error_code); } ==== //depot/projects/linuxolator/src/sys/conf/files.amd64#2 (text+ko) ==== @@ -234,6 +234,7 @@ amd64/linux32/linux32_machdep.c optional compat_linux32 amd64/linux32/linux32_sysent.c optional compat_linux32 amd64/linux32/linux32_sysvec.c optional compat_linux32 +compat/linux/linux_aio.c optional compat_linux32 compat/linux/linux_emul.c optional compat_linux32 compat/linux/linux_file.c optional compat_linux32 compat/linux/linux_futex.c optional compat_linux32 ==== //depot/projects/linuxolator/src/sys/conf/files.i386#2 (text+ko) ==== @@ -85,6 +85,7 @@ # compat/linprocfs/linprocfs.c optional linprocfs compat/linsysfs/linsysfs.c optional linsysfs +compat/linux/linux_aio.c optional compat_linux compat/linux/linux_emul.c optional compat_linux compat/linux/linux_file.c optional compat_linux compat/linux/linux_futex.c optional compat_linux ==== //depot/projects/linuxolator/src/sys/i386/linux/linux.h#3 (text+ko) ==== @@ -803,4 +803,6 @@ #define THREADING_FLAGS (CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND) +#include + #endif /* !_I386_LINUX_LINUX_H_ */ ==== //depot/projects/linuxolator/src/sys/i386/linux/linux_proto.h#2 (text+ko) ==== @@ -2,7 +2,7 @@ * System call prototypes. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/i386/linux/linux_proto.h,v 1.81 2006/08/27 08:58:00 netchild Exp $ + * $FreeBSD$ * created from FreeBSD: src/sys/i386/linux/syscalls.master,v 1.78 2006/08/27 08:56:54 netchild Exp */ @@ -721,6 +721,30 @@ struct linux_get_thread_area_args { char desc_l_[PADL_(struct l_user_desc *)]; struct l_user_desc * desc; char desc_r_[PADR_(struct l_user_desc *)]; }; +struct linux_io_setup_args { + char nr_reqs_l_[PADL_(l_uint)]; l_uint nr_reqs; char nr_reqs_r_[PADR_(l_uint)]; + char ctxp_l_[PADL_(linux_aio_context_t *)]; linux_aio_context_t * ctxp; char ctxp_r_[PADR_(linux_aio_context_t *)]; +}; +struct linux_io_destroy_args { + char ctx_l_[PADL_(linux_aio_context_t)]; linux_aio_context_t ctx; char ctx_r_[PADR_(linux_aio_context_t)]; +}; +struct linux_io_getevents_args { + char ctx_id_l_[PADL_(linux_aio_context_t)]; linux_aio_context_t ctx_id; char ctx_id_r_[PADR_(linux_aio_context_t)]; + char min_nr_l_[PADL_(l_long)]; l_long min_nr; char min_nr_r_[PADR_(l_long)]; + char nr_l_[PADL_(l_long)]; l_long nr; char nr_r_[PADR_(l_long)]; + char events_l_[PADL_(struct linux_io_event *)]; struct linux_io_event * events; char events_r_[PADR_(struct linux_io_event *)]; + char timeout_l_[PADL_(struct l_timespec *)]; struct l_timespec * timeout; char timeout_r_[PADR_(struct l_timespec *)]; +}; +struct linux_io_submit_args { + char ctx_id_l_[PADL_(linux_aio_context_t)]; linux_aio_context_t ctx_id; char ctx_id_r_[PADR_(linux_aio_context_t)]; + char nr_l_[PADL_(l_long)]; l_long nr; char nr_r_[PADR_(l_long)]; + char iocbpp_l_[PADL_(struct linux_iocb **)]; struct linux_iocb ** iocbpp; char iocbpp_r_[PADR_(struct linux_iocb **)]; +}; +struct linux_io_cancel_args { + char ctx_id_l_[PADL_(linux_aio_context_t)]; linux_aio_context_t ctx_id; char ctx_id_r_[PADR_(linux_aio_context_t)]; + char iocb_l_[PADL_(struct linux_iocb *)]; struct linux_iocb * iocb; char iocb_r_[PADR_(struct linux_iocb *)]; + char result_l_[PADL_(struct linux_io_event *)]; struct linux_io_event * result; char result_r_[PADR_(struct linux_io_event *)]; +}; struct linux_fadvise64_args { register_t dummy; }; @@ -1098,6 +1122,11 @@ int linux_sys_futex(struct thread *, struct linux_sys_futex_args *); int linux_set_thread_area(struct thread *, struct linux_set_thread_area_args *); int linux_get_thread_area(struct thread *, struct linux_get_thread_area_args *); +int linux_io_setup(struct thread *, struct linux_io_setup_args *); +int linux_io_destroy(struct thread *, struct linux_io_destroy_args *); +int linux_io_getevents(struct thread *, struct linux_io_getevents_args *); +int linux_io_submit(struct thread *, struct linux_io_submit_args *); +int linux_io_cancel(struct thread *, struct linux_io_cancel_args *); int linux_fadvise64(struct thread *, struct linux_fadvise64_args *); int linux_exit_group(struct thread *, struct linux_exit_group_args *); int linux_lookup_dcookie(struct thread *, struct linux_lookup_dcookie_args *); @@ -1344,6 +1373,11 @@ #define LINUX_SYS_AUE_linux_sys_futex AUE_NULL #define LINUX_SYS_AUE_linux_set_thread_area AUE_NULL #define LINUX_SYS_AUE_linux_get_thread_area AUE_NULL +#define LINUX_SYS_AUE_linux_io_setup AUE_NULL +#define LINUX_SYS_AUE_linux_io_destroy AUE_NULL +#define LINUX_SYS_AUE_linux_io_getevents AUE_NULL +#define LINUX_SYS_AUE_linux_io_submit AUE_NULL +#define LINUX_SYS_AUE_linux_io_cancel AUE_NULL #define LINUX_SYS_AUE_linux_fadvise64 AUE_NULL #define LINUX_SYS_AUE_linux_exit_group AUE_EXIT #define LINUX_SYS_AUE_linux_lookup_dcookie AUE_NULL ==== //depot/projects/linuxolator/src/sys/i386/linux/linux_syscall.h#2 (text+ko) ==== @@ -2,7 +2,7 @@ * System call numbers. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/i386/linux/linux_syscall.h,v 1.75 2006/08/27 08:58:00 netchild Exp $ + * $FreeBSD$ * created from FreeBSD: src/sys/i386/linux/syscalls.master,v 1.78 2006/08/27 08:56:54 netchild Exp */ @@ -230,6 +230,11 @@ #define LINUX_SYS_linux_sys_futex 240 #define LINUX_SYS_linux_set_thread_area 243 #define LINUX_SYS_linux_get_thread_area 244 +#define LINUX_SYS_linux_io_setup 245 +#define LINUX_SYS_linux_io_destroy 246 +#define LINUX_SYS_linux_io_getevents 247 +#define LINUX_SYS_linux_io_submit 248 +#define LINUX_SYS_linux_io_cancel 249 #define LINUX_SYS_linux_fadvise64 250 #define LINUX_SYS_linux_exit_group 252 #define LINUX_SYS_linux_lookup_dcookie 253 ==== //depot/projects/linuxolator/src/sys/i386/linux/linux_sysent.c#2 (text+ko) ==== @@ -2,7 +2,7 @@ * System call switch table. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/i386/linux/linux_sysent.c,v 1.82 2006/08/27 08:58:00 netchild Exp $ + * $FreeBSD$ * created from FreeBSD: src/sys/i386/linux/syscalls.master,v 1.78 2006/08/27 08:56:54 netchild Exp */ @@ -264,11 +264,11 @@ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 242 = linux_sched_getaffinity */ { AS(linux_set_thread_area_args), (sy_call_t *)linux_set_thread_area, AUE_NULL, NULL, 0, 0 }, /* 243 = linux_set_thread_area */ { AS(linux_get_thread_area_args), (sy_call_t *)linux_get_thread_area, AUE_NULL, NULL, 0, 0 }, /* 244 = linux_get_thread_area */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 245 = linux_io_setup */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 246 = linux_io_destroy */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 247 = linux_io_getevents */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 248 = linux_io_submit */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 249 = linux_io_cancel */ + { AS(linux_io_setup_args), (sy_call_t *)linux_io_setup, AUE_NULL, NULL, 0, 0 }, /* 245 = linux_io_setup */ + { AS(linux_io_destroy_args), (sy_call_t *)linux_io_destroy, AUE_NULL, NULL, 0, 0 }, /* 246 = linux_io_destroy */ + { AS(linux_io_getevents_args), (sy_call_t *)linux_io_getevents, AUE_NULL, NULL, 0, 0 }, /* 247 = linux_io_getevents */ + { AS(linux_io_submit_args), (sy_call_t *)linux_io_submit, AUE_NULL, NULL, 0, 0 }, /* 248 = linux_io_submit */ + { AS(linux_io_cancel_args), (sy_call_t *)linux_io_cancel, AUE_NULL, NULL, 0, 0 }, /* 249 = linux_io_cancel */ { 0, (sy_call_t *)linux_fadvise64, AUE_NULL, NULL, 0, 0 }, /* 250 = linux_fadvise64 */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 251 = */ { AS(linux_exit_group_args), (sy_call_t *)linux_exit_group, AUE_EXIT, NULL, 0, 0 }, /* 252 = linux_exit_group */ ==== //depot/projects/linuxolator/src/sys/kern/vfs_aio.c#2 (text+ko) ==== @@ -139,7 +139,7 @@ SYSCTL_INT(_vfs_aio, OID_AUTO, target_aio_procs, CTLFLAG_RW, &target_aio_procs, 0, "Preferred number of ready kernel threads for async IO"); -static int max_queue_count = MAX_AIO_QUEUE; +int max_queue_count = MAX_AIO_QUEUE; SYSCTL_INT(_vfs_aio, OID_AUTO, max_aio_queue, CTLFLAG_RW, &max_queue_count, 0, "Maximum number of aio requests to queue, globally"); @@ -172,7 +172,7 @@ SYSCTL_INT(_vfs_aio, OID_AUTO, max_aio_per_proc, CTLFLAG_RW, &max_aio_per_proc, 0, "Maximum active aio requests per process (stored in the process)"); -static int max_aio_queue_per_proc = MAX_AIO_QUEUE_PER_PROC; +int max_aio_queue_per_proc = MAX_AIO_QUEUE_PER_PROC; SYSCTL_INT(_vfs_aio, OID_AUTO, max_aio_queue_per_proc, CTLFLAG_RW, &max_aio_queue_per_proc, 0, "Maximum queued aio requests per process (stored in the process)"); @@ -313,12 +313,12 @@ static TAILQ_HEAD(,aiocblist) aio_jobs; /* (c) Async job list */ static struct unrhdr *aiod_unr; -static void aio_init_aioinfo(struct proc *p); +void aio_init_aioinfo(struct proc *p); static void aio_onceonly(void); static int aio_free_entry(struct aiocblist *aiocbe); static void aio_process(struct aiocblist *aiocbe); static int aio_newproc(int *); -static int aio_aqueue(struct thread *td, struct aiocb *job, +int aio_aqueue(struct thread *td, struct aiocb *job, struct aioliojob *lio, int type, int osigev); static void aio_physwakeup(struct buf *bp); static void aio_proc_rundown(void *arg, struct proc *p); @@ -498,7 +498,7 @@ * Init the per-process aioinfo structure. The aioinfo limits are set * per-process for user limit (resource) management. */ -static void +void aio_init_aioinfo(struct proc *p) { struct kaioinfo *ki; @@ -1322,7 +1322,7 @@ * Queue a new AIO request. Choosing either the threaded or direct physio VCHR * technique is done in this code. */ -static int +int aio_aqueue(struct thread *td, struct aiocb *job, struct aioliojob *lj, int type, int oldsigev) { ==== //depot/projects/linuxolator/src/sys/modules/aio/Makefile#2 (text+ko) ==== @@ -5,4 +5,8 @@ KMOD= aio SRCS= vfs_aio.c opt_vfs_aio.h vnode_if.h +EXPORT_SYMS= max_aio_queue_per_proc max_queue_count \ + aio_init_aioinfo aio_aqueue aio_suspend \ + aio_cancel aio_return aio_error + .include ==== //depot/projects/linuxolator/src/sys/modules/linux/Makefile#2 (text+ko) ==== @@ -8,11 +8,13 @@ .PATH: ${.CURDIR}/../../compat/linux ${.CURDIR}/../../${MACHINE_ARCH}/linux${SFX} KMOD= linux -SRCS= linux${SFX}_dummy.c linux_emul.c linux_file.c linux_futex.c linux_getcwd.c linux_ioctl.c \ - linux_ipc.c linux${SFX}_machdep.c linux_mib.c linux_misc.c linux_signal.c \ - linux_socket.c linux_stats.c linux_sysctl.c linux${SFX}_sysent.c linux${SFX}_sysvec.c \ - linux_uid16.c linux_util.c linux_time.c opt_inet6.h opt_mac.h opt_compat.h opt_posix.h \ - vnode_if.h device_if.h bus_if.h +SRCS= linux_aio.c linux${SFX}_dummy.c linux_emul.c linux_file.c \ + linux_futex.c linux_getcwd.c linux_ioctl.c linux_ipc.c \ + linux${SFX}_machdep.c linux_mib.c linux_misc.c linux_signal.c \ + linux_socket.c linux_stats.c linux_sysctl.c linux${SFX}_sysent.c \ + linux${SFX}_sysvec.c linux_uid16.c linux_util.c linux_time.c \ + opt_inet6.h opt_mac.h opt_compat.h opt_posix.h vnode_if.h \ + device_if.h bus_if.h OBJS= linux${SFX}_locore.o .if ${MACHINE_ARCH} == "i386" From owner-p4-projects@FreeBSD.ORG Sun Sep 10 17:41:01 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4E55916A416; Sun, 10 Sep 2006 17:41:01 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 088C116A412 for ; Sun, 10 Sep 2006 17:41:01 +0000 (UTC) (envelope-from mjacob@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id A139843D46 for ; Sun, 10 Sep 2006 17:41:00 +0000 (GMT) (envelope-from mjacob@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8AHf0GA073876 for ; Sun, 10 Sep 2006 17:41:00 GMT (envelope-from mjacob@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8AHexwr073869 for perforce@freebsd.org; Sun, 10 Sep 2006 17:40:59 GMT (envelope-from mjacob@freebsd.org) Date: Sun, 10 Sep 2006 17:40:59 GMT Message-Id: <200609101740.k8AHexwr073869@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to mjacob@freebsd.org using -f From: Matt Jacob To: Perforce Change Reviews Cc: Subject: PERFORCE change 105939 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Sep 2006 17:41:01 -0000 http://perforce.freebsd.org/chv.cgi?CH=105939 Change 105939 by mjacob@newisp on 2006/09/10 17:40:25 IFC Affected files ... .. //depot/projects/newisp/amd64/linux32/linux32_sysvec.c#2 integrate .. //depot/projects/newisp/compat/freebsd32/freebsd32_proto.h#3 integrate .. //depot/projects/newisp/compat/freebsd32/freebsd32_syscall.h#3 integrate .. //depot/projects/newisp/compat/freebsd32/freebsd32_syscalls.c#3 integrate .. //depot/projects/newisp/compat/freebsd32/freebsd32_sysent.c#3 integrate .. //depot/projects/newisp/compat/freebsd32/syscalls.master#3 integrate .. //depot/projects/newisp/compat/linux/linux_emul.c#3 integrate .. //depot/projects/newisp/compat/linux/linux_file.c#2 integrate .. //depot/projects/newisp/compat/linux/linux_futex.c#2 integrate .. //depot/projects/newisp/dev/bge/if_bge.c#3 integrate .. //depot/projects/newisp/dev/bge/if_bgereg.h#3 integrate .. //depot/projects/newisp/dev/em/if_em.c#4 integrate .. //depot/projects/newisp/dev/em/if_em.h#3 integrate .. //depot/projects/newisp/dev/fdc/fdc.c#3 integrate .. //depot/projects/newisp/dev/ic/nec765.h#2 integrate .. //depot/projects/newisp/dev/mpt/mpt_pci.c#3 integrate .. //depot/projects/newisp/dev/re/if_re.c#2 integrate .. //depot/projects/newisp/dev/sound/usb/uaudio.c#3 integrate .. //depot/projects/newisp/dev/usb/usb_subr.c#3 integrate .. //depot/projects/newisp/geom/gate/g_gate.c#3 integrate .. //depot/projects/newisp/geom/gate/g_gate.h#3 integrate .. //depot/projects/newisp/geom/geom_event.c#2 integrate .. //depot/projects/newisp/geom/mirror/g_mirror.c#2 integrate .. //depot/projects/newisp/geom/nop/g_nop.c#2 integrate .. //depot/projects/newisp/geom/nop/g_nop.h#2 integrate .. //depot/projects/newisp/geom/raid3/g_raid3.c#2 integrate .. //depot/projects/newisp/i386/i386/sys_machdep.c#2 integrate .. //depot/projects/newisp/i386/linux/linux_sysvec.c#2 integrate .. //depot/projects/newisp/kern/kern_ktr.c#2 integrate .. //depot/projects/newisp/kern/tty.c#2 integrate .. //depot/projects/newisp/kern/uipc_socket.c#2 integrate .. //depot/projects/newisp/modules/Makefile#3 integrate .. //depot/projects/newisp/netgraph/bluetooth/drivers/ubt/ng_ubt.c#3 integrate .. //depot/projects/newisp/netgraph/bluetooth/drivers/ubt/ng_ubt_var.h#3 integrate .. //depot/projects/newisp/netinet/tcp_subr.c#5 integrate .. //depot/projects/newisp/pc98/cbus/fdc.c#2 integrate .. //depot/projects/newisp/security/audit/audit.c#3 integrate .. //depot/projects/newisp/security/audit/audit_bsm.c#3 integrate .. //depot/projects/newisp/sys/mac_policy.h#2 integrate .. //depot/projects/newisp/sys/param.h#4 integrate Differences ... ==== //depot/projects/newisp/amd64/linux32/linux32_sysvec.c#2 (text+ko) ==== @@ -31,7 +31,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_sysvec.c,v 1.23 2006/08/17 21:06:48 netchild Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_sysvec.c,v 1.24 2006/09/09 16:25:25 netchild Exp $"); #include "opt_compat.h" #ifndef COMPAT_IA32 @@ -124,7 +124,7 @@ static void linux32_fixlimits(struct proc *p); extern LIST_HEAD(futex_list, futex) futex_list; -extern struct mtx futex_mtx; +extern struct sx futex_sx; static eventhandler_tag linux_exit_tag; static eventhandler_tag linux_schedtail_tag; @@ -1080,7 +1080,7 @@ sx_init(&emul_lock, "emuldata lock"); sx_init(&emul_shared_lock, "emuldata->shared lock"); LIST_INIT(&futex_list); - mtx_init(&futex_mtx, "futex protection lock", NULL, MTX_DEF); + sx_init(&futex_sx, "futex protection lock"); linux_exit_tag = EVENTHANDLER_REGISTER(process_exit, linux_proc_exit, NULL, 1000); linux_schedtail_tag = EVENTHANDLER_REGISTER(schedtail, linux_schedtail, @@ -1110,7 +1110,7 @@ linux_device_unregister_handler(*ldhp); sx_destroy(&emul_lock); sx_destroy(&emul_shared_lock); - mtx_destroy(&futex_mtx); + sx_destroy(&futex_sx); EVENTHANDLER_DEREGISTER(process_exit, linux_exit_tag); EVENTHANDLER_DEREGISTER(schedtail, linux_schedtail_tag); EVENTHANDLER_DEREGISTER(process_exec, linux_exec_tag); ==== //depot/projects/newisp/compat/freebsd32/freebsd32_proto.h#3 (text+ko) ==== @@ -2,7 +2,7 @@ * System call prototypes. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/compat/freebsd32/freebsd32_proto.h,v 1.60 2006/09/03 16:24:36 rwatson Exp $ + * $FreeBSD: src/sys/compat/freebsd32/freebsd32_proto.h,v 1.61 2006/09/09 01:22:13 davidxu Exp $ * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.73 2006/09/03 16:17:49 rwatson Exp */ ==== //depot/projects/newisp/compat/freebsd32/freebsd32_syscall.h#3 (text+ko) ==== @@ -2,7 +2,7 @@ * System call numbers. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/compat/freebsd32/freebsd32_syscall.h,v 1.58 2006/09/03 16:24:36 rwatson Exp $ + * $FreeBSD: src/sys/compat/freebsd32/freebsd32_syscall.h,v 1.59 2006/09/09 01:22:13 davidxu Exp $ * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.73 2006/09/03 16:17:49 rwatson Exp */ @@ -310,5 +310,10 @@ #define FREEBSD32_SYS_thr_suspend 442 #define FREEBSD32_SYS_thr_wake 443 #define FREEBSD32_SYS_kldunloadf 444 +#define FREEBSD32_SYS_sigqueue 456 #define FREEBSD32_SYS_abort2 463 +#define FREEBSD32_SYS_thr_set_name 464 +#define FREEBSD32_SYS_thr_setscheduler 466 +#define FREEBSD32_SYS_thr_getscheduler 467 +#define FREEBSD32_SYS_thr_setschedparam 468 #define FREEBSD32_SYS_MAXSYSCALL 471 ==== //depot/projects/newisp/compat/freebsd32/freebsd32_syscalls.c#3 (text+ko) ==== @@ -2,7 +2,7 @@ * System call names. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/compat/freebsd32/freebsd32_syscalls.c,v 1.49 2006/09/03 16:24:36 rwatson Exp $ + * $FreeBSD: src/sys/compat/freebsd32/freebsd32_syscalls.c,v 1.50 2006/09/09 01:22:13 davidxu Exp $ * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.73 2006/09/03 16:17:49 rwatson Exp */ @@ -463,7 +463,7 @@ "#453", /* 453 = auditctl */ "#454", /* 454 = _umtx_op */ "#455", /* 455 = thr_new */ - "#456", /* 456 = sigqueue */ + "sigqueue", /* 456 = sigqueue */ "#457", /* 457 = kmq_open */ "#458", /* 458 = kmq_setattr */ "#459", /* 459 = kmq_timedreceive */ @@ -471,11 +471,11 @@ "#461", /* 461 = kmq_notify */ "#462", /* 462 = kmq_unlink */ "abort2", /* 463 = abort2 */ - "#464", /* 464 = thr_set_name */ + "thr_set_name", /* 464 = thr_set_name */ "#465", /* 465 = aio_fsync */ - "#466", /* 466 = thr_setscheduler */ - "#467", /* 467 = thr_getscheduler */ - "#468", /* 468 = thr_setschedparam */ + "thr_setscheduler", /* 466 = thr_setscheduler */ + "thr_getscheduler", /* 467 = thr_getscheduler */ + "thr_setschedparam", /* 468 = thr_setschedparam */ "#469", /* 469 = __getpath_fromfd */ "#470", /* 470 = __getpath_fromaddr */ }; ==== //depot/projects/newisp/compat/freebsd32/freebsd32_sysent.c#3 (text+ko) ==== @@ -2,7 +2,7 @@ * System call switch table. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/compat/freebsd32/freebsd32_sysent.c,v 1.59 2006/09/03 16:24:36 rwatson Exp $ + * $FreeBSD: src/sys/compat/freebsd32/freebsd32_sysent.c,v 1.60 2006/09/09 01:22:13 davidxu Exp $ * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.73 2006/09/03 16:17:49 rwatson Exp */ @@ -488,7 +488,7 @@ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 453 = auditctl */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 454 = _umtx_op */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 455 = thr_new */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 456 = sigqueue */ + { AS(sigqueue_args), (sy_call_t *)sigqueue, AUE_NULL, NULL, 0, 0 }, /* 456 = sigqueue */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 457 = kmq_open */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 458 = kmq_setattr */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 459 = kmq_timedreceive */ @@ -496,11 +496,11 @@ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 461 = kmq_notify */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 462 = kmq_unlink */ { AS(abort2_args), (sy_call_t *)abort2, AUE_NULL, NULL, 0, 0 }, /* 463 = abort2 */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 464 = thr_set_name */ + { AS(thr_set_name_args), (sy_call_t *)thr_set_name, AUE_NULL, NULL, 0, 0 }, /* 464 = thr_set_name */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 465 = aio_fsync */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 466 = thr_setscheduler */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 467 = thr_getscheduler */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 468 = thr_setschedparam */ + { AS(thr_setscheduler_args), (sy_call_t *)thr_setscheduler, AUE_NULL, NULL, 0, 0 }, /* 466 = thr_setscheduler */ + { AS(thr_getscheduler_args), (sy_call_t *)thr_getscheduler, AUE_NULL, NULL, 0, 0 }, /* 467 = thr_getscheduler */ + { AS(thr_setschedparam_args), (sy_call_t *)thr_setschedparam, AUE_NULL, NULL, 0, 0 }, /* 468 = thr_setschedparam */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 469 = __getpath_fromfd */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 470 = __getpath_fromaddr */ }; ==== //depot/projects/newisp/compat/freebsd32/syscalls.master#3 (text+ko) ==== @@ -1,4 +1,4 @@ - $FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.73 2006/09/03 16:17:49 rwatson Exp $ + $FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.74 2006/09/09 01:22:13 davidxu Exp $ ; from: @(#)syscalls.master 8.2 (Berkeley) 1/13/94 ; from: src/sys/kern/syscalls.master 1.107 ; @@ -743,7 +743,8 @@ 453 AUE_AUDITCTL UNIMPL auditctl 454 AUE_NULL UNIMPL _umtx_op 455 AUE_NULL UNIMPL thr_new -456 AUE_NULL UNIMPL sigqueue +456 AUE_NULL NOPROTO { int sigqueue(pid_t pid, int signum, \ + void *value); } 457 AUE_NULL UNIMPL kmq_open 458 AUE_NULL UNIMPL kmq_setattr 459 AUE_NULL UNIMPL kmq_timedreceive @@ -751,10 +752,16 @@ 461 AUE_NULL UNIMPL kmq_notify 462 AUE_NULL UNIMPL kmq_unlink 463 AUE_NULL NOPROTO { int abort2(const char *why, int nargs, void **args); } -464 AUE_NULL UNIMPL thr_set_name +464 AUE_NULL NOPROTO { int thr_set_name(long id, const char *name); } 465 AUE_NULL UNIMPL aio_fsync -466 AUE_NULL UNIMPL thr_setscheduler -467 AUE_NULL UNIMPL thr_getscheduler -468 AUE_NULL UNIMPL thr_setschedparam +466 AUE_NULL NOPROTO { int thr_setscheduler(long id, int policy,\ + const struct sched_param *param, \ + int param_size); } +467 AUE_NULL NOPROTO { int thr_getscheduler(long id, int *policy,\ + struct sched_param *param, \ + int param_size); } +468 AUE_NULL NOPROTO { int thr_setschedparam(long id, \ + const struct sched_param *param, \ + int param_size); } 469 AUE_NULL UNIMPL __getpath_fromfd 470 AUE_NULL UNIMPL __getpath_fromaddr ==== //depot/projects/newisp/compat/linux/linux_emul.c#3 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/compat/linux/linux_emul.c,v 1.5 2006/08/28 13:52:27 ssouhlal Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linux/linux_emul.c,v 1.6 2006/09/09 16:55:55 netchild Exp $"); #include "opt_compat.h" @@ -101,6 +101,7 @@ panic("process not found in proc_init\n"); p->p_emuldata = em; PROC_UNLOCK(p); + EMUL_LOCK(&emul_lock); } else { /* lookup the old one */ em = em_find(td->td_proc, EMUL_UNLOCKED); @@ -129,14 +130,15 @@ if (child != 0) { + EMUL_UNLOCK(&emul_lock); EMUL_SHARED_WLOCK(&emul_shared_lock); LIST_INSERT_HEAD(&em->shared->threads, em, threads); EMUL_SHARED_WUNLOCK(&emul_shared_lock); p = pfind(child); - PROC_UNLOCK(p); /* we might have a sleeping linux_schedtail */ wakeup(&p->p_emuldata); + PROC_UNLOCK(p); } else EMUL_UNLOCK(&emul_lock); ==== //depot/projects/newisp/compat/linux/linux_file.c#2 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/compat/linux/linux_file.c,v 1.96 2006/07/11 20:52:07 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linux/linux_file.c,v 1.97 2006/09/10 13:47:56 netchild Exp $"); #include "opt_compat.h" #include "opt_mac.h" @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -495,6 +496,7 @@ { char *path; int error; + struct stat st; LCONVPATHEXIST(td, args->path, &path); @@ -504,6 +506,11 @@ #endif error = kern_unlink(td, path, UIO_SYSSPACE); + if (error == EPERM) + /* Introduce POSIX noncompliant behaviour of Linux */ + if (kern_stat(td, path, UIO_SYSSPACE, &st) == 0) + if (S_ISDIR(st.st_mode)) + error = EISDIR; LFREEPATH(path); return (error); } ==== //depot/projects/newisp/compat/linux/linux_futex.c#2 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/compat/linux/linux_futex.c,v 1.4 2006/08/26 10:36:16 netchild Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linux/linux_futex.c,v 1.6 2006/09/09 16:25:25 netchild Exp $"); #if 0 __KERNEL_RCSID(1, "$NetBSD: linux_futex.c,v 1.5 2005/11/23 16:14:57 manu Exp $"); #endif @@ -47,6 +47,7 @@ #include #include #include +#include #include #ifdef COMPAT_LINUX32 @@ -73,10 +74,10 @@ }; LIST_HEAD(futex_list, futex) futex_list; -struct mtx futex_mtx; /* this protects the LIST of futexes */ +struct sx futex_sx; /* this protects the LIST of futexes */ -#define FUTEX_LOCK mtx_lock(&futex_mtx) -#define FUTEX_UNLOCK mtx_unlock(&futex_mtx) +#define FUTEX_LOCK sx_xlock(&futex_sx) +#define FUTEX_UNLOCK sx_xunlock(&futex_sx) #define FUTEX_LOCKED 1 #define FUTEX_UNLOCKED 0 @@ -302,9 +303,6 @@ ret = futex_wake(f, args->val, NULL); futex_put(f); if (op_ret > 0) { -#ifdef DEBUG - printf("second wakeup\n"); -#endif op_ret = 0; /* * Linux uses the address of the timespec parameter @@ -346,16 +344,11 @@ return f; } } - if (locked == FUTEX_UNLOCKED) - FUTEX_UNLOCK; - /* Not found, create it */ f = malloc(sizeof(*f), M_LINUX, M_WAITOK); f->f_uaddr = uaddr; f->f_refcount = 1; TAILQ_INIT(&f->f_waiting_proc); - if (locked == FUTEX_UNLOCKED) - FUTEX_LOCK; LIST_INSERT_HEAD(&futex_list, f, f_list); if (locked == FUTEX_UNLOCKED) FUTEX_UNLOCK; @@ -421,13 +414,13 @@ FUTEX_LOCK; TAILQ_FOREACH(wp, &f->f_waiting_proc, wp_list) { if (count <= n) { - wakeup(wp); + wakeup_one(wp); count++; } else { if (newf != NULL) { /* futex_put called after tsleep */ wp->wp_new_futex = futex_get(newf->f_uaddr, FUTEX_LOCKED); - wakeup(wp); + wakeup_one(wp); } } } ==== //depot/projects/newisp/dev/bge/if_bge.c#3 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/bge/if_bge.c,v 1.143 2006/09/03 00:27:41 jmg Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/bge/if_bge.c,v 1.144 2006/09/09 03:36:57 ambrisko Exp $"); /* * Broadcom BCM570x family gigabit ethernet driver for FreeBSD. @@ -326,6 +326,7 @@ static void bge_txeof(struct bge_softc *); static void bge_rxeof(struct bge_softc *); +static void bge_asf_driver_up (struct bge_softc *); static void bge_tick_locked(struct bge_softc *); static void bge_tick(void *); static void bge_stats_update(struct bge_softc *); @@ -376,7 +377,12 @@ static void bge_poll(struct ifnet *ifp, enum poll_cmd cmd, int count); #endif -static void bge_reset(struct bge_softc *); +#define BGE_RESET_START 1 +#define BGE_RESET_STOP 2 +static void bge_sig_post_reset(struct bge_softc *, int); +static void bge_sig_legacy(struct bge_softc *, int); +static void bge_sig_pre_reset(struct bge_softc *, int); +static int bge_reset(struct bge_softc *); static void bge_link_upd(struct bge_softc *); static device_method_t bge_methods[] = { @@ -646,7 +652,6 @@ { struct bge_softc *sc; struct mii_data *mii; - sc = device_get_softc(dev); mii = device_get_softc(sc->bge_miibus); @@ -968,6 +973,84 @@ CSR_WRITE_4(sc, BGE_MAR0 + (i * 4), hashes[i]); } +static void +bge_sig_pre_reset(sc, type) + struct bge_softc *sc; + int type; +{ + /* + * Some chips don't like this so only do this if ASF is enabled + */ + if (sc->bge_asf_mode) + bge_writemem_ind(sc, BGE_SOFTWARE_GENCOMM, BGE_MAGIC_NUMBER); + + if (sc->bge_asf_mode & ASF_NEW_HANDSHAKE) { + switch (type) { + case BGE_RESET_START: + bge_writemem_ind(sc, BGE_SDI_STATUS, 0x1); /* START */ + break; + case BGE_RESET_STOP: + bge_writemem_ind(sc, BGE_SDI_STATUS, 0x2); /* UNLOAD */ + break; + } + } +} + +static void +bge_sig_post_reset(sc, type) + struct bge_softc *sc; + int type; +{ + if (sc->bge_asf_mode & ASF_NEW_HANDSHAKE) { + switch (type) { + case BGE_RESET_START: + bge_writemem_ind(sc, BGE_SDI_STATUS, 0x80000001); + /* START DONE */ + break; + case BGE_RESET_STOP: + bge_writemem_ind(sc, BGE_SDI_STATUS, 0x80000002); + break; + } + } +} + +static void +bge_sig_legacy(sc, type) + struct bge_softc *sc; + int type; +{ + if (sc->bge_asf_mode) { + switch (type) { + case BGE_RESET_START: + bge_writemem_ind(sc, BGE_SDI_STATUS, 0x1); /* START */ + break; + case BGE_RESET_STOP: + bge_writemem_ind(sc, BGE_SDI_STATUS, 0x2); /* UNLOAD */ + break; + } + } +} + +void bge_stop_fw(struct bge_softc *); +void +bge_stop_fw(sc) + struct bge_softc *sc; +{ + int i; + + if (sc->bge_asf_mode) { + bge_writemem_ind(sc, BGE_SOFTWARE_GENCOMM_FW, BGE_FW_PAUSE); + CSR_WRITE_4(sc, BGE_CPU_EVENT, + CSR_READ_4(sc, BGE_CPU_EVENT) != (1 << 14)); + + for (i = 0; i < 100; i++ ) { + if (!(CSR_READ_4(sc, BGE_CPU_EVENT) & (1 << 14))) + break; + DELAY(10); + } + } +} + /* * Do endian, PCI and DMA initialization. Also check the on-board ROM * self-test results. @@ -978,7 +1061,7 @@ uint32_t dma_rw_ctl; int i; - /* Set endian type before we access any non-PCI registers. */ + /* Set endianness before we access any non-PCI registers. */ pci_write_config(sc->bge_dev, BGE_PCI_MISC_CTL, BGE_INIT, 4); /* @@ -1070,6 +1153,12 @@ BGE_MODECTL_TX_NO_PHDR_CSUM); /* + * Tell the firmware the driver is running + */ + if (sc->bge_asf_mode & ASF_STACKUP) + BGE_SETBIT(sc, BGE_MODE_CTL, BGE_MODECTL_STACKUP); + + /* * Disable memory write invalidate. Apparently it is not supported * properly by these devices. */ @@ -1992,6 +2081,7 @@ uint32_t mac_tmp = 0; u_char eaddr[6]; int error = 0, rid; + int trys; sc = device_get_softc(dev); sc->bge_dev = dev; @@ -2059,7 +2149,38 @@ sc->bge_flags |= BGE_FLAG_PCIX; /* Try to reset the chip. */ - bge_reset(sc); + if (bge_reset(sc)) { + device_printf(sc->bge_dev, "chip reset failed\n"); + bge_release_resources(sc); + error = ENXIO; + goto fail; + } + + sc->bge_asf_mode = 0; + if (bge_readmem_ind(sc, BGE_SOFTWARE_GENCOMM_SIG) + == BGE_MAGIC_NUMBER) { + if (bge_readmem_ind(sc, BGE_SOFTWARE_GENCOMM_NICCFG) + & BGE_HWCFG_ASF) { + sc->bge_asf_mode |= ASF_ENABLE; + sc->bge_asf_mode |= ASF_STACKUP; + if (sc->bge_asicrev == BGE_ASICREV_BCM5750) { + sc->bge_asf_mode |= ASF_NEW_HANDSHAKE; + } + } + } + + /* Try to reset the chip again the nice way. */ + bge_stop_fw(sc); + bge_sig_pre_reset(sc, BGE_RESET_STOP); + if (bge_reset(sc)) { + device_printf(sc->bge_dev, "chip reset failed\n"); + bge_release_resources(sc); + error = ENXIO; + goto fail; + } + + bge_sig_legacy(sc, BGE_RESET_STOP); + bge_sig_post_reset(sc, BGE_RESET_STOP); if (bge_chipinit(sc)) { device_printf(sc->bge_dev, "chip initialization failed\n"); @@ -2186,15 +2307,36 @@ sc->bge_ifmedia.ifm_media = sc->bge_ifmedia.ifm_cur->ifm_media; } else { /* - * Do transceiver setup. + * Do transceiver setup and tell the firmware the + * driver is down so we can try to get access the + * probe if ASF is running. Retry a couple of times + * if we get a conflict with the ASF firmware accessing + * the PHY. */ + BGE_CLRBIT(sc, BGE_MODE_CTL, BGE_MODECTL_STACKUP); +again: + bge_asf_driver_up(sc); + + trys = 0; if (mii_phy_probe(dev, &sc->bge_miibus, bge_ifmedia_upd, bge_ifmedia_sts)) { + if (trys++ < 4) { + device_printf(sc->bge_dev, "Try again\n"); + bge_miibus_writereg(sc->bge_dev, 1, MII_BMCR, BMCR_RESET); + goto again; + } + device_printf(sc->bge_dev, "MII without any PHY!\n"); bge_release_resources(sc); error = ENXIO; goto fail; } + + /* + * Now tell the firmware we are going up after probing the PHY + */ + if (sc->bge_asf_mode & ASF_STACKUP) + BGE_SETBIT(sc, BGE_MODE_CTL, BGE_MODECTL_STACKUP); } /* @@ -2295,7 +2437,7 @@ BGE_LOCK_DESTROY(sc); } -static void +static int bge_reset(struct bge_softc *sc) { device_t dev; @@ -2382,7 +2524,7 @@ if (i == BGE_TIMEOUT) { device_printf(sc->bge_dev, "firmware handshake timed out\n"); - return; + return(0); } /* @@ -2403,6 +2545,10 @@ CSR_WRITE_4(sc, BGE_MODE_CTL, BGE_DMA_SWAP_OPTIONS| BGE_MODECTL_BYTESWAP_DATA); + /* Tell the ASF firmware we are up */ + if (sc->bge_asf_mode & ASF_STACKUP) + BGE_SETBIT(sc, BGE_MODE_CTL, BGE_MODECTL_STACKUP); + CSR_WRITE_4(sc, BGE_MAC_MODE, 0); /* @@ -2428,6 +2574,8 @@ CSR_WRITE_4(sc, 0x7c00, v | (1<<25)); } DELAY(10000); + + return(0); } /* @@ -2741,6 +2889,25 @@ } static void +bge_asf_driver_up(struct bge_softc *sc) +{ + if (sc->bge_asf_mode & ASF_STACKUP) { + /* Send ASF heartbeat aprox. every 2s */ + if (sc->bge_asf_count) + sc->bge_asf_count --; + else { + sc->bge_asf_count = 5; + bge_writemem_ind(sc, BGE_SOFTWARE_GENCOMM_FW, + BGE_FW_DRV_ALIVE); + bge_writemem_ind(sc, BGE_SOFTWARE_GENNCOMM_FW_LEN, 4); + bge_writemem_ind(sc, BGE_SOFTWARE_GENNCOMM_FW_DATA, 3); + CSR_WRITE_4(sc, BGE_CPU_EVENT, + CSR_READ_4(sc, BGE_CPU_EVENT) != (1 << 14)); + } + } +} + +static void bge_tick_locked(struct bge_softc *sc) { struct mii_data *mii = NULL; @@ -2754,7 +2921,9 @@ if ((sc->bge_flags & BGE_FLAG_TBI) == 0) { mii = device_get_softc(sc->bge_miibus); - mii_tick(mii); + /* Don't mess with the PHY in IPMI/ASF mode */ + if (!((sc->bge_asf_mode & ASF_STACKUP) && (sc->bge_link))) + mii_tick(mii); } else { /* * Since in TBI mode auto-polling can't be used we should poll @@ -2771,6 +2940,8 @@ } } + bge_asf_driver_up(sc); + callout_reset(&sc->bge_stat_ch, hz, bge_tick, sc); } @@ -3117,7 +3288,13 @@ /* Cancel pending I/O and flush buffers. */ bge_stop(sc); + + bge_stop_fw(sc); + bge_sig_pre_reset(sc, BGE_RESET_START); bge_reset(sc); + bge_sig_legacy(sc, BGE_RESET_START); + bge_sig_post_reset(sc, BGE_RESET_START); + bge_chipinit(sc); /* @@ -3200,7 +3377,7 @@ CSR_WRITE_4(sc, BGE_HCC_TX_MAX_COAL_BDS_INT, 1); } else #endif - + /* Enable host interrupts. */ { BGE_SETBIT(sc, BGE_PCI_MISC_CTL, BGE_PCIMISCCTL_CLEAR_INTA); @@ -3552,7 +3729,20 @@ /* * Tell firmware we're shutting down. */ - BGE_CLRBIT(sc, BGE_MODE_CTL, BGE_MODECTL_STACKUP); + + bge_stop_fw(sc); + bge_sig_pre_reset(sc, BGE_RESET_STOP); + bge_reset(sc); + bge_sig_legacy(sc, BGE_RESET_STOP); + bge_sig_post_reset(sc, BGE_RESET_STOP); + + /* + * Keep the ASF firmware running if up. + */ + if (sc->bge_asf_mode & ASF_STACKUP) + BGE_SETBIT(sc, BGE_MODE_CTL, BGE_MODECTL_STACKUP); + else + BGE_CLRBIT(sc, BGE_MODE_CTL, BGE_MODECTL_STACKUP); /* Free the RX lists. */ bge_free_rx_ring_std(sc); ==== //depot/projects/newisp/dev/bge/if_bgereg.h#3 (text+ko) ==== @@ -30,7 +30,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/bge/if_bgereg.h,v 1.54 2006/09/01 22:45:11 davidch Exp $ + * $FreeBSD: src/sys/dev/bge/if_bgereg.h,v 1.55 2006/09/09 03:36:57 ambrisko Exp $ */ /* @@ -74,6 +74,11 @@ #define BGE_SOFTWARE_GENCOMM 0x00000B50 #define BGE_SOFTWARE_GENCOMM_SIG 0x00000B54 #define BGE_SOFTWARE_GENCOMM_NICCFG 0x00000B58 +#define BGE_SOFTWARE_GENCOMM_FW 0x00000B78 +#define BGE_FW_DRV_ALIVE 0x00000001 +#define BGE_FW_PAUSE 0x00000002 +#define BGE_SOFTWARE_GENNCOMM_FW_LEN 0x00000B7C +#define BGE_SOFTWARE_GENNCOMM_FW_DATA 0x00000B80 #define BGE_SOFTWARE_GENCOMM_END 0x00000FFF #define BGE_UNMAPPED 0x00001000 #define BGE_UNMAPPED_END 0x00001FFF @@ -1651,6 +1656,7 @@ #define BGE_MODE_CTL 0x6800 #define BGE_MISC_CFG 0x6804 #define BGE_MISC_LOCAL_CTL 0x6808 +#define BGE_CPU_EVENT 0x6810 #define BGE_EE_ADDR 0x6838 #define BGE_EE_DATA 0x683C #define BGE_EE_CTL 0x6840 @@ -2064,6 +2070,7 @@ #define BGE_HWCFG_VOLTAGE 0x00000003 #define BGE_HWCFG_PHYLED_MODE 0x0000000C #define BGE_HWCFG_MEDIA 0x00000030 +#define BGE_HWCFG_ASF 0x00000080 #define BGE_VOLTAGE_1POINT3 0x00000000 #define BGE_VOLTAGE_1POINT8 0x00000001 @@ -2434,6 +2441,10 @@ int val; }; +#define ASF_ENABLE 1 +#define ASF_NEW_HANDSHAKE 2 +#define ASF_STACKUP 4 + struct bge_softc { struct ifnet *bge_ifp; /* interface info */ device_t bge_dev; @@ -2453,8 +2464,10 @@ #define BGE_FLAG_PCIX 0x00000010 #define BGE_FLAG_PCIE 0x00000020 uint32_t bge_chipid; - uint8_t bge_asicrev; - uint8_t bge_chiprev; + uint8_t bge_asicrev; + uint8_t bge_chiprev; + uint8_t bge_asf_mode; + uint8_t bge_asf_count; struct bge_ring_data bge_ldata; /* rings */ struct bge_chain_data bge_cdata; /* mbufs */ uint16_t bge_tx_saved_considx; ==== //depot/projects/newisp/dev/em/if_em.c#4 (text+ko) ==== @@ -31,7 +31,7 @@ ***************************************************************************/ -/*$FreeBSD: src/sys/dev/em/if_em.c,v 1.139 2006/09/03 00:27:41 jmg Exp $*/ +/*$FreeBSD: src/sys/dev/em/if_em.c,v 1.142 2006/09/09 20:05:24 pdeuskar Exp $*/ #ifdef HAVE_KERNEL_OPTION_HEADERS #include "opt_device_polling.h" @@ -72,6 +72,7 @@ #include #include +#include #include #include #include @@ -86,7 +87,7 @@ * Driver version *********************************************************************/ -char em_driver_version[] = "Version - 6.1.4"; +char em_driver_version[] = "Version - 6.1.4 - TSO"; /********************************************************************* @@ -231,6 +232,8 @@ struct mbuf *); static void em_transmit_checksum_setup(struct adapter *, struct mbuf *, uint32_t *, uint32_t *); +static boolean_t em_tso_setup(struct adapter *, struct mbuf *, + uint32_t *, uint32_t *); static void em_set_promisc(struct adapter *); static void em_disable_promisc(struct adapter *); static void em_set_multi(struct adapter *); @@ -304,6 +307,7 @@ #define E1000_TICKS_TO_USECS(ticks) ((1024 * (ticks) + 500) / 1000) #define E1000_USECS_TO_TICKS(usecs) ((1000 * (usecs) + 512) / 1024) +#define M_TSO_LEN 66 static int em_tx_int_delay_dflt = E1000_TICKS_TO_USECS(EM_TIDV); static int em_rx_int_delay_dflt = E1000_TICKS_TO_USECS(EM_RDTR); @@ -907,6 +911,10 @@ ifp->if_capenable ^= IFCAP_HWCSUM; reinit = 1; } + if (mask & IFCAP_TSO) { + ifp->if_capenable ^= IFCAP_TSO; + reinit = 1; + } if (mask & IFCAP_VLAN_HWTAGGING) { ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; reinit = 1; @@ -1075,11 +1083,12 @@ ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + ifp->if_hwassist = 0; if (adapter->hw.mac_type >= em_82543) { if (ifp->if_capenable & IFCAP_TXCSUM) ifp->if_hwassist = EM_CHECKSUM_FEATURES; - else - ifp->if_hwassist = 0; + if (ifp->if_capenable & IFCAP_TSO) + ifp->if_hwassist |= EM_TCPSEG_FEATURES; } callout_reset(&adapter->timer, hz, em_local_timer, adapter); @@ -1441,11 +1450,13 @@ struct m_tag *mtag; uint32_t txd_upper, txd_lower, txd_used, txd_saved; int nsegs, i, j; - int error; + int error, do_tso, tso_desc = 0; m_head = *m_headp; current_tx_desc = NULL; - txd_used = txd_saved = 0; + txd_upper = txd_lower = txd_used = txd_saved = 0; + + do_tso = ((m_head->m_pkthdr.csum_flags & CSUM_TSO) != 0); /* * Force a cleanup if number of TX descriptors @@ -1498,6 +1509,17 @@ *m_headp = m_head; } + /* + * TSO workaround: + * If an mbuf is only header we need + * to pull 4 bytes of data into it. + */ + if (do_tso && (m_head->m_len <= M_TSO_LEN)) { + m_head = m_pullup(m_head, M_TSO_LEN + 4); + if (m_head == NULL) + return (ENOBUFS); + } + /* * Map the packet for DMA. */ @@ -1536,24 +1558,42 @@ return (EIO); } - if (nsegs > adapter->num_tx_desc_avail) { + /* + * TSO Hardware workaround, if this packet is not + * TSO, and is only a single descriptor long, and + * it follows a TSO burst, then we need to add a + * sentinel descriptor to prevent premature writeback. + */ + if ((do_tso == 0) && (adapter->tx_tso == TRUE)) { + if (nsegs == 1) + tso_desc = TRUE; + adapter->tx_tso = FALSE; + } + + if (nsegs > adapter->num_tx_desc_avail - 2) { adapter->no_tx_desc_avail2++; bus_dmamap_unload(adapter->txtag, map); return (ENOBUFS); } + /* Do hardware assists */ m_head = *m_headp; - if (ifp->if_hwassist > 0) - em_transmit_checksum_setup(adapter, m_head, &txd_upper, &txd_lower); - else - txd_upper = txd_lower = 0; + if ( ifp->if_hwassist > 0) { + if (em_tso_setup(adapter, m_head, &txd_upper, &txd_lower)) { + /* we need to make a final sentinel transmit desc */ + tso_desc = TRUE; + } else + em_transmit_checksum_setup(adapter, m_head, + &txd_upper, &txd_lower); + } i = adapter->next_avail_tx_desc; - if (adapter->pcix_82544) { + if (adapter->pcix_82544) txd_saved = i; - txd_used = 0; - } + for (j = 0; j < nsegs; j++) { + bus_size_t seg_len; + bus_addr_t seg_addr; /* If adapter is 82544 and on PCIX bus. */ if(adapter->pcix_82544) { DESC_ARRAY desc_array; @@ -1587,26 +1627,57 @@ txd_used++; } } else { - tx_buffer = &adapter->tx_buffer_area[i]; - current_tx_desc = &adapter->tx_desc_base[i]; - - current_tx_desc->buffer_addr = htole64(segs[j].ds_addr); - current_tx_desc->lower.data = htole32( - adapter->txd_cmd | txd_lower | segs[j].ds_len); - current_tx_desc->upper.data = htole32(txd_upper); - - if (++i == adapter->num_tx_desc) - i = 0; - - tx_buffer->m_head = NULL; + tx_buffer = &adapter->tx_buffer_area[i]; + current_tx_desc = &adapter->tx_desc_base[i]; + seg_addr = htole64(segs[j].ds_addr); + seg_len = segs[j].ds_len; + /* + ** TSO Workaround: + ** If this is the last descriptor, we want to + ** split it so we have a small final sentinel + */ >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Sun Sep 10 18:41:40 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id BFC7316A416; Sun, 10 Sep 2006 18:41:40 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6453816A407 for ; Sun, 10 Sep 2006 18:41:40 +0000 (UTC) (envelope-from trhodes@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 48F0843D7B for ; Sun, 10 Sep 2006 18:41:18 +0000 (GMT) (envelope-from trhodes@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8AIfIgC078154 for ; Sun, 10 Sep 2006 18:41:18 GMT (envelope-from trhodes@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8AIfHM4078151 for perforce@freebsd.org; Sun, 10 Sep 2006 18:41:17 GMT (envelope-from trhodes@freebsd.org) Date: Sun, 10 Sep 2006 18:41:17 GMT Message-Id: <200609101841.k8AIfHM4078151@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to trhodes@freebsd.org using -f From: Tom Rhodes To: Perforce Change Reviews Cc: Subject: PERFORCE change 105943 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Sep 2006 18:41:41 -0000 http://perforce.freebsd.org/chv.cgi?CH=105943 Change 105943 by trhodes@trhodes_local on 2006/09/10 18:40:23 More diff reduction: Fix __FBSDID, add/modify comments, add parens, space fixes, etc. Affected files ... .. //depot/projects/usb/src/sys/dev/usb/if_cue.c#7 edit .. //depot/projects/usb/src/sys/dev/usb/if_kue.c#7 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb/if_cue.c#7 (text+ko) ==== @@ -30,6 +30,9 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD: src/sys/dev/usb/if_cue.c,v 1.63 2006/09/07 00:06:41 imp Exp $"); + /* * CATC USB-EL1210A USB to ethernet driver. Used in the CATC Netmate * adapters and others. @@ -53,7 +56,6 @@ * be called from within the config thread function ! */ -#include #include #include #include @@ -84,8 +86,6 @@ #include -__FBSDID("$FreeBSD: src/sys/dev/usb/if_cue.c,v 1.61 2005/11/11 16:04:55 ru Exp $"); - /* * Various supported device vendors/products. */ @@ -121,8 +121,8 @@ static void cue_cfg_getmac(struct cue_softc *sc, void *buf); -static u_int32_t -cue_mchash(const u_int8_t *addr); +static uint32_t +cue_mchash(const uint8_t *addr); static void cue_cfg_promisc_upd(struct cue_softc *sc, @@ -358,10 +358,10 @@ #define CUE_BITS 9 -static u_int32_t -cue_mchash(const u_int8_t *addr) +static uint32_t +cue_mchash(const uint8_t *addr) { - u_int32_t crc; + uint32_t crc; /* Compute CRC for the address value. */ crc = ether_crc32_le(addr, ETHER_ADDR_LEN); @@ -471,7 +471,7 @@ struct cue_type *t; if (uaa->iface != NULL) { - return UMATCH_NONE; + return(UMATCH_NONE); } t = cue_devs; @@ -869,8 +869,8 @@ m, 0, m->m_pkthdr.len); /* - * if there's a BPF listener, bounce a copy - * of this frame to him: + * If there's a BPF listener, bounce a copy of this frame + * to him. */ BPF_MTAP(ifp, m); @@ -919,7 +919,7 @@ } /* - * Cancel pending I/O + * Cancel pending I/O and free all RX/TX buffers. */ cue_cfg_stop(sc, cc, 0); #if 0 @@ -934,7 +934,7 @@ /* Enable RX logic. */ cue_cfg_csr_write_1(sc, CUE_ETHCTL, CUE_ETHCTL_RX_ON|CUE_ETHCTL_MCAST_ON); - /* load the multicast filter */ + /* Load the multicast filter */ cue_cfg_promisc_upd(sc, cc, 0); /* @@ -992,13 +992,13 @@ break; default: - error = ether_ioctl(ifp, command, data); - break; + error = ether_ioctl(ifp, command, data); + break; } mtx_unlock(&(sc->sc_mtx)); - return error; + return(error); } static void @@ -1018,6 +1018,10 @@ return; } +/* + * Stop the adapter and free any mbufs allocated to the + * RX and TX lists. + */ static void cue_cfg_stop(struct cue_softc *sc, struct cue_config_copy *cc, u_int16_t refcount) ==== //depot/projects/usb/src/sys/dev/usb/if_kue.c#7 (text+ko) ==== @@ -30,6 +30,9 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD: src/sys/dev/usb/if_kue.c,v 1.70 2006/09/07 00:06:41 imp Exp $"); + /* * Kawasaki LSI KL5KUSB101B USB to ethernet adapter driver. * @@ -67,7 +70,6 @@ * be called from within the config thread function ! */ -#include #include #include #include @@ -81,6 +83,7 @@ #include #include #include +#include #include #include @@ -98,8 +101,6 @@ #include #include -__FBSDID("$FreeBSD: src/sys/dev/usb/if_kue.c,v 1.68 2005/11/11 16:04:55 ru Exp $"); - /* * Various supported device vendors/products. */ @@ -125,8 +126,6 @@ { 0, 0 } }; -/* prototypes */ - static device_probe_t kue_probe; static device_attach_t kue_attach; static device_detach_t kue_detach; @@ -272,7 +271,7 @@ void *data) { u_int16_t length; - usbd_status err; + usbd_status err; if (usbd_config_td_is_gone(&(sc->sc_config_td))) { goto error; @@ -496,7 +495,7 @@ struct kue_type *t; if (uaa->iface != NULL) { - return UMATCH_NONE; + return(UMATCH_NONE); } t = kue_devs; @@ -507,7 +506,7 @@ } t++; } - return UMATCH_NONE; + return(UMATCH_NONE); } /* @@ -674,6 +673,10 @@ return 0; } +/* + * A frame has been uploaded: pass the resulting mbuf chain up to + * the higher level protocols. + */ static void kue_bulk_read_clear_stall_callback(struct usbd_xfer *xfer) { @@ -868,7 +871,7 @@ ifp->if_drv_flags |= IFF_DRV_OACTIVE; done: - return; + return(0); } static void @@ -961,8 +964,8 @@ static int kue_ioctl_cb(struct ifnet *ifp, u_long command, caddr_t data) { - struct kue_softc * sc = ifp->if_softc; - int error = 0; + struct kue_softc *sc = ifp->if_softc; + int error = 0; mtx_lock(&(sc->sc_mtx)); @@ -1019,6 +1022,10 @@ return; } +/* + * Stop the adapter and free any mbufs allocated to the + * RX and TX lists. + */ static void kue_watchdog(void *arg) { From owner-p4-projects@FreeBSD.ORG Mon Sep 11 16:01:57 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 270D816A416; Mon, 11 Sep 2006 16:01:57 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F421616A403; Mon, 11 Sep 2006 16:01:56 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7421D43D45; Mon, 11 Sep 2006 16:01:56 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.6/8.13.6) with ESMTP id k8BG1b6s017629; Mon, 11 Sep 2006 12:01:50 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: Alexander Leidinger Date: Mon, 11 Sep 2006 11:45:52 -0400 User-Agent: KMail/1.9.1 References: <200609100956.k8A9uD0P094639@repoman.freebsd.org> In-Reply-To: <200609100956.k8A9uD0P094639@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200609111145.52446.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Mon, 11 Sep 2006 12:01:50 -0400 (EDT) X-Virus-Scanned: ClamAV 0.88.3/1857/Mon Sep 11 11:12:56 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: Perforce Change Reviews Subject: Re: PERFORCE change 105930 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Sep 2006 16:01:57 -0000 On Sunday 10 September 2006 05:56, Alexander Leidinger wrote: > PROBLEMS: > > 1. Why does uma_zdestroy(9) print message like: > > Freed UMA keg was not empty (100 items). Lost 2 pages of memory. > > Does it represent any problems? It means a memory leak. -- John Baldwin From owner-p4-projects@FreeBSD.ORG Mon Sep 11 17:16:30 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7D0B616A412; Mon, 11 Sep 2006 17:16:30 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3D59916A403 for ; Mon, 11 Sep 2006 17:16:30 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 90D9243D60 for ; Mon, 11 Sep 2006 17:16:29 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8BHGTRv070193 for ; Mon, 11 Sep 2006 17:16:29 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8BHGTZl070190 for perforce@freebsd.org; Mon, 11 Sep 2006 17:16:29 GMT (envelope-from imp@freebsd.org) Date: Mon, 11 Sep 2006 17:16:29 GMT Message-Id: <200609111716.k8BHGTZl070190@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 105966 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Sep 2006 17:16:30 -0000 http://perforce.freebsd.org/chv.cgi?CH=105966 Change 105966 by imp@imp_paco-paco on 2006/09/11 17:16:17 IFC @105964 Affected files ... .. //depot/projects/arm/src/crypto/openssl/crypto/rsa/rsa_sign.c#3 integrate .. //depot/projects/arm/src/gnu/usr.bin/cc/cc_tools/Makefile#3 integrate .. //depot/projects/arm/src/lib/libc/rpc/clnt_bcast.c#2 integrate .. //depot/projects/arm/src/lib/libc/rpc/clnt_vc.c#2 integrate .. //depot/projects/arm/src/lib/libc/rpc/getnetconfig.c#2 integrate .. //depot/projects/arm/src/lib/libc/rpc/getnetpath.c#2 integrate .. //depot/projects/arm/src/lib/libc/rpc/rpcb_clnt.c#2 integrate .. //depot/projects/arm/src/lib/libc/rpc/rpcb_prot.c#2 integrate .. //depot/projects/arm/src/lib/libc/rpc/svc_simple.c#2 integrate .. //depot/projects/arm/src/lib/libc/rpc/svc_vc.c#2 integrate .. //depot/projects/arm/src/lib/libc/sys/recv.2#2 integrate .. //depot/projects/arm/src/release/Makefile#4 integrate .. //depot/projects/arm/src/release/scripts/package-split.py#2 integrate .. //depot/projects/arm/src/sbin/ipf/ipf/Makefile#2 integrate .. //depot/projects/arm/src/sbin/ipf/ipftest/Makefile#2 integrate .. //depot/projects/arm/src/sbin/ipf/ipmon/Makefile#2 integrate .. //depot/projects/arm/src/sbin/ipf/ipnat/Makefile#2 integrate .. //depot/projects/arm/src/sbin/ipf/ippool/Makefile#2 integrate .. //depot/projects/arm/src/share/man/man5/src.conf.5#3 integrate .. //depot/projects/arm/src/share/mk/bsd.lib.mk#3 integrate .. //depot/projects/arm/src/share/mk/bsd.own.mk#3 integrate .. //depot/projects/arm/src/share/mk/bsd.prog.mk#2 integrate .. //depot/projects/arm/src/sys/amd64/linux32/linux32_sysvec.c#10 integrate .. //depot/projects/arm/src/sys/compat/linux/linux_emul.c#4 integrate .. //depot/projects/arm/src/sys/compat/linux/linux_file.c#6 integrate .. //depot/projects/arm/src/sys/compat/linux/linux_futex.c#4 integrate .. //depot/projects/arm/src/sys/dev/em/if_em.c#28 integrate .. //depot/projects/arm/src/sys/dev/em/if_em.h#11 integrate .. //depot/projects/arm/src/sys/dev/nfe/if_nfe.c#4 integrate .. //depot/projects/arm/src/sys/dev/nfe/if_nfereg.h#3 integrate .. //depot/projects/arm/src/sys/dev/sound/usb/uaudio.c#7 integrate .. //depot/projects/arm/src/sys/dev/usb/usb_subr.c#10 integrate .. //depot/projects/arm/src/sys/geom/geom_event.c#3 integrate .. //depot/projects/arm/src/sys/geom/mirror/g_mirror.c#17 integrate .. //depot/projects/arm/src/sys/geom/raid3/g_raid3.c#20 integrate .. //depot/projects/arm/src/sys/i386/i386/busdma_machdep.c#9 integrate .. //depot/projects/arm/src/sys/i386/i386/sys_machdep.c#4 integrate .. //depot/projects/arm/src/sys/i386/linux/linux_sysvec.c#10 integrate .. //depot/projects/arm/src/sys/kern/kern_ktr.c#5 integrate .. //depot/projects/arm/src/sys/kern/tty.c#7 integrate .. //depot/projects/arm/src/sys/kern/uipc_socket.c#22 integrate .. //depot/projects/arm/src/sys/modules/Makefile#31 integrate .. //depot/projects/arm/src/sys/netinet/ip_output.c#14 integrate .. //depot/projects/arm/src/sys/security/audit/audit.c#10 integrate .. //depot/projects/arm/src/sys/security/audit/audit_bsm.c#8 integrate .. //depot/projects/arm/src/sys/sys/mac_policy.h#6 integrate .. //depot/projects/arm/src/tools/build/options/WITHOUT_ASSERT_DEBUG#1 branch .. //depot/projects/arm/src/tools/build/options/makeman#3 integrate Differences ... ==== //depot/projects/arm/src/crypto/openssl/crypto/rsa/rsa_sign.c#3 (text+ko) ==== @@ -185,6 +185,23 @@ sig=d2i_X509_SIG(NULL,&p,(long)i); if (sig == NULL) goto err; + + /* Excess data can be used to create forgeries */ + if(p != s+i) + { + RSAerr(RSA_F_RSA_VERIFY,RSA_R_BAD_SIGNATURE); + goto err; + } + + /* Parameters to the signature algorithm can also be used to + create forgeries */ + if(sig->algor->parameter + && sig->algor->parameter->type != V_ASN1_NULL) + { + RSAerr(RSA_F_RSA_VERIFY,RSA_R_BAD_SIGNATURE); + goto err; + } + sigtype=OBJ_obj2nid(sig->algor->algorithm); ==== //depot/projects/arm/src/gnu/usr.bin/cc/cc_tools/Makefile#3 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/gnu/usr.bin/cc/cc_tools/Makefile,v 1.82 2006/03/17 18:54:23 ru Exp $ +# $FreeBSD: src/gnu/usr.bin/cc/cc_tools/Makefile,v 1.83 2006/09/11 05:12:12 imp Exp $ .include @@ -49,7 +49,6 @@ .ORDER: options.h options.c options.h options.c: opts.sh ${OPTION_FILES} /bin/sh ${GCCDIR}/opts.sh mv options.c options.h ${OPTION_FILES} - GENSRCS+= options.c options.h CLEANFILES+= options.c options.h @@ -154,7 +153,7 @@ GENSRCS+= tm-preds.h #----------------------------------------------------------------------- -# Gengtype +# Gengtype gengtype-lex.c : gengtype-lex.l ${LEX} -t ${.ALLSRC} | \ @@ -533,7 +532,7 @@ gencodes.o: insn-modes.h genrtl.h genconfig.o: insn-modes.h genrtl.h print-rtl.o: insn-modes.h genrtl.h tm-preds.h tree-check.h -read-rtl.o: insn-modes.h genrtl.h +read-rtl.o: insn-modes.h genrtl.h genattr.o: insn-modes.h genrtl.h genemit.o: insn-modes.h genrtl.h genflags.o: insn-modes.h genrtl.h ==== //depot/projects/arm/src/lib/libc/rpc/clnt_bcast.c#2 (text+ko) ==== @@ -37,7 +37,7 @@ static char sccsid[] = "@(#)clnt_bcast.c 1.15 89/04/21 Copyr 1988 Sun Micro"; #endif #include -__FBSDID("$FreeBSD: src/lib/libc/rpc/clnt_bcast.c,v 1.8 2004/10/16 06:11:34 obrien Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/rpc/clnt_bcast.c,v 1.9 2006/09/09 22:14:42 mbr Exp $"); /* @@ -141,8 +141,10 @@ hints.ai_protocol = proto; hints.ai_socktype = socktype; - if (getaddrinfo(NULL, "sunrpc", &hints, &res) != 0) + if (getaddrinfo(NULL, "sunrpc", &hints, &res) != 0) { + freeifaddrs(ifp); return 0; + } for (ifap = ifp; ifap != NULL; ifap = ifap->ifa_next) { if (ifap->ifa_addr->sa_family != af || @@ -299,6 +301,7 @@ if (nettype == NULL) nettype = "datagram_n"; if ((handle = __rpc_setconf(nettype)) == NULL) { + AUTH_DESTROY(sys_auth); return (RPC_UNKNOWNPROTO); } while ((nconf = __rpc_getconf(handle)) != NULL) { ==== //depot/projects/arm/src/lib/libc/rpc/clnt_vc.c#2 (text+ko) ==== @@ -35,7 +35,7 @@ static char sccsid3[] = "@(#)clnt_vc.c 1.19 89/03/16 Copyr 1988 Sun Micro"; #endif #include -__FBSDID("$FreeBSD: src/lib/libc/rpc/clnt_vc.c,v 1.19 2006/02/27 22:10:59 deischen Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/rpc/clnt_vc.c,v 1.20 2006/09/09 22:18:57 mbr Exp $"); /* * clnt_tcp.c, Implements a TCP/IP based, client side RPC. @@ -243,9 +243,9 @@ } } mutex_unlock(&clnt_fd_lock); + thr_sigsetmask(SIG_SETMASK, &(mask), NULL); if (!__rpc_fd2sockinfo(fd, &si)) goto err; - thr_sigsetmask(SIG_SETMASK, &(mask), NULL); ct->ct_closeit = FALSE; ==== //depot/projects/arm/src/lib/libc/rpc/getnetconfig.c#2 (text+ko) ==== @@ -34,7 +34,7 @@ static char sccsid[] = "@(#)getnetconfig.c 1.12 91/12/19 SMI"; #endif #include -__FBSDID("$FreeBSD: src/lib/libc/rpc/getnetconfig.c,v 1.11 2004/10/16 06:11:34 obrien Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/rpc/getnetconfig.c,v 1.12 2006/09/09 22:21:15 mbr Exp $"); /* * Copyright (c) 1989 by Sun Microsystems, Inc. @@ -692,6 +692,7 @@ p->nc_lookups = (char **)malloc((size_t)(p->nc_nlookups+1) * sizeof(char *)); if (p->nc_lookups == NULL) { free(p->nc_netid); + free(p); return(NULL); } for (i=0; i < p->nc_nlookups; i++) { ==== //depot/projects/arm/src/lib/libc/rpc/getnetpath.c#2 (text+ko) ==== @@ -34,7 +34,7 @@ static char sccsid[] = "@(#)getnetpath.c 1.11 91/12/19 SMI"; #endif #include -__FBSDID("$FreeBSD: src/lib/libc/rpc/getnetpath.c,v 1.5 2004/10/16 06:11:34 obrien Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/rpc/getnetpath.c,v 1.6 2006/09/09 22:22:39 mbr Exp $"); /* * Copyright (c) 1989 by Sun Microsystems, Inc. @@ -100,6 +100,7 @@ return (NULL); } if ((np_sessionp->nc_handlep = setnetconfig()) == NULL) { + free(np_sessionp); syslog (LOG_ERR, "rpc: failed to open " NETCONFIG); return (NULL); } ==== //depot/projects/arm/src/lib/libc/rpc/rpcb_clnt.c#2 (text+ko) ==== @@ -56,7 +56,7 @@ static char sccsid[] = "@(#)rpcb_clnt.c 1.30 89/06/21 Copyr 1988 Sun Micro"; #endif #include -__FBSDID("$FreeBSD: src/lib/libc/rpc/rpcb_clnt.c,v 1.15 2006/02/27 22:10:59 deischen Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/rpc/rpcb_clnt.c,v 1.16 2006/09/09 22:26:47 mbr Exp $"); /* * rpcb_clnt.c @@ -239,11 +239,21 @@ ad_cache->ac_taddr = (struct netbuf *)malloc(sizeof (struct netbuf)); if (!ad_cache->ac_host || !ad_cache->ac_netid || !ad_cache->ac_taddr || (uaddr && !ad_cache->ac_uaddr)) { - return; + goto out; } ad_cache->ac_taddr->len = ad_cache->ac_taddr->maxlen = taddr->len; ad_cache->ac_taddr->buf = (char *) malloc(taddr->len); if (ad_cache->ac_taddr->buf == NULL) { +out: + if (ad_cache->ac_host) + free(ad_cache->ac_host); + if (ad_cache->ac_netid) + free(ad_cache->ac_netid); + if (ad_cache->ac_uaddr) + free(ad_cache->ac_uaddr); + if (ad_cache->ac_taddr) + free(ad_cache->ac_taddr); + free(ad_cache); return; } memcpy(ad_cache->ac_taddr->buf, taddr->buf, taddr->len); @@ -1012,11 +1022,6 @@ } } - if ((address == NULL) || (address->len == 0)) { - rpc_createerr.cf_stat = RPC_PROGNOTREGISTERED; - clnt_geterr(client, &rpc_createerr.cf_error); - } - error: if (client) { CLNT_DESTROY(client); ==== //depot/projects/arm/src/lib/libc/rpc/rpcb_prot.c#2 (text+ko) ==== @@ -38,7 +38,7 @@ static char sccsid[] = "@(#)rpcb_prot.c 1.9 89/04/21 Copyr 1984 Sun Micro"; #endif #include -__FBSDID("$FreeBSD: src/lib/libc/rpc/rpcb_prot.c,v 1.5 2004/10/16 06:11:35 obrien Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/rpc/rpcb_prot.c,v 1.6 2006/09/09 22:29:16 mbr Exp $"); /* * rpcb_prot.c @@ -129,7 +129,7 @@ * the case of freeing we must remember the next object * before we free the current object ... */ - if (freeing) + if (freeing && *rp) next = (*rp)->rpcb_next; if (! xdr_reference(xdrs, (caddr_t *)rp, (u_int)sizeof (rpcblist), (xdrproc_t)xdr_rpcb)) { @@ -143,7 +143,7 @@ * gets nulled out by the xdr_reference * but next itself survives. */ - } else { + } else if (*rp) { rp = &((*rp)->rpcb_next); } } @@ -225,7 +225,7 @@ (xdrproc_t)xdr_rpcb_entry)) { return (FALSE); } - if (freeing) { + if (freeing && *rp) { next_copy = next; rp = &next_copy; /* @@ -233,7 +233,7 @@ * gets nulled out by the xdr_reference * but next itself survives. */ - } else { + } else if (*rp) { rp = &((*rp)->rpcb_entry_next); } } ==== //depot/projects/arm/src/lib/libc/rpc/svc_simple.c#2 (text+ko) ==== @@ -34,7 +34,7 @@ /* #pragma ident "@(#)svc_simple.c 1.18 94/04/24 SMI" */ #include -__FBSDID("$FreeBSD: src/lib/libc/rpc/svc_simple.c,v 1.15 2006/02/27 22:10:59 deischen Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/rpc/svc_simple.c,v 1.16 2006/09/09 22:32:07 mbr Exp $"); /* * svc_simple.c @@ -165,6 +165,10 @@ if (((xdrbuf = malloc((unsigned)recvsz)) == NULL) || ((netid = strdup(nconf->nc_netid)) == NULL)) { warnx(rpc_reg_err, rpc_reg_msg, __no_mem_str); + if (xdrbuf != NULL) + free(xdrbuf); + if (netid != NULL) + free(netid); SVC_DESTROY(svcxprt); break; } ==== //depot/projects/arm/src/lib/libc/rpc/svc_vc.c#2 (text+ko) ==== @@ -34,7 +34,7 @@ static char *sccsid = "@(#)svc_tcp.c 2.2 88/08/01 4.0 RPCSRC"; #endif #include -__FBSDID("$FreeBSD: src/lib/libc/rpc/svc_vc.c,v 1.25 2006/02/27 22:10:59 deischen Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/rpc/svc_vc.c,v 1.26 2006/09/09 22:33:21 mbr Exp $"); /* * svc_vc.c, Server side for Connection Oriented based RPC. @@ -135,13 +135,14 @@ struct sockaddr_storage sslocal; socklen_t slen; + if (!__rpc_fd2sockinfo(fd, &si)) + return NULL; + r = mem_alloc(sizeof(*r)); if (r == NULL) { warnx("svc_vc_create: out of memory"); goto cleanup_svc_vc_create; } - if (!__rpc_fd2sockinfo(fd, &si)) - return NULL; r->sendsize = __rpc_get_t_size(si.si_af, si.si_proto, (int)sendsize); r->recvsize = __rpc_get_t_size(si.si_af, si.si_proto, (int)recvsize); r->maxrec = __svc_maxrec; @@ -177,6 +178,8 @@ xprt_register(xprt); return (xprt); cleanup_svc_vc_create: + if (xprt) + mem_free(xprt, sizeof(*xprt)); if (r != NULL) mem_free(r, sizeof(*r)); return (NULL); ==== //depot/projects/arm/src/lib/libc/sys/recv.2#2 (text+ko) ==== @@ -30,9 +30,9 @@ .\" SUCH DAMAGE. .\" .\" @(#)recv.2 8.3 (Berkeley) 2/21/94 -.\" $FreeBSD: src/lib/libc/sys/recv.2,v 1.30 2006/03/05 10:32:15 brueffer Exp $ +.\" $FreeBSD: src/lib/libc/sys/recv.2,v 1.31 2006/09/10 20:41:33 brian Exp $ .\" -.Dd February 16, 2006 +.Dd September 10, 2006 .Dt RECV 2 .Os .Sh NAME @@ -117,7 +117,7 @@ .Pp The .Xr select 2 -system call may be used to determine when more data arrive. +system call may be used to determine when more data arrives. .Pp The .Fa flags ==== //depot/projects/arm/src/release/Makefile#4 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/release/Makefile,v 1.913 2006/09/08 19:54:36 ru Exp $ +# $FreeBSD: src/release/Makefile,v 1.914 2006/09/11 13:15:09 ru Exp $ # # make release [BUILDNAME=somename] CHROOTDIR=/some/dir CVSROOT=/cvs/dir \ # [RELEASETAG=tag] @@ -587,7 +587,7 @@ # Install the system into the various distributions. release.2: - cd ${.CURDIR}/../etc && make distrib-dirs DESTDIR=${RD}/trees/base + cd ${.CURDIR}/.. && ${CROSSMAKE} distrib-dirs DESTDIR=${RD}/trees/base cd ${.CURDIR}/.. && ${CROSSMAKE} ${WORLD_FLAGS} distributeworld \ DISTDIR=${RD}/trees touch ${.TARGET} @@ -611,7 +611,8 @@ .if exists(${.CURDIR}/${TARGET}/${j}_crunch.conf) rm -rf ${j}_crunch mkdir ${j}_crunch - cd ${j}_crunch; ${WMAKEENV} crunchgen -o \ + cd ${j}_crunch; ${WMAKEENV} MAKEFLAGS="-m ${.CURDIR}/../share/mk" \ + crunchgen -o \ ${.CURDIR}/${TARGET}/${j}_crunch.conf cd ${j}_crunch; ${WMAKE} -f ${j}_crunch.mk subclean cd ${.CURDIR}/..; ${BINMAKE} -f Makefile.inc1 _build-tools ==== //depot/projects/arm/src/release/scripts/package-split.py#2 (text+ko) ==== @@ -7,7 +7,7 @@ # # Usage: package-split.py # -# $FreeBSD: src/release/scripts/package-split.py,v 1.11 2006/03/17 02:05:46 kensmith Exp $ +# $FreeBSD: src/release/scripts/package-split.py,v 1.12 2006/09/09 07:25:40 kris Exp $ import os import sys @@ -60,7 +60,7 @@ 'emulators/mtools', 'graphics/png', 'graphics/xv', - 'irc/xchat2', + 'irc/xchat', 'mail/exim', 'mail/fetchmail', 'mail/mutt', @@ -70,7 +70,7 @@ 'mail/postfix', 'net/cvsup-without-gui', 'net/rsync', - 'net/samba', + 'net/samba3', 'news/slrn', 'news/tin', 'print/a2ps-letter', ==== //depot/projects/arm/src/sbin/ipf/ipf/Makefile#2 (text+ko) ==== @@ -1,15 +1,15 @@ -# $FreeBSD: src/sbin/ipf/ipf/Makefile,v 1.5 2006/05/07 00:40:00 obrien Exp $ +# $FreeBSD: src/sbin/ipf/ipf/Makefile,v 1.6 2006/09/10 08:58:46 obrien Exp $ PROG= ipf -SRCS= ipf.c ipfcomp.c ipf_y.c ipf_l.c bpf_filter.c +SRCS= ${GENHDRS} ipf.c ipfcomp.c ipf_y.c ipf_l.c bpf_filter.c MAN= ipf.8 ipf.4 ipf.5 ipl.4 MLINKS= ipl.4 ipfilter.4 ipf.5 ipf.conf.5 ipf.5 ipf6.conf.5 CFLAGS+= -I. -DIPFILTER_BPF -DPSRCS+= ipf_l.h ipf_y.h +GENHDRS= ipf_l.h ipf_y.h +DPSRCS+= ${GENHDRS} -CLEANFILES+= ipf_y.c ipf_y.h -CLEANFILES+= ipf_l.c ipf_l.h +CLEANFILES+= ${GENHDRS} ipf_y.c ipf_l.c ipf_y.c: ipf_y.y ${YACC} -d ${.ALLSRC} ==== //depot/projects/arm/src/sbin/ipf/ipftest/Makefile#2 (text+ko) ==== @@ -1,7 +1,7 @@ -# $FreeBSD: src/sbin/ipf/ipftest/Makefile,v 1.3 2005/04/28 16:26:34 darrenr Exp $ +# $FreeBSD: src/sbin/ipf/ipftest/Makefile,v 1.4 2006/09/10 08:58:46 obrien Exp $ PROG= ipftest -SRCS= ipftest.c fil.c ip_frag.c ip_state.c ip_nat.c \ +SRCS= ${GENHDRS} ipftest.c fil.c ip_frag.c ip_state.c ip_nat.c \ ip_proxy.c ip_auth.c ip_htable.c ip_lookup.c \ ip_pool.c ip_scan.c ip_sync.c ip_rules.c \ ip_fil.c ip_log.c ippool_y.c ippool_l.c ipf_y.c \ @@ -13,16 +13,15 @@ .PATH: ${.CURDIR}/../../../sys/contrib/ipfilter/netinet -DPSRCS+= ipnat_l.h ipnat_y.h ippool_l.h ippool_y.h ipf_l.h ipf_y.h +GENHDRS= ipnat_l.h ipnat_y.h ippool_l.h ippool_y.h ipf_l.h ipf_y.h +DPSRCS+= ${GENHDRS} -CLEANFILES+= ipf_y.c ipf_y.h -CLEANFILES+= ipf_l.c ipf_l.h +CLEANFILES+= ${GENHDRS} +CLEANFILES+= ipf_y.c ipf_l.c CLEANFILES+= ipf.tab.c ipf.tab.h -CLEANFILES+= ipnat_y.c ipnat_y.h -CLEANFILES+= ipnat_l.c ipnat_l.h +CLEANFILES+= ipnat_y.c ipnat_l.c CLEANFILES+= ipnat.tab.c ipnat.tab.h -CLEANFILES+= ippool_y.c ippool_y.h -CLEANFILES+= ippool_l.c ippool_l.h +CLEANFILES+= ippool_y.c ippool_l.c CLEANFILES+= ippool.tab.c ippool.tab.h ipnat_y.c: ipnat_y.y ==== //depot/projects/arm/src/sbin/ipf/ipmon/Makefile#2 (text+ko) ==== @@ -1,15 +1,15 @@ -# $FreeBSD: src/sbin/ipf/ipmon/Makefile,v 1.2 2005/04/28 16:26:34 darrenr Exp $ +# $FreeBSD: src/sbin/ipf/ipmon/Makefile,v 1.3 2006/09/10 08:58:47 obrien Exp $ PROG= ipmon -SRCS= ipmon.c ipmon_y.c ipmon_l.c +SRCS= ${GENHDRS} ipmon.c ipmon_y.c ipmon_l.c MAN= ipmon.8 CFLAGS+= -DLOGFAC=LOG_LOCAL0 -I. -DPSRCS+= ipmon_l.h ipmon_y.h +GENHDRS+= ipmon_l.h ipmon_y.h +DPSRCS+= ${GENHDRS} -CLEANFILES+= ipmon_y.c ipmon_y.h -CLEANFILES+= ipmon_l.c ipmon_l.h +CLEANFILES+= ${GENHDRS} ipmon_y.c ipmon_l.c ipmon_y.c: ipmon_y.y ${YACC} -d ${.ALLSRC} ==== //depot/projects/arm/src/sbin/ipf/ipnat/Makefile#2 (text+ko) ==== @@ -1,15 +1,15 @@ -# $FreeBSD: src/sbin/ipf/ipnat/Makefile,v 1.2 2005/04/28 16:26:34 darrenr Exp $ +# $FreeBSD: src/sbin/ipf/ipnat/Makefile,v 1.3 2006/09/10 08:58:47 obrien Exp $ PROG= ipnat -SRCS= ipnat.c ipnat_y.c ipnat_l.c +SRCS= ${GENHDRS} ipnat.c ipnat_y.c ipnat_l.c MAN= ipnat.8 ipnat.4 ipnat.5 MLINKS= ipnat.5 ipnat.conf.5 CFLAGS+= -I. -DPSRCS+= ipnat_l.h ipnat_y.h +GENHDRS= ipnat_l.h ipnat_y.h +DPSRCS+= ${GENHDRS} -CLEANFILES+= ipnat_y.c ipnat_y.h -CLEANFILES+= ipnat_l.c ipnat_l.h +CLEANFILES+= ${GENHDRS} ipnat_y.c ipnat_l.c ipnat_y.c: ipnat_y.y ${YACC} -d ${.ALLSRC} ==== //depot/projects/arm/src/sbin/ipf/ippool/Makefile#2 (text+ko) ==== @@ -1,14 +1,14 @@ -# $FreeBSD: src/sbin/ipf/ippool/Makefile,v 1.2 2005/04/28 16:26:34 darrenr Exp $ +# $FreeBSD: src/sbin/ipf/ippool/Makefile,v 1.3 2006/09/10 08:58:47 obrien Exp $ PROG= ippool -SRCS= ippool_y.c ippool_l.c kmem.c ippool.c +SRCS= ${GENHDRS} ippool_y.c ippool_l.c kmem.c ippool.c MAN= ippool.5 ippool.8 CFLAGS+= -I. -DPSRCS+= ippool_l.h ippool_y.h +GENHDRS= ippool_l.h ippool_y.h +DPSRCS+= ${GENHDRS} -CLEANFILES+= ippool_y.c ippool_y.h -CLEANFILES+= ippool_l.c ippool_l.h +CLEANFILES+= ${GENHDRS} ippool_y.c ippool_l.c ippool_y.c: ippool_y.y ${YACC} -d ${.ALLSRC} ==== //depot/projects/arm/src/share/man/man5/src.conf.5#3 (text) ==== @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. -.\" from FreeBSD: src/tools/build/options/makeman,v 1.5 2006/07/31 12:41:13 yar Exp -.\" $FreeBSD: src/share/man/man5/src.conf.5,v 1.6 2006/07/31 14:13:25 yar Exp $ -.Dd July 31, 2006 +.\" from FreeBSD: src/tools/build/options/makeman,v 1.6 2006/09/11 13:39:44 ru Exp +.\" $FreeBSD: src/share/man/man5/src.conf.5,v 1.7 2006/09/11 13:56:28 ru Exp $ +.Dd September 11, 2006 .Dt SRC.CONF 5 .Os .Sh NAME @@ -83,6 +83,11 @@ .Xr acpiconf 8 , .Xr acpidump 8 and related programs. +.It Va WITHOUT_ASSERT_DEBUG +.\" from FreeBSD: src/tools/build/options/WITHOUT_ASSERT_DEBUG,v 1.1 2006/09/11 13:55:27 ru Exp +Set to compile programs and libraries without the +.Xr assert 3 +checks. .It Va WITHOUT_ATM .\" from FreeBSD: src/tools/build/options/WITHOUT_ATM,v 1.1 2006/03/21 07:50:49 ru Exp Set to not build ==== //depot/projects/arm/src/share/mk/bsd.lib.mk#3 (text+ko) ==== @@ -1,5 +1,5 @@ # from: @(#)bsd.lib.mk 5.26 (Berkeley) 5/2/91 -# $FreeBSD: src/share/mk/bsd.lib.mk,v 1.176 2006/08/25 23:50:05 imp Exp $ +# $FreeBSD: src/share/mk/bsd.lib.mk,v 1.177 2006/09/11 05:35:56 imp Exp $ # .include @@ -28,6 +28,10 @@ CFLAGS+= ${CRUNCH_CFLAGS} .endif +.if ${MK_ASSERT_DEBUG} == "no" +CFLAGS+= -DNDEBUG +.endif + .if defined(DEBUG_FLAGS) CFLAGS+= ${DEBUG_FLAGS} .endif ==== //depot/projects/arm/src/share/mk/bsd.own.mk#3 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/share/mk/bsd.own.mk,v 1.55 2006/05/17 09:33:07 phk Exp $ +# $FreeBSD: src/share/mk/bsd.own.mk,v 1.56 2006/09/11 05:35:57 imp Exp $ # # The include file set common variables for owner, # group, mode, and directories. Defaults are in brackets. @@ -282,6 +282,7 @@ # .for var in \ ACPI \ + ASSERT_DEBUG \ ATM \ AUDIT \ AUTHPF \ ==== //depot/projects/arm/src/share/mk/bsd.prog.mk#2 (text+ko) ==== @@ -1,5 +1,5 @@ # from: @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91 -# $FreeBSD: src/share/mk/bsd.prog.mk,v 1.147 2006/03/17 18:54:34 ru Exp $ +# $FreeBSD: src/share/mk/bsd.prog.mk,v 1.148 2006/09/11 05:35:57 imp Exp $ .include @@ -10,6 +10,10 @@ CFLAGS+=${COPTS} .endif +.if ${MK_ASSERT_DEBUG} == "no" +CFLAGS+= -DNDEBUG +.endif + .if defined(DEBUG_FLAGS) CFLAGS+=${DEBUG_FLAGS} .endif ==== //depot/projects/arm/src/sys/amd64/linux32/linux32_sysvec.c#10 (text+ko) ==== @@ -31,7 +31,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_sysvec.c,v 1.23 2006/08/17 21:06:48 netchild Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_sysvec.c,v 1.24 2006/09/09 16:25:25 netchild Exp $"); #include "opt_compat.h" #ifndef COMPAT_IA32 @@ -124,7 +124,7 @@ static void linux32_fixlimits(struct proc *p); extern LIST_HEAD(futex_list, futex) futex_list; -extern struct mtx futex_mtx; +extern struct sx futex_sx; static eventhandler_tag linux_exit_tag; static eventhandler_tag linux_schedtail_tag; @@ -1080,7 +1080,7 @@ sx_init(&emul_lock, "emuldata lock"); sx_init(&emul_shared_lock, "emuldata->shared lock"); LIST_INIT(&futex_list); - mtx_init(&futex_mtx, "futex protection lock", NULL, MTX_DEF); + sx_init(&futex_sx, "futex protection lock"); linux_exit_tag = EVENTHANDLER_REGISTER(process_exit, linux_proc_exit, NULL, 1000); linux_schedtail_tag = EVENTHANDLER_REGISTER(schedtail, linux_schedtail, @@ -1110,7 +1110,7 @@ linux_device_unregister_handler(*ldhp); sx_destroy(&emul_lock); sx_destroy(&emul_shared_lock); - mtx_destroy(&futex_mtx); + sx_destroy(&futex_sx); EVENTHANDLER_DEREGISTER(process_exit, linux_exit_tag); EVENTHANDLER_DEREGISTER(schedtail, linux_schedtail_tag); EVENTHANDLER_DEREGISTER(process_exec, linux_exec_tag); ==== //depot/projects/arm/src/sys/compat/linux/linux_emul.c#4 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/compat/linux/linux_emul.c,v 1.5 2006/08/28 13:52:27 ssouhlal Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linux/linux_emul.c,v 1.6 2006/09/09 16:55:55 netchild Exp $"); #include "opt_compat.h" @@ -101,6 +101,7 @@ panic("process not found in proc_init\n"); p->p_emuldata = em; PROC_UNLOCK(p); + EMUL_LOCK(&emul_lock); } else { /* lookup the old one */ em = em_find(td->td_proc, EMUL_UNLOCKED); @@ -129,14 +130,15 @@ if (child != 0) { + EMUL_UNLOCK(&emul_lock); EMUL_SHARED_WLOCK(&emul_shared_lock); LIST_INSERT_HEAD(&em->shared->threads, em, threads); EMUL_SHARED_WUNLOCK(&emul_shared_lock); p = pfind(child); - PROC_UNLOCK(p); /* we might have a sleeping linux_schedtail */ wakeup(&p->p_emuldata); + PROC_UNLOCK(p); } else EMUL_UNLOCK(&emul_lock); ==== //depot/projects/arm/src/sys/compat/linux/linux_file.c#6 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/compat/linux/linux_file.c,v 1.96 2006/07/11 20:52:07 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linux/linux_file.c,v 1.97 2006/09/10 13:47:56 netchild Exp $"); #include "opt_compat.h" #include "opt_mac.h" @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -495,6 +496,7 @@ { char *path; int error; + struct stat st; LCONVPATHEXIST(td, args->path, &path); @@ -504,6 +506,11 @@ #endif error = kern_unlink(td, path, UIO_SYSSPACE); + if (error == EPERM) + /* Introduce POSIX noncompliant behaviour of Linux */ + if (kern_stat(td, path, UIO_SYSSPACE, &st) == 0) + if (S_ISDIR(st.st_mode)) + error = EISDIR; LFREEPATH(path); return (error); } ==== //depot/projects/arm/src/sys/compat/linux/linux_futex.c#4 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/compat/linux/linux_futex.c,v 1.4 2006/08/26 10:36:16 netchild Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linux/linux_futex.c,v 1.6 2006/09/09 16:25:25 netchild Exp $"); #if 0 __KERNEL_RCSID(1, "$NetBSD: linux_futex.c,v 1.5 2005/11/23 16:14:57 manu Exp $"); #endif @@ -47,6 +47,7 @@ #include #include #include +#include #include #ifdef COMPAT_LINUX32 @@ -73,10 +74,10 @@ }; LIST_HEAD(futex_list, futex) futex_list; -struct mtx futex_mtx; /* this protects the LIST of futexes */ +struct sx futex_sx; /* this protects the LIST of futexes */ -#define FUTEX_LOCK mtx_lock(&futex_mtx) -#define FUTEX_UNLOCK mtx_unlock(&futex_mtx) +#define FUTEX_LOCK sx_xlock(&futex_sx) +#define FUTEX_UNLOCK sx_xunlock(&futex_sx) #define FUTEX_LOCKED 1 #define FUTEX_UNLOCKED 0 @@ -302,9 +303,6 @@ ret = futex_wake(f, args->val, NULL); futex_put(f); if (op_ret > 0) { -#ifdef DEBUG - printf("second wakeup\n"); -#endif op_ret = 0; /* * Linux uses the address of the timespec parameter @@ -346,16 +344,11 @@ return f; } } - if (locked == FUTEX_UNLOCKED) - FUTEX_UNLOCK; - /* Not found, create it */ f = malloc(sizeof(*f), M_LINUX, M_WAITOK); f->f_uaddr = uaddr; f->f_refcount = 1; TAILQ_INIT(&f->f_waiting_proc); - if (locked == FUTEX_UNLOCKED) - FUTEX_LOCK; LIST_INSERT_HEAD(&futex_list, f, f_list); if (locked == FUTEX_UNLOCKED) FUTEX_UNLOCK; @@ -421,13 +414,13 @@ FUTEX_LOCK; TAILQ_FOREACH(wp, &f->f_waiting_proc, wp_list) { if (count <= n) { - wakeup(wp); + wakeup_one(wp); count++; } else { if (newf != NULL) { /* futex_put called after tsleep */ wp->wp_new_futex = futex_get(newf->f_uaddr, FUTEX_LOCKED); - wakeup(wp); + wakeup_one(wp); } } } ==== //depot/projects/arm/src/sys/dev/em/if_em.c#28 (text+ko) ==== @@ -31,7 +31,7 @@ ***************************************************************************/ -/*$FreeBSD: src/sys/dev/em/if_em.c,v 1.139 2006/09/03 00:27:41 jmg Exp $*/ +/*$FreeBSD: src/sys/dev/em/if_em.c,v 1.143 2006/09/10 19:23:27 pdeuskar Exp $*/ #ifdef HAVE_KERNEL_OPTION_HEADERS #include "opt_device_polling.h" @@ -72,6 +72,7 @@ #include #include +#include #include #include #include @@ -86,7 +87,7 @@ * Driver version *********************************************************************/ -char em_driver_version[] = "Version - 6.1.4"; +char em_driver_version[] = "Version - 6.1.4 - TSO"; /********************************************************************* @@ -231,6 +232,8 @@ struct mbuf *); static void em_transmit_checksum_setup(struct adapter *, struct mbuf *, uint32_t *, uint32_t *); +static boolean_t em_tso_setup(struct adapter *, struct mbuf *, + uint32_t *, uint32_t *); static void em_set_promisc(struct adapter *); static void em_disable_promisc(struct adapter *); static void em_set_multi(struct adapter *); @@ -304,6 +307,7 @@ #define E1000_TICKS_TO_USECS(ticks) ((1024 * (ticks) + 500) / 1000) #define E1000_USECS_TO_TICKS(usecs) ((1000 * (usecs) + 512) / 1024) +#define M_TSO_LEN 66 static int em_tx_int_delay_dflt = E1000_TICKS_TO_USECS(EM_TIDV); static int em_rx_int_delay_dflt = E1000_TICKS_TO_USECS(EM_RDTR); @@ -907,6 +911,10 @@ ifp->if_capenable ^= IFCAP_HWCSUM; reinit = 1; } + if (mask & IFCAP_TSO) { + ifp->if_capenable ^= IFCAP_TSO; + reinit = 1; + } if (mask & IFCAP_VLAN_HWTAGGING) { ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; reinit = 1; @@ -1075,11 +1083,12 @@ ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + ifp->if_hwassist = 0; if (adapter->hw.mac_type >= em_82543) { if (ifp->if_capenable & IFCAP_TXCSUM) ifp->if_hwassist = EM_CHECKSUM_FEATURES; - else - ifp->if_hwassist = 0; + if (ifp->if_capenable & IFCAP_TSO) + ifp->if_hwassist |= EM_TCPSEG_FEATURES; } callout_reset(&adapter->timer, hz, em_local_timer, adapter); @@ -1441,11 +1450,13 @@ struct m_tag *mtag; uint32_t txd_upper, txd_lower, txd_used, txd_saved; int nsegs, i, j; - int error; + int error, do_tso, tso_desc = 0; m_head = *m_headp; current_tx_desc = NULL; - txd_used = txd_saved = 0; + txd_upper = txd_lower = txd_used = txd_saved = 0; + + do_tso = ((m_head->m_pkthdr.csum_flags & CSUM_TSO) != 0); /* * Force a cleanup if number of TX descriptors @@ -1499,6 +1510,17 @@ } /* + * TSO workaround: + * If an mbuf is only header we need + * to pull 4 bytes of data into it. + */ + if (do_tso && (m_head->m_len <= M_TSO_LEN)) { + m_head = m_pullup(m_head, M_TSO_LEN + 4); + if (m_head == NULL) + return (ENOBUFS); + } + + /* * Map the packet for DMA. */ tx_buffer = &adapter->tx_buffer_area[adapter->next_avail_tx_desc]; @@ -1536,24 +1558,42 @@ return (EIO); } - if (nsegs > adapter->num_tx_desc_avail) { + /* + * TSO Hardware workaround, if this packet is not + * TSO, and is only a single descriptor long, and + * it follows a TSO burst, then we need to add a + * sentinel descriptor to prevent premature writeback. + */ + if ((do_tso == 0) && (adapter->tx_tso == TRUE)) { + if (nsegs == 1) + tso_desc = TRUE; + adapter->tx_tso = FALSE; + } + + if (nsegs > adapter->num_tx_desc_avail - 2) { adapter->no_tx_desc_avail2++; bus_dmamap_unload(adapter->txtag, map); return (ENOBUFS); } + /* Do hardware assists */ m_head = *m_headp; - if (ifp->if_hwassist > 0) - em_transmit_checksum_setup(adapter, m_head, &txd_upper, &txd_lower); - else - txd_upper = txd_lower = 0; + if ( ifp->if_hwassist > 0) { + if (em_tso_setup(adapter, m_head, &txd_upper, &txd_lower)) { + /* we need to make a final sentinel transmit desc */ + tso_desc = TRUE; + } else >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Mon Sep 11 17:35:45 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B7B4B16A534; Mon, 11 Sep 2006 17:35:45 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6C28416A416; Mon, 11 Sep 2006 17:35:45 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from www.ebusiness-leidinger.de (jojo.ms-net.de [84.16.236.246]) by mx1.FreeBSD.org (Postfix) with ESMTP id A40C043D53; Mon, 11 Sep 2006 17:35:44 +0000 (GMT) (envelope-from netchild@FreeBSD.org) Received: from Andro-Beta.Leidinger.net (p54A5E294.dip.t-dialin.net [84.165.226.148]) (authenticated bits=0) by www.ebusiness-leidinger.de (8.13.6/8.13.6) with ESMTP id k8BHE2rC087811; Mon, 11 Sep 2006 19:14:03 +0200 (CEST) (envelope-from netchild@FreeBSD.org) Received: from Magellan.Leidinger.net (Magellan.Leidinger.net [192.168.1.1]) by Andro-Beta.Leidinger.net (8.13.4/8.13.3) with ESMTP id k8BHZdja087971; Mon, 11 Sep 2006 19:35:39 +0200 (CEST) (envelope-from netchild@FreeBSD.org) Date: Mon, 11 Sep 2006 19:36:00 +0200 From: Alexander Leidinger To: John Baldwin Message-ID: <20060911193600.7ab43fb6@Magellan.Leidinger.net> In-Reply-To: <200609111145.52446.jhb@freebsd.org> References: <200609100956.k8A9uD0P094639@repoman.freebsd.org> <200609111145.52446.jhb@freebsd.org> Organization: FreeBSD X-Mailer: Sylpheed-Claws 2.4.0 (GTK+ 2.8.20; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new Cc: Perforce Change Reviews , mag@intron.ac Subject: Re: PERFORCE change 105930 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Sep 2006 17:35:46 -0000 Quoting John Baldwin (Mon, 11 Sep 2006 11:45:52 -0400): > On Sunday 10 September 2006 05:56, Alexander Leidinger wrote: > > PROBLEMS: > > > > 1. Why does uma_zdestroy(9) print message like: > > > > Freed UMA keg was not empty (100 items). Lost 2 pages of memory. > > > > Does it represent any problems? > > It means a memory leak. Because this is verbatim from the submitter and I don't know if he is subscribed to perforce@, we should tell him about it... CCed. :-) Bye, Alexander. -- ...and that is how we know the Earth to be banana-shaped. http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137 From owner-p4-projects@FreeBSD.ORG Mon Sep 11 18:00:28 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E478616A415; Mon, 11 Sep 2006 18:00:27 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A5FB616A40F for ; Mon, 11 Sep 2006 18:00:27 +0000 (UTC) (envelope-from mjacob@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 11FAE43D5C for ; Mon, 11 Sep 2006 18:00:27 +0000 (GMT) (envelope-from mjacob@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8BI0RIw072455 for ; Mon, 11 Sep 2006 18:00:27 GMT (envelope-from mjacob@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8BI0OO0072452 for perforce@freebsd.org; Mon, 11 Sep 2006 18:00:24 GMT (envelope-from mjacob@freebsd.org) Date: Mon, 11 Sep 2006 18:00:24 GMT Message-Id: <200609111800.k8BI0OO0072452@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to mjacob@freebsd.org using -f From: Matt Jacob To: Perforce Change Reviews Cc: Subject: PERFORCE change 105969 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Sep 2006 18:00:28 -0000 http://perforce.freebsd.org/chv.cgi?CH=105969 Change 105969 by mjacob@newisp on 2006/09/11 17:59:29 Switch to using 2K Login f/w for the 2300 now that we have better support for 2K logins. Affected files ... .. //depot/projects/newisp/dev/ispfw/asm_2300.h#2 edit Differences ... ==== //depot/projects/newisp/dev/ispfw/asm_2300.h#2 (text+ko) ==== @@ -27,18 +27,19 @@ /************************************************************************ * * - * --- ISP2300 Initiator/Target Firmware --- * - * with Fabric support (Public Loop) and * - * with expanded LUN addressing. * + * --- ISP2300 Initiator/Target Firmware --- * + * with Fabric support (Public Loop), with expanded LUN * + * addressing and 2K port logins. * * * - * * - ************************************************************************/ + ************************************************************************ + */ /* - * Firmware Version 3.03.19 (09:40 Nov 30, 2005) + * Firmware Version 3.03.19 (09:41 Nov 30, 2005) */ + static const u_int16_t isp_2300_risc_code[] = { - 0x0470, 0x0000, 0x0000, 0xc646, 0x0000, 0x0003, 0x0003, 0x0013, - 0x0007, 0x2043, 0x4f50, 0x5952, 0x4947, 0x4854, 0x2032, 0x3030, + 0x0470, 0x0000, 0x0000, 0xcd3b, 0x0000, 0x0003, 0x0003, 0x0013, + 0x0107, 0x2043, 0x4f50, 0x5952, 0x4947, 0x4854, 0x2032, 0x3030, 0x3120, 0x514c, 0x4f47, 0x4943, 0x2043, 0x4f52, 0x504f, 0x5241, 0x5449, 0x4f4e, 0x2049, 0x5350, 0x3233, 0x3030, 0x2046, 0x6972, 0x6d77, 0x6172, 0x6520, 0x2056, 0x6572, 0x7369, 0x6f6e, 0x2030, @@ -50,381 +51,411 @@ 0x2091, 0x2a00, 0x20a9, 0x000f, 0x2001, 0x0000, 0x400f, 0x2091, 0x2c00, 0x20a9, 0x000f, 0x2001, 0x0000, 0x400f, 0x2091, 0x2e00, 0x20a9, 0x000f, 0x2001, 0x0000, 0x400f, 0x2091, 0x2000, 0x2001, - 0x0000, 0x20c1, 0x0004, 0x20c9, 0x14ff, 0x2059, 0x0000, 0x2b78, - 0x7883, 0x0004, 0x2089, 0x2702, 0x2051, 0x1100, 0x2a70, 0x20e1, - 0x0001, 0x20e9, 0x0001, 0x2009, 0x0000, 0x080c, 0x0e57, 0x2029, - 0x2e00, 0x2031, 0xffff, 0x2039, 0x2dc8, 0x2021, 0x0200, 0x20e9, + 0x0000, 0x20c1, 0x0004, 0x20c9, 0x1bff, 0x2059, 0x0000, 0x2b78, + 0x7883, 0x0004, 0x2089, 0x2b8d, 0x2051, 0x1800, 0x2a70, 0x20e1, + 0x0001, 0x20e9, 0x0001, 0x2009, 0x0000, 0x080c, 0x0e5f, 0x2029, + 0x3500, 0x2031, 0xffff, 0x2039, 0x34c8, 0x2021, 0x0200, 0x20e9, 0x0001, 0x20a1, 0x0000, 0x20a9, 0x0800, 0x900e, 0x4104, 0x20e9, - 0x0001, 0x20a1, 0x1000, 0x900e, 0x2001, 0x05c0, 0x9084, 0x0fff, + 0x0001, 0x20a1, 0x1000, 0x900e, 0x2001, 0x0cc0, 0x9084, 0x0fff, 0x20a8, 0x4104, 0x2001, 0x0000, 0x9086, 0x0000, 0x0120, 0x21a8, 0x4104, 0x8001, 0x1de0, 0x756a, 0x766e, 0x7766, 0x7472, 0x7476, - 0x00e6, 0x2071, 0x13f9, 0x2472, 0x00ee, 0x20a1, 0x15c8, 0x716c, + 0x00e6, 0x2071, 0x1a9d, 0x2472, 0x00ee, 0x20a1, 0x1cc8, 0x716c, 0x810d, 0x810d, 0x810d, 0x810d, 0x918c, 0x000f, 0x2001, 0x0001, 0x9112, 0x900e, 0x21a8, 0x4104, 0x8211, 0x1de0, 0x716c, 0x3400, 0x8001, 0x9102, 0x0120, 0x0218, 0x20a8, 0x900e, 0x4104, 0x2009, - 0x1100, 0x810d, 0x810d, 0x810d, 0x810d, 0x810d, 0x918c, 0x001f, + 0x1800, 0x810d, 0x810d, 0x810d, 0x810d, 0x810d, 0x918c, 0x001f, 0x2001, 0x0001, 0x9112, 0x20e9, 0x0001, 0x20a1, 0x0800, 0x900e, - 0x20a9, 0x0800, 0x4104, 0x8211, 0x1dd8, 0x080c, 0x57ad, 0x080c, - 0x9610, 0x080c, 0x0ff6, 0x080c, 0x11d9, 0x080c, 0x186d, 0x080c, - 0x0d5d, 0x080c, 0x0f67, 0x080c, 0x2d98, 0x080c, 0x6e26, 0x080c, - 0x6051, 0x080c, 0x7a42, 0x080c, 0x1edd, 0x080c, 0x7d1c, 0x080c, - 0x7471, 0x080c, 0x1d12, 0x080c, 0x1e46, 0x080c, 0x1ed2, 0x2091, - 0x3009, 0x7883, 0x0000, 0x1004, 0x091b, 0x7880, 0x9086, 0x0002, - 0x1190, 0x7883, 0x4000, 0x7837, 0x4000, 0x7833, 0x0010, 0x0e04, - 0x090f, 0x2091, 0x5000, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, - 0xd084, 0x190c, 0x10c4, 0x2a70, 0x7003, 0x0000, 0x2a70, 0x7000, - 0x908e, 0x0003, 0x1168, 0x080c, 0x449a, 0x080c, 0x2daf, 0x080c, - 0x6e87, 0x080c, 0x6591, 0x080c, 0x7a6a, 0x080c, 0x264c, 0x0c70, - 0x000b, 0x0c88, 0x093c, 0x093d, 0x0add, 0x093a, 0x0ba2, 0x0d5c, - 0x0d5c, 0x0d5c, 0x080c, 0x0dc9, 0x0005, 0x0126, 0x00f6, 0x2091, - 0x8000, 0x7000, 0x9086, 0x0001, 0x1904, 0x0ab2, 0x080c, 0x4e65, - 0x1130, 0x0026, 0x2011, 0x0080, 0x080c, 0x0ee5, 0x002e, 0x080c, - 0x6b1f, 0x0150, 0x080c, 0x6b42, 0x15a0, 0x2079, 0x0100, 0x7828, - 0x9085, 0x1800, 0x782a, 0x0468, 0x080c, 0x6a4b, 0x7000, 0x9086, - 0x0001, 0x1904, 0x0ab2, 0x7094, 0x9086, 0x0029, 0x1904, 0x0ab2, - 0x080c, 0x7a2b, 0x080c, 0x7a1d, 0x2001, 0x0161, 0x2003, 0x0001, - 0x2079, 0x0100, 0x7827, 0xffff, 0x7a28, 0x9295, 0x5e2f, 0x7a2a, - 0x2011, 0x69af, 0x080c, 0x7b29, 0x2011, 0x69a2, 0x080c, 0x7bed, - 0x2011, 0x5608, 0x080c, 0x7b29, 0x2011, 0x8030, 0x901e, 0x7392, - 0x04d0, 0x080c, 0x4eb5, 0x2079, 0x0100, 0x7844, 0x9005, 0x1904, - 0x0ab2, 0x2011, 0x5608, 0x080c, 0x7b29, 0x2011, 0x69af, 0x080c, - 0x7b29, 0x2011, 0x69a2, 0x080c, 0x7bed, 0x2001, 0x0265, 0x2001, - 0x0205, 0x2003, 0x0000, 0x7840, 0x9084, 0xfffb, 0x7842, 0x2001, - 0x12dd, 0x2004, 0x9005, 0x1140, 0x00c6, 0x2061, 0x0100, 0x080c, - 0x5755, 0x00ce, 0x0804, 0x0ab2, 0x780f, 0x006b, 0x7a28, 0x080c, - 0x6b27, 0x0118, 0x9295, 0x5e2f, 0x0010, 0x9295, 0x402f, 0x7a2a, - 0x2011, 0x8010, 0x73d4, 0x2001, 0x12de, 0x2003, 0x0001, 0x080c, - 0x24f1, 0x080c, 0x441b, 0x7244, 0xc284, 0x7246, 0x2001, 0x110c, - 0x200c, 0xc1ac, 0xc1cc, 0x2102, 0x080c, 0x90ee, 0x2011, 0x0004, - 0x080c, 0xafb5, 0x080c, 0x5e85, 0x080c, 0x6b1f, 0x1120, 0x080c, - 0x2535, 0x02e0, 0x0400, 0x080c, 0x575c, 0x0140, 0x7093, 0x0001, - 0x70cf, 0x0000, 0x080c, 0x5082, 0x0804, 0x0ab2, 0x080c, 0x4e56, - 0xd094, 0x0188, 0x2011, 0x110c, 0x2204, 0xc0cd, 0x2012, 0x080c, - 0x4e5a, 0xd0d4, 0x1118, 0x080c, 0x2535, 0x1270, 0x2011, 0x110c, - 0x2204, 0xc0bc, 0x00a8, 0x080c, 0x4e5a, 0xd0d4, 0x1db8, 0x2011, - 0x110c, 0x2204, 0xc0bd, 0x0060, 0x2011, 0x110c, 0x2204, 0xc0bd, - 0x2012, 0x080c, 0x5f70, 0x1128, 0xd0a4, 0x0118, 0x2204, 0xc0fd, - 0x2012, 0x080c, 0x5f38, 0x0120, 0x7a0c, 0xc2b4, 0x7a0e, 0x00a8, - 0x707b, 0x0000, 0x080c, 0x6b1f, 0x1130, 0x70ac, 0x9005, 0x1168, - 0x080c, 0xb2e7, 0x0050, 0x080c, 0xb2e7, 0x70d8, 0xd09c, 0x1128, - 0x70ac, 0x9005, 0x0110, 0x080c, 0x5732, 0x70e3, 0x0000, 0x70df, - 0x0000, 0x70a3, 0x0000, 0x080c, 0x253d, 0x0228, 0x2011, 0x0101, - 0x2204, 0xc0c4, 0x2012, 0x72d8, 0x080c, 0x6b1f, 0x1178, 0x9016, - 0x0016, 0x080c, 0x22fa, 0x2019, 0x1293, 0x211a, 0x001e, 0x705b, - 0xffff, 0x705f, 0x00ef, 0x707f, 0x0000, 0x0020, 0x2019, 0x1293, - 0x201b, 0x0000, 0x2079, 0x115b, 0x7804, 0xd0ac, 0x0108, 0xc295, - 0x72da, 0x080c, 0x6b1f, 0x0118, 0x9296, 0x0004, 0x0548, 0x2011, - 0x0001, 0x080c, 0xafb5, 0x70a7, 0x0000, 0x70ab, 0xffff, 0x7003, - 0x0002, 0x2079, 0x0100, 0x7827, 0x0003, 0x7828, 0x9085, 0x0003, - 0x782a, 0x00fe, 0x080c, 0x296f, 0x2011, 0x0005, 0x080c, 0x91f9, - 0x080c, 0x83b3, 0x080c, 0x6b1f, 0x0148, 0x00c6, 0x2061, 0x0100, - 0x0016, 0x080c, 0x22fa, 0x61e2, 0x001e, 0x00ce, 0x012e, 0x0420, - 0x70a7, 0x0000, 0x70ab, 0xffff, 0x7003, 0x0002, 0x00f6, 0x2079, - 0x0100, 0x7827, 0x0003, 0x7828, 0x9085, 0x0003, 0x782a, 0x00fe, - 0x2011, 0x0005, 0x080c, 0x91f9, 0x080c, 0x83b3, 0x080c, 0x6b1f, - 0x0148, 0x00c6, 0x2061, 0x0100, 0x0016, 0x080c, 0x22fa, 0x61e2, - 0x001e, 0x00ce, 0x00fe, 0x012e, 0x0005, 0x00c6, 0x080c, 0x6b1f, - 0x1118, 0x20a9, 0x0100, 0x0010, 0x20a9, 0x0082, 0x080c, 0x6b1f, - 0x1110, 0x900e, 0x0010, 0x2009, 0x007e, 0x86ff, 0x0138, 0x9180, - 0x1000, 0x2004, 0x9065, 0x0110, 0x6000, 0xd0bc, 0x090c, 0x2c5a, - 0x8108, 0x1f04, 0x0ac5, 0x707b, 0x0000, 0x707c, 0x9084, 0x00ff, - 0x707e, 0x70af, 0x0000, 0x00ce, 0x0005, 0x0126, 0x2091, 0x8000, - 0x7000, 0x9086, 0x0002, 0x1904, 0x0ba0, 0x70a8, 0x9086, 0xffff, - 0x0130, 0x080c, 0x296f, 0x080c, 0x83b3, 0x0804, 0x0ba0, 0x70d8, - 0xd0ac, 0x1110, 0xd09c, 0x0558, 0xd084, 0x0548, 0x0006, 0x2001, - 0x0103, 0x2003, 0x002b, 0x000e, 0xd08c, 0x0508, 0x080c, 0x2c91, - 0x11d0, 0x70dc, 0x9086, 0xffff, 0x01b0, 0x080c, 0x2ae4, 0x080c, - 0x83b3, 0x70d8, 0xd094, 0x1904, 0x0ba0, 0x2011, 0x0001, 0x080c, - 0xb55c, 0x0110, 0x2011, 0x0003, 0x901e, 0x080c, 0x2b19, 0x080c, - 0x83b3, 0x0804, 0x0ba0, 0x70e0, 0x9005, 0x1904, 0x0ba0, 0x70a4, - 0x9005, 0x1904, 0x0ba0, 0x70d8, 0xd0a4, 0x0118, 0xd0b4, 0x0904, - 0x0ba0, 0x080c, 0x5f38, 0x1904, 0x0ba0, 0x080c, 0x5f89, 0x1904, - 0x0ba0, 0x080c, 0x5f70, 0x01c0, 0x0156, 0x00c6, 0x20a9, 0x007f, - 0x900e, 0x0016, 0x080c, 0x5ccd, 0x1118, 0x6000, 0xd0ec, 0x1138, - 0x001e, 0x8108, 0x1f04, 0x0b39, 0x00ce, 0x015e, 0x0028, 0x001e, - 0x00ce, 0x015e, 0x0804, 0x0ba0, 0x0006, 0x2001, 0x0103, 0x2003, - 0x006b, 0x000e, 0x2011, 0x12ea, 0x080c, 0x0f3d, 0x2011, 0x1304, - 0x080c, 0x0f3d, 0x7030, 0xc08c, 0x7032, 0x7003, 0x0003, 0x70ab, - 0xffff, 0x080c, 0x4e65, 0x1130, 0x0026, 0x2011, 0x0040, 0x080c, - 0x0ee5, 0x002e, 0x9006, 0x080c, 0x21ae, 0x080c, 0x2c91, 0x0118, - 0x080c, 0x4520, 0x0050, 0x0036, 0x0046, 0x2019, 0xffff, 0x2021, - 0x0006, 0x080c, 0x453a, 0x004e, 0x003e, 0x00f6, 0x2079, 0x0100, - 0x080c, 0x6b42, 0x0150, 0x080c, 0x6b1f, 0x7828, 0x0118, 0x9084, - 0xe1ff, 0x0010, 0x9084, 0xffdf, 0x782a, 0x00fe, 0x2001, 0x131f, - 0x2004, 0x9086, 0x0005, 0x1120, 0x2011, 0x0000, 0x080c, 0x91f9, - 0x2011, 0x0000, 0x080c, 0x9203, 0x080c, 0x83b3, 0x080c, 0x8489, - 0x012e, 0x0005, 0x0016, 0x0046, 0x00f6, 0x0126, 0x2091, 0x8000, + 0x20a9, 0x0800, 0x4104, 0x8211, 0x1dd8, 0x080c, 0x0f25, 0x080c, + 0x5dbc, 0x080c, 0x9c9e, 0x080c, 0x10dc, 0x080c, 0x12c1, 0x080c, + 0x1a82, 0x080c, 0x0d65, 0x080c, 0x1061, 0x080c, 0x3267, 0x080c, + 0x747e, 0x080c, 0x66c3, 0x080c, 0x80b6, 0x080c, 0x2345, 0x080c, + 0x839c, 0x080c, 0x7ae7, 0x080c, 0x217a, 0x080c, 0x22ae, 0x080c, + 0x233a, 0x2091, 0x3009, 0x7883, 0x0000, 0x1004, 0x091d, 0x7880, + 0x9086, 0x0002, 0x1190, 0x7883, 0x4000, 0x7837, 0x4000, 0x7833, + 0x0010, 0x0e04, 0x0911, 0x2091, 0x5000, 0x2091, 0x4080, 0x2001, + 0x0089, 0x2004, 0xd084, 0x190c, 0x11a9, 0x2071, 0x1800, 0x7003, + 0x0000, 0x2071, 0x1800, 0x7000, 0x908e, 0x0003, 0x1168, 0x080c, + 0x4a50, 0x080c, 0x328e, 0x080c, 0x74ef, 0x080c, 0x6be9, 0x080c, + 0x80e2, 0x080c, 0x2ad7, 0x0c68, 0x000b, 0x0c88, 0x0940, 0x0941, + 0x0ae3, 0x093e, 0x0baa, 0x0d64, 0x0d64, 0x0d64, 0x080c, 0x0dd1, + 0x0005, 0x0126, 0x00f6, 0x2091, 0x8000, 0x7000, 0x9086, 0x0001, + 0x1904, 0x0ab6, 0x080c, 0x5469, 0x1130, 0x0026, 0x2011, 0x0080, + 0x080c, 0x0eed, 0x002e, 0x080c, 0x7173, 0x0150, 0x080c, 0x7196, + 0x15a0, 0x2079, 0x0100, 0x7828, 0x9085, 0x1800, 0x782a, 0x0468, + 0x080c, 0x709f, 0x7000, 0x9086, 0x0001, 0x1904, 0x0ab6, 0x7094, + 0x9086, 0x0029, 0x1904, 0x0ab6, 0x080c, 0x809f, 0x080c, 0x8091, + 0x2001, 0x0161, 0x2003, 0x0001, 0x2079, 0x0100, 0x7827, 0xffff, + 0x7a28, 0x9295, 0x5e2f, 0x7a2a, 0x2011, 0x7003, 0x080c, 0x81a1, + 0x2011, 0x6ff6, 0x080c, 0x826d, 0x2011, 0x5c17, 0x080c, 0x81a1, + 0x2011, 0x8030, 0x901e, 0x7392, 0x04d0, 0x080c, 0x54c4, 0x2079, + 0x0100, 0x7844, 0x9005, 0x1904, 0x0ab6, 0x2011, 0x5c17, 0x080c, + 0x81a1, 0x2011, 0x7003, 0x080c, 0x81a1, 0x2011, 0x6ff6, 0x080c, + 0x826d, 0x2001, 0x0265, 0x2001, 0x0205, 0x2003, 0x0000, 0x7840, + 0x9084, 0xfffb, 0x7842, 0x2001, 0x1980, 0x2004, 0x9005, 0x1140, + 0x00c6, 0x2061, 0x0100, 0x080c, 0x5d64, 0x00ce, 0x0804, 0x0ab6, + 0x780f, 0x006b, 0x7a28, 0x080c, 0x717b, 0x0118, 0x9295, 0x5e2f, + 0x0010, 0x9295, 0x402f, 0x7a2a, 0x2011, 0x8010, 0x73d4, 0x2001, + 0x1981, 0x2003, 0x0001, 0x080c, 0x297c, 0x080c, 0x498b, 0x7244, + 0xc284, 0x7246, 0x2001, 0x180c, 0x200c, 0xc1ac, 0xc1cc, 0x2102, + 0x080c, 0x96d5, 0x2011, 0x0004, 0x080c, 0xb6b7, 0x080c, 0x64f6, + 0x080c, 0x7173, 0x1120, 0x080c, 0x29c0, 0x02e0, 0x0400, 0x080c, + 0x5d6b, 0x0140, 0x7093, 0x0001, 0x70cf, 0x0000, 0x080c, 0x5691, + 0x0804, 0x0ab6, 0x080c, 0x545a, 0xd094, 0x0188, 0x2011, 0x180c, + 0x2204, 0xc0cd, 0x2012, 0x080c, 0x545e, 0xd0d4, 0x1118, 0x080c, + 0x29c0, 0x1270, 0x2011, 0x180c, 0x2204, 0xc0bc, 0x00a8, 0x080c, + 0x545e, 0xd0d4, 0x1db8, 0x2011, 0x180c, 0x2204, 0xc0bd, 0x0060, + 0x2011, 0x180c, 0x2204, 0xc0bd, 0x2012, 0x080c, 0x65e2, 0x1128, + 0xd0a4, 0x0118, 0x2204, 0xc0fd, 0x2012, 0x080c, 0x65a8, 0x0120, + 0x7a0c, 0xc2b4, 0x7a0e, 0x00a8, 0x707b, 0x0000, 0x080c, 0x7173, + 0x1130, 0x70ac, 0x9005, 0x1168, 0x080c, 0xb9d1, 0x0050, 0x080c, + 0xb9d1, 0x70d8, 0xd09c, 0x1128, 0x70ac, 0x9005, 0x0110, 0x080c, + 0x5d41, 0x70e3, 0x0000, 0x70df, 0x0000, 0x70a3, 0x0000, 0x080c, + 0x29c8, 0x0228, 0x2011, 0x0101, 0x2204, 0xc0c4, 0x2012, 0x72d8, + 0x080c, 0x7173, 0x1178, 0x9016, 0x0016, 0x080c, 0x2785, 0x2019, + 0x1947, 0x211a, 0x001e, 0x705b, 0xffff, 0x705f, 0x00ef, 0x707f, + 0x0000, 0x0020, 0x2019, 0x1947, 0x201b, 0x0000, 0x2079, 0x185b, + 0x7804, 0xd0ac, 0x0108, 0xc295, 0x72da, 0x080c, 0x7173, 0x0118, + 0x9296, 0x0004, 0x0548, 0x2011, 0x0001, 0x080c, 0xb6b7, 0x70a7, + 0x0000, 0x70ab, 0xffff, 0x7003, 0x0002, 0x2079, 0x0100, 0x7827, + 0x0003, 0x7828, 0x9085, 0x0003, 0x782a, 0x00fe, 0x080c, 0x2dfa, + 0x2011, 0x0005, 0x080c, 0x97e0, 0x080c, 0x8a56, 0x080c, 0x7173, + 0x0148, 0x00c6, 0x2061, 0x0100, 0x0016, 0x080c, 0x2785, 0x61e2, + 0x001e, 0x00ce, 0x012e, 0x0420, 0x70a7, 0x0000, 0x70ab, 0xffff, + 0x7003, 0x0002, 0x00f6, 0x2079, 0x0100, 0x7827, 0x0003, 0x7828, + 0x9085, 0x0003, 0x782a, 0x00fe, 0x2011, 0x0005, 0x080c, 0x97e0, + 0x080c, 0x8a56, 0x080c, 0x7173, 0x0148, 0x00c6, 0x2061, 0x0100, + 0x0016, 0x080c, 0x2785, 0x61e2, 0x001e, 0x00ce, 0x00fe, 0x012e, + 0x0005, 0x00c6, 0x00b6, 0x080c, 0x7173, 0x1118, 0x20a9, 0x0800, + 0x0010, 0x20a9, 0x0782, 0x080c, 0x7173, 0x1110, 0x900e, 0x0010, + 0x2009, 0x007e, 0x86ff, 0x0138, 0x9180, 0x1000, 0x2004, 0x905d, + 0x0110, 0xb800, 0xd0bc, 0x090c, 0x30fd, 0x8108, 0x1f04, 0x0aca, + 0x707b, 0x0000, 0x707c, 0x9084, 0x00ff, 0x707e, 0x70af, 0x0000, + 0x00be, 0x00ce, 0x0005, 0x00b6, 0x0126, 0x2091, 0x8000, 0x7000, + 0x9086, 0x0002, 0x1904, 0x0ba7, 0x70a8, 0x9086, 0xffff, 0x0130, + 0x080c, 0x2dfa, 0x080c, 0x8a56, 0x0804, 0x0ba7, 0x70d8, 0xd0ac, + 0x1110, 0xd09c, 0x0558, 0xd084, 0x0548, 0x0006, 0x2001, 0x0103, + 0x2003, 0x002b, 0x000e, 0xd08c, 0x0508, 0x080c, 0x3160, 0x11d0, + 0x70dc, 0x9086, 0xffff, 0x01b0, 0x080c, 0x2f73, 0x080c, 0x8a56, + 0x70d8, 0xd094, 0x1904, 0x0ba7, 0x2011, 0x0001, 0x080c, 0xbc4c, + 0x0110, 0x2011, 0x0003, 0x901e, 0x080c, 0x2fad, 0x080c, 0x8a56, + 0x0804, 0x0ba7, 0x70e0, 0x9005, 0x1904, 0x0ba7, 0x70a4, 0x9005, + 0x1904, 0x0ba7, 0x70d8, 0xd0a4, 0x0118, 0xd0b4, 0x0904, 0x0ba7, + 0x080c, 0x65a8, 0x1904, 0x0ba7, 0x080c, 0x65fb, 0x1904, 0x0ba7, + 0x080c, 0x65e2, 0x01c0, 0x0156, 0x00c6, 0x20a9, 0x007f, 0x900e, + 0x0016, 0x080c, 0x62f0, 0x1118, 0xb800, 0xd0ec, 0x1138, 0x001e, + 0x8108, 0x1f04, 0x0b40, 0x00ce, 0x015e, 0x0028, 0x001e, 0x00ce, + 0x015e, 0x0804, 0x0ba7, 0x0006, 0x2001, 0x0103, 0x2003, 0x006b, + 0x000e, 0x2011, 0x198d, 0x080c, 0x0f95, 0x2011, 0x19a7, 0x080c, + 0x0f95, 0x7030, 0xc08c, 0x7032, 0x7003, 0x0003, 0x70ab, 0xffff, + 0x080c, 0x5469, 0x1130, 0x0026, 0x2011, 0x0040, 0x080c, 0x0eed, + 0x002e, 0x9006, 0x080c, 0x261a, 0x080c, 0x3160, 0x0118, 0x080c, + 0x4b28, 0x0050, 0x0036, 0x0046, 0x2019, 0xffff, 0x2021, 0x0006, + 0x080c, 0x4b42, 0x004e, 0x003e, 0x00f6, 0x2079, 0x0100, 0x080c, + 0x7196, 0x0150, 0x080c, 0x7173, 0x7828, 0x0118, 0x9084, 0xe1ff, + 0x0010, 0x9084, 0xffdf, 0x782a, 0x00fe, 0x2001, 0x19c2, 0x2004, + 0x9086, 0x0005, 0x1120, 0x2011, 0x0000, 0x080c, 0x97e0, 0x2011, + 0x0000, 0x080c, 0x97ea, 0x080c, 0x8a56, 0x080c, 0x8b2d, 0x012e, + 0x00be, 0x0005, 0x0016, 0x0046, 0x00f6, 0x0126, 0x2091, 0x8000, 0x2079, 0x0100, 0x7904, 0x918c, 0xfffd, 0x7906, 0x2009, 0x00f7, - 0x080c, 0x571b, 0x7940, 0x918c, 0x0010, 0x7942, 0x7924, 0xd1b4, + 0x080c, 0x5d2a, 0x7940, 0x918c, 0x0010, 0x7942, 0x7924, 0xd1b4, 0x0110, 0x7827, 0x0040, 0xd19c, 0x0110, 0x7827, 0x0008, 0x0006, - 0x0036, 0x0156, 0x7954, 0xd1ac, 0x1904, 0x0c2f, 0x2001, 0x12de, - 0x2004, 0x9005, 0x1518, 0x080c, 0x25b8, 0x1148, 0x2001, 0x0001, - 0x080c, 0x2520, 0x2001, 0x0001, 0x080c, 0x2503, 0x00b8, 0x080c, - 0x25c0, 0x1138, 0x9006, 0x080c, 0x2520, 0x9006, 0x080c, 0x2503, - 0x0068, 0x080c, 0x25c8, 0x1d50, 0x2001, 0x12ce, 0x2004, 0xd0fc, - 0x0108, 0x0020, 0x080c, 0x232e, 0x0804, 0x0d0e, 0x080c, 0x6b30, - 0x0148, 0x080c, 0x6b42, 0x1118, 0x080c, 0x6e21, 0x0050, 0x080c, - 0x6b27, 0x0dd0, 0x080c, 0x6e1c, 0x080c, 0x6e12, 0x080c, 0x6a4b, - 0x0058, 0x080c, 0x6b1f, 0x0140, 0x2009, 0x00f8, 0x080c, 0x571b, + 0x0036, 0x0156, 0x7954, 0xd1ac, 0x1904, 0x0c37, 0x2001, 0x1981, + 0x2004, 0x9005, 0x1518, 0x080c, 0x2a43, 0x1148, 0x2001, 0x0001, + 0x080c, 0x29ab, 0x2001, 0x0001, 0x080c, 0x298e, 0x00b8, 0x080c, + 0x2a4b, 0x1138, 0x9006, 0x080c, 0x29ab, 0x9006, 0x080c, 0x298e, + 0x0068, 0x080c, 0x2a53, 0x1d50, 0x2001, 0x1971, 0x2004, 0xd0fc, + 0x0108, 0x0020, 0x080c, 0x27b9, 0x0804, 0x0d16, 0x080c, 0x7184, + 0x0148, 0x080c, 0x7196, 0x1118, 0x080c, 0x7479, 0x0050, 0x080c, + 0x717b, 0x0dd0, 0x080c, 0x7474, 0x080c, 0x746a, 0x080c, 0x709f, + 0x0058, 0x080c, 0x7173, 0x0140, 0x2009, 0x00f8, 0x080c, 0x5d2a, 0x7843, 0x0090, 0x7843, 0x0010, 0x20a9, 0x09c4, 0x7820, 0xd09c, - 0x1138, 0x080c, 0x6b1f, 0x0138, 0x7824, 0xd0ac, 0x1904, 0x0d13, - 0x1f04, 0x0c0e, 0x0070, 0x7824, 0x080c, 0x6b39, 0x0118, 0xd0ac, - 0x1904, 0x0d13, 0x9084, 0x1800, 0x0d98, 0x7003, 0x0001, 0x0804, - 0x0d13, 0x2001, 0x0001, 0x080c, 0x21ae, 0x0804, 0x0d26, 0x2001, - 0x12de, 0x2004, 0x9005, 0x1518, 0x080c, 0x25b8, 0x1148, 0x2001, - 0x0001, 0x080c, 0x2520, 0x2001, 0x0001, 0x080c, 0x2503, 0x00b8, - 0x080c, 0x25c0, 0x1138, 0x9006, 0x080c, 0x2520, 0x9006, 0x080c, - 0x2503, 0x0068, 0x080c, 0x25c8, 0x1d50, 0x2001, 0x12ce, 0x2004, - 0xd0fc, 0x0108, 0x0020, 0x080c, 0x232e, 0x0804, 0x0d0e, 0x7850, + 0x1138, 0x080c, 0x7173, 0x0138, 0x7824, 0xd0ac, 0x1904, 0x0d1b, + 0x1f04, 0x0c16, 0x0070, 0x7824, 0x080c, 0x718d, 0x0118, 0xd0ac, + 0x1904, 0x0d1b, 0x9084, 0x1800, 0x0d98, 0x7003, 0x0001, 0x0804, + 0x0d1b, 0x2001, 0x0001, 0x080c, 0x261a, 0x0804, 0x0d2e, 0x2001, + 0x1981, 0x2004, 0x9005, 0x1518, 0x080c, 0x2a43, 0x1148, 0x2001, + 0x0001, 0x080c, 0x29ab, 0x2001, 0x0001, 0x080c, 0x298e, 0x00b8, + 0x080c, 0x2a4b, 0x1138, 0x9006, 0x080c, 0x29ab, 0x9006, 0x080c, + 0x298e, 0x0068, 0x080c, 0x2a53, 0x1d50, 0x2001, 0x1971, 0x2004, + 0xd0fc, 0x0108, 0x0020, 0x080c, 0x27b9, 0x0804, 0x0d16, 0x7850, 0x9085, 0x0040, 0x7852, 0x7938, 0x7850, 0x9084, 0xfbcf, 0x7852, - 0x080c, 0x25d0, 0x9085, 0x2000, 0x7852, 0x793a, 0x20a9, 0x0046, - 0x1d04, 0x0c68, 0x080c, 0x7bd3, 0x1f04, 0x0c68, 0x7850, 0x9085, - 0x0400, 0x9084, 0xdfbf, 0x7852, 0x793a, 0x080c, 0x6b30, 0x0148, - 0x080c, 0x6b42, 0x1118, 0x080c, 0x6e21, 0x0050, 0x080c, 0x6b27, - 0x0dd0, 0x080c, 0x6e1c, 0x080c, 0x6e12, 0x080c, 0x6a4b, 0x0020, - 0x2009, 0x00f8, 0x080c, 0x571b, 0x20a9, 0x0028, 0xa001, 0x1f04, - 0x0c8e, 0x7850, 0x9085, 0x1400, 0x7852, 0x080c, 0x6b1f, 0x0120, + 0x080c, 0x2a5b, 0x9085, 0x2000, 0x7852, 0x793a, 0x20a9, 0x0046, + 0x1d04, 0x0c70, 0x080c, 0x824d, 0x1f04, 0x0c70, 0x7850, 0x9085, + 0x0400, 0x9084, 0xdfbf, 0x7852, 0x793a, 0x080c, 0x7184, 0x0148, + 0x080c, 0x7196, 0x1118, 0x080c, 0x7479, 0x0050, 0x080c, 0x717b, + 0x0dd0, 0x080c, 0x7474, 0x080c, 0x746a, 0x080c, 0x709f, 0x0020, + 0x2009, 0x00f8, 0x080c, 0x5d2a, 0x20a9, 0x0028, 0xa001, 0x1f04, + 0x0c96, 0x7850, 0x9085, 0x1400, 0x7852, 0x080c, 0x7173, 0x0120, 0x7843, 0x0090, 0x7843, 0x0010, 0x2021, 0xe678, 0x2019, 0xea60, - 0x0d0c, 0x7bd3, 0x7820, 0xd09c, 0x1580, 0x080c, 0x6b1f, 0x0904, - 0x0cf3, 0x7824, 0xd0ac, 0x1904, 0x0d13, 0x080c, 0x6b42, 0x1528, + 0x0d0c, 0x824d, 0x7820, 0xd09c, 0x1580, 0x080c, 0x7173, 0x0904, + 0x0cfb, 0x7824, 0xd0ac, 0x1904, 0x0d1b, 0x080c, 0x7196, 0x1528, 0x0046, 0x2021, 0x0320, 0x8421, 0x1df0, 0x004e, 0x7827, 0x1800, - 0x080c, 0x25d0, 0x7824, 0x9084, 0x1800, 0x1160, 0x9484, 0x0fff, - 0x1138, 0x2001, 0x1110, 0x2004, 0xd0fc, 0x0110, 0x080c, 0x0d39, - 0x8421, 0x1158, 0x1d04, 0x0cce, 0x080c, 0x7bd3, 0x080c, 0x6e1c, - 0x080c, 0x6e12, 0x7003, 0x0001, 0x04f0, 0x8319, 0x1948, 0x1d04, - 0x0cdb, 0x080c, 0x7bd3, 0x2009, 0x12d1, 0x2104, 0x9005, 0x0118, + 0x080c, 0x2a5b, 0x7824, 0x9084, 0x1800, 0x1160, 0x9484, 0x0fff, + 0x1138, 0x2001, 0x1810, 0x2004, 0xd0fc, 0x0110, 0x080c, 0x0d41, + 0x8421, 0x1158, 0x1d04, 0x0cd6, 0x080c, 0x824d, 0x080c, 0x7474, + 0x080c, 0x746a, 0x7003, 0x0001, 0x04f0, 0x8319, 0x1948, 0x1d04, + 0x0ce3, 0x080c, 0x824d, 0x2009, 0x1974, 0x2104, 0x9005, 0x0118, 0x8001, 0x200a, 0x1178, 0x200b, 0x000a, 0x7827, 0x0048, 0x20a9, - 0x0002, 0x080c, 0x25b1, 0x7924, 0x080c, 0x25d0, 0xd19c, 0x0110, - 0x080c, 0x24f1, 0x00d8, 0x080c, 0x6b30, 0x1140, 0x94a2, 0x03e8, - 0x1128, 0x080c, 0x6af7, 0x7003, 0x0001, 0x00a8, 0x7827, 0x1800, - 0x080c, 0x25d0, 0x7824, 0x080c, 0x6b39, 0x0110, 0xd0ac, 0x1158, + 0x0002, 0x080c, 0x2a3c, 0x7924, 0x080c, 0x2a5b, 0xd19c, 0x0110, + 0x080c, 0x297c, 0x00d8, 0x080c, 0x7184, 0x1140, 0x94a2, 0x03e8, + 0x1128, 0x080c, 0x714b, 0x7003, 0x0001, 0x00a8, 0x7827, 0x1800, + 0x080c, 0x2a5b, 0x7824, 0x080c, 0x718d, 0x0110, 0xd0ac, 0x1158, 0x9084, 0x1800, 0x0950, 0x7003, 0x0001, 0x0028, 0x2001, 0x0001, - 0x080c, 0x21ae, 0x0078, 0x2009, 0x110c, 0x210c, 0xd19c, 0x1120, + 0x080c, 0x261a, 0x0078, 0x2009, 0x180c, 0x210c, 0xd19c, 0x1120, 0x7904, 0x918d, 0x0002, 0x7906, 0x7827, 0x0048, 0x7828, 0x9085, - 0x0028, 0x782a, 0x7850, 0x9085, 0x0400, 0x7852, 0x2001, 0x12de, + 0x0028, 0x782a, 0x7850, 0x9085, 0x0400, 0x7852, 0x2001, 0x1981, 0x2003, 0x0000, 0x9006, 0x78f2, 0x015e, 0x003e, 0x000e, 0x080c, - 0x4e65, 0x1110, 0x080c, 0x0e68, 0x012e, 0x00fe, 0x004e, 0x001e, + 0x5469, 0x1110, 0x080c, 0x0e70, 0x012e, 0x00fe, 0x004e, 0x001e, 0x0005, 0x0006, 0x0016, 0x0036, 0x0046, 0x00b6, 0x00c6, 0x00d6, - 0x00e6, 0x00f6, 0x0156, 0x0069, 0x0d0c, 0x7bd3, 0x015e, 0x00fe, + 0x00e6, 0x00f6, 0x0156, 0x0069, 0x0d0c, 0x824d, 0x015e, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x004e, 0x003e, 0x001e, 0x000e, - 0x0005, 0x00e6, 0x2071, 0x119c, 0x7004, 0x9086, 0x0001, 0x1110, - 0x080c, 0x2daf, 0x00ee, 0x0005, 0x0005, 0x2a70, 0x2061, 0x12e2, - 0x2063, 0x0003, 0x6007, 0x0003, 0x600b, 0x0013, 0x600f, 0x0007, - 0x2001, 0x12a2, 0x900e, 0x2102, 0x7192, 0x2001, 0x0100, 0x2004, + 0x0005, 0x00e6, 0x2071, 0x189c, 0x7004, 0x9086, 0x0001, 0x1110, + 0x080c, 0x328e, 0x00ee, 0x0005, 0x0005, 0x2a70, 0x2061, 0x1985, + 0x2063, 0x0003, 0x6007, 0x0003, 0x600b, 0x0013, 0x600f, 0x0107, + 0x2001, 0x1956, 0x900e, 0x2102, 0x7192, 0x2001, 0x0100, 0x2004, 0x9082, 0x0002, 0x0218, 0x705b, 0xffff, 0x0008, 0x715a, 0x7063, - 0xffff, 0x717a, 0x717e, 0x080c, 0xb2e7, 0x2061, 0x1292, 0x6003, + 0xffff, 0x717a, 0x717e, 0x080c, 0xb9d1, 0x2061, 0x1946, 0x6003, 0x0909, 0x6106, 0x600b, 0x8800, 0x600f, 0x0200, 0x6013, 0x00ff, - 0x6017, 0x000f, 0x611a, 0x601f, 0x07d0, 0x2061, 0x129a, 0x6003, + 0x6017, 0x000f, 0x611a, 0x601f, 0x07d0, 0x2061, 0x194e, 0x6003, 0x8000, 0x6106, 0x610a, 0x600f, 0x0200, 0x6013, 0x00ff, 0x6116, - 0x601b, 0x0001, 0x611e, 0x2061, 0x12bf, 0x6003, 0x514c, 0x6007, - 0x4f47, 0x600b, 0x4943, 0x600f, 0x2020, 0x2001, 0x112b, 0x2102, - 0x0005, 0x9016, 0x080c, 0x5ccd, 0x1178, 0x6004, 0x90c4, 0x00ff, + 0x601b, 0x0001, 0x611e, 0x2061, 0x1962, 0x6003, 0x514c, 0x6007, + 0x4f47, 0x600b, 0x4943, 0x600f, 0x2020, 0x2001, 0x182b, 0x2102, + 0x0005, 0x9016, 0x080c, 0x62f0, 0x1178, 0xb804, 0x90c4, 0x00ff, 0x98c6, 0x0006, 0x0128, 0x90c4, 0xff00, 0x98c6, 0x0600, 0x1120, - 0x9186, 0x0080, 0x0108, 0x8210, 0x8108, 0x9186, 0x0100, 0x1d50, + 0x9186, 0x0080, 0x0108, 0x8210, 0x8108, 0x9186, 0x0800, 0x1d50, 0x2208, 0x0005, 0x2091, 0x8000, 0x2079, 0x0000, 0x000e, 0x00f6, - 0x0010, 0x2091, 0x8000, 0x0e04, 0x0dcb, 0x0006, 0x0016, 0x2001, + 0x0010, 0x2091, 0x8000, 0x0e04, 0x0dd3, 0x0006, 0x0016, 0x2001, 0x8002, 0x0006, 0x2079, 0x0000, 0x000e, 0x7882, 0x7836, 0x001e, 0x798e, 0x000e, 0x788a, 0x000e, 0x7886, 0x3900, 0x789a, 0x00d6, - 0x2069, 0x0300, 0x6818, 0x78ae, 0x681c, 0x78b2, 0x2001, 0x133f, - 0x2004, 0x78b6, 0x2001, 0x13ba, 0x2004, 0x78ba, 0x6808, 0x78be, + 0x2069, 0x0300, 0x6818, 0x78ae, 0x681c, 0x78b2, 0x2001, 0x19e2, + 0x2004, 0x78b6, 0x2001, 0x1a5e, 0x2004, 0x78ba, 0x6808, 0x78be, 0x00de, 0x7833, 0x0012, 0x2091, 0x5000, 0x0156, 0x00d6, 0x0036, - 0x0026, 0x2079, 0x0300, 0x2069, 0x13dd, 0x7a08, 0x226a, 0x2069, - 0x13de, 0x7a18, 0x226a, 0x8d68, 0x7a1c, 0x226a, 0x782c, 0x2019, - 0x13eb, 0x201a, 0x2019, 0x13ee, 0x9016, 0x7808, 0xd09c, 0x0168, - 0x7820, 0x201a, 0x8210, 0x8318, 0x9386, 0x13f7, 0x0108, 0x0ca8, - 0x7808, 0xd09c, 0x0110, 0x2011, 0xdead, 0x2019, 0x13ec, 0x782c, - 0x201a, 0x8318, 0x221a, 0x7803, 0x0000, 0x2069, 0x13bd, 0x901e, + 0x0026, 0x2079, 0x0300, 0x2069, 0x1a81, 0x7a08, 0x226a, 0x2069, + 0x1a82, 0x7a18, 0x226a, 0x8d68, 0x7a1c, 0x226a, 0x782c, 0x2019, + 0x1a8f, 0x201a, 0x2019, 0x1a92, 0x9016, 0x7808, 0xd09c, 0x0168, + 0x7820, 0x201a, 0x8210, 0x8318, 0x9386, 0x1a9b, 0x0108, 0x0ca8, + 0x7808, 0xd09c, 0x0110, 0x2011, 0xdead, 0x2019, 0x1a90, 0x782c, + 0x201a, 0x8318, 0x221a, 0x7803, 0x0000, 0x2069, 0x1a61, 0x901e, 0x20a9, 0x0020, 0x7b26, 0x7a28, 0x226a, 0x8d68, 0x8318, 0x1f04, - 0x0e2a, 0x002e, 0x003e, 0x00de, 0x015e, 0x2079, 0x1100, 0x7803, + 0x0e32, 0x002e, 0x003e, 0x00de, 0x015e, 0x2079, 0x1800, 0x7803, 0x0005, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x0180, - 0x2001, 0x1351, 0x2004, 0x9005, 0x0128, 0x2001, 0x008b, 0x2004, + 0x2001, 0x19f5, 0x2004, 0x9005, 0x0128, 0x2001, 0x008b, 0x2004, 0xd0fc, 0x0dd8, 0x2001, 0x008a, 0x2003, 0x0002, 0x2003, 0x1001, - 0x080c, 0x4e65, 0x1110, 0x080c, 0x0e9f, 0x0cd0, 0x0005, 0x918c, + 0x080c, 0x5469, 0x1110, 0x080c, 0x0ea7, 0x0cd0, 0x0005, 0x918c, 0x03ff, 0x2001, 0x0003, 0x2004, 0x9084, 0x0600, 0x1118, 0x918d, 0x2800, 0x0010, 0x918d, 0x2000, 0x2001, 0x017f, 0x2102, 0x0005, - 0x00f6, 0x0006, 0x2079, 0x1126, 0x2f04, 0x8000, 0x207a, 0x080c, - 0x25c8, 0x1150, 0x0006, 0x2001, 0x12ce, 0x2004, 0xd0fc, 0x000e, + 0x00f6, 0x0006, 0x2079, 0x1826, 0x2f04, 0x8000, 0x207a, 0x080c, + 0x2a53, 0x1150, 0x0006, 0x2001, 0x1971, 0x2004, 0xd0fc, 0x000e, 0x1118, 0x9082, 0x7530, 0x0010, 0x9082, 0x000f, 0x0258, 0x9006, - 0x207a, 0x2079, 0x1129, 0x2f04, 0x9084, 0x0001, 0x9086, 0x0001, - 0x207a, 0x0090, 0x2079, 0x1129, 0x2f7c, 0x8fff, 0x1138, 0x0026, - 0x2011, 0x0080, 0x080c, 0x0ee5, 0x002e, 0x0030, 0x0026, 0x2011, - 0x0000, 0x080c, 0x0ee5, 0x002e, 0x000e, 0x00fe, 0x0005, 0x0026, - 0x0126, 0x2011, 0x0080, 0x080c, 0x0ee5, 0x20a9, 0x0fff, 0x080c, - 0x0f06, 0x2011, 0x0040, 0x04c9, 0x20a9, 0x0fff, 0x080c, 0x0f06, + 0x207a, 0x2079, 0x1829, 0x2f04, 0x9084, 0x0001, 0x9086, 0x0001, + 0x207a, 0x0090, 0x2079, 0x1829, 0x2f7c, 0x8fff, 0x1138, 0x0026, + 0x2011, 0x0080, 0x080c, 0x0eed, 0x002e, 0x0030, 0x0026, 0x2011, + 0x0000, 0x080c, 0x0eed, 0x002e, 0x000e, 0x00fe, 0x0005, 0x0026, + 0x0126, 0x2011, 0x0080, 0x080c, 0x0eed, 0x20a9, 0x0fff, 0x080c, + 0x0f0e, 0x2011, 0x0040, 0x04c9, 0x20a9, 0x0fff, 0x080c, 0x0f0e, 0x0c80, 0x7038, 0xd0b4, 0x1128, 0x0026, 0x2011, 0x0040, 0x0469, 0x002e, 0x0005, 0x7038, 0xd0b4, 0x1128, 0x0026, 0x2011, 0x0080, 0x0421, 0x002e, 0x0005, 0x0026, 0x70eb, 0x0000, 0x0459, 0x1148, - 0x080c, 0x25c8, 0x1118, 0x2011, 0x8484, 0x0058, 0x2011, 0x8282, - 0x0040, 0x080c, 0x25c8, 0x1118, 0x2011, 0xcdc5, 0x0010, 0x2011, + 0x080c, 0x2a53, 0x1118, 0x2011, 0x8484, 0x0058, 0x2011, 0x8282, + 0x0040, 0x080c, 0x2a53, 0x1118, 0x2011, 0xcdc5, 0x0010, 0x2011, 0xcac2, 0x00e9, 0x002e, 0x0005, 0xd0b4, 0x0130, 0x0006, 0x3b00, 0x9084, 0xff3f, 0x20d8, 0x000e, 0x0005, 0x0016, 0x3b08, 0x3a00, 0x9104, 0x918d, 0x00c0, 0x21d8, 0x9084, 0xff3f, 0x9205, 0x20d0, - 0x001e, 0x0005, 0x2001, 0x1139, 0x2004, 0xd0dc, 0x0005, 0x9e86, - 0x1100, 0x190c, 0x0dc9, 0x70e4, 0xd0e4, 0x0108, 0xc2e5, 0x72e6, - 0xd0e4, 0x1118, 0x9294, 0x00c0, 0x0c01, 0x0005, 0x1d04, 0x0f06, - 0x2091, 0x6000, 0x1f04, 0x0f06, 0x0005, 0x890b, 0x810b, 0x810b, - 0x810b, 0x810b, 0x810b, 0x9994, 0xfc00, 0x8217, 0x8214, 0x8214, - 0x0005, 0x0006, 0x814c, 0x894c, 0x894c, 0x894c, 0x894c, 0x894c, - 0x9284, 0x003f, 0x8007, 0x8003, 0x8003, 0x994d, 0x000e, 0x0005, - 0x0016, 0x0026, 0x0096, 0x3348, 0x0c01, 0x2100, 0x9300, 0x2098, - 0x22e0, 0x009e, 0x002e, 0x001e, 0x3518, 0x20a9, 0x0001, 0x4002, - 0x8007, 0x4004, 0x8319, 0x1dd8, 0x0005, 0x20e9, 0x0001, 0x71b4, + 0x001e, 0x0005, 0x2001, 0x1839, 0x2004, 0xd0dc, 0x0005, 0x9e86, + 0x1800, 0x190c, 0x0dd1, 0x70e4, 0xd0e4, 0x0108, 0xc2e5, 0x72e6, + 0xd0e4, 0x1118, 0x9294, 0x00c0, 0x0c01, 0x0005, 0x1d04, 0x0f0e, + 0x2091, 0x6000, 0x1f04, 0x0f0e, 0x0005, 0x890e, 0x810e, 0x810f, + 0x9194, 0x003f, 0x918c, 0xffc0, 0x0005, 0x0006, 0x2200, 0x914d, + 0x894f, 0x894d, 0x894d, 0x000e, 0x0005, 0x01d6, 0x0146, 0x0036, + 0x0096, 0x2061, 0x188b, 0x600b, 0x0000, 0x600f, 0x0000, 0x6003, + 0x0000, 0x6007, 0x0000, 0x2009, 0xffc0, 0x2105, 0x0006, 0x2001, + 0xaaaa, 0x200f, 0x2019, 0x5555, 0x9016, 0x2049, 0x0bff, 0xab02, + 0xa001, 0xa001, 0xa800, 0x9306, 0x1138, 0x2105, 0x9306, 0x0120, + 0x8210, 0x99c8, 0x0400, 0x0c98, 0x000e, 0x200f, 0x2001, 0x189b, + 0x928a, 0x000e, 0x1638, 0x928a, 0x0006, 0x2011, 0x0006, 0x1210, + 0x2011, 0x0000, 0x2202, 0x9006, 0x2008, 0x82ff, 0x01b0, 0x8200, + 0x600a, 0x600f, 0xffff, 0x6003, 0x0002, 0x6007, 0x0000, 0x0026, + 0x2019, 0x0010, 0x9280, 0x0001, 0x20e8, 0x21a0, 0x21a8, 0x4104, + 0x8319, 0x1de0, 0x8211, 0x1da0, 0x002e, 0x009e, 0x003e, 0x014e, + 0x01de, 0x0005, 0x2011, 0x000e, 0x08e8, 0x0016, 0x0026, 0x0096, + 0x3348, 0x080c, 0x0f15, 0x2100, 0x9300, 0x2098, 0x22e0, 0x009e, + 0x002e, 0x001e, 0x0036, 0x3518, 0x20a9, 0x0001, 0x4002, 0x8007, + 0x4004, 0x8319, 0x1dd8, 0x003e, 0x0005, 0x20e9, 0x0001, 0x71b4, 0x81ff, 0x11c0, 0x9006, 0x2009, 0x0200, 0x20a9, 0x0002, 0x9298, 0x0018, 0x23a0, 0x4001, 0x2009, 0x0700, 0x20a9, 0x0002, 0x9298, 0x0008, 0x23a0, 0x4001, 0x7078, 0x8007, 0x717c, 0x810f, 0x20a9, - 0x0002, 0x4001, 0x9298, 0x000c, 0x23a0, 0x900e, 0x080c, 0x0da9, - 0x2001, 0x0000, 0x810f, 0x20a9, 0x0002, 0x4001, 0x0005, 0x2071, - 0x1100, 0x7168, 0x712e, 0x2021, 0x0001, 0x9190, 0x0040, 0x9298, - 0x0040, 0x0240, 0x706c, 0x9302, 0x1228, 0x220a, 0x2208, 0x2310, - 0x8420, 0x0ca8, 0x200b, 0x0000, 0x74ba, 0x74be, 0x0005, 0x00e6, - 0x0126, 0x2091, 0x8000, 0x2071, 0x1100, 0x70bc, 0x90ea, 0x0040, - 0x0268, 0x8001, 0x70be, 0x702c, 0x2068, 0x2d04, 0x702e, 0x206b, - 0x0000, 0x6807, 0x0000, 0x012e, 0x00ee, 0x0005, 0x906e, 0x0cd8, - 0x00e6, 0x2071, 0x1100, 0x0126, 0x2091, 0x8000, 0x70bc, 0x8001, - 0x0270, 0x70be, 0x702c, 0x2068, 0x9085, 0x0001, 0x2d04, 0x702e, - 0x206b, 0x0000, 0x6807, 0x0000, 0x012e, 0x00ee, 0x0005, 0x906e, - 0x0cd8, 0x00e6, 0x0126, 0x2091, 0x8000, 0x2071, 0x1100, 0x702c, - 0x206a, 0x2d00, 0x702e, 0x70bc, 0x8000, 0x70be, 0x080c, 0x7a1d, - 0x012e, 0x00ee, 0x0005, 0x8dff, 0x0138, 0x6804, 0x6807, 0x0000, - 0x0006, 0x0c39, 0x00de, 0x0cb8, 0x0005, 0x00d6, 0x0849, 0x0148, - 0x0016, 0x0026, 0x2d08, 0x2011, 0x0001, 0x080c, 0x0f19, 0x002e, - 0x001e, 0x00de, 0x0005, 0x00d6, 0x080c, 0x0f7f, 0x0148, 0x0016, - 0x0026, 0x2d08, 0x2011, 0x0001, 0x080c, 0x0f19, 0x002e, 0x001e, - 0x00de, 0x0005, 0x00d6, 0x0016, 0x0026, 0x080c, 0x0f0d, 0x2168, - 0x002e, 0x001e, 0x080c, 0x0fb1, 0x00de, 0x0005, 0x00e6, 0x2071, - 0x1350, 0x7007, 0x0000, 0x9006, 0x701e, 0x7022, 0x7002, 0x2071, - 0x0000, 0x7010, 0x9085, 0x8044, 0x7012, 0x2071, 0x0080, 0x9006, - 0x20a9, 0x0040, 0x7022, 0x1f04, 0x100a, 0x702b, 0x0020, 0x00ee, - 0x0005, 0x0126, 0x2091, 0x8000, 0x00e6, 0x2270, 0x700b, 0x0000, - 0x2071, 0x1350, 0x701c, 0x9088, 0x135a, 0x220a, 0x8000, 0x9084, - 0x003f, 0x701e, 0x7120, 0x9106, 0x090c, 0x0dc9, 0x7004, 0x9005, - 0x1128, 0x00f6, 0x2079, 0x0080, 0x00a9, 0x00fe, 0x00ee, 0x012e, - 0x0005, 0x0126, 0x2091, 0x8000, 0x00e6, 0x2071, 0x1350, 0x7004, - 0x9005, 0x1128, 0x00f6, 0x2079, 0x0080, 0x0021, 0x00fe, 0x00ee, - 0x012e, 0x0005, 0x7004, 0x9086, 0x0000, 0x1110, 0x7007, 0x0006, - 0x7000, 0x0002, 0x1054, 0x1052, 0x1052, 0x1052, 0x11c8, 0x11c8, - 0x11c8, 0x11c8, 0x080c, 0x0dc9, 0x701c, 0x7120, 0x9106, 0x1148, - 0x792c, 0x9184, 0x0001, 0x1120, 0xd1fc, 0x1110, 0x7007, 0x0000, - 0x0005, 0x00d6, 0x9180, 0x135a, 0x2004, 0x700a, 0x2068, 0x8108, - 0x918c, 0x003f, 0x7122, 0x782b, 0x0026, 0x6828, 0x7802, 0x682c, - 0x7806, 0x6830, 0x780a, 0x6834, 0x780e, 0x6814, 0x700e, 0x680c, - 0x7016, 0x6810, 0x701a, 0x6804, 0x00de, 0xd084, 0x0120, 0x7007, - 0x0001, 0x0029, 0x0005, 0x7007, 0x0002, 0x00b1, 0x0005, 0x0016, - 0x0026, 0x710c, 0x2011, 0x0040, 0x9182, 0x0040, 0x1210, 0x2110, - 0x9006, 0x700e, 0x7212, 0x8203, 0x7812, 0x782b, 0x0020, 0x782b, - 0x0041, 0x002e, 0x001e, 0x0005, 0x0016, 0x0026, 0x0136, 0x0146, - 0x0156, 0x7014, 0x20e0, 0x7018, 0x2098, 0x20e9, 0x0000, 0x20a1, - 0x0088, 0x782b, 0x0026, 0x710c, 0x2011, 0x0040, 0x9182, 0x0040, - 0x1210, 0x2110, 0x9006, 0x700e, 0x22a8, 0x4006, 0x8203, 0x7812, - 0x782b, 0x0020, 0x3300, 0x701a, 0x782b, 0x0001, 0x015e, 0x014e, - 0x013e, 0x002e, 0x001e, 0x0005, 0x2009, 0x1350, 0x2104, 0xc095, - 0x200a, 0x080c, 0x1031, 0x0005, 0x0016, 0x00e6, 0x2071, 0x1350, - 0x00f6, 0x2079, 0x0080, 0x792c, 0xd1bc, 0x190c, 0x0dc2, 0x782b, - 0x0002, 0xd1fc, 0x0120, 0x918c, 0x0700, 0x7004, 0x0023, 0x00fe, - 0x00ee, 0x001e, 0x0005, 0x1042, 0x10ea, 0x111c, 0x0dc9, 0x0dc9, - 0x11d4, 0x0dc9, 0x918c, 0x0700, 0x1548, 0x0136, 0x0146, 0x0156, - 0x7014, 0x20e8, 0x7018, 0x20a0, 0x20e1, 0x0000, 0x2099, 0x0088, - 0x782b, 0x0040, 0x7010, 0x20a8, 0x4005, 0x3400, 0x701a, 0x015e, - 0x014e, 0x013e, 0x700c, 0x9005, 0x0560, 0x7800, 0x7802, 0x7804, - 0x7806, 0x080c, 0x1087, 0x0005, 0x7008, 0x9080, 0x0002, 0x2003, - 0x0100, 0x7007, 0x0000, 0x080c, 0x1042, 0x0005, 0x7008, 0x9080, - 0x0002, 0x2003, 0x0200, 0x0ca8, 0x918c, 0x0700, 0x1150, 0x700c, - 0x9005, 0x0178, 0x7800, 0x7802, 0x7804, 0x7806, 0x080c, 0x109c, - 0x0005, 0x7008, 0x9080, 0x0002, 0x2003, 0x0200, 0x7007, 0x0000, - 0x0080, 0x00d6, 0x7008, 0x2068, 0x7800, 0x682a, 0x7804, 0x682e, - 0x7808, 0x6832, 0x780c, 0x6836, 0x680b, 0x0100, 0x00de, 0x7007, - 0x0000, 0x00c6, 0x00d6, 0x7008, 0x2060, 0x9086, 0x1205, 0x1128, - 0x6038, 0x080f, 0x00de, 0x00ce, 0x0088, 0x00de, 0x00ce, 0x00c6, - 0x00d6, 0x7008, 0x2060, 0x0069, 0x0138, 0x6038, 0x080f, 0x00de, - 0x00ce, 0x080c, 0x1031, 0x0005, 0x00de, 0x00ce, 0x080c, 0x1031, - 0x0005, 0x00e6, 0x2071, 0x1100, 0x8cff, 0x0140, 0x7068, 0x9c02, - 0x0238, 0x9c82, 0xffff, 0x1220, 0x9085, 0x0001, 0x00ee, 0x0005, - 0x9006, 0x0ce0, 0x603c, 0x906d, 0x090c, 0x0dc9, 0x6008, 0x908e, - 0x0100, 0x0130, 0x687b, 0x0030, 0x6883, 0x0000, 0x6897, 0x4002, - 0x080c, 0x6332, 0x603b, 0x0000, 0x603f, 0x0000, 0x2c00, 0x2068, - 0x080c, 0x0fb1, 0x0005, 0x00f6, 0x603c, 0x906d, 0x090c, 0x0dc9, - 0x6008, 0x908e, 0x0100, 0x0128, 0x687b, 0x0001, 0x6883, 0x0000, - 0x0080, 0x680c, 0x2078, 0x7804, 0x9005, 0x0158, 0x680e, 0x2078, - 0x9080, 0x0002, 0x6012, 0x7800, 0x6016, 0x2c10, 0x080c, 0x1011, - 0x00e8, 0x697c, 0x6894, 0x0016, 0x0006, 0x080c, 0x6332, 0x000e, + 0x0002, 0x4001, 0x9298, 0x000c, 0x23a0, 0x900e, 0x080c, 0x0db1, + 0x2001, 0x0000, 0x810f, 0x20a9, 0x0002, 0x4001, 0x0005, 0x89ff, + 0x0140, 0xa804, 0xa807, 0x0000, 0x0006, 0x080c, 0x103f, 0x009e, + 0x0cb0, 0x0005, 0x00e6, 0x2071, 0x1800, 0x080c, 0x10b8, 0x090c, + 0x0dd1, 0x00ee, 0x0005, 0x0086, 0x00e6, 0x0006, 0x0026, 0x0036, + 0x0126, 0x2091, 0x8000, 0x00c9, 0x2071, 0x1800, 0x73bc, 0x702c, + 0x9016, 0x9045, 0x0158, 0x8210, 0x9906, 0x090c, 0x0dd1, 0x2300, + 0x9202, 0x0120, 0x1a0c, 0x0dd1, 0xa000, 0x0c98, 0x012e, 0x003e, + 0x002e, 0x000e, 0x00ee, 0x008e, 0x0005, 0x0086, 0x00e6, 0x0006, + 0x0126, 0x2091, 0x8000, 0x2071, 0x190e, 0x7010, 0x9005, 0x0140, + 0x7018, 0x9045, 0x0128, 0x9906, 0x090c, 0x0dd1, 0xa000, 0x0cc8, + 0x012e, 0x000e, 0x00ee, 0x008e, 0x0005, 0x00e6, 0x2071, 0x1800, + 0x0126, 0x2091, 0x8000, 0x70bc, 0x8001, 0x0270, 0x70be, 0x702c, + 0x2048, 0x9085, 0x0001, 0xa800, 0x702e, 0xa803, 0x0000, 0xa807, + 0x0000, 0x012e, 0x00ee, 0x0005, 0x904e, 0x0cd8, 0x00e6, 0x0126, + 0x2091, 0x8000, 0x2071, 0x1800, 0x70bc, 0x90ca, 0x0040, 0x0268, + 0x8001, 0x70be, 0x702c, 0x2048, 0xa800, 0x702e, 0xa803, 0x0000, + 0xa807, 0x0000, 0x012e, 0x00ee, 0x0005, 0x904e, 0x0cd8, 0x00e6, + 0x0126, 0x2091, 0x8000, 0x0016, 0x890e, 0x810e, 0x810f, 0x9184, + 0x003f, 0xa862, 0x9184, 0xffc0, 0xa85e, 0x001e, 0x0020, 0x00e6, + 0x0126, 0x2091, 0x8000, 0x2071, 0x1800, 0x702c, 0xa802, 0x2900, + 0x702e, 0x70bc, 0x8000, 0x70be, 0x080c, 0x8091, 0x012e, 0x00ee, + 0x0005, 0x2071, 0x1800, 0x9026, 0x2009, 0x0000, 0x2049, 0x0400, + 0x2900, 0x702e, 0x8940, 0x2800, 0xa802, 0xa95e, 0xa863, 0x0001, + 0x8420, 0x9886, 0x0440, 0x0120, 0x2848, 0x9188, 0x0040, 0x0c90, + 0x2071, 0x188b, 0x7000, 0x9005, 0x11a0, 0x2001, 0x04d4, 0xa802, + 0x2048, 0x2009, 0x3500, 0x8940, 0x2800, 0xa802, 0xa95e, 0xa863, + 0x0001, 0x8420, 0x9886, 0x0800, 0x0120, 0x2848, 0x9188, 0x0040, + 0x0c90, 0x2071, 0x188b, 0x7104, 0x7200, 0x82ff, 0x01d0, 0x7308, + 0x8318, 0x831f, 0x831b, 0x831b, 0x7312, 0x8319, 0x2001, 0x0800, + 0xa802, 0x2048, 0x8900, 0xa802, 0x2040, 0xa95e, 0xaa62, 0x8420, + 0x2300, 0x9906, 0x0130, 0x2848, 0x9188, 0x0040, 0x9291, 0x0000, + 0x0c88, 0xa803, 0x0000, 0x2071, 0x1800, 0x74ba, 0x74be, 0x0005, + 0x00e6, 0x0016, 0x9984, 0xfc00, 0x01e8, 0x908c, 0xf800, 0x1168, + 0x9982, 0x0400, 0x02b8, 0x9982, 0x0440, 0x0278, 0x9982, 0x04d4, + 0x0288, 0x9982, 0x0800, 0x1270, 0x0040, 0x9982, 0x0800, 0x0250, + 0x2071, 0x188b, 0x7010, 0x9902, 0x1228, 0x9085, 0x0001, 0x001e, + 0x00ee, 0x0005, 0x9006, 0x0cd8, 0x00e6, 0x2071, 0x19f4, 0x7007, + 0x0000, 0x9006, 0x701e, 0x7022, 0x7002, 0x2071, 0x0000, 0x7010, + 0x9085, 0x8044, 0x7012, 0x2071, 0x0080, 0x9006, 0x20a9, 0x0040, + 0x7022, 0x1f04, 0x10f0, 0x702b, 0x0020, 0x00ee, 0x0005, 0x0126, + 0x2091, 0x8000, 0x00e6, 0xa06f, 0x0000, 0x2071, 0x19f4, 0x701c, + 0x9088, 0x19fe, 0x280a, 0x8000, 0x9084, 0x003f, 0x701e, 0x7120, + 0x9106, 0x090c, 0x0dd1, 0x7004, 0x9005, 0x1128, 0x00f6, 0x2079, + 0x0080, 0x00a9, 0x00fe, 0x00ee, 0x012e, 0x0005, 0x0126, 0x2091, + 0x8000, 0x00e6, 0x2071, 0x19f4, 0x7004, 0x9005, 0x1128, 0x00f6, + 0x2079, 0x0080, 0x0021, 0x00fe, 0x00ee, 0x012e, 0x0005, 0x7004, + 0x9086, 0x0000, 0x1110, 0x7007, 0x0006, 0x7000, 0x0002, 0x1139, + 0x1137, 0x1137, 0x1137, 0x12b0, 0x12b0, 0x12b0, 0x12b0, 0x080c, + 0x0dd1, 0x701c, 0x7120, 0x9106, 0x1148, 0x792c, 0x9184, 0x0001, + 0x1120, 0xd1fc, 0x1110, 0x7007, 0x0000, 0x0005, 0x0096, 0x9180, + 0x19fe, 0x2004, 0x700a, 0x2048, 0x8108, 0x918c, 0x003f, 0x7122, + 0x782b, 0x0026, 0xa88c, 0x7802, 0xa890, 0x7806, 0xa894, 0x780a, + 0xa898, 0x780e, 0xa878, 0x700e, 0xa870, 0x7016, 0xa874, 0x701a, + 0xa868, 0x009e, 0xd084, 0x0120, 0x7007, 0x0001, 0x0029, 0x0005, + 0x7007, 0x0002, 0x00b1, 0x0005, 0x0016, 0x0026, 0x710c, 0x2011, + 0x0040, 0x9182, 0x0040, 0x1210, 0x2110, 0x9006, 0x700e, 0x7212, + 0x8203, 0x7812, 0x782b, 0x0020, 0x782b, 0x0041, 0x002e, 0x001e, + 0x0005, 0x0016, 0x0026, 0x0136, 0x0146, 0x0156, 0x7014, 0x20e0, + 0x7018, 0x2098, 0x20e9, 0x0000, 0x20a1, 0x0088, 0x782b, 0x0026, + 0x710c, 0x2011, 0x0040, 0x9182, 0x0040, 0x1210, 0x2110, 0x9006, + 0x700e, 0x22a8, 0x4006, 0x8203, 0x7812, 0x782b, 0x0020, 0x3300, + 0x701a, 0x782b, 0x0001, 0x015e, 0x014e, 0x013e, 0x002e, 0x001e, + 0x0005, 0x2009, 0x19f4, 0x2104, 0xc095, 0x200a, 0x080c, 0x1116, + 0x0005, 0x0016, 0x00e6, 0x2071, 0x19f4, 0x00f6, 0x2079, 0x0080, + 0x792c, 0xd1bc, 0x190c, 0x0dca, 0x782b, 0x0002, 0xd1fc, 0x0120, + 0x918c, 0x0700, 0x7004, 0x0023, 0x00fe, 0x00ee, 0x001e, 0x0005, + 0x1127, 0x11cf, 0x1203, 0x0dd1, 0x0dd1, 0x12bc, 0x0dd1, 0x918c, + 0x0700, 0x1550, 0x0136, 0x0146, 0x0156, 0x7014, 0x20e8, 0x7018, + 0x20a0, 0x20e1, 0x0000, 0x2099, 0x0088, 0x782b, 0x0040, 0x7010, + 0x20a8, 0x4005, 0x3400, 0x701a, 0x015e, 0x014e, 0x013e, 0x700c, + 0x9005, 0x0578, 0x7800, 0x7802, 0x7804, 0x7806, 0x080c, 0x116c, + 0x0005, 0x7008, 0x0096, 0x2048, 0xa86f, 0x0100, 0x009e, 0x7007, + 0x0000, 0x080c, 0x1127, 0x0005, 0x7008, 0x0096, 0x2048, 0xa86f, + 0x0200, 0x009e, 0x0ca0, 0x918c, 0x0700, 0x1150, 0x700c, 0x9005, + 0x0180, 0x7800, 0x7802, 0x7804, 0x7806, 0x080c, 0x1181, 0x0005, + 0x7008, 0x0096, 0x2048, 0xa86f, 0x0200, 0x009e, 0x7007, 0x0000, + 0x0080, 0x0096, 0x7008, 0x2048, 0x7800, 0xa88e, 0x7804, 0xa892, + 0x7808, 0xa896, 0x780c, 0xa89a, 0xa86f, 0x0100, 0x009e, 0x7007, + 0x0000, 0x0096, 0x00d6, 0x7008, 0x2048, 0x2001, 0x18b7, 0x2004, + 0x9906, 0x1128, 0xa89c, 0x080f, 0x00de, 0x009e, 0x00a0, 0x00de, + 0x009e, 0x0096, 0x00d6, 0x7008, 0x2048, 0x0081, 0x0150, 0xa89c, + 0x0086, 0x2940, 0x080f, 0x008e, 0x00de, 0x009e, 0x080c, 0x1116, + 0x0005, 0x00de, 0x009e, 0x080c, 0x1116, 0x0005, 0xa8a8, 0xd08c, + 0x0005, 0x0096, 0xa0a0, 0x904d, 0x090c, 0x0dd1, 0xa06c, 0x908e, + 0x0100, 0x0130, 0xa87b, 0x0030, 0xa883, 0x0000, 0xa897, 0x4002, + 0x080c, 0x699e, 0xa09f, 0x0000, 0xa0a3, 0x0000, 0x2848, 0x080c, + 0x103f, 0x009e, 0x0005, 0x00a6, 0xa0a0, 0x904d, 0x090c, 0x0dd1, + 0xa06c, 0x908e, 0x0100, 0x0128, 0xa87b, 0x0001, 0xa883, 0x0000, + 0x00c0, 0xa80c, 0x2050, 0xb004, 0x9005, 0x0198, 0xa80e, 0x2050, + 0x8006, 0x8006, 0x8007, 0x908c, 0x003f, 0x9084, 0xffc0, 0x9080, + 0x0002, 0xa076, 0xa172, 0xb000, 0xa07a, 0x2810, 0x080c, 0x10f7, + 0x00e8, 0xa97c, 0xa894, 0x0016, 0x0006, 0x080c, 0x699e, 0x000e, 0x001e, 0xd1fc, 0x1138, 0xd1f4, 0x0128, 0x00c6, 0x2060, 0x080c, - 0x966d, 0x00ce, 0x7008, 0x2068, 0x683b, 0x0000, 0x683f, 0x0000, - 0x080c, 0x0fb1, 0x7007, 0x0000, 0x080c, 0x1031, 0x00fe, 0x0005, + 0x9d08, 0x00ce, 0x7008, 0x2048, 0xa89f, 0x0000, 0xa8a3, 0x0000, + 0x080c, 0x103f, 0x7007, 0x0000, 0x080c, 0x1116, 0x00ae, 0x0005, 0x0126, 0x2091, 0x8000, 0x782b, 0x1001, 0x7007, 0x0005, 0x7000, - 0xc094, 0x7002, 0x012e, 0x0005, 0x7007, 0x0000, 0x080c, 0x1042, - 0x0005, 0x0126, 0x2091, 0x2200, 0x2079, 0x0300, 0x2071, 0x139a, + 0xc094, 0x7002, 0x012e, 0x0005, 0x7007, 0x0000, 0x080c, 0x1127, + 0x0005, 0x0126, 0x2091, 0x2200, 0x2079, 0x0300, 0x2071, 0x1a3e, 0x7003, 0x0000, 0x78bf, 0x00f6, 0x781b, 0x4800, 0x00c1, 0x7803, - 0x0003, 0x780f, 0x0000, 0x20a9, 0x025f, 0x2061, 0xc979, 0x2c0d, - 0x7912, 0xe104, 0x9ce0, 0x0002, 0x7916, 0x1f04, 0x11ef, 0x7807, + 0x0003, 0x780f, 0x0000, 0x20a9, 0x025f, 0x2061, 0xd06e, 0x2c0d, + 0x7912, 0xe104, 0x9ce0, 0x0002, 0x7916, 0x1f04, 0x12d7, 0x7807, 0x0007, 0x7803, 0x0000, 0x7803, 0x0001, 0x012e, 0x0005, 0x00c6, 0x7803, 0x0000, 0x7808, 0xd09c, 0x0110, 0x7820, 0x0cd8, 0x2001, - 0x139b, 0x2003, 0x0000, 0x78ab, 0x0004, 0x78ac, 0xd0ac, 0x1de8, + 0x1a3f, 0x2003, 0x0000, 0x78ab, 0x0004, 0x78ac, 0xd0ac, 0x1de8, 0x78ab, 0x0002, 0x7807, 0x0007, 0x7827, 0x0030, 0x782b, 0x0400, - 0x7827, 0x0031, 0x782b, 0x13bd, 0x781f, 0xff00, 0x781b, 0xb700, + 0x7827, 0x0031, 0x782b, 0x1a61, 0x781f, 0xff00, 0x781b, 0xb700, 0x2001, 0x0200, 0x2004, 0xd0dc, 0x0110, 0x781f, 0x0303, 0x2061, - 0x13bd, 0x602f, 0x15c8, 0x6033, 0x1800, 0x603b, 0x1c36, 0x2001, - 0x2c98, 0xd0fc, 0x190c, 0x0dc9, 0x2001, 0x1110, 0x2004, 0xd0c4, - 0x1128, 0x2001, 0x0003, 0x2004, 0xd0d4, 0x1118, 0x783f, 0x2c98, - 0x0020, 0x9084, 0xc000, 0x783f, 0xac98, 0x00ce, 0x0005, 0x0126, - 0x2091, 0x2200, 0x7908, 0x9184, 0x0070, 0x190c, 0x0dc2, 0xd19c, - 0x0158, 0x7820, 0x908c, 0xf000, 0x15e8, 0x908a, 0x0024, 0x1a0c, - 0x0dc9, 0x0023, 0x012e, 0x0005, 0x012e, 0x0005, 0x1282, 0x1282, - 0x1299, 0x129e, 0x12a2, 0x12a7, 0x12ce, 0x12d2, 0x12df, 0x12e3, - 0x1282, 0x1366, 0x136a, 0x13d8, 0x1282, 0x1282, 0x1282, 0x1282, - 0x1282, 0x1282, 0x1282, 0x1282, 0x1282, 0x1282, 0x1282, 0x1282, - 0x1282, 0x12a9, 0x1282, 0x1282, 0x1282, 0x1282, 0x1282, 0x1282, - 0x1286, 0x1284, 0x080c, 0x0dc9, 0x080c, 0x0dc2, 0x080c, 0x13df, - 0x2009, 0x13b2, 0x2104, 0x8000, 0x200a, 0x080c, 0x753a, 0x080c, - 0x176f, 0x0005, 0x2009, 0x0048, 0x2060, 0x080c, 0x96df, 0x012e, - 0x0005, 0x7004, 0xc085, 0xc0b5, 0x7006, 0x0005, 0x7004, 0xc085, - 0x7006, 0x0005, 0x080c, 0x13df, 0x080c, 0x1538, 0x0005, 0x080c, - 0x0dc9, 0x080c, 0x13df, 0x2060, 0x6014, 0x9080, 0x000e, 0x2003, - 0xffff, 0x2009, 0x0048, 0x080c, 0x96df, 0x2001, 0x015d, 0x2003, - 0x0000, 0x2009, 0x03e8, 0x8109, 0x0160, 0x2001, 0x0201, 0x2004, - 0x9005, 0x0dc8, 0x2001, 0x0218, 0x2004, 0xd0ec, 0x1110, 0x080c, - 0x13e4, 0x2001, 0x0307, 0x2003, 0x8000, 0x0005, 0x7004, 0xc095, - 0x7006, 0x0005, 0x080c, 0x13df, 0x2060, 0x6014, 0x9080, 0x000e, - 0x2003, 0xffff, 0x2009, 0x0048, 0x080c, 0x96df, 0x0005, 0x080c, - 0x13df, 0x080c, 0x0dc9, 0x080c, 0x13df, 0x080c, 0x1351, 0x7827, - 0x0018, 0x79ac, 0xd1dc, 0x0540, 0x7827, 0x0015, 0x7828, 0x782b, - 0x0000, 0x9065, 0x0138, 0x2001, 0x020d, 0x2003, 0x0050, 0x2003, - 0x0020, 0x0400, 0x7004, 0x9005, 0x1180, 0x78ab, 0x0004, 0x7827, - 0x0018, 0x782b, 0x0000, 0xd1bc, 0x090c, 0x0dc9, 0x2001, 0x020d, - 0x2003, 0x0050, 0x2003, 0x0020, 0x0448, 0x78ab, 0x0004, 0x7803, - 0x0001, 0x080c, 0x136a, 0x0005, 0x7828, 0x782b, 0x0000, 0x9065, - 0x090c, 0x0dc9, 0x6014, 0x2068, 0x78ab, 0x0004, 0x918c, 0x0700, - 0x01a8, 0x080c, 0x753a, 0x080c, 0x176f, 0x080c, 0xafaf, 0x0158, - 0x69ac, 0x6936, 0x69b0, 0x693a, 0x683f, 0xffff, 0x6843, 0xffff, - 0x6880, 0xc0bd, 0x6882, 0x080c, 0xac2c, 0x0005, 0x2029, 0x00c8, - 0x8529, 0x0128, 0x2001, 0x0201, 0x2004, 0x9005, 0x0dc8, 0x7dbc, - 0x080c, 0xc922, 0xd5a4, 0x1118, 0x080c, 0x13e4, 0x0005, 0x080c, - 0x753a, 0x080c, 0x176f, 0x0005, 0x781f, 0x0300, 0x7803, 0x0001, - 0x0005, 0x0016, 0x0066, 0x0076, 0x00f6, 0x2079, 0x0300, 0x7908, - 0x918c, 0x0007, 0x9186, 0x0003, 0x0120, 0x2001, 0x0016, 0x080c, - 0x1455, 0x00fe, 0x007e, 0x006e, 0x001e, 0x0005, 0x7004, 0xc09d, - 0x7006, 0x0005, 0x7104, 0x9184, 0x0004, 0x190c, 0x0dc9, 0xd184, - 0x11b1, 0xd19c, 0x0180, 0xc19c, 0x7106, 0x0016, 0x080c, 0x151b, - 0x001e, 0x0148, 0x2001, 0x020d, 0x2003, 0x0050, 0x2003, 0x0020, - 0x080c, 0x13e4, 0x0005, 0x81ff, 0x190c, 0x0dc9, 0x0005, 0x2100, - 0xc184, 0xc1b4, 0x7106, 0xd0b4, 0x0016, 0x00e6, 0x15f0, 0x2071, - 0x0200, 0x080c, 0x150f, 0x080c, 0x151b, 0x05a0, 0x6014, 0x9005, - 0x05a0, 0x9080, 0x0019, 0x2004, 0x9084, 0x00ff, 0x908e, 0x0029, + 0x1a61, 0x602f, 0x1cc8, 0x2001, 0x1819, 0x2004, 0x9082, 0x1cc8, + 0x6032, 0x603b, 0x1f59, 0x2001, 0x3167, 0xd0fc, 0x190c, 0x0dd1, + 0x2001, 0x1810, 0x2004, 0xd0c4, 0x1128, 0x2001, 0x0003, 0x2004, + 0xd0d4, 0x1118, 0x783f, 0x3167, 0x0020, 0x9084, 0xc000, 0x783f, + 0xb167, 0x00ce, 0x0005, 0x0126, 0x2091, 0x2200, 0x7908, 0x9184, + 0x0070, 0x190c, 0x0dca, 0xd19c, 0x0158, 0x7820, 0x908c, 0xf000, + 0x15e8, 0x908a, 0x0024, 0x1a0c, 0x0dd1, 0x0023, 0x012e, 0x0005, + 0x012e, 0x0005, 0x136e, 0x136e, 0x1385, 0x138a, 0x138e, 0x1393, + 0x13bb, 0x13bf, 0x13cd, 0x13d1, 0x136e, 0x1454, 0x1458, 0x14c8, + 0x136e, 0x136e, 0x136e, 0x136e, 0x136e, 0x136e, 0x136e, 0x136e, + 0x136e, 0x136e, 0x136e, 0x136e, 0x136e, 0x1395, 0x136e, 0x136e, + 0x136e, 0x136e, 0x136e, 0x136e, 0x1372, 0x1370, 0x080c, 0x0dd1, + 0x080c, 0x0dca, 0x080c, 0x14cf, 0x2009, 0x1a56, 0x2104, 0x8000, + 0x200a, 0x080c, 0x7bb0, 0x080c, 0x1984, 0x0005, 0x2009, 0x0048, + 0x2060, 0x080c, 0x9d7a, 0x012e, 0x0005, 0x7004, 0xc085, 0xc0b5, + 0x7006, 0x0005, 0x7004, 0xc085, 0x7006, 0x0005, 0x080c, 0x14cf, + 0x080c, 0x1628, 0x0005, 0x080c, 0x0dd1, 0x080c, 0x14cf, 0x2060, + 0x6014, 0x0096, 0x2048, 0xa83b, 0xffff, 0x009e, 0x2009, 0x0048, + 0x080c, 0x9d7a, 0x2001, 0x015d, 0x2003, 0x0000, 0x2009, 0x03e8, + 0x8109, 0x0160, 0x2001, 0x0201, 0x2004, 0x9005, 0x0dc8, 0x2001, + 0x0218, 0x2004, 0xd0ec, 0x1110, 0x080c, 0x14d4, 0x2001, 0x0307, + 0x2003, 0x8000, 0x0005, 0x7004, 0xc095, 0x7006, 0x0005, 0x080c, + 0x14cf, 0x2060, 0x6014, 0x0096, 0x2048, 0xa83b, 0xffff, 0x009e, + 0x2009, 0x0048, 0x080c, 0x9d7a, 0x0005, 0x080c, 0x14cf, 0x080c, + 0x0dd1, 0x080c, 0x14cf, 0x080c, 0x143f, 0x7827, 0x0018, 0x79ac, + 0xd1dc, 0x0540, 0x7827, 0x0015, 0x7828, 0x782b, 0x0000, 0x9065, + 0x0138, 0x2001, 0x020d, 0x2003, 0x0050, 0x2003, 0x0020, 0x0400, + 0x7004, 0x9005, 0x1180, 0x78ab, 0x0004, 0x7827, 0x0018, 0x782b, + 0x0000, 0xd1bc, 0x090c, 0x0dd1, 0x2001, 0x020d, 0x2003, 0x0050, + 0x2003, 0x0020, 0x0448, 0x78ab, 0x0004, 0x7803, 0x0001, 0x080c, + 0x1458, 0x0005, 0x7828, 0x782b, 0x0000, 0x9065, 0x090c, 0x0dd1, + 0x6014, 0x2048, 0x78ab, 0x0004, 0x918c, 0x0700, 0x01a8, 0x080c, + 0x7bb0, 0x080c, 0x1984, 0x080c, 0xb6a7, 0x0158, 0xa9ac, 0xa936, + 0xa9b0, 0xa93a, 0xa83f, 0xffff, 0xa843, 0xffff, 0xa880, 0xc0bd, + 0xa882, 0x080c, 0xb31a, 0x0005, 0x2029, 0x00c8, 0x8529, 0x0128, + 0x2001, 0x0201, 0x2004, 0x9005, 0x0dc8, 0x7dbc, 0x080c, 0xd017, + 0xd5a4, 0x1118, 0x080c, 0x14d4, 0x0005, 0x080c, 0x7bb0, 0x080c, + 0x1984, 0x0005, 0x781f, 0x0300, 0x7803, 0x0001, 0x0005, 0x0016, + 0x0066, 0x0076, 0x00f6, 0x2079, 0x0300, 0x7908, 0x918c, 0x0007, + 0x9186, 0x0003, 0x0120, 0x2001, 0x0016, 0x080c, 0x1545, 0x00fe, + 0x007e, 0x006e, 0x001e, 0x0005, 0x7004, 0xc09d, 0x7006, 0x0005, + 0x7104, 0x9184, 0x0004, 0x190c, 0x0dd1, 0xd184, 0x11b1, 0xd19c, + 0x0180, 0xc19c, 0x7106, 0x0016, 0x080c, 0x160b, 0x001e, 0x0148, + 0x2001, 0x020d, 0x2003, 0x0050, 0x2003, 0x0020, 0x080c, 0x14d4, + 0x0005, 0x81ff, 0x190c, 0x0dd1, 0x0005, 0x2100, 0xc184, 0xc1b4, + 0x7106, 0xd0b4, 0x0016, 0x00e6, 0x1904, 0x14bd, 0x2071, 0x0200, + 0x080c, 0x15ff, 0x080c, 0x160b, 0x05a8, 0x6014, 0x9005, 0x05a8, + 0x0096, 0x2048, 0xa864, 0x009e, 0x9084, 0x00ff, 0x908e, 0x0029, 0x0160, 0x908e, 0x0048, 0x1548, 0x601c, 0xd084, 0x11d8, 0x00f6, - 0x2c78, 0x080c, 0x1574, 0x00fe, 0x00a8, 0x00f6, 0x2c78, 0x080c, - 0x1645, 0x00fe, 0x2009, 0x01f4, 0x8109, 0x0160, 0x2001, 0x0201, + 0x2c78, 0x080c, 0x1664, 0x00fe, 0x00a8, 0x00f6, 0x2c78, 0x080c, + 0x17a8, 0x00fe, 0x2009, 0x01f4, 0x8109, 0x0160, 0x2001, 0x0201, 0x2004, 0x9005, 0x0dc8, 0x2001, 0x0218, 0x2004, 0xd0ec, 0x1110, - 0x0419, 0x0040, 0x2001, 0x020d, 0x2003, 0x0020, 0x080c, 0x11ff, - 0x7803, 0x0001, 0x00ee, 0x001e, 0x0005, 0x080c, 0x151b, 0x0dd0, + 0x0419, 0x0040, 0x2001, 0x020d, 0x2003, 0x0020, 0x080c, 0x12e7, + 0x7803, 0x0001, 0x00ee, 0x001e, 0x0005, 0x080c, 0x160b, 0x0dd0, 0x2001, 0x020d, 0x2003, 0x0050, 0x2003, 0x0020, 0x0069, 0x0c90, - 0x0031, 0x2060, 0x2009, 0x0053, 0x080c, 0x96df, 0x0005, 0x7808, - 0xd09c, 0x0de8, 0x7820, 0x0005, 0x080c, 0x1351, 0x00d6, 0x2069, + 0x0031, 0x2060, 0x2009, 0x0053, 0x080c, 0x9d7a, 0x0005, 0x7808, + 0xd09c, 0x0de8, 0x7820, 0x0005, 0x080c, 0x143f, 0x00d6, 0x2069, 0x0200, 0x2009, 0x01f4, 0x8109, 0x0510, 0x6804, 0x9005, 0x0dd8, 0x2001, 0x015d, 0x2003, 0x0000, 0x79bc, 0xd1a4, 0x1528, 0x79b8, 0x918c, 0x0fff, 0x0180, 0x9182, 0x0841, 0x1268, 0x9188, 0x0007, - 0x918c, 0x0ff8, 0x810c, 0x810c, 0x810c, 0x080c, 0x1447, 0x6827, + 0x918c, 0x0ff8, 0x810c, 0x810c, 0x810c, 0x080c, 0x1537, 0x6827, 0x0001, 0x8109, 0x1dd0, 0x04d9, 0x6827, 0x0002, 0x04c1, 0x6804, 0x9005, 0x1130, 0x682c, 0xd0e4, 0x1500, 0x6804, 0x9005, 0x0de8, - 0x79b8, 0xd1ec, 0x1130, 0x08c0, 0x080c, 0x753a, 0x080c, 0x176f, + 0x79b8, 0xd1ec, 0x1130, 0x08c0, 0x080c, 0x7bb0, 0x080c, 0x1984, 0x0090, 0x7827, 0x0015, 0x782b, 0x0000, 0x7827, 0x0018, 0x782b, 0x0000, 0x2001, 0x020d, 0x2003, 0x0020, 0x2001, 0x0307, 0x2003, 0x0300, 0x7803, 0x0001, 0x00de, 0x0005, 0x682c, 0x9084, 0x5400, @@ -433,304 +464,415 @@ 0x9084, 0x0003, 0x1de0, 0x0005, 0x2001, 0x0030, 0x2c08, 0x621c, 0x0021, 0x7830, 0x9086, 0x0041, 0x0005, 0x00f6, 0x2079, 0x0300, 0x0006, 0x7808, 0xd09c, 0x0140, 0x0016, 0x0026, 0x00c6, 0x080c, - 0x1247, 0x00ce, 0x002e, 0x001e, 0x000e, 0x0006, 0x7832, 0x7936, + 0x1333, 0x00ce, 0x002e, 0x001e, 0x000e, 0x0006, 0x7832, 0x7936, 0x7a3a, 0x781b, 0x8080, 0x0059, 0x1118, 0x000e, 0x00fe, 0x0005, - 0x000e, 0x792c, 0x3900, 0x8000, 0x2004, 0x080c, 0x0dc9, 0x2009, - 0x110c, 0x2104, 0xc0f4, 0x200a, 0x2009, 0xff00, 0x8109, 0x0904, - 0x14d3, 0x7a18, 0x9284, 0x0030, 0x0904, 0x14ce, 0x9284, 0x0048, - 0x9086, 0x0008, 0x1904, 0x14ce, 0x2001, 0x0109, 0x2004, 0xd08c, + 0x000e, 0x792c, 0x3900, 0x8000, 0x2004, 0x080c, 0x0dd1, 0x2009, + 0x180c, 0x2104, 0xc0f4, 0x200a, 0x2009, 0xff00, 0x8109, 0x0904, + 0x15c3, 0x7a18, 0x9284, 0x0030, 0x0904, 0x15be, 0x9284, 0x0048, + 0x9086, 0x0008, 0x1904, 0x15be, 0x2001, 0x0109, 0x2004, 0xd08c, 0x01f0, 0x0006, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x0126, - 0x2091, 0x2800, 0x00f6, 0x0026, 0x0016, 0x2009, 0x13b5, 0x2104, - 0x8000, 0x0208, 0x200a, 0x080c, 0x7e23, 0x001e, 0x002e, 0x00fe, + 0x2091, 0x2800, 0x00f6, 0x0026, 0x0016, 0x2009, 0x1a59, 0x2104, + 0x8000, 0x0208, 0x200a, 0x080c, 0x84a8, 0x001e, 0x002e, 0x00fe, 0x012e, 0x015e, 0x014e, 0x013e, 0x01de, 0x01ce, 0x000e, 0x2001, 0x009b, 0x2004, 0xd0fc, 0x01d0, 0x0006, 0x0126, 0x01c6, 0x01d6, - 0x0136, 0x0146, 0x0156, 0x00f6, 0x0016, 0x2009, 0x13b6, 0x2104, - 0x8000, 0x0208, 0x200a, 0x080c, 0x1ac8, 0x001e, 0x00fe, 0x015e, + 0x0136, 0x0146, 0x0156, 0x00f6, 0x0016, 0x2009, 0x1a5a, 0x2104, + 0x8000, 0x0208, 0x200a, 0x080c, 0x1d7d, 0x001e, 0x00fe, 0x015e, 0x014e, 0x013e, 0x01de, 0x01ce, 0x012e, 0x000e, 0x7818, 0xd0bc, - 0x1904, 0x147e, 0x0005, 0x2001, 0x110c, 0x2004, 0xd0f4, 0x1528, + 0x1904, 0x156e, 0x0005, 0x2001, 0x180c, 0x2004, 0xd0f4, 0x1528, 0x7a18, 0x9284, 0x0030, 0x0508, 0x9284, 0x0048, 0x9086, 0x0008, - 0x11e0, 0x2001, 0x132d, 0x2004, 0x9005, 0x01b8, 0x2001, 0x139d, - 0x2004, 0x9086, 0x0000, 0x0188, 0x2009, 0x13b4, 0x2104, 0x8000, - 0x0208, 0x200a, 0x080c, 0x8ee3, 0x2009, 0x110c, 0x2104, 0xc0f5, - 0x200a, 0x2009, 0xff00, 0x0804, 0x147e, 0x9085, 0x0001, 0x0005, - 0x7832, 0x7936, 0x7a3a, 0x781b, 0x8080, 0x080c, 0x1477, 0x1108, - 0x0005, 0x792c, 0x3900, 0x8000, 0x2004, 0x080c, 0x0dc9, 0x7037, + 0x11e0, 0x2001, 0x19d0, 0x2004, 0x9005, 0x01b8, 0x2001, 0x1a41, + 0x2004, 0x9086, 0x0000, 0x0188, 0x2009, 0x1a58, 0x2104, 0x8000, + 0x0208, 0x200a, 0x080c, 0x94c6, 0x2009, 0x180c, 0x2104, 0xc0f5, + 0x200a, 0x2009, 0xff00, 0x0804, 0x156e, 0x9085, 0x0001, 0x0005, + 0x7832, 0x7936, 0x7a3a, 0x781b, 0x8080, 0x080c, 0x1567, 0x1108, + 0x0005, 0x792c, 0x3900, 0x8000, 0x2004, 0x080c, 0x0dd1, 0x7037, 0x0001, 0x7150, 0x7037, 0x0002, 0x7050, 0x2060, 0xd1bc, 0x1110, 0x7054, 0x2060, 0x0005, 0x0006, 0x0046, 0x00e6, 0x2071, 0x0200, 0x7037, 0x0002, 0x7058, 0x9084, 0xff00, 0x8007, 0x9086, 0x00bc, - 0x1158, 0x2021, 0x13b3, 0x2404, 0x8000, 0x0208, 0x2022, 0x080c, - 0x753a, 0x080c, 0x176f, 0x9006, 0x00ee, 0x004e, 0x000e, 0x0005, + 0x1158, 0x2021, 0x1a57, 0x2404, 0x8000, 0x0208, 0x2022, 0x080c, + 0x7bb0, 0x080c, 0x1984, 0x9006, 0x00ee, 0x004e, 0x000e, 0x0005, 0x0c11, 0x1108, 0x0005, 0x00e6, 0x0016, 0x2071, 0x0200, 0x0879, - 0x7358, 0x745c, 0x6014, 0x905d, 0x0520, 0x2b68, 0x6b42, 0x6c3e, - 0x2001, 0x117d, 0x2004, 0xd0b4, 0x1138, 0x601c, 0xd0e4, 0x1120, - 0x683b, 0x7fff, 0x6837, 0xffff, 0x080c, 0x1c56, 0x1190, 0x080c, - 0x16a1, 0x2a00, 0x6816, 0x0130, 0x2c00, 0x680e, 0x2805, 0x680a, - 0x2800, 0x6812, 0x7037, 0x0020, 0x781f, 0x0300, 0x001e, 0x00ee, + 0x7358, 0x745c, 0x6014, 0x905d, 0x0520, 0x2b48, 0xab42, 0xac3e, + 0x2001, 0x187d, 0x2004, 0xd0b4, 0x1138, 0x601c, 0xd0e4, 0x1120, + 0xa83b, 0x7fff, 0xa837, 0xffff, 0x080c, 0x1f79, 0x1190, 0x080c, + 0x1805, 0x2a00, 0xa816, 0x0130, 0x2800, 0xa80e, 0x2c05, 0xa80a, + 0x2c00, 0xa812, 0x7037, 0x0020, 0x781f, 0x0300, 0x001e, 0x00ee, 0x0005, 0x7037, 0x0050, 0x7037, 0x0020, 0x001e, 0x00ee, 0x080c, - 0x13e4, 0x0005, 0x080c, 0x0dc9, 0x2001, 0x110d, 0x2004, 0xd08c, - 0x190c, 0x6033, 0x2ff0, 0x0126, 0x2091, 0x2200, 0x0016, 0x00c6, - 0x3e60, 0x6014, 0x2068, 0x2d60, 0x903e, 0x2730, 0x6964, 0x691a, - 0x9184, 0x000f, 0x9088, 0x1c36, 0x2145, 0x0002, 0x15a5, 0x160c, - 0x15a5, 0x15a5, 0x15a5, 0x15e5, 0x15a5, 0x15a9, 0x159e, 0x15fa, - 0x15a5, 0x15a5, 0x15a5, 0x163d, 0x15cf, 0x15bb, 0x6964, 0x918c, - 0x00ff, 0x918e, 0x0048, 0x0904, 0x15fa, 0x9085, 0x0001, 0x0804, - 0x1633, 0x687c, 0xd0bc, 0x0dc8, 0x6890, 0x6842, 0x688c, 0x683e, - 0x6888, 0x00d6, 0x2805, 0x9c68, 0x6b08, 0x6a0c, 0x6d00, 0x6c04, - 0x00de, 0x0804, 0x161b, 0x687c, 0xd0bc, 0x0d38, 0x6890, 0x6842, - 0x688c, 0x683e, 0x6888, 0x00d6, 0x2805, 0x9c68, 0x6b10, 0x6a14, - 0x6d00, 0x6c04, 0x6f08, 0x6e0c, 0x00de, 0x0804, 0x161b, 0x687c, - 0xd0bc, 0x0998, 0x6890, 0x6842, 0x688c, 0x683e, 0x6804, 0x2060, - 0x9080, 0x0019, 0x200c, 0x691a, 0x91cc, 0x000f, 0x9980, 0x1c36, - 0x2045, 0x6888, 0xd19c, 0x11e8, 0x0470, 0x687c, 0xd0ac, 0x0904, - 0x15a5, 0x6804, 0x2060, 0x9080, 0x0019, 0x200c, 0x691a, 0x91cc, - 0x000f, 0x9980, 0x1c36, 0x2045, 0x9006, 0x6842, 0x683e, 0xd19c, - 0x1140, 0x00c8, 0x687c, 0xd0ac, 0x0904, 0x15a5, 0x9006, 0x6842, - 0x683e, 0x00d6, 0x2805, 0x9c68, 0x6b10, 0x6a14, 0x6d00, 0x6c04, - 0x6f08, 0x6e0c, 0x00de, 0x0078, 0x687c, 0xd0ac, 0x0904, 0x15a5, - 0x9006, 0x6842, 0x683e, 0x00d6, 0x2805, 0x9c68, 0x6b08, 0x6a0c, - 0x6d00, 0x6c04, 0x00de, 0x6b2e, 0x6a32, 0x6d1e, 0x6c22, 0x6f26, - 0x6e2a, 0x6988, 0x8840, 0x281d, 0x68ac, 0x6ab0, 0x6836, 0x6a3a, - 0x8109, 0x6916, 0x1160, 0x3e60, 0x601c, 0xc085, 0x601e, 0x687c, - 0xc0dd, 0x687e, 0x9006, 0x00ce, 0x001e, 0x012e, 0x0005, 0x2c00, - 0x680e, 0x6b0a, 0x2800, 0x6812, 0x0c70, 0x0804, 0x15a5, 0x2001, - 0x110d, 0x2004, 0xd08c, 0x190c, 0x6033, 0x2ff0, 0x0126, 0x2091, - 0x2200, 0x0016, 0x00c6, 0x3e60, 0x6014, 0x2068, 0x2d60, 0x680e, - 0x2041, 0x1c31, 0x6813, 0x1c31, 0x2805, 0x680a, 0x6964, 0x691a, - 0x687c, 0xd0ac, 0x090c, 0x0dc9, 0x9006, 0x6842, 0x683e, 0x00d6, - 0x2805, 0x9c68, 0x6b10, 0x6a14, 0x6d00, 0x6c04, 0x6f08, 0x6e0c, - 0x00de, 0x6b2e, 0x6a32, 0x6d1e, 0x6c22, 0x6f26, 0x6e2a, 0x68ac, - 0x6ab0, 0x6836, 0x6a3a, 0x6988, 0x6864, 0x9084, 0x00ff, 0x9086, - 0x0008, 0x1120, 0x8109, 0x6916, 0x0128, 0x0080, 0x918a, 0x0002, - 0x6916, 0x1160, 0x3e60, 0x601c, 0xc085, 0x601e, 0x687c, 0xc0dd, - 0x687e, 0x9006, 0x00ce, 0x001e, 0x012e, 0x0005, 0x6804, 0x9065, - 0x090c, 0x0dc9, 0x680e, 0x6064, 0x681a, 0x9084, 0x000f, 0x9080, - 0x1c36, 0x2015, 0x82ff, 0x090c, 0x0dc9, 0x6a12, 0x2205, 0x680a, - 0x0c08, 0x903e, 0x2730, 0x6880, 0xd0fc, 0x11a8, 0x00d6, 0x2805, - 0x9c68, 0x2900, 0x0002, 0x16e3, 0x16c9, 0x16c9, 0x16e3, 0x16e3, - 0x16dd, 0x16e3, 0x16c9, 0x16ce, 0x16ce, 0x16ce, 0x16e3, 0x16e3, - 0x16e3, 0x16d5, 0x16ce, 0xc0fc, 0x6882, 0x6b2c, 0x6a30, 0x6d1c, - 0x6c20, 0x00d6, 0xd99c, 0x0510, 0x2805, 0x9c68, 0x6f08, 0x6e0c, - 0x00e8, 0x6b08, 0x6a0c, 0x6d00, 0x6c04, 0x00c0, 0x6b10, 0x6a14, - 0x6d00, 0x6c04, 0x6f08, 0x6e0c, 0x0088, 0x00de, 0x00d6, 0x6864, - 0x9084, 0x00ff, 0x9086, 0x001e, 0x1130, 0x00de, 0x080c, 0x1bee, - 0x1900, 0x900e, 0x0060, 0x00de, 0x080c, 0x0dc9, 0x00de, 0x6b2e, - 0x6a32, 0x6d1e, 0x6c22, 0x6f26, 0x6e2a, 0x080c, 0x1bee, 0x0005, - 0x6014, 0x2068, 0x6118, 0x81ff, 0x0148, 0x810c, 0x810c, 0x810c, - 0x81ff, 0x1118, 0x6887, 0x0001, 0x0008, 0x6986, 0x601b, 0x0002, - 0x6874, 0x9084, 0x00ff, 0x9084, 0x0008, 0x0150, 0x00e9, 0x6000, - 0x9086, 0x0004, 0x1120, 0x2009, 0x0048, 0x080c, 0x96df, 0x0005, - 0x6974, 0xd1dc, 0x1108, 0x0005, 0x6934, 0x688c, 0x9106, 0x1158, - 0x6938, 0x6890, 0x9106, 0x1138, 0x601c, 0xc084, 0x601e, 0x2009, - 0x0048, 0x0804, 0x96df, 0x0005, 0x0126, 0x00c6, 0x2091, 0x2200, - 0x00ce, 0x7908, 0x918c, 0x0007, 0x9186, 0x0000, 0x05b0, 0x9186, - 0x0003, 0x0598, 0x6020, 0x6023, 0x0000, 0x0006, 0x2031, 0x0008, - 0x00c6, 0x781f, 0x0808, 0x7808, 0xd09c, 0x0120, 0x080c, 0x1247, - 0x8631, 0x1db8, 0x00ce, 0x781f, 0x0800, 0x2031, 0x0168, 0x00c6, - 0x7808, 0xd09c, 0x190c, 0x1247, 0x00ce, 0x2001, 0x0038, 0x080c, - 0x17ff, 0x7930, 0x9186, 0x0040, 0x0160, 0x9186, 0x0042, 0x190c, - 0x0dc9, 0x2001, 0x001e, 0x8001, 0x1df0, 0x8631, 0x1d40, 0x080c, - 0x180e, 0x000e, 0x6022, 0x012e, 0x0005, 0x080c, 0x17fb, 0x7827, - 0x0015, 0x7828, 0x9c06, 0x1db8, 0x782b, 0x0000, 0x0ca0, 0x00f6, - 0x2079, 0x0300, 0x7803, 0x0000, 0x78ab, 0x0004, 0x2001, 0xf000, - 0x8001, 0x090c, 0x0dc9, 0x7aac, 0xd2ac, 0x1dd0, 0x00fe, 0x080c, - 0x6b1f, 0x1188, 0x2001, 0x0138, 0x2003, 0x0000, 0x2001, 0x0160, - 0x2003, 0x0000, 0x2011, 0x012c, 0xa001, 0xa001, 0x8211, 0x1de0, - 0x0059, 0x0804, 0x6bcd, 0x0479, 0x0039, 0x2001, 0x0160, 0x2502, - 0x2001, 0x0138, 0x2202, 0x0005, 0x00e6, 0x2071, 0x0200, 0x080c, - 0x25dc, 0x2009, 0x003c, 0x080c, 0x1e33, 0x2001, 0x015d, 0x2003, - 0x0000, 0x7000, 0x9084, 0x003c, 0x1de0, 0x080c, 0x7a1d, 0x70a0, - 0x70a2, 0x7098, 0x709a, 0x709c, 0x709e, 0x2001, 0x020d, 0x2003, - 0x0020, 0x00f6, 0x2079, 0x0300, 0x080c, 0x11ff, 0x7803, 0x0001, - 0x00fe, 0x00ee, 0x0005, 0x2001, 0x0138, 0x2014, 0x2003, 0x0000, - 0x2001, 0x0160, 0x202c, 0x2003, 0x0000, 0x080c, 0x6b1f, 0x1108, - 0x0005, 0x2021, 0x0260, 0x2001, 0x0141, 0x201c, 0xd3dc, 0x1168, - 0x2001, 0x0109, 0x201c, 0x939c, 0x0048, 0x1160, 0x2001, 0x0111, - 0x201c, 0x83ff, 0x1110, 0x8421, 0x1d70, 0x2001, 0x015d, 0x2003, - 0x0000, 0x0005, 0x0046, 0x2021, 0x0019, 0x2003, 0x0048, 0xa001, - 0xa001, 0x201c, 0x939c, 0x0048, 0x0120, 0x8421, 0x1db0, 0x004e, - 0x0c60, 0x004e, 0x0c40, 0x601c, 0xc084, 0x601e, 0x0005, 0x2c08, - 0x621c, 0x080c, 0x1455, 0x7930, 0x0005, 0x2c08, 0x621c, 0x080c, - 0x1500, 0x7930, 0x0005, 0x8001, 0x1df0, 0x0005, 0x2031, 0x0064, - 0x781c, 0x9084, 0x0007, 0x0170, 0x2001, 0x0038, 0x0c41, 0x9186, - 0x0040, 0x0904, 0x186c, 0x2001, 0x001e, 0x0c69, 0x8631, 0x1d80, - 0x080c, 0x0dc9, 0x781f, 0x0202, 0x2001, 0x015d, 0x2003, 0x0000, - 0x2001, 0x0dac, 0x0c01, 0x781c, 0xd084, 0x0110, 0x0861, 0x04e0, - 0x2001, 0x0030, 0x0891, 0x9186, 0x0040, 0x0568, 0x781c, 0xd084, - 0x1da8, 0x781f, 0x0101, 0x2001, 0x0014, 0x0869, 0x2001, 0x0037, - 0x0821, 0x9186, 0x0040, 0x0140, 0x2001, 0x0030, 0x080c, 0x1805, - 0x9186, 0x0040, 0x190c, 0x0dc9, 0x00d6, 0x2069, 0x0200, 0x692c, - 0xd1f4, 0x1170, 0xd1c4, 0x0160, 0xd19c, 0x0130, 0x6800, 0x9085, - 0x1800, 0x6802, 0x00de, 0x0080, 0x6908, 0x9184, 0x0007, 0x1db0, - 0x00de, 0x781f, 0x0100, 0x791c, 0x9184, 0x0007, 0x090c, 0x0dc9, - 0xa001, 0xa001, 0x781f, 0x0200, 0x0005, 0x00e6, 0x2071, 0x139d, - 0x7003, 0x0000, 0x00ee, 0x0005, 0x00d6, 0x9280, 0x0005, 0x206c, - 0x697c, 0xd1dc, 0x1904, 0x1903, 0x6964, 0x9184, 0x0007, 0x0002, - 0x1888, 0x18ee, 0x18a1, 0x18a1, 0x18a1, 0x18d5, 0x18b4, 0x18a3, - 0x918c, 0x00ff, 0x9186, 0x0008, 0x1180, 0x687c, 0xd0b4, 0x0904, - 0x1a80, 0x9006, 0x6842, 0x683e, 0x6988, 0x2d00, 0x685a, 0x2001, - 0x1c31, 0x2005, 0x6812, 0x0804, 0x18ff, 0x9186, 0x0048, 0x0904, - 0x18ee, 0x080c, 0x0dc9, 0x687c, 0xd0b4, 0x0904, 0x1a80, 0x6890, - 0x6842, 0x683a, 0x688c, 0x683e, 0x6836, 0x68ac, 0x6846, 0x68b0, - 0x684a, 0x6988, 0x0804, 0x18f6, 0x6864, 0x9084, 0x00ff, 0x9086, - 0x001e, 0x1d38, 0x687c, 0xd0b4, 0x0904, 0x1a80, 0x6890, 0x6842, - 0x683a, 0x688c, 0x683e, 0x6836, 0x68ac, 0x6846, 0x68b0, 0x684a, - 0x6804, 0x685a, 0x9080, 0x0019, 0x2004, 0x9084, 0x000f, 0x9080, - 0x1c36, 0x2005, 0x6812, 0x6988, 0x0450, 0x918c, 0x00ff, 0x9186, - 0x0015, 0x1548, 0x687c, 0xd0b4, 0x0904, 0x1a80, 0x6804, 0x685a, - 0x9080, 0x0019, 0x2004, 0x9084, 0x000f, 0x9080, 0x1c36, 0x2005, - 0x6812, 0x6988, 0x9006, 0x6842, 0x683e, 0x0088, 0x687c, 0xd0b4, - 0x0904, 0x1a80, 0x6988, 0x9006, 0x6842, 0x683e, 0x2d00, 0x685a, - 0x6864, 0x9084, 0x000f, 0x9080, 0x1c36, 0x2005, 0x6812, 0x6916, - 0x687c, 0xc0dd, 0x687e, 0x00de, 0x0005, 0x00f6, 0x2079, 0x0090, - 0x782c, 0xd0fc, 0x190c, 0x1ac8, 0x00e6, 0x00d6, 0x2071, 0x139d, - 0x7000, 0x9005, 0x1904, 0x1973, 0x00c6, 0x7206, 0x9280, 0x0005, - 0x205c, 0x7004, 0x2068, 0x782b, 0x0004, 0x2001, 0x0200, 0x2003, - 0x0040, 0x6810, 0x00d6, 0x2068, 0x686c, 0x7836, 0x6890, 0x00f6, - 0x2079, 0x0200, 0x7803, 0x0040, 0xa001, 0xa001, 0xa001, 0xa001, - 0xa001, 0xa001, 0x781a, 0x78d7, 0x0000, 0x00fe, 0x00de, 0x2b68, - 0x6814, 0x2050, 0x6858, 0x2060, 0x6810, 0x2040, 0x6064, 0x90cc, - 0x000f, 0x6944, 0x791a, 0x7116, 0x6848, 0x781e, 0x701a, 0x9006, - 0x700e, 0x7012, 0x7004, 0x6940, 0x6838, 0x9106, 0x1540, 0x693c, - 0x6834, 0x9106, 0x1520, 0x0006, 0x0016, 0x6938, 0x6834, 0x9105, - 0x0118, 0x001e, 0x000e, 0x00d8, 0x001e, 0x000e, 0x8aff, 0x0510, - 0x0126, 0x2091, 0x8000, 0x2009, 0x0306, 0x200b, 0x0808, 0x2079, - 0x0090, 0x2009, 0x0001, 0x0409, 0x0118, 0x2009, 0x0001, 0x00e9, - 0x012e, 0x00ce, 0x9006, 0x00de, 0x00ee, 0x00fe, 0x0005, 0x0036, - 0x0046, 0x6b38, 0x6c34, 0x080c, 0x1c56, 0x004e, 0x003e, 0x09f0, - 0x00ce, 0x0c88, 0x00ce, 0x9085, 0x0001, 0x0c68, 0x2009, 0x0306, - 0x200b, 0x4800, 0x7027, 0x0000, 0x0005, 0x0076, 0x0066, 0x0056, - 0x0046, 0x0036, 0x0026, 0x8aff, 0x0904, 0x1a79, 0x700c, 0x7214, - 0x923a, 0x7010, 0x7218, 0x9203, 0x0a04, 0x1a78, 0x9705, 0x0904, - 0x1a78, 0x903e, 0x2730, 0x6880, 0xd0fc, 0x11a8, 0x00d6, 0x2805, - 0x9c68, 0x2900, 0x0002, 0x1a05, 0x19ca, 0x19ca, 0x1a05, 0x1a05, - 0x19df, 0x1a05, 0x19ca, 0x19e7, 0x19d0, 0x19d0, 0x1a05, 0x1a05, - 0x1a05, 0x19d7, 0x19d0, 0xc0fc, 0x6882, 0x6b2c, 0x6a30, 0x6d1c, - 0x6c20, 0xd99c, 0x0904, 0x1a09, 0x00d6, 0x2805, 0x9c68, 0x6f08, - 0x6e0c, 0x04f0, 0x6b08, 0x6a0c, 0x6d00, 0x6c04, 0x04c8, 0x2268, - 0x6b10, 0x6a14, 0x6d00, 0x6c04, 0x6f08, 0x6e0c, 0x0488, 0x00de, - 0x00d6, 0x6864, 0x9084, 0x00ff, 0x9086, 0x001e, 0x1530, 0x00de, - 0x080c, 0x1bee, 0x1904, 0x1993, 0x900e, 0x0804, 0x1a79, 0x2d10, - 0x00de, 0x00d6, 0x6b64, 0x939c, 0x00ff, 0x9386, 0x0048, 0x1178, - 0x00c6, 0x7004, 0x2060, 0x6004, 0x9086, 0x0043, 0x00ce, 0x09b8, - 0x6b9c, 0x9016, 0x6d8c, 0x6c90, 0x6f94, 0x6e98, 0x0048, 0x9386, - 0x0008, 0x0968, 0x00de, 0x080c, 0x0dc9, 0x00de, 0x080c, 0x0dc9, - 0x00de, 0x0016, 0x2009, 0x030f, 0x2104, 0xd0fc, 0x0538, 0x0066, - 0x2009, 0x0306, 0x2134, 0x200b, 0x4000, 0x2104, 0x9084, 0x0030, - 0x15b8, 0x2031, 0x1000, 0x2600, 0x9302, 0x928b, 0x0000, 0x682e, - 0x6932, 0x0278, 0x9105, 0x0168, 0x2011, 0x0000, 0x2618, 0x2600, - 0x9500, 0x681e, 0x9481, 0x0000, 0x6822, 0x6880, 0xc0fd, 0x6882, - 0x0020, 0x682f, 0x0000, 0x6833, 0x0000, 0x006e, 0x001e, 0x7b12, - 0x7a16, 0x7d02, 0x7c06, 0x7f0a, 0x7e0e, 0x792a, 0x7000, 0x8000, - 0x7002, 0x683c, 0x9300, 0x683e, 0x6840, 0x9201, 0x6842, 0x700c, - 0x9300, 0x700e, 0x7010, 0x9201, 0x7012, 0x080c, 0x1bee, 0x0448, - 0xd6b4, 0x0110, 0x200b, 0x4040, 0x2031, 0x0080, 0x9584, 0x007f, - 0x0108, 0x9632, 0x7124, 0x7000, 0x9086, 0x0000, 0x1198, 0xc185, - 0x7126, 0x2009, 0x0306, 0x2104, 0xd0b4, 0x1904, 0x1a1b, 0x200b, - 0x4040, 0x2009, 0x13b7, 0x2104, 0x8000, 0x0a04, 0x1a1b, 0x200a, - 0x0804, 0x1a1b, 0xc18d, 0x7126, 0xd184, 0x1d58, 0x0804, 0x1a1b, - 0x9006, 0x002e, 0x003e, 0x004e, 0x005e, 0x006e, 0x007e, 0x0005, - 0x080c, 0x0dc9, 0x0026, 0x2001, 0x0105, 0x2003, 0x0010, 0x782b, - 0x0004, 0x7003, 0x0000, 0x7004, 0x2060, 0x00d6, 0x6014, 0x2068, - 0x080c, 0xafaf, 0x0118, 0x6880, 0xc0bd, 0x6882, 0x782c, 0xd0ac, - 0x1de8, 0x080c, 0x1986, 0x6020, 0x9086, 0x0006, 0x1180, 0x2061, - 0x0100, 0x62c8, 0x2001, 0x00fa, 0x8001, 0x1df0, 0x60c8, 0x9206, - 0x1dc0, 0x60c4, 0x689a, 0x60c8, 0x6896, 0x7004, 0x2060, 0x00de, >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Mon Sep 11 18:01:33 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6813B16A416; Mon, 11 Sep 2006 18:01:33 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2EF9E16A412 for ; Mon, 11 Sep 2006 18:01:33 +0000 (UTC) (envelope-from mjacob@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8B1C043D66 for ; Mon, 11 Sep 2006 18:01:29 +0000 (GMT) (envelope-from mjacob@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8BI1Tax072608 for ; Mon, 11 Sep 2006 18:01:29 GMT (envelope-from mjacob@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8BI1TAf072605 for perforce@freebsd.org; Mon, 11 Sep 2006 18:01:29 GMT (envelope-from mjacob@freebsd.org) Date: Mon, 11 Sep 2006 18:01:29 GMT Message-Id: <200609111801.k8BI1TAf072605@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to mjacob@freebsd.org using -f From: Matt Jacob To: Perforce Change Reviews Cc: Subject: PERFORCE change 105970 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Sep 2006 18:01:33 -0000 http://perforce.freebsd.org/chv.cgi?CH=105970 Change 105970 by mjacob@newisp on 2006/09/11 18:01:03 Don't dump continuation entries at logdebug0 level. Affected files ... .. //depot/projects/newisp/dev/isp/isp_pci.c#10 edit Differences ... ==== //depot/projects/newisp/dev/isp/isp_pci.c#10 (text+ko) ==== @@ -2531,7 +2531,7 @@ seglim++; datalen -= dm_segs->ds_len; } - if (isp->isp_dblev & ISP_LOGDEBUG0) { + if (isp->isp_dblev & ISP_LOGDEBUG1) { isp_print_bytes(isp, "Continuation", QENTRY_LEN, crq); } isp_put_cont64_req(isp, crq, cqe); @@ -2658,7 +2658,7 @@ seglim++; datalen -= dm_segs->ds_len; } - if (isp->isp_dblev & ISP_LOGDEBUG0) { + if (isp->isp_dblev & ISP_LOGDEBUG1) { isp_print_bytes(isp, "Continuation", QENTRY_LEN, crq); } isp_put_cont_req(isp, crq, cqe); From owner-p4-projects@FreeBSD.ORG Mon Sep 11 19:59:06 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4E40316A4C8; Mon, 11 Sep 2006 19:59:06 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1064B16A49E for ; Mon, 11 Sep 2006 19:59:06 +0000 (UTC) (envelope-from trhodes@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 06A8443DED for ; Mon, 11 Sep 2006 19:58:04 +0000 (GMT) (envelope-from trhodes@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8BJvwrE090247 for ; Mon, 11 Sep 2006 19:57:58 GMT (envelope-from trhodes@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8BJvvOs090244 for perforce@freebsd.org; Mon, 11 Sep 2006 19:57:57 GMT (envelope-from trhodes@freebsd.org) Date: Mon, 11 Sep 2006 19:57:57 GMT Message-Id: <200609111957.k8BJvvOs090244@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to trhodes@freebsd.org using -f From: Tom Rhodes To: Perforce Change Reviews Cc: Subject: PERFORCE change 105981 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Sep 2006 19:59:06 -0000 http://perforce.freebsd.org/chv.cgi?CH=105981 Change 105981 by trhodes@trhodes_local on 2006/09/11 19:57:00 Fix two cut+paste mistakes which prevented building; more diff reduction. Affected files ... .. //depot/projects/usb/src/sys/dev/usb/ehci_pci.c#7 edit .. //depot/projects/usb/src/sys/dev/usb/if_kue.c#8 edit .. //depot/projects/usb/src/sys/dev/usb/usb_subr.c#16 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb/ehci_pci.c#7 (text+ko) ==== @@ -50,8 +50,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/usb/ehci_pci.c,v 1.23 2006/09/07 00:06:41 imp Ex -p $"); +__FBSDID("$FreeBSD: src/sys/dev/usb/ehci_pci.c,v 1.23 2006/09/07 00:06:41 imp Exp $"); #include "opt_bus.h" ==== //depot/projects/usb/src/sys/dev/usb/if_kue.c#8 (text+ko) ==== @@ -871,7 +871,7 @@ ifp->if_drv_flags |= IFF_DRV_OACTIVE; done: - return(0); + return; } static void ==== //depot/projects/usb/src/sys/dev/usb/usb_subr.c#16 (text+ko) ==== @@ -1,3 +1,18 @@ +/* $NetBSD: usb_subr.c,v 1.99 2002/07/11 21:14:34 augustss Exp $ */ + +/* Also already have from NetBSD: + * $NetBSD: usb_subr.c,v 1.102 2003/01/01 16:21:50 augustss Exp $ + * $NetBSD: usb_subr.c,v 1.103 2003/01/10 11:19:13 augustss Exp $ + * $NetBSD: usb_subr.c,v 1.111 2004/03/15 10:35:04 augustss Exp $ + * $NetBSD: usb_subr.c,v 1.114 2004/06/23 02:30:52 mycroft Exp $ + * $NetBSD: usb_subr.c,v 1.115 2004/06/23 05:23:19 mycroft Exp $ + * $NetBSD: usb_subr.c,v 1.116 2004/06/23 06:27:54 mycroft Exp $ + * $NetBSD: usb_subr.c,v 1.119 2004/10/23 13:26:33 augustss Exp $ + */ + +#include +__FBSDID("$FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.86 2006/09/10 15:20:39 trhodes Exp $"); + /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. * All rights reserved. @@ -35,7 +50,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include #include #include #include @@ -54,11 +68,9 @@ #include "usbdevs.h" #include -__FBSDID("$FreeBSD: src/sys/dev/usb2/usb_subr.c $"); - #ifdef USBVERBOSE /* - * descriptions of of known vendors and devices ("products") + * Descriptions of of known vendors and devices ("products"). */ struct usb_knowndev { u_int16_t vendor; @@ -77,21 +89,13 @@ char *q, *e; if(p == NULL) - { return; - } q = e = p; - while(*q == ' ') /* skip leading spaces */ - { + while (*q == ' ') /* skip leading spaces */ q++; - } - while((*p = *q++)) /* copy string */ - { - if(*p++ != ' ') /* remember last non-space */ - { + while ((*p = *q++)) /* copy string */ + if (*p++ != ' ') /* remember last non-space */ e = p; - } - } *e = 0; /* kill trailing spaces */ return; } @@ -105,8 +109,7 @@ const struct usb_knowndev *kdp; #endif - if(udev == NULL) - { + if(udev == NULL) { v[0] = p[0] = '\0'; return; } @@ -114,7 +117,7 @@ vendor = NULL; product = NULL; - if(usedev) + if (usedev) { (void) usbreq_get_string_any (udev, udd->iManufacturer, v, USB_MAX_STRING_LEN); @@ -139,49 +142,32 @@ } } #ifdef USBVERBOSE - if((vendor == NULL) || (product == NULL)) - { + if (vendor == NULL || product == NULL) { for(kdp = usb_knowndevs; kdp->vendorname != NULL; - kdp++) - { - if((kdp->vendor == UGETW(udd->idVendor)) && - ((kdp->product == UGETW(udd->idProduct)) || - ((kdp->flags & USB_KNOWNDEV_NOPROD) != 0))) - { + kdp++) { + if (kdp->vendor == UGETW(udd->idVendor) && + (kdp->product == UGETW(udd->idProduct) || + (kdp->flags & USB_KNOWNDEV_NOPROD) != 0)) break; - } } - if(kdp->vendorname != NULL) - { - if(vendor == NULL) - { - vendor = kdp->vendorname; - } - if(product == NULL) - { - product = ((kdp->flags & USB_KNOWNDEV_NOPROD) == 0) ? - kdp->productname : NULL; - } + if (kdp->vendorname != NULL) { + if (vendor == NULL) + vendor = kdp->vendorname; + if (product == NULL) + product = (kdp->flags & USB_KNOWNDEV_NOPROD) == 0 ? + kdp->productname : NULL; } } #endif - if((vendor != NULL) && *vendor) - { + if (vendor != NULL && *vendor) strcpy(v, vendor); - } else - { sprintf(v, "vendor 0x%04x", UGETW(udd->idVendor)); - } - if((product != NULL) && *product) - { + if (product != NULL && *product) strcpy(p, product); - } else - { sprintf(p, "product 0x%04x", UGETW(udd->idProduct)); - } return; } @@ -235,24 +221,18 @@ USBD_STATUS_DESC[err] : "unknown error!"; } -/* delay for a certain number of ms */ +/* Delay for a certain number of ms */ void usb_delay_ms(struct usbd_bus *bus, u_int ms) { - /* wait at least two clock ticks, - * so that we know the time has passed - */ - if(bus->use_polling || cold) - { + /* Wait at least two clock ticks so we know the time has passed. */ + if (bus->use_polling || cold) DELAY((ms+1) * 1000); - } else - { tsleep(&ms, PRIBIO, "usbdly", (((ms*hz)+999)/1000) + 1); - } } -/* delay given a device handle */ +/* Delay given a device handle. */ void usbd_delay_ms(struct usbd_device *udev, u_int ms) { @@ -354,15 +334,11 @@ u_int16_t curidx = 0; d = usbd_find_idesc(cd, iface_index, alt_index); - if(d == NULL) - { + if (d == NULL) return NULL; - } - if(endptidx >= d->bNumEndpoints) /* quick exit */ - { + if (endptidx >= d->bNumEndpoints) /* quick exit */ return NULL; - } desc = ((void *)d); @@ -495,7 +471,6 @@ pipe++; } - /**/ pipe = &udev->pipes[0]; /* free old pipes if any */ @@ -712,10 +687,8 @@ /* get the full descriptor */ err = usbreq_get_desc(udev, UDESC_CONFIG, index, len, cdp, 3); - if(err) - { + if (err) goto error; - } if(cdp->bDescriptorType != UDESC_CONFIG) { PRINTF(("bad desc %d\n", @@ -729,17 +702,14 @@ cdp->bNumInterface = (sizeof(udev->ifaces)/sizeof(udev->ifaces[0])); } - /* figure out if the device is self or bus powered */ + /* Figure out if the device is self or bus powered. */ selfpowered = 0; - if(!(udev->quirks->uq_flags & UQ_BUS_POWERED) && - (cdp->bmAttributes & UC_SELF_POWERED)) - { - /* may be self powered */ - if(cdp->bmAttributes & UC_BUS_POWERED) - { - /* must ask device */ - if(udev->quirks->uq_flags & UQ_POWER_CLAIM) - { + if (!(udev->quirks->uq_flags & UQ_BUS_POWERED) && + (cdp->bmAttributes & UC_SELF_POWERED)) { + /* May be self powered. */ + if (cdp->bmAttributes & UC_BUS_POWERED) { + /* Must ask device. */ + if (udev->quirks->uq_flags & UQ_POWER_CLAIM) { /* * Hub claims to be self powered, but isn't. * It seems that the power status can be @@ -756,9 +726,7 @@ PRINTF(("characteristics=0x%04x, error=%s\n", UGETW(hd.wHubCharacteristics), usbd_errstr(err))); - } - else - { + } else { err = usbreq_get_device_status(udev, &ds); if(!err && (UGETW(ds.wStatus) & UDS_SELF_POWERED)) @@ -768,11 +736,8 @@ PRINTF(("status=0x%04x, error=%s\n", UGETW(ds.wStatus), usbd_errstr(err))); } - } - else - { + } else selfpowered = 1; - } } PRINTF(("udev=%p cdesc=%p (addr %d) cno=%d attr=0x%02x, " "selfpowered=%d, power=%d\n", @@ -780,7 +745,7 @@ cdp->bConfigurationValue, udev->address, cdp->bmAttributes, selfpowered, cdp->bMaxPower * 2)); - /* check if we have enough power */ + /* Check if we have enough power. */ power = cdp->bMaxPower * 2; if(power > udev->powersrc->power) { @@ -803,14 +768,14 @@ udev->self_powered = selfpowered; udev->config = cdp->bConfigurationValue; - /* set the actual configuration value */ + /* Set the actual configuration value. */ err = usbreq_set_config(udev, cdp->bConfigurationValue); if(err) { goto error; } - /* allocate and fill interface data */ + /* Allocate and fill interface data. */ nifc = cdp->bNumInterface; while(nifc--) { @@ -820,6 +785,7 @@ goto error; } } + return (USBD_NORMAL_COMPLETION); error: @@ -1206,7 +1172,6 @@ USETW(udev->default_ep_desc.wMaxPacketSize, USB_MAX_IPACKET); udev->default_ep_desc.bInterval = 0; - /**/ udev->bus = bus; udev->quirks = &usbd_no_quirk; udev->address = USB_START_ADDR; From owner-p4-projects@FreeBSD.ORG Mon Sep 11 20:03:05 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6FCFD16A417; Mon, 11 Sep 2006 20:03:05 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 33F8416A415 for ; Mon, 11 Sep 2006 20:03:05 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id DABD343D69 for ; Mon, 11 Sep 2006 20:03:04 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8BK34Mx091723 for ; Mon, 11 Sep 2006 20:03:04 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8BK341Q091720 for perforce@freebsd.org; Mon, 11 Sep 2006 20:03:04 GMT (envelope-from imp@freebsd.org) Date: Mon, 11 Sep 2006 20:03:04 GMT Message-Id: <200609112003.k8BK341Q091720@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 105982 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Sep 2006 20:03:05 -0000 http://perforce.freebsd.org/chv.cgi?CH=105982 Change 105982 by imp@imp_lighthouse on 2006/09/11 20:02:30 Revert back to baseline for further debugging. Affected files ... .. //depot/projects/arm/src/sys/arm/at91/at91_twi.c#24 edit Differences ... ==== //depot/projects/arm/src/sys/arm/at91/at91_twi.c#24 (text+ko) ==== @@ -131,8 +131,8 @@ WR4(sc, TWI_CR, TWI_CR_SWRST); WR4(sc, TWI_CR, TWI_CR_MSEN | TWI_CR_SVDIS); WR4(sc, TWI_CWGR, sc->cwgr); - WR4(sc, TWI_IER, TWI_SR_RXRDY | TWI_SR_OVRE | TWI_SR_UNRE | - TWI_SR_NACK); +// WR4(sc, TWI_IER, TWI_SR_RXRDY | TWI_SR_OVRE | TWI_SR_UNRE | +// TWI_SR_NACK); if ((sc->iicbus = device_add_child(dev, "iicbus", -1)) == NULL) device_printf(dev, "could not allocate iicbus instance\n"); @@ -229,9 +229,9 @@ int err = 0; int counter = 10000; - while (!(RD4(sc, TWI_SR) & bit) && counter-- != 0) - continue; - if (counter == 0) + while (!(RD4(sc, TWI_SR) & bit) && counter-- >= 0) + DELAY(10); + if (counter <= 0) err = EIO; return (err); } @@ -297,7 +297,7 @@ WR4(sc, TWI_MMR, ~TWI_MMR_MREAD & RD4(sc, TWI_MMR)); WR4(sc, TWI_CR, TWI_CR_START); sc->sc_started = 1; - WR4(sc, TWI_IER, TWI_SR_TXRDY); +// WR4(sc, TWI_IER, TWI_SR_TXRDY); while (len--) { WR4(sc, TWI_THR, *walker++); while (!(sc->flags & TXRDY)) { @@ -327,7 +327,7 @@ WR4(sc, TWI_MMR, TWI_MMR_MREAD | RD4(sc, TWI_MMR)); WR4(sc, TWI_CR, TWI_CR_START); sc->sc_started = 1; - WR4(sc, TWI_IER, TWI_SR_RXRDY); +// WR4(sc, TWI_IER, TWI_SR_RXRDY); while (len-- > 0) { err = 0; while (!(sc->flags & RXRDY)) { @@ -446,8 +446,10 @@ while (len--) { if (len == 0) WR4(sc, TWI_CR, TWI_CR_STOP); - if (!at91_twi_wait(sc, TWI_SR_RXRDY)) + if (!at91_twi_wait(sc, TWI_SR_RXRDY)) { + printf("1\n"); return (EIO); + } *buf++ = RD4(sc, TWI_RHR) & 0xff; } } else { @@ -455,12 +457,16 @@ WR4(sc, TWI_THR, *buf++); if (len == 0) WR4(sc, TWI_CR, TWI_CR_STOP); - if (!at91_twi_wait(sc, TWI_SR_TXRDY)) + if (!at91_twi_wait(sc, TWI_SR_TXRDY)) { + printf("3\n"); return (EIO); + } } } - if (!at91_twi_wait(sc, TWI_SR_TXCOMP)) + if (!at91_twi_wait(sc, TWI_SR_TXCOMP)) { + printf("2\n"); return (EIO); + } } return (0); } From owner-p4-projects@FreeBSD.ORG Mon Sep 11 20:12:51 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id AC7B416A47B; Mon, 11 Sep 2006 20:12:51 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7255916A416 for ; Mon, 11 Sep 2006 20:12:51 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5B9B143E09 for ; Mon, 11 Sep 2006 20:12:23 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8BKCImU092432 for ; Mon, 11 Sep 2006 20:12:18 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8BKCHba092428 for perforce@freebsd.org; Mon, 11 Sep 2006 20:12:17 GMT (envelope-from imp@freebsd.org) Date: Mon, 11 Sep 2006 20:12:17 GMT Message-Id: <200609112012.k8BKCHba092428@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 105986 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Sep 2006 20:12:52 -0000 http://perforce.freebsd.org/chv.cgi?CH=105986 Change 105986 by imp@imp_paco-paco on 2006/09/11 20:12:01 IFC @105684 Affected files ... .. //depot/projects/arm/src/gnu/usr.bin/binutils/as/Makefile#3 integrate .. //depot/projects/arm/src/sys/amd64/amd64/nexus.c#4 integrate .. //depot/projects/arm/src/sys/cam/cam_xpt.c#8 integrate .. //depot/projects/arm/src/sys/dev/acpica/acpi.c#13 integrate .. //depot/projects/arm/src/sys/dev/ata/ata-all.c#12 integrate .. //depot/projects/arm/src/sys/dev/ata/ata-chipset.c#27 integrate .. //depot/projects/arm/src/sys/dev/ata/ata-pci.h#16 integrate .. //depot/projects/arm/src/sys/dev/ata/ata-usb.c#4 integrate .. //depot/projects/arm/src/sys/i386/i386/nexus.c#4 integrate .. //depot/projects/arm/src/sys/kern/bus_if.m#6 integrate .. //depot/projects/arm/src/sys/kern/subr_bus.c#18 integrate .. //depot/projects/arm/src/sys/kern/subr_rman.c#10 integrate .. //depot/projects/arm/src/sys/netinet/ip_output.c#15 integrate .. //depot/projects/arm/src/sys/sys/bus.h#9 integrate Differences ... ==== //depot/projects/arm/src/gnu/usr.bin/binutils/as/Makefile#3 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/gnu/usr.bin/binutils/as/Makefile,v 1.16 2004/12/21 09:59:40 ru Exp $ +# $FreeBSD: src/gnu/usr.bin/binutils/as/Makefile,v 1.17 2006/09/11 18:07:09 obrien Exp $ # BINDIR @@ -35,11 +35,9 @@ .else CFLAGS+= -DDEFAULT_ARCH=\"${BINUTILS_ARCH}\" .endif - -.if ${TARGET_ARCH} == "arm" && defined(ARM_BIG_ENDIAN) +.if defined(TARGET_BIG_ENDIAN) CFLAGS+= -DTARGET_BYTES_BIG_ENDIAN=1 .endif - CFLAGS+= -DTARGET_CPU=\"${BINUTILS_ARCH}\" CFLAGS+= -DTARGET_CANONICAL=\"${TARGET_TUPLE}\" CFLAGS+= -DTARGET_ALIAS=\"${TARGET_TUPLE}\" ==== //depot/projects/arm/src/sys/amd64/amd64/nexus.c#4 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/nexus.c,v 1.68 2006/04/20 04:16:34 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/nexus.c,v 1.69 2006/09/11 19:31:51 jhb Exp $"); /* * This code implements a `root nexus' for Intel Architecture @@ -140,7 +140,7 @@ static int nexus_probe(device_t dev) { - int irq, last; + int irq; device_quiet(dev); /* suppress attach message for neatness */ @@ -173,18 +173,10 @@ * We search for regions of existing IRQs and add those to the IRQ * resource manager. */ - last = -1; for (irq = 0; irq < NUM_IO_INTS; irq++) - if (intr_lookup_source(irq) != NULL) { - if (last == -1) - last = irq; - } else if (last != -1) { - if (rman_manage_region(&irq_rman, last, irq - 1) != 0) + if (intr_lookup_source(irq) != NULL) + if (rman_manage_region(&irq_rman, irq, irq) != 0) panic("nexus_probe irq_rman add"); - last = -1; - } - if (last != -1 && rman_manage_region(&irq_rman, last, irq - 1) != 0) - panic("nexus_probe irq_rman add"); /* * ISA DMA on PCI systems is implemented in the ISA part of each ==== //depot/projects/arm/src/sys/cam/cam_xpt.c#8 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/cam/cam_xpt.c,v 1.162 2006/06/26 05:41:11 mjacob Exp $"); +__FBSDID("$FreeBSD: src/sys/cam/cam_xpt.c,v 1.164 2006/09/11 17:57:23 mjacob Exp $"); #include #include @@ -387,9 +387,9 @@ /*quirks*/0, /*mintags*/0, /*maxtags*/0 }, { - /* Does not support other than LUN 0 */ + /* This does not support other than LUN 0 */ { T_DIRECT, SIP_MEDIA_FIXED, "VMware*", "*", "*" }, - CAM_QUIRK_NOLUNS, /*mintags*/0, /*maxtags*/0 + CAM_QUIRK_NOLUNS, /*mintags*/2, /*maxtags*/255 }, { /* ==== //depot/projects/arm/src/sys/dev/acpica/acpi.c#13 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi.c,v 1.227 2006/07/29 21:46:16 njl Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi.c,v 1.228 2006/09/11 19:32:54 jhb Exp $"); #include "opt_acpi.h" #include @@ -417,13 +417,13 @@ acpi_rman_io.rm_type = RMAN_ARRAY; acpi_rman_io.rm_start = 0; acpi_rman_io.rm_end = 0xffff; - acpi_rman_io.rm_descr = "I/O ports"; + acpi_rman_io.rm_descr = "ACPI I/O ports"; if (rman_init(&acpi_rman_io) != 0) panic("acpi rman_init IO ports failed"); acpi_rman_mem.rm_type = RMAN_ARRAY; acpi_rman_mem.rm_start = 0; acpi_rman_mem.rm_end = ~0ul; - acpi_rman_mem.rm_descr = "I/O memory addresses"; + acpi_rman_mem.rm_descr = "ACPI I/O memory addresses"; if (rman_init(&acpi_rman_mem) != 0) panic("acpi rman_init memory failed"); ==== //depot/projects/arm/src/sys/dev/ata/ata-all.c#12 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/ata/ata-all.c,v 1.273 2006/05/12 05:04:40 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/ata-all.c,v 1.274 2006/09/11 18:33:59 sos Exp $"); #include "opt_ata.h" #include @@ -636,7 +636,9 @@ if (init) { sprintf(buffer, "%.40s/%.8s", atacap->model, atacap->revision); device_set_desc_copy(atadev->dev, buffer); - if (atadev->param.config & ATA_PROTO_ATAPI) { + if ((atadev->param.config & ATA_PROTO_ATAPI) && + (atadev->param.config != ATA_CFA_MAGIC1) && + (atadev->param.config != ATA_CFA_MAGIC2)) { if (atapi_dma && ch->dma && (atadev->param.config & ATA_DRQ_MASK) != ATA_DRQ_INTR && ata_umode(&atadev->param) >= ATA_UDMA2) ==== //depot/projects/arm/src/sys/dev/ata/ata-chipset.c#27 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/ata/ata-chipset.c,v 1.173 2006/09/02 12:55:42 sos Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/ata-chipset.c,v 1.174 2006/09/11 19:48:30 sos Exp $"); #include "opt_ata.h" #include @@ -3952,14 +3952,17 @@ struct ata_pci_controller *ctlr = device_get_softc(dev); struct ata_chip_id *idx; static struct ata_chip_id ids[] = - {{ ATA_ROSB4, 0x00, SWKS33, 0x00, ATA_UDMA2, "ROSB4" }, - { ATA_CSB5, 0x92, SWKS100, 0x00, ATA_UDMA5, "CSB5" }, - { ATA_CSB5, 0x00, SWKS66, 0x00, ATA_UDMA4, "CSB5" }, - { ATA_CSB6, 0x00, SWKS100, 0x00, ATA_UDMA5, "CSB6" }, - { ATA_CSB6_1, 0x00, SWKS66, 0x00, ATA_UDMA4, "CSB6" }, - { ATA_HT1000, 0x00, SWKS100, 0x00, ATA_UDMA5, "HT1000" }, - { ATA_HT1000_S1, 0x00, SWKS100, 0x00, ATA_SA150, "HT1000 SATA" }, - { ATA_HT1000_S2, 0x00, SWKSMIO, 0x00, ATA_SA150, "HT1000 SATA mmio" }, + {{ ATA_ROSB4, 0x00, SWKS33, 0, ATA_UDMA2, "ROSB4" }, + { ATA_CSB5, 0x92, SWKS100, 0, ATA_UDMA5, "CSB5" }, + { ATA_CSB5, 0x00, SWKS66, 0, ATA_UDMA4, "CSB5" }, + { ATA_CSB6, 0x00, SWKS100, 0, ATA_UDMA5, "CSB6" }, + { ATA_CSB6_1, 0x00, SWKS66, 0, ATA_UDMA4, "CSB6" }, + { ATA_HT1000, 0x00, SWKS100, 0, ATA_UDMA5, "HT1000" }, + { ATA_HT1000_S1, 0x00, SWKS100, 4, ATA_SA150, "HT1000" }, + { ATA_HT1000_S2, 0x00, SWKSMIO, 4, ATA_SA150, "HT1000" }, + { ATA_K2, 0x00, SWKSMIO, 4, ATA_SA150, "K2" }, + { ATA_FRODO4, 0x00, SWKSMIO, 4, ATA_SA150, "Frodo4" }, + { ATA_FRODO8, 0x00, SWKSMIO, 8, ATA_SA150, "Frodo8" }, { 0, 0, 0, 0, 0, 0}}; char buffer[64]; @@ -3989,7 +3992,7 @@ &ctlr->r_rid2, RF_ACTIVE))) return ENXIO; - ctlr->channels = 4; + ctlr->channels = ctlr->chip->cfg2; ctlr->allocate = ata_serverworks_allocate; ctlr->setmode = ata_sata_setmode; return 0; ==== //depot/projects/arm/src/sys/dev/ata/ata-pci.h#16 (text+ko) ==== @@ -23,7 +23,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/ata/ata-pci.h,v 1.70 2006/09/02 12:55:42 sos Exp $ + * $FreeBSD: src/sys/dev/ata/ata-pci.h,v 1.71 2006/09/11 19:48:30 sos Exp $ */ /* structure holding chipset config info */ @@ -266,6 +266,9 @@ #define ATA_HT1000 0x02141166 #define ATA_HT1000_S1 0x024b1166 #define ATA_HT1000_S2 0x024a1166 +#define ATA_K2 0x02401166 +#define ATA_FRODO4 0x02411166 +#define ATA_FRODO8 0x02421166 #define ATA_SILICON_IMAGE_ID 0x1095 #define ATA_SII3114 0x31141095 ==== //depot/projects/arm/src/sys/dev/ata/ata-usb.c#4 (text) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/ata/ata-usb.c,v 1.4 2006/03/31 08:09:05 sos Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/ata-usb.c,v 1.5 2006/09/11 19:47:53 sos Exp $"); #include "opt_ata.h" #include @@ -85,7 +85,7 @@ /* USB-ATA 'controller' softc */ struct atausb_softc { - USBBASEDEVICE dev; /* base device */ + device_t dev; /* base device */ usbd_interface_handle iface; /* interface */ int ifaceno; /* interface number */ u_int8_t bulkin; /* endpoint address's */ @@ -349,7 +349,7 @@ } static int -atausb_detach(device_ptr_t dev) +atausb_detach(device_t dev) { struct atausb_softc *sc = device_get_softc(dev); usbd_device_handle udev; ==== //depot/projects/arm/src/sys/i386/i386/nexus.c#4 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/i386/i386/nexus.c,v 1.63 2006/04/20 04:10:27 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/i386/i386/nexus.c,v 1.64 2006/09/11 19:31:51 jhb Exp $"); /* * This code implements a `root nexus' for Intel Architecture @@ -144,7 +144,7 @@ static int nexus_probe(device_t dev) { - int irq, last; + int irq; device_quiet(dev); /* suppress attach message for neatness */ @@ -177,18 +177,10 @@ * We search for regions of existing IRQs and add those to the IRQ * resource manager. */ - last = -1; for (irq = 0; irq < NUM_IO_INTS; irq++) - if (intr_lookup_source(irq) != NULL) { - if (last == -1) - last = irq; - } else if (last != -1) { - if (rman_manage_region(&irq_rman, last, irq - 1) != 0) + if (intr_lookup_source(irq) != NULL) + if (rman_manage_region(&irq_rman, irq, irq) != 0) panic("nexus_probe irq_rman add"); - last = -1; - } - if (last != -1 && rman_manage_region(&irq_rman, last, irq - 1) != 0) - panic("nexus_probe irq_rman add"); /* * ISA DMA on PCI systems is implemented in the ISA part of each ==== //depot/projects/arm/src/sys/kern/bus_if.m#6 (text+ko) ==== @@ -23,7 +23,7 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# $FreeBSD: src/sys/kern/bus_if.m,v 1.31 2006/09/03 00:27:42 jmg Exp $ +# $FreeBSD: src/sys/kern/bus_if.m,v 1.32 2006/09/11 19:41:31 jhb Exp $ # #include @@ -194,7 +194,7 @@ int _order; const char *_name; int _unit; -}; +} DEFAULT bus_generic_add_child; /** * @brief Allocate a system resource ==== //depot/projects/arm/src/sys/kern/subr_bus.c#18 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/subr_bus.c,v 1.196 2006/09/03 00:27:42 jmg Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/subr_bus.c,v 1.197 2006/09/11 19:41:31 jhb Exp $"); #include "opt_bus.h" @@ -2846,6 +2846,13 @@ } } +device_t +bus_generic_add_child(device_t dev, int order, const char *name, int unit) +{ + + return (device_add_child_ordered(dev, order, name, unit)); +} + /** * @brief Helper function for implementing DEVICE_PROBE() * ==== //depot/projects/arm/src/sys/kern/subr_rman.c#10 (text+ko) ==== @@ -56,7 +56,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/subr_rman.c,v 1.52 2006/08/03 21:19:13 jb Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/subr_rman.c,v 1.53 2006/09/11 19:31:52 jhb Exp $"); #include #include @@ -155,7 +155,7 @@ int rman_manage_region(struct rman *rm, u_long start, u_long end) { - struct resource_i *r, *s; + struct resource_i *r, *s, *t; DPRINTF(("rman_manage_region: <%s> request: start %#lx, end %#lx\n", rm->rm_descr, start, end)); @@ -167,15 +167,53 @@ r->r_rm = rm; mtx_lock(rm->rm_mtx); + + /* Skip entries before us. */ for (s = TAILQ_FIRST(&rm->rm_list); - s && s->r_end < r->r_start; + s && s->r_end + 1 < r->r_start; s = TAILQ_NEXT(s, r_link)) ; + /* If we ran off the end of the list, insert at the tail. */ if (s == NULL) { TAILQ_INSERT_TAIL(&rm->rm_list, r, r_link); } else { - TAILQ_INSERT_BEFORE(s, r, r_link); + /* Check for any overlap with the current region. */ + if (r->r_start <= s->r_end && r->r_end >= s->r_start) + return EBUSY; + + /* Check for any overlap with the next region. */ + t = TAILQ_NEXT(s, r_link); + if (t && r->r_start <= t->r_end && r->r_end >= t->r_start) + return EBUSY; + + /* + * See if this region can be merged with the next region. If + * not, clear the pointer. + */ + if (t && (r->r_end + 1 != t->r_start || t->r_flags != 0)) + t = NULL; + + /* See if we can merge with the current region. */ + if (s->r_end + 1 == r->r_start && s->r_flags == 0) { + /* Can we merge all 3 regions? */ + if (t != NULL) { + s->r_end = t->r_end; + TAILQ_REMOVE(&rm->rm_list, t, r_link); + free(r, M_RMAN); + free(t, M_RMAN); + } else { + s->r_end = r->r_end; + free(r, M_RMAN); + } + } else { + /* Can we merge with just the next region? */ + if (t != NULL) { + t->r_start = r->r_start; + free(r, M_RMAN); + } else + TAILQ_INSERT_BEFORE(s, r, r_link); + } } mtx_unlock(rm->rm_mtx); ==== //depot/projects/arm/src/sys/netinet/ip_output.c#15 (text+ko) ==== @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * @(#)ip_output.c 8.3 (Berkeley) 1/21/94 - * $FreeBSD: src/sys/netinet/ip_output.c,v 1.262 2006/09/10 17:49:09 jmg Exp $ + * $FreeBSD: src/sys/netinet/ip_output.c,v 1.263 2006/09/11 19:56:10 andre Exp $ */ #include "opt_ipfw.h" @@ -246,7 +246,7 @@ * Calculate MTU. If we have a route that is up, use that, * otherwise use the interface's MTU. */ - if (ro->ro_rt->rt_flags & (RTF_UP | RTF_HOST)) { + if (ro->ro_rt != NULL && (ro->ro_rt->rt_flags & (RTF_UP|RTF_HOST))) { /* * This case can happen if the user changed the MTU * of an interface after enabling IP on it. Because ==== //depot/projects/arm/src/sys/sys/bus.h#9 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/sys/bus.h,v 1.76 2006/09/03 00:27:42 jmg Exp $ + * $FreeBSD: src/sys/sys/bus.h,v 1.77 2006/09/11 19:42:27 jhb Exp $ */ #ifndef _SYS_BUS_H_ @@ -242,6 +242,9 @@ int bus_generic_activate_resource(device_t dev, device_t child, int type, int rid, struct resource *r); +device_t + bus_generic_add_child(device_t dev, int order, const char *name, + int unit); struct resource * bus_generic_alloc_resource(device_t bus, device_t child, int type, int *rid, u_long start, u_long end, From owner-p4-projects@FreeBSD.ORG Mon Sep 11 20:30:43 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 725A316A531; Mon, 11 Sep 2006 20:30:43 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4B8BC16A528 for ; Mon, 11 Sep 2006 20:30:43 +0000 (UTC) (envelope-from mjacob@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id C4E3543D46 for ; Mon, 11 Sep 2006 20:30:42 +0000 (GMT) (envelope-from mjacob@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8BKUgRf093306 for ; Mon, 11 Sep 2006 20:30:42 GMT (envelope-from mjacob@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8BKUgXJ093302 for perforce@freebsd.org; Mon, 11 Sep 2006 20:30:42 GMT (envelope-from mjacob@freebsd.org) Date: Mon, 11 Sep 2006 20:30:42 GMT Message-Id: <200609112030.k8BKUgXJ093302@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to mjacob@freebsd.org using -f From: Matt Jacob To: Perforce Change Reviews Cc: Subject: PERFORCE change 105988 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Sep 2006 20:30:43 -0000 http://perforce.freebsd.org/chv.cgi?CH=105988 Change 105988 by mjacob@newisp on 2006/09/11 20:29:52 IFC Affected files ... .. //depot/projects/newisp/amd64/amd64/local_apic.c#4 integrate .. //depot/projects/newisp/amd64/amd64/mp_machdep.c#2 integrate .. //depot/projects/newisp/amd64/amd64/nexus.c#2 integrate .. //depot/projects/newisp/cam/cam_xpt.c#2 integrate .. //depot/projects/newisp/dev/acpica/acpi.c#2 integrate .. //depot/projects/newisp/dev/ata/ata-all.c#2 integrate .. //depot/projects/newisp/dev/ata/ata-chipset.c#4 integrate .. //depot/projects/newisp/dev/ata/ata-pci.h#3 integrate .. //depot/projects/newisp/dev/ata/ata-usb.c#2 integrate .. //depot/projects/newisp/dev/em/if_em.c#5 integrate .. //depot/projects/newisp/dev/nfe/if_nfe.c#2 integrate .. //depot/projects/newisp/dev/nfe/if_nfereg.h#2 integrate .. //depot/projects/newisp/i386/i386/busdma_machdep.c#2 integrate .. //depot/projects/newisp/i386/i386/local_apic.c#4 integrate .. //depot/projects/newisp/i386/i386/mp_machdep.c#2 integrate .. //depot/projects/newisp/i386/i386/nexus.c#2 integrate .. //depot/projects/newisp/kern/bus_if.m#3 integrate .. //depot/projects/newisp/kern/subr_bus.c#3 integrate .. //depot/projects/newisp/kern/subr_rman.c#2 integrate .. //depot/projects/newisp/netinet/ip_output.c#3 integrate .. //depot/projects/newisp/sys/bus.h#3 integrate Differences ... ==== //depot/projects/newisp/amd64/amd64/local_apic.c#4 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/local_apic.c,v 1.28 2006/09/06 22:05:34 sobomax Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/local_apic.c,v 1.29 2006/09/11 20:12:42 jhb Exp $"); #include "opt_hwpmc_hooks.h" @@ -794,6 +794,76 @@ } } } + +static void +dump_mask(const char *prefix, uint32_t v, int base) +{ + int i, first; + + first = 1; + for (i = 0; i < 32; i++) + if (v & (1 << i)) { + if (first) { + db_printf("%s:", prefix); + first = 0; + } + db_printf(" %02x", base + i); + } + if (!first) + db_printf("\n"); +} + +/* Show info from the lapic regs for this CPU. */ +DB_SHOW_COMMAND(lapic, db_show_lapic) +{ + uint32_t v; + + db_printf("lapic ID = %d\n", lapic_id()); + v = lapic->version; + db_printf("version = %d.%d\n", (v & APIC_VER_VERSION) >> 4, + v & 0xf); + db_printf("max LVT = %d\n", (v & APIC_VER_MAXLVT) >> MAXLVTSHIFT); + v = lapic->svr; + db_printf("SVR = %02x (%s)\n", v & APIC_SVR_VECTOR, + v & APIC_SVR_ENABLE ? "enabled" : "disabled"); + db_printf("TPR = %02x\n", lapic->tpr); + +#define dump_field(prefix, index) \ + dump_mask(__XSTRING(prefix ## index), lapic->prefix ## index, \ + index * 32) + + db_printf("In-service Interrupts:\n"); + dump_field(isr, 0); + dump_field(isr, 1); + dump_field(isr, 2); + dump_field(isr, 3); + dump_field(isr, 4); + dump_field(isr, 5); + dump_field(isr, 6); + dump_field(isr, 7); + + db_printf("TMR Interrupts:\n"); + dump_field(tmr, 0); + dump_field(tmr, 1); + dump_field(tmr, 2); + dump_field(tmr, 3); + dump_field(tmr, 4); + dump_field(tmr, 5); + dump_field(tmr, 6); + dump_field(tmr, 7); + + db_printf("IRR Interrupts:\n"); + dump_field(irr, 0); + dump_field(irr, 1); + dump_field(irr, 2); + dump_field(irr, 3); + dump_field(irr, 4); + dump_field(irr, 5); + dump_field(irr, 6); + dump_field(irr, 7); + +#undef dump_field +} #endif /* ==== //depot/projects/newisp/amd64/amd64/mp_machdep.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/mp_machdep.c,v 1.276 2006/05/16 14:32:16 phk Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/mp_machdep.c,v 1.277 2006/09/11 20:10:42 jhb Exp $"); #include "opt_cpu.h" #include "opt_kstack_pages.h" @@ -342,7 +342,10 @@ setidt(IPI_INVLTLB, IDTVEC(invltlb), SDT_SYSIGT, SEL_KPL, 0); setidt(IPI_INVLPG, IDTVEC(invlpg), SDT_SYSIGT, SEL_KPL, 0); setidt(IPI_INVLRNG, IDTVEC(invlrng), SDT_SYSIGT, SEL_KPL, 0); - + + /* Install an inter-CPU IPI for cache invalidation. */ + setidt(IPI_INVLCACHE, IDTVEC(invlcache), SDT_SYSIGT, SEL_KPL, 0); + /* Install an inter-CPU IPI for all-CPU rendezvous */ setidt(IPI_RENDEZVOUS, IDTVEC(rendezvous), SDT_SYSIGT, SEL_KPL, 0); ==== //depot/projects/newisp/amd64/amd64/nexus.c#2 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/nexus.c,v 1.68 2006/04/20 04:16:34 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/nexus.c,v 1.69 2006/09/11 19:31:51 jhb Exp $"); /* * This code implements a `root nexus' for Intel Architecture @@ -140,7 +140,7 @@ static int nexus_probe(device_t dev) { - int irq, last; + int irq; device_quiet(dev); /* suppress attach message for neatness */ @@ -173,18 +173,10 @@ * We search for regions of existing IRQs and add those to the IRQ * resource manager. */ - last = -1; for (irq = 0; irq < NUM_IO_INTS; irq++) - if (intr_lookup_source(irq) != NULL) { - if (last == -1) - last = irq; - } else if (last != -1) { - if (rman_manage_region(&irq_rman, last, irq - 1) != 0) + if (intr_lookup_source(irq) != NULL) + if (rman_manage_region(&irq_rman, irq, irq) != 0) panic("nexus_probe irq_rman add"); - last = -1; - } - if (last != -1 && rman_manage_region(&irq_rman, last, irq - 1) != 0) - panic("nexus_probe irq_rman add"); /* * ISA DMA on PCI systems is implemented in the ISA part of each ==== //depot/projects/newisp/cam/cam_xpt.c#2 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/cam/cam_xpt.c,v 1.162 2006/06/26 05:41:11 mjacob Exp $"); +__FBSDID("$FreeBSD: src/sys/cam/cam_xpt.c,v 1.164 2006/09/11 17:57:23 mjacob Exp $"); #include #include @@ -387,9 +387,9 @@ /*quirks*/0, /*mintags*/0, /*maxtags*/0 }, { - /* Does not support other than LUN 0 */ + /* This does not support other than LUN 0 */ { T_DIRECT, SIP_MEDIA_FIXED, "VMware*", "*", "*" }, - CAM_QUIRK_NOLUNS, /*mintags*/0, /*maxtags*/0 + CAM_QUIRK_NOLUNS, /*mintags*/2, /*maxtags*/255 }, { /* ==== //depot/projects/newisp/dev/acpica/acpi.c#2 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi.c,v 1.227 2006/07/29 21:46:16 njl Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi.c,v 1.228 2006/09/11 19:32:54 jhb Exp $"); #include "opt_acpi.h" #include @@ -415,13 +415,13 @@ acpi_rman_io.rm_type = RMAN_ARRAY; acpi_rman_io.rm_start = 0; acpi_rman_io.rm_end = 0xffff; - acpi_rman_io.rm_descr = "I/O ports"; + acpi_rman_io.rm_descr = "ACPI I/O ports"; if (rman_init(&acpi_rman_io) != 0) panic("acpi rman_init IO ports failed"); acpi_rman_mem.rm_type = RMAN_ARRAY; acpi_rman_mem.rm_start = 0; acpi_rman_mem.rm_end = ~0ul; - acpi_rman_mem.rm_descr = "I/O memory addresses"; + acpi_rman_mem.rm_descr = "ACPI I/O memory addresses"; if (rman_init(&acpi_rman_mem) != 0) panic("acpi rman_init memory failed"); ==== //depot/projects/newisp/dev/ata/ata-all.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/ata/ata-all.c,v 1.273 2006/05/12 05:04:40 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/ata-all.c,v 1.274 2006/09/11 18:33:59 sos Exp $"); #include "opt_ata.h" #include @@ -636,7 +636,9 @@ if (init) { sprintf(buffer, "%.40s/%.8s", atacap->model, atacap->revision); device_set_desc_copy(atadev->dev, buffer); - if (atadev->param.config & ATA_PROTO_ATAPI) { + if ((atadev->param.config & ATA_PROTO_ATAPI) && + (atadev->param.config != ATA_CFA_MAGIC1) && + (atadev->param.config != ATA_CFA_MAGIC2)) { if (atapi_dma && ch->dma && (atadev->param.config & ATA_DRQ_MASK) != ATA_DRQ_INTR && ata_umode(&atadev->param) >= ATA_UDMA2) ==== //depot/projects/newisp/dev/ata/ata-chipset.c#4 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/ata/ata-chipset.c,v 1.173 2006/09/02 12:55:42 sos Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/ata-chipset.c,v 1.174 2006/09/11 19:48:30 sos Exp $"); #include "opt_ata.h" #include @@ -3952,14 +3952,17 @@ struct ata_pci_controller *ctlr = device_get_softc(dev); struct ata_chip_id *idx; static struct ata_chip_id ids[] = - {{ ATA_ROSB4, 0x00, SWKS33, 0x00, ATA_UDMA2, "ROSB4" }, - { ATA_CSB5, 0x92, SWKS100, 0x00, ATA_UDMA5, "CSB5" }, - { ATA_CSB5, 0x00, SWKS66, 0x00, ATA_UDMA4, "CSB5" }, - { ATA_CSB6, 0x00, SWKS100, 0x00, ATA_UDMA5, "CSB6" }, - { ATA_CSB6_1, 0x00, SWKS66, 0x00, ATA_UDMA4, "CSB6" }, - { ATA_HT1000, 0x00, SWKS100, 0x00, ATA_UDMA5, "HT1000" }, - { ATA_HT1000_S1, 0x00, SWKS100, 0x00, ATA_SA150, "HT1000 SATA" }, - { ATA_HT1000_S2, 0x00, SWKSMIO, 0x00, ATA_SA150, "HT1000 SATA mmio" }, + {{ ATA_ROSB4, 0x00, SWKS33, 0, ATA_UDMA2, "ROSB4" }, + { ATA_CSB5, 0x92, SWKS100, 0, ATA_UDMA5, "CSB5" }, + { ATA_CSB5, 0x00, SWKS66, 0, ATA_UDMA4, "CSB5" }, + { ATA_CSB6, 0x00, SWKS100, 0, ATA_UDMA5, "CSB6" }, + { ATA_CSB6_1, 0x00, SWKS66, 0, ATA_UDMA4, "CSB6" }, + { ATA_HT1000, 0x00, SWKS100, 0, ATA_UDMA5, "HT1000" }, + { ATA_HT1000_S1, 0x00, SWKS100, 4, ATA_SA150, "HT1000" }, + { ATA_HT1000_S2, 0x00, SWKSMIO, 4, ATA_SA150, "HT1000" }, + { ATA_K2, 0x00, SWKSMIO, 4, ATA_SA150, "K2" }, + { ATA_FRODO4, 0x00, SWKSMIO, 4, ATA_SA150, "Frodo4" }, + { ATA_FRODO8, 0x00, SWKSMIO, 8, ATA_SA150, "Frodo8" }, { 0, 0, 0, 0, 0, 0}}; char buffer[64]; @@ -3989,7 +3992,7 @@ &ctlr->r_rid2, RF_ACTIVE))) return ENXIO; - ctlr->channels = 4; + ctlr->channels = ctlr->chip->cfg2; ctlr->allocate = ata_serverworks_allocate; ctlr->setmode = ata_sata_setmode; return 0; ==== //depot/projects/newisp/dev/ata/ata-pci.h#3 (text+ko) ==== @@ -23,7 +23,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/ata/ata-pci.h,v 1.70 2006/09/02 12:55:42 sos Exp $ + * $FreeBSD: src/sys/dev/ata/ata-pci.h,v 1.71 2006/09/11 19:48:30 sos Exp $ */ /* structure holding chipset config info */ @@ -266,6 +266,9 @@ #define ATA_HT1000 0x02141166 #define ATA_HT1000_S1 0x024b1166 #define ATA_HT1000_S2 0x024a1166 +#define ATA_K2 0x02401166 +#define ATA_FRODO4 0x02411166 +#define ATA_FRODO8 0x02421166 #define ATA_SILICON_IMAGE_ID 0x1095 #define ATA_SII3114 0x31141095 ==== //depot/projects/newisp/dev/ata/ata-usb.c#2 (text) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/ata/ata-usb.c,v 1.4 2006/03/31 08:09:05 sos Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/ata-usb.c,v 1.5 2006/09/11 19:47:53 sos Exp $"); #include "opt_ata.h" #include @@ -85,7 +85,7 @@ /* USB-ATA 'controller' softc */ struct atausb_softc { - USBBASEDEVICE dev; /* base device */ + device_t dev; /* base device */ usbd_interface_handle iface; /* interface */ int ifaceno; /* interface number */ u_int8_t bulkin; /* endpoint address's */ @@ -349,7 +349,7 @@ } static int -atausb_detach(device_ptr_t dev) +atausb_detach(device_t dev) { struct atausb_softc *sc = device_get_softc(dev); usbd_device_handle udev; ==== //depot/projects/newisp/dev/em/if_em.c#5 (text+ko) ==== @@ -31,7 +31,7 @@ ***************************************************************************/ -/*$FreeBSD: src/sys/dev/em/if_em.c,v 1.142 2006/09/09 20:05:24 pdeuskar Exp $*/ +/*$FreeBSD: src/sys/dev/em/if_em.c,v 1.143 2006/09/10 19:23:27 pdeuskar Exp $*/ #ifdef HAVE_KERNEL_OPTION_HEADERS #include "opt_device_polling.h" @@ -1456,7 +1456,7 @@ current_tx_desc = NULL; txd_upper = txd_lower = txd_used = txd_saved = 0; - do_tso = ((m_head->m_pkthdr.csum_flags & CSUM_TSO) != 0); + do_tso = ((m_head->m_pkthdr.csum_flags & CSUM_TSO) != 0); /* * Force a cleanup if number of TX descriptors @@ -1509,16 +1509,16 @@ *m_headp = m_head; } - /* - * TSO workaround: - * If an mbuf is only header we need - * to pull 4 bytes of data into it. - */ - if (do_tso && (m_head->m_len <= M_TSO_LEN)) { - m_head = m_pullup(m_head, M_TSO_LEN + 4); - if (m_head == NULL) - return (ENOBUFS); - } + /* + * TSO workaround: + * If an mbuf is only header we need + * to pull 4 bytes of data into it. + */ + if (do_tso && (m_head->m_len <= M_TSO_LEN)) { + m_head = m_pullup(m_head, M_TSO_LEN + 4); + if (m_head == NULL) + return (ENOBUFS); + } /* * Map the packet for DMA. @@ -1558,17 +1558,17 @@ return (EIO); } - /* - * TSO Hardware workaround, if this packet is not - * TSO, and is only a single descriptor long, and - * it follows a TSO burst, then we need to add a - * sentinel descriptor to prevent premature writeback. - */ - if ((do_tso == 0) && (adapter->tx_tso == TRUE)) { - if (nsegs == 1) - tso_desc = TRUE; - adapter->tx_tso = FALSE; - } + /* + * TSO Hardware workaround, if this packet is not + * TSO, and is only a single descriptor long, and + * it follows a TSO burst, then we need to add a + * sentinel descriptor to prevent premature writeback. + */ + if ((do_tso == 0) && (adapter->tx_tso == TRUE)) { + if (nsegs == 1) + tso_desc = TRUE; + adapter->tx_tso = FALSE; + } if (nsegs > adapter->num_tx_desc_avail - 2) { adapter->no_tx_desc_avail2++; @@ -1576,24 +1576,24 @@ return (ENOBUFS); } - /* Do hardware assists */ + /* Do hardware assists */ m_head = *m_headp; - if ( ifp->if_hwassist > 0) { - if (em_tso_setup(adapter, m_head, &txd_upper, &txd_lower)) { - /* we need to make a final sentinel transmit desc */ - tso_desc = TRUE; - } else - em_transmit_checksum_setup(adapter, m_head, - &txd_upper, &txd_lower); - } + if ( ifp->if_hwassist > 0) { + if (em_tso_setup(adapter, m_head, &txd_upper, &txd_lower)) { + /* we need to make a final sentinel transmit desc */ + tso_desc = TRUE; + } else + em_transmit_checksum_setup(adapter, m_head, + &txd_upper, &txd_lower); + } i = adapter->next_avail_tx_desc; if (adapter->pcix_82544) txd_saved = i; for (j = 0; j < nsegs; j++) { - bus_size_t seg_len; - bus_addr_t seg_addr; + bus_size_t seg_len; + bus_addr_t seg_addr; /* If adapter is 82544 and on PCIX bus. */ if(adapter->pcix_82544) { DESC_ARRAY desc_array; @@ -1627,46 +1627,46 @@ txd_used++; } } else { - tx_buffer = &adapter->tx_buffer_area[i]; - current_tx_desc = &adapter->tx_desc_base[i]; - seg_addr = htole64(segs[j].ds_addr); - seg_len = segs[j].ds_len; - /* - ** TSO Workaround: - ** If this is the last descriptor, we want to - ** split it so we have a small final sentinel - */ - if (tso_desc && (j == (nsegs -1)) && (seg_len > 8)) { - seg_len -= 4; - current_tx_desc->buffer_addr = seg_addr; - current_tx_desc->lower.data = htole32( - adapter->txd_cmd | txd_lower | seg_len); - current_tx_desc->upper.data = - htole32(txd_upper); - if (++i == adapter->num_tx_desc) - i = 0; - /* Now make the sentinel */ - ++txd_used; /* using an extra txd */ - current_tx_desc = &adapter->tx_desc_base[i]; - tx_buffer = &adapter->tx_buffer_area[i]; - current_tx_desc->buffer_addr = - seg_addr + seg_len; - current_tx_desc->lower.data = htole32( - adapter->txd_cmd | txd_lower | 4); - current_tx_desc->upper.data = - htole32(txd_upper); - if (++i == adapter->num_tx_desc) - i = 0; - } else { - current_tx_desc->buffer_addr = seg_addr; - current_tx_desc->lower.data = htole32( - adapter->txd_cmd | txd_lower | seg_len); - current_tx_desc->upper.data = - htole32(txd_upper); - if (++i == adapter->num_tx_desc) - i = 0; - } - tx_buffer->m_head = NULL; + tx_buffer = &adapter->tx_buffer_area[i]; + current_tx_desc = &adapter->tx_desc_base[i]; + seg_addr = htole64(segs[j].ds_addr); + seg_len = segs[j].ds_len; + /* + ** TSO Workaround: + ** If this is the last descriptor, we want to + ** split it so we have a small final sentinel + */ + if (tso_desc && (j == (nsegs -1)) && (seg_len > 8)) { + seg_len -= 4; + current_tx_desc->buffer_addr = seg_addr; + current_tx_desc->lower.data = htole32( + adapter->txd_cmd | txd_lower | seg_len); + current_tx_desc->upper.data = + htole32(txd_upper); + if (++i == adapter->num_tx_desc) + i = 0; + /* Now make the sentinel */ + ++txd_used; /* using an extra txd */ + current_tx_desc = &adapter->tx_desc_base[i]; + tx_buffer = &adapter->tx_buffer_area[i]; + current_tx_desc->buffer_addr = + seg_addr + seg_len; + current_tx_desc->lower.data = htole32( + adapter->txd_cmd | txd_lower | 4); + current_tx_desc->upper.data = + htole32(txd_upper); + if (++i == adapter->num_tx_desc) + i = 0; + } else { + current_tx_desc->buffer_addr = seg_addr; + current_tx_desc->lower.data = htole32( + adapter->txd_cmd | txd_lower | seg_len); + current_tx_desc->upper.data = + htole32(txd_upper); + if (++i == adapter->num_tx_desc) + i = 0; + } + tx_buffer->m_head = NULL; } } @@ -1675,9 +1675,9 @@ adapter->num_tx_desc_avail -= txd_used; else { adapter->num_tx_desc_avail -= nsegs; - if (tso_desc) /* TSO used an extra for sentinel */ - adapter->num_tx_desc_avail -= txd_used; - } + if (tso_desc) /* TSO used an extra for sentinel */ + adapter->num_tx_desc_avail -= txd_used; + } if (mtag != NULL) { /* Set the vlan id. */ @@ -2337,12 +2337,12 @@ ifp->if_capenable |= IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM; } - /* Enable TSO if available */ - if ((adapter->hw.mac_type > em_82544) && - (adapter->hw.mac_type != em_82547)) { - ifp->if_capabilities |= IFCAP_TSO; - ifp->if_capenable |= IFCAP_TSO; - } + /* Enable TSO if available */ + if ((adapter->hw.mac_type > em_82544) && + (adapter->hw.mac_type != em_82547)) { + ifp->if_capabilities |= IFCAP_TSO; + ifp->if_capenable |= IFCAP_TSO; + } /* * Tell the upper layer(s) we support long frames. @@ -2562,7 +2562,7 @@ static int em_setup_transmit_structures(struct adapter *adapter) { - struct ifnet *ifp = adapter->ifp; + struct ifnet *ifp = adapter->ifp; device_t dev = adapter->dev; struct em_buffer *tx_buffer; bus_size_t size, segsize; @@ -2573,11 +2573,11 @@ */ segsize = size = roundup2(adapter->hw.max_frame_size, MCLBYTES); - /* Overrides for TSO - want large sizes */ - if (ifp->if_hwassist & EM_TCPSEG_FEATURES) { - size = EM_TSO_SIZE; - segsize = PAGE_SIZE; - } + /* Overrides for TSO - want large sizes */ + if (ifp->if_hwassist & EM_TCPSEG_FEATURES) { + size = EM_TSO_SIZE; + segsize = PAGE_SIZE; + } if ((error = bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */ 1, 0, /* alignment, bounds */ @@ -2852,76 +2852,74 @@ * **********************************************************************/ static boolean_t -em_tso_setup(struct adapter *adapter, - struct mbuf *mp, - uint32_t *txd_upper, - uint32_t *txd_lower) +em_tso_setup(struct adapter *adapter, struct mbuf *mp, uint32_t *txd_upper, + uint32_t *txd_lower) { - struct em_context_desc *TXD; - struct em_buffer *tx_buffer; - struct ip *ip; - struct tcphdr *th; - int curr_txd, hdr_len, ip_hlen, tcp_hlen; + struct em_context_desc *TXD; + struct em_buffer *tx_buffer; + struct ip *ip; + struct tcphdr *th; + int curr_txd, hdr_len, ip_hlen, tcp_hlen; - if (((mp->m_pkthdr.csum_flags & CSUM_TSO) == 0) || - (mp->m_pkthdr.len <= E1000_TX_BUFFER_SIZE)) { - return FALSE; - } + if (((mp->m_pkthdr.csum_flags & CSUM_TSO) == 0) || + (mp->m_pkthdr.len <= E1000_TX_BUFFER_SIZE)) { + return FALSE; + } - *txd_lower = (E1000_TXD_CMD_DEXT | - E1000_TXD_DTYP_D | - E1000_TXD_CMD_TSE); + *txd_lower = (E1000_TXD_CMD_DEXT | + E1000_TXD_DTYP_D | + E1000_TXD_CMD_TSE); - *txd_upper = (E1000_TXD_POPTS_IXSM | - E1000_TXD_POPTS_TXSM) << 8; + *txd_upper = (E1000_TXD_POPTS_IXSM | + E1000_TXD_POPTS_TXSM) << 8; - curr_txd = adapter->next_avail_tx_desc; - tx_buffer = &adapter->tx_buffer_area[curr_txd]; - TXD = (struct em_context_desc *) &adapter->tx_desc_base[curr_txd]; + curr_txd = adapter->next_avail_tx_desc; + tx_buffer = &adapter->tx_buffer_area[curr_txd]; + TXD = (struct em_context_desc *) &adapter->tx_desc_base[curr_txd]; - mp->m_data += sizeof(struct ether_header); - ip = mtod(mp, struct ip *); - ip->ip_len = 0; - ip->ip_sum = 0; - ip_hlen = ip->ip_hl << 2 ; - th = (struct tcphdr *)((caddr_t)ip + ip_hlen); - tcp_hlen = th->th_off << 2; + mp->m_data += sizeof(struct ether_header); + ip = mtod(mp, struct ip *); + ip->ip_len = 0; + ip->ip_sum = 0; + ip_hlen = ip->ip_hl << 2 ; + th = (struct tcphdr *)((caddr_t)ip + ip_hlen); + tcp_hlen = th->th_off << 2; - hdr_len = ETHER_HDR_LEN + ip_hlen + tcp_hlen; + hdr_len = ETHER_HDR_LEN + ip_hlen + tcp_hlen; th->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, htons(IPPROTO_TCP)); - mp->m_data -= sizeof(struct ether_header); - TXD->lower_setup.ip_fields.ipcss = ETHER_HDR_LEN; - TXD->lower_setup.ip_fields.ipcso = - ETHER_HDR_LEN + offsetof(struct ip, ip_sum); - TXD->lower_setup.ip_fields.ipcse = - htole16(ETHER_HDR_LEN + ip_hlen - 1); + mp->m_data -= sizeof(struct ether_header); + TXD->lower_setup.ip_fields.ipcss = ETHER_HDR_LEN; + TXD->lower_setup.ip_fields.ipcso = + ETHER_HDR_LEN + offsetof(struct ip, ip_sum); + TXD->lower_setup.ip_fields.ipcse = + htole16(ETHER_HDR_LEN + ip_hlen - 1); - TXD->upper_setup.tcp_fields.tucss = - ETHER_HDR_LEN + ip_hlen; - TXD->upper_setup.tcp_fields.tucse = 0; - TXD->upper_setup.tcp_fields.tucso = - ETHER_HDR_LEN + ip_hlen + - offsetof(struct tcphdr, th_sum); - TXD->tcp_seg_setup.fields.mss = htole16(mp->m_pkthdr.tso_segsz); - TXD->tcp_seg_setup.fields.hdr_len = hdr_len; - TXD->cmd_and_length = htole32(adapter->txd_cmd | - E1000_TXD_CMD_DEXT | - E1000_TXD_CMD_TSE | - E1000_TXD_CMD_IP | E1000_TXD_CMD_TCP | - (mp->m_pkthdr.len - (hdr_len))); + TXD->upper_setup.tcp_fields.tucss = + ETHER_HDR_LEN + ip_hlen; + TXD->upper_setup.tcp_fields.tucse = 0; + TXD->upper_setup.tcp_fields.tucso = + ETHER_HDR_LEN + ip_hlen + + offsetof(struct tcphdr, th_sum); + TXD->tcp_seg_setup.fields.mss = htole16(mp->m_pkthdr.tso_segsz); + TXD->tcp_seg_setup.fields.hdr_len = hdr_len; + TXD->cmd_and_length = htole32(adapter->txd_cmd | + E1000_TXD_CMD_DEXT | + E1000_TXD_CMD_TSE | + E1000_TXD_CMD_IP | E1000_TXD_CMD_TCP | + (mp->m_pkthdr.len - (hdr_len))); - tx_buffer->m_head = NULL; + tx_buffer->m_head = NULL; - if (++curr_txd == adapter->num_tx_desc) - curr_txd = 0; + if (++curr_txd == adapter->num_tx_desc) + curr_txd = 0; - adapter->num_tx_desc_avail--; - adapter->next_avail_tx_desc = curr_txd; - adapter->tx_tso = TRUE; + adapter->num_tx_desc_avail--; + adapter->next_avail_tx_desc = curr_txd; + adapter->tx_tso = TRUE; - return TRUE; + return TRUE; } /********************************************************************** @@ -3870,10 +3868,10 @@ (long long)adapter->stats.gprc); device_printf(dev, "Good Packets Xmtd = %lld\n", (long long)adapter->stats.gptc); - device_printf(dev, "TSO Contexts Xmtd = %lld\n", - (long long)adapter->stats.tsctc); - device_printf(dev, "TSO Contexts Failed = %lld\n", - (long long)adapter->stats.tsctfc); + device_printf(dev, "TSO Contexts Xmtd = %lld\n", + (long long)adapter->stats.tsctc); + device_printf(dev, "TSO Contexts Failed = %lld\n", + (long long)adapter->stats.tsctfc); } static int ==== //depot/projects/newisp/dev/nfe/if_nfe.c#2 (text+ko) ==== @@ -21,7 +21,7 @@ /* Driver for NVIDIA nForce MCP Fast Ethernet and Gigabit Ethernet */ #include -__FBSDID("$FreeBSD: src/sys/dev/nfe/if_nfe.c,v 1.3 2006/08/14 15:35:43 ru Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/nfe/if_nfe.c,v 1.4 2006/09/11 07:31:55 obrien Exp $"); /* Uncomment the following line to enable polling. */ /* #define DEVICE_POLLING */ @@ -200,6 +200,22 @@ "NVIDIA nForce MCP55 Networking Adapter"}, {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP55_LAN2, "NVIDIA nForce MCP55 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP61_LAN1, + "NVIDIA nForce MCP61 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP61_LAN2, + "NVIDIA nForce MCP61 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP61_LAN3, + "NVIDIA nForce MCP61 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP61_LAN2, + "NVIDIA nForce MCP61 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP65_LAN1, + "NVIDIA nForce MCP65 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP65_LAN2, + "NVIDIA nForce MCP65 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP65_LAN3, + "NVIDIA nForce MCP65 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP65_LAN2, + "NVIDIA nForce MCP65 Networking Adapter"}, {0, 0, NULL} }; @@ -292,6 +308,18 @@ case PCI_PRODUCT_NVIDIA_MCP55_LAN2: sc->nfe_flags |= NFE_JUMBO_SUP | NFE_40BIT_ADDR | NFE_HW_CSUM | NFE_HW_VLAN; break; + case PCI_PRODUCT_NVIDIA_MCP61_LAN1: + case PCI_PRODUCT_NVIDIA_MCP61_LAN2: + case PCI_PRODUCT_NVIDIA_MCP61_LAN3: + case PCI_PRODUCT_NVIDIA_MCP61_LAN4: + sc->nfe_flags |= NFE_40BIT_ADDR; + break; + case PCI_PRODUCT_NVIDIA_MCP65_LAN1: + case PCI_PRODUCT_NVIDIA_MCP65_LAN2: + case PCI_PRODUCT_NVIDIA_MCP65_LAN3: + case PCI_PRODUCT_NVIDIA_MCP65_LAN4: + sc->nfe_flags |= NFE_JUMBO_SUP | NFE_40BIT_ADDR | NFE_HW_CSUM; + break; } #ifndef NFE_NO_JUMBO ==== //depot/projects/newisp/dev/nfe/if_nfereg.h#2 (text+ko) ==== @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $FreeBSD: src/sys/dev/nfe/if_nfereg.h,v 1.2 2006/06/26 23:41:07 obrien Exp $ + * $FreeBSD: src/sys/dev/nfe/if_nfereg.h,v 1.3 2006/09/11 07:31:55 obrien Exp $ */ #define NFE_PCI_BA 0x10 @@ -218,6 +218,14 @@ #define PCI_PRODUCT_NVIDIA_NFORCE430_LAN2 0x0269 #define PCI_PRODUCT_NVIDIA_MCP55_LAN1 0x0372 #define PCI_PRODUCT_NVIDIA_MCP55_LAN2 0x0373 +#define PCI_PRODUCT_NVIDIA_MCP61_LAN1 0x03e5 +#define PCI_PRODUCT_NVIDIA_MCP61_LAN2 0x03e6 +#define PCI_PRODUCT_NVIDIA_MCP61_LAN3 0x03ee +#define PCI_PRODUCT_NVIDIA_MCP61_LAN4 0x03ef +#define PCI_PRODUCT_NVIDIA_MCP65_LAN1 0x0450 +#define PCI_PRODUCT_NVIDIA_MCP65_LAN2 0x0451 +#define PCI_PRODUCT_NVIDIA_MCP65_LAN3 0x0452 +#define PCI_PRODUCT_NVIDIA_MCP65_LAN4 0x0453 #define PCI_PRODUCT_NVIDIA_NFORCE3_LAN2 PCI_PRODUCT_NVIDIA_NFORCE2_400_LAN1 #define PCI_PRODUCT_NVIDIA_NFORCE3_LAN3 PCI_PRODUCT_NVIDIA_NFORCE2_400_LAN2 ==== //depot/projects/newisp/i386/i386/busdma_machdep.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/i386/i386/busdma_machdep.c,v 1.80 2006/06/01 04:49:29 silby Exp $"); +__FBSDID("$FreeBSD: src/sys/i386/i386/busdma_machdep.c,v 1.81 2006/09/11 06:48:53 scottl Exp $"); #include #include @@ -53,6 +53,9 @@ #include #define MAX_BPAGES 512 +#define BUS_DMA_USE_FILTER BUS_DMA_BUS2 +#define BUS_DMA_COULD_BOUNCE BUS_DMA_BUS3 +#define BUS_DMA_MIN_ALLOC_COMP BUS_DMA_BUS4 struct bounce_zone; @@ -137,7 +140,7 @@ static bus_addr_t add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map, vm_offset_t vaddr, bus_size_t size); static void free_bounce_page(bus_dma_tag_t dmat, struct bounce_page *bpage); -static __inline int run_filter(bus_dma_tag_t dmat, bus_addr_t paddr); +static int run_filter(bus_dma_tag_t dmat, bus_addr_t paddr); /* * Return true if a match is made. @@ -147,7 +150,7 @@ * If paddr is within the bounds of the dma tag then call the filter callback * to check for a match, if there is no filter callback then assume a match. */ -static __inline int +static int run_filter(bus_dma_tag_t dmat, bus_addr_t paddr) { int retval; @@ -202,8 +205,6 @@ panic("driver error: busdma dflt_lock called"); } -#define BUS_DMA_COULD_BOUNCE BUS_DMA_BUS3 -#define BUS_DMA_MIN_ALLOC_COMP BUS_DMA_BUS4 /* * Allocate a device specific dma_tag. */ @@ -265,6 +266,9 @@ else if (parent->boundary != 0) newtag->boundary = MIN(parent->boundary, newtag->boundary); + if ((newtag->filter != NULL) || + ((parent->flags & BUS_DMA_USE_FILTER) != 0)) + newtag->flags |= BUS_DMA_USE_FILTER; if (newtag->filter == NULL) { /* * Short circuit looking at our parent directly @@ -553,37 +557,16 @@ CTR3(KTR_BUSDMA, "%s: tag %p flags 0x%x", __func__, dmat, dmat->flags); } -/* - * Utility function to load a linear buffer. lastaddrp holds state - * between invocations (for multiple-buffer loads). segp contains - * the starting segment on entrace, and the ending segment on exit. - * first indicates if this is the first invocation of this function. - */ -static __inline int -_bus_dmamap_load_buffer(bus_dma_tag_t dmat, - bus_dmamap_t map, - void *buf, bus_size_t buflen, - pmap_t pmap, - int flags, - bus_addr_t *lastaddrp, - bus_dma_segment_t *segs, - int *segp, - int first) +static int +_bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf, + bus_size_t buflen, int flags, int *nb) { - bus_size_t sgsize; - bus_addr_t curaddr, lastaddr, baddr, bmask; vm_offset_t vaddr; + vm_offset_t vendaddr; bus_addr_t paddr; - int needbounce = 0; - int seg; + int needbounce = *nb; - if (map == NULL) - map = &nobounce_dmamap; - - if ((map != &nobounce_dmamap && map->pagesneeded == 0) - && ((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0)) { - vm_offset_t vendaddr; - + if ((map != &nobounce_dmamap && map->pagesneeded == 0)) { CTR4(KTR_BUSDMA, "lowaddr= %d Maxmem= %d, boundary= %d, " "alignment= %d", dmat->lowaddr, ptoa((vm_paddr_t)Maxmem), dmat->boundary, dmat->alignment); @@ -598,7 +581,8 @@ while (vaddr < vendaddr) { paddr = pmap_kextract(vaddr); - if (run_filter(dmat, paddr) != 0) { + if (((dmat->flags & BUS_DMA_USE_FILTER) != 0) && + run_filter(dmat, paddr) != 0) { needbounce = 1; map->pagesneeded++; } @@ -630,6 +614,43 @@ mtx_unlock(&bounce_lock); } + *nb = needbounce; + return (0); +} + +/* + * Utility function to load a linear buffer. lastaddrp holds state + * between invocations (for multiple-buffer loads). segp contains + * the starting segment on entrace, and the ending segment on exit. + * first indicates if this is the first invocation of this function. + */ +static __inline int +_bus_dmamap_load_buffer(bus_dma_tag_t dmat, + bus_dmamap_t map, + void *buf, bus_size_t buflen, + pmap_t pmap, + int flags, + bus_addr_t *lastaddrp, + bus_dma_segment_t *segs, + int *segp, + int first) +{ + bus_size_t sgsize; + bus_addr_t curaddr, lastaddr, baddr, bmask; + vm_offset_t vaddr; + int needbounce = 0; + int seg, error; + + if (map == NULL) + map = &nobounce_dmamap; + + if ((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0) { + error = _bus_dmamap_count_pages(dmat, map, buf, buflen, flags, + &needbounce); + if (error) + return (error); + } + vaddr = (vm_offset_t)buf; lastaddr = *lastaddrp; bmask = ~(dmat->boundary - 1); @@ -659,7 +680,8 @@ >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Tue Sep 12 05:07:36 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 235B916A4EA; Tue, 12 Sep 2006 05:07:36 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F2E4316A4E7 for ; Tue, 12 Sep 2006 05:07:35 +0000 (UTC) (envelope-from mjacob@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id BF4B043D46 for ; Tue, 12 Sep 2006 05:07:35 +0000 (GMT) (envelope-from mjacob@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8C57ZpL068235 for ; Tue, 12 Sep 2006 05:07:35 GMT (envelope-from mjacob@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8C57Z9Q068232 for perforce@freebsd.org; Tue, 12 Sep 2006 05:07:35 GMT (envelope-from mjacob@freebsd.org) Date: Tue, 12 Sep 2006 05:07:35 GMT Message-Id: <200609120507.k8C57Z9Q068232@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to mjacob@freebsd.org using -f From: Matt Jacob To: Perforce Change Reviews Cc: Subject: PERFORCE change 106001 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Sep 2006 05:07:36 -0000 http://perforce.freebsd.org/chv.cgi?CH=106001 Change 106001 by mjacob@newisp on 2006/09/12 05:06:35 Integrate em change. Affected files ... .. //depot/projects/newisp/dev/em/if_em.c#6 integrate Differences ... ==== //depot/projects/newisp/dev/em/if_em.c#6 (text+ko) ==== @@ -31,7 +31,7 @@ ***************************************************************************/ -/*$FreeBSD: src/sys/dev/em/if_em.c,v 1.143 2006/09/10 19:23:27 pdeuskar Exp $*/ +/*$FreeBSD: src/sys/dev/em/if_em.c,v 1.144 2006/09/11 20:59:01 pdeuskar Exp $*/ #ifdef HAVE_KERNEL_OPTION_HEADERS #include "opt_device_polling.h" @@ -1516,8 +1516,10 @@ */ if (do_tso && (m_head->m_len <= M_TSO_LEN)) { m_head = m_pullup(m_head, M_TSO_LEN + 4); - if (m_head == NULL) + *m_headp = m_head; + if (m_head == NULL) { return (ENOBUFS); + } } /* @@ -1578,7 +1580,7 @@ /* Do hardware assists */ m_head = *m_headp; - if ( ifp->if_hwassist > 0) { + if (ifp->if_hwassist > 0) { if (em_tso_setup(adapter, m_head, &txd_upper, &txd_lower)) { /* we need to make a final sentinel transmit desc */ tso_desc = TRUE; From owner-p4-projects@FreeBSD.ORG Tue Sep 12 08:30:13 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id CF01816A4C2; Tue, 12 Sep 2006 08:30:12 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 92E6E16A492 for ; Tue, 12 Sep 2006 08:30:12 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.229]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5F7B443D46 for ; Tue, 12 Sep 2006 08:30:11 +0000 (GMT) (envelope-from asmrookie@gmail.com) Received: by wx-out-0506.google.com with SMTP id i27so1947906wxd for ; Tue, 12 Sep 2006 01:30:10 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=aYNbrNa17o4rjzN0/l73C1MeIRdeA4GV5Wq8/5362zWrenQSA/eaB17xIvtMq9Gq/r4RlZ6mqqnP53q9OzQCeJE7GBPkodcoHOMYqak0tGlL+/a4ROxmUPJRS7RxWEAbgFNZs6DWDnhPhOpAev2BZnqarnprbcMqREdDmL1WVUQ= Received: by 10.70.37.12 with SMTP id k12mr7824720wxk; Tue, 12 Sep 2006 01:30:10 -0700 (PDT) Received: by 10.70.11.4 with HTTP; Tue, 12 Sep 2006 01:30:10 -0700 (PDT) Message-ID: <3bbf2fe10609120130l55c4590eha3628e7f1c21d8a7@mail.gmail.com> Date: Tue, 12 Sep 2006 10:30:10 +0200 From: "Attilio Rao" Sender: asmrookie@gmail.com To: "Alexander Leidinger" In-Reply-To: <20060912073021.pvw7p0mit4w4cs8s@webmail.leidinger.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200609100956.k8A9uD0P094639@repoman.freebsd.org> <20060911193600.7ab43fb6@Magellan.Leidinger.net> <200609111528.49054.jhb@freebsd.org> <20060912073021.pvw7p0mit4w4cs8s@webmail.leidinger.net> X-Google-Sender-Auth: 3b3afe9ce9aecf03 Cc: perforce@freebsd.org Subject: Re: PERFORCE change 105930 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Sep 2006 08:30:13 -0000 2006/9/12, Alexander Leidinger : > Quoting John Baldwin (from Mon, 11 Sep 2006 15:28:48 -0400): > > > I've only gotten this message when I've leaked memory in a zone. Do you have > > an example self-contained kernel module that produces this? > > Download > http://www.Leidinger.net/FreeBSD/linuxolator/linuxolator-p4.diff (or > check out the p4-branch) and recompile the aio and linux modules. You might put the code under "Initialize the new context" (linux_io_setup) into the init function for your UMA object, and so the destructive pair. It might not solve your problem, but it is more elegant. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-p4-projects@FreeBSD.ORG Tue Sep 12 08:47:56 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4E94816A47C; Tue, 12 Sep 2006 08:47:56 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 258B616A415 for ; Tue, 12 Sep 2006 08:47:56 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.231]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5138443D70 for ; Tue, 12 Sep 2006 08:47:48 +0000 (GMT) (envelope-from asmrookie@gmail.com) Received: by wx-out-0506.google.com with SMTP id i27so1952339wxd for ; Tue, 12 Sep 2006 01:47:47 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=ayQdhTCUdTZESuaimUqrEIcOjsAXN6406lrlVa+T6tk855te6SppiM69CVYBTguUunzp4gawyTBDJ4sU311jsq5vihw48SlUTP6SJpb19ngVt5jMpMud+kmKFYVc0gUukxeWf0w8nFV2ocs8Dq2nyC0ju+lKfxjP4iBZ1xzEQak= Received: by 10.70.61.1 with SMTP id j1mr7861559wxa; Tue, 12 Sep 2006 01:47:47 -0700 (PDT) Received: by 10.70.11.4 with HTTP; Tue, 12 Sep 2006 01:47:47 -0700 (PDT) Message-ID: <3bbf2fe10609120147p343f48a4yeef4ad42a8bbb337@mail.gmail.com> Date: Tue, 12 Sep 2006 10:47:47 +0200 From: "Attilio Rao" Sender: asmrookie@gmail.com To: "Alexander Leidinger" In-Reply-To: <3bbf2fe10609120130l55c4590eha3628e7f1c21d8a7@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200609100956.k8A9uD0P094639@repoman.freebsd.org> <20060911193600.7ab43fb6@Magellan.Leidinger.net> <200609111528.49054.jhb@freebsd.org> <20060912073021.pvw7p0mit4w4cs8s@webmail.leidinger.net> <3bbf2fe10609120130l55c4590eha3628e7f1c21d8a7@mail.gmail.com> X-Google-Sender-Auth: 776271aa9a3af1a9 Cc: perforce@freebsd.org, John Baldwin , mag@intron.ac Subject: Re: PERFORCE change 105930 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Sep 2006 08:47:56 -0000 2006/9/12, Attilio Rao : > 2006/9/12, Alexander Leidinger : > > Quoting John Baldwin (from Mon, 11 Sep 2006 15:28:48 -0400): > > > > > I've only gotten this message when I've leaked memory in a zone. Do you have > > > an example self-contained kernel module that produces this? > > > > Download > > http://www.Leidinger.net/FreeBSD/linuxolator/linuxolator-p4.diff (or > > check out the p4-branch) and recompile the aio and linux modules. > > You might put the code under "Initialize the new context" > (linux_io_setup) into the init function for your UMA object, and so > the destructive pair. > > It might not solve your problem, but it is more elegant. BTW, the error that you receive effectively happens only on memory leak. This is called from the keg destructor (uma_core.c). Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-p4-projects@FreeBSD.ORG Tue Sep 12 09:41:45 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5F5DE16A4F5; Tue, 12 Sep 2006 09:41:45 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2DE2416A47E; Tue, 12 Sep 2006 09:41:45 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from www.ebusiness-leidinger.de (jojo.ms-net.de [84.16.236.246]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6C40A43D45; Tue, 12 Sep 2006 09:41:43 +0000 (GMT) (envelope-from netchild@FreeBSD.org) Received: from Andro-Beta.Leidinger.net (p54A5D65E.dip.t-dialin.net [84.165.214.94]) (authenticated bits=0) by www.ebusiness-leidinger.de (8.13.6/8.13.6) with ESMTP id k8C9JsM6093152; Tue, 12 Sep 2006 11:19:55 +0200 (CEST) (envelope-from netchild@FreeBSD.org) Received: from localhost (webmail.Leidinger.net [192.168.1.102]) by Andro-Beta.Leidinger.net (8.13.4/8.13.3) with ESMTP id k8C9fdtR024049; Tue, 12 Sep 2006 11:41:39 +0200 (CEST) (envelope-from netchild@FreeBSD.org) Received: from psbru.cec.eu.int (psbru.cec.eu.int [158.169.131.14]) by webmail.leidinger.net (Horde MIME library) with HTTP; Tue, 12 Sep 2006 11:41:27 +0200 Message-ID: <20060912114127.7t09tj1aw4wcc8c8@webmail.leidinger.net> X-Priority: 3 (Normal) Date: Tue, 12 Sep 2006 11:41:27 +0200 From: Alexander Leidinger To: Attilio Rao References: <200609100956.k8A9uD0P094639@repoman.freebsd.org> <20060911193600.7ab43fb6@Magellan.Leidinger.net> <200609111528.49054.jhb@freebsd.org> <20060912073021.pvw7p0mit4w4cs8s@webmail.leidinger.net> <3bbf2fe10609120130l55c4590eha3628e7f1c21d8a7@mail.gmail.com> In-Reply-To: <3bbf2fe10609120130l55c4590eha3628e7f1c21d8a7@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable User-Agent: Internet Messaging Program (IMP) H3 (4.1.3) / FreeBSD-7.0 X-Virus-Scanned: by amavisd-new X-Mailman-Approved-At: Tue, 12 Sep 2006 11:54:36 +0000 Cc: perforce@FreeBSD.org, mag@intron.ac Subject: Re: PERFORCE change 105930 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Sep 2006 09:41:45 -0000 Quoting Attilio Rao (from Tue, 12 Sep 2006 =20 10:30:10 +0200): > 2006/9/12, Alexander Leidinger : >> Quoting John Baldwin (from Mon, 11 Sep 2006 =20 >> 15:28:48 -0400): >> >>> I've only gotten this message when I've leaked memory in a zone. Do >> you have >>> an example self-contained kernel module that produces this? >> >> Download >> http://www.Leidinger.net/FreeBSD/linuxolator/linuxolator-p4.diff (or >> check out the p4-branch) and recompile the aio and linux modules. > > You might put the code under "Initialize the new context" > (linux_io_setup) into the init function for your UMA object, and so > the destructive pair. > > It might not solve your problem, but it is more elegant. Please don't trim the CC, at least not intron (the author of this)... Bye, Alexander. --=20 http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID =3D B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID =3D 72077137 I don't have any solution but I certainly admire the problem. =09=09-- Ashleigh Brilliant From owner-p4-projects@FreeBSD.ORG Tue Sep 12 12:28:03 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B7E3F16A416; Tue, 12 Sep 2006 12:28:03 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5184016A412 for ; Tue, 12 Sep 2006 12:28:03 +0000 (UTC) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 16FF243D45 for ; Tue, 12 Sep 2006 12:28:03 +0000 (GMT) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8CCS2Y3025188 for ; Tue, 12 Sep 2006 12:28:02 GMT (envelope-from piso@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8CCS24V025185 for perforce@freebsd.org; Tue, 12 Sep 2006 12:28:02 GMT (envelope-from piso@freebsd.org) Date: Tue, 12 Sep 2006 12:28:02 GMT Message-Id: <200609121228.k8CCS24V025185@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to piso@freebsd.org using -f From: Paolo Pisati To: Perforce Change Reviews Cc: Subject: PERFORCE change 106010 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Sep 2006 12:28:03 -0000 http://perforce.freebsd.org/chv.cgi?CH=106010 Change 106010 by piso@piso_longino on 2006/09/12 12:27:59 -correctly release the rlock on nat_chain_rwl in case something goes wrong with the nat action -use a nat counter (nat_cnt) to keep track of all the nat instances -white space cleanup Affected files ... .. //depot/projects/soc2005/libalias/sbin/ipfw/ipfw2.c#8 edit .. //depot/projects/soc2005/libalias/sys/netinet/ip_fw2.c#13 edit Differences ... ==== //depot/projects/soc2005/libalias/sbin/ipfw/ipfw2.c#8 (text+ko) ==== @@ -5830,7 +5830,7 @@ struct cfg_nat *n; struct cfg_redir *e; int cmd, i, nbytes, do_cfg, do_rule = 0, frule, lrule, nalloc = 1024, - size = 0, loop, r; + size = 0, nat_cnt, r; u_int8_t *data = NULL, *p; char **lav, *endptr; @@ -5864,10 +5864,9 @@ if (nbytes == 0) exit(0); if (do_cfg) { - for (i = 0, loop = 1; loop; ) { + nat_cnt = *((int *)data); + for (i = sizeof(nat_cnt); nat_cnt; nat_cnt--) { n = (struct cfg_nat *)&data[i]; - if (n->next == NULL) - loop = 0; if (do_rule) if (!(frule <= n->id && lrule >= n->id)) continue; ==== //depot/projects/soc2005/libalias/sys/netinet/ip_fw2.c#13 (text+ko) ==== @@ -3420,16 +3420,17 @@ struct mbuf *mcl; /* XXX - libalias duct tape */ int ldt = 0; - char *c; + char *c; args->rule = f; /* Report matching rule. */ retval = 0; t = ((ipfw_insn_nat *)cmd)->nat; + NAT_RLOCK(&nat_chain_rwl); if (t == NULL) { - NAT_RLOCK(&nat_chain_rwl); t = lookup_nat(cmd->arg1); if (t == NULL) { retval = IP_FW_DENY; + NAT_RUNLOCK(&nat_chain_rwl); goto done; } else ((ipfw_insn_nat *)cmd)->nat = t; @@ -3495,6 +3496,7 @@ /* XXX - should i add some logging? */ m_free(mcl); badnat: + NAT_RUNLOCK(&nat_chain_rwl); args->m = NULL; retval = IP_FW_DENY; goto done; @@ -4599,9 +4601,9 @@ add_redir_spool_cfg(&buf[(sizeof(struct cfg_nat))], ptr); /* Add new entries. */ free(buf, M_IPFW); - NAT_WLOCK(&nat_chain_rwl); + NAT_WLOCK(&nat_chain_rwl); HOOK_NAT(&nat_chain, ptr); - NAT_WUNLOCK(&nat_chain_rwl); + NAT_WUNLOCK(&nat_chain_rwl); } break; @@ -4636,14 +4638,16 @@ int sof_nat = sizeof(struct cfg_nat); int sof_redir = sizeof(struct cfg_redir); int sof_spool = sizeof(struct cfg_spool); - int off = 0; - + int nat_cnt = 0, off = sizeof(nat_cnt); + + printf("NAT_GET_CONFIG\n"); data = malloc(NAT_BUF_LEN, M_IPFW, M_NOWAIT | M_ZERO); if (data == NULL) return (ENOSPC); NAT_RLOCK(&nat_chain_rwl); /* Serialize all the data. */ LIST_FOREACH(n, &nat_chain, _next) { + nat_cnt++; if (off + sof_nat < NAT_BUF_LEN) { bcopy(n, &data[off], sof_nat); off += sof_nat; @@ -4664,9 +4668,11 @@ } else goto nospace; } + bcopy(&nat_cnt, data, sizeof(nat_cnt)); NAT_RUNLOCK(&nat_chain_rwl); error = sooptcopyout(sopt, data, NAT_BUF_LEN); free(data, M_IPFW); + break; nospace: NAT_RUNLOCK(&nat_chain_rwl); printf("serialized data buffer not big enough: please increase NAT_BUF_LEN\n"); From owner-p4-projects@FreeBSD.ORG Tue Sep 12 12:49:30 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9855F16A47C; Tue, 12 Sep 2006 12:49:30 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6D85C16A417 for ; Tue, 12 Sep 2006 12:49:30 +0000 (UTC) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 34DCA43D46 for ; Tue, 12 Sep 2006 12:49:30 +0000 (GMT) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8CCnU3h034478 for ; Tue, 12 Sep 2006 12:49:30 GMT (envelope-from piso@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8CCnUcV034475 for perforce@freebsd.org; Tue, 12 Sep 2006 12:49:30 GMT (envelope-from piso@freebsd.org) Date: Tue, 12 Sep 2006 12:49:30 GMT Message-Id: <200609121249.k8CCnUcV034475@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to piso@freebsd.org using -f From: Paolo Pisati To: Perforce Change Reviews Cc: Subject: PERFORCE change 106011 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Sep 2006 12:49:30 -0000 http://perforce.freebsd.org/chv.cgi?CH=106011 Change 106011 by piso@piso_longino on 2006/09/12 12:49:00 s/$Id$/$FreeBSD$/ Affected files ... .. //depot/projects/soc2005/libalias/lib/libalias/Makefile#4 edit .. //depot/projects/soc2005/libalias/lib/libalias/modules/Makefile#2 edit .. //depot/projects/soc2005/libalias/lib/libalias/modules/modules.inc#2 edit .. //depot/projects/soc2005/libalias/sys/modules/libalias/Makefile#5 edit .. //depot/projects/soc2005/libalias/sys/modules/libalias/modules/Makefile#2 edit .. //depot/projects/soc2005/libalias/sys/modules/libalias/modules/modules.inc#2 edit Differences ... ==== //depot/projects/soc2005/libalias/lib/libalias/Makefile#4 (text+ko) ==== @@ -22,7 +22,7 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# $Id$ +# $FreeBSD$ SUBDIR+= libalias modules ==== //depot/projects/soc2005/libalias/lib/libalias/modules/Makefile#2 (text+ko) ==== @@ -22,7 +22,7 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# $Id$ +# $FreeBSD$ .include "modules.inc" ==== //depot/projects/soc2005/libalias/lib/libalias/modules/modules.inc#2 (text+ko) ==== @@ -1,4 +1,4 @@ -# $Id$ +# $FreeBSD$ .include ==== //depot/projects/soc2005/libalias/sys/modules/libalias/Makefile#5 (text+ko) ==== @@ -22,7 +22,7 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# $Id$ +# $FreeBSD$ SUBDIR+= libalias modules ==== //depot/projects/soc2005/libalias/sys/modules/libalias/modules/Makefile#2 (text+ko) ==== @@ -22,7 +22,7 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# $Id$ +# $FreeBSD$ .include "modules.inc" ==== //depot/projects/soc2005/libalias/sys/modules/libalias/modules/modules.inc#2 (text+ko) ==== @@ -1,4 +1,4 @@ -# $Id$ +# $FreeBSD$ .include From owner-p4-projects@FreeBSD.ORG Tue Sep 12 12:54:39 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 19ACC16A47C; Tue, 12 Sep 2006 12:54:39 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E5BE416A417 for ; Tue, 12 Sep 2006 12:54:38 +0000 (UTC) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 46BC943D66 for ; Tue, 12 Sep 2006 12:54:37 +0000 (GMT) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8CCsbbu034813 for ; Tue, 12 Sep 2006 12:54:37 GMT (envelope-from piso@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8CCsblE034810 for perforce@freebsd.org; Tue, 12 Sep 2006 12:54:37 GMT (envelope-from piso@freebsd.org) Date: Tue, 12 Sep 2006 12:54:37 GMT Message-Id: <200609121254.k8CCsblE034810@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to piso@freebsd.org using -f From: Paolo Pisati To: Perforce Change Reviews Cc: Subject: PERFORCE change 106012 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Sep 2006 12:54:39 -0000 http://perforce.freebsd.org/chv.cgi?CH=106012 Change 106012 by piso@piso_longino on 2006/09/12 12:54:09 Style bug: SUBDIR is assigned with a simple `='. Affected files ... .. //depot/projects/soc2005/libalias/lib/libalias/Makefile#5 edit .. //depot/projects/soc2005/libalias/sys/modules/libalias/Makefile#6 edit Differences ... ==== //depot/projects/soc2005/libalias/lib/libalias/Makefile#5 (text+ko) ==== @@ -24,6 +24,6 @@ # # $FreeBSD$ -SUBDIR+= libalias modules +SUBDIR= libalias modules .include ==== //depot/projects/soc2005/libalias/sys/modules/libalias/Makefile#6 (text+ko) ==== @@ -24,6 +24,6 @@ # # $FreeBSD$ -SUBDIR+= libalias modules +SUBDIR= libalias modules .include From owner-p4-projects@FreeBSD.ORG Tue Sep 12 13:09:59 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 47E7416A415; Tue, 12 Sep 2006 13:09:59 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0927F16A403 for ; Tue, 12 Sep 2006 13:09:59 +0000 (UTC) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id C995443D6A for ; Tue, 12 Sep 2006 13:09:58 +0000 (GMT) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8CD9wIm036667 for ; Tue, 12 Sep 2006 13:09:58 GMT (envelope-from piso@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8CD9wAx036664 for perforce@freebsd.org; Tue, 12 Sep 2006 13:09:58 GMT (envelope-from piso@freebsd.org) Date: Tue, 12 Sep 2006 13:09:58 GMT Message-Id: <200609121309.k8CD9wAx036664@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to piso@freebsd.org using -f From: Paolo Pisati To: Perforce Change Reviews Cc: Subject: PERFORCE change 106013 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Sep 2006 13:09:59 -0000 http://perforce.freebsd.org/chv.cgi?CH=106013 Change 106013 by piso@piso_longino on 2006/09/12 13:09:21 Style bug: tab after ':', actually it should be a single white space. Affected files ... .. //depot/projects/soc2005/libalias/lib/libalias/libalias/Makefile#2 edit .. //depot/projects/soc2005/libalias/lib/libalias/modules/Makefile.inc#2 edit Differences ... ==== //depot/projects/soc2005/libalias/lib/libalias/libalias/Makefile#2 (text+ko) ==== @@ -1,6 +1,6 @@ # $FreeBSD: src/lib/libalias/Makefile,v 1.30.2.1 2005/07/22 17:29:02 kensmith Exp $ -.PATH: ${.CURDIR}/../../../sys/netinet/libalias +.PATH: ${.CURDIR}/../../../sys/netinet/libalias LIB= alias SHLIBDIR?= /lib ==== //depot/projects/soc2005/libalias/lib/libalias/modules/Makefile.inc#2 (text+ko) ==== @@ -1,4 +1,4 @@ -.PATH: ${.CURDIR}/../../../../sys/netinet/libalias +.PATH: ${.CURDIR}/../../../../sys/netinet/libalias SHLIBDIR?= /lib SHLIB_MAJOR= 4 From owner-p4-projects@FreeBSD.ORG Tue Sep 12 13:14:05 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 40A4016A47C; Tue, 12 Sep 2006 13:14:05 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BCFF416A403 for ; Tue, 12 Sep 2006 13:14:04 +0000 (UTC) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 747B643D45 for ; Tue, 12 Sep 2006 13:14:04 +0000 (GMT) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8CDE4E8036971 for ; Tue, 12 Sep 2006 13:14:04 GMT (envelope-from piso@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8CDE4HC036968 for perforce@freebsd.org; Tue, 12 Sep 2006 13:14:04 GMT (envelope-from piso@freebsd.org) Date: Tue, 12 Sep 2006 13:14:04 GMT Message-Id: <200609121314.k8CDE4HC036968@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to piso@freebsd.org using -f From: Paolo Pisati To: Perforce Change Reviews Cc: Subject: PERFORCE change 106014 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Sep 2006 13:14:05 -0000 http://perforce.freebsd.org/chv.cgi?CH=106014 Change 106014 by piso@piso_longino on 2006/09/12 13:13:18 Missing new line. Affected files ... .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_cuseeme.c#10 edit Differences ... ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_cuseeme.c#10 (text+ko) ==== @@ -69,6 +69,7 @@ static void AliasHandleCUSeeMeIn(struct libalias *la, struct ip *pip, struct in_addr original_addr); + static int fingerprint(struct libalias *la, struct ip *pip, struct alias_data *ah) { From owner-p4-projects@FreeBSD.ORG Tue Sep 12 14:03:07 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C159E16A416; Tue, 12 Sep 2006 14:03:07 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 63FAB16A415 for ; Tue, 12 Sep 2006 14:03:07 +0000 (UTC) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0F92743D46 for ; Tue, 12 Sep 2006 14:03:07 +0000 (GMT) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8CE372X040942 for ; Tue, 12 Sep 2006 14:03:07 GMT (envelope-from piso@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8CE36TU040937 for perforce@freebsd.org; Tue, 12 Sep 2006 14:03:06 GMT (envelope-from piso@freebsd.org) Date: Tue, 12 Sep 2006 14:03:06 GMT Message-Id: <200609121403.k8CE36TU040937@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to piso@freebsd.org using -f From: Paolo Pisati To: Perforce Change Reviews Cc: Subject: PERFORCE change 106015 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Sep 2006 14:03:08 -0000 http://perforce.freebsd.org/chv.cgi?CH=106015 Change 106015 by piso@piso_longino on 2006/09/12 14:02:26 style: function opening brace must go on the next line. Affected files ... .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias.c#13 edit .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_cuseeme.c#11 edit .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_db.c#7 edit .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_dummy.c#10 edit .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_ftp.c#10 edit .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_irc.c#11 edit .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_mod.c#20 edit .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_nbt.c#11 edit .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_pptp.c#9 edit .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_skinny.c#9 edit .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_smedia.c#10 edit .. //depot/projects/soc2005/libalias/sys/netinet/libalias/libalias.3#6 edit Differences ... ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias.c#13 (text+ko) ==== @@ -1491,7 +1491,8 @@ #ifndef _KERNEL int -LibAliasRefreshModules(void) { +LibAliasRefreshModules(void) +{ char buf[256], conf[] = "/etc/libalias.conf"; FILE *fd; int len; @@ -1517,7 +1518,8 @@ } int -LibAliasLoadModule(char *path) { +LibAliasLoadModule(char *path) +{ struct dll *t; void *handle; struct proto_handler *m; @@ -1558,7 +1560,8 @@ } int -LibAliasUnLoadAllModule(void) { +LibAliasUnLoadAllModule(void) +{ struct dll *t; struct proto_handler *p; ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_cuseeme.c#11 (text+ko) ==== @@ -71,7 +71,8 @@ struct in_addr original_addr); static int -fingerprint(struct libalias *la, struct ip *pip, struct alias_data *ah) { +fingerprint(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ if (ah->dport == NULL || ah->oaddr == NULL) return (-1); @@ -81,14 +82,16 @@ } static int -protohandlerin(struct libalias *la, struct ip *pip, struct alias_data *ah) { +protohandlerin(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ AliasHandleCUSeeMeIn(la, pip, *ah->oaddr); return (0); } static int -protohandlerout(struct libalias *la, struct ip *pip, struct alias_data *ah) { +protohandlerout(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ AliasHandleCUSeeMeOut(la, pip, ah->lnk); return (0); ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_db.c#7 (text+ko) ==== @@ -467,7 +467,8 @@ #ifdef _KERNEL static void -AliasLog(char * str, const char * format, ...) { +AliasLog(char * str, const char * format, ...) +{ va_list ap; va_start(ap, format); @@ -477,7 +478,8 @@ } #else static void -AliasLog(FILE * stream, const char * format, ...) { +AliasLog(FILE * stream, const char * format, ...) +{ va_list ap; va_start(ap, format); @@ -488,7 +490,8 @@ #endif static void -ShowAliasStats(struct libalias *la) { +ShowAliasStats(struct libalias *la) +{ /* Used for debugging */ if (la->logDesc) { ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_dummy.c#10 (text+ko) ==== @@ -68,7 +68,8 @@ AliasHandleDummy(struct libalias *la, struct ip *ip, struct alias_data *ah); static int -fingerprint(struct libalias *la, struct ip *pip, struct alias_data *ah) { +fingerprint(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ /* * Check here all the data that will be used later, if any field @@ -93,7 +94,8 @@ */ static int -protohandler(struct libalias *la, struct ip *pip, struct alias_data *ah) { +protohandler(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ AliasHandleDummy(la, pip, ah); return (0); @@ -152,7 +154,8 @@ #endif static void -AliasHandleDummy(struct libalias *la, struct ip *ip, struct alias_data *ah) { +AliasHandleDummy(struct libalias *la, struct ip *ip, struct alias_data *ah) +{ ; /* Dummy. */ } ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_ftp.c#10 (text+ko) ==== @@ -108,7 +108,8 @@ int maxpacketsize); static int -fingerprint(struct libalias *la, struct ip *pip, struct alias_data *ah) { +fingerprint(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL || ah->maxpktsize == 0) @@ -120,7 +121,8 @@ } static int -protohandler(struct libalias *la, struct ip *pip, struct alias_data *ah) { +protohandler(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ AliasHandleFtpOut(la, pip, ah->lnk, ah->maxpktsize); return (0); ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_irc.c#11 (text+ko) ==== @@ -93,7 +93,8 @@ int maxpacketsize); static int -fingerprint(struct libalias *la, struct ip *pip, struct alias_data *ah) { +fingerprint(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ if (ah->dport == NULL || ah->dport == NULL || ah->lnk == NULL || ah->maxpktsize == 0) @@ -105,7 +106,8 @@ } static int -protohandler(struct libalias *la, struct ip *pip, struct alias_data *ah) { +protohandler(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ AliasHandleIrcOut(la, pip, ah->lnk, ah->maxpktsize); return (0); @@ -123,7 +125,8 @@ }; static int -mod_handler(module_t mod, int type, void *data) { +mod_handler(module_t mod, int type, void *data) +{ int error; switch (type) { ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_mod.c#20 (text+ko) ==== @@ -101,14 +101,16 @@ } static void -_handler_chain_init(void) { +_handler_chain_init(void) +{ if (!rw_initialized(&handler_rw)) LIBALIAS_LOCK_INIT(); } static void -_handler_chain_destroy(void) { +_handler_chain_destroy(void) +{ if (rw_initialized(&handler_rw)) LIBALIAS_LOCK_DESTROY(); @@ -145,29 +147,34 @@ } static void -_handler_chain_init(void) { +_handler_chain_init(void) +{ ; } static void -_handler_chain_destroy(void) { +_handler_chain_destroy(void) +{ ; } #endif void -handler_chain_init(void) { +handler_chain_init(void) +{ _handler_chain_init(); } void -handler_chain_destroy(void) { +handler_chain_destroy(void) +{ _handler_chain_destroy(); } static int -_attach_handler(struct proto_handler *p) { +_attach_handler(struct proto_handler *p) +{ struct proto_handler *b = NULL; LIBALIAS_WLOCK_ASSERT(); @@ -190,7 +197,8 @@ } static int -_detach_handler(struct proto_handler *p) { +_detach_handler(struct proto_handler *p) +{ struct proto_handler *b, *b_tmp;; LIBALIAS_WLOCK_ASSERT(); @@ -204,7 +212,8 @@ } int -LibAliasAttachHandlers(struct proto_handler *_p) { +LibAliasAttachHandlers(struct proto_handler *_p) +{ int i, error = -1; LIBALIAS_WLOCK(); @@ -220,7 +229,8 @@ } int -LibAliasDetachHandlers(struct proto_handler *_p) { +LibAliasDetachHandlers(struct proto_handler *_p) +{ int i, error = -1; LIBALIAS_WLOCK(); @@ -236,7 +246,8 @@ } int -detach_handler(struct proto_handler *_p) { +detach_handler(struct proto_handler *_p) +{ int error = -1; LIBALIAS_WLOCK(); @@ -247,7 +258,8 @@ int find_handler(int8_t dir, int8_t proto, struct libalias *la, struct ip *pip, - struct alias_data *ad) { + struct alias_data *ad) +{ struct proto_handler *p; int error = ENOENT; @@ -265,7 +277,8 @@ } struct proto_handler * -first_handler(void) { +first_handler(void) +{ return (LIST_FIRST(&handler_chain)); } @@ -273,7 +286,8 @@ /* Dll manipulation code - this code is not thread safe... */ int -attach_dll(struct dll *p) { +attach_dll(struct dll *p) +{ struct dll *b; SLIST_FOREACH(b, &dll_chain, next) { @@ -285,7 +299,8 @@ } void * -detach_dll(char *p) { +detach_dll(char *p) +{ struct dll *b = NULL, *b_tmp; void *error = NULL; @@ -299,7 +314,8 @@ } struct dll * -walk_dll_chain(void) { +walk_dll_chain(void) +{ struct dll *t; t = SLIST_FIRST(&dll_chain); ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_nbt.c#11 (text+ko) ==== @@ -85,7 +85,8 @@ AliasHandleUdpNbtNS(struct libalias *, struct ip *, struct alias_link *, struct in_addr *, u_short *, struct in_addr *, u_short *); static int -fingerprint1(struct libalias *la, struct ip *pip, struct alias_data *ah) { +fingerprint1(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL || ah->aaddr == NULL || ah->aport == NULL) @@ -97,14 +98,16 @@ } static int -protohandler1(struct libalias *la, struct ip *pip, struct alias_data *ah) { +protohandler1(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ AliasHandleUdpNbt(la, pip, ah->lnk, ah->aaddr, *ah->aport); return (0); } static int -fingerprint2(struct libalias *la, struct ip *pip, struct alias_data *ah) { +fingerprint2(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL || ah->aaddr == NULL || ah->aport == NULL) @@ -116,7 +119,8 @@ } static int -protohandler2in(struct libalias *la, struct ip *pip, struct alias_data *ah) { +protohandler2in(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ AliasHandleUdpNbtNS(la, pip, ah->lnk, ah->aaddr, ah->aport, ah->oaddr, ah->dport); @@ -124,7 +128,8 @@ } static int -protohandler2out(struct libalias *la, struct ip *pip, struct alias_data *ah) { +protohandler2out(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ AliasHandleUdpNbtNS(la, pip, ah->lnk, &pip->ip_src, ah->sport, ah->aaddr, ah->aport); ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_pptp.c#9 (text+ko) ==== @@ -93,7 +93,8 @@ AliasHandlePptpGreIn(struct libalias *, struct ip *); static int -fingerprint(struct libalias *la, struct ip *pip, struct alias_data *ah) { +fingerprint(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL) return (-1); @@ -104,27 +105,31 @@ } static int -fingerprintgre(struct libalias *la, struct ip *pip, struct alias_data *ah) { +fingerprintgre(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ return (0); } static int -protohandlerin(struct libalias *la, struct ip *pip, struct alias_data *ah) { +protohandlerin(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ AliasHandlePptpIn(la, pip, ah->lnk); return (0); } static int -protohandlerout(struct libalias *la, struct ip *pip, struct alias_data *ah) { +protohandlerout(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ AliasHandlePptpOut(la, pip, ah->lnk); return (0); } static int -protohandlergrein(struct libalias *la, struct ip *pip, struct alias_data *ah) { +protohandlergrein(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ if (la->packetAliasMode & PKT_ALIAS_PROXY_ONLY || AliasHandlePptpGreIn(la, pip) == 0) @@ -133,7 +138,8 @@ } static int -protohandlergreout(struct libalias *la, struct ip *pip, struct alias_data *ah) { +protohandlergreout(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ if (AliasHandlePptpGreOut(la, pip) == 0) return (0); ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_skinny.c#9 (text+ko) ==== @@ -68,7 +68,8 @@ AliasHandleSkinny(struct libalias *, struct ip *, struct alias_link *); static int -fingerprint(struct libalias *la, struct ip *pip, struct alias_data *ah) { +fingerprint(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL) return (-1); @@ -79,7 +80,8 @@ } static int -protohandler(struct libalias *la, struct ip *pip, struct alias_data *ah) { +protohandler(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ AliasHandleSkinny(la, pip, ah->lnk); return (0); ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_smedia.c#10 (text+ko) ==== @@ -137,7 +137,8 @@ AliasHandleRtspOut(struct libalias *, struct ip *, struct alias_link *, int maxpacketsize); static int -fingerprint(struct libalias *la, struct ip *pip, struct alias_data *ah) { +fingerprint(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL || ah->maxpktsize == 0) @@ -152,7 +153,8 @@ } static int -protohandler(struct libalias *la, struct ip *pip, struct alias_data *ah) { +protohandler(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ if (ntohs(*ah->dport) == TFTP_PORT_NUMBER) FindRtspOut(la, pip->ip_src, pip->ip_dst, ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/libalias.3#6 (text+ko) ==== @@ -1345,7 +1345,8 @@ static #endif int -fingerprint(struct libalias *la, struct ip *pip, struct alias_data *ah) { +fingerprint(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ ... } @@ -1355,7 +1356,8 @@ #endif int protohandler(struct libalias *la, struct ip *pip, - struct alias_data *ah) { + struct alias_data *ah) +{ ... } @@ -1388,7 +1390,8 @@ .An 5) and place this function somewhere in main.c: .Pp .An static void -.An signal_handler(int sig) { +.An signal_handler(int sig) +.An { .Pp .An LibAliasRefreshModules(); .An } From owner-p4-projects@FreeBSD.ORG Tue Sep 12 14:49:06 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6557816A412; Tue, 12 Sep 2006 14:49:06 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2864A16A403 for ; Tue, 12 Sep 2006 14:49:06 +0000 (UTC) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id E9EB843D49 for ; Tue, 12 Sep 2006 14:49:05 +0000 (GMT) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8CEn5xQ044262 for ; Tue, 12 Sep 2006 14:49:05 GMT (envelope-from piso@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8CEn5j3044259 for perforce@freebsd.org; Tue, 12 Sep 2006 14:49:05 GMT (envelope-from piso@freebsd.org) Date: Tue, 12 Sep 2006 14:49:05 GMT Message-Id: <200609121449.k8CEn5j3044259@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to piso@freebsd.org using -f From: Paolo Pisati To: Perforce Change Reviews Cc: Subject: PERFORCE change 106017 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Sep 2006 14:49:06 -0000 http://perforce.freebsd.org/chv.cgi?CH=106017 Change 106017 by piso@piso_longino on 2006/09/12 14:48:51 Don't use WARNS in kernel modules. Affected files ... .. //depot/projects/soc2005/libalias/sys/modules/libalias/libalias/Makefile#7 edit .. //depot/projects/soc2005/libalias/sys/modules/libalias/modules/Makefile.inc#2 edit Differences ... ==== //depot/projects/soc2005/libalias/sys/modules/libalias/libalias/Makefile#7 (text+ko) ==== @@ -2,6 +2,5 @@ KMOD= libalias SRCS= alias.c alias_db.c alias_proxy.c alias_util.c alias_old.c alias_mod.c -WARNS?= 1 .include ==== //depot/projects/soc2005/libalias/sys/modules/libalias/modules/Makefile.inc#2 (text+ko) ==== @@ -1,3 +1,1 @@ .PATH: ${.CURDIR}/../../../../netinet/libalias - -WARNS?= 1 From owner-p4-projects@FreeBSD.ORG Tue Sep 12 15:03:24 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C88E916A40F; Tue, 12 Sep 2006 15:03:24 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7A10E16A407 for ; Tue, 12 Sep 2006 15:03:24 +0000 (UTC) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 22E1943D4C for ; Tue, 12 Sep 2006 15:03:24 +0000 (GMT) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8CF3OfL046172 for ; Tue, 12 Sep 2006 15:03:24 GMT (envelope-from piso@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8CF3N1t046169 for perforce@freebsd.org; Tue, 12 Sep 2006 15:03:23 GMT (envelope-from piso@freebsd.org) Date: Tue, 12 Sep 2006 15:03:23 GMT Message-Id: <200609121503.k8CF3N1t046169@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to piso@freebsd.org using -f From: Paolo Pisati To: Perforce Change Reviews Cc: Subject: PERFORCE change 106018 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Sep 2006 15:03:25 -0000 http://perforce.freebsd.org/chv.cgi?CH=106018 Change 106018 by piso@piso_longino on 2006/09/12 15:02:29 Delete whitespace after *. Affected files ... .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_db.c#8 edit Differences ... ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_db.c#8 (text+ko) ==== @@ -467,7 +467,7 @@ #ifdef _KERNEL static void -AliasLog(char * str, const char * format, ...) +AliasLog(char *str, const char *format, ...) { va_list ap; @@ -478,7 +478,7 @@ } #else static void -AliasLog(FILE * stream, const char * format, ...) +AliasLog(FILE *stream, const char *format, ...) { va_list ap; From owner-p4-projects@FreeBSD.ORG Tue Sep 12 15:11:37 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 372B316A4A7; Tue, 12 Sep 2006 15:11:37 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D82C816A522 for ; Tue, 12 Sep 2006 15:11:36 +0000 (UTC) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9677B43D5D for ; Tue, 12 Sep 2006 15:11:35 +0000 (GMT) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8CFBZiP046595 for ; Tue, 12 Sep 2006 15:11:35 GMT (envelope-from piso@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8CFBZcn046592 for perforce@freebsd.org; Tue, 12 Sep 2006 15:11:35 GMT (envelope-from piso@freebsd.org) Date: Tue, 12 Sep 2006 15:11:35 GMT Message-Id: <200609121511.k8CFBZcn046592@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to piso@freebsd.org using -f From: Paolo Pisati To: Perforce Change Reviews Cc: Subject: PERFORCE change 106020 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Sep 2006 15:11:37 -0000 http://perforce.freebsd.org/chv.cgi?CH=106020 Change 106020 by piso@piso_longino on 2006/09/12 15:11:33 Axe some compatibility code for FreeBSD 5.x. Affected files ... .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_db.c#9 edit .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_pptp.c#10 edit Differences ... ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_db.c#9 (text+ko) ==== @@ -2588,11 +2588,7 @@ /* Firewall include files */ #include -#if __FreeBSD__ < 5 -#include -#else #include -#endif #include #include ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_pptp.c#10 (text+ko) ==== @@ -41,11 +41,7 @@ /* Includes */ #ifdef _KERNEL -#if __FreeBSD__ >= 5 #include -#else -#include -#endif #include #include #include From owner-p4-projects@FreeBSD.ORG Tue Sep 12 19:40:18 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 89FFB16A494; Tue, 12 Sep 2006 19:40:18 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 65A5016A49E for ; Tue, 12 Sep 2006 19:40:18 +0000 (UTC) (envelope-from millert@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 07AF143D45 for ; Tue, 12 Sep 2006 19:40:18 +0000 (GMT) (envelope-from millert@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8CJeHPs073328 for ; Tue, 12 Sep 2006 19:40:17 GMT (envelope-from millert@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8CJeHCZ073325 for perforce@freebsd.org; Tue, 12 Sep 2006 19:40:17 GMT (envelope-from millert@freebsd.org) Date: Tue, 12 Sep 2006 19:40:17 GMT Message-Id: <200609121940.k8CJeHCZ073325@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to millert@freebsd.org using -f From: Todd Miller To: Perforce Change Reviews Cc: Subject: PERFORCE change 106027 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Sep 2006 19:40:18 -0000 http://perforce.freebsd.org/chv.cgi?CH=106027 Change 106027 by millert@millert_g5tower on 2006/09/12 19:39:25 Add execute bit. Affected files ... .. //depot/projects/trustedbsd/sedarwin8/policies/sedarwin/policy/update_plist#2 edit Differences ... ==== //depot/projects/trustedbsd/sedarwin8/policies/sedarwin/policy/update_plist#2 (xtext/text+ko) ==== From owner-p4-projects@FreeBSD.ORG Tue Sep 12 19:53:35 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 63A0E16A4ED; Tue, 12 Sep 2006 19:53:35 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3AD2616A4E9 for ; Tue, 12 Sep 2006 19:53:35 +0000 (UTC) (envelope-from millert@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id E785243D45 for ; Tue, 12 Sep 2006 19:53:34 +0000 (GMT) (envelope-from millert@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8CJrYlI074057 for ; Tue, 12 Sep 2006 19:53:34 GMT (envelope-from millert@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8CJrY3O074054 for perforce@freebsd.org; Tue, 12 Sep 2006 19:53:34 GMT (envelope-from millert@freebsd.org) Date: Tue, 12 Sep 2006 19:53:34 GMT Message-Id: <200609121953.k8CJrY3O074054@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to millert@freebsd.org using -f From: Todd Miller To: Perforce Change Reviews Cc: Subject: PERFORCE change 106028 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Sep 2006 19:53:35 -0000 http://perforce.freebsd.org/chv.cgi?CH=106028 Change 106028 by millert@millert_g5tower on 2006/09/12 19:53:26 Remove generated security.h in clean target Affected files ... .. //depot/projects/trustedbsd/sedarwin8/darwin/libmac/Makefile#3 edit Differences ... ==== //depot/projects/trustedbsd/sedarwin8/darwin/libmac/Makefile#3 (text+ko) ==== @@ -19,7 +19,7 @@ $(RANLIB) $(DESTDIR)/usr/lib/lib$(LIB).a clean: - rm -f lib$(LIB).a $(OBJS) security.c + rm -f lib$(LIB).a $(OBJS) security.c security.h lib$(LIB).a:: $(OBJS) rm -f lib$(LIB).a From owner-p4-projects@FreeBSD.ORG Tue Sep 12 20:16:17 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1399B16A4A0; Tue, 12 Sep 2006 20:16:17 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DCE0F16A47B for ; Tue, 12 Sep 2006 20:16:16 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2211443DAB for ; Tue, 12 Sep 2006 20:15:02 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8CKF2Bv078286 for ; Tue, 12 Sep 2006 20:15:02 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8CKF2c8078280 for perforce@freebsd.org; Tue, 12 Sep 2006 20:15:02 GMT (envelope-from imp@freebsd.org) Date: Tue, 12 Sep 2006 20:15:02 GMT Message-Id: <200609122015.k8CKF2c8078280@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 106029 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Sep 2006 20:16:17 -0000 http://perforce.freebsd.org/chv.cgi?CH=106029 Change 106029 by imp@imp_lighthouse on 2006/09/12 20:14:28 nit Affected files ... .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/mci_device.c#11 edit Differences ... ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/mci_device.c#11 (text+ko) ==== @@ -556,7 +556,8 @@ //* \fn AT91F_MCI_SDCard_Init //* \brief Return the SDCard initialisation status //*---------------------------------------------------------------------------- -AT91S_MCIDeviceStatus AT91F_MCI_SDCard_Init (AT91PS_MciDevice pMCI_Device) +AT91S_MCIDeviceStatus +AT91F_MCI_SDCard_Init (AT91PS_MciDevice pMCI_Device) { unsigned int tab_response[4]; unsigned int mult,blocknr; From owner-p4-projects@FreeBSD.ORG Tue Sep 12 20:30:54 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2393516A4D2; Tue, 12 Sep 2006 20:30:54 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F13E916A4C9 for ; Tue, 12 Sep 2006 20:30:53 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2503F43ECD for ; Tue, 12 Sep 2006 20:28:19 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8CKSJMo079271 for ; Tue, 12 Sep 2006 20:28:19 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8CKSIbL079268 for perforce@freebsd.org; Tue, 12 Sep 2006 20:28:18 GMT (envelope-from imp@freebsd.org) Date: Tue, 12 Sep 2006 20:28:18 GMT Message-Id: <200609122028.k8CKSIbL079268@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 106030 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Sep 2006 20:30:54 -0000 http://perforce.freebsd.org/chv.cgi?CH=106030 Change 106030 by imp@imp_lighthouse on 2006/09/12 20:27:42 Break out mmc detection code to its own routine. Add stubbed sd card detection code minor formatting nits. Affected files ... .. //depot/projects/arm/src/sys/arm/at91/at91_qdmmc.c#3 edit Differences ... ==== //depot/projects/arm/src/sys/arm/at91/at91_qdmmc.c#3 (text+ko) ==== @@ -128,7 +128,8 @@ error = RD4(sc, MCI_SR) & MCI_SR_ERROR; if (error) { - if ((cmd != AT91C_SDCARD_APP_OP_COND_CMD) && (cmd != AT91C_MMC_SEND_OP_COND_CMD)) { + if ((cmd != AT91C_SDCARD_APP_OP_COND_CMD) && + (cmd != AT91C_MMC_SEND_OP_COND_CMD)) { //printf("qdmmc: Error 0x%x\n", error); return (error); } @@ -150,6 +151,137 @@ } static int +at91_qdmmc_sdcard_init(device_t dev) +{ + return (ENXIO); +} + +static int +at91_qdmmc_mmc_init(device_t dev) +{ + struct at91_qdmmc_softc *sc = device_get_softc(dev); + uint32_t cond; + int err; + + err = 0; + /* get all cards into idle state */ + at91_qdmmc_SendCommand(dev, AT91C_MMC_GO_IDLE_STATE_CMD, + AT91C_NO_ARGUMENT); + + /* check operating conditions */ + do { /* loop on busy */ + err = at91_qdmmc_SendCommand(dev, AT91C_MMC_SEND_OP_COND_CMD, + AT91C_MMC_HOST_VOLTAGE_RANGE); + if (err != 0) { + err = 0; + printf("No MMC cards found\n"); + goto out; + } + cond = RD4(sc, MCI_RSPR); + } while ((cond & AT91C_CARD_POWER_UP_BUSY) == 0); + printf("at91_qdmmc_attach: operating conditions: 0x%x\n", + cond & ~(AT91C_CARD_POWER_UP_BUSY)); + + /* now find our cards */ + for(sc->nb_cards = 0; sc->nb_cards < MMC_MAX; sc->nb_cards++) { + int status; + int card = sc->nb_cards; + status = at91_qdmmc_SendCommand(dev, AT91C_MMC_ALL_SEND_CID_CMD, + AT91C_NO_ARGUMENT); + if (status != 0) { + break; + } + sc->cards[card].CID[0] = RD4(sc, MCI_RSPR + 0); + sc->cards[card].CID[1] = RD4(sc, MCI_RSPR + 4); + sc->cards[card].CID[2] = RD4(sc, MCI_RSPR + 8); + sc->cards[card].CID[3] = RD4(sc, MCI_RSPR + 12); + printf("Found MMC %i - CID = 0x%x%x%x%x\n", card, + sc->cards[card].CID[0], + sc->cards[card].CID[1], + sc->cards[card].CID[2], + sc->cards[card].CID[3]); + printf("MMC %i: Vendor-ID = 0x%x\n", card, + sc->cards[card].CID[0] >> 24), + printf("MMC %i: OEM-ID = 0x%x\n", card, + (sc->cards[card].CID[0] >> 8) & 0xffff), + sc->cards[card].name[0] = (sc->cards[card].CID[0] >> 0) & 0xff; + sc->cards[card].name[1] = (sc->cards[card].CID[1] >> 24) & 0xff; + sc->cards[card].name[2] = (sc->cards[card].CID[1] >> 16) & 0xff; + sc->cards[card].name[3] = (sc->cards[card].CID[1] >> 8) & 0xff; + sc->cards[card].name[4] = (sc->cards[card].CID[1] >> 0) & 0xff; + sc->cards[card].name[5] = (sc->cards[card].CID[2] >> 24) & 0xff; + sc->cards[card].name[6] = '\0'; + printf("MMC %i: Productname = %s\n", card, + sc->cards[card].name); + printf("MMC %i: Revision = 0x%x\n", card, + (sc->cards[card].CID[2] >> 16) & 0xff), + printf("MMC %i: Serial = 0x%x\n", card, + (sc->cards[card].CID[2] << 16) | + (sc->cards[card].CID[3] >> 16)); + int year = 1997; + year += ((sc->cards[card].CID[3] >> 8) & 0xf); + int month = 0; + month += ((sc->cards[card].CID[3] >> 12) & 0xf); + printf("MMC %i: Manufacturing Date = %i/%i\n", card, year, + month); + + sc->cards[card].addr = card + AT91C_FIRST_RCA; + status = at91_qdmmc_SendCommand(dev, + AT91C_MMC_SET_RELATIVE_ADDR_CMD, + (sc->cards[card].addr) << 16); + if (status != 0) { + printf("Failed to set address for MMC %i\n", card); + goto out; + } + printf("Set MMC %i address to 0x%x\n", card, + sc->cards[card].addr); + + status = at91_qdmmc_SendCommand(dev, AT91C_SEND_CSD_CMD, + (sc->cards[card].addr) << 16); + if (status != 0) { + printf("Failed to get CSD for MMC %i\n", card); + goto out; + } + sc->cards[card].CSD[0] = RD4(sc, MCI_RSPR + 0); + sc->cards[card].CSD[1] = RD4(sc, MCI_RSPR + 4); + sc->cards[card].CSD[2] = RD4(sc, MCI_RSPR + 8); + sc->cards[card].CSD[3] = RD4(sc, MCI_RSPR + 12); + printf("MMC %i: CSD = 0x%x%x%x%x\n", card, + sc->cards[card].CSD[0], + sc->cards[card].CSD[1], + sc->cards[card].CSD[2], + sc->cards[card].CSD[3]); + uint64_t c_size; + uint64_t c_size_mult; + sc->cards[card].sector_size = + 1 << ((sc->cards[card].CSD[1] >> 16) & 0xf); + printf("MMC %i: Blocksize = %i Bytes\n", card, + sc->cards[card].sector_size); + c_size = ((sc->cards[card].CSD[1] & 0x3ff) << 2) | + ((sc->cards[card].CSD[2] >> 30) & 0x3); + printf("MMC %i: c_size = %lld\n", card, c_size); + c_size_mult = (sc->cards[card].CSD[2] >> 15) & 0x7; + c_size_mult = 1 << (c_size_mult + 2); + printf("MMC %i: c_size_mult = %lld\n", card, c_size_mult); + sc->cards[card].size = sc->cards[card].sector_size * + (c_size + 1) * c_size_mult; + printf("MMC %i: Size = %lld Bytes\n", card, + sc->cards[card].size); + /* declare clockrate to 5MHz - XXX the card may allow more */ + sc->cards[card].mode = 5 * MCI_MR_CLKDIV | MCI_MR_PWSDIV | + (MCI_MR_PWSDIV << 1 | AT91C_MCI_MR_PDCMODE); + sc->cards[card].mode = 75 * MCI_MR_CLKDIV | MCI_MR_PWSDIV | + (MCI_MR_PWSDIV << 1); + + bioq_init(&sc->cards[0].bio_queue); + } + if (sc->nb_cards == 0) + err = ENXIO; +out:; + return (err); +} + +static int at91_qdmmc_attach(device_t dev) { /* XXX: asumes MCK = 60MHz */ @@ -217,97 +349,15 @@ goto out; } - /* get all cards into idle state */ - at91_qdmmc_SendCommand(dev, AT91C_MMC_GO_IDLE_STATE_CMD, AT91C_NO_ARGUMENT); - - /* check operating conditions */ - uint32_t cond; - do { /* loop on busy */ - err = at91_qdmmc_SendCommand(dev, AT91C_MMC_SEND_OP_COND_CMD, AT91C_MMC_HOST_VOLTAGE_RANGE); - if (err != 0) { + if (at91_qdmmc_mmc_init(dev) != 0) { + printf("No MMC Cards found, trying SD\n"); + if (at91_qdmmc_sdcard_init(dev) != 0) { + printf("No SD Cards found\n"); err = 0; - printf("No MMC cards found\n"); goto out; } - cond = RD4(sc, MCI_RSPR); - } while ((cond & AT91C_CARD_POWER_UP_BUSY) == 0); - printf("at91_qdmmc_attach: operating conditions: 0x%x\n", cond & ~(AT91C_CARD_POWER_UP_BUSY)); - - /* now find our cards */ - for(sc->nb_cards = 0; sc->nb_cards < MMC_MAX; sc->nb_cards++) { // max out at 30 cards - int status; - int card = sc->nb_cards; - status = at91_qdmmc_SendCommand(dev, AT91C_MMC_ALL_SEND_CID_CMD, AT91C_NO_ARGUMENT); - if (status != 0) { - break; - } - sc->cards[card].CID[0] = RD4(sc, MCI_RSPR + 0); - sc->cards[card].CID[1] = RD4(sc, MCI_RSPR + 4); - sc->cards[card].CID[2] = RD4(sc, MCI_RSPR + 8); - sc->cards[card].CID[3] = RD4(sc, MCI_RSPR + 12); - printf("Found MMC %i - CID = 0x%x%x%x%x\n", card, - sc->cards[card].CID[0], - sc->cards[card].CID[1], - sc->cards[card].CID[2], - sc->cards[card].CID[3]); - printf("MMC %i: Vendor-ID = 0x%x\n", card, sc->cards[card].CID[0] >> 24), - printf("MMC %i: OEM-ID = 0x%x\n", card, (sc->cards[card].CID[0] >> 8) & 0xffff), - sc->cards[card].name[0] = (sc->cards[card].CID[0] >> 0) & 0xff;; - sc->cards[card].name[1] = (sc->cards[card].CID[1] >> 24) & 0xff;; - sc->cards[card].name[2] = (sc->cards[card].CID[1] >> 16) & 0xff;; - sc->cards[card].name[3] = (sc->cards[card].CID[1] >> 8) & 0xff;; - sc->cards[card].name[4] = (sc->cards[card].CID[1] >> 0) & 0xff;; - sc->cards[card].name[5] = (sc->cards[card].CID[2] >> 24) & 0xff;; - sc->cards[card].name[6] = '\0'; - printf("MMC %i: Productname = %s\n", card, sc->cards[card].name); - printf("MMC %i: Revision = 0x%x\n", card, (sc->cards[card].CID[2] >> 16) & 0xff), - printf("MMC %i: Serial = 0x%x\n", card, - (sc->cards[card].CID[2] << 16) | (sc->cards[card].CID[3] >> 16)); - int year = 1997; - year += ((sc->cards[card].CID[3] >> 8) & 0xf); - int month = 0; - month += ((sc->cards[card].CID[3] >> 12) & 0xf); - printf("MMC %i: Manufacturing Date = %i/%i\n", card, year, month); - - sc->cards[card].addr = card + AT91C_FIRST_RCA; - status = at91_qdmmc_SendCommand(dev, AT91C_MMC_SET_RELATIVE_ADDR_CMD, (sc->cards[card].addr) << 16); - if (status != 0) { - printf("Failed to set address for MMC %i\n", card); - goto out; - } - printf("Set MMC %i address to 0x%x\n", card, sc->cards[card].addr); - - status = at91_qdmmc_SendCommand(dev, AT91C_SEND_CSD_CMD, (sc->cards[card].addr) << 16); - if (status != 0) { - printf("Failed to get CSD for MMC %i\n", card); - goto out; - } - sc->cards[card].CSD[0] = RD4(sc, MCI_RSPR + 0); - sc->cards[card].CSD[1] = RD4(sc, MCI_RSPR + 4); - sc->cards[card].CSD[2] = RD4(sc, MCI_RSPR + 8); - sc->cards[card].CSD[3] = RD4(sc, MCI_RSPR + 12); - printf("MMC %i: CSD = 0x%x%x%x%x\n", card, - sc->cards[card].CSD[0], - sc->cards[card].CSD[1], - sc->cards[card].CSD[2], - sc->cards[card].CSD[3]); - uint64_t c_size; - uint64_t c_size_mult; - sc->cards[card].sector_size = 1 << ((sc->cards[card].CSD[1] >> 16) & 0xf); - printf("MMC %i: Blocksize = %i Bytes\n", card, sc->cards[card].sector_size); - c_size = ((sc->cards[card].CSD[1] & 0x3ff) << 2) | ((sc->cards[card].CSD[2] >> 30) & 0x3); - printf("MMC %i: c_size = %lld\n", card, c_size); - c_size_mult = (sc->cards[card].CSD[2] >> 15) & 0x7; - c_size_mult = 1 << (c_size_mult + 2); - printf("MMC %i: c_size_mult = %lld\n", card, c_size_mult); - sc->cards[card].size = sc->cards[card].sector_size * (c_size + 1) * c_size_mult; - printf("MMC %i: Size = %lld Bytes\n", card, sc->cards[card].size); - /* declare clockrate to 5MHz - XXX the card may allow more */ - sc->cards[card].mode = 5 * MCI_MR_CLKDIV | MCI_MR_PWSDIV | (MCI_MR_PWSDIV << 1 | AT91C_MCI_MR_PDCMODE); - sc->cards[card].mode = 75 * MCI_MR_CLKDIV | MCI_MR_PWSDIV | (MCI_MR_PWSDIV << 1); - - bioq_init(&sc->cards[0].bio_queue); } + if (sc->nb_cards == 0) { printf("No MMC cards found\n"); goto out; From owner-p4-projects@FreeBSD.ORG Tue Sep 12 23:56:48 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C1E6E16A47B; Tue, 12 Sep 2006 23:56:48 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8493816A403 for ; Tue, 12 Sep 2006 23:56:48 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 33DAA43D4C for ; Tue, 12 Sep 2006 23:56:48 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8CNumOL007812 for ; Tue, 12 Sep 2006 23:56:48 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8CNulA3007809 for perforce@freebsd.org; Tue, 12 Sep 2006 23:56:47 GMT (envelope-from imp@freebsd.org) Date: Tue, 12 Sep 2006 23:56:47 GMT Message-Id: <200609122356.k8CNulA3007809@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 106037 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Sep 2006 23:56:49 -0000 http://perforce.freebsd.org/chv.cgi?CH=106037 Change 106037 by imp@imp_lighthouse on 2006/09/12 23:56:02 Refactor for better sharing. Affected files ... .. //depot/projects/arm/src/sys/arm/at91/at91_qdmmc.c#4 edit .. //depot/projects/arm/src/sys/arm/at91/at91_qdmmcreg.h#2 edit .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/at91rm9200.h#6 edit .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/mci_device.c#12 edit .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/mci_device.h#6 edit .. //depot/projects/arm/src/sys/dev/mmc/mmcreg.h#2 edit Differences ... ==== //depot/projects/arm/src/sys/arm/at91/at91_qdmmc.c#4 (text+ko) ==== @@ -50,6 +50,7 @@ #include #include #include +#include #include #include @@ -75,6 +76,15 @@ uint32_t sector_size; uint64_t size; uint32_t mode; + uint32_t rca; /* Relative Card Address */ + uint32_t flags; +#define READ_PARTIAL 0x001 +#define WRITE_PARTIAL 0x002 +#define ERASE_BLOCK_EN 0x004 +#define READ_MISALIGN 0x008 +#define WRITE_MISALIGN 0x010 + uint32_t read_bl; + uint32_t write_bl; } cards[MMC_MAX]; }; @@ -153,6 +163,7 @@ static int at91_qdmmc_sdcard_init(device_t dev) { + printf("No SD cards found\n"); return (ENXIO); } @@ -173,7 +184,7 @@ err = at91_qdmmc_SendCommand(dev, AT91C_MMC_SEND_OP_COND_CMD, AT91C_MMC_HOST_VOLTAGE_RANGE); if (err != 0) { - err = 0; + err = ENXIO; printf("No MMC cards found\n"); goto out; } @@ -225,7 +236,7 @@ printf("MMC %i: Manufacturing Date = %i/%i\n", card, year, month); - sc->cards[card].addr = card + AT91C_FIRST_RCA; + sc->cards[card].addr = card + MMC_FIRST_RCA; status = at91_qdmmc_SendCommand(dev, AT91C_MMC_SET_RELATIVE_ADDR_CMD, (sc->cards[card].addr) << 16); @@ -269,9 +280,17 @@ sc->cards[card].size); /* declare clockrate to 5MHz - XXX the card may allow more */ sc->cards[card].mode = 5 * MCI_MR_CLKDIV | MCI_MR_PWSDIV | - (MCI_MR_PWSDIV << 1 | AT91C_MCI_MR_PDCMODE); + (MCI_MR_PWSDIV << 1 | MCI_MR_PDCMODE); sc->cards[card].mode = 75 * MCI_MR_CLKDIV | MCI_MR_PWSDIV | (MCI_MR_PWSDIV << 1); + sc->cards[card].flags = 0; + if (sc->cards[card].CSD[1] & CSD_1_RD_B_PAR_M) + sc->cards[card].flags |= READ_PARTIAL; + if (sc->cards[card].CSD[3] & CSD_3_WBLOCK_P_M) + sc->cards[card].flags |= WRITE_PARTIAL; + sc->cards[card].read_bl = 0; + sc->cards[card].write_bl = 0; + sc->cards[card].rca = 0; bioq_init(&sc->cards[0].bio_queue); } @@ -315,10 +334,10 @@ // disable all interrupt sources WR4(sc, MCI_IDR, 0xffffffff); // set timeout values - WR4(sc, MCI_DTOR, AT91C_MCI_DTOR_1MEGA_CYCLES); + WR4(sc, MCI_DTOR, MCI_DTOR_DTOMUL_1048576); //WR4(sc, MCI_MR, AT91C_MCI_MR_PDCMODE); // set clockrate to just 400kHz needed to identify - WR4(sc, MCI_MR, 74 * MCI_MR_CLKDIV | MCI_MR_PWSDIV | (MCI_MR_PWSDIV << 1 | AT91C_MCI_MR_PDCMODE)); + WR4(sc, MCI_MR, 74 * MCI_MR_CLKDIV | MCI_MR_PWSDIV | (MCI_MR_PWSDIV << 1 | MCI_MR_PDCMODE)); WR4(sc, MCI_SDCR, 0); // enable controller WR4(sc, MCI_CR, MCI_CR_MCIEN | MCI_CR_PWSEN); @@ -350,9 +369,7 @@ } if (at91_qdmmc_mmc_init(dev) != 0) { - printf("No MMC Cards found, trying SD\n"); if (at91_qdmmc_sdcard_init(dev) != 0) { - printf("No SD Cards found\n"); err = 0; goto out; } @@ -380,7 +397,7 @@ } /* set clockrate to 5MHz - XXX the card may allow more */ - WR4(sc, MCI_MR, 5 * MCI_MR_CLKDIV | MCI_MR_PWSDIV | (MCI_MR_PWSDIV << 1) | AT91C_MCI_MR_PDCMODE); + WR4(sc, MCI_MR, 5 * MCI_MR_CLKDIV | MCI_MR_PWSDIV | (MCI_MR_PWSDIV << 1) | MCI_MR_PDCMODE); AT91_QDMMC_UNLOCK(sc); ==== //depot/projects/arm/src/sys/arm/at91/at91_qdmmcreg.h#2 (text+ko) ==== @@ -128,147 +128,4 @@ #define AT91C_NO_ARGUMENT 0x0 -///////////////////////////////////////////////////////////////// -// Class 0 & 1 commands: Basic commands and Read Stream commands -///////////////////////////////////////////////////////////////// - -#define AT91C_GO_IDLE_STATE_CMD (0 | MCI_CMDR_TRCMD_NO | MCI_CMDR_SPCMD) -#define AT91C_MMC_GO_IDLE_STATE_CMD (0 | MCI_CMDR_TRCMD_NO | MCI_CMDR_SPCMD | MCI_CMDR_OPDCMD) -#define AT91C_MMC_SEND_OP_COND_CMD (1 | MCI_CMDR_TRCMD_NO | MCI_CMDR_SPCMD | MCI_CMDR_RSPTYP_48 | MCI_CMDR_OPDCMD) -#define AT91C_ALL_SEND_CID_CMD (2 | MCI_CMDR_TRCMD_NO | MCI_CMDR_SPCMD | MCI_CMDR_RSPTYP_136) -#define AT91C_MMC_ALL_SEND_CID_CMD (2 | MCI_CMDR_TRCMD_NO | MCI_CMDR_SPCMD | MCI_CMDR_RSPTYP_136 | MCI_CMDR_OPDCMD) -#define AT91C_SET_RELATIVE_ADDR_CMD (3 | MCI_CMDR_TRCMD_NO | MCI_CMDR_SPCMD | MCI_CMDR_RSPTYP_48 | MCI_CMDR_MAXLAT) -#define AT91C_MMC_SET_RELATIVE_ADDR_CMD (3 | MCI_CMDR_TRCMD_NO | MCI_CMDR_SPCMD | MCI_CMDR_RSPTYP_48 | MCI_CMDR_MAXLAT | MCI_CMDR_OPDCMD) - -#define AT91C_SET_DSR_CMD (4 | MCI_CMDR_TRCMD_NO | MCI_CMDR_SPCMD | AT91C_MCI_RSPTYP_NO | MCI_CMDR_MAXLAT) // no tested - -#define AT91C_SEL_DESEL_CARD_CMD (7 | MCI_CMDR_TRCMD_NO | MCI_CMDR_SPCMD | MCI_CMDR_RSPTYP_48 | MCI_CMDR_MAXLAT) -#define AT91C_SEND_CSD_CMD (9 | MCI_CMDR_TRCMD_NO | MCI_CMDR_SPCMD | MCI_CMDR_RSPTYP_136 | MCI_CMDR_MAXLAT) -#define AT91C_SEND_CID_CMD (10 | MCI_CMDR_TRCMD_NO | MCI_CMDR_SPCMD | MCI_CMDR_RSPTYP_136 | MCI_CMDR_MAXLAT) -#define AT91C_MMC_READ_DAT_UNTIL_STOP_CMD (11 | AT91C_MCI_TRTYP_STREAM | MCI_CMDR_SPCMD | MCI_CMDR_RSPTYP_48 | MCI_CMDR_TRDIR | MCI_CMDR_TRCMD_START | MCI_CMDR_MAXLAT) - -#define AT91C_STOP_TRANSMISSION_CMD (12 | AT91C_MCI_TRCMD_STOP | MCI_CMDR_SPCMD | MCI_CMDR_RSPTYP_48 | MCI_CMDR_MAXLAT) -#define AT91C_STOP_TRANSMISSION_SYNC_CMD (12 | AT91C_MCI_TRCMD_STOP | AT91C_MCI_SPCMD_SYNC | MCI_CMDR_RSPTYP_48 | MCI_CMDR_MAXLAT) -#define AT91C_SEND_STATUS_CMD (13 | MCI_CMDR_TRCMD_NO | MCI_CMDR_SPCMD | MCI_CMDR_RSPTYP_48 | MCI_CMDR_MAXLAT) -#define AT91C_GO_INACTIVE_STATE_CMD (15 | AT91C_MCI_RSPTYP_NO) - -//*------------------------------------------------ -//* Class 2 commands: Block oriented Read commands -//*------------------------------------------------ - -#define AT91C_SET_BLOCKLEN_CMD (16 | MCI_CMDR_TRCMD_NO | MCI_CMDR_SPCMD | MCI_CMDR_RSPTYP_48 | MCI_CMDR_MAXLAT) -#define AT91C_READ_SINGLE_BLOCK_CMD (17 | MCI_CMDR_SPCMD | MCI_CMDR_RSPTYP_48 | MCI_CMDR_TRCMD_START | MCI_CMDR_TRTYP_BLOCK | MCI_CMDR_TRDIR | MCI_CMDR_MAXLAT) -#define AT91C_READ_MULTIPLE_BLOCK_CMD (18 | MCI_CMDR_SPCMD | MCI_CMDR_RSPTYP_48 | MCI_CMDR_TRCMD_START | AT91C_MCI_TRTYP_MULTIPLE | MCI_CMDR_TRDIR | MCI_CMDR_MAXLAT) - -//*-------------------------------------------- -//* Class 3 commands: Sequential write commands -//*-------------------------------------------- - -#define AT91C_MMC_WRITE_DAT_UNTIL_STOP_CMD (20 | AT91C_MCI_TRTYP_STREAM | MCI_CMDR_SPCMD | MCI_CMDR_RSPTYP_48 & ~(MCI_CMDR_TRDIR) | MCI_CMDR_TRCMD_START | MCI_CMDR_MAXLAT) // MMC - -//*------------------------------------------------ -//* Class 4 commands: Block oriented write commands -//*------------------------------------------------ - -#define AT91C_WRITE_BLOCK_CMD (24 | MCI_CMDR_SPCMD | MCI_CMDR_RSPTYP_48 | MCI_CMDR_TRCMD_START | (MCI_CMDR_TRTYP_BLOCK & ~(MCI_CMDR_TRDIR))| MCI_CMDR_MAXLAT) -#define AT91C_WRITE_MULTIPLE_BLOCK_CMD (25 | MCI_CMDR_SPCMD | MCI_CMDR_RSPTYP_48 | MCI_CMDR_TRCMD_START | (AT91C_MCI_TRTYP_MULTIPLE & ~(MCI_CMDR_TRDIR)) | MCI_CMDR_MAXLAT) -#define AT91C_PROGRAM_CSD_CMD (27 | MCI_CMDR_RSPTYP_48) - - -//*---------------------------------------- -//* Class 6 commands: Group Write protect -//*---------------------------------------- - -#define AT91C_SET_WRITE_PROT_CMD (28 | MCI_CMDR_RSPTYP_48) -#define AT91C_CLR_WRITE_PROT_CMD (29 | MCI_CMDR_RSPTYP_48) -#define AT91C_SEND_WRITE_PROT_CMD (30 | MCI_CMDR_RSPTYP_48) - - -//*---------------------------------------- -//* Class 5 commands: Erase commands -//*---------------------------------------- - -#define AT91C_TAG_SECTOR_START_CMD (32 | MCI_CMDR_SPCMD | MCI_CMDR_RSPTYP_48 | MCI_CMDR_TRCMD_NO | MCI_CMDR_MAXLAT) -#define AT91C_TAG_SECTOR_END_CMD (33 | MCI_CMDR_SPCMD | MCI_CMDR_RSPTYP_48 | MCI_CMDR_TRCMD_NO | MCI_CMDR_MAXLAT) -#define AT91C_MMC_UNTAG_SECTOR_CMD (34 | MCI_CMDR_RSPTYP_48) -#define AT91C_MMC_TAG_ERASE_GROUP_START_CMD (35 | MCI_CMDR_RSPTYP_48) -#define AT91C_MMC_TAG_ERASE_GROUP_END_CMD (36 | MCI_CMDR_RSPTYP_48) -#define AT91C_MMC_UNTAG_ERASE_GROUP_CMD (37 | MCI_CMDR_RSPTYP_48) -#define AT91C_ERASE_CMD (38 | MCI_CMDR_SPCMD | MCI_CMDR_RSPTYP_48 | MCI_CMDR_TRCMD_NO | MCI_CMDR_MAXLAT) - -//*---------------------------------------- -//* Class 7 commands: Lock commands -//*---------------------------------------- - -#define AT91C_LOCK_UNLOCK (42 | MCI_CMDR_SPCMD | MCI_CMDR_RSPTYP_48 | MCI_CMDR_TRCMD_NO | MCI_CMDR_MAXLAT) // no tested - -//*----------------------------------------------- -// Class 8 commands: Application specific commands -//*----------------------------------------------- - -#define AT91C_APP_CMD (55 | MCI_CMDR_SPCMD | MCI_CMDR_RSPTYP_48 | MCI_CMDR_TRCMD_NO | MCI_CMDR_MAXLAT) -#define AT91C_GEN_CMD (56 | MCI_CMDR_SPCMD | MCI_CMDR_RSPTYP_48 | MCI_CMDR_TRCMD_NO | MCI_CMDR_MAXLAT) // no tested - -#define AT91C_SDCARD_SET_BUS_WIDTH_CMD (6 | MCI_CMDR_SPCMD | MCI_CMDR_RSPTYP_48 | MCI_CMDR_TRCMD_NO | MCI_CMDR_MAXLAT) -#define AT91C_SDCARD_STATUS_CMD (13 | MCI_CMDR_SPCMD | MCI_CMDR_RSPTYP_48 | MCI_CMDR_TRCMD_NO | MCI_CMDR_MAXLAT) -#define AT91C_SDCARD_SEND_NUM_WR_BLOCKS_CMD (22 | MCI_CMDR_SPCMD | MCI_CMDR_RSPTYP_48 | MCI_CMDR_TRCMD_NO | MCI_CMDR_MAXLAT) -#define AT91C_SDCARD_SET_WR_BLK_ERASE_COUNT_CMD (23 | MCI_CMDR_SPCMD | MCI_CMDR_RSPTYP_48 | MCI_CMDR_TRCMD_NO | MCI_CMDR_MAXLAT) -#define AT91C_SDCARD_APP_OP_COND_CMD (41 | MCI_CMDR_SPCMD | MCI_CMDR_RSPTYP_48 | MCI_CMDR_TRCMD_NO) -#define AT91C_SDCARD_SET_CLR_CARD_DETECT_CMD (42 | MCI_CMDR_SPCMD | MCI_CMDR_RSPTYP_48 | MCI_CMDR_TRCMD_NO | MCI_CMDR_MAXLAT) -#define AT91C_SDCARD_SEND_SCR_CMD (51 | MCI_CMDR_SPCMD | MCI_CMDR_RSPTYP_48 | MCI_CMDR_TRCMD_NO | MCI_CMDR_MAXLAT) - -#define AT91C_SDCARD_APP_ALL_CMD (AT91C_SDCARD_SET_BUS_WIDTH_CMD +\ - AT91C_SDCARD_STATUS_CMD +\ - AT91C_SDCARD_SEND_NUM_WR_BLOCKS_CMD +\ - AT91C_SDCARD_SET_WR_BLK_ERASE_COUNT_CMD +\ - AT91C_SDCARD_APP_OP_COND_CMD +\ - AT91C_SDCARD_SET_CLR_CARD_DETECT_CMD +\ - AT91C_SDCARD_SEND_SCR_CMD) - -//*---------------------------------------- -//* Class 9 commands: IO Mode commands -//*---------------------------------------- - -#define AT91C_MMC_FAST_IO_CMD (39 | MCI_CMDR_SPCMD | MCI_CMDR_RSPTYP_48 | MCI_CMDR_MAXLAT) -#define AT91C_MMC_GO_IRQ_STATE_CMD (40 | MCI_CMDR_SPCMD | MCI_CMDR_RSPTYP_48 | MCI_CMDR_TRCMD_NO| MCI_CMDR_MAXLAT) - -//* Classic MCI Data Timeout Register Configuration with 1048576 MCK cycles between 2 data transfer -#define AT91C_MCI_DTOR_1MEGA_CYCLES (MCI_DTOR_DTOCYC | MCI_DTOR_DTOMUL) - -//* Classic MCI Mode Register Configuration with PDC mode enabled and MCK = MCI Clock -#define AT91C_MCI_MR_PDCMODE (75 * MCI_MR_CLKDIV |\ - MCI_MR_PWSDIV |\ - (MCI_MR_PWSDIV<<1) |\ - MCI_MR_PDCMODE) - -#define AT91C_VDD_16_17 (1 << 4) -#define AT91C_VDD_17_18 (1 << 5) -#define AT91C_VDD_18_19 (1 << 6) -#define AT91C_VDD_19_20 (1 << 7) -#define AT91C_VDD_20_21 (1 << 8) -#define AT91C_VDD_21_22 (1 << 9) -#define AT91C_VDD_22_23 (1 << 10) -#define AT91C_VDD_23_24 (1 << 11) -#define AT91C_VDD_24_25 (1 << 12) -#define AT91C_VDD_25_26 (1 << 13) -#define AT91C_VDD_26_27 (1 << 14) -#define AT91C_VDD_27_28 (1 << 15) -#define AT91C_VDD_28_29 (1 << 16) -#define AT91C_VDD_29_30 (1 << 17) -#define AT91C_VDD_30_31 (1 << 18) -#define AT91C_VDD_31_32 (1 << 19) -#define AT91C_VDD_32_33 (1 << 20) -#define AT91C_VDD_33_34 (1 << 21) -#define AT91C_VDD_34_35 (1 << 22) -#define AT91C_VDD_35_36 (1 << 23) -#define AT91C_CARD_POWER_UP_BUSY (1 << 31) - -#define AT91C_MMC_HOST_VOLTAGE_RANGE (AT91C_VDD_27_28 +\ - AT91C_VDD_28_29 +\ - AT91C_VDD_29_30 +\ - AT91C_VDD_30_31 +\ - AT91C_VDD_31_32 +\ - AT91C_VDD_32_33) - -#define AT91C_FIRST_RCA 0xCAFE #endif /* ARM_AT91_AT91QDMMCREG_H */ ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/at91rm9200.h#6 (text) ==== @@ -1156,28 +1156,6 @@ #define AT91C_MCI_SCDSEL (0x1u << 0) // (MCI) SD Card Selector #define AT91C_MCI_SCDBUS (0x1u << 7) // (MCI) SD Card Bus Width // -------- MCI_CMDR : (MCI Offset: 0x14) MCI Command Register -------- -#define AT91C_MCI_CMDNB (0x1Fu << 0) // (MCI) Command Number -#define AT91C_MCI_RSPTYP (0x3u << 6) // (MCI) Response Type -#define AT91C_MCI_RSPTYP_NO (0x0u << 6) // (MCI) No response -#define AT91C_MCI_RSPTYP_48 (0x1u << 6) // (MCI) 48-bit response -#define AT91C_MCI_RSPTYP_136 (0x2u << 6) // (MCI) 136-bit response -#define AT91C_MCI_SPCMD (0x7u << 8) // (MCI) Special CMD -#define AT91C_MCI_SPCMD_NONE (0x0u << 8) // (MCI) Not a special CMD -#define AT91C_MCI_SPCMD_INIT (0x1u << 8) // (MCI) Initialization CMD -#define AT91C_MCI_SPCMD_SYNC (0x2u << 8) // (MCI) Synchronized CMD -#define AT91C_MCI_SPCMD_IT_CMD (0x4u << 8) // (MCI) Interrupt command -#define AT91C_MCI_SPCMD_IT_REP (0x5u << 8) // (MCI) Interrupt response -#define AT91C_MCI_OPDCMD (0x1u << 11) // (MCI) Open Drain Command -#define AT91C_MCI_MAXLAT (0x1u << 12) // (MCI) Maximum Latency for Command to respond -#define AT91C_MCI_TRCMD (0x3u << 16) // (MCI) Transfer CMD -#define AT91C_MCI_TRCMD_NO (0x0u << 16) // (MCI) No transfer -#define AT91C_MCI_TRCMD_START (0x1u << 16) // (MCI) Start transfer -#define AT91C_MCI_TRCMD_STOP (0x2u << 16) // (MCI) Stop transfer -#define AT91C_MCI_TRDIR (0x1u << 18) // (MCI) Transfer Direction -#define AT91C_MCI_TRTYP (0x3u << 19) // (MCI) Transfer Type -#define AT91C_MCI_TRTYP_BLOCK (0x0u << 19) // (MCI) Block Transfer type -#define AT91C_MCI_TRTYP_MULTIPLE (0x1u << 19) // (MCI) Multiple Block transfer type -#define AT91C_MCI_TRTYP_STREAM (0x2u << 19) // (MCI) Stream transfer type // -------- MCI_SR : (MCI Offset: 0x40) MCI Status Register -------- #define AT91C_MCI_CMDRDY (0x1u << 0) // (MCI) Command Ready flag #define AT91C_MCI_RXRDY (0x1u << 1) // (MCI) RX Ready flag ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/mci_device.c#12 (text+ko) ==== ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/mci_device.h#6 (text+ko) ==== @@ -46,6 +46,7 @@ #ifndef __MCI_Device_h #define __MCI_Device_h +#include typedef unsigned int AT91S_MCIDeviceStatus; @@ -76,9 +77,11 @@ /* TimeOut */ #define AT91C_TIMEOUT_CMDRDY 30 -///////////////////////////////////////////////////////////////////////////////////////////////////// + + +//////////////////////////////////////////////////////////////////////////////// // MMC & SDCard Structures -///////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// /*-----------------------------------------------*/ /* SDCard Device Descriptor Structure Definition */ @@ -116,291 +119,13 @@ { AT91PS_MciDeviceDesc pMCI_DeviceDesc; // MCI device descriptor AT91PS_MciDeviceFeatures pMCI_DeviceFeatures;// Pointer on a MCI device features array -}AT91S_MciDevice, *AT91PS_MciDevice; +} AT91S_MciDevice, *AT91PS_MciDevice; -///////////////////////////////////////////////////////////////////////////////////////////////////// -// MCI_CMD Register Value -///////////////////////////////////////////////////////////////////////////////////////////////////// -#define AT91C_POWER_ON_INIT (0 | AT91C_MCI_TRCMD_NO | AT91C_MCI_SPCMD_INIT | AT91C_MCI_OPDCMD) +#include -///////////////////////////////////////////////////////////////// -// Class 0 & 1 commands: Basic commands and Read Stream commands -///////////////////////////////////////////////////////////////// - -#define AT91C_GO_IDLE_STATE_CMD (0 | AT91C_MCI_TRCMD_NO | AT91C_MCI_SPCMD_NONE ) -#define AT91C_MMC_GO_IDLE_STATE_CMD (0 | AT91C_MCI_TRCMD_NO | AT91C_MCI_SPCMD_NONE | AT91C_MCI_OPDCMD) -#define AT91C_MMC_SEND_OP_COND_CMD (1 | AT91C_MCI_TRCMD_NO | AT91C_MCI_SPCMD_NONE | AT91C_MCI_RSPTYP_48 | AT91C_MCI_OPDCMD) -#define AT91C_ALL_SEND_CID_CMD (2 | AT91C_MCI_TRCMD_NO | AT91C_MCI_SPCMD_NONE | AT91C_MCI_RSPTYP_136 ) -#define AT91C_MMC_ALL_SEND_CID_CMD (2 | AT91C_MCI_TRCMD_NO | AT91C_MCI_SPCMD_NONE | AT91C_MCI_RSPTYP_136 | AT91C_MCI_OPDCMD) -#define AT91C_SET_RELATIVE_ADDR_CMD (3 | AT91C_MCI_TRCMD_NO | AT91C_MCI_SPCMD_NONE | AT91C_MCI_RSPTYP_48 | AT91C_MCI_MAXLAT ) -#define AT91C_MMC_SET_RELATIVE_ADDR_CMD (3 | AT91C_MCI_TRCMD_NO | AT91C_MCI_SPCMD_NONE | AT91C_MCI_RSPTYP_48 | AT91C_MCI_MAXLAT | AT91C_MCI_OPDCMD) - -#define AT91C_SET_DSR_CMD (4 | AT91C_MCI_TRCMD_NO | AT91C_MCI_SPCMD_NONE | AT91C_MCI_RSPTYP_NO | AT91C_MCI_MAXLAT ) // no tested - -#define AT91C_SEL_DESEL_CARD_CMD (7 | AT91C_MCI_TRCMD_NO | AT91C_MCI_SPCMD_NONE | AT91C_MCI_RSPTYP_48 | AT91C_MCI_MAXLAT ) -#define AT91C_SEND_CSD_CMD (9 | AT91C_MCI_TRCMD_NO | AT91C_MCI_SPCMD_NONE | AT91C_MCI_RSPTYP_136 | AT91C_MCI_MAXLAT ) -#define AT91C_SEND_CID_CMD (10 | AT91C_MCI_TRCMD_NO | AT91C_MCI_SPCMD_NONE | AT91C_MCI_RSPTYP_136 | AT91C_MCI_MAXLAT ) -#define AT91C_MMC_READ_DAT_UNTIL_STOP_CMD (11 | AT91C_MCI_TRTYP_STREAM| AT91C_MCI_SPCMD_NONE | AT91C_MCI_RSPTYP_48 | AT91C_MCI_TRDIR | AT91C_MCI_TRCMD_START | AT91C_MCI_MAXLAT ) - -#define AT91C_STOP_TRANSMISSION_CMD (12 | AT91C_MCI_TRCMD_STOP | AT91C_MCI_SPCMD_NONE | AT91C_MCI_RSPTYP_48 | AT91C_MCI_MAXLAT ) -#define AT91C_STOP_TRANSMISSION_SYNC_CMD (12 | AT91C_MCI_TRCMD_STOP | AT91C_MCI_SPCMD_SYNC | AT91C_MCI_RSPTYP_48 | AT91C_MCI_MAXLAT ) -#define AT91C_SEND_STATUS_CMD (13 | AT91C_MCI_TRCMD_NO | AT91C_MCI_SPCMD_NONE | AT91C_MCI_RSPTYP_48 | AT91C_MCI_MAXLAT ) -#define AT91C_GO_INACTIVE_STATE_CMD (15 | AT91C_MCI_RSPTYP_NO ) - -//*------------------------------------------------ -//* Class 2 commands: Block oriented Read commands -//*------------------------------------------------ - -#define AT91C_SET_BLOCKLEN_CMD (16 | AT91C_MCI_TRCMD_NO | AT91C_MCI_SPCMD_NONE | AT91C_MCI_RSPTYP_48 | AT91C_MCI_MAXLAT ) -#define AT91C_READ_SINGLE_BLOCK_CMD (17 | AT91C_MCI_SPCMD_NONE | AT91C_MCI_RSPTYP_48 | AT91C_MCI_TRCMD_START | AT91C_MCI_TRTYP_BLOCK | AT91C_MCI_TRDIR | AT91C_MCI_MAXLAT) -#define AT91C_READ_MULTIPLE_BLOCK_CMD (18 | AT91C_MCI_SPCMD_NONE | AT91C_MCI_RSPTYP_48 | AT91C_MCI_TRCMD_START | AT91C_MCI_TRTYP_MULTIPLE | AT91C_MCI_TRDIR | AT91C_MCI_MAXLAT) - -//*-------------------------------------------- -//* Class 3 commands: Sequential write commands -//*-------------------------------------------- - -#define AT91C_MMC_WRITE_DAT_UNTIL_STOP_CMD (20 | AT91C_MCI_TRTYP_STREAM| AT91C_MCI_SPCMD_NONE | AT91C_MCI_RSPTYP_48 & ~(AT91C_MCI_TRDIR) | AT91C_MCI_TRCMD_START | AT91C_MCI_MAXLAT ) // MMC - -//*------------------------------------------------ -//* Class 4 commands: Block oriented write commands -//*------------------------------------------------ - -#define AT91C_WRITE_BLOCK_CMD (24 | AT91C_MCI_SPCMD_NONE | AT91C_MCI_RSPTYP_48 | AT91C_MCI_TRCMD_START | (AT91C_MCI_TRTYP_BLOCK & ~(AT91C_MCI_TRDIR)) | AT91C_MCI_MAXLAT) -#define AT91C_WRITE_MULTIPLE_BLOCK_CMD (25 | AT91C_MCI_SPCMD_NONE | AT91C_MCI_RSPTYP_48 | AT91C_MCI_TRCMD_START | (AT91C_MCI_TRTYP_MULTIPLE & ~(AT91C_MCI_TRDIR)) | AT91C_MCI_MAXLAT) -#define AT91C_PROGRAM_CSD_CMD (27 | AT91C_MCI_RSPTYP_48 ) - - -//*---------------------------------------- -//* Class 6 commands: Group Write protect -//*---------------------------------------- - -#define AT91C_SET_WRITE_PROT_CMD (28 | AT91C_MCI_RSPTYP_48 ) -#define AT91C_CLR_WRITE_PROT_CMD (29 | AT91C_MCI_RSPTYP_48 ) -#define AT91C_SEND_WRITE_PROT_CMD (30 | AT91C_MCI_RSPTYP_48 ) - - -//*---------------------------------------- -//* Class 5 commands: Erase commands -//*---------------------------------------- - -#define AT91C_TAG_SECTOR_START_CMD (32 | AT91C_MCI_SPCMD_NONE | AT91C_MCI_RSPTYP_48 | AT91C_MCI_TRCMD_NO | AT91C_MCI_MAXLAT) -#define AT91C_TAG_SECTOR_END_CMD (33 | AT91C_MCI_SPCMD_NONE | AT91C_MCI_RSPTYP_48 | AT91C_MCI_TRCMD_NO | AT91C_MCI_MAXLAT) -#define AT91C_MMC_UNTAG_SECTOR_CMD (34 | AT91C_MCI_RSPTYP_48 ) -#define AT91C_MMC_TAG_ERASE_GROUP_START_CMD (35 | AT91C_MCI_RSPTYP_48 ) -#define AT91C_MMC_TAG_ERASE_GROUP_END_CMD (36 | AT91C_MCI_RSPTYP_48 ) -#define AT91C_MMC_UNTAG_ERASE_GROUP_CMD (37 | AT91C_MCI_RSPTYP_48 ) -#define AT91C_ERASE_CMD (38 | AT91C_MCI_SPCMD_NONE | AT91C_MCI_RSPTYP_48 | AT91C_MCI_TRCMD_NO | AT91C_MCI_MAXLAT ) - -//*---------------------------------------- -//* Class 7 commands: Lock commands -//*---------------------------------------- - -#define AT91C_LOCK_UNLOCK (42 | AT91C_MCI_SPCMD_NONE | AT91C_MCI_RSPTYP_48 | AT91C_MCI_TRCMD_NO | AT91C_MCI_MAXLAT) // no tested - -//*----------------------------------------------- -// Class 8 commands: Application specific commands -//*----------------------------------------------- - -#define AT91C_APP_CMD (55 | AT91C_MCI_SPCMD_NONE | AT91C_MCI_RSPTYP_48 | AT91C_MCI_TRCMD_NO | AT91C_MCI_MAXLAT) -#define AT91C_GEN_CMD (56 | AT91C_MCI_SPCMD_NONE | AT91C_MCI_RSPTYP_48 | AT91C_MCI_TRCMD_NO | AT91C_MCI_MAXLAT) // no tested - -#define AT91C_SDCARD_SET_BUS_WIDTH_CMD (6 | AT91C_MCI_SPCMD_NONE | AT91C_MCI_RSPTYP_48 | AT91C_MCI_TRCMD_NO | AT91C_MCI_MAXLAT) -#define AT91C_SDCARD_STATUS_CMD (13 | AT91C_MCI_SPCMD_NONE | AT91C_MCI_RSPTYP_48 | AT91C_MCI_TRCMD_NO | AT91C_MCI_MAXLAT) -#define AT91C_SDCARD_SEND_NUM_WR_BLOCKS_CMD (22 | AT91C_MCI_SPCMD_NONE | AT91C_MCI_RSPTYP_48 | AT91C_MCI_TRCMD_NO | AT91C_MCI_MAXLAT) -#define AT91C_SDCARD_SET_WR_BLK_ERASE_COUNT_CMD (23 | AT91C_MCI_SPCMD_NONE | AT91C_MCI_RSPTYP_48 | AT91C_MCI_TRCMD_NO | AT91C_MCI_MAXLAT) -#define AT91C_SDCARD_APP_OP_COND_CMD (41 | AT91C_MCI_SPCMD_NONE | AT91C_MCI_RSPTYP_48 | AT91C_MCI_TRCMD_NO ) -#define AT91C_SDCARD_SET_CLR_CARD_DETECT_CMD (42 | AT91C_MCI_SPCMD_NONE | AT91C_MCI_RSPTYP_48 | AT91C_MCI_TRCMD_NO | AT91C_MCI_MAXLAT) -#define AT91C_SDCARD_SEND_SCR_CMD (51 | AT91C_MCI_SPCMD_NONE | AT91C_MCI_RSPTYP_48 | AT91C_MCI_TRCMD_NO | AT91C_MCI_MAXLAT) - -#define AT91C_SDCARD_APP_ALL_CMD (AT91C_SDCARD_SET_BUS_WIDTH_CMD +\ - AT91C_SDCARD_STATUS_CMD +\ - AT91C_SDCARD_SEND_NUM_WR_BLOCKS_CMD +\ - AT91C_SDCARD_SET_WR_BLK_ERASE_COUNT_CMD +\ - AT91C_SDCARD_APP_OP_COND_CMD +\ - AT91C_SDCARD_SET_CLR_CARD_DETECT_CMD +\ - AT91C_SDCARD_SEND_SCR_CMD) - -//*---------------------------------------- -//* Class 9 commands: IO Mode commands -//*---------------------------------------- - -#define AT91C_MMC_FAST_IO_CMD (39 | AT91C_MCI_SPCMD_NONE | AT91C_MCI_RSPTYP_48 | AT91C_MCI_MAXLAT) -#define AT91C_MMC_GO_IRQ_STATE_CMD (40 | AT91C_MCI_SPCMD_NONE | AT91C_MCI_RSPTYP_48 | AT91C_MCI_TRCMD_NO | AT91C_MCI_MAXLAT) - -///////////////////////////////////////////////////////////////////////////////////////////////////// -// Functions returnals -///////////////////////////////////////////////////////////////////////////////////////////////////// -#define AT91C_CMD_SEND_OK 0 // Command ok -#define AT91C_CMD_SEND_ERROR -1 // Command failed -#define AT91C_INIT_OK 2 // Init Successfull -#define AT91C_INIT_ERROR 3 // Init Failed -#define AT91C_READ_OK 4 // Read Successfull -#define AT91C_READ_ERROR 5 // Read Failed -#define AT91C_WRITE_OK 6 // Write Successfull -#define AT91C_WRITE_ERROR 7 // Write Failed -#define AT91C_ERASE_OK 8 // Erase Successfull -#define AT91C_ERASE_ERROR 9 // Erase Failed -#define AT91C_CARD_SELECTED_OK 10 // Card Selection Successfull -#define AT91C_CARD_SELECTED_ERROR 11 // Card Selection Failed - -///////////////////////////////////////////////////////////////////////////////////////////////////// -// MCI_SR Errors -///////////////////////////////////////////////////////////////////////////////////////////////////// -#define AT91C_MCI_SR_ERROR (AT91C_MCI_UNRE |\ - AT91C_MCI_OVRE |\ - AT91C_MCI_DTOE |\ - AT91C_MCI_DCRCE |\ - AT91C_MCI_RTOE |\ - AT91C_MCI_RENDE |\ - AT91C_MCI_RCRCE |\ - AT91C_MCI_RDIRE |\ - AT91C_MCI_RINDE) - -//////////////////////////////////////////////////////////////////////////////////////////////////// -// OCR Register -//////////////////////////////////////////////////////////////////////////////////////////////////// -#define AT91C_VDD_16_17 (1 << 4) -#define AT91C_VDD_17_18 (1 << 5) -#define AT91C_VDD_18_19 (1 << 6) -#define AT91C_VDD_19_20 (1 << 7) -#define AT91C_VDD_20_21 (1 << 8) -#define AT91C_VDD_21_22 (1 << 9) -#define AT91C_VDD_22_23 (1 << 10) -#define AT91C_VDD_23_24 (1 << 11) -#define AT91C_VDD_24_25 (1 << 12) -#define AT91C_VDD_25_26 (1 << 13) -#define AT91C_VDD_26_27 (1 << 14) -#define AT91C_VDD_27_28 (1 << 15) -#define AT91C_VDD_28_29 (1 << 16) -#define AT91C_VDD_29_30 (1 << 17) -#define AT91C_VDD_30_31 (1 << 18) -#define AT91C_VDD_31_32 (1 << 19) -#define AT91C_VDD_32_33 (1 << 20) -#define AT91C_VDD_33_34 (1 << 21) -#define AT91C_VDD_34_35 (1 << 22) -#define AT91C_VDD_35_36 (1 << 23) -#define AT91C_CARD_POWER_UP_BUSY (1 << 31) - -#define AT91C_MMC_HOST_VOLTAGE_RANGE (AT91C_VDD_27_28 +\ - AT91C_VDD_28_29 +\ - AT91C_VDD_29_30 +\ - AT91C_VDD_30_31 +\ - AT91C_VDD_31_32 +\ - AT91C_VDD_32_33) - -//////////////////////////////////////////////////////////////////////////////////////////////////// -// CURRENT_STATE & READY_FOR_DATA in SDCard Status Register definition (response type R1) -//////////////////////////////////////////////////////////////////////////////////////////////////// -#define AT91C_SR_READY_FOR_DATA (1 << 8) // corresponds to buffer empty signalling on the bus -#define AT91C_SR_IDLE (0 << 9) -#define AT91C_SR_READY (1 << 9) -#define AT91C_SR_IDENT (2 << 9) -#define AT91C_SR_STBY (3 << 9) -#define AT91C_SR_TRAN (4 << 9) -#define AT91C_SR_DATA (5 << 9) -#define AT91C_SR_RCV (6 << 9) -#define AT91C_SR_PRG (7 << 9) -#define AT91C_SR_DIS (8 << 9) - -#define AT91C_SR_CARD_SELECTED (AT91C_SR_READY_FOR_DATA + AT91C_SR_TRAN) - -///////////////////////////////////////////////////////////////////////////////////////////////////// -// MMC CSD register header File -// CSD_x_xxx_S for shift value for word x -// CSD_x_xxx_M for mask value for word x -///////////////////////////////////////////////////////////////////////////////////////////////////// - -// First Response INT <=> CSD[3] : bits 0 to 31 -#define CSD_3_BIT0_S 0 // [0:0] -#define CSD_3_BIT0_M 0x01 -#define CSD_3_CRC_S 1 // [7:1] -#define CSD_3_CRC_M 0x7F -#define CSD_3_MMC_ECC_S 8 // [9:8] reserved for MMC compatibility -#define CSD_3_MMC_ECC_M 0x03 -#define CSD_3_FILE_FMT_S 10 // [11:10] -#define CSD_3_FILE_FMT_M 0x03 -#define CSD_3_TMP_WP_S 12 // [12:12] -#define CSD_3_TMP_WP_M 0x01 -#define CSD_3_PERM_WP_S 13 // [13:13] -#define CSD_3_PERM_WP_M 0x01 -#define CSD_3_COPY_S 14 // [14:14] -#define CSD_3_COPY_M 0x01 -#define CSD_3_FILE_FMT_GRP_S 15 // [15:15] -#define CSD_3_FILE_FMT_GRP_M 0x01 -// reserved 16 // [20:16] -// reserved 0x1F -#define CSD_3_WBLOCK_P_S 21 // [21:21] -#define CSD_3_WBLOCK_P_M 0x01 -#define CSD_3_WBLEN_S 22 // [25:22] -#define CSD_3_WBLEN_M 0x0F -#define CSD_3_R2W_F_S 26 // [28:26] -#define CSD_3_R2W_F_M 0x07 -#define CSD_3_MMC_DEF_ECC_S 29 // [30:29] reserved for MMC compatibility -#define CSD_3_MMC_DEF_ECC_M 0x03 -#define CSD_3_WP_GRP_EN_S 31 // [31:31] -#define CSD_3_WP_GRP_EN_M 0x01 - -// Seconde Response INT <=> CSD[2] : bits 32 to 63 -#define CSD_2_v21_WP_GRP_SIZE_S 0 // [38:32] -#define CSD_2_v21_WP_GRP_SIZE_M 0x7F -#define CSD_2_v21_SECT_SIZE_S 7 // [45:39] -#define CSD_2_v21_SECT_SIZE_M 0x7F -#define CSD_2_v21_ER_BLEN_EN_S 14 // [46:46] -#define CSD_2_v21_ER_BLEN_EN_M 0x01 - -#define CSD_2_v22_WP_GRP_SIZE_S 0 // [36:32] -#define CSD_2_v22_WP_GRP_SIZE_M 0x1F -#define CSD_2_v22_ER_GRP_SIZE_S 5 // [41:37] -#define CSD_2_v22_ER_GRP_SIZE_M 0x1F -#define CSD_2_v22_SECT_SIZE_S 10 // [46:42] -#define CSD_2_v22_SECT_SIZE_M 0x1F - -#define CSD_2_C_SIZE_M_S 15 // [49:47] -#define CSD_2_C_SIZE_M_M 0x07 -#define CSD_2_VDD_WMAX_S 18 // [52:50] -#define CSD_2_VDD_WMAX_M 0x07 -#define CSD_2_VDD_WMIN_S 21 // [55:53] -#define CSD_2_VDD_WMIN_M 0x07 -#define CSD_2_RCUR_MAX_S 24 // [58:56] -#define CSD_2_RCUR_MAX_M 0x07 -#define CSD_2_RCUR_MIN_S 27 // [61:59] -#define CSD_2_RCUR_MIN_M 0x07 -#define CSD_2_CSIZE_L_S 30 // [63:62] <=> 2 LSB of CSIZE -#define CSD_2_CSIZE_L_M 0x03 - -// Third Response INT <=> CSD[1] : bits 64 to 95 -#define CSD_1_CSIZE_H_S 0 // [73:64] <=> 10 MSB of CSIZE -#define CSD_1_CSIZE_H_M 0x03FF -// reserved 10 // [75:74] -// reserved 0x03 -#define CSD_1_DSR_I_S 12 // [76:76] -#define CSD_1_DSR_I_M 0x01 -#define CSD_1_RD_B_MIS_S 13 // [77:77] -#define CSD_1_RD_B_MIS_M 0x01 -#define CSD_1_WR_B_MIS_S 14 // [78:78] -#define CSD_1_WR_B_MIS_M 0x01 -#define CSD_1_RD_B_PAR_S 15 // [79:79] -#define CSD_1_RD_B_PAR_M 0x01 -#define CSD_1_RD_B_LEN_S 16 // [83:80] -#define CSD_1_RD_B_LEN_M 0x0F -#define CSD_1_CCC_S 20 // [95:84] -#define CSD_1_CCC_M 0x0FFF - -// Fourth Response INT <=> CSD[0] : bits 96 to 127 -#define CSD_0_TRANS_SPEED_S 0 // [103:96] -#define CSD_0_TRANS_SPEED_M 0xFF -#define CSD_0_NSAC_S 8 // [111:104] -#define CSD_0_NSAC_M 0xFF -#define CSD_0_TAAC_S 16 // [119:112] -#define CSD_0_TAAC_M 0xFF -// reserved 24 // [121:120] -// reserved 0x03 -#define CSD_0_MMC_SPEC_VERS_S 26 // [125:122] reserved for MMC compatibility -#define CSD_0_MMC_SPEC_VERS_M 0x0F -#define CSD_0_STRUCT_S 30 // [127:126] -#define CSD_0_STRUCT_M 0x03 - -///////////////////////////////////////////////////////////////////////////////////////////////////// +#define AT91C_MCI_SR_ERROR (AT91C_MCI_UNRE | AT91C_MCI_OVRE | AT91C_MCI_DTOE | \ + AT91C_MCI_DCRCE | AT91C_MCI_RTOE | AT91C_MCI_RENDE | AT91C_MCI_RCRCE | \ + AT91C_MCI_RDIRE | AT91C_MCI_RINDE) void AT91F_MCI_Device_Handler(AT91PS_MciDevice,unsigned int); AT91S_MCIDeviceStatus AT91F_MCI_SDCard_Init (AT91PS_MciDevice); ==== //depot/projects/arm/src/sys/dev/mmc/mmcreg.h#2 (text+ko) ==== @@ -81,4 +81,328 @@ void *done_data; /* requestor set data */ }; -#endif /* DEV_MMC_BRIDGE_H */ +#define MMC_CMDNB (0x1Fu << 0) // Command Number +#define MMC_RSPTYP (0x3u << 6) // Response Type +#define MMC_RSPTYP_NO (0x0u << 6) // No response +#define MMC_RSPTYP_48 (0x1u << 6) // 48-bit response +#define MMC_RSPTYP_136 (0x2u << 6) // 136-bit response +#define MMC_SPCMD (0x7u << 8) // Special CMD +#define MMC_SPCMD_NONE (0x0u << 8) // Not a special CMD +#define MMC_SPCMD_INIT (0x1u << 8) // Initialization CMD +#define MMC_SPCMD_SYNC (0x2u << 8) // Synchronized CMD +#define MMC_SPCMD_IT_CMD (0x4u << 8) // Interrupt command +#define MMC_SPCMD_IT_REP (0x5u << 8) // Interrupt response +#define MMC_OPDCMD (0x1u << 11) // Open Drain Command +#define MMC_MAXLAT (0x1u << 12) // Maximum Latency for Command to respond +#define MMC_TRCMD (0x3u << 16) // Transfer CMD +#define MMC_TRCMD_NO (0x0u << 16) // No transfer +#define MMC_TRCMD_START (0x1u << 16) // Start transfer +#define MMC_TRCMD_STOP (0x2u << 16) // Stop transfer +#define MMC_TRDIR (0x1u << 18) // Transfer Direction +#define MMC_TRTYP (0x3u << 19) // Transfer Type +#define MMC_TRTYP_BLOCK (0x0u << 19) // Block Transfer type +#define MMC_TRTYP_MULTIPLE (0x1u << 19) // Multiple Block transfer type +#define MMC_TRTYP_STREAM (0x2u << 19) // Stream transfer type + +/////////////////////////////////////////////////////////////////////////////// +// MCI_CMD Register Value +/////////////////////////////////////////////////////////////////////////////// +#define AT91C_POWER_ON_INIT \ + (0 | MMC_TRCMD_NO | MMC_SPCMD_INIT | MMC_OPDCMD) + +///////////////////////////////////////////////////////////////// +// Class 0 & 1 commands: Basic commands and Read Stream commands +///////////////////////////////////////////////////////////////// + +#define AT91C_GO_IDLE_STATE_CMD \ + (0 | MMC_TRCMD_NO | MMC_SPCMD_NONE ) +#define AT91C_MMC_GO_IDLE_STATE_CMD \ + (0 | MMC_TRCMD_NO | MMC_SPCMD_NONE | MMC_OPDCMD) +#define AT91C_MMC_SEND_OP_COND_CMD \ + (1 | MMC_TRCMD_NO | MMC_SPCMD_NONE | MMC_RSPTYP_48 | \ + MMC_OPDCMD) + +#define AT91C_ALL_SEND_CID_CMD \ + (2 | MMC_TRCMD_NO | MMC_SPCMD_NONE | MMC_RSPTYP_136) +#define AT91C_MMC_ALL_SEND_CID_CMD \ + (2 | MMC_TRCMD_NO | MMC_SPCMD_NONE | MMC_RSPTYP_136 | \ + MMC_OPDCMD) + +#define AT91C_SET_RELATIVE_ADDR_CMD \ + (3 | MMC_TRCMD_NO | MMC_SPCMD_NONE | MMC_RSPTYP_48 | \ + MMC_MAXLAT) +#define AT91C_MMC_SET_RELATIVE_ADDR_CMD \ + (3 | MMC_TRCMD_NO | MMC_SPCMD_NONE | MMC_RSPTYP_48 | \ + MMC_MAXLAT | MMC_OPDCMD) + +#define AT91C_SET_DSR_CMD \ + (4 | MMC_TRCMD_NO | MMC_SPCMD_NONE | MMC_RSPTYP_NO | \ + MMC_MAXLAT) // no tested + +#define AT91C_SEL_DESEL_CARD_CMD \ + (7 | MMC_TRCMD_NO | MMC_SPCMD_NONE | MMC_RSPTYP_48 | \ + MMC_MAXLAT) +#define AT91C_SEND_CSD_CMD \ + (9 | MMC_TRCMD_NO | MMC_SPCMD_NONE | MMC_RSPTYP_136 | \ + MMC_MAXLAT) +#define AT91C_SEND_CID_CMD \ + (10 | MMC_TRCMD_NO | MMC_SPCMD_NONE | MMC_RSPTYP_136 | \ + MMC_MAXLAT) +#define AT91C_MMC_READ_DAT_UNTIL_STOP_CMD \ + (11 | MMC_TRTYP_STREAM | MMC_SPCMD_NONE | \ + MMC_RSPTYP_48 | MMC_TRDIR | MMC_TRCMD_START | \ + MMC_MAXLAT) + +#define AT91C_STOP_TRANSMISSION_CMD \ + (12 | MMC_TRCMD_STOP | MMC_SPCMD_NONE | MMC_RSPTYP_48 | \ + MMC_MAXLAT) +#define AT91C_STOP_TRANSMISSION_SYNC_CMD \ + (12 | MMC_TRCMD_STOP | MMC_SPCMD_SYNC | MMC_RSPTYP_48 | \ + MMC_MAXLAT) +#define AT91C_SEND_STATUS_CMD \ + (13 | MMC_TRCMD_NO | MMC_SPCMD_NONE | MMC_RSPTYP_48 | \ + MMC_MAXLAT) +#define AT91C_GO_INACTIVE_STATE_CMD \ + (15 | MMC_RSPTYP_NO) + +//*------------------------------------------------ +//* Class 2 commands: Block oriented Read commands +//*------------------------------------------------ + +#define AT91C_SET_BLOCKLEN_CMD (16 | MMC_TRCMD_NO | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_MAXLAT ) +#define AT91C_READ_SINGLE_BLOCK_CMD (17 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_START | MMC_TRTYP_BLOCK | MMC_TRDIR | MMC_MAXLAT) +#define AT91C_READ_MULTIPLE_BLOCK_CMD (18 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_START | MMC_TRTYP_MULTIPLE | MMC_TRDIR | MMC_MAXLAT) + +//*-------------------------------------------- +//* Class 3 commands: Sequential write commands +//*-------------------------------------------- + +#define AT91C_MMC_WRITE_DAT_UNTIL_STOP_CMD (20 | MMC_TRTYP_STREAM| MMC_SPCMD_NONE | MMC_RSPTYP_48 & ~(MMC_TRDIR) | MMC_TRCMD_START | MMC_MAXLAT ) // MMC + +//*------------------------------------------------ +//* Class 4 commands: Block oriented write commands +//*------------------------------------------------ + +#define AT91C_WRITE_BLOCK_CMD (24 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_START | (MMC_TRTYP_BLOCK & ~(MMC_TRDIR)) | MMC_MAXLAT) +#define AT91C_WRITE_MULTIPLE_BLOCK_CMD (25 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_START | (MMC_TRTYP_MULTIPLE & ~(MMC_TRDIR)) | MMC_MAXLAT) +#define AT91C_PROGRAM_CSD_CMD (27 | MMC_RSPTYP_48 ) + + +//*---------------------------------------- +//* Class 6 commands: Group Write protect +//*---------------------------------------- + +#define AT91C_SET_WRITE_PROT_CMD (28 | MMC_RSPTYP_48 ) +#define AT91C_CLR_WRITE_PROT_CMD (29 | MMC_RSPTYP_48 ) +#define AT91C_SEND_WRITE_PROT_CMD (30 | MMC_RSPTYP_48 ) + + +//*---------------------------------------- +//* Class 5 commands: Erase commands +//*---------------------------------------- + +#define AT91C_TAG_SECTOR_START_CMD (32 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) +#define AT91C_TAG_SECTOR_END_CMD (33 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) +#define AT91C_MMC_UNTAG_SECTOR_CMD (34 | MMC_RSPTYP_48 ) +#define AT91C_MMC_TAG_ERASE_GROUP_START_CMD (35 | MMC_RSPTYP_48 ) +#define AT91C_MMC_TAG_ERASE_GROUP_END_CMD (36 | MMC_RSPTYP_48 ) +#define AT91C_MMC_UNTAG_ERASE_GROUP_CMD (37 | MMC_RSPTYP_48 ) +#define AT91C_ERASE_CMD (38 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT ) + +//*---------------------------------------- +//* Class 7 commands: Lock commands +//*---------------------------------------- + +#define AT91C_LOCK_UNLOCK (42 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) // no tested + +//*----------------------------------------------- +// Class 8 commands: Application specific commands +//*----------------------------------------------- + +#define AT91C_APP_CMD (55 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) +#define AT91C_GEN_CMD (56 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) // no tested + +#define AT91C_SDCARD_SET_BUS_WIDTH_CMD (6 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) +#define AT91C_SDCARD_STATUS_CMD (13 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) +#define AT91C_SDCARD_SEND_NUM_WR_BLOCKS_CMD (22 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) +#define AT91C_SDCARD_SET_WR_BLK_ERASE_COUNT_CMD (23 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) +#define AT91C_SDCARD_APP_OP_COND_CMD (41 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO ) +#define AT91C_SDCARD_SET_CLR_CARD_DETECT_CMD (42 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) +#define AT91C_SDCARD_SEND_SCR_CMD (51 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) + +#define AT91C_SDCARD_APP_ALL_CMD (AT91C_SDCARD_SET_BUS_WIDTH_CMD +\ + AT91C_SDCARD_STATUS_CMD +\ + AT91C_SDCARD_SEND_NUM_WR_BLOCKS_CMD +\ + AT91C_SDCARD_SET_WR_BLK_ERASE_COUNT_CMD +\ + AT91C_SDCARD_APP_OP_COND_CMD +\ + AT91C_SDCARD_SET_CLR_CARD_DETECT_CMD +\ + AT91C_SDCARD_SEND_SCR_CMD) + +//*---------------------------------------- +//* Class 9 commands: IO Mode commands +//*---------------------------------------- + +#define AT91C_MMC_FAST_IO_CMD (39 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_MAXLAT) +#define AT91C_MMC_GO_IRQ_STATE_CMD (40 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) + +///////////////////////////////////////////////////////////////////////////////////////////////////// +// Functions returnals +///////////////////////////////////////////////////////////////////////////////////////////////////// +#define AT91C_CMD_SEND_OK 0 // Command ok +#define AT91C_CMD_SEND_ERROR -1 // Command failed +#define AT91C_INIT_OK 2 // Init Successfull +#define AT91C_INIT_ERROR 3 // Init Failed +#define AT91C_READ_OK 4 // Read Successfull +#define AT91C_READ_ERROR 5 // Read Failed +#define AT91C_WRITE_OK 6 // Write Successfull +#define AT91C_WRITE_ERROR 7 // Write Failed +#define AT91C_ERASE_OK 8 // Erase Successfull +#define AT91C_ERASE_ERROR 9 // Erase Failed +#define AT91C_CARD_SELECTED_OK 10 // Card Selection Successfull +#define AT91C_CARD_SELECTED_ERROR 11 // Card Selection Failed + +//////////////////////////////////////////////////////////////////////////////// +// OCR Register +//////////////////////////////////////////////////////////////////////////////// +#define AT91C_VDD_16_17 (1 << 4) +#define AT91C_VDD_17_18 (1 << 5) +#define AT91C_VDD_18_19 (1 << 6) +#define AT91C_VDD_19_20 (1 << 7) +#define AT91C_VDD_20_21 (1 << 8) +#define AT91C_VDD_21_22 (1 << 9) +#define AT91C_VDD_22_23 (1 << 10) +#define AT91C_VDD_23_24 (1 << 11) +#define AT91C_VDD_24_25 (1 << 12) +#define AT91C_VDD_25_26 (1 << 13) +#define AT91C_VDD_26_27 (1 << 14) +#define AT91C_VDD_27_28 (1 << 15) +#define AT91C_VDD_28_29 (1 << 16) +#define AT91C_VDD_29_30 (1 << 17) +#define AT91C_VDD_30_31 (1 << 18) +#define AT91C_VDD_31_32 (1 << 19) +#define AT91C_VDD_32_33 (1 << 20) +#define AT91C_VDD_33_34 (1 << 21) +#define AT91C_VDD_34_35 (1 << 22) +#define AT91C_VDD_35_36 (1 << 23) +#define AT91C_CARD_POWER_UP_BUSY (1 << 31) + +#define AT91C_MMC_HOST_VOLTAGE_RANGE (AT91C_VDD_27_28 | AT91C_VDD_28_29 | \ + AT91C_VDD_29_30 | AT91C_VDD_30_31 | AT91C_VDD_31_32 | AT91C_VDD_32_33) + +//////////////////////////////////////////////////////////////////////////////// +// CURRENT_STATE & READY_FOR_DATA in SDCard Status Register definition (response type R1) +//////////////////////////////////////////////////////////////////////////////// +#define AT91C_SR_READY_FOR_DATA (1 << 8) // corresponds to buffer empty signalling on the bus +#define AT91C_SR_IDLE (0 << 9) +#define AT91C_SR_READY (1 << 9) +#define AT91C_SR_IDENT (2 << 9) +#define AT91C_SR_STBY (3 << 9) +#define AT91C_SR_TRAN (4 << 9) +#define AT91C_SR_DATA (5 << 9) +#define AT91C_SR_RCV (6 << 9) +#define AT91C_SR_PRG (7 << 9) +#define AT91C_SR_DIS (8 << 9) + +#define AT91C_SR_CARD_SELECTED (AT91C_SR_READY_FOR_DATA + AT91C_SR_TRAN) + +#define MMC_FIRST_RCA 0xCAFE + +//////////////////////////////////////////////////////////////////////////////// +// MMC CSD register header File +// CSD_x_xxx_S for shift value for word x +// CSD_x_xxx_M for mask value for word x +//////////////////////////////////////////////////////////////////////////////// + +// First Response INT <=> CSD[3] : bits 0 to 31 +#define CSD_3_BIT0_S 0 // [0:0] +#define CSD_3_BIT0_M 0x01 +#define CSD_3_CRC_S 1 // [7:1] +#define CSD_3_CRC_M 0x7F +#define CSD_3_MMC_ECC_S 8 // [9:8] reserved for MMC compatibility +#define CSD_3_MMC_ECC_M 0x03 +#define CSD_3_FILE_FMT_S 10 // [11:10] +#define CSD_3_FILE_FMT_M 0x03 +#define CSD_3_TMP_WP_S 12 // [12:12] +#define CSD_3_TMP_WP_M 0x01 +#define CSD_3_PERM_WP_S 13 // [13:13] +#define CSD_3_PERM_WP_M 0x01 +#define CSD_3_COPY_S 14 // [14:14] +#define CSD_3_COPY_M 0x01 +#define CSD_3_FILE_FMT_GRP_S 15 // [15:15] +#define CSD_3_FILE_FMT_GRP_M 0x01 +// reserved 16 // [20:16] +// reserved 0x1F +#define CSD_3_WBLOCK_P_S 21 // [21:21] +#define CSD_3_WBLOCK_P_M 0x01 +#define CSD_3_WBLEN_S 22 // [25:22] +#define CSD_3_WBLEN_M 0x0F +#define CSD_3_R2W_F_S 26 // [28:26] +#define CSD_3_R2W_F_M 0x07 +#define CSD_3_MMC_DEF_ECC_S 29 // [30:29] reserved for MMC compatibility +#define CSD_3_MMC_DEF_ECC_M 0x03 +#define CSD_3_WP_GRP_EN_S 31 // [31:31] +#define CSD_3_WP_GRP_EN_M 0x01 + +// Seconde Response INT <=> CSD[2] : bits 32 to 63 +#define CSD_2_v21_WP_GRP_SIZE_S 0 // [38:32] +#define CSD_2_v21_WP_GRP_SIZE_M 0x7F +#define CSD_2_v21_SECT_SIZE_S 7 // [45:39] +#define CSD_2_v21_SECT_SIZE_M 0x7F +#define CSD_2_v21_ER_BLEN_EN_S 14 // [46:46] +#define CSD_2_v21_ER_BLEN_EN_M 0x01 + +#define CSD_2_v22_WP_GRP_SIZE_S 0 // [36:32] +#define CSD_2_v22_WP_GRP_SIZE_M 0x1F +#define CSD_2_v22_ER_GRP_SIZE_S 5 // [41:37] +#define CSD_2_v22_ER_GRP_SIZE_M 0x1F +#define CSD_2_v22_SECT_SIZE_S 10 // [46:42] +#define CSD_2_v22_SECT_SIZE_M 0x1F + +#define CSD_2_C_SIZE_M_S 15 // [49:47] +#define CSD_2_C_SIZE_M_M 0x07 +#define CSD_2_VDD_WMAX_S 18 // [52:50] +#define CSD_2_VDD_WMAX_M 0x07 +#define CSD_2_VDD_WMIN_S 21 // [55:53] +#define CSD_2_VDD_WMIN_M 0x07 +#define CSD_2_RCUR_MAX_S 24 // [58:56] +#define CSD_2_RCUR_MAX_M 0x07 +#define CSD_2_RCUR_MIN_S 27 // [61:59] +#define CSD_2_RCUR_MIN_M 0x07 +#define CSD_2_CSIZE_L_S 30 // [63:62] <=> 2 LSB of CSIZE +#define CSD_2_CSIZE_L_M 0x03 + +// Third Response INT <=> CSD[1] : bits 64 to 95 +#define CSD_1_CSIZE_H_S 0 // [73:64] <=> 10 MSB of CSIZE +#define CSD_1_CSIZE_H_M 0x03FF +// reserved 10 // [75:74] +// reserved 0x03 +#define CSD_1_DSR_I_S 12 // [76:76] +#define CSD_1_DSR_I_M 0x01 +#define CSD_1_RD_B_MIS_S 13 // [77:77] +#define CSD_1_RD_B_MIS_M 0x01 +#define CSD_1_WR_B_MIS_S 14 // [78:78] +#define CSD_1_WR_B_MIS_M 0x01 +#define CSD_1_RD_B_PAR_S 15 // [79:79] +#define CSD_1_RD_B_PAR_M 0x01 +#define CSD_1_RD_B_LEN_S 16 // [83:80] +#define CSD_1_RD_B_LEN_M 0x0F +#define CSD_1_CCC_S 20 // [95:84] +#define CSD_1_CCC_M 0x0FFF + +// Fourth Response INT <=> CSD[0] : bits 96 to 127 +#define CSD_0_TRANS_SPEED_S 0 // [103:96] +#define CSD_0_TRANS_SPEED_M 0xFF +#define CSD_0_NSAC_S 8 // [111:104] +#define CSD_0_NSAC_M 0xFF +#define CSD_0_TAAC_S 16 // [119:112] +#define CSD_0_TAAC_M 0xFF +// reserved 24 // [121:120] +// reserved 0x03 +#define CSD_0_MMC_SPEC_VERS_S 26 // [125:122] reserved for MMC compatibility +#define CSD_0_MMC_SPEC_VERS_M 0x0F +#define CSD_0_STRUCT_S 30 // [127:126] +#define CSD_0_STRUCT_M 0x03 + +//////////////////////////////////////////////////////////////////////////////// + +#endif /* DEV_MMCREG_H */ From owner-p4-projects@FreeBSD.ORG Wed Sep 13 00:18:16 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 267D116A47B; Wed, 13 Sep 2006 00:18:16 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0281C16A412 for ; Wed, 13 Sep 2006 00:18:16 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6244043D4C for ; Wed, 13 Sep 2006 00:18:15 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8D0IFdZ009886 for ; Wed, 13 Sep 2006 00:18:15 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8D0IFEQ009883 for perforce@freebsd.org; Wed, 13 Sep 2006 00:18:15 GMT (envelope-from imp@freebsd.org) Date: Wed, 13 Sep 2006 00:18:15 GMT Message-Id: <200609130018.k8D0IFEQ009883@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 106038 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Sep 2006 00:18:16 -0000 http://perforce.freebsd.org/chv.cgi?CH=106038 Change 106038 by imp@imp_lighthouse on 2006/09/13 00:17:53 Slightly more consistant Affected files ... .. //depot/projects/arm/src/sys/arm/at91/at91_qdmmc.c#5 edit .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/mci_device.c#13 edit .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/mci_device.h#7 edit .. //depot/projects/arm/src/sys/dev/mmc/mmcreg.h#3 edit Differences ... ==== //depot/projects/arm/src/sys/arm/at91/at91_qdmmc.c#5 (text+ko) ==== @@ -138,8 +138,8 @@ error = RD4(sc, MCI_SR) & MCI_SR_ERROR; if (error) { - if ((cmd != AT91C_SDCARD_APP_OP_COND_CMD) && - (cmd != AT91C_MMC_SEND_OP_COND_CMD)) { + if ((cmd != SDCARD_APP_OP_COND_CMD) && + (cmd != MMC_SEND_OP_COND_CMD)) { //printf("qdmmc: Error 0x%x\n", error); return (error); } @@ -176,12 +176,11 @@ err = 0; /* get all cards into idle state */ - at91_qdmmc_SendCommand(dev, AT91C_MMC_GO_IDLE_STATE_CMD, - AT91C_NO_ARGUMENT); + at91_qdmmc_SendCommand(dev, MMC_GO_IDLE_STATE_CMD, AT91C_NO_ARGUMENT); /* check operating conditions */ do { /* loop on busy */ - err = at91_qdmmc_SendCommand(dev, AT91C_MMC_SEND_OP_COND_CMD, + err = at91_qdmmc_SendCommand(dev, MMC_SEND_OP_COND_CMD, AT91C_MMC_HOST_VOLTAGE_RANGE); if (err != 0) { err = ENXIO; @@ -197,7 +196,7 @@ for(sc->nb_cards = 0; sc->nb_cards < MMC_MAX; sc->nb_cards++) { int status; int card = sc->nb_cards; - status = at91_qdmmc_SendCommand(dev, AT91C_MMC_ALL_SEND_CID_CMD, + status = at91_qdmmc_SendCommand(dev, MMC_ALL_SEND_CID_CMD, AT91C_NO_ARGUMENT); if (status != 0) { break; @@ -237,8 +236,7 @@ month); sc->cards[card].addr = card + MMC_FIRST_RCA; - status = at91_qdmmc_SendCommand(dev, - AT91C_MMC_SET_RELATIVE_ADDR_CMD, + status = at91_qdmmc_SendCommand(dev, MMC_SET_RELATIVE_ADDR_CMD, (sc->cards[card].addr) << 16); if (status != 0) { printf("Failed to set address for MMC %i\n", card); @@ -247,7 +245,7 @@ printf("Set MMC %i address to 0x%x\n", card, sc->cards[card].addr); - status = at91_qdmmc_SendCommand(dev, AT91C_SEND_CSD_CMD, + status = at91_qdmmc_SendCommand(dev, SEND_CSD_CMD, (sc->cards[card].addr) << 16); if (status != 0) { printf("Failed to get CSD for MMC %i\n", card); @@ -532,9 +530,11 @@ bioq_remove(&sc->cards[0].bio_queue, bp); //printf("at91_qdmmc_task: request %p\n", bp); if (bp->bio_cmd == BIO_READ) { - status = at91_qdmmc_SendCommand(sc->dev, AT91C_SEL_DESEL_CARD_CMD, (sc->cards[0].addr) << 16); + status = at91_qdmmc_SendCommand(sc->dev, + SEL_DESEL_CARD_CMD, (sc->cards[0].addr) << 16); //printf("at91_qdmmc_task: select_card-status = 0x%x\n", status); - status = at91_qdmmc_SendCommand(sc->dev, AT91C_SET_BLOCKLEN_CMD, sc->cards[0].sector_size); + status = at91_qdmmc_SendCommand(sc->dev, + SET_BLOCKLEN_CMD, sc->cards[0].sector_size); //printf("at91_qdmmc_task: set_blocklen-status = 0x%x\n", status); //printf("at91_qdmmc_task: read block %lld, bcount %ld\n", bp->bio_pblkno, bp->bio_bcount); uint32_t block; @@ -560,7 +560,8 @@ //printf("status = 0x%x, paddr = %p, RPR = 0x%x, RCR = 0x%x\n", status, paddr, // RD4(sc, PDC_RPR), RD4(sc, PDC_RCR)); - status = at91_qdmmc_SendCommand(sc->dev, AT91C_READ_SINGLE_BLOCK_CMD, block * sc->cards[0].sector_size); + status = at91_qdmmc_SendCommand(sc->dev, + READ_SINGLE_BLOCK_CMD, block * sc->cards[0].sector_size); //printf("at91_qdmmc_task: read-status = 0x%x\n", status); // wait for completion @@ -583,7 +584,8 @@ ((tmp & 0xff) << 24); } } - status = at91_qdmmc_SendCommand(sc->dev, AT91C_SEL_DESEL_CARD_CMD, 0); + status = at91_qdmmc_SendCommand(sc->dev, + SEL_DESEL_CARD_CMD, 0); //printf("at91_qdmmc_task: deselect_card-status = 0x%x\n", status); // Reset Mode Register @@ -600,9 +602,11 @@ WR4(sc, MCI_MR, sc->cards[0].mode | (sc->cards[0].sector_size << 16)); // printf("mode 0x%x\n", RD4(sc, MCI_MR)); - status = at91_qdmmc_SendCommand(sc->dev, AT91C_SEL_DESEL_CARD_CMD, (sc->cards[0].addr) << 16); + status = at91_qdmmc_SendCommand(sc->dev, + SEL_DESEL_CARD_CMD, (sc->cards[0].addr) << 16); // printf("at91_qdmmc_task: select_card-status = 0x%x\n", status); - status = at91_qdmmc_SendCommand(sc->dev, AT91C_SET_BLOCKLEN_CMD, sc->cards[0].sector_size); + status = at91_qdmmc_SendCommand(sc->dev, + SET_BLOCKLEN_CMD, sc->cards[0].sector_size); // printf("at91_qdmmc_task: set_blocklen-status = 0x%x\n", status); //tmpbuf = malloc(sc->cards[0].sector_size, M_DEVBUF, M_WAITOK); @@ -632,7 +636,8 @@ // printf("status = 0x%x, tmpbuf = %p, TPR = 0x%x, TCR = 0x%x\n", status, tmpbuf, // RD4(sc, PDC_TPR), RD4(sc, PDC_TCR)); - status = at91_qdmmc_SendCommand(sc->dev, AT91C_WRITE_BLOCK_CMD, block * sc->cards[0].sector_size); + status = at91_qdmmc_SendCommand(sc->dev, + WRITE_BLOCK_CMD, block * sc->cards[0].sector_size); // printf("at91_qdmmc_task: write-status = 0x%x\n", status); WR4(sc, MCI_IER, MCI_SR_NOTBUSY); WR4(sc, PDC_PTCR, PDC_PTCR_TXTEN); @@ -649,7 +654,8 @@ } //free(tmpbuf, M_DEVBUF); - status = at91_qdmmc_SendCommand(sc->dev, AT91C_SEL_DESEL_CARD_CMD, 0); + status = at91_qdmmc_SendCommand(sc->dev, + SEL_DESEL_CARD_CMD, 0); //printf("at91_qdmmc_task: deselect_card-status = 0x%x\n", status); // Reset Mode Register @@ -661,7 +667,7 @@ out: if (map) bus_dmamap_unload(sc->dmatag, sc->map); - status = at91_qdmmc_SendCommand(sc->dev, AT91C_SEL_DESEL_CARD_CMD, 0); + status = at91_qdmmc_SendCommand(sc->dev, SEL_DESEL_CARD_CMD, 0); //printf("at91_qdmmc_task: deselect_card-status = 0x%x\n", status); AT91_QDMMC_UNLOCK(sc); biofinish(bp, NULL, ENXIO); ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/mci_device.c#13 (text+ko) ==== @@ -75,8 +75,8 @@ if (error != 0 ) { // if the command is SEND_OP_COND the CRC error flag is // always present (cf : R3 response) - if ((Cmd != AT91C_SDCARD_APP_OP_COND_CMD) && - (Cmd != AT91C_MMC_SEND_OP_COND_CMD)) + if ((Cmd != SDCARD_APP_OP_COND_CMD) && + (Cmd != MMC_SEND_OP_COND_CMD)) return ((AT91C_BASE_MCI->MCI_SR) & AT91C_MCI_SR_ERROR); if (error != AT91C_MCI_RCRCE) return ((AT91C_BASE_MCI->MCI_SR) & AT91C_MCI_SR_ERROR); @@ -98,7 +98,7 @@ // Send the CMD55 for application specific command AT91C_BASE_MCI->MCI_ARGR = (pMCI_Device->pMCI_DeviceFeatures->Relative_Card_Address << 16 ); - AT91C_BASE_MCI->MCI_CMDR = AT91C_APP_CMD; + AT91C_BASE_MCI->MCI_CMDR = APP_CMD; // wait for CMDRDY Status flag to read the response do @@ -112,7 +112,7 @@ return ((AT91C_BASE_MCI->MCI_SR) & AT91C_MCI_SR_ERROR); // check if it is a specific command and then send the command - if ( (Cmd_App && AT91C_SDCARD_APP_ALL_CMD) == 0) + if ( (Cmd_App & SDCARD_APP_ALL_CMD) == 0) return AT91C_CMD_SEND_ERROR; return(AT91F_MCI_SendCommand(Cmd_App,Arg)); @@ -125,7 +125,7 @@ static AT91S_MCIDeviceStatus AT91F_MCI_GetStatus(unsigned int relative_card_address) { - if (AT91F_MCI_SendCommand(AT91C_SEND_STATUS_CMD, + if (AT91F_MCI_SendCommand(SEND_STATUS_CMD, relative_card_address <<16) == AT91C_CMD_SEND_OK) return (AT91C_BASE_MCI->MCI_RSPR[0]); return AT91C_CMD_SEND_ERROR; @@ -229,7 +229,7 @@ AT91C_BASE_PDC_MCI->PDC_RCR = sizeToRead; // Send the Read single block command - if (AT91F_MCI_SendCommand(AT91C_READ_SINGLE_BLOCK_CMD, src) != AT91C_CMD_SEND_OK) + if (AT91F_MCI_SendCommand(READ_SINGLE_BLOCK_CMD, src) != AT91C_CMD_SEND_OK) return AT91C_READ_ERROR; pMCI_Device->pMCI_DeviceDesc->state = AT91C_MCI_RX_SINGLE_BLOCK; @@ -291,7 +291,7 @@ AT91C_BASE_PDC_MCI->PDC_TCR = sizeToWrite; // Send the write single block command - if ( AT91F_MCI_SendCommand(AT91C_WRITE_BLOCK_CMD, dest) != AT91C_CMD_SEND_OK) + if ( AT91F_MCI_SendCommand(WRITE_BLOCK_CMD, dest) != AT91C_CMD_SEND_OK) return AT91C_WRITE_ERROR; pMCI_Device->pMCI_DeviceDesc->state = AT91C_MCI_TX_SINGLE_BLOCK; @@ -332,7 +332,7 @@ if (status > AT91C_MAX_MCI_CARDS) return AT91C_CARD_SELECTED_ERROR; - if (AT91F_MCI_SendCommand(AT91C_SEL_DESEL_CARD_CMD, + if (AT91F_MCI_SendCommand(SEL_DESEL_CARD_CMD, pMCI_Device->pMCI_DeviceFeatures[status].Relative_Card_Address << 16) == AT91C_CMD_SEND_OK) return AT91C_CARD_SELECTED_OK; return AT91C_CARD_SELECTED_ERROR; @@ -347,7 +347,7 @@ AT91F_MCI_GetCSD(unsigned int relative_card_address , unsigned int * response) { - if(AT91F_MCI_SendCommand(AT91C_SEND_CSD_CMD, + if(AT91F_MCI_SendCommand(SEND_CSD_CMD, (relative_card_address << 16)) != AT91C_CMD_SEND_OK) return AT91C_CMD_SEND_ERROR; @@ -366,7 +366,7 @@ AT91S_MCIDeviceStatus AT91F_MCI_SetBlocklength(unsigned int length) { - return( AT91F_MCI_SendCommand(AT91C_SET_BLOCKLEN_CMD, length) ); + return( AT91F_MCI_SendCommand(SET_BLOCKLEN_CMD, length) ); } #if MMC_SUPPORT @@ -380,7 +380,7 @@ unsigned int response =0x0; while(1) { - response = AT91F_MCI_SendCommand(AT91C_MMC_SEND_OP_COND_CMD, + response = AT91F_MCI_SendCommand(MMC_SEND_OP_COND_CMD, AT91C_MMC_HOST_VOLTAGE_RANGE); if (response != AT91C_CMD_SEND_OK) return AT91C_INIT_ERROR; @@ -400,7 +400,7 @@ int Nb_Cards_Found=-1; while (1) { - if(AT91F_MCI_SendCommand(AT91C_MMC_ALL_SEND_CID_CMD, + if(AT91F_MCI_SendCommand(MMC_ALL_SEND_CID_CMD, AT91C_NO_ARGUMENT) != AT91C_CMD_SEND_OK) return Nb_Cards_Found; else { @@ -411,7 +411,7 @@ pMCI_Device->pMCI_DeviceFeatures[Nb_Cards_Found].Card_Inserted = AT91C_MMC_CARD_INSERTED; if (AT91F_MCI_SendCommand( - AT91C_MMC_SET_RELATIVE_ADDR_CMD, + MMC_SET_RELATIVE_ADDR_CMD, (Nb_Cards_Found + AT91C_FIRST_RCA) << 16) != AT91C_CMD_SEND_OK) return AT91C_CMD_SEND_ERROR; @@ -434,7 +434,7 @@ AT91PS_MciDeviceFeatures f; //* Resets all MMC Cards in Idle state - AT91F_MCI_SendCommand(AT91C_MMC_GO_IDLE_STATE_CMD, AT91C_NO_ARGUMENT); + AT91F_MCI_SendCommand(MMC_GO_IDLE_STATE_CMD, AT91C_NO_ARGUMENT); if (AT91F_MCI_MMC_GetAllOCR(pMCI_Device) == AT91C_INIT_ERROR) return AT91C_INIT_ERROR; @@ -492,7 +492,7 @@ while( (response & AT91C_CARD_POWER_UP_BUSY) != AT91C_CARD_POWER_UP_BUSY ) { response = AT91F_MCI_SDCard_SendAppCommand(pMCI_Device, - AT91C_SDCARD_APP_OP_COND_CMD, + SDCARD_APP_OP_COND_CMD, AT91C_MMC_HOST_VOLTAGE_RANGE); if (response != AT91C_CMD_SEND_OK) return AT91C_INIT_ERROR; @@ -509,7 +509,7 @@ static AT91S_MCIDeviceStatus AT91F_MCI_SDCard_GetCID(unsigned int *response) { - if (AT91F_MCI_SendCommand(AT91C_ALL_SEND_CID_CMD, + if (AT91F_MCI_SendCommand(ALL_SEND_CID_CMD, AT91C_NO_ARGUMENT) != AT91C_CMD_SEND_OK) return AT91C_CMD_SEND_ERROR; @@ -537,7 +537,7 @@ while((ret_value > 0) && ((ret_value & AT91C_SR_READY_FOR_DATA) == 0)); // Select Card - AT91F_MCI_SendCommand(AT91C_SEL_DESEL_CARD_CMD, + AT91F_MCI_SendCommand(SEL_DESEL_CARD_CMD, (pMCI_Device->pMCI_DeviceFeatures->Relative_Card_Address)<<16); // Set bus width for Sdcard @@ -546,7 +546,8 @@ else bus_width = AT91C_BUS_WIDTH_1BIT; - if (AT91F_MCI_SDCard_SendAppCommand(pMCI_Device,AT91C_SDCARD_SET_BUS_WIDTH_CMD,bus_width) != AT91C_CMD_SEND_OK) + if (AT91F_MCI_SDCard_SendAppCommand(pMCI_Device, + SDCARD_SET_BUS_WIDTH_CMD,bus_width) != AT91C_CMD_SEND_OK) return AT91C_CMD_SEND_ERROR; return AT91C_CMD_SEND_OK; @@ -563,7 +564,7 @@ unsigned int mult,blocknr; AT91PS_MciDeviceFeatures f; - AT91F_MCI_SendCommand(AT91C_GO_IDLE_STATE_CMD, AT91C_NO_ARGUMENT); + AT91F_MCI_SendCommand(GO_IDLE_STATE_CMD, AT91C_NO_ARGUMENT); if (AT91F_MCI_SDCard_GetOCR(pMCI_Device) == AT91C_INIT_ERROR) return AT91C_INIT_ERROR; @@ -572,7 +573,7 @@ if (AT91F_MCI_SDCard_GetCID(tab_response) != AT91C_CMD_SEND_OK) return AT91C_INIT_ERROR; f->Card_Inserted = AT91C_SD_CARD_INSERTED; - if (AT91F_MCI_SendCommand(AT91C_SET_RELATIVE_ADDR_CMD, 0) != + if (AT91F_MCI_SendCommand(SET_RELATIVE_ADDR_CMD, 0) != AT91C_CMD_SEND_OK) return AT91C_INIT_ERROR; f->Relative_Card_Address = (AT91C_BASE_MCI->MCI_RSPR[0] >> 16); ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/mci_device.h#7 (text+ko) ==== @@ -123,6 +123,22 @@ #include +///////////////////////////////////////////////////////////////////////////////////////////////////// +// Functions returnals +///////////////////////////////////////////////////////////////////////////////////////////////////// +#define AT91C_CMD_SEND_OK 0 // Command ok +#define AT91C_CMD_SEND_ERROR -1 // Command failed +#define AT91C_INIT_OK 2 // Init Successfull +#define AT91C_INIT_ERROR 3 // Init Failed +#define AT91C_READ_OK 4 // Read Successfull +#define AT91C_READ_ERROR 5 // Read Failed +#define AT91C_WRITE_OK 6 // Write Successfull +#define AT91C_WRITE_ERROR 7 // Write Failed +#define AT91C_ERASE_OK 8 // Erase Successfull +#define AT91C_ERASE_ERROR 9 // Erase Failed +#define AT91C_CARD_SELECTED_OK 10 // Card Selection Successfull +#define AT91C_CARD_SELECTED_ERROR 11 // Card Selection Failed + #define AT91C_MCI_SR_ERROR (AT91C_MCI_UNRE | AT91C_MCI_OVRE | AT91C_MCI_DTOE | \ AT91C_MCI_DCRCE | AT91C_MCI_RTOE | AT91C_MCI_RENDE | AT91C_MCI_RCRCE | \ AT91C_MCI_RDIRE | AT91C_MCI_RINDE) ==== //depot/projects/arm/src/sys/dev/mmc/mmcreg.h#3 (text+ko) ==== @@ -107,159 +107,143 @@ /////////////////////////////////////////////////////////////////////////////// // MCI_CMD Register Value /////////////////////////////////////////////////////////////////////////////// -#define AT91C_POWER_ON_INIT \ +#define POWER_ON_INIT \ (0 | MMC_TRCMD_NO | MMC_SPCMD_INIT | MMC_OPDCMD) ///////////////////////////////////////////////////////////////// // Class 0 & 1 commands: Basic commands and Read Stream commands ///////////////////////////////////////////////////////////////// -#define AT91C_GO_IDLE_STATE_CMD \ +#define GO_IDLE_STATE_CMD \ (0 | MMC_TRCMD_NO | MMC_SPCMD_NONE ) -#define AT91C_MMC_GO_IDLE_STATE_CMD \ +#define MMC_GO_IDLE_STATE_CMD \ (0 | MMC_TRCMD_NO | MMC_SPCMD_NONE | MMC_OPDCMD) -#define AT91C_MMC_SEND_OP_COND_CMD \ +#define MMC_SEND_OP_COND_CMD \ (1 | MMC_TRCMD_NO | MMC_SPCMD_NONE | MMC_RSPTYP_48 | \ MMC_OPDCMD) -#define AT91C_ALL_SEND_CID_CMD \ +#define ALL_SEND_CID_CMD \ (2 | MMC_TRCMD_NO | MMC_SPCMD_NONE | MMC_RSPTYP_136) -#define AT91C_MMC_ALL_SEND_CID_CMD \ +#define MMC_ALL_SEND_CID_CMD \ (2 | MMC_TRCMD_NO | MMC_SPCMD_NONE | MMC_RSPTYP_136 | \ MMC_OPDCMD) -#define AT91C_SET_RELATIVE_ADDR_CMD \ +#define SET_RELATIVE_ADDR_CMD \ (3 | MMC_TRCMD_NO | MMC_SPCMD_NONE | MMC_RSPTYP_48 | \ MMC_MAXLAT) -#define AT91C_MMC_SET_RELATIVE_ADDR_CMD \ +#define MMC_SET_RELATIVE_ADDR_CMD \ (3 | MMC_TRCMD_NO | MMC_SPCMD_NONE | MMC_RSPTYP_48 | \ MMC_MAXLAT | MMC_OPDCMD) -#define AT91C_SET_DSR_CMD \ +#define SET_DSR_CMD \ (4 | MMC_TRCMD_NO | MMC_SPCMD_NONE | MMC_RSPTYP_NO | \ MMC_MAXLAT) // no tested -#define AT91C_SEL_DESEL_CARD_CMD \ +#define SEL_DESEL_CARD_CMD \ (7 | MMC_TRCMD_NO | MMC_SPCMD_NONE | MMC_RSPTYP_48 | \ MMC_MAXLAT) -#define AT91C_SEND_CSD_CMD \ +#define SEND_CSD_CMD \ (9 | MMC_TRCMD_NO | MMC_SPCMD_NONE | MMC_RSPTYP_136 | \ MMC_MAXLAT) -#define AT91C_SEND_CID_CMD \ +#define SEND_CID_CMD \ (10 | MMC_TRCMD_NO | MMC_SPCMD_NONE | MMC_RSPTYP_136 | \ MMC_MAXLAT) -#define AT91C_MMC_READ_DAT_UNTIL_STOP_CMD \ +#define MMC_READ_DAT_UNTIL_STOP_CMD \ (11 | MMC_TRTYP_STREAM | MMC_SPCMD_NONE | \ MMC_RSPTYP_48 | MMC_TRDIR | MMC_TRCMD_START | \ MMC_MAXLAT) -#define AT91C_STOP_TRANSMISSION_CMD \ +#define STOP_TRANSMISSION_CMD \ (12 | MMC_TRCMD_STOP | MMC_SPCMD_NONE | MMC_RSPTYP_48 | \ MMC_MAXLAT) -#define AT91C_STOP_TRANSMISSION_SYNC_CMD \ +#define STOP_TRANSMISSION_SYNC_CMD \ (12 | MMC_TRCMD_STOP | MMC_SPCMD_SYNC | MMC_RSPTYP_48 | \ MMC_MAXLAT) -#define AT91C_SEND_STATUS_CMD \ +#define SEND_STATUS_CMD \ (13 | MMC_TRCMD_NO | MMC_SPCMD_NONE | MMC_RSPTYP_48 | \ MMC_MAXLAT) -#define AT91C_GO_INACTIVE_STATE_CMD \ +#define GO_INACTIVE_STATE_CMD \ (15 | MMC_RSPTYP_NO) //*------------------------------------------------ //* Class 2 commands: Block oriented Read commands //*------------------------------------------------ -#define AT91C_SET_BLOCKLEN_CMD (16 | MMC_TRCMD_NO | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_MAXLAT ) -#define AT91C_READ_SINGLE_BLOCK_CMD (17 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_START | MMC_TRTYP_BLOCK | MMC_TRDIR | MMC_MAXLAT) -#define AT91C_READ_MULTIPLE_BLOCK_CMD (18 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_START | MMC_TRTYP_MULTIPLE | MMC_TRDIR | MMC_MAXLAT) +#define SET_BLOCKLEN_CMD (16 | MMC_TRCMD_NO | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_MAXLAT ) +#define READ_SINGLE_BLOCK_CMD (17 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_START | MMC_TRTYP_BLOCK | MMC_TRDIR | MMC_MAXLAT) +#define READ_MULTIPLE_BLOCK_CMD (18 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_START | MMC_TRTYP_MULTIPLE | MMC_TRDIR | MMC_MAXLAT) //*-------------------------------------------- //* Class 3 commands: Sequential write commands //*-------------------------------------------- -#define AT91C_MMC_WRITE_DAT_UNTIL_STOP_CMD (20 | MMC_TRTYP_STREAM| MMC_SPCMD_NONE | MMC_RSPTYP_48 & ~(MMC_TRDIR) | MMC_TRCMD_START | MMC_MAXLAT ) // MMC +#define MMC_WRITE_DAT_UNTIL_STOP_CMD (20 | MMC_TRTYP_STREAM| MMC_SPCMD_NONE | MMC_RSPTYP_48 & ~(MMC_TRDIR) | MMC_TRCMD_START | MMC_MAXLAT ) // MMC //*------------------------------------------------ //* Class 4 commands: Block oriented write commands //*------------------------------------------------ -#define AT91C_WRITE_BLOCK_CMD (24 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_START | (MMC_TRTYP_BLOCK & ~(MMC_TRDIR)) | MMC_MAXLAT) -#define AT91C_WRITE_MULTIPLE_BLOCK_CMD (25 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_START | (MMC_TRTYP_MULTIPLE & ~(MMC_TRDIR)) | MMC_MAXLAT) -#define AT91C_PROGRAM_CSD_CMD (27 | MMC_RSPTYP_48 ) +#define WRITE_BLOCK_CMD (24 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_START | (MMC_TRTYP_BLOCK & ~(MMC_TRDIR)) | MMC_MAXLAT) +#define WRITE_MULTIPLE_BLOCK_CMD (25 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_START | (MMC_TRTYP_MULTIPLE & ~(MMC_TRDIR)) | MMC_MAXLAT) +#define PROGRAM_CSD_CMD (27 | MMC_RSPTYP_48 ) //*---------------------------------------- //* Class 6 commands: Group Write protect //*---------------------------------------- -#define AT91C_SET_WRITE_PROT_CMD (28 | MMC_RSPTYP_48 ) -#define AT91C_CLR_WRITE_PROT_CMD (29 | MMC_RSPTYP_48 ) -#define AT91C_SEND_WRITE_PROT_CMD (30 | MMC_RSPTYP_48 ) +#define SET_WRITE_PROT_CMD (28 | MMC_RSPTYP_48 ) +#define CLR_WRITE_PROT_CMD (29 | MMC_RSPTYP_48 ) +#define SEND_WRITE_PROT_CMD (30 | MMC_RSPTYP_48 ) //*---------------------------------------- //* Class 5 commands: Erase commands //*---------------------------------------- -#define AT91C_TAG_SECTOR_START_CMD (32 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) -#define AT91C_TAG_SECTOR_END_CMD (33 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) -#define AT91C_MMC_UNTAG_SECTOR_CMD (34 | MMC_RSPTYP_48 ) -#define AT91C_MMC_TAG_ERASE_GROUP_START_CMD (35 | MMC_RSPTYP_48 ) -#define AT91C_MMC_TAG_ERASE_GROUP_END_CMD (36 | MMC_RSPTYP_48 ) -#define AT91C_MMC_UNTAG_ERASE_GROUP_CMD (37 | MMC_RSPTYP_48 ) -#define AT91C_ERASE_CMD (38 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT ) +#define TAG_SECTOR_START_CMD (32 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) +#define TAG_SECTOR_END_CMD (33 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) +#define MMC_UNTAG_SECTOR_CMD (34 | MMC_RSPTYP_48 ) +#define MMC_TAG_ERASE_GROUP_START_CMD (35 | MMC_RSPTYP_48 ) +#define MMC_TAG_ERASE_GROUP_END_CMD (36 | MMC_RSPTYP_48 ) +#define MMC_UNTAG_ERASE_GROUP_CMD (37 | MMC_RSPTYP_48 ) +#define ERASE_CMD (38 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT ) //*---------------------------------------- //* Class 7 commands: Lock commands //*---------------------------------------- -#define AT91C_LOCK_UNLOCK (42 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) // no tested +#define LOCK_UNLOCK (42 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) // no tested //*----------------------------------------------- // Class 8 commands: Application specific commands //*----------------------------------------------- -#define AT91C_APP_CMD (55 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) -#define AT91C_GEN_CMD (56 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) // no tested +#define APP_CMD (55 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) +#define GEN_CMD (56 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) // no tested -#define AT91C_SDCARD_SET_BUS_WIDTH_CMD (6 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) -#define AT91C_SDCARD_STATUS_CMD (13 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) -#define AT91C_SDCARD_SEND_NUM_WR_BLOCKS_CMD (22 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) -#define AT91C_SDCARD_SET_WR_BLK_ERASE_COUNT_CMD (23 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) -#define AT91C_SDCARD_APP_OP_COND_CMD (41 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO ) -#define AT91C_SDCARD_SET_CLR_CARD_DETECT_CMD (42 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) -#define AT91C_SDCARD_SEND_SCR_CMD (51 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) +#define SDCARD_SET_BUS_WIDTH_CMD (6 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) +#define SDCARD_STATUS_CMD (13 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) +#define SDCARD_SEND_NUM_WR_BLOCKS_CMD (22 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) +#define SDCARD_SET_WR_BLK_ERASE_COUNT_CMD (23 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) +#define SDCARD_APP_OP_COND_CMD (41 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO ) +#define SDCARD_SET_CLR_CARD_DETECT_CMD (42 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) +#define SDCARD_SEND_SCR_CMD (51 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) -#define AT91C_SDCARD_APP_ALL_CMD (AT91C_SDCARD_SET_BUS_WIDTH_CMD +\ - AT91C_SDCARD_STATUS_CMD +\ - AT91C_SDCARD_SEND_NUM_WR_BLOCKS_CMD +\ - AT91C_SDCARD_SET_WR_BLK_ERASE_COUNT_CMD +\ - AT91C_SDCARD_APP_OP_COND_CMD +\ - AT91C_SDCARD_SET_CLR_CARD_DETECT_CMD +\ - AT91C_SDCARD_SEND_SCR_CMD) +#define SDCARD_APP_ALL_CMD (SDCARD_SET_BUS_WIDTH_CMD +\ + SDCARD_STATUS_CMD +\ + SDCARD_SEND_NUM_WR_BLOCKS_CMD +\ + SDCARD_SET_WR_BLK_ERASE_COUNT_CMD +\ + SDCARD_APP_OP_COND_CMD +\ + SDCARD_SET_CLR_CARD_DETECT_CMD +\ + SDCARD_SEND_SCR_CMD) //*---------------------------------------- //* Class 9 commands: IO Mode commands //*---------------------------------------- -#define AT91C_MMC_FAST_IO_CMD (39 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_MAXLAT) -#define AT91C_MMC_GO_IRQ_STATE_CMD (40 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) - -///////////////////////////////////////////////////////////////////////////////////////////////////// -// Functions returnals -///////////////////////////////////////////////////////////////////////////////////////////////////// -#define AT91C_CMD_SEND_OK 0 // Command ok -#define AT91C_CMD_SEND_ERROR -1 // Command failed -#define AT91C_INIT_OK 2 // Init Successfull -#define AT91C_INIT_ERROR 3 // Init Failed -#define AT91C_READ_OK 4 // Read Successfull -#define AT91C_READ_ERROR 5 // Read Failed -#define AT91C_WRITE_OK 6 // Write Successfull -#define AT91C_WRITE_ERROR 7 // Write Failed -#define AT91C_ERASE_OK 8 // Erase Successfull -#define AT91C_ERASE_ERROR 9 // Erase Failed -#define AT91C_CARD_SELECTED_OK 10 // Card Selection Successfull -#define AT91C_CARD_SELECTED_ERROR 11 // Card Selection Failed +#define MMC_FAST_IO_CMD (39 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_MAXLAT) +#define MMC_GO_IRQ_STATE_CMD (40 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) //////////////////////////////////////////////////////////////////////////////// // OCR Register From owner-p4-projects@FreeBSD.ORG Wed Sep 13 06:45:24 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5728416A5EA; Wed, 13 Sep 2006 06:45:24 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E0C3416A5C7 for ; Wed, 13 Sep 2006 06:45:23 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3907543D7B for ; Wed, 13 Sep 2006 06:45:19 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8D6jJQ0054550 for ; Wed, 13 Sep 2006 06:45:19 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8D6jI3v054547 for perforce@freebsd.org; Wed, 13 Sep 2006 06:45:18 GMT (envelope-from imp@freebsd.org) Date: Wed, 13 Sep 2006 06:45:18 GMT Message-Id: <200609130645.k8D6jI3v054547@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 106044 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Sep 2006 06:45:24 -0000 http://perforce.freebsd.org/chv.cgi?CH=106044 Change 106044 by imp@imp_lighthouse on 2006/09/13 06:44:36 Quick ramdisk experiment Affected files ... .. //depot/projects/arm/src/sys/arm/conf/TSC4370RAM#1 add Differences ... From owner-p4-projects@FreeBSD.ORG Wed Sep 13 06:45:25 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A0BD516A5A1; Wed, 13 Sep 2006 06:45:24 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E4FCE16A5CA for ; Wed, 13 Sep 2006 06:45:23 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8CB7B43D7C for ; Wed, 13 Sep 2006 06:45:19 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8D6jJ2M054556 for ; Wed, 13 Sep 2006 06:45:19 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8D6jJkV054553 for perforce@freebsd.org; Wed, 13 Sep 2006 06:45:19 GMT (envelope-from imp@freebsd.org) Date: Wed, 13 Sep 2006 06:45:19 GMT Message-Id: <200609130645.k8D6jJkV054553@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 106045 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Sep 2006 06:45:25 -0000 http://perforce.freebsd.org/chv.cgi?CH=106045 Change 106045 by imp@imp_lighthouse on 2006/09/13 06:45:09 checkpoint Affected files ... .. //depot/projects/arm/src/sys/arm/at91/at91_qdmmc.c#6 edit Differences ... ==== //depot/projects/arm/src/sys/arm/at91/at91_qdmmc.c#6 (text+ko) ==== @@ -160,11 +160,88 @@ return (0); } +#if 0 +static int +at91_qdmmc_SDCard_GetOCR(device_t dev) +{ + struct at91_qdmmc_softc *sc = device_get_softc(dev); + uint32_t response = 0; + + // The RCA to be used for CMD55 in Idle state shall be the card's + // default RCA=0x0000. + sc->cards[0].rca = 0; + while(!(response & AT91C_CARD_POWER_UP_BUSY)) { + response = at91_qdmmc_SDCard_SendAppCommand(dev, + SDCARD_APP_OP_COND_CMD, AT91C_MMC_HOST_VOLTAGE_RANGE); + if (response != 0) + return (-1); + response = RD4(sc, MCI_RSPR); + } + + return (response); +} +#endif + static int at91_qdmmc_sdcard_init(device_t dev) { - printf("No SD cards found\n"); +#if 0 + struct at91_qdmmc_softc *sc = device_get_softc(dev); + unsigned int tab_response[4]; + unsigned int mult,blocknr; + + at91_qdmmc_SendCommand(dev, GO_IDLE_STATE_CMD, AT91C_NO_ARGUMENT); + + if (at91_qdmmc_SDCard_GetOCR(dev) == -1) + return ENXIO; + + f = pMCI_Device->pMCI_DeviceFeatures; + if (at91_qdmmc_SDCard_GetCID(tab_response) != 0) + return AT91C_INIT_ERROR; + f->Card_Inserted = AT91C_SD_CARD_INSERTED; + if (at91_qdmmc_SendCommand(SET_RELATIVE_ADDR_CMD, 0) != 0) + return AT91C_INIT_ERROR; + f->Relative_Card_Address = (AT91C_BASE_MCI->MCI_RSPR[0] >> 16); + if (at91_qdmmc_GetCSD(f->Relative_Card_Address,tab_response) + != AT91C_CMD_SEND_OK) + return AT91C_INIT_ERROR; + f->READ_BL_LEN = (tab_response[1] >> CSD_1_RD_B_LEN_S) & + CSD_1_RD_B_LEN_M; + f->WRITE_BL_LEN = (tab_response[3] >> CSD_3_WBLEN_S) & + CSD_3_WBLEN_M; + f->Sector_Size = 1 + ((tab_response[2] >> CSD_2_v21_SECT_SIZE_S) & + CSD_2_v21_SECT_SIZE_M); + f->Read_Partial = (tab_response[1] >> CSD_1_RD_B_PAR_S) & + CSD_1_RD_B_PAR_M; + f->Write_Partial = (tab_response[3] >> CSD_3_WBLOCK_P_S) & + CSD_3_WBLOCK_P_M; + f->Erase_Block_Enable = (tab_response[2] >> CSD_2_v21_ER_BLEN_EN_S) & + CSD_2_v21_ER_BLEN_EN_M; + f->Read_Block_Misalignment = (tab_response[1] >> CSD_1_RD_B_MIS_S) & + CSD_1_RD_B_MIS_M; + f->Write_Block_Misalignment = (tab_response[1] >> CSD_1_WR_B_MIS_S) & + CSD_1_WR_B_MIS_M; + //// Compute Memory Capacity + // compute MULT + mult = 1 << ( ((tab_response[2] >> CSD_2_C_SIZE_M_S) & + CSD_2_C_SIZE_M_M) + 2 ); + // compute MSB of C_SIZE + blocknr = ((tab_response[1] >> CSD_1_CSIZE_H_S) & + CSD_1_CSIZE_H_M) << 2; + // compute MULT * (LSB of C-SIZE + MSB already computed + 1) = BLOCKNR + blocknr = mult * ((blocknr + ((tab_response[2] >> CSD_2_CSIZE_L_S) & + CSD_2_CSIZE_L_M)) + 1); + f->Memory_Capacity = (1 << f->READ_BL_LEN) * blocknr; + //// End of Compute Memory Capacity + if (at91_qdmmc_SDCard_SetBusWidth(pMCI_Device) != AT91C_CMD_SEND_OK) + return AT91C_INIT_ERROR; + if (at91_qdmmc_SetBlocklength(1 << f->READ_BL_LEN) != AT91C_CMD_SEND_OK) + return AT91C_INIT_ERROR; + printf("Found SD card %u bytes\n", f->Memory_Capacity); + return (0); +#else return (ENXIO); +#endif } static int From owner-p4-projects@FreeBSD.ORG Wed Sep 13 07:10:53 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 33EDB16A40F; Wed, 13 Sep 2006 07:10:53 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0D80416A403 for ; Wed, 13 Sep 2006 07:10:53 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id BA21243D46 for ; Wed, 13 Sep 2006 07:10:52 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8D7Aqgb057082 for ; Wed, 13 Sep 2006 07:10:52 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8D7AqN6057077 for perforce@freebsd.org; Wed, 13 Sep 2006 07:10:52 GMT (envelope-from imp@freebsd.org) Date: Wed, 13 Sep 2006 07:10:52 GMT Message-Id: <200609130710.k8D7AqN6057077@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 106047 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Sep 2006 07:10:53 -0000 http://perforce.freebsd.org/chv.cgi?CH=106047 Change 106047 by imp@imp_lighthouse on 2006/09/13 07:09:53 Checkpoint again... SD detection should work, but we always fail because the block size computation isn't yet finished. Affected files ... .. //depot/projects/arm/src/sys/arm/at91/at91_qdmmc.c#7 edit Differences ... ==== //depot/projects/arm/src/sys/arm/at91/at91_qdmmc.c#7 (text+ko) ==== @@ -126,7 +126,8 @@ #define AT91_QDMMC_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); static int -at91_qdmmc_SendCommand(device_t dev, uint32_t cmd, uint32_t arg) { +at91_qdmmc_SendCommand(device_t dev, uint32_t cmd, uint32_t arg) +{ struct at91_qdmmc_softc *sc = device_get_softc(dev); uint32_t error; @@ -152,6 +153,33 @@ } static int +at91_qdmmc_SDCard_SendAppCommand(device_t dev, uint32_t cmd, uint32_t arg) +{ + uint32_t status; + struct at91_qdmmc_softc *sc = device_get_softc(dev); + + // Send the CMD55 for application specific command + WR4(sc, MCI_ARGR, sc->cards[0].rca << 16); + WR4(sc, MCI_CMDR, APP_CMD); + + // wait for CMDRDY Status flag to read the response + do + { + status = RD4(sc, MCI_SR); + } while(!(status & MCI_SR_CMDRDY)); + + // if an error occurs + if ((status & MCI_SR_ERROR) != 0 ) + return (status & MCI_SR_ERROR); + + // check if it is a specific command and then send the command + if ((cmd & SDCARD_APP_ALL_CMD) == 0) + return MCI_SR_ERROR; + + return (at91_qdmmc_SendCommand(dev, cmd, arg)); +} + +static int at91_qdmmc_probe(device_t dev) { @@ -160,7 +188,6 @@ return (0); } -#if 0 static int at91_qdmmc_SDCard_GetOCR(device_t dev) { @@ -180,68 +207,115 @@ return (response); } -#endif + +static int +at91_qdmmc_SDCard_GetCID(device_t dev, uint32_t *response) +{ + struct at91_qdmmc_softc *sc = device_get_softc(dev); + + if (at91_qdmmc_SendCommand(dev, ALL_SEND_CID_CMD, AT91C_NO_ARGUMENT)) + return EIO; + response[0] = RD4(sc, MCI_RSPR + 0 * sizeof(response[0])); + response[1] = RD4(sc, MCI_RSPR + 1 * sizeof(response[0])); + response[2] = RD4(sc, MCI_RSPR + 2 * sizeof(response[0])); + response[3] = RD4(sc, MCI_RSPR + 3 * sizeof(response[0])); + return 0; +} + +static int +at91_qdmmc_GetCSD(device_t dev, uint32_t rca, uint32_t *response) +{ + struct at91_qdmmc_softc *sc = device_get_softc(dev); + + if (at91_qdmmc_SendCommand(dev, SEND_CSD_CMD, rca << 16)) + return EIO; + response[0] = RD4(sc, MCI_RSPR + 0 * sizeof(response[0])); + response[1] = RD4(sc, MCI_RSPR + 1 * sizeof(response[0])); + response[2] = RD4(sc, MCI_RSPR + 2 * sizeof(response[0])); + response[3] = RD4(sc, MCI_RSPR + 3 * sizeof(response[0])); + return 0; +} static int at91_qdmmc_sdcard_init(device_t dev) { -#if 0 struct at91_qdmmc_softc *sc = device_get_softc(dev); - unsigned int tab_response[4]; - unsigned int mult,blocknr; + uint32_t *csd; at91_qdmmc_SendCommand(dev, GO_IDLE_STATE_CMD, AT91C_NO_ARGUMENT); if (at91_qdmmc_SDCard_GetOCR(dev) == -1) return ENXIO; - f = pMCI_Device->pMCI_DeviceFeatures; - if (at91_qdmmc_SDCard_GetCID(tab_response) != 0) - return AT91C_INIT_ERROR; - f->Card_Inserted = AT91C_SD_CARD_INSERTED; - if (at91_qdmmc_SendCommand(SET_RELATIVE_ADDR_CMD, 0) != 0) - return AT91C_INIT_ERROR; - f->Relative_Card_Address = (AT91C_BASE_MCI->MCI_RSPR[0] >> 16); - if (at91_qdmmc_GetCSD(f->Relative_Card_Address,tab_response) - != AT91C_CMD_SEND_OK) - return AT91C_INIT_ERROR; - f->READ_BL_LEN = (tab_response[1] >> CSD_1_RD_B_LEN_S) & + csd = &sc->cards[0].CSD[0]; + if (at91_qdmmc_SDCard_GetCID(dev, csd) != 0) + return ENXIO; + if (at91_qdmmc_SendCommand(dev, SET_RELATIVE_ADDR_CMD, 0) != 0) + return ENXIO; + sc->cards[0].rca = RD4(sc, MCI_RSPR) >> 16; + if (at91_qdmmc_GetCSD(dev, sc->cards[0].rca, csd) != 0) + return ENXIO; + printf("Found SD Card - CID = 0x%x%x%x%x\n", + sc->cards[0].CID[0], + sc->cards[0].CID[1], + sc->cards[0].CID[2], + sc->cards[0].CID[3]); + printf("SD: Vendor-ID = 0x%x\n", sc->cards[0].CID[0] >> 24); + printf("SD: OEM-ID = 0x%x\n", (sc->cards[0].CID[0] >> 8) & 0xffff); + sc->cards[0].name[0] = (sc->cards[0].CID[0] >> 0) & 0xff; + sc->cards[0].name[1] = (sc->cards[0].CID[1] >> 24) & 0xff; + sc->cards[0].name[2] = (sc->cards[0].CID[1] >> 16) & 0xff; + sc->cards[0].name[3] = (sc->cards[0].CID[1] >> 8) & 0xff; + sc->cards[0].name[4] = (sc->cards[0].CID[1] >> 0) & 0xff; + sc->cards[0].name[5] = (sc->cards[0].CID[2] >> 24) & 0xff; + sc->cards[0].name[6] = '\0'; + printf("SD: Productname = %s\n", sc->cards[0].name); + printf("SD: Revision = 0x%x\n", (sc->cards[0].CID[2] >> 16) & 0xff); + printf("SD: Serial = 0x%x\n", (sc->cards[0].CID[2] << 16) | + (sc->cards[0].CID[3] >> 16)); + int year = 1997; + year += ((sc->cards[0].CID[3] >> 8) & 0xf); + int month = 0; + month += ((sc->cards[0].CID[3] >> 12) & 0xf); + printf("SD: Manufacturing Date = %i/%i\n", year, month); +#if 0 + f->READ_BL_LEN = (csd[1] >> CSD_1_RD_B_LEN_S) & CSD_1_RD_B_LEN_M; - f->WRITE_BL_LEN = (tab_response[3] >> CSD_3_WBLEN_S) & + f->WRITE_BL_LEN = (csd[3] >> CSD_3_WBLEN_S) & CSD_3_WBLEN_M; - f->Sector_Size = 1 + ((tab_response[2] >> CSD_2_v21_SECT_SIZE_S) & + f->Sector_Size = 1 + ((csd[2] >> CSD_2_v21_SECT_SIZE_S) & CSD_2_v21_SECT_SIZE_M); - f->Read_Partial = (tab_response[1] >> CSD_1_RD_B_PAR_S) & + f->Read_Partial = (csd[1] >> CSD_1_RD_B_PAR_S) & CSD_1_RD_B_PAR_M; - f->Write_Partial = (tab_response[3] >> CSD_3_WBLOCK_P_S) & + f->Write_Partial = (csd[3] >> CSD_3_WBLOCK_P_S) & CSD_3_WBLOCK_P_M; - f->Erase_Block_Enable = (tab_response[2] >> CSD_2_v21_ER_BLEN_EN_S) & + f->Erase_Block_Enable = (csd[2] >> CSD_2_v21_ER_BLEN_EN_S) & CSD_2_v21_ER_BLEN_EN_M; - f->Read_Block_Misalignment = (tab_response[1] >> CSD_1_RD_B_MIS_S) & + f->Read_Block_Misalignment = (csd[1] >> CSD_1_RD_B_MIS_S) & CSD_1_RD_B_MIS_M; - f->Write_Block_Misalignment = (tab_response[1] >> CSD_1_WR_B_MIS_S) & + f->Write_Block_Misalignment = (csd[1] >> CSD_1_WR_B_MIS_S) & CSD_1_WR_B_MIS_M; //// Compute Memory Capacity // compute MULT - mult = 1 << ( ((tab_response[2] >> CSD_2_C_SIZE_M_S) & + uint32_t mult, blocknr; + mult = 1 << ( ((csd[2] >> CSD_2_C_SIZE_M_S) & CSD_2_C_SIZE_M_M) + 2 ); // compute MSB of C_SIZE - blocknr = ((tab_response[1] >> CSD_1_CSIZE_H_S) & + blocknr = ((csd[1] >> CSD_1_CSIZE_H_S) & CSD_1_CSIZE_H_M) << 2; // compute MULT * (LSB of C-SIZE + MSB already computed + 1) = BLOCKNR - blocknr = mult * ((blocknr + ((tab_response[2] >> CSD_2_CSIZE_L_S) & + blocknr = mult * ((blocknr + ((csd[2] >> CSD_2_CSIZE_L_S) & CSD_2_CSIZE_L_M)) + 1); f->Memory_Capacity = (1 << f->READ_BL_LEN) * blocknr; //// End of Compute Memory Capacity - if (at91_qdmmc_SDCard_SetBusWidth(pMCI_Device) != AT91C_CMD_SEND_OK) - return AT91C_INIT_ERROR; + if (at91_qdmmc_SDCard_SetBusWidth(dev)) + return EIO; if (at91_qdmmc_SetBlocklength(1 << f->READ_BL_LEN) != AT91C_CMD_SEND_OK) return AT91C_INIT_ERROR; printf("Found SD card %u bytes\n", f->Memory_Capacity); - return (0); -#else - return (ENXIO); + return 0; #endif + return (EIO); } static int From owner-p4-projects@FreeBSD.ORG Wed Sep 13 07:37:27 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 447FA16A415; Wed, 13 Sep 2006 07:37:27 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EAA4116A407 for ; Wed, 13 Sep 2006 07:37:26 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id A8C6E43D45 for ; Wed, 13 Sep 2006 07:37:26 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8D7bQPE059063 for ; Wed, 13 Sep 2006 07:37:26 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8D7bQrE059060 for perforce@freebsd.org; Wed, 13 Sep 2006 07:37:26 GMT (envelope-from imp@freebsd.org) Date: Wed, 13 Sep 2006 07:37:26 GMT Message-Id: <200609130737.k8D7bQrE059060@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 106049 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Sep 2006 07:37:27 -0000 http://perforce.freebsd.org/chv.cgi?CH=106049 Change 106049 by imp@imp_lighthouse on 2006/09/13 07:36:58 Flesh out more sd support. Maybe this will even work when I get to the office in the moring :-) Affected files ... .. //depot/projects/arm/src/sys/arm/at91/at91_qdmmc.c#8 edit .. //depot/projects/arm/src/sys/arm/at91/at91_qdmmcreg.h#3 edit Differences ... ==== //depot/projects/arm/src/sys/arm/at91/at91_qdmmc.c#8 (text+ko) ==== @@ -236,6 +236,48 @@ return 0; } +static uint32_t +at91_qdmmc_GetStatus(device_t dev, uint32_t rca) +{ + struct at91_qdmmc_softc *sc = device_get_softc(dev); + + if (at91_qdmmc_SendCommand(dev, SEND_STATUS_CMD, rca << 16) == 0) + return (RD4(sc, MCI_RSPR)); + return 0xffffffff; +} + +static int +at91_qdmmc_SetBlocklength(device_t dev, uint32_t length) +{ + return (at91_qdmmc_SendCommand(dev, SET_BLOCKLEN_CMD, length) ); +} + +static int +at91_qdmmc_SDCard_SetBusWidth(device_t dev) +{ + struct at91_qdmmc_softc *sc = device_get_softc(dev); + uint32_t ret_value, rca; + char bus_width; + + rca = sc->cards[0].rca; + do { + ret_value = at91_qdmmc_GetStatus(dev, rca); + } while (ret_value != 0xffffffff && + !(ret_value & AT91C_SR_READY_FOR_DATA)); + + // Select Card + at91_qdmmc_SendCommand(dev, SEL_DESEL_CARD_CMD, rca << 16); + + // XXX hard code 4. + bus_width = AT91C_BUS_WIDTH_4BITS; + + if (at91_qdmmc_SDCard_SendAppCommand(dev, SDCARD_SET_BUS_WIDTH_CMD, + bus_width) != 0) + return EIO; + + return 0; +} + static int at91_qdmmc_sdcard_init(device_t dev) { @@ -278,44 +320,40 @@ int month = 0; month += ((sc->cards[0].CID[3] >> 12) & 0xf); printf("SD: Manufacturing Date = %i/%i\n", year, month); -#if 0 - f->READ_BL_LEN = (csd[1] >> CSD_1_RD_B_LEN_S) & + sc->cards[0].mode = 5 * MCI_MR_CLKDIV | MCI_MR_PWSDIV | + (MCI_MR_PWSDIV << 1 | MCI_MR_PDCMODE); + sc->cards[0].mode = 75 * MCI_MR_CLKDIV | MCI_MR_PWSDIV | + (MCI_MR_PWSDIV << 1); + sc->cards[0].flags = 0; + if (sc->cards[0].CSD[1] & CSD_1_RD_B_PAR_M) + sc->cards[0].flags |= READ_PARTIAL; + if (sc->cards[0].CSD[3] & CSD_3_WBLOCK_P_M) + sc->cards[0].flags |= WRITE_PARTIAL; + sc->cards[0].read_bl = (csd[1] >> CSD_1_RD_B_LEN_S) & CSD_1_RD_B_LEN_M; - f->WRITE_BL_LEN = (csd[3] >> CSD_3_WBLEN_S) & + sc->cards[0].write_bl = (csd[3] >> CSD_3_WBLEN_S) & CSD_3_WBLEN_M; - f->Sector_Size = 1 + ((csd[2] >> CSD_2_v21_SECT_SIZE_S) & + bioq_init(&sc->cards[0].bio_queue); + + sc->cards[0].sector_size = 1 + ((csd[2] >> CSD_2_v21_SECT_SIZE_S) & CSD_2_v21_SECT_SIZE_M); - f->Read_Partial = (csd[1] >> CSD_1_RD_B_PAR_S) & - CSD_1_RD_B_PAR_M; - f->Write_Partial = (csd[3] >> CSD_3_WBLOCK_P_S) & - CSD_3_WBLOCK_P_M; - f->Erase_Block_Enable = (csd[2] >> CSD_2_v21_ER_BLEN_EN_S) & - CSD_2_v21_ER_BLEN_EN_M; - f->Read_Block_Misalignment = (csd[1] >> CSD_1_RD_B_MIS_S) & - CSD_1_RD_B_MIS_M; - f->Write_Block_Misalignment = (csd[1] >> CSD_1_WR_B_MIS_S) & - CSD_1_WR_B_MIS_M; - //// Compute Memory Capacity - // compute MULT - uint32_t mult, blocknr; - mult = 1 << ( ((csd[2] >> CSD_2_C_SIZE_M_S) & - CSD_2_C_SIZE_M_M) + 2 ); - // compute MSB of C_SIZE - blocknr = ((csd[1] >> CSD_1_CSIZE_H_S) & - CSD_1_CSIZE_H_M) << 2; - // compute MULT * (LSB of C-SIZE + MSB already computed + 1) = BLOCKNR - blocknr = mult * ((blocknr + ((csd[2] >> CSD_2_CSIZE_L_S) & - CSD_2_CSIZE_L_M)) + 1); - f->Memory_Capacity = (1 << f->READ_BL_LEN) * blocknr; - //// End of Compute Memory Capacity + printf("SD: Blocksize = %i Bytes\n", sc->cards[0].sector_size); + uint64_t c_size; + uint64_t c_size_mult; + c_size = ((sc->cards[0].CSD[1] & 0x3ff) << 2) | + ((sc->cards[0].CSD[2] >> 30) & 0x3); + printf("SD: c_size = %lld\n", c_size); + c_size_mult = (sc->cards[0].CSD[2] >> 15) & 0x7; + c_size_mult = 1 << (c_size_mult + 2); + printf("SD: c_size_mult = %lld\n", c_size_mult); + sc->cards[0].size = sc->cards[0].sector_size * + (c_size + 1) * c_size_mult; + printf("SD: Size = %lld Bytes\n", sc->cards[0].size); if (at91_qdmmc_SDCard_SetBusWidth(dev)) return EIO; - if (at91_qdmmc_SetBlocklength(1 << f->READ_BL_LEN) != AT91C_CMD_SEND_OK) - return AT91C_INIT_ERROR; - printf("Found SD card %u bytes\n", f->Memory_Capacity); + if (at91_qdmmc_SetBlocklength(dev, sc->cards[0].sector_size) != 0) + return EIO; return 0; -#endif - return (EIO); } static int @@ -439,8 +477,6 @@ sc->cards[card].flags |= WRITE_PARTIAL; sc->cards[card].read_bl = 0; sc->cards[card].write_bl = 0; - sc->cards[card].rca = 0; - bioq_init(&sc->cards[0].bio_queue); } if (sc->nb_cards == 0) ==== //depot/projects/arm/src/sys/arm/at91/at91_qdmmcreg.h#3 (text+ko) ==== @@ -128,4 +128,7 @@ #define AT91C_NO_ARGUMENT 0x0 +#define AT91C_BUS_WIDTH_1BIT 0x00 +#define AT91C_BUS_WIDTH_4BITS 0x02 + #endif /* ARM_AT91_AT91QDMMCREG_H */ From owner-p4-projects@FreeBSD.ORG Wed Sep 13 07:40:40 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9121116A415; Wed, 13 Sep 2006 07:40:40 +0000 (UTC) X-Original-To: perforce@FreeBSD.ORG Delivered-To: perforce@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 68D2716A403; Wed, 13 Sep 2006 07:40:40 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id EBAB743D45; Wed, 13 Sep 2006 07:40:39 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost.village.org [127.0.0.1] (may be forged)) by harmony.bsdimp.com (8.13.4/8.13.4) with ESMTP id k8D7dAHO043815; Wed, 13 Sep 2006 01:39:10 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Wed, 13 Sep 2006 01:39:13 -0600 (MDT) Message-Id: <20060913.013913.-345496520.imp@bsdimp.com> To: piso@FreeBSD.ORG From: "M. Warner Losh" In-Reply-To: <200609121511.k8CFBZcn046592@repoman.freebsd.org> References: <200609121511.k8CFBZcn046592@repoman.freebsd.org> X-Mailer: Mew version 4.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Wed, 13 Sep 2006 01:39:10 -0600 (MDT) Cc: perforce@FreeBSD.ORG Subject: Re: PERFORCE change 106020 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Sep 2006 07:40:40 -0000 In message: <200609121511.k8CFBZcn046592@repoman.freebsd.org> Paolo Pisati writes: : Axe some compatibility code for FreeBSD 5.x. Actually, these axe compat code for 4.x and earlier : Affected files ... : : .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_db.c#9 edit : .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_pptp.c#10 edit : : Differences ... : : ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_db.c#9 (text+ko) ==== : : @@ -2588,11 +2588,7 @@ : /* Firewall include files */ : #include : : -#if __FreeBSD__ < 5 : -#include : -#else : #include : -#endif : #include : #include : : : ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_pptp.c#10 (text+ko) ==== : : @@ -41,11 +41,7 @@ : : /* Includes */ : #ifdef _KERNEL : -#if __FreeBSD__ >= 5 : #include : -#else : -#include : -#endif : #include : #include : #include : From owner-p4-projects@FreeBSD.ORG Wed Sep 13 12:59:19 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7283A16A417; Wed, 13 Sep 2006 12:59:19 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4E1AC16A412 for ; Wed, 13 Sep 2006 12:59:19 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 95EC643D82 for ; Wed, 13 Sep 2006 12:59:10 +0000 (GMT) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8DCxAM2098494 for ; Wed, 13 Sep 2006 12:59:10 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8DCx9Rj098491 for perforce@freebsd.org; Wed, 13 Sep 2006 12:59:09 GMT (envelope-from hselasky@FreeBSD.org) Date: Wed, 13 Sep 2006 12:59:09 GMT Message-Id: <200609131259.k8DCx9Rj098491@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 106054 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Sep 2006 12:59:19 -0000 http://perforce.freebsd.org/chv.cgi?CH=106054 Change 106054 by hselasky@hselasky_mini_itx on 2006/09/13 12:58:58 Make ata-usb more compliant with the BBB standard. Remove the interrupt callback and transfers, hence CBI needs to be handled separately. Fix a small bug where the code is returning from attach instead of "goto detach". Add extra check for softc equal to NULL. Double check that the residue is valid. Affected files ... .. //depot/projects/usb/src/sys/dev/ata/ata-usb.c#5 edit Differences ... ==== //depot/projects/usb/src/sys/dev/ata/ata-usb.c#5 (text) ==== @@ -99,11 +99,14 @@ #define ATAUSB_T_BBB_RESET3 2 #define ATAUSB_T_BBB_COMMAND 3 #define ATAUSB_T_BBB_DATA_READ 4 -#define ATAUSB_T_BBB_DATA_WRITE 5 -#define ATAUSB_T_BBB_STATUS 6 -#define ATAUSB_T_BBB_INTERRUPT 7 -#define ATAUSB_T_BBB_I_CLEAR_STALL 8 -#define ATAUSB_T_MAX 9 +#define ATAUSB_T_BBB_DATA_RD_CS 5 +#define ATAUSB_T_BBB_DATA_WRITE 6 +#define ATAUSB_T_BBB_DATA_WR_CS 7 +#define ATAUSB_T_BBB_STATUS 8 +#define ATAUSB_T_BBB_MAX 9 + +#define ATAUSB_T_MAX ATAUSB_T_BBB_MAX + struct usbd_xfer * xfer[ATAUSB_T_MAX]; caddr_t ata_data; device_t dev; @@ -118,6 +121,7 @@ u_int8_t intr_stalled; u_int8_t maxlun; u_int8_t iface_no; + u_int8_t status_try; }; static const int atausbdebug = 0; @@ -144,22 +148,28 @@ atausb_t_bbb_reset3_callback(struct usbd_xfer *xfer); static void +atausb_t_bbb_data_read_clear_stall_callback(struct usbd_xfer *xfer, + u_int8_t next_xfer); +static void +atausb_t_bbb_data_write_clear_stall_callback(struct usbd_xfer *xfer, + u_int8_t next_xfer); +static void atausb_t_bbb_command_callback(struct usbd_xfer *xfer); static void atausb_t_bbb_data_read_callback(struct usbd_xfer *xfer); static void -atausb_t_bbb_data_write_callback(struct usbd_xfer *xfer); +atausb_t_bbb_data_rd_cs(struct usbd_xfer *xfer); static void -atausb_t_bbb_status_callback(struct usbd_xfer *xfer); +atausb_t_bbb_data_write_callback(struct usbd_xfer *xfer); static void -atausb_t_bbb_interrupt_callback(struct usbd_xfer *xfer); +atausb_t_bbb_data_wr_cs(struct usbd_xfer *xfer); static void -atausb_t_bbb_i_clear_stall_callback(struct usbd_xfer *xfer); +atausb_t_bbb_status_callback(struct usbd_xfer *xfer); static void atausb_tr_error(struct usbd_xfer *xfer); @@ -181,7 +191,7 @@ * USB frontend part */ -struct usbd_config atausb_config[ATAUSB_T_MAX] = { +struct usbd_config atausb_config[ATAUSB_T_BBB_MAX] = { [ATAUSB_T_BBB_RESET1] = { .type = UE_CONTROL, @@ -233,6 +243,16 @@ .timeout = 0, /* overwritten later */ }, + [ATAUSB_T_BBB_DATA_RD_CS] = { + .type = UE_CONTROL, + .endpoint = 0x00, /* Control pipe */ + .direction = -1, + .bufsize = sizeof(usb_device_request_t), + .flags = USBD_USE_DMA, + .callback = &atausb_t_bbb_data_rd_cs, + .timeout = 5000, /* 5 seconds */ + }, + [ATAUSB_T_BBB_DATA_WRITE] = { .type = UE_BULK, .endpoint = -1, /* any */ @@ -243,6 +263,16 @@ .timeout = 0, /* overwritten later */ }, + [ATAUSB_T_BBB_DATA_WR_CS] = { + .type = UE_CONTROL, + .endpoint = 0x00, /* Control pipe */ + .direction = -1, + .bufsize = sizeof(usb_device_request_t), + .flags = USBD_USE_DMA, + .callback = &atausb_t_bbb_data_wr_cs, + .timeout = 5000, /* 5 seconds */ + }, + [ATAUSB_T_BBB_STATUS] = { .type = UE_BULK, .endpoint = -1, /* any */ @@ -252,30 +282,6 @@ .callback = &atausb_t_bbb_status_callback, .timeout = 5000, /* ms */ }, - - /* - * the following endpoints are only - * present on CBI devices: - */ - - [ATAUSB_T_BBB_INTERRUPT] = { - .type = UE_INTERRUPT, - .endpoint = -1, /* any */ - .direction = UE_DIR_IN, - .flags = (USBD_USE_DMA|USBD_SHORT_XFER_OK), - .bufsize = 0, /* use wMaxPacketSize */ - .callback = &atausb_t_bbb_interrupt_callback, - }, - - [ATAUSB_T_BBB_I_CLEAR_STALL] = { - .type = UE_CONTROL, - .endpoint = 0x00, /* Control pipe */ - .direction = -1, - .flags = USBD_USE_DMA, - .bufsize = sizeof(usb_device_request_t), - .callback = &atausb_t_bbb_i_clear_stall_callback, - .timeout = 5000, /* ms */ - }, }; static devclass_t atausb_devclass; @@ -347,6 +353,10 @@ u_int8_t has_intr; int err; + if (sc == NULL) { + return ENOMEM; + } + usbd_set_desc(dev, uaa->device); sc->dev = dev; @@ -400,13 +410,16 @@ device_printf(dev, "using %s over %s\n", subclass, proto); if (strcmp(proto, "Bulk-Only") || (strcmp(subclass, "ATAPI") && strcmp(subclass, "SCSI"))) { - return ENXIO; + goto detach; } err = usbd_transfer_setup(uaa->device, uaa->iface_index, sc->xfer, atausb_config, - has_intr ? ATAUSB_T_MAX : (ATAUSB_T_MAX-2), sc, + ATAUSB_T_BBB_MAX, sc, &(sc->locked_mtx), &(sc->mem_wait)); + /* skip reset first time */ + sc->last_xfer_no = ATAUSB_T_BBB_COMMAND; + if (err) { device_printf(sc->dev, "could not setup required " "transfers, %s\n", usbd_errstr(err)); @@ -504,13 +517,10 @@ mtx_assert(&(sc->locked_mtx), MA_OWNED); - if (sc->xfer[ATAUSB_T_BBB_INTERRUPT]) { - /* start the interrupt pipe, in case it stopped */ - usbd_transfer_start(sc->xfer[ATAUSB_T_BBB_INTERRUPT]); - } - +#if 0 __callout_reset(&(sc->watchdog), hz, &atausb_watchdog, sc); +#endif mtx_unlock(&(sc->locked_mtx)); return; @@ -519,9 +529,9 @@ static void atausb_transfer_start(struct atausb_softc *sc, u_int8_t xfer_no) { -#if 0 - device_printf(sc->dev, "BBB transfer %d\n", xfer_no); -#endif + if (atausbdebug) { + device_printf(sc->dev, "BBB transfer %d\n", xfer_no); + } sc->last_xfer_no = xfer_no; usbd_transfer_start(sc->xfer[xfer_no]); return; @@ -550,7 +560,8 @@ req.bmRequestType = UT_WRITE_CLASS_INTERFACE; req.bRequest = 0xff; /* bulk-only reset */ USETW(req.wValue, 0); - USETW(req.wIndex, sc->iface_no); + req.wIndex[0] = sc->iface_no; + req.wIndex[1] = 0; USETW(req.wLength, 0); usbd_copy_in(&(xfer->buf_data), 0, &req, sizeof(req)); @@ -562,6 +573,21 @@ static void atausb_t_bbb_reset2_callback(struct usbd_xfer *xfer) { + atausb_t_bbb_data_read_clear_stall_callback(xfer, ATAUSB_T_BBB_RESET3); + return; +} + +static void +atausb_t_bbb_reset3_callback(struct usbd_xfer *xfer) +{ + atausb_t_bbb_data_write_clear_stall_callback(xfer, ATAUSB_T_BBB_COMMAND); + return; +} + +static void +atausb_t_bbb_data_read_clear_stall_callback(struct usbd_xfer *xfer, + u_int8_t next_xfer) +{ struct atausb_softc *sc = xfer->priv_sc; USBD_CHECK_STATUS(xfer); @@ -571,7 +597,7 @@ return; tr_transferred: - atausb_transfer_start(sc, ATAUSB_T_BBB_RESET3); + atausb_transfer_start(sc, next_xfer); return; tr_setup: @@ -581,7 +607,8 @@ } static void -atausb_t_bbb_reset3_callback(struct usbd_xfer *xfer) +atausb_t_bbb_data_write_clear_stall_callback(struct usbd_xfer *xfer, + u_int8_t next_xfer) { struct atausb_softc *sc = xfer->priv_sc; @@ -592,7 +619,7 @@ return; tr_transferred: - atausb_transfer_start(sc, ATAUSB_T_BBB_COMMAND); + atausb_transfer_start(sc, next_xfer); return; tr_setup: @@ -625,6 +652,7 @@ tr_setup: sc->reset_count = 0; + sc->status_try = 0; if (request) { ch = device_get_softc(request->parent); @@ -658,7 +686,11 @@ USBD_CHECK_STATUS(xfer); tr_error: - atausb_tr_error(xfer); + if (xfer->error == USBD_CANCELLED) { + atausb_tr_error(xfer); + } else { + atausb_transfer_start(sc, ATAUSB_T_BBB_DATA_RD_CS); + } return; tr_transferred: @@ -699,6 +731,13 @@ } static void +atausb_t_bbb_data_rd_cs(struct usbd_xfer *xfer) +{ + atausb_t_bbb_data_read_clear_stall_callback(xfer, ATAUSB_T_BBB_STATUS); + return; +} + +static void atausb_t_bbb_data_write_callback(struct usbd_xfer *xfer) { struct atausb_softc *sc = xfer->priv_sc; @@ -707,7 +746,11 @@ USBD_CHECK_STATUS(xfer); tr_error: - atausb_tr_error(xfer); + if (xfer->error == USBD_CANCELLED) { + atausb_tr_error(xfer); + } else { + atausb_transfer_start(sc, ATAUSB_T_BBB_DATA_WR_CS); + } return; tr_transferred: @@ -743,6 +786,13 @@ } static void +atausb_t_bbb_data_wr_cs(struct usbd_xfer *xfer) +{ + atausb_t_bbb_data_write_clear_stall_callback(xfer, ATAUSB_T_BBB_STATUS); + return; +} + +static void atausb_t_bbb_status_callback(struct usbd_xfer *xfer) { struct atausb_softc *sc = xfer->priv_sc; @@ -752,7 +802,13 @@ USBD_CHECK_STATUS(xfer); tr_error: - atausb_tr_error(xfer); + if ((xfer->error == USBD_CANCELLED) || + (sc->status_try)) { + atausb_tr_error(xfer); + } else { + sc->status_try = 1; + atausb_transfer_start(sc, ATAUSB_T_BBB_DATA_RD_CS); + } return; tr_transferred: @@ -773,6 +829,15 @@ residue = (request->bytecount - request->donecount); } + if (residue > request->bytecount) { + if (atausbdebug) { + device_printf(sc->dev, "truncating residue from %d " + "to %d bytes\n", residue, + request->bytecount); + } + residue = request->bytecount; + } + /* check CSW and handle eventual error */ if (UGETDW(sc->csw.signature) != CSWSIGNATURE) { if (atausbdebug) { @@ -837,68 +902,6 @@ } static void -atausb_t_bbb_interrupt_callback(struct usbd_xfer *xfer) -{ - struct atausb_softc *sc = xfer->priv_sc; - - USBD_CHECK_STATUS(xfer); - - tr_transferred: - if (atausbdebug) { - device_printf(sc->dev, "Interrupt transfer " - "complete, %d bytes\n", xfer->actlen); - } - - tr_setup: - if (sc->intr_stalled) { - usbd_transfer_start(sc->xfer[ATAUSB_T_BBB_I_CLEAR_STALL]); - } else { - usbd_start_hardware(xfer); - } - return; - - tr_error: - if (xfer->error != USBD_CANCELLED) { - /* try to clear stall first */ - sc->intr_stalled = 1; - usbd_transfer_start(sc->xfer[ATAUSB_T_BBB_I_CLEAR_STALL]); - } - return; -} - -static void -atausb_t_bbb_i_clear_stall_callback(struct usbd_xfer *xfer) -{ - struct atausb_softc *sc = xfer->priv_sc; - struct usbd_xfer *other_xfer = sc->xfer[ATAUSB_T_BBB_INTERRUPT]; - - USBD_CHECK_STATUS(xfer); - - tr_setup: - /* start clear stall */ - usbd_clear_stall_tr_setup(xfer, other_xfer); - return; - - tr_transferred: - usbd_clear_stall_tr_transferred(xfer, other_xfer); - - sc->intr_stalled = 0; - usbd_transfer_start(other_xfer); - return; - - tr_error: - /* bomb out (wait for watchdog to start - * interrupt transfer again) - */ - sc->intr_stalled = 0; - - if (xfer->error != USBD_CANCELLED) { - device_printf(sc->dev, "Interrupt transfer stopped!\n"); - } - return; -} - -static void atausb_tr_error(struct usbd_xfer *xfer) { struct atausb_softc *sc = xfer->priv_sc; From owner-p4-projects@FreeBSD.ORG Wed Sep 13 13:37:01 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6AC5616A47B; Wed, 13 Sep 2006 13:37:01 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4470916A403; Wed, 13 Sep 2006 13:37:01 +0000 (UTC) (envelope-from flag@longino.wired.org) Received: from mail.oltrelinux.com (krisma.oltrelinux.com [194.242.226.43]) by mx1.FreeBSD.org (Postfix) with ESMTP id C980643D64; Wed, 13 Sep 2006 13:37:00 +0000 (GMT) (envelope-from flag@longino.wired.org) Received: from longino.wired.org (unknown [131.114.190.222]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.oltrelinux.com (Postfix) with ESMTP id 85B3811B249; Wed, 13 Sep 2006 15:36:52 +0200 (CEST) Received: (from flag@localhost) by longino.wired.org (8.13.8/8.13.8/Submit) id k8DDdHbt001328; Wed, 13 Sep 2006 15:39:17 +0200 (CEST) (envelope-from flag) Date: Wed, 13 Sep 2006 15:39:17 +0200 From: Paolo Pisati To: "M. Warner Losh" Message-ID: <20060913133917.GA1296@tin.it> References: <200609121511.k8CFBZcn046592@repoman.freebsd.org> <20060913.013913.-345496520.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060913.013913.-345496520.imp@bsdimp.com> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at krisma.oltrelinux.com Cc: perforce@freebsd.org, piso@freebsd.org Subject: Re: PERFORCE change 106020 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Sep 2006 13:37:01 -0000 On Wed, Sep 13, 2006 at 01:39:13AM -0600, M. Warner Losh wrote: > In message: <200609121511.k8CFBZcn046592@repoman.freebsd.org> > Paolo Pisati writes: > : Axe some compatibility code for FreeBSD 5.x. > > Actually, these axe compat code for 4.x and earlier right, sorry. bye -- Paolo Piso's first law: nothing works as expected! From owner-p4-projects@FreeBSD.ORG Wed Sep 13 14:01:31 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4B72C16A412; Wed, 13 Sep 2006 14:01:31 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0DDD016A403 for ; Wed, 13 Sep 2006 14:01:31 +0000 (UTC) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id D02F043D49 for ; Wed, 13 Sep 2006 14:01:30 +0000 (GMT) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8DE1UOF004464 for ; Wed, 13 Sep 2006 14:01:30 GMT (envelope-from piso@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8DE1USP004461 for perforce@freebsd.org; Wed, 13 Sep 2006 14:01:30 GMT (envelope-from piso@freebsd.org) Date: Wed, 13 Sep 2006 14:01:30 GMT Message-Id: <200609131401.k8DE1USP004461@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to piso@freebsd.org using -f From: Paolo Pisati To: Perforce Change Reviews Cc: Subject: PERFORCE change 106057 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Sep 2006 14:01:31 -0000 http://perforce.freebsd.org/chv.cgi?CH=106057 Change 106057 by piso@piso_longino on 2006/09/13 14:00:38 Turn some empty functions into empty defines: less space wasted. Affected files ... .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_mod.c#21 edit Differences ... ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_mod.c#21 (text+ko) ==== @@ -117,47 +117,15 @@ } #else - #define LIBALIAS_LOCK_INIT() ; #define LIBALIAS_LOCK_DESTROY() ; #define LIBALIAS_WLOCK_ASSERT() ; - -static __inline void -LIBALIAS_RLOCK(void) -{ - ; -} - -static __inline void -LIBALIAS_RUNLOCK(void) -{ - ; -} - -static __inline void -LIBALIAS_WLOCK(void) -{ - ; -} - -static __inline void -LIBALIAS_WUNLOCK(void) -{ - ; -} - -static void -_handler_chain_init(void) -{ - ; -} - -static void -_handler_chain_destroy(void) -{ - ; -} - +#define LIBALIAS_RLOCK() ; +#define LIBALIAS_RUNLOCK() ; +#define LIBALIAS_WLOCK() ; +#define LIBALIAS_WUNLOCK() ; +#define _handler_chain_init() ; +#define _handler_chain_destroy() ; #endif void From owner-p4-projects@FreeBSD.ORG Wed Sep 13 14:07:40 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4249B16A416; Wed, 13 Sep 2006 14:07:40 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1C44016A407 for ; Wed, 13 Sep 2006 14:07:40 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id AA57A43D46 for ; Wed, 13 Sep 2006 14:07:39 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8DE7d8T005900 for ; Wed, 13 Sep 2006 14:07:39 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8DE7d7i005897 for perforce@freebsd.org; Wed, 13 Sep 2006 14:07:39 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Wed, 13 Sep 2006 14:07:39 GMT Message-Id: <200609131407.k8DE7d7i005897@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 106058 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Sep 2006 14:07:40 -0000 http://perforce.freebsd.org/chv.cgi?CH=106058 Change 106058 by rwatson@rwatson_peppercorn on 2006/09/13 14:07:12 Annotate that there's some functional duplication between the MAC system checks and privilege checks, so we might want to do some pruning. Affected files ... .. //depot/projects/trustedbsd/priv/sys/security/mac/mac_system.c#3 edit Differences ... ==== //depot/projects/trustedbsd/priv/sys/security/mac/mac_system.c#3 (text+ko) ==== @@ -59,6 +59,12 @@ &mac_enforce_system, 0, "Enforce MAC policy on system operations"); TUNABLE_INT("security.mac.enforce_system", &mac_enforce_system); +/* + * XXXRW: Some of these checks now duplicate privilege checks. However, + * others provide additional security context that may be useful to policies. + * We need to review these and remove ones that are pure duplicates. + */ + int mac_check_kenv_dump(struct ucred *cred) { From owner-p4-projects@FreeBSD.ORG Wed Sep 13 14:12:47 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0E5E316A47C; Wed, 13 Sep 2006 14:12:47 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C352C16A416 for ; Wed, 13 Sep 2006 14:12:46 +0000 (UTC) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7B70A43D49 for ; Wed, 13 Sep 2006 14:12:46 +0000 (GMT) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8DECkqC006188 for ; Wed, 13 Sep 2006 14:12:46 GMT (envelope-from piso@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8DECkTZ006185 for perforce@freebsd.org; Wed, 13 Sep 2006 14:12:46 GMT (envelope-from piso@freebsd.org) Date: Wed, 13 Sep 2006 14:12:46 GMT Message-Id: <200609131412.k8DECkTZ006185@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to piso@freebsd.org using -f From: Paolo Pisati To: Perforce Change Reviews Cc: Subject: PERFORCE change 106059 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Sep 2006 14:12:47 -0000 http://perforce.freebsd.org/chv.cgi?CH=106059 Change 106059 by piso@piso_longino on 2006/09/13 14:11:56 One modules.inc is enough: use sys/modules/libalias/modules/modules.inc for userland libalias too. Affected files ... .. //depot/projects/soc2005/libalias/lib/libalias/modules/Makefile#3 edit Differences ... ==== //depot/projects/soc2005/libalias/lib/libalias/modules/Makefile#3 (text+ko) ==== @@ -24,7 +24,7 @@ # # $FreeBSD$ -.include "modules.inc" +.include "../../../sys/modules/libalias/modules/modules.inc" SUBDIR= ${MODULES} From owner-p4-projects@FreeBSD.ORG Wed Sep 13 14:42:24 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6A19516A415; Wed, 13 Sep 2006 14:42:24 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4322F16A407 for ; Wed, 13 Sep 2006 14:42:24 +0000 (UTC) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id F0C4143D46 for ; Wed, 13 Sep 2006 14:42:23 +0000 (GMT) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8DEgNd5007566 for ; Wed, 13 Sep 2006 14:42:23 GMT (envelope-from piso@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8DEgNjL007563 for perforce@freebsd.org; Wed, 13 Sep 2006 14:42:23 GMT (envelope-from piso@freebsd.org) Date: Wed, 13 Sep 2006 14:42:23 GMT Message-Id: <200609131442.k8DEgNjL007563@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to piso@freebsd.org using -f From: Paolo Pisati To: Perforce Change Reviews Cc: Subject: PERFORCE change 106060 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Sep 2006 14:42:24 -0000 http://perforce.freebsd.org/chv.cgi?CH=106060 Change 106060 by piso@piso_longino on 2006/09/13 14:42:14 bsd.own.mk is not needed here. Affected files ... .. //depot/projects/soc2005/libalias/sys/modules/libalias/modules/modules.inc#3 edit Differences ... ==== //depot/projects/soc2005/libalias/sys/modules/libalias/modules/modules.inc#3 (text+ko) ==== @@ -1,7 +1,5 @@ # $FreeBSD$ -.include - MODULES = MODULES += cuseeme MODULES += dummy From owner-p4-projects@FreeBSD.ORG Wed Sep 13 15:51:06 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B2C7316A47B; Wed, 13 Sep 2006 15:51:05 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6D09D16A51F for ; Wed, 13 Sep 2006 15:51:05 +0000 (UTC) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5B6D643D5D for ; Wed, 13 Sep 2006 15:50:50 +0000 (GMT) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8DFooh1013230 for ; Wed, 13 Sep 2006 15:50:50 GMT (envelope-from piso@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8DFonap013227 for perforce@freebsd.org; Wed, 13 Sep 2006 15:50:49 GMT (envelope-from piso@freebsd.org) Date: Wed, 13 Sep 2006 15:50:49 GMT Message-Id: <200609131550.k8DFonap013227@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to piso@freebsd.org using -f From: Paolo Pisati To: Perforce Change Reviews Cc: Subject: PERFORCE change 106062 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Sep 2006 15:51:06 -0000 http://perforce.freebsd.org/chv.cgi?CH=106062 Change 106062 by piso@piso_longino on 2006/09/13 15:50:34 -Trim BSD license from Makefile&c. -Add the $FreeBSD$ tag where missing. Affected files ... .. //depot/projects/soc2005/libalias/lib/libalias/modules/Makefile#4 edit .. //depot/projects/soc2005/libalias/lib/libalias/modules/Makefile.inc#3 edit .. //depot/projects/soc2005/libalias/lib/libalias/modules/cuseeme/Makefile#3 edit .. //depot/projects/soc2005/libalias/lib/libalias/modules/dummy/Makefile#3 edit .. //depot/projects/soc2005/libalias/lib/libalias/modules/ftp/Makefile#3 edit .. //depot/projects/soc2005/libalias/lib/libalias/modules/irc/Makefile#3 edit .. //depot/projects/soc2005/libalias/lib/libalias/modules/nbt/Makefile#3 edit .. //depot/projects/soc2005/libalias/lib/libalias/modules/pptp/Makefile#3 edit .. //depot/projects/soc2005/libalias/lib/libalias/modules/skinny/Makefile#3 edit .. //depot/projects/soc2005/libalias/lib/libalias/modules/smedia/Makefile#3 edit .. //depot/projects/soc2005/libalias/sys/modules/libalias/Makefile#7 edit .. //depot/projects/soc2005/libalias/sys/modules/libalias/libalias/Makefile#8 edit .. //depot/projects/soc2005/libalias/sys/modules/libalias/modules/Makefile#3 edit .. //depot/projects/soc2005/libalias/sys/modules/libalias/modules/Makefile.inc#3 edit .. //depot/projects/soc2005/libalias/sys/modules/libalias/modules/cuseeme/Makefile#2 edit .. //depot/projects/soc2005/libalias/sys/modules/libalias/modules/dummy/Makefile#2 edit .. //depot/projects/soc2005/libalias/sys/modules/libalias/modules/ftp/Makefile#2 edit .. //depot/projects/soc2005/libalias/sys/modules/libalias/modules/irc/Makefile#2 edit .. //depot/projects/soc2005/libalias/sys/modules/libalias/modules/modules.inc#4 edit .. //depot/projects/soc2005/libalias/sys/modules/libalias/modules/nbt/Makefile#2 edit .. //depot/projects/soc2005/libalias/sys/modules/libalias/modules/pptp/Makefile#2 edit .. //depot/projects/soc2005/libalias/sys/modules/libalias/modules/skinny/Makefile#2 edit .. //depot/projects/soc2005/libalias/sys/modules/libalias/modules/smedia/Makefile#2 edit Differences ... ==== //depot/projects/soc2005/libalias/lib/libalias/modules/Makefile#4 (text+ko) ==== @@ -1,27 +1,3 @@ -# Copyright 2006 Paolo Pisati -# All rights reserved. -# -# 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. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. -# # $FreeBSD$ .include "../../../sys/modules/libalias/modules/modules.inc" ==== //depot/projects/soc2005/libalias/lib/libalias/modules/Makefile.inc#3 (text+ko) ==== @@ -1,3 +1,5 @@ +# $FreeBSD$ + .PATH: ${.CURDIR}/../../../../sys/netinet/libalias SHLIBDIR?= /lib ==== //depot/projects/soc2005/libalias/lib/libalias/modules/cuseeme/Makefile#3 (text+ko) ==== @@ -1,3 +1,5 @@ +# $FreeBSD$ + LIB= alias_cuseeme SRCS= alias_cuseeme.c ==== //depot/projects/soc2005/libalias/lib/libalias/modules/dummy/Makefile#3 (text+ko) ==== @@ -1,3 +1,5 @@ +# $FreeBSD$ + LIB= alias_dummy SRCS= alias_dummy.c ==== //depot/projects/soc2005/libalias/lib/libalias/modules/ftp/Makefile#3 (text+ko) ==== @@ -1,3 +1,5 @@ +# $FreeBSD$ + LIB= alias_ftp SRCS= alias_ftp.c ==== //depot/projects/soc2005/libalias/lib/libalias/modules/irc/Makefile#3 (text+ko) ==== @@ -1,3 +1,5 @@ +# $FreeBSD$ + LIB= alias_irc SRCS= alias_irc.c ==== //depot/projects/soc2005/libalias/lib/libalias/modules/nbt/Makefile#3 (text+ko) ==== @@ -1,3 +1,5 @@ +# $FreeBSD$ + LIB= alias_nbt SRCS= alias_nbt.c ==== //depot/projects/soc2005/libalias/lib/libalias/modules/pptp/Makefile#3 (text+ko) ==== @@ -1,3 +1,5 @@ +# $FreeBSD$ + LIB= alias_pptp SRCS= alias_pptp.c ==== //depot/projects/soc2005/libalias/lib/libalias/modules/skinny/Makefile#3 (text+ko) ==== @@ -1,3 +1,5 @@ +# $FreeBSD$ + LIB= alias_skinny SRCS= alias_skinny.c ==== //depot/projects/soc2005/libalias/lib/libalias/modules/smedia/Makefile#3 (text+ko) ==== @@ -1,3 +1,5 @@ +# $FreeBSD$ + LIB= alias_smedia SRCS= alias_smedia.c ==== //depot/projects/soc2005/libalias/sys/modules/libalias/Makefile#7 (text+ko) ==== @@ -1,27 +1,3 @@ -# Copyright 2006 Paolo Pisati -# All rights reserved. -# -# 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. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. -# # $FreeBSD$ SUBDIR= libalias modules ==== //depot/projects/soc2005/libalias/sys/modules/libalias/libalias/Makefile#8 (text+ko) ==== @@ -1,3 +1,5 @@ +# $FreeBSD$ + .PATH: ${.CURDIR}/../../../netinet/libalias KMOD= libalias ==== //depot/projects/soc2005/libalias/sys/modules/libalias/modules/Makefile#3 (text+ko) ==== @@ -1,27 +1,3 @@ -# Copyright 2006 Paolo Pisati -# All rights reserved. -# -# 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. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. -# # $FreeBSD$ .include "modules.inc" ==== //depot/projects/soc2005/libalias/sys/modules/libalias/modules/Makefile.inc#3 (text+ko) ==== @@ -1,1 +1,3 @@ +# $FreeBSD$ + .PATH: ${.CURDIR}/../../../../netinet/libalias ==== //depot/projects/soc2005/libalias/sys/modules/libalias/modules/cuseeme/Makefile#2 (text+ko) ==== @@ -1,3 +1,5 @@ +# $FreeBSD$ + KMOD= alias_cuseeme SRCS= alias_cuseeme.c ==== //depot/projects/soc2005/libalias/sys/modules/libalias/modules/dummy/Makefile#2 (text+ko) ==== @@ -1,3 +1,5 @@ +# $FreeBSD$ + KMOD= alias_dummy SRCS= alias_dummy.c ==== //depot/projects/soc2005/libalias/sys/modules/libalias/modules/ftp/Makefile#2 (text+ko) ==== @@ -1,3 +1,5 @@ +# $FreeBSD$ + KMOD= alias_ftp SRCS= alias_ftp.c ==== //depot/projects/soc2005/libalias/sys/modules/libalias/modules/irc/Makefile#2 (text+ko) ==== @@ -1,3 +1,5 @@ +# $FreeBSD$ + KMOD= alias_irc SRCS= alias_irc.c ==== //depot/projects/soc2005/libalias/sys/modules/libalias/modules/modules.inc#4 (text+ko) ==== ==== //depot/projects/soc2005/libalias/sys/modules/libalias/modules/nbt/Makefile#2 (text+ko) ==== @@ -1,3 +1,5 @@ +# $FreeBSD$ + KMOD= alias_nbt SRCS= alias_nbt.c ==== //depot/projects/soc2005/libalias/sys/modules/libalias/modules/pptp/Makefile#2 (text+ko) ==== @@ -1,3 +1,5 @@ +# $FreeBSD$ + KMOD= alias_pptp SRCS= alias_pptp.c ==== //depot/projects/soc2005/libalias/sys/modules/libalias/modules/skinny/Makefile#2 (text+ko) ==== @@ -1,3 +1,5 @@ +# $FreeBSD$ + KMOD= alias_skinny SRCS= alias_skinny.c ==== //depot/projects/soc2005/libalias/sys/modules/libalias/modules/smedia/Makefile#2 (text+ko) ==== @@ -1,3 +1,5 @@ +# $FreeBSD$ + KMOD= alias_smedia SRCS= alias_smedia.c From owner-p4-projects@FreeBSD.ORG Wed Sep 13 15:58:00 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9499216A416; Wed, 13 Sep 2006 15:58:00 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 58DF116A412 for ; Wed, 13 Sep 2006 15:58:00 +0000 (UTC) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 11BFD43D45 for ; Wed, 13 Sep 2006 15:58:00 +0000 (GMT) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8DFvxex013636 for ; Wed, 13 Sep 2006 15:57:59 GMT (envelope-from piso@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8DFvx9M013633 for perforce@freebsd.org; Wed, 13 Sep 2006 15:57:59 GMT (envelope-from piso@freebsd.org) Date: Wed, 13 Sep 2006 15:57:59 GMT Message-Id: <200609131557.k8DFvx9M013633@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to piso@freebsd.org using -f From: Paolo Pisati To: Perforce Change Reviews Cc: Subject: PERFORCE change 106064 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Sep 2006 15:58:00 -0000 http://perforce.freebsd.org/chv.cgi?CH=106064 Change 106064 by piso@piso_longino on 2006/09/13 15:57:11 Not needed anymore. Affected files ... .. //depot/projects/soc2005/libalias/lib/libalias/modules/modules.inc#3 delete Differences ... From owner-p4-projects@FreeBSD.ORG Wed Sep 13 16:53:11 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 673E216A618; Wed, 13 Sep 2006 16:53:11 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 24E2C16A558 for ; Wed, 13 Sep 2006 16:53:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7292443D70 for ; Wed, 13 Sep 2006 16:53:10 +0000 (GMT) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8DGrABd027365 for ; Wed, 13 Sep 2006 16:53:10 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8DGrAXg027362 for perforce@freebsd.org; Wed, 13 Sep 2006 16:53:10 GMT (envelope-from hselasky@FreeBSD.org) Date: Wed, 13 Sep 2006 16:53:10 GMT Message-Id: <200609131653.k8DGrAXg027362@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 106069 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Sep 2006 16:53:11 -0000 http://perforce.freebsd.org/chv.cgi?CH=106069 Change 106069 by hselasky@hselasky_mini_itx on 2006/09/13 16:52:14 Factorize the clear stall code. Add missing "_callout" to two function names. Affected files ... .. //depot/projects/usb/src/sys/dev/ata/ata-usb.c#6 edit Differences ... ==== //depot/projects/usb/src/sys/dev/ata/ata-usb.c#6 (text) ==== @@ -148,25 +148,23 @@ atausb_t_bbb_reset3_callback(struct usbd_xfer *xfer); static void -atausb_t_bbb_data_read_clear_stall_callback(struct usbd_xfer *xfer, - u_int8_t next_xfer); +atausb_t_bbb_data_clear_stall_callback(struct usbd_xfer *xfer, + u_int8_t next_xfer, + u_int8_t stall_xfer); static void -atausb_t_bbb_data_write_clear_stall_callback(struct usbd_xfer *xfer, - u_int8_t next_xfer); -static void atausb_t_bbb_command_callback(struct usbd_xfer *xfer); static void atausb_t_bbb_data_read_callback(struct usbd_xfer *xfer); static void -atausb_t_bbb_data_rd_cs(struct usbd_xfer *xfer); +atausb_t_bbb_data_rd_cs_callback(struct usbd_xfer *xfer); static void atausb_t_bbb_data_write_callback(struct usbd_xfer *xfer); static void -atausb_t_bbb_data_wr_cs(struct usbd_xfer *xfer); +atausb_t_bbb_data_wr_cs_callback(struct usbd_xfer *xfer); static void atausb_t_bbb_status_callback(struct usbd_xfer *xfer); @@ -249,7 +247,7 @@ .direction = -1, .bufsize = sizeof(usb_device_request_t), .flags = USBD_USE_DMA, - .callback = &atausb_t_bbb_data_rd_cs, + .callback = &atausb_t_bbb_data_rd_cs_callback, .timeout = 5000, /* 5 seconds */ }, @@ -269,7 +267,7 @@ .direction = -1, .bufsize = sizeof(usb_device_request_t), .flags = USBD_USE_DMA, - .callback = &atausb_t_bbb_data_wr_cs, + .callback = &atausb_t_bbb_data_wr_cs_callback, .timeout = 5000, /* 5 seconds */ }, @@ -573,20 +571,23 @@ static void atausb_t_bbb_reset2_callback(struct usbd_xfer *xfer) { - atausb_t_bbb_data_read_clear_stall_callback(xfer, ATAUSB_T_BBB_RESET3); + atausb_t_bbb_data_clear_stall_callback(xfer, ATAUSB_T_BBB_RESET3, + ATAUSB_T_BBB_DATA_READ); return; } static void atausb_t_bbb_reset3_callback(struct usbd_xfer *xfer) { - atausb_t_bbb_data_write_clear_stall_callback(xfer, ATAUSB_T_BBB_COMMAND); + atausb_t_bbb_data_clear_stall_callback(xfer, ATAUSB_T_BBB_COMMAND, + ATAUSB_T_BBB_DATA_WRITE); return; } static void -atausb_t_bbb_data_read_clear_stall_callback(struct usbd_xfer *xfer, - u_int8_t next_xfer) +atausb_t_bbb_data_clear_stall_callback(struct usbd_xfer *xfer, + u_int8_t next_xfer, + u_int8_t stall_xfer) { struct atausb_softc *sc = xfer->priv_sc; @@ -601,34 +602,12 @@ return; tr_setup: - usbd_clear_stall_tr_setup(xfer, sc->xfer[ATAUSB_T_BBB_DATA_READ]); - usbd_clear_stall_tr_transferred(xfer, sc->xfer[ATAUSB_T_BBB_DATA_READ]); + usbd_clear_stall_tr_setup(xfer, sc->xfer[stall_xfer]); + usbd_clear_stall_tr_transferred(xfer, sc->xfer[stall_xfer]); return; } static void -atausb_t_bbb_data_write_clear_stall_callback(struct usbd_xfer *xfer, - u_int8_t next_xfer) -{ - struct atausb_softc *sc = xfer->priv_sc; - - USBD_CHECK_STATUS(xfer); - - tr_error: - atausb_tr_error(xfer); - return; - - tr_transferred: - atausb_transfer_start(sc, next_xfer); - return; - - tr_setup: - usbd_clear_stall_tr_setup(xfer, sc->xfer[ATAUSB_T_BBB_DATA_WRITE]); - usbd_clear_stall_tr_transferred(xfer, sc->xfer[ATAUSB_T_BBB_DATA_WRITE]); - return; -} - -static void atausb_t_bbb_command_callback(struct usbd_xfer *xfer) { struct atausb_softc *sc = xfer->priv_sc; @@ -731,9 +710,10 @@ } static void -atausb_t_bbb_data_rd_cs(struct usbd_xfer *xfer) +atausb_t_bbb_data_rd_cs_callback(struct usbd_xfer *xfer) { - atausb_t_bbb_data_read_clear_stall_callback(xfer, ATAUSB_T_BBB_STATUS); + atausb_t_bbb_data_clear_stall_callback(xfer, ATAUSB_T_BBB_STATUS, + ATAUSB_T_BBB_DATA_READ); return; } @@ -786,10 +766,11 @@ } static void -atausb_t_bbb_data_wr_cs(struct usbd_xfer *xfer) +atausb_t_bbb_data_wr_cs_callback(struct usbd_xfer *xfer) { - atausb_t_bbb_data_write_clear_stall_callback(xfer, ATAUSB_T_BBB_STATUS); - return; + atausb_t_bbb_data_clear_stall_callback(xfer, ATAUSB_T_BBB_STATUS, + ATAUSB_T_BBB_DATA_WRITE); + return; } static void From owner-p4-projects@FreeBSD.ORG Wed Sep 13 16:58:18 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4293116A412; Wed, 13 Sep 2006 16:58:18 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1D5C016A403 for ; Wed, 13 Sep 2006 16:58:18 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 699A243D46 for ; Wed, 13 Sep 2006 16:58:17 +0000 (GMT) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8DGwH3L027621 for ; Wed, 13 Sep 2006 16:58:17 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8DGwH3n027618 for perforce@freebsd.org; Wed, 13 Sep 2006 16:58:17 GMT (envelope-from hselasky@FreeBSD.org) Date: Wed, 13 Sep 2006 16:58:17 GMT Message-Id: <200609131658.k8DGwH3n027618@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 106070 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Sep 2006 16:58:18 -0000 http://perforce.freebsd.org/chv.cgi?CH=106070 Change 106070 by hselasky@hselasky_mini_itx on 2006/09/13 16:58:00 Finished reworking "umass". There are lots of changes again. Please test! Affected files ... .. //depot/projects/usb/src/sys/dev/usb/umass.c#5 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb/umass.c#5 (text+ko) ==== @@ -1,0 +1,3219 @@ +/*- + * Copyright (c) 1999 MAEKAWA Masahide , + * Nick Hibma + * All rights reserved. + * + * 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. + * + * $FreeBSD: src/sys/dev/usb/umass.c,v 1.135 2006/03/17 18:16:22 iedowse Exp $ + * $NetBSD: umass.c,v 1.28 2000/04/02 23:46:53 augustss Exp $ + */ + +/* Also already merged from NetBSD: + * $NetBSD: umass.c,v 1.67 2001/11/25 19:05:22 augustss Exp $ + * $NetBSD: umass.c,v 1.90 2002/11/04 19:17:33 pooka Exp $ + * $NetBSD: umass.c,v 1.108 2003/11/07 17:03:25 wiz Exp $ + * $NetBSD: umass.c,v 1.109 2003/12/04 13:57:31 keihan Exp $ + */ + +/* + * Universal Serial Bus Mass Storage Class specs: + * http://www.usb.org/developers/devclass_docs/usb_msc_overview_1.2.pdf + * http://www.usb.org/developers/devclass_docs/usbmassbulk_10.pdf + * http://www.usb.org/developers/devclass_docs/usb_msc_cbi_1.1.pdf + * http://www.usb.org/developers/devclass_docs/usbmass-ufi10.pdf + */ + +/* + * Ported to NetBSD by Lennart Augustsson . + * Parts of the code written by Jason R. Thorpe . + */ + +/* + * The driver handles 3 Wire Protocols + * - Command/Bulk/Interrupt (CBI) + * - Command/Bulk/Interrupt with Command Completion Interrupt (CBI with CCI) + * - Mass Storage Bulk-Only (BBB) + * (BBB refers Bulk/Bulk/Bulk for Command/Data/Status phases) + * + * Over these wire protocols it handles the following command protocols + * - SCSI + * - UFI (floppy command set) + * - 8070i (ATAPI) + * + * UFI and 8070i (ATAPI) are transformed versions of the SCSI command set. The + * sc->sc_transform method is used to convert the commands into the appropriate + * format (if at all necessary). For example, UFI requires all commands to be + * 12 bytes in length amongst other things. + * + * The source code below is marked and can be split into a number of pieces + * (in this order): + * + * - probe/attach/detach + * - generic transfer routines + * - BBB + * - CBI + * - CBI_I (in addition to functions from CBI) + * - CAM (Common Access Method) + * - SCSI + * - UFI + * - 8070i (ATAPI) + * + * The protocols are implemented using a state machine, for the transfers as + * well as for the resets. The state machine is contained in umass_t_*_callback. + * The state machine is started through either umass_command_start() or + * umass_reset(). + * + * The reason for doing this is a) CAM performs a lot better this way and b) it + * avoids using tsleep from interrupt context (for example after a failed + * transfer). + */ + +/* + * The SCSI related part of this driver has been derived from the + * dev/ppbus/vpo.c driver, by Nicolas Souchu (nsouch@freebsd.org). + * + * The CAM layer uses so called actions which are messages sent to the host + * adapter for completion. The actions come in through umass_cam_action. The + * appropriate block of routines is called depending on the transport protocol + * in use. When the transfer has finished, these routines call + * umass_cam_cb again to complete the CAM command. + */ + +#include +#include +#include +#include + +#include +#include +#include + +#include "usbdevs.h" + +#include +#include +#include +#include +#include +#include + +#include + +#ifdef USB_DEBUG +#define DIF(m, x) \ + do { \ + if (umass_debug & (m)) { x } \ + } while (0) + +#define DPRINTF(sc, m, fmt, ...) \ + do { \ + if (umass_debug & (m)) { \ + printf("%s:%s: " fmt, \ + (sc) ? (const char *)(sc)->sc_name : \ + (const char *)"umassX", \ + __FUNCTION__ ,## __VA_ARGS__); \ + } \ + } while(0) + +#define UDMASS_GEN 0x00010000 /* general */ +#define UDMASS_SCSI 0x00020000 /* scsi */ +#define UDMASS_UFI 0x00040000 /* ufi command set */ +#define UDMASS_ATAPI 0x00080000 /* 8070i command set */ +#define UDMASS_CMD (UDMASS_SCSI|UDMASS_UFI|UDMASS_ATAPI) +#define UDMASS_USB 0x00100000 /* USB general */ +#define UDMASS_BBB 0x00200000 /* Bulk-Only transfers */ +#define UDMASS_CBI 0x00400000 /* CBI transfers */ +#define UDMASS_WIRE (UDMASS_BBB|UDMASS_CBI) +#define UDMASS_ALL 0xffff0000 /* all of the above */ +static int umass_debug = 0; +SYSCTL_NODE(_hw_usb, OID_AUTO, umass, CTLFLAG_RW, 0, "USB umass"); +SYSCTL_INT(_hw_usb_umass, OID_AUTO, debug, CTLFLAG_RW, + &umass_debug, 0, "umass debug level"); +#else +#define DIF(...) /* nop */ +#define DPRINTF(...) /* nop */ +#endif + +#define UMASS_BULK_SIZE (1 << 17) /* bytes, must not be less than (1<<16) */ +#define UMASS_CBI_DIAGNOSTIC_CMDLEN 12 /* bytes */ +#define UMASS_MAX_CMDLEN MAX(12, CAM_MAX_CDBLEN) /* bytes */ + +/* USB transfer definitions */ + +#define UMASS_T_BBB_RESET1 0 /* Bulk-Only */ +#define UMASS_T_BBB_RESET2 1 +#define UMASS_T_BBB_RESET3 2 +#define UMASS_T_BBB_COMMAND 3 +#define UMASS_T_BBB_DATA_READ 4 +#define UMASS_T_BBB_DATA_RD_CS 5 +#define UMASS_T_BBB_DATA_WRITE 6 +#define UMASS_T_BBB_DATA_WR_CS 7 +#define UMASS_T_BBB_STATUS 8 +#define UMASS_T_BBB_MAX 9 + +#define UMASS_T_CBI_RESET1 0 /* CBI */ +#define UMASS_T_CBI_RESET2 1 +#define UMASS_T_CBI_RESET3 2 +#define UMASS_T_CBI_COMMAND 3 +#define UMASS_T_CBI_DATA_READ 4 +#define UMASS_T_CBI_DATA_RD_CS 5 +#define UMASS_T_CBI_DATA_WRITE 6 +#define UMASS_T_CBI_DATA_WR_CS 7 +#define UMASS_T_CBI_STATUS 8 +#define UMASS_T_CBI_RESET4 9 +#define UMASS_T_CBI_MAX 10 + +#define UMASS_T_MAX MAX(UMASS_T_CBI_MAX, UMASS_T_BBB_MAX) + +/* Generic definitions */ + +/* Direction for transfer */ +#define DIR_NONE 0 +#define DIR_IN 1 +#define DIR_OUT 2 + +/* device name */ +#define DEVNAME "umass" +#define DEVNAME_SIM "umass-sim" + +/* Approximate maximum transfer speeds (assumes 33% overhead). */ +#define UMASS_FULL_TRANSFER_SPEED 1000 +#define UMASS_HIGH_TRANSFER_SPEED 40000 +#define UMASS_FLOPPY_TRANSFER_SPEED 20 + +#define UMASS_TIMEOUT 5000 /* ms */ + +/* CAM specific definitions */ + +#define UMASS_SCSIID_MAX 1 /* maximum number of drives expected */ +#define UMASS_SCSIID_HOST UMASS_SCSIID_MAX + +/* Bulk-Only features */ + +#define UR_BBB_RESET 0xff /* Bulk-Only reset */ +#define UR_BBB_GET_MAX_LUN 0xfe /* Get maximum lun */ + +/* Command Block Wrapper */ +typedef struct { + uDWord dCBWSignature; +# define CBWSIGNATURE 0x43425355 + uDWord dCBWTag; + uDWord dCBWDataTransferLength; + uByte bCBWFlags; +# define CBWFLAGS_OUT 0x00 +# define CBWFLAGS_IN 0x80 + uByte bCBWLUN; + uByte bCDBLength; +# define CBWCDBLENGTH 16 + uByte CBWCDB[CBWCDBLENGTH]; +} UPACKED umass_bbb_cbw_t; +#define UMASS_BBB_CBW_SIZE 31 + +/* Command Status Wrapper */ +typedef struct { + uDWord dCSWSignature; +# define CSWSIGNATURE 0x53425355 +# define CSWSIGNATURE_IMAGINATION_DBX1 0x43425355 +# define CSWSIGNATURE_OLYMPUS_C1 0x55425355 + uDWord dCSWTag; + uDWord dCSWDataResidue; + uByte bCSWStatus; +# define CSWSTATUS_GOOD 0x0 +# define CSWSTATUS_FAILED 0x1 +# define CSWSTATUS_PHASE 0x2 +} UPACKED umass_bbb_csw_t; +#define UMASS_BBB_CSW_SIZE 13 + +/* CBI features */ + +#define UR_CBI_ADSC 0x00 + +typedef union { + struct { + u_int8_t type; +# define IDB_TYPE_CCI 0x00 + u_int8_t value; +# define IDB_VALUE_PASS 0x00 +# define IDB_VALUE_FAIL 0x01 +# define IDB_VALUE_PHASE 0x02 +# define IDB_VALUE_PERSISTENT 0x03 +# define IDB_VALUE_STATUS_MASK 0x03 + } UPACKED common; + + struct { + u_int8_t asc; + u_int8_t ascq; + } UPACKED ufi; +} UPACKED umass_cbi_sbl_t; + +struct umass_softc; /* see below */ + +typedef void (umass_callback_t) (struct umass_softc *sc, union ccb *ccb, + u_int32_t residue, u_int8_t status); +#define STATUS_CMD_OK 0 /* everything ok */ +#define STATUS_CMD_UNKNOWN 1 /* will have to fetch sense */ +#define STATUS_CMD_FAILED 2 /* transfer was ok, command failed */ +#define STATUS_WIRE_FAILED 3 /* couldn't even get command across */ + +typedef u_int8_t (umass_transform_t) (struct umass_softc *sc, u_int8_t *cmd_ptr, + u_int8_t cmd_len); + +struct umass_devdescr { + u_int32_t vid; +# define VID_WILDCARD 0xffffffff +# define VID_EOT 0xfffffffe + u_int32_t pid; +# define PID_WILDCARD 0xffffffff +# define PID_EOT 0xfffffffe + u_int32_t rid; +# define RID_WILDCARD 0xffffffff +# define RID_EOT 0xfffffffe + + /* wire and command protocol */ + u_int16_t proto; +# define UMASS_PROTO_BBB 0x0001 /* USB wire protocol */ +# define UMASS_PROTO_CBI 0x0002 +# define UMASS_PROTO_CBI_I 0x0004 +# define UMASS_PROTO_WIRE 0x00ff /* USB wire protocol mask */ +# define UMASS_PROTO_SCSI 0x0100 /* command protocol */ +# define UMASS_PROTO_ATAPI 0x0200 +# define UMASS_PROTO_UFI 0x0400 +# define UMASS_PROTO_RBC 0x0800 +# define UMASS_PROTO_COMMAND 0xff00 /* command protocol mask */ + + /* Device specific quirks */ + u_int16_t quirks; +# define NO_QUIRKS 0x0000 + /* The drive does not support Test Unit Ready. Convert to Start Unit + */ +# define NO_TEST_UNIT_READY 0x0001 + /* The drive does not reset the Unit Attention state after REQUEST + * SENSE has been sent. The INQUIRY command does not reset the UA + * either, and so CAM runs in circles trying to retrieve the initial + * INQUIRY data. + */ +# define RS_NO_CLEAR_UA 0x0002 + /* The drive does not support START STOP. */ +# define NO_START_STOP 0x0004 + /* Don't ask for full inquiry data (255b). */ +# define FORCE_SHORT_INQUIRY 0x0008 + /* Needs to be initialised the Shuttle way */ +# define SHUTTLE_INIT 0x0010 + /* Drive needs to be switched to alternate iface 1 */ +# define ALT_IFACE_1 0x0020 + /* Drive does not do 1Mb/s, but just floppy speeds (20kb/s) */ +# define FLOPPY_SPEED 0x0040 + /* The device can't count and gets the residue of transfers wrong */ +# define IGNORE_RESIDUE 0x0080 + /* No GetMaxLun call */ +# define NO_GETMAXLUN 0x0100 + /* The device uses a weird CSWSIGNATURE. */ +# define WRONG_CSWSIG 0x0200 + /* Device cannot handle INQUIRY so fake a generic response */ +# define NO_INQUIRY 0x0400 + /* Device cannot handle INQUIRY EVPD, return CHECK CONDITION */ +# define NO_INQUIRY_EVPD 0x0800 + /* Pad all RBC requests to 12 bytes. */ +# define RBC_PAD_TO_12 0x1000 +}; + +static const struct umass_devdescr umass_devdescr[] = { + { USB_VENDOR_ASAHIOPTICAL, PID_WILDCARD, RID_WILDCARD, + UMASS_PROTO_ATAPI | UMASS_PROTO_CBI_I, + RS_NO_CLEAR_UA + }, + { USB_VENDOR_ADDON, USB_PRODUCT_ADDON_ATTACHE, RID_WILDCARD, + UMASS_PROTO_SCSI | UMASS_PROTO_BBB, + IGNORE_RESIDUE + }, + { USB_VENDOR_FUJIPHOTO, USB_PRODUCT_FUJIPHOTO_MASS0100, RID_WILDCARD, + UMASS_PROTO_ATAPI | UMASS_PROTO_CBI_I, + RS_NO_CLEAR_UA + }, + { USB_VENDOR_ADDON, USB_PRODUCT_ADDON_A256MB, RID_WILDCARD, + UMASS_PROTO_SCSI | UMASS_PROTO_BBB, + IGNORE_RESIDUE + }, + { USB_VENDOR_ADDON, USB_PRODUCT_ADDON_DISKPRO512, RID_WILDCARD, + UMASS_PROTO_SCSI | UMASS_PROTO_BBB, + IGNORE_RESIDUE + }, + { USB_VENDOR_GENESYS, USB_PRODUCT_GENESYS_GL641USB2IDE, RID_WILDCARD, + UMASS_PROTO_SCSI | UMASS_PROTO_BBB, + FORCE_SHORT_INQUIRY | NO_START_STOP | IGNORE_RESIDUE + }, + { USB_VENDOR_GENESYS, USB_PRODUCT_GENESYS_GL641USB2IDE_2, RID_WILDCARD, + UMASS_PROTO_ATAPI | UMASS_PROTO_BBB, + FORCE_SHORT_INQUIRY | NO_START_STOP | IGNORE_RESIDUE + }, + { USB_VENDOR_GENESYS, USB_PRODUCT_GENESYS_GL641USB, RID_WILDCARD, + UMASS_PROTO_SCSI | UMASS_PROTO_BBB, + FORCE_SHORT_INQUIRY | NO_START_STOP | IGNORE_RESIDUE + }, + { USB_VENDOR_GENESYS, USB_PRODUCT_GENESYS_GL641USB_2, RID_WILDCARD, + UMASS_PROTO_SCSI | UMASS_PROTO_BBB, + WRONG_CSWSIG + }, + { USB_VENDOR_HITACHI, USB_PRODUCT_HITACHI_DVDCAM_USB, RID_WILDCARD, + UMASS_PROTO_ATAPI | UMASS_PROTO_CBI_I, + NO_INQUIRY + }, + { USB_VENDOR_HP, USB_PRODUCT_HP_CDW8200, RID_WILDCARD, + UMASS_PROTO_ATAPI | UMASS_PROTO_CBI_I, + NO_TEST_UNIT_READY | NO_START_STOP + }, + { USB_VENDOR_IMAGINATION, USB_PRODUCT_IMAGINATION_DBX1, RID_WILDCARD, + UMASS_PROTO_SCSI | UMASS_PROTO_BBB, + WRONG_CSWSIG + }, + { USB_VENDOR_INSYSTEM, USB_PRODUCT_INSYSTEM_USBCABLE, RID_WILDCARD, + UMASS_PROTO_ATAPI | UMASS_PROTO_CBI, + NO_TEST_UNIT_READY | NO_START_STOP | ALT_IFACE_1 + }, + { USB_VENDOR_IODATA, USB_PRODUCT_IODATA_IU_CD2, RID_WILDCARD, + UMASS_PROTO_SCSI | UMASS_PROTO_BBB, + NO_QUIRKS + }, + { USB_VENDOR_IODATA, USB_PRODUCT_IODATA_DVR_UEH8, RID_WILDCARD, + UMASS_PROTO_SCSI | UMASS_PROTO_BBB, + NO_QUIRKS + }, + { USB_VENDOR_IOMEGA, USB_PRODUCT_IOMEGA_ZIP100, RID_WILDCARD, + /* XXX This is not correct as there are Zip drives that use ATAPI. + */ + UMASS_PROTO_SCSI | UMASS_PROTO_BBB, + NO_TEST_UNIT_READY + }, + { USB_VENDOR_LOGITEC, USB_PRODUCT_LOGITEC_LDR_H443SU2, RID_WILDCARD, + UMASS_PROTO_SCSI, + NO_QUIRKS + }, + { USB_VENDOR_LOGITEC, USB_PRODUCT_LOGITEC_LDR_H443U2, RID_WILDCARD, + UMASS_PROTO_SCSI | UMASS_PROTO_BBB, + NO_QUIRKS + }, + { USB_VENDOR_MELCO, USB_PRODUCT_MELCO_DUBPXXG, RID_WILDCARD, + UMASS_PROTO_SCSI | UMASS_PROTO_BBB, + FORCE_SHORT_INQUIRY | NO_START_STOP | IGNORE_RESIDUE + }, + { USB_VENDOR_MICROTECH, USB_PRODUCT_MICROTECH_DPCM, RID_WILDCARD, + UMASS_PROTO_SCSI | UMASS_PROTO_CBI, + NO_TEST_UNIT_READY | NO_START_STOP + }, + { USB_VENDOR_MOTOROLA2, USB_PRODUCT_MOTOROLA2_E398, RID_WILDCARD, + UMASS_PROTO_SCSI | UMASS_PROTO_BBB, + FORCE_SHORT_INQUIRY | NO_INQUIRY_EVPD | NO_GETMAXLUN + }, + { USB_VENDOR_MSYSTEMS, USB_PRODUCT_MSYSTEMS_DISKONKEY, RID_WILDCARD, + UMASS_PROTO_SCSI | UMASS_PROTO_BBB, + IGNORE_RESIDUE | NO_GETMAXLUN | RS_NO_CLEAR_UA + }, + { USB_VENDOR_MSYSTEMS, USB_PRODUCT_MSYSTEMS_DISKONKEY2, RID_WILDCARD, + UMASS_PROTO_ATAPI | UMASS_PROTO_BBB, + NO_QUIRKS + }, + { USB_VENDOR_NEODIO, USB_PRODUCT_NEODIO_ND3260, RID_WILDCARD, + UMASS_PROTO_SCSI | UMASS_PROTO_BBB, + FORCE_SHORT_INQUIRY + }, + { USB_VENDOR_OLYMPUS, USB_PRODUCT_OLYMPUS_C1, RID_WILDCARD, + UMASS_PROTO_SCSI | UMASS_PROTO_BBB, + WRONG_CSWSIG + }, + { USB_VENDOR_ONSPEC, USB_PRODUCT_ONSPEC_UCF100, RID_WILDCARD, + UMASS_PROTO_ATAPI | UMASS_PROTO_BBB, + NO_INQUIRY | NO_GETMAXLUN + }, + { USB_VENDOR_PANASONIC, USB_PRODUCT_PANASONIC_KXLCB20AN, RID_WILDCARD, + UMASS_PROTO_SCSI | UMASS_PROTO_BBB, + NO_QUIRKS + }, + { USB_VENDOR_PANASONIC, USB_PRODUCT_PANASONIC_KXLCB35AN, RID_WILDCARD, + UMASS_PROTO_SCSI | UMASS_PROTO_BBB, + NO_QUIRKS + }, + { USB_VENDOR_PLEXTOR, USB_PRODUCT_PLEXTOR_40_12_40U, RID_WILDCARD, + UMASS_PROTO_SCSI | UMASS_PROTO_BBB, + NO_TEST_UNIT_READY + }, + { USB_VENDOR_PNY, USB_PRODUCT_PNY_ATTACHE2, RID_WILDCARD, + UMASS_PROTO_SCSI | UMASS_PROTO_BBB, + IGNORE_RESIDUE | NO_START_STOP + }, + { USB_VENDOR_SANDISK, USB_PRODUCT_SANDISK_SDCZ2_256, RID_WILDCARD, + UMASS_PROTO_SCSI | UMASS_PROTO_BBB, + IGNORE_RESIDUE + }, + { USB_VENDOR_SANDISK, USB_PRODUCT_SANDISK_SDCZ4_128, RID_WILDCARD, + UMASS_PROTO_SCSI | UMASS_PROTO_BBB, + IGNORE_RESIDUE + }, + { USB_VENDOR_SANDISK, USB_PRODUCT_SANDISK_SDCZ4_256, RID_WILDCARD, + UMASS_PROTO_SCSI | UMASS_PROTO_BBB, + IGNORE_RESIDUE + }, + { USB_VENDOR_SCANLOGIC, USB_PRODUCT_SCANLOGIC_SL11R, RID_WILDCARD, + UMASS_PROTO_ATAPI | UMASS_PROTO_BBB, + NO_INQUIRY + }, + { USB_VENDOR_SHUTTLE, USB_PRODUCT_SHUTTLE_EUSB, RID_WILDCARD, + UMASS_PROTO_ATAPI | UMASS_PROTO_CBI_I, + NO_TEST_UNIT_READY | NO_START_STOP | SHUTTLE_INIT + }, + { USB_VENDOR_SIGMATEL, USB_PRODUCT_SIGMATEL_I_BEAD100, RID_WILDCARD, + UMASS_PROTO_SCSI | UMASS_PROTO_BBB, + SHUTTLE_INIT + }, + { USB_VENDOR_SIIG, USB_PRODUCT_SIIG_WINTERREADER, RID_WILDCARD, + UMASS_PROTO_SCSI | UMASS_PROTO_BBB, + IGNORE_RESIDUE + }, + { USB_VENDOR_SONY, USB_PRODUCT_SONY_DSC, 0x0500, + UMASS_PROTO_RBC | UMASS_PROTO_CBI, + RBC_PAD_TO_12 + }, + { USB_VENDOR_SONY, USB_PRODUCT_SONY_DSC, 0x0600, + UMASS_PROTO_RBC | UMASS_PROTO_CBI, + RBC_PAD_TO_12 + }, + { USB_VENDOR_SONY, USB_PRODUCT_SONY_DSC, RID_WILDCARD, + UMASS_PROTO_RBC | UMASS_PROTO_CBI, + NO_QUIRKS + }, + { USB_VENDOR_SONY, USB_PRODUCT_SONY_HANDYCAM, RID_WILDCARD, + UMASS_PROTO_RBC | UMASS_PROTO_CBI, + NO_QUIRKS + }, + { USB_VENDOR_SONY, USB_PRODUCT_SONY_MSC, RID_WILDCARD, + UMASS_PROTO_RBC | UMASS_PROTO_CBI, + NO_QUIRKS + }, + { USB_VENDOR_TREK, USB_PRODUCT_TREK_THUMBDRIVE_8MB, RID_WILDCARD, + UMASS_PROTO_ATAPI | UMASS_PROTO_BBB, + IGNORE_RESIDUE + }, + { USB_VENDOR_TRUMPION, USB_PRODUCT_TRUMPION_C3310, RID_WILDCARD, + UMASS_PROTO_UFI | UMASS_PROTO_CBI, + NO_QUIRKS + }, + { USB_VENDOR_TWINMOS, USB_PRODUCT_TWINMOS_MDIV, RID_WILDCARD, + UMASS_PROTO_SCSI | UMASS_PROTO_BBB, + NO_QUIRKS + }, + { USB_VENDOR_WESTERN, USB_PRODUCT_WESTERN_EXTHDD, RID_WILDCARD, + UMASS_PROTO_SCSI | UMASS_PROTO_BBB, + FORCE_SHORT_INQUIRY | NO_START_STOP | IGNORE_RESIDUE + }, + { USB_VENDOR_YANO, USB_PRODUCT_YANO_U640MO, RID_WILDCARD, + UMASS_PROTO_ATAPI | UMASS_PROTO_CBI_I, + FORCE_SHORT_INQUIRY + }, + { VID_EOT, PID_EOT, RID_EOT, 0, 0 } +}; + +struct umass_softc { + + struct usbd_memory_wait sc_mem_wait; + struct scsi_sense cam_scsi_sense; + struct scsi_test_unit_ready cam_scsi_test_unit_ready; + struct mtx sc_mtx; + struct { + u_int8_t * data_ptr; + union ccb * ccb; + umass_callback_t * callback; + + u_int32_t data_len; /* bytes */ + u_int32_t data_rem; /* bytes */ + u_int32_t data_timeout; /* ms */ + u_int32_t actlen; /* bytes */ + + u_int8_t cmd_data[UMASS_MAX_CMDLEN]; + u_int8_t cmd_len; /* bytes */ + u_int8_t dir; + u_int8_t lun; + } sc_transfer; + + /* Bulk specific variables for transfers in progress */ + umass_bbb_cbw_t cbw; /* command block wrapper */ + umass_bbb_csw_t csw; /* command status wrapper*/ + + /* CBI specific variables for transfers in progress */ + umass_cbi_sbl_t sbl; /* status block */ + + device_t sc_dev; + struct usbd_device * sc_udev; + struct cam_sim * sc_sim; /* SCSI Interface Module */ + struct usbd_xfer * sc_xfer[UMASS_T_MAX]; + + /* The command transform function is used to convert the SCSI commands + * into their derivatives, like UFI, ATAPI, and friends. + */ + umass_transform_t * sc_transform; + + u_int32_t sc_unit; + + u_int16_t sc_proto; /* wire and cmd protocol */ + u_int16_t sc_quirks; /* they got it almost right */ + + u_int8_t sc_name[16]; + u_int8_t sc_iface_no; /* interface number */ + u_int8_t sc_maxlun; /* maximum LUN number, inclusive */ + u_int8_t sc_last_xfer_index; + u_int8_t sc_reset_count; + u_int8_t sc_status_try; +}; + +struct umass_probe_proto { + u_int16_t quirks; + u_int16_t proto; + + int32_t error; +}; + +/* prototypes */ + +static device_probe_t umass_probe; +static device_attach_t umass_attach; +static device_detach_t umass_detach; + +static void +umass_init_shuttle(struct umass_softc *sc); + +static void +umass_reset(struct umass_softc *sc); + +static void +umass_tr_error(struct usbd_xfer *xfer); + +static void +umass_t_bbb_reset1_callback(struct usbd_xfer *xfer); + +static void +umass_t_bbb_reset2_callback(struct usbd_xfer *xfer); + +static void +umass_t_bbb_reset3_callback(struct usbd_xfer *xfer); + +static void +umass_t_bbb_data_clear_stall_callback(struct usbd_xfer *xfer, + u_int8_t next_xfer, + u_int8_t stall_xfer); +static void +umass_t_bbb_command_callback(struct usbd_xfer *xfer); + +static void +umass_t_bbb_data_read_callback(struct usbd_xfer *xfer); + +static void +umass_t_bbb_data_rd_cs_callback(struct usbd_xfer *xfer); + +static void +umass_t_bbb_data_write_callback(struct usbd_xfer *xfer); + +static void +umass_t_bbb_data_wr_cs_callback(struct usbd_xfer *xfer); + +static void +umass_t_bbb_status_callback(struct usbd_xfer *xfer); + +static void +umass_command_start(struct umass_softc *sc, u_int8_t dir, + void *data_ptr, u_int32_t data_len, + u_int32_t data_timeout, umass_callback_t *callback, + union ccb *ccb); +static u_int8_t +umass_bbb_get_max_lun(struct umass_softc *sc); + +static void +umass_cbi_start_status(struct umass_softc *sc); + +static void +umass_t_cbi_reset1_callback(struct usbd_xfer *xfer); + +static void +umass_t_cbi_reset2_callback(struct usbd_xfer *xfer); + +static void +umass_t_cbi_reset3_callback(struct usbd_xfer *xfer); + +static void +umass_t_cbi_reset4_callback(struct usbd_xfer *xfer); + +static void +umass_t_cbi_data_clear_stall_callback(struct usbd_xfer *xfer, + u_int8_t next_xfer, + u_int8_t stall_xfer); +static void +umass_t_cbi_command_callback(struct usbd_xfer *xfer); + +static void +umass_t_cbi_data_read_callback(struct usbd_xfer *xfer); + +static void +umass_t_cbi_data_rd_cs_callback(struct usbd_xfer *xfer); + +static void +umass_t_cbi_data_write_callback(struct usbd_xfer *xfer); + +static void +umass_t_cbi_data_wr_cs_callback(struct usbd_xfer *xfer); + +static void +umass_t_cbi_status_callback(struct usbd_xfer *xfer); + +static int +umass_cam_attach_sim(struct umass_softc *sc); + +static void +umass_cam_rescan_callback(struct cam_periph *periph, union ccb *ccb); + +static void +umass_cam_rescan(struct umass_softc *sc); + +static void +umass_cam_attach(struct umass_softc *sc); + +static void +umass_cam_detach_sim(struct umass_softc *sc); + +static void +umass_cam_action(struct cam_sim *sim, union ccb *ccb); + +static void +umass_cam_poll(struct cam_sim *sim); + +static void +umass_cam_cb(struct umass_softc *sc, union ccb *ccb, u_int32_t residue, + u_int8_t status); +static void +umass_cam_sense_cb(struct umass_softc *sc, union ccb *ccb, u_int32_t residue, + u_int8_t status); +static void +umass_cam_quirk_cb(struct umass_softc *sc, union ccb *ccb, u_int32_t residue, + u_int8_t status); +static u_int8_t +umass_scsi_transform(struct umass_softc *sc, u_int8_t *cmd_ptr, + u_int8_t cmd_len); +static u_int8_t +umass_rbc_transform(struct umass_softc *sc, u_int8_t *cmd_ptr, u_int8_t cmd_len); + +static u_int8_t +umass_ufi_transform(struct umass_softc *sc, u_int8_t *cmd_ptr, + u_int8_t cmd_len); +static u_int8_t +umass_atapi_transform(struct umass_softc *sc, u_int8_t *cmd_ptr, + u_int8_t cmd_len); +static u_int8_t +umass_no_transform(struct umass_softc *sc, u_int8_t *cmd, + u_int8_t cmdlen); +#ifdef USB_DEBUG +static void +umass_bbb_dump_cbw(struct umass_softc *sc, umass_bbb_cbw_t *cbw); + +static void +umass_bbb_dump_csw(struct umass_softc *sc, umass_bbb_csw_t *csw); + +static void +umass_cbi_dump_cmd(struct umass_softc *sc, void *cmd, u_int8_t cmdlen); + +static void +umass_dump_buffer(struct umass_softc *sc, u_int8_t *buffer, u_int32_t buflen, + u_int32_t printlen); +#endif + +struct usbd_config umass_bbb_config[UMASS_T_BBB_MAX] = { + + [UMASS_T_BBB_RESET1] = { + .type = UE_CONTROL, + .endpoint = 0x00, /* Control pipe */ + .direction = -1, + .bufsize = sizeof(usb_device_request_t), + .flags = USBD_USE_DMA, + .callback = &umass_t_bbb_reset1_callback, + .timeout = 5000, /* 5 seconds */ + }, + + [UMASS_T_BBB_RESET2] = { + .type = UE_CONTROL, + .endpoint = 0x00, /* Control pipe */ + .direction = -1, + .bufsize = sizeof(usb_device_request_t), + .flags = USBD_USE_DMA, + .callback = &umass_t_bbb_reset2_callback, + .timeout = 5000, /* 5 seconds */ + }, + + [UMASS_T_BBB_RESET3] = { + .type = UE_CONTROL, + .endpoint = 0x00, /* Control pipe */ + .direction = -1, + .bufsize = sizeof(usb_device_request_t), + .flags = USBD_USE_DMA, + .callback = &umass_t_bbb_reset3_callback, + .timeout = 5000, /* 5 seconds */ + }, + + [UMASS_T_BBB_COMMAND] = { + .type = UE_BULK, + .endpoint = -1, /* any */ + .direction = UE_DIR_OUT, + .bufsize = sizeof(umass_bbb_cbw_t), + .flags = USBD_USE_DMA, + .callback = &umass_t_bbb_command_callback, + .timeout = 5000, /* 5 seconds */ + }, + + [UMASS_T_BBB_DATA_READ] = { + .type = UE_BULK, + .endpoint = -1, /* any */ + .direction = UE_DIR_IN, + .bufsize = UMASS_BULK_SIZE, + .flags = (USBD_USE_DMA|USBD_SHORT_XFER_OK), + .callback = &umass_t_bbb_data_read_callback, + .timeout = 0, /* overwritten later */ + }, + + [UMASS_T_BBB_DATA_RD_CS] = { + .type = UE_CONTROL, + .endpoint = 0x00, /* Control pipe */ + .direction = -1, + .bufsize = sizeof(usb_device_request_t), + .flags = USBD_USE_DMA, + .callback = &umass_t_bbb_data_rd_cs_callback, + .timeout = 5000, /* 5 seconds */ + }, + + [UMASS_T_BBB_DATA_WRITE] = { + .type = UE_BULK, + .endpoint = -1, /* any */ + .direction = UE_DIR_OUT, + .bufsize = UMASS_BULK_SIZE, + .flags = USBD_USE_DMA, + .callback = &umass_t_bbb_data_write_callback, + .timeout = 0, /* overwritten later */ + }, + + [UMASS_T_BBB_DATA_WR_CS] = { + .type = UE_CONTROL, + .endpoint = 0x00, /* Control pipe */ + .direction = -1, + .bufsize = sizeof(usb_device_request_t), + .flags = USBD_USE_DMA, + .callback = &umass_t_bbb_data_wr_cs_callback, + .timeout = 5000, /* 5 seconds */ + }, + + [UMASS_T_BBB_STATUS] = { + .type = UE_BULK, + .endpoint = -1, /* any */ + .direction = UE_DIR_IN, + .bufsize = sizeof(umass_bbb_csw_t), + .flags = (USBD_USE_DMA|USBD_SHORT_XFER_OK), + .callback = &umass_t_bbb_status_callback, + .timeout = 5000, /* ms */ + }, +}; + +struct usbd_config umass_cbi_config[UMASS_T_CBI_MAX] = { + + [UMASS_T_CBI_RESET1] = { + .type = UE_CONTROL, + .endpoint = 0x00, /* Control pipe */ + .direction = -1, + .bufsize = (sizeof(usb_device_request_t) + + UMASS_CBI_DIAGNOSTIC_CMDLEN), + .flags = USBD_USE_DMA, + .callback = &umass_t_cbi_reset1_callback, + .timeout = 5000, /* 5 seconds */ + }, + + [UMASS_T_CBI_RESET2] = { + .type = UE_CONTROL, + .endpoint = 0x00, /* Control pipe */ + .direction = -1, + .bufsize = sizeof(usb_device_request_t), + .flags = USBD_USE_DMA, + .callback = &umass_t_cbi_reset2_callback, + .timeout = 5000, /* 5 seconds */ + }, + + [UMASS_T_CBI_RESET3] = { + .type = UE_CONTROL, + .endpoint = 0x00, /* Control pipe */ + .direction = -1, + .bufsize = sizeof(usb_device_request_t), + .flags = USBD_USE_DMA, + .callback = &umass_t_cbi_reset3_callback, + .timeout = 5000, /* 5 seconds */ + }, + + [UMASS_T_CBI_COMMAND] = { + .type = UE_CONTROL, + .endpoint = 0x00, /* Control pipe */ + .direction = -1, + .bufsize = (sizeof(usb_device_request_t) + + UMASS_MAX_CMDLEN), + .flags = USBD_USE_DMA, + .callback = &umass_t_cbi_command_callback, + .timeout = 5000, /* 5 seconds */ + }, + + [UMASS_T_CBI_DATA_READ] = { + .type = UE_BULK, + .endpoint = -1, /* any */ + .direction = UE_DIR_IN, + .bufsize = UMASS_BULK_SIZE, + .flags = (USBD_USE_DMA|USBD_SHORT_XFER_OK), + .callback = &umass_t_cbi_data_read_callback, + .timeout = 0, /* overwritten later */ + }, + + [UMASS_T_CBI_DATA_RD_CS] = { + .type = UE_CONTROL, + .endpoint = 0x00, /* Control pipe */ + .direction = -1, + .bufsize = sizeof(usb_device_request_t), + .flags = USBD_USE_DMA, + .callback = &umass_t_cbi_data_rd_cs_callback, + .timeout = 5000, /* 5 seconds */ + }, + + [UMASS_T_CBI_DATA_WRITE] = { + .type = UE_BULK, + .endpoint = -1, /* any */ + .direction = UE_DIR_OUT, + .bufsize = UMASS_BULK_SIZE, + .flags = USBD_USE_DMA, + .callback = &umass_t_cbi_data_write_callback, + .timeout = 0, /* overwritten later */ + }, + + [UMASS_T_CBI_DATA_WR_CS] = { + .type = UE_CONTROL, + .endpoint = 0x00, /* Control pipe */ + .direction = -1, + .bufsize = sizeof(usb_device_request_t), + .flags = USBD_USE_DMA, + .callback = &umass_t_cbi_data_wr_cs_callback, + .timeout = 5000, /* 5 seconds */ + }, + + [UMASS_T_CBI_STATUS] = { + .type = UE_INTERRUPT, + .endpoint = -1, /* any */ + .direction = UE_DIR_IN, + .flags = (USBD_USE_DMA|USBD_SHORT_XFER_OK), + .bufsize = sizeof(umass_cbi_sbl_t), + .callback = &umass_t_cbi_status_callback, + .timeout = 5000, /* ms */ + }, + + [UMASS_T_CBI_RESET4] = { + .type = UE_CONTROL, + .endpoint = 0x00, /* Control pipe */ + .direction = -1, + .bufsize = sizeof(usb_device_request_t), + .flags = USBD_USE_DMA, + .callback = &umass_t_cbi_reset4_callback, + .timeout = 5000, /* ms */ + }, +}; + +/* If device cannot return valid inquiry data, fake it */ +static const u_int8_t fake_inq_data[SHORT_INQUIRY_LENGTH] = { + 0, /*removable*/ 0x80, SCSI_REV_2, SCSI_REV_2, + /*additional_length*/ 31, 0, 0, 0 +}; + +#define UFI_COMMAND_LENGTH 12 /* UFI commands are always 12 bytes */ +#define ATAPI_COMMAND_LENGTH 12 /* ATAPI commands are always 12 bytes */ + +static devclass_t umass_devclass; + +static device_method_t umass_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, umass_probe), + DEVMETHOD(device_attach, umass_attach), + DEVMETHOD(device_detach, umass_detach), + { 0, 0 } +}; + +static driver_t umass_driver = { + .name = "umass", + .methods = umass_methods, + .size = sizeof(struct umass_softc), +}; + +DRIVER_MODULE(umass, uhub, umass_driver, umass_devclass, usbd_driver_load, 0); + +MODULE_DEPEND(umass, usb, 1,1,1); +MODULE_DEPEND(umass, cam, 1,1,1); + +/* + * USB device probe/attach/detach + */ + +/* + * Match the device we are seeing with the + * devices supported. + */ +static struct umass_probe_proto +umass_probe_proto(device_t dev, struct usb_attach_arg *uaa) +{ + const struct umass_devdescr *udd = umass_devdescr; + usb_interface_descriptor_t *id; + struct umass_probe_proto ret; + >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Wed Sep 13 22:24:33 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id DB61316A415; Wed, 13 Sep 2006 22:24:32 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B6B1016A403 for ; Wed, 13 Sep 2006 22:24:32 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 18ED143D45 for ; Wed, 13 Sep 2006 22:24:32 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8DMOWxA072239 for ; Wed, 13 Sep 2006 22:24:32 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8DMOV2T072236 for perforce@freebsd.org; Wed, 13 Sep 2006 22:24:31 GMT (envelope-from imp@freebsd.org) Date: Wed, 13 Sep 2006 22:24:31 GMT Message-Id: <200609132224.k8DMOV2T072236@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 106081 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Sep 2006 22:24:33 -0000 http://perforce.freebsd.org/chv.cgi?CH=106081 Change 106081 by imp@imp_lighthouse on 2006/09/13 22:24:24 SD cards now detected # Had to disable strategy and make it EIO since we have an interrupt # problem elsewhere that was keeping bio's in flight which was hanging # the boot. Affected files ... .. //depot/projects/arm/src/sys/arm/at91/at91_qdmmc.c#9 edit Differences ... ==== //depot/projects/arm/src/sys/arm/at91/at91_qdmmc.c#9 (text+ko) ==== @@ -131,6 +131,7 @@ struct at91_qdmmc_softc *sc = device_get_softc(dev); uint32_t error; + device_printf(dev, "Sending command %x:%x\n", cmd, arg); WR4(sc, MCI_ARGR, arg); WR4(sc, MCI_CMDR, cmd); @@ -162,6 +163,8 @@ WR4(sc, MCI_ARGR, sc->cards[0].rca << 16); WR4(sc, MCI_CMDR, APP_CMD); + printf("CMD55: %x\n", sc->cards[0].rca << 16); + // wait for CMDRDY Status flag to read the response do { @@ -172,10 +175,6 @@ if ((status & MCI_SR_ERROR) != 0 ) return (status & MCI_SR_ERROR); - // check if it is a specific command and then send the command - if ((cmd & SDCARD_APP_ALL_CMD) == 0) - return MCI_SR_ERROR; - return (at91_qdmmc_SendCommand(dev, cmd, arg)); } @@ -203,17 +202,18 @@ if (response != 0) return (-1); response = RD4(sc, MCI_RSPR); + printf("card's OCR is %#x\n", response); } return (response); } static int -at91_qdmmc_SDCard_GetCID(device_t dev, uint32_t *response) +at91_qdmmc_GetCID(device_t dev, uint32_t *response) { struct at91_qdmmc_softc *sc = device_get_softc(dev); - if (at91_qdmmc_SendCommand(dev, ALL_SEND_CID_CMD, AT91C_NO_ARGUMENT)) + if (at91_qdmmc_SendCommand(dev, ALL_SEND_CID_CMD, 0)) return EIO; response[0] = RD4(sc, MCI_RSPR + 0 * sizeof(response[0])); response[1] = RD4(sc, MCI_RSPR + 1 * sizeof(response[0])); @@ -282,43 +282,54 @@ at91_qdmmc_sdcard_init(device_t dev) { struct at91_qdmmc_softc *sc = device_get_softc(dev); - uint32_t *csd; + uint32_t *csd, *cid; - at91_qdmmc_SendCommand(dev, GO_IDLE_STATE_CMD, AT91C_NO_ARGUMENT); + // CMD0 + at91_qdmmc_SendCommand(dev, GO_IDLE_STATE_CMD, 0); - if (at91_qdmmc_SDCard_GetOCR(dev) == -1) + if (at91_qdmmc_SDCard_GetOCR(dev) == -1) { // ACMD41 + printf("SD: can't get OCR\n"); return ENXIO; - - csd = &sc->cards[0].CSD[0]; - if (at91_qdmmc_SDCard_GetCID(dev, csd) != 0) + } + cid = &sc->cards[0].CID[0]; + if (at91_qdmmc_GetCID(dev, cid) != 0) { // CMD2 + printf("SD: cant get cid\n"); return ENXIO; - if (at91_qdmmc_SendCommand(dev, SET_RELATIVE_ADDR_CMD, 0) != 0) + } + if (at91_qdmmc_SendCommand(dev, SET_RELATIVE_ADDR_CMD, 0) != 0) { + printf("SD: Can't set RCA to 0\n"); return ENXIO; + } sc->cards[0].rca = RD4(sc, MCI_RSPR) >> 16; - if (at91_qdmmc_GetCSD(dev, sc->cards[0].rca, csd) != 0) + csd = &sc->cards[0].CSD[0]; + if (at91_qdmmc_GetCSD(dev, sc->cards[0].rca, csd) != 0) { + printf("SD: can't get csd\n"); return ENXIO; - printf("Found SD Card - CID = 0x%x%x%x%x\n", - sc->cards[0].CID[0], - sc->cards[0].CID[1], - sc->cards[0].CID[2], - sc->cards[0].CID[3]); - printf("SD: Vendor-ID = 0x%x\n", sc->cards[0].CID[0] >> 24); - printf("SD: OEM-ID = 0x%x\n", (sc->cards[0].CID[0] >> 8) & 0xffff); - sc->cards[0].name[0] = (sc->cards[0].CID[0] >> 0) & 0xff; - sc->cards[0].name[1] = (sc->cards[0].CID[1] >> 24) & 0xff; - sc->cards[0].name[2] = (sc->cards[0].CID[1] >> 16) & 0xff; - sc->cards[0].name[3] = (sc->cards[0].CID[1] >> 8) & 0xff; - sc->cards[0].name[4] = (sc->cards[0].CID[1] >> 0) & 0xff; - sc->cards[0].name[5] = (sc->cards[0].CID[2] >> 24) & 0xff; + } + printf("Found SD Card - CID = 0x%08x%08x%08x%08x\n", + cid[0], + cid[1], + cid[2], + cid[3]); + printf("SD - CSD = 0x%08x%08x%08x%08x\n", csd[0], csd[1], csd[2], + csd[3]); + printf("SD: Vendor-ID = 0x%x\n", cid[0] >> 24); + printf("SD: OEM-ID = 0x%x\n", (cid[0] >> 8) & 0xffff); + sc->cards[0].name[0] = (cid[0] >> 0) & 0xff; + sc->cards[0].name[1] = (cid[1] >> 24) & 0xff; + sc->cards[0].name[2] = (cid[1] >> 16) & 0xff; + sc->cards[0].name[3] = (cid[1] >> 8) & 0xff; + sc->cards[0].name[4] = (cid[1] >> 0) & 0xff; + sc->cards[0].name[5] = (cid[2] >> 24) & 0xff; sc->cards[0].name[6] = '\0'; printf("SD: Productname = %s\n", sc->cards[0].name); - printf("SD: Revision = 0x%x\n", (sc->cards[0].CID[2] >> 16) & 0xff); - printf("SD: Serial = 0x%x\n", (sc->cards[0].CID[2] << 16) | - (sc->cards[0].CID[3] >> 16)); - int year = 1997; - year += ((sc->cards[0].CID[3] >> 8) & 0xf); + printf("SD: Revision = 0x%x\n", (cid[2] >> 16) & 0xff); + printf("SD: Serial = 0x%x\n", (cid[2] << 16) | + (cid[3] >> 16)); + int year = 2001; + year += ((cid[3] >> 8) & 0xf); int month = 0; - month += ((sc->cards[0].CID[3] >> 12) & 0xf); + month += ((cid[3] >> 12) & 0xf); printf("SD: Manufacturing Date = %i/%i\n", year, month); sc->cards[0].mode = 5 * MCI_MR_CLKDIV | MCI_MR_PWSDIV | (MCI_MR_PWSDIV << 1 | MCI_MR_PDCMODE); @@ -335,24 +346,29 @@ CSD_3_WBLEN_M; bioq_init(&sc->cards[0].bio_queue); - sc->cards[0].sector_size = 1 + ((csd[2] >> CSD_2_v21_SECT_SIZE_S) & - CSD_2_v21_SECT_SIZE_M); + sc->cards[0].sector_size = 1 << sc->cards[0].read_bl; printf("SD: Blocksize = %i Bytes\n", sc->cards[0].sector_size); uint64_t c_size; uint64_t c_size_mult; - c_size = ((sc->cards[0].CSD[1] & 0x3ff) << 2) | - ((sc->cards[0].CSD[2] >> 30) & 0x3); + c_size = ((sc->cards[0].CSD[1] & CSD_1_CSIZE_H_M) << 2) | + ((sc->cards[0].CSD[2] >> CSD_2_CSIZE_L_S) & CSD_2_CSIZE_L_M); printf("SD: c_size = %lld\n", c_size); - c_size_mult = (sc->cards[0].CSD[2] >> 15) & 0x7; + c_size_mult = (sc->cards[0].CSD[2] >> CSD_2_C_SIZE_M_S) & + CSD_2_C_SIZE_M_M; c_size_mult = 1 << (c_size_mult + 2); printf("SD: c_size_mult = %lld\n", c_size_mult); sc->cards[0].size = sc->cards[0].sector_size * (c_size + 1) * c_size_mult; printf("SD: Size = %lld Bytes\n", sc->cards[0].size); - if (at91_qdmmc_SDCard_SetBusWidth(dev)) + if (at91_qdmmc_SDCard_SetBusWidth(dev)) { + printf("Failed to set bus width"); return EIO; - if (at91_qdmmc_SetBlocklength(dev, sc->cards[0].sector_size) != 0) + } + if (at91_qdmmc_SetBlocklength(dev, sc->cards[0].sector_size) != 0) { + printf("Failed to set block length!\n"); return EIO; + } + sc->nb_cards++; return 0; } @@ -365,7 +381,7 @@ err = 0; /* get all cards into idle state */ - at91_qdmmc_SendCommand(dev, MMC_GO_IDLE_STATE_CMD, AT91C_NO_ARGUMENT); + at91_qdmmc_SendCommand(dev, MMC_GO_IDLE_STATE_CMD, 0); /* check operating conditions */ do { /* loop on busy */ @@ -385,15 +401,8 @@ for(sc->nb_cards = 0; sc->nb_cards < MMC_MAX; sc->nb_cards++) { int status; int card = sc->nb_cards; - status = at91_qdmmc_SendCommand(dev, MMC_ALL_SEND_CID_CMD, - AT91C_NO_ARGUMENT); - if (status != 0) { + if (at91_qdmmc_GetCID(dev, sc->cards[card].CID)) break; - } - sc->cards[card].CID[0] = RD4(sc, MCI_RSPR + 0); - sc->cards[card].CID[1] = RD4(sc, MCI_RSPR + 4); - sc->cards[card].CID[2] = RD4(sc, MCI_RSPR + 8); - sc->cards[card].CID[3] = RD4(sc, MCI_RSPR + 12); printf("Found MMC %i - CID = 0x%x%x%x%x\n", card, sc->cards[card].CID[0], sc->cards[card].CID[1], @@ -554,7 +563,9 @@ } if (at91_qdmmc_mmc_init(dev) != 0) { + printf("MMC FAILED, LET'S TRY SDCARD\n"); if (at91_qdmmc_sdcard_init(dev) != 0) { + printf("SD CARD FAILED, YOU LOSE\n"); err = 0; goto out; } @@ -691,10 +702,14 @@ //printf("at91_qdmmc_strategy: called\n"); sc = (struct at91_qdmmc_softc *)bp->bio_disk->d_drv1; +#if 0 AT91_QDMMC_LOCK(sc); bioq_disksort(&sc->cards[0].bio_queue, bp); wakeup(sc); AT91_QDMMC_UNLOCK(sc); +#else + biofinish(bp, NULL, EIO); +#endif } static void at91_qdmmc_task(void *arg) { @@ -707,7 +722,7 @@ tmpbuf = malloc(sc->cards[0].sector_size, M_DEVBUF, M_WAITOK); AT91_QDMMC_LOCK(sc); - //printf("at91_qdmmc_task: start\n"); + printf("at91_qdmmc_task: start\n"); for (;;) { do { bp = bioq_first(&sc->cards[0].bio_queue); @@ -715,19 +730,19 @@ msleep(sc, &sc->sc_mtx, PRIBIO, "jobqueue", 0); } while (bp == NULL); bioq_remove(&sc->cards[0].bio_queue, bp); - //printf("at91_qdmmc_task: request %p\n", bp); + printf("at91_qdmmc_task: request %p\n", bp); if (bp->bio_cmd == BIO_READ) { status = at91_qdmmc_SendCommand(sc->dev, SEL_DESEL_CARD_CMD, (sc->cards[0].addr) << 16); - //printf("at91_qdmmc_task: select_card-status = 0x%x\n", status); + printf("at91_qdmmc_task: select_card-status = 0x%x\n", status); status = at91_qdmmc_SendCommand(sc->dev, SET_BLOCKLEN_CMD, sc->cards[0].sector_size); - //printf("at91_qdmmc_task: set_blocklen-status = 0x%x\n", status); - //printf("at91_qdmmc_task: read block %lld, bcount %ld\n", bp->bio_pblkno, bp->bio_bcount); + printf("at91_qdmmc_task: set_blocklen-status = 0x%x\n", status); + printf("at91_qdmmc_task: read block %lld, bcount %ld\n", bp->bio_pblkno, bp->bio_bcount); uint32_t block; // Init Mode Register WR4(sc, MCI_MR, sc->cards[0].mode | (sc->cards[0].sector_size << 16)); - //printf("mode 0x%x\n", RD4(sc, MCI_MR)); + printf("mode 0x%x\n", RD4(sc, MCI_MR)); for (block = bp->bio_pblkno; block < bp->bio_pblkno + (bp->bio_bcount / sc->cards[0].sector_size); block++) { WR4(sc, PDC_PTCR, PDC_PTCR_TXTDIS | PDC_PTCR_RXTDIS); @@ -743,20 +758,23 @@ WR4(sc, PDC_RPR, addr); WR4(sc, PDC_RCR, sc->cards[0].sector_size / 4); WR4(sc, PDC_PTCR, PDC_PTCR_RXTEN); - WR4(sc, MCI_IER, MCI_SR_RXBUFF); + WR4(sc, MCI_IER, MCI_SR_RXBUFF | MCI_SR_ENDRX); - //printf("status = 0x%x, paddr = %p, RPR = 0x%x, RCR = 0x%x\n", status, paddr, - // RD4(sc, PDC_RPR), RD4(sc, PDC_RCR)); + printf("status = 0x%x, paddr = %p, RPR = 0x%x, RCR = 0x%x\n", status, paddr, + RD4(sc, PDC_RPR), RD4(sc, PDC_RCR)); status = at91_qdmmc_SendCommand(sc->dev, READ_SINGLE_BLOCK_CMD, block * sc->cards[0].sector_size); - //printf("at91_qdmmc_task: read-status = 0x%x\n", status); + printf("at91_qdmmc_task: read-status = 0x%x\n", status); // wait for completion + printf("TO SLEEP, PURCHANCE TO DREAM\n"); msleep(sc, &sc->sc_mtx, PRIBIO, "endrx", 0); + printf("DONE SLEEPING\n"); // safety check while ((RD4(sc, MCI_SR) & MCI_SR_ENDRX) == 0) DELAY(700); + printf("DONE WAITING\n"); bus_dmamap_sync(sc->dmatag, sc->map, BUS_DMASYNC_POSTREAD); bus_dmamap_unload(sc->dmatag, sc->map); map = 0; @@ -771,9 +789,10 @@ ((tmp & 0xff) << 24); } } + printf("Delecting card!\n"); status = at91_qdmmc_SendCommand(sc->dev, SEL_DESEL_CARD_CMD, 0); - //printf("at91_qdmmc_task: deselect_card-status = 0x%x\n", status); + printf("at91_qdmmc_task: deselect_card-status = 0x%x\n", status); // Reset Mode Register WR4(sc, MCI_MR, sc->cards[0].mode); @@ -781,22 +800,22 @@ continue; } if (bp->bio_cmd == BIO_WRITE) { - //printf("at91_qdmmc_task: write block %lld, bcount %ld\n", bp->bio_pblkno, bp->bio_bcount); + printf("at91_qdmmc_task: write block %lld, bcount %ld\n", bp->bio_pblkno, bp->bio_bcount); uint32_t block; - //uint32_t *tmpbuf; + uint32_t *tmpbuf; // Init Mode Register WR4(sc, MCI_MR, sc->cards[0].mode | (sc->cards[0].sector_size << 16)); - // printf("mode 0x%x\n", RD4(sc, MCI_MR)); + printf("mode 0x%x\n", RD4(sc, MCI_MR)); status = at91_qdmmc_SendCommand(sc->dev, SEL_DESEL_CARD_CMD, (sc->cards[0].addr) << 16); - // printf("at91_qdmmc_task: select_card-status = 0x%x\n", status); + printf("at91_qdmmc_task: select_card-status = 0x%x\n", status); status = at91_qdmmc_SendCommand(sc->dev, SET_BLOCKLEN_CMD, sc->cards[0].sector_size); - // printf("at91_qdmmc_task: set_blocklen-status = 0x%x\n", status); + printf("at91_qdmmc_task: set_blocklen-status = 0x%x\n", status); - //tmpbuf = malloc(sc->cards[0].sector_size, M_DEVBUF, M_WAITOK); + tmpbuf = malloc(sc->cards[0].sector_size, M_DEVBUF, M_WAITOK); for (block = bp->bio_pblkno; block < bp->bio_pblkno + (bp->bio_bcount / sc->cards[0].sector_size); block++) { char *paddr = bp->bio_data + (block - bp->bio_pblkno) * sc->cards[0].sector_size; @@ -821,8 +840,8 @@ WR4(sc, PDC_TPR, addr); WR4(sc, PDC_TCR, sc->cards[0].sector_size / 4); - // printf("status = 0x%x, tmpbuf = %p, TPR = 0x%x, TCR = 0x%x\n", status, tmpbuf, - // RD4(sc, PDC_TPR), RD4(sc, PDC_TCR)); + printf("status = 0x%x, tmpbuf = %p, TPR = 0x%x, TCR = 0x%x\n", status, tmpbuf, + RD4(sc, PDC_TPR), RD4(sc, PDC_TCR)); status = at91_qdmmc_SendCommand(sc->dev, WRITE_BLOCK_CMD, block * sc->cards[0].sector_size); // printf("at91_qdmmc_task: write-status = 0x%x\n", status); @@ -839,11 +858,11 @@ bus_dmamap_unload(sc->dmatag, sc->map); map = 0; } - //free(tmpbuf, M_DEVBUF); + free(tmpbuf, M_DEVBUF); status = at91_qdmmc_SendCommand(sc->dev, SEL_DESEL_CARD_CMD, 0); - //printf("at91_qdmmc_task: deselect_card-status = 0x%x\n", status); + printf("at91_qdmmc_task: deselect_card-status = 0x%x\n", status); // Reset Mode Register WR4(sc, MCI_MR, sc->cards[0].mode); @@ -855,7 +874,7 @@ if (map) bus_dmamap_unload(sc->dmatag, sc->map); status = at91_qdmmc_SendCommand(sc->dev, SEL_DESEL_CARD_CMD, 0); - //printf("at91_qdmmc_task: deselect_card-status = 0x%x\n", status); + printf("at91_qdmmc_task: deselect_card-status = 0x%x\n", status); AT91_QDMMC_UNLOCK(sc); biofinish(bp, NULL, ENXIO); } @@ -884,7 +903,7 @@ struct at91_qdmmc_softc *sc = (struct at91_qdmmc_softc*)arg; AT91_QDMMC_LOCK(sc); - //printf("i 0x%x\n", RD4(sc, MCI_SR)); + printf("i 0x%x\n", RD4(sc, MCI_SR)); wakeup(sc); WR4(sc, MCI_IDR, 0xffffffff); AT91_QDMMC_UNLOCK(sc); From owner-p4-projects@FreeBSD.ORG Thu Sep 14 12:09:35 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 90B5D16A416; Thu, 14 Sep 2006 12:09:35 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4F86316A40F; Thu, 14 Sep 2006 12:09:35 +0000 (UTC) (envelope-from ticso@cicely12.cicely.de) Received: from raven.bwct.de (raven.bwct.de [85.159.14.73]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8DEAF43D46; Thu, 14 Sep 2006 12:09:34 +0000 (GMT) (envelope-from ticso@cicely12.cicely.de) Received: from cicely5.cicely.de ([10.1.1.7]) by raven.bwct.de (8.13.4/8.13.4) with ESMTP id k8EC9Wfb075844; Thu, 14 Sep 2006 14:09:32 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (cicely12.cicely.de [10.1.1.14]) by cicely5.cicely.de (8.13.4/8.13.4) with ESMTP id k8EC9OLD032775 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 14 Sep 2006 14:09:25 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (localhost [127.0.0.1]) by cicely12.cicely.de (8.13.4/8.13.3) with ESMTP id k8EC9OdN036227; Thu, 14 Sep 2006 14:09:24 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: (from ticso@localhost) by cicely12.cicely.de (8.13.4/8.13.3/Submit) id k8EC9OWf036226; Thu, 14 Sep 2006 14:09:24 +0200 (CEST) (envelope-from ticso) Date: Thu, 14 Sep 2006 14:09:24 +0200 From: Bernd Walter To: Warner Losh Message-ID: <20060914120923.GH28441@cicely12.cicely.de> References: <200609132224.k8DMOV2T072236@repoman.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200609132224.k8DMOV2T072236@repoman.freebsd.org> X-Operating-System: FreeBSD cicely12.cicely.de 5.4-STABLE alpha User-Agent: Mutt/1.5.9i X-Spam-Status: No, score=-4.4 required=5.0 autolearn=unavailable version=3.1.1 X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on cicely12.cicely.de Cc: Perforce Change Reviews Subject: Re: PERFORCE change 106081 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: ticso@cicely.de List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Sep 2006 12:09:35 -0000 On Wed, Sep 13, 2006 at 10:24:31PM +0000, Warner Losh wrote: > http://perforce.freebsd.org/chv.cgi?CH=106081 > > Change 106081 by imp@imp_lighthouse on 2006/09/13 22:24:24 > > SD cards now detected > > # Had to disable strategy and make it EIO since we have an interrupt > # problem elsewhere that was keeping bio's in flight which was hanging > # the boot. You can just remove enabling the interrupts. It should work by polling the status later. Is the SEL_DESEL_CARD_CMD Ok for SD? -- B.Walter http://www.bwct.de http://www.fizon.de bernd@bwct.de info@bwct.de support@fizon.de From owner-p4-projects@FreeBSD.ORG Thu Sep 14 13:15:56 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id DE25616A47E; Thu, 14 Sep 2006 13:15:55 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7634316A416 for ; Thu, 14 Sep 2006 13:15:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id A22E643D46 for ; Thu, 14 Sep 2006 13:15:54 +0000 (GMT) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8EDFssE087864 for ; Thu, 14 Sep 2006 13:15:54 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8EDFsxo087861 for perforce@freebsd.org; Thu, 14 Sep 2006 13:15:54 GMT (envelope-from hselasky@FreeBSD.org) Date: Thu, 14 Sep 2006 13:15:54 GMT Message-Id: <200609141315.k8EDFsxo087861@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 106096 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Sep 2006 13:15:56 -0000 http://perforce.freebsd.org/chv.cgi?CH=106096 Change 106096 by hselasky@hselasky_mini_itx on 2006/09/14 13:15:46 Finished reworking "urio". Please test! Added two new functions to the USB-cdev API. Affected files ... .. //depot/projects/usb/src/sys/dev/usb/rio500_usb.h#3 add .. //depot/projects/usb/src/sys/dev/usb/urio.c#5 edit .. //depot/projects/usb/src/sys/dev/usb/usb_cdev.c#8 edit .. //depot/projects/usb/src/sys/dev/usb/usb_subr.h#22 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb/urio.c#5 (text+ko) ==== @@ -1,0 +1,594 @@ +/*- + * Copyright (c) 2000 Iwasa Kazmi + * All rights reserved. + * + * 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. + * + * This code is based on ugen.c and ulpt.c developed by Lennart Augustsson. + * This code includes software developed by the NetBSD Foundation, Inc. and + * its contributors. + */ + +#include +__FBSDID("$FreeBSD: src/sys/dev/usb/urio.c,v 1.35 2005/01/06 01:43:29 imp Exp $"); + + +/* + * 2000/3/24 added NetBSD/OpenBSD support (from Alex Nemirovsky) + * 2000/3/07 use two bulk-pipe handles for read and write (Dirk) + * 2000/3/06 change major number(143), and copyright header + * some fix for 4.0 (Dirk) + * 2000/3/05 codes for FreeBSD 4.x - CURRENT (Thanks to Dirk-Willem van Gulik) + * 2000/3/01 remove retry code from urioioctl() + * change method of bulk transfer (no interrupt) + * 2000/2/28 small fixes for new rio_usb.h + * 2000/2/24 first version. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "usbdevs.h" + +#include + +#ifdef USB_DEBUG +#define DPRINTF(sc,n,fmt,...) do { \ + if (urio_debug > (n)) \ + printf("%s:%s: " fmt, (sc)->sc_name, \ + __FUNCTION__ ,##__VA_ARGS__); \ +} while(0) + +static int urio_debug = 0; +SYSCTL_NODE(_hw_usb, OID_AUTO, urio, CTLFLAG_RW, 0, "USB urio"); +SYSCTL_INT(_hw_usb_urio, OID_AUTO, debug, CTLFLAG_RW, + &urio_debug, 0, "urio debug level"); +#else +#define DPRINTF(...) /* nop */ +#endif + +#define URIO_T_WR 0 +#define URIO_T_RD 1 +#define URIO_T_WR_CS 2 +#define URIO_T_RD_CS 3 +#define URIO_T_MAX 4 + +#define URIO_BSIZE (1<<12) /* bytes */ +#define URIO_IFQ_MAXLEN 2 /* units */ + +struct urio_softc { + struct usb_cdev sc_cdev; + struct mtx sc_mtx; + struct usbd_memory_wait sc_mem_wait; + + device_t sc_dev; + struct usbd_device * sc_udev; + struct usbd_xfer * sc_xfer[URIO_T_MAX]; + + u_int8_t sc_flags; +#define URIO_FLAG_READ_STALL 0x01 /* read transfer stalled */ +#define URIO_FLAG_WRITE_STALL 0x02 /* write transfer stalled */ + + u_int8_t sc_name[16]; +}; + +/* prototypes */ + +static device_probe_t urio_probe; +static device_attach_t urio_attach; +static device_detach_t urio_detach; + +static void +urio_write_callback(struct usbd_xfer *xfer); + +static void +urio_write_clear_stall_callback(struct usbd_xfer *xfer); + +static void +urio_read_callback(struct usbd_xfer *xfer); + +static void +urio_read_clear_stall_callback(struct usbd_xfer *xfer); + +static void +urio_start_read(struct usb_cdev *cdev); + +static void +urio_stop_read(struct usb_cdev *cdev); + +static void +urio_start_write(struct usb_cdev *cdev); + +static void +urio_stop_write(struct usb_cdev *cdev); + +static int32_t +urio_open(struct usb_cdev *cdev, int32_t fflags, + int32_t devtype, struct thread *td); +static int32_t +urio_ioctl(struct usb_cdev *cdev, u_long cmd, caddr_t addr, + int32_t fflags, struct thread *td); + +static const struct usbd_config urio_config[URIO_T_MAX] = { + [URIO_T_WR] = { + .type = UE_BULK, + .endpoint = -1, /* any */ + .direction = UE_DIR_OUT, + .bufsize = URIO_BSIZE, + .flags = 0, + .callback = &urio_write_callback, + }, + + [URIO_T_RD] = { + .type = UE_BULK, + .endpoint = -1, /* any */ + .direction = UE_DIR_IN, + .bufsize = URIO_BSIZE, + .flags = USBD_SHORT_XFER_OK, + .callback = &urio_read_callback, + }, + + [URIO_T_WR_CS] = { + .type = UE_CONTROL, + .endpoint = 0x00, /* Control pipe */ + .direction = -1, + .bufsize = sizeof(usb_device_request_t), + .flags = USBD_USE_DMA, + .callback = &urio_write_clear_stall_callback, + .timeout = 1000, /* 1 second */ + }, + + [URIO_T_RD_CS] = { + .type = UE_CONTROL, + .endpoint = 0x00, /* Control pipe */ + .direction = -1, + .bufsize = sizeof(usb_device_request_t), + .flags = USBD_USE_DMA, + .callback = &urio_read_clear_stall_callback, + .timeout = 1000, /* 1 second */ + }, +}; + +static devclass_t urio_devclass; + +static device_method_t urio_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, urio_probe), + DEVMETHOD(device_attach, urio_attach), + DEVMETHOD(device_detach, urio_detach), + { 0, 0 } +}; + +static driver_t urio_driver = { + .name = "urio", + .methods = urio_methods, + .size = sizeof(struct urio_softc), +}; + +DRIVER_MODULE(urio, uhub, urio_driver, urio_devclass, usbd_driver_load, 0); + +MODULE_DEPEND(urio, usb, 1,1,1); + +static int +urio_probe(device_t dev) +{ + struct usb_attach_arg *uaa = device_get_ivars(dev); + usb_device_descriptor_t *dd; + + if (!uaa->iface) + return UMATCH_NONE; + + dd = usbd_get_device_descriptor(uaa->device); + + if (dd && + (((UGETW(dd->idVendor) == USB_VENDOR_DIAMOND) && + (UGETW(dd->idProduct) == USB_PRODUCT_DIAMOND_RIO500USB)) || + ((UGETW(dd->idVendor) == USB_VENDOR_DIAMOND2) && + ((UGETW(dd->idProduct) == USB_PRODUCT_DIAMOND2_RIO600USB) || + (UGETW(dd->idProduct) == USB_PRODUCT_DIAMOND2_RIO800USB))))) + return UMATCH_VENDOR_PRODUCT; + else + return UMATCH_NONE; +} + +static int +urio_attach(device_t dev) +{ + struct usb_attach_arg *uaa = device_get_ivars(dev); + struct urio_softc *sc = device_get_softc(dev); + const char * p_buf[2]; + int32_t error; + char buf_1[16]; + + if (sc == NULL) { + return ENOMEM; + } + + usbd_set_desc(dev, uaa->device); + + sc->sc_dev = dev; + sc->sc_udev = uaa->device; + + mtx_init(&(sc->sc_mtx), "urio lock", NULL, MTX_DEF|MTX_RECURSE); + + snprintf(sc->sc_name, sizeof(sc->sc_name), + "%s", device_get_nameunit(dev)); + + error = usbd_transfer_setup(uaa->device, uaa->iface_index, + sc->sc_xfer, urio_config, URIO_T_MAX, + sc, &(sc->sc_mtx), &(sc->sc_mem_wait)); + if (error) { + DPRINTF(sc, 0, "error=%s\n", usbd_errstr(error)) ; + goto detach; + } + + snprintf(buf_1, sizeof(buf_1), "urio%d", device_get_unit(dev)); + + p_buf[0] = buf_1; + p_buf[1] = NULL; + + sc->sc_cdev.sc_start_read = &urio_start_read; + sc->sc_cdev.sc_start_write = &urio_start_write; + sc->sc_cdev.sc_stop_read = &urio_stop_read; + sc->sc_cdev.sc_stop_write = &urio_stop_write; + sc->sc_cdev.sc_open = &urio_open; + sc->sc_cdev.sc_ioctl = &urio_ioctl; + sc->sc_cdev.sc_flags |= (USB_CDEV_FLAG_FWD_SHORT| + USB_CDEV_FLAG_WAKEUP_RD_IMMED| + USB_CDEV_FLAG_WAKEUP_WR_IMMED); + + error = usb_cdev_attach(&(sc->sc_cdev), sc, &(sc->sc_mtx), p_buf, + UID_ROOT, GID_OPERATOR, 0644, + URIO_BSIZE, URIO_IFQ_MAXLEN, + URIO_BSIZE, URIO_IFQ_MAXLEN); + if (error) { + goto detach; + } + + return 0; /* success */ + + detach: + urio_detach(dev); + return ENOMEM; /* failure */ +} + +static void +urio_write_callback(struct usbd_xfer *xfer) +{ + struct urio_softc *sc = xfer->priv_sc; + u_int32_t actlen; + + USBD_CHECK_STATUS(xfer); + + tr_transferred: + tr_setup: + if (sc->sc_flags & URIO_FLAG_WRITE_STALL) { + usbd_transfer_start(sc->sc_xfer[URIO_T_WR_CS]); + return; + } + if (usb_cdev_get_data(&(sc->sc_cdev), xfer->buffer, + URIO_BSIZE, &actlen, 0)) { + + xfer->length = actlen; + usbd_start_hardware(xfer); + } + return; + + tr_error: + if (xfer->error != USBD_CANCELLED) { + /* try to clear stall first */ + sc->sc_flags |= URIO_FLAG_WRITE_STALL; + usbd_transfer_start(sc->sc_xfer[URIO_T_WR_CS]); + } + return; +} + +static void +urio_write_clear_stall_callback(struct usbd_xfer *xfer) +{ + struct urio_softc *sc = xfer->priv_sc; + struct usbd_xfer *xfer_other = sc->sc_xfer[URIO_T_WR]; + + USBD_CHECK_STATUS(xfer); + + tr_setup: + /* start clear stall */ + usbd_clear_stall_tr_setup(xfer, xfer_other); + return; + + tr_transferred: + usbd_clear_stall_tr_transferred(xfer, xfer_other); + + sc->sc_flags &= ~URIO_FLAG_WRITE_STALL; + usbd_transfer_start(xfer_other); + return; + + tr_error: + /* bomb out */ + sc->sc_flags &= ~URIO_FLAG_WRITE_STALL; + usb_cdev_get_data_error(&(sc->sc_cdev)); + return; +} + +static void +urio_read_callback(struct usbd_xfer *xfer) +{ + struct urio_softc *sc = xfer->priv_sc; + struct usbd_mbuf *m; + + USBD_CHECK_STATUS(xfer); + + tr_transferred: + usb_cdev_put_data(&(sc->sc_cdev), xfer->buffer, xfer->actlen, 1); + + tr_setup: + if (sc->sc_flags & URIO_FLAG_READ_STALL) { + usbd_transfer_start(sc->sc_xfer[URIO_T_RD_CS]); + return; + } + + USBD_IF_POLL(&sc->sc_cdev.sc_rdq_free, m); + + if (m) { + usbd_start_hardware(xfer); + } + return; + + tr_error: + if (xfer->error != USBD_CANCELLED) { + /* try to clear stall first */ + sc->sc_flags |= URIO_FLAG_READ_STALL; + usbd_transfer_start(sc->sc_xfer[URIO_T_RD_CS]); + } + return; +} + +static void +urio_read_clear_stall_callback(struct usbd_xfer *xfer) +{ + struct urio_softc *sc = xfer->priv_sc; + struct usbd_xfer *xfer_other = sc->sc_xfer[URIO_T_RD]; + + USBD_CHECK_STATUS(xfer); + + tr_setup: + /* start clear stall */ + usbd_clear_stall_tr_setup(xfer, xfer_other); + return; + + tr_transferred: + usbd_clear_stall_tr_transferred(xfer, xfer_other); + + sc->sc_flags &= ~URIO_FLAG_READ_STALL; + usbd_transfer_start(xfer_other); + return; + + tr_error: + /* bomb out */ + sc->sc_flags &= ~URIO_FLAG_READ_STALL; + usb_cdev_put_data_error(&(sc->sc_cdev)); + return; +} + +static void +urio_start_read(struct usb_cdev *cdev) +{ + struct urio_softc *sc = cdev->sc_priv_ptr; + usbd_transfer_start(sc->sc_xfer[URIO_T_RD]); + return; +} + +static void +urio_stop_read(struct usb_cdev *cdev) +{ + struct urio_softc *sc = cdev->sc_priv_ptr; + usbd_transfer_stop(sc->sc_xfer[URIO_T_RD_CS]); + usbd_transfer_stop(sc->sc_xfer[URIO_T_RD]); + return; +} + +static void +urio_start_write(struct usb_cdev *cdev) +{ + struct urio_softc *sc = cdev->sc_priv_ptr; + usbd_transfer_start(sc->sc_xfer[URIO_T_WR]); + return; +} + +static void +urio_stop_write(struct usb_cdev *cdev) +{ + struct urio_softc *sc = cdev->sc_priv_ptr; + usbd_transfer_stop(sc->sc_xfer[URIO_T_WR_CS]); + usbd_transfer_stop(sc->sc_xfer[URIO_T_WR]); + return; +} + +static int32_t +urio_open(struct usb_cdev *cdev, int32_t fflags, + int32_t devtype, struct thread *td) +{ + struct urio_softc *sc = cdev->sc_priv_ptr; + + if ((fflags & (FWRITE|FREAD)) != (FWRITE|FREAD)) { + return EACCES; + } + + if (fflags & FREAD) { + /* clear stall first */ + sc->sc_flags |= URIO_FLAG_READ_STALL; + } + + if (fflags & FWRITE) { + /* clear stall first */ + sc->sc_flags |= URIO_FLAG_WRITE_STALL; + } + return 0; /* success */ +} + +static int32_t +urio_ioctl(struct usb_cdev *cdev, u_long cmd, caddr_t addr, + int32_t fflags, struct thread *td) +{ + usb_device_request_t req; + struct iovec iov; + struct uio uio; + + struct urio_softc *sc = cdev->sc_priv_ptr; + struct RioCommand *rio_cmd; + void *ptr = 0; + + int32_t error = 0; + + u_int16_t len; + u_int8_t requesttype; + + usb_cdev_unlock(cdev, fflags); + + switch (cmd) { + case RIO_RECV_COMMAND: + if (!(fflags & FWRITE)) { + error = EPERM; + goto done; + } + rio_cmd = (struct RioCommand *)addr; + if (rio_cmd == NULL) { + error = EINVAL; + goto done; + } + len = rio_cmd->length; + + requesttype = rio_cmd->requesttype | UT_READ_VENDOR_DEVICE; + DPRINTF(sc, 1, "sending command:reqtype=%0x req=%0x value=%0x index=%0x len=%0x\n", + requesttype, rio_cmd->request, rio_cmd->value, rio_cmd->index, len); + break; + + case RIO_SEND_COMMAND: + if (!(fflags & FWRITE)) { + error = EPERM; + goto done; + } + rio_cmd = (struct RioCommand *)addr; + if (rio_cmd == NULL) { + error = EINVAL; + goto done; + } + len = rio_cmd->length; + + requesttype = rio_cmd->requesttype | UT_WRITE_VENDOR_DEVICE; + DPRINTF(sc, 1, "sending command:reqtype=%0x req=%0x value=%0x index=%0x len=%0x\n", + requesttype, rio_cmd->request, rio_cmd->value, rio_cmd->index, len); + break; + + default: + error = EINVAL; + goto done; + } + + /* Send rio control message */ + req.bmRequestType = requesttype; + req.bRequest = rio_cmd->request; + USETW(req.wValue, rio_cmd->value); + USETW(req.wIndex, rio_cmd->index); + USETW(req.wLength, len); + + if (len > 32767) { + error = EINVAL; + goto done; + } + + if (len != 0) { + iov.iov_base = (caddr_t)rio_cmd->buffer; + iov.iov_len = len; + uio.uio_iov = &iov; + uio.uio_iovcnt = 1; + uio.uio_resid = len; + uio.uio_offset = 0; + uio.uio_segflg = UIO_USERSPACE; + uio.uio_rw = + ((req.bmRequestType & UT_READ) ? + UIO_READ : UIO_WRITE); + uio.uio_procp = td; + ptr = malloc(len, M_TEMP, M_WAITOK); + if (ptr == NULL) { + error = ENOMEM; + goto done; + } + if (uio.uio_rw == UIO_WRITE) { + error = uiomove(ptr, len, &uio); + if (error) { + goto done; + } + } + } + + mtx_lock(cdev->sc_mtx_ptr); + + error = usbd_do_request_flags_mtx + (sc->sc_udev, cdev->sc_mtx_ptr, + &req, ptr, 0, NULL, USBD_DEFAULT_TIMEOUT); + + mtx_unlock(cdev->sc_mtx_ptr); + + if (error == 0) { + if (len != 0) { + if (uio.uio_rw == UIO_READ) { + error = uiomove(ptr, len, &uio); + } + } + } else { + error = EIO; + } + done: + if (ptr) { + free(ptr, M_TEMP); + } + + return usb_cdev_lock(cdev, fflags, error); +} + +static int +urio_detach(device_t dev) +{ + struct urio_softc *sc = device_get_softc(dev); + + DPRINTF(sc, 0, "\n"); + + usb_cdev_detach(&(sc->sc_cdev)); + + usbd_transfer_unsetup(sc->sc_xfer, URIO_T_MAX); + + usbd_transfer_drain(&(sc->sc_mem_wait), &(sc->sc_mtx)); + + mtx_destroy(&(sc->sc_mtx)); + + return 0; +} ==== //depot/projects/usb/src/sys/dev/usb/usb_cdev.c#8 (text+ko) ==== @@ -221,6 +221,35 @@ return; } +void +usb_cdev_unlock(struct usb_cdev *sc, int32_t fflags) +{ + u_int32_t context_bit = usb_cdev_get_context(fflags); + + context_bit &= (USB_CDEV_FLAG_SLEEP_IOCTL_RD| + USB_CDEV_FLAG_SLEEP_IOCTL_WR); + + sc->sc_flags |= context_bit; + + mtx_unlock(sc->sc_mtx_ptr); + + return; +} + +int32_t +usb_cdev_lock(struct usb_cdev *sc, int32_t fflags, + int32_t error) +{ + u_int32_t context_bit = usb_cdev_get_context(fflags); + + context_bit &= (USB_CDEV_FLAG_SLEEP_IOCTL_RD| + USB_CDEV_FLAG_SLEEP_IOCTL_WR); + + mtx_lock(sc->sc_mtx_ptr); + + return usb_cdev_exit_context(sc, context_bit, error); +} + /* * the synchronization part is a little more * complicated, hence there are two modes: ==== //depot/projects/usb/src/sys/dev/usb/usb_subr.h#22 (text+ko) ==== @@ -1164,6 +1164,12 @@ extern void usb_cdev_wakeup(struct usb_cdev *sc); +extern void +usb_cdev_unlock(struct usb_cdev *sc, int32_t fflags); + +extern int32_t +usb_cdev_lock(struct usb_cdev *sc, int32_t fflags, int32_t error); + extern int32_t usb_cdev_attach(struct usb_cdev *sc, void *priv_sc, From owner-p4-projects@FreeBSD.ORG Thu Sep 14 13:57:49 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E412016A412; Thu, 14 Sep 2006 13:57:48 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A7F6916A407 for ; Thu, 14 Sep 2006 13:57:48 +0000 (UTC) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4625943D45 for ; Thu, 14 Sep 2006 13:57:48 +0000 (GMT) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8EDvm2g001034 for ; Thu, 14 Sep 2006 13:57:48 GMT (envelope-from piso@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8EDvlI6001031 for perforce@freebsd.org; Thu, 14 Sep 2006 13:57:47 GMT (envelope-from piso@freebsd.org) Date: Thu, 14 Sep 2006 13:57:47 GMT Message-Id: <200609141357.k8EDvlI6001031@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to piso@freebsd.org using -f From: Paolo Pisati To: Perforce Change Reviews Cc: Subject: PERFORCE change 106098 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Sep 2006 13:57:49 -0000 http://perforce.freebsd.org/chv.cgi?CH=106098 Change 106098 by piso@piso_longino on 2006/09/14 13:56:46 Trim unnecessary headers. Affected files ... .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias.c#14 edit .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_cuseeme.c#12 edit .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_db.c#10 edit .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_dummy.c#11 edit .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_ftp.c#11 edit .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_irc.c#12 edit .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_local.h#6 edit .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_mod.c#22 edit .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_nbt.c#12 edit .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_pptp.c#11 edit .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_proxy.c#7 edit .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_skinny.c#10 edit .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_smedia.c#11 edit Differences ... ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias.c#14 (text+ko) ==== @@ -113,9 +113,6 @@ #ifdef _KERNEL #include -#include -#include -#include #else #include #include ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_cuseeme.c#12 (text+ko) ==== @@ -31,15 +31,8 @@ #ifdef _KERNEL #include -#include -#include -#include -#include #include -#include -#include #include -#include #else #include #include @@ -52,7 +45,6 @@ #include #ifdef _KERNEL -#include #include #include #else ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_db.c#10 (text+ko) ==== @@ -146,30 +146,18 @@ #include #include #include +#include +#include #else #include -#include -#endif - +#include +#include #include -#include -#include #include - -#ifdef _KERNEL -#include -#include -#include -#else -#include -#include #include #endif -/* BSD network include files */ -#include -#include -#include +#include #include #ifdef _KERNEL @@ -177,7 +165,6 @@ #include #include #include -#include #else #include "alias.h" #include "alias_local.h" ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_dummy.c#11 (text+ko) ==== @@ -34,29 +34,20 @@ #ifdef _KERNEL #include -#include -#include -#include #include -#include -#include #include -#include #else #include #include -#include #include -#include #endif #include #include #include -#include +#include #ifdef _KERNEL -#include #include #include #else ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_ftp.c#11 (text+ko) ==== @@ -72,19 +72,13 @@ #ifdef _KERNEL #include #include -#include #include #include -#include -#include #include -#include #else #include #include -#include #include -#include #endif #include @@ -93,7 +87,6 @@ #include #ifdef _KERNEL -#include #include #include #else ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_irc.c#12 (text+ko) ==== @@ -50,21 +50,15 @@ /* Includes */ #ifdef _KERNEL #include -#include #include +#include #include #include -#include -#include #include -#include -#include #else #include #include -#include #include -#include #include #endif @@ -74,7 +68,6 @@ #include #ifdef _KERNEL -#include #include #include #else ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_local.h#6 (text+ko) ==== @@ -46,21 +46,12 @@ #ifndef _ALIAS_LOCAL_H_ #define _ALIAS_LOCAL_H_ -#include #include #include #ifdef _KERNEL -#include #include -#include #include -#include -#include -#include -#endif - -#ifdef _KERNEL /* XXX: LibAliasSetTarget() uses this constant. */ #define INADDR_NONE 0xffffffff #endif ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_mod.c#22 (text+ko) ==== @@ -30,8 +30,6 @@ #include #include #include -#include -#include #else #include #include @@ -42,25 +40,15 @@ #include #include #include -#include -#include -#include - -#include -#include -#include #ifdef _KERNEL #include #include #else -#include "alias.h" #include "alias_local.h" #include "alias_mod.h" #endif -#include - /* Protocol and userland module handlers chains. */ LIST_HEAD(handler_chain, proto_handler) handler_chain = LIST_HEAD_INITIALIZER(foo); #ifdef _KERNEL ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_nbt.c#12 (text+ko) ==== @@ -43,30 +43,21 @@ /* Includes */ #ifdef _KERNEL #include -#include -#include #include #include -#include -#include #include -#include #else #include #include -#include #include -#include #endif #include #include #include #include -#include #ifdef _KERNEL -#include #include #include #else ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_pptp.c#11 (text+ko) ==== @@ -41,17 +41,10 @@ /* Includes */ #ifdef _KERNEL +#include #include -#include -#include -#include -#include -#include #include -#include -#include #include -#include #else #include #include @@ -59,9 +52,6 @@ #include #endif -#include -#include -#include #include #ifdef _KERNEL ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_proxy.c#7 (text+ko) ==== @@ -58,12 +58,9 @@ #include #include #include -#include -#include #include #else #include -#include #include #include #include @@ -71,10 +68,6 @@ #include #endif -/* BSD IPV4 includes */ -#include -#include -#include #include #ifdef _KERNEL ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_skinny.c#10 (text+ko) ==== @@ -32,20 +32,11 @@ #ifdef _KERNEL #include -#include #include -#include -#include #include -#include -#include -#include #else #include -#include -#include #include -#include #include #endif @@ -53,10 +44,8 @@ #include #include #include -#include #ifdef _KERNEL -#include #include #include #else ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_smedia.c#11 (text+ko) ==== @@ -100,13 +100,9 @@ #ifdef _KERNEL #include -#include #include #include -#include -#include #include -#include #else #include #include @@ -118,10 +114,8 @@ #include #include #include -#include #ifdef _KERNEL -#include #include #include #else From owner-p4-projects@FreeBSD.ORG Thu Sep 14 15:19:32 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3BB2B16A412; Thu, 14 Sep 2006 15:19:32 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DA61D16A403 for ; Thu, 14 Sep 2006 15:19:31 +0000 (UTC) (envelope-from csjp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9E14143D45 for ; Thu, 14 Sep 2006 15:19:31 +0000 (GMT) (envelope-from csjp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8EFJVrw020159 for ; Thu, 14 Sep 2006 15:19:31 GMT (envelope-from csjp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8EFJUgS020156 for perforce@freebsd.org; Thu, 14 Sep 2006 15:19:31 GMT (envelope-from csjp@freebsd.org) Date: Thu, 14 Sep 2006 15:19:31 GMT Message-Id: <200609141519.k8EFJUgS020156@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to csjp@freebsd.org using -f From: "Christian S.J. Peron" To: Perforce Change Reviews Cc: Subject: PERFORCE change 106100 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Sep 2006 15:19:32 -0000 http://perforce.freebsd.org/chv.cgi?CH=106100 Change 106100 by csjp@csjp_xor on 2006/09/14 15:19:12 Fix processing of userspace records, Right now, if the kernel record is not selected, then the userspace record is thrown away along with it, even if the userspace record itself was selected. Affected files ... .. //depot/projects/trustedbsd/audit3/sys/security/audit/audit.c#36 edit .. //depot/projects/trustedbsd/audit3/sys/security/audit/audit_private.h#32 edit .. //depot/projects/trustedbsd/audit3/sys/security/audit/audit_syscalls.c#22 edit .. //depot/projects/trustedbsd/audit3/sys/security/audit/audit_worker.c#15 edit Differences ... ==== //depot/projects/trustedbsd/audit3/sys/security/audit/audit.c#36 (text+ko) ==== @@ -399,8 +399,8 @@ if (audit_pipe_preselect(auid, event, class, sorf, ar->k_ar_commit & AR_PRESELECT_TRAIL) != 0) ar->k_ar_commit |= AR_PRESELECT_PIPE; - if ((ar->k_ar_commit & (AR_PRESELECT_TRAIL | AR_PRESELECT_PIPE)) == - 0) { + if ((ar->k_ar_commit & (AR_PRESELECT_TRAIL | AR_PRESELECT_PIPE | + AR_PRESELECT_USER_TRAIL | AR_PRESELECT_USER_PIPE)) == 0) { mtx_lock(&audit_mtx); audit_pre_q_len--; mtx_unlock(&audit_mtx); ==== //depot/projects/trustedbsd/audit3/sys/security/audit/audit_private.h#32 (text+ko) ==== @@ -96,6 +96,8 @@ #define AR_PRESELECT_TRAIL 0x00001000U #define AR_PRESELECT_PIPE 0x00002000U +#define AR_PRESELECT_USER_TRAIL 0x00004000U +#define AR_PRESELECT_USER_PIPE 0x00008000U /* * Audit data is generated as a stream of struct audit_record structures, * linked by struct kaudit_record, and contain storage for possible audit so ==== //depot/projects/trustedbsd/audit3/sys/security/audit/audit_syscalls.c#22 (text+ko) ==== @@ -139,6 +139,13 @@ ar->k_udata = rec; ar->k_ulen = uap->length; ar->k_ar_commit |= AR_COMMIT_USER; + /* + * Currently we assume that all preselection has been performed in + * userspace. We unconditionally set these masks so that the records + * get committed both to the trail and pipe. In the future we will + * want to setup kernel based preselection. + */ + ar->k_ar_commit |= (AR_PRESELECT_USER_TRAIL | AR_PRESELECT_USER_PIPE); return (0); free_out: ==== //depot/projects/trustedbsd/audit3/sys/security/audit/audit_worker.c#15 (text+ko) ==== @@ -322,8 +322,8 @@ au_id_t auid; int sorf; - if ((ar->k_ar_commit & AR_COMMIT_USER) && - (ar->k_ar_commit & AR_PRESELECT_TRAIL)) { + if ((ar->k_ar_commit & AR_COMMIT_USER) != 0 && + (ar->k_ar_commit & AR_PRESELECT_USER_TRAIL)) { error = audit_record_write(audit_vp, audit_cred, audit_td, ar->k_udata, ar->k_ulen); if (error && audit_panic_on_write_fail) @@ -331,11 +331,14 @@ else if (error) printf("audit_worker: write error %d\n", error); } - if ((ar->k_ar_commit & AR_COMMIT_USER) && - (ar->k_ar_commit & AR_PRESELECT_PIPE)) + if ((ar->k_ar_commit & AR_COMMIT_USER) != 0 && + (ar->k_ar_commit & AR_PRESELECT_USER_PIPE)) { audit_pipe_submit_user(ar->k_udata, ar->k_ulen); + } - if (!(ar->k_ar_commit & AR_COMMIT_KERNEL)) + if (!(ar->k_ar_commit & AR_COMMIT_KERNEL) || + ((ar->k_ar_commit & AR_PRESELECT_PIPE) == 0 && + (ar->k_ar_commit & AR_PRESELECT_TRAIL) == 0)) return; auid = ar->k_ar.ar_subj_auid; From owner-p4-projects@FreeBSD.ORG Thu Sep 14 17:51:56 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 79CB316A4C2; Thu, 14 Sep 2006 17:51:56 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3326016A492 for ; Thu, 14 Sep 2006 17:51:56 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6F19643D7C for ; Thu, 14 Sep 2006 17:51:47 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8EHplhS038498 for ; Thu, 14 Sep 2006 17:51:47 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8EHpj4h038492 for perforce@freebsd.org; Thu, 14 Sep 2006 17:51:45 GMT (envelope-from imp@freebsd.org) Date: Thu, 14 Sep 2006 17:51:45 GMT Message-Id: <200609141751.k8EHpj4h038492@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 106104 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Sep 2006 17:51:56 -0000 http://perforce.freebsd.org/chv.cgi?CH=106104 Change 106104 by imp@imp_paco-paco on 2006/09/14 17:51:08 IFC @106102 minus new bintuils/etc changes Affected files ... .. //depot/projects/arm/src/MAINTAINERS#3 integrate .. //depot/projects/arm/src/lib/libc/sys/send.2#2 integrate .. //depot/projects/arm/src/lib/libpam/modules/pam_login_access/login.access.5#2 integrate .. //depot/projects/arm/src/sbin/mount_std/mount_std.c#2 integrate .. //depot/projects/arm/src/sbin/sconfig/sconfig.c#2 integrate .. //depot/projects/arm/src/share/examples/etc/make.conf#2 integrate .. //depot/projects/arm/src/share/man/man4/ipmi.4#2 integrate .. //depot/projects/arm/src/share/man/man4/tcp.4#2 integrate .. //depot/projects/arm/src/share/man/man7/hier.7#4 integrate .. //depot/projects/arm/src/share/man/man9/device_add_child.9#2 integrate .. //depot/projects/arm/src/share/mk/bsd.lib.mk#4 integrate .. //depot/projects/arm/src/share/mk/bsd.prog.mk#3 integrate .. //depot/projects/arm/src/sys/amd64/amd64/local_apic.c#12 integrate .. //depot/projects/arm/src/sys/amd64/amd64/mp_machdep.c#11 integrate .. //depot/projects/arm/src/sys/contrib/pf/net/pf.c#6 integrate .. //depot/projects/arm/src/sys/dev/ata/ata-chipset.c#28 integrate .. //depot/projects/arm/src/sys/dev/ata/ata-raid.h#9 integrate .. //depot/projects/arm/src/sys/dev/bktr/bktr_i2c.c#3 integrate .. //depot/projects/arm/src/sys/dev/em/if_em.c#29 integrate .. //depot/projects/arm/src/sys/dev/ichsmb/ichsmb.c#5 integrate .. //depot/projects/arm/src/sys/dev/iicbus/iicsmb.c#3 integrate .. //depot/projects/arm/src/sys/dev/sio/sio_pccard.c#3 integrate .. //depot/projects/arm/src/sys/dev/smbus/smb.c#4 integrate .. //depot/projects/arm/src/sys/dev/smbus/smb.h#2 integrate .. //depot/projects/arm/src/sys/dev/smbus/smbconf.c#2 integrate .. //depot/projects/arm/src/sys/dev/smbus/smbconf.h#2 integrate .. //depot/projects/arm/src/sys/dev/smbus/smbus.c#5 integrate .. //depot/projects/arm/src/sys/dev/smbus/smbus.h#3 integrate .. //depot/projects/arm/src/sys/dev/smbus/smbus_if.m#2 integrate .. //depot/projects/arm/src/sys/dev/syscons/scmouse.c#3 integrate .. //depot/projects/arm/src/sys/dev/syscons/syscons.c#9 integrate .. //depot/projects/arm/src/sys/dev/syscons/syscons.h#4 integrate .. //depot/projects/arm/src/sys/fs/udf/osta.h#2 integrate .. //depot/projects/arm/src/sys/geom/mirror/g_mirror.c#18 integrate .. //depot/projects/arm/src/sys/geom/raid3/g_raid3.c#21 integrate .. //depot/projects/arm/src/sys/i386/conf/NOTES#17 integrate .. //depot/projects/arm/src/sys/i386/i386/busdma_machdep.c#10 integrate .. //depot/projects/arm/src/sys/i386/i386/local_apic.c#11 integrate .. //depot/projects/arm/src/sys/i386/i386/mp_machdep.c#10 integrate .. //depot/projects/arm/src/sys/kern/bus_if.m#7 integrate .. //depot/projects/arm/src/sys/kern/kern_exit.c#17 integrate .. //depot/projects/arm/src/sys/kern/subr_witness.c#11 integrate .. //depot/projects/arm/src/sys/kern/uipc_socket.c#23 integrate .. //depot/projects/arm/src/sys/kern/vfs_lookup.c#10 integrate .. //depot/projects/arm/src/sys/modules/ipfw/Makefile#4 integrate .. //depot/projects/arm/src/sys/modules/pf/Makefile#5 integrate .. //depot/projects/arm/src/sys/netinet/ip_fw2.c#19 integrate .. //depot/projects/arm/src/sys/netinet/tcp_input.c#17 integrate .. //depot/projects/arm/src/sys/netinet/tcp_output.c#6 integrate .. //depot/projects/arm/src/sys/netinet/tcp_syncache.c#12 integrate .. //depot/projects/arm/src/sys/netinet/tcp_var.h#10 integrate .. //depot/projects/arm/src/sys/nfs4client/nfs4_vfsops.c#6 integrate .. //depot/projects/arm/src/sys/nfs4client/nfs4_vnops.c#7 integrate .. //depot/projects/arm/src/sys/nfsclient/nfs_node.c#7 integrate .. //depot/projects/arm/src/sys/nfsclient/nfs_subs.c#6 integrate .. //depot/projects/arm/src/sys/nfsclient/nfs_vfsops.c#9 integrate .. //depot/projects/arm/src/sys/nfsclient/nfs_vnops.c#11 integrate .. //depot/projects/arm/src/sys/nfsclient/nfsnode.h#5 integrate .. //depot/projects/arm/src/sys/pci/alpm.c#4 integrate .. //depot/projects/arm/src/sys/pci/amdpm.c#6 integrate .. //depot/projects/arm/src/sys/pci/amdsmb.c#3 integrate .. //depot/projects/arm/src/sys/pci/intpm.c#4 integrate .. //depot/projects/arm/src/sys/pci/intpmreg.h#2 integrate .. //depot/projects/arm/src/sys/pci/nfsmb.c#4 integrate .. //depot/projects/arm/src/sys/pci/viapm.c#6 integrate .. //depot/projects/arm/src/sys/security/mac/mac_inet.c#2 integrate .. //depot/projects/arm/src/sys/security/mac_biba/mac_biba.c#6 integrate .. //depot/projects/arm/src/sys/security/mac_lomac/mac_lomac.c#3 integrate .. //depot/projects/arm/src/sys/security/mac_mls/mac_mls.c#4 integrate .. //depot/projects/arm/src/sys/sys/mac.h#4 integrate .. //depot/projects/arm/src/sys/sys/mac_policy.h#7 integrate .. //depot/projects/arm/src/sys/sys/mount.h#12 integrate .. //depot/projects/arm/src/tools/regression/priv/Makefile#1 branch .. //depot/projects/arm/src/tools/regression/priv/main.c#1 branch .. //depot/projects/arm/src/tools/regression/priv/main.h#1 branch .. //depot/projects/arm/src/tools/regression/priv/priv_acct.c#1 branch .. //depot/projects/arm/src/tools/regression/priv/priv_adjtime.c#1 branch .. //depot/projects/arm/src/tools/regression/priv/priv_clock_settime.c#1 branch .. //depot/projects/arm/src/tools/regression/priv/priv_io.c#1 branch .. //depot/projects/arm/src/tools/regression/priv/priv_kenv_set.c#1 branch .. //depot/projects/arm/src/tools/regression/priv/priv_kenv_unset.c#1 branch .. //depot/projects/arm/src/tools/regression/priv/priv_proc_setlogin.c#1 branch .. //depot/projects/arm/src/tools/regression/priv/priv_proc_setrlimit.c#1 branch .. //depot/projects/arm/src/tools/regression/priv/priv_sched_rtprio.c#1 branch .. //depot/projects/arm/src/tools/regression/priv/priv_sched_setpriority.c#1 branch .. //depot/projects/arm/src/tools/regression/priv/priv_settimeofday.c#1 branch .. //depot/projects/arm/src/tools/regression/priv/priv_sysctl_write.c#1 branch .. //depot/projects/arm/src/tools/regression/priv/priv_vfs_admin.c#1 branch .. //depot/projects/arm/src/tools/regression/priv/priv_vfs_chown.c#1 branch .. //depot/projects/arm/src/tools/regression/priv/priv_vfs_chroot.c#1 branch .. //depot/projects/arm/src/tools/regression/priv/priv_vfs_clearsugid.c#1 branch .. //depot/projects/arm/src/tools/regression/priv/priv_vfs_extattr_system.c#1 branch .. //depot/projects/arm/src/tools/regression/priv/priv_vfs_fhopen.c#1 branch .. //depot/projects/arm/src/tools/regression/priv/priv_vfs_fhstat.c#1 branch .. //depot/projects/arm/src/tools/regression/priv/priv_vfs_fhstatfs.c#1 branch .. //depot/projects/arm/src/tools/regression/priv/priv_vfs_generation.c#1 branch .. //depot/projects/arm/src/tools/regression/priv/priv_vfs_getfh.c#1 branch .. //depot/projects/arm/src/tools/regression/priv/priv_vfs_read_write.c#1 branch .. //depot/projects/arm/src/tools/regression/priv/priv_vfs_setgid.c#1 branch .. //depot/projects/arm/src/tools/regression/priv/priv_vfs_stickyfile.c#1 branch .. //depot/projects/arm/src/tools/regression/priv/priv_vm_madv_protect.c#1 branch .. //depot/projects/arm/src/tools/regression/priv/priv_vm_mlock.c#1 branch .. //depot/projects/arm/src/tools/regression/priv/priv_vm_munlock.c#1 branch .. //depot/projects/arm/src/tools/regression/priv/test_utimes.c#1 branch .. //depot/projects/arm/src/usr.bin/calendar/calendars/calendar.freebsd#3 integrate .. //depot/projects/arm/src/usr.bin/indent/indent.c#2 integrate .. //depot/projects/arm/src/usr.bin/login/login.1#2 integrate .. //depot/projects/arm/src/usr.bin/paste/paste.c#2 integrate .. //depot/projects/arm/src/usr.bin/su/su.1#2 integrate .. //depot/projects/arm/src/usr.sbin/edquota/edquota.c#2 integrate .. //depot/projects/arm/src/usr.sbin/rpc.statd/procs.c#3 integrate .. //depot/projects/arm/src/usr.sbin/rpc.statd/statd.c#2 integrate Differences ... ==== //depot/projects/arm/src/MAINTAINERS#3 (text+ko) ==== @@ -1,4 +1,4 @@ -$FreeBSD: src/MAINTAINERS,v 1.140 2006/08/31 09:51:33 cperciva Exp $ +$FreeBSD: src/MAINTAINERS,v 1.141 2006/09/11 19:39:46 simon Exp $ Please note that the content of this file is strictly advisory. No locks listed here are valid. The only strict review requirements @@ -119,6 +119,7 @@ bs{diff,patch} cperciva Pre-commit review requested. portsnap cperciva Pre-commit review requested. freebsd-update cperciva Pre-commit review requested. +openssl simon Pre-commit review requested. sys/netgraph/bluetooth emax Pre-commit review preferred. lib/libbluetooth emax Pre-commit review preferred. lib/libsdp emax Pre-commit review preferred. ==== //depot/projects/arm/src/lib/libc/sys/send.2#2 (text+ko) ==== @@ -30,9 +30,9 @@ .\" SUCH DAMAGE. .\" .\" From: @(#)send.2 8.2 (Berkeley) 2/21/94 -.\" $FreeBSD: src/lib/libc/sys/send.2,v 1.32 2005/06/15 19:04:04 ru Exp $ +.\" $FreeBSD: src/lib/libc/sys/send.2,v 1.33 2006/09/13 19:48:00 joel Exp $ .\" -.Dd February 15, 1995 +.Dd September 13, 2006 .Dt SEND 2 .Os .Sh NAME @@ -130,10 +130,7 @@ .Dv SOCK_STREAM sockets in the .Dv PF_INET -protocol family, and is used to implement Transaction -.Tn TCP -(see -.Xr ttcp 4 ) . +protocol family. .Dv MSG_DONTROUTE is usually used only by diagnostic or routing programs. .Dv MSG_NOSIGNAL ==== //depot/projects/arm/src/lib/libpam/modules/pam_login_access/login.access.5#2 (text+ko) ==== @@ -1,7 +1,7 @@ .\" -.\" $FreeBSD: src/lib/libpam/modules/pam_login_access/login.access.5,v 1.15 2006/03/06 13:15:12 yar Exp $ +.\" $FreeBSD: src/lib/libpam/modules/pam_login_access/login.access.5,v 1.17 2006/09/13 18:34:32 joel Exp $ .\" -.Dd April 30, 1994 +.Dd September 13, 2006 .Dt LOGIN.ACCESS 5 .Os .Sh NAME @@ -52,7 +52,6 @@ .El .Sh SEE ALSO .Xr login 1 , -.Xr pam 8 , .Xr pam_login_access 8 .Sh AUTHORS .An Guido van Rooij ==== //depot/projects/arm/src/sbin/mount_std/mount_std.c#2 (text+ko) ==== @@ -37,10 +37,8 @@ The Regents of the University of California. All rights reserved.\n"; #endif /* not lint */ -#ifndef lint -static const char rcsid[] = - "$FreeBSD: src/sbin/mount_std/mount_std.c,v 1.21 2005/06/10 09:51:42 delphij Exp $"; -#endif /* not lint */ +#include +__FBSDID("$FreeBSD: src/sbin/mount_std/mount_std.c,v 1.22 2006/09/13 04:50:44 charnier Exp $"); #include #include @@ -68,15 +66,13 @@ static void usage(void) __dead2; static void -catchsig(int s) +catchsig(int s __unused) { caughtsig = 1; } int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { int ch, mntflags; char mntpath[MAXPATHLEN]; @@ -154,7 +150,7 @@ } void -usage() +usage(void) { (void)fprintf(stderr, "usage: mount_%s [-o options] what_to_mount mount_point\n", ==== //depot/projects/arm/src/sbin/sconfig/sconfig.c#2 (text+ko) ==== @@ -15,8 +15,11 @@ * all derivative works or modified versions. * * Cronyx Id: sconfig.c,v 1.4.2.2 2005/11/09 13:01:35 rik Exp $ - * $FreeBSD: src/sbin/sconfig/sconfig.c,v 1.3 2006/01/30 21:08:30 rik Exp $ */ + +#include +__FBSDID("$FreeBSD: src/sbin/sconfig/sconfig.c,v 1.4 2006/09/12 17:54:35 charnier Exp $"); + #include #include #include @@ -39,9 +42,6 @@ int adapter_type; /* 0-sigma, 1-tau, 2-taupci, 3-tau32 */ char chan_name[16]; -extern char *optarg; -extern int optind; - static void usage (void) { @@ -257,7 +257,11 @@ } static void +#ifdef __linux__ print_ifconfig (int fd) +#else +print_ifconfig (int fd __unused) +#endif { char buf [64]; #ifdef __linux__ @@ -508,14 +512,14 @@ } static char * -format_e3_cv (unsigned long cv, unsigned long baud, unsigned long time) +format_e3_cv (unsigned long cv, unsigned long baud, unsigned long atime) { static char buf[80]; - if (!cv || !baud || !time) + if (!cv || !baud || !atime) sprintf (buf, " - "); else - sprintf (buf, "%10lu (%.1e)", cv, (double)cv/baud/time); + sprintf (buf, "%10lu (%.1e)", cv, (double)cv/baud/atime); return buf; } ==== //depot/projects/arm/src/share/examples/etc/make.conf#2 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/share/examples/etc/make.conf,v 1.277 2006/07/19 11:27:19 des Exp $ +# $FreeBSD: src/share/examples/etc/make.conf,v 1.278 2006/09/13 10:20:56 ru Exp $ # # NOTE: Please would any committer updating this file also update the # make.conf(5) manual page, if necessary, which is located in @@ -48,10 +48,14 @@ # CFLAGS controls the compiler settings used when compiling C code. # Note that optimization settings other than -O and -O2 are not recommended # or supported for compiling the world or the kernel - please revert any -# nonstandard optimization settings to "-O" or -O2 before submitting bug -# reports without patches to the developers. +# nonstandard optimization settings to "-O" or "-O2 -fno-strict-aliasing" +# before submitting bug reports without patches to the developers. +# +# Compiling with -fstrict-aliasing optimization breaks some [notable] ports. +# GCC turns on -fstrict-aliasing optimization at all levels above -O[1], so +# explicitly turn it off when using compiling with the -O2 optimization level. # -#CFLAGS= -O -pipe +#CFLAGS= -O2 -fno-strict-aliasing -pipe # # CXXFLAGS controls the compiler settings used when compiling C++ code. # Note that CXXFLAGS is initially set to the value of CFLAGS. If you wish ==== //depot/projects/arm/src/share/man/man4/ipmi.4#2 (text) ==== @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $FreeBSD: src/share/man/man4/ipmi.4,v 1.4 2006/04/20 18:29:59 brueffer Exp $ +.\" $FreeBSD: src/share/man/man4/ipmi.4,v 1.5 2006/09/13 21:11:13 jhb Exp $ .\" .Dd April 20, 2006 .Dt IPMI 4 @@ -34,7 +34,7 @@ .Sh SYNOPSIS .Cd "device ipmi" .Pp -.In sys/dev/ipmi.h +.In sys/ipmi.h .Ft int .Fn ioctl "int d" "IPMICTL_RECEIVE_MSG_TRUNC" "struct ipmi_recv *" .Ft int ==== //depot/projects/arm/src/share/man/man4/tcp.4#2 (text+ko) ==== @@ -30,9 +30,9 @@ .\" SUCH DAMAGE. .\" .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 -.\" $FreeBSD: src/share/man/man4/tcp.4,v 1.52 2005/08/25 13:47:41 glebius Exp $ +.\" $FreeBSD: src/share/man/man4/tcp.4,v 1.54 2006/09/13 15:47:26 glebius Exp $ .\" -.Dd August 25, 2005 +.Dd September 13, 2006 .Dt TCP 4 .Os .Sh NAME @@ -460,6 +460,24 @@ .It Va sack.initburst Control the number of SACK retransmissions done upon initiation of SACK recovery. +.It Va maxtcptw +When a TCP connection enters the +.Dv TIME_WAIT +state, its associated socket structure is freed, since it is of +negligible size and use, and a new structure is allocated to contain a +minimal amount of information necessary for sustaining a connection in +this state, called the compressed TCP TIME_WAIT state. +Since this structure is smaller than a socket structure, it can save +a significant amount of system memory. +The +.Va net.inet.tcp.maxtcptw +MIB variable controls the maximum number of these structures allocated. +By default, it is initialized to +.Va kern.ipc.maxsockets +/ 5. +.It Va nolocaltimewait +Suppress creating of compressed TCP TIME_WAIT states for connections in +which both endpoints are local. .El .Sh ERRORS A socket operation may fail with one of the following errors returned: ==== //depot/projects/arm/src/share/man/man7/hier.7#4 (text+ko) ==== @@ -30,9 +30,9 @@ .\" SUCH DAMAGE. .\" .\" @(#)hier.7 8.1 (Berkeley) 6/5/93 -.\" $FreeBSD: src/share/man/man7/hier.7,v 1.120 2006/08/03 05:46:32 jb Exp $ +.\" $FreeBSD: src/share/man/man7/hier.7,v 1.121 2006/09/13 17:46:19 joel Exp $ .\" -.Dd May 10, 2006 +.Dd September 13, 2006 .Dt HIER 7 .Os .Sh NAME @@ -121,9 +121,7 @@ .Xr named 8 .It Pa pam.d/ configuration files for the Pluggable Authentication Modules (PAM) -library; -see -.Xr pam 8 +library .It Pa periodic/ scripts that are run daily, weekly, and monthly, via .Xr cron 8 ; ==== //depot/projects/arm/src/share/man/man9/device_add_child.9#2 (text+ko) ==== @@ -26,9 +26,9 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $FreeBSD: src/share/man/man9/device_add_child.9,v 1.23 2006/01/13 11:24:08 ru Exp $ +.\" $FreeBSD: src/share/man/man9/device_add_child.9,v 1.25 2006/09/12 15:48:22 imp Exp $ .\" -.Dd May 13, 2004 +.Dd September 12, 2006 .Dt DEVICE_ADD_CHILD 9 .Os .Sh NAME @@ -108,9 +108,15 @@ Authors of bus drivers must likewise be careful when adding children when they are loaded and unloaded to avoid duplication of children devices. +.Pp +Identify routines should use +.Xr BUS_ADD_CHILD 9 +instead of +.Xr device_add_child 9 . .Sh RETURN VALUES The new device if successful, NULL otherwise. .Sh SEE ALSO +.Xr BUS_ADD_CHILD 9 , .Xr device 9 , .Xr device_find_child 9 , .Xr DEVICE_IDENTIFY 9 ==== //depot/projects/arm/src/share/mk/bsd.lib.mk#4 (text+ko) ==== @@ -1,5 +1,5 @@ # from: @(#)bsd.lib.mk 5.26 (Berkeley) 5/2/91 -# $FreeBSD: src/share/mk/bsd.lib.mk,v 1.177 2006/09/11 05:35:56 imp Exp $ +# $FreeBSD: src/share/mk/bsd.lib.mk,v 1.178 2006/09/13 23:27:21 obrien Exp $ # .include @@ -30,6 +30,7 @@ .if ${MK_ASSERT_DEBUG} == "no" CFLAGS+= -DNDEBUG +NO_WERROR= .endif .if defined(DEBUG_FLAGS) ==== //depot/projects/arm/src/share/mk/bsd.prog.mk#3 (text+ko) ==== @@ -1,5 +1,5 @@ # from: @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91 -# $FreeBSD: src/share/mk/bsd.prog.mk,v 1.148 2006/09/11 05:35:57 imp Exp $ +# $FreeBSD: src/share/mk/bsd.prog.mk,v 1.149 2006/09/13 23:27:21 obrien Exp $ .include @@ -12,6 +12,7 @@ .if ${MK_ASSERT_DEBUG} == "no" CFLAGS+= -DNDEBUG +NO_WERROR= .endif .if defined(DEBUG_FLAGS) ==== //depot/projects/arm/src/sys/amd64/amd64/local_apic.c#12 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/local_apic.c,v 1.28 2006/09/06 22:05:34 sobomax Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/local_apic.c,v 1.29 2006/09/11 20:12:42 jhb Exp $"); #include "opt_hwpmc_hooks.h" @@ -794,6 +794,76 @@ } } } + +static void +dump_mask(const char *prefix, uint32_t v, int base) +{ + int i, first; + + first = 1; + for (i = 0; i < 32; i++) + if (v & (1 << i)) { + if (first) { + db_printf("%s:", prefix); + first = 0; + } + db_printf(" %02x", base + i); + } + if (!first) + db_printf("\n"); +} + +/* Show info from the lapic regs for this CPU. */ +DB_SHOW_COMMAND(lapic, db_show_lapic) +{ + uint32_t v; + + db_printf("lapic ID = %d\n", lapic_id()); + v = lapic->version; + db_printf("version = %d.%d\n", (v & APIC_VER_VERSION) >> 4, + v & 0xf); + db_printf("max LVT = %d\n", (v & APIC_VER_MAXLVT) >> MAXLVTSHIFT); + v = lapic->svr; + db_printf("SVR = %02x (%s)\n", v & APIC_SVR_VECTOR, + v & APIC_SVR_ENABLE ? "enabled" : "disabled"); + db_printf("TPR = %02x\n", lapic->tpr); + +#define dump_field(prefix, index) \ + dump_mask(__XSTRING(prefix ## index), lapic->prefix ## index, \ + index * 32) + + db_printf("In-service Interrupts:\n"); + dump_field(isr, 0); + dump_field(isr, 1); + dump_field(isr, 2); + dump_field(isr, 3); + dump_field(isr, 4); + dump_field(isr, 5); + dump_field(isr, 6); + dump_field(isr, 7); + + db_printf("TMR Interrupts:\n"); + dump_field(tmr, 0); + dump_field(tmr, 1); + dump_field(tmr, 2); + dump_field(tmr, 3); + dump_field(tmr, 4); + dump_field(tmr, 5); + dump_field(tmr, 6); + dump_field(tmr, 7); + + db_printf("IRR Interrupts:\n"); + dump_field(irr, 0); + dump_field(irr, 1); + dump_field(irr, 2); + dump_field(irr, 3); + dump_field(irr, 4); + dump_field(irr, 5); + dump_field(irr, 6); + dump_field(irr, 7); + +#undef dump_field +} #endif /* ==== //depot/projects/arm/src/sys/amd64/amd64/mp_machdep.c#11 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/mp_machdep.c,v 1.276 2006/05/16 14:32:16 phk Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/mp_machdep.c,v 1.277 2006/09/11 20:10:42 jhb Exp $"); #include "opt_cpu.h" #include "opt_kstack_pages.h" @@ -342,7 +342,10 @@ setidt(IPI_INVLTLB, IDTVEC(invltlb), SDT_SYSIGT, SEL_KPL, 0); setidt(IPI_INVLPG, IDTVEC(invlpg), SDT_SYSIGT, SEL_KPL, 0); setidt(IPI_INVLRNG, IDTVEC(invlrng), SDT_SYSIGT, SEL_KPL, 0); - + + /* Install an inter-CPU IPI for cache invalidation. */ + setidt(IPI_INVLCACHE, IDTVEC(invlcache), SDT_SYSIGT, SEL_KPL, 0); + /* Install an inter-CPU IPI for all-CPU rendezvous */ setidt(IPI_RENDEZVOUS, IDTVEC(rendezvous), SDT_SYSIGT, SEL_KPL, 0); ==== //depot/projects/arm/src/sys/contrib/pf/net/pf.c#6 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/contrib/pf/net/pf.c,v 1.40 2005/12/25 23:52:00 mlaier Exp $ */ +/* $FreeBSD: src/sys/contrib/pf/net/pf.c,v 1.41 2006/09/12 04:25:11 csjp Exp $ */ /* $OpenBSD: pf.c,v 1.483 2005/03/15 17:38:43 dhartmei Exp $ */ /* @@ -42,6 +42,7 @@ #endif #ifdef __FreeBSD__ +#include "opt_mac.h" #include "opt_bpf.h" #include "opt_pf.h" @@ -78,6 +79,7 @@ #include #include #ifdef __FreeBSD__ +#include #include #include #else @@ -192,7 +194,12 @@ struct pf_addr *, struct pf_addr *, u_int16_t, u_int16_t *, u_int16_t *, u_int16_t *, u_int16_t *, u_int8_t, sa_family_t); +#ifdef __FreeBSD__ +void pf_send_tcp(struct mbuf *, + const struct pf_rule *, sa_family_t, +#else void pf_send_tcp(const struct pf_rule *, sa_family_t, +#endif const struct pf_addr *, const struct pf_addr *, u_int16_t, u_int16_t, u_int32_t, u_int32_t, u_int8_t, u_int16_t, u_int16_t, u_int8_t, int, @@ -1114,7 +1121,11 @@ cur->local_flags |= PFSTATE_EXPIRING; #endif if (cur->src.state == PF_TCPS_PROXY_DST) +#ifdef __FreeBSD__ + pf_send_tcp(NULL, cur->rule.ptr, cur->af, +#else pf_send_tcp(cur->rule.ptr, cur->af, +#endif &cur->ext.addr, &cur->lan.addr, cur->ext.port, cur->lan.port, cur->src.seqhi, cur->src.seqlo + 1, @@ -1574,7 +1585,11 @@ } void +#ifdef __FreeBSD__ +pf_send_tcp(struct mbuf *replyto, const struct pf_rule *r, sa_family_t af, +#else pf_send_tcp(const struct pf_rule *r, sa_family_t af, +#endif const struct pf_addr *saddr, const struct pf_addr *daddr, u_int16_t sport, u_int16_t dport, u_int32_t seq, u_int32_t ack, u_int8_t flags, u_int16_t win, u_int16_t mss, u_int8_t ttl, int tag, @@ -1613,6 +1628,16 @@ m = m_gethdr(M_DONTWAIT, MT_HEADER); if (m == NULL) return; +#ifdef __FreeBSD__ +#ifdef MAC + if (replyto) + mac_create_mbuf_netlayer(replyto, m); + else + mac_create_mbuf_from_firewall(m); +#else + (void)replyto; +#endif +#endif if (tag) { #ifdef __FreeBSD__ m->m_flags |= M_SKIP_FIREWALL; @@ -3146,7 +3171,11 @@ ack++; if (th->th_flags & TH_FIN) ack++; +#ifdef __FreeBSD__ + pf_send_tcp(m, r, af, pd->dst, +#else pf_send_tcp(r, af, pd->dst, +#endif pd->src, th->th_dport, th->th_sport, ntohl(th->th_ack), ack, TH_RST|TH_ACK, 0, 0, r->return_ttl, 1, pd->eh, kif->pfik_ifp); @@ -3347,7 +3376,11 @@ mss = pf_calc_mss(saddr, af, mss); mss = pf_calc_mss(daddr, af, mss); s->src.mss = mss; +#ifdef __FreeBSD__ + pf_send_tcp(NULL, r, af, daddr, saddr, th->th_dport, +#else pf_send_tcp(r, af, daddr, saddr, th->th_dport, +#endif th->th_sport, s->src.seqhi, ntohl(th->th_seq) + 1, TH_SYN|TH_ACK, 0, s->src.mss, 0, 1, NULL, NULL); REASON_SET(&reason, PFRES_SYNPROXY); @@ -4348,7 +4381,11 @@ REASON_SET(reason, PFRES_SYNPROXY); return (PF_DROP); } +#ifdef __FreeBSD__ + pf_send_tcp(NULL, (*state)->rule.ptr, pd->af, pd->dst, +#else pf_send_tcp((*state)->rule.ptr, pd->af, pd->dst, +#endif pd->src, th->th_dport, th->th_sport, (*state)->src.seqhi, ntohl(th->th_seq) + 1, TH_SYN|TH_ACK, 0, (*state)->src.mss, 0, 1, @@ -4387,7 +4424,12 @@ (*state)->src.max_win = MAX(ntohs(th->th_win), 1); if ((*state)->dst.seqhi == 1) (*state)->dst.seqhi = htonl(arc4random()); +#ifdef __FreeBSD__ + pf_send_tcp(NULL, (*state)->rule.ptr, pd->af, + &src->addr, +#else pf_send_tcp((*state)->rule.ptr, pd->af, &src->addr, +#endif &dst->addr, src->port, dst->port, (*state)->dst.seqhi, 0, TH_SYN, 0, (*state)->src.mss, 0, 0, NULL, NULL); @@ -4401,12 +4443,21 @@ } else { (*state)->dst.max_win = MAX(ntohs(th->th_win), 1); (*state)->dst.seqlo = ntohl(th->th_seq); +#ifdef __FreeBSD__ + pf_send_tcp(NULL, (*state)->rule.ptr, pd->af, pd->dst, +#else pf_send_tcp((*state)->rule.ptr, pd->af, pd->dst, +#endif pd->src, th->th_dport, th->th_sport, ntohl(th->th_ack), ntohl(th->th_seq) + 1, TH_ACK, (*state)->src.max_win, 0, 0, 0, NULL, NULL); +#ifdef __FreeBSD__ + pf_send_tcp(NULL, (*state)->rule.ptr, pd->af, + &src->addr, +#else pf_send_tcp((*state)->rule.ptr, pd->af, &src->addr, +#endif &dst->addr, src->port, dst->port, (*state)->src.seqhi + 1, (*state)->src.seqlo + 1, TH_ACK, (*state)->dst.max_win, 0, 0, 1, @@ -4685,7 +4736,11 @@ (*state)->src.state == TCPS_SYN_SENT) { /* Send RST for state mismatches during handshake */ if (!(th->th_flags & TH_RST)) +#ifdef __FreeBSD__ + pf_send_tcp(m, (*state)->rule.ptr, pd->af, +#else pf_send_tcp((*state)->rule.ptr, pd->af, +#endif pd->dst, pd->src, th->th_dport, th->th_sport, ntohl(th->th_ack), 0, TH_RST, 0, 0, ==== //depot/projects/arm/src/sys/dev/ata/ata-chipset.c#28 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/ata/ata-chipset.c,v 1.174 2006/09/11 19:48:30 sos Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/ata-chipset.c,v 1.175 2006/09/12 22:06:39 sos Exp $"); #include "opt_ata.h" #include @@ -4869,7 +4869,7 @@ ata_default_registers(dev); for (i = ATA_BMCMD_PORT; i <= ATA_BMDTP_PORT; i++) { ch->r_io[i].res = ctlr->r_res1; - ch->r_io[i].offset = i - ATA_BMCMD_PORT; + ch->r_io[i].offset = (i - ATA_BMCMD_PORT)+(ch->unit * ATA_BMIOSIZE); } ata_pci_hw(dev); } ==== //depot/projects/arm/src/sys/dev/ata/ata-raid.h#9 (text+ko) ==== @@ -23,7 +23,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/ata/ata-raid.h,v 1.44 2006/02/17 13:02:10 sos Exp $ + * $FreeBSD: src/sys/dev/ata/ata-raid.h,v 1.45 2006/09/12 20:37:22 sos Exp $ */ /* misc defines */ @@ -76,7 +76,7 @@ #define AR_F_SII_RAID 0x0800 #define AR_F_SIS_RAID 0x1000 #define AR_F_VIA_RAID 0x2000 -#define AR_F_FORMAT_MASK 0x1fff +#define AR_F_FORMAT_MASK 0x3fff u_int generation; u_int64_t total_sectors; ==== //depot/projects/arm/src/sys/dev/bktr/bktr_i2c.c#3 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/bktr/bktr_i2c.c,v 1.27 2005/05/29 04:42:19 nyan Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/bktr/bktr_i2c.c,v 1.28 2006/09/11 20:52:40 jhb Exp $"); /* * I2C support for the bti2c chipset. @@ -119,7 +119,7 @@ return (error); } -int bti2c_smb_callback(device_t dev, int index, caddr_t *data) +int bti2c_smb_callback(device_t dev, int index, void *data) { struct bktr_softc *bktr_sc = (struct bktr_softc *)device_get_softc(dev); struct bktr_i2c_softc *sc = &bktr_sc->i2c_sc; @@ -338,4 +338,6 @@ return (0); } +DRIVER_MODULE(smbus, bktr, smbus_driver, smbus_devclass, 0, 0); + #endif /* defined(BKTR_USE_FREEBSD_SMBUS) */ ==== //depot/projects/arm/src/sys/dev/em/if_em.c#29 (text+ko) ==== @@ -31,7 +31,7 @@ ***************************************************************************/ -/*$FreeBSD: src/sys/dev/em/if_em.c,v 1.143 2006/09/10 19:23:27 pdeuskar Exp $*/ +/*$FreeBSD: src/sys/dev/em/if_em.c,v 1.144 2006/09/11 20:59:01 pdeuskar Exp $*/ #ifdef HAVE_KERNEL_OPTION_HEADERS #include "opt_device_polling.h" @@ -1516,8 +1516,10 @@ */ if (do_tso && (m_head->m_len <= M_TSO_LEN)) { m_head = m_pullup(m_head, M_TSO_LEN + 4); - if (m_head == NULL) + *m_headp = m_head; + if (m_head == NULL) { return (ENOBUFS); + } } /* @@ -1578,7 +1580,7 @@ /* Do hardware assists */ m_head = *m_headp; - if ( ifp->if_hwassist > 0) { + if (ifp->if_hwassist > 0) { if (em_tso_setup(adapter, m_head, &txd_upper, &txd_lower)) { /* we need to make a final sentinel transmit desc */ tso_desc = TRUE; ==== //depot/projects/arm/src/sys/dev/ichsmb/ichsmb.c#5 (text+ko) ==== @@ -36,7 +36,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/ichsmb/ichsmb.c,v 1.15 2006/01/03 17:01:43 brian Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ichsmb/ichsmb.c,v 1.16 2006/09/11 20:52:41 jhb Exp $"); /* * Support for the SMBus controller logical device which is part of the @@ -51,6 +51,7 @@ #include #include #include +#include #include #include #include @@ -136,7 +137,7 @@ ********************************************************************/ int -ichsmb_callback(device_t dev, int index, caddr_t data) +ichsmb_callback(device_t dev, int index, void *data) { int smb_error = 0; @@ -381,7 +382,7 @@ KASSERT(sc->ich_cmd == -1, ("%s: ich_cmd=%d\n", __func__ , sc->ich_cmd)); if (count < 1 || count > 32) - return (EINVAL); + return (SMB_EINVAL); bcopy(buf, sc->block_data, count); sc->block_count = count; sc->block_index = 1; @@ -403,7 +404,7 @@ } int -ichsmb_bread(device_t dev, u_char slave, char cmd, u_char count, char *buf) +ichsmb_bread(device_t dev, u_char slave, char cmd, u_char *count, char *buf) { const sc_p sc = device_get_softc(dev); int smb_error; @@ -411,10 +412,10 @@ DBG("slave=0x%02x cmd=0x%02x count=%d\n", slave, (u_char)cmd, count); KASSERT(sc->ich_cmd == -1, ("%s: ich_cmd=%d\n", __func__ , sc->ich_cmd)); - if (count < 1 || count > 32) - return (EINVAL); + if (*count < 1 || *count > 32) + return (SMB_EINVAL); bzero(sc->block_data, sizeof(sc->block_data)); - sc->block_count = count; + sc->block_count = 0; sc->block_index = 0; sc->block_write = 0; @@ -423,11 +424,13 @@ bus_space_write_1(sc->io_bst, sc->io_bsh, ICH_XMIT_SLVA, (slave << 1) | ICH_XMIT_SLVA_READ); bus_space_write_1(sc->io_bst, sc->io_bsh, ICH_HST_CMD, cmd); - bus_space_write_1(sc->io_bst, sc->io_bsh, ICH_D0, count); /* XXX? */ + bus_space_write_1(sc->io_bst, sc->io_bsh, ICH_D0, *count); /* XXX? */ bus_space_write_1(sc->io_bst, sc->io_bsh, ICH_HST_CNT, ICH_HST_CNT_START | ICH_HST_CNT_INTREN | sc->ich_cmd); - if ((smb_error = ichsmb_wait(sc)) == SMB_ENOERR) - bcopy(sc->block_data, buf, sc->block_count); + if ((smb_error = ichsmb_wait(sc)) == SMB_ENOERR) { + bcopy(sc->block_data, buf, min(sc->block_count, *count)); + *count = sc->block_count; + } mtx_unlock(&sc->mutex); DBG("smb_error=%d\n", smb_error); #if ICHSMB_DEBUG @@ -669,14 +672,20 @@ } } -int ichsmb_detach(device_t dev) +int +ichsmb_detach(device_t dev) { const sc_p sc = device_get_softc(dev); + int error; - mtx_destroy(&sc->mutex); - bus_generic_detach(dev); + error = bus_generic_detach(dev); + if (error) + return (error); device_delete_child(dev, sc->smb); ichsmb_release_resources(sc); + mtx_destroy(&sc->mutex); return 0; } + +DRIVER_MODULE(smbus, ichsmb, smbus_driver, smbus_devclass, 0, 0); ==== //depot/projects/arm/src/sys/dev/iicbus/iicsmb.c#3 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/iicbus/iicsmb.c,v 1.13 2006/04/04 23:29:17 imp Exp $ + * $FreeBSD: src/sys/dev/iicbus/iicsmb.c,v 1.14 2006/09/11 20:52:41 jhb Exp $ * */ @@ -83,7 +83,7 @@ static void iicsmb_identify(driver_t *driver, device_t parent); static void iicsmb_intr(device_t dev, int event, char *buf); -static int iicsmb_callback(device_t dev, int index, caddr_t data); +static int iicsmb_callback(device_t dev, int index, void *data); static int iicsmb_quick(device_t dev, u_char slave, int how); static int iicsmb_sendb(device_t dev, u_char slave, char byte); static int iicsmb_recvb(device_t dev, u_char slave, char *byte); @@ -93,7 +93,7 @@ static int iicsmb_readw(device_t dev, u_char slave, char cmd, short *word); static int iicsmb_pcall(device_t dev, u_char slave, char cmd, short sdata, short *rdata); static int iicsmb_bwrite(device_t dev, u_char slave, char cmd, u_char count, char *buf); -static int iicsmb_bread(device_t dev, u_char slave, char cmd, u_char count, char *buf); +static int iicsmb_bread(device_t dev, u_char slave, char cmd, u_char *count, char *buf); static devclass_t iicsmb_devclass; @@ -247,7 +247,7 @@ } static int -iicsmb_callback(device_t dev, int index, caddr_t data) +iicsmb_callback(device_t dev, int index, void *data) { device_t parent = device_get_parent(dev); int error = 0; @@ -482,7 +482,7 @@ } static int -iicsmb_bread(device_t dev, u_char slave, char cmd, u_char count, char *buf) +iicsmb_bread(device_t dev, u_char slave, char cmd, u_char *count, char *buf) { device_t parent = device_get_parent(dev); int error, sent, read; @@ -496,9 +496,10 @@ if ((error = iicbus_repeated_start(parent, slave | LSB, IICBUS_TIMEOUT))) goto error; - if ((error = iicbus_read(parent, buf, (int)count, &read, + if ((error = iicbus_read(parent, buf, (int)*count, &read, IIC_LAST_READ, IICBUS_TIMEOUT))) >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Thu Sep 14 18:08:13 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 04A4316A47C; Thu, 14 Sep 2006 18:08:13 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D40AB16A417 for ; Thu, 14 Sep 2006 18:08:12 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id DE69843D6B for ; Thu, 14 Sep 2006 18:08:08 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8EI88Nk049511 for ; Thu, 14 Sep 2006 18:08:08 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8EI88Bb049508 for perforce@freebsd.org; Thu, 14 Sep 2006 18:08:08 GMT (envelope-from imp@freebsd.org) Date: Thu, 14 Sep 2006 18:08:08 GMT Message-Id: <200609141808.k8EI88Bb049508@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 106107 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Sep 2006 18:08:13 -0000 http://perforce.freebsd.org/chv.cgi?CH=106107 Change 106107 by imp@imp_lighthouse on 2006/09/14 18:07:41 bpf Affected files ... .. //depot/projects/arm/src/sys/arm/conf/TSC4370RAM#2 edit Differences ... ==== //depot/projects/arm/src/sys/arm/conf/TSC4370RAM#2 (text+ko) ==== @@ -101,3 +101,5 @@ # SPI bus device spibus device at45 # at45db642 and maybe others + +device bpf From owner-p4-projects@FreeBSD.ORG Thu Sep 14 18:08:14 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 03B4116A563; Thu, 14 Sep 2006 18:08:14 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D5FCD16A49E for ; Thu, 14 Sep 2006 18:08:13 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8A84C43D6A for ; Thu, 14 Sep 2006 18:08:08 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8EI88Dg049505 for ; Thu, 14 Sep 2006 18:08:08 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8EI88Pc049502 for perforce@freebsd.org; Thu, 14 Sep 2006 18:08:08 GMT (envelope-from imp@freebsd.org) Date: Thu, 14 Sep 2006 18:08:08 GMT Message-Id: <200609141808.k8EI88Pc049502@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 106106 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Sep 2006 18:08:14 -0000 http://perforce.freebsd.org/chv.cgi?CH=106106 Change 106106 by imp@imp_lighthouse on 2006/09/14 18:07:13 #ifdef'd out code to write primitive euid64 to the eeprom. Fix code that reads it in. print mac address onboot, for now. Affected files ... .. //depot/projects/arm/src/sys/boot/arm/at91/boot2/boot2.c#16 edit Differences ... ==== //depot/projects/arm/src/sys/boot/arm/at91/boot2/boot2.c#16 (text+ko) ==== @@ -205,20 +205,34 @@ MacFromEE() { uint32_t sig; +#if 0 + uint8_t euid64[8] = { 0x00, 0x30, 0x96, 0x20, + 0x00, 0x00, 0x00, 0x05 }; +#else uint8_t euid64[8]; +#endif +#if 0 + printf("writing...\n"); + sig = 0xaa55aa55; + EEWrite(0, (uint8_t *)&sig, sizeof(sig)); + EEWrite(48, euid64, sizeof(euid64)); +#endif + sig = 0; EERead(0, (uint8_t *)&sig, sizeof(sig)); if (sig != 0xaa55aa55) { printf("Bad signature %x\n", sig); return; } - EERead(48, euid64, 8); + EERead(48, euid64, sizeof(euid64)); mac[0] = euid64[0]; mac[1] = euid64[1]; - mac[2] = euid64[4]; + mac[2] = euid64[2]; mac[3] = euid64[5]; mac[4] = euid64[6]; - mac[6] = euid64[7]; + mac[5] = euid64[7]; + printf("MAC Address %x:%x:%x:%x:%x:%x\n", mac[0], + mac[1], mac[2], mac[3], mac[4], mac[5]); } int From owner-p4-projects@FreeBSD.ORG Thu Sep 14 18:09:11 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3E6E016A417; Thu, 14 Sep 2006 18:09:11 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1D3D016A403 for ; Thu, 14 Sep 2006 18:09:11 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9AB9F43D70 for ; Thu, 14 Sep 2006 18:09:10 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8EI9A8s049581 for ; Thu, 14 Sep 2006 18:09:10 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8EI9AwH049578 for perforce@freebsd.org; Thu, 14 Sep 2006 18:09:10 GMT (envelope-from imp@freebsd.org) Date: Thu, 14 Sep 2006 18:09:10 GMT Message-Id: <200609141809.k8EI9AwH049578@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 106108 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Sep 2006 18:09:11 -0000 http://perforce.freebsd.org/chv.cgi?CH=106108 Change 106108 by imp@imp_lighthouse on 2006/09/14 18:08:18 debugging checkpoint Affected files ... .. //depot/projects/arm/src/sys/arm/at91/at91_qdmmc.c#10 edit Differences ... ==== //depot/projects/arm/src/sys/arm/at91/at91_qdmmc.c#10 (text+ko) ==== @@ -76,7 +76,6 @@ uint32_t sector_size; uint64_t size; uint32_t mode; - uint32_t rca; /* Relative Card Address */ uint32_t flags; #define READ_PARTIAL 0x001 #define WRITE_PARTIAL 0x002 @@ -160,10 +159,10 @@ struct at91_qdmmc_softc *sc = device_get_softc(dev); // Send the CMD55 for application specific command - WR4(sc, MCI_ARGR, sc->cards[0].rca << 16); + WR4(sc, MCI_ARGR, sc->cards[0].addr << 16); WR4(sc, MCI_CMDR, APP_CMD); - printf("CMD55: %x\n", sc->cards[0].rca << 16); + printf("CMD55: %x\n", sc->cards[0].addr << 16); // wait for CMDRDY Status flag to read the response do @@ -195,7 +194,7 @@ // The RCA to be used for CMD55 in Idle state shall be the card's // default RCA=0x0000. - sc->cards[0].rca = 0; + sc->cards[0].addr = 0; while(!(response & AT91C_CARD_POWER_UP_BUSY)) { response = at91_qdmmc_SDCard_SendAppCommand(dev, SDCARD_APP_OP_COND_CMD, AT91C_MMC_HOST_VOLTAGE_RANGE); @@ -259,7 +258,7 @@ uint32_t ret_value, rca; char bus_width; - rca = sc->cards[0].rca; + rca = sc->cards[0].addr; do { ret_value = at91_qdmmc_GetStatus(dev, rca); } while (ret_value != 0xffffffff && @@ -300,13 +299,14 @@ printf("SD: Can't set RCA to 0\n"); return ENXIO; } - sc->cards[0].rca = RD4(sc, MCI_RSPR) >> 16; + sc->cards[0].addr = RD4(sc, MCI_RSPR) >> 16; + printf("SD Card at %#x\n", sc->cards[0].addr); csd = &sc->cards[0].CSD[0]; - if (at91_qdmmc_GetCSD(dev, sc->cards[0].rca, csd) != 0) { + if (at91_qdmmc_GetCSD(dev, sc->cards[0].addr, csd) != 0) { printf("SD: can't get csd\n"); return ENXIO; } - printf("Found SD Card - CID = 0x%08x%08x%08x%08x\n", + printf("SD Card - CID = 0x%08x%08x%08x%08x\n", cid[0], cid[1], cid[2], @@ -702,7 +702,7 @@ //printf("at91_qdmmc_strategy: called\n"); sc = (struct at91_qdmmc_softc *)bp->bio_disk->d_drv1; -#if 0 +#if 1 AT91_QDMMC_LOCK(sc); bioq_disksort(&sc->cards[0].bio_queue, bp); wakeup(sc); @@ -733,8 +733,8 @@ printf("at91_qdmmc_task: request %p\n", bp); if (bp->bio_cmd == BIO_READ) { status = at91_qdmmc_SendCommand(sc->dev, - SEL_DESEL_CARD_CMD, (sc->cards[0].addr) << 16); - printf("at91_qdmmc_task: select_card-status = 0x%x\n", status); + SEL_DESEL_CARD_CMD, sc->cards[0].addr << 16); + printf("at91_qdmmc_task: select_card-status(%x) = 0x%x\n", sc->cards[0].addr, status); status = at91_qdmmc_SendCommand(sc->dev, SET_BLOCKLEN_CMD, sc->cards[0].sector_size); printf("at91_qdmmc_task: set_blocklen-status = 0x%x\n", status); From owner-p4-projects@FreeBSD.ORG Thu Sep 14 21:03:14 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id BAD8516A417; Thu, 14 Sep 2006 21:03:14 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 95AD516A415 for ; Thu, 14 Sep 2006 21:03:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2A46843D7B for ; Thu, 14 Sep 2006 21:02:54 +0000 (GMT) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8EL2sqW074845 for ; Thu, 14 Sep 2006 21:02:54 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8EL2rsD074841 for perforce@freebsd.org; Thu, 14 Sep 2006 21:02:53 GMT (envelope-from hselasky@FreeBSD.org) Date: Thu, 14 Sep 2006 21:02:53 GMT Message-Id: <200609142102.k8EL2rsD074841@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 106119 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Sep 2006 21:03:15 -0000 http://perforce.freebsd.org/chv.cgi?CH=106119 Change 106119 by hselasky@hselasky_mini_itx on 2006/09/14 21:02:10 Finished reworking "udbp". Please test! Affected files ... .. //depot/projects/usb/src/sys/dev/usb/udbp.c#5 edit .. //depot/projects/usb/src/sys/dev/usb/udbp.h#3 add Differences ... ==== //depot/projects/usb/src/sys/dev/usb/udbp.c#5 (text+ko) ==== @@ -1,0 +1,914 @@ +/*- + * Copyright (c) 1996-2000 Whistle Communications, Inc. + * All rights reserved. + * + * 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 author 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 NICK HIBMA 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 AUTHOR 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. + * + */ + +#include +__FBSDID("$FreeBSD: src/sys/dev/usb/udbp.c,v 1.29 2005/01/06 01:43:28 imp Exp $"); + +/* Driver for arbitrary double bulk pipe devices. + * The driver assumes that there will be the same driver on the other side. + * + * XXX Some more information on what the framing of the IP packets looks like. + * + * To take full advantage of bulk transmission, packets should be chosen + * between 1k and 5k in size (1k to make sure the sending side starts + * streaming, and <5k to avoid overflowing the system with small TDs). + */ + + +/* probe/attach/detach: + * Connect the driver to the hardware and netgraph + * + * The reason we submit a bulk in transfer is that USB does not know about + * interrupts. The bulk transfer continuously polls the device for data. + * While the device has no data available, the device NAKs the TDs. As soon + * as there is data, the transfer happens and the data comes flowing in. + * + * In case you were wondering, interrupt transfers happen exactly that way. + * It therefore doesn't make sense to use the interrupt pipe to signal + * 'data ready' and then schedule a bulk transfer to fetch it. That would + * incur a 2ms delay at least, without reducing bandwidth requirements. + * + */ + +#include +#include +#include +#include + +#include +#include +#include + +#include "usbdevs.h" + +#include +#include +#include +#include +#include + +#ifdef USB_DEBUG +#define DPRINTF(sc,n,fmt,...) do { \ + if (udbp_debug > (n)) \ + printf("%s:%s: " fmt, (sc)->sc_name, \ + __FUNCTION__,## __VA_ARGS__); \ +} while(0) + +static int udbp_debug = 0; +SYSCTL_NODE(_hw_usb, OID_AUTO, udbp, CTLFLAG_RW, 0, "USB udbp"); +SYSCTL_INT(_hw_usb_udbp, OID_AUTO, debug, CTLFLAG_RW, + &udbp_debug, 0, "udbp debug level"); +#else +#define DPRINTF(...) /* nop */ +#endif + +#define UDBP_TIMEOUT 2000 /* timeout on outbound transfers, in msecs */ +#define UDBP_BUFFERSIZE MCLBYTES /* maximum number of bytes in one transfer */ +#define UDBP_T_WR 0 +#define UDBP_T_RD 1 +#define UDBP_T_WR_CS 2 +#define UDBP_T_RD_CS 3 +#define UDBP_T_MAX 4 +#define UDBP_Q_MAXLEN 50 + +struct udbp_softc { + + struct mtx sc_mtx; + struct usbd_memory_wait sc_mem_wait; + struct ng_bt_mbufq sc_xmitq_hipri; /* hi-priority transmit queue */ + struct ng_bt_mbufq sc_xmitq; /* low-priority transmit queue */ + + struct usbd_xfer * sc_xfer[UDBP_T_MAX]; + node_p sc_node; /* back pointer to node */ + hook_p sc_hook; /* pointer to the hook */ + struct mbuf * sc_bulk_in_buffer; + + u_int32_t sc_packets_in; /* packets in from downstream */ + u_int32_t sc_packets_out; /* packets out towards downstream */ + + u_int8_t sc_flags; +#define UDBP_FLAG_READ_STALL 0x01 /* read transfer stalled */ +#define UDBP_FLAG_WRITE_STALL 0x02 /* write transfer stalled */ + + u_int8_t sc_name[16]; +}; + +static int +udbp_modload(module_t mod, int event, void *data); + +static device_probe_t udbp_probe; +static device_attach_t udbp_attach; +static device_detach_t udbp_detach; + +static void +udbp_bulk_read_callback(struct usbd_xfer *xfer); + +static void +udbp_bulk_read_clear_stall_callback(struct usbd_xfer *xfer); + +static void +udbp_bulk_read_complete(node_p node, hook_p hook, void *arg1, int arg2); + +static void +udbp_bulk_write_callback(struct usbd_xfer *xfer); + +static void +udbp_bulk_write_clear_stall_callback(struct usbd_xfer *xfer); + +static ng_constructor_t ng_udbp_constructor; +static ng_rcvmsg_t ng_udbp_rcvmsg; +static ng_shutdown_t ng_udbp_rmnode; +static ng_newhook_t ng_udbp_newhook; +static ng_connect_t ng_udbp_connect; +static ng_rcvdata_t ng_udbp_rcvdata; +static ng_disconnect_t ng_udbp_disconnect; + +/* Parse type for struct ngudbpstat */ +static const struct ng_parse_struct_field + ng_udbp_stat_type_fields[] = NG_UDBP_STATS_TYPE_INFO; +static const struct ng_parse_type ng_udbp_stat_type = { + &ng_parse_struct_type, + &ng_udbp_stat_type_fields +}; + +/* List of commands and how to convert arguments to/from ASCII */ +static const struct ng_cmdlist ng_udbp_cmdlist[] = { + { + NGM_UDBP_COOKIE, + NGM_UDBP_GET_STATUS, + "getstatus", + NULL, + &ng_udbp_stat_type, + }, + { + NGM_UDBP_COOKIE, + NGM_UDBP_SET_FLAG, + "setflag", + &ng_parse_int32_type, + NULL + }, + { 0 } +}; + +/* Netgraph node type descriptor */ +static struct ng_type ng_udbp_typestruct = { + .version = NG_ABI_VERSION, + .name = NG_UDBP_NODE_TYPE, + .constructor = ng_udbp_constructor, + .rcvmsg = ng_udbp_rcvmsg, + .shutdown = ng_udbp_rmnode, + .newhook = ng_udbp_newhook, + .connect = ng_udbp_connect, + .rcvdata = ng_udbp_rcvdata, + .disconnect = ng_udbp_disconnect, + .cmdlist = ng_udbp_cmdlist, +}; + +/* USB config */ +static const struct usbd_config udbp_config[UDBP_T_MAX] = { + + [UDBP_T_WR] = { + .type = UE_BULK, + .endpoint = -1, /* any */ + .direction = UE_DIR_OUT, + .bufsize = UDBP_BUFFERSIZE, + .flags = USBD_USE_DMA|USBD_FORCE_SHORT_XFER, + .callback = &udbp_bulk_write_callback, + .timeout = UDBP_TIMEOUT, + }, + + [UDBP_T_RD] = { + .type = UE_BULK, + .endpoint = -1, /* any */ + .direction = UE_DIR_IN, + .bufsize = UDBP_BUFFERSIZE, + .flags = USBD_USE_DMA|USBD_SHORT_XFER_OK, + .callback = &udbp_bulk_read_callback, + }, + + [UDBP_T_WR_CS] = { + .type = UE_CONTROL, + .endpoint = 0x00, /* Control pipe */ + .direction = -1, + .bufsize = sizeof(usb_device_request_t), + .flags = USBD_USE_DMA, + .callback = &udbp_bulk_write_clear_stall_callback, + .timeout = 1000, /* 1 second */ + }, + + [UDBP_T_RD_CS] = { + .type = UE_CONTROL, + .endpoint = 0x00, /* Control pipe */ + .direction = -1, + .bufsize = sizeof(usb_device_request_t), + .flags = USBD_USE_DMA, + .callback = &udbp_bulk_read_clear_stall_callback, + .timeout = 1000, /* 1 second */ + }, +}; + +static devclass_t udbp_devclass; + +static device_method_t udbp_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, udbp_probe), + DEVMETHOD(device_attach, udbp_attach), + DEVMETHOD(device_detach, udbp_detach), + { 0, 0 } +}; + +static driver_t udbp_driver = { + .name = "udbp", + .methods = udbp_methods, + .size = sizeof(struct udbp_softc), +}; + +DRIVER_MODULE(udbp, uhub, udbp_driver, udbp_devclass, udbp_modload, 0); +MODULE_DEPEND(udbp, netgraph, NG_ABI_VERSION, NG_ABI_VERSION, NG_ABI_VERSION); +MODULE_DEPEND(udbp, usb, 1,1,1); + +static int +udbp_modload(module_t mod, int event, void *data) +{ + int error; + + switch (event) { + case MOD_LOAD: + error = ng_newtype(&ng_udbp_typestruct); + if (error != 0) { + printf("%s: Could not register " + "Netgraph node type, error=%d\n", + NG_UDBP_NODE_TYPE, error); + } + else + error = usbd_driver_load(mod, event, data); + break; + + case MOD_UNLOAD: + error = ng_rmtype(&ng_udbp_typestruct); + if (error == 0) + error = usbd_driver_load(mod, event, data); + break; + + default: + error = EOPNOTSUPP; + break; + } + return (error); +} + +static int +udbp_probe(device_t dev) +{ + struct usb_attach_arg *uaa = device_get_ivars(dev); + + if (!uaa->iface) + return (UMATCH_NONE); + + /* XXX Julian, add the id of the device if you have one to test + * things with. run 'usbdevs -v' and note the 3 ID's that appear. + * The Vendor Id and Product Id are in hex and the Revision Id is in + * bcd. But as usual if the revision is 0x101 then you should compare + * the revision id in the device descriptor with 0x101 + * Or go search the file usbdevs.h. Maybe the device is already in + * there. + */ + if (((uaa->vendor == USB_VENDOR_NETCHIP) && + (uaa->product == USB_PRODUCT_NETCHIP_TURBOCONNECT))) + return(UMATCH_VENDOR_PRODUCT); + + if (((uaa->vendor == USB_VENDOR_PROLIFIC) && + ((uaa->product == USB_PRODUCT_PROLIFIC_PL2301) || + (uaa->product == USB_PRODUCT_PROLIFIC_PL2302)))) + return(UMATCH_VENDOR_PRODUCT); + + if (((uaa->vendor == USB_VENDOR_ANCHOR) && + (uaa->product == USB_PRODUCT_ANCHOR_EZLINK))) + return(UMATCH_VENDOR_PRODUCT); + + return (UMATCH_NONE); +} + +static int +udbp_attach(device_t dev) +{ + struct usb_attach_arg *uaa = device_get_ivars(dev); + struct udbp_softc *sc = device_get_softc(dev); + int32_t error; + + if (sc == NULL) { + return ENOMEM; + } + + usbd_set_desc(dev, uaa->device); + + snprintf(sc->sc_name, sizeof(sc->sc_name), + "%s", device_get_nameunit(dev)); + + mtx_init(&(sc->sc_mtx), "udbp lock", NULL, MTX_DEF|MTX_RECURSE); + + error = usbd_transfer_setup(uaa->device, uaa->iface_index, + sc->sc_xfer, udbp_config, UDBP_T_MAX, + sc, &(sc->sc_mtx), &(sc->sc_mem_wait)); + if (error) { + DPRINTF(sc, 0, "error=%s\n", usbd_errstr(error)) ; + goto detach; + } + + NG_BT_MBUFQ_INIT(&(sc->sc_xmitq), UDBP_Q_MAXLEN); + + NG_BT_MBUFQ_INIT(&(sc->sc_xmitq_hipri), UDBP_Q_MAXLEN); + + /* create Netgraph node */ + + if (ng_make_node_common(&ng_udbp_typestruct, &sc->sc_node) != 0) { + printf("%s: Could not create Netgraph node\n", + sc->sc_name); + sc->sc_node = NULL; + goto detach; + } + + /* name node */ + + if (ng_name_node(sc->sc_node, sc->sc_name) != 0) { + printf("%s: Could not name node\n", + sc->sc_name); + NG_NODE_UNREF(sc->sc_node); + sc->sc_node = NULL; + goto detach; + } + + NG_NODE_SET_PRIVATE(sc->sc_node, sc); + + /* the device is now operational */ + + return 0; /* success */ + + detach: + udbp_detach(dev); + return ENOMEM; /* failure */ +} + +static int +udbp_detach(device_t dev) +{ + struct udbp_softc *sc = device_get_softc(dev); + + /* destroy Netgraph node */ + + if (sc->sc_node != NULL) { + NG_NODE_SET_PRIVATE(sc->sc_node, NULL); + ng_rmnode_self(sc->sc_node); + sc->sc_node = NULL; + } + + /* free USB transfers, if any */ + + usbd_transfer_unsetup(sc->sc_xfer, UDBP_T_MAX); + + usbd_transfer_drain(&(sc->sc_mem_wait), &(sc->sc_mtx)); + + mtx_destroy(&(sc->sc_mtx)); + + /* destroy queues */ + + NG_BT_MBUFQ_DESTROY(&(sc->sc_xmitq)); + NG_BT_MBUFQ_DESTROY(&(sc->sc_xmitq_hipri)); + + /* extra check */ + + if (sc->sc_bulk_in_buffer) { + m_freem(sc->sc_bulk_in_buffer); + sc->sc_bulk_in_buffer = NULL; + } + + return 0; /* success */ +} + +static void +udbp_bulk_read_callback(struct usbd_xfer *xfer) +{ + struct udbp_softc *sc = xfer->priv_sc; + struct mbuf *m; + + USBD_CHECK_STATUS(xfer); + + tr_error: + if (xfer->error != USBD_CANCELLED) { + /* try to clear stall first */ + sc->sc_flags |= UDBP_FLAG_READ_STALL; + usbd_transfer_start(sc->sc_xfer[UDBP_T_RD_CS]); + } + return; + + tr_transferred: + + /* allocate new mbuf */ + + MGETHDR(m, M_DONTWAIT, MT_DATA); + + if (m == NULL) { + goto tr_setup; + } + + MCLGET(m, M_DONTWAIT); + + if (!(m->m_flags & M_EXT)) { + m_freem(m); + goto tr_setup; + } + + m->m_pkthdr.len = m->m_len = xfer->actlen; + + usbd_copy_out(&(xfer->buf_data), 0, m->m_data, xfer->actlen); + + sc->sc_bulk_in_buffer = m; + + DPRINTF(sc, 0, "received package %d " + "bytes\n", xfer->actlen); + + tr_setup: + if (sc->sc_bulk_in_buffer) { + ng_send_fn(sc->sc_node, NULL, &udbp_bulk_read_complete, NULL, 0); + return; + } + + if (sc->sc_flags & UDBP_FLAG_READ_STALL) { + usbd_transfer_start(sc->sc_xfer[UDBP_T_RD_CS]); + return; + } + + usbd_start_hardware(xfer); + return; +} + +static void +udbp_bulk_read_clear_stall_callback(struct usbd_xfer *xfer) +{ + struct udbp_softc *sc = xfer->priv_sc; + struct usbd_xfer *other_xfer = sc->sc_xfer[UDBP_T_RD]; + + USBD_CHECK_STATUS(xfer); + + tr_setup: + /* start clear stall */ + usbd_clear_stall_tr_setup(xfer, other_xfer); + return; + + tr_transferred: + usbd_clear_stall_tr_transferred(xfer, other_xfer); + + sc->sc_flags &= ~UDBP_FLAG_READ_STALL; + usbd_transfer_start(other_xfer); + return; + + tr_error: + /* bomb out */ + sc->sc_flags &= ~UDBP_FLAG_READ_STALL; + DPRINTF(sc, 0, "clear stall failed!\n"); + return; +} + +static void +udbp_bulk_read_complete(node_p node, hook_p hook, void *arg1, int arg2) +{ + struct udbp_softc * sc = NG_NODE_PRIVATE(node); + struct mbuf * m; + int error; + + if (sc == NULL) { + return; + } + + mtx_lock(&(sc->sc_mtx)); + + m = sc->sc_bulk_in_buffer; + + if (m) { + + sc->sc_bulk_in_buffer = NULL; + + if ((sc->sc_hook == NULL) || + NG_HOOK_NOT_VALID(sc->sc_hook)) { + DPRINTF(sc, 0, "No upstream hook\n"); + goto done; + } + + sc->sc_packets_in ++; + + NG_SEND_DATA_ONLY(error, sc->sc_hook, m); + + m = NULL; + } + + done: + if (m) { + m_freem(m); + } + + /* start USB bulk-in transfer, if not already started */ + + usbd_transfer_start(sc->sc_xfer[UDBP_T_RD]); + + mtx_unlock(&(sc->sc_mtx)); + + return; +} + +static void +udbp_bulk_write_callback(struct usbd_xfer *xfer) +{ + struct udbp_softc *sc = xfer->priv_sc; + struct mbuf *m; + + USBD_CHECK_STATUS(xfer); + + tr_error: + if (xfer->error != USBD_CANCELLED) { + /* try to clear stall first */ + sc->sc_flags |= UDBP_FLAG_WRITE_STALL; + usbd_transfer_start(sc->sc_xfer[UDBP_T_WR_CS]); + } + return; + + tr_transferred: + + sc->sc_packets_out ++; + + tr_setup: + if (sc->sc_flags & UDBP_FLAG_WRITE_STALL) { + usbd_transfer_start(sc->sc_xfer[UDBP_T_WR_CS]); + return; + } + + /* get next mbuf, if any */ + + NG_BT_MBUFQ_DEQUEUE(&(sc->sc_xmitq_hipri), m); + if (m == NULL) { + NG_BT_MBUFQ_DEQUEUE(&(sc->sc_xmitq), m); + if (m == NULL) { + DPRINTF(sc, 0, "Data queue is empty\n"); + return; + } + } + + if (m->m_pkthdr.len > MCLBYTES) { + DPRINTF(sc, 0, "truncating large packet " + "from %d to %d bytes\n", m->m_pkthdr.len, + MCLBYTES); + m->m_pkthdr.len = MCLBYTES; + } + + usbd_m_copy_in(&(xfer->buf_data), 0, m, 0, m->m_pkthdr.len); + + xfer->length = m->m_pkthdr.len; + + m_freem(m); + + DPRINTF(sc, 0, "packet out: %d bytes\n", + xfer->length); + + usbd_start_hardware(xfer); + return; +} + +static void +udbp_bulk_write_clear_stall_callback(struct usbd_xfer *xfer) +{ + struct udbp_softc *sc = xfer->priv_sc; + struct usbd_xfer *other_xfer = sc->sc_xfer[UDBP_T_WR]; + + USBD_CHECK_STATUS(xfer); + + tr_setup: + /* start clear stall */ + usbd_clear_stall_tr_setup(xfer, other_xfer); + return; + + tr_transferred: + usbd_clear_stall_tr_transferred(xfer, other_xfer); + + sc->sc_flags &= ~UDBP_FLAG_WRITE_STALL; + usbd_transfer_start(other_xfer); + return; + + tr_error: + /* bomb out */ + sc->sc_flags &= ~UDBP_FLAG_WRITE_STALL; + DPRINTF(sc, 0, "clear stall failed\n"); + return; +} + +/*********************************************************************** + * Start of Netgraph methods + **********************************************************************/ + +/* + * If this is a device node so this work is done in the attach() + * routine and the constructor will return EINVAL as you should not be able + * to create nodes that depend on hardware (unless you can add the hardware :) + */ +static int +ng_udbp_constructor(node_p node) +{ + return (EINVAL); +} + +/* + * Give our ok for a hook to be added... + * If we are not running this might kick a device into life. + * Possibly decode information out of the hook name. + * Add the hook's private info to the hook structure. + * (if we had some). In this example, we assume that there is a + * an array of structs, called 'channel' in the private info, + * one for each active channel. The private + * pointer of each hook points to the appropriate UDBP_hookinfo struct + * so that the source of an input packet is easily identified. + */ +static int +ng_udbp_newhook(node_p node, hook_p hook, const char *name) +{ + struct udbp_softc *sc = NG_NODE_PRIVATE(node); + int32_t error = 0; + + if (strcmp(name, NG_UDBP_HOOK_NAME)) { + return EINVAL; + } + + mtx_lock(&(sc->sc_mtx)); + + if (sc->sc_hook != NULL) { + error = EISCONN; + } else { + sc->sc_hook = hook; + NG_HOOK_SET_PRIVATE(hook, NULL); + } + + mtx_unlock(&(sc->sc_mtx)); + + return error; +} + +/* + * Get a netgraph control message. + * Check it is one we understand. If needed, send a response. + * We could save the address for an async action later, but don't here. + * Always free the message. + * The response should be in a malloc'd region that the caller can 'free'. + * A response is not required. + * Theoretically you could respond defferently to old message types if + * the cookie in the header didn't match what we consider to be current + * (so that old userland programs could continue to work). + */ +static int +ng_udbp_rcvmsg(node_p node, item_p item, hook_p lasthook) +{ + struct udbp_softc *sc = NG_NODE_PRIVATE(node); + struct ng_mesg *resp = NULL; + int error = 0; + struct ng_mesg *msg; + + NGI_GET_MSG(item, msg); + /* Deal with message according to cookie and command */ + switch (msg->header.typecookie) { + case NGM_UDBP_COOKIE: + switch (msg->header.cmd) { + case NGM_UDBP_GET_STATUS: + { + struct ngudbpstat *stats; + + NG_MKRESPONSE(resp, msg, sizeof(*stats), M_NOWAIT); + if (!resp) { + error = ENOMEM; + break; + } + stats = (struct ngudbpstat *) resp->data; + mtx_lock(&(sc->sc_mtx)); + stats->packets_in = sc->sc_packets_in; + stats->packets_out = sc->sc_packets_out; + mtx_unlock(&(sc->sc_mtx)); + break; + } + case NGM_UDBP_SET_FLAG: + if (msg->header.arglen != sizeof(u_int32_t)) { + error = EINVAL; + break; + } + DPRINTF(sc, 0, "flags = 0x%08x\n", + *((u_int32_t *) msg->data)); + break; + default: + error = EINVAL; /* unknown command */ + break; + } + break; + default: + error = EINVAL; /* unknown cookie type */ + break; + } + + /* Take care of synchronous response, if any */ + NG_RESPOND_MSG(error, node, item, resp); + NG_FREE_MSG(msg); + return(error); +} + +/* + * Accept data from the hook and queue it for output. + */ +static int +ng_udbp_rcvdata(hook_p hook, item_p item) +{ + struct udbp_softc *sc = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); + struct ng_bt_mbufq *queue_ptr; + struct mbuf *m; + struct ng_tag_prio *ptag; + int error; + + if (sc == NULL) { + NG_FREE_ITEM(item); + return EHOSTDOWN; + } + + NGI_GET_M(item, m); + NG_FREE_ITEM(item); + + /* + * Now queue the data for when it can be sent + */ + ptag = (void *)m_tag_locate(m, NGM_GENERIC_COOKIE, + NG_TAG_PRIO, NULL); + + if (ptag && (ptag->priority > NG_PRIO_CUTOFF)) + queue_ptr = &(sc->sc_xmitq_hipri); + else + queue_ptr = &(sc->sc_xmitq); + + mtx_lock(&(sc->sc_mtx)); + + if (NG_BT_MBUFQ_FULL(queue_ptr)) { + NG_BT_MBUFQ_DROP(queue_ptr); + NG_FREE_M(m); + error = ENOBUFS; + } else { + NG_BT_MBUFQ_ENQUEUE(queue_ptr, m); + /* start bulk-out transfer, if not + * already started: + */ + usbd_transfer_start(sc->sc_xfer[UDBP_T_WR]); + error = 0; + } + + mtx_unlock(&(sc->sc_mtx)); + + return error; +} + +/* + * Do local shutdown processing.. + * We are a persistant device, we refuse to go away, and + * only remove our links and reset ourself. + */ +static int +ng_udbp_rmnode(node_p node) +{ + struct udbp_softc *sc = NG_NODE_PRIVATE(node); + + /* Let old node go */ + NG_NODE_SET_PRIVATE(node, NULL); + NG_NODE_UNREF(node); /* forget it ever existed */ + + if (sc == NULL) { + goto done; + } + + /* Create Netgraph node */ + if (ng_make_node_common(&ng_udbp_typestruct, &sc->sc_node) != 0) { + printf("%s: Could not create Netgraph node\n", + sc->sc_name); + sc->sc_node = NULL; + goto done; + } + + /* Name node */ + if (ng_name_node(sc->sc_node, sc->sc_name) != 0) { + printf("%s: Could not name Netgraph node\n", + sc->sc_name); + NG_NODE_UNREF(sc->sc_node); + sc->sc_node = NULL; + goto done; + } + + NG_NODE_SET_PRIVATE(sc->sc_node, sc); + + done: + if (sc) { + mtx_unlock(&(sc->sc_mtx)); + } + + return 0; +} + +/* + * This is called once we've already connected a new hook to the other node. + * It gives us a chance to balk at the last minute. + */ +static int +ng_udbp_connect(hook_p hook) +{ + struct udbp_softc *sc = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); + + /* probably not at splnet, force outward queueing */ + NG_HOOK_FORCE_QUEUE(NG_HOOK_PEER(hook)); + + mtx_lock(&(sc->sc_mtx)); + + sc->sc_flags |= (UDBP_FLAG_READ_STALL| + UDBP_FLAG_WRITE_STALL); + + /* start bulk-in transfer */ + usbd_transfer_start(sc->sc_xfer[UDBP_T_RD]); + + /* start bulk-out transfer */ + usbd_transfer_start(sc->sc_xfer[UDBP_T_WR]); + + mtx_unlock(&(sc->sc_mtx)); + + return (0); +} + +/* + * Dook disconnection + * + * For this type, removal of the last link destroys the node + */ +static int +ng_udbp_disconnect(hook_p hook) +{ + struct udbp_softc *sc = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); + int error = 0; + + if (sc != NULL) { + + mtx_lock(&(sc->sc_mtx)); + + if (hook != sc->sc_hook) { + error = EINVAL; + } else { + + /* stop bulk-in transfer */ + usbd_transfer_stop(sc->sc_xfer[UDBP_T_RD_CS]); + usbd_transfer_stop(sc->sc_xfer[UDBP_T_RD]); + + /* stop bulk-out transfer */ + usbd_transfer_stop(sc->sc_xfer[UDBP_T_WR_CS]); + usbd_transfer_stop(sc->sc_xfer[UDBP_T_WR]); + + /* cleanup queues */ + NG_BT_MBUFQ_DRAIN(&sc->sc_xmitq); + NG_BT_MBUFQ_DRAIN(&sc->sc_xmitq_hipri); + + if (sc->sc_bulk_in_buffer) { + m_freem(sc->sc_bulk_in_buffer); + sc->sc_bulk_in_buffer = NULL; + } + + sc->sc_hook = NULL; + } + + mtx_unlock(&(sc->sc_mtx)); + } + + if ((NG_NODE_NUMHOOKS(NG_HOOK_NODE(hook)) == 0) + && (NG_NODE_IS_VALID(NG_HOOK_NODE(hook)))) + ng_rmnode_self(NG_HOOK_NODE(hook)); + + return error; +} From owner-p4-projects@FreeBSD.ORG Thu Sep 14 21:04:58 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B748916A4A7; Thu, 14 Sep 2006 21:04:58 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3D4A716A4A0 for ; Thu, 14 Sep 2006 21:04:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0EE6343D49 for ; Thu, 14 Sep 2006 21:04:58 +0000 (GMT) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8EL4v9I076131 for ; Thu, 14 Sep 2006 21:04:57 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8EL4v2V076128 for perforce@freebsd.org; Thu, 14 Sep 2006 21:04:57 GMT (envelope-from hselasky@FreeBSD.org) Date: Thu, 14 Sep 2006 21:04:57 GMT Message-Id: <200609142104.k8EL4v2V076128@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 106120 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Sep 2006 21:04:58 -0000 http://perforce.freebsd.org/chv.cgi?CH=106120 Change 106120 by hselasky@hselasky_mini_itx on 2006/09/14 21:04:29 Remove extra header files. Affected files ... .. //depot/projects/usb/src/sys/dev/usb/ulpt.c#14 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb/ulpt.c#14 (text+ko) ==== @@ -46,13 +46,7 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include +#include #include #include From owner-p4-projects@FreeBSD.ORG Thu Sep 14 21:06:00 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3A81516A417; Thu, 14 Sep 2006 21:06:00 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 18F2F16A403 for ; Thu, 14 Sep 2006 21:06:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id CCA1D43D69 for ; Thu, 14 Sep 2006 21:05:59 +0000 (GMT) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8EL5x1R076262 for ; Thu, 14 Sep 2006 21:05:59 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8EL5xoH076242 for perforce@freebsd.org; Thu, 14 Sep 2006 21:05:59 GMT (envelope-from hselasky@FreeBSD.org) Date: Thu, 14 Sep 2006 21:05:59 GMT Message-Id: <200609142105.k8EL5xoH076242@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 106121 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Sep 2006 21:06:00 -0000 http://perforce.freebsd.org/chv.cgi?CH=106121 Change 106121 by hselasky@hselasky_mini_itx on 2006/09/14 21:05:49 Add missing header file. Affected files ... .. //depot/projects/usb/src/sys/dev/usb/uftdi.c#6 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb/uftdi.c#6 (text+ko) ==== @@ -51,6 +51,7 @@ #include #include #include +#include #define usbd_config_td_cc uftdi_config_copy #define usbd_config_td_softc uftdi_softc From owner-p4-projects@FreeBSD.ORG Thu Sep 14 21:48:54 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 99FEB16A47B; Thu, 14 Sep 2006 21:48:54 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4F3FB16A403 for ; Thu, 14 Sep 2006 21:48:54 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 054BB43D46 for ; Thu, 14 Sep 2006 21:48:54 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8ELmr0J084425 for ; Thu, 14 Sep 2006 21:48:53 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8ELmrvK084422 for perforce@freebsd.org; Thu, 14 Sep 2006 21:48:53 GMT (envelope-from imp@freebsd.org) Date: Thu, 14 Sep 2006 21:48:53 GMT Message-Id: <200609142148.k8ELmrvK084422@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 106122 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Sep 2006 21:48:54 -0000 http://perforce.freebsd.org/chv.cgi?CH=106122 Change 106122 by imp@imp_paco-paco on 2006/09/14 21:47:57 IFC fixups Affected files ... .. //depot/projects/arm/src/sys/boot/arm/at91/bootspi/arm_init.S#7 integrate .. //depot/projects/arm/src/sys/boot/arm/at91/bootspi/env_vars.c#10 integrate .. //depot/projects/arm/src/sys/boot/arm/at91/bootspi/env_vars.h#3 integrate .. //depot/projects/arm/src/sys/boot/arm/at91/bootspi/loader_prompt.c#20 integrate .. //depot/projects/arm/src/sys/boot/arm/at91/bootspi/loader_prompt.h#9 integrate .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/delay.c#4 integrate .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/emac_init.c#3 integrate .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/lib_AT91RM9200.h#4 integrate .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/mci_device.c#14 integrate .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/mci_device.h#8 integrate .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/reset.c#5 integrate .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/sd-card.c#9 integrate .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/sd-card.h#3 integrate Differences ... ==== //depot/projects/arm/src/sys/boot/arm/at91/bootspi/arm_init.S#7 (text+ko) ==== @@ -20,7 +20,7 @@ * only. * END_BLOCK * - * $FreeBSD: src/sys/boot/arm/at91/bootspi/arm_init.S,v 1.1 2006/08/16 23:39:58 imp Exp $ + * $FreeBSD: src/sys/boot/arm/at91/bootspi/arm_init.S,v 1.2 2006/08/17 00:14:32 imp Exp $ ******************************************************************************/ .equ ARM_MODE_USER, 0x10 ==== //depot/projects/arm/src/sys/boot/arm/at91/bootspi/env_vars.c#10 (text+ko) ==== ==== //depot/projects/arm/src/sys/boot/arm/at91/bootspi/env_vars.h#3 (text+ko) ==== ==== //depot/projects/arm/src/sys/boot/arm/at91/bootspi/loader_prompt.c#20 (text+ko) ==== ==== //depot/projects/arm/src/sys/boot/arm/at91/bootspi/loader_prompt.h#9 (text+ko) ==== ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/delay.c#4 (text+ko) ==== ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/emac_init.c#3 (text+ko) ==== ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/lib_AT91RM9200.h#4 (text+ko) ==== ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/mci_device.c#14 (text+ko) ==== ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/mci_device.h#8 (text+ko) ==== ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/reset.c#5 (text+ko) ==== ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/sd-card.c#9 (text+ko) ==== ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/sd-card.h#3 (text+ko) ==== From owner-p4-projects@FreeBSD.ORG Thu Sep 14 22:55:17 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 792B016A415; Thu, 14 Sep 2006 22:55:17 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 233C116A40F for ; Thu, 14 Sep 2006 22:55:17 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id CDAA343D45 for ; Thu, 14 Sep 2006 22:55:16 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8EMtGQd090296 for ; Thu, 14 Sep 2006 22:55:16 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8EMtGwO090293 for perforce@freebsd.org; Thu, 14 Sep 2006 22:55:16 GMT (envelope-from imp@freebsd.org) Date: Thu, 14 Sep 2006 22:55:16 GMT Message-Id: <200609142255.k8EMtGwO090293@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 106123 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Sep 2006 22:55:17 -0000 http://perforce.freebsd.org/chv.cgi?CH=106123 Change 106123 by imp@imp_lighthouse on 2006/09/14 22:54:47 separate out the hard-core str* and mem* from the text parsing good. The latter moves to strcvt.c. This saves aboue 250 bytes in boot2, boot0spi and bootsd. Affected files ... .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/Makefile#19 edit .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/p_string.c#8 edit .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/strcvt.c#1 add Differences ... ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/Makefile#19 (text+ko) ==== @@ -6,7 +6,7 @@ INTERNALLIB= SRCS=at91rm9200_lowlevel.c delay.c eeprom.c emac.c emac_init.c fpga.c getc.c \ p_string.c putchar.c printf.c reset.c spi_flash.c xmodem.c \ - sd-card.c mci_device.c + sd-card.c mci_device.c strcvt.c NO_MAN= .if ${MK_TAG_LIST} != "no" ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/p_string.c#8 (text+ko) ==== @@ -27,41 +27,6 @@ /* * .KB_C_FN_DEFINITION_START - * int p_IsWhiteSpace(char) - * This global function returns true if the character is not considered - * a non-space character. - * .KB_C_FN_DEFINITION_END - */ -int -p_IsWhiteSpace(char cValue) -{ - return ((cValue == ' ') || - (cValue == '\t') || - (cValue == 0) || - (cValue == '\r') || - (cValue == '\n')); -} - - -/* - * .KB_C_FN_DEFINITION_START - * unsigned p_HexCharValue(char) - * This global function returns the decimal value of the validated hex char. - * .KB_C_FN_DEFINITION_END - */ -unsigned -p_HexCharValue(char cValue) -{ - if (cValue < ('9' + 1)) - return (cValue - '0'); - if (cValue < ('F' + 1)) - return (cValue - 'A' + 10); - return (cValue - 'a' + 10); -} - - -/* - * .KB_C_FN_DEFINITION_START * void p_memset(char *buffer, char value, int size) * This global function sets memory at the pointer for the specified * number of bytes to value. @@ -109,54 +74,6 @@ return (to); } - -/* - * .KB_C_FN_DEFINITION_START - * unsigned p_ASCIIToHex(char *) - * This global function set the unsigned value equal to the converted - * hex number passed as a string. No error checking is performed; the - * string must be valid hex value, point at the start of string, and be - * NULL-terminated. - * .KB_C_FN_DEFINITION_END - */ -unsigned -p_ASCIIToHex(const char *buf) -{ - unsigned lValue = 0; - - if ((*buf == '0') && ((buf[1] == 'x') || (buf[1] == 'X'))) - buf += 2; - - while (*buf) { - lValue <<= 4; - lValue += p_HexCharValue(*buf++); - } - return (lValue); -} - - -/* - * .KB_C_FN_DEFINITION_START - * unsigned p_ASCIIToDec(char *) - * This global function set the unsigned value equal to the converted - * decimal number passed as a string. No error checking is performed; the - * string must be valid decimal value, point at the start of string, and be - * NULL-terminated. - * .KB_C_FN_DEFINITION_END - */ -unsigned -p_ASCIIToDec(const char *buf) -{ - unsigned v = 0; - - while (*buf) { - v *= 10; - v += (*buf++) - '0'; - } - return (v); -} - - /* * .KB_C_FN_DEFINITION_START * void p_memcpy(char *, char *, unsigned) From owner-p4-projects@FreeBSD.ORG Thu Sep 14 23:16:50 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6B60E16A407; Thu, 14 Sep 2006 23:16:50 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D5A4A16A494 for ; Thu, 14 Sep 2006 23:16:49 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id CE78D43D5C for ; Thu, 14 Sep 2006 23:16:43 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8ENGhd7092417 for ; Thu, 14 Sep 2006 23:16:43 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8ENGhHs092409 for perforce@freebsd.org; Thu, 14 Sep 2006 23:16:43 GMT (envelope-from imp@freebsd.org) Date: Thu, 14 Sep 2006 23:16:43 GMT Message-Id: <200609142316.k8ENGhHs092409@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 106124 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Sep 2006 23:16:50 -0000 http://perforce.freebsd.org/chv.cgi?CH=106124 Change 106124 by imp@imp_lighthouse on 2006/09/14 23:16:11 Replace p_memcpy and p_strcpy from the versions in boot2.c. They are smaller and save between 24 and 140 bytes in various boot loaders depending on how heavily they were used. # boot2 is back up to a respectible 888 bytes free after this. I'd # love to find another 136... Affected files ... .. //depot/projects/arm/src/sys/boot/arm/at91/boot0spi/main.c#18 edit .. //depot/projects/arm/src/sys/boot/arm/at91/boot2/boot2.c#17 edit .. //depot/projects/arm/src/sys/boot/arm/at91/bootiic/env_vars.c#15 edit .. //depot/projects/arm/src/sys/boot/arm/at91/bootiic/loader_prompt.c#18 edit .. //depot/projects/arm/src/sys/boot/arm/at91/bootspi/loader_prompt.c#21 edit .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/emac.c#29 edit .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/emac_init.c#4 edit .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/lib.h#18 edit .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/p_string.c#9 edit Differences ... ==== //depot/projects/arm/src/sys/boot/arm/at91/boot0spi/main.c#18 (text) ==== @@ -44,7 +44,7 @@ while ((len = xmodem_rx(addr)) == -1) continue; printf("\nDownloaded %u bytes.\n", len); - p_memcpy(addr3, addr, (len + FLASH_PAGE_SIZE - 1) / FLASH_PAGE_SIZE * FLASH_PAGE_SIZE); + memcpy(addr3, addr, (len + FLASH_PAGE_SIZE - 1) / FLASH_PAGE_SIZE * FLASH_PAGE_SIZE); printf("Writing %u bytes to flash at %u\n", len, OFFSET); for (i = 0; i < len; i+= FLASH_PAGE_SIZE) { for (j = 0; j < 10; j++) { ==== //depot/projects/arm/src/sys/boot/arm/at91/boot2/boot2.c#17 (text+ko) ==== @@ -98,24 +98,6 @@ static int dskread(void *, unsigned, unsigned); static int drvread(void *, unsigned, unsigned); -static void memcpy(void *, const void *, int); -static void -memcpy(void *dst, const void *src, int len) -{ - const char *s = src; - char *d = dst; - - while (len--) - *d++ = *s++; -} - -static inline int -strcmp(const char *s1, const char *s2) -{ - for (; *s1 == *s2 && *s1; s1++, s2++); - return (unsigned char)*s1 - (unsigned char)*s2; -} - #include "ufsread.c" static inline int ==== //depot/projects/arm/src/sys/boot/arm/at91/bootiic/env_vars.c#15 (text+ko) ==== @@ -93,7 +93,7 @@ if (size < 0) { continue; } - p_memcpy(cPtr, boot_commands[i], copySize); + memcpy(cPtr, boot_commands[i], copySize); cPtr += copySize; *cPtr++ = 0; } ==== //depot/projects/arm/src/sys/boot/arm/at91/bootiic/loader_prompt.c#18 (text+ko) ==== @@ -93,7 +93,7 @@ int i; for (i = 0; CommandTable[i].command != COMMAND_FINAL_FLAG; ++i) - if (!p_strcmp(CommandTable[i].c_string, cPtr)) + if (!strcmp(CommandTable[i].c_string, cPtr)) return (CommandTable[i].command); return (COMMAND_INVALID); @@ -188,7 +188,7 @@ to = (char *)p_ASCIIToHex(argv[1]); from = (char *)p_ASCIIToHex(argv[2]); size = p_ASCIIToHex(argv[3]); - p_memcpy(to, from, size); + memcpy(to, from, size); } break; } ==== //depot/projects/arm/src/sys/boot/arm/at91/bootspi/loader_prompt.c#21 (text+ko) ==== @@ -125,7 +125,7 @@ int i; for (i = 0; CommandTable[i].command != COMMAND_FINAL_FLAG; ++i) - if (!p_strcmp(CommandTable[i].c_string, cPtr)) + if (!strcmp(CommandTable[i].c_string, cPtr)) return (CommandTable[i].command); return (COMMAND_INVALID); ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/emac.c#29 (text+ko) ==== @@ -75,7 +75,7 @@ p_memset((char*)p_ARP->dest_mac, 0xFF, 6); - p_memcpy((char*)p_ARP->src_mac, (char*)localMACAddr, 6); + memcpy(p_ARP->src_mac, localMACAddr, 6); p_ARP->frame_type = SWAP16(PROTOCOL_ARP); p_ARP->hard_type = SWAP16(1); @@ -84,13 +84,10 @@ p_ARP->prot_size = 4; p_ARP->operation = SWAP16(ARP_REQUEST); - p_memcpy((char*)p_ARP->sender_mac, (char*)localMACAddr, 6); - - p_memcpy((char*)p_ARP->sender_ip, (char*)localIPAddr, 4); - + memcpy(p_ARP->sender_mac, localMACAddr, 6); + memcpy(p_ARP->sender_ip, localIPAddr, 4); p_memset((char*)p_ARP->target_mac, 0, 6); - - p_memcpy((char*)p_ARP->target_ip, (char*)serverIPAddr, 4); + memcpy(p_ARP->target_ip, serverIPAddr, 4); // wait until transmit is available while (!(*AT91C_EMAC_TSR & AT91C_EMAC_BNQ)) ; @@ -115,10 +112,8 @@ udp_header_t *udpHdr; unsigned t_checksum; - p_memcpy((char*)macHdr->dest_mac, (char*)serverMACAddr, 6); - - p_memcpy((char*)macHdr->src_mac, (char*)localMACAddr, 6); - + memcpy(macHdr->dest_mac, serverMACAddr, 6); + memcpy(macHdr->src_mac, localMACAddr, 6); macHdr->proto_mac = SWAP16(PROTOCOL_IP); ipHdr = (ip_header_t*)&macHdr->packet_length; @@ -132,10 +127,9 @@ ipHdr->ip_p = PROTOCOL_UDP; ipHdr->ip_sum = 0; - p_memcpy((char*)ipHdr->ip_src, (char*)localIPAddr, 4); + memcpy(ipHdr->ip_src, localIPAddr, 4); + memcpy(ipHdr->ip_dst, serverIPAddr, 4); - p_memcpy((char*)ipHdr->ip_dst, (char*)serverIPAddr, 4); - ipHdr->ip_sum = SWAP16(IP_checksum((unsigned short*)ipHdr, 20)); udpHdr = (udp_header_t*)(ipHdr + 1); @@ -145,7 +139,7 @@ udpHdr->udp_len = SWAP16(8 + tftpLength); udpHdr->udp_cksum = 0; - p_memcpy((char*)udpHdr+8, tftpData, tftpLength); + memcpy(udpHdr+8, tftpData, tftpLength); t_checksum = IP_checksum((unsigned short*)ipHdr + 6, (16 + tftpLength)); @@ -205,7 +199,7 @@ if (block_num == (ackBlock + 1)) { ++ackBlock; - p_memcpy(dlAddress, data, len); + memcpy(dlAddress, data, len); dlAddress += len; lastSize += len; if (ackBlock % 128 == 0) @@ -267,8 +261,7 @@ serverMACSet = 1; - p_memcpy((char*)serverMACAddr, - (char*)p_ARP->sender_mac, 6); + memcpy(serverMACAddr, p_ARP->sender_mac, 6); } } else if (p_ARP->operation == SWAP16(ARP_REQUEST)) { // ARP REPLY operation @@ -299,7 +292,7 @@ break; case SWAP16(PROTOCOL_IP): pIpHeader = (ip_header_t*)(pData + 14); - p_memcpy((char*)pHeader, (char*)pIpHeader,sizeof(ip_header_t)); + memcpy(pHeader, pIpHeader, sizeof(ip_header_t)); if (pIpHeader->ip_p == PROTOCOL_UDP) { udp_header_t *udpHdr; ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/emac_init.c#4 (text+ko) ==== @@ -82,7 +82,7 @@ /* enable the peripheral clock before using EMAC */ pPMC->PMC_PCER = ((unsigned) 1 << AT91C_ID_EMAC); - p_memcpy(localMACAddr, mac, 6); + memcpy(localMACAddr, mac, 6); localMAClow = (mac[2] << 24) | (mac[3] << 16) | (mac[4] << 8) | mac[5]; localMAChigh = (mac[0] << 8) | mac[1]; localMACSet = 1; ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/lib.h#18 (text) ==== @@ -58,8 +58,8 @@ void p_memset(char *buffer, char value, int size); int p_strlen(const char *buffer); char *p_strcpy(char *to, const char *from); -void p_memcpy(char *to, const char *from, unsigned size); +void memcpy(void *to, const void *from, unsigned size); int p_memcmp(const char *to, const char *from, unsigned size); -int p_strcmp(const char *to, const char *from); +int strcmp(const char *to, const char *from); #endif ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/p_string.c#9 (text+ko) ==== @@ -74,21 +74,16 @@ return (to); } -/* - * .KB_C_FN_DEFINITION_START - * void p_memcpy(char *, char *, unsigned) - * This global function copies data from the first pointer to the second - * pointer for the specified number of bytes. - * .KB_C_FN_DEFINITION_END - */ void -p_memcpy(char *to, const char *from, unsigned size) +memcpy(void *dst, const void *src, unsigned len) { - while (size--) - *to++ = *from++; + const char *s = src; + char *d = dst; + + while (len--) + *d++ = *s++; } - /* * .KB_C_FN_DEFINITION_START * int p_memcmp(char *to, char *from, unsigned size) @@ -109,19 +104,14 @@ /* * .KB_C_FN_DEFINITION_START - * int p_strcmp(char *to, char *from) + * int strcmp(char *to, char *from) * This global function compares string at to against string at from. * Returns 0 if the locations are equal. * .KB_C_FN_DEFINITION_END */ int -p_strcmp(const char *to, const char *from) +strcmp(const char *s1, const char *s2) { - - while (*to && *from && (*to == *from)) { - ++to; - ++from; - } - - return (!((!*to) && (*to == *from))); + for (; *s1 == *s2 && *s1; s1++, s2++); + return (unsigned char)*s1 - (unsigned char)*s2; } From owner-p4-projects@FreeBSD.ORG Thu Sep 14 23:32:08 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6908416A412; Thu, 14 Sep 2006 23:32:08 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 21A9B16A407 for ; Thu, 14 Sep 2006 23:32:08 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id DC67E43D45 for ; Thu, 14 Sep 2006 23:32:07 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8ENW7ah093241 for ; Thu, 14 Sep 2006 23:32:07 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8ENW2El093238 for perforce@freebsd.org; Thu, 14 Sep 2006 23:32:02 GMT (envelope-from imp@freebsd.org) Date: Thu, 14 Sep 2006 23:32:02 GMT Message-Id: <200609142332.k8ENW2El093238@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 106125 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Sep 2006 23:32:08 -0000 http://perforce.freebsd.org/chv.cgi?CH=106125 Change 106125 by imp@imp_lighthouse on 2006/09/14 23:31:13 o Remove some unneeded printfs, shorten strings. o kill unneeded read the symbols code. o fix a couple of bugs with reading in chars. o read mac directly into mac rather than reading all of euid64 and copying. This fixes a few bugs, and saves another 164 bytes. boot2 now has > 1k (1056) free. Almost, but not quite, enough to allow both MMC and SD support with FPGA loading... Affected files ... .. //depot/projects/arm/src/sys/boot/arm/at91/boot2/boot2.c#18 edit Differences ... ==== //depot/projects/arm/src/sys/boot/arm/at91/boot2/boot2.c#18 (text+ko) ==== @@ -68,7 +68,7 @@ //#define PATH_KERNEL "/boot/kernel/kernel" #define PATH_KERNEL "/kernel.gz.tramp" -#define NOPT 6 +#define NOPT 5 #define OPT_SET(opt) (1 << (opt)) #define OPT_CHECK(opt) ((opts) & OPT_SET(opt)) @@ -105,20 +105,19 @@ { ssize_t rv; - if ((size_t)(rv = fsread(inode, buf, nbyte)) != nbyte) { - printf("Invalid %s\n", "sector"); + if ((size_t)(rv = fsread(inode, buf, nbyte)) != nbyte) return -1; - } return 0; } static inline void -getstr(void) +getstr(int c) { char *s; - int c; s = cmd; + if (c) + *s++ = c; for (;;) { switch (c = getc(10000)) { case 0: @@ -190,8 +189,6 @@ #if 0 uint8_t euid64[8] = { 0x00, 0x30, 0x96, 0x20, 0x00, 0x00, 0x00, 0x05 }; -#else - uint8_t euid64[8]; #endif #if 0 @@ -202,25 +199,18 @@ #endif sig = 0; EERead(0, (uint8_t *)&sig, sizeof(sig)); - if (sig != 0xaa55aa55) { - printf("Bad signature %x\n", sig); + if (sig != 0xaa55aa55) return; - } - EERead(48, euid64, sizeof(euid64)); - mac[0] = euid64[0]; - mac[1] = euid64[1]; - mac[2] = euid64[2]; - mac[3] = euid64[5]; - mac[4] = euid64[6]; - mac[5] = euid64[7]; - printf("MAC Address %x:%x:%x:%x:%x:%x\n", mac[0], + EERead(48, mac, 3); + EERead(48+5, mac+3, 3); + printf("MAC %x:%x:%x:%x:%x:%x\n", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); } int main(void) { - int autoboot; + int autoboot, c = 0; ino_t ino; #ifdef TSC_FPGA @@ -253,14 +243,13 @@ p_strcpy(kname, PATH_KERNEL); for (;;) { - printf("\nFreeBSD/arm boot\n" - "Default: %s\n" - "boot: ", kname); - if (!autoboot || getc(5) == -1) - getstr(); + printf("\nDefault: %s\nboot: ", kname); + if (!autoboot || (c = getc(2)) != -1) + getstr(c); else if (!autoboot) xputchar('\n'); autoboot = 0; + c = 0; if (parse()) xputchar('\a'); else @@ -273,9 +262,6 @@ { Elf32_Ehdr eh; static Elf32_Phdr ep[2]; -#if 0 - static Elf32_Shdr es[2]; -#endif caddr_t p; ino_t ino; uint32_t addr; @@ -305,30 +291,6 @@ if (xfsread(ino, p, ep[i].p_filesz)) return; } -#if 0 - printf("3\n"); - p += roundup2(ep[1].p_memsz, PAGE_SIZE); - if (eh.e_shnum == eh.e_shstrndx + 3) { - printf("4\n"); - fs_off = eh.e_shoff + sizeof(es[0]) * - (eh.e_shstrndx + 1); - printf("5\n"); - if (xfsread(ino, &es, sizeof(es))) { - printf("5a\n"); - return; - } - printf("6\n"); - for (i = 0; i < 2; i++) { - printf("6.%d\n", i); - memcpy(p, &es[i].sh_size, sizeof(es[i].sh_size)); - p += sizeof(es[i].sh_size); - fs_off = es[i].sh_offset; - if (xfsread(ino, p, es[i].sh_size)) - return; - p += es[i].sh_size; - } - } -#endif addr = eh.e_entry; ((void(*)(int))addr)(RB_BOOTINFO | (opts & RBX_MASK)); } @@ -384,10 +346,8 @@ if (dp[i].dp_typ == DOSPTYP_386BSD) break; } - if (i == NDOSPART) { - printf("No BSD partition found\n"); + if (i == NDOSPART) return -1; - } // Although dp_start is aligned within the disk partition structure, // DOSPARTOFF is 446, which is only word (2) aligned, not longword (4) // aligned. Cope by using memcpy to fetch the start of this partition. From owner-p4-projects@FreeBSD.ORG Fri Sep 15 01:23:30 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D751916A40F; Fri, 15 Sep 2006 01:23:29 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6075116A403 for ; Fri, 15 Sep 2006 01:23:29 +0000 (UTC) (envelope-from dongmei@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2C03543D45 for ; Fri, 15 Sep 2006 01:23:29 +0000 (GMT) (envelope-from dongmei@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8F1NTBr008373 for ; Fri, 15 Sep 2006 01:23:29 GMT (envelope-from dongmei@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8F1NSGi008370 for perforce@freebsd.org; Fri, 15 Sep 2006 01:23:28 GMT (envelope-from dongmei@FreeBSD.org) Date: Fri, 15 Sep 2006 01:23:28 GMT Message-Id: <200609150123.k8F1NSGi008370@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to dongmei@FreeBSD.org using -f From: dongmei To: Perforce Change Reviews Cc: Subject: PERFORCE change 106126 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Sep 2006 01:23:30 -0000 http://perforce.freebsd.org/chv.cgi?CH=106126 Change 106126 by dongmei@soc-dongmei-sebsd on 2006/09/15 01:22:59 Check the context of /usr/bin/login which has been missed last time. Affected files ... .. //depot/projects/soc2006/dongmei_sebsd/contrib/sebsd/refpolicy/policy/modules/system/authlogin.fc#4 edit Differences ... ==== //depot/projects/soc2006/dongmei_sebsd/contrib/sebsd/refpolicy/policy/modules/system/authlogin.fc#4 (text+ko) ==== @@ -1,5 +1,5 @@ -/bin/login -- gen_context(system_u:object_r:login_exec_t,s0) +/usr/bin/login -- gen_context(system_u:object_r:login_exec_t,s0) /etc/\.pwd\.lock -- gen_context(system_u:object_r:shadow_t,s0) /etc/group\.lock -- gen_context(system_u:object_r:shadow_t,s0) From owner-p4-projects@FreeBSD.ORG Fri Sep 15 04:07:54 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 91AF516A417; Fri, 15 Sep 2006 04:07:54 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5157E16A415 for ; Fri, 15 Sep 2006 04:07:54 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id E223443D53 for ; Fri, 15 Sep 2006 04:07:53 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8F47r2K021038 for ; Fri, 15 Sep 2006 04:07:53 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8F47rQp021035 for perforce@freebsd.org; Fri, 15 Sep 2006 04:07:53 GMT (envelope-from imp@freebsd.org) Date: Fri, 15 Sep 2006 04:07:53 GMT Message-Id: <200609150407.k8F47rQp021035@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 106128 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Sep 2006 04:07:54 -0000 http://perforce.freebsd.org/chv.cgi?CH=106128 Change 106128 by imp@imp_paco-paco on 2006/09/15 04:07:24 IFC @106102 (id changes only) Affected files ... .. //depot/projects/arm/src/gnu/usr.bin/binutils/Makefile.inc#2 integrate .. //depot/projects/arm/src/gnu/usr.bin/binutils/libiberty/config.h#3 integrate .. //depot/projects/arm/src/gnu/usr.bin/cc/cc_int/Makefile#3 integrate Differences ... ==== //depot/projects/arm/src/gnu/usr.bin/binutils/Makefile.inc#2 (text+ko) ==== @@ -1,6 +1,4 @@ -# -# $FreeBSD: src/gnu/usr.bin/binutils/Makefile.inc,v 1.8 2004/02/24 19:23:28 johan Exp $ -# +# $FreeBSD: src/gnu/usr.bin/binutils/Makefile.inc,v 1.9 2006/09/12 19:24:01 obrien Exp $ .if (${TARGET_ARCH} == "alpha") WARNS?= 2 ==== //depot/projects/arm/src/gnu/usr.bin/binutils/libiberty/config.h#3 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/gnu/usr.bin/binutils/libiberty/config.h,v 1.6 2004/06/16 07:09:41 obrien Exp $ */ +/* $FreeBSD: src/gnu/usr.bin/binutils/libiberty/config.h,v 1.8 2006/09/14 06:36:13 imp Exp $ */ /* config.h. Generated by configure. */ /* config.in. Generated from configure.ac by autoheader. */ ==== //depot/projects/arm/src/gnu/usr.bin/cc/cc_int/Makefile#3 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/gnu/usr.bin/cc/cc_int/Makefile,v 1.46 2006/01/14 20:48:50 ru Exp $ +# $FreeBSD: src/gnu/usr.bin/cc/cc_int/Makefile,v 1.48 2006/09/12 07:37:44 obrien Exp $ .include "../Makefile.inc" From owner-p4-projects@FreeBSD.ORG Fri Sep 15 05:22:31 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 442CD16A417; Fri, 15 Sep 2006 05:22:31 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0824F16A407 for ; Fri, 15 Sep 2006 05:22:31 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1450B43D5E for ; Fri, 15 Sep 2006 05:22:30 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8F5MTi1034306 for ; Fri, 15 Sep 2006 05:22:29 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8F5MS0u034303 for perforce@freebsd.org; Fri, 15 Sep 2006 05:22:28 GMT (envelope-from imp@freebsd.org) Date: Fri, 15 Sep 2006 05:22:28 GMT Message-Id: <200609150522.k8F5MS0u034303@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 106130 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Sep 2006 05:22:31 -0000 http://perforce.freebsd.org/chv.cgi?CH=106130 Change 106130 by imp@imp_paco-paco on 2006/09/15 05:22:01 IFC @106102 + fix to not have the default code generator be xscale. Affected files ... .. //depot/projects/arm/src/gnu/usr.bin/binutils/ld/Makefile.arm#3 integrate .. //depot/projects/arm/src/gnu/usr.bin/binutils/libbfd/Makefile.arm#4 integrate .. //depot/projects/arm/src/gnu/usr.bin/cc/Makefile.tgt#2 edit .. //depot/projects/arm/src/gnu/usr.bin/cc/cpp/Makefile#2 integrate Differences ... ==== //depot/projects/arm/src/gnu/usr.bin/binutils/ld/Makefile.arm#3 (text+ko) ==== @@ -1,6 +1,6 @@ -# $FreeBSD: src/gnu/usr.bin/binutils/ld/Makefile.arm,v 1.1 2006/07/22 14:36:15 obrien Exp $ +# $FreeBSD: src/gnu/usr.bin/binutils/ld/Makefile.arm,v 1.2 2006/09/12 06:59:39 obrien Exp $ -.if defined(ARM_BIG_ENDIAN) +.if defined(TARGET_BIG_ENDIAN) NATIVE_EMULATION= armelfb_fbsd .else NATIVE_EMULATION= armelf_fbsd ==== //depot/projects/arm/src/gnu/usr.bin/binutils/libbfd/Makefile.arm#4 (text+ko) ==== @@ -1,52 +1,44 @@ -# $FreeBSD: src/gnu/usr.bin/binutils/libbfd/Makefile.arm,v 1.3 2006/08/10 16:39:55 obrien Exp $ +# $FreeBSD: src/gnu/usr.bin/binutils/libbfd/Makefile.arm,v 1.5 2006/09/12 07:03:58 obrien Exp $ -.if defined(ARM_BIG_ENDIAN) -DEFAULT_VECTOR= bfd_elf32_bigarm_vec -ADDITIONAL_VECTOR= bfd_elf32_littlearm_vec +.if defined(TARGET_BIG_ENDIAN) +DEFAULT_VECTOR= bfd_elf32_bigarm_vec .else DEFAULT_VECTOR= bfd_elf32_littlearm_vec -ADDITIONAL_VECTOR= bfd_elf32_bigarm_vec .endif -SRCS+= \ - cpu-arm.c \ - elf32.c \ +SRCS+= cpu-arm.c \ elf32-arm-fbsd.c \ + elf32.c \ elf32-gen.c \ elf32-target.h \ - elflink.c -VECS+= ${DEFAULT_VECTOR} \ - ${ADDITIONAL_VECTOR} - -.if ${TARGET_ARCH} == "arm" -CFLAGS+= -DDEFAULT_VECTOR=${DEFAULT_VECTOR} + elflink.c +VECS+= ${DEFAULT_VECTOR} +.if defined(TARGET_BIG_ENDIAN) +VECS+= bfd_elf32_littlearm_vec +.else +VECS+= bfd_elf32_bigarm_vec .endif CLEANFILES+= elf32-arm-fbsd.c -# # XXX: We should really add the FreeBSD case in elf32_arm_nabi_grok_prstatus # instead of defining our own elf32_fbsd_arm_grok_prstatus. # elf32-arm-fbsd.c: elfarm-nabi.c - cat ${.ALLSRC} | sed -e s/ELFOSABI_ARM/ELFOSABI_FREEBSD/g \ - -e "s/\(.*#define.*\)elf32_arm_nabi_grok_prstatus/\1elf32_fbsd_arm_grok_prstatus/" -e s/"#include.*elf32-arm.h.*//" >${.TARGET}; \ + cat ${.ALLSRC} | sed \ + -e s/ELFOSABI_ARM/ELFOSABI_FREEBSD/g \ + -e "s/\(.*#define.*\)elf32_arm_nabi_grok_prstatus/\1elf32_fbsd_arm_grok_prstatus/" \ + -e s/"#include.*elf32-arm.h.*//" >${.TARGET} echo '\ - static bfd_boolean elf32_fbsd_arm_grok_prstatus(bfd *abfd, Elf_Internal_Note *note) \ - { \ - size_t raw_size; \ - int offset; \ - if (note->descsz != 96) \ - return (FALSE); \ - offset = 28; \ - raw_size = 68; \ - if (elf_tdata(abfd)->core_signal == 0) \ + static bfd_boolean \ + elf32_fbsd_arm_grok_prstatus(bfd *abfd, Elf_Internal_Note *note) \ + { size_t raw_size =68 ; int offset = 28; \ + if (note->descsz != 96) return (FALSE); \ + if (elf_tdata(abfd)->core_signal == 0) \ elf_tdata (abfd)->core_signal = ((int *)(note->descdata))[5]; \ - elf_tdata (abfd)->core_pid = ((int *)(note->descdata))[6]; \ - /* Make a ".reg/999" section. */ \ - return _bfd_elfcore_make_pseudosection (abfd, ".reg", \ - raw_size, note->descpos + offset); \ -}' >> ${.TARGET}; \ + elf_tdata (abfd)->core_pid = ((int *)(note->descdata))[6]; \ + /* Make a ".reg/999" section. */ \ + return _bfd_elfcore_make_pseudosection (abfd, ".reg",raw_size, \ + note->descpos + offset); \ + }' >> ${.TARGET} echo '#include "elf32-arm.h"' >> ${.TARGET} - - ==== //depot/projects/arm/src/gnu/usr.bin/cc/Makefile.tgt#2 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/gnu/usr.bin/cc/Makefile.tgt,v 1.8 2004/07/28 05:27:19 kan Exp $ +# $FreeBSD: src/gnu/usr.bin/cc/Makefile.tgt,v 1.9 2006/09/12 07:37:02 obrien Exp $ TARGET_ARCH?= ${MACHINE_ARCH} @@ -6,6 +6,10 @@ GCC_CPU= alpha .elif ${TARGET_ARCH} == "arm" GCC_CPU= arm +####TARGET_CPU_DEFAULT= TARGET_CPU_xscale +.if defined(TARGET_BIG_ENDIAN) +CFLAGS+= -DTARGET_ENDIAN_DEFAULT=ARM_FLAG_BIG_END +.endif .elif ${TARGET_ARCH} == "i386" || ${TARGET_ARCH} == "amd64" GCC_CPU= i386 .elif ${TARGET_ARCH} == "ia64" ==== //depot/projects/arm/src/gnu/usr.bin/cc/cpp/Makefile#2 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/gnu/usr.bin/cc/cpp/Makefile,v 1.24 2004/02/05 22:44:21 ru Exp $ +# $FreeBSD: src/gnu/usr.bin/cc/cpp/Makefile,v 1.25 2006/09/12 21:57:28 kan Exp $ .include "../Makefile.inc" .include "../Makefile.fe" @@ -8,9 +8,6 @@ PROG= cpp SRCS= gcc.c cppspec.c -CFLAGS+= -DDEFAULT_TARGET_VERSION=\"$(version)\" -CFLAGS+= -DDEFAULT_TARGET_MACHINE=\"$(target)\" - DPADD= ${LIBCC_INT} LDADD= ${LIBCC_INT} From owner-p4-projects@FreeBSD.ORG Fri Sep 15 05:58:18 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id ED5FD16A412; Fri, 15 Sep 2006 05:58:17 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B0DB116A403 for ; Fri, 15 Sep 2006 05:58:17 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4863F43D45 for ; Fri, 15 Sep 2006 05:58:17 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8F5wHt0036131 for ; Fri, 15 Sep 2006 05:58:17 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8F5wGhO036128 for perforce@freebsd.org; Fri, 15 Sep 2006 05:58:16 GMT (envelope-from imp@freebsd.org) Date: Fri, 15 Sep 2006 05:58:16 GMT Message-Id: <200609150558.k8F5wGhO036128@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 106134 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Sep 2006 05:58:18 -0000 http://perforce.freebsd.org/chv.cgi?CH=106134 Change 106134 by imp@imp_paco-paco on 2006/09/15 05:57:16 IFC @106133 Affected files ... .. //depot/projects/arm/src/gnu/usr.bin/binutils/as/arm-freebsd/targ-cpu.h#2 integrate .. //depot/projects/arm/src/gnu/usr.bin/binutils/ld/Makefile.arm#4 integrate .. //depot/projects/arm/src/gnu/usr.bin/binutils/ld/armelf_fbsd.sh#2 integrate .. //depot/projects/arm/src/gnu/usr.bin/binutils/ld/armelfb_fbsd.sh#2 integrate .. //depot/projects/arm/src/gnu/usr.bin/binutils/ld/genscripts.sh#3 integrate .. //depot/projects/arm/src/gnu/usr.bin/binutils/libbfd/Makefile.arm#5 integrate .. //depot/projects/arm/src/gnu/usr.bin/cc/Makefile.tgt#3 integrate .. //depot/projects/arm/src/gnu/usr.bin/gdb/arch/arm/Makefile#2 integrate .. //depot/projects/arm/src/gnu/usr.bin/gdb/arch/arm/armfbsd-nat.c#2 integrate .. //depot/projects/arm/src/gnu/usr.bin/gdb/arch/arm/armfbsd-tdep.c#2 integrate .. //depot/projects/arm/src/gnu/usr.bin/gdb/arch/arm/config.h#2 integrate .. //depot/projects/arm/src/gnu/usr.bin/gdb/arch/arm/init.c#2 integrate .. //depot/projects/arm/src/gnu/usr.bin/gdb/arch/arm/nm-fbsd.h#2 integrate .. //depot/projects/arm/src/gnu/usr.bin/gdb/arch/arm/tm-fbsd.h#2 integrate .. //depot/projects/arm/src/gnu/usr.bin/gdb/arch/arm/xm-fbsd.h#2 integrate .. //depot/projects/arm/src/gnu/usr.bin/gdb/kgdb/trgt_arm.c#3 integrate .. //depot/projects/arm/src/sbin/mount/mount.8#3 integrate .. //depot/projects/arm/src/sys/dev/ata/ata-disk.c#9 integrate .. //depot/projects/arm/src/sys/kern/vfs_lookup.c#11 integrate .. //depot/projects/arm/src/usr.sbin/inetd/inetd.8#2 integrate .. //depot/projects/arm/src/usr.sbin/inetd/inetd.c#2 integrate .. //depot/projects/arm/src/usr.sbin/inetd/inetd.h#2 integrate Differences ... ==== //depot/projects/arm/src/gnu/usr.bin/binutils/as/arm-freebsd/targ-cpu.h#2 (text+ko) ==== ==== //depot/projects/arm/src/gnu/usr.bin/binutils/ld/Makefile.arm#4 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/gnu/usr.bin/binutils/ld/Makefile.arm,v 1.2 2006/09/12 06:59:39 obrien Exp $ +# $FreeBSD: src/gnu/usr.bin/binutils/ld/Makefile.arm,v 1.3 2006/09/14 07:44:05 imp Exp $ .if defined(TARGET_BIG_ENDIAN) NATIVE_EMULATION= armelfb_fbsd ==== //depot/projects/arm/src/gnu/usr.bin/binutils/ld/armelf_fbsd.sh#2 (text+ko) ==== ==== //depot/projects/arm/src/gnu/usr.bin/binutils/ld/armelfb_fbsd.sh#2 (text+ko) ==== ==== //depot/projects/arm/src/gnu/usr.bin/binutils/ld/genscripts.sh#3 (text+ko) ==== @@ -9,7 +9,7 @@ # sparc-sun-sunos4.1.3 sparc-sun-sunos4.1.3 sun4 "" sun3 sparc-sun-sunos4.1.3 # produces sun3.x sun3.xbn sun3.xn sun3.xr sun3.xu em_sun3.c # -# $FreeBSD: src/gnu/usr.bin/binutils/ld/genscripts.sh,v 1.6 2004/06/16 07:09:37 obrien Exp $ +# $FreeBSD: src/gnu/usr.bin/binutils/ld/genscripts.sh,v 1.7 2006/09/14 07:46:32 imp Exp $ # # This is a cut-down version of the GNU script. Instead of jumping through # hoops for all possible combinations of paths, just use the libdir ==== //depot/projects/arm/src/gnu/usr.bin/binutils/libbfd/Makefile.arm#5 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/gnu/usr.bin/binutils/libbfd/Makefile.arm,v 1.5 2006/09/12 07:03:58 obrien Exp $ +# $FreeBSD: src/gnu/usr.bin/binutils/libbfd/Makefile.arm,v 1.8 2006/09/14 08:21:20 imp Exp $ .if defined(TARGET_BIG_ENDIAN) DEFAULT_VECTOR= bfd_elf32_bigarm_vec @@ -7,8 +7,8 @@ .endif SRCS+= cpu-arm.c \ + elf32.c \ elf32-arm-fbsd.c \ - elf32.c \ elf32-gen.c \ elf32-target.h \ elflink.c @@ -29,7 +29,7 @@ -e s/ELFOSABI_ARM/ELFOSABI_FREEBSD/g \ -e "s/\(.*#define.*\)elf32_arm_nabi_grok_prstatus/\1elf32_fbsd_arm_grok_prstatus/" \ -e s/"#include.*elf32-arm.h.*//" >${.TARGET} - echo '\ + echo ' \ static bfd_boolean \ elf32_fbsd_arm_grok_prstatus(bfd *abfd, Elf_Internal_Note *note) \ { size_t raw_size =68 ; int offset = 28; \ ==== //depot/projects/arm/src/gnu/usr.bin/cc/Makefile.tgt#3 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/gnu/usr.bin/cc/Makefile.tgt,v 1.9 2006/09/12 07:37:02 obrien Exp $ +# $FreeBSD: src/gnu/usr.bin/cc/Makefile.tgt,v 1.10 2006/09/15 05:21:06 imp Exp $ TARGET_ARCH?= ${MACHINE_ARCH} @@ -6,7 +6,7 @@ GCC_CPU= alpha .elif ${TARGET_ARCH} == "arm" GCC_CPU= arm -####TARGET_CPU_DEFAULT= TARGET_CPU_xscale +# TARGET_CPU_DEFAULT= TARGET_CPU_xscale .if defined(TARGET_BIG_ENDIAN) CFLAGS+= -DTARGET_ENDIAN_DEFAULT=ARM_FLAG_BIG_END .endif ==== //depot/projects/arm/src/gnu/usr.bin/gdb/arch/arm/Makefile#2 (text+ko) ==== ==== //depot/projects/arm/src/gnu/usr.bin/gdb/arch/arm/armfbsd-nat.c#2 (text+ko) ==== ==== //depot/projects/arm/src/gnu/usr.bin/gdb/arch/arm/armfbsd-tdep.c#2 (text+ko) ==== ==== //depot/projects/arm/src/gnu/usr.bin/gdb/arch/arm/config.h#2 (text+ko) ==== ==== //depot/projects/arm/src/gnu/usr.bin/gdb/arch/arm/init.c#2 (text+ko) ==== ==== //depot/projects/arm/src/gnu/usr.bin/gdb/arch/arm/nm-fbsd.h#2 (text+ko) ==== ==== //depot/projects/arm/src/gnu/usr.bin/gdb/arch/arm/tm-fbsd.h#2 (text+ko) ==== ==== //depot/projects/arm/src/gnu/usr.bin/gdb/arch/arm/xm-fbsd.h#2 (text+ko) ==== ==== //depot/projects/arm/src/gnu/usr.bin/gdb/kgdb/trgt_arm.c#3 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/gnu/usr.bin/gdb/kgdb/trgt_arm.c,v 1.1 2006/07/22 15:27:18 obrien Exp $"); +__FBSDID("$FreeBSD: src/gnu/usr.bin/gdb/kgdb/trgt_arm.c,v 1.2 2006/09/14 07:51:52 imp Exp $"); #include #ifndef CROSS_DEBUGGER ==== //depot/projects/arm/src/sbin/mount/mount.8#3 (text+ko) ==== @@ -26,7 +26,7 @@ .\" SUCH DAMAGE. .\" .\" @(#)mount.8 8.8 (Berkeley) 6/16/94 -.\" $FreeBSD: src/sbin/mount/mount.8,v 1.79 2006/09/08 13:47:39 danger Exp $ +.\" $FreeBSD: src/sbin/mount/mount.8,v 1.80 2006/09/14 13:47:55 des Exp $ .\" .Dd July 12, 2006 .Dt MOUNT 8 @@ -157,7 +157,8 @@ file for the file system. .It Cm late This file system should be skipped when -.Nm is run with the +.Nm +is run with the .Fl a flag but without the .Fl l ==== //depot/projects/arm/src/sys/dev/ata/ata-disk.c#9 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/ata/ata-disk.c,v 1.198 2006/08/09 18:23:47 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/ata-disk.c,v 1.199 2006/09/14 19:12:29 sos Exp $"); #include "opt_ata.h" #include @@ -105,7 +105,8 @@ } device_set_ivars(dev, adp); - if (atadev->param.atavalid & ATA_FLAG_54_58) { + if ((atadev->param.atavalid & ATA_FLAG_54_58) && + atadev->param.current_heads && atadev->param.current_sectors) { adp->heads = atadev->param.current_heads; adp->sectors = atadev->param.current_sectors; adp->total_secs = (u_int32_t)atadev->param.current_size_1 | ==== //depot/projects/arm/src/sys/kern/vfs_lookup.c#11 (text+ko) ==== @@ -35,7 +35,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/vfs_lookup.c,v 1.94 2006/09/13 18:39:08 mohans Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/vfs_lookup.c,v 1.95 2006/09/14 17:57:02 mohans Exp $"); #include "opt_ktrace.h" #include "opt_mac.h" @@ -306,7 +306,8 @@ static int compute_cn_lkflags(struct mount *mp, int lkflags) { - if ((lkflags & LK_SHARED) && !(mp->mnt_kern_flag & MNTK_LOOKUP_SHARED)) { + if (mp == NULL || + ((lkflags & LK_SHARED) && !(mp->mnt_kern_flag & MNTK_LOOKUP_SHARED))) { lkflags &= ~LK_SHARED; lkflags |= LK_EXCLUSIVE; } ==== //depot/projects/arm/src/usr.sbin/inetd/inetd.8#2 (text+ko) ==== @@ -26,9 +26,9 @@ .\" SUCH DAMAGE. .\" .\" from: @(#)inetd.8 8.3 (Berkeley) 4/13/94 -.\" $FreeBSD: src/usr.sbin/inetd/inetd.8,v 1.83 2006/02/04 22:17:38 ceri Exp $ +.\" $FreeBSD: src/usr.sbin/inetd/inetd.8,v 1.84 2006/09/14 08:36:53 ru Exp $ .\" -.Dd February 4, 2006 +.Dd September 14, 2006 .Dt INETD 8 .Os .Sh NAME @@ -286,21 +286,6 @@ via a wildcard .Dv AF_INET6 socket. -If it is desired that the service is reachable via T/TCP, one should -specify -.Dq tcp/ttcp , -which implies IPv4 for backward compatibility. -The name -.Dq tcp4/ttcp -specifies IPv4 only, while -.Dq tcp6/ttcp -specifies IPv6 only. -The name -.Dq tcp46/ttcp -specifies that the entry accepts both IPv6 and IPv6 connections -via a wildcard -.Dv AF_INET6 -socket. Rpc based services are specified with the .Dq rpc/tcp ==== //depot/projects/arm/src/usr.sbin/inetd/inetd.c#2 (text+ko) ==== @@ -40,7 +40,7 @@ #endif /* not lint */ #include -__FBSDID("$FreeBSD: src/usr.sbin/inetd/inetd.c,v 1.133 2006/01/18 19:38:42 delphij Exp $"); +__FBSDID("$FreeBSD: src/usr.sbin/inetd/inetd.c,v 1.134 2006/09/14 08:36:53 ru Exp $"); /* * Inetd - Internet super-server @@ -69,7 +69,7 @@ * or name a tcpmux service * or specify a unix domain socket * socket type stream/dgram/raw/rdm/seqpacket - * protocol tcp[4][6][/faith,ttcp], udp[4][6], unix + * protocol tcp[4][6][/faith], udp[4][6], unix * wait/nowait single-threaded/multi-threaded * user user to run daemon as * server program full path name @@ -1301,10 +1301,6 @@ syslog(LOG_ERR, "setsockopt (IPV6_V6ONLY): %m"); } #undef turnon - if (sep->se_type == TTCP_TYPE) - if (setsockopt(sep->se_fd, IPPROTO_TCP, TCP_NOPUSH, - (char *)&on, sizeof (on)) < 0) - syslog(LOG_ERR, "setsockopt (TCP_NOPUSH): %m"); #ifdef IPV6_FAITH if (sep->se_type == FAITH_TYPE) { if (setsockopt(sep->se_fd, IPPROTO_IPV6, IPV6_FAITH, &on, @@ -1746,9 +1742,7 @@ if (strncmp(arg, "tcp", 3) == 0) { sep->se_proto = newstr(strsep(&arg, "/")); if (arg != NULL) { - if (strcmp(arg, "ttcp") == 0) - sep->se_type = TTCP_TYPE; - else if (strcmp(arg, "faith") == 0) + if (strcmp(arg, "faith") == 0) sep->se_type = FAITH_TYPE; } } else { ==== //depot/projects/arm/src/usr.sbin/inetd/inetd.h#2 (text+ko) ==== @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/usr.sbin/inetd/inetd.h,v 1.16 2006/01/18 19:38:43 delphij Exp $ + * $FreeBSD: src/usr.sbin/inetd/inetd.h,v 1.17 2006/09/14 08:36:53 ru Exp $ */ #include @@ -44,12 +44,10 @@ #define NORM_TYPE 0 #define MUX_TYPE 1 #define MUXPLUS_TYPE 2 -#define TTCP_TYPE 3 #define FAITH_TYPE 4 #define ISMUX(sep) (((sep)->se_type == MUX_TYPE) || \ ((sep)->se_type == MUXPLUS_TYPE)) #define ISMUXPLUS(sep) ((sep)->se_type == MUXPLUS_TYPE) -#define ISTTCP(sep) ((sep)->se_type == TTCP_TYPE) struct procinfo { LIST_ENTRY(procinfo) pr_link; From owner-p4-projects@FreeBSD.ORG Fri Sep 15 07:11:52 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0509116A415; Fri, 15 Sep 2006 07:11:52 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D3FAF16A412 for ; Fri, 15 Sep 2006 07:11:51 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7498743D6E for ; Fri, 15 Sep 2006 07:11:51 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8F7BpxR041802 for ; Fri, 15 Sep 2006 07:11:51 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8F7BpsW041799 for perforce@freebsd.org; Fri, 15 Sep 2006 07:11:51 GMT (envelope-from imp@freebsd.org) Date: Fri, 15 Sep 2006 07:11:51 GMT Message-Id: <200609150711.k8F7BpsW041799@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 106136 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Sep 2006 07:11:52 -0000 http://perforce.freebsd.org/chv.cgi?CH=106136 Change 106136 by imp@imp_lighthouse on 2006/09/15 07:11:01 Compile -Os. I'm not 100% sure I like this change. It causes the compiler to emit code that calls huge-ass division routines so typically increases the size of the boot image by a few tens to a few hundred bytes. Since all the other loaders are no where near their limits, this is OK, but a little worrisome. However, for the most important boot loader (boot2), it shrinks it by 356 bytes. A rather substantial savings, so go ahead and pull the trigger. I'm sure careful study of boot2 will shed light on why the other loaders grew so much if anyone ever wishes to investigate. Affected files ... .. //depot/projects/arm/src/sys/boot/arm/at91/Makefile.inc#20 edit .. //depot/projects/arm/src/sys/boot/arm/at91/boot2/Makefile#6 edit .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/Makefile#20 edit Differences ... ==== //depot/projects/arm/src/sys/boot/arm/at91/Makefile.inc#20 (text+ko) ==== @@ -5,7 +5,7 @@ __at91_boot_Makefile.inc__: -CFLAGS=-O2 -mcpu=arm9 -ffreestanding \ +CFLAGS=-Os -mcpu=arm9 -ffreestanding \ -I${.CURDIR}/../libat91 \ -I${.CURDIR}/../../../.. \ -I${.CURDIR}/../../../../arm \ ==== //depot/projects/arm/src/sys/boot/arm/at91/boot2/Makefile#6 (text+ko) ==== @@ -2,11 +2,9 @@ .PATH: ${.CURDIR}/../bootspi -BOOT_COMCONSOLE_SPEED?= 9600 - P=boot2 FILES=${P} -SRCS=arm_init.S boot2.c ee.c ashldi3.c divsi3.S +SRCS=arm_init.S boot2.c ee.c NO_MAN= LDFLAGS=-e 0 -T ${.CURDIR}/../linker.cfg OBJS+= ${SRCS:N*.h:R:S/$/.o/g} ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/Makefile#20 (text+ko) ==== @@ -7,6 +7,7 @@ SRCS=at91rm9200_lowlevel.c delay.c eeprom.c emac.c emac_init.c fpga.c getc.c \ p_string.c putchar.c printf.c reset.c spi_flash.c xmodem.c \ sd-card.c mci_device.c strcvt.c +SRCS+=ashldi3.c divsi3.S NO_MAN= .if ${MK_TAG_LIST} != "no" From owner-p4-projects@FreeBSD.ORG Fri Sep 15 07:25:19 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 21EAB16A494; Fri, 15 Sep 2006 07:25:19 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D9DB816A415 for ; Fri, 15 Sep 2006 07:25:18 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 91F5B43D55 for ; Fri, 15 Sep 2006 07:25:08 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8F7P8bx042371 for ; Fri, 15 Sep 2006 07:25:08 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8F7P83j042368 for perforce@freebsd.org; Fri, 15 Sep 2006 07:25:08 GMT (envelope-from imp@freebsd.org) Date: Fri, 15 Sep 2006 07:25:08 GMT Message-Id: <200609150725.k8F7P83j042368@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 106137 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Sep 2006 07:25:19 -0000 http://perforce.freebsd.org/chv.cgi?CH=106137 Change 106137 by imp@imp_lighthouse on 2006/09/15 07:24:42 Eliminate 4 bytes from strlen. Affected files ... .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/p_string.c#10 edit .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/spi_flash_write.c#1 branch Differences ... ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/p_string.c#10 (text+ko) ==== @@ -51,9 +51,8 @@ p_strlen(const char *buffer) { int len = 0; - if (buffer) - while (buffer[len]) - len++; + while (buffer[len]) + len++; return (len); } From owner-p4-projects@FreeBSD.ORG Fri Sep 15 07:27:12 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3A01D16A412; Fri, 15 Sep 2006 07:27:12 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1485D16A415 for ; Fri, 15 Sep 2006 07:27:12 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9EB6A43D49 for ; Fri, 15 Sep 2006 07:27:11 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8F7RBXW042517 for ; Fri, 15 Sep 2006 07:27:11 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8F7RBYp042514 for perforce@freebsd.org; Fri, 15 Sep 2006 07:27:11 GMT (envelope-from imp@freebsd.org) Date: Fri, 15 Sep 2006 07:27:11 GMT Message-Id: <200609150727.k8F7RBYp042514@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 106138 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Sep 2006 07:27:12 -0000 http://perforce.freebsd.org/chv.cgi?CH=106138 Change 106138 by imp@imp_lighthouse on 2006/09/15 07:27:04 reimplement strlen. Saves another 16 bytes (20 so far). Affected files ... .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/p_string.c#11 edit Differences ... ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/p_string.c#11 (text+ko) ==== @@ -50,10 +50,10 @@ int p_strlen(const char *buffer) { - int len = 0; - while (buffer[len]) - len++; - return (len); + const char *ptr = buffer; + while (*ptr++) + continue; + return (ptr - buffer); } From owner-p4-projects@FreeBSD.ORG Fri Sep 15 07:38:27 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 74DF616A47E; Fri, 15 Sep 2006 07:38:27 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3805D16A47B for ; Fri, 15 Sep 2006 07:38:27 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id C4DA343D49 for ; Fri, 15 Sep 2006 07:38:26 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8F7cQQf043282 for ; Fri, 15 Sep 2006 07:38:26 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8F7cQKG043279 for perforce@freebsd.org; Fri, 15 Sep 2006 07:38:26 GMT (envelope-from imp@freebsd.org) Date: Fri, 15 Sep 2006 07:38:26 GMT Message-Id: <200609150738.k8F7cQKG043279@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 106140 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Sep 2006 07:38:27 -0000 http://perforce.freebsd.org/chv.cgi?CH=106140 Change 106140 by imp@imp_lighthouse on 2006/09/15 07:37:25 Break p_strlen out of p_string to save another 24 bytes per boot loader (except bootiic). Affected files ... .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/Makefile#21 edit .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/p_string.c#12 edit .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/strlen.c#1 add Differences ... ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/Makefile#21 (text+ko) ==== @@ -6,7 +6,7 @@ INTERNALLIB= SRCS=at91rm9200_lowlevel.c delay.c eeprom.c emac.c emac_init.c fpga.c getc.c \ p_string.c putchar.c printf.c reset.c spi_flash.c xmodem.c \ - sd-card.c mci_device.c strcvt.c + sd-card.c mci_device.c strcvt.c strlen.c SRCS+=ashldi3.c divsi3.S NO_MAN= ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/p_string.c#12 (text+ko) ==== @@ -39,24 +39,6 @@ *buffer++ = value; } - -/* - * .KB_C_FN_DEFINITION_START - * int p_strlen(char *) - * This global function returns the number of bytes starting at the pointer - * before (not including) the string termination character ('/0'). - * .KB_C_FN_DEFINITION_END - */ -int -p_strlen(const char *buffer) -{ - const char *ptr = buffer; - while (*ptr++) - continue; - return (ptr - buffer); -} - - /* * .KB_C_FN_DEFINITION_START * char *p_strcpy(char *to, char *from) From owner-p4-projects@FreeBSD.ORG Fri Sep 15 07:41:32 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 189A216A417; Fri, 15 Sep 2006 07:41:32 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C988116A415 for ; Fri, 15 Sep 2006 07:41:31 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 771BE43D49 for ; Fri, 15 Sep 2006 07:41:31 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8F7fVlA043487 for ; Fri, 15 Sep 2006 07:41:31 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8F7fVgu043484 for perforce@freebsd.org; Fri, 15 Sep 2006 07:41:31 GMT (envelope-from imp@freebsd.org) Date: Fri, 15 Sep 2006 07:41:31 GMT Message-Id: <200609150741.k8F7fVgu043484@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 106141 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Sep 2006 07:41:32 -0000 http://perforce.freebsd.org/chv.cgi?CH=106141 Change 106141 by imp@imp_lighthouse on 2006/09/15 07:40:54 rv was unused. Affected files ... .. //depot/projects/arm/src/sys/boot/arm/at91/boot2/boot2.c#19 edit Differences ... ==== //depot/projects/arm/src/sys/boot/arm/at91/boot2/boot2.c#19 (text+ko) ==== @@ -103,9 +103,7 @@ static inline int xfsread(ino_t inode, void *buf, size_t nbyte) { - ssize_t rv; - - if ((size_t)(rv = fsread(inode, buf, nbyte)) != nbyte) + if ((size_t)fsread(inode, buf, nbyte) != nbyte) return -1; return 0; } From owner-p4-projects@FreeBSD.ORG Fri Sep 15 13:29:28 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C7DD216A412; Fri, 15 Sep 2006 13:29:28 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8908B16A407 for ; Fri, 15 Sep 2006 13:29:28 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 448BD43D5A for ; Fri, 15 Sep 2006 13:29:28 +0000 (GMT) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8FDTSl0094562 for ; Fri, 15 Sep 2006 13:29:28 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8FDTRa0094559 for perforce@freebsd.org; Fri, 15 Sep 2006 13:29:27 GMT (envelope-from hselasky@FreeBSD.org) Date: Fri, 15 Sep 2006 13:29:27 GMT Message-Id: <200609151329.k8FDTRa0094559@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 106147 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Sep 2006 13:29:29 -0000 http://perforce.freebsd.org/chv.cgi?CH=106147 Change 106147 by hselasky@hselasky_mini_itx on 2006/09/15 13:28:30 Complete parenthesis of expression. Affected files ... .. //depot/projects/usb/src/sys/dev/usb/usb_subr.c#17 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb/usb_subr.c#17 (text+ko) ==== @@ -142,29 +142,29 @@ } } #ifdef USBVERBOSE - if (vendor == NULL || product == NULL) { + if ((vendor == NULL) || (product == NULL)) { for(kdp = usb_knowndevs; kdp->vendorname != NULL; kdp++) { - if (kdp->vendor == UGETW(udd->idVendor) && - (kdp->product == UGETW(udd->idProduct) || - (kdp->flags & USB_KNOWNDEV_NOPROD) != 0)) + if ((kdp->vendor == UGETW(udd->idVendor)) && + ((kdp->product == UGETW(udd->idProduct)) || + (kdp->flags & USB_KNOWNDEV_NOPROD))) break; } if (kdp->vendorname != NULL) { if (vendor == NULL) vendor = kdp->vendorname; if (product == NULL) - product = (kdp->flags & USB_KNOWNDEV_NOPROD) == 0 ? + product = ((kdp->flags & USB_KNOWNDEV_NOPROD) == 0) ? kdp->productname : NULL; } } #endif - if (vendor != NULL && *vendor) + if ((vendor != NULL) && *vendor) strcpy(v, vendor); else sprintf(v, "vendor 0x%04x", UGETW(udd->idVendor)); - if (product != NULL && *product) + if ((product != NULL) && *product) strcpy(p, product); else sprintf(p, "product 0x%04x", UGETW(udd->idProduct)); From owner-p4-projects@FreeBSD.ORG Fri Sep 15 14:17:46 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 729FA16A494; Fri, 15 Sep 2006 14:17:46 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3619216A415 for ; Fri, 15 Sep 2006 14:17:46 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 148A243DB0 for ; Fri, 15 Sep 2006 14:17:29 +0000 (GMT) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8FEHTLq098276 for ; Fri, 15 Sep 2006 14:17:29 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8FEHSFx098273 for perforce@freebsd.org; Fri, 15 Sep 2006 14:17:28 GMT (envelope-from hselasky@FreeBSD.org) Date: Fri, 15 Sep 2006 14:17:28 GMT Message-Id: <200609151417.k8FEHSFx098273@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 106148 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Sep 2006 14:17:46 -0000 http://perforce.freebsd.org/chv.cgi?CH=106148 Change 106148 by hselasky@hselasky_mini_itx on 2006/09/15 14:17:12 Initialize all driver_t structures by record. Bugfix: Some of the modem drivers did not use the "ucom_devclass". Make sure that all modem drivers use this devclass. Affected files ... .. //depot/projects/usb/src/sys/dev/usb/if_aue.c#9 edit .. //depot/projects/usb/src/sys/dev/usb/if_axe.c#8 edit .. //depot/projects/usb/src/sys/dev/usb/if_cdce.c#7 edit .. //depot/projects/usb/src/sys/dev/usb/if_cue.c#8 edit .. //depot/projects/usb/src/sys/dev/usb/if_kue.c#9 edit .. //depot/projects/usb/src/sys/dev/usb/if_rue.c#7 edit .. //depot/projects/usb/src/sys/dev/usb/if_udav.c#7 edit .. //depot/projects/usb/src/sys/dev/usb/ucycom.c#6 edit .. //depot/projects/usb/src/sys/dev/usb/ufm.c#6 edit .. //depot/projects/usb/src/sys/dev/usb/ufoma.c#6 edit .. //depot/projects/usb/src/sys/dev/usb/uftdi.c#7 edit .. //depot/projects/usb/src/sys/dev/usb/umct.c#6 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb/if_aue.c#9 (text+ko) ==== @@ -375,9 +375,9 @@ }; static driver_t aue_driver = { - "aue", - aue_methods, - sizeof(struct aue_softc) + .name = "aue", + .methods = aue_methods, + .size = sizeof(struct aue_softc) }; static devclass_t aue_devclass; ==== //depot/projects/usb/src/sys/dev/usb/if_axe.c#8 (text+ko) ==== @@ -308,9 +308,9 @@ }; static driver_t axe_driver = { - "axe", - axe_methods, - sizeof(struct axe_softc) + .name = "axe", + .methods = axe_methods, + .size = sizeof(struct axe_softc), }; static devclass_t axe_devclass; ==== //depot/projects/usb/src/sys/dev/usb/if_cdce.c#7 (text+ko) ==== @@ -165,9 +165,9 @@ }; static driver_t cdce_driver = { - "cdce", - cdce_methods, - sizeof(struct cdce_softc) + .name = "cdce", + .methods = cdce_methods, + .size = sizeof(struct cdce_softc), }; static devclass_t cdce_devclass; ==== //depot/projects/usb/src/sys/dev/usb/if_cue.c#8 (text+ko) ==== @@ -228,9 +228,9 @@ }; static driver_t cue_driver = { - "cue", - cue_methods, - sizeof(struct cue_softc) + .name = "cue", + .methods = cue_methods, + .size = sizeof(struct cue_softc), }; static devclass_t cue_devclass; ==== //depot/projects/usb/src/sys/dev/usb/if_kue.c#9 (text+ko) ==== @@ -248,9 +248,9 @@ }; static driver_t kue_driver = { - "kue", - kue_methods, - sizeof(struct kue_softc) + .name = "kue", + .methods = kue_methods, + .size = sizeof(struct kue_softc), }; static devclass_t kue_devclass; ==== //depot/projects/usb/src/sys/dev/usb/if_rue.c#7 (text+ko) ==== @@ -317,9 +317,9 @@ }; static driver_t rue_driver = { - "rue", - rue_methods, - sizeof(struct rue_softc) + .name = "rue", + .methods = rue_methods, + .size = sizeof(struct rue_softc), }; static devclass_t rue_devclass; ==== //depot/projects/usb/src/sys/dev/usb/if_udav.c#7 (text+ko) ==== @@ -266,9 +266,9 @@ }; static driver_t udav_driver = { - "udav", - udav_methods, - sizeof(struct udav_softc) + .name = "udav", + .methods = udav_methods, + .size = sizeof(struct udav_softc), }; static devclass_t udav_devclass; ==== //depot/projects/usb/src/sys/dev/usb/ucycom.c#6 (text+ko) ==== @@ -193,14 +193,12 @@ }; static driver_t ucycom_driver = { - "ucycom", - ucycom_methods, - sizeof(struct ucycom_softc), + .name = "ucom", + .methods = ucycom_methods, + .size = sizeof(struct ucycom_softc), }; -static devclass_t ucycom_devclass; - -DRIVER_MODULE(ucycom, uhub, ucycom_driver, ucycom_devclass, usbd_driver_load, 0); +DRIVER_MODULE(ucycom, uhub, ucycom_driver, ucom_devclass, usbd_driver_load, 0); MODULE_VERSION(ucycom, 1); MODULE_DEPEND(ucycom, usb, 1, 1, 1); ==== //depot/projects/usb/src/sys/dev/usb/ufm.c#6 (text+ko) ==== @@ -143,9 +143,9 @@ }; static driver_t ufm_driver = { - "ufm", - ufm_methods, - sizeof(struct ufm_softc) + .name = "ufm", + .methods = ufm_methods, + .size = sizeof(struct ufm_softc), }; MODULE_DEPEND(ufm, usb, 1, 1, 1); ==== //depot/projects/usb/src/sys/dev/usb/ufoma.c#6 (text+ko) ==== @@ -400,13 +400,11 @@ }; static driver_t ufoma_driver = { - "ucom", - ufoma_methods, - sizeof(struct ufoma_softc) + .name = "ucom", + .methods = ufoma_methods, + .size = sizeof(struct ufoma_softc), }; -static devclass_t ucom_devclass; - DRIVER_MODULE(ufoma, uhub, ufoma_driver, ucom_devclass, usbd_driver_load, 0); MODULE_DEPEND(ufoma, usb, 1, 1, 1); MODULE_DEPEND(ufoma, ucom, UCOM_MINVER, UCOM_PREFVER, UCOM_MAXVER); ==== //depot/projects/usb/src/sys/dev/usb/uftdi.c#7 (text+ko) ==== @@ -280,9 +280,9 @@ }; static driver_t uftdi_driver = { - "ucom", - uftdi_methods, - sizeof (struct uftdi_softc) + .name = "ucom", + .methods = uftdi_methods, + .size = sizeof (struct uftdi_softc), }; DRIVER_MODULE(uftdi, uhub, uftdi_driver, ucom_devclass, usbd_driver_load, 0); ==== //depot/projects/usb/src/sys/dev/usb/umct.c#6 (text+ko) ==== @@ -294,9 +294,9 @@ }; static driver_t umct_driver = { - "ucom", - umct_methods, - sizeof(struct umct_softc) + .name = "ucom", + .methods = umct_methods, + .size = sizeof(struct umct_softc), }; DRIVER_MODULE(umct, uhub, umct_driver, ucom_devclass, usbd_driver_load, 0); From owner-p4-projects@FreeBSD.ORG Fri Sep 15 14:46:35 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id BC15C16A4ED; Fri, 15 Sep 2006 14:46:35 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 63ED616A412; Fri, 15 Sep 2006 14:46:35 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id AE1FD43D46; Fri, 15 Sep 2006 14:46:25 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from zion.baldwin.cx (zion.baldwin.cx [192.168.0.7]) (authenticated bits=0) by server.baldwin.cx (8.13.6/8.13.6) with ESMTP id k8FEkD7B051402; Fri, 15 Sep 2006 10:46:22 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: Hans Petter Selasky Date: Fri, 15 Sep 2006 10:39:16 -0400 User-Agent: KMail/1.9.1 References: <200609151417.k8FEHSFx098273@repoman.freebsd.org> In-Reply-To: <200609151417.k8FEHSFx098273@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200609151039.16523.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [192.168.0.1]); Fri, 15 Sep 2006 10:46:22 -0400 (EDT) X-Virus-Scanned: ClamAV 0.88.3/1885/Fri Sep 15 07:19:10 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: Perforce Change Reviews Subject: Re: PERFORCE change 106148 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Sep 2006 14:46:36 -0000 On Friday 15 September 2006 10:17, Hans Petter Selasky wrote: > http://perforce.freebsd.org/chv.cgi?CH=106148 > > Change 106148 by hselasky@hselasky_mini_itx on 2006/09/15 14:17:12 > > Initialize all driver_t structures by record. Bugfix: Some of the > modem drivers did not use the "ucom_devclass". Make sure that all > modem drivers use this devclass. That doesn't actually matter. Also, no other drivers use this style to initialize their driver_t. If you really wanted to do a change, you should change them to use DEFINE_CLASS macros to define a KOBJ class instead. BTW, why the devclass doesn't matter: the devclass_t is just a pointer to a device class. The device classes are based on the driver name, so if you add a new driver with the name "foo", it will look up the device class by name ("foo"), creating one if it doesn't exist. It then saves a pointer to that device class object in the devclass_t pointer specified in DRIVER_MODULE(). So, by making them all share the same devclass_t, they are all just going to overwrite the same pointer when the driver module loads. To be honest, most drivers don't even use the devclass pointer, and I'd actually like to axe it and make the few drivers that do care use 'devclass_find("foo")' when they need the devclass pointer instead. > Affected files ... > > .. //depot/projects/usb/src/sys/dev/usb/if_aue.c#9 edit > .. //depot/projects/usb/src/sys/dev/usb/if_axe.c#8 edit > .. //depot/projects/usb/src/sys/dev/usb/if_cdce.c#7 edit > .. //depot/projects/usb/src/sys/dev/usb/if_cue.c#8 edit > .. //depot/projects/usb/src/sys/dev/usb/if_kue.c#9 edit > .. //depot/projects/usb/src/sys/dev/usb/if_rue.c#7 edit > .. //depot/projects/usb/src/sys/dev/usb/if_udav.c#7 edit > .. //depot/projects/usb/src/sys/dev/usb/ucycom.c#6 edit > .. //depot/projects/usb/src/sys/dev/usb/ufm.c#6 edit > .. //depot/projects/usb/src/sys/dev/usb/ufoma.c#6 edit > .. //depot/projects/usb/src/sys/dev/usb/uftdi.c#7 edit > .. //depot/projects/usb/src/sys/dev/usb/umct.c#6 edit > > Differences ... > > ==== //depot/projects/usb/src/sys/dev/usb/if_aue.c#9 (text+ko) ==== > > @@ -375,9 +375,9 @@ > }; > > static driver_t aue_driver = { > - "aue", > - aue_methods, > - sizeof(struct aue_softc) > + .name = "aue", > + .methods = aue_methods, > + .size = sizeof(struct aue_softc) > }; > > static devclass_t aue_devclass; > > ==== //depot/projects/usb/src/sys/dev/usb/if_axe.c#8 (text+ko) ==== > > @@ -308,9 +308,9 @@ > }; > > static driver_t axe_driver = { > - "axe", > - axe_methods, > - sizeof(struct axe_softc) > + .name = "axe", > + .methods = axe_methods, > + .size = sizeof(struct axe_softc), > }; > > static devclass_t axe_devclass; > > ==== //depot/projects/usb/src/sys/dev/usb/if_cdce.c#7 (text+ko) ==== > > @@ -165,9 +165,9 @@ > }; > > static driver_t cdce_driver = { > - "cdce", > - cdce_methods, > - sizeof(struct cdce_softc) > + .name = "cdce", > + .methods = cdce_methods, > + .size = sizeof(struct cdce_softc), > }; > > static devclass_t cdce_devclass; > > ==== //depot/projects/usb/src/sys/dev/usb/if_cue.c#8 (text+ko) ==== > > @@ -228,9 +228,9 @@ > }; > > static driver_t cue_driver = { > - "cue", > - cue_methods, > - sizeof(struct cue_softc) > + .name = "cue", > + .methods = cue_methods, > + .size = sizeof(struct cue_softc), > }; > > static devclass_t cue_devclass; > > ==== //depot/projects/usb/src/sys/dev/usb/if_kue.c#9 (text+ko) ==== > > @@ -248,9 +248,9 @@ > }; > > static driver_t kue_driver = { > - "kue", > - kue_methods, > - sizeof(struct kue_softc) > + .name = "kue", > + .methods = kue_methods, > + .size = sizeof(struct kue_softc), > }; > > static devclass_t kue_devclass; > > ==== //depot/projects/usb/src/sys/dev/usb/if_rue.c#7 (text+ko) ==== > > @@ -317,9 +317,9 @@ > }; > > static driver_t rue_driver = { > - "rue", > - rue_methods, > - sizeof(struct rue_softc) > + .name = "rue", > + .methods = rue_methods, > + .size = sizeof(struct rue_softc), > }; > > static devclass_t rue_devclass; > > ==== //depot/projects/usb/src/sys/dev/usb/if_udav.c#7 (text+ko) ==== > > @@ -266,9 +266,9 @@ > }; > > static driver_t udav_driver = { > - "udav", > - udav_methods, > - sizeof(struct udav_softc) > + .name = "udav", > + .methods = udav_methods, > + .size = sizeof(struct udav_softc), > }; > > static devclass_t udav_devclass; > > ==== //depot/projects/usb/src/sys/dev/usb/ucycom.c#6 (text+ko) ==== > > @@ -193,14 +193,12 @@ > }; > > static driver_t ucycom_driver = { > - "ucycom", > - ucycom_methods, > - sizeof(struct ucycom_softc), > + .name = "ucom", > + .methods = ucycom_methods, > + .size = sizeof(struct ucycom_softc), > }; > > -static devclass_t ucycom_devclass; > - > -DRIVER_MODULE(ucycom, uhub, ucycom_driver, ucycom_devclass, usbd_driver_load, 0); > +DRIVER_MODULE(ucycom, uhub, ucycom_driver, ucom_devclass, usbd_driver_load, 0); > MODULE_VERSION(ucycom, 1); > MODULE_DEPEND(ucycom, usb, 1, 1, 1); > > > ==== //depot/projects/usb/src/sys/dev/usb/ufm.c#6 (text+ko) ==== > > @@ -143,9 +143,9 @@ > }; > > static driver_t ufm_driver = { > - "ufm", > - ufm_methods, > - sizeof(struct ufm_softc) > + .name = "ufm", > + .methods = ufm_methods, > + .size = sizeof(struct ufm_softc), > }; > > MODULE_DEPEND(ufm, usb, 1, 1, 1); > > ==== //depot/projects/usb/src/sys/dev/usb/ufoma.c#6 (text+ko) ==== > > @@ -400,13 +400,11 @@ > }; > > static driver_t ufoma_driver = { > - "ucom", > - ufoma_methods, > - sizeof(struct ufoma_softc) > + .name = "ucom", > + .methods = ufoma_methods, > + .size = sizeof(struct ufoma_softc), > }; > > -static devclass_t ucom_devclass; > - > DRIVER_MODULE(ufoma, uhub, ufoma_driver, ucom_devclass, usbd_driver_load, 0); > MODULE_DEPEND(ufoma, usb, 1, 1, 1); > MODULE_DEPEND(ufoma, ucom, UCOM_MINVER, UCOM_PREFVER, UCOM_MAXVER); > > ==== //depot/projects/usb/src/sys/dev/usb/uftdi.c#7 (text+ko) ==== > > @@ -280,9 +280,9 @@ > }; > > static driver_t uftdi_driver = { > - "ucom", > - uftdi_methods, > - sizeof (struct uftdi_softc) > + .name = "ucom", > + .methods = uftdi_methods, > + .size = sizeof (struct uftdi_softc), > }; > > DRIVER_MODULE(uftdi, uhub, uftdi_driver, ucom_devclass, usbd_driver_load, 0); > > ==== //depot/projects/usb/src/sys/dev/usb/umct.c#6 (text+ko) ==== > > @@ -294,9 +294,9 @@ > }; > > static driver_t umct_driver = { > - "ucom", > - umct_methods, > - sizeof(struct umct_softc) > + .name = "ucom", > + .methods = umct_methods, > + .size = sizeof(struct umct_softc), > }; > > DRIVER_MODULE(umct, uhub, umct_driver, ucom_devclass, usbd_driver_load, 0); > -- John Baldwin From owner-p4-projects@FreeBSD.ORG Fri Sep 15 15:09:37 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id AA6EA16A51B; Fri, 15 Sep 2006 15:09:37 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8550D16A500 for ; Fri, 15 Sep 2006 15:09:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id A066F43D5A for ; Fri, 15 Sep 2006 15:09:33 +0000 (GMT) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8FF9XCr002786 for ; Fri, 15 Sep 2006 15:09:33 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8FF9X6C002783 for perforce@freebsd.org; Fri, 15 Sep 2006 15:09:33 GMT (envelope-from hselasky@FreeBSD.org) Date: Fri, 15 Sep 2006 15:09:33 GMT Message-Id: <200609151509.k8FF9X6C002783@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 106149 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Sep 2006 15:09:37 -0000 http://perforce.freebsd.org/chv.cgi?CH=106149 Change 106149 by hselasky@hselasky_mini_itx on 2006/09/15 15:09:28 The "ucom" layer currently only supports devices that are in the "ucom_devclass", due to the need for unique unit numbers. Affected files ... .. //depot/projects/usb/src/sys/dev/usb/ucom.c#8 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb/ucom.c#8 (text+ko) ==== @@ -153,6 +153,15 @@ mtx_assert(&Giant, MA_OWNED); + if (device_get_devclass(dev) != ucom_devclass) { + /* NOTE: if all devices are not in the same + * devclass, we get duplicate unit numbers + * which will crash the TTY layer! + */ + error = EINVAL; + goto done; + } + unit = device_get_unit(dev); tp = ttyalloc(); From owner-p4-projects@FreeBSD.ORG Fri Sep 15 15:10:09 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1DC6116A47B; Fri, 15 Sep 2006 15:10:09 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D8ECC16A415; Fri, 15 Sep 2006 15:10:08 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe13.swip.net [212.247.155.129]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2A90543D58; Fri, 15 Sep 2006 15:10:03 +0000 (GMT) (envelope-from hselasky@c2i.net) X-T2-Posting-ID: gvlK0tOCzrqh9CPROFOFPw== X-Cloudmark-Score: 0.000000 [] Received: from [193.217.137.89] (HELO [10.0.0.249]) by mailfe13.swip.net (CommuniGate Pro SMTP 5.0.8) with ESMTP id 111423715; Fri, 15 Sep 2006 17:10:01 +0200 From: Hans Petter Selasky To: John Baldwin Date: Fri, 15 Sep 2006 17:10:16 +0200 User-Agent: KMail/1.7 References: <200609151417.k8FEHSFx098273@repoman.freebsd.org> <200609151039.16523.jhb@freebsd.org> In-Reply-To: <200609151039.16523.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200609151710.17572.hselasky@c2i.net> Cc: Perforce Change Reviews Subject: Re: PERFORCE change 106148 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Sep 2006 15:10:09 -0000 On Friday 15 September 2006 16:39, you wrote: > On Friday 15 September 2006 10:17, Hans Petter Selasky wrote: > > http://perforce.freebsd.org/chv.cgi?CH=106148 > > > > Change 106148 by hselasky@hselasky_mini_itx on 2006/09/15 14:17:12 > > > > Initialize all driver_t structures by record. Bugfix: Some of the > > modem drivers did not use the "ucom_devclass". Make sure that all > > modem drivers use this devclass. > > That doesn't actually matter. Also, no other drivers use this style to > initialize their driver_t. If you really wanted to do a change, you should > change them to use DEFINE_CLASS macros to define a KOBJ class instead. Ok. Will consider that next time. > BTW, why the devclass doesn't matter: the devclass_t is just a pointer to > a device class. The device classes are based on the driver name, so if you > add a new driver with the name "foo", it will look up the device class by > name ("foo"), creating one if it doesn't exist. My implementation for NetBSD works like this: static u_int8_t devclass_create(devclass_t *dc_pp) { if (dc_pp == NULL) { return 1; } if (dc_pp[0] == NULL) { dc_pp[0] = malloc(sizeof(**(dc_pp)), M_DEVBUF, M_WAITOK|M_ZERO); if (dc_pp[0] == NULL) { return 1; } } return 0; } static const struct bsd_module_data * devclass_find_create(const char *classname) { const struct bsd_module_data *mod; for(mod = &bsd_module_data_start[0]; mod < &bsd_module_data_end[0]; mod++) { if(mod->mod_name && (strcmp(classname, mod->mod_name) == 0)) { if(devclass_create(mod->devclass_pp)) { continue; } return mod; } } return NULL; } > It then saves a pointer to > that device class object in the devclass_t pointer specified in > DRIVER_MODULE(). So, by making them all share the same devclass_t, they are > all just going to overwrite the same pointer when the driver module loads. No, wrong. The devclass_t pointer is not overwritten if it is already initialized! > To be honest, most drivers don't even use the devclass pointer, and I'd > actually like to axe it and make the few drivers that do care use > 'devclass_find("foo")' when they need the devclass pointer instead. I need the devclass to get unique unit numbers. --HPS From owner-p4-projects@FreeBSD.ORG Fri Sep 15 17:08:33 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 120A516A415; Fri, 15 Sep 2006 17:08:33 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C9D5B16A403 for ; Fri, 15 Sep 2006 17:08:32 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 826F743D67 for ; Fri, 15 Sep 2006 17:08:22 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.6/8.13.6) with ESMTP id k8FH89i5052169; Fri, 15 Sep 2006 13:08:09 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: Hans Petter Selasky Date: Fri, 15 Sep 2006 12:43:50 -0400 User-Agent: KMail/1.9.1 References: <200609151417.k8FEHSFx098273@repoman.freebsd.org> <200609151039.16523.jhb@freebsd.org> <200609151710.17572.hselasky@c2i.net> In-Reply-To: <200609151710.17572.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200609151243.50388.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Fri, 15 Sep 2006 13:08:10 -0400 (EDT) X-Virus-Scanned: ClamAV 0.88.3/1885/Fri Sep 15 07:19:10 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: Perforce Change Reviews Subject: Re: PERFORCE change 106148 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Sep 2006 17:08:33 -0000 On Friday 15 September 2006 11:10, Hans Petter Selasky wrote: > On Friday 15 September 2006 16:39, you wrote: > > On Friday 15 September 2006 10:17, Hans Petter Selasky wrote: > > > http://perforce.freebsd.org/chv.cgi?CH=106148 > > > > > > Change 106148 by hselasky@hselasky_mini_itx on 2006/09/15 14:17:12 > > > > > > Initialize all driver_t structures by record. Bugfix: Some of the > > > modem drivers did not use the "ucom_devclass". Make sure that all > > > modem drivers use this devclass. > > > > That doesn't actually matter. Also, no other drivers use this style to > > initialize their driver_t. If you really wanted to do a change, you should > > change them to use DEFINE_CLASS macros to define a KOBJ class instead. > > Ok. Will consider that next time. > > > BTW, why the devclass doesn't matter: the devclass_t is just a pointer to > > a device class. The device classes are based on the driver name, so if you > > add a new driver with the name "foo", it will look up the device class by > > name ("foo"), creating one if it doesn't exist. > > My implementation for NetBSD works like this: This is FreeBSD I'm talking about. > > It then saves a pointer to > > that device class object in the devclass_t pointer specified in > > DRIVER_MODULE(). So, by making them all share the same devclass_t, they are > > all just going to overwrite the same pointer when the driver module loads. > > No, wrong. The devclass_t pointer is not overwritten if it is already > initialized! Umm. It's overwritten, but to the same value. Go look at the actual code. This is the function that is called via SYSINIT via DRIVER_MODULE(): /** * @brief Module handler for registering device drivers * * This module handler is used to automatically register device * drivers when modules are loaded. If @p what is MOD_LOAD, it calls * devclass_add_driver() for the driver described by the * driver_module_data structure pointed to by @p arg */ int driver_module_handler(module_t mod, int what, void *arg) { ... dmd = (struct driver_module_data *)arg; ... switch (what) { case MOD_LOAD: ... if (driver->baseclasses) { const char *parentname; parentname = driver->baseclasses[0]->name; *dmd->dmd_devclass = devclass_find_internal(driver->name, parentname, TRUE); } else { *dmd->dmd_devclass = devclass_find_internal(driver->name, 0, TRUE); } break; ... } The writes to dmd_devclass are writing to the 'static devclass_t' you specify in your DRIVER_MODULE() line. As I mentioned earlier, devclass_t isn't a struct, it's a pointer to a struct: typedef struct devclass *devclass_t; Basically, passing a devclass_t into DRIVER_MODULE() just gives you a pre-intialized pointer to your devclass. The devclass's aren't bound to that devclass_t though, they are bound to the name. Thus if you have: static devclass_t foo_class, bar_class; static driver_t foo_driver { "foo", ... }; static driver_t bar_driver { "foo", ... }; DRIVER_MODULE(..., foo_driver, foo_devclass, ...); DRIVER_MODULE(..., bar_driver, bar_devclass, ...); foo_devclass and bar_devclass will both point to the same device class object. > > To be honest, most drivers don't even use the devclass pointer, and I'd > > actually like to axe it and make the few drivers that do care use > > 'devclass_find("foo")' when they need the devclass pointer instead. > > I need the devclass to get unique unit numbers. Again, go look at the actual code, it can still call devclass_find_internal(), but it is not required to save the pointer to do so. -- John Baldwin From owner-p4-projects@FreeBSD.ORG Fri Sep 15 17:20:23 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7835316A47E; Fri, 15 Sep 2006 17:20:23 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 54A9B16A417 for ; Fri, 15 Sep 2006 17:20:23 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 81DAD43D77 for ; Fri, 15 Sep 2006 17:20:21 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8FHKLnY020834 for ; Fri, 15 Sep 2006 17:20:21 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8FHKLxL020831 for perforce@freebsd.org; Fri, 15 Sep 2006 17:20:21 GMT (envelope-from imp@freebsd.org) Date: Fri, 15 Sep 2006 17:20:21 GMT Message-Id: <200609151720.k8FHKLxL020831@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 106157 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Sep 2006 17:20:23 -0000 http://perforce.freebsd.org/chv.cgi?CH=106157 Change 106157 by imp@imp_lighthouse on 2006/09/15 17:19:50 integrate Affected files ... .. //depot/projects/arm/src/sys/boot/arm/at91/boot2/boot2.c#20 edit .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/memcpy.c#1 branch .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/strcmp.c#1 branch Differences ... ==== //depot/projects/arm/src/sys/boot/arm/at91/boot2/boot2.c#20 (text+ko) ==== @@ -180,6 +180,7 @@ } #endif +#ifdef BOOT_TSC static void MacFromEE() { @@ -204,6 +205,7 @@ printf("MAC %x:%x:%x:%x:%x:%x\n", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); } +#endif int main(void) @@ -212,11 +214,13 @@ ino_t ino; #ifdef TSC_FPGA - SPI_InitFlash(); - fpga_load(); + SPI_InitFlash(); + fpga_load(); #endif +#ifdef BOOT_TSC EEInit(); MacFromEE(); +#endif EMAC_Init(); sdcard_init(); EMAC_SetMACAddress(mac); From owner-p4-projects@FreeBSD.ORG Fri Sep 15 17:34:48 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5BC0916A417; Fri, 15 Sep 2006 17:34:48 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 375AA16A40F for ; Fri, 15 Sep 2006 17:34:48 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 05FFB43D69 for ; Fri, 15 Sep 2006 17:34:40 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8FHYd3t021775 for ; Fri, 15 Sep 2006 17:34:39 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8FHYdlQ021772 for perforce@freebsd.org; Fri, 15 Sep 2006 17:34:39 GMT (envelope-from imp@freebsd.org) Date: Fri, 15 Sep 2006 17:34:39 GMT Message-Id: <200609151734.k8FHYdlQ021772@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 106158 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Sep 2006 17:34:48 -0000 http://perforce.freebsd.org/chv.cgi?CH=106158 Change 106158 by imp@imp_lighthouse on 2006/09/15 17:33:51 Migrate more functions into their own file. This helps get another 48 bytes from boot2 Affected files ... .. //depot/projects/arm/src/sys/boot/arm/at91/boot2/boot2.c#21 edit .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/Makefile#22 edit .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/emac.c#30 edit .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/lib.h#19 edit .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/memcmp.c#1 add .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/memcpy.c#2 edit .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/memset.c#1 add .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/p_string.c#13 edit .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/strcmp.c#2 edit .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/strcpy.c#1 add Differences ... ==== //depot/projects/arm/src/sys/boot/arm/at91/boot2/boot2.c#21 (text+ko) ==== @@ -243,7 +243,7 @@ /* Present the user with the boot2 prompt. */ - p_strcpy(kname, PATH_KERNEL); + strcpy(kname, PATH_KERNEL); for (;;) { printf("\nDefault: %s\nboot: ", kname); if (!autoboot || (c = getc(2)) != -1) ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/Makefile#22 (text+ko) ==== @@ -5,8 +5,9 @@ LIB= at91 INTERNALLIB= SRCS=at91rm9200_lowlevel.c delay.c eeprom.c emac.c emac_init.c fpga.c getc.c \ - p_string.c putchar.c printf.c reset.c spi_flash.c xmodem.c \ - sd-card.c mci_device.c strcvt.c strlen.c + putchar.c printf.c reset.c spi_flash.c xmodem.c \ + sd-card.c mci_device.c strcvt.c strlen.c strcmp.c memcpy.c strcpy.c \ + memset.c memcmp.c SRCS+=ashldi3.c divsi3.S NO_MAN= ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/emac.c#30 (text+ko) ==== @@ -176,8 +176,8 @@ cPtr = (char*)&(tftpHeader.block_num); - ePtr = p_strcpy(cPtr, filename); - mPtr = p_strcpy(ePtr, "octet"); + ePtr = strcpy(cPtr, filename); + mPtr = strcpy(ePtr, "octet"); length = mPtr - cPtr; length += 2; ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/lib.h#19 (text) ==== @@ -57,7 +57,7 @@ void p_memset(char *buffer, char value, int size); int p_strlen(const char *buffer); -char *p_strcpy(char *to, const char *from); +char *strcpy(char *to, const char *from); void memcpy(void *to, const void *from, unsigned size); int p_memcmp(const char *to, const char *from, unsigned size); int strcmp(const char *to, const char *from); ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/memcpy.c#2 (text+ko) ==== @@ -1,61 +1,6 @@ -/****************************************************************************** - * - * Filename: p_string.c - * - * Instantiation of basic string operations to prevent inclusion of full - * string library. These are simple implementations not necessarily optimized - * for speed, but rather to show intent. - * - * Revision information: - * - * 20AUG2004 kb_admin initial creation - * 12JAN2005 kb_admin minor updates - * - * BEGIN_KBDD_BLOCK - * No warranty, expressed or implied, is included with this software. It is - * provided "AS IS" and no warranty of any kind including statutory or aspects - * relating to merchantability or fitness for any purpose is provided. All - * intellectual property rights of others is maintained with the respective - * owners. This software is not copyrighted and is intended for reference - * only. - * END_BLOCK - * - * $FreeBSD: src/sys/boot/arm/at91/libat91/p_string.c,v 1.2 2006/08/10 18:07:49 imp Exp $ - *****************************************************************************/ - #include "lib.h" -/* - * .KB_C_FN_DEFINITION_START - * void p_memset(char *buffer, char value, int size) - * This global function sets memory at the pointer for the specified - * number of bytes to value. - * .KB_C_FN_DEFINITION_END - */ void -p_memset(char *buffer, char value, int size) -{ - while (size--) - *buffer++ = value; -} - -/* - * .KB_C_FN_DEFINITION_START - * char *p_strcpy(char *to, char *from) - * This global function returns a pointer to the end of the destination string - * after the copy operation (after the '/0'). - * .KB_C_FN_DEFINITION_END - */ -char * -p_strcpy(char *to, const char *from) -{ - while (*from) - *to++ = *from++; - *to++ = '\0'; - return (to); -} - -void memcpy(void *dst, const void *src, unsigned len) { const char *s = src; @@ -64,35 +9,3 @@ while (len--) *d++ = *s++; } - -/* - * .KB_C_FN_DEFINITION_START - * int p_memcmp(char *to, char *from, unsigned size) - * This global function compares data at to against data at from for - * size bytes. Returns 0 if the locations are equal. size must be - * greater than 0. - * .KB_C_FN_DEFINITION_END - */ -int -p_memcmp(const char *to, const char *from, unsigned size) -{ - while ((--size) && (*to++ == *from++)) - continue; - - return (*to != *from); -} - - -/* - * .KB_C_FN_DEFINITION_START - * int strcmp(char *to, char *from) - * This global function compares string at to against string at from. - * Returns 0 if the locations are equal. - * .KB_C_FN_DEFINITION_END - */ -int -strcmp(const char *s1, const char *s2) -{ - for (; *s1 == *s2 && *s1; s1++, s2++); - return (unsigned char)*s1 - (unsigned char)*s2; -} ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/p_string.c#13 (text+ko) ==== @@ -41,32 +41,6 @@ /* * .KB_C_FN_DEFINITION_START - * char *p_strcpy(char *to, char *from) - * This global function returns a pointer to the end of the destination string - * after the copy operation (after the '/0'). - * .KB_C_FN_DEFINITION_END - */ -char * -p_strcpy(char *to, const char *from) -{ - while (*from) - *to++ = *from++; - *to++ = '\0'; - return (to); -} - -void -memcpy(void *dst, const void *src, unsigned len) -{ - const char *s = src; - char *d = dst; - - while (len--) - *d++ = *s++; -} - -/* - * .KB_C_FN_DEFINITION_START * int p_memcmp(char *to, char *from, unsigned size) * This global function compares data at to against data at from for * size bytes. Returns 0 if the locations are equal. size must be @@ -81,18 +55,3 @@ return (*to != *from); } - - -/* - * .KB_C_FN_DEFINITION_START - * int strcmp(char *to, char *from) - * This global function compares string at to against string at from. - * Returns 0 if the locations are equal. - * .KB_C_FN_DEFINITION_END - */ -int -strcmp(const char *s1, const char *s2) -{ - for (; *s1 == *s2 && *s1; s1++, s2++); - return (unsigned char)*s1 - (unsigned char)*s2; -} ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/strcmp.c#2 (text+ko) ==== @@ -1,95 +1,5 @@ -/****************************************************************************** - * - * Filename: p_string.c - * - * Instantiation of basic string operations to prevent inclusion of full - * string library. These are simple implementations not necessarily optimized - * for speed, but rather to show intent. - * - * Revision information: - * - * 20AUG2004 kb_admin initial creation - * 12JAN2005 kb_admin minor updates - * - * BEGIN_KBDD_BLOCK - * No warranty, expressed or implied, is included with this software. It is - * provided "AS IS" and no warranty of any kind including statutory or aspects - * relating to merchantability or fitness for any purpose is provided. All - * intellectual property rights of others is maintained with the respective - * owners. This software is not copyrighted and is intended for reference - * only. - * END_BLOCK - * - * $FreeBSD: src/sys/boot/arm/at91/libat91/p_string.c,v 1.2 2006/08/10 18:07:49 imp Exp $ - *****************************************************************************/ - #include "lib.h" -/* - * .KB_C_FN_DEFINITION_START - * void p_memset(char *buffer, char value, int size) - * This global function sets memory at the pointer for the specified - * number of bytes to value. - * .KB_C_FN_DEFINITION_END - */ -void -p_memset(char *buffer, char value, int size) -{ - while (size--) - *buffer++ = value; -} - -/* - * .KB_C_FN_DEFINITION_START - * char *p_strcpy(char *to, char *from) - * This global function returns a pointer to the end of the destination string - * after the copy operation (after the '/0'). - * .KB_C_FN_DEFINITION_END - */ -char * -p_strcpy(char *to, const char *from) -{ - while (*from) - *to++ = *from++; - *to++ = '\0'; - return (to); -} - -void -memcpy(void *dst, const void *src, unsigned len) -{ - const char *s = src; - char *d = dst; - - while (len--) - *d++ = *s++; -} - -/* - * .KB_C_FN_DEFINITION_START - * int p_memcmp(char *to, char *from, unsigned size) - * This global function compares data at to against data at from for - * size bytes. Returns 0 if the locations are equal. size must be - * greater than 0. - * .KB_C_FN_DEFINITION_END - */ -int -p_memcmp(const char *to, const char *from, unsigned size) -{ - while ((--size) && (*to++ == *from++)) - continue; - - return (*to != *from); -} - - -/* - * .KB_C_FN_DEFINITION_START - * int strcmp(char *to, char *from) - * This global function compares string at to against string at from. - * Returns 0 if the locations are equal. - * .KB_C_FN_DEFINITION_END - */ int strcmp(const char *s1, const char *s2) { From owner-p4-projects@FreeBSD.ORG Fri Sep 15 17:45:02 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C237616A416; Fri, 15 Sep 2006 17:45:01 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 84FA516A412 for ; Fri, 15 Sep 2006 17:45:01 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 996F743D72 for ; Fri, 15 Sep 2006 17:44:54 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8FHisFe022350 for ; Fri, 15 Sep 2006 17:44:54 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8FHisOf022347 for perforce@freebsd.org; Fri, 15 Sep 2006 17:44:54 GMT (envelope-from imp@freebsd.org) Date: Fri, 15 Sep 2006 17:44:54 GMT Message-Id: <200609151744.k8FHisOf022347@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 106159 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Sep 2006 17:45:02 -0000 http://perforce.freebsd.org/chv.cgi?CH=106159 Change 106159 by imp@imp_lighthouse on 2006/09/15 17:43:53 Move some globals around, remove needless initialization. This saves another 64 bytes from boot2. Affected files ... .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/emac.c#31 edit .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/emac.h#12 edit .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/emac_init.c#5 edit Differences ... ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/emac.c#31 (text+ko) ==== @@ -31,6 +31,10 @@ /* ********************** PRIVATE FUNCTIONS/DATA ******************************/ +static unsigned short serverPort; +static unsigned serverMACSet; +static unsigned localIPSet, serverIPSet; +static unsigned lastSize; static char serverMACAddr[6]; static unsigned char localIPAddr[4], serverIPAddr[4]; static int ackBlock; ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/emac.h#12 (text+ko) ==== @@ -129,10 +129,8 @@ extern unsigned char localMACAddr[6]; extern unsigned localMAClow, localMAChigh; -extern unsigned localMACSet, serverMACSet; +extern unsigned localMACSet; extern receive_descriptor_t *p_rxBD; -extern unsigned lastSize; -extern unsigned localIPSet, serverIPSet; -extern unsigned short serverPort, localPort; +extern unsigned short localPort; #endif /* _EMAC_H_ */ ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/emac_init.c#5 (text+ko) ==== @@ -56,12 +56,10 @@ /* ****************************** GLOBALS *************************************/ -unsigned lastSize; -unsigned localMACSet, serverMACSet; +unsigned localMACSet; unsigned char localMACAddr[6]; unsigned localMAClow, localMAChigh; -unsigned localIPSet, serverIPSet; -unsigned short serverPort, localPort; +unsigned short localPort; receive_descriptor_t *p_rxBD; /* ********************** PRIVATE FUNCTIONS/DATA ******************************/ @@ -130,10 +128,5 @@ EMAC_Init(void) { p_rxBD = (receive_descriptor_t*)RX_BUFFER_START; - localMACSet = 0; - serverMACSet = 0; - localIPSet = 0; - serverIPSet = 0; localPort = SWAP16(0x8002); - lastSize = 0; } From owner-p4-projects@FreeBSD.ORG Fri Sep 15 17:51:09 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 205D316A563; Fri, 15 Sep 2006 17:51:09 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B511A16A40F for ; Fri, 15 Sep 2006 17:51:08 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0322A43D45 for ; Fri, 15 Sep 2006 17:51:07 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8FHp7Gv022686 for ; Fri, 15 Sep 2006 17:51:07 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8FHp7Gv022679 for perforce@freebsd.org; Fri, 15 Sep 2006 17:51:07 GMT (envelope-from imp@freebsd.org) Date: Fri, 15 Sep 2006 17:51:07 GMT Message-Id: <200609151751.k8FHp7Gv022679@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 106161 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Sep 2006 17:51:09 -0000 http://perforce.freebsd.org/chv.cgi?CH=106161 Change 106161 by imp@imp_lighthouse on 2006/09/15 17:50:19 A little more data shuffling gives us another 40 bytes. This eliminates the EMAC_Init function entirely, since it is now all initialized in the proper place. Affected files ... .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/emac.c#32 edit .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/emac.h#13 edit .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/emac_init.c#6 edit Differences ... ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/emac.c#32 (text+ko) ==== @@ -31,11 +31,13 @@ /* ********************** PRIVATE FUNCTIONS/DATA ******************************/ +static receive_descriptor_t *p_rxBD = (receive_descriptor_t*)RX_BUFFER_START; +static unsigned short localPort = SWAP16(0x8002); static unsigned short serverPort; static unsigned serverMACSet; static unsigned localIPSet, serverIPSet; static unsigned lastSize; -static char serverMACAddr[6]; +static unsigned char serverMACAddr[6]; static unsigned char localIPAddr[4], serverIPAddr[4]; static int ackBlock; static char *dlAddress; ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/emac.h#13 (text+ko) ==== @@ -130,7 +130,6 @@ extern unsigned char localMACAddr[6]; extern unsigned localMAClow, localMAChigh; extern unsigned localMACSet; -extern receive_descriptor_t *p_rxBD; -extern unsigned short localPort; +#define EMAC_Init() #endif /* _EMAC_H_ */ ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/emac_init.c#6 (text+ko) ==== @@ -59,8 +59,6 @@ unsigned localMACSet; unsigned char localMACAddr[6]; unsigned localMAClow, localMAChigh; -unsigned short localPort; -receive_descriptor_t *p_rxBD; /* ********************** PRIVATE FUNCTIONS/DATA ******************************/ @@ -117,16 +115,3 @@ pEmac->EMAC_SA1L = localMAClow; pEmac->EMAC_SA1H = localMAChigh; } - -/* - * .KB_C_FN_DEFINITION_START - * void EMAC_Init(void) - * This global function initializes variables used in tftp transfers. - * .KB_C_FN_DEFINITION_END - */ -void -EMAC_Init(void) -{ - p_rxBD = (receive_descriptor_t*)RX_BUFFER_START; - localPort = SWAP16(0x8002); -} From owner-p4-projects@FreeBSD.ORG Fri Sep 15 18:39:19 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D648C16A417; Fri, 15 Sep 2006 18:39:18 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7F28D16A40F; Fri, 15 Sep 2006 18:39:18 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe04.swip.net [212.247.154.97]) by mx1.FreeBSD.org (Postfix) with ESMTP id 66AED43D45; Fri, 15 Sep 2006 18:39:17 +0000 (GMT) (envelope-from hselasky@c2i.net) X-T2-Posting-ID: gvlK0tOCzrqh9CPROFOFPw== X-Cloudmark-Score: 0.000000 [] Received: from [193.216.121.196] (HELO [10.0.0.249]) by mailfe04.swip.net (CommuniGate Pro SMTP 5.0.8) with ESMTP id 279126304; Fri, 15 Sep 2006 20:39:13 +0200 From: Hans Petter Selasky To: John Baldwin Date: Fri, 15 Sep 2006 20:39:28 +0200 User-Agent: KMail/1.7 References: <200609151417.k8FEHSFx098273@repoman.freebsd.org> <200609151710.17572.hselasky@c2i.net> <200609151243.50388.jhb@freebsd.org> In-Reply-To: <200609151243.50388.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200609152039.28868.hselasky@c2i.net> Cc: Perforce Change Reviews Subject: Re: PERFORCE change 106148 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Sep 2006 18:39:19 -0000 On Friday 15 September 2006 18:43, John Baldwin wrote: > On Friday 15 September 2006 11:10, Hans Petter Selasky wrote: > > On Friday 15 September 2006 16:39, you wrote: > > > On Friday 15 September 2006 10:17, Hans Petter Selasky wrote: > > > > http://perforce.freebsd.org/chv.cgi?CH=106148 > > > > > > > > Change 106148 by hselasky@hselasky_mini_itx on 2006/09/15 14:17:12 > > > > > > > > Initialize all driver_t structures by record. Bugfix: Some of the > > > > modem drivers did not use the "ucom_devclass". Make sure that all > > > > modem drivers use this devclass. > > > > > My implementation for NetBSD works like this: > > This is FreeBSD I'm talking about. It is based off FreeBSD. > > > It then saves a pointer to > > > that device class object in the devclass_t pointer specified in > > > DRIVER_MODULE(). So, by making them all share the same devclass_t, they > > are > > > > all just going to overwrite the same pointer when the driver module > > > loads. Ok, right. But the old USB code did already do that. It shared the devclass among multiple devices. > > > > No, wrong. The devclass_t pointer is not overwritten if it is already > > initialized! > > Umm. It's overwritten, but to the same value. Go look at the actual code. ... > int > driver_module_handler(module_t mod, int what, void *arg) > { > ... > dmd = (struct driver_module_data *)arg; > ... > switch (what) { > case MOD_LOAD: > ... > if (driver->baseclasses) { > const char *parentname; > parentname = driver->baseclasses[0]->name; Maybe a missing "if (*dmd->dmd_devclass == NULL)" here. It is not a big problem. All the USB probe / attach code is currently executed under Giant, so there should not be any race condition. "devclass_find_internal()" allocates memory with M_NOWAIT, and will not sleep and cause problems. > *dmd->dmd_devclass = > devclass_find_internal(driver->name, > parentname, TRUE); > } else { > *dmd->dmd_devclass = > devclass_find_internal(driver->name, 0, TRUE); > } > break; > ... > } > > The writes to dmd_devclass are writing to the 'static devclass_t' you > specify in your DRIVER_MODULE() line. As I mentioned earlier, devclass_t > isn't a struct, it's a pointer to a struct: I know. But then my NetBSD implementation is slightly different. I only allocate a devclass when there are devices present, and not before, to save memory. I thought that was why devclass_t was a pointer and not a structure. > typedef struct devclass *devclass_t; > > Basically, passing a devclass_t into DRIVER_MODULE() just gives you a > pre-intialized pointer to your devclass. The devclass's aren't bound to > that devclass_t though, they are bound to the name. Thus if you have: > > static devclass_t foo_class, bar_class; > > static driver_t foo_driver { > "foo", ... > }; > > static driver_t bar_driver { > "foo", ... > }; > > DRIVER_MODULE(..., foo_driver, foo_devclass, ...); > DRIVER_MODULE(..., bar_driver, bar_devclass, ...); > Yes, but I cannot set the "devclass" to "NULL" ? That will panic according to the "driver_module_handler()" function ?? > foo_devclass and bar_devclass will both point to the same device class > object. > > > > To be honest, most drivers don't even use the devclass pointer, and I'd > > > actually like to axe it and make the few drivers that do care use > > > 'devclass_find("foo")' when they need the devclass pointer instead. > > > > I need the devclass to get unique unit numbers. > > Again, go look at the actual code, it can still call > devclass_find_internal(), but it is not required to save the pointer to do > so. Ok. --HPS From owner-p4-projects@FreeBSD.ORG Fri Sep 15 19:49:41 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id AA6EA16A416; Fri, 15 Sep 2006 19:49:41 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 85F5016A403 for ; Fri, 15 Sep 2006 19:49:41 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 480AB43D72 for ; Fri, 15 Sep 2006 19:49:40 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8FJnedM033022 for ; Fri, 15 Sep 2006 19:49:40 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8FJndQk033019 for perforce@freebsd.org; Fri, 15 Sep 2006 19:49:39 GMT (envelope-from imp@freebsd.org) Date: Fri, 15 Sep 2006 19:49:39 GMT Message-Id: <200609151949.k8FJndQk033019@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 106170 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Sep 2006 19:49:42 -0000 http://perforce.freebsd.org/chv.cgi?CH=106170 Change 106170 by imp@imp_lighthouse on 2006/09/15 19:48:44 Kill bootsd. Affected files ... .. //depot/projects/arm/src/sys/boot/arm/at91/Makefile#12 edit .. //depot/projects/arm/src/sys/boot/arm/at91/bootsd/Makefile#5 delete .. //depot/projects/arm/src/sys/boot/arm/at91/bootsd/main.c#8 delete Differences ... ==== //depot/projects/arm/src/sys/boot/arm/at91/Makefile#12 (text+ko) ==== @@ -1,5 +1,5 @@ # $FreeBSD: src/sys/boot/arm/at91/Makefile,v 1.2 2006/04/21 06:43:32 imp Exp $ -SUBDIR= libat91 boot0 boot0iic boot0spi boot2 bootiic bootspi bootsd +SUBDIR= libat91 boot0 boot0iic boot0spi boot2 bootiic bootspi .include From owner-p4-projects@FreeBSD.ORG Fri Sep 15 20:34:38 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7C87416A416; Fri, 15 Sep 2006 20:34:38 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3D71216A403 for ; Fri, 15 Sep 2006 20:34:38 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 01C3843D45 for ; Fri, 15 Sep 2006 20:34:38 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8FKYbU9036362 for ; Fri, 15 Sep 2006 20:34:37 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8FKYbOm036359 for perforce@freebsd.org; Fri, 15 Sep 2006 20:34:37 GMT (envelope-from imp@freebsd.org) Date: Fri, 15 Sep 2006 20:34:37 GMT Message-Id: <200609152034.k8FKYbOm036359@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 106172 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Sep 2006 20:34:38 -0000 http://perforce.freebsd.org/chv.cgi?CH=106172 Change 106172 by imp@imp_lighthouse on 2006/09/15 20:33:45 checkpoint Affected files ... .. //depot/projects/arm/src/sys/boot/arm/at91/Makefile.inc#21 edit .. //depot/projects/arm/src/sys/boot/arm/at91/bootspi/arm_init.S#8 edit .. //depot/projects/arm/src/sys/boot/arm/at91/bootspi/loader_prompt.c#22 edit .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/emac.c#33 edit Differences ... ==== //depot/projects/arm/src/sys/boot/arm/at91/Makefile.inc#21 (text+ko) ==== @@ -5,7 +5,7 @@ __at91_boot_Makefile.inc__: -CFLAGS=-Os -mcpu=arm9 -ffreestanding \ +CFLAGS=-O2 -mcpu=arm9 -ffreestanding \ -I${.CURDIR}/../libat91 \ -I${.CURDIR}/../../../.. \ -I${.CURDIR}/../../../../arm \ ==== //depot/projects/arm/src/sys/boot/arm/at91/bootspi/arm_init.S#8 (text+ko) ==== @@ -109,7 +109,7 @@ .string "e 0x10000000 " .string " " #else -#if 0 +#if 1 .string "Bootloader for KB9202 Evaluation Board." .string "m 42 53 44 0 0 1 " .string "ip 206 168 13 194 " ==== //depot/projects/arm/src/sys/boot/arm/at91/bootspi/loader_prompt.c#22 (text+ko) ==== @@ -280,6 +280,7 @@ // set mac address using 6 byte values unsigned char mac[6]; + printf("Set MAC %d\n", argc); if (argc > 6) { for (i = 0; i < 6; i++) mac[i] = p_ASCIIToHex(argv[i + 1]); ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/emac.c#33 (text+ko) ==== @@ -31,8 +31,8 @@ /* ********************** PRIVATE FUNCTIONS/DATA ******************************/ -static receive_descriptor_t *p_rxBD = (receive_descriptor_t*)RX_BUFFER_START; -static unsigned short localPort = SWAP16(0x8002); +static receive_descriptor_t *p_rxBD; +static unsigned short localPort; static unsigned short serverPort; static unsigned serverMACSet; static unsigned localIPSet, serverIPSet; @@ -249,7 +249,6 @@ if (!process) return (0); - process = i; pFrameType = (unsigned short *)((p_rxBD[i].address & 0xFFFFFFFC) + 12); @@ -260,16 +259,17 @@ case SWAP16(PROTOCOL_ARP): p_ARP = (arp_header_t*)pData; if (p_ARP->operation == SWAP16(ARP_REPLY)) { + printf("R"); // check if new server info is available if ((!serverMACSet) && (!(p_memcmp((char*)p_ARP->sender_ip, (char*)serverIPAddr, 4)))) { serverMACSet = 1; - memcpy(serverMACAddr, p_ARP->sender_mac, 6); } } else if (p_ARP->operation == SWAP16(ARP_REQUEST)) { + printf("r"); // ARP REPLY operation p_ARP->operation = SWAP16(ARP_REPLY); @@ -297,6 +297,7 @@ } break; case SWAP16(PROTOCOL_IP): + printf("i"); pIpHeader = (ip_header_t*)(pData + 14); memcpy(pHeader, pIpHeader, sizeof(ip_header_t)); @@ -304,24 +305,33 @@ udp_header_t *udpHdr; tftp_header_t *tftpHdr; + printf("u"); udpHdr = (udp_header_t*)((char*)pIpHeader+20); tftpHdr = (tftp_header_t*)((char*)udpHdr + 8); - if (udpHdr->dst_port != localPort) - break; + if (udpHdr->dst_port != localPort) { + printf("@ %x %x\n", udpHdr->dst_port, localPort); + break; + } - if (tftpHdr->opcode != TFTP_DATA_OPCODE) - break; + if (tftpHdr->opcode != TFTP_DATA_OPCODE) { + printf("#"); + break; + } if (ackBlock == -1) { - if (tftpHdr->block_num != SWAP16(1)) - break; + if (tftpHdr->block_num != SWAP16(1)) { + printf("%"); + break; + } serverPort = udpHdr->src_port; ackBlock = 0; } - if (serverPort != udpHdr->src_port) - break; + if (serverPort != udpHdr->src_port) { + printf("$"); + break; + } TFTP_ACK_Data(tftpHdr->data, SWAP16(tftpHdr->block_num), @@ -442,6 +452,9 @@ char *pRxPacket = (char*)RX_DATA_START; AT91PS_EMAC pEmac = AT91C_BASE_EMAC; + p_rxBD = (receive_descriptor_t*)RX_BUFFER_START; + localPort = SWAP16(0x8002); + for (i = 0; i < MAX_RX_PACKETS; ++i) { p_rxBD[i].address = (unsigned)pRxPacket; @@ -539,9 +552,11 @@ if (CheckForNewPacket(&IpHeader)) { if (ackBlock == -2) break; + printf("P"); timeout = 10; thisSeconds = GetSeconds() + 1; } else if (GetSeconds() > thisSeconds) { + printf("."); --timeout; thisSeconds = GetSeconds() + 1; if (!serverMACSet) From owner-p4-projects@FreeBSD.ORG Fri Sep 15 20:48:39 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 33FA116A593; Fri, 15 Sep 2006 20:48:39 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DD7BC16A591 for ; Fri, 15 Sep 2006 20:48:38 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 05D0643D53 for ; Fri, 15 Sep 2006 20:48:29 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.6/8.13.6) with ESMTP id k8FKmOq0053408; Fri, 15 Sep 2006 16:48:24 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: Hans Petter Selasky Date: Fri, 15 Sep 2006 16:47:20 -0400 User-Agent: KMail/1.9.1 References: <200609151417.k8FEHSFx098273@repoman.freebsd.org> <200609151243.50388.jhb@freebsd.org> <200609152039.28868.hselasky@c2i.net> In-Reply-To: <200609152039.28868.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200609151647.20432.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Fri, 15 Sep 2006 16:48:25 -0400 (EDT) X-Virus-Scanned: ClamAV 0.88.3/1885/Fri Sep 15 07:19:10 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: Perforce Change Reviews Subject: Re: PERFORCE change 106148 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Sep 2006 20:48:39 -0000 On Friday 15 September 2006 14:39, Hans Petter Selasky wrote: > Maybe a missing "if (*dmd->dmd_devclass == NULL)" here. It is not a big > problem. All the USB probe / attach code is currently executed under Giant, > so there should not be any race condition. "devclass_find_internal()" > allocates memory with M_NOWAIT, and will not sleep and cause problems. Well, as long as new-bus eventually has locking to handle concurrent driver adds (probably just a big sx lock around the whole thing) it will be fine. > > typedef struct devclass *devclass_t; > > > > Basically, passing a devclass_t into DRIVER_MODULE() just gives you a > > pre-intialized pointer to your devclass. The devclass's aren't bound to > > that devclass_t though, they are bound to the name. Thus if you have: > > > > static devclass_t foo_class, bar_class; > > > > static driver_t foo_driver { > > "foo", ... > > }; > > > > static driver_t bar_driver { > > "foo", ... > > }; > > > > DRIVER_MODULE(..., foo_driver, foo_devclass, ...); > > DRIVER_MODULE(..., bar_driver, bar_devclass, ...); > > > > Yes, but I cannot set the "devclass" to "NULL" ? That will panic according to > the "driver_module_handler()" function ?? Yes. I actually want to just remove it altogether because for almost all drivers it's worthless and just wastes space (granted, all of 1 pointer in the data seg of each driver). -- John Baldwin From owner-p4-projects@FreeBSD.ORG Fri Sep 15 22:20:53 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6803816A412; Fri, 15 Sep 2006 22:20:53 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4235F16A407 for ; Fri, 15 Sep 2006 22:20:53 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id B469743D49 for ; Fri, 15 Sep 2006 22:20:52 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8FMKqW3052694 for ; Fri, 15 Sep 2006 22:20:52 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8FMKqOY052691 for perforce@freebsd.org; Fri, 15 Sep 2006 22:20:52 GMT (envelope-from imp@freebsd.org) Date: Fri, 15 Sep 2006 22:20:52 GMT Message-Id: <200609152220.k8FMKqOY052691@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 106176 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Sep 2006 22:20:53 -0000 http://perforce.freebsd.org/chv.cgi?CH=106176 Change 106176 by imp@imp_lighthouse on 2006/09/15 22:20:09 Remove debug put back one (char *) that affected the generated code because the cast was from potiner to a udp packet to char *. Failure to cast adds 160 not 8! Affected files ... .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/emac.c#34 edit Differences ... ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/emac.c#34 (text+ko) ==== @@ -145,7 +145,7 @@ udpHdr->udp_len = SWAP16(8 + tftpLength); udpHdr->udp_cksum = 0; - memcpy(udpHdr+8, tftpData, tftpLength); + memcpy((char *)udpHdr+8, tftpData, tftpLength); t_checksum = IP_checksum((unsigned short*)ipHdr + 6, (16 + tftpLength)); @@ -209,7 +209,7 @@ dlAddress += len; lastSize += len; if (ackBlock % 128 == 0) - printf("tftp: %u kB", lastSize / 1024); + printf("tftp: %u kB\r", lastSize / 1024); } tftpHeader.opcode = TFTP_ACK_OPCODE; tftpHeader.block_num = SWAP16(ackBlock); @@ -259,7 +259,6 @@ case SWAP16(PROTOCOL_ARP): p_ARP = (arp_header_t*)pData; if (p_ARP->operation == SWAP16(ARP_REPLY)) { - printf("R"); // check if new server info is available if ((!serverMACSet) && (!(p_memcmp((char*)p_ARP->sender_ip, @@ -269,7 +268,6 @@ memcpy(serverMACAddr, p_ARP->sender_mac, 6); } } else if (p_ARP->operation == SWAP16(ARP_REQUEST)) { - printf("r"); // ARP REPLY operation p_ARP->operation = SWAP16(ARP_REPLY); @@ -297,7 +295,6 @@ } break; case SWAP16(PROTOCOL_IP): - printf("i"); pIpHeader = (ip_header_t*)(pData + 14); memcpy(pHeader, pIpHeader, sizeof(ip_header_t)); @@ -305,33 +302,24 @@ udp_header_t *udpHdr; tftp_header_t *tftpHdr; - printf("u"); udpHdr = (udp_header_t*)((char*)pIpHeader+20); tftpHdr = (tftp_header_t*)((char*)udpHdr + 8); - if (udpHdr->dst_port != localPort) { - printf("@ %x %x\n", udpHdr->dst_port, localPort); - break; - } + if (udpHdr->dst_port != localPort) + break; - if (tftpHdr->opcode != TFTP_DATA_OPCODE) { - printf("#"); - break; - } + if (tftpHdr->opcode != TFTP_DATA_OPCODE) + break; if (ackBlock == -1) { - if (tftpHdr->block_num != SWAP16(1)) { - printf("%"); - break; - } + if (tftpHdr->block_num != SWAP16(1)) + break; serverPort = udpHdr->src_port; ackBlock = 0; } - if (serverPort != udpHdr->src_port) { - printf("$"); - break; - } + if (serverPort != udpHdr->src_port) + break; TFTP_ACK_Data(tftpHdr->data, SWAP16(tftpHdr->block_num), @@ -552,11 +540,9 @@ if (CheckForNewPacket(&IpHeader)) { if (ackBlock == -2) break; - printf("P"); timeout = 10; thisSeconds = GetSeconds() + 1; } else if (GetSeconds() > thisSeconds) { - printf("."); --timeout; thisSeconds = GetSeconds() + 1; if (!serverMACSet) From owner-p4-projects@FreeBSD.ORG Fri Sep 15 22:21:55 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3627616A416; Fri, 15 Sep 2006 22:21:55 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E537116A415 for ; Fri, 15 Sep 2006 22:21:54 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id A09BD43D49 for ; Fri, 15 Sep 2006 22:21:54 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8FMLsvZ052812 for ; Fri, 15 Sep 2006 22:21:54 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8FMLsJu052809 for perforce@freebsd.org; Fri, 15 Sep 2006 22:21:54 GMT (envelope-from imp@freebsd.org) Date: Fri, 15 Sep 2006 22:21:54 GMT Message-Id: <200609152221.k8FMLsJu052809@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 106177 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Sep 2006 22:21:55 -0000 http://perforce.freebsd.org/chv.cgi?CH=106177 Change 106177 by imp@imp_lighthouse on 2006/09/15 22:21:10 Remove stray debug Affected files ... .. //depot/projects/arm/src/sys/boot/arm/at91/bootspi/loader_prompt.c#23 edit Differences ... ==== //depot/projects/arm/src/sys/boot/arm/at91/bootspi/loader_prompt.c#23 (text+ko) ==== @@ -280,7 +280,6 @@ // set mac address using 6 byte values unsigned char mac[6]; - printf("Set MAC %d\n", argc); if (argc > 6) { for (i = 0; i < 6; i++) mac[i] = p_ASCIIToHex(argv[i + 1]); From owner-p4-projects@FreeBSD.ORG Fri Sep 15 23:13:03 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2F33616A416; Fri, 15 Sep 2006 23:13:03 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E2A8016A40F for ; Fri, 15 Sep 2006 23:13:02 +0000 (UTC) (envelope-from mjacob@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 90D9B43D62 for ; Fri, 15 Sep 2006 23:12:58 +0000 (GMT) (envelope-from mjacob@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8FNCwdD056692 for ; Fri, 15 Sep 2006 23:12:58 GMT (envelope-from mjacob@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8FNCw5c056689 for perforce@freebsd.org; Fri, 15 Sep 2006 23:12:58 GMT (envelope-from mjacob@freebsd.org) Date: Fri, 15 Sep 2006 23:12:58 GMT Message-Id: <200609152312.k8FNCw5c056689@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to mjacob@freebsd.org using -f From: Matt Jacob To: Perforce Change Reviews Cc: Subject: PERFORCE change 106178 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Sep 2006 23:13:03 -0000 http://perforce.freebsd.org/chv.cgi?CH=106178 Change 106178 by mjacob@newisp on 2006/09/15 23:12:52 An amazingly large amount of changes for so little net effect... Fixed REGISTER_FC4_TYPES for the 24XX. Did more new FC state engine work. Did some of the prelim spadework for multipath failover. Added an 'isp_stds' file which has structures as defined in the appropriate ANSI specs rather than derivative dribs and drabs all over the place. Removed Postion Map command support- I doubt anyone will need it ever again. Did some IOCB structure changes to try and get things ready for N-Port virtualization. Affected files ... .. //depot/projects/newisp/dev/isp/isp.c#10 edit .. //depot/projects/newisp/dev/isp/isp_freebsd.c#6 edit .. //depot/projects/newisp/dev/isp/isp_freebsd.h#4 edit .. //depot/projects/newisp/dev/isp/isp_library.c#5 edit .. //depot/projects/newisp/dev/isp/isp_library.h#5 edit .. //depot/projects/newisp/dev/isp/isp_pci.c#11 edit .. //depot/projects/newisp/dev/isp/isp_stds.h#1 add .. //depot/projects/newisp/dev/isp/isp_target.h#5 edit .. //depot/projects/newisp/dev/isp/ispmbox.h#3 edit .. //depot/projects/newisp/dev/isp/ispvar.h#3 edit Differences ... ==== //depot/projects/newisp/dev/isp/isp.c#10 (text+ko) ==== @@ -80,8 +80,6 @@ static const char topology[] = "Our PortID 0x%06x N-Port Handle %d, Connection Topology '%s'\n" " WWNN 0x%08x%08x WWPN 0x%08x%08x"; -static const char swrej[] = - "Fabric Nameserver rejected %s (Reason=0x%x Expl=0x%x) for Port ID 0x%x"; static const char finmsg[] = "%d.%d.%d: FIN dl%d resid %d STS 0x%x SKEY %c XS_ERR=0x%x"; static const char sc0[] = @@ -112,7 +110,6 @@ static void isp_fibre_init_2400(ispsoftc_t *); static void isp_dump_portdb(ispsoftc_t *); static void isp_mark_portdb(ispsoftc_t *, int); -static int isp_getmap(ispsoftc_t *, fcpos_map_t *); static void isp_plogx_24xx(ispsoftc_t *, uint16_t, uint32_t, int *); static int isp_port_login(ispsoftc_t *, uint16_t, uint32_t); static void isp_port_logout(ispsoftc_t *, uint16_t, uint32_t); @@ -123,8 +120,10 @@ static int isp_pdb_sync(ispsoftc_t *); static int isp_scan_loop(ispsoftc_t *); static int isp_gid_ft_sns(ispsoftc_t *); +static int isp_gid_ft_ct_passthru(ispsoftc_t *); static int isp_scan_fabric(ispsoftc_t *); -static void isp_register_fc4_type(ispsoftc_t *); +static int isp_register_fc4_type(ispsoftc_t *); +static int isp_register_fc4_type_24xx(ispsoftc_t *); static void isp_fw_state(ispsoftc_t *); static void isp_mboxcmd_qnw(ispsoftc_t *, mbreg_t *, int); static void isp_mboxcmd(ispsoftc_t *, mbreg_t *, int); @@ -1991,36 +1990,7 @@ /* * Fibre Channel Support- get the port database for the id. - * - * Locks are held before coming here. Return 0 if success, - * else failure. */ - -static int -isp_getmap(ispsoftc_t *isp, fcpos_map_t *map) -{ - fcparam *fcp = (fcparam *) isp->isp_param; - mbreg_t mbs; - - MEMZERO(&mbs, sizeof (mbs)); - mbs.param[0] = MBOX_GET_FC_AL_POSITION_MAP; - mbs.param[2] = DMA_WD1(fcp->isp_scdma); - mbs.param[3] = DMA_WD0(fcp->isp_scdma); - mbs.param[6] = DMA_WD3(fcp->isp_scdma); - mbs.param[7] = DMA_WD2(fcp->isp_scdma); - FC_SCRATCH_ACQUIRE(isp); - MEMORYBARRIER(isp, SYNC_SFORDEV, 0, sizeof (fcpos_map_t)); - isp_mboxcmd(isp, &mbs, MBLOGALL & ~MBOX_COMMAND_PARAM_ERROR); - if (mbs.param[0] == MBOX_COMMAND_COMPLETE) { - MEMCPY(map, fcp->isp_scratch, sizeof (fcpos_map_t)); - map->fwmap = mbs.param[1] != 0; - FC_SCRATCH_RELEASE(isp); - return (0); - } - FC_SCRATCH_RELEASE(isp); - return (-1); -} - static void isp_dump_portdb(ispsoftc_t *isp) { @@ -2156,7 +2126,8 @@ break; case PLOGX_IOCBERR_FAILED: isp_prt(isp, ISP_LOGERR, - "PLOGX failed- reason 0x%x, last LOGIN state 0x%x", + "PLOGX(0x%x) of Port 0x%06x failed: reason 0x%x (last LOGIN" + " state 0x%x)", *log_ret, portid, parm1 & 0xff, (parm1 >> 8) & 0xff); break; case PLOGX_IOCBERR_NOFABRIC: @@ -2396,10 +2367,6 @@ isp_mark_portdb(isp, 1); /* - * XXX: Here is where we would start a 'loop dead' timeout - */ - - /* * Wait up to N microseconds for F/W to go to a ready state. */ lwfs = FW_CONFIG_WAIT; @@ -2466,7 +2433,8 @@ * If we haven't gone to 'ready' state, return. */ if (fcp->isp_fwstate != FW_READY) { - isp_prt(isp, ISP_LOGDEBUG0, "isp_fclink_test: not at FW_READY state"); + isp_prt(isp, ISP_LOGDEBUG0, + "isp_fclink_test: not at FW_READY state"); return (-1); } @@ -2536,7 +2504,7 @@ * Save the Fabric controller's port database entry. */ lp = &fcp->portdb[FL_ID]; - lp->state = FC_PORTDB_STATE_VALID; + lp->state = FC_PORTDB_STATE_PENDING_VALID; MAKE_WWN_FROM_NODE_NAME(lp->node_wwn, pdb.nodename); MAKE_WWN_FROM_NODE_NAME(lp->port_wwn, pdb.portname); lp->roles = (pdb.s3_role & SVC3_ROLE_MASK) >> SVC3_ROLE_SHIFT; @@ -2544,7 +2512,11 @@ lp->handle = pdb.handle; lp->new_portid = lp->portid; lp->new_roles = lp->roles; - isp_register_fc4_type(isp); + if (IS_24XX(isp)) { + (void) isp_register_fc4_type_24xx(isp); + } else { + (void) isp_register_fc4_type(isp); + } } else { not_on_fabric: fcp->portdb[FL_ID].state = FC_PORTDB_STATE_NIL; @@ -2624,12 +2596,18 @@ fcportdb_t *lp; uint16_t dbidx; + if (fcp->isp_loopstate == LOOP_READY) { + return (0); + } + /* * Make sure we're okay for doing this right now. */ if (fcp->isp_loopstate != LOOP_PDB_RCVD && fcp->isp_loopstate != LOOP_FSCAN_DONE && fcp->isp_loopstate != LOOP_LSCAN_DONE) { + isp_prt(isp, ISP_LOGWARN, "isp_pdb_sync: bad loopstate %d", + fcp->isp_loopstate); return (-1); } @@ -2638,6 +2616,8 @@ fcp->isp_topo == TOPO_N_PORT) { if (fcp->isp_loopstate < LOOP_LSCAN_DONE) { if (isp_scan_loop(isp) != 0) { + isp_prt(isp, ISP_LOGWARN, + "isp_pdb_sync: isp_scan_loop failed"); return (-1); } } @@ -2646,6 +2626,8 @@ if (fcp->isp_topo == TOPO_F_PORT || fcp->isp_topo == TOPO_FL_PORT) { if (fcp->isp_loopstate < LOOP_FSCAN_DONE) { if (isp_scan_fabric(isp) != 0) { + isp_prt(isp, ISP_LOGWARN, + "isp_pdb_sync: isp_scan_fabric failed"); return (-1); } } @@ -2748,9 +2730,15 @@ fcp->isp_ini_map[t] = dbidx + 1; } isp_async(isp, ISPASYNC_DEV_STAYED, lp); - lp->new_roles = 0; - lp->new_portid = 0; + if (dbidx != FL_ID) { + lp->new_roles = 0; + lp->new_portid = 0; + } break; + default: + isp_prt(isp, ISP_LOGERR, "eh? state %d for idx %d", + lp->state, dbidx); + isp_dump_portdb(isp); } } @@ -2776,6 +2764,15 @@ isp_pdb_t pdb; uint16_t dbidx, lim; + if (fcp->isp_fwstate < FW_READY || + fcp->isp_loopstate < LOOP_PDB_RCVD) { + return (-1); + } + + if (fcp->isp_loopstate > LOOP_SCANNING_LOOP) { + return (0); + } + /* * Check our connection topology. * @@ -3074,11 +3071,11 @@ fcparam *fcp = FCPARAM(isp); union { isp_ct_pt_t plocal; - isp_ct_hdr_t clocal; + ct_hdr_t clocal; uint8_t q[QENTRY_LEN]; } un; isp_ct_pt_t *pt; - isp_ct_hdr_t *ct; + ct_hdr_t *ct; uint32_t *rp; uint8_t *scp = fcp->isp_scratch; @@ -3126,16 +3123,10 @@ ct->ct_cmd_resp = SNS_GID_FT; ct->ct_bcnt_resid = (GIDLEN - 16) >> 2; - isp_put_ct_hdr(isp, ct, (isp_ct_hdr_t *) &scp[XTXOFF]); + isp_put_ct_hdr(isp, ct, (ct_hdr_t *) &scp[XTXOFF]); rp = (uint32_t *) &scp[XTXOFF+sizeof (*ct)]; ISP_IOZPUT_32(isp, FC4_SCSI, rp); - if (isp->isp_dblev & ISP_LOGDEBUG1) { - isp_print_bytes(isp, "ct hdr swizzled", - sizeof (*ct) + sizeof (uint32_t), &scp[XTXOFF]); - } - MEMZERO(&scp[ZTXOFF], QENTRY_LEN); - MEMZERO(&mbs, sizeof (mbs)); mbs.param[0] = MBOX_EXEC_COMMAND_IOCB_A64; mbs.param[1] = QENTRY_LEN; @@ -3173,6 +3164,13 @@ sns_gid_ft_rsp_t *rs0, *rs1; isp_prt(isp, ISP_LOGDEBUG0, "FC Scan Fabric"); + if (fcp->isp_fwstate != FW_READY || + fcp->isp_loopstate < LOOP_LSCAN_DONE) { + return (-1); + } + if (fcp->isp_loopstate > LOOP_SCANNING_FABRIC) { + return (0); + } if (fcp->isp_topo != TOPO_FL_PORT && fcp->isp_topo != TOPO_F_PORT) { fcp->isp_loopstate = LOOP_FSCAN_DONE; isp_prt(isp, ISP_LOGDEBUG0, "FC Scan Fabric Done (no fabric)"); @@ -3193,7 +3191,7 @@ FC_SCRATCH_RELEASE(isp); return (0); } else if (r < 0) { - fcp->isp_loopstate = LOOP_LIP_RCVD; /* try again */ + fcp->isp_loopstate = LOOP_PDB_RCVD; /* try again */ FC_SCRATCH_RELEASE(isp); return (0); } @@ -3206,7 +3204,7 @@ rs0 = (sns_gid_ft_rsp_t *) ((uint8_t *)fcp->isp_scratch+IGPOFF); rs1 = (sns_gid_ft_rsp_t *) ((uint8_t *)fcp->isp_scratch+OGPOFF); isp_get_gid_ft_response(isp, rs0, rs1, NGENT); - if (rs1->snscb_cthdr.ct_cmd_resp != FS_ACC) { + if (rs1->snscb_cthdr.ct_cmd_resp != LS_ACC) { int level; if (rs1->snscb_cthdr.ct_reason == 9 && rs1->snscb_cthdr.ct_explanation == 7) { @@ -3214,9 +3212,9 @@ } else { level = ISP_LOGWARN; } - isp_prt(isp, level, swrej, "GID_FT", - rs1->snscb_cthdr.ct_reason, - rs1->snscb_cthdr.ct_explanation, 0); + isp_prt(isp, level, "Fabric Nameserver rejected GID_FT " + "(Reason=0x%x Expl=0x%x)", rs1->snscb_cthdr.ct_reason, + rs1->snscb_cthdr.ct_explanation); FC_SCRATCH_RELEASE(isp); fcp->isp_loopstate = LOOP_FSCAN_DONE; return (0); @@ -3630,7 +3628,7 @@ return (0); } -static void +static int isp_register_fc4_type(ispsoftc_t *isp) { fcparam *fcp = isp->isp_param; @@ -3638,11 +3636,6 @@ sns_screq_t *reqp = (sns_screq_t *) local; mbreg_t mbs; - if (IS_24XX(isp)) { - isp_prt(isp, ISP_LOGDEBUG0, "Register FC4 types XXX NEED ONE FOR 24XX"); - return; - } - MEMZERO((void *) reqp, SNS_RFT_ID_REQ_SIZE); reqp->snscb_rblen = SNS_RFT_ID_RESP_SIZE >> 1; reqp->snscb_addr[RQRSP_ADDR0015] = DMA_WD0(fcp->isp_scdma + 0x100); @@ -3667,7 +3660,110 @@ isp_mboxcmd(isp, &mbs, MBLOGALL); FC_SCRATCH_RELEASE(isp); if (mbs.param[0] == MBOX_COMMAND_COMPLETE) { - isp_prt(isp, ISP_LOGDEBUG0, "Register FC4 types succeeded"); + return (0); + } else { + return (-1); + } +} + +static int +isp_register_fc4_type_24xx(ispsoftc_t *isp) +{ + mbreg_t mbs; + fcparam *fcp = FCPARAM(isp); + union { + isp_ct_pt_t plocal; + rft_id_t clocal; + uint8_t q[QENTRY_LEN]; + } un; + isp_ct_pt_t *pt; + ct_hdr_t *ct; + rft_id_t *rp; + uint8_t *scp = fcp->isp_scratch; + + FC_SCRATCH_ACQUIRE(isp); + /* + * Build a Passthrough IOCB in memory. + */ + MEMZERO(un.q, QENTRY_LEN); + pt = &un.plocal; + pt->ctp_header.rqs_entry_count = 1; + pt->ctp_header.rqs_entry_type = RQSTYPE_CT_PASSTHRU; + pt->ctp_handle = 0xffffffff; + pt->ctp_nphdl = NPH_SNS_ID; + pt->ctp_cmd_cnt = 1; + pt->ctp_time = 1; + pt->ctp_rsp_cnt = 1; + pt->ctp_rsp_bcnt = sizeof (ct_hdr_t); + pt->ctp_cmd_bcnt = sizeof (rft_id_t); + pt->ctp_dataseg[0].ds_base = DMA_LO32(fcp->isp_scdma+XTXOFF); + pt->ctp_dataseg[0].ds_basehi = DMA_HI32(fcp->isp_scdma+XTXOFF); + pt->ctp_dataseg[0].ds_count = sizeof (rft_id_t); + pt->ctp_dataseg[1].ds_base = DMA_LO32(fcp->isp_scdma+IGPOFF); + pt->ctp_dataseg[1].ds_basehi = DMA_HI32(fcp->isp_scdma+IGPOFF); + pt->ctp_dataseg[1].ds_count = sizeof (ct_hdr_t); + isp_put_ct_pt(isp, pt, (isp_ct_pt_t *) &scp[CTXOFF]); + + /* + * Build the CT header and command in memory. + * + * Note that the CT header has to end up as Big Endian format in memory. + */ + MEMZERO(&un.clocal, sizeof (un.clocal)); + ct = &un.clocal.rftid_hdr; + ct->ct_revision = CT_REVISION; + ct->ct_fcs_type = CT_FC_TYPE_FC; + ct->ct_fcs_subtype = CT_FC_SUBTYPE_NS; + ct->ct_cmd_resp = SNS_RFT_ID; + ct->ct_bcnt_resid = (sizeof (rft_id_t) - sizeof (ct_hdr_t)) >> 2; + rp = &un.clocal; + rp->rftid_portid[0] = fcp->isp_portid >> 16; + rp->rftid_portid[1] = fcp->isp_portid >> 8; + rp->rftid_portid[2] = fcp->isp_portid; + rp->rftid_fc4types[FC4_SCSI >> 5] = 1 << (FC4_SCSI & 0x1f); + isp_put_rft_id(isp, rp, (rft_id_t *) &scp[XTXOFF]); + + MEMZERO(&scp[ZTXOFF], sizeof (ct_hdr_t)); + + MEMZERO(&mbs, sizeof (mbs)); + mbs.param[0] = MBOX_EXEC_COMMAND_IOCB_A64; + mbs.param[1] = QENTRY_LEN; + mbs.param[2] = DMA_WD1(fcp->isp_scdma + CTXOFF); + mbs.param[3] = DMA_WD0(fcp->isp_scdma + CTXOFF); + mbs.param[6] = DMA_WD3(fcp->isp_scdma + CTXOFF); + mbs.param[7] = DMA_WD2(fcp->isp_scdma + CTXOFF); + MEMORYBARRIER(isp, SYNC_SFORDEV, XTXOFF, 2 * QENTRY_LEN); + isp_mboxcmd(isp, &mbs, MBLOGALL); + if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { + FC_SCRATCH_RELEASE(isp); + return (-1); + } + MEMORYBARRIER(isp, SYNC_SFORCPU, ZTXOFF, QENTRY_LEN); + pt = &un.plocal; + isp_get_ct_pt(isp, (isp_ct_pt_t *) &scp[ZTXOFF], pt); + if (isp->isp_dblev & ISP_LOGDEBUG1) { + isp_print_bytes(isp, "IOCB response", QENTRY_LEN, pt); + } + if (pt->ctp_status) { + FC_SCRATCH_RELEASE(isp); + isp_prt(isp, ISP_LOGWARN, "CT Passthrough returned 0x%x", + pt->ctp_status); + return (-1); + } + + isp_get_ct_hdr(isp, (ct_hdr_t *) &scp[IGPOFF], ct); + FC_SCRATCH_RELEASE(isp); + + if (ct->ct_cmd_resp == LS_RJT) { + isp_prt(isp, ISP_LOGWARN, "Register FC4 Type rejected"); + return (-1); + } else if (ct->ct_cmd_resp == LS_ACC) { + isp_prt(isp, ISP_LOGDEBUG0, "Register FC4 Type accepted"); + return(0); + } else { + isp_prt(isp, ISP_LOGWARN, + "Register FC4 Type: %x", ct->ct_cmd_resp); + return (-1); } } @@ -3826,13 +3922,13 @@ } } if (ttype == REQFLAG_OTAG) { - ttype = 2; + ttype = FCP_CMND_TASK_ATTR_ORDERED; } else if (ttype == REQFLAG_HTAG) { - ttype = 1; + ttype = FCP_CMND_TASK_ATTR_HEAD; } else { - ttype = 0; + ttype = FCP_CMND_TASK_ATTR_SIMPLE; } - ((ispreqt7_t *)reqp)->req_task_attributes = ttype; + ((ispreqt7_t *)reqp)->req_task_attribute = ttype; } else if (IS_FC(isp)) { /* * See comment in isp_intr @@ -3879,7 +3975,7 @@ ((ispreqt7_t *)reqp)->req_nphdl = target; ((ispreqt7_t *)reqp)->req_tidlo = lp->portid; - ((ispreqt7_t *)reqp)->req_tidhi_vpidx = lp->portid >> 16; + ((ispreqt7_t *)reqp)->req_tidhi = lp->portid >> 16; if (XS_LUN(xs) > 256) { ((ispreqt7_t *)reqp)->req_lun[0] = XS_LUN(xs) >> 8; ((ispreqt7_t *)reqp)->req_lun[0] |= 0x40; @@ -4098,14 +4194,6 @@ } break; - case ISPCTL_GET_POSMAP: - - if (IS_FC(isp) && arg) { - return (isp_getmap(isp, arg)); - } - break; - - case ISPCTL_GET_PDB: if (IS_FC(isp) && arg) { int id = *((int *)arg); @@ -4344,7 +4432,7 @@ * Synchronize our view of this response queue entry. */ MEMORYBARRIER(isp, SYNC_RESULT, oop, QENTRY_LEN); - isp_copy_in_hdr(isp, hp, &sp->req_header); + isp_get_hdr(isp, hp, &sp->req_header); etype = sp->req_header.rqs_entry_type; if (IS_24XX(isp) && etype == RQSTYPE_T7RQS) { @@ -4944,10 +5032,11 @@ break; case ASYNC_CHANGE_NOTIFY: - /* - * Not correct, but it will force us to rescan the loop. - */ - FCPARAM(isp)->isp_loopstate = LOOP_PDB_RCVD; + if (FCPARAM(isp)->isp_topo == TOPO_F_PORT) { + FCPARAM(isp)->isp_loopstate = LOOP_LSCAN_DONE; + } else { + FCPARAM(isp)->isp_loopstate = LOOP_PDB_RCVD; + } isp_mark_portdb(isp, 1); isp_async(isp, ISPASYNC_CHANGE_NOTIFY, ISPASYNC_CHANGE_SNS); break; @@ -6842,7 +6931,18 @@ isp_prt(isp, ISP_LOGERR, "isp_reinit cannot restart card"); } - } + } else if (IS_FC(isp)) { + /* + * If we're in ISP_ROLE_NONE, turn off the lasers. + */ + if (!IS_24XX(isp)) { + ISP_WRITE(isp, BIU2100_CSR, BIU2100_FPM0_REGS); + ISP_WRITE(isp, FPM_DIAG_CONFIG, FPM_SOFT_RESET); + ISP_WRITE(isp, BIU2100_CSR, BIU2100_FB_REGS); + ISP_WRITE(isp, FBM_CMD, FBMCMD_FIFO_RESET_ALL); + ISP_WRITE(isp, BIU2100_CSR, BIU2100_RISC_REGS); + } + } isp->isp_nactive = 0; for (tmp = 0; tmp < isp->isp_maxcmds; tmp++) { @@ -7520,7 +7620,7 @@ wwn = ISP2400_NVRAM_PORT_NAME(nvram_data); if (wwn) { - if ((wwn >> 60) != 2) { + if ((wwn >> 60) != 2 && (wwn >> 60) != 5) { wwn = 0; } } @@ -7528,7 +7628,7 @@ wwn = ISP2400_NVRAM_NODE_NAME(nvram_data); if (wwn) { - if ((wwn >> 60) != 2) { + if ((wwn >> 60) != 2 && (wwn >> 60) != 5) { wwn = 0; } } ==== //depot/projects/newisp/dev/isp/isp_freebsd.c#6 (text+ko) ==== @@ -43,6 +43,8 @@ MODULE_VERSION(isp, 1); MODULE_DEPEND(isp, cam, 1, 1, 1); int isp_announced = 0; +int isp_fabric_hysteresis = 5; +int isp_loop_down_limit = 300; /* default loop down limit */ static d_ioctl_t ispioctl; static void isp_intr_enable(void *); @@ -2057,7 +2059,6 @@ isp_kthread(void *arg) { ispsoftc_t *isp = arg; - int loop_down_count = 0; int slp; @@ -2081,24 +2082,39 @@ int wasfrozen, lb; isp_prt(isp, ISP_LOGDEBUG0, "kthread: checking FC state"); - lb = isp_fc_runstate(isp, 2 * 1000000); + lb = isp_fc_runstate(isp, 250000); isp->isp_osinfo.ktmature = 1; if (lb) { + unsigned int inc = 1; + isp_prt(isp, ISP_LOGDEBUG0, "kthread: FC state %d", lb); - loop_down_count += 1; - if (loop_down_count > 20) { + if (isp->isp_osinfo.loop_down_time > 30) { + inc = 30; slp = 30 * hz; - } else if (loop_down_count > 5) { + } else if (isp->isp_osinfo.loop_down_time > 1) { slp = hz; } else { - slp = hz >> 8; + slp = 1; + } + + inc += isp->isp_osinfo.loop_down_time; + if (inc < 0xffff) { + isp->isp_osinfo.loop_down_time = inc; + } else { + isp->isp_osinfo.loop_down_time = 0xfffe; } } else { isp_prt(isp, ISP_LOGDEBUG0, "kthread: FC state OK"); - loop_down_count = 0; - slp = 60 * 60 * hz; + isp->isp_osinfo.loop_down_time = 0; + slp = 0; } + /* + * If we'd frozen the simq, unfreeze it now so that CAM + * can start sending us commands. If the FC state isn't + * okay yet, they'll hit that in isp_start which will + * freeze the queue again. + */ wasfrozen = isp->isp_osinfo.simqfrozen & SIMQFRZ_LOOPDOWN; isp->isp_osinfo.simqfrozen &= ~SIMQFRZ_LOOPDOWN; if (wasfrozen && isp->isp_osinfo.simqfrozen == 0) { @@ -2116,6 +2132,17 @@ (void) tsleep(&isp->isp_osinfo.kthread_cv, PRIBIO, "ispf", slp); #endif #endif + /* + * If slp is zero, we're waking up for the first time after + * things have been okay. In this case, we set a deferral state + * for all commands and delay hysteresis seconds before starting + * the FC state evaluation. This gives the loop/fabric a chance + * to settle. + */ + if (slp == 0 && isp->isp_osinfo.hysteresis) { + (void) tsleep(&isp_fabric_hysteresis, PRIBIO, "ispT", + (isp->isp_osinfo.hysteresis * hz)); + } } } @@ -2209,10 +2236,14 @@ KASSERT((IS_FC(isp)), ("CMD_RQLATER for FC only")); /* * If we've never seen loop up and we've at least - * looked once, just fail these commands. + * looked once, just fail these commands. Also, + * if we've exceeded the loop down limit- fail them + * as well. */ - if (FCPARAM(isp)->loop_seen_once == 0 && - isp->isp_osinfo.ktmature) { + if ((FCPARAM(isp)->loop_seen_once == 0 && + isp->isp_osinfo.ktmature) || + isp->isp_osinfo.loop_down_time > + isp->isp_osinfo.loop_down_limit) { ISPLOCK_2_CAMLOCK(isp); XS_SETERR(ccb, CAM_SEL_TIMEOUT); xpt_done(ccb); @@ -3096,13 +3127,17 @@ } break; case ISPASYNC_CHANGE_NOTIFY: + { + char *msg; if (arg == ISPASYNC_CHANGE_PDB) { - isp_prt(isp, ISP_LOGINFO, - "Port Database Changed"); + msg = "Port Database Changed"; } else if (arg == ISPASYNC_CHANGE_SNS) { - isp_prt(isp, ISP_LOGINFO, - "Name Server Database Changed"); + msg = "Name Server Database Changed"; + } else { + msg = "Other Change Notify"; } + isp_prt(isp, ISP_LOGINFO, msg); + isp_freeze_loopdown(isp, msg); #if __FreeBSD_version < 500000 wakeup(&isp->isp_osinfo.kproc); #else @@ -3113,6 +3148,7 @@ #endif #endif break; + } #ifdef ISP_TARGET_MODE case ISPASYNC_TARGET_NOTIFY: { ==== //depot/projects/newisp/dev/isp/isp_freebsd.h#4 (text+ko) ==== @@ -149,7 +149,11 @@ struct cam_sim *sim2; struct cam_path *path2; struct intr_config_hook ehook; - uint8_t + uint16_t loop_down_time; + uint16_t loop_down_limit; + uint32_t + : 16, + hysteresis : 8, disabled : 1, fcbsy : 1, ktmature : 1, @@ -427,6 +431,8 @@ * driver global data */ extern int isp_announced; +extern int isp_fabric_hysteresis; +extern int isp_loop_down_limit; /* * Platform private flags ==== //depot/projects/newisp/dev/isp/isp_library.c#5 (text) ==== @@ -199,14 +199,19 @@ } fcp = FCPARAM(isp); tptr = &tval; - if (isp_control(isp, ISPCTL_FCLINK_TEST, tptr) != 0) { - isp_prt(isp, ISP_LOGINFO, "isp_fc_runstate: linktest failed"); - return (-1); - } - if (fcp->isp_fwstate != FW_READY || + if (fcp->isp_fwstate < FW_READY || fcp->isp_loopstate < LOOP_PDB_RCVD) { - isp_prt(isp, ISP_LOGINFO, "isp_fc_runstate: f/w not ready"); - return (-1); + if (isp_control(isp, ISPCTL_FCLINK_TEST, tptr) != 0) { + isp_prt(isp, ISP_LOGINFO, + "isp_fc_runstate: linktest failed"); + return (-1); + } + if (fcp->isp_fwstate != FW_READY || + fcp->isp_loopstate < LOOP_PDB_RCVD) { + isp_prt(isp, ISP_LOGINFO, + "isp_fc_runstate: f/w not ready"); + return (-1); + } } if (isp_control(isp, ISPCTL_SCAN_LOOP, NULL) != 0) { isp_prt(isp, ISP_LOGINFO, "isp_fc_runstate: scan loop fails"); @@ -247,7 +252,7 @@ * Swizzle/Copy Functions */ void -isp_copy_out_hdr(ispsoftc_t *isp, isphdr_t *hpsrc, isphdr_t *hpdst) +isp_put_hdr(ispsoftc_t *isp, isphdr_t *hpsrc, isphdr_t *hpdst) { if (ISP_IS_SBUS(isp)) { ISP_IOXPUT_8(isp, hpsrc->rqs_entry_type, @@ -271,7 +276,7 @@ } void -isp_copy_in_hdr(ispsoftc_t *isp, isphdr_t *hpsrc, isphdr_t *hpdst) +isp_get_hdr(ispsoftc_t *isp, isphdr_t *hpsrc, isphdr_t *hpdst) { if (ISP_IS_SBUS(isp)) { ISP_IOXGET_8(isp, &hpsrc->rqs_entry_type, @@ -310,7 +315,7 @@ isp_put_request(ispsoftc_t *isp, ispreq_t *rqsrc, ispreq_t *rqdst) { int i; - isp_copy_out_hdr(isp, &rqsrc->req_header, &rqdst->req_header); + isp_put_hdr(isp, &rqsrc->req_header, &rqdst->req_header); ISP_IOXPUT_32(isp, rqsrc->req_handle, &rqdst->req_handle); if (ISP_IS_SBUS(isp)) { ISP_IOXPUT_8(isp, rqsrc->req_lun_trn, &rqdst->req_target); @@ -338,23 +343,24 @@ isp_put_marker(ispsoftc_t *isp, isp_marker_t *src, isp_marker_t *dst) { int i; - isp_copy_out_hdr(isp, &src->mrk_header, &dst->mrk_header); + isp_put_hdr(isp, &src->mrk_header, &dst->mrk_header); ISP_IOXPUT_32(isp, src->mrk_handle, &dst->mrk_handle); if (ISP_IS_SBUS(isp)) { - ISP_IOXPUT_8(isp, src->_res0, &dst->mrk_target); - ISP_IOXPUT_8(isp, src->mrk_target, &dst->_res0); - ISP_IOXPUT_8(isp, src->_res1, &dst->mrk_modifier); - ISP_IOXPUT_8(isp, src->mrk_modifier, &dst->_res1); + ISP_IOXPUT_8(isp, src->mrk_reserved0, &dst->mrk_target); + ISP_IOXPUT_8(isp, src->mrk_target, &dst->mrk_reserved0); + ISP_IOXPUT_8(isp, src->mrk_reserved1, &dst->mrk_modifier); + ISP_IOXPUT_8(isp, src->mrk_modifier, &dst->mrk_reserved1); } else { - ISP_IOXPUT_8(isp, src->_res0, &dst->_res0); + ISP_IOXPUT_8(isp, src->mrk_reserved0, &dst->mrk_reserved0); ISP_IOXPUT_8(isp, src->mrk_target, &dst->mrk_target); ISP_IOXPUT_8(isp, src->mrk_modifier, &dst->mrk_modifier); - ISP_IOXPUT_8(isp, src->_res1, &dst->_res1); + ISP_IOXPUT_8(isp, src->mrk_reserved1, &dst->mrk_reserved1); } ISP_IOXPUT_16(isp, src->mrk_flags, &dst->mrk_flags); ISP_IOXPUT_16(isp, src->mrk_lun, &dst->mrk_lun); for (i = 0; i < 48; i++) { - ISP_IOXPUT_8(isp, src->_res2[i], &dst->_res2[i]); + ISP_IOXPUT_8(isp, src->mrk_reserved2[i], + &dst->mrk_reserved2[i]); } } @@ -363,270 +369,258 @@ isp_marker_24xx_t *src, isp_marker_24xx_t *dst) { int i; - isp_copy_out_hdr(isp, &src->mrk_header, &dst->mrk_header); + isp_put_hdr(isp, &src->mrk_header, &dst->mrk_header); ISP_IOXPUT_32(isp, src->mrk_handle, &dst->mrk_handle); ISP_IOXPUT_16(isp, src->mrk_nphdl, &dst->mrk_nphdl); ISP_IOXPUT_8(isp, src->mrk_modifier, &dst->mrk_modifier); - ISP_IOXPUT_8(isp, src->_res0, &dst->_res0); - ISP_IOXPUT_8(isp, src->_res1, &dst->_res1); + ISP_IOXPUT_8(isp, src->mrk_reserved0, &dst->mrk_reserved0); + ISP_IOXPUT_8(isp, src->mrk_reserved1, &dst->mrk_reserved1); ISP_IOXPUT_8(isp, src->mrk_vphdl, &dst->mrk_vphdl); - ISP_IOXPUT_8(isp, src->_res2, &dst->_res2); + ISP_IOXPUT_8(isp, src->mrk_reserved2, &dst->mrk_reserved2); for (i = 0; i < 8; i++) { ISP_IOXPUT_8(isp, src->mrk_lun[i], &dst->mrk_lun[i]); } for (i = 0; i < 40; i++) { - ISP_IOXPUT_8(isp, src->_res3[i], &dst->_res3[i]); + ISP_IOXPUT_8(isp, src->mrk_reserved3[i], + &dst->mrk_reserved3[i]); } } void -isp_put_request_t2(ispsoftc_t *isp, ispreqt2_t *tqsrc, ispreqt2_t *tqdst) +isp_put_request_t2(ispsoftc_t *isp, ispreqt2_t *src, ispreqt2_t *dst) { int i; - isp_copy_out_hdr(isp, &tqsrc->req_header, &tqdst->req_header); - ISP_IOXPUT_32(isp, tqsrc->req_handle, &tqdst->req_handle); - ISP_IOXPUT_8(isp, tqsrc->req_lun_trn, &tqdst->req_lun_trn); - ISP_IOXPUT_8(isp, tqsrc->req_target, &tqdst->req_target); - ISP_IOXPUT_16(isp, tqsrc->req_scclun, &tqdst->req_scclun); - ISP_IOXPUT_16(isp, tqsrc->req_flags, &tqdst->req_flags); - ISP_IOXPUT_16(isp, tqsrc->_res2, &tqdst->_res2); - ISP_IOXPUT_16(isp, tqsrc->req_time, &tqdst->req_time); - ISP_IOXPUT_16(isp, tqsrc->req_seg_count, &tqdst->req_seg_count); + isp_put_hdr(isp, &src->req_header, &dst->req_header); + ISP_IOXPUT_32(isp, src->req_handle, &dst->req_handle); + ISP_IOXPUT_8(isp, src->req_lun_trn, &dst->req_lun_trn); + ISP_IOXPUT_8(isp, src->req_target, &dst->req_target); + ISP_IOXPUT_16(isp, src->req_scclun, &dst->req_scclun); + ISP_IOXPUT_16(isp, src->req_flags, &dst->req_flags); + ISP_IOXPUT_16(isp, src->req_reserved, &dst->req_reserved); + ISP_IOXPUT_16(isp, src->req_time, &dst->req_time); + ISP_IOXPUT_16(isp, src->req_seg_count, &dst->req_seg_count); for (i = 0; i < 16; i++) { - ISP_IOXPUT_8(isp, tqsrc->req_cdb[i], &tqdst->req_cdb[i]); + ISP_IOXPUT_8(isp, src->req_cdb[i], &dst->req_cdb[i]); } - ISP_IOXPUT_32(isp, tqsrc->req_totalcnt, &tqdst->req_totalcnt); + ISP_IOXPUT_32(isp, src->req_totalcnt, &dst->req_totalcnt); for (i = 0; i < ISP_RQDSEG_T2; i++) { - ISP_IOXPUT_32(isp, tqsrc->req_dataseg[i].ds_base, - &tqdst->req_dataseg[i].ds_base); - ISP_IOXPUT_32(isp, tqsrc->req_dataseg[i].ds_count, - &tqdst->req_dataseg[i].ds_count); + ISP_IOXPUT_32(isp, src->req_dataseg[i].ds_base, + &dst->req_dataseg[i].ds_base); + ISP_IOXPUT_32(isp, src->req_dataseg[i].ds_count, + &dst->req_dataseg[i].ds_count); } } void -isp_put_request_t2e(ispsoftc_t *isp, ispreqt2e_t *tqsrc, ispreqt2e_t *tqdst) +isp_put_request_t2e(ispsoftc_t *isp, ispreqt2e_t *src, ispreqt2e_t *dst) { int i; - isp_copy_out_hdr(isp, &tqsrc->req_header, &tqdst->req_header); - ISP_IOXPUT_32(isp, tqsrc->req_handle, &tqdst->req_handle); - ISP_IOXPUT_16(isp, tqsrc->req_target, &tqdst->req_target); - ISP_IOXPUT_16(isp, tqsrc->req_scclun, &tqdst->req_scclun); - ISP_IOXPUT_16(isp, tqsrc->req_flags, &tqdst->req_flags); - ISP_IOXPUT_16(isp, tqsrc->_res2, &tqdst->_res2); - ISP_IOXPUT_16(isp, tqsrc->req_time, &tqdst->req_time); - ISP_IOXPUT_16(isp, tqsrc->req_seg_count, &tqdst->req_seg_count); + isp_put_hdr(isp, &src->req_header, &dst->req_header); + ISP_IOXPUT_32(isp, src->req_handle, &dst->req_handle); + ISP_IOXPUT_16(isp, src->req_target, &dst->req_target); + ISP_IOXPUT_16(isp, src->req_scclun, &dst->req_scclun); + ISP_IOXPUT_16(isp, src->req_flags, &dst->req_flags); + ISP_IOXPUT_16(isp, src->req_reserved, &dst->req_reserved); + ISP_IOXPUT_16(isp, src->req_time, &dst->req_time); + ISP_IOXPUT_16(isp, src->req_seg_count, &dst->req_seg_count); for (i = 0; i < 16; i++) { - ISP_IOXPUT_8(isp, tqsrc->req_cdb[i], &tqdst->req_cdb[i]); + ISP_IOXPUT_8(isp, src->req_cdb[i], &dst->req_cdb[i]); } - ISP_IOXPUT_32(isp, tqsrc->req_totalcnt, &tqdst->req_totalcnt); + ISP_IOXPUT_32(isp, src->req_totalcnt, &dst->req_totalcnt); for (i = 0; i < ISP_RQDSEG_T2; i++) { - ISP_IOXPUT_32(isp, tqsrc->req_dataseg[i].ds_base, - &tqdst->req_dataseg[i].ds_base); - ISP_IOXPUT_32(isp, tqsrc->req_dataseg[i].ds_count, - &tqdst->req_dataseg[i].ds_count); + ISP_IOXPUT_32(isp, src->req_dataseg[i].ds_base, + &dst->req_dataseg[i].ds_base); + ISP_IOXPUT_32(isp, src->req_dataseg[i].ds_count, + &dst->req_dataseg[i].ds_count); } } void -isp_put_request_t3(ispsoftc_t *isp, ispreqt3_t *tqsrc, ispreqt3_t *tqdst) +isp_put_request_t3(ispsoftc_t *isp, ispreqt3_t *src, ispreqt3_t *dst) { int i; - isp_copy_out_hdr(isp, &tqsrc->req_header, &tqdst->req_header); - ISP_IOXPUT_32(isp, tqsrc->req_handle, &tqdst->req_handle); - ISP_IOXPUT_8(isp, tqsrc->req_lun_trn, &tqdst->req_lun_trn); - ISP_IOXPUT_8(isp, tqsrc->req_target, &tqdst->req_target); - ISP_IOXPUT_16(isp, tqsrc->req_scclun, &tqdst->req_scclun); - ISP_IOXPUT_16(isp, tqsrc->req_flags, &tqdst->req_flags); - ISP_IOXPUT_16(isp, tqsrc->_res2, &tqdst->_res2); - ISP_IOXPUT_16(isp, tqsrc->req_time, &tqdst->req_time); - ISP_IOXPUT_16(isp, tqsrc->req_seg_count, &tqdst->req_seg_count); + isp_put_hdr(isp, &src->req_header, &dst->req_header); + ISP_IOXPUT_32(isp, src->req_handle, &dst->req_handle); + ISP_IOXPUT_8(isp, src->req_lun_trn, &dst->req_lun_trn); + ISP_IOXPUT_8(isp, src->req_target, &dst->req_target); + ISP_IOXPUT_16(isp, src->req_scclun, &dst->req_scclun); + ISP_IOXPUT_16(isp, src->req_flags, &dst->req_flags); + ISP_IOXPUT_16(isp, src->req_reserved, &dst->req_reserved); + ISP_IOXPUT_16(isp, src->req_time, &dst->req_time); + ISP_IOXPUT_16(isp, src->req_seg_count, &dst->req_seg_count); for (i = 0; i < 16; i++) { - ISP_IOXPUT_8(isp, tqsrc->req_cdb[i], &tqdst->req_cdb[i]); + ISP_IOXPUT_8(isp, src->req_cdb[i], &dst->req_cdb[i]); } - ISP_IOXPUT_32(isp, tqsrc->req_totalcnt, &tqdst->req_totalcnt); + ISP_IOXPUT_32(isp, src->req_totalcnt, &dst->req_totalcnt); for (i = 0; i < ISP_RQDSEG_T3; i++) { - ISP_IOXPUT_32(isp, tqsrc->req_dataseg[i].ds_base, - &tqdst->req_dataseg[i].ds_base); - ISP_IOXPUT_32(isp, tqsrc->req_dataseg[i].ds_basehi, - &tqdst->req_dataseg[i].ds_basehi); - ISP_IOXPUT_32(isp, tqsrc->req_dataseg[i].ds_count, - &tqdst->req_dataseg[i].ds_count); + ISP_IOXPUT_32(isp, src->req_dataseg[i].ds_base, + &dst->req_dataseg[i].ds_base); + ISP_IOXPUT_32(isp, src->req_dataseg[i].ds_basehi, + &dst->req_dataseg[i].ds_basehi); + ISP_IOXPUT_32(isp, src->req_dataseg[i].ds_count, + &dst->req_dataseg[i].ds_count); } } void -isp_put_request_t3e(ispsoftc_t *isp, ispreqt3e_t *tqsrc, ispreqt3e_t *tqdst) +isp_put_request_t3e(ispsoftc_t *isp, ispreqt3e_t *src, ispreqt3e_t *dst) { int i; - isp_copy_out_hdr(isp, &tqsrc->req_header, &tqdst->req_header); - ISP_IOXPUT_32(isp, tqsrc->req_handle, &tqdst->req_handle); - ISP_IOXPUT_16(isp, tqsrc->req_target, &tqdst->req_target); - ISP_IOXPUT_16(isp, tqsrc->req_scclun, &tqdst->req_scclun); - ISP_IOXPUT_16(isp, tqsrc->req_flags, &tqdst->req_flags); - ISP_IOXPUT_16(isp, tqsrc->_res2, &tqdst->_res2); - ISP_IOXPUT_16(isp, tqsrc->req_time, &tqdst->req_time); - ISP_IOXPUT_16(isp, tqsrc->req_seg_count, &tqdst->req_seg_count); + isp_put_hdr(isp, &src->req_header, &dst->req_header); + ISP_IOXPUT_32(isp, src->req_handle, &dst->req_handle); + ISP_IOXPUT_16(isp, src->req_target, &dst->req_target); + ISP_IOXPUT_16(isp, src->req_scclun, &dst->req_scclun); + ISP_IOXPUT_16(isp, src->req_flags, &dst->req_flags); + ISP_IOXPUT_16(isp, src->req_reserved, &dst->req_reserved); + ISP_IOXPUT_16(isp, src->req_time, &dst->req_time); + ISP_IOXPUT_16(isp, src->req_seg_count, &dst->req_seg_count); for (i = 0; i < 16; i++) { - ISP_IOXPUT_8(isp, tqsrc->req_cdb[i], &tqdst->req_cdb[i]); + ISP_IOXPUT_8(isp, src->req_cdb[i], &dst->req_cdb[i]); } - ISP_IOXPUT_32(isp, tqsrc->req_totalcnt, &tqdst->req_totalcnt); + ISP_IOXPUT_32(isp, src->req_totalcnt, &dst->req_totalcnt); for (i = 0; i < ISP_RQDSEG_T3; i++) { - ISP_IOXPUT_32(isp, tqsrc->req_dataseg[i].ds_base, - &tqdst->req_dataseg[i].ds_base); - ISP_IOXPUT_32(isp, tqsrc->req_dataseg[i].ds_basehi, - &tqdst->req_dataseg[i].ds_basehi); - ISP_IOXPUT_32(isp, tqsrc->req_dataseg[i].ds_count, - &tqdst->req_dataseg[i].ds_count); + ISP_IOXPUT_32(isp, src->req_dataseg[i].ds_base, + &dst->req_dataseg[i].ds_base); + ISP_IOXPUT_32(isp, src->req_dataseg[i].ds_basehi, + &dst->req_dataseg[i].ds_basehi); + ISP_IOXPUT_32(isp, src->req_dataseg[i].ds_count, + &dst->req_dataseg[i].ds_count); } } void -isp_put_extended_request(ispsoftc_t *isp, ispextreq_t *xqsrc, - ispextreq_t *xqdst) +isp_put_extended_request(ispsoftc_t *isp, ispextreq_t *src, ispextreq_t *dst) { int i; - isp_copy_out_hdr(isp, &xqsrc->req_header, &xqdst->req_header); - ISP_IOXPUT_32(isp, xqsrc->req_handle, &xqdst->req_handle); + isp_put_hdr(isp, &src->req_header, &dst->req_header); + ISP_IOXPUT_32(isp, src->req_handle, &dst->req_handle); if (ISP_IS_SBUS(isp)) { - ISP_IOXPUT_8(isp, xqsrc->req_lun_trn, &xqdst->req_target); - ISP_IOXPUT_8(isp, xqsrc->req_target, &xqdst->req_lun_trn); + ISP_IOXPUT_8(isp, src->req_lun_trn, &dst->req_target); + ISP_IOXPUT_8(isp, src->req_target, &dst->req_lun_trn); } else { - ISP_IOXPUT_8(isp, xqsrc->req_lun_trn, &xqdst->req_lun_trn); - ISP_IOXPUT_8(isp, xqsrc->req_target, &xqdst->req_target); >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Sat Sep 16 00:05:04 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3916816A415; Sat, 16 Sep 2006 00:05:04 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F09B616A40F for ; Sat, 16 Sep 2006 00:05:03 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id AAFA543D45 for ; Sat, 16 Sep 2006 00:05:03 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8G053KM062178 for ; Sat, 16 Sep 2006 00:05:03 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8G053dZ062175 for perforce@freebsd.org; Sat, 16 Sep 2006 00:05:03 GMT (envelope-from imp@freebsd.org) Date: Sat, 16 Sep 2006 00:05:03 GMT Message-Id: <200609160005.k8G053dZ062175@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 106179 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Sep 2006 00:05:04 -0000 http://perforce.freebsd.org/chv.cgi?CH=106179 Change 106179 by imp@imp_lighthouse on 2006/09/16 00:04:58 Allow for downloading and resetting from the loader... silly, I know, but useful for devel Affected files ... .. //depot/projects/arm/src/sys/boot/arm/at91/Makefile.inc#22 edit .. //depot/projects/arm/src/sys/boot/arm/at91/boot2/boot2.c#22 edit Differences ... ==== //depot/projects/arm/src/sys/boot/arm/at91/Makefile.inc#22 (text+ko) ==== @@ -5,7 +5,7 @@ __at91_boot_Makefile.inc__: -CFLAGS=-O2 -mcpu=arm9 -ffreestanding \ +CFLAGS=-Os -mcpu=arm9 -ffreestanding \ -I${.CURDIR}/../libat91 \ -I${.CURDIR}/../../../.. \ -I${.CURDIR}/../../../../arm \ ==== //depot/projects/arm/src/sys/boot/arm/at91/boot2/boot2.c#22 (text+ko) ==== @@ -117,6 +117,8 @@ if (c) *s++ = c; for (;;) { + c = getc(10000); + switch (c = getc(10000)) { case 0: break; @@ -207,6 +209,30 @@ } #endif +#define XMODEM_DL +#ifdef XMODEM_DL +#define FLASH_OFFSET (0 * FLASH_PAGE_SIZE) +#define FPGA_OFFSET (15 * FLASH_PAGE_SIZE) +#define FPGA_LEN (212608) +#define KERNEL_OFFSET (220 * FLASH_PAGE_SIZE) +#define KERNEL_LEN (6 * 1024 * FLASH_PAGE_SIZE) + +static void +UpdateFlash(int offset) +{ + char *addr = (char *)0x20000000 + (1 << 20); /* Load to base + 1MB */ + int len, i, off; + + while ((len = xmodem_rx(addr)) == -1) + continue; + printf("\nDownloaded %u bytes.\n", len); + for (i = 0; i < len; i+= FLASH_PAGE_SIZE) { + off = i + offset; + SPI_WriteFlash(off, addr + i, FLASH_PAGE_SIZE); + } +} +#endif + int main(void) { @@ -248,12 +274,18 @@ printf("\nDefault: %s\nboot: ", kname); if (!autoboot || (c = getc(2)) != -1) getstr(c); - else if (!autoboot) - xputchar('\n'); + xputchar('\n'); autoboot = 0; c = 0; + printf("cmd is '%s'\n", cmd); if (parse()) xputchar('\a'); +#ifdef XMODEM_DL + else if (*cmd == '*') + UpdateFlash(FLASH_OFFSET); + else if (*cmd == '#') + reset(); +#endif else load(); } From owner-p4-projects@FreeBSD.ORG Sat Sep 16 13:43:13 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 84F4B16A415; Sat, 16 Sep 2006 13:43:13 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3A91316A403 for ; Sat, 16 Sep 2006 13:43:13 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id D4A3043D5A for ; Sat, 16 Sep 2006 13:43:12 +0000 (GMT) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8GDhCaC052029 for ; Sat, 16 Sep 2006 13:43:12 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8GDhCW4052026 for perforce@freebsd.org; Sat, 16 Sep 2006 13:43:12 GMT (envelope-from hselasky@FreeBSD.org) Date: Sat, 16 Sep 2006 13:43:12 GMT Message-Id: <200609161343.k8GDhCW4052026@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 106202 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Sep 2006 13:43:13 -0000 http://perforce.freebsd.org/chv.cgi?CH=106202 Change 106202 by hselasky@hselasky_mini_itx on 2006/09/16 13:42:44 Added missing callout_drain() at various places. Affected files ... .. //depot/projects/usb/src/sys/dev/ata/ata-usb.c#7 edit .. //depot/projects/usb/src/sys/dev/usb/ehci.c#11 edit .. //depot/projects/usb/src/sys/dev/usb/if_aue.c#10 edit .. //depot/projects/usb/src/sys/dev/usb/if_axe.c#9 edit .. //depot/projects/usb/src/sys/dev/usb/if_cue.c#9 edit .. //depot/projects/usb/src/sys/dev/usb/if_kue.c#10 edit .. //depot/projects/usb/src/sys/dev/usb/if_rue.c#8 edit .. //depot/projects/usb/src/sys/dev/usb/if_udav.c#8 edit .. //depot/projects/usb/src/sys/dev/usb/if_ural.c#10 edit .. //depot/projects/usb/src/sys/dev/usb/ohci.c#10 edit .. //depot/projects/usb/src/sys/dev/usb/uhci.c#10 edit .. //depot/projects/usb/src/sys/dev/usb/ulpt.c#15 edit .. //depot/projects/usb/src/sys/dev/usb/ums.c#11 edit .. //depot/projects/usb/src/sys/dev/usb/usb_subr.c#18 edit .. //depot/projects/usb/src/sys/dev/usb/uvscom.c#11 edit Differences ... ==== //depot/projects/usb/src/sys/dev/ata/ata-usb.c#7 (text) ==== @@ -504,6 +504,8 @@ usbd_transfer_drain(&(sc->mem_wait), &(sc->locked_mtx)); + __callout_drain(&(sc->watchdog)); + mtx_destroy(&sc->locked_mtx); return 0; } ==== //depot/projects/usb/src/sys/dev/usb/ehci.c#11 (text+ko) ==== @@ -367,6 +367,9 @@ DELAY(1000*300); /* XXX let stray task complete */ mtx_unlock(&sc->sc_bus.mtx); + + __callout_drain(&(sc->sc_tmo_pcd)); + return; } ==== //depot/projects/usb/src/sys/dev/usb/if_aue.c#10 (text+ko) ==== @@ -998,6 +998,8 @@ usbd_config_td_unsetup(&(sc->sc_config_td)); + __callout_drain(&(sc->sc_watchdog)); + mtx_destroy(&(sc->sc_mtx)); return 0; ==== //depot/projects/usb/src/sys/dev/usb/if_axe.c#9 (text+ko) ==== @@ -800,6 +800,8 @@ usbd_config_td_unsetup(&(sc->sc_config_td)); + __callout_drain(&(sc->sc_watchdog)); + mtx_destroy(&(sc->sc_mtx)); return 0; ==== //depot/projects/usb/src/sys/dev/usb/if_cue.c#9 (text+ko) ==== @@ -632,6 +632,8 @@ usbd_config_td_unsetup(&(sc->sc_config_td)); + __callout_drain(&(sc->sc_watchdog)); + mtx_destroy(&(sc->sc_mtx)); return 0; ==== //depot/projects/usb/src/sys/dev/usb/if_kue.c#10 (text+ko) ==== @@ -668,6 +668,8 @@ usbd_config_td_unsetup(&(sc->sc_config_td)); + __callout_drain(&(sc->sc_watchdog)); + mtx_destroy(&(sc->sc_mtx)); return 0; ==== //depot/projects/usb/src/sys/dev/usb/if_rue.c#8 (text+ko) ==== @@ -899,6 +899,8 @@ usbd_config_td_unsetup(&(sc->sc_config_td)); + __callout_drain(&(sc->sc_watchdog)); + mtx_destroy(&(sc->sc_mtx)); return 0; ==== //depot/projects/usb/src/sys/dev/usb/if_udav.c#8 (text+ko) ==== @@ -506,6 +506,8 @@ usbd_config_td_unsetup(&(sc->sc_config_td)); + __callout_drain(&(sc->sc_watchdog)); + mtx_destroy(&(sc->sc_mtx)); return 0; ==== //depot/projects/usb/src/sys/dev/usb/if_ural.c#10 (text+ko) ==== @@ -142,7 +142,8 @@ ural_ack_rate(struct ieee80211com *ic, u_int16_t rate); static u_int16_t -ural_txtime(struct ural_softc *sc, u_int16_t len, u_int16_t rate, u_int32_t flags); +ural_txtime(struct ural_softc *sc, u_int16_t len, u_int16_t rate, + u_int32_t flags); static u_int8_t ural_plcp_signal(u_int16_t rate); @@ -614,6 +615,8 @@ usbd_config_td_unsetup(&(sc->sc_config_td)); + __callout_drain(&(sc->sc_watchdog)); + mtx_destroy(&sc->sc_mtx); return 0; ==== //depot/projects/usb/src/sys/dev/usb/ohci.c#10 (text+ko) ==== @@ -383,6 +383,9 @@ DELAY(1000*300); /* XXX let stray task complete */ mtx_unlock(&sc->sc_bus.mtx); + + __callout_drain(&(sc->sc_tmo_rhsc)); + return; } ==== //depot/projects/usb/src/sys/dev/usb/uhci.c#10 (text+ko) ==== ==== //depot/projects/usb/src/sys/dev/usb/ulpt.c#15 (text+ko) ==== @@ -700,6 +700,8 @@ usbd_transfer_drain(&(sc->sc_mem_wait), &(sc->sc_mtx)); + __callout_drain(&(sc->sc_watchdog)); + mtx_destroy(&(sc->sc_mtx)); return 0; ==== //depot/projects/usb/src/sys/dev/usb/ums.c#11 (text+ko) ==== @@ -573,6 +573,8 @@ usbd_transfer_drain(&(sc->sc_mem_wait), &(sc->sc_mtx)); + __callout_drain(&(sc->sc_callout)); + mtx_destroy(&(sc->sc_mtx)); return 0; ==== //depot/projects/usb/src/sys/dev/usb/usb_subr.c#18 (text+ko) ==== ==== //depot/projects/usb/src/sys/dev/usb/uvscom.c#11 (text+ko) ==== @@ -511,6 +511,8 @@ usbd_transfer_drain(&(sc->sc_mem_wait), &Giant); + __callout_drain(&(sc->sc_watchdog)); + return 0; } From owner-p4-projects@FreeBSD.ORG Sat Sep 16 13:47:19 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 88A5716A415; Sat, 16 Sep 2006 13:47:19 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 63AC716A40F for ; Sat, 16 Sep 2006 13:47:19 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 31FDC43D45 for ; Sat, 16 Sep 2006 13:47:19 +0000 (GMT) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8GDlJQ8052210 for ; Sat, 16 Sep 2006 13:47:19 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8GDlJGR052207 for perforce@freebsd.org; Sat, 16 Sep 2006 13:47:19 GMT (envelope-from hselasky@FreeBSD.org) Date: Sat, 16 Sep 2006 13:47:19 GMT Message-Id: <200609161347.k8GDlJGR052207@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 106203 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Sep 2006 13:47:19 -0000 http://perforce.freebsd.org/chv.cgi?CH=106203 Change 106203 by hselasky@hselasky_mini_itx on 2006/09/16 13:47:15 Compile fix. Define __callout_drain(). Affected files ... .. //depot/projects/usb/src/sys/dev/usb/usb_port.h#9 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb/usb_port.h#9 (text+ko) ==== @@ -76,6 +76,7 @@ # define __callout_init_mtx(c,m,f) callout_init_mtx(&(c)->co,m,f) # define __callout_reset(c,t,f,d) callout_reset(&(c)->co,t,f,d) # define __callout_stop(c) callout_stop(&(c)->co) +# define __callout_drain(c) callout_drain(&(c)->co) # define __callout_pending(c) callout_pending(&(c)->co) struct __callout { struct callout co; }; # endif From owner-p4-projects@FreeBSD.ORG Sat Sep 16 13:49:22 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id CB1FB16A415; Sat, 16 Sep 2006 13:49:22 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8F1C616A407 for ; Sat, 16 Sep 2006 13:49:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4794C43D4C for ; Sat, 16 Sep 2006 13:49:22 +0000 (GMT) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8GDnMRT052284 for ; Sat, 16 Sep 2006 13:49:22 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8GDnL8T052281 for perforce@freebsd.org; Sat, 16 Sep 2006 13:49:22 GMT (envelope-from hselasky@FreeBSD.org) Date: Sat, 16 Sep 2006 13:49:22 GMT Message-Id: <200609161349.k8GDnL8T052281@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 106204 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Sep 2006 13:49:23 -0000 http://perforce.freebsd.org/chv.cgi?CH=106204 Change 106204 by hselasky@hselasky_mini_itx on 2006/09/16 13:48:30 Add missing callout_drain(). Affected files ... .. //depot/projects/usb/src/sys/dev/usb/usb_transfer.c#15 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb/usb_transfer.c#15 (text+ko) ==== @@ -430,6 +430,8 @@ mtx_unlock(xfer->priv_mtx); } + __callout_drain(&(xfer->timeout_handle)); + if(xfer->usb_root) { usbd_drop_refcount(xfer->usb_root); From owner-p4-projects@FreeBSD.ORG Sat Sep 16 14:38:25 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5528A16A415; Sat, 16 Sep 2006 14:38:25 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3119516A407 for ; Sat, 16 Sep 2006 14:38:25 +0000 (UTC) (envelope-from netchild@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id E22C743D5F for ; Sat, 16 Sep 2006 14:38:24 +0000 (GMT) (envelope-from netchild@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8GEcOVM057065 for ; Sat, 16 Sep 2006 14:38:24 GMT (envelope-from netchild@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8GEcO4F057062 for perforce@freebsd.org; Sat, 16 Sep 2006 14:38:24 GMT (envelope-from netchild@freebsd.org) Date: Sat, 16 Sep 2006 14:38:24 GMT Message-Id: <200609161438.k8GEcO4F057062@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to netchild@freebsd.org using -f From: Alexander Leidinger To: Perforce Change Reviews Cc: Subject: PERFORCE change 106208 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Sep 2006 14:38:25 -0000 http://perforce.freebsd.org/chv.cgi?CH=106208 Change 106208 by netchild@netchild_magellan on 2006/09/16 14:37:28 - Some minor modifications in comments and debugging messages. - Calling uma_zcreate() without the flag UMA_ZONE_NOFREE to fix a memory leak. Submitted by: mag@intron.ac Affected files ... .. //depot/projects/linuxolator/src/sys/compat/linux/linux_aio.c#2 edit Differences ... ==== //depot/projects/linuxolator/src/sys/compat/linux/linux_aio.c#2 (text+ko) ==== @@ -61,7 +61,7 @@ /* Print message in syscall function */ #define DPRINTF(fmt, ...) printf(LMSG("%s(): " fmt), \ __func__, __VA_ARGS__) -/* Print message in non-syscall function */ +/* Print message in non-syscall function, the one more "P" means "private" */ #define DPPRINTF(fmt, ...) printf("linux(): %s(): " fmt "\n", \ __func__, __VA_ARGS__) @@ -87,9 +87,9 @@ * +------------+ +------------+ * | request | | request | * | | | | + * |.req_pbsd | |.req_pbsd | * |.req_porig | |.req_porig | * |.req_linux | |.req_linux | - * |.req_pbsd | |.req_pbsd | * | | | | * +------------+ +------------+ * | | @@ -178,7 +178,8 @@ * AIO_(UN)LOCK in /sys/kern/vfs_aio.c. Thus, the mutex much be unlocked * before calling functions of FreeBSD native AIO module. * - * XXX The member "kaio_mtx" is the first element of "struct kaioinfo". + * XXX + * I ASSUME the member "kaio_mtx" is the first element of "struct kaioinfo". */ #define LINUX_AIO_LOCK(p) { \ if ((p)->p_aioinfo == NULL) \ @@ -199,7 +200,7 @@ /* * XXX * Calling external function/variable declared with "static" is DANGEROUS !!! - * Compiler may use register to transfer function arguments for optimization, + * Compiler may use register to transfer calling arguments for optimization, * which is NOT a normal calling way and can cause kernel crash. */ @@ -236,6 +237,7 @@ return nerr; } +/* Allocate memory in user space */ static int user_malloc(struct thread *td, void **pp, size_t s) { struct mmap_args mmaparg; @@ -264,6 +266,7 @@ return nerr; } +/* Free memory in user space */ static int user_free(struct thread *td, void *p, size_t s) { struct munmap_args munmaparg; @@ -331,7 +334,7 @@ #else /* ! LINUX_AIO_DEBUG */ #define DUMP_FREEBSD_AIOCB(p, isu) -#define DUMP_TIMESPEC(f,t,a) +#define DUMP_TIMESPEC(f, t, a) #endif /* LINUX_AIO_DEBUG */ @@ -348,7 +351,7 @@ * I/O buffer */ pbsd->aio_nbytes = plnx->aio_nbytes; /* Number of bytes for I/O */ - switch (plnx->aio_lio_opcode) { /* LIO opcode */ + switch (plnx->aio_lio_opcode) { /* LIO opcode */ case LINUX_IOCB_CMD_PREAD: pbsd->aio_lio_opcode = LIO_READ; break; @@ -814,7 +817,7 @@ if (args->timeout != NULL) { nanouptime(&t1); /* Time before aio_suspend() */ DUMP_TIMESPEC("T1: ", &t1, - " (uptime before aio_suspend())"); + " (uptime before calling aio_suspend())"); } /* Prepare arguments for aio_suspend() */ @@ -831,7 +834,7 @@ if (args->timeout != NULL) { copyout(&timeout, u_ptimeout, sizeof(timeout)); aiosusargs.timeout = u_ptimeout; - DUMP_TIMESPEC("Time remaining: ", &timeout, ""); + DUMP_TIMESPEC("Time remained: ", &timeout, ""); } else { aiosusargs.timeout = NULL; } @@ -844,25 +847,25 @@ if (args->timeout != NULL) { nanouptime(&t2); /* Time after aio_suspend() */ DUMP_TIMESPEC("T2: ", &t2, - " (uptime after aio_suspend())"); + " (uptime after calling aio_suspend())"); timespecsub(&t2, &t1); /* * Time spent by * aio_suspend() */ DUMP_TIMESPEC("T_delta: ", &t2, - " (time spent by aio_suspend())"); + " (time spent by calling aio_suspend())"); if (timespeccmp(&t2, &timeout, >=)) { timespecclear(&timeout); /* Timed out */ } else { timespecsub(&timeout, &t2); /* Time remaining */ } - DUMP_TIMESPEC("Time remaining: ", &timeout, ""); + DUMP_TIMESPEC("Time remained: ", &timeout, ""); } if (aio_err == EAGAIN) { /* Timed out */ DPRINTF("returning(context %p): " - "timed out after aio_suspend()", + "timed out after calling aio_suspend()", pctx); break; } @@ -883,7 +886,7 @@ skip_substantial_0: td->td_retval[0] = i; /* user_free() resets td->td_retval[0] to 0 */ - DPRINTF("%d requests got out of context %p", i, pctx); + DPRINTF("%d requests are unhooked from the context %p", i, pctx); } /* End of dealing with request queue */ LINUX_AIO_CTX_UNLOCK(pctx); @@ -1170,11 +1173,11 @@ linux_aio_context_zone = uma_zcreate("LINUXAIOCTX", sizeof(struct linux_aio_context), NULL, NULL, NULL, NULL, - UMA_ALIGN_PTR, UMA_ZONE_NOFREE); + UMA_ALIGN_PTR, 0); linux_aio_request_zone = uma_zcreate("LINUXAIOREQ", sizeof(struct linux_aio_request), NULL, NULL, NULL, NULL, - UMA_ALIGN_PTR, UMA_ZONE_NOFREE); + UMA_ALIGN_PTR, 0); mtx_init(&linux_aio_context_list_mtx, "linux_aio_context_list", NULL, MTX_DEF); SLIST_INIT(&linux_aio_context_list); From owner-p4-projects@FreeBSD.ORG Sat Sep 16 15:31:21 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B133416A4D8; Sat, 16 Sep 2006 15:31:21 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6736B16A47B for ; Sat, 16 Sep 2006 15:31:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id CD34843D6A for ; Sat, 16 Sep 2006 15:30:29 +0000 (GMT) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8GFUTY2060834 for ; Sat, 16 Sep 2006 15:30:29 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8GFUTGp060830 for perforce@freebsd.org; Sat, 16 Sep 2006 15:30:29 GMT (envelope-from hselasky@FreeBSD.org) Date: Sat, 16 Sep 2006 15:30:29 GMT Message-Id: <200609161530.k8GFUTGp060830@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 106209 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Sep 2006 15:31:22 -0000 http://perforce.freebsd.org/chv.cgi?CH=106209 Change 106209 by hselasky@hselasky_mini_itx on 2006/09/16 15:30:18 Add missing __callout_drain(). Affected files ... .. //depot/projects/usb/src/sys/dev/usb/ukbd.c#11 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb/ukbd.c#11 (text+ko) ==== @@ -767,6 +767,8 @@ usbd_transfer_drain(&(sc->sc_mem_wait), &Giant); + __callout_drain(&(sc->sc_callout)); + DPRINTF(0, "%s: disconnected\n", device_get_nameunit(dev)); From owner-p4-projects@FreeBSD.ORG Sat Sep 16 17:26:59 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A385416A40F; Sat, 16 Sep 2006 17:26:59 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 66DBA16A403 for ; Sat, 16 Sep 2006 17:26:59 +0000 (UTC) (envelope-from mjacob@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0419843D55 for ; Sat, 16 Sep 2006 17:26:59 +0000 (GMT) (envelope-from mjacob@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8GHQwbJ080355 for ; Sat, 16 Sep 2006 17:26:58 GMT (envelope-from mjacob@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8GHQvAQ080352 for perforce@freebsd.org; Sat, 16 Sep 2006 17:26:57 GMT (envelope-from mjacob@freebsd.org) Date: Sat, 16 Sep 2006 17:26:57 GMT Message-Id: <200609161726.k8GHQvAQ080352@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to mjacob@freebsd.org using -f From: Matt Jacob To: Perforce Change Reviews Cc: Subject: PERFORCE change 106213 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Sep 2006 17:26:59 -0000 http://perforce.freebsd.org/chv.cgi?CH=106213 Change 106213 by mjacob@newisp on 2006/09/16 17:26:27 IFC Affected files ... .. //depot/projects/newisp/compat/linux/linux_misc.c#2 integrate .. //depot/projects/newisp/contrib/pf/net/pf.c#2 integrate .. //depot/projects/newisp/crypto/via/padlock_cipher.c#2 integrate .. //depot/projects/newisp/dev/ata/ata-chipset.c#5 integrate .. //depot/projects/newisp/dev/ata/ata-disk.c#2 integrate .. //depot/projects/newisp/dev/ata/ata-raid.h#2 integrate .. //depot/projects/newisp/dev/bge/if_bge.c#4 integrate .. //depot/projects/newisp/dev/bktr/bktr_i2c.c#2 integrate .. //depot/projects/newisp/dev/cs/if_cs.c#2 integrate .. //depot/projects/newisp/dev/cs/if_csvar.h#2 integrate .. //depot/projects/newisp/dev/dc/if_dc.c#2 integrate .. //depot/projects/newisp/dev/dc/if_dcreg.h#2 integrate .. //depot/projects/newisp/dev/de/if_de.c#2 integrate .. //depot/projects/newisp/dev/de/if_devar.h#2 integrate .. //depot/projects/newisp/dev/en/if_en_pci.c#2 integrate .. //depot/projects/newisp/dev/en/midway.c#2 integrate .. //depot/projects/newisp/dev/ichsmb/ichsmb.c#2 integrate .. //depot/projects/newisp/dev/iicbus/iicsmb.c#2 integrate .. //depot/projects/newisp/dev/lge/if_lge.c#2 integrate .. //depot/projects/newisp/dev/lge/if_lgereg.h#2 integrate .. //depot/projects/newisp/dev/mxge/eth_z8e.dat.gz.uu#2 integrate .. //depot/projects/newisp/dev/mxge/ethp_z8e.dat.gz.uu#2 integrate .. //depot/projects/newisp/dev/mxge/if_mxge.c#2 integrate .. //depot/projects/newisp/dev/mxge/if_mxge_var.h#2 integrate .. //depot/projects/newisp/dev/mxge/mxge_mcp.h#2 integrate .. //depot/projects/newisp/dev/my/if_my.c#2 integrate .. //depot/projects/newisp/dev/my/if_myreg.h#2 integrate .. //depot/projects/newisp/dev/nge/if_nge.c#2 integrate .. //depot/projects/newisp/dev/nge/if_ngereg.h#2 integrate .. //depot/projects/newisp/dev/re/if_re.c#3 integrate .. //depot/projects/newisp/dev/sio/sio_pccard.c#2 integrate .. //depot/projects/newisp/dev/smbus/smb.c#2 integrate .. //depot/projects/newisp/dev/smbus/smb.h#2 integrate .. //depot/projects/newisp/dev/smbus/smbconf.c#2 integrate .. //depot/projects/newisp/dev/smbus/smbconf.h#2 integrate .. //depot/projects/newisp/dev/smbus/smbus.c#2 integrate .. //depot/projects/newisp/dev/smbus/smbus.h#2 integrate .. //depot/projects/newisp/dev/smbus/smbus_if.m#2 integrate .. //depot/projects/newisp/dev/syscons/scmouse.c#2 integrate .. //depot/projects/newisp/dev/syscons/syscons.c#2 integrate .. //depot/projects/newisp/dev/syscons/syscons.h#2 integrate .. //depot/projects/newisp/dev/ti/if_ti.c#2 integrate .. //depot/projects/newisp/fs/udf/osta.h#2 integrate .. //depot/projects/newisp/geom/eli/g_eli.h#2 integrate .. //depot/projects/newisp/geom/eli/g_eli_ctl.c#2 integrate .. //depot/projects/newisp/geom/geom.h#2 integrate .. //depot/projects/newisp/geom/geom_subr.c#2 integrate .. //depot/projects/newisp/geom/label/g_label_ufs.c#2 integrate .. //depot/projects/newisp/geom/mirror/g_mirror.c#3 integrate .. //depot/projects/newisp/geom/raid3/g_raid3.c#3 integrate .. //depot/projects/newisp/geom/raid3/g_raid3_ctl.c#2 integrate .. //depot/projects/newisp/i386/conf/NOTES#2 integrate .. //depot/projects/newisp/i386/i386/busdma_machdep.c#3 integrate .. //depot/projects/newisp/ia64/ia32/ia32_trap.c#2 integrate .. //depot/projects/newisp/ia64/ia64/trap.c#2 integrate .. //depot/projects/newisp/kern/bus_if.m#4 integrate .. //depot/projects/newisp/kern/kern_exit.c#2 integrate .. //depot/projects/newisp/kern/subr_witness.c#2 integrate .. //depot/projects/newisp/kern/uipc_socket.c#3 integrate .. //depot/projects/newisp/kern/vfs_lookup.c#2 integrate .. //depot/projects/newisp/modules/ipfw/Makefile#2 integrate .. //depot/projects/newisp/modules/pf/Makefile#2 integrate .. //depot/projects/newisp/netgraph/ng_eiface.c#2 integrate .. //depot/projects/newisp/netgraph/ng_fec.c#2 integrate .. //depot/projects/newisp/netinet/ip_fw2.c#3 integrate .. //depot/projects/newisp/netinet/tcp_input.c#4 integrate .. //depot/projects/newisp/netinet/tcp_output.c#3 integrate .. //depot/projects/newisp/netinet/tcp_syncache.c#2 integrate .. //depot/projects/newisp/netinet/tcp_var.h#4 integrate .. //depot/projects/newisp/netinet6/nd6.c#2 integrate .. //depot/projects/newisp/nfs4client/nfs4_vfsops.c#2 integrate .. //depot/projects/newisp/nfs4client/nfs4_vnops.c#2 integrate .. //depot/projects/newisp/nfsclient/nfs_node.c#2 integrate .. //depot/projects/newisp/nfsclient/nfs_subs.c#2 integrate .. //depot/projects/newisp/nfsclient/nfs_vfsops.c#2 integrate .. //depot/projects/newisp/nfsclient/nfs_vnops.c#2 integrate .. //depot/projects/newisp/nfsclient/nfsnode.h#2 integrate .. //depot/projects/newisp/pci/alpm.c#2 integrate .. //depot/projects/newisp/pci/amdpm.c#2 integrate .. //depot/projects/newisp/pci/amdsmb.c#2 integrate .. //depot/projects/newisp/pci/if_rl.c#2 integrate .. //depot/projects/newisp/pci/if_sf.c#2 integrate .. //depot/projects/newisp/pci/if_sfreg.h#2 integrate .. //depot/projects/newisp/pci/if_sis.c#2 integrate .. //depot/projects/newisp/pci/if_sisreg.h#2 integrate .. //depot/projects/newisp/pci/if_ste.c#2 integrate .. //depot/projects/newisp/pci/if_tl.c#2 integrate .. //depot/projects/newisp/pci/if_tlreg.h#2 integrate .. //depot/projects/newisp/pci/if_vr.c#2 integrate .. //depot/projects/newisp/pci/if_vrreg.h#2 integrate .. //depot/projects/newisp/pci/if_wb.c#2 integrate .. //depot/projects/newisp/pci/if_wbreg.h#2 integrate .. //depot/projects/newisp/pci/if_xl.c#2 integrate .. //depot/projects/newisp/pci/if_xlreg.h#2 integrate .. //depot/projects/newisp/pci/intpm.c#2 integrate .. //depot/projects/newisp/pci/intpmreg.h#2 integrate .. //depot/projects/newisp/pci/nfsmb.c#2 integrate .. //depot/projects/newisp/pci/viapm.c#2 integrate .. //depot/projects/newisp/powerpc/powerpc/trap.c#2 integrate .. //depot/projects/newisp/security/mac/mac_inet.c#2 integrate .. //depot/projects/newisp/security/mac_biba/mac_biba.c#2 integrate .. //depot/projects/newisp/security/mac_lomac/mac_lomac.c#2 integrate .. //depot/projects/newisp/security/mac_mls/mac_mls.c#3 integrate .. //depot/projects/newisp/sys/mac.h#2 integrate .. //depot/projects/newisp/sys/mac_policy.h#3 integrate .. //depot/projects/newisp/sys/mount.h#2 integrate Differences ... ==== //depot/projects/newisp/compat/linux/linux_misc.c#2 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/compat/linux/linux_misc.c,v 1.186 2006/08/25 11:02:42 rwatson Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linux/linux_misc.c,v 1.187 2006/09/16 14:12:04 netchild Exp $"); #include "opt_compat.h" #include "opt_mac.h" @@ -1299,6 +1299,13 @@ #define REBOOT_CAD_ON 0x89abcdef #define REBOOT_CAD_OFF 0 #define REBOOT_HALT 0xcdef0123 +#define REBOOT_RESTART 0x01234567 +#define REBOOT_RESTART2 0xA1B2C3D4 +#define REBOOT_POWEROFF 0x4321FEDC +#define REBOOT_MAGIC1 0xfee1dead +#define REBOOT_MAGIC2 0x28121969 +#define REBOOT_MAGIC2A 0x05121996 +#define REBOOT_MAGIC2B 0x16041998 int linux_reboot(struct thread *td, struct linux_reboot_args *args) @@ -1309,10 +1316,37 @@ if (ldebug(reboot)) printf(ARGS(reboot, "0x%x"), args->cmd); #endif - if (args->cmd == REBOOT_CAD_ON || args->cmd == REBOOT_CAD_OFF) - return (0); - bsd_args.opt = (args->cmd == REBOOT_HALT) ? RB_HALT : 0; - return (reboot(td, &bsd_args)); + + if (args->magic1 != REBOOT_MAGIC1) + return EINVAL; + + switch (args->magic2) { + case REBOOT_MAGIC2: + case REBOOT_MAGIC2A: + case REBOOT_MAGIC2B: + break; + default: + return EINVAL; + } + + switch (args->cmd) { + case REBOOT_CAD_ON: + case REBOOT_CAD_OFF: + return suser(td); + case REBOOT_HALT: + bsd_args.opt = RB_HALT; + break; + case REBOOT_RESTART: + case REBOOT_RESTART2: + bsd_args.opt = 0; + break; + case REBOOT_POWEROFF: + bsd_args.opt = RB_POWEROFF; + break; + default: + return EINVAL; + } + return reboot(td, &bsd_args); } ==== //depot/projects/newisp/contrib/pf/net/pf.c#2 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/contrib/pf/net/pf.c,v 1.40 2005/12/25 23:52:00 mlaier Exp $ */ +/* $FreeBSD: src/sys/contrib/pf/net/pf.c,v 1.41 2006/09/12 04:25:11 csjp Exp $ */ /* $OpenBSD: pf.c,v 1.483 2005/03/15 17:38:43 dhartmei Exp $ */ /* @@ -42,6 +42,7 @@ #endif #ifdef __FreeBSD__ +#include "opt_mac.h" #include "opt_bpf.h" #include "opt_pf.h" @@ -78,6 +79,7 @@ #include #include #ifdef __FreeBSD__ +#include #include #include #else @@ -192,7 +194,12 @@ struct pf_addr *, struct pf_addr *, u_int16_t, u_int16_t *, u_int16_t *, u_int16_t *, u_int16_t *, u_int8_t, sa_family_t); +#ifdef __FreeBSD__ +void pf_send_tcp(struct mbuf *, + const struct pf_rule *, sa_family_t, +#else void pf_send_tcp(const struct pf_rule *, sa_family_t, +#endif const struct pf_addr *, const struct pf_addr *, u_int16_t, u_int16_t, u_int32_t, u_int32_t, u_int8_t, u_int16_t, u_int16_t, u_int8_t, int, @@ -1114,7 +1121,11 @@ cur->local_flags |= PFSTATE_EXPIRING; #endif if (cur->src.state == PF_TCPS_PROXY_DST) +#ifdef __FreeBSD__ + pf_send_tcp(NULL, cur->rule.ptr, cur->af, +#else pf_send_tcp(cur->rule.ptr, cur->af, +#endif &cur->ext.addr, &cur->lan.addr, cur->ext.port, cur->lan.port, cur->src.seqhi, cur->src.seqlo + 1, @@ -1574,7 +1585,11 @@ } void +#ifdef __FreeBSD__ +pf_send_tcp(struct mbuf *replyto, const struct pf_rule *r, sa_family_t af, +#else pf_send_tcp(const struct pf_rule *r, sa_family_t af, +#endif const struct pf_addr *saddr, const struct pf_addr *daddr, u_int16_t sport, u_int16_t dport, u_int32_t seq, u_int32_t ack, u_int8_t flags, u_int16_t win, u_int16_t mss, u_int8_t ttl, int tag, @@ -1613,6 +1628,16 @@ m = m_gethdr(M_DONTWAIT, MT_HEADER); if (m == NULL) return; +#ifdef __FreeBSD__ +#ifdef MAC + if (replyto) + mac_create_mbuf_netlayer(replyto, m); + else + mac_create_mbuf_from_firewall(m); +#else + (void)replyto; +#endif +#endif if (tag) { #ifdef __FreeBSD__ m->m_flags |= M_SKIP_FIREWALL; @@ -3146,7 +3171,11 @@ ack++; if (th->th_flags & TH_FIN) ack++; +#ifdef __FreeBSD__ + pf_send_tcp(m, r, af, pd->dst, +#else pf_send_tcp(r, af, pd->dst, +#endif pd->src, th->th_dport, th->th_sport, ntohl(th->th_ack), ack, TH_RST|TH_ACK, 0, 0, r->return_ttl, 1, pd->eh, kif->pfik_ifp); @@ -3347,7 +3376,11 @@ mss = pf_calc_mss(saddr, af, mss); mss = pf_calc_mss(daddr, af, mss); s->src.mss = mss; +#ifdef __FreeBSD__ + pf_send_tcp(NULL, r, af, daddr, saddr, th->th_dport, +#else pf_send_tcp(r, af, daddr, saddr, th->th_dport, +#endif th->th_sport, s->src.seqhi, ntohl(th->th_seq) + 1, TH_SYN|TH_ACK, 0, s->src.mss, 0, 1, NULL, NULL); REASON_SET(&reason, PFRES_SYNPROXY); @@ -4348,7 +4381,11 @@ REASON_SET(reason, PFRES_SYNPROXY); return (PF_DROP); } +#ifdef __FreeBSD__ + pf_send_tcp(NULL, (*state)->rule.ptr, pd->af, pd->dst, +#else pf_send_tcp((*state)->rule.ptr, pd->af, pd->dst, +#endif pd->src, th->th_dport, th->th_sport, (*state)->src.seqhi, ntohl(th->th_seq) + 1, TH_SYN|TH_ACK, 0, (*state)->src.mss, 0, 1, @@ -4387,7 +4424,12 @@ (*state)->src.max_win = MAX(ntohs(th->th_win), 1); if ((*state)->dst.seqhi == 1) (*state)->dst.seqhi = htonl(arc4random()); +#ifdef __FreeBSD__ + pf_send_tcp(NULL, (*state)->rule.ptr, pd->af, + &src->addr, +#else pf_send_tcp((*state)->rule.ptr, pd->af, &src->addr, +#endif &dst->addr, src->port, dst->port, (*state)->dst.seqhi, 0, TH_SYN, 0, (*state)->src.mss, 0, 0, NULL, NULL); @@ -4401,12 +4443,21 @@ } else { (*state)->dst.max_win = MAX(ntohs(th->th_win), 1); (*state)->dst.seqlo = ntohl(th->th_seq); +#ifdef __FreeBSD__ + pf_send_tcp(NULL, (*state)->rule.ptr, pd->af, pd->dst, +#else pf_send_tcp((*state)->rule.ptr, pd->af, pd->dst, +#endif pd->src, th->th_dport, th->th_sport, ntohl(th->th_ack), ntohl(th->th_seq) + 1, TH_ACK, (*state)->src.max_win, 0, 0, 0, NULL, NULL); +#ifdef __FreeBSD__ + pf_send_tcp(NULL, (*state)->rule.ptr, pd->af, + &src->addr, +#else pf_send_tcp((*state)->rule.ptr, pd->af, &src->addr, +#endif &dst->addr, src->port, dst->port, (*state)->src.seqhi + 1, (*state)->src.seqlo + 1, TH_ACK, (*state)->dst.max_win, 0, 0, 1, @@ -4685,7 +4736,11 @@ (*state)->src.state == TCPS_SYN_SENT) { /* Send RST for state mismatches during handshake */ if (!(th->th_flags & TH_RST)) +#ifdef __FreeBSD__ + pf_send_tcp(m, (*state)->rule.ptr, pd->af, +#else pf_send_tcp((*state)->rule.ptr, pd->af, +#endif pd->dst, pd->src, th->th_dport, th->th_sport, ntohl(th->th_ack), 0, TH_RST, 0, 0, ==== //depot/projects/newisp/crypto/via/padlock_cipher.c#2 (text+ko) ==== @@ -45,7 +45,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/crypto/via/padlock_cipher.c,v 1.4 2006/07/25 20:00:55 pjd Exp $"); +__FBSDID("$FreeBSD: src/sys/crypto/via/padlock_cipher.c,v 1.5 2006/09/15 10:44:55 pjd Exp $"); #include #include @@ -225,7 +225,7 @@ cw->cw_direction = PADLOCK_DIRECTION_ENCRYPT; key = ses->ses_ekey; if ((enccrd->crd_flags & CRD_F_IV_EXPLICIT) != 0) - bcopy(enccrd->crd_iv, ses->ses_iv, 16); + bcopy(enccrd->crd_iv, ses->ses_iv, AES_BLOCK_LEN); if ((enccrd->crd_flags & CRD_F_IV_PRESENT) == 0) { crypto_copyback(crp->crp_flags, crp->crp_buf, @@ -247,7 +247,8 @@ enccrd->crd_len, abuf); } - padlock_cbc(abuf, abuf, enccrd->crd_len / 16, key, cw, ses->ses_iv); + padlock_cbc(abuf, abuf, enccrd->crd_len / AES_BLOCK_LEN, key, cw, + ses->ses_iv); if (allocated) { crypto_copyback(crp->crp_flags, crp->crp_buf, enccrd->crd_skip, ==== //depot/projects/newisp/dev/ata/ata-chipset.c#5 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/ata/ata-chipset.c,v 1.174 2006/09/11 19:48:30 sos Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/ata-chipset.c,v 1.175 2006/09/12 22:06:39 sos Exp $"); #include "opt_ata.h" #include @@ -4869,7 +4869,7 @@ ata_default_registers(dev); for (i = ATA_BMCMD_PORT; i <= ATA_BMDTP_PORT; i++) { ch->r_io[i].res = ctlr->r_res1; - ch->r_io[i].offset = i - ATA_BMCMD_PORT; + ch->r_io[i].offset = (i - ATA_BMCMD_PORT)+(ch->unit * ATA_BMIOSIZE); } ata_pci_hw(dev); } ==== //depot/projects/newisp/dev/ata/ata-disk.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/ata/ata-disk.c,v 1.198 2006/08/09 18:23:47 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/ata-disk.c,v 1.199 2006/09/14 19:12:29 sos Exp $"); #include "opt_ata.h" #include @@ -105,7 +105,8 @@ } device_set_ivars(dev, adp); - if (atadev->param.atavalid & ATA_FLAG_54_58) { + if ((atadev->param.atavalid & ATA_FLAG_54_58) && + atadev->param.current_heads && atadev->param.current_sectors) { adp->heads = atadev->param.current_heads; adp->sectors = atadev->param.current_sectors; adp->total_secs = (u_int32_t)atadev->param.current_size_1 | ==== //depot/projects/newisp/dev/ata/ata-raid.h#2 (text+ko) ==== @@ -23,7 +23,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/ata/ata-raid.h,v 1.44 2006/02/17 13:02:10 sos Exp $ + * $FreeBSD: src/sys/dev/ata/ata-raid.h,v 1.45 2006/09/12 20:37:22 sos Exp $ */ /* misc defines */ @@ -76,7 +76,7 @@ #define AR_F_SII_RAID 0x0800 #define AR_F_SIS_RAID 0x1000 #define AR_F_VIA_RAID 0x2000 -#define AR_F_FORMAT_MASK 0x1fff +#define AR_F_FORMAT_MASK 0x3fff u_int generation; u_int64_t total_sectors; ==== //depot/projects/newisp/dev/bge/if_bge.c#4 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/bge/if_bge.c,v 1.144 2006/09/09 03:36:57 ambrisko Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/bge/if_bge.c,v 1.145 2006/09/15 15:16:10 glebius Exp $"); /* * Broadcom BCM570x family gigabit ethernet driver for FreeBSD. @@ -591,7 +591,7 @@ } if (i == BGE_TIMEOUT) { - if_printf(sc->bge_ifp, "PHY read timed out\n"); + device_printf(sc->bge_dev, "PHY read timed out\n"); val = 0; goto done; } @@ -640,7 +640,7 @@ } if (i == BGE_TIMEOUT) { - if_printf(sc->bge_ifp, "PHY read timed out\n"); + device_printf(sc->bge_dev, "PHY read timed out\n"); return (0); } ==== //depot/projects/newisp/dev/bktr/bktr_i2c.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/bktr/bktr_i2c.c,v 1.27 2005/05/29 04:42:19 nyan Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/bktr/bktr_i2c.c,v 1.28 2006/09/11 20:52:40 jhb Exp $"); /* * I2C support for the bti2c chipset. @@ -119,7 +119,7 @@ return (error); } -int bti2c_smb_callback(device_t dev, int index, caddr_t *data) +int bti2c_smb_callback(device_t dev, int index, void *data) { struct bktr_softc *bktr_sc = (struct bktr_softc *)device_get_softc(dev); struct bktr_i2c_softc *sc = &bktr_sc->i2c_sc; @@ -338,4 +338,6 @@ return (0); } +DRIVER_MODULE(smbus, bktr, smbus_driver, smbus_devclass, 0, 0); + #endif /* defined(BKTR_USE_FREEBSD_SMBUS) */ ==== //depot/projects/newisp/dev/cs/if_cs.c#2 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/cs/if_cs.c,v 1.44 2006/03/10 23:50:53 philip Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/cs/if_cs.c,v 1.45 2006/09/15 15:16:10 glebius Exp $"); /* * @@ -198,7 +198,7 @@ RE_NEG_NOW | ALLOW_FDX | AUTO_NEG_ENABLE); for (i=0; cs_readreg(sc, PP_AutoNegST) & AUTO_NEG_BUSY; i++) { if (i > 40000) { - if_printf(sc->ifp, + device_printf(sc->dev, "full/half duplex auto negotiation timeout\n"); error = ETIMEDOUT; break; @@ -218,7 +218,7 @@ DELAY( 150000 ); if ((cs_readreg(sc, PP_LineST) & LINK_OK)==0) { - if_printf(sc->ifp, "failed to enable TP\n"); + device_printf(sc->dev, "failed to enable TP\n"); return (EINVAL); } @@ -279,7 +279,7 @@ (sc->line_ctl & ~AUTO_AUI_10BASET) | AUI_ONLY); if (!send_test_pkt(sc)) { - if_printf(sc->ifp, "failed to enable AUI\n"); + device_printf(sc->dev, "failed to enable AUI\n"); return (EINVAL); } return (0); @@ -297,7 +297,7 @@ (sc->line_ctl & ~AUTO_AUI_10BASET) | AUI_ONLY); if (!send_test_pkt(sc)) { - if_printf(sc->ifp, "failed to enable BNC\n"); + device_printf(sc->dev, "failed to enable BNC\n"); return (EINVAL); } return (0); @@ -586,6 +586,8 @@ struct cs_softc *sc = device_get_softc(dev);; struct ifnet *ifp; + sc->dev = dev; + ifp = sc->ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { device_printf(dev, "can not if_alloc()\n"); @@ -630,7 +632,7 @@ sc->buffer=malloc(ETHER_MAX_LEN-ETHER_CRC_LEN,M_DEVBUF,M_NOWAIT); if (sc->buffer == NULL) { - if_printf(ifp, "Couldn't allocate memory for NIC\n"); + device_printf(sc->dev, "Couldn't allocate memory for NIC\n"); return(0); } @@ -665,7 +667,7 @@ case A_CNF_MEDIA_10B_2: media = IFM_ETHER|IFM_10_2; break; case A_CNF_MEDIA_AUI: media = IFM_ETHER|IFM_10_5; break; default: - if_printf(ifp, "no media, assuming 10baseT\n"); + device_printf(sc->dev, "no media, assuming 10baseT\n"); sc->adapter_cnf |= A_CNF_10B_T; ifmedia_add(&sc->media, IFM_ETHER|IFM_10_T, 0, NULL); if (sc->chip_type != CS8900) { @@ -799,13 +801,13 @@ length = cs_inw(sc, RX_FRAME_PORT); #ifdef CS_DEBUG - if_printf(ifp, "rcvd: stat %x, len %d\n", + device_printf(sc->dev, "rcvd: stat %x, len %d\n", status, length); #endif if (!(status & RX_OK)) { #ifdef CS_DEBUG - if_printf(ifp, "bad pkt stat %x\n", status); + device_printf(sc->dev, "bad pkt stat %x\n", status); #endif ifp->if_ierrors++; return (-1); @@ -864,13 +866,13 @@ int status; #ifdef CS_DEBUG - if_printf(ifp, "Interrupt.\n"); + device_printf(sc->dev, "Interrupt.\n"); #endif while ((status=cs_inw(sc, ISQ_PORT))) { #ifdef CS_DEBUG - if_printf(ifp, "from ISQ: %04x\n", status); + device_printf(sc->dev, "from ISQ: %04x\n", status); #endif switch (status & ISQ_EVENT_MASK) { @@ -1138,7 +1140,7 @@ int s,error=0; #ifdef CS_DEBUG - if_printf(ifp, "ioctl(%lx)\n", command); + if_printf(ifp, "%s command=%lx\n", __func__, command); #endif s=splimp(); @@ -1266,7 +1268,7 @@ ~(SERIAL_RX_ON | SERIAL_TX_ON)); #ifdef CS_DEBUG - if_printf(sc->ifp, "cs_setmedia(%x)\n", media); + device_printf(sc->dev, "%s media=%x\n", __func__, media); #endif switch (IFM_SUBTYPE(media)) { ==== //depot/projects/newisp/dev/cs/if_csvar.h#2 (text+ko) ==== @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/cs/if_csvar.h,v 1.8 2006/02/11 03:50:03 imp Exp $ + * $FreeBSD: src/sys/dev/cs/if_csvar.h,v 1.9 2006/09/15 15:16:10 glebius Exp $ */ #ifndef _IF_CSVAR_H @@ -37,6 +37,7 @@ struct cs_softc { /* Ethernet common code */ struct ifnet *ifp; + device_t dev; /* Configuration words from EEPROM */ int auto_neg_cnf; /* AutoNegotitation configuration */ ==== //depot/projects/newisp/dev/dc/if_dc.c#2 (text+ko) ==== @@ -31,7 +31,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/dc/if_dc.c,v 1.184 2006/06/08 08:15:21 glebius Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/dc/if_dc.c,v 1.185 2006/09/15 15:16:10 glebius Exp $"); /* * DEC "tulip" clone ethernet driver. Supports the DEC/Intel 21143 @@ -1395,7 +1395,7 @@ } if (i == DC_TIMEOUT) - if_printf(sc->dc_ifp, + device_printf(sc->dc_dev, "failed to force tx and rx to idle state\n"); } @@ -1536,7 +1536,7 @@ } if (i == DC_TIMEOUT) - if_printf(sc->dc_ifp, "reset never completed!\n"); + device_printf(sc->dc_dev, "reset never completed!\n"); /* Wait a little while for the chip to get its brains in order. */ DELAY(1000); @@ -1815,6 +1815,7 @@ u_int8_t *mac; sc = device_get_softc(dev); + sc->dc_dev = dev; mtx_init(&sc->dc_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, MTX_DEF); @@ -2968,13 +2969,13 @@ DELAY(10); } if (i == DC_TIMEOUT) { - if_printf(sc->dc_ifp, + device_printf(sc->dc_dev, "failed to force tx to idle state\n"); dc_init_locked(sc); } } - if_printf(sc->dc_ifp, "TX underrun -- "); + device_printf(sc->dc_dev, "TX underrun -- "); sc->dc_txthresh += DC_TXTHRESH_INC; if (sc->dc_txthresh > DC_TXTHRESH_MAX) { printf("using store and forward mode\n"); @@ -3040,7 +3041,7 @@ dc_tx_underrun(sc); if (status & DC_ISR_BUS_ERR) { - if_printf(ifp, "dc_poll: bus error\n"); + if_printf(ifp, "%s: bus error\n", __func__); dc_reset(sc); dc_init_locked(sc); } @@ -3446,7 +3447,7 @@ /* Init circular RX list. */ if (dc_list_rx_init(sc) == ENOBUFS) { - if_printf(ifp, + device_printf(sc->dc_dev, "initialization failed: no memory for rx buffers\n"); dc_stop(sc); return; ==== //depot/projects/newisp/dev/dc/if_dcreg.h#2 (text+ko) ==== @@ -29,7 +29,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/dc/if_dcreg.h,v 1.51 2006/06/08 08:15:21 glebius Exp $ + * $FreeBSD: src/sys/dev/dc/if_dcreg.h,v 1.52 2006/09/15 15:16:10 glebius Exp $ */ /* @@ -717,6 +717,7 @@ struct dc_softc { struct ifnet *dc_ifp; /* interface info */ + device_t dc_dev; /* device info */ bus_space_handle_t dc_bhandle; /* bus space handle */ bus_space_tag_t dc_btag; /* bus space tag */ bus_dma_tag_t dc_ltag; /* tag for descriptor ring */ ==== //depot/projects/newisp/dev/de/if_de.c#2 (text) ==== @@ -36,7 +36,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/de/if_de.c,v 1.180 2006/05/12 05:04:41 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/de/if_de.c,v 1.181 2006/09/15 15:16:11 glebius Exp $"); #define TULIP_HDR_DATA @@ -436,17 +436,16 @@ static void tulip_media_print(tulip_softc_t * const sc) { - struct ifnet *ifp = sc->tulip_ifp; TULIP_LOCK_ASSERT(sc); if ((sc->tulip_flags & TULIP_LINKUP) == 0) return; if (sc->tulip_flags & TULIP_PRINTMEDIA) { - if_printf(ifp, "enabling %s port\n", - tulip_mediums[sc->tulip_media]); + device_printf(sc->tulip_dev, "enabling %s port\n", + tulip_mediums[sc->tulip_media]); sc->tulip_flags &= ~(TULIP_PRINTMEDIA|TULIP_PRINTLINKUP); } else if (sc->tulip_flags & TULIP_PRINTLINKUP) { - if_printf(ifp, "link up\n"); + device_printf(sc->tulip_dev, "link up\n"); sc->tulip_flags &= ~TULIP_PRINTLINKUP; } } @@ -495,10 +494,9 @@ continue; #if defined(TULIP_DEBUG) - if_printf(ifp, "gpr_media_sense: %s: 0x%02x & 0x%02x == 0x%02x\n", - tulip_mediums[media], - TULIP_CSR_READ(sc, csr_gp) & 0xFF, - mi->mi_actmask, mi->mi_actdata); + device_printf(sc->tulip_dev, "%s: %s: 0x%02x & 0x%02x == 0x%02x\n", + __func__, tulip_mediums[media], TULIP_CSR_READ(sc, csr_gp) & 0xFF, + mi->mi_actmask, mi->mi_actdata); #endif /* * It does! If this is the first media we detected, then @@ -519,7 +517,6 @@ static tulip_link_status_t tulip_media_link_monitor(tulip_softc_t * const sc) { - struct ifnet *ifp = sc->tulip_ifp; const tulip_media_info_t * const mi = sc->tulip_mediums[sc->tulip_media]; tulip_link_status_t linkup = TULIP_LINK_DOWN; @@ -603,7 +600,7 @@ linkup = TULIP_LINK_UP; #if defined(TULIP_DEBUG) if (sc->tulip_probe_timeout <= 0) - if_printf(ifp, "sia status = 0x%08x\n", + device_printf(sc->tulip_dev, "sia status = 0x%08x\n", TULIP_CSR_READ(sc, csr_sia_status)); #endif } else if (mi->mi_type == TULIP_MEDIAINFO_SYM) { @@ -619,7 +616,7 @@ return TULIP_LINK_UP; sc->tulip_flags &= ~TULIP_LINKUP; - if_printf(ifp, "link down: cable problem?\n"); + device_printf(sc->tulip_dev, "link down: cable problem?\n"); } #if defined(TULIP_DEBUG) sc->tulip_dbg.dbg_link_downed++; @@ -630,7 +627,6 @@ static void tulip_media_poll(tulip_softc_t * const sc, tulip_mediapoll_event_t event) { - struct ifnet *ifp = sc->tulip_ifp; TULIP_LOCK_ASSERT(sc); #if defined(TULIP_DEBUG) @@ -751,7 +747,7 @@ if (sc->tulip_probe_timeout > 0) { tulip_media_t new_probe_media = tulip_21140_gpr_media_sense(sc); #if defined(TULIP_DEBUG) - if_printf(ifp, "media_poll: gpr sensing = %s\n", + device_printf(sc->tulip_dev, "%s: gpr sensing = %s\n", __func__, tulip_mediums[new_probe_media]); #endif if (new_probe_media != TULIP_MEDIA_UNKNOWN) { @@ -838,7 +834,7 @@ if (/* event == TULIP_MEDIAPOLL_TXPROBE_FAILED || */ sc->tulip_probe_timeout <= 0) { #if defined(TULIP_DEBUG) if (sc->tulip_probe_media == TULIP_MEDIA_UNKNOWN) { - if_printf(ifp, "poll media unknown!\n"); + device_printf(sc->tulip_dev, "poll media unknown!\n"); sc->tulip_probe_media = TULIP_MEDIA_MAX; } #endif @@ -850,7 +846,8 @@ sc->tulip_probe_media -= 1; if (sc->tulip_probe_media == TULIP_MEDIA_UNKNOWN) { if (++sc->tulip_probe_passes == 3) { - if_printf(ifp, "autosense failed: cable problem?\n"); + device_printf(sc->tulip_dev, + "autosense failed: cable problem?\n"); if ((sc->tulip_ifp->if_flags & IFF_UP) == 0) { sc->tulip_ifp->if_drv_flags &= ~IFF_DRV_RUNNING; sc->tulip_probe_state = TULIP_PROBE_INACTIVE; @@ -866,7 +863,7 @@ || TULIP_IS_MEDIA_FD(sc->tulip_probe_media)); #if defined(TULIP_DEBUG) - if_printf(ifp, "%s: probing %s\n", + device_printf(sc->tulip_dev, "%s: probing %s\n", event == TULIP_MEDIAPOLL_TXPROBE_FAILED ? "txprobe failed" : "timeout", tulip_mediums[sc->tulip_probe_media]); #endif @@ -1194,7 +1191,7 @@ sc->tulip_flags &= ~TULIP_WANTRXACT; sc->tulip_probe_timeout = TULIP_21041_PROBE_AUIBNC_TIMEOUT; } else { - if_printf(sc->tulip_ifp, + device_printf(sc->tulip_dev, "autosense failed: cable problem?\n"); if ((sc->tulip_ifp->if_flags & IFF_UP) == 0) { sc->tulip_ifp->if_drv_flags &= ~IFF_DRV_RUNNING; @@ -1512,7 +1509,7 @@ } #if defined(TULIP_DEBUG) } else { - if_printf(sc->tulip_ifp, "preset: bad media %d!\n", media); + device_printf(sc->tulip_dev, "preset: bad media %d!\n", media); } #endif } @@ -1565,7 +1562,7 @@ sc->tulip_dbg.dbg_events[event]++; #endif #if defined(DIAGNOSTIC) - if_printf(sc->tulip_ifp, "botch(media_poll) at line %d\n", __LINE__); + device_printf(sc->tulip_dev, "botch(media_poll) at line %d\n", __LINE__); #endif } @@ -2300,7 +2297,7 @@ mi->mi_phyaddr = tulip_mii_get_phyaddr(sc, 0); } if (mi->mi_phyaddr == TULIP_MII_NOPHY) { - if_printf(sc->tulip_ifp, "can't find phy 0\n"); + device_printf(sc->tulip_dev, "can't find phy 0\n"); return; } @@ -2553,7 +2550,7 @@ } if (mi->mi_phyaddr == TULIP_MII_NOPHY) { #if defined(TULIP_DEBUG) - if_printf(sc->tulip_ifp, "can't find phy %d\n", + device_printf(sc->tulip_dev, "can't find phy %d\n", phyno); #endif break; @@ -2654,7 +2651,7 @@ } if (mi->mi_phyaddr == TULIP_MII_NOPHY) { #if defined(TULIP_DEBUG) - if_printf(sc->tulip_ifp, "can't find phy %d\n", + device_printf(sc->tulip_dev, "can't find phy %d\n", phyno); #endif break; @@ -3239,7 +3236,7 @@ (*sc->tulip_boardsw->bd_media_select)(sc); #if defined(TULIP_DEBUG) if ((sc->tulip_flags & TULIP_NEEDRESET) == TULIP_NEEDRESET) - if_printf(sc->tulip_ifp, + device_printf(sc->tulip_dev, "tulip_reset: additional reset needed?!?\n"); #endif if (bootverbose) @@ -3466,7 +3463,7 @@ } #if defined(TULIP_VERBOSE) if (error != NULL && (sc->tulip_flags & TULIP_NOMESSAGES) == 0) { - if_printf(sc->tulip_ifp, "receive: %6D: %s\n", + device_printf(sc->tulip_dev, "receive: %6D: %s\n", mtod(ms, u_char *) + 6, ":", error); sc->tulip_flags |= TULIP_NOMESSAGES; @@ -3560,7 +3557,7 @@ error = bus_dmamap_load_mbuf(ri->ri_data_tag, *nextout->di_map, ms, tulip_dma_map_rxbuf, nextout->di_desc, BUS_DMA_NOWAIT); if (error) { - if_printf(sc->tulip_ifp, + device_printf(sc->tulip_dev, "unable to load rx map, error = %d\n", error); panic("tulip_rx_intr"); /* XXX */ } @@ -3649,7 +3646,7 @@ m_freem(m); #if defined(TULIP_DEBUG) } else { - if_printf(sc->tulip_ifp, + device_printf(sc->tulip_dev, "tx_intr: failed to dequeue mbuf?!?\n"); #endif } @@ -3744,7 +3741,7 @@ TULIP_LOCK_ASSERT(sc); csr &= (1 << (sizeof(tulip_status_bits)/sizeof(tulip_status_bits[0]))) - 1; - if_printf(sc->tulip_ifp, "abnormal interrupt:"); + device_printf(sc->tulip_dev, "abnormal interrupt:"); for (sep = " ", mask = 1; mask <= csr; mask <<= 1, msgp++) { if ((csr & mask) && *msgp != NULL) { printf("%s%s", sep, *msgp); @@ -3779,7 +3776,7 @@ if (sc->tulip_flags & TULIP_NOMESSAGES) { sc->tulip_flags |= TULIP_SYSTEMERROR; } else { - if_printf(sc->tulip_ifp, "system error: %s\n", + device_printf(sc->tulip_dev, "system error: %s\n", tulip_system_errors[sc->tulip_last_system_error]); } sc->tulip_flags |= TULIP_NEEDRESET; @@ -3904,7 +3901,7 @@ TULIP_LOCK_ASSERT(sc); #if defined(TULIP_DEBUG) if ((sc->tulip_cmdmode & TULIP_CMD_TXRUN) == 0) { - if_printf(sc->tulip_ifp, "txput%s: tx not running\n", + device_printf(sc->tulip_dev, "txput%s: tx not running\n", (sc->tulip_flags & TULIP_TXPROBE_ACTIVE) ? "(probe)" : ""); sc->tulip_flags |= TULIP_WANTTXSTART; sc->tulip_dbg.dbg_txput_finishes[0]++; @@ -3983,7 +3980,7 @@ segs, &nsegs, BUS_DMA_NOWAIT); } if (error != 0) { - if_printf(sc->tulip_ifp, + device_printf(sc->tulip_dev, "unable to load tx map, error = %d\n", error); #if defined(TULIP_DEBUG) sc->tulip_dbg.dbg_txput_finishes[3]++; @@ -4162,7 +4159,7 @@ #if defined(TULIP_DEBUG) if ((sc->tulip_cmdmode & TULIP_CMD_TXRUN) == 0) { - if_printf(sc->tulip_ifp, "txput_setup: tx not running\n"); + device_printf(sc->tulip_dev, "txput_setup: tx not running\n"); sc->tulip_flags |= TULIP_WANTTXSTART; return; } @@ -4427,7 +4424,7 @@ ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); - if_printf(ifp, "%s%s pass %d.%d%s\n", + device_printf(sc->tulip_dev, "%s%s pass %d.%d%s\n", sc->tulip_boardid, tulip_chipdescs[sc->tulip_chipid], (sc->tulip_revinfo & 0xF0) >> 4, @@ -4789,6 +4786,7 @@ } sc = device_get_softc(dev); >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Sat Sep 16 17:55:36 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6D74916A407; Sat, 16 Sep 2006 17:55:36 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2D17316A412 for ; Sat, 16 Sep 2006 17:55:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id D42E243D5E for ; Sat, 16 Sep 2006 17:55:35 +0000 (GMT) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8GHtZm1081737 for ; Sat, 16 Sep 2006 17:55:35 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8GHtZMM081734 for perforce@freebsd.org; Sat, 16 Sep 2006 17:55:35 GMT (envelope-from hselasky@FreeBSD.org) Date: Sat, 16 Sep 2006 17:55:35 GMT Message-Id: <200609161755.k8GHtZMM081734@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 106215 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Sep 2006 17:55:36 -0000 http://perforce.freebsd.org/chv.cgi?CH=106215 Change 106215 by hselasky@hselasky_mini_itx on 2006/09/16 17:55:29 Undo change 106147 until further, to reduce the number of differences between FreeBSD-7-current and the USB project. Affected files ... .. //depot/projects/usb/src/sys/dev/usb/usb_subr.c#19 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb/usb_subr.c#19 (text+ko) ==== @@ -142,29 +142,29 @@ } } #ifdef USBVERBOSE - if ((vendor == NULL) || (product == NULL)) { + if (vendor == NULL || product == NULL) { for(kdp = usb_knowndevs; kdp->vendorname != NULL; kdp++) { - if ((kdp->vendor == UGETW(udd->idVendor)) && - ((kdp->product == UGETW(udd->idProduct)) || - (kdp->flags & USB_KNOWNDEV_NOPROD))) + if (kdp->vendor == UGETW(udd->idVendor) && + (kdp->product == UGETW(udd->idProduct) || + (kdp->flags & USB_KNOWNDEV_NOPROD) != 0)) break; } if (kdp->vendorname != NULL) { if (vendor == NULL) vendor = kdp->vendorname; if (product == NULL) - product = ((kdp->flags & USB_KNOWNDEV_NOPROD) == 0) ? + product = (kdp->flags & USB_KNOWNDEV_NOPROD) == 0 ? kdp->productname : NULL; } } #endif - if ((vendor != NULL) && *vendor) + if (vendor != NULL && *vendor) strcpy(v, vendor); else sprintf(v, "vendor 0x%04x", UGETW(udd->idVendor)); - if ((product != NULL) && *product) + if (product != NULL && *product) strcpy(p, product); else sprintf(p, "product 0x%04x", UGETW(udd->idProduct)); From owner-p4-projects@FreeBSD.ORG Sat Sep 16 18:36:26 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8FD9016A412; Sat, 16 Sep 2006 18:36:26 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 66BFA16A407 for ; Sat, 16 Sep 2006 18:36:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1027243D45 for ; Sat, 16 Sep 2006 18:36:26 +0000 (GMT) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8GIaQRQ086108 for ; Sat, 16 Sep 2006 18:36:26 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8GIaPee086105 for perforce@freebsd.org; Sat, 16 Sep 2006 18:36:25 GMT (envelope-from hselasky@FreeBSD.org) Date: Sat, 16 Sep 2006 18:36:25 GMT Message-Id: <200609161836.k8GIaPee086105@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 106216 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Sep 2006 18:36:26 -0000 http://perforce.freebsd.org/chv.cgi?CH=106216 Change 106216 by hselasky@hselasky_mini_itx on 2006/09/16 18:35:25 Make "ums" use the new USB-cdev API. This saves some code. Also parenthesis two unclear expressions, where "complement" and "and" was involved. Affected files ... .. //depot/projects/usb/src/sys/dev/usb/ums.c#12 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb/ums.c#12 (text+ko) ==== @@ -84,12 +84,10 @@ #define UMS_BUT(i) ((i) < 3 ? (((i) + 2) % 3) : (i)) struct ums_softc { + struct usb_cdev sc_cdev; struct mtx sc_mtx; - struct usbd_ifqueue sc_rdq_free; - struct usbd_ifqueue sc_rdq_used; struct __callout sc_callout; struct usbd_memory_wait sc_mem_wait; - struct selinfo sc_read_sel; struct hid_location sc_loc_x; struct hid_location sc_loc_y; struct hid_location sc_loc_z; @@ -100,8 +98,6 @@ mousestatus_t sc_status; struct usbd_xfer * sc_xfer[UMS_N_TRANSFER]; - void * sc_mem_ptr_1; - struct cdev * sc_cdev_1; u_int32_t sc_flags; #define UMS_FLAG_X_AXIS 0x0001 @@ -109,31 +105,41 @@ #define UMS_FLAG_Z_AXIS 0x0004 #define UMS_FLAG_T_AXIS 0x0008 #define UMS_FLAG_SBU 0x0010 /* spurious button up events */ -#define UMS_FLAG_SELECT 0x0020 /* select is waiting */ -#define UMS_FLAG_INTR_STALL 0x0040 /* set if transfer error */ -#define UMS_FLAG_GONE 0x0080 /* device is gone */ -#define UMS_FLAG_RD_WUP 0x0100 /* device is waiting for wakeup */ -#define UMS_FLAG_RD_SLP 0x0200 /* device is sleeping */ -#define UMS_FLAG_CLOSING 0x0400 /* device is closing */ -#define UMS_FLAG_DEV_OPEN 0x0800 /* device is open */ +#define UMS_FLAG_INTR_STALL 0x0020 /* set if transfer error */ u_int8_t sc_buttons; u_int8_t sc_iid; - u_int8_t sc_wakeup_read; /* dummy */ - u_int8_t sc_wakeup_sync_1; /* dummy */ }; +static void +ums_put_queue_timeout(void *__sc); + +static void +ums_clear_stall_callback(struct usbd_xfer *xfer); + +static void +ums_intr_callback(struct usbd_xfer *xfer); + static device_probe_t ums_probe; static device_attach_t ums_attach; static device_detach_t ums_detach; -static d_close_t ums_close; + +static void +ums_start_read(struct usb_cdev *cdev); + +static void +ums_stop_read(struct usb_cdev *cdev); +static int32_t +ums_open(struct usb_cdev *cdev, int32_t fflags, + int32_t devtype, struct thread *td); +static int32_t +ums_ioctl(struct usb_cdev *cdev, u_long cmd, caddr_t addr, + int32_t fflags, struct thread *td); static void ums_put_queue(struct ums_softc *sc, int32_t dx, int32_t dy, int32_t dz, int32_t dt, int32_t buttons); -extern cdevsw_t ums_cdevsw; - static void ums_put_queue_timeout(void *__sc) { @@ -283,7 +289,7 @@ if (sc->sc_flags & UMS_FLAG_INTR_STALL) { usbd_transfer_start(sc->sc_xfer[1]); } else { - USBD_IF_POLL(&sc->sc_rdq_free, m); + USBD_IF_POLL(&(sc->sc_cdev.sc_rdq_free), m); if (m) { usbd_start_hardware(xfer); @@ -366,18 +372,17 @@ struct usb_attach_arg *uaa = device_get_ivars(dev); struct ums_softc *sc = device_get_softc(dev); void *d_ptr = NULL; + const char * p_buf[2]; int32_t unit = device_get_unit(dev); int32_t d_len; int32_t isize; u_int32_t flags; - usbd_status err; + int32_t err; u_int8_t i; + char buf_1[16]; DPRINTF(10, "sc=%p\n", sc); - sc->sc_rdq_free.ifq_maxlen = UMS_IFQ_MAXLEN; - sc->sc_rdq_used.ifq_maxlen = UMS_IFQ_MAXLEN; - usbd_set_desc(dev, uaa->device); mtx_init(&(sc->sc_mtx), "ums lock", NULL, MTX_DEF|MTX_RECURSE); @@ -385,14 +390,6 @@ __callout_init_mtx(&(sc->sc_callout), &(sc->sc_mtx), CALLOUT_RETURNUNLOCKED); - sc->sc_mem_ptr_1 = - usbd_alloc_mbufs(M_DEVBUF, &(sc->sc_rdq_free), - UMS_BUF_SIZE, UMS_IFQ_MAXLEN); - - if (sc->sc_mem_ptr_1 == NULL) { - goto detach; - } - err = usbd_transfer_setup(uaa->device, uaa->iface_index, sc->sc_xfer, ums_config, UMS_N_TRANSFER, sc, &(sc->sc_mtx), &(sc->sc_mem_wait)); @@ -481,6 +478,7 @@ } free(d_ptr, M_TEMP); + d_ptr = NULL; #ifdef USB_DEBUG DPRINTF(0, "sc=%p\n", sc); @@ -522,11 +520,25 @@ sc->sc_status.dy = 0; sc->sc_status.dz = 0; - sc->sc_cdev_1 = make_dev - (&ums_cdevsw, unit, UID_ROOT, GID_OPERATOR, 0644, "ums%d", unit); + snprintf(buf_1, sizeof(buf_1), "ums%d", unit); + + p_buf[0] = buf_1; + p_buf[1] = NULL; + + sc->sc_cdev.sc_start_read = &ums_start_read; + sc->sc_cdev.sc_stop_read = &ums_stop_read; + sc->sc_cdev.sc_open = &ums_open; + sc->sc_cdev.sc_ioctl = &ums_ioctl; + sc->sc_cdev.sc_flags |= (USB_CDEV_FLAG_FWD_SHORT| + USB_CDEV_FLAG_WAKEUP_RD_IMMED| + USB_CDEV_FLAG_WAKEUP_WR_IMMED); - if (sc->sc_cdev_1) { - DEV2SC(sc->sc_cdev_1) = sc; + err = usb_cdev_attach(&(sc->sc_cdev), sc, &(sc->sc_mtx), p_buf, + UID_ROOT, GID_OPERATOR, 0644, + UMS_BUF_SIZE, UMS_IFQ_MAXLEN, + 1, 1 /* dummy write buffer */); + if (err) { + goto detach; } return 0; @@ -546,31 +558,10 @@ DPRINTF(0, "sc=%p\n", sc); - mtx_lock(&(sc->sc_mtx)); - sc->sc_flags |= UMS_FLAG_GONE; - mtx_unlock(&(sc->sc_mtx)); - - if (sc->sc_cdev_1) { - - ums_close(sc->sc_cdev_1, 0, 0, 0); - - DEV2SC(sc->sc_cdev_1) = NULL; - - destroy_dev(sc->sc_cdev_1); - } - - mtx_lock(&(sc->sc_mtx)); - - __callout_stop(&(sc->sc_callout)); + usb_cdev_detach(&(sc->sc_cdev)); - mtx_unlock(&(sc->sc_mtx)); - usbd_transfer_unsetup(sc->sc_xfer, UMS_N_TRANSFER); - if (sc->sc_mem_ptr_1) { - free(sc->sc_mem_ptr_1, M_DEVBUF); - } - usbd_transfer_drain(&(sc->sc_mem_wait), &(sc->sc_mtx)); __callout_drain(&(sc->sc_callout)); @@ -580,6 +571,25 @@ return 0; } +static void +ums_start_read(struct usb_cdev *cdev) +{ + struct ums_softc *sc = cdev->sc_priv_ptr; + usbd_transfer_start(sc->sc_xfer[0]); + return; +} + +static void +ums_stop_read(struct usb_cdev *cdev) +{ + struct ums_softc *sc = cdev->sc_priv_ptr; + usbd_transfer_stop(sc->sc_xfer[1]); + usbd_transfer_stop(sc->sc_xfer[0]); + __callout_stop(&(sc->sc_callout)); + return; +} + + #if ((MOUSE_SYS_PACKETSIZE != 8) || \ (MOUSE_MSC_PACKETSIZE != 5)) #error "Software assumptions are not met. Please update code." @@ -589,14 +599,10 @@ ums_put_queue(struct ums_softc *sc, int32_t dx, int32_t dy, int32_t dz, int32_t dt, int32_t buttons) { - struct usbd_mbuf *m; - u_int8_t *buf; + u_int8_t buf[8]; - USBD_IF_DEQUEUE(&sc->sc_rdq_free, m); + if (1) { - if (m) { - USBD_MBUF_RESET(m); - if (dx > 254) dx = 254; if (dx < -256) dx = -256; if (dy > 254) dy = 254; @@ -606,11 +612,8 @@ if (dt > 126) dt = 126; if (dt < -128) dt = -128; - buf = m->cur_data_ptr; - m->cur_data_len = sc->sc_mode.packetsize; - buf[0] = sc->sc_mode.syncmask[1]; - buf[0] |= ~buttons & MOUSE_MSC_BUTTONS; + buf[0] |= (~buttons) & MOUSE_MSC_BUTTONS; buf[1] = dx >> 1; buf[2] = dy >> 1; buf[3] = dx - (dx >> 1); @@ -619,21 +622,12 @@ if (sc->sc_mode.level == 1) { buf[5] = dz >> 1; buf[6] = dz - (dz >> 1); - buf[7] = ((~buttons >> 3) & MOUSE_SYS_EXTBUTTONS); + buf[7] = (((~buttons) >> 3) & MOUSE_SYS_EXTBUTTONS); } - USBD_IF_ENQUEUE(&(sc->sc_rdq_used), m); - - if (sc->sc_flags & UMS_FLAG_RD_WUP) { - sc->sc_flags &= ~UMS_FLAG_RD_WUP; - wakeup(&(sc->sc_wakeup_read)); - } + usb_cdev_put_data(&(sc->sc_cdev), buf, + sc->sc_mode.packetsize, 1); - if (sc->sc_flags & UMS_FLAG_SELECT) { - sc->sc_flags &= ~UMS_FLAG_SELECT; - selwakeup(&(sc->sc_read_sel)); - } - } else { DPRINTF(0, "Buffer full, discarded packet\n"); } @@ -641,47 +635,6 @@ return; } -static int -ums_uiomove(struct ums_softc *sc, u_int32_t context_bit, - void *cp, int n, struct uio *uio) -{ - int error; - - sc->sc_flags |= context_bit; - - mtx_unlock(&(sc->sc_mtx)); - - error = uiomove(cp, n, uio); - - mtx_lock(&(sc->sc_mtx)); - - sc->sc_flags &= ~context_bit; - - if (sc->sc_flags & UMS_FLAG_CLOSING) { - wakeup(&(sc->sc_wakeup_sync_1)); - error = EINTR; - } - return error; -} - -static int -ums_msleep(struct ums_softc *sc, u_int32_t context_bit, void *ident) -{ - int error; - - sc->sc_flags |= context_bit; - - error = msleep(ident, &(sc->sc_mtx), PRIBIO|PCATCH, "ums_sleep", 0); - - sc->sc_flags &= ~context_bit; - - if (sc->sc_flags & UMS_FLAG_CLOSING) { - wakeup(&(sc->sc_wakeup_sync_1)); - error = EINTR; - } - return error; -} - static void ums_reset_buf(struct ums_softc *sc) { @@ -690,10 +643,10 @@ /* reset read queue */ while(1) { - USBD_IF_DEQUEUE(&(sc->sc_rdq_used), m); + USBD_IF_DEQUEUE(&(sc->sc_cdev.sc_rdq_used), m); if (m) { - USBD_IF_ENQUEUE(&(sc->sc_rdq_free), m); + USBD_IF_ENQUEUE(&(sc->sc_cdev.sc_rdq_free), m); } else { break; } @@ -701,32 +654,14 @@ return; } -static int -ums_open(struct cdev *dev, int flag, int fmt, struct thread *td) +static int32_t +ums_open(struct usb_cdev *cdev, int32_t fflags, + int32_t devtype, struct thread *td) { - struct ums_softc *sc = DEV2SC(dev); - int error = 0; + struct ums_softc *sc = cdev->sc_priv_ptr; DPRINTF(1, "\n"); - if (sc == NULL) { - return EIO; - } - - mtx_lock(&(sc->sc_mtx)); - - /* check flags */ - - if (sc->sc_flags & - (UMS_FLAG_DEV_OPEN|UMS_FLAG_GONE)) { - error = EBUSY; - goto done; - } - - /* reset buffer */ - - ums_reset_buf(sc); - /* reset status */ sc->sc_status.flags = 0; @@ -737,215 +672,19 @@ sc->sc_status.dz = 0; /* sc->sc_status.dt = 0; */ - /* start interrupt transfer */ - - usbd_transfer_start(sc->sc_xfer[0]); - - sc->sc_flags |= UMS_FLAG_DEV_OPEN; - - done: - mtx_unlock(&(sc->sc_mtx)); - - return error; -} - -static int -ums_close(struct cdev *dev, int flag, int fmt, struct thread *td) -{ - struct ums_softc *sc = DEV2SC(dev); - int error; - - DPRINTF(1, "\n"); - - if (sc == NULL) { - return EIO; - } - - mtx_lock(&(sc->sc_mtx)); - - if (sc->sc_flags & UMS_FLAG_CLOSING) { - goto done; - } - - if (sc->sc_flags & UMS_FLAG_DEV_OPEN) { - - sc->sc_flags |= UMS_FLAG_CLOSING; - - /* stop transfers */ - - if (sc->sc_xfer[0]) { - usbd_transfer_stop(sc->sc_xfer[0]); - } - - if (sc->sc_xfer[1]) { - usbd_transfer_stop(sc->sc_xfer[1]); - } - - /* stop callout */ - - __callout_stop(&(sc->sc_callout)); - - while (sc->sc_flags & - (UMS_FLAG_RD_SLP|UMS_FLAG_RD_WUP)) { - - if (sc->sc_flags & UMS_FLAG_RD_WUP) { - sc->sc_flags &= ~UMS_FLAG_RD_WUP; - wakeup(&(sc->sc_wakeup_read)); - } - - error = msleep(&(sc->sc_wakeup_sync_1), &(sc->sc_mtx), - PRIBIO, "ums_sync_1", 0); - } - - if (sc->sc_flags & UMS_FLAG_SELECT) { - sc->sc_flags &= ~UMS_FLAG_SELECT; - selwakeup(&(sc->sc_read_sel)); - } - - sc->sc_flags &= ~(UMS_FLAG_DEV_OPEN| - UMS_FLAG_CLOSING); - } - - done: - mtx_unlock(&(sc->sc_mtx)); - - DPRINTF(0, "closed\n"); - return 0; } -static int -ums_read(struct cdev *dev, struct uio *uio, int flag) +static int32_t +ums_ioctl(struct usb_cdev *cdev, u_long cmd, caddr_t addr, + int32_t fflags, struct thread *td) { - struct ums_softc *sc = DEV2SC(dev); - struct usbd_mbuf *m; - int error = 0; - int io_len; - - if (sc == NULL) { - return EIO; - } - - DPRINTF(1, "\n"); - - mtx_lock(&(sc->sc_mtx)); - - if (sc->sc_flags & (UMS_FLAG_CLOSING|UMS_FLAG_GONE| - UMS_FLAG_RD_SLP)) { - error = EIO; - goto done; - } - - while (uio->uio_resid) { - - USBD_IF_DEQUEUE(&(sc->sc_rdq_used), m); - - if (m == NULL) { - - /* start reader thread */ - - usbd_transfer_start(sc->sc_xfer[0]); - - if (flag & O_NONBLOCK) { - error = EWOULDBLOCK; - goto done; - } - - error = ums_msleep(sc, (UMS_FLAG_RD_SLP|UMS_FLAG_RD_WUP), - &(sc->sc_wakeup_read)); - if (error) { - break; - } else { - continue; - } - } - - io_len = min(m->cur_data_len, uio->uio_resid); - - DPRINTF(1, "transfer %d bytes from %p\n", - io_len, m->cur_data_ptr); - - error = ums_uiomove(sc, UMS_FLAG_RD_SLP, m->cur_data_ptr, - io_len, uio); - - m->cur_data_len -= io_len; - m->cur_data_ptr += io_len; - - if (m->cur_data_len == 0) { - USBD_IF_ENQUEUE(&sc->sc_rdq_free, m); - } else { - USBD_IF_PREPEND(&sc->sc_rdq_used, m); - } - - if (error) { - break; - } - } - - done: - mtx_unlock(&(sc->sc_mtx)); - - return error; -} - -static int -ums_poll(struct cdev *dev, int events, struct thread *td) -{ - struct ums_softc *sc = DEV2SC(dev); - struct usbd_mbuf *m; - int32_t revents = 0; - - if (sc == NULL) { - return POLLNVAL; - } - - DPRINTF(1, "\n"); - - mtx_lock(&(sc->sc_mtx)); - - if (sc->sc_flags & (UMS_FLAG_CLOSING|UMS_FLAG_GONE)) { - revents = POLLNVAL; - goto done; - } - - if (events & (POLLIN | POLLRDNORM)) { - - USBD_IF_POLL(&(sc->sc_rdq_used), m); - - if (m) { - revents = events & (POLLIN | POLLRDNORM); - } else { - sc->sc_flags |= UMS_FLAG_SELECT; - selrecord(td, &(sc->sc_read_sel)); - } - } - - done: - mtx_unlock(&(sc->sc_mtx)); - - return revents; -} - -static int -ums_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td) -{ - struct ums_softc *sc = DEV2SC(dev); + struct ums_softc *sc = cdev->sc_priv_ptr; mousemode_t mode; int error = 0; - if (sc == NULL) { - return EIO; - } - DPRINTF(1, "\n"); - mtx_lock(&(sc->sc_mtx)); - - if (sc->sc_flags & (UMS_FLAG_CLOSING|UMS_FLAG_GONE)) { - error = EIO; - goto done; - } - switch(cmd) { case MOUSE_GETHWINFO: *(mousehw_t *)addr = sc->sc_hw; @@ -1048,21 +787,9 @@ } done: - mtx_unlock(&(sc->sc_mtx)); - return error; } -cdevsw_t ums_cdevsw = { - .d_version = D_VERSION, - .d_open = ums_open, - .d_close = ums_close, - .d_read = ums_read, - .d_ioctl = ums_ioctl, - .d_poll = ums_poll, - .d_name = "ums", -}; - static devclass_t ums_devclass; static device_method_t ums_methods[] = { From owner-p4-projects@FreeBSD.ORG Sat Sep 16 20:12:34 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1C10216A4B3; Sat, 16 Sep 2006 20:12:34 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C28B116A47E for ; Sat, 16 Sep 2006 20:12:33 +0000 (UTC) (envelope-from mjacob@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0A6FE43D5C for ; Sat, 16 Sep 2006 20:12:29 +0000 (GMT) (envelope-from mjacob@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8GKCT40093150 for ; Sat, 16 Sep 2006 20:12:29 GMT (envelope-from mjacob@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8GKCT9Z093147 for perforce@freebsd.org; Sat, 16 Sep 2006 20:12:29 GMT (envelope-from mjacob@freebsd.org) Date: Sat, 16 Sep 2006 20:12:29 GMT Message-Id: <200609162012.k8GKCT9Z093147@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to mjacob@freebsd.org using -f From: Matt Jacob To: Perforce Change Reviews Cc: Subject: PERFORCE change 106221 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Sep 2006 20:12:34 -0000 http://perforce.freebsd.org/chv.cgi?CH=106221 Change 106221 by mjacob@newisp on 2006/09/16 20:12:26 Add a slightly tighter interpretation of 'loop down' such that we have a 'quick boot' time limit (loop down count when we're booting) and a 'running' time limit (loop down count when we've seen loop up once). Affected files ... .. //depot/projects/newisp/dev/isp/isp_freebsd.c#7 edit .. //depot/projects/newisp/dev/isp/isp_freebsd.h#5 edit .. //depot/projects/newisp/dev/isp/isp_library.c#6 edit Differences ... ==== //depot/projects/newisp/dev/isp/isp_freebsd.c#7 (text+ko) ==== @@ -45,6 +45,7 @@ int isp_announced = 0; int isp_fabric_hysteresis = 5; int isp_loop_down_limit = 300; /* default loop down limit */ +int isp_quickboot_time = 5; /* don't wait more than N secs for loop up */ static d_ioctl_t ispioctl; static void isp_intr_enable(void *); @@ -2083,12 +2084,33 @@ isp_prt(isp, ISP_LOGDEBUG0, "kthread: checking FC state"); lb = isp_fc_runstate(isp, 250000); - isp->isp_osinfo.ktmature = 1; if (lb) { unsigned int inc = 1; - isp_prt(isp, ISP_LOGDEBUG0, "kthread: FC state %d", lb); - if (isp->isp_osinfo.loop_down_time > 30) { + if (lb < 0) { + isp_prt(isp, ISP_LOGDEBUG0, + "kthread: FC loop not up (down count %d)", + isp->isp_osinfo.loop_down_time); + } else { + isp_prt(isp, ISP_LOGDEBUG0, + "kthread: FC got to %d (down count %d)", + lb, isp->isp_osinfo.loop_down_time); + } + + + /* + * If we've never seen loop up and we've waited longer + * than quickboot time, give up and go to sleep until + * loop comes up. Otherwise, increment the loop down + * time and figure out how long to sleep to the next + * check. + */ + if (FCPARAM(isp)->loop_seen_once == 0 && + isp->isp_osinfo.loop_down_time >= + isp_quickboot_time) { + isp->isp_osinfo.loop_down_time = 0xffff; + slp = 0; + } else if (isp->isp_osinfo.loop_down_time > 30) { inc = 30; slp = 30 * hz; } else if (isp->isp_osinfo.loop_down_time > 1) { @@ -2235,14 +2257,10 @@ */ KASSERT((IS_FC(isp)), ("CMD_RQLATER for FC only")); /* - * If we've never seen loop up and we've at least - * looked once, just fail these commands. Also, - * if we've exceeded the loop down limit- fail them - * as well. + * If we've exceeded the loop down limit start + * failing commands. */ - if ((FCPARAM(isp)->loop_seen_once == 0 && - isp->isp_osinfo.ktmature) || - isp->isp_osinfo.loop_down_time > + if (isp->isp_osinfo.loop_down_time > isp->isp_osinfo.loop_down_limit) { ISPLOCK_2_CAMLOCK(isp); XS_SETERR(ccb, CAM_SEL_TIMEOUT); ==== //depot/projects/newisp/dev/isp/isp_freebsd.h#5 (text+ko) ==== @@ -156,7 +156,7 @@ hysteresis : 8, disabled : 1, fcbsy : 1, - ktmature : 1, + : 1, mboxwaiting : 1, intsok : 1, simqfrozen : 3; @@ -433,6 +433,7 @@ extern int isp_announced; extern int isp_fabric_hysteresis; extern int isp_loop_down_limit; +extern int isp_quickboot_time; /* * Platform private flags ==== //depot/projects/newisp/dev/isp/isp_library.c#6 (text) ==== @@ -193,10 +193,6 @@ fcparam *fcp; int *tptr; - if (IS_SCSI(isp)) { - isp_prt(isp, ISP_LOGERR, "isp_fc_runstate for SCSI card?"); - return (-1); - } fcp = FCPARAM(isp); tptr = &tval; if (fcp->isp_fwstate < FW_READY || @@ -215,16 +211,16 @@ } if (isp_control(isp, ISPCTL_SCAN_LOOP, NULL) != 0) { isp_prt(isp, ISP_LOGINFO, "isp_fc_runstate: scan loop fails"); - return (-1); + return (LOOP_PDB_RCVD); } if (isp_control(isp, ISPCTL_SCAN_FABRIC, NULL) != 0) { isp_prt(isp, ISP_LOGINFO, "isp_fc_runstate: scan fabric fails"); - return (-1); + return (LOOP_LSCAN_DONE); } if (isp_control(isp, ISPCTL_PDB_SYNC, NULL) != 0) { isp_prt(isp, ISP_LOGINFO, "isp_fc_runstate: pdb_sync fails"); - return (-1); + return (LOOP_FSCAN_DONE); } if (fcp->isp_fwstate != FW_READY || fcp->isp_loopstate != LOOP_READY) { isp_prt(isp, ISP_LOGINFO,