netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] sc92031: trivial cosmetic fixes
@ 2009-01-12 23:20 Cesar Eduardo Barros
  2009-01-12 23:21 ` [PATCH 1/5] sc92031: more useful banner in kernel log Cesar Eduardo Barros
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Cesar Eduardo Barros @ 2009-01-12 23:20 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev

These are trivial cosmetic fixes for the sc92031 driver. All but the 
first one have no real effect on the driver code. They were all compile 
tested only.

-- 
Cesar Eduardo Barros
cesarb@cesarb.net
cesar.barros@gmail.com

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

* [PATCH 1/5] sc92031: more useful banner in kernel log
  2009-01-12 23:20 [PATCH 0/5] sc92031: trivial cosmetic fixes Cesar Eduardo Barros
@ 2009-01-12 23:21 ` Cesar Eduardo Barros
  2009-01-12 23:21 ` [PATCH 2/5] sc92031: remove meaningless version string Cesar Eduardo Barros
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Cesar Eduardo Barros @ 2009-01-12 23:21 UTC (permalink / raw)
  To: jgarzik; +Cc: netdev, Cesar Eduardo Barros

The banner currently printed when loading the module is mostly useless.

Replace it with a more informative one, printed after probing the device.

Output format copied from 8139cp/8139too.

Signed-off-by: Cesar Eduardo Barros <cesarb@cesarb.net>
---
 drivers/net/sc92031.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/drivers/net/sc92031.c b/drivers/net/sc92031.c
index 42fd312..40b39af 100644
--- a/drivers/net/sc92031.c
+++ b/drivers/net/sc92031.c
@@ -1422,6 +1422,7 @@ static int __devinit sc92031_probe(struct pci_dev *pdev,
 	struct net_device *dev;
 	struct sc92031_priv *priv;
 	u32 mac0, mac1;
+	unsigned long base_addr;
 
 	err = pci_enable_device(pdev);
 	if (unlikely(err < 0))
@@ -1496,6 +1497,14 @@ static int __devinit sc92031_probe(struct pci_dev *pdev,
 	if (err < 0)
 		goto out_register_netdev;
 
+#if SC92031_USE_BAR == 0
+	base_addr = dev->mem_start;
+#elif SC92031_USE_BAR == 1
+	base_addr = dev->base_addr;
+#endif
+	printk(KERN_INFO "%s: SC92031 at 0x%lx, %pM, IRQ %d\n", dev->name,
+			base_addr, dev->dev_addr, dev->irq);
+
 	return 0;
 
 out_register_netdev:
@@ -1602,7 +1611,6 @@ static struct pci_driver sc92031_pci_driver = {
 
 static int __init sc92031_init(void)
 {
-	printk(KERN_INFO SC92031_DESCRIPTION " " SC92031_VERSION "\n");
 	return pci_register_driver(&sc92031_pci_driver);
 }
 
-- 
1.6.1.dirty


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

* [PATCH 2/5] sc92031: remove meaningless version string
  2009-01-12 23:20 [PATCH 0/5] sc92031: trivial cosmetic fixes Cesar Eduardo Barros
  2009-01-12 23:21 ` [PATCH 1/5] sc92031: more useful banner in kernel log Cesar Eduardo Barros
@ 2009-01-12 23:21 ` Cesar Eduardo Barros
  2009-01-12 23:21 ` [PATCH 3/5] sc92031: inline SC92031_DESCRIPTION Cesar Eduardo Barros
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Cesar Eduardo Barros @ 2009-01-12 23:21 UTC (permalink / raw)
  To: jgarzik; +Cc: netdev, Cesar Eduardo Barros

The version string makes no sense anymore, since this driver is only
maintained within the kernel.

Signed-off-by: Cesar Eduardo Barros <cesarb@cesarb.net>
---
 drivers/net/sc92031.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/drivers/net/sc92031.c b/drivers/net/sc92031.c
index 40b39af..07bd13b 100644
--- a/drivers/net/sc92031.c
+++ b/drivers/net/sc92031.c
@@ -37,7 +37,6 @@
 
 #define SC92031_NAME "sc92031"
 #define SC92031_DESCRIPTION "Silan SC92031 PCI Fast Ethernet Adapter driver"
-#define SC92031_VERSION "2.0c"
 
 /* BAR 0 is MMIO, BAR 1 is PIO */
 #ifndef SC92031_USE_BAR
