Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
pch_gbe_main.c File Reference
#include "pch_gbe.h"
#include "pch_gbe_api.h"
#include <linux/module.h>

Go to the source code of this file.

Macros

#define DRV_VERSION   "1.01"
 
#define PCI_DEVICE_ID_INTEL_IOH1_GBE   0x8802 /* Pci device ID */
 
#define PCH_GBE_MAR_ENTRIES   16
 
#define PCH_GBE_SHORT_PKT   64
 
#define DSC_INIT16   0xC000
 
#define PCH_GBE_DMA_ALIGN   0
 
#define PCH_GBE_DMA_PADDING   2
 
#define PCH_GBE_WATCHDOG_PERIOD   (5 * HZ) /* watchdog time */
 
#define PCH_GBE_COPYBREAK_DEFAULT   256
 
#define PCH_GBE_PCI_BAR   1
 
#define PCH_GBE_RESERVE_MEMORY   0x200000 /* 2MB */
 
#define PCI_VENDOR_ID_ROHM   0x10db
 
#define PCI_DEVICE_ID_ROHM_ML7223_GBE   0x8013
 
#define PCI_DEVICE_ID_ROHM_ML7831_GBE   0x8802
 
#define PCH_GBE_TX_WEIGHT   64
 
#define PCH_GBE_RX_WEIGHT   64
 
#define PCH_GBE_RX_BUFFER_WRITE   16
 
#define PCH_GBE_WL_INIT_SETTING   (PCH_GBE_WLC_MP)
 
#define PCH_GBE_MAC_RGMII_CTRL_SETTING
 
#define PCH_GBE_MAX_RX_BUFFER_SIZE   0x2880
 
#define PCH_GBE_MAX_JUMBO_FRAME_SIZE   10318
 
#define PCH_GBE_FRAME_SIZE_2048   2048
 
#define PCH_GBE_FRAME_SIZE_4096   4096
 
#define PCH_GBE_FRAME_SIZE_8192   8192
 
#define PCH_GBE_GET_DESC(R, i, type)   (&(((struct type *)((R).desc))[i]))
 
#define PCH_GBE_RX_DESC(R, i)   PCH_GBE_GET_DESC(R, i, pch_gbe_rx_desc)
 
#define PCH_GBE_TX_DESC(R, i)   PCH_GBE_GET_DESC(R, i, pch_gbe_tx_desc)
 
#define PCH_GBE_DESC_UNUSED(R)
 
#define PCH_GBE_PAUSE_PKT1_VALUE   0x00C28001
 
#define PCH_GBE_PAUSE_PKT2_VALUE   0x00000100
 
#define PCH_GBE_PAUSE_PKT4_VALUE   0x01000888
 
#define PCH_GBE_PAUSE_PKT5_VALUE   0x0000FFFF
 
#define PCH_GBE_INT_ENABLE_MASK
 
#define PCH_GBE_INT_DISABLE_ALL   0
 

Functions

void pch_gbe_mac_load_mac_addr (struct pch_gbe_hw *hw)
 
s32 pch_gbe_mac_read_mac_addr (struct pch_gbe_hw *hw)
 
s32 pch_gbe_mac_force_mac_fc (struct pch_gbe_hw *hw)
 
u16 pch_gbe_mac_ctrl_miim (struct pch_gbe_hw *hw, u32 addr, u32 dir, u32 reg, u16 data)
 
void pch_gbe_reinit_locked (struct pch_gbe_adapter *adapter)
 
void pch_gbe_reset (struct pch_gbe_adapter *adapter)
 
void pch_gbe_update_stats (struct pch_gbe_adapter *adapter)
 
int pch_gbe_setup_tx_resources (struct pch_gbe_adapter *adapter, struct pch_gbe_tx_ring *tx_ring)
 
int pch_gbe_setup_rx_resources (struct pch_gbe_adapter *adapter, struct pch_gbe_rx_ring *rx_ring)
 
void pch_gbe_free_tx_resources (struct pch_gbe_adapter *adapter, struct pch_gbe_tx_ring *tx_ring)
 
void pch_gbe_free_rx_resources (struct pch_gbe_adapter *adapter, struct pch_gbe_rx_ring *rx_ring)
 
int pch_gbe_up (struct pch_gbe_adapter *adapter)
 
void pch_gbe_down (struct pch_gbe_adapter *adapter)
 
 module_init (pch_gbe_init_module)
 
 module_exit (pch_gbe_exit_module)
 
 MODULE_DESCRIPTION ("EG20T PCH Gigabit ethernet Driver")
 
 MODULE_AUTHOR ("LAPIS SEMICONDUCTOR, <[email protected]>")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_VERSION (DRV_VERSION)
 
 MODULE_DEVICE_TABLE (pci, pch_gbe_pcidev_id)
 
 module_param (copybreak, uint, 0644)
 
 MODULE_PARM_DESC (copybreak,"Maximum size of packet that is copied to a new buffer on receive")
 

