Commit ecdb975c authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville

iwlwifi: virtualize nic_config

The nic_config sets uCode dependent register
bits, so it must be virtual in the op_mode.
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent f8d7c1a1
...@@ -1422,6 +1422,13 @@ static void iwl_cmd_queue_full(struct iwl_op_mode *op_mode) ...@@ -1422,6 +1422,13 @@ static void iwl_cmd_queue_full(struct iwl_op_mode *op_mode)
} }
} }
static void iwl_nic_config(struct iwl_op_mode *op_mode)
{
struct iwl_priv *priv = IWL_OP_MODE_GET_DVM(op_mode);
cfg(priv)->lib->nic_config(priv);
}
const struct iwl_op_mode_ops iwl_dvm_ops = { const struct iwl_op_mode_ops iwl_dvm_ops = {
.start = iwl_op_mode_dvm_start, .start = iwl_op_mode_dvm_start,
.stop = iwl_op_mode_dvm_stop, .stop = iwl_op_mode_dvm_stop,
...@@ -1432,6 +1439,7 @@ const struct iwl_op_mode_ops iwl_dvm_ops = { ...@@ -1432,6 +1439,7 @@ const struct iwl_op_mode_ops iwl_dvm_ops = {
.free_skb = iwl_free_skb, .free_skb = iwl_free_skb,
.nic_error = iwl_nic_error, .nic_error = iwl_nic_error,
.cmd_queue_full = iwl_cmd_queue_full, .cmd_queue_full = iwl_cmd_queue_full,
.nic_config = iwl_nic_config,
}; };
/***************************************************************************** /*****************************************************************************
......
...@@ -1468,11 +1468,6 @@ void iwl_set_hw_rfkill_state(struct iwl_op_mode *op_mode, bool state) ...@@ -1468,11 +1468,6 @@ void iwl_set_hw_rfkill_state(struct iwl_op_mode *op_mode, bool state)
wiphy_rfkill_set_hw_state(priv->hw->wiphy, state); wiphy_rfkill_set_hw_state(priv->hw->wiphy, state);
} }
void iwl_nic_config(struct iwl_priv *priv)
{
cfg(priv)->lib->nic_config(priv);
}
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 iwl_priv *priv = IWL_OP_MODE_GET_DVM(op_mode); struct iwl_priv *priv = IWL_OP_MODE_GET_DVM(op_mode);
......
...@@ -123,6 +123,8 @@ struct iwl_fw; ...@@ -123,6 +123,8 @@ struct iwl_fw;
* Must be atomic * Must be atomic
* @nic_error: error notification. Must be atomic * @nic_error: error notification. Must be atomic
* @cmd_queue_full: Called when the command queue gets full. Must be atomic. * @cmd_queue_full: Called when the command queue gets full. Must be atomic.
* @nic_config: configure NIC, called before firmware is started.
* May sleep
*/ */
struct iwl_op_mode_ops { struct iwl_op_mode_ops {
struct iwl_op_mode *(*start)(struct iwl_trans *trans, struct iwl_op_mode *(*start)(struct iwl_trans *trans,
...@@ -136,6 +138,7 @@ struct iwl_op_mode_ops { ...@@ -136,6 +138,7 @@ struct iwl_op_mode_ops {
void (*free_skb)(struct iwl_op_mode *op_mode, struct sk_buff *skb); void (*free_skb)(struct iwl_op_mode *op_mode, struct sk_buff *skb);
void (*nic_error)(struct iwl_op_mode *op_mode); void (*nic_error)(struct iwl_op_mode *op_mode);
void (*cmd_queue_full)(struct iwl_op_mode *op_mode); void (*cmd_queue_full)(struct iwl_op_mode *op_mode);
void (*nic_config)(struct iwl_op_mode *op_mode);
}; };
/** /**
...@@ -199,6 +202,12 @@ static inline void iwl_op_mode_cmd_queue_full(struct iwl_op_mode *op_mode) ...@@ -199,6 +202,12 @@ static inline void iwl_op_mode_cmd_queue_full(struct iwl_op_mode *op_mode)
op_mode->ops->cmd_queue_full(op_mode); op_mode->ops->cmd_queue_full(op_mode);
} }
static inline void iwl_op_mode_nic_config(struct iwl_op_mode *op_mode)
{
might_sleep();
op_mode->ops->nic_config(op_mode);
}
/***************************************************** /*****************************************************
* Op mode layers implementations * Op mode layers implementations
******************************************************/ ******************************************************/
......
...@@ -418,7 +418,6 @@ enum iwl_rxon_context_id { ...@@ -418,7 +418,6 @@ enum iwl_rxon_context_id {
}; };
int iwlagn_hw_valid_rtc_data_addr(u32 addr); int iwlagn_hw_valid_rtc_data_addr(u32 addr);
void iwl_nic_config(struct iwl_priv *priv);
const char *get_cmd_string(u8 cmd); const char *get_cmd_string(u8 cmd);
#define IWL_CMD(x) case x: return #x #define IWL_CMD(x) case x: return #x
......
...@@ -816,7 +816,7 @@ static int iwl_nic_init(struct iwl_trans *trans) ...@@ -816,7 +816,7 @@ static int iwl_nic_init(struct iwl_trans *trans)
iwl_set_pwr_vmain(trans); iwl_set_pwr_vmain(trans);
iwl_nic_config(priv(trans)); iwl_op_mode_nic_config(trans->op_mode);
#ifndef CONFIG_IWLWIFI_IDI #ifndef CONFIG_IWLWIFI_IDI
/* Allocate the RX queue, or reset if it is already allocated */ /* Allocate the RX queue, or reset if it is already allocated */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment