if_rl.c (42051) | if_rl.c (42738) |
---|---|
1/* 2 * Copyright (c) 1997, 1998 3 * Bill Paul <wpaul@ctr.columbia.edu>. 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 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 * THE POSSIBILITY OF SUCH DAMAGE. 31 * | 1/* 2 * Copyright (c) 1997, 1998 3 * Bill Paul <wpaul@ctr.columbia.edu>. 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 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 * THE POSSIBILITY OF SUCH DAMAGE. 31 * |
32 * $Id: if_rl.c,v 1.7 1998/12/14 06:32:55 dillon Exp $ | 32 * $Id: if_rl.c,v 1.20 1999/01/16 20:46:24 wpaul Exp $ |
33 */ 34 35/* 36 * RealTek 8129/8139 PCI NIC driver 37 * 38 * Supports several extremely cheap PCI 10/100 adapters based on 39 * the RealTek chipset. Datasheets can be obtained from 40 * www.realtek.com.tw. --- 81 unchanged lines hidden (view full) --- 122 * uniprocessor systems though. 123 */ 124#define RL_USEIOSPACE 125 126#include <pci/if_rlreg.h> 127 128#ifndef lint 129static const char rcsid[] = | 33 */ 34 35/* 36 * RealTek 8129/8139 PCI NIC driver 37 * 38 * Supports several extremely cheap PCI 10/100 adapters based on 39 * the RealTek chipset. Datasheets can be obtained from 40 * www.realtek.com.tw. --- 81 unchanged lines hidden (view full) --- 122 * uniprocessor systems though. 123 */ 124#define RL_USEIOSPACE 125 126#include <pci/if_rlreg.h> 127 128#ifndef lint 129static const char rcsid[] = |
130 "$Id: if_rl.c,v 1.7 1998/12/14 06:32:55 dillon Exp $"; | 130 "$Id: if_rl.c,v 1.20 1999/01/16 20:46:24 wpaul Exp $"; |
131#endif 132 133/* 134 * Various supported device vendors/types and their names. 135 */ 136static struct rl_type rl_devs[] = { 137 { RT_VENDORID, RT_DEVICEID_8129, 138 "RealTek 8129 10/100BaseTX" }, --- 1148 unchanged lines hidden (view full) --- 1287 /* Do not try to read past this point. */ 1288 limit = CSR_READ_2(sc, RL_CURRXBUF) % RL_RXBUFLEN; 1289 1290 if (limit < cur_rx) 1291 max_bytes = (RL_RXBUFLEN - cur_rx) + limit; 1292 else 1293 max_bytes = limit - cur_rx; 1294 | 131#endif 132 133/* 134 * Various supported device vendors/types and their names. 135 */ 136static struct rl_type rl_devs[] = { 137 { RT_VENDORID, RT_DEVICEID_8129, 138 "RealTek 8129 10/100BaseTX" }, --- 1148 unchanged lines hidden (view full) --- 1287 /* Do not try to read past this point. */ 1288 limit = CSR_READ_2(sc, RL_CURRXBUF) % RL_RXBUFLEN; 1289 1290 if (limit < cur_rx) 1291 max_bytes = (RL_RXBUFLEN - cur_rx) + limit; 1292 else 1293 max_bytes = limit - cur_rx; 1294 |
1295 while((CSR_READ_1(sc, RL_COMMAND) & 1) == 0) { | 1295 while((CSR_READ_1(sc, RL_COMMAND) & RL_CMD_EMPTY_RXBUF) == 0) { |
1296 rxbufpos = sc->rl_cdata.rl_rx_buf + cur_rx; 1297 rxstat = *(u_int32_t *)rxbufpos; 1298 1299 /* 1300 * Here's a totally undocumented fact for you. When the 1301 * RealTek chip is in the process of copying a packet into 1302 * RAM for you, the length will be 0xfff0. If you spot a 1303 * packet header with this value, you need to stop. The --- 689 unchanged lines hidden --- | 1296 rxbufpos = sc->rl_cdata.rl_rx_buf + cur_rx; 1297 rxstat = *(u_int32_t *)rxbufpos; 1298 1299 /* 1300 * Here's a totally undocumented fact for you. When the 1301 * RealTek chip is in the process of copying a packet into 1302 * RAM for you, the length will be 0xfff0. If you spot a 1303 * packet header with this value, you need to stop. The --- 689 unchanged lines hidden --- |