Skip to contentSkip to conversation

ax88179_178a: ASIX AX88179_178A USB 3.0/2.0 to gigabit ethernet adapter driver

PATCH In review Freddy Xin 2 participants 5 messages Feb 7, 2013

Subsystems (3)
lore
Share & tools
lore

Freddy Xin

author
#0 lore raw

PATCH 1/1 ax88179_178a: ASIX AX88179_178A USB 3.0/2.0 to gigabit ethernet adapter driver

From: Freddy Xin <freddy-knRN6Y/[email protected]>

This is a resubmission.
Fixed the issue that the default MTU is not 1500.
Added ax88179_change_mtu function and enabled the hardware jumbo frame function to support an MTU higher than 1500.
Fixed indentation and empty line coding style errors.
The _nopm version usb functions were added to access register in suspend and resume functions. Serveral variables allocted dynamically were removed and replaced by stack variables. ax88179_get_eeprom were modified from asix_get_eeprom in asix_common.

This patch adds a driver for ASIX's AX88179 family of USB 3.0/2.0 to gigabit ethernet adapters. It's based on the AX88xxx driver but the usb commands used to access registers for AX88179 are completely different. This driver had been verified on x86 system with AX88179/AX88178A and Sitcomm LN-032 USB dongles.

---
 drivers/net/usb/Kconfig        |   18 +
 drivers/net/usb/Makefile       |    1 +
 drivers/net/usb/ax88179_178a.c | 1398 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 1417 insertions(+)
 create mode 100644 drivers/net/usb/ax88179_178a.c
drivers/net/usb/Kconfig +18 -0
index ef97621..75af401 100644
@@ -158,6 +158,24 @@ config USB_NET_AX8817X
 	  This driver creates an interface named "ethX", where X depends on
 	  what other networking devices you have in use.
 
+config USB_NET_AX88179_178A
+	tristate "ASIX AX88179/178A USB 3.0/2.0 to Gigabit Ethernet"
+	depends on USB_USBNET
+	select CRC32
+	select PHYLIB
+	default y
+	help
+	  This option adds support for ASIX AX88179 based USB 3.0/2.0
+	  to Gigabit Ethernet adapters.
+
+ 	  This driver should work with at least the following devices:
+	    * ASIX AX88179
+	    * ASIX AX88178A
+	    * Sitcomm LN-032
+
+	  This driver creates an interface named "ethX", where X depends on
+	  what other networking devices you have in use.
+
 config USB_NET_CDCETHER
 	tristate "CDC Ethernet support (smart devices such as cable modems)"
 	depends on USB_USBNET
drivers/net/usb/Makefile +1 -0
index 4786913..119b06c 100644
@@ -9,6 +9,7 @@ obj-$(CONFIG_USB_RTL8150)	+= rtl8150.o
 obj-$(CONFIG_USB_HSO)		+= hso.o
 obj-$(CONFIG_USB_NET_AX8817X)	+= asix.o
 asix-y := asix_devices.o asix_common.o ax88172a.o
+obj-$(CONFIG_USB_NET_AX88179_178A)      += ax88179_178a.o
 obj-$(CONFIG_USB_NET_CDCETHER)	+= cdc_ether.o
 obj-$(CONFIG_USB_NET_CDC_EEM)	+= cdc_eem.o
 obj-$(CONFIG_USB_NET_DM9601)	+= dm9601.o
drivers/net/usb/ax88179_178a.c new file +1398 -0

1,398 lines not on this page · raw message

Signature · 6 lines
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#1 lore raw

drivers/net/usb/ax88179_178a.c line 189

Quoted 7 lines · On Thu, 7 Feb 2013 12:36:34 +0800 Freddy Xin <[email protected]> wrote:
drivers/net/usb/ax88179_178a.c new file +7 -0
+struct {unsigned char ctrl, timer_l, timer_h, size, ifg; }
+AX88179_BULKIN_SIZE[] =	{
+	{7, 0x4f, 0,	0x12, 0xff},
+	{7, 0xf0, 1,	0x15, 0xff},
+	{7, 0xae, 7,	0x18, 0xff},
+	{7, 0xcc, 0x4c, 0x18, 8},
+};

