Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
asix.h File Reference
#include <linux/module.h>
#include <linux/kmod.h>
#include <linux/init.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/ethtool.h>
#include <linux/workqueue.h>
#include <linux/mii.h>
#include <linux/usb.h>
#include <linux/crc32.h>
#include <linux/usb/usbnet.h>
#include <linux/slab.h>
#include <linux/if_vlan.h>

Go to the source code of this file.

Data Structures

struct  asix_data
 

Macros

#define DRIVER_VERSION   "22-Dec-2011"
 
#define DRIVER_NAME   "asix"
 
#define AX_CMD_SET_SW_MII   0x06
 
#define AX_CMD_READ_MII_REG   0x07
 
#define AX_CMD_WRITE_MII_REG   0x08
 
#define AX_CMD_SET_HW_MII   0x0a
 
#define AX_CMD_READ_EEPROM   0x0b
 
#define AX_CMD_WRITE_EEPROM   0x0c
 
#define AX_CMD_WRITE_ENABLE   0x0d
 
#define AX_CMD_WRITE_DISABLE   0x0e
 
#define AX_CMD_READ_RX_CTL   0x0f
 
#define AX_CMD_WRITE_RX_CTL   0x10
 
#define AX_CMD_READ_IPG012   0x11
 
#define AX_CMD_WRITE_IPG0   0x12
 
#define AX_CMD_WRITE_IPG1   0x13
 
#define AX_CMD_READ_NODE_ID   0x13
 
#define AX_CMD_WRITE_NODE_ID   0x14
 
#define AX_CMD_WRITE_IPG2   0x14
 
#define AX_CMD_WRITE_MULTI_FILTER   0x16
 
#define AX88172_CMD_READ_NODE_ID   0x17
 
#define AX_CMD_READ_PHY_ID   0x19
 
#define AX_CMD_READ_MEDIUM_STATUS   0x1a
 
#define AX_CMD_WRITE_MEDIUM_MODE   0x1b
 
#define AX_CMD_READ_MONITOR_MODE   0x1c
 
#define AX_CMD_WRITE_MONITOR_MODE   0x1d
 
#define AX_CMD_READ_GPIOS   0x1e
 
#define AX_CMD_WRITE_GPIOS   0x1f
 
#define AX_CMD_SW_RESET   0x20
 
#define AX_CMD_SW_PHY_STATUS   0x21
 
#define AX_CMD_SW_PHY_SELECT   0x22
 
#define AX_PHY_SELECT_MASK   (BIT(3) | BIT(2))
 
#define AX_PHY_SELECT_INTERNAL   0
 
#define AX_PHY_SELECT_EXTERNAL   BIT(2)
 
#define AX_MONITOR_MODE   0x01
 
#define AX_MONITOR_LINK   0x02
 
#define AX_MONITOR_MAGIC   0x04
 
#define AX_MONITOR_HSFS   0x10
 
#define AX88172_MEDIUM_FD   0x02
 
#define AX88172_MEDIUM_TX   0x04
 
#define AX88172_MEDIUM_FC   0x10
 
#define AX88172_MEDIUM_DEFAULT   ( AX88172_MEDIUM_FD | AX88172_MEDIUM_TX | AX88172_MEDIUM_FC )
 
#define AX_MCAST_FILTER_SIZE   8
 
#define AX_MAX_MCAST   64
 
#define AX_SWRESET_CLEAR   0x00
 
#define AX_SWRESET_RR   0x01
 
#define AX_SWRESET_RT   0x02
 
#define AX_SWRESET_PRTE   0x04
 
#define AX_SWRESET_PRL   0x08
 
#define AX_SWRESET_BZ   0x10
 
#define AX_SWRESET_IPRL   0x20
 
#define AX_SWRESET_IPPD   0x40
 
#define AX88772_IPG0_DEFAULT   0x15
 
#define AX88772_IPG1_DEFAULT   0x0c
 
#define AX88772_IPG2_DEFAULT   0x12
 
#define AX_MEDIUM_PF   0x0080
 
#define AX_MEDIUM_JFE   0x0040
 
#define AX_MEDIUM_TFC   0x0020
 
#define AX_MEDIUM_RFC   0x0010
 
#define AX_MEDIUM_ENCK   0x0008
 
