Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
de4x5.c File Reference
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/interrupt.h>
#include <linux/ptrace.h>
#include <linux/errno.h>
#include <linux/ioport.h>
#include <linux/pci.h>
#include <linux/eisa.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/spinlock.h>
#include <linux/crc32.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/time.h>
#include <linux/types.h>
#include <linux/unistd.h>
#include <linux/ctype.h>
#include <linux/dma-mapping.h>
#include <linux/moduleparam.h>
#include <linux/bitops.h>
#include <linux/gfp.h>
#include <asm/io.h>
#include <asm/dma.h>
#include <asm/byteorder.h>
#include <asm/unaligned.h>
#include <asm/uaccess.h>
#include "de4x5.h"

Go to the source code of this file.

Data Structures

struct  phy_table
 
struct  mii_phy
 
struct  sia_phy
 
struct  parameters
 
struct  de4x5_srom
 
struct  de4x5_desc
 
struct  pkt_stats
 
struct  de4x5_private
 
struct  InfoLeaf
 

Macros

#define c_char   const char
 
#define DE4X5_MAX_PHY   8 /* Allow up to 8 attached PHY devices per board */
 
#define GENERIC_REG   0x05 /* Autoneg. Link Partner Advertisement Reg. */
 
#define GENERIC_MASK   MII_ANLPA_100M /* All 100Mb/s Technologies */
 
#define GENERIC_VALUE   MII_ANLPA_100M /* 100B-TX, 100B-TX FDX, 100B-T4 */
 
#define SMC   1
 
#define ACCTON   2
 
#define DE4X5_AUTOSENSE_MS   250 /* msec autosense tick (DE500) */
 
#define DE4X5_NDA   0xffe0 /* No Device (I/O) Address */
 
#define PROBE_LENGTH   32
 
#define ETH_PROM_SIG   0xAA5500FFUL
 
#define PKT_BUF_SZ   1536 /* Buffer size for each Tx/Rx buffer */
 
#define IEEE802_3_SZ   1518 /* Packet + CRC */
 
#define MAX_PKT_SZ   1514 /* Maximum ethernet packet length */
 
#define MAX_DAT_SZ   1500 /* Maximum ethernet data length */
 
#define MIN_DAT_SZ   1 /* Minimum ethernet data length */
 
#define PKT_HDR_LEN   14 /* Addresses and data length info */
 
#define FAKE_FRAME_LEN   (MAX_PKT_SZ + 1)
 
#define QUEUE_PKT_TIMEOUT   (3*HZ) /* 3 second timeout */
 
#define DE4X5_EISA_IO_PORTS   0x0c00 /* I/O port base address, slot 0 */
 
#define DE4X5_EISA_TOTAL_SIZE   0x100 /* I/O address extent */
 
#define EISA_ALLOWED_IRQ_LIST   {5, 9, 10, 11}
 
#define DE4X5_SIGNATURE   {"DE425","DE434","DE435","DE450","DE500"}
 
#define DE4X5_NAME_LENGTH   8
 
#define PROBE_LENGTH   32
 
#define ETH_PROM_SIG   0xAA5500FFUL
 
#define PCI_MAX_BUS_NUM   8
 
#define DE4X5_PCI_TOTAL_SIZE   0x80 /* I/O address extent */
 
#define DE4X5_CLASS_CODE   0x00020000 /* Network controller, Ethernet */
 
#define DE4X5_ALIGN4   ((u_long)4 - 1) /* 1 longword align */
 
#define DE4X5_ALIGN8   ((u_long)8 - 1) /* 2 longword align */
 
#define DE4X5_ALIGN16   ((u_long)16 - 1) /* 4 longword align */
 
#define DE4X5_ALIGN32   ((u_long)32 - 1) /* 8 longword align */
 
#define DE4X5_ALIGN64   ((u_long)64 - 1) /* 16 longword align */
 
#define DE4X5_ALIGN128   ((u_long)128 - 1) /* 32 longword align */
 
#define DE4X5_ALIGN   DE4X5_ALIGN32 /* Keep the DC21040 happy... */
 
#define DE4X5_CACHE_ALIGN   CAL_16LONG
 
