[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1328699332-9024-1-git-send-email-pmeerw@pmeerw.net>
Date: Wed, 8 Feb 2012 12:08:51 +0100
From: Peter Meerwald <pmeerw@...erw.net>
To: linux-kernel@...r.kernel.org
Cc: davem@...emloft.net, steve.glendinning@...c.com,
Peter Meerwald <p.meerwald@...-electronic.com>
Subject: [PATCH 1/2] smsc95xx: add module parameter to turn off NIC status leds
From: Peter Meerwald <p.meerwald@...-electronic.com>
add module parameter to allow to turn off NIC status leds (link,
speed, activity); blinking LEDs are annoying outside the server room :)
default behaviour is not changed, tested on beagleboard-xm
Signed-off-by: Peter Meerwald <p.meerwald@...-electronic.com>
---
drivers/net/usb/smsc95xx.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index d45520e..b7b2326 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -63,6 +63,10 @@ static bool turbo_mode = true;
module_param(turbo_mode, bool, 0644);
MODULE_PARM_DESC(turbo_mode, "Enable multiple frames per Rx transaction");
+static bool leds_off = false;
+module_param(leds_off, bool, 0644);
+MODULE_PARM_DESC(leds_off, "Turn off NIC LEDs");
+
static int smsc95xx_read_reg(struct usbnet *dev, u32 index, u32 *data)
{
u32 *buf = kmalloc(4, GFP_KERNEL);
@@ -894,8 +898,11 @@ static int smsc95xx_reset(struct usbnet *dev)
netif_dbg(dev, ifup, dev->net, "ID_REV = 0x%08x\n", read_buf);
/* Configure GPIO pins as LED outputs */
- write_buf = LED_GPIO_CFG_SPD_LED | LED_GPIO_CFG_LNK_LED |
- LED_GPIO_CFG_FDX_LED;
+ if (!leds_off)
+ write_buf = LED_GPIO_CFG_SPD_LED | LED_GPIO_CFG_LNK_LED |
+ LED_GPIO_CFG_FDX_LED;
+ else
+ write_buf = 0;
ret = smsc95xx_write_reg(dev, LED_GPIO_CFG, write_buf);
if (ret < 0) {
netdev_warn(dev->net, "Failed to write LED_GPIO_CFG register, ret=%d\n",
--
1.7.4.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists