Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
niu.c File Reference
#include <linux/module.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/pci.h>
#include <linux/dma-mapping.h>
#include <linux/netdevice.h>
#include <linux/ethtool.h>
#include <linux/etherdevice.h>
#include <linux/platform_device.h>
#include <linux/delay.h>
#include <linux/bitops.h>
#include <linux/mii.h>
#include <linux/if.h>
#include <linux/if_ether.h>
#include <linux/if_vlan.h>
#include <linux/ip.h>
#include <linux/in.h>
#include <linux/ipv6.h>
#include <linux/log2.h>
#include <linux/jiffies.h>
#include <linux/crc32.h>
#include <linux/list.h>
#include <linux/slab.h>
#include <linux/io.h>
#include <linux/of_device.h>
#include "niu.h"

Go to the source code of this file.

Data Structures

struct  niu_phy_template
 

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define DRV_MODULE_NAME   "niu"
 
#define DRV_MODULE_VERSION   "1.1"
 
#define DRV_MODULE_RELDATE   "Apr 22, 2010"
 
#define NIU_TX_TIMEOUT   (5 * HZ)
 
#define nr64(reg)   readq(np->regs + (reg))
 
#define nw64(reg, val)   writeq((val), np->regs + (reg))
 
#define nr64_mac(reg)   readq(np->mac_regs + (reg))
 
#define nw64_mac(reg, val)   writeq((val), np->mac_regs + (reg))
 
#define nr64_ipp(reg)   readq(np->regs + np->ipp_off + (reg))
 
#define nw64_ipp(reg, val)   writeq((val), np->regs + np->ipp_off + (reg))
 
#define nr64_pcs(reg)   readq(np->regs + np->pcs_off + (reg))
 
#define nw64_pcs(reg, val)   writeq((val), np->regs + np->pcs_off + (reg))
 
#define nr64_xpcs(reg)   readq(np->regs + np->xpcs_off + (reg))
 
#define nw64_xpcs(reg, val)   writeq((val), np->regs + np->xpcs_off + (reg))
 
#define NIU_MSG_DEFAULT   (NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_LINK)
 
#define niu_lock_parent(np, flags)   spin_lock_irqsave(&np->parent->lock, flags)
 
#define niu_unlock_parent(np, flags)   spin_unlock_irqrestore(&np->parent->lock, flags)
 
#define niu_set_and_wait_clear_mac(NP, REG, BITS, LIMIT, DELAY, REG_NAME)
 
#define niu_set_and_wait_clear_ipp(NP, REG, BITS, LIMIT, DELAY, REG_NAME)
 
#define niu_wait_bits_clear(NP, REG, BITS, LIMIT, DELAY)
 
#define niu_set_and_wait_clear(NP, REG, BITS, LIMIT, DELAY, REG_NAME)
 
#define NIU_TX_WAKEUP_THRESH(rp)   ((rp)->pending / 4)
 
#define NUM_XMAC_STAT_KEYS   ARRAY_SIZE(niu_xmac_stat_keys)
 
#define NUM_BMAC_STAT_KEYS   ARRAY_SIZE(niu_bmac_stat_keys)
 
#define NUM_RXCHAN_STAT_KEYS   ARRAY_SIZE(niu_rxchan_stat_keys)
 
#define NUM_TXCHAN_STAT_KEYS   ARRAY_SIZE(niu_txchan_stat_keys)
 
#define FOUND_MASK_MODEL   0x00000001
 
#define FOUND_MASK_BMODEL   0x00000002
 
#define FOUND_MASK_VERS   0x00000004
 
#define FOUND_MASK_MAC   0x00000008
 
#define FOUND_MASK_NMAC   0x00000010
 
#define FOUND_MASK_PHY   0x00000020
 
#define FOUND_MASK_ALL   0x0000003f
 

Functions

 MODULE_AUTHOR ("David S. Miller ([email protected])")
 
 MODULE_DESCRIPTION ("NIU ethernet driver")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_VERSION (DRV_MODULE_VERSION)
 
 MODULE_DEVICE_TABLE (pci, niu_pci_tbl)
 
 module_param (debug, int, 0)
 
 MODULE_PARM_DESC (debug,"NIU debug level")
 
 module_init (niu_init)
 
 module_exit (niu_exit)
 

Macro Definition Documentation

#define DRV_MODULE_NAME   "niu"

Definition at line 37 of file niu.c.

#define DRV_MODULE_RELDATE   "Apr 22, 2010"

Definition at line 39 of file niu.c.

#define DRV_MODULE_VERSION   "1.1"

Definition at line 38 of file niu.c.

#define FOUND_MASK_ALL   0x0000003f
#define FOUND_MASK_BMODEL   0x00000002
#define FOUND_MASK_MAC   0x00000008
#define FOUND_MASK_MODEL   0x00000001
#define FOUND_MASK_NMAC   0x00000010
#define FOUND_MASK_PHY   0x00000020
#define FOUND_MASK_VERS   0x00000004
#define niu_lock_parent (   np,
  flags 
)    spin_lock_irqsave(&np->parent->lock, flags)

