diff mbox

[-stable] Add USB PID for new MOSCHIP USB ethernet controller MCS7832 variant

Message ID 20101130200737.GA5185@rhlx01.hs-esslingen.de
State Not Applicable, archived
Delegated to: David Miller
Headers show

Commit Message

Andreas Mohr Nov. 30, 2010, 8:07 p.m. UTC
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!

Signed-off-by: Andreas Mohr <andi@lisas.de>

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

gregkh@suse.de Nov. 30, 2010, 8:27 p.m. UTC | #1
On Tue, Nov 30, 2010 at 09:07:37PM +0100, Andreas Mohr wrote:
> 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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Andreas Mohr Nov. 30, 2010, 9:05 p.m. UTC | #2
On Tue, Nov 30, 2010 at 12:27:12PM -0800, Greg KH wrote:
> On Tue, Nov 30, 2010 at 09:07:37PM +0100, Andreas Mohr wrote:
> > 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?

> 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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
gregkh@suse.de Nov. 30, 2010, 9:13 p.m. UTC | #3
On Tue, Nov 30, 2010 at 10:05:10PM +0100, Andreas Mohr wrote:
> On Tue, Nov 30, 2010 at 12:27:12PM -0800, Greg KH wrote:
> > On Tue, Nov 30, 2010 at 09:07:37PM +0100, Andreas Mohr wrote:
> > > 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?

Read the line in that file that says:
	 - To have the patch automatically included in the stable tree,
	   add the tag
	        Cc: stable@kernel.org
	   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.

> 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.

> > 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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/usb/mcs7830.c b/drivers/net/usb/mcs7830.c
index a6281e3..3fbcb0d 100644
--- a/drivers/net/usb/mcs7830.c
+++ b/drivers/net/usb/mcs7830.c
@@ -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,
 	},