ax88172reg.h revision 6716431ba7de213d5c318e58dc24c8a36da9b068
/*
* @(#)ax88172reg.h 1.1 09/06/15
* Macro definitions for ASIX AX88172 USB to fast ethernet controler
* based on ASIX AX88172/88772 data sheet
* This file is public domain. Coded by M.Murayama (KHF04453@nifty.com)
*/
#ifndef __AX88172_H__
#define __AX88172_H__
/*
* Vendor command definitions
*/
#define VCMD_READ_SRAM 0x02
#define VCMD_WRITE_RXSRAM 0x03
#define VCMD_WRITE_TXSRAM 0x04
#define VCMD_SOFTWARE_MII_OP 0x06
#define VCMD_READ_MII_REG 0x07
#define VCMD_WRITE_MII_REG 0x08
#define VCMD_READ_MII_OPMODE 0x09
#define VCMD_HARDWARE_MII_OP 0x0a
#define VCMD_READ_SROM 0x0b
#define VCMD_WRITE_SROM 0x0c
#define VCMD_WRITE_SROM_ENABLE 0x0d
#define VCMD_WRITE_SROM_DISABLE 0x0e
#define VCMD_READ_RXCTRL 0x0f
#define VCMD_WRITE_RXCTRL 0x10
#define VCMD_READ_IPGS 0x11
#define VCMD_WRITE_IPG 0x12
#define VCMD_WRITE_IPG1 0x13
#define VCMD_WRITE_IPG2 0x14
#define VCMD_READ_MCAST_FILTER 0x15
#define VCMD_WRITE_MCAST_FILTER 0x16
#define VCMD_READ_NODE_ID 0x17
#define VCMD_READ_PHY_IDS 0x19
#define VCMD_READ_MEDIUM_STATUS 0x1a
#define VCMD_WRITE_MEDIUM_STATUS 0x1b
#define VCMD_SET_MONITOR_MODE 0x1c
#define VCMD_GET_MONITOR_MODE 0x1d
#define VCMD_READ_GPIO 0x1e
#define VCMD_WRITE_GPIO 0x1f
/* ax88772 only, currently not supported */
#define VCMD_WRITE_IPGS_88772 0x12
#define VCMD_READ_NODE_ID_88772 0x13
#define VCMD_WRITE_NODE_ID_88772 0x14
#define VCMD_WRITE_TEST_REG_88772 0x17
#define VCMD_SOFTWARE_RESET_88772 0x20
#define VCMD_READ_PHY_SELECT_88772 0x21
#define VCMD_WRITE_PHY_SELECT_88772 0x22
/*
* Register definitions
*/
/* Rx control register */
#define RCR_MFB 0x0300
#define RCR_MFB_SHIFT 8
#define RCR_MFB_2K (0U << RCR_MFB_SHIFT)
#define RCR_BITS \
"\020" \
"\010SO" \
"\006AP" \
"\005AM" \
"\004AB" \
"\003SEP" \
"\002AMALL" \
"\001PRO"
/* Medium status register */
#define MSR_BITS \
"\020" \
"\015SM" \
"\014SBP" \
"\012PS" \
"\011RE" \
"\005FCEN" \
"\004ENCK" \
"\003TXABT" \
"\002FDPX" \
"\001GM"
/* monitor mode register */
#define MMR_BITS \
"\020" \
"\003RWMP" \
"\002RWLU" \
"\001MOM"
/* GPIO register */
#define GPIO_DATA2 0x20
#define GPIO_EN2 0x10
#define GPIO_DATA1 0x08
#define GPIO_EN1 0x04
#define GPIO_DATA0 0x02
#define GPIO_EN0 0x01
#define GPIO_BITS \
"\020" \
"\010RSE" \
"\006DATA2" \
"\005EN2" \
"\004DATA1" \
"\003EN1" \
"\002DATA0" \
"\001EN0"
/* Software reset register */
#define SWRST_BITS \
"\020" \
"\007IPPD" \
"\006IPRL" \
"\005BZ" \
"\004PRL" \
"\003PRTE" \
"\002RT" \
"\001RR"
/* Software PHY Select Status register */
#endif /* __AX88172_H__ */