Ignore:
Timestamp:
2011-02-23T23:10:08+01:00 (5 years ago)
Author:
florian
Message:

[brcm-2.4] fix wlcompat so that the wl module can be unloaded

This patch was created on 8.09.2 but it also applies to Backfire
I found that I couldn't unload the broadcom wl driver, wlcompat didn't correctly release/decrement the device pointer,
This patch cleans that up

I wanted to be able to remove/install the wl driver so that I could get out of monitor mode without rebooting

Signed-off-by: Chris Martin <chris@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/backfire/package/broadcom-wl/src/wlcompat/wlcompat.c

    r15245 r25671  
    3939 
    4040char buf[WLC_IOCTL_MAXLEN]; 
    41 static struct net_device *dev; 
     41static struct net_device *dev = NULL; 
    4242#ifndef DEBUG 
    4343static int random = 1; 
     
    982982        char devname[4] = "wl0"; 
    983983 
     984        /* calling dev_get_by_name() will inc the open_counter in dev 
     985         * we must put it back with dev_put() when we are finished to dec the counter */ 
    984986        while (!found && (dev = dev_get_by_name(devname))) { 
    985987                if ((wl_ioctl(dev, WLC_GET_MAGIC, &i, sizeof(i)) == 0) && (i == WLC_IOCTL_MAGIC)) 
    986988                        found = 1; 
    987                 devname[2]++; 
     989                else { 
     990                        dev_put(dev); 
     991                        devname[2]++; 
     992                } 
    988993        } 
    989994 
     
    10271032#endif 
    10281033        dev->do_ioctl = old_ioctl; 
     1034 
     1035        dev_put(dev); 
     1036 
    10291037        return; 
    10301038} 
Note: See TracChangeset for help on using the changeset viewer.