Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
uli526x.c File Reference
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/timer.h>
#include <linux/errno.h>
#include <linux/ioport.h>
#include <linux/interrupt.h>
#include <linux/pci.h>
#include <linux/init.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/ethtool.h>
#include <linux/skbuff.h>
#include <linux/delay.h>
#include <linux/spinlock.h>
#include <linux/dma-mapping.h>
#include <linux/bitops.h>
#include <asm/processor.h>
#include <asm/io.h>
#include <asm/dma.h>
#include <asm/uaccess.h>

Go to the source code of this file.

Data Structures

struct  tx_desc
 
struct  rx_desc
 
struct  uli526x_board_info
 
struct  uli526x_board_info::uli_phy_ops
 

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define DRV_NAME   "uli526x"
 
#define DRV_VERSION   "0.9.3"
 
#define DRV_RELDATE   "2005-7-29"
 
#define uw32(reg, val)   iowrite32(val, ioaddr + (reg))
 
#define ur32(reg)   ioread32(ioaddr + (reg))
 
#define PCI_ULI5261_ID   0x526110B9 /* ULi M5261 ID*/
 
#define PCI_ULI5263_ID   0x526310B9 /* ULi M5263 ID*/
 
#define ULI526X_IO_SIZE   0x100
 
#define TX_DESC_CNT   0x20 /* Allocated Tx descriptors */
 
#define RX_DESC_CNT   0x30 /* Allocated Rx descriptors */
 
#define TX_FREE_DESC_CNT   (TX_DESC_CNT - 2) /* Max TX packet count */
 
#define TX_WAKE_DESC_CNT   (TX_DESC_CNT - 3) /* TX wakeup count */
 
#define DESC_ALL_CNT   (TX_DESC_CNT + RX_DESC_CNT)
 
#define TX_BUF_ALLOC   0x600
 
#define RX_ALLOC_SIZE   0x620
 
#define ULI526X_RESET   1
 
#define CR0_DEFAULT   0
 
#define CR6_DEFAULT   0x22200000
 
#define CR7_DEFAULT   0x180c1
 
#define CR15_DEFAULT   0x06 /* TxJabber RxWatchdog */
 
#define TDES0_ERR_MASK   0x4302 /* TXJT, LC, EC, FUE */
 
#define MAX_PACKET_SIZE   1514
 
#define ULI5261_MAX_MULTICAST   14
 
#define RX_COPY_SIZE   100
 
#define MAX_CHECK_PACKET   0x8000
 
#define ULI526X_10MHF   0
 
#define ULI526X_100MHF   1
 
#define ULI526X_10MFD   4
 
#define ULI526X_100MFD   5
 
#define ULI526X_AUTO   8
 
#define ULI526X_TXTH_72   0x400000 /* TX TH 72 byte */
 
#define ULI526X_TXTH_96   0x404000 /* TX TH 96 byte */
 
#define ULI526X_TXTH_128   0x0000 /* TX TH 128 byte */
 
#define ULI526X_TXTH_256   0x4000 /* TX TH 256 byte */
 
#define ULI526X_TXTH_512   0x8000 /* TX TH 512 byte */
 
#define ULI526X_TXTH_1K   0xC000 /* TX TH 1K byte */
 
#define ULI526X_TIMER_WUT   (jiffies + HZ * 1)/* timer wakeup time : 1 second */
 
#define ULI526X_TX_TIMEOUT   ((16*HZ)/2) /* tx packet time-out time 8 s" */
 
#define ULI526X_TX_KICK   (4*HZ/2) /* tx packet Kick-out time 2 s" */
 
#define ULI526X_DBUG(dbug_now, msg, value)
 
#define SHOW_MEDIA_TYPE(mode)
 
#define CR9_SROM_READ   0x4800
 
#define CR9_SRCS   0x1
 
#define CR9_SRCLK   0x2
 
#define CR9_CRDOUT   0x8
 
#define SROM_DATA_0   0x0
 
#define SROM_DATA_1   0x4
 
#define PHY_DATA_1   0x20000
 
#define PHY_DATA_0   0x00000
 
#define MDCLKH   0x10000
 
#define PHY_POWER_DOWN   0x800
 
#define SROM_V41_CODE   0x14
 
#define uli526x_suspend   NULL
 
#define uli526x_resume   NULL
 
#define FLT_SHIFT   0
 

Enumerations

enum  uli526x_offsets {
  DCR0 = 0x00, DCR1 = 0x08, DCR2 = 0x10, DCR3 = 0x18,
  DCR4 = 0x20, DCR5 = 0x28, DCR6 = 0x30, DCR7 = 0x38,
  DCR8 = 0x40, DCR9 = 0x48, DCR10 = 0x50, DCR11 = 0x58,
  DCR12 = 0x60, DCR13 = 0x68, DCR14 = 0x70, DCR15 = 0x78
}
 
enum  uli526x_CR6_bits {
  CR6_RXSC = 0x2, CR6_PBF = 0x8, CR6_PM = 0x40, CR6_PAM = 0x80,
  CR6_FDM = 0x200, CR6_TXSC = 0x2000, CR6_STI = 0x100000, CR6_SFT = 0x200000,
  CR6_RXA = 0x40000000, CR6_NO_PURGE = 0x20000000
}
 