@@ -1264,7 +1263,6 @@ static void sc92031_ethtool_get_drvinfo(struct net_device *dev,
 	struct pci_dev *pdev = priv->pdev;
 
 	strcpy(drvinfo->driver, SC92031_NAME);
-	strcpy(drvinfo->version, SC92031_VERSION);
 	strcpy(drvinfo->bus_info, pci_name(pdev));
 }
 
@@ -1625,4 +1623,3 @@ module_exit(sc92031_exit);
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Cesar Eduardo Barros <cesarb@cesarb.net>");
 MODULE_DESCRIPTION(SC92031_DESCRIPTION);
-MODULE_VERSION(SC92031_VERSION);
-- 
1.6.1.dirty


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

* [PATCH 3/5] sc92031: inline SC92031_DESCRIPTION
  2009-01-12 23:20 [PATCH 0/5] sc92031: trivial cosmetic fixes Cesar Eduardo Barros
  2009-01-12 23:21 ` [PATCH 1/5] sc92031: more useful banner in kernel log Cesar Eduardo Barros
  2009-01-12 23:21 ` [PATCH 2/5] sc92031: remove meaningless version string Cesar Eduardo Barros
@ 2009-01-12 23:21 ` Cesar Eduardo Barros
  2009-01-12 23:21 ` [PATCH 4/5] sc92031: use device id directly instead of made-up name Cesar Eduardo Barros
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Cesar Eduardo Barros @ 2009-01-12 23:21 UTC (permalink / raw)
  To: jgarzik; +Cc: netdev, Cesar Eduardo Barros

SC92031_DESCRIPTION is only used in one place.

Signed-off-by: Cesar Eduardo Barros <cesarb@cesarb.net>
---
 drivers/net/sc92031.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/net/sc92031.c b/drivers/net/sc92031.c
index 07bd13b..ac4ccd4 100644
--- a/drivers/net/sc92031.c
+++ b/drivers/net/sc92031.c
@@ -36,7 +36,6 @@
 #define PCI_DEVICE_ID_SILAN_8139D	0x8139
 
 #define SC92031_NAME "sc92031"
-#define SC92031_DESCRIPTION "Silan SC92031 PCI Fast Ethernet Adapter driver"
 
 /* BAR 0 is MMIO, BAR 1 is PIO */
 #ifndef SC92031_USE_BAR
@@ -1622,4 +1621,4 @@ module_exit(sc92031_exit);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Cesar Eduardo Barros <cesarb@cesarb.net>");
-MODULE_DESCRIPTION(SC92031_DESCRIPTION);
+MODULE_DESCRIPTION("Silan SC92031 PCI Fast Ethernet Adapter driver");
-- 
1.6.1.dirty


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

* [PATCH 4/5] sc92031: use device id directly instead of made-up name
  2009-01-12 23:20 [PATCH 0/5] sc92031: trivial cosmetic fixes Cesar Eduardo Barros
                   ` (2 preceding siblings ...)
  2009-01-12 23:21 ` [PATCH 3/5] sc92031: inline SC92031_DESCRIPTION Cesar Eduardo Barros
