All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -stable] Add USB PID for new MOSCHIP USB ethernet controller MCS7832 variant
@ 2010-11-30 20:07 Andreas Mohr
  2010-11-30 20:27 ` Greg KH
  2010-12-19 15:42 ` [PATCH] net: " Andreas Mohr
  0 siblings, 2 replies; 7+ messages in thread
From: Andreas Mohr @ 2010-11-30 20:07 UTC (permalink / raw)
  To: gregkh, David S. Miller
  Cc: stable, Arnd Bergmann, dhollis, Phil Chang, netdev, linux-kernel

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>

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,
 	},

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH -stable] Add USB PID for new MOSCHIP USB ethernet controller MCS7832 variant
  2010-11-30 20:07 [PATCH -stable] Add USB PID for new MOSCHIP USB ethernet controller MCS7832 variant Andreas Mohr
@ 2010-11-30 20:27 ` Greg KH
  2010-11-30 21:05   ` Andreas Mohr
  2010-12-19 15:42 ` [PATCH] net: " Andreas Mohr
  1 sibling, 1 reply; 7+ messages in thread
From: Greg KH @ 2010-11-30 20:27 UTC (permalink / raw)
  To: Andreas Mohr
  Cc: David S. Miller, stable, Arnd Bergmann, dhollis, Phil Chang,
	netdev, linux-kernel

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH -stable] Add USB PID for new MOSCHIP USB ethernet controller MCS7832 variant
  2010-11-30 20:27 ` Greg KH
@ 2010-11-30 21:05   ` Andreas Mohr
  2010-11-30 21:13     ` Greg KH
  0 siblings, 1 reply; 7+ messages in thread
From: Andreas Mohr @ 2010-11-30 21:05 UTC (permalink / raw)
  To: Greg KH
  Cc: Andreas Mohr, David S. Miller, stable, Arnd Bergmann, dhollis,
	Phil Chang, netdev, linux-kernel

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH -stable] Add USB PID for new MOSCHIP USB ethernet controller MCS7832 variant
  2010-11-30 21:05   ` Andreas Mohr
@ 2010-11-30 21:13     ` Greg KH
  2010-11-30 21:29       ` Andreas Mohr
  0 siblings, 1 reply; 7+ messages in thread
From: Greg KH @ 2010-11-30 21:13 UTC (permalink / raw)
  To: Andreas Mohr
  Cc: David S. Miller, stable, Arnd Bergmann, dhollis, Phil Chang,
	netdev, linux-kernel

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH -stable] Add USB PID for new MOSCHIP USB ethernet controller MCS7832 variant
  2010-11-30 21:13     ` Greg KH
@ 2010-11-30 21:29       ` Andreas Mohr
  0 siblings, 0 replies; 7+ messages in thread
From: Andreas Mohr @ 2010-11-30 21:29 UTC (permalink / raw)
  To: Greg KH; +Cc: Andreas Mohr, linux-kernel

[trimmed receivers since it's less relevant]

On Tue, Nov 30, 2010 at 01:13:54PM -0800, Greg KH wrote:
> On Tue, Nov 30, 2010 at 10:05:10PM +0100, Andreas Mohr wrote:
> > 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.

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

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

> thanks,
> 
> greg k-h

Andreas Mohr

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] net: Add USB PID for new MOSCHIP USB ethernet controller MCS7832 variant
  2010-11-30 20:07 [PATCH -stable] Add USB PID for new MOSCHIP USB ethernet controller MCS7832 variant Andreas Mohr
  2010-11-30 20:27 ` Greg KH
@ 2010-12-19 15:42 ` Andreas Mohr
  2010-12-20 18:39   ` David Miller
  1 sibling, 1 reply; 7+ messages in thread
From: Andreas Mohr @ 2010-12-19 15:42 UTC (permalink / raw)
  To: David S. Miller; +Cc: Arnd Bergmann, dhollis, Phil Chang, netdev, linux-kernel

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

Signed-off-by: Andreas Mohr <andi@lisas.de>
Cc: stable@kernel.org
---
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!

diff --git a/drivers/net/usb/mcs7830.c b/drivers/net/usb/mcs7830.c
index a6281e3..b701f59 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,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,
 	},

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] net: Add USB PID for new MOSCHIP USB ethernet controller MCS7832 variant
  2010-12-19 15:42 ` [PATCH] net: " Andreas Mohr
@ 2010-12-20 18:39   ` David Miller
  0 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2010-12-20 18:39 UTC (permalink / raw)
  To: andi; +Cc: arnd, dhollis, pchang23, netdev, linux-kernel

From: Andreas Mohr <andi@lisas.de>
Date: Sun, 19 Dec 2010 16:42:57 +0100

> 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
> 
> Signed-off-by: Andreas Mohr <andi@lisas.de>

Applied.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-12-20 18:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-30 20:07 [PATCH -stable] Add USB PID for new MOSCHIP USB ethernet controller MCS7832 variant Andreas Mohr
2010-11-30 20:27 ` Greg KH
2010-11-30 21:05   ` Andreas Mohr
2010-11-30 21:13     ` Greg KH
2010-11-30 21:29       ` Andreas Mohr
2010-12-19 15:42 ` [PATCH] net: " Andreas Mohr
2010-12-20 18:39   ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.