[OLPC Networking] [PATCH 5/5] libertas: make more functions static
Arnd Bergmann
arnd at arndb.de
Tue Jul 4 23:10:34 EDT 2006
These symbols are part of the internal interface, but used
only in the file they are defined in, or not used at all,
so we can remove the external declaration and make them
static.
Signed-off-by: Arnd Bergmann <arnd at arndb.de>
Index: libertas/drivers/net/wireless/libertas/if_usb.c
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/if_usb.c 2006-07-05 05:09:14.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/if_usb.c 2006-07-05 05:09:14.000000000 +0200
@@ -54,11 +54,11 @@
static usb_notifier_fn_add wlan_card_add_cb = NULL;
static usb_notifier_fn_remove wlan_card_remove_cb = NULL;
-const char usbdriver_name[] = "usb8xxx";
+static const char usbdriver_name[] = "usb8xxx";
static u8 usb_int_cause = 0;
/** struct This structure contains the device signature */
-struct usb_device_id if_usb_table[] = {
+static struct usb_device_id if_usb_table[] = {
/* Enter the device signature inside */
{
USB_DEVICE(USB8388_VID_1, USB8388_PID_1),
@@ -69,8 +69,7 @@
{} /* Terminating entry */
};
-int if_prog_firmware(wlan_private * priv);
-
+static int if_prog_firmware(wlan_private * priv);
static void if_usb_receive(struct urb *urb, struct pt_regs *regs);
static void if_usb_receive_fwload(struct urb *urb, struct pt_regs *regs);
static int if_usb_probe(struct usb_interface *intf,
@@ -703,24 +702,6 @@
return ret;
}
-/**
- * @brief This function reads data from FW.
- * @param priv pointer to wlan_private structure
- * @param type type of data to read
- * @param nb number of data bytes
- * @param payload buffer for payload data
- * @param npayload number of bytes to read
- * @return WLAN_STATUS_SUCCESS
- */
-int sbi_card_to_host(wlan_private * priv, u32 type, u32 * nb, u8 * payload,
- u16 npayload)
-{
- /* handle dummy conditions as upload buf is ready in the
- * Rx callback
- */
- return WLAN_STATUS_SUCCESS;
-}
-
/**
* @brief This is a dummy function
* @param priv pointer to wlan_private
@@ -905,7 +886,7 @@
* @param priv pointer to wlan_private
* @return WLAN_STATUS_SUCCESS
*/
-int if_prog_firmware(wlan_private * priv)
+static int if_prog_firmware(wlan_private * priv)
{
struct usb_card_rec *cardp = priv->wlan_dev.card;
struct FWData *fwdata;
Index: libertas/drivers/net/wireless/libertas/wlan_11d.c
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/wlan_11d.c 2006-07-05 05:09:14.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/wlan_11d.c 2006-07-05 05:09:14.000000000 +0200
@@ -42,7 +42,7 @@
};
/* Following 2 structure defines the supported channels */
-struct chan_freq_power channel_freq_power_UN_BG[] = {
+static struct chan_freq_power channel_freq_power_UN_BG[] = {
{1, 2412, TX_PWR_DEFAULT},
{2, 2417, TX_PWR_DEFAULT},
{3, 2422, TX_PWR_DEFAULT},
@@ -59,45 +59,6 @@
{14, 2484, TX_PWR_DEFAULT}
};
-struct chan_freq_power channel_freq_power_UN_AJ[] = {
- {8, 5040, TX_PWR_DEFAULT},
- {12, 5060, TX_PWR_DEFAULT},
- {16, 5080, TX_PWR_DEFAULT},
- {34, 5170, TX_PWR_DEFAULT},
- {38, 5190, TX_PWR_DEFAULT},
- {42, 5210, TX_PWR_DEFAULT},
- {46, 5230, TX_PWR_DEFAULT},
- {36, 5180, TX_PWR_DEFAULT},
- {40, 5200, TX_PWR_DEFAULT},
- {44, 5220, TX_PWR_DEFAULT},
- {48, 5240, TX_PWR_DEFAULT},
- {52, 5260, TX_PWR_DEFAULT},
- {56, 5280, TX_PWR_DEFAULT},
- {60, 5300, TX_PWR_DEFAULT},
- {64, 5320, TX_PWR_DEFAULT},
- {100, 5500, TX_PWR_DEFAULT},
- {104, 5520, TX_PWR_DEFAULT},
- {108, 5540, TX_PWR_DEFAULT},
- {112, 5560, TX_PWR_DEFAULT},
- {116, 5580, TX_PWR_DEFAULT},
- {120, 5600, TX_PWR_DEFAULT},
- {124, 5620, TX_PWR_DEFAULT},
- {128, 5640, TX_PWR_DEFAULT},
- {132, 5660, TX_PWR_DEFAULT},
- {136, 5680, TX_PWR_DEFAULT},
- {140, 5700, TX_PWR_DEFAULT},
- {149, 5745, TX_PWR_DEFAULT},
- {153, 5765, TX_PWR_DEFAULT},
- {157, 5785, TX_PWR_DEFAULT},
- {161, 5805, TX_PWR_DEFAULT},
- {165, 5825, TX_PWR_DEFAULT},
-/* {240, 4920, TX_PWR_DEFAULT},
- {244, 4940, TX_PWR_DEFAULT},
- {248, 4960, TX_PWR_DEFAULT},
- {252, 4980, TX_PWR_DEFAULT},
-channels for 11J JP 10M channel gap */
-};
-
extern struct chan_freq_power *wlan_get_region_cfp_table(u8 region,
u8 band, int *cfp_no);
@@ -251,7 +212,7 @@
* @param domaininfo pointer to wlan_802_11d_domain_reg
* @return WLAN_STATUS_SUCCESS
*/
-int wlan_generate_domain_info_11d(struct parsed_region_chan_11d
+static int wlan_generate_domain_info_11d(struct parsed_region_chan_11d
*parsed_region_chan,
struct wlan_802_11d_domain_reg * domaininfo)
{
@@ -321,7 +282,7 @@
* @param *parsed_region_chan pointer to parsed_region_chan_11d
* @return N/A
*/
-void wlan_generate_parsed_region_chan_11d(struct region_channel * region_chan,
+static void wlan_generate_parsed_region_chan_11d(struct region_channel * region_chan,
struct parsed_region_chan_11d *
parsed_region_chan)
{
@@ -405,7 +366,7 @@
* @param parsed_region_chan pointer to parsed_region_chan_11d
* @return WLAN_STATUS_SUCCESS
*/
-int wlan_parse_domain_info_11d(struct IEEEtypes_CountryInfoFullSet* CountryInfo,
+static int wlan_parse_domain_info_11d(struct IEEEtypes_CountryInfoFullSet* CountryInfo,
u8 band,
struct parsed_region_chan_11d *
parsed_region_chan)
@@ -568,7 +529,7 @@
* @param flag enable/disable flag
* @return WLAN_STATUS_SUCCESS; WLAN_STATUS_FAILURE
*/
-int wlan_enable_11d(wlan_private * priv, enum state_11d flag)
+static int wlan_enable_11d(wlan_private * priv, enum state_11d flag)
{
wlan_adapter *Adapter = priv->adapter;
struct wlan_802_11d_state *state = &Adapter->State11D;
@@ -598,7 +559,7 @@
* @param priv pointer to wlan_private
* @return WLAN_STATUS_SUCCESS; WLAN_STATUS_FAILURE
*/
-int wlan_set_domain_info_11d(wlan_private * priv)
+static int wlan_set_domain_info_11d(wlan_private * priv)
{
int ret;
Index: libertas/drivers/net/wireless/libertas/wlan_cmd.c
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/wlan_cmd.c 2006-07-05 05:09:14.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/wlan_cmd.c 2006-07-05 05:09:14.000000000 +0200
@@ -47,6 +47,8 @@
#include "wlan_wext.h"
#include "os_macros.h"
+static void CleanUpCmdCtrlNode(struct CmdCtrlNode *pTempNode);
+
static u16 Commands_Allowed_In_PS[] = {
HostCmd_CMD_802_11_RSSI,
};
@@ -1907,7 +1909,7 @@
* @param pTempNode A pointer to CmdCtrlNode structure
* @return n/a
*/
-void CleanUpCmdCtrlNode(struct CmdCtrlNode *pTempNode)
+static void CleanUpCmdCtrlNode(struct CmdCtrlNode *pTempNode)
{
ENTER();
Index: libertas/drivers/net/wireless/libertas/wlan_main.c
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/wlan_main.c 2006-07-05 05:09:14.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/wlan_main.c 2006-07-05 05:09:14.000000000 +0200
@@ -149,7 +149,7 @@
/**
* the structure for the mapping between region and CFP
*/
-struct region_cfp_table region_cfp_table[] = {
+static struct region_cfp_table region_cfp_table[] = {
{0x10, /*US FCC */
channel_freq_power_US_BG,
sizeof(channel_freq_power_US_BG) / sizeof(struct chan_freq_power),
@@ -210,12 +210,7 @@
* the global variable of a pointer to wlan_private
* structure variable
*/
-wlan_private *wlanpriv = NULL;
-
-u32 DSFreqList[15] = {
- 0, 2412000, 2417000, 2422000, 2427000, 2432000, 2437000, 2442000,
- 2447000, 2452000, 2457000, 2462000, 2467000, 2472000, 2484000
-};
+static wlan_private *wlanpriv = NULL;
/**
* the table to keep region code
@@ -223,7 +218,7 @@
u16 RegionCodeToIndex[MRVDRV_MAX_REGION_CODE] =
{ 0x10, 0x20, 0x30, 0x31, 0x32, 0x40 };
-u8 *default_fw_name = "usb8388.bin";
+static u8 *default_fw_name = "usb8388.bin";
extern u8 *fw_name;
/**
Index: libertas/drivers/net/wireless/libertas/wlan_rx.c
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/wlan_rx.c 2006-07-05 05:09:14.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/wlan_rx.c 2006-07-05 05:09:14.000000000 +0200
@@ -59,6 +59,8 @@
void *eth80211_hdr;
} __attribute__ ((packed));
+static int ProcessRxed_802_11_Packet(wlan_private * priv, struct sk_buff *skb);
+
/**
* @brief This function computes the AvgSNR .
*
@@ -338,7 +340,7 @@
* @param skb A pointer to skb which includes the received packet
* @return WLAN_STATUS_SUCCESS or WLAN_STATUS_FAILURE
*/
-int ProcessRxed_802_11_Packet(wlan_private * priv, struct sk_buff *skb)
+static int ProcessRxed_802_11_Packet(wlan_private * priv, struct sk_buff *skb)
{
wlan_adapter *Adapter = priv->adapter;
int ret = WLAN_STATUS_SUCCESS;
Index: libertas/drivers/net/wireless/libertas/wlan_fw.c
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/wlan_fw.c 2006-07-05 05:09:14.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/wlan_fw.c 2006-07-05 05:09:14.000000000 +0200
@@ -274,6 +274,8 @@
return;
}
+static void command_timer_fn(unsigned long data);
+
/**
* @brief This function initializes firmware
*
@@ -368,7 +370,7 @@
* @param FunctionContext A pointer to FunctionContext
* @return n/a
*/
-void command_timer_fn(unsigned long data)
+static void command_timer_fn(unsigned long data)
{
wlan_private *priv = (wlan_private *)data;
wlan_adapter *Adapter = priv->adapter;
Index: libertas/drivers/net/wireless/libertas/wlan_join.c
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/wlan_join.c 2006-07-05 05:09:14.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/wlan_join.c 2006-07-05 05:09:14.000000000 +0200
@@ -47,6 +47,8 @@
#include "wlan_join.h"
#include "wlan_dev.h"
+static int wlan_associate(wlan_private * priv, struct bss_descriptor * pBSSDesc);
+
/**
* @brief This function finds out the common rates between rate1 and rate2.
*
@@ -427,7 +429,7 @@
*
* @return WLAN_STATUS_SUCCESS-success, otherwise fail
*/
-int wlan_associate(wlan_private * priv, struct bss_descriptor * pBSSDesc)
+static int wlan_associate(wlan_private * priv, struct bss_descriptor * pBSSDesc)
{
int ret;
Index: libertas/drivers/net/wireless/libertas/wlan_scan.c
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/wlan_scan.c 2006-07-05 05:09:14.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/wlan_scan.c 2006-07-05 05:09:14.000000000 +0200
@@ -1516,29 +1516,6 @@
}
/**
- * @brief Convert radio type scan paramter to a band config used in join cmd
- *
- * @param scanBand Scan parameter indicating the band used for a channel
- * in a scan command.
- *
- * @return Band type conversion of scanBand used in join/assoc cmds
- *
- */
-u8 wlan_scan_radio_to_band(u8 scanBand)
-{
- u8 retBand = BAND_G;
-
- switch (scanBand) {
- case HostCmd_SCAN_RADIO_TYPE_BG:
- default:
- retBand = BAND_G;
- break;
- }
-
- return retBand;
-}
-
-/**
* @brief Scan Network
*
* @param dev A pointer to net_device structure
Index: libertas/drivers/net/wireless/libertas/wlan_wext.c
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/wlan_wext.c 2006-07-05 05:09:14.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/wlan_wext.c 2006-07-05 05:09:14.000000000 +0200
@@ -89,6 +89,8 @@
static int wlan_get_txpow(struct net_device *dev, struct iw_request_info *info,
struct iw_param *vwrq, char *extra);
+static struct iw_statistics *wlan_get_wireless_stats(struct net_device *dev);
+
/* DFT function declaration */
static int wlan_dft_add_ioctl(wlan_private * priv, struct ifreq *req);
static int wlan_dft_del_ioctl(wlan_private * priv, struct ifreq *req);
@@ -4598,7 +4600,7 @@
* @param dev A pointer to net_device structure
* @return A pointer to iw_statistics buf
*/
-struct iw_statistics *wlan_get_wireless_stats(struct net_device *dev)
+static struct iw_statistics *wlan_get_wireless_stats(struct net_device *dev)
{
enum {
POOR = 30,
Index: libertas/drivers/net/wireless/libertas/sbi.h
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/sbi.h 2006-07-05 05:09:14.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/sbi.h 2006-07-05 05:09:14.000000000 +0200
@@ -103,8 +103,6 @@
int sbi_read_event_cause(wlan_private *);
int sbi_reenable_host_interrupt(wlan_private *, u8);
int sbi_host_to_card(wlan_private * priv, u8 type, u8 * payload, u16 nb);
-int sbi_card_to_host(wlan_private * priv, u32 type, u32 * nb, u8 * payload,
- u16 npayload);
int sbi_enable_host_int(wlan_private *);
#ifdef ENABLE_PM
Index: libertas/drivers/net/wireless/libertas/wlan_11d.h
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/wlan_11d.h 2006-07-05 05:09:14.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/wlan_11d.h 2006-07-05 05:09:14.000000000 +0200
@@ -120,6 +120,7 @@
u8 code;
};
+#if 0
/* function prototypes*/
int wlan_generate_domain_info_11d(struct parsed_region_chan_11d
*parsed_region_chan,
@@ -129,27 +130,19 @@
u8 band,
struct parsed_region_chan_11d
*parsed_region_chan);
+#endif
u8 wlan_get_scan_type_11d(u8 chan,
struct parsed_region_chan_11d *parsed_region_chan);
u32 chan_2_freq(u8 chan, u8 band);
-int wlan_set_domain_info_11d(wlan_private * priv);
-
enum state_11d wlan_get_state_11d(wlan_private * priv);
void wlan_init_11d(wlan_private * priv);
-int wlan_enable_11d(wlan_private * priv, enum state_11d flag);
-
int wlan_set_universaltable(wlan_private * priv, u8 band);
-struct region_channel;
-void wlan_generate_parsed_region_chan_11d(struct region_channel *region,
- struct parsed_region_chan_11d *
- parsed_region_chan);
-
int wlan_cmd_802_11d_domain_info(wlan_private * priv,
struct HostCmd_DS_COMMAND *cmd, u16 cmdno,
u16 CmdOption);
Index: libertas/drivers/net/wireless/libertas/wlan_decl.h
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/wlan_decl.h 2006-07-05 05:09:14.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/wlan_decl.h 2006-07-05 05:09:14.000000000 +0200
@@ -50,7 +50,6 @@
void Wep_encrypt(wlan_private * priv, u8 * Buf, u32 Len);
int FreeCmdBuffer(wlan_private * priv);
struct CmdCtrlNode;
-void CleanUpCmdCtrlNode(struct CmdCtrlNode *pTempNode);
struct CmdCtrlNode *GetFreeCmdCtrlNode(wlan_private * priv);
void SetCmdCtrlNode(wlan_private * priv,
@@ -84,7 +83,6 @@
int wlan_process_rx_command(wlan_private * priv);
int wlan_process_tx(wlan_private * priv, struct sk_buff *skb);
void CleanupAndInsertCmd(wlan_private * priv, struct CmdCtrlNode *pTempCmd);
-void command_timer_fn(unsigned long data);
#ifdef REASSOCIATION
void reassoc_timer_fn(unsigned long data);
@@ -98,8 +96,6 @@
int ProcessRxedPacket(wlan_private * priv, struct sk_buff *);
-int ProcessRxed_802_11_Packet(wlan_private * priv, struct sk_buff *);
-
void PSSleep(wlan_private * priv, int wait_option);
void PSConfirmSleep(wlan_private * priv, u16 PSMode);
void PSWakeup(wlan_private * priv, int wait_option);
Index: libertas/drivers/net/wireless/libertas/wlan_join.h
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/wlan_join.h 2006-07-05 05:09:14.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/wlan_join.h 2006-07-05 05:09:14.000000000 +0200
@@ -59,11 +59,6 @@
extern int wlan_cmd_802_11_associate(wlan_private * priv,
struct HostCmd_DS_COMMAND *cmd,
void *pdata_buf);
-extern int wlan_cmd_append_reassoc_tlv(wlan_private * priv, u8 ** ppBuffer);
-
-extern int wlan_cmd_append_marvell_tlv(wlan_private * priv, u8 ** ppBuffer);
-
-extern int wlan_cmd_append_generic_ie(wlan_private * priv, u8 ** ppBuffer);
extern int wlan_ret_802_11_authenticate(wlan_private * priv,
struct HostCmd_DS_COMMAND *resp);
@@ -76,9 +71,6 @@
extern int wlan_ret_802_11_associate(wlan_private * priv,
struct HostCmd_DS_COMMAND *resp);
-struct bss_descriptor;
-extern int wlan_associate(wlan_private * priv, struct bss_descriptor *pBSSDesc);
-
extern int wlanidle_on(wlan_private * priv);
extern int wlanidle_off(wlan_private * priv);
@@ -86,6 +78,8 @@
extern int wlan_reassociation_thread(void *data);
struct WLAN_802_11_SSID;
+struct bss_descriptor;
+
extern int StartAdhocNetwork(wlan_private * priv,
struct WLAN_802_11_SSID *AdhocSSID);
extern int JoinAdhocNetwork(wlan_private * priv, struct bss_descriptor *pBSSDesc);
@@ -95,9 +89,6 @@
extern int wlan_send_deauth(wlan_private * priv);
extern int wlan_do_adhocstop_ioctl(wlan_private * priv);
-struct iwreq;
-extern int wlan_get_assoc_rsp_ioctl(wlan_private * priv, struct iwreq *wrq);
-extern int wlan_set_mrvl_tlv_ioctl(wlan_private * priv, struct iwreq *wrq);
#ifdef __KERNEL__
struct iw_request_info;
Index: libertas/drivers/net/wireless/libertas/wlan_scan.h
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/wlan_scan.h 2006-07-05 05:09:14.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/wlan_scan.h 2006-07-05 05:09:14.000000000 +0200
@@ -293,13 +293,9 @@
extern int SendSpecificBSSIDScan(wlan_private * priv,
u8 * bssid, u8 keepPreviousScan);
-extern u8 wlan_scan_radio_to_band(u8 scanBand);
-
extern int wlan_get_scan_table_ioctl(wlan_private * priv, struct iwreq *wrq);
extern int wlan_set_user_scan_ioctl(wlan_private * priv, struct iwreq *wrq);
-extern int wlan_associate(wlan_private * priv, struct bss_descriptor *pBSSDesc);
-
extern int wlan_cmd_802_11_scan(wlan_private * priv,
struct HostCmd_DS_COMMAND *cmd,
void *pdata_buf);
Index: libertas/drivers/net/wireless/libertas/wlan_defs.h
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/wlan_defs.h 2006-07-05 05:09:34.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/wlan_defs.h 2006-07-05 05:09:43.000000000 +0200
@@ -372,9 +372,7 @@
typedef struct _wlan_private wlan_private;
typedef struct _wlan_adapter wlan_adapter;
-extern u32 DSFreqList[15];
extern const char driver_version[];
-extern u32 DSFreqList[];
extern u16 RegionCodeToIndex[MRVDRV_MAX_REGION_CODE];
extern u8 WlanDataRates[WLAN_SUPPORTED_RATES];
@@ -384,7 +382,6 @@
extern u8 AdhocRates_G[G_SUPPORTED_RATES];
extern u8 AdhocRates_B[4];
-extern wlan_private *wlanpriv;
/** ENUM definition*/
/** SNRNF_TYPE */
Index: libertas/drivers/net/wireless/libertas/wlan_wext.h
===================================================================
--- libertas.orig/drivers/net/wireless/libertas/wlan_wext.h 2006-07-05 05:09:34.000000000 +0200
+++ libertas/drivers/net/wireless/libertas/wlan_wext.h 2006-07-05 05:09:43.000000000 +0200
@@ -238,7 +238,6 @@
#ifdef __KERNEL__
extern struct iw_handler_def wlan_handler_def;
-struct iw_statistics *wlan_get_wireless_stats(struct net_device *dev);
int wlan_do_ioctl(struct net_device *dev, struct ifreq *req, int i);
#endif
--
More information about the Networking
mailing list