PCMCIA Network driver.

2001-07-17 Thread Case, Benjamin
 I just got an ENCORE PCMCIA Netowrk Card. From their website I d/l the
 linux drivers. This consisted of these files:
 
 8390.c, gen1, gen2, and PCNET_CS.c. as well as a readme with the following
 instructions:
 
 16-bit 100/10M Fast Ethernet PCMCIA Adapter LINUX DRIVER INSTALL
  Note: this driver for linux 2.0.30
 
  1. copy driver to /FASTPCM
 # mcopy a:/* /FASTPCM
  
  2. download pcmcia-cs-3.0.x.tar.gz from hyper.stanford.edu
 in the /pub/pcmcia directory
 readme PCMCIA-HOWTO file  install it 
  
  3. add the following lines into /etc/pcmcia/config
 card 16-bit 100/10M Fast Ethernet PCMCIA Adapter
 version PCMCIA, 100BASE
 bind pcnet_cs
 
  4.# cd /FASTPCM
# chmod +x gen1 gen2
  
  5.# gen1
# gen2
  
  6.# reboot
  
 
 None of this is working. I have PCMCIA services working fine with another
 3com PCMCIA network card, so I think I have the SLOT configured properly.
 Is there anyway to simply compile that 8930.c file into 8930.o and
 'insmod' it ? I have never used linux on a laptop, and I have never worked
 with PCMCIA before. I assume the list doesnt like attachments, so if
 anyone is intereseted in the files, I will be happy to provide them. As an
 alternative I will make this e-mail extrememly long and attach the text of
 the files below:
 
 --
 --
 
 (/* 8390.c: A general NS8390 ethernet driver core for linux. */
 /*
   Written 1992-94 by Donald Becker.
   
   Copyright 1993 United States Government as represented by the
   Director, National Security Agency.
 
   This software may be used and distributed according to the terms
   of the GNU Public License, incorporated herein by reference.
 
   The author may be reached as [EMAIL PROTECTED], or C/O
   Center of Excellence in Space Data and Information Sciences
  Code 930.5, Goddard Space Flight Center, Greenbelt MD 20771
   
   This is the chip-specific code for many 8390-based ethernet adaptors.
   This is not a complete driver, it must be combined with board-specific
   code such as ne.c, wd.c, 3c503.c, etc.
 
   Seeing how at least eight drivers use this code, (not counting the
   PCMCIA ones either) it is easy to break some card by what seems like
   a simple innocent change. Please contact me or Donald if you think
   you have found something that needs changing. -- PG
 
 
   Changelog:
 
   Paul Gortmaker  : remove set_bit lock, other cleanups.
   Paul Gortmaker  : add ei_get_8390_hdr() so we can pass skb's to 
 ei_block_input() for eth_io_copy_and_sum().
   Paul Gortmaker  : exchange static int ei_pingpong for a #define,
 also add better Tx error handling.
   Paul Gortmaker  : rewrite Rx overrun handling as per NS specs.
 
   
 
   Sources:
   The National Semiconductor LAN Databook, and the 3Com 3c503 databook.
 
   */
 
 static const char *version =
 8390.c:v1.10 9/23/94 Donald Becker ([EMAIL PROTECTED])\n;
 
 #include linux/module.h
 #include linux/kernel.h
 #include linux/sched.h
 #include linux/fs.h
 #include linux/types.h
 #include linux/ptrace.h
 #include linux/string.h
 #include asm/system.h
 #include asm/segment.h
 #include asm/bitops.h
 #include asm/io.h
 #include linux/errno.h
 #include linux/fcntl.h
 #include linux/in.h
 #include linux/interrupt.h
 
 #include linux/netdevice.h
 #include linux/etherdevice.h
 
 #include 8390.h
 
 // These are the operational function interfaces to board-specific
 // routines.
 //void reset_8390(struct device *dev)
 //Resets the board associated with DEV, including a hardware
 reset of
 //the 8390.  This is only called when there is a transmit
 timeout, and
 //it is always followed by 8390_init().
 //void block_output(struct device *dev, int count, const unsigned char
 *buf,
 //  int start_page)
 //Write the COUNT bytes of BUF to the packet buffer at
 START_PAGE.  The
 //page value uses the 8390's 256-byte pages.
 //void get_8390_hdr(struct device *dev, struct e8390_hdr *hdr, int
 ring_page)
 //Read the 4 byte, page aligned 8390 header. *If* there is a
 //subsequent read, it will be of the rest of the packet.
 //void block_input(struct device *dev, int count, struct sk_buff *skb,
 int ring_offset)
 //Read COUNT bytes from the packet buffer into the skb data
 area. Start 
 //reading from RING_OFFSET, the address as the 8390 sees it.
 This will always
 //follow the read of the 8390 header. 
 
 #define ei_reset_8390 (ei_local-reset_8390)
 #define ei_block_output (ei_local-block_output)
 #define ei_block_input (ei_local-block_input)
 #define ei_get_8390_hdr (ei_local-get_8390_hdr)
 
 /* use 0 for production, 1 for verification, 2 for debug */
 #ifdef EI_DEBUG
 int ei_debug = 