#define AX_MEDIUM_AC   0x0004
 
#define AX_MEDIUM_FD   0x0002
 
#define AX_MEDIUM_GM   0x0001
 
#define AX_MEDIUM_SM   0x1000
 
#define AX_MEDIUM_SBP   0x0800
 
#define AX_MEDIUM_PS   0x0200
 
#define AX_MEDIUM_RE   0x0100
 
#define AX88178_MEDIUM_DEFAULT
 
#define AX88772_MEDIUM_DEFAULT
 
#define AX_RX_CTL_SO   0x0080
 
#define AX_RX_CTL_AP   0x0020
 
#define AX_RX_CTL_AM   0x0010
 
#define AX_RX_CTL_AB   0x0008
 
#define AX_RX_CTL_SEP   0x0004
 
#define AX_RX_CTL_AMALL   0x0002
 
#define AX_RX_CTL_PRO   0x0001
 
#define AX_RX_CTL_MFB_2048   0x0000
 
#define AX_RX_CTL_MFB_4096   0x0100
 
#define AX_RX_CTL_MFB_8192   0x0200
 
#define AX_RX_CTL_MFB_16384   0x0300
 
#define AX_DEFAULT_RX_CTL   (AX_RX_CTL_SO | AX_RX_CTL_AB)
 
#define AX_GPIO_GPO0EN   0x01 /* GPIO0 Output enable */
 
#define AX_GPIO_GPO_0   0x02 /* GPIO0 Output value */
 
#define AX_GPIO_GPO1EN   0x04 /* GPIO1 Output enable */
 
#define AX_GPIO_GPO_1   0x08 /* GPIO1 Output value */
 
#define AX_GPIO_GPO2EN   0x10 /* GPIO2 Output enable */
 
#define AX_GPIO_GPO_2   0x20 /* GPIO2 Output value */
 
#define AX_GPIO_RESERVED   0x40 /* Reserved */
 
#define AX_GPIO_RSE   0x80 /* Reload serial EEPROM */
 
#define AX_EEPROM_MAGIC   0xdeadbeef
 
#define AX_EEPROM_LEN   0x200
 

Functions

int asix_read_cmd (struct usbnet *dev, u8 cmd, u16 value, u16 index, u16 size, void *data)
 
int asix_write_cmd (struct usbnet *dev, u8 cmd, u16 value, u16 index, u16 size, void *data)
 
void asix_write_cmd_async (struct usbnet *dev, u8 cmd, u16 value, u16 index, u16 size, void *data)
 
int asix_rx_fixup (struct usbnet *dev, struct sk_buff *skb)
 
struct sk_buffasix_tx_fixup (struct usbnet *dev, struct sk_buff *skb, gfp_t flags)
 
int asix_set_sw_mii (struct usbnet *dev)
 
int asix_set_hw_mii (struct usbnet *dev)
 
int asix_read_phy_addr (struct usbnet *dev, int internal)
 
int asix_get_phy_addr (struct usbnet *dev)
 
int asix_sw_reset (struct usbnet *dev, u8 flags)
 
u16 asix_read_rx_ctl (struct usbnet *dev)
 
int asix_write_rx_ctl (struct usbnet *dev, u16 mode)
 
u16 asix_read_medium_status (struct usbnet *dev)
 
int asix_write_medium_mode (struct usbnet *dev, u16 mode)
 
int asix_write_gpio (struct usbnet *dev, u16 value, int sleep)
 
void asix_set_multicast (struct net_device *net)
 
int asix_mdio_read (struct net_device *netdev, int phy_id, int loc)
 
void asix_mdio_write (struct net_device *netdev, int phy_id, int loc, int val)
 
void asix_get_wol (struct net_device *net, struct ethtool_wolinfo *wolinfo)
 
int asix_set_wol (struct net_device *net, struct ethtool_wolinfo *wolinfo)
 
int asix_get_eeprom_len (struct net_device *net)
 
int asix_get_eeprom (struct net_device *net, struct ethtool_eeprom *eeprom, u8 *data)
 
int asix_set_eeprom (struct net_device *net, struct ethtool_eeprom *eeprom, u8 *data)
 
void asix_get_drvinfo (struct net_device *net, struct ethtool_drvinfo *info)
 
int asix_set_mac_address (struct net_device *net, void *p)
 

