The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/dev/netif/cs/if_cs_pccard.c

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*
    2  * Copyright (c) 1999 M. Warner Losh <imp@village.org> 
    3  * All rights reserved.
    4  *
    5  * Redistribution and use in source and binary forms, with or without
    6  * modification, are permitted provided that the following conditions
    7  * are met:
    8  * 1. Redistributions of source code must retain the above copyright
    9  *    notice, this list of conditions and the following disclaimer.
   10  * 2. Redistributions in binary form must reproduce the above copyright
   11  *    notice, this list of conditions and the following disclaimer in the
   12  *    documentation and/or other materials provided with the distribution.
   13  *
   14  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
   15  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   16  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
   17  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
   18  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
   19  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   20  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   21  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   22  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
   23  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   24  *
   25  * $FreeBSD: src/sys/dev/cs/if_cs_pccard.c,v 1.1.2.1 2001/01/25 20:13:48 imp Exp $
   26  */
   27 
   28 #include <sys/param.h>
   29 #include <sys/systm.h>
   30 #include <sys/kernel.h>
   31 #include <sys/socket.h>
   32 #include <sys/module.h>
   33 #include <sys/bus.h>
   34 
   35 #include <net/ethernet.h> 
   36 #include <net/if.h> 
   37 #include <net/if_arp.h>
   38 
   39 #include "if_csvar.h"
   40 #include <bus/pccard/pccardvar.h>
   41 
   42 #include "card_if.h"
   43 #include "pccarddevs.h"
   44 
   45 static const struct pccard_product cs_pccard_products[] = {
   46         PCMCIA_CARD(IBM, ETHERJET, 0),
   47         { NULL }
   48 };
   49 static int
   50 cs_pccard_match(device_t dev)
   51 {
   52         const struct pccard_product *pp;
   53 
   54         if ((pp = pccard_product_lookup(dev, cs_pccard_products,
   55             sizeof(cs_pccard_products[0]), NULL)) != NULL) {
   56                 if (pp->pp_name != NULL)
   57                         device_set_desc(dev, pp->pp_name);
   58                 return 0;
   59         }
   60         return EIO;
   61 }
   62 
   63 static int
   64 cs_pccard_probe(device_t dev)
   65 {
   66         int error;
   67 
   68         error = cs_cs89x0_probe(dev);
   69         cs_release_resources(dev);
   70         return (error);
   71 }
   72 
   73 static device_method_t cs_pccard_methods[] = {
   74         /* Device interface */
   75         DEVMETHOD(device_probe,         pccard_compat_probe),
   76         DEVMETHOD(device_attach,        pccard_compat_attach),
   77         DEVMETHOD(device_detach,        cs_detach),
   78 
   79         /* Card interface */
   80         DEVMETHOD(card_compat_match,    cs_pccard_match),
   81         DEVMETHOD(card_compat_probe,    cs_pccard_probe),
   82         DEVMETHOD(card_compat_attach,   cs_attach),
   83 
   84         DEVMETHOD_END
   85 };
   86 
   87 static driver_t cs_pccard_driver = {
   88         "cs",
   89         cs_pccard_methods,
   90         sizeof(struct cs_softc),
   91 };
   92 
   93 extern devclass_t cs_devclass;
   94 
   95 DRIVER_MODULE(if_cs, pccard, cs_pccard_driver, cs_devclass, NULL, NULL);
   96 MODULE_DEPEND(if_cs, pccard, 1, 1, 1);

Cache object: 5a805befb5d26318bb9824ccead0223a


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.