diff options
author | Amitkumar Karwar <akarwar@marvell.com> | 2011-10-12 23:29:33 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-10-14 14:48:20 -0400 |
commit | 711825a06bb288e04f8236d77c4e12eba9a1c478 (patch) | |
tree | 8095d8e79c50370fafa03f0c340489e1a98df563 | |
parent | efaaa8b8414e0ab4ba09aaaf79ab92a34b75797b (diff) |
mwifiex: fix make namespacecheck warnings
This patch takes care of warnings found by running
'make namespacecheck':
1. Remove dead code.
2. Reorder function definitions to avoid forward declarations.
3. Remove unnecessary function/structure declarations and mark
them as static.
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/mwifiex/cfp.c | 10 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/fw.h | 6 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/init.c | 56 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/main.h | 8 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/scan.c | 50 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/sta_ioctl.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/txrx.c | 40 |
7 files changed, 60 insertions, 114 deletions
diff --git a/drivers/net/wireless/mwifiex/cfp.c b/drivers/net/wireless/mwifiex/cfp.c index d0cada5a29a0..f2e6de03805c 100644 --- a/drivers/net/wireless/mwifiex/cfp.c +++ b/drivers/net/wireless/mwifiex/cfp.c | |||
@@ -48,7 +48,7 @@ static u8 adhoc_rates_bg[BG_SUPPORTED_RATES] = { 0x82, 0x84, 0x8b, 0x96, | |||
48 | 48 | ||
49 | static u8 adhoc_rates_a[A_SUPPORTED_RATES] = { 0x8c, 0x12, 0x98, 0x24, | 49 | static u8 adhoc_rates_a[A_SUPPORTED_RATES] = { 0x8c, 0x12, 0x98, 0x24, |
50 | 0xb0, 0x48, 0x60, 0x6c, 0 }; | 50 | 0xb0, 0x48, 0x60, 0x6c, 0 }; |
51 | u8 supported_rates_a[A_SUPPORTED_RATES] = { 0x0c, 0x12, 0x18, 0x24, | 51 | static u8 supported_rates_a[A_SUPPORTED_RATES] = { 0x0c, 0x12, 0x18, 0x24, |
52 | 0xb0, 0x48, 0x60, 0x6c, 0 }; | 52 | 0xb0, 0x48, 0x60, 0x6c, 0 }; |
53 | static u16 mwifiex_data_rates[MWIFIEX_SUPPORTED_RATES_EXT] = { 0x02, 0x04, | 53 | static u16 mwifiex_data_rates[MWIFIEX_SUPPORTED_RATES_EXT] = { 0x02, 0x04, |
54 | 0x0B, 0x16, 0x00, 0x0C, 0x12, 0x18, | 54 | 0x0B, 0x16, 0x00, 0x0C, 0x12, 0x18, |
@@ -57,19 +57,19 @@ static u16 mwifiex_data_rates[MWIFIEX_SUPPORTED_RATES_EXT] = { 0x02, 0x04, | |||
57 | 0x75, 0x82, 0x0C, 0x1B, 0x36, 0x51, | 57 | 0x75, 0x82, 0x0C, 0x1B, 0x36, 0x51, |
58 | 0x6C, 0xA2, 0xD8, 0xF3, 0x10E, 0x00 }; | 58 | 0x6C, 0xA2, 0xD8, 0xF3, 0x10E, 0x00 }; |
59 | 59 | ||
60 | u8 supported_rates_b[B_SUPPORTED_RATES] = { 0x02, 0x04, 0x0b, 0x16, 0 }; | 60 | static u8 supported_rates_b[B_SUPPORTED_RATES] = { 0x02, 0x04, 0x0b, 0x16, 0 }; |
61 | 61 | ||
62 | u8 supported_rates_g[G_SUPPORTED_RATES] = { 0x0c, 0x12, 0x18, 0x24, | 62 | static u8 supported_rates_g[G_SUPPORTED_RATES] = { 0x0c, 0x12, 0x18, 0x24, |
63 | 0x30, 0x48, 0x60, 0x6c, 0 }; | 63 | 0x30, 0x48, 0x60, 0x6c, 0 }; |
64 | 64 | ||
65 | u8 supported_rates_bg[BG_SUPPORTED_RATES] = { 0x02, 0x04, 0x0b, 0x0c, | 65 | static u8 supported_rates_bg[BG_SUPPORTED_RATES] = { 0x02, 0x04, 0x0b, 0x0c, |
66 | 0x12, 0x16, 0x18, 0x24, 0x30, 0x48, | 66 | 0x12, 0x16, 0x18, 0x24, 0x30, 0x48, |
67 | 0x60, 0x6c, 0 }; | 67 | 0x60, 0x6c, 0 }; |
68 | 68 | ||
69 | u16 region_code_index[MWIFIEX_MAX_REGION_CODE] = { 0x10, 0x20, 0x30, | 69 | u16 region_code_index[MWIFIEX_MAX_REGION_CODE] = { 0x10, 0x20, 0x30, |
70 | 0x32, 0x40, 0x41, 0xff }; | 70 | 0x32, 0x40, 0x41, 0xff }; |
71 | 71 | ||
72 | u8 supported_rates_n[N_SUPPORTED_RATES] = { 0x02, 0x04, 0 }; | 72 | static u8 supported_rates_n[N_SUPPORTED_RATES] = { 0x02, 0x04, 0 }; |
73 | 73 | ||
74 | /* | 74 | /* |
75 | * This function maps an index in supported rates table into | 75 | * This function maps an index in supported rates table into |
diff --git a/drivers/net/wireless/mwifiex/fw.h b/drivers/net/wireless/mwifiex/fw.h index 71c61b7e74ee..0cc5d73cb0c1 100644 --- a/drivers/net/wireless/mwifiex/fw.h +++ b/drivers/net/wireless/mwifiex/fw.h | |||
@@ -57,12 +57,6 @@ struct tx_packet_hdr { | |||
57 | #define GET_FW_DEFAULT_BANDS(adapter) \ | 57 | #define GET_FW_DEFAULT_BANDS(adapter) \ |
58 | ((adapter->fw_cap_info >> 8) & ALL_802_11_BANDS) | 58 | ((adapter->fw_cap_info >> 8) & ALL_802_11_BANDS) |
59 | 59 | ||
60 | extern u8 supported_rates_b[B_SUPPORTED_RATES]; | ||
61 | extern u8 supported_rates_g[G_SUPPORTED_RATES]; | ||
62 | extern u8 supported_rates_bg[BG_SUPPORTED_RATES]; | ||
63 | extern u8 supported_rates_a[A_SUPPORTED_RATES]; | ||
64 | extern u8 supported_rates_n[N_SUPPORTED_RATES]; | ||
65 | |||
66 | #define HostCmd_WEP_KEY_INDEX_MASK 0x3fff | 60 | #define HostCmd_WEP_KEY_INDEX_MASK 0x3fff |
67 | 61 | ||
68 | #define KEY_INFO_ENABLED 0x01 | 62 | #define KEY_INFO_ENABLED 0x01 |
diff --git a/drivers/net/wireless/mwifiex/init.c b/drivers/net/wireless/mwifiex/init.c index 0ce72fc91437..d792b3fb7c16 100644 --- a/drivers/net/wireless/mwifiex/init.c +++ b/drivers/net/wireless/mwifiex/init.c | |||
@@ -283,6 +283,34 @@ static void mwifiex_init_adapter(struct mwifiex_adapter *adapter) | |||
283 | } | 283 | } |
284 | 284 | ||
285 | /* | 285 | /* |
286 | * This function releases the lock variables and frees the locks and | ||
287 | * associated locks. | ||
288 | */ | ||
289 | static void mwifiex_free_lock_list(struct mwifiex_adapter *adapter) | ||
290 | { | ||
291 | struct mwifiex_private *priv; | ||
292 | s32 i, j; | ||
293 | |||
294 | /* Free lists */ | ||
295 | list_del(&adapter->cmd_free_q); | ||
296 | list_del(&adapter->cmd_pending_q); | ||
297 | list_del(&adapter->scan_pending_q); | ||
298 | |||
299 | for (i = 0; i < adapter->priv_num; i++) | ||
300 | list_del(&adapter->bss_prio_tbl[i].bss_prio_head); | ||
301 | |||
302 | for (i = 0; i < adapter->priv_num; i++) { | ||
303 | if (adapter->priv[i]) { | ||
304 | priv = adapter->priv[i]; | ||
305 | for (j = 0; j < MAX_NUM_TID; ++j) | ||
306 | list_del(&priv->wmm.tid_tbl_ptr[j].ra_list); | ||
307 | list_del(&priv->tx_ba_stream_tbl_ptr); | ||
308 | list_del(&priv->rx_reorder_tbl_ptr); | ||
309 | } | ||
310 | } | ||
311 | } | ||
312 | |||
313 | /* | ||
286 | * This function frees the adapter structure. | 314 | * This function frees the adapter structure. |
287 | * | 315 | * |
288 | * The freeing operation is done recursively, by canceling all | 316 | * The freeing operation is done recursively, by canceling all |
@@ -376,34 +404,6 @@ int mwifiex_init_lock_list(struct mwifiex_adapter *adapter) | |||
376 | } | 404 | } |
377 | 405 | ||
378 | /* | 406 | /* |
379 | * This function releases the lock variables and frees the locks and | ||
380 | * associated locks. | ||
381 | */ | ||
382 | void mwifiex_free_lock_list(struct mwifiex_adapter *adapter) | ||
383 | { | ||
384 | struct mwifiex_private *priv; | ||
385 | s32 i, j; | ||
386 | |||
387 | /* Free lists */ | ||
388 | list_del(&adapter->cmd_free_q); | ||
389 | list_del(&adapter->cmd_pending_q); | ||
390 | list_del(&adapter->scan_pending_q); | ||
391 | |||
392 | for (i = 0; i < adapter->priv_num; i++) | ||
393 | list_del(&adapter->bss_prio_tbl[i].bss_prio_head); | ||
394 | |||
395 | for (i = 0; i < adapter->priv_num; i++) { | ||
396 | if (adapter->priv[i]) { | ||
397 | priv = adapter->priv[i]; | ||
398 | for (j = 0; j < MAX_NUM_TID; ++j) | ||
399 | list_del(&priv->wmm.tid_tbl_ptr[j].ra_list); | ||
400 | list_del(&priv->tx_ba_stream_tbl_ptr); | ||
401 | list_del(&priv->rx_reorder_tbl_ptr); | ||
402 | } | ||
403 | } | ||
404 | } | ||
405 | |||
406 | /* | ||
407 | * This function initializes the firmware. | 407 | * This function initializes the firmware. |
408 | * | 408 | * |
409 | * The following operations are performed sequentially - | 409 | * The following operations are performed sequentially - |
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h index 7db20dbf486d..30f138b6fa4c 100644 --- a/drivers/net/wireless/mwifiex/main.h +++ b/drivers/net/wireless/mwifiex/main.h | |||
@@ -658,7 +658,6 @@ struct mwifiex_adapter { | |||
658 | }; | 658 | }; |
659 | 659 | ||
660 | int mwifiex_init_lock_list(struct mwifiex_adapter *adapter); | 660 | int mwifiex_init_lock_list(struct mwifiex_adapter *adapter); |
661 | void mwifiex_free_lock_list(struct mwifiex_adapter *adapter); | ||
662 | 661 | ||
663 | int mwifiex_init_fw(struct mwifiex_adapter *adapter); | 662 | int mwifiex_init_fw(struct mwifiex_adapter *adapter); |
664 | 663 | ||
@@ -709,8 +708,6 @@ int mwifiex_process_tx(struct mwifiex_private *priv, struct sk_buff *skb, | |||
709 | int mwifiex_send_null_packet(struct mwifiex_private *priv, u8 flags); | 708 | int mwifiex_send_null_packet(struct mwifiex_private *priv, u8 flags); |
710 | int mwifiex_write_data_complete(struct mwifiex_adapter *adapter, | 709 | int mwifiex_write_data_complete(struct mwifiex_adapter *adapter, |
711 | struct sk_buff *skb, int status); | 710 | struct sk_buff *skb, int status); |
712 | int mwifiex_recv_packet_complete(struct mwifiex_adapter *, | ||
713 | struct sk_buff *skb, int status); | ||
714 | void mwifiex_clean_txrx(struct mwifiex_private *priv); | 711 | void mwifiex_clean_txrx(struct mwifiex_private *priv); |
715 | u8 mwifiex_check_last_packet_indication(struct mwifiex_private *priv); | 712 | u8 mwifiex_check_last_packet_indication(struct mwifiex_private *priv); |
716 | void mwifiex_check_ps_cond(struct mwifiex_adapter *adapter); | 713 | void mwifiex_check_ps_cond(struct mwifiex_adapter *adapter); |
@@ -740,8 +737,6 @@ int mwifiex_process_sta_rx_packet(struct mwifiex_adapter *, | |||
740 | int mwifiex_process_sta_event(struct mwifiex_private *); | 737 | int mwifiex_process_sta_event(struct mwifiex_private *); |
741 | void *mwifiex_process_sta_txpd(struct mwifiex_private *, struct sk_buff *skb); | 738 | void *mwifiex_process_sta_txpd(struct mwifiex_private *, struct sk_buff *skb); |
742 | int mwifiex_sta_init_cmd(struct mwifiex_private *, u8 first_sta); | 739 | int mwifiex_sta_init_cmd(struct mwifiex_private *, u8 first_sta); |
743 | int mwifiex_scan_networks(struct mwifiex_private *priv, | ||
744 | const struct mwifiex_user_scan_cfg *user_scan_in); | ||
745 | int mwifiex_cmd_802_11_scan(struct host_cmd_ds_command *cmd, | 740 | int mwifiex_cmd_802_11_scan(struct host_cmd_ds_command *cmd, |
746 | struct mwifiex_scan_cmd_config *scan_cfg); | 741 | struct mwifiex_scan_cmd_config *scan_cfg); |
747 | void mwifiex_queue_scan_cmd(struct mwifiex_private *priv, | 742 | void mwifiex_queue_scan_cmd(struct mwifiex_private *priv, |
@@ -901,9 +896,6 @@ int mwifiex_copy_mcast_addr(struct mwifiex_multicast_list *mlist, | |||
901 | int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter); | 896 | int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter); |
902 | int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss, | 897 | int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss, |
903 | struct mwifiex_802_11_ssid *req_ssid); | 898 | struct mwifiex_802_11_ssid *req_ssid); |
904 | int mwifiex_set_hs_params(struct mwifiex_private *priv, | ||
905 | u16 action, int cmd_type, | ||
906 | struct mwifiex_ds_hs_cfg *hscfg); | ||
907 | int mwifiex_cancel_hs(struct mwifiex_private *priv, int cmd_type); | 899 | int mwifiex_cancel_hs(struct mwifiex_private *priv, int cmd_type); |
908 | int mwifiex_enable_hs(struct mwifiex_adapter *adapter); | 900 | int mwifiex_enable_hs(struct mwifiex_adapter *adapter); |
909 | int mwifiex_disable_auto_ds(struct mwifiex_private *priv); | 901 | int mwifiex_disable_auto_ds(struct mwifiex_private *priv); |
diff --git a/drivers/net/wireless/mwifiex/scan.c b/drivers/net/wireless/mwifiex/scan.c index 5456dcbf037c..dae8dbb24a03 100644 --- a/drivers/net/wireless/mwifiex/scan.c +++ b/drivers/net/wireless/mwifiex/scan.c | |||
@@ -172,29 +172,6 @@ mwifiex_ssid_cmp(struct mwifiex_802_11_ssid *ssid1, | |||
172 | } | 172 | } |
173 | 173 | ||
174 | /* | 174 | /* |
175 | * Sends IOCTL request to start a scan with user configurations. | ||
176 | * | ||
177 | * This function allocates the IOCTL request buffer, fills it | ||
178 | * with requisite parameters and calls the IOCTL handler. | ||
179 | * | ||
180 | * Upon completion, it also generates a wireless event to notify | ||
181 | * applications. | ||
182 | */ | ||
183 | int mwifiex_set_user_scan_ioctl(struct mwifiex_private *priv, | ||
184 | struct mwifiex_user_scan_cfg *scan_req) | ||
185 | { | ||
186 | int status; | ||
187 | |||
188 | priv->adapter->scan_wait_q_woken = false; | ||
189 | |||
190 | status = mwifiex_scan_networks(priv, scan_req); | ||
191 | if (!status) | ||
192 | status = mwifiex_wait_queue_complete(priv->adapter); | ||
193 | |||
194 | return status; | ||
195 | } | ||
196 | |||
197 | /* | ||
198 | * This function checks if wapi is enabled in driver and scanned network is | 175 | * This function checks if wapi is enabled in driver and scanned network is |
199 | * compatible with it. | 176 | * compatible with it. |
200 | */ | 177 | */ |
@@ -1316,8 +1293,8 @@ mwifiex_radio_type_to_band(u8 radio_type) | |||
1316 | * order to send the appropriate scan commands to firmware to populate or | 1293 | * order to send the appropriate scan commands to firmware to populate or |
1317 | * update the internal driver scan table. | 1294 | * update the internal driver scan table. |
1318 | */ | 1295 | */ |
1319 | int mwifiex_scan_networks(struct mwifiex_private *priv, | 1296 | static int mwifiex_scan_networks(struct mwifiex_private *priv, |
1320 | const struct mwifiex_user_scan_cfg *user_scan_in) | 1297 | const struct mwifiex_user_scan_cfg *user_scan_in) |
1321 | { | 1298 | { |
1322 | int ret = 0; | 1299 | int ret = 0; |
1323 | struct mwifiex_adapter *adapter = priv->adapter; | 1300 | struct mwifiex_adapter *adapter = priv->adapter; |
@@ -1399,6 +1376,29 @@ int mwifiex_scan_networks(struct mwifiex_private *priv, | |||
1399 | } | 1376 | } |
1400 | 1377 | ||
1401 | /* | 1378 | /* |
1379 | * Sends IOCTL request to start a scan with user configurations. | ||
1380 | * | ||
1381 | * This function allocates the IOCTL request buffer, fills it | ||
1382 | * with requisite parameters and calls the IOCTL handler. | ||
1383 | * | ||
1384 | * Upon completion, it also generates a wireless event to notify | ||
1385 | * applications. | ||
1386 | */ | ||
1387 | int mwifiex_set_user_scan_ioctl(struct mwifiex_private *priv, | ||
1388 | struct mwifiex_user_scan_cfg *scan_req) | ||
1389 | { | ||
1390 | int status; | ||
1391 | |||
1392 | priv->adapter->scan_wait_q_woken = false; | ||
1393 | |||
1394 | status = mwifiex_scan_networks(priv, scan_req); | ||
1395 | if (!status) | ||
1396 | status = mwifiex_wait_queue_complete(priv->adapter); | ||
1397 | |||
1398 | return status; | ||
1399 | } | ||
1400 | |||
1401 | /* | ||
1402 | * This function prepares a scan command to be sent to the firmware. | 1402 | * This function prepares a scan command to be sent to the firmware. |
1403 | * | 1403 | * |
1404 | * This uses the scan command configuration sent to the command processing | 1404 | * This uses the scan command configuration sent to the command processing |
diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c index d39bb72896f1..ea4a29b7e331 100644 --- a/drivers/net/wireless/mwifiex/sta_ioctl.c +++ b/drivers/net/wireless/mwifiex/sta_ioctl.c | |||
@@ -293,8 +293,8 @@ done: | |||
293 | * This function prepares the correct firmware command and | 293 | * This function prepares the correct firmware command and |
294 | * issues it. | 294 | * issues it. |
295 | */ | 295 | */ |
296 | int mwifiex_set_hs_params(struct mwifiex_private *priv, u16 action, | 296 | static int mwifiex_set_hs_params(struct mwifiex_private *priv, u16 action, |
297 | int cmd_type, struct mwifiex_ds_hs_cfg *hs_cfg) | 297 | int cmd_type, struct mwifiex_ds_hs_cfg *hs_cfg) |
298 | 298 | ||
299 | { | 299 | { |
300 | struct mwifiex_adapter *adapter = priv->adapter; | 300 | struct mwifiex_adapter *adapter = priv->adapter; |
diff --git a/drivers/net/wireless/mwifiex/txrx.c b/drivers/net/wireless/mwifiex/txrx.c index 4c3421eb6f40..a206f412875f 100644 --- a/drivers/net/wireless/mwifiex/txrx.c +++ b/drivers/net/wireless/mwifiex/txrx.c | |||
@@ -161,43 +161,3 @@ done: | |||
161 | return 0; | 161 | return 0; |
162 | } | 162 | } |
163 | 163 | ||
164 | /* | ||
165 | * Packet receive completion callback handler. | ||
166 | * | ||
167 | * This function calls another completion callback handler which | ||
168 | * updates the statistics, and optionally updates the parent buffer | ||
169 | * use count before freeing the received packet. | ||
170 | */ | ||
171 | int mwifiex_recv_packet_complete(struct mwifiex_adapter *adapter, | ||
172 | struct sk_buff *skb, int status) | ||
173 | { | ||
174 | struct mwifiex_rxinfo *rx_info = MWIFIEX_SKB_RXCB(skb); | ||
175 | struct mwifiex_rxinfo *rx_info_parent; | ||
176 | struct mwifiex_private *priv; | ||
177 | struct sk_buff *skb_parent; | ||
178 | unsigned long flags; | ||
179 | |||
180 | priv = adapter->priv[rx_info->bss_index]; | ||
181 | |||
182 | if (priv && (status == -1)) | ||
183 | priv->stats.rx_dropped++; | ||
184 | |||
185 | if (rx_info->parent) { | ||
186 | skb_parent = rx_info->parent; | ||
187 | rx_info_parent = MWIFIEX_SKB_RXCB(skb_parent); | ||
188 | |||
189 | spin_lock_irqsave(&priv->rx_pkt_lock, flags); | ||
190 | --rx_info_parent->use_count; | ||
191 | |||
192 | if (!rx_info_parent->use_count) { | ||
193 | spin_unlock_irqrestore(&priv->rx_pkt_lock, flags); | ||
194 | dev_kfree_skb_any(skb_parent); | ||
195 | } else { | ||
196 | spin_unlock_irqrestore(&priv->rx_pkt_lock, flags); | ||
197 | } | ||
198 | } else { | ||
199 | dev_kfree_skb_any(skb); | ||
200 | } | ||
201 | |||
202 | return 0; | ||
203 | } | ||