Macro Definition Documentation

#define AX88172_CMD_READ_NODE_ID   0x17

Definition at line 65 of file asix.h.

#define AX88172_MEDIUM_DEFAULT   ( AX88172_MEDIUM_FD | AX88172_MEDIUM_TX | AX88172_MEDIUM_FC )

Definition at line 90 of file asix.h.

#define AX88172_MEDIUM_FC   0x10

Definition at line 89 of file asix.h.

#define AX88172_MEDIUM_FD   0x02

Definition at line 87 of file asix.h.

#define AX88172_MEDIUM_TX   0x04

Definition at line 88 of file asix.h.

#define AX88178_MEDIUM_DEFAULT
Value:
AX_MEDIUM_RFC | AX_MEDIUM_TFC | AX_MEDIUM_JFE | \
AX_MEDIUM_RE)

Definition at line 123 of file asix.h.

#define AX88772_IPG0_DEFAULT   0x15

Definition at line 105 of file asix.h.

#define AX88772_IPG1_DEFAULT   0x0c

Definition at line 106 of file asix.h.

#define AX88772_IPG2_DEFAULT   0x12

Definition at line 107 of file asix.h.

#define AX88772_MEDIUM_DEFAULT
Value:
AX_MEDIUM_TFC | AX_MEDIUM_PS | \
AX_MEDIUM_AC | AX_MEDIUM_RE)

Definition at line 128 of file asix.h.

#define AX_CMD_READ_EEPROM   0x0b

Definition at line 52 of file asix.h.

#define AX_CMD_READ_GPIOS   0x1e

Definition at line 71 of file asix.h.

#define AX_CMD_READ_IPG012   0x11

Definition at line 58 of file asix.h.

#define AX_CMD_READ_MEDIUM_STATUS   0x1a

Definition at line 67 of file asix.h.

#define AX_CMD_READ_MII_REG   0x07

Definition at line 49 of file asix.h.

#define AX_CMD_READ_MONITOR_MODE   0x1c

Definition at line 69 of file asix.h.

#define AX_CMD_READ_NODE_ID   0x13

Definition at line 61 of file asix.h.

#define AX_CMD_READ_PHY_ID   0x19

Definition at line 66 of file asix.h.

#define AX_CMD_READ_RX_CTL   0x0f

Definition at line 56 of file asix.h.

#define AX_CMD_SET_HW_MII   0x0a

Definition at line 51 of file asix.h.

#define AX_CMD_SET_SW_MII   0x06

Definition at line 48 of file asix.h.

#define AX_CMD_SW_PHY_SELECT   0x22

Definition at line 75 of file asix.h.

#define AX_CMD_SW_PHY_STATUS   0x21

Definition at line 74 of file asix.h.

#define AX_CMD_SW_RESET   0x20

Definition at line 73 of file asix.h.

#define AX_CMD_WRITE_DISABLE   0x0e

Definition at line 55 of file asix.h.

#define AX_CMD_WRITE_EEPROM   0x0c

Definition at line 53 of file asix.h.

#define AX_CMD_WRITE_ENABLE   0x0d

Definition at line 54 of file asix.h.

#define AX_CMD_WRITE_GPIOS   0x1f

Definition at line 72 of file asix.h.

#define AX_CMD_WRITE_IPG0   0x12

Definition at line 59 of file asix.h.

#define AX_CMD_WRITE_IPG1   0x13

Definition at line 60 of file asix.h.

#define AX_CMD_WRITE_IPG2   0x14

Definition at line 63 of file asix.h.

#define AX_CMD_WRITE_MEDIUM_MODE   0x1b

Definition at line 68 of file asix.h.

#define AX_CMD_WRITE_MII_REG   0x08

Definition at line 50 of file asix.h.

#define AX_CMD_WRITE_MONITOR_MODE   0x1d

Definition at line 70 of file asix.h.

#define AX_CMD_WRITE_MULTI_FILTER   0x16

Definition at line 64 of file asix.h.

#define AX_CMD_WRITE_NODE_ID   0x14

Definition at line 62 of file asix.h.

#define AX_CMD_WRITE_RX_CTL   0x10

Definition at line 57 of file asix.h.

#define AX_DEFAULT_RX_CTL   (AX_RX_CTL_SO | AX_RX_CTL_AB)