#define DESC_SKIP_LEN   DSL_0 /* Must agree with DESC_ALIGN */
 
#define DESC_ALIGN
 
#define ENABLE_IRQs
 
#define DISABLE_IRQs
 
#define UNMASK_IRQs
 
#define MASK_IRQs
 
#define START_DE4X5
 
#define STOP_DE4X5
 
#define RESET_SIA   outl(0, DE4X5_SICR); /* Reset SIA connectivity regs */
 
#define DE4X5_AUTOSENSE_MS   250
 
#define SUB_VENDOR_ID   0x500a
 
#define NUM_RX_DESC   8 /* Number of RX descriptors */
 
#define NUM_TX_DESC   32 /* Number of TX descriptors */
 
#define RX_BUFF_SZ   1536 /* Power of 2 for kmalloc and */
 
#define DE4X5_PKT_STAT_SZ   16
 
#define DE4X5_PKT_BIN_SZ
 
#define TX_BUFFS_AVAIL
 
#define TX_PKT_PENDING   (lp->tx_old != lp->tx_new)
 
#define INFOLEAF_SIZE   ARRAY_SIZE(infoleaf_array)
 
#define COMPACT   (ARRAY_SIZE(dc_infoblock) - 1)
 
#define RESET_DE4X5
 
#define PHY_HARD_RESET
 
#define SAMPLE_INTERVAL   500 /* ms */
 
#define SAMPLE_DELAY   2000 /* ms */
 
#define DE4X5_DUMP   0x0f /* Dump the DE4X5 Status */
 

Functions

 module_param (io, int, 0)
 
 module_param (de4x5_debug, int, 0)
 
 module_param (dec_only, int, 0)
 
 module_param (args, charp, 0)
 
 MODULE_PARM_DESC (io,"de4x5 I/O base address")
 
 MODULE_PARM_DESC (de4x5_debug,"de4x5 debug mask")
 
 MODULE_PARM_DESC (dec_only,"de4x5 probe only for Digital boards (0-1)")
 
 MODULE_PARM_DESC (args,"de4x5 full duplex and media type settings; see de4x5.c for details")
 
 MODULE_LICENSE ("GPL")
 
 module_init (de4x5_module_init)
 
 module_exit (de4x5_module_exit)
 

Macro Definition Documentation

#define ACCTON   2

Definition at line 562 of file de4x5.c.

#define c_char   const char

Definition at line 485 of file de4x5.c.

#define COMPACT   (ARRAY_SIZE(dc_infoblock) - 1)

Definition at line 1057 of file de4x5.c.

#define DE4X5_ALIGN   DE4X5_ALIGN32 /* Keep the DC21040 happy... */

Definition at line 666 of file de4x5.c.

#define DE4X5_ALIGN128   ((u_long)128 - 1) /* 32 longword align */

Definition at line 664 of file de4x5.c.

#define DE4X5_ALIGN16   ((u_long)16 - 1) /* 4 longword align */

Definition at line 661 of file de4x5.c.

#define DE4X5_ALIGN32   ((u_long)32 - 1) /* 8 longword align */

Definition at line 662 of file de4x5.c.

#define DE4X5_ALIGN4   ((u_long)4 - 1) /* 1 longword align */

Definition at line 659 of file de4x5.c.

#define DE4X5_ALIGN64   ((u_long)64 - 1) /* 16 longword align */

Definition at line 663 of file de4x5.c.

#define DE4X5_ALIGN8   ((u_long)8 - 1) /* 2 longword align */

Definition at line 660 of file de4x5.c.

#define DE4X5_AUTOSENSE_MS   250 /* msec autosense tick (DE500) */

Definition at line 726 of file de4x5.c.

#define DE4X5_AUTOSENSE_MS   250

Definition at line 726 of file de4x5.c.

#define DE4X5_CACHE_ALIGN   CAL_16LONG

Definition at line 667 of file de4x5.c.

#define DE4X5_CLASS_CODE   0x00020000 /* Network controller, Ethernet */

Definition at line 651 of file de4x5.c.

