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 3 participants 3 messages Jan 17, 2013 – Jan 18, 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

This is a resubmission.
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 | 1424 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 1443 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..ce01578 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 +1424 -0

1,424 lines not on this page · raw message

Signature · 1 line
1.7.9.5
maintainer
#1 lore raw

From: Freddy Xin <[email protected]>
Date: Thu, 17 Jan 2013 17:32:54 +0800

drivers/net/usb/ax88179_178a.c line 199

Quoted 3 lines
drivers/net/usb/ax88179_178a.c new file +3 -0
+struct ax88179_rx_pkt_header {
+
+	u8	l4_csum_err:1,

Get rid of such extraneous empty lines. They do not add clarity, rather they just take up space.

Review

Quoted 2 lines
(quoted diff) +2 -0
+	ret = fn(dev, cmd, USB_DIR_IN | USB_TYPE_VENDOR |
+			USB_RECIP_DEVICE, value, index, data, size);

This is not indented properly. When a function call takes up multiple lines, the text on the second and subsequent lines must be left justified to the first column after the openning parenthesis of the function call, like this:

	function(arg1, arg2,
		 arg3, arg4);

You must use the appropriate combination of TAB and space characters to achieve this. If you are trying to only use TAB characters, you are doing it wrong.

This code has a lot of other similar coding style errors, please put some effort into fixing them up before you consider resubmitting this driver.

All of the coding style errors are probably why nobody reviewed your driver the first time around, there's already enough properly styled submissions to review.

#2 lore raw
Quoted 8 lines · David Miller

Review

Quoted 2 lines
(quoted diff) +2 -0
+	ret = fn(dev, cmd, USB_DIR_IN | USB_TYPE_VENDOR |
+			USB_RECIP_DEVICE, value, index, data, size);

This is not indented properly. When a function call takes up multiple lines, the text on the second and subsequent lines must be left justified to the first column after the openning parenthesis of the function call, like this:

Quoted 6 lines
	function(arg1, arg2,
		 arg3, arg4);

You must use the appropriate combination of TAB and space characters to achieve this. If you are trying to only use TAB characters, you are doing it wrong.

Documentation/CodingStyle doesn't mention this. Does the networking stack have its own special requirements, not listed in CodingStyle?

Alan Stern

P.S: The standard I have tried to follow for USB code is to indent continuation lines by two tab stops more than the first line, regardless of whether the break occurs inside a function call. I have seen other people consistently indent continuation lines by 1/2 tab stop (i.e., four spaces) beyond the first line.