Definition at line 146 of file asix.h.

#define AX_EEPROM_LEN   0x200

Definition at line 159 of file asix.h.

#define AX_EEPROM_MAGIC   0xdeadbeef

Definition at line 158 of file asix.h.

#define AX_GPIO_GPO0EN   0x01 /* GPIO0 Output enable */

Definition at line 149 of file asix.h.

#define AX_GPIO_GPO1EN   0x04 /* GPIO1 Output enable */

Definition at line 151 of file asix.h.

#define AX_GPIO_GPO2EN   0x10 /* GPIO2 Output enable */

Definition at line 153 of file asix.h.

#define AX_GPIO_GPO_0   0x02 /* GPIO0 Output value */

Definition at line 150 of file asix.h.

#define AX_GPIO_GPO_1   0x08 /* GPIO1 Output value */

Definition at line 152 of file asix.h.

#define AX_GPIO_GPO_2   0x20 /* GPIO2 Output value */

Definition at line 154 of file asix.h.

#define AX_GPIO_RESERVED   0x40 /* Reserved */

Definition at line 155 of file asix.h.

#define AX_GPIO_RSE   0x80 /* Reload serial EEPROM */

Definition at line 156 of file asix.h.

#define AX_MAX_MCAST   64

Definition at line 94 of file asix.h.

#define AX_MCAST_FILTER_SIZE   8

Definition at line 93 of file asix.h.

#define AX_MEDIUM_AC   0x0004

Definition at line 115 of file asix.h.

#define AX_MEDIUM_ENCK   0x0008

Definition at line 114 of file asix.h.

#define AX_MEDIUM_FD   0x0002

Definition at line 116 of file asix.h.

#define AX_MEDIUM_GM   0x0001

Definition at line 117 of file asix.h.

#define AX_MEDIUM_JFE   0x0040

Definition at line 111 of file asix.h.

#define AX_MEDIUM_PF   0x0080

Definition at line 110 of file asix.h.

#define AX_MEDIUM_PS   0x0200

Definition at line 120 of file asix.h.

#define AX_MEDIUM_RE   0x0100

Definition at line 121 of file asix.h.

#define AX_MEDIUM_RFC   0x0010

Definition at line 113 of file asix.h.

#define AX_MEDIUM_SBP   0x0800

Definition at line 119 of file asix.h.

#define AX_MEDIUM_SM   0x1000

Definition at line 118 of file asix.h.

#define AX_MEDIUM_TFC   0x0020

Definition at line 112 of file asix.h.

#define AX_MONITOR_HSFS   0x10

Definition at line 84 of file asix.h.

#define AX_MONITOR_LINK   0x02

Definition at line 82 of file asix.h.

#define AX_MONITOR_MAGIC   0x04

Definition at line 83 of file asix.h.

#define AX_MONITOR_MODE   0x01

Definition at line 81 of file asix.h.

#define AX_PHY_SELECT_EXTERNAL   BIT(2)

Definition at line 79 of file asix.h.

#define AX_PHY_SELECT_INTERNAL   0

Definition at line 78 of file asix.h.

#define AX_PHY_SELECT_MASK   (BIT(3) | BIT(2))

Definition at line 77 of file asix.h.

#define AX_RX_CTL_AB   0x0008

Definition at line 137 of file asix.h.

#define AX_RX_CTL_AM   0x0010

Definition at line 136 of file asix.h.

#define AX_RX_CTL_AMALL   0x0002

Definition at line 139 of file asix.h.

#define AX_RX_CTL_AP   0x0020

Definition at line 135 of file asix.h.

#define AX_RX_CTL_MFB_16384   0x0300

Definition at line 144 of file asix.h.

#define AX_RX_CTL_MFB_2048   0x0000

Definition at line 141 of file asix.h.

#define AX_RX_CTL_MFB_4096   0x0100

Definition at line 142 of file asix.h.

#define AX_RX_CTL_MFB_8192   0x0200

Definition at line 143 of file asix.h.

#define AX_RX_CTL_PRO   0x0001

Definition at line 140 of file asix.h.

#define AX_RX_CTL_SEP   0x0004

Definition at line 138 of file asix.h.

#define AX_RX_CTL_SO   0x0080

Definition at line 134 of file asix.h.

