Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 141221
b: refs/heads/master
c: cfde745
h: refs/heads/master
i:
  141219: 50f9cfd
v: v3
  • Loading branch information
Richard Kennedy authored and Greg Kroah-Hartman committed Apr 3, 2009
1 parent c540a14 commit e1485d3
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 18c7f792be75c2430cbf16e22dca1ab6a9881a63
refs/heads/master: cfde74517b32724a78896eda49198f147e12050d
14 changes: 14 additions & 0 deletions trunk/drivers/staging/wlan-ng/p80211netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,8 @@ static int p80211knetdev_do_ioctl(netdevice_t *dev, struct ifreq *ifr, int cmd)

pr_debug("rx'd ioctl, cmd=%d, len=%d\n", cmd, req->len);

mutex_lock(&wlandev->ioctl_lock);

#ifdef SIOCETHTOOL
if (cmd == SIOCETHTOOL) {
result =
Expand Down Expand Up @@ -607,6 +609,8 @@ static int p80211knetdev_do_ioctl(netdevice_t *dev, struct ifreq *ifr, int cmd)
result = -ENOMEM;
}
bail:
mutex_unlock(&wlandev->ioctl_lock);

return result; /* If allocate,copyfrom or copyto fails, return errno */
}

Expand Down Expand Up @@ -758,6 +762,11 @@ int wlan_setup(wlandevice_t *wlandev)
dev->open = p80211knetdev_open;
dev->stop = p80211knetdev_stop;

mutex_init(&wlandev->ioctl_lock);
/* block ioctls until fully initialised. Don't forget to call
allow_ioctls at some point!*/
mutex_lock(&wlandev->ioctl_lock);

#if (WIRELESS_EXT < 21)
dev->get_wireless_stats = p80211wext_get_wireless_stats;
#endif
Expand Down Expand Up @@ -1098,3 +1107,8 @@ static void p80211knetdev_tx_timeout(netdevice_t *netdev)
netif_wake_queue(wlandev->netdev);
}
}

void p80211_allow_ioctls(wlandevice_t *wlandev)
{
mutex_unlock(&wlandev->ioctl_lock);
}
4 changes: 3 additions & 1 deletion trunk/drivers/staging/wlan-ng/p80211netdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ typedef struct wlandevice {
u8 spy_number;
char spy_address[IW_MAX_SPY][ETH_ALEN];
struct iw_quality spy_stat[IW_MAX_SPY];

struct mutex ioctl_lock;
} wlandevice_t;

/* WEP stuff */
Expand All @@ -242,5 +244,5 @@ int register_wlandev(wlandevice_t *wlandev);
int unregister_wlandev(wlandevice_t *wlandev);
void p80211netdev_rx(wlandevice_t *wlandev, struct sk_buff *skb);
void p80211netdev_hwremoved(wlandevice_t *wlandev);

void p80211_allow_ioctls(wlandevice_t *wlandev);
#endif
1 change: 1 addition & 0 deletions trunk/drivers/staging/wlan-ng/prism2usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ static int prism2sta_probe_usb(struct usb_interface *interface,
wlandev = NULL;

done:
p80211_allow_ioctls(wlandev);
usb_set_intfdata(interface, wlandev);
return result;
}
Expand Down

0 comments on commit e1485d3

Please sign in to comment.