Definition at line 93 of file niu.c.

#define NIU_MSG_DEFAULT   (NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_LINK)

Definition at line 86 of file niu.c.

#define niu_set_and_wait_clear (   NP,
  REG,
  BITS,
  LIMIT,
  DELAY,
  REG_NAME 
)
Value:
({ BUILD_BUG_ON(LIMIT <= 0 || DELAY < 0); \
__niu_set_and_wait_clear(NP, REG, BITS, LIMIT, DELAY, REG_NAME); \
})

Definition at line 209 of file niu.c.

#define niu_set_and_wait_clear_ipp (   NP,
  REG,
  BITS,
  LIMIT,
  DELAY,
  REG_NAME 
)
Value:
({ BUILD_BUG_ON(LIMIT <= 0 || DELAY < 0); \
__niu_set_and_wait_clear_ipp(NP, REG, BITS, LIMIT, DELAY, REG_NAME); \
})

Definition at line 169 of file niu.c.

#define niu_set_and_wait_clear_mac (   NP,
  REG,
  BITS,
  LIMIT,
  DELAY,
  REG_NAME 
)
Value:
({ BUILD_BUG_ON(LIMIT <= 0 || DELAY < 0); \
__niu_set_and_wait_clear_mac(NP, REG, BITS, LIMIT, DELAY, REG_NAME); \
})

Definition at line 130 of file niu.c.

#define NIU_TX_TIMEOUT   (5 * HZ)

Definition at line 69 of file niu.c.

#define NIU_TX_WAKEUP_THRESH (   rp)    ((rp)->pending / 4)

Definition at line 3600 of file niu.c.

#define niu_unlock_parent (   np,
  flags 
)    spin_unlock_irqrestore(&np->parent->lock, flags)

Definition at line 95 of file niu.c.

#define niu_wait_bits_clear (   NP,
  REG,
  BITS,
  LIMIT,
  DELAY 
)
Value:
({ BUILD_BUG_ON(LIMIT <= 0 || DELAY < 0); \
__niu_wait_bits_clear(NP, REG, BITS, LIMIT, DELAY); \
})

Definition at line 189 of file niu.c.

#define nr64 (   reg)    readq(np->regs + (reg))

Definition at line 71 of file niu.c.

#define nr64_ipp (   reg)    readq(np->regs + np->ipp_off + (reg))

Definition at line 77 of file niu.c.

#define nr64_mac (   reg)    readq(np->mac_regs + (reg))

Definition at line 74 of file niu.c.

#define nr64_pcs (   reg)    readq(np->regs + np->pcs_off + (reg))

Definition at line 80 of file niu.c.

#define nr64_xpcs (   reg)    readq(np->regs + np->xpcs_off + (reg))

Definition at line 83 of file niu.c.

#define NUM_BMAC_STAT_KEYS   ARRAY_SIZE(niu_bmac_stat_keys)

Definition at line 7739 of file niu.c.

#define NUM_RXCHAN_STAT_KEYS   ARRAY_SIZE(niu_rxchan_stat_keys)

Definition at line 7751 of file niu.c.

#define NUM_TXCHAN_STAT_KEYS   ARRAY_SIZE(niu_txchan_stat_keys)

Definition at line 7762 of file niu.c.

#define NUM_XMAC_STAT_KEYS   ARRAY_SIZE(niu_xmac_stat_keys)

Definition at line 7720 of file niu.c.

#define nw64 (   reg,
  val 
)    writeq((val), np->regs + (reg))

Definition at line 72 of file niu.c.

#define nw64_ipp (   reg,
  val 
)    writeq((val), np->regs + np->ipp_off + (reg))

Definition at line 78 of file niu.c.

#define nw64_mac (   reg,
  val 
)    writeq((val), np->mac_regs + (reg))

Definition at line 75 of file niu.c.

#define nw64_pcs (   reg,
  val 
)    writeq((val), np->regs + np->pcs_off + (reg))

Definition at line 81 of file niu.c.

#define nw64_xpcs (   reg,
  val 
)    writeq((val), np->regs + np->xpcs_off + (reg))

Definition at line 84 of file niu.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 6 of file niu.c.

Function Documentation

MODULE_AUTHOR ( "David S. Miller ([email protected])"  )
MODULE_DESCRIPTION ( "NIU ethernet driver )
MODULE_DEVICE_TABLE ( pci  ,
niu_pci_tbl   
)
module_exit ( niu_exit  )
module_init ( niu_init  )
MODULE_LICENSE ( "GPL"  )
module_param ( debug  ,
int  ,
 
)
MODULE_PARM_DESC ( debug  ,
"NIU debug level  
)
MODULE_VERSION ( DRV_MODULE_VERSION  )

Variable Documentation

Definition at line 7687 of file niu.c.