]> err.no Git - linux-2.6/commitdiff
[PATCH] libertas: make more functions static & remove unused functions
authorHolger Schurig <hs4233@mail.mn-solutions.de>
Thu, 2 Aug 2007 15:49:06 +0000 (11:49 -0400)
committerDavid S. Miller <davem@sunset.davemloft.net>
Wed, 10 Oct 2007 23:49:49 +0000 (16:49 -0700)
Some functions where declared in header files, but used only once. They are
now static functions.

After doing this, I found out that some functions weren't used at all. I
removed this dead code.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 files changed:
drivers/net/wireless/libertas/11d.c
drivers/net/wireless/libertas/11d.h
drivers/net/wireless/libertas/cmd.c
drivers/net/wireless/libertas/decl.h
drivers/net/wireless/libertas/if_usb.c
drivers/net/wireless/libertas/if_usb.h
drivers/net/wireless/libertas/join.c
drivers/net/wireless/libertas/join.h
drivers/net/wireless/libertas/main.c
drivers/net/wireless/libertas/scan.c
drivers/net/wireless/libertas/scan.h
drivers/net/wireless/libertas/wext.c
drivers/net/wireless/libertas/wext.h

index 26d85ec37d9e4eab8e3a575159e41bdd33a3d917..ba4cbcb5911359ed9f89e4ab9631b756005deec1 100644 (file)
@@ -446,25 +446,6 @@ void libertas_init_11d(wlan_private * priv)
        return;
 }
 
-static int wlan_enable_11d(wlan_private * priv, u8 flag)
-{
-       int ret;
-
-       priv->adapter->enable11d = flag;
-
-       /* send cmd to FW to enable/disable 11D function in FW */
-       ret = libertas_prepare_and_send_command(priv,
-                                   CMD_802_11_SNMP_MIB,
-                                   CMD_ACT_SET,
-                                   CMD_OPTION_WAITFORRSP,
-                                   OID_802_11D_ENABLE,
-                                   &priv->adapter->enable11d);
-       if (ret)
-               lbs_deb_11d("11D: Fail to enable 11D \n");
-
-       return 0;
-}
-
 /**
  *  @brief This function sets DOMAIN INFO to FW
  *  @param priv       pointer to wlan_private
@@ -577,31 +558,6 @@ done:
        return 0;
 }
 
-/**
- *  @brief This function implements private cmd: enable/disable 11D
- *  @param priv    pointer to wlan_private
- *  @param wrq     pointer to user data
- *  @return       0 or -1
- */
-int libertas_cmd_enable_11d(wlan_private * priv, struct iwreq *wrq)
-{
-       int data = 0;
-       int *val;
-
-       lbs_deb_enter(LBS_DEB_11D);
-       data = SUBCMD_DATA(wrq);
-
-       lbs_deb_11d("enable 11D: %s\n",
-              (data == 1) ? "enable" : "Disable");
-
-       wlan_enable_11d(priv, data);
-       val = (int *)wrq->u.name;
-       *val = priv->adapter->enable11d;
-
-       lbs_deb_enter(LBS_DEB_11D);
-       return 0;
-}
-
 /**
  *  @brief This function parses countryinfo from AP and download country info to FW
  *  @param priv    pointer to wlan_private
index 73e42e7129110a3da2fefc377fbdd8a10676ef0a..3a6d1f8db78fcaee88e6bf81bf7e7049d811ffad 100644 (file)
@@ -83,8 +83,6 @@ u8 libertas_get_scan_type_11d(u8 chan,
 
 u32 libertas_chan_2_freq(u8 chan, u8 band);
 
-enum state_11d libertas_get_state_11d(wlan_private * priv);
-
 void libertas_init_11d(wlan_private * priv);
 
 int libertas_set_universaltable(wlan_private * priv, u8 band);
@@ -93,8 +91,6 @@ int libertas_cmd_802_11d_domain_info(wlan_private * priv,
                                 struct cmd_ds_command *cmd, u16 cmdno,
                                 u16 cmdOption);
 
-int libertas_cmd_enable_11d(wlan_private * priv, struct iwreq *wrq);
-
 int libertas_ret_802_11d_domain_info(wlan_private * priv,
                                 struct cmd_ds_command *resp);
 
index c3fc074b6e3a840bd40fda4cde7667e79ebf3a0f..85b573770704e15ad7ec16df179ecfeeef3ea967 100644 (file)
@@ -1045,7 +1045,7 @@ done:
        return;
 }
 
-void libertas_cleanup_and_insert_cmd(wlan_private * priv, struct cmd_ctrl_node *ptempcmd)
+static void libertas_cleanup_and_insert_cmd(wlan_private * priv, struct cmd_ctrl_node *ptempcmd)
 {
        unsigned long flags;
 
index 113cfc1395e3a8cee882b1efda8b4cd6b3408762..095edf6a4c29a53f272d338a567b9a29934a3851 100644 (file)
@@ -15,14 +15,9 @@ struct wlan_private;
 struct sk_buff;
 struct net_device;
 
-extern char *libertas_fw_name;
-
-void libertas_free_adapter(wlan_private * priv);
 int libertas_set_mac_packet_filter(wlan_private * priv);
 
-int libertas_send_null_packet(wlan_private * priv, u8 pwr_mgmt);
 void libertas_send_tx_feedback(wlan_private * priv);
-u8 libertas_check_last_packet_indication(wlan_private * priv);
 
 int libertas_free_cmd_buffer(wlan_private * priv);
 struct cmd_ctrl_node;
@@ -53,8 +48,6 @@ void libertas_upload_rx_packet(wlan_private * priv, struct sk_buff *skb);
 /** The proc fs interface */
 int libertas_process_rx_command(wlan_private * priv);
 int libertas_process_tx(wlan_private * priv, struct sk_buff *skb);
