lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1310644306-16180-1-git-send-email-viliam.mateicka@gmail.com>
Date:	Thu, 14 Jul 2011 13:51:46 +0200
From:	Viliam Mateicka <viliam.mateicka@...il.com>
To:	"David S . Miller " <davem@...emloft.net>, mirq-linux@...e.qmqm.pl,
	Steve Glendinning <steve.glendinning@...c.com>,
	Rabin Vincent <rabin@....in>,
	David Decotigny <decot@...gle.com>,
	linux-kernel@...r.kernel.org
Cc:	Viliam Mateicka <viliam.mateicka@...il.com>
Subject: [PATCH] smsc95xx: add missing .reset_resume hook and reset card

This patch fixes the undefined behaviour (random MAC, interface goes down) of smsc95xx driver after resume from suspend.
Calling smsc95xx_reset() is needed to properly set hw registers of card and bring interface up to defined state.

Signed-off-by: Viliam Mateicka <viliam.mateicka@...il.com>
---
 drivers/net/usb/smsc95xx.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index f74f3ce..5c33be8 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -1181,6 +1181,17 @@ static struct sk_buff *smsc95xx_tx_fixup(struct usbnet *dev,
 	return skb;
 }
 
+static int smsc95xx_reset_resume(struct usb_interface *intf)
+{
+	struct usbnet	*dev = usb_get_intfdata(intf);
+
+	smsc95xx_reset(dev);
+
+	usbnet_resume(intf);
+
+	return 0;
+}
+
 static const struct driver_info smsc95xx_info = {
 	.description	= "smsc95xx USB 2.0 Ethernet",
 	.bind		= smsc95xx_bind,
@@ -1295,6 +1306,7 @@ static struct usb_driver smsc95xx_driver = {
 	.suspend	= usbnet_suspend,
 	.resume		= usbnet_resume,
 	.disconnect	= usbnet_disconnect,
+	.reset_resume	= smsc95xx_reset_resume,
 };
 
 static int __init smsc95xx_init(void)
-- 
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