Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
cassini.c File Reference
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/compiler.h>
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/vmalloc.h>
#include <linux/ioport.h>
#include <linux/pci.h>
#include <linux/mm.h>
#include <linux/highmem.h>
#include <linux/list.h>
#include <linux/dma-mapping.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/ethtool.h>
#include <linux/crc32.h>
#include <linux/random.h>
#include <linux/mii.h>
#include <linux/ip.h>
#include <linux/tcp.h>
#include <linux/mutex.h>
#include <linux/firmware.h>
#include <net/checksum.h>
#include <linux/atomic.h>
#include <asm/io.h>
#include <asm/byteorder.h>
#include <asm/uaccess.h>
#include "cassini.h"

Go to the source code of this file.

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define cas_page_map(x)   kmap_atomic((x))
 
#define cas_page_unmap(x)   kunmap_atomic((x))
 
#define CAS_NCPUS   num_online_cpus()
 
#define cas_skb_release(x)   netif_rx(x)
 
#define USE_HP_WORKAROUND
 
#define HP_WORKAROUND_DEFAULT   /* select which firmware to use as default */
 
#define CAS_HP_ALT_FIRMWARE   cas_prog_null /* alternate firmware */
 
#define USE_TX_COMPWB   /* use completion writeback registers */
 
#define USE_CSMA_CD_PROTO   /* standard CSMA/CD */
 
#define USE_RX_BLANK   /* hw interrupt mitigation */
 
#define USE_PAGE_ORDER   /* specify to allocate large rx pages */
 
#define RX_DONT_BATCH   0 /* if 1, don't batch flows */
 
#define RX_COPY_ALWAYS   0 /* if 0, use frags */
 
#define RX_COPY_MIN   64 /* copy a little to make upper layers happy */
 
#define DRV_MODULE_NAME   "cassini"
 
#define DRV_MODULE_VERSION   "1.6"
 
#define DRV_MODULE_RELDATE   "21 May 2008"
 
#define CAS_DEF_MSG_ENABLE
 
#define CAS_TX_TIMEOUT   (HZ)
 
#define CAS_LINK_TIMEOUT   (22*HZ/10)
 
#define CAS_LINK_FAST_TIMEOUT   (1)
 
#define STOP_TRIES_PHY   1000
 
#define STOP_TRIES   5000
 
#define CAS_MIN_FRAME   97
 
#define CAS_1000MB_MIN_FRAME   255
 
#define CAS_MIN_MTU   60
 
#define CAS_MAX_MTU   min(((cp->page_size << 1) - 0x50), 9000)
 
#define DEFAULT_LINKDOWN_TIMEOUT   5
 
#define cas_lock_all_save(cp, flags)
 
#define cas_unlock_all_restore(cp, flags)
 
#define RX_USED_ADD(x, y)
 
#define RX_USED_SET(x, y)
 
#define CAS_TABORT(x)   (((x)->cas_flags & CAS_FLAG_TARGET_ABORT) ? 2 : 1)
 
#define CAS_ROUND_PAGE(x)   (((x) + PAGE_SIZE - 1) & PAGE_MASK)
 
#define VPD_FOUND_MAC   0x01
 
#define VPD_FOUND_PHY   0x02
 
#define CAS_NUM_STAT_KEYS   ARRAY_SIZE(ethtool_cassini_statnames)
 
#define CAS_REG_LEN   ARRAY_SIZE(ethtool_register_table)
 
#define CAS_MAX_REGS   (sizeof (u32)*CAS_REG_LEN)
 

Functions

 MODULE_AUTHOR ("Adrian Sun ([email protected])")
 
 MODULE_DESCRIPTION ("Sun Cassini(+) ethernet driver")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_FIRMWARE ("sun/cassini.bin")
 
 module_param (cassini_debug, int, 0)
 
 MODULE_PARM_DESC (cassini_debug,"Cassini bitmapped debugging message enable value")
 
 module_param (link_mode, int, 0)
 
 MODULE_PARM_DESC (link_mode,"default link mode")
 
 module_param (linkdown_timeout, int, 0)
 
 MODULE_PARM_DESC (linkdown_timeout,"min reset interval in sec. for PCS linkdown issue; disabled if not positive")
 
 MODULE_DEVICE_TABLE (pci, cas_pci_tbl)
 
 module_init (cas_init)
 
 module_exit (cas_cleanup)
 

Macro Definition Documentation

#define CAS_1000MB_MIN_FRAME   255

Definition at line 173 of file cassini.c.

#define CAS_DEF_MSG_ENABLE
Value:
NETIF_MSG_PROBE | \
NETIF_MSG_LINK | \
NETIF_MSG_TIMER | \
NETIF_MSG_IFDOWN | \
NETIF_MSG_IFUP | \
NETIF_MSG_RX_ERR | \
NETIF_MSG_TX_ERR)

Definition at line 145 of file cassini.c.

#define CAS_HP_ALT_FIRMWARE   cas_prog_null /* alternate firmware */

Definition at line 115 of file cassini.c.

#define CAS_LINK_FAST_TIMEOUT   (1)

Definition at line 160 of file cassini.c.

#define CAS_LINK_TIMEOUT   (22*HZ/10)

Definition at line 159 of file cassini.c.

