if_rl.c (117748) | if_rl.c (118089) |
---|---|
1/* 2 * Copyright (c) 1997, 1998-2003 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 --- 110 unchanged lines hidden (view full) --- 119 * PCI ID. Two new NIC type codes, RL_8139CPLUS and RL_8169 have 120 * been added to distinguish the chips at runtime. Separate RX and 121 * TX handling routines have been added to handle C+ mode, which 122 * are selected via function pointers that are initialized during 123 * the driver attach phase. 124 */ 125 126#include <sys/cdefs.h> | 1/* 2 * Copyright (c) 1997, 1998-2003 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 --- 110 unchanged lines hidden (view full) --- 119 * PCI ID. Two new NIC type codes, RL_8139CPLUS and RL_8169 have 120 * been added to distinguish the chips at runtime. Separate RX and 121 * TX handling routines have been added to handle C+ mode, which 122 * are selected via function pointers that are initialized during 123 * the driver attach phase. 124 */ 125 126#include <sys/cdefs.h> |
127__FBSDID("$FreeBSD: head/sys/pci/if_rl.c 117748 2003-07-18 22:11:47Z wpaul $"); | 127__FBSDID("$FreeBSD: head/sys/pci/if_rl.c 118089 2003-07-27 14:38:54Z mux $"); |
128 129#include <sys/param.h> 130#include <sys/endian.h> 131#include <sys/systm.h> 132#include <sys/sockio.h> 133#include <sys/mbuf.h> 134#include <sys/malloc.h> 135#include <sys/kernel.h> --- 35 unchanged lines hidden (view full) --- 171 * can hang the bus. I'm inclined to blame this on crummy design/construction 172 * on the part of RealTek. Memory mapped mode does appear to work on 173 * uniprocessor systems though. 174 */ 175#define RL_USEIOSPACE 176 177#include <pci/if_rlreg.h> 178 | 128 129#include <sys/param.h> 130#include <sys/endian.h> 131#include <sys/systm.h> 132#include <sys/sockio.h> 133#include <sys/mbuf.h> 134#include <sys/malloc.h> 135#include <sys/kernel.h> --- 35 unchanged lines hidden (view full) --- 171 * can hang the bus. I'm inclined to blame this on crummy design/construction 172 * on the part of RealTek. Memory mapped mode does appear to work on 173 * uniprocessor systems though. 174 */ 175#define RL_USEIOSPACE 176 177#include <pci/if_rlreg.h> 178 |
179__FBSDID("$FreeBSD: head/sys/pci/if_rl.c 117748 2003-07-18 22:11:47Z wpaul $"); | 179__FBSDID("$FreeBSD: head/sys/pci/if_rl.c 118089 2003-07-27 14:38:54Z mux $"); |
180 181#define RL_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP) 182 183/* 184 * Various supported device vendors/types and their names. 185 */ 186static struct rl_type rl_devs[] = { 187 { RT_VENDORID, RT_DEVICEID_8129, RL_8129, --- 969 unchanged lines hidden (view full) --- 1157 if (error) { 1158 device_printf(dev, "could not allocate dma tag\n"); 1159 return (ENOMEM); 1160 } 1161 1162 /* Allocate DMA'able memory for the TX ring */ 1163 1164 error = bus_dmamem_alloc(sc->rl_ldata.rl_tx_list_tag, | 180 181#define RL_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP) 182 183/* 184 * Various supported device vendors/types and their names. 185 */ 186static struct rl_type rl_devs[] = { 187 { RT_VENDORID, RT_DEVICEID_8129, RL_8129, --- 969 unchanged lines hidden (view full) --- 1157 if (error) { 1158 device_printf(dev, "could not allocate dma tag\n"); 1159 return (ENOMEM); 1160 } 1161 1162 /* Allocate DMA'able memory for the TX ring */ 1163 1164 error = bus_dmamem_alloc(sc->rl_ldata.rl_tx_list_tag, |
1165 (void **)&sc->rl_ldata.rl_tx_list, BUS_DMA_NOWAIT, | 1165 (void **)&sc->rl_ldata.rl_tx_list, BUS_DMA_NOWAIT | BUS_DMA_ZERO, |
1166 &sc->rl_ldata.rl_tx_list_map); 1167 if (error) 1168 return (ENOMEM); 1169 | 1166 &sc->rl_ldata.rl_tx_list_map); 1167 if (error) 1168 return (ENOMEM); 1169 |
1170 bzero((char *)sc->rl_ldata.rl_tx_list, RL_TX_LIST_SZ); 1171 | |
1172 /* Load the map for the TX ring. */ 1173 1174 error = bus_dmamap_load(sc->rl_ldata.rl_tx_list_tag, 1175 sc->rl_ldata.rl_tx_list_map, sc->rl_ldata.rl_tx_list, 1176 RL_TX_LIST_SZ, rl_dma_map_addr, 1177 &sc->rl_ldata.rl_tx_list_addr, BUS_DMA_NOWAIT); 1178 1179 /* Create DMA maps for TX buffers */ --- 17 unchanged lines hidden (view full) --- 1197 if (error) { 1198 device_printf(dev, "could not allocate dma tag\n"); 1199 return (ENOMEM); 1200 } 1201 1202 /* Allocate DMA'able memory for the RX ring */ 1203 1204 error = bus_dmamem_alloc(sc->rl_ldata.rl_rx_list_tag, | 1170 /* Load the map for the TX ring. */ 1171 1172 error = bus_dmamap_load(sc->rl_ldata.rl_tx_list_tag, 1173 sc->rl_ldata.rl_tx_list_map, sc->rl_ldata.rl_tx_list, 1174 RL_TX_LIST_SZ, rl_dma_map_addr, 1175 &sc->rl_ldata.rl_tx_list_addr, BUS_DMA_NOWAIT); 1176 1177 /* Create DMA maps for TX buffers */ --- 17 unchanged lines hidden (view full) --- 1195 if (error) { 1196 device_printf(dev, "could not allocate dma tag\n"); 1197 return (ENOMEM); 1198 } 1199 1200 /* Allocate DMA'able memory for the RX ring */ 1201 1202 error = bus_dmamem_alloc(sc->rl_ldata.rl_rx_list_tag, |
1205 (void **)&sc->rl_ldata.rl_rx_list, BUS_DMA_NOWAIT, | 1203 (void **)&sc->rl_ldata.rl_rx_list, BUS_DMA_NOWAIT | BUS_DMA_ZERO, |
1206 &sc->rl_ldata.rl_rx_list_map); 1207 if (error) 1208 return (ENOMEM); 1209 | 1204 &sc->rl_ldata.rl_rx_list_map); 1205 if (error) 1206 return (ENOMEM); 1207 |
1210 bzero((char *)sc->rl_ldata.rl_rx_list, RL_RX_LIST_SZ); 1211 | |
1212 /* Load the map for the RX ring. */ 1213 1214 error = bus_dmamap_load(sc->rl_ldata.rl_rx_list_tag, 1215 sc->rl_ldata.rl_rx_list_map, sc->rl_ldata.rl_rx_list, 1216 RL_TX_LIST_SZ, rl_dma_map_addr, 1217 &sc->rl_ldata.rl_rx_list_addr, BUS_DMA_NOWAIT); 1218 1219 /* Create DMA maps for RX buffers */ --- 1743 unchanged lines hidden --- | 1208 /* Load the map for the RX ring. */ 1209 1210 error = bus_dmamap_load(sc->rl_ldata.rl_rx_list_tag, 1211 sc->rl_ldata.rl_rx_list_map, sc->rl_ldata.rl_rx_list, 1212 RL_TX_LIST_SZ, rl_dma_map_addr, 1213 &sc->rl_ldata.rl_rx_list_addr, BUS_DMA_NOWAIT); 1214 1215 /* Create DMA maps for RX buffers */ --- 1743 unchanged lines hidden --- |