From imp@hammer.village.org Tue Dec 18 22:38:23 2001 Return-Path: Delivered-To: wpaul@freebsd.org Received: from hammer.village.org (rover.bsdimp.com [204.144.255.66]) by hub.freebsd.org (Postfix) with ESMTP id F03CC37B416 for ; Tue, 18 Dec 2001 22:38:22 -0800 (PST) Received: (from imp@localhost) by hammer.village.org (8.11.6/8.11.4) id fBJ6cJT04197 for wpaul@freebsd.org; Tue, 18 Dec 2001 23:38:19 -0700 (MST) (envelope-from imp) Date: Tue, 18 Dec 2001 23:38:19 -0700 (MST) From: "M. Warner Losh" Message-Id: <200112190638.fBJ6cJT04197@hammer.village.org> To: wpaul@freebsd.org Subject: ata patch Status: RO Index: ata-card.c =================================================================== RCS file: /cache/ncvs/src/sys/dev/ata/ata-card.c,v retrieving revision 1.2 diff -u -r1.2 ata-card.c --- ata-card.c 20 Sep 2001 15:25:23 -0000 1.2 +++ ata-card.c 3 Dec 2001 18:06:41 -0000 @@ -43,6 +43,31 @@ #include #include #include +#include +#include +#include + +static int +ata_pccard_match(device_t dev) +{ + int error = 0; + u_int32_t fcn = PCCARD_FUNCTION_UNSPEC; + + error = pccard_get_function(dev, &fcn); + if (error != 0) + return (error); + /* + * If a fixed disk, we're likely the one. + */ + if (fcn == PCCARD_FUNCTION_DISK) + return (0); + + /* + * I believe that we'll need a table here for cdroms, since some of + * them do not identify themselves properly. + */ + return(ENXIO); +} static int ata_pccard_probe(device_t dev) @@ -93,9 +118,14 @@ static device_method_t ata_pccard_methods[] = { /* device interface */ - DEVMETHOD(device_probe, ata_pccard_probe), - DEVMETHOD(device_attach, ata_attach), + DEVMETHOD(device_probe, pccard_compat_probe), + DEVMETHOD(device_attach, pccard_compat_attach), DEVMETHOD(device_detach, ata_detach), + + /* Card interface */ + DEVMETHOD(card_compat_match, ata_pccard_match), + DEVMETHOD(card_compat_probe, ata_pccard_probe), + DEVMETHOD(card_compat_attach, ata_attach), { 0, 0 } };