if_fxp.c (92924291158d113d5afeb7c4e7654f1ca45c1190) | if_fxp.c (c1087c13240442926a34afa825b4dd3993868549) |
---|---|
1/* 2 * Copyright (c) 1995, David Greenman 3 * All rights reserved. 4 * 5 * Modifications to support NetBSD and media selection: 6 * Copyright (c) 1997 Jason R. Thorpe. All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 13 unchanged lines hidden (view full) --- 22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * SUCH DAMAGE. 29 * | 1/* 2 * Copyright (c) 1995, David Greenman 3 * All rights reserved. 4 * 5 * Modifications to support NetBSD and media selection: 6 * Copyright (c) 1997 Jason R. Thorpe. All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 13 unchanged lines hidden (view full) --- 22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * SUCH DAMAGE. 29 * |
30 * $Id: if_fxp.c,v 1.49 1998/02/20 13:11:53 bde Exp $ | 30 * $Id: if_fxp.c,v 1.50 1998/03/03 14:19:07 dg Exp $ |
31 */ 32 33/* 34 * Intel EtherExpress Pro/100B PCI Fast Ethernet driver 35 */ 36 37#include "bpfilter.h" 38 --- 167 unchanged lines hidden (view full) --- 206 { FXP_PHY_80C24, fxp_media_default, 207 sizeof(fxp_media_default) / sizeof(fxp_media_default[0]), 208 FXP_MEDIA_DEFAULT_DEFMEDIA }, 209}; 210#define NFXPMEDIA (sizeof(fxp_media) / sizeof(fxp_media[0])) 211 212static int fxp_mediachange __P((struct ifnet *)); 213static void fxp_mediastatus __P((struct ifnet *, struct ifmediareq *)); | 31 */ 32 33/* 34 * Intel EtherExpress Pro/100B PCI Fast Ethernet driver 35 */ 36 37#include "bpfilter.h" 38 --- 167 unchanged lines hidden (view full) --- 206 { FXP_PHY_80C24, fxp_media_default, 207 sizeof(fxp_media_default) / sizeof(fxp_media_default[0]), 208 FXP_MEDIA_DEFAULT_DEFMEDIA }, 209}; 210#define NFXPMEDIA (sizeof(fxp_media) / sizeof(fxp_media[0])) 211 212static int fxp_mediachange __P((struct ifnet *)); 213static void fxp_mediastatus __P((struct ifnet *, struct ifmediareq *)); |
214static void fxp_set_media __P((struct fxp_softc *, int)); 215static inline void fxp_scb_wait __P((struct fxp_softc *)); | 214static void fxp_set_media __P((struct fxp_softc *, int)); 215static __inline void fxp_scb_wait __P((struct fxp_softc *)); |
216static FXP_INTR_TYPE fxp_intr __P((void *)); 217static void fxp_start __P((struct ifnet *)); 218static int fxp_ioctl __P((struct ifnet *, | 216static FXP_INTR_TYPE fxp_intr __P((void *)); 217static void fxp_start __P((struct ifnet *)); 218static int fxp_ioctl __P((struct ifnet *, |
219 FXP_IOCTLCMD_TYPE, caddr_t)); | 219 FXP_IOCTLCMD_TYPE, caddr_t)); |
220static void fxp_init __P((void *)); 221static void fxp_stop __P((struct fxp_softc *)); 222static void fxp_watchdog __P((struct ifnet *)); 223static int fxp_add_rfabuf __P((struct fxp_softc *, struct mbuf *)); 224static int fxp_mdi_read __P((struct fxp_softc *, int, int)); 225static void fxp_mdi_write __P((struct fxp_softc *, int, int, int)); 226static void fxp_read_eeprom __P((struct fxp_softc *, u_int16_t *, | 220static void fxp_init __P((void *)); 221static void fxp_stop __P((struct fxp_softc *)); 222static void fxp_watchdog __P((struct ifnet *)); 223static int fxp_add_rfabuf __P((struct fxp_softc *, struct mbuf *)); 224static int fxp_mdi_read __P((struct fxp_softc *, int, int)); 225static void fxp_mdi_write __P((struct fxp_softc *, int, int, int)); 226static void fxp_read_eeprom __P((struct fxp_softc *, u_int16_t *, |
227 int, int)); | 227 int, int)); |
228static int fxp_attach_common __P((struct fxp_softc *, u_int8_t *)); 229static void fxp_stats_update __P((void *)); 230static void fxp_mc_setup __P((struct fxp_softc *)); 231 232/* 233 * Set initial transmit threshold at 64 (512 bytes). This is 234 * increased by 64 (512 bytes) at a time, to maximum of 192 235 * (1536 bytes), if an underrun occurs. --- 25 unchanged lines hidden (view full) --- 261 * NIC. See fxp_stats_update(). 262 */ 263#define FXP_MAX_RX_IDLE 15 264 265/* 266 * Wait for the previous command to be accepted (but not necessarily 267 * completed). 268 */ | 228static int fxp_attach_common __P((struct fxp_softc *, u_int8_t *)); 229static void fxp_stats_update __P((void *)); 230static void fxp_mc_setup __P((struct fxp_softc *)); 231 232/* 233 * Set initial transmit threshold at 64 (512 bytes). This is 234 * increased by 64 (512 bytes) at a time, to maximum of 192 235 * (1536 bytes), if an underrun occurs. --- 25 unchanged lines hidden (view full) --- 261 * NIC. See fxp_stats_update(). 262 */ 263#define FXP_MAX_RX_IDLE 15 264 265/* 266 * Wait for the previous command to be accepted (but not necessarily 267 * completed). 268 */ |
269static inline void | 269static __inline void |
270fxp_scb_wait(sc) 271 struct fxp_softc *sc; 272{ 273 int i = 10000; 274 275 while (CSR_READ_1(sc, FXP_CSR_SCB_COMMAND) && --i); 276} 277 --- 1486 unchanged lines hidden --- | 270fxp_scb_wait(sc) 271 struct fxp_softc *sc; 272{ 273 int i = 10000; 274 275 while (CSR_READ_1(sc, FXP_CSR_SCB_COMMAND) && --i); 276} 277 --- 1486 unchanged lines hidden --- |