Functions

struct tx_desc __attribute__ ((aligned(32)))
 
 MODULE_DEVICE_TABLE (pci, uli526x_pci_tbl)
 
 MODULE_AUTHOR ("Peer Chen, [email protected]")
 
 MODULE_DESCRIPTION ("ULi M5261/M5263 fast ethernet driver")
 
 MODULE_LICENSE ("GPL")
 
 module_param (debug, int, 0644)
 
 module_param (mode, int, 0)
 
 module_param (cr6set, int, 0)
 
 MODULE_PARM_DESC (debug,"ULi M5261/M5263 enable debugging (0-1)")
 
 MODULE_PARM_DESC (mode,"ULi M5261/M5263: Bit 0: 10/100Mbps, bit 2: duplex, bit 8: HomePNA")
 
 module_init (uli526x_init_module)
 
 module_exit (uli526x_cleanup_module)
 

Variables

__le32 tdes0
 
__le32 tdes1
 
__le32 tdes2
 
__le32 tdes3
 
chartx_buf_ptr
 
struct tx_descnext_tx_desc
 
__le32 rdes0
 
__le32 rdes1
 
__le32 rdes2
 
__le32 rdes3
 
struct sk_buffrx_skb_ptr
 
struct rx_descnext_rx_desc
 
struct uli526x_board_info __attribute__
 

Macro Definition Documentation

#define CR0_DEFAULT   0

Definition at line 61 of file uli526x.c.

#define CR15_DEFAULT   0x06 /* TxJabber RxWatchdog */

Definition at line 64 of file uli526x.c.

#define CR6_DEFAULT   0x22200000

Definition at line 62 of file uli526x.c.

#define CR7_DEFAULT   0x180c1

Definition at line 63 of file uli526x.c.

#define CR9_CRDOUT   0x8

Definition at line 104 of file uli526x.c.

#define CR9_SRCLK   0x2

Definition at line 103 of file uli526x.c.

#define CR9_SRCS   0x1

Definition at line 102 of file uli526x.c.

#define CR9_SROM_READ   0x4800

Definition at line 101 of file uli526x.c.

#define DESC_ALL_CNT   (TX_DESC_CNT + RX_DESC_CNT)

Definition at line 57 of file uli526x.c.

#define DRV_NAME   "uli526x"

Definition at line 17 of file uli526x.c.

#define DRV_RELDATE   "2005-7-29"

Definition at line 19 of file uli526x.c.

#define DRV_VERSION   "0.9.3"

Definition at line 18 of file uli526x.c.

#define FLT_SHIFT   0

Definition at line 1387 of file uli526x.c.

#define MAX_CHECK_PACKET   0x8000

Definition at line 69 of file uli526x.c.

#define MAX_PACKET_SIZE   1514

Definition at line 66 of file uli526x.c.

#define MDCLKH   0x10000

Definition at line 109 of file uli526x.c.

#define PCI_ULI5261_ID   0x526110B9 /* ULi M5261 ID*/

Definition at line 49 of file uli526x.c.

#define PCI_ULI5263_ID   0x526310B9 /* ULi M5263 ID*/

Definition at line 50 of file uli526x.c.

#define PHY_DATA_0   0x00000

Definition at line 108 of file uli526x.c.

#define PHY_DATA_1   0x20000

Definition at line 107 of file uli526x.c.

#define PHY_POWER_DOWN   0x800

Definition at line 111 of file uli526x.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 15 of file uli526x.c.

#define RX_ALLOC_SIZE   0x620

Definition at line 59 of file uli526x.c.

#define RX_COPY_SIZE   100

Definition at line 68 of file uli526x.c.

#define RX_DESC_CNT   0x30 /* Allocated Rx descriptors */

Definition at line 54 of file uli526x.c.

#define SHOW_MEDIA_TYPE (   mode)
Value:
pr_err("Change Speed to %sMhz %s duplex\n", \
mode & 1 ? "100" : "10", \
mode & 4 ? "full" : "half");

Definition at line 94 of file uli526x.c.

#define SROM_DATA_0   0x0

Definition at line 105 of file uli526x.c.

#define SROM_DATA_1   0x4

Definition at line 106 of file uli526x.c.

#define SROM_V41_CODE   0x14

Definition at line 113 of file uli526x.c.

#define TDES0_ERR_MASK   0x4302 /* TXJT, LC, EC, FUE */

Definition at line 65 of file uli526x.c.

#define TX_BUF_ALLOC   0x600

Definition at line 58 of file uli526x.c.

#define TX_DESC_CNT   0x20 /* Allocated Tx descriptors */

Definition at line 53 of file uli526x.c.

#define TX_FREE_DESC_CNT   (TX_DESC_CNT - 2) /* Max TX packet count */

Definition at line 55 of file uli526x.c.

#define TX_WAKE_DESC_CNT   (TX_DESC_CNT - 3) /* TX wakeup count */

Definition at line 56 of file uli526x.c.

