From owner-freebsd-arch Tue Oct 24 7:39:21 2000 Delivered-To: freebsd-arch@freebsd.org Received: from shidahara1.planet.sci.kobe-u.ac.jp (shidahara1.planet.sci.kobe-u.ac.jp [133.30.50.200]) by hub.freebsd.org (Postfix) with ESMTP id C3D9937B4C5; Tue, 24 Oct 2000 07:39:16 -0700 (PDT) Received: from shidahara1.planet.sci.kobe-u.ac.jp (localhost [127.0.0.1]) by shidahara1.planet.sci.kobe-u.ac.jp (8.9.3/8.9.3) with ESMTP id XAA58776; Tue, 24 Oct 2000 23:38:12 +0900 (JST) (envelope-from takawata@shidahara1.planet.sci.kobe-u.ac.jp) Message-Id: <200010241438.XAA58776@shidahara1.planet.sci.kobe-u.ac.jp> To: imp@freebsd.org, arch@freebsd.org Subject: NEWCARD/OLDCARD compatibility layer Date: Tue, 24 Oct 2000 23:38:12 +0900 From: Takanori Watanabe Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi, I looked card_if.m and I think there is a problem:If there is a system that have neither OLDCARD or NEWCARD layer, module-ifyed driver that uses NEWCARD/OLDCARD compatibility layer mechanism cannot load because pccard_compat_probe/pccard_compat_attach is not exist. How about this change? And ,in child driver side, PCCARD_COMPAT_LAYER should be defined to use pccard_compat_* function before including "card_if.h". With this change kernel can be compiled.(I don't know wherther it collectly work or not.) Takanori Watanabe Public Key Key fingerprint = 2C 51 E2 78 2C E1 C5 2D 0F F1 20 A3 11 3A 62 2A --- card_if.m.org Wed Sep 20 14:24:23 2000 +++ card_if.m Tue Oct 24 23:21:01 2000 @@ -143,6 +143,34 @@ # # Drivers wishing to not retain OLDCARD compatibility needn't do this. # + +#These Function is defined in bus code + +METHOD int compatsubr_probe{ + device_t parent; + device_t dev; +}; + +METHOD int compatsubr_attach{ + device_t parent; + device_t dev; +}; + +HEADER{ + #ifdef PCCARD_COMPAT_LAYER + static int pccard_compat_probe(device_t); + static int pccard_compat_attach(device_t); + static int pccard_compat_probe(device_t dev) + { + return CARD_COMPATSUBR_PROBE(device_get_parent(dev), dev); + } + static int pccard_compat_attach(device_t dev) + { + return CARD_COMPATSUBR_ATTACH(device_get_parent(dev), dev); + } + #endif +}; + METHOD int compat_probe { device_t dev; } --- pccard.c~ Mon Oct 9 22:08:33 2000 +++ pccard.c Tue Oct 24 22:40:54 2000 @@ -563,14 +563,14 @@ * needs to grab devices while in the old they were assigned to the device by * the pccardd process. These symbols are exported to the upper layers. */ -int -pccard_compat_probe(device_t dev) +static int +pccard_compat_probe(device_t parent, device_t dev) { return (CARD_COMPAT_MATCH(dev)); } -int -pccard_compat_attach(device_t dev) +static int +pccard_compat_attach(device_t parent, device_t dev) { int err; @@ -811,7 +811,8 @@ DEVMETHOD(card_get_type, pccard_card_gettype), DEVMETHOD(card_attach_card, pccard_attach_card), DEVMETHOD(card_detach_card, pccard_detach_card), - + DEVMETHOD(card_compatsubr_probe, pccard_compat_probe), + DEVMETHOD(card_compatsubr_attach, pccard_compat_attach), { 0, 0 } }; --- pccardvar.h~ Mon Oct 9 22:08:33 2000 +++ pccardvar.h Tue Oct 24 22:59:07 2000 @@ -287,9 +287,12 @@ #define pccard_mem_unmap(pf, window) \ (pccard_chip_mem_unmap((pf)->sc->pct, (pf)->sc->pch, (window))) -/* compat layer */ -int pccard_compat_probe(device_t dev); -int pccard_compat_attach(device_t dev); +/* + * compat layer are defined in card_if.h statically.(A bit ugly.) + * + * int pccard_compat_probe(device_t dev); + * int pccard_compat_attach(device_t dev); + */ /* ivar interface */ enum { To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message