#define DE4X5_DUMP   0x0f /* Dump the DE4X5 Status */
#define DE4X5_EISA_IO_PORTS   0x0c00 /* I/O port base address, slot 0 */

Definition at line 630 of file de4x5.c.

#define DE4X5_EISA_TOTAL_SIZE   0x100 /* I/O address extent */

Definition at line 631 of file de4x5.c.

#define DE4X5_MAX_PHY   8 /* Allow up to 8 attached PHY devices per board */

Definition at line 520 of file de4x5.c.

#define DE4X5_NAME_LENGTH   8

Definition at line 636 of file de4x5.c.

#define DE4X5_NDA   0xffe0 /* No Device (I/O) Address */

Definition at line 606 of file de4x5.c.

#define DE4X5_PCI_TOTAL_SIZE   0x80 /* I/O address extent */

Definition at line 650 of file de4x5.c.

#define DE4X5_PKT_BIN_SZ
Value:
128 /* Should be >=100 unless you
increase DE4X5_PKT_STAT_SZ */

Definition at line 770 of file de4x5.c.

#define DE4X5_PKT_STAT_SZ   16

Definition at line 769 of file de4x5.c.

#define DE4X5_SIGNATURE   {"DE425","DE434","DE435","DE450","DE500"}

Definition at line 635 of file de4x5.c.

#define DESC_ALIGN

Definition at line 670 of file de4x5.c.

#define DESC_SKIP_LEN   DSL_0 /* Must agree with DESC_ALIGN */

Definition at line 668 of file de4x5.c.

#define DISABLE_IRQs
Value:
{\
imr = inl(DE4X5_IMR);\
imr &= ~lp->irq_en;\
outl(imr, DE4X5_IMR); /* Disable the IRQs */\
}

Definition at line 686 of file de4x5.c.

#define EISA_ALLOWED_IRQ_LIST   {5, 9, 10, 11}

Definition at line 633 of file de4x5.c.

#define ENABLE_IRQs
Value:
{ \
imr |= lp->irq_en;\
outl(imr, DE4X5_IMR); /* Enable the IRQs */\
}

Definition at line 681 of file de4x5.c.

#define ETH_PROM_SIG   0xAA5500FFUL

Definition at line 644 of file de4x5.c.

#define ETH_PROM_SIG   0xAA5500FFUL

Definition at line 644 of file de4x5.c.

#define FAKE_FRAME_LEN   (MAX_PKT_SZ + 1)

Definition at line 623 of file de4x5.c.

#define GENERIC_MASK   MII_ANLPA_100M /* All 100Mb/s Technologies */

Definition at line 550 of file de4x5.c.

#define GENERIC_REG   0x05 /* Autoneg. Link Partner Advertisement Reg. */

Definition at line 549 of file de4x5.c.

#define GENERIC_VALUE   MII_ANLPA_100M /* 100B-TX, 100B-TX FDX, 100B-T4 */

Definition at line 551 of file de4x5.c.

#define IEEE802_3_SZ   1518 /* Packet + CRC */

Definition at line 618 of file de4x5.c.

#define INFOLEAF_SIZE   ARRAY_SIZE(infoleaf_array)

Definition at line 1042 of file de4x5.c.

#define MASK_IRQs
Value:
{\
imr = inl(DE4X5_IMR);\
imr &= ~lp->irq_mask;\
outl(imr, DE4X5_IMR); /* Mask the IRQs */\
}

Definition at line 697 of file de4x5.c.

#define MAX_DAT_SZ   1500 /* Maximum ethernet data length */

Definition at line 620 of file de4x5.c.

#define MAX_PKT_SZ   1514 /* Maximum ethernet packet length */

Definition at line 619 of file de4x5.c.

#define MIN_DAT_SZ   1 /* Minimum ethernet data length */

Definition at line 621 of file de4x5.c.

#define NUM_RX_DESC   8 /* Number of RX descriptors */

Definition at line 753 of file de4x5.c.

#define NUM_TX_DESC   32 /* Number of TX descriptors */

Definition at line 754 of file de4x5.c.

#define PCI_MAX_BUS_NUM   8

Definition at line 649 of file de4x5.c.

