Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
stmmac_main.c File Reference
#include <linux/clk.h>
#include <linux/kernel.h>
#include <linux/interrupt.h>
#include <linux/ip.h>
#include <linux/tcp.h>
#include <linux/skbuff.h>
#include <linux/ethtool.h>
#include <linux/if_ether.h>
#include <linux/crc32.h>
#include <linux/mii.h>
#include <linux/if.h>
#include <linux/if_vlan.h>
#include <linux/dma-mapping.h>
#include <linux/slab.h>
#include <linux/prefetch.h>
#include "stmmac.h"

Go to the source code of this file.

Macros

#define DBG(nlevel, klevel, fmt, args...)   do { } while (0)
 
#define RX_DBG(fmt, args...)   do { } while (0)
 
#define TX_DBG(fmt, args...)   do { } while (0)
 
#define STMMAC_ALIGN(x)   L1_CACHE_ALIGN(x)
 
#define JUMBO_LEN   9000
 
#define TX_TIMEO   5000 /* default 5 seconds */
 
#define DMA_TX_SIZE   256
 
#define DMA_RX_SIZE   256
 
#define TC_DEFAULT   64
 
#define DMA_BUFFER_SIZE   BUF_SIZE_2KiB
 
#define STMMAC_DEFAULT_LPI_TIMER   1000
 
#define STMMAC_LPI_TIMER(x)   (jiffies + msecs_to_jiffies(x))
 
#define STMMAC_TX_THRESH(x)   (x->dma_tx_size/4)
 