Variables

const char pch_driver_version [] = DRV_VERSION
 

Macro Definition Documentation

#define DRV_VERSION   "1.01"

Definition at line 29 of file pch_gbe_main.c.

#define DSC_INIT16   0xC000

Definition at line 35 of file pch_gbe_main.c.

#define PCH_GBE_COPYBREAK_DEFAULT   256

Definition at line 39 of file pch_gbe_main.c.

#define PCH_GBE_DESC_UNUSED (   R)
Value:
((((R)->next_to_clean > (R)->next_to_use) ? 0 : (R)->count) + \
(R)->next_to_clean - (R)->next_to_use - 1)

Definition at line 72 of file pch_gbe_main.c.

#define PCH_GBE_DMA_ALIGN   0

Definition at line 36 of file pch_gbe_main.c.

#define PCH_GBE_DMA_PADDING   2

Definition at line 37 of file pch_gbe_main.c.

#define PCH_GBE_FRAME_SIZE_2048   2048

Definition at line 65 of file pch_gbe_main.c.

#define PCH_GBE_FRAME_SIZE_4096   4096

Definition at line 66 of file pch_gbe_main.c.

#define PCH_GBE_FRAME_SIZE_8192   8192

Definition at line 67 of file pch_gbe_main.c.

#define PCH_GBE_GET_DESC (   R,
  i,
  type 
)    (&(((struct type *)((R).desc))[i]))

Definition at line 69 of file pch_gbe_main.c.

#define PCH_GBE_INT_DISABLE_ALL   0

Definition at line 99 of file pch_gbe_main.c.

#define PCH_GBE_INT_ENABLE_MASK
Value:
( \
PCH_GBE_INT_RX_DMA_CMPLT | \
PCH_GBE_INT_RX_DSC_EMP | \
PCH_GBE_INT_RX_FIFO_ERR | \
PCH_GBE_INT_WOL_DET | \
PCH_GBE_INT_TX_CMPLT \
)

Definition at line 91 of file pch_gbe_main.c.

#define PCH_GBE_MAC_RGMII_CTRL_SETTING
Value:
( \
PCH_GBE_CHIP_TYPE_INTERNAL | \
PCH_GBE_RGMII_MODE_RGMII \
)

Definition at line 57 of file pch_gbe_main.c.

#define PCH_GBE_MAR_ENTRIES   16

Definition at line 33 of file pch_gbe_main.c.

#define PCH_GBE_MAX_JUMBO_FRAME_SIZE   10318

Definition at line 64 of file pch_gbe_main.c.

#define PCH_GBE_MAX_RX_BUFFER_SIZE   0x2880

Definition at line 63 of file pch_gbe_main.c.

#define PCH_GBE_PAUSE_PKT1_VALUE   0x00C28001

Definition at line 77 of file pch_gbe_main.c.

#define PCH_GBE_PAUSE_PKT2_VALUE   0x00000100

Definition at line 78 of file pch_gbe_main.c.

#define PCH_GBE_PAUSE_PKT4_VALUE   0x01000888

Definition at line 79 of file pch_gbe_main.c.

#define PCH_GBE_PAUSE_PKT5_VALUE   0x0000FFFF

Definition at line 80 of file pch_gbe_main.c.

#define PCH_GBE_PCI_BAR   1

Definition at line 40 of file pch_gbe_main.c.

#define PCH_GBE_RESERVE_MEMORY   0x200000 /* 2MB */

Definition at line 41 of file pch_gbe_main.c.

#define PCH_GBE_RX_BUFFER_WRITE   16

Definition at line 52 of file pch_gbe_main.c.

#define PCH_GBE_RX_DESC (   R,
  i 
)    PCH_GBE_GET_DESC(R, i, pch_gbe_rx_desc)

Definition at line 70 of file pch_gbe_main.c.

#define PCH_GBE_RX_WEIGHT   64

Definition at line 51 of file pch_gbe_main.c.

#define PCH_GBE_SHORT_PKT   64

Definition at line 34 of file pch_gbe_main.c.

#define PCH_GBE_TX_DESC (   R,
  i 
)    PCH_GBE_GET_DESC(R, i, pch_gbe_tx_desc)

Definition at line 71 of file pch_gbe_main.c.

#define PCH_GBE_TX_WEIGHT   64

Definition at line 50 of file pch_gbe_main.c.

#define PCH_GBE_WATCHDOG_PERIOD   (5 * HZ) /* watchdog time */

Definition at line 38 of file pch_gbe_main.c.

#define PCH_GBE_WL_INIT_SETTING   (PCH_GBE_WLC_MP)

Definition at line 55 of file pch_gbe_main.c.

