Skip to contentSkip to conversation

STAGING patches for 2.6-git

PATCH New Greg KH 2 participants 6 messages Feb 27, 2009 Staging

lore
Share & tools
lore

Greg KH

author
#0 lore raw

PATCH 1/1 STAGING patches for 2.6-git

Here are some tiny staging patches that fix some bugs and oopses that people have reported, as well as a Kconfig dependancy fix that is needed.

Please pull from:
master.kernel.org:/pub/scm/linux/kernel/git/gregkh/staging-2.6.git/

All of these have been in the -next releases with no known build errors.

The patches will be sent as a follow-on to this message to lkml for people to see.

thanks,

greg k-h

--------------

 drivers/staging/panel/panel.c                      |   23 ++++++++++---------
 drivers/staging/rtl8187se/Kconfig                  |    1 +
 .../staging/rtl8187se/ieee80211/ieee80211_crypt.c  |   19 ++++++++-------
 drivers/staging/rtl8187se/r8180_core.c             |    2 +-
 drivers/staging/winbond/wbusb.c                    |   20 +++++++++++------
 5 files changed, 37 insertions(+), 28 deletions(-)

---------------

Costantino Leandro (1):
Staging: panel: fix oops on panel_cleanup_module

Pavel Machek (1):
Staging: w35und: fix registration with wlan stack

Pekka Enberg (1):
Staging: w35und: fix usb_control_msg() error handling in wb35_probe()

Randy Dunlap (1):
Staging: rtl8187se: fix Kconfig dependencies

leandro Costantino (1):
Staging: rtl8187se: Fix oops and memory poison caused by builtin ieee80211.

#1 lore raw

PATCH 1/5 Staging: rtl8187se: fix Kconfig dependencies

From: Randy Dunlap <[email protected]>

rtl8187se uses wireless extensions so it needs to depend on WIRELESS_EXT (or select it).

rtl8187se uses fields in struct net_device that are only present if CONFIG_COMPAT_NET_DEV_OPS=y, so it needs to depend on that symbol also.

drivers/staging/rtl8187se/r8180_core.c:5973: error: 'struct net_device' has no member named 'wireless_handlers' drivers/staging/rtl8187se/r8180_core.c:5982: error: 'struct net_device' has no member named 'wireless_handlers'

drivers/staging/rtl8187se/r8180_core.c:201: error: 'struct net_device' has no member named 'stop' drivers/staging/rtl8187se/r8180_core.c:4584: error: 'struct net_device' has no member named 'get_stats' drivers/staging/rtl8187se/r8180_core.c:5969: error: 'struct net_device' has no member named 'open' drivers/staging/rtl8187se/r8180_core.c:5970: error: 'struct net_device' has no member named 'stop' drivers/staging/rtl8187se/r8180_core.c:5972: error: 'struct net_device' has no member named 'tx_timeout' drivers/staging/rtl8187se/r8180_core.c:5974: error: 'struct net_device' has no member named 'do_ioctl' drivers/staging/rtl8187se/r8180_core.c:5975: error: 'struct net_device' has no member named 'set_multicast_list' drivers/staging/rtl8187se/r8180_core.c:5976: error: 'struct net_device' has no member named 'set_mac_address'

---
 drivers/staging/rtl8187se/Kconfig |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/staging/rtl8187se/Kconfig +1 -0
index 79c225a..f636296 100644
@@ -1,5 +1,6 @@
 config RTL8187SE
 	tristate "RealTek RTL8187SE Wireless LAN NIC driver"
 	depends on PCI
+	depends on WIRELESS_EXT && COMPAT_NET_DEV_OPS
 	default N
 	---help---
Signature · 1 line
1.6.0.2
#2 lore raw

PATCH 2/5 Staging: rtl8187se: Fix oops and memory poison caused by builtin ieee80211.

In reply to Greg KH

From: leandro Costantino <[email protected]>

