⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 linux下8019驱动程序.txt

📁 8019驱动程序
💻 TXT
📖 第 1 页 / 共 5 页
字号:
Linux Source Browser - 2001/01/01 RIC lab.                                                                          
~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~         
Linux Cross Reference                                                                                               
Linux/drivers/net/ne.c                                                                                              
Version: ~ [ 2.2.18 ] ~ [ 2.4.0 ] ~                                                                                 
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~                    
                                                                                                                    
                                                                                                                    
--------------------------------------------------------------------------------                                    
                                                                                                                    
** Warning: Cannot open xref database.                                                                              
  1 /* ne.c: A general non-shared-memory NS8390 ethernet driver for linux. */                                       
  2 /*                                                                                                              
  3     Written 1992-94 by Donald Becker.                                                                           
  4                                                                                                                 
  5     Copyright 1993 United States Government as represented by the                                               
  6     Director, National Security Agency.                                                                         
  7                                                                                                                 
  8     This software may be used and distributed according to the terms                                            
  9     of the GNU Public License, incorporated herein by reference.                                                
 10                                                                                                                 
 11     The author may be reached as becker@CESDIS.gsfc.nasa.gov, or C/O                                            
 12     Center of Excellence in Space Data and Information Sciences                                                 
 13         Code 930.5, Goddard Space Flight Center, Greenbelt MD 20771                                             
 14                                                                                                                 
 15     This driver should work with many programmed-I/O 8390-based ethernet                                        
 16     boards.  Currently it supports the NE1000, NE2000, many clones,                                             
 17     and some Cabletron products.                                                                                
 18                                                                                                                 
 19     Changelog:                                                                                                  
 20                                                                                                                 
 21     Paul Gortmaker      : use ENISR_RDC to monitor Tx PIO uploads, made                                         
 22                           sanity checks and bad clone support optional.                                         
 23     Paul Gortmaker      : new reset code, reset card after probe at boot.                                       
 24     Paul Gortmaker      : multiple card support for module users.                                               
 25     Paul Gortmaker      : Support for PCI ne2k clones, similar to lance.c                                       
 26     Paul Gortmaker      : Allow users with bad cards to avoid full probe.                                       
 27     Paul Gortmaker      : PCI probe changes, more PCI cards supported.                                          
 28     rjohnson@analogic.com : Changed init order so an interrupt will only                                        
 29     occur after memory is allocated for dev->priv. Deallocated memory                                           
 30     last in cleanup_modue()                                                                                     
 31     Richard Guenther    : Added support for ISAPnP cards                                                        
 32     Paul Gortmaker      : Discontinued PCI support - use ne2k-pci.c instead.                                    
 33                                                                                                                 
 34 */                                                                                                              
 35                                                                                                                 
 36 /* Routines for the NatSemi-based designs (NE[12]000). */                                                       
 37                                                                                                                 
 38 static const char version1[] =                                                                                  
 39 "ne.c:v1.10 9/23/94 Donald Becker (becker@scyld.com)\n";                                                        
 40 static const char version2[] =                                                                                  
 41 "Last modified Nov 1, 2000 by Paul Gortmaker\n";                                                                
 42                                                                                                                 
 43                                                                                                                 
 44 #include <linux/module.h>                                                                                       
 45 #include <linux/kernel.h>                                                                                       
 46 #include <linux/sched.h>                                                                                        
 47 #include <linux/errno.h>                                                                                        
 48 #include <linux/isapnp.h>                                                                                       
 49 #include <linux/init.h>                                                                                         
 50 #include <linux/delay.h>                                                                                        
 51 #include <asm/system.h>                                                                                         
 52 #include <asm/io.h>                                                                                             
 53                                                                                                                 
 54 #include <linux/netdevice.h>                                                                                    
 55 #include <linux/etherdevice.h>                                                                                  
 56 #include "8390.h"                                                                                               
 57                                                                                                                 
 58 /* Some defines that people can play with if so inclined. */                                                    
 59                                                                                                                 
 60 /* Do we support clones that don't adhere to 14,15 of the SAprom ? */                                           
 61 #define SUPPORT_NE_BAD_CLONES                                                                                   
 62                                                                                                                 
 63 /* Do we perform extra sanity checks on stuff ? */                                                              
 64 /* #define NE_SANITY_CHECK */                                                                                   
 65                                                                                                                 
 66 /* Do we implement the read before write bugfix ? */                                                            
 67 /* #define NE_RW_BUGFIX */                                                                                      
 68                                                                                                                 
 69 /* Do we have a non std. amount of memory? (in units of 256 byte pages) */                                      
 70 /* #define PACKETBUF_MEMSIZE    0x40 */                                                                         
 71                                                                                                                 
 72 /* A zero-terminated list of I/O addresses to be probed at boot. */                                             
 73 #ifndef MODULE                                                                                                  
 74 static unsigned int netcard_portlist[] __initdata = {                                                           
 75         0x300, 0x280, 0x320, 0x340, 0x360, 0x380, 0                                                             
 76 };                                                                                                              
 77 #endif                                                                                                          
 78                                                                                                                 
 79 static struct { unsigned short vendor, function; char *name; }                                                  
 80 isapnp_clone_list[] __initdata = {                                                                              
 81         {ISAPNP_VENDOR('E','D','I'), ISAPNP_FUNCTION(0x0216),           "NN NE2000" },                          
 82         {ISAPNP_VENDOR('P','N','P'), ISAPNP_FUNCTION(0x80d6),           "Generic PNP" },                        
 83         {0,}                                                                                                    
 84 };                                                                                                              
 85                                                                                                                 
 86 #ifdef SUPPORT_NE_BAD_CLONES                                                                                    
 87 /* A list of bad clones that we none-the-less recognize. */                                                     
 88 static struct { const char *name8, *name16; unsigned char SAprefix[4];}                                         
 89 bad_clone_list[] __initdata = {                                                                                 
 90     {"DE100", "DE200", {0x00, 0xDE, 0x01,}},                                                                    
 91     {"DE120", "DE220", {0x00, 0x80, 0xc8,}},                                                                    
 92     {"DFI1000", "DFI2000", {'D', 'F', 'I',}}, /* Original, eh?  */                                              
 93     {"EtherNext UTP8", "EtherNext UTP16", {0x00, 0x00, 0x79}},                                                  
 94     {"NE1000","NE2000-invalid", {0x00, 0x00, 0xd8}}, /* Ancient real NE1000. */                                 
 95     {"NN1000", "NN2000",  {0x08, 0x03, 0x08}}, /* Outlaw no-name clone. */                                      
 96     {"4-DIM8","4-DIM16", {0x00,0x00,0x4d,}},  /* Outlaw 4-Dimension cards. */                                   
 97     {"Con-Intl_8", "Con-Intl_16", {0x00, 0x00, 0x24}}, /* Connect Int'nl */                                     
 98     {"ET-100","ET-200", {0x00, 0x45, 0x54}}, /* YANG and YA clone */                                            
 99     {"COMPEX","COMPEX16",{0x00,0x80,0x48}}, /* Broken ISA Compex cards */                                       
100     {"E-LAN100", "E-LAN200", {0x00, 0x00, 0x5d}}, /* Broken ne1000 clones */                                    
101     {"PCM-4823", "PCM-4823", {0x00, 0xc0, 0x6c}}, /* Broken Advantech MoBo */                                   

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -