提交 ac558ca2 编写于 作者: H Holger Schurig 提交者: David S. Miller

[PATCH] libertas: make more functions static & remove unused functions

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: NHolger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 c23a24f6
...@@ -446,25 +446,6 @@ void libertas_init_11d(wlan_private * priv) ...@@ -446,25 +446,6 @@ void libertas_init_11d(wlan_private * priv)
return; 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 * @brief This function sets DOMAIN INFO to FW
* @param priv pointer to wlan_private * @param priv pointer to wlan_private
...@@ -577,31 +558,6 @@ int libertas_cmd_802_11d_domain_info(wlan_private * priv, ...@@ -577,31 +558,6 @@ int libertas_cmd_802_11d_domain_info(wlan_private * priv,
return 0; 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 * @brief This function parses countryinfo from AP and download country info to FW
* @param priv pointer to wlan_private * @param priv pointer to wlan_private
......
...@@ -83,8 +83,6 @@ u8 libertas_get_scan_type_11d(u8 chan, ...@@ -83,8 +83,6 @@ u8 libertas_get_scan_type_11d(u8 chan,
u32 libertas_chan_2_freq(u8 chan, u8 band); 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); void libertas_init_11d(wlan_private * priv);
int libertas_set_universaltable(wlan_private * priv, u8 band); int libertas_set_universaltable(wlan_private * priv, u8 band);
...@@ -93,8 +91,6 @@ int libertas_cmd_802_11d_domain_info(wlan_private * priv, ...@@ -93,8 +91,6 @@ int libertas_cmd_802_11d_domain_info(wlan_private * priv,
struct cmd_ds_command *cmd, u16 cmdno, struct cmd_ds_command *cmd, u16 cmdno,
u16 cmdOption); u16 cmdOption);
int libertas_cmd_enable_11d(wlan_private * priv, struct iwreq *wrq);
int libertas_ret_802_11d_domain_info(wlan_private * priv, int libertas_ret_802_11d_domain_info(wlan_private * priv,
struct cmd_ds_command *resp); struct cmd_ds_command *resp);
......
...@@ -1045,7 +1045,7 @@ void __libertas_cleanup_and_insert_cmd(wlan_private * priv, struct cmd_ctrl_node ...@@ -1045,7 +1045,7 @@ void __libertas_cleanup_and_insert_cmd(wlan_private * priv, struct cmd_ctrl_node
return; 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; unsigned long flags;
......
...@@ -15,14 +15,9 @@ struct wlan_private; ...@@ -15,14 +15,9 @@ struct wlan_private;
struct sk_buff; struct sk_buff;
struct net_device; 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_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); 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); int libertas_free_cmd_buffer(wlan_private * priv);
struct cmd_ctrl_node; struct cmd_ctrl_node;
...@@ -53,8 +48,6 @@ void libertas_upload_rx_packet(wlan_private * priv, struct sk_buff *skb); ...@@ -53,8 +48,6 @@ void libertas_upload_rx_packet(wlan_private * priv, struct sk_buff *skb);
/** The proc fs interface */ /** The proc fs interface */
int libertas_process_rx_command(wlan_private * priv); int libertas_process_rx_command(wlan_private * priv);
int libertas_process_tx(wlan_private * priv, struct sk_buff *skb); 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, void __libertas_cleanup_and_insert_cmd(wlan_private * priv,
struct cmd_ctrl_node *ptempcmd); struct cmd_ctrl_node *ptempcmd);
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
static const char usbdriver_name[] = "usb8xxx"; static const char usbdriver_name[] = "usb8xxx";
static u8 *default_fw_name = "usb8388.bin"; 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); module_param_named(fw_name, libertas_fw_name, charp, 0644);
/* /*
...@@ -51,6 +51,8 @@ static int if_usb_prog_firmware(wlan_private *); ...@@ -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_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_get_int_status(wlan_private * priv, u8 *);
static int if_usb_read_event_cause(wlan_private *); 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 * @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) ...@@ -92,7 +94,7 @@ static void if_usb_write_bulk_callback(struct urb *urb)
* @param cardp pointer usb_card_rec * @param cardp pointer usb_card_rec
* @return N/A * @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); lbs_deb_enter(LBS_DEB_USB);
...@@ -384,7 +386,7 @@ static int if_usb_reset_device(wlan_private *priv) ...@@ -384,7 +386,7 @@ static int if_usb_reset_device(wlan_private *priv)
* @param nb data length * @param nb data length
* @return 0 or -1 * @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 */ /* pointer to card structure */
struct usb_card_rec *cardp = priv->card; struct usb_card_rec *cardp = priv->card;
......
...@@ -102,7 +102,4 @@ struct fwsyncheader { ...@@ -102,7 +102,4 @@ struct fwsyncheader {
#define FW_DATA_XMIT_SIZE \ #define FW_DATA_XMIT_SIZE \
sizeof(struct fwheader) + le32_to_cpu(fwdata->fwheader.datalength) + sizeof(u32) 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 #endif
...@@ -112,20 +112,6 @@ void libertas_unset_basic_rate_flags(u8 * rates, size_t len) ...@@ -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 * @brief Associate to a specific BSS discovered in a scan
* *
......
...@@ -12,44 +12,39 @@ ...@@ -12,44 +12,39 @@
#include "dev.h" #include "dev.h"
struct cmd_ds_command; 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, struct cmd_ds_command *cmd,
void *pdata_buf); 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, struct cmd_ds_command *cmd,
void *pdata_buf); 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); 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, struct cmd_ds_command *cmd,
void *pdata_buf); 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); 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, struct cmd_ds_command *cmd,
void *pdata_buf); 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); 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); 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); 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); struct cmd_ds_command *resp);
extern int libertas_reassociation_thread(void *data); int libertas_start_adhoc_network(wlan_private * priv,
extern int libertas_start_adhoc_network(wlan_private * priv,
struct assoc_request * assoc_req); 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); struct assoc_request * assoc_req);
extern int libertas_stop_adhoc_network(wlan_private * priv); int libertas_stop_adhoc_network(wlan_private * priv);
extern int libertas_send_deauthentication(wlan_private * priv);
extern int libertas_send_deauth(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); int wlan_associate(wlan_private * priv, struct assoc_request * assoc_req);
......
...@@ -890,6 +890,31 @@ static void command_timer_fn(unsigned long data) ...@@ -890,6 +890,31 @@ static void command_timer_fn(unsigned long data)
return; 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) static int wlan_allocate_adapter(wlan_private * priv)
{ {
size_t bufsize; size_t bufsize;
...@@ -1009,31 +1034,6 @@ static void wlan_init_adapter(wlan_private * priv) ...@@ -1009,31 +1034,6 @@ static void wlan_init_adapter(wlan_private * priv)
return; 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) static int libertas_init_fw(wlan_private * priv)
{ {
int ret = -1; int ret = -1;
......
...@@ -1254,7 +1254,7 @@ struct bss_descriptor * libertas_find_ssid_in_list(wlan_adapter * adapter, ...@@ -1254,7 +1254,7 @@ struct bss_descriptor * libertas_find_ssid_in_list(wlan_adapter * adapter,
* *
* @return index in BSSID list * @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 mode)
{ {
u8 bestrssi = 0; u8 bestrssi = 0;
...@@ -1386,39 +1386,6 @@ int libertas_send_specific_ssid_scan(wlan_private * priv, ...@@ -1386,39 +1386,6 @@ int libertas_send_specific_ssid_scan(wlan_private * priv,
return ret; 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, static inline char *libertas_translate_scan(wlan_private *priv,
char *start, char *stop, char *start, char *stop,
struct bss_descriptor *bss) struct bss_descriptor *bss)
......
...@@ -175,31 +175,26 @@ struct bss_descriptor { ...@@ -175,31 +175,26 @@ struct bss_descriptor {
struct list_head list; 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, struct bss_descriptor * libertas_find_ssid_in_list(wlan_adapter * adapter,
u8 *ssid, u8 ssid_len, u8 * bssid, u8 mode, u8 *ssid, u8 ssid_len, u8 * bssid, u8 mode,
int channel); int channel);
struct bss_descriptor * libertas_find_best_ssid_in_list(wlan_adapter * adapter, struct bss_descriptor * libertas_find_bssid_in_list(wlan_adapter * adapter,
u8 mode);
extern struct bss_descriptor * libertas_find_bssid_in_list(wlan_adapter * adapter,
u8 * bssid, u8 mode); u8 * bssid, u8 mode);
int libertas_find_best_network_ssid(wlan_private * priv, u8 *out_ssid, int libertas_find_best_network_ssid(wlan_private * priv, u8 *out_ssid,
u8 *out_ssid_len, u8 preferred_mode, u8 *out_mode); 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); 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, struct cmd_ds_command *cmd,
void *pdata_buf); 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); struct cmd_ds_command *resp);
int wlan_scan_networks(wlan_private * priv, int wlan_scan_networks(wlan_private * priv,
...@@ -211,9 +206,9 @@ struct ifreq; ...@@ -211,9 +206,9 @@ struct ifreq;
struct iw_point; struct iw_point;
struct iw_param; struct iw_param;
struct iw_request_info; 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); 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); struct iw_param *vwrq, char *extra);
#endif /* _WLAN_SCAN_H */ #endif /* _WLAN_SCAN_H */
...@@ -157,7 +157,7 @@ static struct chan_freq_power *find_cfp_by_band_and_freq(wlan_adapter * adapter, ...@@ -157,7 +157,7 @@ static struct chan_freq_power *find_cfp_by_band_and_freq(wlan_adapter * adapter,
* @option Radio Option * @option Radio Option
* @return 0 --success, otherwise fail * @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; int ret = 0;
wlan_adapter *adapter = priv->adapter; wlan_adapter *adapter = priv->adapter;
......
...@@ -4,9 +4,6 @@ ...@@ -4,9 +4,6 @@
#ifndef _WLAN_WEXT_H_ #ifndef _WLAN_WEXT_H_
#define _WLAN_WEXT_H_ #define _WLAN_WEXT_H_
#define SUBCMD_OFFSET 4
#define SUBCMD_DATA(x) *((int *)(x->u.name + SUBCMD_OFFSET))
/** wlan_ioctl_regrdwr */ /** wlan_ioctl_regrdwr */
struct wlan_ioctl_regrdwr { struct wlan_ioctl_regrdwr {
/** Which register to access */ /** Which register to access */
...@@ -25,6 +22,5 @@ struct wlan_ioctl_regrdwr { ...@@ -25,6 +22,5 @@ struct wlan_ioctl_regrdwr {
extern struct iw_handler_def libertas_handler_def; extern struct iw_handler_def libertas_handler_def;
extern struct iw_handler_def mesh_handler_def; extern struct iw_handler_def mesh_handler_def;
int wlan_radio_ioctl(wlan_private * priv, u8 option);
#endif /* _WLAN_WEXT_H_ */ #endif /* _WLAN_WEXT_H_ */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册