when modprobe and removing rtl8187se ( just for testing, i do not have that card , and oops and a memory poison error happens on the builtin ieee80211 of that driver. I dont know if they will port it to the current ieeee80221 instead of the builtin ones, but just in case i attach a proposed fix for that problem.

- Change for loop on ieee80211_crypto_deinit for list_for_each_safe to remove items. Is there an spinlock needed here?
- Call ieee80211_crypto_deinit after exiting all registerd crypto protocols.

---
 .../staging/rtl8187se/ieee80211/ieee80211_crypt.c  |   19 ++++++++++---------
 drivers/staging/rtl8187se/r8180_core.c             |    2 +-
 2 files changed, 11 insertions(+), 10 deletions(-)
drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.c +10 -9
index af64cfb..7370296 100644
@@ -234,20 +234,21 @@ out:
 void ieee80211_crypto_deinit(void)
 {
 	struct list_head *ptr, *n;
+	struct ieee80211_crypto_alg *alg = NULL;
 
 	if (hcrypt == NULL)
 		return;
 
-	for (ptr = hcrypt->algs.next, n = ptr->next; ptr != &hcrypt->algs;
-	     ptr = n, n = ptr->next) {
-		struct ieee80211_crypto_alg *alg =
-			(struct ieee80211_crypto_alg *) ptr;
-		list_del(ptr);
-		printk(KERN_DEBUG "ieee80211_crypt: unregistered algorithm "
-		       "'%s' (deinit)\n", alg->ops->name);
-		kfree(alg);
+	list_for_each_safe(ptr, n, &hcrypt->algs) {
+		alg = list_entry(ptr, struct ieee80211_crypto_alg, list);
+		if (alg) {
+			list_del(ptr);
+			printk(KERN_DEBUG
+			       "ieee80211_crypt: unregistered algorithm '%s' (deinit)\n",
+			       alg->ops->name);
+			kfree(alg);
+		}
 	}
-
 	kfree(hcrypt);
 }
 
drivers/staging/rtl8187se/r8180_core.c +1 -1
index 9453495..66de5cc 100644
@@ -6161,10 +6161,10 @@ static void __exit rtl8180_pci_module_exit(void)
 {
 	pci_unregister_driver (&rtl8180_pci_driver);
 	rtl8180_proc_module_remove();
-	ieee80211_crypto_deinit();
 	ieee80211_crypto_tkip_exit();
 	ieee80211_crypto_ccmp_exit();
 	ieee80211_crypto_wep_exit();
+	ieee80211_crypto_deinit();
 	DMESG("Exiting");
 }
 
Signature · 1 line
1.6.0.2
#3 lore raw

PATCH 3/5 Staging: panel: fix oops on panel_cleanup_module

In reply to Greg KH

From: Costantino Leandro <[email protected]>

Check for null pardevice (not registered, ej: panel never attached, inexistent parport, etc. ) before calling parport_release, parport_unregister_device, and related funcs on module release.

---
 drivers/staging/panel/panel.c |   23 ++++++++++++-----------
 1 files changed, 12 insertions(+), 11 deletions(-)
drivers/staging/panel/panel.c +12 -11
index ab69c1b..c2747bc 100644
@@ -2164,19 +2164,20 @@ static void __exit panel_cleanup_module(void)
 	if (scan_timer.function != NULL)
 		del_timer(&scan_timer);
 
-	if (keypad_enabled)
-		misc_deregister(&keypad_dev);
+	if (pprt != NULL) {
+		if (keypad_enabled)
+			misc_deregister(&keypad_dev);
+
+		if (lcd_enabled) {
+			panel_lcd_print("\x0cLCD driver " PANEL_VERSION
+					"\nunloaded.\x1b[Lc\x1b[Lb\x1b[L-");
+			misc_deregister(&lcd_dev);
+		}
 
-	if (lcd_enabled) {
-		panel_lcd_print("\x0cLCD driver " PANEL_VERSION
-				"\nunloaded.\x1b[Lc\x1b[Lb\x1b[L-");
-		misc_deregister(&lcd_dev);
+		/* TODO: free all input signals */
+		parport_release(pprt);
+		parport_unregister_device(pprt);
 	}
-
-	/* TODO: free all input signals */
-
-	parport_release(pprt);
-	parport_unregister_device(pprt);
 	parport_unregister_driver(&panel_driver);
 }
 
Signature · 1 line
1.6.0.2
#4 lore raw

PATCH 4/5 Staging: w35und: fix registration with wlan stack

In reply to Greg KH

From: Pavel Machek <[email protected]>

Initialize few more fields in wireless device structure so that wireless core actually accepts our registration.

---
 drivers/staging/winbond/wbusb.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/staging/winbond/wbusb.c +3 -1
index b003f9a..49f1bf0 100644
@@ -369,9 +369,11 @@ static int wb35_probe(struct usb_interface *intf, const struct usb_device_id *id
 	}
 
 	dev->extra_tx_headroom = 12;	/* FIXME */
-	dev->flags = 0;
+	dev->flags = IEEE80211_HW_SIGNAL_UNSPEC;
+	dev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION);
 
 	dev->channel_change_time = 1000;
+	dev->max_signal = 100;
 	dev->queues = 1;
 
 	dev->wiphy->bands[IEEE80211_BAND_2GHZ] = &wbsoft_band_2GHz;
Signature · 1 line
1.6.0.2
#5 lore raw

PATCH 5/5 Staging: w35und: fix usb_control_msg() error handling in wb35_probe()

In reply to Greg KH

From: Pekka Enberg <[email protected]>

If successful, the usb_control_msg() function returns the number of bytes transferred. Fix up wb35_probe() to only bail out if the function returns a negative number. Also, fix up ieee80211_alloc_hw() error code to ENOMEM; otherwise GCC complains that err might be undefined (and is right about that).

---
 drivers/staging/winbond/wbusb.c |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)
drivers/staging/winbond/wbusb.c +10 -6
index 49f1bf0..f716b2e 100644
@@ -319,16 +319,18 @@ static int wb35_probe(struct usb_interface *intf, const struct usb_device_id *id
 	struct usb_device *udev = interface_to_usbdev(intf);
 	struct wbsoft_priv *priv;
 	struct ieee80211_hw *dev;
-	int err;
+	int nr, err;
 
 	usb_get_dev(udev);
 
 	// 20060630.2 Check the device if it already be opened
-	err = usb_control_msg(udev, usb_rcvctrlpipe( udev, 0 ),
-			      0x01, USB_TYPE_VENDOR|USB_RECIP_DEVICE|USB_DIR_IN,
-			      0x0, 0x400, &ltmp, 4, HZ*100 );
-	if (err)
+	nr = usb_control_msg(udev, usb_rcvctrlpipe( udev, 0 ),
+			     0x01, USB_TYPE_VENDOR|USB_RECIP_DEVICE|USB_DIR_IN,
+			     0x0, 0x400, &ltmp, 4, HZ*100 );
+	if (nr < 0) {
+		err = nr;
 		goto error;
+	}
 
 	ltmp = cpu_to_le32(ltmp);
 	if (ltmp) {  // Is already initialized?
@@ -337,8 +339,10 @@ static int wb35_probe(struct usb_interface *intf, const struct usb_device_id *id
 	}
 
 	dev = ieee80211_alloc_hw(sizeof(*priv), &wbsoft_ops);
-	if (!dev)
+	if (!dev) {
+		err = -ENOMEM;
 		goto error;
+	}
 
 	priv = dev->priv;
 
Signature · 1 line
1.6.0.2