Skip to contentSkip to conversation

Add USB PID for new MOSCHIP USB ethernet controller MCS7832 variant

PATCH In review Andreas Mohr 3 participants 7 messages Nov 30, 2010 – Dec 20, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add USB PID for new MOSCHIP USB ethernet controller MCS7832 variant

Due to active notification of the new MCS7832 version by the manufacturer today (Mr. Milton; thanks!) -- quote: "functionality same as MCS7830", I'm now submitting this patch, intended for networking.git and -stable.

ChangeLog:
- add MCS7832 USB PID to be able to support this new device variant, too
- add HIF_REG_EEPROM_STATUS definitions, comments

Patch created, "semi"-tested (via my existing MCS7830 only) on -rc3, checkpatch.pl'd.
GIT history seems clean, should thus apply easily.

Thanks!

drivers/net/usb/mcs7830.c +21 -2
index a6281e3..3fbcb0d 100644
@@ -1,5 +1,5 @@
 /*
- * MOSCHIP MCS7830 based USB 2.0 Ethernet Devices
+ * MOSCHIP MCS7830 based (7730/7830/7832) USB 2.0 Ethernet Devices
  *
  * based on usbnet.c, asix.c and the vendor provided mcs7830 driver
  *
@@ -11,8 +11,12 @@
  *
  * Definitions gathered from MOSCHIP, Data Sheet_7830DA.pdf (thanks!).
  *
+ * 2010-11-30: add 7832 USB PID ("functionality same as MCS7830"),
+ *             per active notification by manufacturer
+ *
  * TODO:
  * - support HIF_REG_CONFIG_SLEEPMODE/HIF_REG_CONFIG_TXENABLE (via autopm?)
+ * - support HIF_REG_FRAME_DROP_COUNTER, for interface statistics
  * - implement ethtool_ops get_pauseparam/set_pauseparam
  *   via HIF_REG_PAUSE_THRESHOLD (>= revision C only!)
  * - implement get_eeprom/[set_eeprom]
@@ -60,6 +64,7 @@
 #define MCS7830_MAX_MCAST	64
 
 #define MCS7830_VENDOR_ID	0x9710
+#define MCS7832_PRODUCT_ID	0x7832
 #define MCS7830_PRODUCT_ID	0x7830
 #define MCS7730_PRODUCT_ID	0x7730
 
@@ -97,6 +102,11 @@ enum {
 	HIF_REG_FRAME_DROP_COUNTER		= 0x15, /* 0..ff; reset: 0 */
 	HIF_REG_PAUSE_THRESHOLD			= 0x16,
 	   HIF_REG_PAUSE_THRESHOLD_DEFAULT	= 0,
+	HIF_REG_EEPROM_STATUS			= 0x17,
+	   /* "read in progress": bits 0/1/2 == 0 */
+	   HIF_REG_EEPROM_STATUS_SW_EEPROM_READ	= 0x04,
+	   HIF_REG_EEPROM_STATUS_READ_FAILED	= 0x02, /* ro! */
+	   HIF_REG_EEPROM_STATUS_READ_SUCCEEDED	= 0x01, /* ro! */
 };
 
 /* Trailing status byte in Ethernet Rx frame */
