]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/staging/wlan-ng/p80211netdev.c
Merge branch 'omap-clock-fixes' of git://git.pwsan.com/linux-2.6
[linux-2.6-omap-h63xx.git] / drivers / staging / wlan-ng / p80211netdev.c
index 1f166b3da7973bbb89a0e4184814828f7314e111..b2a606a36936360e547c2f7d63e1f62e3e129ff3 100644 (file)
@@ -80,7 +80,6 @@
 /*================================================================*/
 /* Project Includes */
 
-#include "wlan_compat.h"
 #include "p80211types.h"
 #include "p80211hdr.h"
 #include "p80211conv.h"
@@ -568,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 =
@@ -608,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 */
 }
 
@@ -755,32 +758,21 @@ int wlan_setup(wlandevice_t *wlandev)
                dev->ml_priv = wlandev;
                dev->hard_start_xmit = p80211knetdev_hard_start_xmit;
                dev->get_stats = p80211knetdev_get_stats;
-#ifdef HAVE_PRIVATE_IOCTL
-               dev->do_ioctl = p80211knetdev_do_ioctl;
-#endif
-#ifdef HAVE_MULTICAST
-               dev->set_multicast_list = p80211knetdev_set_multicast_list;
-#endif
                dev->init = p80211knetdev_init;
                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
                dev->wireless_handlers = &p80211wext_handler_def;
 
                netif_stop_queue(dev);
-#ifdef HAVE_CHANGE_MTU
-               dev->change_mtu = wlan_change_mtu;
-#endif
-#ifdef HAVE_SET_MAC_ADDR
-               dev->set_mac_address = p80211knetdev_set_mac_address;
-#endif
-#ifdef HAVE_TX_TIMEOUT
-               dev->tx_timeout = &p80211knetdev_tx_timeout;
-               dev->watchdog_timeo = (wlan_watchdog * HZ) / 1000;
-#endif
                netif_carrier_off(dev);
        }
 
@@ -1115,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);
+}