#define cas_lock_all_save (   cp,
  flags 
)
Value:
do { \
struct cas *xxxcp = (cp); \
spin_lock_irqsave(&xxxcp->lock, flags); \
cas_lock_tx(xxxcp); \
} while (0)

Definition at line 268 of file cassini.c.

#define CAS_MAX_MTU   min(((cp->page_size << 1) - 0x50), 9000)

Definition at line 175 of file cassini.c.

#define CAS_MAX_REGS   (sizeof (u32)*CAS_REG_LEN)

Definition at line 4396 of file cassini.c.

#define CAS_MIN_FRAME   97

Definition at line 172 of file cassini.c.

#define CAS_MIN_MTU   60

Definition at line 174 of file cassini.c.

#define CAS_NCPUS   num_online_cpus()

Definition at line 108 of file cassini.c.

#define CAS_NUM_STAT_KEYS   ARRAY_SIZE(ethtool_cassini_statnames)

Definition at line 4371 of file cassini.c.

#define cas_page_map (   x)    kmap_atomic((x))

Definition at line 106 of file cassini.c.

#define cas_page_unmap (   x)    kunmap_atomic((x))

Definition at line 107 of file cassini.c.

#define CAS_REG_LEN   ARRAY_SIZE(ethtool_register_table)

Definition at line 4395 of file cassini.c.

#define CAS_ROUND_PAGE (   x)    (((x) + PAGE_SIZE - 1) & PAGE_MASK)

Definition at line 1844 of file cassini.c.

#define cas_skb_release (   x)    netif_rx(x)

Definition at line 110 of file cassini.c.

#define CAS_TABORT (   x)    (((x)->cas_flags & CAS_FLAG_TARGET_ABORT) ? 2 : 1)

Definition at line 1843 of file cassini.c.

#define CAS_TX_TIMEOUT   (HZ)

Definition at line 158 of file cassini.c.

#define cas_unlock_all_restore (   cp,
  flags 
)
Value:
do { \
struct cas *xxxcp = (cp); \
cas_unlock_tx(xxxcp); \
spin_unlock_irqrestore(&xxxcp->lock, flags); \
} while (0)

Definition at line 289 of file cassini.c.

#define DEFAULT_LINKDOWN_TIMEOUT   5

Definition at line 207 of file cassini.c.

#define DRV_MODULE_NAME   "cassini"

Definition at line 141 of file cassini.c.

#define DRV_MODULE_RELDATE   "21 May 2008"

Definition at line 143 of file cassini.c.

#define DRV_MODULE_VERSION   "1.6"

Definition at line 142 of file cassini.c.

#define HP_WORKAROUND_DEFAULT   /* select which firmware to use as default */

Definition at line 114 of file cassini.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 69 of file cassini.c.

#define RX_COPY_ALWAYS   0 /* if 0, use frags */

Definition at line 137 of file cassini.c.

#define RX_COPY_MIN   64 /* copy a little to make upper layers happy */

Definition at line 138 of file cassini.c.

#define RX_DONT_BATCH   0 /* if 1, don't batch flows */

Definition at line 136 of file cassini.c.

#define RX_USED_ADD (   x,
  y 
)

Definition at line 483 of file cassini.c.

#define RX_USED_SET (   x,
  y 
)

Definition at line 484 of file cassini.c.

#define STOP_TRIES   5000

Definition at line 166 of file cassini.c.

#define STOP_TRIES_PHY   1000

Definition at line 165 of file cassini.c.

#define USE_CSMA_CD_PROTO   /* standard CSMA/CD */

Definition at line 120 of file cassini.c.

#define USE_HP_WORKAROUND

Definition at line 113 of file cassini.c.

#define USE_PAGE_ORDER   /* specify to allocate large rx pages */

Definition at line 135 of file cassini.c.

#define USE_RX_BLANK   /* hw interrupt mitigation */

Definition at line 121 of file cassini.c.

#define USE_TX_COMPWB   /* use completion writeback registers */

Definition at line 119 of file cassini.c.

#define VPD_FOUND_MAC   0x01
#define VPD_FOUND_PHY   0x02

Function Documentation

MODULE_AUTHOR ( "Adrian Sun ([email protected])"  )
MODULE_DESCRIPTION ( "Sun Cassini(+) ethernet driver )
MODULE_DEVICE_TABLE ( pci  ,
cas_pci_tbl   
)
module_exit ( cas_cleanup  )
MODULE_FIRMWARE ( "sun/cassini.bin"  )
module_init ( cas_init  )
MODULE_LICENSE ( "GPL"  )
module_param ( cassini_debug  ,
int  ,
 
)
module_param ( link_mode  ,
int  ,
 
)
module_param ( linkdown_timeout  ,
int  ,
 
)
MODULE_PARM_DESC ( cassini_debug  ,
"Cassini bitmapped debugging message enable value  
)
MODULE_PARM_DESC ( link_mode  ,
"default link mode  
)
MODULE_PARM_DESC ( linkdown_timeout  ,
"min reset interval in sec. for PCS linkdown issue; disabled if not positive"   
)

Variable Documentation

Definition at line 4352 of file cassini.c.

const int offsets

Definition at line 4374 of file cassini.c.