#define ULI5261_MAX_MULTICAST   14

Definition at line 67 of file uli526x.c.

#define ULI526X_100MFD   5

Definition at line 74 of file uli526x.c.

#define ULI526X_100MHF   1

Definition at line 72 of file uli526x.c.

#define ULI526X_10MFD   4

Definition at line 73 of file uli526x.c.

#define ULI526X_10MHF   0

Definition at line 71 of file uli526x.c.

#define ULI526X_AUTO   8

Definition at line 75 of file uli526x.c.

#define ULI526X_DBUG (   dbug_now,
  msg,
  value 
)
Value:
do { \
if (uli526x_debug || (dbug_now)) \
pr_err("%s %lx\n", (msg), (long) (value)); \
} while (0)

Definition at line 88 of file uli526x.c.

#define ULI526X_IO_SIZE   0x100

Definition at line 52 of file uli526x.c.

#define ULI526X_RESET   1

Definition at line 60 of file uli526x.c.

#define uli526x_resume   NULL

Definition at line 1259 of file uli526x.c.

#define uli526x_suspend   NULL

Definition at line 1258 of file uli526x.c.

#define ULI526X_TIMER_WUT   (jiffies + HZ * 1)/* timer wakeup time : 1 second */

Definition at line 84 of file uli526x.c.

#define ULI526X_TX_KICK   (4*HZ/2) /* tx packet Kick-out time 2 s" */

Definition at line 86 of file uli526x.c.

#define ULI526X_TX_TIMEOUT   ((16*HZ)/2) /* tx packet time-out time 8 s" */

Definition at line 85 of file uli526x.c.

#define ULI526X_TXTH_128   0x0000 /* TX TH 128 byte */

Definition at line 79 of file uli526x.c.

#define ULI526X_TXTH_1K   0xC000 /* TX TH 1K byte */

Definition at line 82 of file uli526x.c.

#define ULI526X_TXTH_256   0x4000 /* TX TH 256 byte */

Definition at line 80 of file uli526x.c.

#define ULI526X_TXTH_512   0x8000 /* TX TH 512 byte */

Definition at line 81 of file uli526x.c.

#define ULI526X_TXTH_72   0x400000 /* TX TH 72 byte */

Definition at line 77 of file uli526x.c.

#define ULI526X_TXTH_96   0x404000 /* TX TH 96 byte */

Definition at line 78 of file uli526x.c.

#define ur32 (   reg)    ioread32(ioaddr + (reg))

Definition at line 46 of file uli526x.c.

#define uw32 (   reg,
  val 
)    iowrite32(val, ioaddr + (reg))

Definition at line 45 of file uli526x.c.

Enumeration Type Documentation

Enumerator:
CR6_RXSC 
CR6_PBF 
CR6_PM 
CR6_PAM 
CR6_FDM 
CR6_TXSC 
CR6_STI 
CR6_SFT 
CR6_RXA 
CR6_NO_PURGE 

Definition at line 200 of file uli526x.c.

Enumerator:
DCR0 
DCR1 
DCR2 
DCR3 
DCR4 
DCR5 
DCR6 
DCR7 
DCR8 
DCR9 
DCR10 
DCR11 
DCR12 
DCR13 
DCR14 
DCR15 

Definition at line 193 of file uli526x.c.

Function Documentation

MODULE_AUTHOR ( "Peer  Chen,
peer.chen @uli.com.tw"   
)
MODULE_DESCRIPTION ( "ULi M5261/M5263 fast ethernet driver )
MODULE_DEVICE_TABLE ( pci  ,
uli526x_pci_tbl   
)
module_exit ( uli526x_cleanup_module  )
module_init ( uli526x_init_module  )
MODULE_LICENSE ( "GPL"  )
module_param ( debug  ,
int  ,
0644   
)
module_param ( mode  ,
int  ,
 
)
module_param ( cr6set  ,
int  ,
 
)
MODULE_PARM_DESC ( debug  ,
"ULi M5261/M5263 enable debugging (0-1)"   
)
MODULE_PARM_DESC ( mode  ,
"ULi M5261/M5263: Bit 0: 10/  100Mbps,
bit 2:duplex  ,
bit 8:HomePNA"   
)

Variable Documentation

struct rx_desc* next_rx_desc

Definition at line 129 of file uli526x.c.

struct tx_desc* next_tx_desc

Definition at line 123 of file uli526x.c.

__le32 rdes0

Definition at line 127 of file uli526x.c.

__le32 rdes1

Definition at line 127 of file uli526x.c.

__le32 rdes2

Definition at line 127 of file uli526x.c.

__le32 rdes3

Definition at line 127 of file uli526x.c.

struct sk_buff* rx_skb_ptr

Definition at line 128 of file uli526x.c.

__le32 tdes0

Definition at line 121 of file uli526x.c.

__le32 tdes1

Definition at line 121 of file uli526x.c.

__le32 tdes2

Definition at line 121 of file uli526x.c.

__le32 tdes3

Definition at line 121 of file uli526x.c.

char* tx_buf_ptr

Definition at line 122 of file uli526x.c.