brintos

brintos / linux-shallow public Read only

0
0
Text · 2.7 KiB · 180531a Raw
62 lines · plain
1/* nicstar.c  v0.22  Jawaid Bazyar (bazyar@hypermall.com)2 * nicstar.c, M. Welsh (matt.welsh@cl.cam.ac.uk)3 *4 * Hacked October, 1997 by Jawaid Bazyar, Interlink Advertising Services Inc.5 * 	http://www.hypermall.com/6 * 10/1/97 - commented out CFG_PHYIE bit - we don't care when the PHY7 *	interrupts us (except possibly for removal/insertion of the cable?)8 * 10/4/97 - began heavy inline documentation of the code. Corrected typos9 *	and spelling mistakes.10 * 10/5/97 - added code to handle PHY interrupts, disable PHY on11 *	loss of link, and correctly re-enable PHY when link is12 *	re-established. (put back CFG_PHYIE)13 *14 *   Modified to work with the IDT7721 nicstar -- AAL5 (tested) only.15 *16 * R. D. Rechenmacher <ron@fnal.gov>, Aug. 6, 199717 *18 * Linux driver for the IDT77201 NICStAR PCI ATM controller.19 * PHY component is expected to be 155 Mbps S/UNI-Lite or IDT 77155;20 * see init_nicstar() for PHY initialization to change this. This driver21 * expects the Linux ATM stack to support scatter-gather lists 22 * (skb->atm.iovcnt != 0) for Rx skb's passed to vcc->push.23 *24 * Implementing minimal-copy of received data:25 *   IDT always receives data into a small buffer, then large buffers26 *     as needed. This means that data must always be copied to create27 *     the linear buffer needed by most non-ATM protocol stacks (e.g. IP)28 *     Fix is simple: make large buffers large enough to hold entire29 *     SDU, and leave <small_buffer_data> bytes empty at the start. Then30 *     copy small buffer contents to head of large buffer.31 *   Trick is to avoid fragmenting Linux, due to need for a lot of large32 *     buffers. This is done by 2 things:33 *       1) skb->destructor / skb->atm.recycle_buffer34 *            combined, allow nicstar_free_rx_skb to be called to35 *            recycle large data buffers36 *       2) skb_clone of received buffers37 *   See nicstar_free_rx_skb and linearize_buffer for implementation38 *     details.39 *40 *41 *42 * Copyright (c) 1996 University of Cambridge Computer Laboratory43 *44 *   This program is free software; you can redistribute it and/or modify45 *   it under the terms of the GNU General Public License as published by46 *   the Free Software Foundation; either version 2 of the License, or47 *   (at your option) any later version.48 * 49 *   This program is distributed in the hope that it will be useful,50 *   but WITHOUT ANY WARRANTY; without even the implied warranty of51 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the52 *   GNU General Public License for more details.53 *54 *   You should have received a copy of the GNU General Public License55 *   along with this program; if not, write to the Free Software56 *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.57 *58 * M. Welsh, 6 July 199659 *60 *61 */62