Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 06 Aug 2001 12:16:37 -0400
From:      Assem Salama <assem@twcny.rr.com>
To:        freebsd-hackers@freebsd.org
Subject:   detach
Message-ID:  <3B6EC2E5.CF2077FC@twcny.rr.com>

next in thread | raw e-mail | index | archive | help
Hello,
    I have a question. I'm trying to make a module for a PCI card. My
problem is my 'detach' function never get's called when I unload the
module. Al my other functions get called correctly. Here is my source:


#define DRIVERNAME                      "ide_mod"

#ifdef DEBUG
#define PRINTD(STR)                     uprintf("%s: %s",DRIVERNAME,
STR);
#else
#define PRINTD(STR)
#endif

static int ide_mod_detach(device_t dev)
{
        PRINTD("Inside detach ... \n");
        return 0;
}


static device_method_t ide_mod_methods[] =
{
        /* device methods */
        DEVMETHOD(device_probe,         ide_mod_probe),
        DEVMETHOD(device_attach,        ide_mod_attach),
        DEVMETHOD(device_detach,        ide_mod_detach),
        {0, 0}
};

static driver_t ide_mod_driver = {
        "ide_mod",
        ide_mod_methods,
        sizeof(ide_mod_softc),
};

static devclass_t ide_mod_devclas;

/* all our macros */
DRIVER_MODULE(ide_mod, atapci, ide_mod_driver, ide_mod_devclas, 0, 0);


Thanks,
Assem Salama


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3B6EC2E5.CF2077FC>