#define PCI_DEVICE_ID_INTEL_IOH1_GBE   0x8802 /* Pci device ID */

Definition at line 32 of file pch_gbe_main.c.

#define PCI_DEVICE_ID_ROHM_ML7223_GBE   0x8013

Definition at line 45 of file pch_gbe_main.c.

#define PCI_DEVICE_ID_ROHM_ML7831_GBE   0x8802

Definition at line 48 of file pch_gbe_main.c.

#define PCI_VENDOR_ID_ROHM   0x10db

Definition at line 44 of file pch_gbe_main.c.

Function Documentation

MODULE_AUTHOR ( "LAPIS  SEMICONDUCTOR,
< tshimizu818 @gmail.com >"   
)
MODULE_DESCRIPTION ( "EG20T PCH Gigabit ethernet Driver"  )
MODULE_DEVICE_TABLE ( pci  ,
pch_gbe_pcidev_id   
)
module_exit ( pch_gbe_exit_module  )
module_init ( pch_gbe_init_module  )
MODULE_LICENSE ( "GPL"  )
module_param ( copybreak  ,
uint  ,
0644   
)
MODULE_PARM_DESC ( copybreak  ,
"Maximum size of packet that is copied to a new buffer on receive"   
)
MODULE_VERSION ( DRV_VERSION  )
void pch_gbe_down ( struct pch_gbe_adapter adapter)

pch_gbe_down - Down GbE network device : Board private structure

Definition at line 1983 of file pch_gbe_main.c.

void pch_gbe_free_rx_resources ( struct pch_gbe_adapter adapter,
struct pch_gbe_rx_ring rx_ring 
)

pch_gbe_free_rx_resources - Free Rx Resources : Board private structure : Ring to clean the resources from

Definition at line 1876 of file pch_gbe_main.c.

void pch_gbe_free_tx_resources ( struct pch_gbe_adapter adapter,
struct pch_gbe_tx_ring tx_ring 
)

pch_gbe_free_tx_resources - Free Tx Resources : Board private structure : Tx descriptor ring for a specific queue

Definition at line 1859 of file pch_gbe_main.c.

u16 pch_gbe_mac_ctrl_miim ( struct pch_gbe_hw hw,
u32  addr,
u32  dir,
u32  reg,
u16  data 
)

Definition at line 552 of file pch_gbe_main.c.

s32 pch_gbe_mac_force_mac_fc ( struct pch_gbe_hw hw)

pch_gbe_mac_force_mac_fc - Force the MAC's flow control settings : Pointer to the HW structure Returns: 0: Successful. Negative value: Failed.

Definition at line 475 of file pch_gbe_main.c.

void pch_gbe_mac_load_mac_addr ( struct pch_gbe_hw hw)
inline

Definition at line 296 of file pch_gbe_main.c.

s32 pch_gbe_mac_read_mac_addr ( struct pch_gbe_hw hw)

pch_gbe_mac_read_mac_addr - Read MAC address : Pointer to the HW structure Returns: 0: Successful.

Definition at line 307 of file pch_gbe_main.c.

void pch_gbe_reinit_locked ( struct pch_gbe_adapter adapter)

pch_gbe_reinit_locked- Re-initialization : Board private structure

Definition at line 755 of file pch_gbe_main.c.

void pch_gbe_reset ( struct pch_gbe_adapter adapter)

pch_gbe_reset - Reset GbE : Board private structure

Definition at line 765 of file pch_gbe_main.c.

int pch_gbe_setup_rx_resources ( struct pch_gbe_adapter adapter,
struct pch_gbe_rx_ring rx_ring 
)

pch_gbe_setup_rx_resources - Allocate Rx resources (Descriptors) : Board private structure : Rx descriptor ring (for a specific queue) to setup Returns: 0: Successfully Negative value: Failed

Definition at line 1818 of file pch_gbe_main.c.

int pch_gbe_setup_tx_resources ( struct pch_gbe_adapter adapter,
struct pch_gbe_tx_ring tx_ring 
)

pch_gbe_setup_tx_resources - Allocate Tx resources (Descriptors) : Board private structure : Tx descriptor ring (for a specific queue) to setup Returns: 0: Successfully Negative value: Failed

Definition at line 1771 of file pch_gbe_main.c.

int pch_gbe_up ( struct pch_gbe_adapter adapter)

pch_gbe_up - Up GbE network device : Board private structure Returns: 0: Successfully Negative value: Failed

Definition at line 1928 of file pch_gbe_main.c.

void pch_gbe_update_stats ( struct pch_gbe_adapter adapter)

pch_gbe_update_stats - Update the board statistics counters : Board private structure

Definition at line 1258 of file pch_gbe_main.c.

Variable Documentation

const char pch_driver_version[] = DRV_VERSION

Definition at line 30 of file pch_gbe_main.c.