-void libertas_cleanup_and_insert_cmd(wlan_private * priv,
-                                       struct cmd_ctrl_node *ptempcmd);
 void __libertas_cleanup_and_insert_cmd(wlan_private * priv,
                                        struct cmd_ctrl_node *ptempcmd);
 
index ac1cfc253fdc2c9693b336df8776f99d47a4ef7b..c28d9747b86508cf5dccac302021c54ece134859 100644 (file)
@@ -22,7 +22,7 @@
 static const char usbdriver_name[] = "usb8xxx";
 static u8 *default_fw_name = "usb8388.bin";
 
-char *libertas_fw_name = NULL;
+static char *libertas_fw_name = NULL;
 module_param_named(fw_name, libertas_fw_name, charp, 0644);
 
 /*
@@ -51,6 +51,8 @@ static int if_usb_prog_firmware(wlan_private *);
 static int if_usb_host_to_card(wlan_private * priv, u8 type, u8 * payload, u16 nb);
 static int if_usb_get_int_status(wlan_private * priv, u8 *);
 static int if_usb_read_event_cause(wlan_private *);
+static int usb_tx_block(wlan_private *priv, u8 *payload, u16 nb);
+static void if_usb_free(struct usb_card_rec *cardp);
 
 /**
  *  @brief  call back function to handle the status of the URB
@@ -92,7 +94,7 @@ static void if_usb_write_bulk_callback(struct urb *urb)
  *  @param cardp       pointer usb_card_rec
  *  @return            N/A
  */
