From owner-freebsd-drivers@FreeBSD.ORG Fri Sep 13 09:24:37 2013 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3F1FE731; Fri, 13 Sep 2013 09:24:37 +0000 (UTC) (envelope-from matthias@petermann-it.de) Received: from mail.s1.d2ux.org (static.209.96.9.5.clients.your-server.de [5.9.96.209]) by mx1.freebsd.org (Postfix) with ESMTP id F061F2421; Fri, 13 Sep 2013 09:24:36 +0000 (UTC) Received: from mail.s1.d2ux.org (mail [10.0.0.3]) by mail.s1.d2ux.org (Postfix) with ESMTP id 6B35884F25BB; Fri, 13 Sep 2013 11:24:29 +0200 (CEST) Received: from mail.s1.d2ux.org ([10.0.0.3]) by mail.s1.d2ux.org (mail.s1.d2ux.org [10.0.0.3]) (amavisd-new, port 10024) with ESMTP id yvTqF3FFwrxm; Fri, 13 Sep 2013 11:24:27 +0200 (CEST) Received: from www.s1.d2ux.org (unknown [10.0.0.4]) by mail.s1.d2ux.org (Postfix) with ESMTP id 764A284F2586; Fri, 13 Sep 2013 11:24:27 +0200 (CEST) Received: from 188.92.33.52 ([188.92.33.52]) by d2ux.org (Horde Framework) with HTTP; Fri, 13 Sep 2013 11:24:27 +0200 Date: Fri, 13 Sep 2013 11:24:27 +0200 Message-ID: <20130913112427.Horde.Lr2e32AbzvcQIrrWuDh-dg1@d2ux.org> From: Matthias Petermann To: freebsd-current@freebsd.org Subject: Centrino Wireless N2230 support User-Agent: Internet Messaging Program (IMP) H5 (6.1.3) Content-Type: text/plain; charset=UTF-8; format=flowed; DelSp=Yes MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: 8bit Cc: freebsd-wireless@freebsd.org, freebsd-drivers@freebsd.org X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2013 09:24:37 -0000 Hello, there was some recent discussion[1] on freebsd-wireless and freebsd-drivers about Centrino Wireless N2230[2] support in FreeBSD. I would be curious if there is a working patch somewhere available which builds against 10-current? Thanks in advance & kind regards, Matthias [1] http://lists.freebsd.org/pipermail/freebsd-drivers/2013-July/001570.html [2] http://www.intel.de/content/www/de/de/wireless-products/centrino-wireless-n-2230.html -- Matthias Petermann Ihr Partner für anspruchsvolle IT-Lösungen www.petermann-it.de - lösungsorientiert, innovativ und erfolgreich From owner-freebsd-drivers@FreeBSD.ORG Fri Sep 13 09:34:55 2013 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id CBA70C43; Fri, 13 Sep 2013 09:34:55 +0000 (UTC) (envelope-from cg@cgross.info) Received: from alpha.kreiz-it.fr (alpha.kreiz-it.fr [IPv6:2001:41d0:8:dda6::1]) by mx1.freebsd.org (Postfix) with ESMTP id 9206F24CF; Fri, 13 Sep 2013 09:34:55 +0000 (UTC) Received: from DirTech (lnr56-1-82-246-51-185.fbx.proxad.net [82.246.51.185]) by alpha.kreiz-it.fr (Postfix) with ESMTPSA id CDCF6877; Fri, 13 Sep 2013 11:34:53 +0200 (CEST) From: "Cedric GROSS" To: "'Matthias Petermann'" References: <20130913112427.Horde.Lr2e32AbzvcQIrrWuDh-dg1@d2ux.org> In-Reply-To: <20130913112427.Horde.Lr2e32AbzvcQIrrWuDh-dg1@d2ux.org> Subject: RE: Centrino Wireless N2230 support Date: Fri, 13 Sep 2013 11:34:50 +0200 Message-ID: <001e01ceb064$80168220$80438660$@info> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Ac6wYx57eIffdn5TS+mBCYe2mFppYAAAH5nw Content-Language: fr Cc: freebsd-wireless@freebsd.org, freebsd-drivers@freebsd.org, freebsd-current@freebsd.org X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2013 09:34:55 -0000 Hello, > De : owner-freebsd-drivers@freebsd.org [mailto:owner-freebsd- > drivers@freebsd.org] De la part de Matthias Petermann > Envoy=C3=A9 : vendredi 13 septembre 2013 11:24 > =C3=80 : freebsd-current@freebsd.org > Cc : freebsd-wireless@freebsd.org; freebsd-drivers@freebsd.org > Objet : Centrino Wireless N2230 support >=20 >=20 > Hello, >=20 > there was some recent discussion[1] on freebsd-wireless and freebsd- > drivers about Centrino Wireless N2230[2] support in FreeBSD. >=20 > I would be curious if there is a working patch somewhere available > which builds against 10-current? >=20 Not against 10-current. But if you wish, you could test with my version on github = https://github.com/KreizIT/FreeBSD-IWN Use LKGV branch, should be running with 10-current. Cedric From owner-freebsd-drivers@FreeBSD.ORG Fri Sep 13 15:26:17 2013 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 99F12A29; Fri, 13 Sep 2013 15:26:17 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 729292937; Fri, 13 Sep 2013 15:26:17 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 7FA92B982; Fri, 13 Sep 2013 11:26:16 -0400 (EDT) From: John Baldwin To: freebsd-drivers@freebsd.org Subject: Re: WOL with msk(4) driver Date: Fri, 13 Sep 2013 10:56:54 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201309131056.54507.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 13 Sep 2013 11:26:16 -0400 (EDT) Cc: Zucchetti , yongari@freebsd.org X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2013 15:26:17 -0000 On Thursday, September 05, 2013 5:44:20 pm Zucchetti wrote: > Hello Everybody, > > The FreeBSD Forum Administrator > *DutchDaemon*told me today > I should send an email here regarding this: > > http://forums.freebsd.org/showpost.php?p=231918&postcount=6 > > hope you will enjoy it. yongari@FreeBSD.org maintains the msk(4) driver (or has done the most work on it recently at least). I'm not sure he is on this list, but I do think he is on net@ where most network driver questions are asked. I've cc'd him in case he is interested in your patches. I believe he has worked on WOL for other NICs. -- John Baldwin From owner-freebsd-drivers@FreeBSD.ORG Sat Sep 14 18:09:07 2013 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 592155F7 for ; Sat, 14 Sep 2013 18:09:07 +0000 (UTC) (envelope-from lnrdpss@gmail.com) Received: from mail-vc0-x230.google.com (mail-vc0-x230.google.com [IPv6:2607:f8b0:400c:c03::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1B32C225E for ; Sat, 14 Sep 2013 18:09:07 +0000 (UTC) Received: by mail-vc0-f176.google.com with SMTP id lf11so1831759vcb.7 for ; Sat, 14 Sep 2013 11:09:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=4vXgSw+M1KKHxNIT0nm6KlTVCYak3HNY3d7bt81Z4ww=; b=FV7pDrZHhPKauvwOOBppHIWX0xVqU4j2oUtbZzQdfz1j+Xq1n5iG3vujzqKny/btDl Hon1zNU3q7devFgwkyW0BwYr7+A7LS6oOURuwaYC99jtd8Iv1u+FMNWUG3j32zBFpb/R YLwCrS2PwtHeTecw8lWgDbrWeLxClXNBTcpINB4yPHvvckjD7byxumQdezGDkhdlhlr8 V7PinnoM37aBfrrdXkBr3z/lfTW2e2RtwopwPVEZDNj3x+DivCa6Z6+0YKtRsstD4qJe BQnUPm2C/UwKBNZu/8Mz7xpA2kNTCRTxyxtQA1XA1oT2pYoDqf1R+uAghTuek+uyPO/C RlMQ== MIME-Version: 1.0 X-Received: by 10.52.232.165 with SMTP id tp5mr15168554vdc.11.1379182146189; Sat, 14 Sep 2013 11:09:06 -0700 (PDT) Received: by 10.221.17.130 with HTTP; Sat, 14 Sep 2013 11:09:06 -0700 (PDT) Date: Sat, 14 Sep 2013 14:09:06 -0400 Message-ID: Subject: Device hierarchy From: Leonardo Passos To: freebsd-drivers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Sep 2013 18:09:07 -0000 Hi all, I am checking some code from the FreeBSD repository, and I came across a situation that I could not explain, at least from the existing documentation. Looking at sys/dev/ata/ata-raid.c in the 9.1 release, I see the following module declaration (line 4616): static moduledata_t ata_raid_moduledata = { "ataraid", ata_raid_module_event_handler, NULL }; DECLARE_MODULE(ata, ata_raid_moduledata, SI_SUB_RAID, SI_ORDER_FIRST); MODULE_VERSION(ataraid, 1); MODULE_DEPEND(ataraid, ata, 1, 1, 1); MODULE_DEPEND(ataraid, ad, 1, 1, 1); The name of the module, as specified in DECLARE_MODULE, is ata, but the name provided in the moduledata_t instance is "ataraid". According to the documentation of DECLARE_MODULE, the name field in the structure instance (2nd parameter) is the official module name. So, it is correct to assume that passing "ata" as the first parameter in DECLARE_MODULE is an error, as it does not match "ataraid", or is it the case that such name is a "don't care" field, as FreeBSD takes the name as given by the moduledata_t instance? Another weird situation appears in sys/dev/ata-isa.c (line 201): static driver_t ata_isa_driver = { "ata", ata_isa_methods, sizeof(struct ata_channel), }; DRIVER_MODULE(ata, isa, ata_isa_driver, ata_devclass, 0, 0); MODULE_DEPEND(ata, ata, 1, 1, 1); Here, the driver module name is set to "ata", and later, it is stated that ata depends on ata. Is the dependency referring to another ata module, at a different level in the driver stacking? How are these names and dependencies resolved? Thanks, Leonardo. From owner-freebsd-drivers@FreeBSD.ORG Sat Sep 14 18:25:38 2013 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 99B8D7E9 for ; Sat, 14 Sep 2013 18:25:38 +0000 (UTC) (envelope-from jmg@h2.funkthat.com) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7A0122337 for ; Sat, 14 Sep 2013 18:25:38 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id r8EIPbET043120 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 14 Sep 2013 11:25:37 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id r8EIPbad043119; Sat, 14 Sep 2013 11:25:37 -0700 (PDT) (envelope-from jmg) Date: Sat, 14 Sep 2013 11:25:37 -0700 From: John-Mark Gurney To: Leonardo Passos Subject: Re: Device hierarchy Message-ID: <20130914182537.GZ68682@funkthat.com> Mail-Followup-To: Leonardo Passos , freebsd-drivers@freebsd.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Sat, 14 Sep 2013 11:25:37 -0700 (PDT) Cc: freebsd-drivers@freebsd.org X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Sep 2013 18:25:38 -0000 Leonardo Passos wrote this message on Sat, Sep 14, 2013 at 14:09 -0400: > Hi all, > > I am checking some code from the FreeBSD repository, and I came across a > situation that I could not explain, at least from the existing > documentation. > > Looking at sys/dev/ata/ata-raid.c in the 9.1 release, I see the following > module declaration (line 4616): > > static moduledata_t ata_raid_moduledata = > { "ataraid", ata_raid_module_event_handler, NULL }; > DECLARE_MODULE(ata, ata_raid_moduledata, SI_SUB_RAID, SI_ORDER_FIRST); > MODULE_VERSION(ataraid, 1); > MODULE_DEPEND(ataraid, ata, 1, 1, 1); > MODULE_DEPEND(ataraid, ad, 1, 1, 1); Read below, it looks like DECLARE_MODULE's name is the same: #define DECLARE_MODULE_WITH_MAXVER(name, data, sub, order, maxver) \ MODULE_DEPEND(name, kernel, __FreeBSD_version, \ __FreeBSD_version, maxver); \ MODULE_METADATA(_md_##name, MDT_MODULE, &data, #name); \ SYSINIT(name##module, sub, order, module_register_init, &data); \ struct __hack #define DECLARE_MODULE(name, data, sub, order) \ DECLARE_MODULE_WITH_MAXVER(name, data, sub, order, MODULE_KERNEL_MAXVER) and the first arg to SYSINIT is uniquifier... > Another weird situation appears in sys/dev/ata-isa.c (line 201): > > static driver_t ata_isa_driver = { > "ata", > ata_isa_methods, > sizeof(struct ata_channel), > }; > > DRIVER_MODULE(ata, isa, ata_isa_driver, ata_devclass, 0, 0); > MODULE_DEPEND(ata, ata, 1, 1, 1); > > Here, the driver module name is set to "ata", and later, it is stated that > ata depends on ata. Is the dependency referring to another ata module, at a > different level in the driver stacking? How are these names and > dependencies resolved? Here, MODULE_DEPEND should probably be: MODULE_DEPEND(isa/ata, ata, 1, 1, 1); but I'm not sure how that would/will work... Here DRIVER_MODULE does something special and names the module w/ the bus/name instead of just the first one, and why if you run kldstat -v, you'll see something like: 45 isa/ata in the output... But after looking at the MODULE_DEPEND, what really matters is that the first arg is unique per file since the macro only uses it to name symbols: #define MODULE_METADATA(uniquifier, type, data, cval) \ static struct mod_metadata _mod_metadata##uniquifier = { \ MDT_STRUCT_VERSION, \ type, \ data, \ cval \ }; \ DATA_SET(modmetadata_set, _mod_metadata##uniquifier) #define MODULE_DEPEND(module, mdepend, vmin, vpref, vmax) \ static struct mod_depend _##module##_depend_on_##mdepend = { \ vmin, \ vpref, \ vmax \ }; \ MODULE_METADATA(_md_##module##_on_##mdepend, MDT_DEPEND, \ &_##module##_depend_on_##mdepend, #mdepend) So, adding the slash is probably not useful... It should probably be made clear in MODULE_DEPEND that name is only used to uniquify the symbols and have no useful info... Maybe we should switch to using __LINE__ instead, and make name option/unused? We should probably change the first arg for MODULE_DEPEND and DECLARE_MODULE to be like SYSINIT's and name them uniquifier.. P.S. The macros I pasted came from sys/module.h. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-freebsd-drivers@FreeBSD.ORG Sat Sep 14 23:30:00 2013 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id F28859BE for ; Sat, 14 Sep 2013 23:29:59 +0000 (UTC) (envelope-from lnrdpss@gmail.com) Received: from mail-ve0-x22e.google.com (mail-ve0-x22e.google.com [IPv6:2607:f8b0:400c:c01::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B2B722176 for ; Sat, 14 Sep 2013 23:29:59 +0000 (UTC) Received: by mail-ve0-f174.google.com with SMTP id jy13so1989799veb.5 for ; Sat, 14 Sep 2013 16:29:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=n03JH7YtbFCYj92qLatPUN5hrWLA1pZVohnAsgLKXjc=; b=xoTosJ1UD/djw0WlAKGGakPHlxNcP0NhtW6JzDgzWiDE1NYjDrh5BYLW4vkgciDsZB /Nph3U5hfaygUCUT9ZvwYRdn6MjiBHghCreo3GZKfNbgWyTwDfg+vWRBwoYsLFgZDy6Y y7E7LQD+sx8KqQOl4V+IbuJV9B6KObHP94xKk0fXKE6YkF17pQgRmOXc9SJYJfCJiFdi uz33RSsb7yF6YVCkRpAzFuCKX7aV2JXyxpXs8yoLP/1ryXJv4NO/+dNLMXbUYa+07C3A KZhsbWA10/YlaXJ5bp6ANoG1yi6XTF7ge20yomN9rXIp9ZW3nAF6Bqe6FNufSprusvAA 6RAQ== MIME-Version: 1.0 X-Received: by 10.52.227.6 with SMTP id rw6mr16194368vdc.19.1379201398673; Sat, 14 Sep 2013 16:29:58 -0700 (PDT) Received: by 10.221.17.130 with HTTP; Sat, 14 Sep 2013 16:29:58 -0700 (PDT) In-Reply-To: <20130914182537.GZ68682@funkthat.com> References: <20130914182537.GZ68682@funkthat.com> Date: Sat, 14 Sep 2013 19:29:58 -0400 Message-ID: Subject: Re: Device hierarchy From: Leonardo Passos To: freebsd-drivers@freebsd.org, jmg@funkthat.com Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Sep 2013 23:30:00 -0000 Thanks John-Mark. That was very insightful :) On Sat, Sep 14, 2013 at 2:25 PM, John-Mark Gurney wrote: > Leonardo Passos wrote this message on Sat, Sep 14, 2013 at 14:09 -0400: > > Hi all, > > > > I am checking some code from the FreeBSD repository, and I came across a > > situation that I could not explain, at least from the existing > > documentation. > > > > Looking at sys/dev/ata/ata-raid.c in the 9.1 release, I see the following > > module declaration (line 4616): > > > > static moduledata_t ata_raid_moduledata = > > { "ataraid", ata_raid_module_event_handler, NULL }; > > DECLARE_MODULE(ata, ata_raid_moduledata, SI_SUB_RAID, SI_ORDER_FIRST); > > MODULE_VERSION(ataraid, 1); > > MODULE_DEPEND(ataraid, ata, 1, 1, 1); > > MODULE_DEPEND(ataraid, ad, 1, 1, 1); > > Read below, it looks like DECLARE_MODULE's name is the same: > #define DECLARE_MODULE_WITH_MAXVER(name, data, sub, order, maxver) \ > MODULE_DEPEND(name, kernel, __FreeBSD_version, \ > __FreeBSD_version, maxver); \ > MODULE_METADATA(_md_##name, MDT_MODULE, &data, #name); \ > SYSINIT(name##module, sub, order, module_register_init, &data); \ > struct __hack > > #define DECLARE_MODULE(name, data, sub, order) \ > DECLARE_MODULE_WITH_MAXVER(name, data, sub, order, > MODULE_KERNEL_MAXVER) > > and the first arg to SYSINIT is uniquifier... > > > Another weird situation appears in sys/dev/ata-isa.c (line 201): > > > > static driver_t ata_isa_driver = { > > "ata", > > ata_isa_methods, > > sizeof(struct ata_channel), > > }; > > > > DRIVER_MODULE(ata, isa, ata_isa_driver, ata_devclass, 0, 0); > > MODULE_DEPEND(ata, ata, 1, 1, 1); > > > > Here, the driver module name is set to "ata", and later, it is stated > that > > ata depends on ata. Is the dependency referring to another ata module, > at a > > different level in the driver stacking? How are these names and > > dependencies resolved? > > Here, MODULE_DEPEND should probably be: > MODULE_DEPEND(isa/ata, ata, 1, 1, 1); > > but I'm not sure how that would/will work... Here DRIVER_MODULE does > something special and names the module w/ the bus/name instead of just > the first one, and why if you run kldstat -v, you'll see something like: > 45 isa/ata > > in the output... But after looking at the MODULE_DEPEND, what really > matters is that the first arg is unique per file since the macro only > uses it to name symbols: > #define MODULE_METADATA(uniquifier, type, data, cval) \ > static struct mod_metadata _mod_metadata##uniquifier = { \ > MDT_STRUCT_VERSION, \ > type, \ > data, \ > cval \ > }; \ > DATA_SET(modmetadata_set, _mod_metadata##uniquifier) > > #define MODULE_DEPEND(module, mdepend, vmin, vpref, vmax) \ > static struct mod_depend _##module##_depend_on_##mdepend = { \ > vmin, \ > vpref, \ > vmax \ > }; \ > MODULE_METADATA(_md_##module##_on_##mdepend, MDT_DEPEND, \ > &_##module##_depend_on_##mdepend, #mdepend) > > > So, adding the slash is probably not useful... It should probably be > made clear in MODULE_DEPEND that name is only used to uniquify the > symbols and have no useful info... Maybe we should switch to using > __LINE__ instead, and make name option/unused? > > We should probably change the first arg for MODULE_DEPEND and > DECLARE_MODULE to be like SYSINIT's and name them uniquifier.. > > P.S. The macros I pasted came from sys/module.h. > > -- > John-Mark Gurney Voice: +1 415 225 5579 > > "All that I will do, has been done, All that I have, has not." >