Functions

 module_param (watchdog, int, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (watchdog,"Transmit timeout in milliseconds")
 
 module_param (debug, int, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (debug,"Message Level (0: no output, 16: all)")
 
 module_param (phyaddr, int, S_IRUGO)
 
 MODULE_PARM_DESC (phyaddr,"Physical device address")
 
 module_param (dma_txsize, int, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (dma_txsize,"Number of descriptors in the TX list")
 
 module_param (dma_rxsize, int, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (dma_rxsize,"Number of descriptors in the RX list")
 
 module_param (flow_ctrl, int, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (flow_ctrl,"Flow control ability [on/off]")
 
 module_param (pause, int, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (pause,"Flow Control Pause Time")
 
 module_param (tc, int, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (tc,"DMA threshold control value")
 
 module_param (buf_sz, int, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (buf_sz,"DMA buffer size")
 
 module_param (eee_timer, int, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (eee_timer,"LPI tx expiration time in msec")
 
void stmmac_disable_eee_mode (struct stmmac_priv *priv)
 
bool stmmac_eee_init (struct stmmac_priv *priv)
 
struct stmmac_privstmmac_dvr_probe (struct device *device, struct plat_stmmacenet_data *plat_dat, void __iomem *addr)
 
int stmmac_dvr_remove (struct net_device *ndev)
 
 module_init (stmmac_init)
 
 module_exit (stmmac_exit)
 
 __setup ("stmmaceth=", stmmac_cmdline_opt)
 
 MODULE_DESCRIPTION ("STMMAC 10/100/1000 Ethernet device driver")
 
 MODULE_AUTHOR ("Giuseppe Cavallaro <[email protected]>")
 
 MODULE_LICENSE ("GPL")
 

Variables

int phyaddr = -1
 

Macro Definition Documentation

#define DBG (   nlevel,
  klevel,
  fmt,
  args... 
)    do { } while (0)

Definition at line 59 of file stmmac_main.c.

#define DMA_BUFFER_SIZE   BUF_SIZE_2KiB

Definition at line 128 of file stmmac_main.c.

#define DMA_RX_SIZE   256

Definition at line 100 of file stmmac_main.c.

#define DMA_TX_SIZE   256

Definition at line 95 of file stmmac_main.c.

#define JUMBO_LEN   9000

Definition at line 79 of file stmmac_main.c.

#define RX_DBG (   fmt,
  args... 
)    do { } while (0)

Definition at line 67 of file stmmac_main.c.

#define STMMAC_ALIGN (   x)    L1_CACHE_ALIGN(x)

Definition at line 78 of file stmmac_main.c.

#define STMMAC_DEFAULT_LPI_TIMER   1000

Definition at line 137 of file stmmac_main.c.

#define STMMAC_LPI_TIMER (   x)    (jiffies + msecs_to_jiffies(x))

Definition at line 141 of file stmmac_main.c.

#define STMMAC_TX_THRESH (   x)    (x->dma_tx_size/4)

Definition at line 217 of file stmmac_main.c.

#define TC_DEFAULT   64

Definition at line 113 of file stmmac_main.c.

#define TX_DBG (   fmt,
  args... 
)    do { } while (0)

Definition at line 75 of file stmmac_main.c.

#define TX_TIMEO   5000 /* default 5 seconds */

Definition at line 82 of file stmmac_main.c.

Function Documentation

__setup ( )
MODULE_AUTHOR ( "Giuseppe Cavallaro <[email protected]>"  )
MODULE_DESCRIPTION ( "STMMAC 10/100/1000 Ethernet device driver )
module_exit ( stmmac_exit  )
module_init ( stmmac_init  )
MODULE_LICENSE ( "GPL"  )
module_param ( watchdog  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param ( debug  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param ( phyaddr  ,
int  ,
S_IRUGO   
)
module_param ( dma_txsize  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param ( dma_rxsize  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param ( flow_ctrl  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param ( pause  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param ( tc  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param ( buf_sz  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param ( eee_timer  ,
int  ,
S_IRUGO S_IWUSR 
)
MODULE_PARM_DESC ( watchdog  ,
"Transmit timeout in milliseconds"   
)
MODULE_PARM_DESC ( debug  ,
"Message Level (0: no output, 16: all)"   
)
MODULE_PARM_DESC ( phyaddr  ,
"Physical device address  
)
MODULE_PARM_DESC ( dma_txsize  ,
"Number of descriptors in the TX list  
)
MODULE_PARM_DESC ( dma_rxsize  ,
"Number of descriptors in the RX list  
)
MODULE_PARM_DESC ( flow_ctrl  ,
"Flow control ability "  [on/off] 
)
MODULE_PARM_DESC ( pause  ,
"Flow Control Pause Time  
)
MODULE_PARM_DESC ( tc  ,
"DMA threshold control value  
)
MODULE_PARM_DESC ( buf_sz  ,
"DMA buffer size  
)
MODULE_PARM_DESC ( eee_timer  ,
"LPI tx expiration time in msec  
)
void stmmac_disable_eee_mode ( struct stmmac_priv priv)

Definition at line 244 of file stmmac_main.c.

struct stmmac_priv* stmmac_dvr_probe ( struct device device,
struct plat_stmmacenet_data plat_dat,
void __iomem addr 
)
read

stmmac_dvr_probe : device pointer : platform data pointer : iobase memory address Description: this is the main probe function used to call the alloc_etherdev, allocate the priv structure.

Definition at line 2001 of file stmmac_main.c.

int stmmac_dvr_remove ( struct net_device ndev)

stmmac_dvr_remove : net device pointer Description: this function resets the TX/RX processes, disables the MAC RX/TX changes the link status, releases the DMA descriptor rings.

Definition at line 2108 of file stmmac_main.c.

bool stmmac_eee_init ( struct stmmac_priv priv)

stmmac_eee_init : private device pointer Description: If the EEE support has been enabled while configuring the driver, if the GMAC actually supports the EEE (from the HW cap reg) and the phy can also manage EEE, so enable the LPI state and start the timer to verify if the tx path can enter in LPI state.

Definition at line 276 of file stmmac_main.c.

Variable Documentation

int phyaddr = -1

Definition at line 91 of file stmmac_main.c.