Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
w5300.c File Reference
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/kconfig.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/platform_device.h>
#include <linux/platform_data/wiznet.h>
#include <linux/ethtool.h>
#include <linux/skbuff.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/io.h>
#include <linux/ioport.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/gpio.h>

Go to the source code of this file.

Data Structures

struct  w5300_priv
 

Macros

#define DRV_NAME   "w5300"
 
#define DRV_VERSION   "2012-04-04"
 
#define W5300_MR   0x0000 /* Mode Register */
 
#define MR_DBW   (1 << 15) /* Data bus width */
 
#define MR_MPF   (1 << 14) /* Mac layer pause frame */
 
#define MR_WDF(n)   (((n)&7)<<11) /* Write data fetch time */
 
#define MR_RDH   (1 << 10) /* Read data hold time */
 
#define MR_FS   (1 << 8) /* FIFO swap */
 
#define MR_RST   (1 << 7) /* S/W reset */
 
#define MR_PB   (1 << 4) /* Ping block */
 
#define MR_DBS   (1 << 2) /* Data bus swap */
 
#define MR_IND   (1 << 0) /* Indirect mode */
 
#define W5300_IR   0x0002 /* Interrupt Register */
 
#define W5300_IMR   0x0004 /* Interrupt Mask Register */
 
#define IR_S0   0x0001 /* S0 interrupt */
 
#define W5300_SHARL   0x0008 /* Source MAC address (0123) */
 
#define W5300_SHARH   0x000c /* Source MAC address (45) */
 
#define W5300_TMSRL   0x0020 /* Transmit Memory Size (0123) */
 
#define W5300_TMSRH   0x0024 /* Transmit Memory Size (4567) */
 
#define W5300_RMSRL   0x0028 /* Receive Memory Size (0123) */
 
#define W5300_RMSRH   0x002c /* Receive Memory Size (4567) */
 
#define W5300_MTYPE   0x0030 /* Memory Type */
 
#define W5300_IDR   0x00fe /* Chip ID register */
 
#define IDR_W5300   0x5300 /* =0x5300 for WIZnet W5300 */
 
#define W5300_S0_MR   0x0200 /* S0 Mode Register */
 
#define S0_MR_CLOSED   0x0000 /* Close mode */
 
#define S0_MR_MACRAW   0x0004 /* MAC RAW mode (promiscous) */
 
#define S0_MR_MACRAW_MF   0x0044 /* MAC RAW mode (filtered) */
 
#define W5300_S0_CR   0x0202 /* S0 Command Register */
 
#define S0_CR_OPEN   0x0001 /* OPEN command */
 
#define S0_CR_CLOSE   0x0010 /* CLOSE command */
 
#define S0_CR_SEND   0x0020 /* SEND command */
 
#define S0_CR_RECV   0x0040 /* RECV command */
 
#define W5300_S0_IMR   0x0204 /* S0 Interrupt Mask Register */
 
#define W5300_S0_IR   0x0206 /* S0 Interrupt Register */
 
#define S0_IR_RECV   0x0004 /* Receive interrupt */
 
#define S0_IR_SENDOK   0x0010 /* Send OK interrupt */
 
#define W5300_S0_SSR   0x0208 /* S0 Socket Status Register */
 
#define W5300_S0_TX_WRSR   0x0220 /* S0 TX Write Size Register */
 
#define W5300_S0_TX_FSR   0x0224 /* S0 TX Free Size Register */
 
#define W5300_S0_RX_RSR   0x0228 /* S0 Received data Size */
 
#define W5300_S0_TX_FIFO   0x022e /* S0 Transmit FIFO */
 
#define W5300_S0_RX_FIFO   0x0230 /* S0 Receive FIFO */
 
#define W5300_REGS_LEN   0x0400
 
#define W5300_IDM_AR   0x0002 /* Indirect Mode Address */
 
#define W5300_IDM_DR   0x0004 /* Indirect Mode Data */
 
#define w5300_read   priv->read
 
#define w5300_write   priv->write
 

Functions

 MODULE_DESCRIPTION ("WIZnet W5300 Ethernet driver v"DRV_VERSION)
 
 MODULE_AUTHOR ("Mike Sinkovsky <[email protected]>")
 
 MODULE_ALIAS ("platform:"DRV_NAME)
 
 MODULE_LICENSE ("GPL")
 
 module_platform_driver (w5300_driver)
 

Macro Definition Documentation

#define DRV_NAME   "w5300"

Definition at line 31 of file w5300.c.

#define DRV_VERSION   "2012-04-04"

Definition at line 32 of file w5300.c.

#define IDR_W5300   0x5300 /* =0x5300 for WIZnet W5300 */

Definition at line 63 of file w5300.c.

#define IR_S0   0x0001 /* S0 interrupt */

Definition at line 54 of file w5300.c.

#define MR_DBS   (1 << 2) /* Data bus swap */

Definition at line 50 of file w5300.c.

#define MR_DBW   (1 << 15) /* Data bus width */

Definition at line 43 of file w5300.c.

#define MR_FS   (1 << 8) /* FIFO swap */

Definition at line 47 of file w5300.c.

