if_ep_pccard.c (166901) | if_ep_pccard.c (190908) |
---|---|
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 --- 21 unchanged lines hidden (view full) --- 30 31/* 32 * Pccard support for 3C589 by: 33 * HAMADA Naoki 34 * nao@tom-yam.or.jp 35 */ 36 37#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 --- 21 unchanged lines hidden (view full) --- 30 31/* 32 * Pccard support for 3C589 by: 33 * HAMADA Naoki 34 * nao@tom-yam.or.jp 35 */ 36 37#include <sys/cdefs.h> |
38__FBSDID("$FreeBSD: head/sys/dev/ep/if_ep_pccard.c 166901 2007-02-23 12:19:07Z piso $"); | 38__FBSDID("$FreeBSD: head/sys/dev/ep/if_ep_pccard.c 190908 2009-04-11 04:30:38Z imp $"); |
39 40#include <sys/param.h> 41#include <sys/systm.h> 42#include <sys/kernel.h> 43#include <sys/socket.h> 44#include <sys/module.h> 45#include <sys/bus.h> 46 --- 16 unchanged lines hidden (view full) --- 63struct ep_pccard_product 64{ 65 struct pccard_product prod; 66 int chipset; 67}; 68 69#define EP_CHIP_589 1 /* Classic 3c5x9 chipset */ 70#define EP_CHIP_574 2 /* Roadrunner */ | 39 40#include <sys/param.h> 41#include <sys/systm.h> 42#include <sys/kernel.h> 43#include <sys/socket.h> 44#include <sys/module.h> 45#include <sys/bus.h> 46 --- 16 unchanged lines hidden (view full) --- 63struct ep_pccard_product 64{ 65 struct pccard_product prod; 66 int chipset; 67}; 68 69#define EP_CHIP_589 1 /* Classic 3c5x9 chipset */ 70#define EP_CHIP_574 2 /* Roadrunner */ |
71#define EP_CHIP_C1 3 /* 3c1 */ |
|
71 72static const struct ep_pccard_product ep_pccard_products[] = { | 72 73static const struct ep_pccard_product ep_pccard_products[] = { |
73 { PCMCIA_CARD(3COM, 3C1), EP_CHIP_589 }, | 74 { PCMCIA_CARD(3COM, 3C1), EP_CHIP_C1 }, |
74 { PCMCIA_CARD(3COM, 3C562), EP_CHIP_589 }, 75 { PCMCIA_CARD(3COM, 3C589), EP_CHIP_589 }, 76 { PCMCIA_CARD(3COM, 3CXEM556), EP_CHIP_589 }, 77 { PCMCIA_CARD(3COM, 3CXEM556INT), EP_CHIP_589 }, 78 { PCMCIA_CARD(3COM, 3C574), EP_CHIP_574 }, 79 { PCMCIA_CARD(3COM, 3CCFEM556BI), EP_CHIP_574 }, 80 { { NULL } } 81}; --- 57 unchanged lines hidden (view full) --- 139 struct ep_softc *sc = device_get_softc(dev); 140 uint16_t result; 141 int error = 0; 142 const struct ep_pccard_product *pp; 143 144 if ((pp = ep_pccard_lookup(dev)) == NULL) 145 panic("ep_pccard_attach: can't find product in attach."); 146 | 75 { PCMCIA_CARD(3COM, 3C562), EP_CHIP_589 }, 76 { PCMCIA_CARD(3COM, 3C589), EP_CHIP_589 }, 77 { PCMCIA_CARD(3COM, 3CXEM556), EP_CHIP_589 }, 78 { PCMCIA_CARD(3COM, 3CXEM556INT), EP_CHIP_589 }, 79 { PCMCIA_CARD(3COM, 3C574), EP_CHIP_574 }, 80 { PCMCIA_CARD(3COM, 3CCFEM556BI), EP_CHIP_574 }, 81 { { NULL } } 82}; --- 57 unchanged lines hidden (view full) --- 140 struct ep_softc *sc = device_get_softc(dev); 141 uint16_t result; 142 int error = 0; 143 const struct ep_pccard_product *pp; 144 145 if ((pp = ep_pccard_lookup(dev)) == NULL) 146 panic("ep_pccard_attach: can't find product in attach."); 147 |
147 if (pp->chipset == EP_CHIP_589) { 148 sc->epb.mii_trans = 0; 149 sc->epb.cmd_off = 0; 150 } else { | 148 if (pp->chipset == EP_CHIP_574) { |
151 sc->epb.mii_trans = 1; 152 sc->epb.cmd_off = 2; | 149 sc->epb.mii_trans = 1; 150 sc->epb.cmd_off = 2; |
151 } else { 152 sc->epb.mii_trans = 0; 153 sc->epb.cmd_off = 0; |
|
153 } | 154 } |
154 | |
155 if ((error = ep_alloc(dev))) { 156 device_printf(dev, "ep_alloc() failed! (%d)\n", error); 157 goto bad; 158 } 159 | 155 if ((error = ep_alloc(dev))) { 156 device_printf(dev, "ep_alloc() failed! (%d)\n", error); 157 goto bad; 158 } 159 |
160 if (pp->chipset == EP_CHIP_C1) 161 sc->stat |= F_HAS_TX_PLL; 162 |
|
160 /* ROM size = 0, ROM base = 0 */ 161 /* For now, ignore AUTO SELECT feature of 3C589B and later. */ 162 error = ep_get_e(sc, EEPROM_ADDR_CFG, &result); 163 CSR_WRITE_2(sc, EP_W0_ADDRESS_CFG, result & 0xc000); 164 165 /* 166 * Fake IRQ must be 3 for 3C589 and 3C589B. 3C589D and newer 167 * ignore this value. 3C589C is unknown, as are the other --- 67 unchanged lines hidden --- | 163 /* ROM size = 0, ROM base = 0 */ 164 /* For now, ignore AUTO SELECT feature of 3C589B and later. */ 165 error = ep_get_e(sc, EEPROM_ADDR_CFG, &result); 166 CSR_WRITE_2(sc, EP_W0_ADDRESS_CFG, result & 0xc000); 167 168 /* 169 * Fake IRQ must be 3 for 3C589 and 3C589B. 3C589D and newer 170 * ignore this value. 3C589C is unknown, as are the other --- 67 unchanged lines hidden --- |