Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[powerpc.git] / drivers / net / wireless / hostap / hostap_ioctl.c
index 53f5246..8399de5 100644 (file)
@@ -1,11 +1,13 @@
 /* ioctl() (mostly Linux Wireless Extensions) routines for Host AP driver */
 
-#ifdef in_atomic
-/* Get kernel_locked() for in_atomic() */
+#include <linux/types.h>
 #include <linux/smp_lock.h>
-#endif
 #include <linux/ethtool.h>
+#include <net/ieee80211_crypt.h>
 
+#include "hostap_wlan.h"
+#include "hostap.h"
+#include "hostap_ap.h"
 
 static struct iw_statistics *hostap_get_wireless_stats(struct net_device *dev)
 {
@@ -552,7 +554,6 @@ static int prism2_ioctl_giwaplist(struct net_device *dev,
 
        kfree(addr);
        kfree(qual);
-
        return 0;
 }
 
@@ -1859,7 +1860,7 @@ static char * __prism2_translate_scan(local_info_t *local,
        memset(&iwe, 0, sizeof(iwe));
        iwe.cmd = SIOCGIWFREQ;
        if (scan) {
-               chan = scan->chid;
+               chan = le16_to_cpu(scan->chid);
        } else if (bss) {
                chan = bss->chan;
        } else {
@@ -1867,7 +1868,7 @@ static char * __prism2_translate_scan(local_info_t *local,
        }
 
        if (chan > 0) {
-               iwe.u.freq.m = freq_list[le16_to_cpu(chan - 1)] * 100000;
+               iwe.u.freq.m = freq_list[chan - 1] * 100000;
                iwe.u.freq.e = 1;
                current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe,
                                                  IW_EV_FREQ_LEN);
@@ -3081,9 +3082,7 @@ static int prism2_ioctl_priv_download(local_info_t *local, struct iw_point *p)
        ret = local->func->download(local, param);
 
  out:
-       if (param != NULL)
-               kfree(param);
-
+       kfree(param);
        return ret;
 }
 #endif /* PRISM2_DOWNLOAD_SUPPORT */
@@ -3359,10 +3358,6 @@ static int prism2_ioctl_siwencodeext(struct net_device *dev,
        if (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) {
                if (!sta_ptr)
                        local->tx_keyidx = i;
-               else if (i) {
-                       ret = -EINVAL;
-                       goto done;
-               }
        }
 
 
@@ -3890,9 +3885,7 @@ static int prism2_ioctl_priv_hostapd(local_info_t *local, struct iw_point *p)
        }
 
  out:
-       if (param != NULL)
-               kfree(param);
-
+       kfree(param);
        return ret;
 }
 
@@ -3915,7 +3908,7 @@ static void prism2_get_drvinfo(struct net_device *dev,
                 local->sta_fw_ver & 0xff);
 }
 
-static struct ethtool_ops prism2_ethtool_ops = {
+struct ethtool_ops prism2_ethtool_ops = {
        .get_drvinfo = prism2_get_drvinfo
 };
 
@@ -3990,7 +3983,7 @@ static const iw_handler prism2_private_handler[] =
        (iw_handler) prism2_ioctl_priv_readmif,         /* 3 */
 };
 
-static const struct iw_handler_def hostap_iw_handler_def =
+const struct iw_handler_def hostap_iw_handler_def =
 {
        .num_standard   = sizeof(prism2_handler) / sizeof(iw_handler),
        .num_private    = sizeof(prism2_private_handler) / sizeof(iw_handler),