-void if_usb_free(struct usb_card_rec *cardp)
+static void if_usb_free(struct usb_card_rec *cardp)
 {
        lbs_deb_enter(LBS_DEB_USB);
 
@@ -384,7 +386,7 @@ static int if_usb_reset_device(wlan_private *priv)
  *  @param nb          data length
  *  @return            0 or -1
  */
-int usb_tx_block(wlan_private * priv, u8 * payload, u16 nb)
+static int usb_tx_block(wlan_private * priv, u8 * payload, u16 nb)
 {
        /* pointer to card structure */
        struct usb_card_rec *cardp = priv->card;
index 5da8c94ca4c58bd8829a5660488cb7a2ba882e51..8b3b4f1e47f6dbeccf32d4c2e2d34787ae499ecc 100644 (file)
@@ -102,7 +102,4 @@ struct fwsyncheader {
 #define FW_DATA_XMIT_SIZE \
        sizeof(struct fwheader) + le32_to_cpu(fwdata->fwheader.datalength) + sizeof(u32)
 
-int usb_tx_block(wlan_private *priv, u8 *payload, u16 nb);
-void if_usb_free(struct usb_card_rec *cardp);
-
 #endif
index f71c172101a84032f2be4cfecce77a2ac3c24c31..f9799c3b81c20dcf2bbe3f440f803e141474a6a5 100644 (file)
@@ -112,20 +112,6 @@ void libertas_unset_basic_rate_flags(u8 * rates, size_t len)
 }
 
 
-int libertas_send_deauth(wlan_private * priv)
-{
-       wlan_adapter *adapter = priv->adapter;
-       int ret = 0;
-
-       if (adapter->mode == IW_MODE_INFRA &&
-           adapter->connect_status == LIBERTAS_CONNECTED)
-               ret = libertas_send_deauthentication(priv);
-       else
-               ret = -ENOTSUPP;
-
-       return ret;
-}
-
 /**
  *  @brief Associate to a specific BSS discovered in a scan
  *
index 8ea5ae30f4ab694f3fcfc96b7c781756b0e69783..894a072b9f8d4e6ab8164a422deec0aa68e462df 100644 (file)
 #include "dev.h"
 
 struct cmd_ds_command;
-extern int libertas_cmd_80211_authenticate(wlan_private * priv,
+int libertas_cmd_80211_authenticate(wlan_private * priv,
                                        struct cmd_ds_command *cmd,
                                        void *pdata_buf);
-extern int libertas_cmd_80211_ad_hoc_join(wlan_private * priv,
+int libertas_cmd_80211_ad_hoc_join(wlan_private * priv,
                                       struct cmd_ds_command *cmd,
                                       void *pdata_buf);
-extern int libertas_cmd_80211_ad_hoc_stop(wlan_private * priv,
+int libertas_cmd_80211_ad_hoc_stop(wlan_private * priv,
                                       struct cmd_ds_command *cmd);
-extern int libertas_cmd_80211_ad_hoc_start(wlan_private * priv,
+int libertas_cmd_80211_ad_hoc_start(wlan_private * priv,
                                        struct cmd_ds_command *cmd,
                                        void *pdata_buf);
-extern int libertas_cmd_80211_deauthenticate(wlan_private * priv,
+int libertas_cmd_80211_deauthenticate(wlan_private * priv,
                                          struct cmd_ds_command *cmd);
-extern int libertas_cmd_80211_associate(wlan_private * priv,
+int libertas_cmd_80211_associate(wlan_private * priv,
                                     struct cmd_ds_command *cmd,
                                     void *pdata_buf);
 
-extern int libertas_ret_80211_ad_hoc_start(wlan_private * priv,
+int libertas_ret_80211_ad_hoc_start(wlan_private * priv,
                                        struct cmd_ds_command *resp);
-extern int libertas_ret_80211_ad_hoc_stop(wlan_private * priv,
+int libertas_ret_80211_ad_hoc_stop(wlan_private * priv,
                                       struct cmd_ds_command *resp);
-extern int libertas_ret_80211_disassociate(wlan_private * priv,
+int libertas_ret_80211_disassociate(wlan_private * priv,
                                        struct cmd_ds_command *resp);
-extern int libertas_ret_80211_associate(wlan_private * priv,
+int libertas_ret_80211_associate(wlan_private * priv,
                                     struct cmd_ds_command *resp);
 
-extern int libertas_reassociation_thread(void *data);
-
-extern int libertas_start_adhoc_network(wlan_private * priv,
+int libertas_start_adhoc_network(wlan_private * priv,
                             struct assoc_request * assoc_req);
-extern int libertas_join_adhoc_network(wlan_private * priv,
+int libertas_join_adhoc_network(wlan_private * priv,
                                struct assoc_request * assoc_req);
-extern int libertas_stop_adhoc_network(wlan_private * priv);
-
-extern int libertas_send_deauthentication(wlan_private * priv);
-extern int libertas_send_deauth(wlan_private * priv);
+int libertas_stop_adhoc_network(wlan_private * priv);
 
-extern int libertas_do_adhocstop_ioctl(wlan_private * priv);
+int libertas_send_deauthentication(wlan_private * priv);
 
 int wlan_associate(wlan_private * priv, struct assoc_request * assoc_req);
 
index 7e417eacbc770ba3a51463b974a6840ee4ce6c77..e8555de657628582393c005aed9001ee9212b81e 100644 (file)
@@ -890,6 +890,31 @@ static void command_timer_fn(unsigned long data)
        return;
 }
 
+static void libertas_free_adapter(wlan_private * priv)
+{
+       wlan_adapter *adapter = priv->adapter;
+
+       if (!adapter) {
+               lbs_deb_fw("why double free adapter?\n");
+               return;
+       }
+
+       lbs_deb_fw("free command buffer\n");
+       libertas_free_cmd_buffer(priv);
+
+       lbs_deb_fw("free command_timer\n");
+       del_timer(&adapter->command_timer);
+
+       lbs_deb_fw("free scan results table\n");
+       kfree(adapter->networks);
+       adapter->networks = NULL;
+
+       /* Free the adapter object itself */
+       lbs_deb_fw("free adapter\n");
+       kfree(adapter);
+       priv->adapter = NULL;
+}
+
 static int wlan_allocate_adapter(wlan_private * priv)
 {
        size_t bufsize;
@@ -1009,31 +1034,6 @@ static void wlan_init_adapter(wlan_private * priv)
        return;
 }
 
-void libertas_free_adapter(wlan_private * priv)
-{
-       wlan_adapter *adapter = priv->adapter;
-
-       if (!adapter) {
-               lbs_deb_fw("why double free adapter?\n");
-               return;
-       }
-
-       lbs_deb_fw("free command buffer\n");
-       libertas_free_cmd_buffer(priv);
-
-       lbs_deb_fw("free command_timer\n");
-       del_timer(&adapter->command_timer);
-
-       lbs_deb_fw("free scan results table\n");
-       kfree(adapter->networks);
-       adapter->networks = NULL;
-
-       /* Free the adapter object itself */
-       lbs_deb_fw("free adapter\n");
-       kfree(adapter);
-       priv->adapter = NULL;
-}
-
 static int libertas_init_fw(wlan_private * priv)
 {
        int ret = -1;
index 790e9888ea2b2613975be65aba4f60df079bdad3..683fa1ba5cacda570c5ca99f5a64dd5921ad80cd 100644 (file)
@@ -1254,7 +1254,7 @@ out:
  *
  *  @return         index in BSSID list
  */
-struct bss_descriptor * libertas_find_best_ssid_in_list(wlan_adapter * adapter,
+static struct bss_descriptor * libertas_find_best_ssid_in_list(wlan_adapter * adapter,
                u8 mode)
 {
        u8 bestrssi = 0;
@@ -1386,39 +1386,6 @@ out:
        return ret;
 }
 
-/**
- *  @brief scan an AP with specific BSSID
- *
- *  @param priv             A pointer to wlan_private structure
- *  @param bssid            A pointer to AP's bssid
- *  @param keeppreviousscan Flag used to save/clear scan table before scan
- *
- *  @return          0-success, otherwise fail
- */
-int libertas_send_specific_bssid_scan(wlan_private * priv, u8 * bssid, u8 clear_bssid)
-{
-       struct wlan_ioctl_user_scan_cfg scancfg;
-
-       lbs_deb_enter(LBS_DEB_ASSOC);
-
-       if (bssid == NULL)
-               goto out;
-
-       memset(&scancfg, 0x00, sizeof(scancfg));
-       memcpy(scancfg.bssid, bssid, ETH_ALEN);
-       scancfg.clear_bssid = clear_bssid;
-
-       wlan_scan_networks(priv, &scancfg, 1);
-       if (priv->adapter->surpriseremoved)
-               return -1;
-       wait_event_interruptible(priv->adapter->cmd_pending,
-               !priv->adapter->nr_cmd_pending);
-
-out:
-       lbs_deb_leave(LBS_DEB_ASSOC);
-       return 0;
-}
-
 static inline char *libertas_translate_scan(wlan_private *priv,
                                        char *start, char *stop,
                                        struct bss_descriptor *bss)
index 8c3508b3257f8a566356489af5f0b472647d757c..def0db5c4e619c92f1dcf8afe6b2fdf339f8225f 100644 (file)
@@ -175,31 +175,26 @@ struct bss_descriptor {
        struct list_head list;
 };
 
-extern int libertas_ssid_cmp(u8 *ssid1, u8 ssid1_len, u8 *ssid2, u8 ssid2_len);
+int libertas_ssid_cmp(u8 *ssid1, u8 ssid1_len, u8 *ssid2, u8 ssid2_len);
 
 struct bss_descriptor * libertas_find_ssid_in_list(wlan_adapter * adapter,
                        u8 *ssid, u8 ssid_len, u8 * bssid, u8 mode,
                        int channel);
 
-struct bss_descriptor * libertas_find_best_ssid_in_list(wlan_adapter * adapter,
-                       u8 mode);
-
-extern struct bss_descriptor * libertas_find_bssid_in_list(wlan_adapter * adapter,
+struct bss_descriptor * libertas_find_bssid_in_list(wlan_adapter * adapter,
                        u8 * bssid, u8 mode);
 
 int libertas_find_best_network_ssid(wlan_private * priv, u8 *out_ssid,
                        u8 *out_ssid_len, u8 preferred_mode, u8 *out_mode);
 
-extern int libertas_send_specific_ssid_scan(wlan_private * priv, u8 *ssid,
+int libertas_send_specific_ssid_scan(wlan_private * priv, u8 *ssid,
                                u8 ssid_len, u8 clear_ssid);
-extern int libertas_send_specific_bssid_scan(wlan_private * priv,
-                                u8 * bssid, u8 clear_bssid);
 
-extern int libertas_cmd_80211_scan(wlan_private * priv,
+int libertas_cmd_80211_scan(wlan_private * priv,
                                struct cmd_ds_command *cmd,
                                void *pdata_buf);
 
-extern int libertas_ret_80211_scan(wlan_private * priv,
+int libertas_ret_80211_scan(wlan_private * priv,
                                struct cmd_ds_command *resp);
 
 int wlan_scan_networks(wlan_private * priv,
@@ -211,9 +206,9 @@ struct ifreq;
 struct iw_point;
 struct iw_param;
 struct iw_request_info;
-extern int libertas_get_scan(struct net_device *dev, struct iw_request_info *info,
+int libertas_get_scan(struct net_device *dev, struct iw_request_info *info,
                         struct iw_point *dwrq, char *extra);
-extern int libertas_set_scan(struct net_device *dev, struct iw_request_info *info,
+int libertas_set_scan(struct net_device *dev, struct iw_request_info *info,
                         struct iw_param *vwrq, char *extra);
 
 #endif                         /* _WLAN_SCAN_H */
index 0b805e32993a95be2ca3afce7a9f650b919acb07..e8c0629f9a4bdde794e3a85c48dc43a5cf3aa5bc 100644 (file)
@@ -157,7 +157,7 @@ static struct chan_freq_power *find_cfp_by_band_and_freq(wlan_adapter * adapter,
  *  @option                    Radio Option
  *  @return                    0 --success, otherwise fail
  */
-int wlan_radio_ioctl(wlan_private * priv, u8 option)
+static int wlan_radio_ioctl(wlan_private * priv, u8 option)
 {
        int ret = 0;
        wlan_adapter *adapter = priv->adapter;
index 3d5196c9553aa6228cdade43ffd95364ad91a1c7..5b0bbc99a21e632d8be970de57ec5807f189f174 100644 (file)
@@ -4,9 +4,6 @@
 #ifndef        _WLAN_WEXT_H_
 #define        _WLAN_WEXT_H_
 
-#define SUBCMD_OFFSET                  4
-#define SUBCMD_DATA(x)                 *((int *)(x->u.name + SUBCMD_OFFSET))
-
 /** wlan_ioctl_regrdwr */
 struct wlan_ioctl_regrdwr {
        /** Which register to access */
@@ -25,6 +22,5 @@ struct wlan_ioctl_regrdwr {
 
 extern struct iw_handler_def libertas_handler_def;
 extern struct iw_handler_def mesh_handler_def;
-int wlan_radio_ioctl(wlan_private * priv, u8 option);
 
 #endif                         /* _WLAN_WEXT_H_ */