|
@@ -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 =
|
|
@@ -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 */
|
|
|
}
|
|
|
|
|
@@ -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
|
|
@@ -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);
|
|
|
+}
|