if_txp.c (80455) | if_txp.c (80457) |
---|---|
1/* $OpenBSD: if_txp.c,v 1.48 2001/06/27 06:34:50 kjc Exp $ */ | 1/* $OpenBSD: if_txp.c,v 1.48 2001/06/27 06:34:50 kjc Exp $ */ |
2/* $FreeBSD: head/sys/dev/txp/if_txp.c 80455 2001-07-27 18:28:37Z wpaul $ */ | 2/* $FreeBSD: head/sys/dev/txp/if_txp.c 80457 2001-07-27 19:38:56Z wpaul $ */ |
3 4/* 5 * Copyright (c) 2001 6 * Jason L. Wright <jason@thought.net>, Theo de Raadt, and 7 * Aaron Campbell <aaron@monkey.org>. All rights reserved. 8 * 9 * Redistribution and use in source and binary forms, with or without 10 * modification, are permitted provided that the following conditions --- 77 unchanged lines hidden (view full) --- 88#define TXP_USEIOSPACE 89#define __STRICT_ALIGNMENT 90 91#include <dev/txp/if_txpreg.h> 92#include <dev/txp/3c990img.h> 93 94#ifndef lint 95static const char rcsid[] = | 3 4/* 5 * Copyright (c) 2001 6 * Jason L. Wright <jason@thought.net>, Theo de Raadt, and 7 * Aaron Campbell <aaron@monkey.org>. All rights reserved. 8 * 9 * Redistribution and use in source and binary forms, with or without 10 * modification, are permitted provided that the following conditions --- 77 unchanged lines hidden (view full) --- 88#define TXP_USEIOSPACE 89#define __STRICT_ALIGNMENT 90 91#include <dev/txp/if_txpreg.h> 92#include <dev/txp/3c990img.h> 93 94#ifndef lint 95static const char rcsid[] = |
96 "$FreeBSD: head/sys/dev/txp/if_txp.c 80455 2001-07-27 18:28:37Z wpaul $"; | 96 "$FreeBSD: head/sys/dev/txp/if_txp.c 80457 2001-07-27 19:38:56Z wpaul $"; |
97#endif 98 99/* 100 * Various supported device vendors/types and their names. 101 */ 102static struct txp_type txp_devs[] = { 103 { TXP_VENDORID_3COM, TXP_DEVICEID_3CR990_TX_95, 104 "3Com 3cR990-TX-95 Etherlink with 3XP Processor" }, --- 211 unchanged lines hidden (view full) --- 316 317 if (error) { 318 txp_release_resources(sc); 319 goto fail; 320 } 321 322 sc->sc_ldata = contigmalloc(sizeof(struct txp_ldata), M_DEVBUF, 323 M_NOWAIT, 0, 0xffffffff, PAGE_SIZE, 0); | 97#endif 98 99/* 100 * Various supported device vendors/types and their names. 101 */ 102static struct txp_type txp_devs[] = { 103 { TXP_VENDORID_3COM, TXP_DEVICEID_3CR990_TX_95, 104 "3Com 3cR990-TX-95 Etherlink with 3XP Processor" }, --- 211 unchanged lines hidden (view full) --- 316 317 if (error) { 318 txp_release_resources(sc); 319 goto fail; 320 } 321 322 sc->sc_ldata = contigmalloc(sizeof(struct txp_ldata), M_DEVBUF, 323 M_NOWAIT, 0, 0xffffffff, PAGE_SIZE, 0); |
324 bzero(sc->sc_ldata, sizeof(struct txp_ldata)); |
|
324 325 if (txp_alloc_rings(sc)) { 326 txp_release_resources(sc); 327 goto fail; 328 } 329 330 if (txp_command(sc, TXP_CMD_MAX_PKT_SIZE_WRITE, TXP_MAX_PKTLEN, 0, 0, 331 NULL, NULL, NULL, 1)) { --- 702 unchanged lines hidden (view full) --- 1034 1035 /* receive buffer ring */ 1036 boot->br_rxbuf_lo = vtophys(&ld->txp_rxbufs); 1037 boot->br_rxbuf_hi = 0; 1038 boot->br_rxbuf_siz = RXBUF_ENTRIES * sizeof(struct txp_rxbuf_desc); 1039 sc->sc_rxbufs = (struct txp_rxbuf_desc *)&ld->txp_rxbufs; 1040 1041 for (i = 0; i < RXBUF_ENTRIES; i++) { | 325 326 if (txp_alloc_rings(sc)) { 327 txp_release_resources(sc); 328 goto fail; 329 } 330 331 if (txp_command(sc, TXP_CMD_MAX_PKT_SIZE_WRITE, TXP_MAX_PKTLEN, 0, 0, 332 NULL, NULL, NULL, 1)) { --- 702 unchanged lines hidden (view full) --- 1035 1036 /* receive buffer ring */ 1037 boot->br_rxbuf_lo = vtophys(&ld->txp_rxbufs); 1038 boot->br_rxbuf_hi = 0; 1039 boot->br_rxbuf_siz = RXBUF_ENTRIES * sizeof(struct txp_rxbuf_desc); 1040 sc->sc_rxbufs = (struct txp_rxbuf_desc *)&ld->txp_rxbufs; 1041 1042 for (i = 0; i < RXBUF_ENTRIES; i++) { |
1043 struct txp_swdesc *sd; |
|
1042 if (sc->sc_rxbufs[i].rb_sd != NULL) 1043 continue; 1044 sc->sc_rxbufs[i].rb_sd = malloc(sizeof(struct txp_swdesc), 1045 M_DEVBUF, M_NOWAIT); 1046 if (sc->sc_rxbufs[i].rb_sd == NULL) 1047 return(ENOBUFS); | 1044 if (sc->sc_rxbufs[i].rb_sd != NULL) 1045 continue; 1046 sc->sc_rxbufs[i].rb_sd = malloc(sizeof(struct txp_swdesc), 1047 M_DEVBUF, M_NOWAIT); 1048 if (sc->sc_rxbufs[i].rb_sd == NULL) 1049 return(ENOBUFS); |
1050 sd = sc->sc_rxbufs[i].rb_sd; 1051 sd->sd_mbuf = NULL; |
|
1048 } 1049 sc->sc_rxbufprod = 0; 1050 1051 /* zero dma */ 1052 bzero(&ld->txp_zero, sizeof(u_int32_t)); 1053 boot->br_zero_lo = vtophys(&ld->txp_zero); 1054 boot->br_zero_hi = 0; 1055 --- 875 unchanged lines hidden --- | 1052 } 1053 sc->sc_rxbufprod = 0; 1054 1055 /* zero dma */ 1056 bzero(&ld->txp_zero, sizeof(u_int32_t)); 1057 boot->br_zero_lo = vtophys(&ld->txp_zero); 1058 boot->br_zero_hi = 0; 1059 --- 875 unchanged lines hidden --- |