#define PHY_HARD_RESET
Value:
{\
outl(GEP_HRST, DE4X5_GEP); /* Hard RESET the PHY dev. */\
mdelay(1); /* Assert for 1ms */\
outl(0x00, DE4X5_GEP);\
mdelay(2); /* Wait for 2ms */\
}

Definition at line 1074 of file de4x5.c.

#define PKT_BUF_SZ   1536 /* Buffer size for each Tx/Rx buffer */

Definition at line 617 of file de4x5.c.

#define PKT_HDR_LEN   14 /* Addresses and data length info */

Definition at line 622 of file de4x5.c.

#define PROBE_LENGTH   32

Definition at line 643 of file de4x5.c.

#define PROBE_LENGTH   32

Definition at line 643 of file de4x5.c.

#define QUEUE_PKT_TIMEOUT   (3*HZ) /* 3 second timeout */

Definition at line 624 of file de4x5.c.

#define RESET_DE4X5
Value:
{\
int i;\
mdelay(1);\
outl(i | BMR_SWR, DE4X5_BMR);\
mdelay(1);\
outl(i, DE4X5_BMR);\
mdelay(1);\
for (i=0;i<5;i++) {inl(DE4X5_BMR); mdelay(1);}\
mdelay(1);\
}

Definition at line 1062 of file de4x5.c.

#define RESET_SIA   outl(0, DE4X5_SICR); /* Reset SIA connectivity regs */

Definition at line 721 of file de4x5.c.

#define RX_BUFF_SZ   1536 /* Power of 2 for kmalloc and */

Definition at line 755 of file de4x5.c.

#define SAMPLE_DELAY   2000 /* ms */

Definition at line 3385 of file de4x5.c.

#define SAMPLE_INTERVAL   500 /* ms */

Definition at line 3384 of file de4x5.c.

#define SMC   1

Definition at line 561 of file de4x5.c.

#define START_DE4X5
Value:
{\
omr = inl(DE4X5_OMR);\
omr |= OMR_ST | OMR_SR;\
outl(omr, DE4X5_OMR); /* Enable the TX and/or RX */\
}

Definition at line 706 of file de4x5.c.

#define STOP_DE4X5
Value:
{\
omr = inl(DE4X5_OMR);\
omr &= ~(OMR_ST|OMR_SR);\
outl(omr, DE4X5_OMR); /* Disable the TX and/or RX */ \
}

Definition at line 712 of file de4x5.c.

#define SUB_VENDOR_ID   0x500a

Definition at line 743 of file de4x5.c.

#define TX_BUFFS_AVAIL
Value:
((lp->tx_old<=lp->tx_new)?\
lp->tx_old+lp->txRingSize-lp->tx_new-1:\
lp->tx_old -lp->tx_new-1)

Definition at line 887 of file de4x5.c.

#define TX_PKT_PENDING   (lp->tx_old != lp->tx_new)

Definition at line 891 of file de4x5.c.

#define UNMASK_IRQs
Value:
{\
imr |= lp->irq_mask;\
outl(imr, DE4X5_IMR); /* Unmask the IRQs */\
}

Definition at line 692 of file de4x5.c.

Function Documentation

module_exit ( de4x5_module_exit  )
module_init ( de4x5_module_init  )
MODULE_LICENSE ( "GPL"  )
module_param ( io  ,
int  ,
 
)
module_param ( de4x5_debug  ,
int  ,
 
)
module_param ( dec_only  ,
int  ,
 
)
module_param ( args  ,
charp  ,
 
)
MODULE_PARM_DESC ( io  ,
"de4x5 I/O base address  
)
MODULE_PARM_DESC ( de4x5_debug  ,
"de4x5 debug mask  
)
MODULE_PARM_DESC ( dec_only  ,
"de4x5 probe only for Digital boards (0-1)"   
)
MODULE_PARM_DESC ( args  ,
"de4x5 full duplex and media type settings; see de4x5.c for details"   
)

Variable Documentation

Definition at line 877 of file de4x5.c.

int bus

Definition at line 875 of file de4x5.c.

Definition at line 874 of file de4x5.c.

uint8_t irq

Definition at line 876 of file de4x5.c.