@@ -362,6 +372,11 @@ static int mcs7830_get_rev(struct usbnet *dev)
 {
 	u8 dummy[2];
 	int ret;
+	/* TODO?: 7832 _might_  have more registers (untested: no hardware).
+	   Might also be a better idea to gather revision from
+	   SEEPROM field "Release Number" (if reliably supported
+	   by all variants).
+	 */
 	ret = mcs7830_get_reg(dev, HIF_REG_FRAME_DROP_COUNTER, 2, dummy);
 	if (ret > 0)
 		return 2; /* Rev C or later */
@@ -626,7 +641,7 @@ static int mcs7830_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
 }
 
 static const struct driver_info moschip_info = {
-	.description	= "MOSCHIP 7830/7730 usb-NET adapter",
+	.description	= "MOSCHIP 7830/7832/7730 usb-NET adapter",
 	.bind		= mcs7830_bind,
 	.rx_fixup	= mcs7830_rx_fixup,
 	.flags		= FLAG_ETHER,
@@ -645,6 +660,10 @@ static const struct driver_info sitecom_info = {
 
 static const struct usb_device_id products[] = {
 	{
+		USB_DEVICE(MCS7830_VENDOR_ID, MCS7832_PRODUCT_ID),
+		.driver_info = (unsigned long) &moschip_info,
+	},
+	{
 		USB_DEVICE(MCS7830_VENDOR_ID, MCS7830_PRODUCT_ID),
 		.driver_info = (unsigned long) &moschip_info,
 	},
#1 lore raw
Quoted 3 lines · Andreas Mohr

Due to active notification of the new MCS7832 version by the manufacturer today (Mr. Milton; thanks!) -- quote: "functionality same as MCS7830", I'm now submitting this patch, intended for networking.git and -stable.

This is not how you get stuff into the stable kernel trees, sorry. Please read Documentation/stable_kernel_rules.txt for how to do that.

Sometimes I wonder why we even write documentation if no one ever reads it...

thanks,

greg k-h

#2 lore raw
Quoted 9 lines · Greg KH
Quoted 3 lines · Andreas Mohr

Due to active notification of the new MCS7832 version by the manufacturer today (Mr. Milton; thanks!) -- quote: "functionality same as MCS7830", I'm now submitting this patch, intended for networking.git and -stable.

This is not how you get stuff into the stable kernel trees, sorry. Please read Documentation/stable_kernel_rules.txt for how to do that.

From having read that perhaps 2 or 3 times (randomly)

and following a couple dozen -stable mails I had the impression that remembering the constraints would be quite easy; obviously not - sorry! Did have some doubts about the number of hunks, though.
And obviously violated the "must be upstream" rule.

So what to do?
Shovel patch as-is to networking only (optionally specifying the somewhat unclearly formulated Cc: stable mechanism)? Or rather minimalist-reduce the patch, then dito?

Quoted 2 lines

Sometimes I wonder why we even write documentation if no one ever reads it...

I could also mention some (strangely familiar) cases where people _didn't_ write kernel docs which many people likely would have liked to read to avoid wasting half-millions of dollars... *smirk*

Thanks,

Andreas Mohr

#3 lore raw
Quoted 9 lines · Andreas Mohr
Quoted 7 lines · Greg KH
Quoted 3 lines · Andreas Mohr

Due to active notification of the new MCS7832 version by the manufacturer today (Mr. Milton; thanks!) -- quote: "functionality same as MCS7830", I'm now submitting this patch, intended for networking.git and -stable.

This is not how you get stuff into the stable kernel trees, sorry. Please read Documentation/stable_kernel_rules.txt for how to do that.

Quoted 7 lines

From having read that perhaps 2 or 3 times (randomly)
and following a couple dozen -stable mails I had the impression that remembering the constraints would be quite easy; obviously not - sorry! Did have some doubts about the number of hunks, though.
And obviously violated the "must be upstream" rule.

So what to do?

Read the line in that file that says:
- To have the patch automatically included in the stable tree, add the tag
Cc: [email protected]
in the sign-off area. Once the patch is merged it will be applied to the stable tree without anything else needing to be done by the author or subsystem maintainer.

Quoted 3 lines

Shovel patch as-is to networking only (optionally specifying the somewhat unclearly formulated Cc: stable mechanism)? Or rather minimalist-reduce the patch, then dito?

See above.

Quoted 6 lines
Quoted 2 lines

Sometimes I wonder why we even write documentation if no one ever reads it...

I could also mention some (strangely familiar) cases where people _didn't_ write kernel docs which many people likely would have liked to read to avoid wasting half-millions of dollars... *smirk*

Examples? And are those people likely to put up the money to write those docs? That's the big problem, people like to complain, but not pay anyone to do the work...

thanks,

greg k-h

#4 lore raw

[trimmed receivers since it's less relevant]

Quoted 17 lines · Greg KH
Quoted 7 lines · Andreas Mohr

From having read that perhaps 2 or 3 times (randomly)
and following a couple dozen -stable mails I had the impression that remembering the constraints would be quite easy; obviously not - sorry! Did have some doubts about the number of hunks, though.
And obviously violated the "must be upstream" rule.

So what to do?

Read the line in that file that says:
- To have the patch automatically included in the stable tree, add the tag
Cc: [email protected]
in the sign-off area. Once the patch is merged it will be applied to the stable tree without anything else needing to be done by the author or subsystem maintainer.

Quoted 5 lines
Quoted 3 lines

Shovel patch as-is to networking only (optionally specifying the somewhat unclearly formulated Cc: stable mechanism)? Or rather minimalist-reduce the patch, then dito?

See above.

Hmm, that doesn't fully answer it.
Anyway, I know what I'll do.

Quoted 10 lines
Quoted 6 lines
Quoted 2 lines

Sometimes I wonder why we even write documentation if no one ever reads it...

I could also mention some (strangely familiar) cases where people _didn't_ write kernel docs which many people likely would have liked to read to avoid wasting half-millions of dollars... *smirk*

Examples? And are those people likely to put up the money to write those docs? That's the big problem, people like to complain, but not pay anyone to do the work...

I was sheepishly referring to an earlier patch.
Indeed, there's too much complaining and a dearth of activity sometimes.

Quoted 3 lines

thanks,

greg k-h

Andreas Mohr

#5 lore raw

PATCH 1/1 net: Add USB PID for new MOSCHIP USB ethernet controller MCS7832 variant

In reply to Andreas Mohr

Due to active notification of the new MCS7832 version by the manufacturer (Mr. Milton; thanks!) -- quote: "functionality same as MCS7830",
I'm now submitting this patch (on -rc6), intended for networking.git and -stable.

- add MCS7832 USB PID to be able to support this new device variant, too
- add related descriptions

---
Patch created, "semi"-tested (via my existing MCS7830 only), checkpatch.pl'd.
GIT history seems clean, should thus apply easily.

Took longer (it's that time of the year again).

Thanks!

drivers/net/usb/mcs7830.c +10 -2
index a6281e3..b701f59 100644
@@ -1,5 +1,5 @@
 /*
- * MOSCHIP MCS7830 based USB 2.0 Ethernet Devices
+ * MOSCHIP MCS7830 based (7730/7830/7832) USB 2.0 Ethernet Devices
  *
  * based on usbnet.c, asix.c and the vendor provided mcs7830 driver
  *
@@ -11,6 +11,9 @@
  *
  * Definitions gathered from MOSCHIP, Data Sheet_7830DA.pdf (thanks!).
  *
+ * 2010-12-19: add 7832 USB PID ("functionality same as MCS7830"),
+ *             per active notification by manufacturer
+ *
  * TODO:
  * - support HIF_REG_CONFIG_SLEEPMODE/HIF_REG_CONFIG_TXENABLE (via autopm?)
  * - implement ethtool_ops get_pauseparam/set_pauseparam
@@ -60,6 +63,7 @@
 #define MCS7830_MAX_MCAST	64
 
 #define MCS7830_VENDOR_ID	0x9710
+#define MCS7832_PRODUCT_ID	0x7832
 #define MCS7830_PRODUCT_ID	0x7830
 #define MCS7730_PRODUCT_ID	0x7730
 
@@ -626,7 +630,7 @@ static int mcs7830_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
 }
 
 static const struct driver_info moschip_info = {
-	.description	= "MOSCHIP 7830/7730 usb-NET adapter",
+	.description	= "MOSCHIP 7830/7832/7730 usb-NET adapter",
 	.bind		= mcs7830_bind,
 	.rx_fixup	= mcs7830_rx_fixup,
 	.flags		= FLAG_ETHER,
@@ -645,6 +649,10 @@ static const struct driver_info sitecom_info = {
 
 static const struct usb_device_id products[] = {
 	{
+		USB_DEVICE(MCS7830_VENDOR_ID, MCS7832_PRODUCT_ID),
+		.driver_info = (unsigned long) &moschip_info,
+	},
+	{
 		USB_DEVICE(MCS7830_VENDOR_ID, MCS7830_PRODUCT_ID),
 		.driver_info = (unsigned long) &moschip_info,
 	},
maintainer Applied
#6 lore raw

Re: [PATCH] net: Add USB PID for new MOSCHIP USB ethernet controller MCS7832 variant

From: Andreas Mohr <[email protected]>
Date: Sun, 19 Dec 2010 16:42:57 +0100

Quoted 8 lines

Due to active notification of the new MCS7832 version by the manufacturer (Mr. Milton; thanks!) -- quote: "functionality same as MCS7830",
I'm now submitting this patch (on -rc6), intended for networking.git and -stable.

- add MCS7832 USB PID to be able to support this new device variant, too
- add related descriptions

Applied.