diff options
Diffstat (limited to 'drivers/net/wireless/iwlegacy/iwl4965-base.c')
-rw-r--r-- | drivers/net/wireless/iwlegacy/iwl4965-base.c | 71 |
1 files changed, 34 insertions, 37 deletions
diff --git a/drivers/net/wireless/iwlegacy/iwl4965-base.c b/drivers/net/wireless/iwlegacy/iwl4965-base.c index 0f7d44c95f08..ddf4200a95cf 100644 --- a/drivers/net/wireless/iwlegacy/iwl4965-base.c +++ b/drivers/net/wireless/iwlegacy/iwl4965-base.c | |||
@@ -72,7 +72,7 @@ | |||
72 | */ | 72 | */ |
73 | #define DRV_DESCRIPTION "Intel(R) Wireless WiFi 4965 driver for Linux" | 73 | #define DRV_DESCRIPTION "Intel(R) Wireless WiFi 4965 driver for Linux" |
74 | 74 | ||
75 | #ifdef CONFIG_IWLWIFI_LEGACY_DEBUG | 75 | #ifdef CONFIG_IWLEGACY_DEBUG |
76 | #define VD "d" | 76 | #define VD "d" |
77 | #else | 77 | #else |
78 | #define VD | 78 | #define VD |
@@ -493,7 +493,7 @@ static void il4965_rx_beacon_notif(struct il_priv *il, | |||
493 | struct il_rx_packet *pkt = rxb_addr(rxb); | 493 | struct il_rx_packet *pkt = rxb_addr(rxb); |
494 | struct il4965_beacon_notif *beacon = | 494 | struct il4965_beacon_notif *beacon = |
495 | (struct il4965_beacon_notif *)pkt->u.raw; | 495 | (struct il4965_beacon_notif *)pkt->u.raw; |
496 | #ifdef CONFIG_IWLWIFI_LEGACY_DEBUG | 496 | #ifdef CONFIG_IWLEGACY_DEBUG |
497 | u8 rate = il4965_hw_get_rate(beacon->beacon_notify_hdr.rate_n_flags); | 497 | u8 rate = il4965_hw_get_rate(beacon->beacon_notify_hdr.rate_n_flags); |
498 | 498 | ||
499 | D_RX("beacon status %x retries %d iss %d " | 499 | D_RX("beacon status %x retries %d iss %d " |
@@ -778,7 +778,7 @@ static void il4965_irq_tasklet(struct il_priv *il) | |||
778 | u32 inta_fh; | 778 | u32 inta_fh; |
779 | unsigned long flags; | 779 | unsigned long flags; |
780 | u32 i; | 780 | u32 i; |
781 | #ifdef CONFIG_IWLWIFI_LEGACY_DEBUG | 781 | #ifdef CONFIG_IWLEGACY_DEBUG |
782 | u32 inta_mask; | 782 | u32 inta_mask; |
783 | #endif | 783 | #endif |
784 | 784 | ||
@@ -796,7 +796,7 @@ static void il4965_irq_tasklet(struct il_priv *il) | |||
796 | inta_fh = _il_rd(il, CSR_FH_INT_STATUS); | 796 | inta_fh = _il_rd(il, CSR_FH_INT_STATUS); |
797 | _il_wr(il, CSR_FH_INT_STATUS, inta_fh); | 797 | _il_wr(il, CSR_FH_INT_STATUS, inta_fh); |
798 | 798 | ||
799 | #ifdef CONFIG_IWLWIFI_LEGACY_DEBUG | 799 | #ifdef CONFIG_IWLEGACY_DEBUG |
800 | if (il_get_debug_level(il) & IL_DL_ISR) { | 800 | if (il_get_debug_level(il) & IL_DL_ISR) { |
801 | /* just for debug */ | 801 | /* just for debug */ |
802 | inta_mask = _il_rd(il, CSR_INT_MASK); | 802 | inta_mask = _il_rd(il, CSR_INT_MASK); |
@@ -831,7 +831,7 @@ static void il4965_irq_tasklet(struct il_priv *il) | |||
831 | return; | 831 | return; |
832 | } | 832 | } |
833 | 833 | ||
834 | #ifdef CONFIG_IWLWIFI_LEGACY_DEBUG | 834 | #ifdef CONFIG_IWLEGACY_DEBUG |
835 | if (il_get_debug_level(il) & (IL_DL_ISR)) { | 835 | if (il_get_debug_level(il) & (IL_DL_ISR)) { |
836 | /* NIC fires this, but we don't use it, redundant with WAKEUP */ | 836 | /* NIC fires this, but we don't use it, redundant with WAKEUP */ |
837 | if (inta & CSR_INT_BIT_SCD) { | 837 | if (inta & CSR_INT_BIT_SCD) { |
@@ -946,7 +946,7 @@ static void il4965_irq_tasklet(struct il_priv *il) | |||
946 | else if (handled & CSR_INT_BIT_RF_KILL) | 946 | else if (handled & CSR_INT_BIT_RF_KILL) |
947 | il_enable_rfkill_int(il); | 947 | il_enable_rfkill_int(il); |
948 | 948 | ||
949 | #ifdef CONFIG_IWLWIFI_LEGACY_DEBUG | 949 | #ifdef CONFIG_IWLEGACY_DEBUG |
950 | if (il_get_debug_level(il) & (IL_DL_ISR)) { | 950 | if (il_get_debug_level(il) & (IL_DL_ISR)) { |
951 | inta = _il_rd(il, CSR_INT); | 951 | inta = _il_rd(il, CSR_INT); |
952 | inta_mask = _il_rd(il, CSR_INT_MASK); | 952 | inta_mask = _il_rd(il, CSR_INT_MASK); |
@@ -964,7 +964,7 @@ static void il4965_irq_tasklet(struct il_priv *il) | |||
964 | * | 964 | * |
965 | *****************************************************************************/ | 965 | *****************************************************************************/ |
966 | 966 | ||
967 | #ifdef CONFIG_IWLWIFI_LEGACY_DEBUG | 967 | #ifdef CONFIG_IWLEGACY_DEBUG |
968 | 968 | ||
969 | /* | 969 | /* |
970 | * The following adds a new attribute to the sysfs representation | 970 | * The following adds a new attribute to the sysfs representation |
@@ -1007,7 +1007,7 @@ static DEVICE_ATTR(debug_level, S_IWUSR | S_IRUGO, | |||
1007 | il4965_show_debug_level, il4965_store_debug_level); | 1007 | il4965_show_debug_level, il4965_store_debug_level); |
1008 | 1008 | ||
1009 | 1009 | ||
1010 | #endif /* CONFIG_IWLWIFI_LEGACY_DEBUG */ | 1010 | #endif /* CONFIG_IWLEGACY_DEBUG */ |
1011 | 1011 | ||
1012 | 1012 | ||
1013 | static ssize_t il4965_show_temperature(struct device *d, | 1013 | static ssize_t il4965_show_temperature(struct device *d, |
@@ -1062,7 +1062,7 @@ static DEVICE_ATTR(tx_power, S_IWUSR | S_IRUGO, | |||
1062 | static struct attribute *il_sysfs_entries[] = { | 1062 | static struct attribute *il_sysfs_entries[] = { |
1063 | &dev_attr_temperature.attr, | 1063 | &dev_attr_temperature.attr, |
1064 | &dev_attr_tx_power.attr, | 1064 | &dev_attr_tx_power.attr, |
1065 | #ifdef CONFIG_IWLWIFI_LEGACY_DEBUG | 1065 | #ifdef CONFIG_IWLEGACY_DEBUG |
1066 | &dev_attr_debug_level.attr, | 1066 | &dev_attr_debug_level.attr, |
1067 | #endif | 1067 | #endif |
1068 | NULL | 1068 | NULL |
@@ -1607,7 +1607,7 @@ static const s8 default_queue_to_tx_fifo[] = { | |||
1607 | IL_TX_FIFO_VI, | 1607 | IL_TX_FIFO_VI, |
1608 | IL_TX_FIFO_BE, | 1608 | IL_TX_FIFO_BE, |
1609 | IL_TX_FIFO_BK, | 1609 | IL_TX_FIFO_BK, |
1610 | IWL49_CMD_FIFO_NUM, | 1610 | IL49_CMD_FIFO_NUM, |
1611 | IL_TX_FIFO_UNUSED, | 1611 | IL_TX_FIFO_UNUSED, |
1612 | IL_TX_FIFO_UNUSED, | 1612 | IL_TX_FIFO_UNUSED, |
1613 | }; | 1613 | }; |
@@ -1623,18 +1623,18 @@ static int il4965_alive_notify(struct il_priv *il) | |||
1623 | 1623 | ||
1624 | /* Clear 4965's internal Tx Scheduler data base */ | 1624 | /* Clear 4965's internal Tx Scheduler data base */ |
1625 | il->scd_base_addr = il_rd_prph(il, | 1625 | il->scd_base_addr = il_rd_prph(il, |
1626 | IWL49_SCD_SRAM_BASE_ADDR); | 1626 | IL49_SCD_SRAM_BASE_ADDR); |
1627 | a = il->scd_base_addr + IWL49_SCD_CONTEXT_DATA_OFFSET; | 1627 | a = il->scd_base_addr + IL49_SCD_CONTEXT_DATA_OFFSET; |
1628 | for (; a < il->scd_base_addr + IWL49_SCD_TX_STTS_BITMAP_OFFSET; a += 4) | 1628 | for (; a < il->scd_base_addr + IL49_SCD_TX_STTS_BITMAP_OFFSET; a += 4) |
1629 | il_write_targ_mem(il, a, 0); | 1629 | il_write_targ_mem(il, a, 0); |
1630 | for (; a < il->scd_base_addr + IWL49_SCD_TRANSLATE_TBL_OFFSET; a += 4) | 1630 | for (; a < il->scd_base_addr + IL49_SCD_TRANSLATE_TBL_OFFSET; a += 4) |
1631 | il_write_targ_mem(il, a, 0); | 1631 | il_write_targ_mem(il, a, 0); |
1632 | for (; a < il->scd_base_addr + | 1632 | for (; a < il->scd_base_addr + |
1633 | IWL49_SCD_TRANSLATE_TBL_OFFSET_QUEUE(il->hw_params.max_txq_num); a += 4) | 1633 | IL49_SCD_TRANSLATE_TBL_OFFSET_QUEUE(il->hw_params.max_txq_num); a += 4) |
1634 | il_write_targ_mem(il, a, 0); | 1634 | il_write_targ_mem(il, a, 0); |
1635 | 1635 | ||
1636 | /* Tel 4965 where to find Tx byte count tables */ | 1636 | /* Tel 4965 where to find Tx byte count tables */ |
1637 | il_wr_prph(il, IWL49_SCD_DRAM_BASE_ADDR, | 1637 | il_wr_prph(il, IL49_SCD_DRAM_BASE_ADDR, |
1638 | il->scd_bc_tbls.dma >> 10); | 1638 | il->scd_bc_tbls.dma >> 10); |
1639 | 1639 | ||
1640 | /* Enable DMA channel */ | 1640 | /* Enable DMA channel */ |
@@ -1650,32 +1650,32 @@ static int il4965_alive_notify(struct il_priv *il) | |||
1650 | reg_val | FH_TX_CHICKEN_BITS_SCD_AUTO_RETRY_EN); | 1650 | reg_val | FH_TX_CHICKEN_BITS_SCD_AUTO_RETRY_EN); |
1651 | 1651 | ||
1652 | /* Disable chain mode for all queues */ | 1652 | /* Disable chain mode for all queues */ |
1653 | il_wr_prph(il, IWL49_SCD_QUEUECHAIN_SEL, 0); | 1653 | il_wr_prph(il, IL49_SCD_QUEUECHAIN_SEL, 0); |
1654 | 1654 | ||
1655 | /* Initialize each Tx queue (including the command queue) */ | 1655 | /* Initialize each Tx queue (including the command queue) */ |
1656 | for (i = 0; i < il->hw_params.max_txq_num; i++) { | 1656 | for (i = 0; i < il->hw_params.max_txq_num; i++) { |
1657 | 1657 | ||
1658 | /* TFD circular buffer read/write indexes */ | 1658 | /* TFD circular buffer read/write indexes */ |
1659 | il_wr_prph(il, IWL49_SCD_QUEUE_RDPTR(i), 0); | 1659 | il_wr_prph(il, IL49_SCD_QUEUE_RDPTR(i), 0); |
1660 | il_wr(il, HBUS_TARG_WRPTR, 0 | (i << 8)); | 1660 | il_wr(il, HBUS_TARG_WRPTR, 0 | (i << 8)); |
1661 | 1661 | ||
1662 | /* Max Tx Window size for Scheduler-ACK mode */ | 1662 | /* Max Tx Window size for Scheduler-ACK mode */ |
1663 | il_write_targ_mem(il, il->scd_base_addr + | 1663 | il_write_targ_mem(il, il->scd_base_addr + |
1664 | IWL49_SCD_CONTEXT_QUEUE_OFFSET(i), | 1664 | IL49_SCD_CONTEXT_QUEUE_OFFSET(i), |
1665 | (SCD_WIN_SIZE << | 1665 | (SCD_WIN_SIZE << |
1666 | IWL49_SCD_QUEUE_CTX_REG1_WIN_SIZE_POS) & | 1666 | IL49_SCD_QUEUE_CTX_REG1_WIN_SIZE_POS) & |
1667 | IWL49_SCD_QUEUE_CTX_REG1_WIN_SIZE_MSK); | 1667 | IL49_SCD_QUEUE_CTX_REG1_WIN_SIZE_MSK); |
1668 | 1668 | ||
1669 | /* Frame limit */ | 1669 | /* Frame limit */ |
1670 | il_write_targ_mem(il, il->scd_base_addr + | 1670 | il_write_targ_mem(il, il->scd_base_addr + |
1671 | IWL49_SCD_CONTEXT_QUEUE_OFFSET(i) + | 1671 | IL49_SCD_CONTEXT_QUEUE_OFFSET(i) + |
1672 | sizeof(u32), | 1672 | sizeof(u32), |
1673 | (SCD_FRAME_LIMIT << | 1673 | (SCD_FRAME_LIMIT << |
1674 | IWL49_SCD_QUEUE_CTX_REG2_FRAME_LIMIT_POS) & | 1674 | IL49_SCD_QUEUE_CTX_REG2_FRAME_LIMIT_POS) & |
1675 | IWL49_SCD_QUEUE_CTX_REG2_FRAME_LIMIT_MSK); | 1675 | IL49_SCD_QUEUE_CTX_REG2_FRAME_LIMIT_MSK); |
1676 | 1676 | ||
1677 | } | 1677 | } |
1678 | il_wr_prph(il, IWL49_SCD_INTERRUPT_MASK, | 1678 | il_wr_prph(il, IL49_SCD_INTERRUPT_MASK, |
1679 | (1 << il->hw_params.max_txq_num) - 1); | 1679 | (1 << il->hw_params.max_txq_num) - 1); |
1680 | 1680 | ||
1681 | /* Activate all Tx DMA/FIFO channels */ | 1681 | /* Activate all Tx DMA/FIFO channels */ |
@@ -2733,7 +2733,7 @@ void il4965_set_wr_ptrs(struct il_priv *il, int txq_id, u32 index) | |||
2733 | { | 2733 | { |
2734 | il_wr(il, HBUS_TARG_WRPTR, | 2734 | il_wr(il, HBUS_TARG_WRPTR, |
2735 | (index & 0xff) | (txq_id << 8)); | 2735 | (index & 0xff) | (txq_id << 8)); |
2736 | il_wr_prph(il, IWL49_SCD_QUEUE_RDPTR(txq_id), index); | 2736 | il_wr_prph(il, IL49_SCD_QUEUE_RDPTR(txq_id), index); |
2737 | } | 2737 | } |
2738 | 2738 | ||
2739 | void il4965_tx_queue_set_status(struct il_priv *il, | 2739 | void il4965_tx_queue_set_status(struct il_priv *il, |
@@ -2746,12 +2746,12 @@ void il4965_tx_queue_set_status(struct il_priv *il, | |||
2746 | int active = test_bit(txq_id, &il->txq_ctx_active_msk) ? 1 : 0; | 2746 | int active = test_bit(txq_id, &il->txq_ctx_active_msk) ? 1 : 0; |
2747 | 2747 | ||
2748 | /* Set up and activate */ | 2748 | /* Set up and activate */ |
2749 | il_wr_prph(il, IWL49_SCD_QUEUE_STATUS_BITS(txq_id), | 2749 | il_wr_prph(il, IL49_SCD_QUEUE_STATUS_BITS(txq_id), |
2750 | (active << IWL49_SCD_QUEUE_STTS_REG_POS_ACTIVE) | | 2750 | (active << IL49_SCD_QUEUE_STTS_REG_POS_ACTIVE) | |
2751 | (tx_fifo_id << IWL49_SCD_QUEUE_STTS_REG_POS_TXF) | | 2751 | (tx_fifo_id << IL49_SCD_QUEUE_STTS_REG_POS_TXF) | |
2752 | (scd_retry << IWL49_SCD_QUEUE_STTS_REG_POS_WSL) | | 2752 | (scd_retry << IL49_SCD_QUEUE_STTS_REG_POS_WSL) | |
2753 | (scd_retry << IWL49_SCD_QUEUE_STTS_REG_POS_SCD_ACK) | | 2753 | (scd_retry << IL49_SCD_QUEUE_STTS_REG_POS_SCD_ACK) | |
2754 | IWL49_SCD_QUEUE_STTS_REG_MSK); | 2754 | IL49_SCD_QUEUE_STTS_REG_MSK); |
2755 | 2755 | ||
2756 | txq->sched_retry = scd_retry; | 2756 | txq->sched_retry = scd_retry; |
2757 | 2757 | ||
@@ -3195,7 +3195,7 @@ static void __devexit il4965_pci_remove(struct pci_dev *pdev) | |||
3195 | */ | 3195 | */ |
3196 | void il4965_txq_set_sched(struct il_priv *il, u32 mask) | 3196 | void il4965_txq_set_sched(struct il_priv *il, u32 mask) |
3197 | { | 3197 | { |
3198 | il_wr_prph(il, IWL49_SCD_TXFACT, mask); | 3198 | il_wr_prph(il, IL49_SCD_TXFACT, mask); |
3199 | } | 3199 | } |
3200 | 3200 | ||
3201 | /***************************************************************************** | 3201 | /***************************************************************************** |
@@ -3206,11 +3206,8 @@ void il4965_txq_set_sched(struct il_priv *il, u32 mask) | |||
3206 | 3206 | ||
3207 | /* Hardware specific file defines the PCI IDs table for that hardware module */ | 3207 | /* Hardware specific file defines the PCI IDs table for that hardware module */ |
3208 | static DEFINE_PCI_DEVICE_TABLE(il4965_hw_card_ids) = { | 3208 | static DEFINE_PCI_DEVICE_TABLE(il4965_hw_card_ids) = { |
3209 | #if defined(CONFIG_IWL4965_MODULE) || defined(CONFIG_IWL4965) | ||
3210 | {IL_PCI_DEVICE(0x4229, PCI_ANY_ID, il4965_cfg)}, | 3209 | {IL_PCI_DEVICE(0x4229, PCI_ANY_ID, il4965_cfg)}, |
3211 | {IL_PCI_DEVICE(0x4230, PCI_ANY_ID, il4965_cfg)}, | 3210 | {IL_PCI_DEVICE(0x4230, PCI_ANY_ID, il4965_cfg)}, |
3212 | #endif /* CONFIG_IWL4965 */ | ||
3213 | |||
3214 | {0} | 3211 | {0} |
3215 | }; | 3212 | }; |
3216 | MODULE_DEVICE_TABLE(pci, il4965_hw_card_ids); | 3213 | MODULE_DEVICE_TABLE(pci, il4965_hw_card_ids); |
@@ -3258,7 +3255,7 @@ static void __exit il4965_exit(void) | |||
3258 | module_exit(il4965_exit); | 3255 | module_exit(il4965_exit); |
3259 | module_init(il4965_init); | 3256 | module_init(il4965_init); |
3260 | 3257 | ||
3261 | #ifdef CONFIG_IWLWIFI_LEGACY_DEBUG | 3258 | #ifdef CONFIG_IWLEGACY_DEBUG |
3262 | module_param_named(debug, il_debug_level, uint, S_IRUGO | S_IWUSR); | 3259 | module_param_named(debug, il_debug_level, uint, S_IRUGO | S_IWUSR); |
3263 | MODULE_PARM_DESC(debug, "debug output mask"); | 3260 | MODULE_PARM_DESC(debug, "debug output mask"); |
3264 | #endif | 3261 | #endif |