aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c51
1 files changed, 29 insertions, 22 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index cab3f63f4e4e..fcbc3b1d0584 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -200,7 +200,7 @@ int iwlagn_send_beacon_cmd(struct iwl_priv *priv)
200 cmd.data[1] = priv->beacon_skb->data; 200 cmd.data[1] = priv->beacon_skb->data;
201 cmd.dataflags[1] = IWL_HCMD_DFL_NOCOPY; 201 cmd.dataflags[1] = IWL_HCMD_DFL_NOCOPY;
202 202
203 return trans_send_cmd(&priv->trans, &cmd); 203 return iwl_trans_send_cmd(trans(priv), &cmd);
204} 204}
205 205
206static void iwl_bg_beacon_update(struct work_struct *work) 206static void iwl_bg_beacon_update(struct work_struct *work)
@@ -1685,7 +1685,7 @@ static void iwl_rf_kill_ct_config(struct iwl_priv *priv)
1685 adv_cmd.critical_temperature_exit = 1685 adv_cmd.critical_temperature_exit =
1686 cpu_to_le32(hw_params(priv).ct_kill_exit_threshold); 1686 cpu_to_le32(hw_params(priv).ct_kill_exit_threshold);
1687 1687
1688 ret = trans_send_cmd_pdu(&priv->trans, 1688 ret = iwl_trans_send_cmd_pdu(trans(priv),
1689 REPLY_CT_KILL_CONFIG_CMD, 1689 REPLY_CT_KILL_CONFIG_CMD,
1690 CMD_SYNC, sizeof(adv_cmd), &adv_cmd); 1690 CMD_SYNC, sizeof(adv_cmd), &adv_cmd);
1691 if (ret) 1691 if (ret)
@@ -1700,7 +1700,7 @@ static void iwl_rf_kill_ct_config(struct iwl_priv *priv)
1700 cmd.critical_temperature_R = 1700 cmd.critical_temperature_R =
1701 cpu_to_le32(hw_params(priv).ct_kill_threshold); 1701 cpu_to_le32(hw_params(priv).ct_kill_threshold);
1702 1702
1703 ret = trans_send_cmd_pdu(&priv->trans, 1703 ret = iwl_trans_send_cmd_pdu(trans(priv),
1704 REPLY_CT_KILL_CONFIG_CMD, 1704 REPLY_CT_KILL_CONFIG_CMD,
1705 CMD_SYNC, sizeof(cmd), &cmd); 1705 CMD_SYNC, sizeof(cmd), &cmd);
1706 if (ret) 1706 if (ret)
@@ -1726,7 +1726,7 @@ static int iwlagn_send_calib_cfg_rt(struct iwl_priv *priv, u32 cfg)
1726 calib_cfg_cmd.ucd_calib_cfg.once.is_enable = IWL_CALIB_INIT_CFG_ALL; 1726 calib_cfg_cmd.ucd_calib_cfg.once.is_enable = IWL_CALIB_INIT_CFG_ALL;
1727 calib_cfg_cmd.ucd_calib_cfg.once.start = cpu_to_le32(cfg); 1727 calib_cfg_cmd.ucd_calib_cfg.once.start = cpu_to_le32(cfg);
1728 1728
1729 return trans_send_cmd(&priv->trans, &cmd); 1729 return iwl_trans_send_cmd(trans(priv), &cmd);
1730} 1730}
1731 1731
1732 1732
@@ -1738,7 +1738,7 @@ static int iwlagn_send_tx_ant_config(struct iwl_priv *priv, u8 valid_tx_ant)
1738 1738
1739 if (IWL_UCODE_API(priv->ucode_ver) > 1) { 1739 if (IWL_UCODE_API(priv->ucode_ver) > 1) {
1740 IWL_DEBUG_HC(priv, "select valid tx ant: %u\n", valid_tx_ant); 1740 IWL_DEBUG_HC(priv, "select valid tx ant: %u\n", valid_tx_ant);
1741 return trans_send_cmd_pdu(&priv->trans, 1741 return iwl_trans_send_cmd_pdu(trans(priv),
1742 TX_ANT_CONFIGURATION_CMD, 1742 TX_ANT_CONFIGURATION_CMD,
1743 CMD_SYNC, 1743 CMD_SYNC,
1744 sizeof(struct iwl_tx_ant_config_cmd), 1744 sizeof(struct iwl_tx_ant_config_cmd),
@@ -1912,7 +1912,7 @@ static void __iwl_down(struct iwl_priv *priv)
1912 test_bit(STATUS_EXIT_PENDING, &priv->shrd->status) << 1912 test_bit(STATUS_EXIT_PENDING, &priv->shrd->status) <<
1913 STATUS_EXIT_PENDING; 1913 STATUS_EXIT_PENDING;
1914 1914
1915 trans_stop_device(&priv->trans); 1915 iwl_trans_stop_device(trans(priv));
1916 1916
1917 dev_kfree_skb(priv->beacon_skb); 1917 dev_kfree_skb(priv->beacon_skb);
1918 priv->beacon_skb = NULL; 1918 priv->beacon_skb = NULL;
@@ -2336,7 +2336,7 @@ static int iwlagn_send_patterns(struct iwl_priv *priv,
2336 } 2336 }
2337 2337
2338 cmd.data[0] = pattern_cmd; 2338 cmd.data[0] = pattern_cmd;
2339 err = trans_send_cmd(&priv->trans, &cmd); 2339 err = iwl_trans_send_cmd(trans(priv), &cmd);
2340 kfree(pattern_cmd); 2340 kfree(pattern_cmd);
2341 return err; 2341 return err;
2342} 2342}
@@ -2591,7 +2591,7 @@ static int iwlagn_mac_suspend(struct ieee80211_hw *hw,
2591 2591
2592 memcpy(&rxon, &ctx->active, sizeof(rxon)); 2592 memcpy(&rxon, &ctx->active, sizeof(rxon));
2593 2593
2594 trans_stop_device(&priv->trans); 2594 iwl_trans_stop_device(trans(priv));
2595 2595
2596 priv->wowlan = true; 2596 priv->wowlan = true;
2597 2597
@@ -2643,13 +2643,13 @@ static int iwlagn_mac_suspend(struct ieee80211_hw *hw,
2643 .len[0] = sizeof(*key_data.rsc_tsc), 2643 .len[0] = sizeof(*key_data.rsc_tsc),
2644 }; 2644 };
2645 2645
2646 ret = trans_send_cmd(&priv->trans, &rsc_tsc_cmd); 2646 ret = iwl_trans_send_cmd(trans(priv), &rsc_tsc_cmd);
2647 if (ret) 2647 if (ret)
2648 goto error; 2648 goto error;
2649 } 2649 }
2650 2650
2651 if (key_data.use_tkip) { 2651 if (key_data.use_tkip) {
2652 ret = trans_send_cmd_pdu(&priv->trans, 2652 ret = iwl_trans_send_cmd_pdu(trans(priv),
2653 REPLY_WOWLAN_TKIP_PARAMS, 2653 REPLY_WOWLAN_TKIP_PARAMS,
2654 CMD_SYNC, sizeof(tkip_cmd), 2654 CMD_SYNC, sizeof(tkip_cmd),
2655 &tkip_cmd); 2655 &tkip_cmd);
@@ -2665,7 +2665,7 @@ static int iwlagn_mac_suspend(struct ieee80211_hw *hw,
2665 kek_kck_cmd.kek_len = cpu_to_le16(NL80211_KEK_LEN); 2665 kek_kck_cmd.kek_len = cpu_to_le16(NL80211_KEK_LEN);
2666 kek_kck_cmd.replay_ctr = priv->replay_ctr; 2666 kek_kck_cmd.replay_ctr = priv->replay_ctr;
2667 2667
2668 ret = trans_send_cmd_pdu(&priv->trans, 2668 ret = iwl_trans_send_cmd_pdu(trans(priv),
2669 REPLY_WOWLAN_KEK_KCK_MATERIAL, 2669 REPLY_WOWLAN_KEK_KCK_MATERIAL,
2670 CMD_SYNC, sizeof(kek_kck_cmd), 2670 CMD_SYNC, sizeof(kek_kck_cmd),
2671 &kek_kck_cmd); 2671 &kek_kck_cmd);
@@ -2674,7 +2674,7 @@ static int iwlagn_mac_suspend(struct ieee80211_hw *hw,
2674 } 2674 }
2675 } 2675 }
2676 2676
2677 ret = trans_send_cmd_pdu(&priv->trans, REPLY_WOWLAN_WAKEUP_FILTER, 2677 ret = iwl_trans_send_cmd_pdu(trans(priv), REPLY_WOWLAN_WAKEUP_FILTER,
2678 CMD_SYNC, sizeof(wakeup_filter_cmd), 2678 CMD_SYNC, sizeof(wakeup_filter_cmd),
2679 &wakeup_filter_cmd); 2679 &wakeup_filter_cmd);
2680 if (ret) 2680 if (ret)
@@ -2943,7 +2943,7 @@ static int iwlagn_mac_ampdu_action(struct ieee80211_hw *hw,
2943 case IEEE80211_AMPDU_TX_OPERATIONAL: 2943 case IEEE80211_AMPDU_TX_OPERATIONAL:
2944 buf_size = min_t(int, buf_size, LINK_QUAL_AGG_FRAME_LIMIT_DEF); 2944 buf_size = min_t(int, buf_size, LINK_QUAL_AGG_FRAME_LIMIT_DEF);
2945 2945
2946 trans_txq_agg_setup(&priv->trans, iwl_sta_id(sta), tid, 2946 iwl_trans_txq_agg_setup(trans(priv), iwl_sta_id(sta), tid,
2947 buf_size); 2947 buf_size);
2948 2948
2949 /* 2949 /*
@@ -3590,7 +3590,8 @@ out:
3590 return hw; 3590 return hw;
3591} 3591}
3592 3592
3593int iwl_probe(struct iwl_bus *bus, struct iwl_cfg *cfg) 3593int iwl_probe(struct iwl_bus *bus, const struct iwl_trans_ops *trans_ops,
3594 struct iwl_cfg *cfg)
3594{ 3595{
3595 int err = 0; 3596 int err = 0;
3596 struct iwl_priv *priv; 3597 struct iwl_priv *priv;
@@ -3614,6 +3615,12 @@ int iwl_probe(struct iwl_bus *bus, struct iwl_cfg *cfg)
3614 priv->shrd->priv = priv; 3615 priv->shrd->priv = priv;
3615 bus_set_drv_data(priv->bus, priv->shrd); 3616 bus_set_drv_data(priv->bus, priv->shrd);
3616 3617
3618 priv->shrd->trans = trans_ops->alloc(priv->shrd);
3619 if (priv->shrd->trans == NULL) {
3620 err = -ENOMEM;
3621 goto out_free_traffic_mem;
3622 }
3623
3617 /* At this point both hw and priv are allocated. */ 3624 /* At this point both hw and priv are allocated. */
3618 3625
3619 SET_IEEE80211_DEV(hw, priv->bus->dev); 3626 SET_IEEE80211_DEV(hw, priv->bus->dev);
@@ -3656,11 +3663,11 @@ int iwl_probe(struct iwl_bus *bus, struct iwl_cfg *cfg)
3656 IWL_INFO(priv, "Detected %s, REV=0x%X\n", 3663 IWL_INFO(priv, "Detected %s, REV=0x%X\n",
3657 priv->cfg->name, hw_rev); 3664 priv->cfg->name, hw_rev);
3658 3665
3659 err = iwl_trans_register(&priv->trans, priv); 3666 err = iwl_trans_request_irq(trans(priv));
3660 if (err) 3667 if (err)
3661 goto out_free_traffic_mem; 3668 goto out_free_trans;
3662 3669
3663 if (trans_prepare_card_hw(&priv->trans)) { 3670 if (iwl_trans_prepare_card_hw(trans(priv))) {
3664 err = -EIO; 3671 err = -EIO;
3665 IWL_WARN(priv, "Failed, HW not ready\n"); 3672 IWL_WARN(priv, "Failed, HW not ready\n");
3666 goto out_free_trans; 3673 goto out_free_trans;
@@ -3754,7 +3761,7 @@ out_destroy_workqueue:
3754out_free_eeprom: 3761out_free_eeprom:
3755 iwl_eeprom_free(priv); 3762 iwl_eeprom_free(priv);
3756out_free_trans: 3763out_free_trans:
3757 trans_free(&priv->trans); 3764 iwl_trans_free(trans(priv));
3758out_free_traffic_mem: 3765out_free_traffic_mem:
3759 iwl_free_traffic_mem(priv); 3766 iwl_free_traffic_mem(priv);
3760 ieee80211_free_hw(priv->hw); 3767 ieee80211_free_hw(priv->hw);
@@ -3800,12 +3807,12 @@ void __devexit iwl_remove(struct iwl_priv * priv)
3800 iwl_disable_interrupts(priv); 3807 iwl_disable_interrupts(priv);
3801 spin_unlock_irqrestore(&priv->shrd->lock, flags); 3808 spin_unlock_irqrestore(&priv->shrd->lock, flags);
3802 3809
3803 trans_sync_irq(&priv->trans); 3810 iwl_trans_sync_irq(trans(priv));
3804 3811
3805 iwl_dealloc_ucode(priv); 3812 iwl_dealloc_ucode(priv);
3806 3813
3807 trans_rx_free(&priv->trans); 3814 iwl_trans_rx_free(trans(priv));
3808 trans_tx_free(&priv->trans); 3815 iwl_trans_tx_free(trans(priv));
3809 3816
3810 iwl_eeprom_free(priv); 3817 iwl_eeprom_free(priv);
3811 3818
@@ -3819,7 +3826,7 @@ void __devexit iwl_remove(struct iwl_priv * priv)
3819 priv->shrd->workqueue = NULL; 3826 priv->shrd->workqueue = NULL;
3820 iwl_free_traffic_mem(priv); 3827 iwl_free_traffic_mem(priv);
3821 3828
3822 trans_free(&priv->trans); 3829 iwl_trans_free(trans(priv));
3823 3830
3824 bus_set_drv_data(priv->bus, NULL); 3831 bus_set_drv_data(priv->bus, NULL);
3825 3832