This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / drivers / net / wireless / prism54 / isl_ioctl.c
index 601e406..989599a 100644 (file)
@@ -20,7 +20,6 @@
  *
  */
 
-#include <linux/version.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/if_arp.h>
 
 #include <net/iw_handler.h>    /* New driver API */
 
+
+static void prism54_wpa_ie_add(islpci_private *priv, u8 *bssid,
+                               u8 *wpa_ie, size_t wpa_ie_len);
+static size_t prism54_wpa_ie_get(islpci_private *priv, u8 *bssid, u8 *wpa_ie);
+static int prism54_set_wpa(struct net_device *, struct iw_request_info *,
+                               __u32 *, char *);
+
+
 /**
  * prism54_mib_mode_helper - MIB change mode helper function
  * @mib: the &struct islpci_mib object to modify
@@ -47,7 +54,7 @@
  *  Wireless API modes to Device firmware modes. It also checks for 
  *  correct valid Linux wireless modes. 
  */
-int
+static int
 prism54_mib_mode_helper(islpci_private *priv, u32 iw_mode)
 {
        u32 config = INL_CONFIG_MANUALRUN;
@@ -454,14 +461,12 @@ prism54_get_range(struct net_device *ndev, struct iw_request_info *info,
        /* txpower is supported in dBm's */
        range->txpower_capa = IW_TXPOW_DBM;
 
-#if WIRELESS_EXT > 16
        /* Event capability (kernel + driver) */
        range->event_capa[0] = (IW_EVENT_CAPA_K_0 |
        IW_EVENT_CAPA_MASK(SIOCGIWTHRSPY) |
        IW_EVENT_CAPA_MASK(SIOCGIWAP));
        range->event_capa[1] = IW_EVENT_CAPA_K_1;
        range->event_capa[4] = IW_EVENT_CAPA_MASK(IWEVCUSTOM);
-#endif /* WIRELESS_EXT > 16 */
 
        if (islpci_get_state(priv) < PRV_STATE_INIT)
                return 0;
@@ -647,7 +652,7 @@ prism54_translate_bss(struct net_device *ndev, char *current_ev,
        return current_ev;
 }
 
-int
+static int
 prism54_get_scan(struct net_device *ndev, struct iw_request_info *info,
                 struct iw_point *dwrq, char *extra)
 {
@@ -685,14 +690,13 @@ prism54_get_scan(struct net_device *ndev, struct iw_request_info *info,
                                                   extra + dwrq->length,
                                                   &(bsslist->bsslist[i]),
                                                   noise);
-#if WIRELESS_EXT > 16
+
                /* Check if there is space for one more entry */
                if((extra + dwrq->length - current_ev) <= IW_EV_ADDR_LEN) {
                        /* Ask user space to try again with a bigger buffer */
                        rvalue = -E2BIG;
                        break;
                }
-#endif /* WIRELESS_EXT > 16 */
        }
 
        kfree(bsslist);
@@ -743,8 +747,8 @@ prism54_get_essid(struct net_device *ndev, struct iw_request_info *info,
 
        if (essid->length) {
                dwrq->flags = 1;        /* set ESSID to ON for Wireless Extensions */
-               /* if it is to big, trunk it */
-               dwrq->length = min(IW_ESSID_MAX_SIZE, essid->length + 1);
+               /* if it is too big, trunk it */
+               dwrq->length = min((u8)IW_ESSID_MAX_SIZE, essid->length);
        } else {
                dwrq->flags = 0;
                dwrq->length = 0;
@@ -1524,31 +1528,35 @@ send_formatted_event(islpci_private *priv, const char *str,
                     const struct obj_mlme *mlme, int error)
 {
        union iwreq_data wrqu;
+       char *memptr;
 
-       wrqu.data.pointer = kmalloc(IW_CUSTOM_MAX, GFP_KERNEL);
-       if (!wrqu.data.pointer)
+       memptr = kmalloc(IW_CUSTOM_MAX, GFP_KERNEL);
+       if (!memptr)
                return;
+       wrqu.data.pointer = memptr;
        wrqu.data.length = 0;
-       format_event(priv, wrqu.data.pointer, str, mlme, &wrqu.data.length,
+       format_event(priv, memptr, str, mlme, &wrqu.data.length,
                     error);
-       wireless_send_event(priv->ndev, IWEVCUSTOM, &wrqu, wrqu.data.pointer);
-       kfree(wrqu.data.pointer);
+       wireless_send_event(priv->ndev, IWEVCUSTOM, &wrqu, memptr);
+       kfree(memptr);
 }
 
 static void
 send_simple_event(islpci_private *priv, const char *str)
 {
        union iwreq_data wrqu;
+       char *memptr;
        int n = strlen(str);
 
-       wrqu.data.pointer = kmalloc(IW_CUSTOM_MAX, GFP_KERNEL);
-       if (!wrqu.data.pointer)
+       memptr = kmalloc(IW_CUSTOM_MAX, GFP_KERNEL);
+       if (!memptr)
                return;
        BUG_ON(n > IW_CUSTOM_MAX);
+       wrqu.data.pointer = memptr;
        wrqu.data.length = n;
-       strcpy(wrqu.data.pointer, str);
-       wireless_send_event(priv->ndev, IWEVCUSTOM, &wrqu, wrqu.data.pointer);
-       kfree(wrqu.data.pointer);
+       strcpy(memptr, str);
+       wireless_send_event(priv->ndev, IWEVCUSTOM, &wrqu, memptr);
+       kfree(memptr);
 }
 
 static void
@@ -1582,7 +1590,7 @@ static u8 wpa_oid[4] = { 0x00, 0x50, 0xf2, 1 };
 #define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5]
 #define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x"
 
-void
+static void
 prism54_wpa_ie_add(islpci_private *priv, u8 *bssid,
                   u8 *wpa_ie, size_t wpa_ie_len)
 {
@@ -1649,7 +1657,7 @@ prism54_wpa_ie_add(islpci_private *priv, u8 *bssid,
        up(&priv->wpa_sem);
 }
 
-size_t
+static size_t
 prism54_wpa_ie_get(islpci_private *priv, u8 *bssid, u8 *wpa_ie)
 {
        struct list_head *ptr;
@@ -1736,7 +1744,7 @@ handle_request(islpci_private *priv, struct obj_mlme *mlme, enum oid_num_t oid)
        }
 }
 
-int
+static int
 prism54_process_trap_helper(islpci_private *priv, enum oid_num_t oid,
                            char *data)
 {
@@ -1746,7 +1754,7 @@ prism54_process_trap_helper(islpci_private *priv, enum oid_num_t oid,
        u8 wpa_ie[MAX_WPA_IE_LEN];
        int wpa_ie_len;
        size_t len = 0; /* u16, better? */
-       u8 *payload = 0, *pos = 0;
+       u8 *payload = NULL, *pos = NULL;
        int ret;
 
        /* I think all trapable objects are listed here.
@@ -2314,7 +2322,7 @@ prism54_hostapd(struct net_device *ndev, struct iw_point *p)
        return ret;
 }
 
-int
+static int
 prism54_set_wpa(struct net_device *ndev, struct iw_request_info *info,
                __u32 * uwrq, char *extra)
 {
@@ -2358,7 +2366,7 @@ prism54_set_wpa(struct net_device *ndev, struct iw_request_info *info,
        return 0;
 }
 
-int
+static int
 prism54_get_wpa(struct net_device *ndev, struct iw_request_info *info,
                __u32 * uwrq, char *extra)
 {
@@ -2367,7 +2375,7 @@ prism54_get_wpa(struct net_device *ndev, struct iw_request_info *info,
        return 0;
 }
 
-int
+static int
 prism54_set_prismhdr(struct net_device *ndev, struct iw_request_info *info,
                     __u32 * uwrq, char *extra)
 {
@@ -2380,7 +2388,7 @@ prism54_set_prismhdr(struct net_device *ndev, struct iw_request_info *info,
        return 0;
 }
 
-int
+static int
 prism54_get_prismhdr(struct net_device *ndev, struct iw_request_info *info,
                     __u32 * uwrq, char *extra)
 {
@@ -2389,7 +2397,7 @@ prism54_get_prismhdr(struct net_device *ndev, struct iw_request_info *info,
        return 0;
 }
 
-int
+static int
 prism54_debug_oid(struct net_device *ndev, struct iw_request_info *info,
                  __u32 * uwrq, char *extra)
 {
@@ -2401,7 +2409,7 @@ prism54_debug_oid(struct net_device *ndev, struct iw_request_info *info,
        return 0;
 }
 
-int
+static int
 prism54_debug_get_oid(struct net_device *ndev, struct iw_request_info *info,
                      struct iw_point *data, char *extra)
 {
@@ -2437,7 +2445,7 @@ prism54_debug_get_oid(struct net_device *ndev, struct iw_request_info *info,
        return ret;
 }
 
-int
+static int
 prism54_debug_set_oid(struct net_device *ndev, struct iw_request_info *info,
                      struct iw_point *data, char *extra)
 {
@@ -2715,9 +2723,7 @@ const struct iw_handler_def prism54_handler_def = {
        .standard = (iw_handler *) prism54_handler,
        .private = (iw_handler *) prism54_private_handler,
        .private_args = (struct iw_priv_args *) prism54_private_args,
-#if WIRELESS_EXT == 16
-       .spy_offset = offsetof(islpci_private, spy_data),
-#endif /* WIRELESS_EXT == 16 */
+       .get_wireless_stats = prism54_get_wireless_stats,
 };
 
 /* For wpa_supplicant */