#define MR_IND   (1 << 0) /* Indirect mode */

Definition at line 51 of file w5300.c.

#define MR_MPF   (1 << 14) /* Mac layer pause frame */

Definition at line 44 of file w5300.c.

#define MR_PB   (1 << 4) /* Ping block */

Definition at line 49 of file w5300.c.

#define MR_RDH   (1 << 10) /* Read data hold time */

Definition at line 46 of file w5300.c.

#define MR_RST   (1 << 7) /* S/W reset */

Definition at line 48 of file w5300.c.

#define MR_WDF (   n)    (((n)&7)<<11) /* Write data fetch time */

Definition at line 45 of file w5300.c.

#define S0_CR_CLOSE   0x0010 /* CLOSE command */

Definition at line 70 of file w5300.c.

#define S0_CR_OPEN   0x0001 /* OPEN command */

Definition at line 69 of file w5300.c.

#define S0_CR_RECV   0x0040 /* RECV command */

Definition at line 72 of file w5300.c.

#define S0_CR_SEND   0x0020 /* SEND command */

Definition at line 71 of file w5300.c.

#define S0_IR_RECV   0x0004 /* Receive interrupt */

Definition at line 75 of file w5300.c.

#define S0_IR_SENDOK   0x0010 /* Send OK interrupt */

Definition at line 76 of file w5300.c.

#define S0_MR_CLOSED   0x0000 /* Close mode */

Definition at line 65 of file w5300.c.

#define S0_MR_MACRAW   0x0004 /* MAC RAW mode (promiscous) */

Definition at line 66 of file w5300.c.

#define S0_MR_MACRAW_MF   0x0044 /* MAC RAW mode (filtered) */

Definition at line 67 of file w5300.c.

#define W5300_IDM_AR   0x0002 /* Indirect Mode Address */

Definition at line 135 of file w5300.c.

#define W5300_IDM_DR   0x0004 /* Indirect Mode Data */

Definition at line 136 of file w5300.c.

#define W5300_IDR   0x00fe /* Chip ID register */

Definition at line 62 of file w5300.c.

#define W5300_IMR   0x0004 /* Interrupt Mask Register */

Definition at line 53 of file w5300.c.

#define W5300_IR   0x0002 /* Interrupt Register */

Definition at line 52 of file w5300.c.

#define W5300_MR   0x0000 /* Mode Register */

Definition at line 42 of file w5300.c.

#define W5300_MTYPE   0x0030 /* Memory Type */

Definition at line 61 of file w5300.c.

#define w5300_read   priv->read

Definition at line 173 of file w5300.c.

#define W5300_REGS_LEN   0x0400

Definition at line 83 of file w5300.c.

#define W5300_RMSRH   0x002c /* Receive Memory Size (4567) */

Definition at line 60 of file w5300.c.

#define W5300_RMSRL   0x0028 /* Receive Memory Size (0123) */

Definition at line 59 of file w5300.c.

#define W5300_S0_CR   0x0202 /* S0 Command Register */

Definition at line 68 of file w5300.c.

#define W5300_S0_IMR   0x0204 /* S0 Interrupt Mask Register */

Definition at line 73 of file w5300.c.

#define W5300_S0_IR   0x0206 /* S0 Interrupt Register */

Definition at line 74 of file w5300.c.

#define W5300_S0_MR   0x0200 /* S0 Mode Register */

Definition at line 64 of file w5300.c.

#define W5300_S0_RX_FIFO   0x0230 /* S0 Receive FIFO */

Definition at line 82 of file w5300.c.

#define W5300_S0_RX_RSR   0x0228 /* S0 Received data Size */

Definition at line 80 of file w5300.c.

#define W5300_S0_SSR   0x0208 /* S0 Socket Status Register */

Definition at line 77 of file w5300.c.

#define W5300_S0_TX_FIFO   0x022e /* S0 Transmit FIFO */

Definition at line 81 of file w5300.c.

#define W5300_S0_TX_FSR   0x0224 /* S0 TX Free Size Register */

Definition at line 79 of file w5300.c.

#define W5300_S0_TX_WRSR   0x0220 /* S0 TX Write Size Register */

Definition at line 78 of file w5300.c.

#define W5300_SHARH   0x000c /* Source MAC address (45) */

Definition at line 56 of file w5300.c.

#define W5300_SHARL   0x0008 /* Source MAC address (0123) */

Definition at line 55 of file w5300.c.

#define W5300_TMSRH   0x0024 /* Transmit Memory Size (4567) */

Definition at line 58 of file w5300.c.

#define W5300_TMSRL   0x0020 /* Transmit Memory Size (0123) */

Definition at line 57 of file w5300.c.

#define w5300_write   priv->write

Definition at line 174 of file w5300.c.

Function Documentation

MODULE_ALIAS ( "platform:"  DRV_NAME)
MODULE_AUTHOR ( "Mike Sinkovsky <[email protected]>"  )
MODULE_DESCRIPTION ( "WIZnet W5300 Ethernet driver v DRV_VERSION)
MODULE_LICENSE ( "GPL"  )
module_platform_driver ( w5300_driver  )