Better to make it static, const, and add a couple
of line breaks.

static const struct {
      unsigned char ctrl, timer_l, timer_h, size, ifg;
} AX88179_BULKIN_SIZE[] =	{
	{7, 0x4f, 0,	0x12, 0xff},
	{7, 0xf0, 1,	0x15, 0xff},
	{7, 0xae, 7,	0x18, 0xff},
	{7, 0xcc, 0x4c, 0x18, 8},
};
author
#2 lore raw
Quoted 13 lines · Stephen Hemminger

drivers/net/usb/ax88179_178a.c line 189

Quoted 7 lines · On Thu, 7 Feb 2013 12:36:34 +0800 Freddy Xin <[email protected]> wrote:
drivers/net/usb/ax88179_178a.c new file +7 -0
+struct {unsigned char ctrl, timer_l, timer_h, size, ifg; }
+AX88179_BULKIN_SIZE[] =	{
+	{7, 0x4f, 0,	0x12, 0xff},
+	{7, 0xf0, 1,	0x15, 0xff},
+	{7, 0xae, 7,	0x18, 0xff},
+	{7, 0xcc, 0x4c, 0x18, 8},
+};

Better to make it static, const, and add a couple of line breaks.

Quoted 8 lines
  static const struct {
       unsigned char ctrl, timer_l, timer_h, size, ifg;
  } AX88179_BULKIN_SIZE[] =	{
	{7, 0x4f, 0,	0x12, 0xff},
	{7, 0xf0, 1,	0x15, 0xff},
	{7, 0xae, 7,	0x18, 0xff},
	{7, 0xcc, 0x4c, 0x18, 8},
};

Thank you, Stephen. I will fix these errors.

Quoted 1 line
#3 lore raw
In reply to Freddy Xin

drivers/net/usb/ax88179_178a.c line 530

Quoted 13 lines · On Thu, 7 Feb 2013 12:36:34 +0800 Freddy Xin…
drivers/net/usb/ax88179_178a.c new file +13 -0
+static struct ethtool_ops ax88179_ethtool_ops = {
+	.get_link		= ethtool_op_get_link,
+	.get_msglevel		= usbnet_get_msglevel,
+	.set_msglevel		= usbnet_set_msglevel,
+	.get_wol		= ax88179_get_wol,
+	.set_wol		= ax88179_set_wol,
+	.get_eeprom_len		= ax88179_get_eeprom_len,
+	.get_eeprom		= ax88179_get_eeprom,
+	.get_settings		= ax88179_get_settings,
+	.set_settings		= ax88179_set_settings,
+	.nway_reset		= usbnet_nway_reset,
+};
+

ethtool_ops should always be const
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

author
#4 lore raw
Quoted 18 lines · Stephen Hemminger

drivers/net/usb/ax88179_178a.c line 530

Quoted 13 lines · On Thu, 7 Feb 2013 12:36:34 +0800 Freddy Xin <[email protected]> wrote:
drivers/net/usb/ax88179_178a.c new file +13 -0
+static struct ethtool_ops ax88179_ethtool_ops = {
+	.get_link		= ethtool_op_get_link,
+	.get_msglevel		= usbnet_get_msglevel,
+	.set_msglevel		= usbnet_set_msglevel,
+	.get_wol		= ax88179_get_wol,
+	.set_wol		= ax88179_set_wol,
+	.get_eeprom_len		= ax88179_get_eeprom_len,
+	.get_eeprom		= ax88179_get_eeprom,
+	.get_settings		= ax88179_get_settings,
+	.set_settings		= ax88179_set_settings,
+	.nway_reset		= usbnet_nway_reset,
+};
+

ethtool_ops should always be const

Thank you, Stephen. I will fix these errors.