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

iwlagn: clean up ucode loading

All agn devices behave the same, so there's no
need to go through function pointers for any
of the ucode loading functionality.
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 2dedbf58
...@@ -185,13 +185,10 @@ static struct iwl_lib_ops iwl1000_lib = { ...@@ -185,13 +185,10 @@ static struct iwl_lib_ops iwl1000_lib = {
.rx_handler_setup = iwlagn_rx_handler_setup, .rx_handler_setup = iwlagn_rx_handler_setup,
.setup_deferred_work = iwlagn_setup_deferred_work, .setup_deferred_work = iwlagn_setup_deferred_work,
.is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr, .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr,
.load_ucode = iwlagn_load_ucode,
.dump_nic_event_log = iwl_dump_nic_event_log, .dump_nic_event_log = iwl_dump_nic_event_log,
.dump_nic_error_log = iwl_dump_nic_error_log, .dump_nic_error_log = iwl_dump_nic_error_log,
.dump_csr = iwl_dump_csr, .dump_csr = iwl_dump_csr,
.dump_fh = iwl_dump_fh, .dump_fh = iwl_dump_fh,
.init_alive_start = iwlagn_init_alive_start,
.alive_notify = iwlagn_alive_notify,
.send_tx_power = iwlagn_send_tx_power, .send_tx_power = iwlagn_send_tx_power,
.update_chain_flags = iwl_update_chain_flags, .update_chain_flags = iwl_update_chain_flags,
.apm_ops = { .apm_ops = {
......
...@@ -266,13 +266,10 @@ static struct iwl_lib_ops iwl2000_lib = { ...@@ -266,13 +266,10 @@ static struct iwl_lib_ops iwl2000_lib = {
.setup_deferred_work = iwlagn_bt_setup_deferred_work, .setup_deferred_work = iwlagn_bt_setup_deferred_work,
.cancel_deferred_work = iwlagn_bt_cancel_deferred_work, .cancel_deferred_work = iwlagn_bt_cancel_deferred_work,
.is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr, .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr,
.load_ucode = iwlagn_load_ucode,
.dump_nic_event_log = iwl_dump_nic_event_log, .dump_nic_event_log = iwl_dump_nic_event_log,
.dump_nic_error_log = iwl_dump_nic_error_log, .dump_nic_error_log = iwl_dump_nic_error_log,
.dump_csr = iwl_dump_csr, .dump_csr = iwl_dump_csr,
.dump_fh = iwl_dump_fh, .dump_fh = iwl_dump_fh,
.init_alive_start = iwlagn_init_alive_start,
.alive_notify = iwlagn_alive_notify,
.send_tx_power = iwlagn_send_tx_power, .send_tx_power = iwlagn_send_tx_power,
.update_chain_flags = iwl_update_chain_flags, .update_chain_flags = iwl_update_chain_flags,
.set_channel_switch = iwl2030_hw_channel_switch, .set_channel_switch = iwl2030_hw_channel_switch,
......
...@@ -358,9 +358,6 @@ static struct iwl_lib_ops iwl5000_lib = { ...@@ -358,9 +358,6 @@ static struct iwl_lib_ops iwl5000_lib = {
.dump_nic_error_log = iwl_dump_nic_error_log, .dump_nic_error_log = iwl_dump_nic_error_log,
.dump_csr = iwl_dump_csr, .dump_csr = iwl_dump_csr,
.dump_fh = iwl_dump_fh, .dump_fh = iwl_dump_fh,
.load_ucode = iwlagn_load_ucode,
.init_alive_start = iwlagn_init_alive_start,
.alive_notify = iwlagn_alive_notify,
.send_tx_power = iwlagn_send_tx_power, .send_tx_power = iwlagn_send_tx_power,
.update_chain_flags = iwl_update_chain_flags, .update_chain_flags = iwl_update_chain_flags,
.set_channel_switch = iwl5000_hw_channel_switch, .set_channel_switch = iwl5000_hw_channel_switch,
...@@ -423,9 +420,6 @@ static struct iwl_lib_ops iwl5150_lib = { ...@@ -423,9 +420,6 @@ static struct iwl_lib_ops iwl5150_lib = {
.dump_nic_event_log = iwl_dump_nic_event_log, .dump_nic_event_log = iwl_dump_nic_event_log,
.dump_nic_error_log = iwl_dump_nic_error_log, .dump_nic_error_log = iwl_dump_nic_error_log,
.dump_csr = iwl_dump_csr, .dump_csr = iwl_dump_csr,
.load_ucode = iwlagn_load_ucode,
.init_alive_start = iwlagn_init_alive_start,
.alive_notify = iwlagn_alive_notify,
.send_tx_power = iwlagn_send_tx_power, .send_tx_power = iwlagn_send_tx_power,
.update_chain_flags = iwl_update_chain_flags, .update_chain_flags = iwl_update_chain_flags,
.set_channel_switch = iwl5000_hw_channel_switch, .set_channel_switch = iwl5000_hw_channel_switch,
......
...@@ -294,13 +294,10 @@ static struct iwl_lib_ops iwl6000_lib = { ...@@ -294,13 +294,10 @@ static struct iwl_lib_ops iwl6000_lib = {
.rx_handler_setup = iwlagn_rx_handler_setup, .rx_handler_setup = iwlagn_rx_handler_setup,
.setup_deferred_work = iwlagn_setup_deferred_work, .setup_deferred_work = iwlagn_setup_deferred_work,
.is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr, .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr,
.load_ucode = iwlagn_load_ucode,
.dump_nic_event_log = iwl_dump_nic_event_log, .dump_nic_event_log = iwl_dump_nic_event_log,
.dump_nic_error_log = iwl_dump_nic_error_log, .dump_nic_error_log = iwl_dump_nic_error_log,
.dump_csr = iwl_dump_csr, .dump_csr = iwl_dump_csr,
.dump_fh = iwl_dump_fh, .dump_fh = iwl_dump_fh,
.init_alive_start = iwlagn_init_alive_start,
.alive_notify = iwlagn_alive_notify,
.send_tx_power = iwlagn_send_tx_power, .send_tx_power = iwlagn_send_tx_power,
.update_chain_flags = iwl_update_chain_flags, .update_chain_flags = iwl_update_chain_flags,
.set_channel_switch = iwl6000_hw_channel_switch, .set_channel_switch = iwl6000_hw_channel_switch,
...@@ -362,13 +359,10 @@ static struct iwl_lib_ops iwl6030_lib = { ...@@ -362,13 +359,10 @@ static struct iwl_lib_ops iwl6030_lib = {
.setup_deferred_work = iwlagn_bt_setup_deferred_work, .setup_deferred_work = iwlagn_bt_setup_deferred_work,
.cancel_deferred_work = iwlagn_bt_cancel_deferred_work, .cancel_deferred_work = iwlagn_bt_cancel_deferred_work,
.is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr, .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr,
.load_ucode = iwlagn_load_ucode,
.dump_nic_event_log = iwl_dump_nic_event_log, .dump_nic_event_log = iwl_dump_nic_event_log,
.dump_nic_error_log = iwl_dump_nic_error_log, .dump_nic_error_log = iwl_dump_nic_error_log,
.dump_csr = iwl_dump_csr, .dump_csr = iwl_dump_csr,
.dump_fh = iwl_dump_fh, .dump_fh = iwl_dump_fh,
.init_alive_start = iwlagn_init_alive_start,
.alive_notify = iwlagn_alive_notify,
.send_tx_power = iwlagn_send_tx_power, .send_tx_power = iwlagn_send_tx_power,
.update_chain_flags = iwl_update_chain_flags, .update_chain_flags = iwl_update_chain_flags,
.set_channel_switch = iwl6000_hw_channel_switch, .set_channel_switch = iwl6000_hw_channel_switch,
......
...@@ -318,7 +318,7 @@ void iwlagn_init_alive_start(struct iwl_priv *priv) ...@@ -318,7 +318,7 @@ void iwlagn_init_alive_start(struct iwl_priv *priv)
goto restart; goto restart;
} }
ret = priv->cfg->ops->lib->alive_notify(priv); ret = iwlagn_alive_notify(priv);
if (ret) { if (ret) {
IWL_WARN(priv, IWL_WARN(priv,
"Could not complete ALIVE transition: %d\n", ret); "Could not complete ALIVE transition: %d\n", ret);
......
...@@ -2248,7 +2248,7 @@ static void iwl_alive_start(struct iwl_priv *priv) ...@@ -2248,7 +2248,7 @@ static void iwl_alive_start(struct iwl_priv *priv)
goto restart; goto restart;
} }
ret = priv->cfg->ops->lib->alive_notify(priv); ret = iwlagn_alive_notify(priv);
if (ret) { if (ret) {
IWL_WARN(priv, IWL_WARN(priv,
"Could not complete ALIVE transition [ntf]: %d\n", ret); "Could not complete ALIVE transition [ntf]: %d\n", ret);
...@@ -2581,7 +2581,7 @@ static int __iwl_up(struct iwl_priv *priv) ...@@ -2581,7 +2581,7 @@ static int __iwl_up(struct iwl_priv *priv)
/* load bootstrap state machine, /* load bootstrap state machine,
* load bootstrap program into processor's memory, * load bootstrap program into processor's memory,
* prepare to load the "initialize" uCode */ * prepare to load the "initialize" uCode */
ret = priv->cfg->ops->lib->load_ucode(priv); ret = iwlagn_load_ucode(priv);
if (ret) { if (ret) {
IWL_ERR(priv, "Unable to set up bootstrap uCode: %d\n", IWL_ERR(priv, "Unable to set up bootstrap uCode: %d\n",
...@@ -2626,7 +2626,7 @@ static void iwl_bg_init_alive_start(struct work_struct *data) ...@@ -2626,7 +2626,7 @@ static void iwl_bg_init_alive_start(struct work_struct *data)
return; return;
} }
priv->cfg->ops->lib->init_alive_start(priv); iwlagn_init_alive_start(priv);
mutex_unlock(&priv->mutex); mutex_unlock(&priv->mutex);
} }
......
...@@ -177,14 +177,9 @@ struct iwl_lib_ops { ...@@ -177,14 +177,9 @@ struct iwl_lib_ops {
void (*setup_deferred_work)(struct iwl_priv *priv); void (*setup_deferred_work)(struct iwl_priv *priv);
/* cancel deferred work */ /* cancel deferred work */
void (*cancel_deferred_work)(struct iwl_priv *priv); void (*cancel_deferred_work)(struct iwl_priv *priv);
/* alive notification after init uCode load */
void (*init_alive_start)(struct iwl_priv *priv);
/* alive notification */
int (*alive_notify)(struct iwl_priv *priv);
/* check validity of rtc data address */ /* check validity of rtc data address */
int (*is_valid_rtc_data_addr)(u32 addr); int (*is_valid_rtc_data_addr)(u32 addr);
/* 1st ucode load */
int (*load_ucode)(struct iwl_priv *priv);
int (*dump_nic_event_log)(struct iwl_priv *priv, int (*dump_nic_event_log)(struct iwl_priv *priv,
bool full_log, char **buf, bool display); bool full_log, char **buf, bool display);
void (*dump_nic_error_log)(struct iwl_priv *priv); void (*dump_nic_error_log)(struct iwl_priv *priv);
......
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