aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi
diff options
context:
space:
mode:
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>2008-06-11 21:47:18 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-06-14 12:18:10 -0400
commitbe1f3ab6e5e9788fd2985117b40755130058a2be (patch)
treebfb3f526195076f866723880dc59dba4a82a49b0 /drivers/net/wireless/iwlwifi
parent808e72a088d164cf0030f593d9a5fc23306fb6b6 (diff)
iwlwifi: general code clean up
This patch cleans up iwlwifi's code: Add missing include, remove empty lines etc... Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965-rs.c1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965.c4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-calib.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-calib.h9
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-dev.h62
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-sta.c23
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-sta.h16
7 files changed, 32 insertions, 85 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
index b9a4e4b19ab..d601d31e0de 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
@@ -38,6 +38,7 @@
38#include "../net/mac80211/rate.h" 38#include "../net/mac80211/rate.h"
39 39
40#include "iwl-dev.h" 40#include "iwl-dev.h"
41#include "iwl-sta.h"
41#include "iwl-core.h" 42#include "iwl-core.h"
42#include "iwl-helpers.h" 43#include "iwl-helpers.h"
43 44
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index 6e6038fd22f..9662fae0f73 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -722,7 +722,7 @@ static const u16 default_queue_to_tx_fifo[] = {
722 IWL_TX_FIFO_HCCA_2 722 IWL_TX_FIFO_HCCA_2
723}; 723};
724 724
725int iwl4965_alive_notify(struct iwl_priv *priv) 725static int iwl4965_alive_notify(struct iwl_priv *priv)
726{ 726{
727 u32 a; 727 u32 a;
728 int i = 0; 728 int i = 0;
@@ -827,7 +827,7 @@ static struct iwl_sensitivity_ranges iwl4965_sensitivity = {
827 * 827 *
828 * Called when initializing driver 828 * Called when initializing driver
829 */ 829 */
830int iwl4965_hw_set_hw_params(struct iwl_priv *priv) 830static int iwl4965_hw_set_hw_params(struct iwl_priv *priv)
831{ 831{
832 832
833 if ((priv->cfg->mod_params->num_of_queues > IWL49_NUM_QUEUES) || 833 if ((priv->cfg->mod_params->num_of_queues > IWL49_NUM_QUEUES) ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-calib.c b/drivers/net/wireless/iwlwifi/iwl-calib.c
index 72242a4ede8..48f58000b64 100644
--- a/drivers/net/wireless/iwlwifi/iwl-calib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-calib.c
@@ -60,13 +60,11 @@
60 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 60 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
61 *****************************************************************************/ 61 *****************************************************************************/
62 62
63#include <linux/kernel.h>
64#include <net/mac80211.h> 63#include <net/mac80211.h>
65 64
66#include "iwl-dev.h" 65#include "iwl-dev.h"
67#include "iwl-core.h" 66#include "iwl-core.h"
68#include "iwl-calib.h" 67#include "iwl-calib.h"
69#include "iwl-eeprom.h"
70 68
71/* "false alarms" are signals that our DSP tries to lock onto, 69/* "false alarms" are signals that our DSP tries to lock onto,
72 * but then determines that they are either noise, or transmissions 70 * but then determines that they are either noise, or transmissions
diff --git a/drivers/net/wireless/iwlwifi/iwl-calib.h b/drivers/net/wireless/iwlwifi/iwl-calib.h
index 45f37cb2bfe..5524a29e22d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-calib.h
+++ b/drivers/net/wireless/iwlwifi/iwl-calib.h
@@ -62,14 +62,9 @@
62#ifndef __iwl_calib_h__ 62#ifndef __iwl_calib_h__
63#define __iwl_calib_h__ 63#define __iwl_calib_h__
64 64
65#include <linux/kernel.h>
66#include <linux/module.h>
67#include <linux/version.h>
68
69#include <net/mac80211.h>
70#include "iwl-eeprom.h"
71#include "iwl-core.h"
72#include "iwl-dev.h" 65#include "iwl-dev.h"
66#include "iwl-core.h"
67#include "iwl-commands.h"
73 68
74void iwl_chain_noise_calibration(struct iwl_priv *priv, 69void iwl_chain_noise_calibration(struct iwl_priv *priv,
75 struct iwl4965_notif_statistics *stat_resp); 70 struct iwl4965_notif_statistics *stat_resp);
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index 70018545591..e6188f087ea 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -29,8 +29,8 @@
29 * Please use iwl-4965-hw.h for hardware-related definitions. 29 * Please use iwl-4965-hw.h for hardware-related definitions.
30 */ 30 */
31 31
32#ifndef __iwl_4965_h__ 32#ifndef __iwl_dev_h__
33#define __iwl_4965_h__ 33#define __iwl_dev_h__
34 34
35#include <linux/pci.h> /* for struct pci_device_id */ 35#include <linux/pci.h> /* for struct pci_device_id */
36#include <linux/kernel.h> 36#include <linux/kernel.h>
@@ -593,15 +593,8 @@ u8 iwl_add_station_flags(struct iwl_priv *priv, const u8 *addr, int is_ap,
593 u8 flags, struct ieee80211_ht_info *ht_info); 593 u8 flags, struct ieee80211_ht_info *ht_info);
594extern int iwl4965_is_network_packet(struct iwl_priv *priv, 594extern int iwl4965_is_network_packet(struct iwl_priv *priv,
595 struct ieee80211_hdr *header); 595 struct ieee80211_hdr *header);
596extern int iwl4965_power_init_handle(struct iwl_priv *priv);
597extern void iwl4965_handle_data_packet_monitor(struct iwl_priv *priv,
598 struct iwl_rx_mem_buffer *rxb,
599 void *data, short len,
600 struct ieee80211_rx_status *stats,
601 u16 phy_flags);
602extern int iwl4965_is_duplicate_packet(struct iwl_priv *priv, 596extern int iwl4965_is_duplicate_packet(struct iwl_priv *priv,
603 struct ieee80211_hdr *header); 597 struct ieee80211_hdr *header);
604extern int iwl4965_calc_db_from_ratio(int sig_ratio);
605extern int iwl4965_calc_sig_qual(int rssi_dbm, int noise_dbm); 598extern int iwl4965_calc_sig_qual(int rssi_dbm, int noise_dbm);
606extern unsigned int iwl4965_fill_beacon_frame(struct iwl_priv *priv, 599extern unsigned int iwl4965_fill_beacon_frame(struct iwl_priv *priv,
607 struct ieee80211_hdr *hdr, 600 struct ieee80211_hdr *hdr,
@@ -609,18 +602,7 @@ extern unsigned int iwl4965_fill_beacon_frame(struct iwl_priv *priv,
609extern void iwl4965_update_chain_flags(struct iwl_priv *priv); 602extern void iwl4965_update_chain_flags(struct iwl_priv *priv);
610int iwl4965_set_pwr_src(struct iwl_priv *priv, enum iwl_pwr_src src); 603int iwl4965_set_pwr_src(struct iwl_priv *priv, enum iwl_pwr_src src);
611 604
612int iwl4965_init_geos(struct iwl_priv *priv);
613void iwl4965_free_geos(struct iwl_priv *priv);
614
615extern const u8 iwl_bcast_addr[ETH_ALEN]; 605extern const u8 iwl_bcast_addr[ETH_ALEN];
616int iwl4965_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd);
617
618/*
619 * Currently used by iwl-3945-rs... look at restructuring so that it doesn't
620 * call this... todo... fix that.
621*/
622extern u8 iwl4965_sync_station(struct iwl_priv *priv, int sta_id,
623 u16 tx_rate, u8 flags);
624 606
625/****************************************************************************** 607/******************************************************************************
626 * 608 *
@@ -638,35 +620,16 @@ extern u8 iwl4965_sync_station(struct iwl_priv *priv, int sta_id,
638 * iwl4965_mac_ <-- mac80211 callback 620 * iwl4965_mac_ <-- mac80211 callback
639 * 621 *
640 ****************************************************************************/ 622 ****************************************************************************/
641extern void iwl4965_hw_setup_deferred_work(struct iwl_priv *priv);
642extern void iwl4965_hw_cancel_deferred_work(struct iwl_priv *priv);
643extern int iwl4965_hw_set_hw_params(struct iwl_priv *priv);
644extern int iwl_rxq_stop(struct iwl_priv *priv); 623extern int iwl_rxq_stop(struct iwl_priv *priv);
645extern void iwl_txq_ctx_stop(struct iwl_priv *priv); 624extern void iwl_txq_ctx_stop(struct iwl_priv *priv);
646extern unsigned int iwl4965_hw_get_beacon_cmd(struct iwl_priv *priv, 625extern unsigned int iwl4965_hw_get_beacon_cmd(struct iwl_priv *priv,
647 struct iwl_frame *frame, u8 rate); 626 struct iwl_frame *frame, u8 rate);
648extern void iwl4965_hw_build_tx_cmd_rate(struct iwl_priv *priv,
649 struct iwl_cmd *cmd,
650 struct ieee80211_tx_info *info,
651 struct ieee80211_hdr *hdr,
652 int sta_id, int tx_id);
653extern void iwl4965_hw_rx_statistics(struct iwl_priv *priv, 627extern void iwl4965_hw_rx_statistics(struct iwl_priv *priv,
654 struct iwl_rx_mem_buffer *rxb); 628 struct iwl_rx_mem_buffer *rxb);
655extern void iwl4965_disable_events(struct iwl_priv *priv); 629extern void iwl4965_disable_events(struct iwl_priv *priv);
656extern int iwl4965_get_temperature(const struct iwl_priv *priv);
657extern void iwl4965_rx_reply_rx(struct iwl_priv *priv, 630extern void iwl4965_rx_reply_rx(struct iwl_priv *priv,
658 struct iwl_rx_mem_buffer *rxb); 631 struct iwl_rx_mem_buffer *rxb);
659 632
660/**
661 * iwl_find_station - Find station id for a given BSSID
662 * @bssid: MAC address of station ID to find
663 *
664 * NOTE: This should not be hardware specific but the code has
665 * not yet been merged into a single common layer for managing the
666 * station tables.
667 */
668extern u8 iwl_find_station(struct iwl_priv *priv, const u8 *bssid);
669
670extern int iwl4965_hw_channel_switch(struct iwl_priv *priv, u16 channel); 633extern int iwl4965_hw_channel_switch(struct iwl_priv *priv, u16 channel);
671extern int iwl_queue_space(const struct iwl_queue *q); 634extern int iwl_queue_space(const struct iwl_queue *q);
672static inline int iwl_queue_used(const struct iwl_queue *q, int i) 635static inline int iwl_queue_used(const struct iwl_queue *q, int i)
@@ -694,16 +657,8 @@ extern int iwl4965_radio_kill_sw(struct iwl_priv *priv, int disable_radio);
694/* 657/*
695 * Forward declare iwl-4965.c functions for iwl-base.c 658 * Forward declare iwl-4965.c functions for iwl-base.c
696 */ 659 */
697extern int iwl4965_tx_queue_update_wr_ptr(struct iwl_priv *priv,
698 struct iwl_tx_queue *txq,
699 u16 byte_cnt);
700extern int iwl4965_alive_notify(struct iwl_priv *priv);
701extern void iwl4965_update_rate_scaling(struct iwl_priv *priv, u8 mode);
702extern void iwl4965_rf_kill_ct_config(struct iwl_priv *priv); 660extern void iwl4965_rf_kill_ct_config(struct iwl_priv *priv);
703 661
704extern void iwl4965_init_ht_hw_capab(const struct iwl_priv *priv,
705 struct ieee80211_ht_info *ht_info,
706 enum ieee80211_band band);
707int iwl4965_mac_ampdu_action(struct ieee80211_hw *hw, 662int iwl4965_mac_ampdu_action(struct ieee80211_hw *hw,
708 enum ieee80211_ampdu_mlme_action action, 663 enum ieee80211_ampdu_mlme_action action,
709 const u8 *addr, u16 tid, u16 *ssn); 664 const u8 *addr, u16 tid, u16 *ssn);
@@ -1174,17 +1129,6 @@ static inline const char *iwl_get_tx_fail_reason(u32 status) { return ""; }
1174#endif 1129#endif
1175 1130
1176 1131
1177static inline int iwl_get_ra_sta_id(struct iwl_priv *priv,
1178 struct ieee80211_hdr *hdr)
1179{
1180 if (priv->iw_mode == IEEE80211_IF_TYPE_STA) {
1181 return IWL_AP_ID;
1182 } else {
1183 u8 *da = ieee80211_get_DA(hdr);
1184 return iwl_find_station(priv, da);
1185 }
1186}
1187
1188static inline struct ieee80211_hdr *iwl_tx_queue_get_hdr(struct iwl_priv *priv, 1132static inline struct ieee80211_hdr *iwl_tx_queue_get_hdr(struct iwl_priv *priv,
1189 int txq_id, int idx) 1133 int txq_id, int idx)
1190{ 1134{
@@ -1254,4 +1198,4 @@ extern const struct iwl_channel_info *iwl_get_channel_info(
1254 1198
1255/* Requires full declaration of iwl_priv before including */ 1199/* Requires full declaration of iwl_priv before including */
1256 1200
1257#endif /* __iwl4965_4965_h__ */ 1201#endif /* __iwl_dev_h__ */
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c
index fae5d6d528d..f874e7d7b22 100644
--- a/drivers/net/wireless/iwlwifi/iwl-sta.c
+++ b/drivers/net/wireless/iwlwifi/iwl-sta.c
@@ -30,11 +30,9 @@
30#include <net/mac80211.h> 30#include <net/mac80211.h>
31#include <linux/etherdevice.h> 31#include <linux/etherdevice.h>
32 32
33#include "iwl-eeprom.h"
34#include "iwl-dev.h" 33#include "iwl-dev.h"
35#include "iwl-core.h" 34#include "iwl-core.h"
36#include "iwl-sta.h" 35#include "iwl-sta.h"
37#include "iwl-io.h"
38#include "iwl-helpers.h" 36#include "iwl-helpers.h"
39 37
40 38
@@ -74,6 +72,17 @@ u8 iwl_find_station(struct iwl_priv *priv, const u8 *addr)
74} 72}
75EXPORT_SYMBOL(iwl_find_station); 73EXPORT_SYMBOL(iwl_find_station);
76 74
75int iwl_get_ra_sta_id(struct iwl_priv *priv, struct ieee80211_hdr *hdr)
76{
77 if (priv->iw_mode == IEEE80211_IF_TYPE_STA) {
78 return IWL_AP_ID;
79 } else {
80 u8 *da = ieee80211_get_DA(hdr);
81 return iwl_find_station(priv, da);
82 }
83}
84EXPORT_SYMBOL(iwl_get_ra_sta_id);
85
77static int iwl_add_sta_callback(struct iwl_priv *priv, 86static int iwl_add_sta_callback(struct iwl_priv *priv,
78 struct iwl_cmd *cmd, struct sk_buff *skb) 87 struct iwl_cmd *cmd, struct sk_buff *skb)
79{ 88{
@@ -105,8 +114,6 @@ static int iwl_add_sta_callback(struct iwl_priv *priv,
105 return 1; 114 return 1;
106} 115}
107 116
108
109
110int iwl_send_add_sta(struct iwl_priv *priv, 117int iwl_send_add_sta(struct iwl_priv *priv,
111 struct iwl_addsta_cmd *sta, u8 flags) 118 struct iwl_addsta_cmd *sta, u8 flags)
112{ 119{
@@ -272,7 +279,6 @@ u8 iwl_add_station_flags(struct iwl_priv *priv, const u8 *addr, int is_ap,
272} 279}
273EXPORT_SYMBOL(iwl_add_station_flags); 280EXPORT_SYMBOL(iwl_add_station_flags);
274 281
275
276static int iwl_sta_ucode_deactivate(struct iwl_priv *priv, const char *addr) 282static int iwl_sta_ucode_deactivate(struct iwl_priv *priv, const char *addr)
277{ 283{
278 unsigned long flags; 284 unsigned long flags;
@@ -376,9 +382,9 @@ static int iwl_send_remove_station(struct iwl_priv *priv, const u8 *addr,
376 382
377 return ret; 383 return ret;
378} 384}
385
379/** 386/**
380 * iwl_remove_station - Remove driver's knowledge of station. 387 * iwl_remove_station - Remove driver's knowledge of station.
381 *
382 */ 388 */
383u8 iwl_remove_station(struct iwl_priv *priv, const u8 *addr, int is_ap) 389u8 iwl_remove_station(struct iwl_priv *priv, const u8 *addr, int is_ap)
384{ 390{
@@ -418,7 +424,7 @@ out:
418 return 0; 424 return 0;
419} 425}
420EXPORT_SYMBOL(iwl_remove_station); 426EXPORT_SYMBOL(iwl_remove_station);
421int iwl_get_free_ucode_key_index(struct iwl_priv *priv) 427static int iwl_get_free_ucode_key_index(struct iwl_priv *priv)
422{ 428{
423 int i; 429 int i;
424 430
@@ -869,7 +875,6 @@ int iwl_rxon_add_station(struct iwl_priv *priv, const u8 *addr, int is_ap)
869} 875}
870EXPORT_SYMBOL(iwl_rxon_add_station); 876EXPORT_SYMBOL(iwl_rxon_add_station);
871 877
872
873/** 878/**
874 * iwl_get_sta_id - Find station's index within station table 879 * iwl_get_sta_id - Find station's index within station table
875 * 880 *
@@ -927,7 +932,6 @@ int iwl_get_sta_id(struct iwl_priv *priv, struct ieee80211_hdr *hdr)
927} 932}
928EXPORT_SYMBOL(iwl_get_sta_id); 933EXPORT_SYMBOL(iwl_get_sta_id);
929 934
930
931/** 935/**
932 * iwl_sta_modify_enable_tid_tx - Enable Tx for this TID in station table 936 * iwl_sta_modify_enable_tid_tx - Enable Tx for this TID in station table
933 */ 937 */
@@ -946,4 +950,3 @@ void iwl_sta_modify_enable_tid_tx(struct iwl_priv *priv, int sta_id, int tid)
946} 950}
947EXPORT_SYMBOL(iwl_sta_modify_enable_tid_tx); 951EXPORT_SYMBOL(iwl_sta_modify_enable_tid_tx);
948 952
949
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.h b/drivers/net/wireless/iwlwifi/iwl-sta.h
index 3d55716f530..b6bb209fdd5 100644
--- a/drivers/net/wireless/iwlwifi/iwl-sta.h
+++ b/drivers/net/wireless/iwlwifi/iwl-sta.h
@@ -32,18 +32,24 @@
32#define HW_KEY_DYNAMIC 0 32#define HW_KEY_DYNAMIC 0
33#define HW_KEY_DEFAULT 1 33#define HW_KEY_DEFAULT 1
34 34
35int iwl_get_free_ucode_key_index(struct iwl_priv *priv); 35/**
36 * iwl_find_station - Find station id for a given BSSID
37 * @bssid: MAC address of station ID to find
38 */
39u8 iwl_find_station(struct iwl_priv *priv, const u8 *bssid);
40
36int iwl_send_static_wepkey_cmd(struct iwl_priv *priv, u8 send_if_empty); 41int iwl_send_static_wepkey_cmd(struct iwl_priv *priv, u8 send_if_empty);
37int iwl_remove_default_wep_key(struct iwl_priv *priv, 42int iwl_remove_default_wep_key(struct iwl_priv *priv,
38 struct ieee80211_key_conf *key); 43 struct ieee80211_key_conf *key);
39int iwl_set_default_wep_key(struct iwl_priv *priv, 44int iwl_set_default_wep_key(struct iwl_priv *priv,
40 struct ieee80211_key_conf *key); 45 struct ieee80211_key_conf *key);
41int iwl_set_dynamic_key(struct iwl_priv *priv, 46int iwl_set_dynamic_key(struct iwl_priv *priv,
42 struct ieee80211_key_conf *key, u8 sta_id); 47 struct ieee80211_key_conf *key, u8 sta_id);
43int iwl_remove_dynamic_key(struct iwl_priv *priv, 48int iwl_remove_dynamic_key(struct iwl_priv *priv,
44 struct ieee80211_key_conf *key, u8 sta_id); 49 struct ieee80211_key_conf *key, u8 sta_id);
45int iwl_rxon_add_station(struct iwl_priv *priv, const u8 *addr, int is_ap); 50int iwl_rxon_add_station(struct iwl_priv *priv, const u8 *addr, int is_ap);
46u8 iwl_remove_station(struct iwl_priv *priv, const u8 *addr, int is_ap); 51u8 iwl_remove_station(struct iwl_priv *priv, const u8 *addr, int is_ap);
47int iwl_get_sta_id(struct iwl_priv *priv, struct ieee80211_hdr *hdr); 52int iwl_get_sta_id(struct iwl_priv *priv, struct ieee80211_hdr *hdr);
48void iwl_sta_modify_enable_tid_tx(struct iwl_priv *priv, int sta_id, int tid); 53void iwl_sta_modify_enable_tid_tx(struct iwl_priv *priv, int sta_id, int tid);
54int iwl_get_ra_sta_id(struct iwl_priv *priv, struct ieee80211_hdr *hdr);
49#endif /* __iwl_sta_h__ */ 55#endif /* __iwl_sta_h__ */