From owner-freebsd-drivers@FreeBSD.ORG Mon Dec 19 13:34:55 2005 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1CF6016A41F for ; Mon, 19 Dec 2005 13:34:55 +0000 (GMT) (envelope-from hide_yama@jcom.home.ne.jp) Received: from smtp22.m2.home.ne.jp (smtp22.m2.home.ne.jp [220.152.32.145]) by mx1.FreeBSD.org (Postfix) with ESMTP id 44F5343D46 for ; Mon, 19 Dec 2005 13:34:53 +0000 (GMT) (envelope-from hide_yama@jcom.home.ne.jp) Received: from CJ3087924A ([210.20.46.222]) by smtp22.m2.home.ne.jp with SMTP id <20051219133452.XQFH21991.smtp22.m2.home.ne.jp@CJ3087924A> for ; Mon, 19 Dec 2005 22:34:52 +0900 From: "hide_yama" To: Date: Mon, 19 Dec 2005 22:34:44 +0900 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 Subject: Close never called. (Open same device file from 2 Apps.) X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Dec 2005 13:34:55 -0000 Hi everybody Now, I'm writing device driver on 5.4R. But it doesn't act that I unexpected. So, if you know the reason and the avoidance, please tell to me. Work is as follows. 1) Open device file "/dev/mypci" by App1. This App1 just calls open routine and sleep for a while in it's program. 2) Open and close the same device file by App2 befor App1 is expired. App2 calls just open and close routines in it's program. I expect that App2 calls open and close routines, however App2 just calls open, doesn't call close. Why isn't the close routine called? And are there any avoidance for this problem? Thanks. --- Chaki [test driver] ----(/usr/srs/sys/dev/mypci/mypci.c start)---- #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* Function prototypes */ static d_open_t mypci_open; static d_close_t mypci_close; static d_read_t mypci_read; static d_write_t mypci_write; static d_ioctl_t mypci_ioctl; /* Character device entry points */ static struct cdevsw mypci_cdevsw = { .d_version = D_VERSION, .d_flags = D_NEEDGIANT, .d_open = mypci_open, .d_close = mypci_close, .d_read = mypci_read, .d_write = mypci_write, .d_ioctl = mypci_ioctl, .d_name = "mypci", }; static int mypci_open(struct cdev *dev, int flags, int fmt, struct thread *td) { int err = 0; printf("Opened device \"mypci\" successfully.\n"); return 0; } static int mypci_close(struct cdev *dev, int flags, int fmt, struct thread *td) { int err = 0; printf("Closing device \"mypci.\"\n"); return 0; } static int mypci_read(struct cdev *dev, struct uio *uio, int ioflag) { int err = 0; printf("mypci read!\n"); return 0; } static int mypci_write(struct cdev *dev, struct uio *uio, int ioflag) { int err = 0; printf("mypci write!\n"); return 0; } static int mypci_probe(device_t dev) { return (0); } static int mypci_attach(device_t dev) { make_dev(&mypci_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "mypci"); printf("mypci device loaded.\n"); return (0); } static int mypci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags, struct thread *td) { printf("mypci ioctl!\n"); return (0); } static device_method_t mypci_methods[] = { DEVMETHOD(device_probe, mypci_probe), DEVMETHOD(device_attach, mypci_attach), { 0, 0 } }; static driver_t mypci_driver = { "mypci", mypci_methods, 0, }; static devclass_t mypci_devclass; DRIVER_MODULE(mypci, pci, mypci_driver, mypci_devclass, 0, 0); ----(/usr/srs/sys/dev/mypci/mypci.c end)---- [test driver Makefile] ----(/usr/srs/sys/modules/mypci/Makefile start)---- .PATH: ${.CURDIR}/../../dev/mypci SRCS= bus_if.h device_if.h pci_if.h mypci.c KMOD= mypci .include ----(/usr/srs/sys/modules/mypci/Makefile end)---- [App1] ----(/tmp/App1.c start)---- #include #include #include #include #include #include int main(void) { int fd; if ((fd = open("/dev/mypci", O_RDWR)) < 0){ printf("open error\n"); return -1; } printf("open OK\n"); sleep(100000); return 0; } ----(/tmp/App1.c end)---- [App2] ----(/tmp/App2.c start)---- #include #include #include #include #include #include int main(void) { int fd; int ret; if ((fd = open("/dev/mypci", O_RDWR)) < 0){ printf("open error = %d\n", errno); return -1; } printf("open OK\n"); if ((ret = close(fd)) < 0){ printf("close errno = %d\n", errno); return -1; } printf("close OK\n"); return 0; } ----(/tmp/App2.c end)---- From owner-freebsd-drivers@FreeBSD.ORG Mon Dec 19 15:58:08 2005 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 361D216A41F for ; Mon, 19 Dec 2005 15:58:08 +0000 (GMT) (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 C5BD643D45 for ; Mon, 19 Dec 2005 15:58:07 +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.3/8.13.3) with ESMTP id jBJFuaR4008202; Mon, 19 Dec 2005 08:56:37 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Mon, 19 Dec 2005 08:57:07 -0700 (MST) Message-Id: <20051219.085707.00459236.imp@bsdimp.com> To: hide_yama@jcom.home.ne.jp From: "M. Warner Losh" In-Reply-To: References: X-Mailer: Mew version 3.3 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]); Mon, 19 Dec 2005 08:56:37 -0700 (MST) Cc: freebsd-drivers@freebsd.org Subject: Re: Close never called. (Open same device file from 2 Apps.) X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Dec 2005 15:58:08 -0000 In message: "hide_yama" writes: : Hi everybody : : Now, I'm writing device driver on 5.4R. But it doesn't act that I : unexpected. : So, if you know the reason and the avoidance, please tell to me. : Work is as follows. : : 1) Open device file "/dev/mypci" by App1. : This App1 just calls open routine and sleep for a while in it's program. : : 2) Open and close the same device file by App2 befor App1 is expired. : App2 calls just open and close routines in it's program. : : I expect that App2 calls open and close routines, however App2 just calls : open, doesn't call close. : : Why isn't the close routine called? Because close is only called on the last close. : And are there any avoidance for this problem? D_TRACKCLOSE in d_flags will change the behavior. Warner From owner-freebsd-drivers@FreeBSD.ORG Tue Dec 20 02:43:49 2005 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C213516A41F for ; Tue, 20 Dec 2005 02:43:49 +0000 (GMT) (envelope-from sashan@endace.com) Received: from www.endace.com (endace.smrn.com [209.234.97.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id 321F743D55 for ; Tue, 20 Dec 2005 02:43:49 +0000 (GMT) (envelope-from sashan@endace.com) Received: from et.endace.com (203-97-51-114.dsl.clear.net.nz [203.97.51.114]) by www.endace.com (8.13.4/8.12.10) with ESMTP id jBK2hm8T036202 for ; Mon, 19 Dec 2005 18:43:48 -0800 (PST) Received: from [192.168.64.125] (orpheus.et.endace.com [192.168.64.125]) by et.endace.com (8.13.5/8.12.11) with ESMTP id jBK2hgR5091965 for ; Tue, 20 Dec 2005 15:43:42 +1300 (NZDT) Message-ID: <43A76FF9.5020402@endace.com> Date: Tue, 20 Dec 2005 15:44:09 +1300 From: sashan User-Agent: Mail/News 1.5 (X11/20051201) MIME-Version: 1.0 To: freebsd-drivers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version devel-20051115, clamav-milter version devel-300905 on www.endace.com X-Virus-Scanned: ClamAV 0.87.1/1213/Tue Dec 20 03:48:34 2005 on et.endace.com X-Virus-Status: Clean Subject: undefined symbols (how to export symobls) X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Dec 2005 02:43:49 -0000 Hi I'm trying get kernel module B to find a function/symbol S defined in kernel module A. Currently whenever B trys to use S it fails with link_elf: symbol undefined I've tried adding EXPORT_SYMS = S to the Makefile. A is loaded. I'm using 5.4-RELEASE. Thanks for the help. From owner-freebsd-drivers@FreeBSD.ORG Tue Dec 20 04:58:06 2005 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1324716A41F for ; Tue, 20 Dec 2005 04:58:06 +0000 (GMT) (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 63EC943D60 for ; Tue, 20 Dec 2005 04:58:05 +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.3/8.13.3) with ESMTP id jBK4tmJD013670; Mon, 19 Dec 2005 21:55:48 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Mon, 19 Dec 2005 21:56:27 -0700 (MST) Message-Id: <20051219.215627.122939537.imp@bsdimp.com> To: sashan@endace.com From: "M. Warner Losh" In-Reply-To: <43A76FF9.5020402@endace.com> References: <43A76FF9.5020402@endace.com> X-Mailer: Mew version 3.3 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]); Mon, 19 Dec 2005 21:55:48 -0700 (MST) Cc: freebsd-drivers@freebsd.org Subject: Re: undefined symbols (how to export symobls) X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Dec 2005 04:58:06 -0000 In message: <43A76FF9.5020402@endace.com> sashan writes: : Hi : : I'm trying get kernel module B to find a function/symbol S defined in : kernel module A. Currently whenever B trys to use S it fails with : : link_elf: symbol undefined : : I've tried adding EXPORT_SYMS = S to the Makefile. : : A is loaded. : : I'm using 5.4-RELEASE. MODULE_DEPEND is what you need: MODULE_DEPEND(ed, miibus, 1, 1, 1); Warner From owner-freebsd-drivers@FreeBSD.ORG Tue Dec 20 13:37:24 2005 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5CF3716A41F for ; Tue, 20 Dec 2005 13:37:24 +0000 (GMT) (envelope-from hide_yama@jcom.home.ne.jp) Received: from smtp21.m2.home.ne.jp (smtp21.m2.home.ne.jp [220.152.32.143]) by mx1.FreeBSD.org (Postfix) with ESMTP id C95A643D6A for ; Tue, 20 Dec 2005 13:37:17 +0000 (GMT) (envelope-from hide_yama@jcom.home.ne.jp) Received: from CJ3087924A ([210.20.46.222]) by smtp21.m2.home.ne.jp with SMTP id <20051220133715.DIMW21885.smtp21.m2.home.ne.jp@CJ3087924A> for ; Tue, 20 Dec 2005 22:37:15 +0900 From: "hide_yama" To: Date: Tue, 20 Dec 2005 22:37:08 +0900 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 In-Reply-To: <20051219.085707.00459236.imp@bsdimp.com> Importance: Normal Subject: RE: Close never called. (Open same device file from 2 Apps.) X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Dec 2005 13:37:24 -0000 I am most grateful to you. I add flag like as follows. static struct cdevsw mypci_cdevsw = { .d_version = D_VERSION, .d_flags = D_NEEDGIANT|D_TRACKCLOSE, ^^^^^^^^^^^^^^ .d_open = mypci_open, .d_close = mypci_close, .d_read = mypci_read, .d_write = mypci_write, .d_ioctl = mypci_ioctl, .d_name = "mypci", }; Then the program runs as I expected. Close routine has called!!! Thanks a lot!!!!! --- Chaki > : Why isn't the close routine called? > > Because close is only called on the last close. > > : And are there any avoidance for this problem? > > D_TRACKCLOSE in d_flags will change the behavior. > > Warner From owner-freebsd-drivers@FreeBSD.ORG Wed Dec 21 13:45:34 2005 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3295E16A423 for ; Wed, 21 Dec 2005 13:45:34 +0000 (GMT) (envelope-from new.folder@email.it) Received: from smtp-out2.email.it (smtp-out2.email.it [80.247.70.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id 903E443D64 for ; Wed, 21 Dec 2005 13:45:32 +0000 (GMT) (envelope-from new.folder@email.it) Received: from 151.100.8.60 (unknown [80.247.70.11]) by smtp-out2.email.it (Email.it) with ESMTP id 4B5C61BCF44 for ; Wed, 21 Dec 2005 14:45:35 +0100 (CET) Received: from Email-mailer ([151.100.8.60]) by 151.100.8.60 with HTTP (Wmail); Wed, 21 Dec 2005 14:45:34 +0100 Date: Wed, 21 Dec 2005 14:45:34 +0100 To: freebsd-drivers@freebsd.org From: new.folder@email.it Message-ID: <4594988015c0429a430ba92fc05ecfa2@151.100.8.60> X-Priority: X-Mailer: Webmail-Email.it [Mailer version 1.70] X-SenderIP: 151.100.8.60 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="iso-8859-1" X-Mailman-Approved-At: Wed, 21 Dec 2005 13:52:33 +0000 Subject: Accessing driver members X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: new.folder@email.it List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Dec 2005 13:45:34 -0000 Hi, I would like to know what's the better way to access to a device member form kernelspace. For example, I can use a ioctl from userspace but, since the functions are all static I can't access nicely from kernel space (and using ioctl(2) in the kernel is not a great idea...). Thanks in advance, Mario Fiorani -- Email.it, the professional e-mail, gratis per te: http://www.email.it/f Sponsor: L'auto dei tuoi sogni? Findomestic ti offre finanziamenti chiari e semplici senza anticipi! clicca qui Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=3937&d=20051221 From owner-freebsd-drivers@FreeBSD.ORG Wed Dec 21 17:13:24 2005 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 559C716A41F for ; Wed, 21 Dec 2005 17:13:24 +0000 (GMT) (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 886D143D6D for ; Wed, 21 Dec 2005 17:13:22 +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.3/8.13.3) with ESMTP id jBLHC9it039211; Wed, 21 Dec 2005 10:12:10 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Wed, 21 Dec 2005 10:12:09 -0700 (MST) Message-Id: <20051221.101209.78745726.imp@bsdimp.com> To: new.folder@email.it From: Warner Losh In-Reply-To: <4594988015c0429a430ba92fc05ecfa2@151.100.8.60> References: <4594988015c0429a430ba92fc05ecfa2@151.100.8.60> X-Mailer: Mew version 3.3 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, 21 Dec 2005 10:12:10 -0700 (MST) Cc: freebsd-drivers@freebsd.org Subject: Re: Accessing driver members X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Dec 2005 17:13:24 -0000 > I would like to know what's the better way to access to a device member form > kernelspace. For example, I can use a ioctl from userspace but, since the > functions are all static I can't access nicely from kernel space (and using > ioctl(2) in the kernel is not a great idea...). You have one device driver that wants to access another device driver's private parts? If so, there are only a few ways to deal with this: (1) Make the drivers friends. Let one driver know about the private parts of the other driver and provide secret public functions for that other driver to use (you can firewall the information leak by using modules and MODULE_DEPEND). This is simple, but scales poorly and is thought by many to be ugly. (2) Use a kobj interface for the two devices to talk to one another. This tends to be a better interface in that it is more flexible. I use this when I have one module that measures something in the kernel controlling a different module based on those measurements to meet a soft real-time specification (and also to give a level of overkill that made management happy given their flawed knowledge about how certain things worked). Warner From owner-freebsd-drivers@FreeBSD.ORG Thu Dec 22 22:30:47 2005 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1601716A41F for ; Thu, 22 Dec 2005 22:30:47 +0000 (GMT) (envelope-from joao.barros@gmail.com) Received: from xproxy.gmail.com (xproxy.gmail.com [66.249.82.192]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9E3F643D45 for ; Thu, 22 Dec 2005 22:30:46 +0000 (GMT) (envelope-from joao.barros@gmail.com) Received: by xproxy.gmail.com with SMTP id t12so359540wxc for ; Thu, 22 Dec 2005 14:30:45 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=kH4IMS92QatXZNu+Hq6es1uToliVOh1M8x/RQTDE8BHyxXVCXKF8oUqFyNrbMUNXdqzVhm01cs1YMD+SSA6P/hN3KwnGIHfcGbbJD/HDwpP62SMo5hPG7Ts9zf1GoIsdecfEQ9yQiEqa41Am5vpsbl8tUJjv2h/BYjnXu0ak+Qg= Received: by 10.70.17.1 with SMTP id 1mr2543366wxq; Thu, 22 Dec 2005 14:30:45 -0800 (PST) Received: by 10.70.36.7 with HTTP; Thu, 22 Dec 2005 14:30:45 -0800 (PST) Message-ID: <70e8236f0512221430l4acc087er84b2a1a27293c48e@mail.gmail.com> Date: Thu, 22 Dec 2005 22:30:45 +0000 From: Joao Barros To: freebsd-drivers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Subject: Kernel device load order/dependency X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Dec 2005 22:30:47 -0000 Hi, How can I make a pseudo device load before another device or even better make one depend on the load of another. I'm importing the raid management framework from OpenBSD and the driver is loading/unloading fine but I need it to load before amr and ciss. -- Joao Barros From owner-freebsd-drivers@FreeBSD.ORG Fri Dec 23 13:53:49 2005 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BF5D016A428 for ; Fri, 23 Dec 2005 13:53:49 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (mail6.speedfactory.net [66.23.216.219]) by mx1.FreeBSD.org (Postfix) with ESMTP id F1C0A43D79 for ; Fri, 23 Dec 2005 13:53:46 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.5b3) with ESMTP id 4424122 for multiple; Fri, 23 Dec 2005 08:55:28 -0500 Received: from zion.baldwin.cx (zion.baldwin.cx [192.168.0.7]) (authenticated bits=0) by server.baldwin.cx (8.13.4/8.13.4) with ESMTP id jBNDrieK042551; Fri, 23 Dec 2005 08:53:44 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-drivers@freebsd.org Date: Fri, 23 Dec 2005 08:53:41 -0500 User-Agent: KMail/1.8.3 References: <70e8236f0512221430l4acc087er84b2a1a27293c48e@mail.gmail.com> In-Reply-To: <70e8236f0512221430l4acc087er84b2a1a27293c48e@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200512230853.42492.jhb@freebsd.org> X-Virus-Scanned: ClamAV version 0.87.1, clamav-milter version 0.87 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.4 required=4.2 tests=ALL_TRUSTED autolearn=failed version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on server.baldwin.cx X-Server: High Performance Mail Server - http://surgemail.com r=1653887525 Cc: Subject: Re: Kernel device load order/dependency X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Dec 2005 13:53:49 -0000 On Thursday 22 December 2005 05:30 pm, Joao Barros wrote: > Hi, > > How can I make a pseudo device load before another device or even > better make one depend on the load of another. > I'm importing the raid management framework from OpenBSD and the > driver is loading/unloading fine but I need it to load before amr and > ciss. Use MODULE_DEPEND to have the drivers depend on your module. =2D-=20 John Baldwin =A0<>< =A0http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" =A0=3D =A0http://www.FreeBSD.org