Skip to content

Commit

Permalink
iwlwifi: expose static methods for MVM use
Browse files Browse the repository at this point in the history
To support hybrid state of MVM op_mode, most of the functioanallity
will be done using DVM functions.

When MVM will have independant live, the declarations will be removed
and the functions will be static back.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
  • Loading branch information
David Spinadel authored and Wey-Yi Guy committed Apr 16, 2012
1 parent cfd8544 commit 50c1e9a
Show file tree
Hide file tree
Showing 5 changed files with 156 additions and 78 deletions.
19 changes: 9 additions & 10 deletions drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,7 @@ static int iwlagn_disconn_pan(struct iwl_priv *priv,
return ret;
}

static void iwlagn_update_qos(struct iwl_priv *priv,
struct iwl_rxon_context *ctx)
void iwlagn_update_qos(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
{
int ret;

Expand All @@ -205,8 +204,8 @@ static void iwlagn_update_qos(struct iwl_priv *priv,
IWL_DEBUG_QUIET_RFKILL(priv, "Failed to update QoS\n");
}

static int iwlagn_update_beacon(struct iwl_priv *priv,
struct ieee80211_vif *vif)
int iwlagn_update_beacon(struct iwl_priv *priv,
struct ieee80211_vif *vif)
{
lockdep_assert_held(&priv->mutex);

Expand Down Expand Up @@ -879,8 +878,8 @@ static int iwl_check_rxon_cmd(struct iwl_priv *priv,
* or is clearing the RXON_FILTER_ASSOC_MSK, then return 1 to indicate that
* a new tune (full RXON command, rather than RXON_ASSOC cmd) is required.
*/
static int iwl_full_rxon_required(struct iwl_priv *priv,
struct iwl_rxon_context *ctx)
int iwl_full_rxon_required(struct iwl_priv *priv,
struct iwl_rxon_context *ctx)
{
const struct iwl_rxon_cmd *staging = &ctx->staging;
const struct iwl_rxon_cmd *active = &ctx->active;
Expand Down Expand Up @@ -1223,9 +1222,9 @@ int iwlagn_mac_config(struct ieee80211_hw *hw, u32 changed)
return ret;
}

static void iwlagn_check_needed_chains(struct iwl_priv *priv,
struct iwl_rxon_context *ctx,
struct ieee80211_bss_conf *bss_conf)
void iwlagn_check_needed_chains(struct iwl_priv *priv,
struct iwl_rxon_context *ctx,
struct ieee80211_bss_conf *bss_conf)
{
struct ieee80211_vif *vif = ctx->vif;
struct iwl_rxon_context *tmp;
Expand Down Expand Up @@ -1317,7 +1316,7 @@ static void iwlagn_check_needed_chains(struct iwl_priv *priv,
ht_conf->single_chain_sufficient = !need_multiple;
}

static void iwlagn_chain_noise_reset(struct iwl_priv *priv)
void iwlagn_chain_noise_reset(struct iwl_priv *priv)
{
struct iwl_chain_noise_data *data = &priv->chain_noise_data;
int ret;
Expand Down
32 changes: 16 additions & 16 deletions drivers/net/wireless/iwlwifi/iwl-agn.c
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ static const u8 iwlagn_pan_queue_to_ac[] = {
IEEE80211_AC_VO,
};

static void iwl_init_context(struct iwl_priv *priv, u32 ucode_flags)
void iwl_init_context(struct iwl_priv *priv, u32 ucode_flags)
{
int i;

Expand Down Expand Up @@ -664,7 +664,7 @@ static void iwl_init_context(struct iwl_priv *priv, u32 ucode_flags)
BUILD_BUG_ON(NUM_IWL_RXON_CTX != 2);
}

static void iwl_rf_kill_ct_config(struct iwl_priv *priv)
void iwl_rf_kill_ct_config(struct iwl_priv *priv)
{
struct iwl_ct_kill_config cmd;
struct iwl_ct_kill_throttling_config adv_cmd;
Expand Down Expand Up @@ -745,7 +745,7 @@ static int iwlagn_send_tx_ant_config(struct iwl_priv *priv, u8 valid_tx_ant)
}
}

static void iwl_send_bt_config(struct iwl_priv *priv)
void iwl_send_bt_config(struct iwl_priv *priv)
{
struct iwl_bt_cmd bt_cmd = {
.lead_time = BT_LEAD_TIME_DEF,
Expand Down Expand Up @@ -1100,7 +1100,7 @@ static void iwlagn_disable_roc_work(struct work_struct *work)
*
*****************************************************************************/

static void iwl_setup_deferred_work(struct iwl_priv *priv)
void iwl_setup_deferred_work(struct iwl_priv *priv)
{
priv->workqueue = create_singlethread_workqueue(DRV_NAME);

Expand Down Expand Up @@ -1348,7 +1348,7 @@ static void iwl_free_geos(struct iwl_priv *priv)
clear_bit(STATUS_GEO_CONFIGURED, &priv->status);
}

static int iwl_init_drv(struct iwl_priv *priv)
int iwl_init_drv(struct iwl_priv *priv)
{
int ret;

Expand Down Expand Up @@ -1411,7 +1411,7 @@ static int iwl_init_drv(struct iwl_priv *priv)
return ret;
}

static void iwl_uninit_drv(struct iwl_priv *priv)
void iwl_uninit_drv(struct iwl_priv *priv)
{
iwl_free_geos(priv);
iwl_free_channel_map(priv);
Expand All @@ -1424,7 +1424,7 @@ static void iwl_uninit_drv(struct iwl_priv *priv)
#endif
}

static void iwl_set_hw_params(struct iwl_priv *priv)
void iwl_set_hw_params(struct iwl_priv *priv)
{
if (cfg(priv)->ht_params)
priv->hw_params.use_rts_for_aggregation =
Expand All @@ -1439,7 +1439,7 @@ static void iwl_set_hw_params(struct iwl_priv *priv)



static void iwl_debug_config(struct iwl_priv *priv)
void iwl_debug_config(struct iwl_priv *priv)
{
dev_printk(KERN_INFO, trans(priv)->dev, "CONFIG_IWLWIFI_DEBUG "
#ifdef CONFIG_IWLWIFI_DEBUG
Expand Down Expand Up @@ -1752,7 +1752,7 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
return op_mode;
}

static void iwl_op_mode_dvm_stop(struct iwl_op_mode *op_mode)
void iwl_op_mode_dvm_stop(struct iwl_op_mode *op_mode)
{
struct iwl_priv *priv = IWL_OP_MODE_GET_DVM(op_mode);

Expand Down Expand Up @@ -2217,7 +2217,7 @@ static void iwlagn_fw_error(struct iwl_priv *priv, bool ondemand)
}
}

static void iwl_nic_error(struct iwl_op_mode *op_mode)
void iwl_nic_error(struct iwl_op_mode *op_mode)
{
struct iwl_priv *priv = IWL_OP_MODE_GET_DVM(op_mode);

Expand All @@ -2230,7 +2230,7 @@ static void iwl_nic_error(struct iwl_op_mode *op_mode)
iwlagn_fw_error(priv, false);
}

static void iwl_cmd_queue_full(struct iwl_op_mode *op_mode)
void iwl_cmd_queue_full(struct iwl_op_mode *op_mode)
{
struct iwl_priv *priv = IWL_OP_MODE_GET_DVM(op_mode);

Expand All @@ -2240,7 +2240,7 @@ static void iwl_cmd_queue_full(struct iwl_op_mode *op_mode)
}
}

static void iwl_nic_config(struct iwl_op_mode *op_mode)
void iwl_nic_config(struct iwl_op_mode *op_mode)
{
struct iwl_priv *priv = IWL_OP_MODE_GET_DVM(op_mode);

Expand All @@ -2255,7 +2255,7 @@ static void iwl_wimax_active(struct iwl_op_mode *op_mode)
IWL_ERR(priv, "RF is used by WiMAX\n");
}

static void iwl_stop_sw_queue(struct iwl_op_mode *op_mode, int queue)
void iwl_stop_sw_queue(struct iwl_op_mode *op_mode, int queue)
{
struct iwl_priv *priv = IWL_OP_MODE_GET_DVM(op_mode);
int ac = priv->queue_to_ac[queue];
Expand All @@ -2274,7 +2274,7 @@ static void iwl_stop_sw_queue(struct iwl_op_mode *op_mode, int queue)
ieee80211_stop_queue(priv->hw, ac);
}

static void iwl_wake_sw_queue(struct iwl_op_mode *op_mode, int queue)
void iwl_wake_sw_queue(struct iwl_op_mode *op_mode, int queue)
{
struct iwl_priv *priv = IWL_OP_MODE_GET_DVM(op_mode);
int ac = priv->queue_to_ac[queue];
Expand Down Expand Up @@ -2314,7 +2314,7 @@ void iwlagn_lift_passive_no_rx(struct iwl_priv *priv)
priv->passive_no_rx = false;
}

static void iwl_free_skb(struct iwl_op_mode *op_mode, struct sk_buff *skb)
void iwl_free_skb(struct iwl_op_mode *op_mode, struct sk_buff *skb)
{
struct ieee80211_tx_info *info;

Expand All @@ -2323,7 +2323,7 @@ static void iwl_free_skb(struct iwl_op_mode *op_mode, struct sk_buff *skb)
dev_kfree_skb_any(skb);
}

static void iwl_set_hw_rfkill_state(struct iwl_op_mode *op_mode, bool state)
void iwl_set_hw_rfkill_state(struct iwl_op_mode *op_mode, bool state)
{
struct iwl_priv *priv = IWL_OP_MODE_GET_DVM(op_mode);

Expand Down
81 changes: 81 additions & 0 deletions drivers/net/wireless/iwlwifi/iwl-agn.h
Original file line number Diff line number Diff line change
Expand Up @@ -495,4 +495,85 @@ do { \
} while (0)
#endif /* CONFIG_IWLWIFI_DEBUG */

/* API method exported for mvm hybrid state */
void iwl_setup_deferred_work(struct iwl_priv *priv);
int iwl_send_wimax_coex(struct iwl_priv *priv);
int iwl_send_bt_env(struct iwl_priv *priv, u8 action, u8 type);
void iwl_debug_config(struct iwl_priv *priv);
int iwl_alloc_traffic_mem(struct iwl_priv *priv);
void iwl_set_hw_params(struct iwl_priv *priv);
void iwl_init_context(struct iwl_priv *priv, u32 ucode_flags);
int iwl_init_drv(struct iwl_priv *priv);
void iwl_uninit_drv(struct iwl_priv *priv);
void iwl_send_bt_config(struct iwl_priv *priv);
void iwl_rf_kill_ct_config(struct iwl_priv *priv);
int iwl_setup_interface(struct iwl_priv *priv, struct iwl_rxon_context *ctx);
void iwl_teardown_interface(struct iwl_priv *priv,
struct ieee80211_vif *vif,
bool mode_change);
int iwl_full_rxon_required(struct iwl_priv *priv, struct iwl_rxon_context *ctx);
void iwlagn_update_qos(struct iwl_priv *priv, struct iwl_rxon_context *ctx);
void iwlagn_check_needed_chains(struct iwl_priv *priv,
struct iwl_rxon_context *ctx,
struct ieee80211_bss_conf *bss_conf);
void iwlagn_chain_noise_reset(struct iwl_priv *priv);
int iwlagn_update_beacon(struct iwl_priv *priv,
struct ieee80211_vif *vif);
void iwl_tt_handler(struct iwl_priv *priv);
void iwl_op_mode_dvm_stop(struct iwl_op_mode *op_mode);
void iwl_stop_sw_queue(struct iwl_op_mode *op_mode, int queue);
void iwl_set_hw_rfkill_state(struct iwl_op_mode *op_mode, bool state);
void iwl_free_skb(struct iwl_op_mode *op_mode, struct sk_buff *skb);
void iwl_nic_error(struct iwl_op_mode *op_mode);
void iwl_cmd_queue_full(struct iwl_op_mode *op_mode);
void iwl_nic_config(struct iwl_op_mode *op_mode);
int iwlagn_mac_set_tim(struct ieee80211_hw *hw,
struct ieee80211_sta *sta, bool set);
void iwlagn_mac_rssi_callback(struct ieee80211_hw *hw,
enum ieee80211_rssi_event rssi_event);
int iwlagn_mac_cancel_remain_on_channel(struct ieee80211_hw *hw);
int iwlagn_mac_tx_last_beacon(struct ieee80211_hw *hw);
void iwlagn_mac_flush(struct ieee80211_hw *hw, bool drop);
void iwl_wake_sw_queue(struct iwl_op_mode *op_mode, int queue);
void iwlagn_mac_channel_switch(struct ieee80211_hw *hw,
struct ieee80211_channel_switch *ch_switch);
int iwlagn_mac_sta_state(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
struct ieee80211_sta *sta,
enum ieee80211_sta_state old_state,
enum ieee80211_sta_state new_state);
int iwlagn_mac_ampdu_action(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
enum ieee80211_ampdu_mlme_action action,
struct ieee80211_sta *sta, u16 tid, u16 *ssn,
u8 buf_size);
int iwlagn_mac_hw_scan(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
struct cfg80211_scan_request *req);
void iwlagn_mac_sta_notify(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
enum sta_notify_cmd cmd,
struct ieee80211_sta *sta);
void iwlagn_configure_filter(struct ieee80211_hw *hw,
unsigned int changed_flags,
unsigned int *total_flags,
u64 multicast);
int iwlagn_mac_conf_tx(struct ieee80211_hw *hw,
struct ieee80211_vif *vif, u16 queue,
const struct ieee80211_tx_queue_params *params);
void iwlagn_mac_set_rekey_data(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
struct cfg80211_gtk_rekey_data *data);
void iwlagn_mac_update_tkip_key(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
struct ieee80211_key_conf *keyconf,
struct ieee80211_sta *sta,
u32 iv32, u16 *phase1key);
int iwlagn_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
struct ieee80211_vif *vif,
struct ieee80211_sta *sta,
struct ieee80211_key_conf *key);
void iwlagn_mac_stop(struct ieee80211_hw *hw);
void iwlagn_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb);
int iwlagn_mac_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan);
#endif /* __iwl_agn_h__ */
Loading

0 comments on commit 50c1e9a

Please sign in to comment.