FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu Kernel Team

 
 
LinkBack Thread Tools
 
Old 10-08-2008, 10:14 PM
Leann Ogasawara
 
Default LP Bug 263309 - oops on plugging in DWL-122

The following patch should resolve LP Bug 263309 - oops on plugging in
DWL-122. The patch has already been applied to the upstream
linux-wlan-ng git tree. Additionally, one of the subscribers to the bug
report has tested and confirmed this patch to resolve the Oops:

https://bugs.edge.launchpad.net/ubuntu/+bug/263309/comments/10

The patch is attached as well as inlined below for immediate
review/comment.

UBUNTU: Fix Oops in wlan_setup
OriginalAuthor: Richard Kennedy <richard@rsk.demon.co.uk>
OriginalLocation: http://git.shaftnet.org/git/gitweb.cgi?p=linux-wlan-ng.git;a=commitdiff;h=3d7a066a273aa2f9ca8186ce37e0 466d1e815f76;hp=ed269789c03ad622753be3730f585af930 05314c
Bug: #263309

oops caused by not setting up network device queues.

Change wlan_setup to use the kernel provided alloc_netdev() rather than
hand coding it. This should help avoid any future problems.

Also change register_wlandev to not call dev_alloc_name() as
register_netdev() will do that if the device name has been setup.

Signed-off-by: Richard Kennedy <richard@rsk.demon.co.uk>

diff --git a/ubuntu/misc/wireless/p80211/p80211netdev.c b/ubuntu/misc/wireless/p80211/p80211netdev.c
index c8d879a..7fa9b99 100644
--- a/ubuntu/misc/wireless/p80211/p80211netdev.c
+++ b/ubuntu/misc/wireless/p80211/p80211netdev.c
@@ -869,6 +869,30 @@ static int wlan_change_mtu(netdevice_t *dev, int new_mtu)
return 0;
}

+/*---------------------------------------------------------
+ * wlan_alloc_netdev
+ *
+ * create a netdev properly over different kernel versions
+ * this should work with kernels earlier than 2.6.26, and if
+ * anyone cares they can change it
+----------------------------------------------------------*/
+
+static inline netdevice_t * wlan_alloc_netdev() {
+ netdevice_t *dev;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26) )
+ dev = alloc_netdev(0,"wlan%d",ether_setup);
+#else
+ dev = kmalloc(sizeof(netdevice_t), GFP_ATOMIC);
+ if ( dev ) {
+ memset( dev, 0, sizeof(netdevice_t));
+ ether_setup(dev);
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) )
+ dev->nd_net = &init_net;
+#endif
+ }
+#endif
+ return dev;
+}


/*----------------------------------------------------------------
@@ -911,14 +935,12 @@ int wlan_setup(wlandevice_t *wlandev)
p80211netdev_rx_bh,
(unsigned long)wlandev);

- /* Allocate and initialize the struct device */
- dev = kmalloc(sizeof(netdevice_t), GFP_ATOMIC);
+ /* Allocate and initialize the struct net device */
+ dev = wlan_alloc_netdev();
if ( dev == NULL ) {
WLAN_LOG_ERROR("Failed to alloc netdev.
");
result = 1;
} else {
- memset( dev, 0, sizeof(netdevice_t));
- ether_setup(dev);
wlandev->netdev = dev;
dev->priv = wlandev;
dev->hard_start_xmit = p80211knetdev_hard_start_xmit;
@@ -946,12 +968,6 @@ int wlan_setup(wlandevice_t *wlandev)
dev->wireless_handlers = &p80211wext_handler_def;
#endif
#endif
-
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26) )
- dev_net_set(dev, &init_net);
-#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) )
- dev->nd_net = &init_net;
-#endif

#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,38) )
dev->tbusy = 1;
@@ -1044,7 +1060,12 @@ int register_wlandev(wlandevice_t *wlandev)
netdevice_t *dev = wlandev->netdev;

DBFENTER;
-
+/* alloc_netdev already sets up the name */
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26) )
+ i = register_netdev(dev);
+ if (i)
+ return i;
+#else
i = dev_alloc_name(wlandev->netdev, "wlan%d");
if (i >= 0) {
i = register_netdev(wlandev->netdev);
@@ -1058,6 +1079,8 @@ int register_wlandev(wlandevice_t *wlandev)
#else
strcpy(wlandev->name, dev->name);
#endif
+#endif
+

#ifdef CONFIG_PROC_FS
if (proc_p80211) {

--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 
Old 10-09-2008, 02:57 AM
Tim Gardner
 
Default LP Bug 263309 - oops on plugging in DWL-122

Leann Ogasawara wrote:

pulled

Since you're going to all of this work (which is much appreciated), why
not apply these patches to your own git tree on kernel.ubuntu.com and
just submit a pull request?

rtg
--
Tim Gardner tim.gardner@canonical.com

--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 
Old 10-09-2008, 06:44 AM
Leann Ogasawara
 
Default LP Bug 263309 - oops on plugging in DWL-122

On Wed, 2008-10-08 at 20:57 -0600, Tim Gardner wrote:
> Leann Ogasawara wrote:
>
> pulled
>
> Since you're going to all of this work (which is much appreciated), why
> not apply these patches to your own git tree on kernel.ubuntu.com and
> just submit a pull request?

I was actually thinking the same thing after starting to send them out.
I'll start doing this for future ones.

Thanks,
Leann


--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 

Thread Tools




All times are GMT. The time now is 04:21 AM.

VBulletin, Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org