Re: PCMCIA Network driver.

2001-07-17 Thread Joost Kooij
On Tue, Jul 17, 2001 at 10:02:54AM -0500, Case, Benjamin wrote:
  I just got an ENCORE PCMCIA Netowrk Card. From their website I d/l the
  linux drivers. This consisted of these files:
  
  8390.c, gen1, gen2, and PCNET_CS.c. as well as a readme with the following
  instructions:
  
  16-bit 100/10M Fast Ethernet PCMCIA Adapter LINUX DRIVER INSTALL
   Note: this driver for linux 2.0.30
 ^^
  
   1. copy driver to /FASTPCM
  # mcopy a:/* /FASTPCM
   
   2. download pcmcia-cs-3.0.x.tar.gz from hyper.stanford.edu
  in the /pub/pcmcia directory
  readme PCMCIA-HOWTO file  install it 

Don't do this.  Use the debian pcmcia-cs package instead.

   3. add the following lines into /etc/pcmcia/config
  card 16-bit 100/10M Fast Ethernet PCMCIA Adapter
  version PCMCIA, 100BASE
  bind pcnet_cs
  
   4.# cd /FASTPCM
 # chmod +x gen1 gen2
   
   5.# gen1
 # gen2

All (and more) done automatically by the debian package.

   6.# reboot

Windows mindset.

In short: why aren't you using the driver in the linux kernel?

Most of these vendor drivers are cheap ripoffs from Donald Becker's
drivers in the official linux kernel.  Use the drivers in the standard
kernel, those are up-to-date and reviewed.

The manufacturer drivers for linux are nice publicity and add credibility
to linux in the eyes of some (official vendor support), but are not to be
actually used.

  3com PCMCIA network card, so I think I have the SLOT configured properly.
  Is there anyway to simply compile that 8930.c file into 8930.o and
  'insmod' it ? I have never used linux on a laptop, and I have never worked
  with PCMCIA before. I assume the list doesnt like attachments, so if
  anyone is intereseted in the files, I will be happy to provide them. As an
  alternative I will make this e-mail extrememly long and attach the text of
  the files below:

Are you NUTS?!?  This add nothing to the content of your message.
It pushes a very big email through the phone line of hundreds of
subscribers to this list.  Go read a few netiquette faqs before ever
doing that again.

About your problem: install pcmcia-cs and pcmcia-modules and read the
PCMCIA-HOWTO at http://linuxdoc.org

Cheers,


Joost



PCMCIA Network driver.

2001-07-17 Thread Case, Benjamin
I just got an ENCORE PCMCIA Netowrk Card. From their website I d/l the
linux drivers. This consisted of these files:

8390.c, gen1, gen2, and PCNET_CS.c. as well as a readme with the following
instructions:

16-bit 100/10M Fast Ethernet PCMCIA Adapter LINUX DRIVER INSTALL
 Note: this driver for linux 2.0.30

 1. copy driver to /FASTPCM
# mcopy a:/* /FASTPCM
 
 2. download pcmcia-cs-3.0.x.tar.gz from hyper.stanford.edu
in the /pub/pcmcia directory
readme PCMCIA-HOWTO file  install it 
 
 3. add the following lines into /etc/pcmcia/config
