diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-5000.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-5000.c | 86 |
1 files changed, 20 insertions, 66 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c index afa88a304158..a6e347b9799a 100644 --- a/drivers/net/wireless/iwlwifi/iwl-5000.c +++ b/drivers/net/wireless/iwlwifi/iwl-5000.c | |||
@@ -72,72 +72,14 @@ static const u16 iwl5000_default_queue_to_tx_fifo[] = { | |||
72 | IWL_TX_FIFO_HCCA_2 | 72 | IWL_TX_FIFO_HCCA_2 |
73 | }; | 73 | }; |
74 | 74 | ||
75 | int iwl5000_apm_init(struct iwl_priv *priv) | ||
76 | { | ||
77 | int ret = 0; | ||
78 | |||
79 | iwl_set_bit(priv, CSR_GIO_CHICKEN_BITS, | ||
80 | CSR_GIO_CHICKEN_BITS_REG_BIT_DIS_L0S_EXIT_TIMER); | ||
81 | |||
82 | /* disable L0s without affecting L1 :don't wait for ICH L0s bug W/A) */ | ||
83 | iwl_set_bit(priv, CSR_GIO_CHICKEN_BITS, | ||
84 | CSR_GIO_CHICKEN_BITS_REG_BIT_L1A_NO_L0S_RX); | ||
85 | |||
86 | /* Set FH wait threshold to maximum (HW error during stress W/A) */ | ||
87 | iwl_set_bit(priv, CSR_DBG_HPET_MEM_REG, CSR_DBG_HPET_MEM_REG_VAL); | ||
88 | |||
89 | /* enable HAP INTA to move device L1a -> L0s */ | ||
90 | iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG, | ||
91 | CSR_HW_IF_CONFIG_REG_BIT_HAP_WAKE_L1A); | ||
92 | |||
93 | if (priv->cfg->need_pll_cfg) | ||
94 | iwl_set_bit(priv, CSR_ANA_PLL_CFG, CSR50_ANA_PLL_CFG_VAL); | ||
95 | |||
96 | /* set "initialization complete" bit to move adapter | ||
97 | * D0U* --> D0A* state */ | ||
98 | iwl_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE); | ||
99 | |||
100 | /* wait for clock stabilization */ | ||
101 | ret = iwl_poll_bit(priv, CSR_GP_CNTRL, | ||
102 | CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, | ||
103 | CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000); | ||
104 | if (ret < 0) { | ||
105 | IWL_DEBUG_INFO(priv, "Failed to init the card\n"); | ||
106 | return ret; | ||
107 | } | ||
108 | |||
109 | /* enable DMA */ | ||
110 | iwl_write_prph(priv, APMG_CLK_EN_REG, APMG_CLK_VAL_DMA_CLK_RQT); | ||
111 | |||
112 | udelay(20); | ||
113 | |||
114 | /* disable L1-Active */ | ||
115 | iwl_set_bits_prph(priv, APMG_PCIDEV_STT_REG, | ||
116 | APMG_PCIDEV_STT_VAL_L1_ACT_DIS); | ||
117 | |||
118 | return ret; | ||
119 | } | ||
120 | |||
121 | /* NIC configuration for 5000 series */ | 75 | /* NIC configuration for 5000 series */ |
122 | void iwl5000_nic_config(struct iwl_priv *priv) | 76 | void iwl5000_nic_config(struct iwl_priv *priv) |
123 | { | 77 | { |
124 | unsigned long flags; | 78 | unsigned long flags; |
125 | u16 radio_cfg; | 79 | u16 radio_cfg; |
126 | u16 lctl; | ||
127 | 80 | ||
128 | spin_lock_irqsave(&priv->lock, flags); | 81 | spin_lock_irqsave(&priv->lock, flags); |
129 | 82 | ||
130 | lctl = iwl_pcie_link_ctl(priv); | ||
131 | |||
132 | /* HW bug W/A */ | ||
133 | /* L1-ASPM is enabled by BIOS */ | ||
134 | if ((lctl & PCI_CFG_LINK_CTRL_VAL_L1_EN) == PCI_CFG_LINK_CTRL_VAL_L1_EN) | ||
135 | /* L1-APSM enabled: disable L0S */ | ||
136 | iwl_set_bit(priv, CSR_GIO_REG, CSR_GIO_REG_VAL_L0S_ENABLED); | ||
137 | else | ||
138 | /* L1-ASPM disabled: enable L0S */ | ||
139 | iwl_clear_bit(priv, CSR_GIO_REG, CSR_GIO_REG_VAL_L0S_ENABLED); | ||
140 | |||
141 | radio_cfg = iwl_eeprom_query16(priv, EEPROM_RADIO_CONFIG); | 83 | radio_cfg = iwl_eeprom_query16(priv, EEPROM_RADIO_CONFIG); |
142 | 84 | ||
143 | /* write radio config values to register */ | 85 | /* write radio config values to register */ |
@@ -1488,7 +1430,7 @@ struct iwl_lib_ops iwl5000_lib = { | |||
1488 | .send_tx_power = iwl5000_send_tx_power, | 1430 | .send_tx_power = iwl5000_send_tx_power, |
1489 | .update_chain_flags = iwl_update_chain_flags, | 1431 | .update_chain_flags = iwl_update_chain_flags, |
1490 | .apm_ops = { | 1432 | .apm_ops = { |
1491 | .init = iwl5000_apm_init, | 1433 | .init = iwl_apm_init, |
1492 | .stop = iwl_apm_stop, | 1434 | .stop = iwl_apm_stop, |
1493 | .config = iwl5000_nic_config, | 1435 | .config = iwl5000_nic_config, |
1494 | .set_pwr_src = iwl_set_pwr_src, | 1436 | .set_pwr_src = iwl_set_pwr_src, |
@@ -1539,7 +1481,7 @@ static struct iwl_lib_ops iwl5150_lib = { | |||
1539 | .send_tx_power = iwl5000_send_tx_power, | 1481 | .send_tx_power = iwl5000_send_tx_power, |
1540 | .update_chain_flags = iwl_update_chain_flags, | 1482 | .update_chain_flags = iwl_update_chain_flags, |
1541 | .apm_ops = { | 1483 | .apm_ops = { |
1542 | .init = iwl5000_apm_init, | 1484 | .init = iwl_apm_init, |
1543 | .stop = iwl_apm_stop, | 1485 | .stop = iwl_apm_stop, |
1544 | .config = iwl5000_nic_config, | 1486 | .config = iwl5000_nic_config, |
1545 | .set_pwr_src = iwl_set_pwr_src, | 1487 | .set_pwr_src = iwl_set_pwr_src, |
@@ -1607,7 +1549,9 @@ struct iwl_cfg iwl5300_agn_cfg = { | |||
1607 | .mod_params = &iwl50_mod_params, | 1549 | .mod_params = &iwl50_mod_params, |
1608 | .valid_tx_ant = ANT_ABC, | 1550 | .valid_tx_ant = ANT_ABC, |
1609 | .valid_rx_ant = ANT_ABC, | 1551 | .valid_rx_ant = ANT_ABC, |
1610 | .need_pll_cfg = true, | 1552 | .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL, |
1553 | .set_l0s = true, | ||
1554 | .use_bsm = false, | ||
1611 | .ht_greenfield_support = true, | 1555 | .ht_greenfield_support = true, |
1612 | .led_compensation = 51, | 1556 | .led_compensation = 51, |
1613 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, | 1557 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, |
@@ -1628,7 +1572,9 @@ struct iwl_cfg iwl5100_bg_cfg = { | |||
1628 | .mod_params = &iwl50_mod_params, | 1572 | .mod_params = &iwl50_mod_params, |
1629 | .valid_tx_ant = ANT_B, | 1573 | .valid_tx_ant = ANT_B, |
1630 | .valid_rx_ant = ANT_AB, | 1574 | .valid_rx_ant = ANT_AB, |
1631 | .need_pll_cfg = true, | 1575 | .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL, |
1576 | .set_l0s = true, | ||
1577 | .use_bsm = false, | ||
1632 | .ht_greenfield_support = true, | 1578 | .ht_greenfield_support = true, |
1633 | .led_compensation = 51, | 1579 | .led_compensation = 51, |
1634 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, | 1580 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, |
@@ -1649,7 +1595,9 @@ struct iwl_cfg iwl5100_abg_cfg = { | |||
1649 | .mod_params = &iwl50_mod_params, | 1595 | .mod_params = &iwl50_mod_params, |
1650 | .valid_tx_ant = ANT_B, | 1596 | .valid_tx_ant = ANT_B, |
1651 | .valid_rx_ant = ANT_AB, | 1597 | .valid_rx_ant = ANT_AB, |
1652 | .need_pll_cfg = true, | 1598 | .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL, |
1599 | .set_l0s = true, | ||
1600 | .use_bsm = false, | ||
1653 | .ht_greenfield_support = true, | 1601 | .ht_greenfield_support = true, |
1654 | .led_compensation = 51, | 1602 | .led_compensation = 51, |
1655 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, | 1603 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, |
@@ -1670,7 +1618,9 @@ struct iwl_cfg iwl5100_agn_cfg = { | |||
1670 | .mod_params = &iwl50_mod_params, | 1618 | .mod_params = &iwl50_mod_params, |
1671 | .valid_tx_ant = ANT_B, | 1619 | .valid_tx_ant = ANT_B, |
1672 | .valid_rx_ant = ANT_AB, | 1620 | .valid_rx_ant = ANT_AB, |
1673 | .need_pll_cfg = true, | 1621 | .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL, |
1622 | .set_l0s = true, | ||
1623 | .use_bsm = false, | ||
1674 | .ht_greenfield_support = true, | 1624 | .ht_greenfield_support = true, |
1675 | .led_compensation = 51, | 1625 | .led_compensation = 51, |
1676 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, | 1626 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, |
@@ -1691,7 +1641,9 @@ struct iwl_cfg iwl5350_agn_cfg = { | |||
1691 | .mod_params = &iwl50_mod_params, | 1641 | .mod_params = &iwl50_mod_params, |
1692 | .valid_tx_ant = ANT_ABC, | 1642 | .valid_tx_ant = ANT_ABC, |
1693 | .valid_rx_ant = ANT_ABC, | 1643 | .valid_rx_ant = ANT_ABC, |
1694 | .need_pll_cfg = true, | 1644 | .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL, |
1645 | .set_l0s = true, | ||
1646 | .use_bsm = false, | ||
1695 | .ht_greenfield_support = true, | 1647 | .ht_greenfield_support = true, |
1696 | .led_compensation = 51, | 1648 | .led_compensation = 51, |
1697 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, | 1649 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, |
@@ -1712,7 +1664,9 @@ struct iwl_cfg iwl5150_agn_cfg = { | |||
1712 | .mod_params = &iwl50_mod_params, | 1664 | .mod_params = &iwl50_mod_params, |
1713 | .valid_tx_ant = ANT_A, | 1665 | .valid_tx_ant = ANT_A, |
1714 | .valid_rx_ant = ANT_AB, | 1666 | .valid_rx_ant = ANT_AB, |
1715 | .need_pll_cfg = true, | 1667 | .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL, |
1668 | .set_l0s = true, | ||
1669 | .use_bsm = false, | ||
1716 | .ht_greenfield_support = true, | 1670 | .ht_greenfield_support = true, |
1717 | .led_compensation = 51, | 1671 | .led_compensation = 51, |
1718 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, | 1672 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, |