if_ep_pccard.c (119418) | if_ep_pccard.c (119572) |
---|---|
1/* 2 * Copyright (c) 1994 Herb Peyerl <hpeyerl@novatel.ca> 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 --- 15 unchanged lines hidden (view full) --- 24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 */ 30 31#include <sys/cdefs.h> | 1/* 2 * Copyright (c) 1994 Herb Peyerl <hpeyerl@novatel.ca> 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 --- 15 unchanged lines hidden (view full) --- 24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 */ 30 31#include <sys/cdefs.h> |
32__FBSDID("$FreeBSD: head/sys/dev/ep/if_ep_pccard.c 119418 2003-08-24 17:55:58Z obrien $"); | 32__FBSDID("$FreeBSD: head/sys/dev/ep/if_ep_pccard.c 119572 2003-08-30 08:10:58Z markm $"); |
33 34/* 35 * Pccard support for 3C589 by: 36 * HAMADA Naoki 37 * nao@tom-yam.or.jp 38 */ 39 40#include <sys/cdefs.h> | 33 34/* 35 * Pccard support for 3C589 by: 36 * HAMADA Naoki 37 * nao@tom-yam.or.jp 38 */ 39 40#include <sys/cdefs.h> |
41__FBSDID("$FreeBSD: head/sys/dev/ep/if_ep_pccard.c 119418 2003-08-24 17:55:58Z obrien $"); | 41__FBSDID("$FreeBSD: head/sys/dev/ep/if_ep_pccard.c 119572 2003-08-30 08:10:58Z markm $"); |
42 43#include <sys/param.h> 44#include <sys/systm.h> 45#include <sys/kernel.h> 46#include <sys/socket.h> 47#include <sys/module.h> 48#include <sys/bus.h> 49 --- 36 unchanged lines hidden (view full) --- 86 * 2. Sadly, you need to have a correct cmd_off in order to 87 * identify the card. So we have to hit it with both and 88 * cross our virtual fingers. There's got to be a better way 89 * to do this. jyoung@accessus.net 09/11/1999 90 */ 91 92 epb->cmd_off = 0; 93 | 42 43#include <sys/param.h> 44#include <sys/systm.h> 45#include <sys/kernel.h> 46#include <sys/socket.h> 47#include <sys/module.h> 48#include <sys/bus.h> 49 --- 36 unchanged lines hidden (view full) --- 86 * 2. Sadly, you need to have a correct cmd_off in order to 87 * identify the card. So we have to hit it with both and 88 * cross our virtual fingers. There's got to be a better way 89 * to do this. jyoung@accessus.net 09/11/1999 90 */ 91 92 epb->cmd_off = 0; 93 |
94 error = get_e(sc, EEPROM_PROD_ID, &result); /* XXX check return */ | 94 /* XXX check return */ 95 error = get_e(sc, EEPROM_PROD_ID, &result); |
95 epb->prod_id = result; 96 97 if ((desc = ep_pccard_identify(epb->prod_id)) == NULL) { 98 if (bootverbose) 99 device_printf(dev, "Pass 1 of 2 detection " 100 "failed (nonfatal) id 0x%x\n", epb->prod_id); 101 epb->cmd_off = 2; | 96 epb->prod_id = result; 97 98 if ((desc = ep_pccard_identify(epb->prod_id)) == NULL) { 99 if (bootverbose) 100 device_printf(dev, "Pass 1 of 2 detection " 101 "failed (nonfatal) id 0x%x\n", epb->prod_id); 102 epb->cmd_off = 2; |
102 error = get_e(sc, EEPROM_PROD_ID, &result); /* XXX check return */ | 103 /* XXX check return */ 104 error = get_e(sc, EEPROM_PROD_ID, &result); |
103 epb->prod_id = result; 104 if ((desc = ep_pccard_identify(epb->prod_id)) == NULL) { 105 device_printf(dev, "Unit failed to come ready or " 106 "product ID unknown! (id 0x%x)\n", epb->prod_id); 107 ep_free(dev); 108 return (ENXIO); 109 } 110 } --- 62 unchanged lines hidden (view full) --- 173 int error = 0; 174 175 if ((error = ep_alloc(dev))) { 176 device_printf(dev, "ep_alloc() failed! (%d)\n", error); 177 goto bad; 178 } 179 sc->epb.cmd_off = 0; 180 | 105 epb->prod_id = result; 106 if ((desc = ep_pccard_identify(epb->prod_id)) == NULL) { 107 device_printf(dev, "Unit failed to come ready or " 108 "product ID unknown! (id 0x%x)\n", epb->prod_id); 109 ep_free(dev); 110 return (ENXIO); 111 } 112 } --- 62 unchanged lines hidden (view full) --- 175 int error = 0; 176 177 if ((error = ep_alloc(dev))) { 178 device_printf(dev, "ep_alloc() failed! (%d)\n", error); 179 goto bad; 180 } 181 sc->epb.cmd_off = 0; 182 |
181 error = get_e(sc, EEPROM_PROD_ID, &result); /* XXX check return */ | 183 /* XXX check return */ 184 error = get_e(sc, EEPROM_PROD_ID, &result); |
182 sc->epb.prod_id = result; 183 184 if (!ep_pccard_card_attach(&sc->epb)) { 185 sc->epb.cmd_off = 2; 186 error = get_e(sc, EEPROM_PROD_ID, &result); 187 sc->epb.prod_id = result; 188 error = get_e(sc, EEPROM_RESOURCE_CFG, &result); 189 sc->epb.res_cfg = result; --- 97 unchanged lines hidden --- | 185 sc->epb.prod_id = result; 186 187 if (!ep_pccard_card_attach(&sc->epb)) { 188 sc->epb.cmd_off = 2; 189 error = get_e(sc, EEPROM_PROD_ID, &result); 190 sc->epb.prod_id = result; 191 error = get_e(sc, EEPROM_RESOURCE_CFG, &result); 192 sc->epb.res_cfg = result; --- 97 unchanged lines hidden --- |