#define AX_SWRESET_BZ   0x10

Definition at line 101 of file asix.h.

#define AX_SWRESET_CLEAR   0x00

Definition at line 96 of file asix.h.

#define AX_SWRESET_IPPD   0x40

Definition at line 103 of file asix.h.

#define AX_SWRESET_IPRL   0x20

Definition at line 102 of file asix.h.

#define AX_SWRESET_PRL   0x08

Definition at line 100 of file asix.h.

#define AX_SWRESET_PRTE   0x04

Definition at line 99 of file asix.h.

#define AX_SWRESET_RR   0x01

Definition at line 97 of file asix.h.

#define AX_SWRESET_RT   0x02

Definition at line 98 of file asix.h.

#define DRIVER_NAME   "asix"

Definition at line 44 of file asix.h.

#define DRIVER_VERSION   "22-Dec-2011"

Definition at line 43 of file asix.h.

Function Documentation

void asix_get_drvinfo ( struct net_device net,
struct ethtool_drvinfo info 
)

Definition at line 600 of file asix_common.c.

int asix_get_eeprom ( struct net_device net,
struct ethtool_eeprom eeprom,
u8 data 
)

Definition at line 484 of file asix_common.c.

int asix_get_eeprom_len ( struct net_device net)

Definition at line 479 of file asix_common.c.

int asix_get_phy_addr ( struct usbnet dev)

Definition at line 281 of file asix_common.c.

void asix_get_wol ( struct net_device net,
struct ethtool_wolinfo wolinfo 
)

Definition at line 444 of file asix_common.c.

int asix_mdio_read ( struct net_device netdev,
int  phy_id,
int  loc 
)

Definition at line 412 of file asix_common.c.

void asix_mdio_write ( struct net_device netdev,
int  phy_id,
int  loc,
int  val 
)

Definition at line 430 of file asix_common.c.

int asix_read_cmd ( struct usbnet dev,
u8  cmd,
u16  value,
u16  index,
u16  size,
void data 
)

Definition at line 25 of file asix_common.c.

u16 asix_read_medium_status ( struct usbnet dev)

Definition at line 326 of file asix_common.c.

int asix_read_phy_addr ( struct usbnet dev,
int  internal 
)

Definition at line 261 of file asix_common.c.

u16 asix_read_rx_ctl ( struct usbnet dev)

Definition at line 299 of file asix_common.c.

int asix_rx_fixup ( struct usbnet dev,
struct sk_buff skb 
)

Definition at line 145 of file asix_common.c.

int asix_set_eeprom ( struct net_device net,
struct ethtool_eeprom eeprom,
u8 data 
)

Definition at line 519 of file asix_common.c.

int asix_set_hw_mii ( struct usbnet dev)

Definition at line 252 of file asix_common.c.

int asix_set_mac_address ( struct net_device net,
void p 
)

Definition at line 609 of file asix_common.c.

void asix_set_multicast ( struct net_device net)

Definition at line 373 of file asix_common.c.

int asix_set_sw_mii ( struct usbnet dev)

Definition at line 243 of file asix_common.c.

int asix_set_wol ( struct net_device net,
struct ethtool_wolinfo wolinfo 
)

Definition at line 462 of file asix_common.c.

int asix_sw_reset ( struct usbnet dev,
u8  flags 
)

Definition at line 288 of file asix_common.c.

struct sk_buff* asix_tx_fixup ( struct usbnet dev,
struct sk_buff skb,
gfp_t  flags 
)
read

Definition at line 188 of file asix_common.c.

int asix_write_cmd ( struct usbnet dev,
u8  cmd,
u16  value,
u16  index,
u16  size,
void data 
)

Definition at line 58 of file asix_common.c.

void asix_write_cmd_async ( struct usbnet dev,
u8  cmd,
u16  value,
u16  index,
u16  size,
void data 
)

Definition at line 102 of file asix_common.c.

int asix_write_gpio ( struct usbnet dev,
u16  value,
int  sleep 
)

Definition at line 354 of file asix_common.c.

int asix_write_medium_mode ( struct usbnet dev,
u16  mode 
)

Definition at line 341 of file asix_common.c.

int asix_write_rx_ctl ( struct usbnet dev,
u16  mode 
)

Definition at line 313 of file asix_common.c.