card 16-bit 100/10M Fast Ethernet PCMCIA Adapter
version PCMCIA, 100BASE
bind pcnet_cs

 4.# cd /FASTPCM
   # chmod +x gen1 gen2
 
 5.# gen1
   # gen2
 
 6.# reboot
 

None of this is working. I have PCMCIA services working fine with another
3com PCMCIA network card, so I think I have the SLOT configured properly. Is
there anyway to simply compile that 8930.c file into 8930.o and 'insmod' it
? I have never used linux on a laptop, and I have never worked with PCMCIA
before. I assume the list doesnt like attachments, so if anyone is
intereseted in the files, I will be happy to provide them. As an alternative
I will make this e-mail extrememly long and attach the text of the files
below:




(/* 8390.c: A general NS8390 ethernet driver core for linux. */
/*
Written 1992-94 by Donald Becker.
  
Copyright 1993 United States Government as represented by the
Director, National Security Agency.

This software may be used and distributed according to the terms
of the GNU Public License, incorporated herein by reference.

The author may be reached as [EMAIL PROTECTED], or C/O
Center of Excellence in Space Data and Information Sciences
   Code 930.5, Goddard Space Flight Center, Greenbelt MD 20771
  
  This is the chip-specific code for many 8390-based ethernet adaptors.
  This is not a complete driver, it must be combined with board-specific
  code such as ne.c, wd.c, 3c503.c, etc.

  Seeing how at least eight drivers use this code, (not counting the
  PCMCIA ones either) it is easy to break some card by what seems like
  a simple innocent change. Please contact me or Donald if you think
  you have found something that needs changing. -- PG


  Changelog:

  Paul Gortmaker: remove set_bit lock, other cleanups.
  Paul Gortmaker: add ei_get_8390_hdr() so we can pass skb's to 
  ei_block_input() for eth_io_copy_and_sum().
  Paul Gortmaker: exchange static int ei_pingpong for a #define,
  also add better Tx error handling.
  Paul Gortmaker: rewrite Rx overrun handling as per NS specs.

  

  Sources:
  The National Semiconductor LAN Databook, and the 3Com 3c503 databook.

  */

static const char *version =
8390.c:v1.10 9/23/94 Donald Becker ([EMAIL PROTECTED])\n;

#include linux/module.h
#include linux/kernel.h
#include linux/sched.h
#include linux/fs.h
#include linux/types.h
#include linux/ptrace.h
#include linux/string.h
#include asm/system.h
#include asm/segment.h
#include asm/bitops.h
#include asm/io.h
#include linux/errno.h
#include linux/fcntl.h
#include linux/in.h
#include linux/interrupt.h

#include linux/netdevice.h
#include linux/etherdevice.h

#include 8390.h

// These are the operational function interfaces to board-specific
// routines.
//  void reset_8390(struct device *dev)
//  Resets the board associated with DEV, including a hardware
reset of
//  the 8390.  This is only called when there is a transmit
timeout, and
//  it is always followed by 8390_init().
//  void block_output(struct device *dev, int count, const unsigned char
*buf,
//int start_page)
//  Write the COUNT bytes of BUF to the packet buffer at
START_PAGE.  The
//  page value uses the 8390's 256-byte pages.
//  void get_8390_hdr(struct device *dev, struct e8390_hdr *hdr, int
ring_page)
//  Read the 4 byte, page aligned 8390 header. *If* there is a
//  subsequent read, it will be of the rest of the packet.
//  void block_input(struct device *dev, int count, struct sk_buff *skb,
int ring_offset)
//  Read COUNT bytes from the packet buffer into the skb data
area. Start 
//  reading from RING_OFFSET, the address as the 8390 sees it.
This will always
//  follow the read of the 8390 header. 

#define ei_reset_8390 (ei_local-reset_8390)
#define ei_block_output (ei_local-block_output)
#define ei_block_input (ei_local-block_input)
#define ei_get_8390_hdr (ei_local-get_8390_hdr)

/* use 0 for production, 1 for verification, 2 for debug */
#ifdef EI_DEBUG
int ei_debug = EI_DEBUG;
#else
int ei_debug = 1;
#endif

/* Index to functions. */
static void