@ 2009-01-12 23:21 ` Cesar Eduardo Barros
  2009-01-12 23:21 ` [PATCH 5/5] sc92031: add a link to the datasheet Cesar Eduardo Barros
  2009-01-15  4:34 ` [PATCH 0/5] sc92031: trivial cosmetic fixes David Miller
  5 siblings, 0 replies; 7+ messages in thread
From: Cesar Eduardo Barros @ 2009-01-12 23:21 UTC (permalink / raw)
  To: jgarzik; +Cc: netdev, Cesar Eduardo Barros

Instead of making up a name for the device ids, put them directly in the
device id table. Also move the vendor id to pci_ids.h.

Signed-off-by: Cesar Eduardo Barros <cesarb@cesarb.net>
---
 drivers/net/sc92031.c   |    8 ++------
 include/linux/pci_ids.h |    2 ++
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/net/sc92031.c b/drivers/net/sc92031.c
index ac4ccd4..2a111f2 100644
--- a/drivers/net/sc92031.c
+++ b/drivers/net/sc92031.c
@@ -31,10 +31,6 @@
 
 #include <asm/irq.h>
 
-#define PCI_VENDOR_ID_SILAN		0x1904
-#define PCI_DEVICE_ID_SILAN_SC92031	0x2031
-#define PCI_DEVICE_ID_SILAN_8139D	0x8139
-
 #define SC92031_NAME "sc92031"
 
 /* BAR 0 is MMIO, BAR 1 is PIO */
@@ -1591,8 +1587,8 @@ out:
 }
 
 static struct pci_device_id sc92031_pci_device_id_table[] __devinitdata = {
-	{ PCI_DEVICE(PCI_VENDOR_ID_SILAN, PCI_DEVICE_ID_SILAN_SC92031) },
-	{ PCI_DEVICE(PCI_VENDOR_ID_SILAN, PCI_DEVICE_ID_SILAN_8139D) },
+	{ PCI_DEVICE(PCI_VENDOR_ID_SILAN, 0x2031) },
+	{ PCI_DEVICE(PCI_VENDOR_ID_SILAN, 0x8139) },
 	{ 0, }
 };
 MODULE_DEVICE_TABLE(pci, sc92031_pci_device_id_table);
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index d543365..c05bc2a 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -2208,6 +2208,8 @@
 
 #define PCI_VENDOR_ID_TOPSPIN		0x1867
 
+#define PCI_VENDOR_ID_SILAN		0x1904
+
 #define PCI_VENDOR_ID_TDI               0x192E
 #define PCI_DEVICE_ID_TDI_EHCI          0x0101
 
-- 
1.6.1.dirty


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

* [PATCH 5/5] sc92031: add a link to the datasheet
  2009-01-12 23:20 [PATCH 0/5] sc92031: trivial cosmetic fixes Cesar Eduardo Barros
                   ` (3 preceding siblings ...)
  2009-01-12 23:21 ` [PATCH 4/5] sc92031: use device id directly instead of made-up name Cesar Eduardo Barros
@ 2009-01-12 23:21 ` Cesar Eduardo Barros
  2009-01-15  4:34 ` [PATCH 0/5] sc92031: trivial cosmetic fixes David Miller
  5 siblings, 0 replies; 7+ messages in thread
From: Cesar Eduardo Barros @ 2009-01-12 23:21 UTC (permalink / raw)
  To: jgarzik; +Cc: netdev, Cesar Eduardo Barros

Signed-off-by: Cesar Eduardo Barros <cesarb@cesarb.net>
---
 drivers/net/sc92031.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/net/sc92031.c b/drivers/net/sc92031.c
index 2a111f2..d26ee28 100644
--- a/drivers/net/sc92031.c
+++ b/drivers/net/sc92031.c
@@ -13,6 +13,9 @@
  *  Both are almost identical and seem to be based on pci-skeleton.c
  *
  *  Rewritten for 2.6 by Cesar Eduardo Barros
+ *
+ *  A datasheet for this chip can be found at
+ *  http://www.silan.com.cn/english/products/pdf/SC92031AY.pdf
  */
 
 /* Note about set_mac_address: I don't know how to change the hardware
-- 
1.6.1.dirty


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

* Re: [PATCH 0/5] sc92031: trivial cosmetic fixes
  2009-01-12 23:20 [PATCH 0/5] sc92031: trivial cosmetic fixes Cesar Eduardo Barros
                   ` (4 preceding siblings ...)
  2009-01-12 23:21 ` [PATCH 5/5] sc92031: add a link to the datasheet Cesar Eduardo Barros
@ 2009-01-15  4:34 ` David Miller
  5 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2009-01-15  4:34 UTC (permalink / raw)
  To: cesarb; +Cc: jgarzik, netdev

From: Cesar Eduardo Barros <cesarb@cesarb.net>
Date: Mon, 12 Jan 2009 21:20:47 -0200

> These are trivial cosmetic fixes for the sc92031 driver. All but the
> first one have no real effect on the driver code. They were all
> compile tested only.

All applied to what will become net-next-2.6, thanks.

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

end of thread, other threads:[~2009-01-15  4:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-12 23:20 [PATCH 0/5] sc92031: trivial cosmetic fixes Cesar Eduardo Barros
2009-01-12 23:21 ` [PATCH 1/5] sc92031: more useful banner in kernel log Cesar Eduardo Barros
2009-01-12 23:21 ` [PATCH 2/5] sc92031: remove meaningless version string Cesar Eduardo Barros
2009-01-12 23:21 ` [PATCH 3/5] sc92031: inline SC92031_DESCRIPTION Cesar Eduardo Barros
2009-01-12 23:21 ` [PATCH 4/5] sc92031: use device id directly instead of made-up name Cesar Eduardo Barros
2009-01-12 23:21 ` [PATCH 5/5] sc92031: add a link to the datasheet Cesar Eduardo Barros
2009-01-15  4:34 ` [PATCH 0/5] sc92031: trivial cosmetic fixes David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).