diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2011-08-26 02:10:36 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-08-29 15:25:30 -0400 |
commit | 48f20d354e729afcfb29ff41aca7583ebb94613d (patch) | |
tree | 8d5c3b20c123d0ed02c09b5530f02212f56730eb /drivers/net/wireless/iwlwifi/iwl-agn.c | |
parent | a294b96f25f2d436c90ca54d91e13461696cbcd4 (diff) |
iwlagn: introduce iwl-shared.h
It will hold declaration of functions and forward declaration of struct that
are used by several layers.
This will allow modules not to include iwl_priv. iwl_bus and iwl_trans are
still visible to all.
All the layers share the module parameters, move the struct to iwl-shared.h.
Also add all module parameters to iwl_mod_params instead of having them as
global static. This includes
* debug_level
* ant_coupling
* bt_ch_announce
* wanted_ucode_alternative
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index 7f50d9d6f7cf..cb8a9f9a22df 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -51,6 +51,7 @@ | |||
51 | #include "iwl-sta.h" | 51 | #include "iwl-sta.h" |
52 | #include "iwl-agn-calib.h" | 52 | #include "iwl-agn-calib.h" |
53 | #include "iwl-agn.h" | 53 | #include "iwl-agn.h" |
54 | #include "iwl-shared.h" | ||
54 | #include "iwl-bus.h" | 55 | #include "iwl-bus.h" |
55 | #include "iwl-trans.h" | 56 | #include "iwl-trans.h" |
56 | 57 | ||
@@ -79,9 +80,6 @@ MODULE_VERSION(DRV_VERSION); | |||
79 | MODULE_AUTHOR(DRV_COPYRIGHT " " DRV_AUTHOR); | 80 | MODULE_AUTHOR(DRV_COPYRIGHT " " DRV_AUTHOR); |
80 | MODULE_LICENSE("GPL"); | 81 | MODULE_LICENSE("GPL"); |
81 | 82 | ||
82 | static int iwlagn_ant_coupling; | ||
83 | static bool iwlagn_bt_ch_announce = 1; | ||
84 | |||
85 | void iwl_update_chain_flags(struct iwl_priv *priv) | 83 | void iwl_update_chain_flags(struct iwl_priv *priv) |
86 | { | 84 | { |
87 | struct iwl_rxon_context *ctx; | 85 | struct iwl_rxon_context *ctx; |
@@ -818,8 +816,6 @@ static int iwlagn_load_legacy_firmware(struct iwl_priv *priv, | |||
818 | return 0; | 816 | return 0; |
819 | } | 817 | } |
820 | 818 | ||
821 | static int iwlagn_wanted_ucode_alternative = 1; | ||
822 | |||
823 | static int iwlagn_load_firmware(struct iwl_priv *priv, | 819 | static int iwlagn_load_firmware(struct iwl_priv *priv, |
824 | const struct firmware *ucode_raw, | 820 | const struct firmware *ucode_raw, |
825 | struct iwlagn_firmware_pieces *pieces, | 821 | struct iwlagn_firmware_pieces *pieces, |
@@ -829,7 +825,8 @@ static int iwlagn_load_firmware(struct iwl_priv *priv, | |||
829 | struct iwl_ucode_tlv *tlv; | 825 | struct iwl_ucode_tlv *tlv; |
830 | size_t len = ucode_raw->size; | 826 | size_t len = ucode_raw->size; |
831 | const u8 *data; | 827 | const u8 *data; |
832 | int wanted_alternative = iwlagn_wanted_ucode_alternative, tmp; | 828 | int wanted_alternative = iwlagn_mod_params.wanted_ucode_alternative; |
829 | int tmp; | ||
833 | u64 alternatives; | 830 | u64 alternatives; |
834 | u32 tlv_len; | 831 | u32 tlv_len; |
835 | enum iwl_ucode_tlv_type tlv_type; | 832 | enum iwl_ucode_tlv_type tlv_type; |
@@ -1619,7 +1616,7 @@ int iwl_dump_nic_event_log(struct iwl_priv *priv, bool full_log, | |||
1619 | } | 1616 | } |
1620 | 1617 | ||
1621 | /* enable/disable bt channel inhibition */ | 1618 | /* enable/disable bt channel inhibition */ |
1622 | priv->bt_ch_announce = iwlagn_bt_ch_announce; | 1619 | priv->bt_ch_announce = iwlagn_mod_params.bt_ch_announce; |
1623 | 1620 | ||
1624 | #ifdef CONFIG_IWLWIFI_DEBUG | 1621 | #ifdef CONFIG_IWLWIFI_DEBUG |
1625 | if (!(iwl_get_debug_level(priv) & IWL_DL_FW_ERRORS) && !full_log) | 1622 | if (!(iwl_get_debug_level(priv) & IWL_DL_FW_ERRORS) && !full_log) |
@@ -3618,11 +3615,12 @@ int iwl_probe(struct iwl_bus *bus, struct iwl_cfg *cfg) | |||
3618 | 3615 | ||
3619 | /* is antenna coupling more than 35dB ? */ | 3616 | /* is antenna coupling more than 35dB ? */ |
3620 | priv->bt_ant_couple_ok = | 3617 | priv->bt_ant_couple_ok = |
3621 | (iwlagn_ant_coupling > IWL_BT_ANTENNA_COUPLING_THRESHOLD) ? | 3618 | (iwlagn_mod_params.ant_coupling > |
3622 | true : false; | 3619 | IWL_BT_ANTENNA_COUPLING_THRESHOLD) ? |
3620 | true : false; | ||
3623 | 3621 | ||
3624 | /* enable/disable bt channel inhibition */ | 3622 | /* enable/disable bt channel inhibition */ |
3625 | priv->bt_ch_announce = iwlagn_bt_ch_announce; | 3623 | priv->bt_ch_announce = iwlagn_mod_params.bt_ch_announce; |
3626 | IWL_DEBUG_INFO(priv, "BT channel inhibition is %s\n", | 3624 | IWL_DEBUG_INFO(priv, "BT channel inhibition is %s\n", |
3627 | (priv->bt_ch_announce) ? "On" : "Off"); | 3625 | (priv->bt_ch_announce) ? "On" : "Off"); |
3628 | 3626 | ||
@@ -3863,7 +3861,8 @@ module_exit(iwl_exit); | |||
3863 | module_init(iwl_init); | 3861 | module_init(iwl_init); |
3864 | 3862 | ||
3865 | #ifdef CONFIG_IWLWIFI_DEBUG | 3863 | #ifdef CONFIG_IWLWIFI_DEBUG |
3866 | module_param_named(debug, iwl_debug_level, uint, S_IRUGO | S_IWUSR); | 3864 | module_param_named(debug, iwlagn_mod_params.debug_level, uint, |
3865 | S_IRUGO | S_IWUSR); | ||
3867 | MODULE_PARM_DESC(debug, "debug output mask"); | 3866 | MODULE_PARM_DESC(debug, "debug output mask"); |
3868 | #endif | 3867 | #endif |
3869 | 3868 | ||
@@ -3879,16 +3878,19 @@ MODULE_PARM_DESC(amsdu_size_8K, "enable 8K amsdu size"); | |||
3879 | module_param_named(fw_restart, iwlagn_mod_params.restart_fw, int, S_IRUGO); | 3878 | module_param_named(fw_restart, iwlagn_mod_params.restart_fw, int, S_IRUGO); |
3880 | MODULE_PARM_DESC(fw_restart, "restart firmware in case of error"); | 3879 | MODULE_PARM_DESC(fw_restart, "restart firmware in case of error"); |
3881 | 3880 | ||
3882 | module_param_named(ucode_alternative, iwlagn_wanted_ucode_alternative, int, | 3881 | module_param_named(ucode_alternative, |
3883 | S_IRUGO); | 3882 | iwlagn_mod_params.wanted_ucode_alternative, |
3883 | int, S_IRUGO); | ||
3884 | MODULE_PARM_DESC(ucode_alternative, | 3884 | MODULE_PARM_DESC(ucode_alternative, |
3885 | "specify ucode alternative to use from ucode file"); | 3885 | "specify ucode alternative to use from ucode file"); |
3886 | 3886 | ||
3887 | module_param_named(antenna_coupling, iwlagn_ant_coupling, int, S_IRUGO); | 3887 | module_param_named(antenna_coupling, iwlagn_mod_params.ant_coupling, |
3888 | int, S_IRUGO); | ||
3888 | MODULE_PARM_DESC(antenna_coupling, | 3889 | MODULE_PARM_DESC(antenna_coupling, |
3889 | "specify antenna coupling in dB (defualt: 0 dB)"); | 3890 | "specify antenna coupling in dB (defualt: 0 dB)"); |
3890 | 3891 | ||
3891 | module_param_named(bt_ch_inhibition, iwlagn_bt_ch_announce, bool, S_IRUGO); | 3892 | module_param_named(bt_ch_inhibition, iwlagn_mod_params.bt_ch_announce, |
3893 | bool, S_IRUGO); | ||
3892 | MODULE_PARM_DESC(bt_ch_inhibition, | 3894 | MODULE_PARM_DESC(bt_ch_inhibition, |
3893 | "Disable BT channel inhibition (default: enable)"); | 3895 | "Disable BT channel inhibition (default: enable)"); |
3894 | 3896 | ||