if_ed_pccard.c (139749) | if_ed_pccard.c (140522) |
---|---|
1/*- 2 * Copyright (c) 1995, David Greenman 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 --- 10 unchanged lines hidden (view full) --- 19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * | 1/*- 2 * Copyright (c) 1995, David Greenman 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 --- 10 unchanged lines hidden (view full) --- 19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * |
27 * $FreeBSD: head/sys/dev/ed/if_ed_pccard.c 139749 2005-01-06 01:43:34Z imp $ | 27 * $FreeBSD: head/sys/dev/ed/if_ed_pccard.c 140522 2005-01-20 19:37:22Z imp $ |
28 */ 29 30#include "opt_ed.h" 31 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/socket.h> 35#include <sys/kernel.h> --- 10 unchanged lines hidden (view full) --- 46#include <net/if.h> 47#include <net/if_arp.h> 48#include <net/if_mib.h> 49#include <net/if_media.h> 50 51#include <dev/ed/if_edreg.h> 52#include <dev/ed/if_edvar.h> 53#include <dev/pccard/pccardvar.h> | 28 */ 29 30#include "opt_ed.h" 31 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/socket.h> 35#include <sys/kernel.h> --- 10 unchanged lines hidden (view full) --- 46#include <net/if.h> 47#include <net/if_arp.h> 48#include <net/if_mib.h> 49#include <net/if_media.h> 50 51#include <dev/ed/if_edreg.h> 52#include <dev/ed/if_edvar.h> 53#include <dev/pccard/pccardvar.h> |
54#include <dev/pccard/pccard_cis.h> |
|
54#ifndef ED_NO_MIIBUS 55#include <dev/mii/mii.h> 56#include <dev/mii/miivar.h> 57#endif 58 59#include "card_if.h" 60#ifndef ED_NO_MIIBUS 61/* "device miibus" required. See GENERIC if you get errors here. */ --- 125 unchanged lines hidden (view full) --- 187 { PCMCIA_CARD(ZONET, ZEN, 0), 0}, 188 { { NULL } } 189}; 190 191static int 192ed_pccard_match(device_t dev) 193{ 194 const struct ed_product *pp; | 55#ifndef ED_NO_MIIBUS 56#include <dev/mii/mii.h> 57#include <dev/mii/miivar.h> 58#endif 59 60#include "card_if.h" 61#ifndef ED_NO_MIIBUS 62/* "device miibus" required. See GENERIC if you get errors here. */ --- 125 unchanged lines hidden (view full) --- 188 { PCMCIA_CARD(ZONET, ZEN, 0), 0}, 189 { { NULL } } 190}; 191 192static int 193ed_pccard_match(device_t dev) 194{ 195 const struct ed_product *pp; |
196 int error; 197 uint32_t fcn = PCCARD_FUNCTION_UNSPEC; |
|
195 | 198 |
199 /* Make sure we're a network function */ 200 error = pccard_get_function(dev, &fcn); 201 if (error != 0) 202 return (error); 203 if (fcn != PCCARD_FUNCTION_NETWORK) 204 return (ENXIO); 205 |
|
196 if ((pp = (const struct ed_product *) pccard_product_lookup(dev, 197 (const struct pccard_product *) ed_pccard_products, 198 sizeof(ed_pccard_products[0]), NULL)) != NULL) { 199 if (pp->prod.pp_name != NULL) 200 device_set_desc(dev, pp->prod.pp_name); 201 if (pp->flags & NE2000DVF_DL10019) 202 device_set_flags(dev, ED_FLAGS_LINKSYS); 203 else if (pp->flags & NE2000DVF_AX88190) --- 337 unchanged lines hidden --- | 206 if ((pp = (const struct ed_product *) pccard_product_lookup(dev, 207 (const struct pccard_product *) ed_pccard_products, 208 sizeof(ed_pccard_products[0]), NULL)) != NULL) { 209 if (pp->prod.pp_name != NULL) 210 device_set_desc(dev, pp->prod.pp_name); 211 if (pp->flags & NE2000DVF_DL10019) 212 device_set_flags(dev, ED_FLAGS_LINKSYS); 213 else if (pp->flags & NE2000DVF_AX88190) --- 337 unchanged lines hidden --- |