OLD | NEW |
1 /****************************************************************************** | 1 /****************************************************************************** |
2 | 2 |
3 Copyright(c) 2003 - 2006 Intel Corporation. All rights reserved. | 3 Copyright(c) 2003 - 2006 Intel Corporation. All rights reserved. |
4 | 4 |
5 This program is free software; you can redistribute it and/or modify it | 5 This program is free software; you can redistribute it and/or modify it |
6 under the terms of version 2 of the GNU General Public License as | 6 under the terms of version 2 of the GNU General Public License as |
7 published by the Free Software Foundation. | 7 published by the Free Software Foundation. |
8 | 8 |
9 This program is distributed in the hope that it will be useful, but WITHOUT | 9 This program is distributed in the hope that it will be useful, but WITHOUT |
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | 10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
(...skipping 2722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2733 } | 2733 } |
2734 | 2734 |
2735 i = (rxq->next + 1) % rxq->entries; | 2735 i = (rxq->next + 1) % rxq->entries; |
2736 s = i; | 2736 s = i; |
2737 while (i != r) { | 2737 while (i != r) { |
2738 /* IPW_DEBUG_RX("r = %d : w = %d : processing = %d\n", | 2738 /* IPW_DEBUG_RX("r = %d : w = %d : processing = %d\n", |
2739 r, rxq->next, i); */ | 2739 r, rxq->next, i); */ |
2740 | 2740 |
2741 packet = &priv->rx_buffers[i]; | 2741 packet = &priv->rx_buffers[i]; |
2742 | 2742 |
2743 /* Sync the DMA for the STATUS buffer so CPU is sure to get | |
2744 * the correct values */ | |
2745 pci_dma_sync_single_for_cpu(priv->pci_dev, | |
2746 sq->nic + | |
2747 sizeof(struct ipw2100_status) * i, | |
2748 sizeof(struct ipw2100_status), | |
2749 PCI_DMA_FROMDEVICE); | |
2750 | |
2751 /* Sync the DMA for the RX buffer so CPU is sure to get | 2743 /* Sync the DMA for the RX buffer so CPU is sure to get |
2752 * the correct values */ | 2744 * the correct values */ |
2753 pci_dma_sync_single_for_cpu(priv->pci_dev, packet->dma_addr, | 2745 pci_dma_sync_single_for_cpu(priv->pci_dev, packet->dma_addr, |
2754 sizeof(struct ipw2100_rx), | 2746 sizeof(struct ipw2100_rx), |
2755 PCI_DMA_FROMDEVICE); | 2747 PCI_DMA_FROMDEVICE); |
2756 | 2748 |
2757 if (unlikely(ipw2100_corruption_check(priv, i))) { | 2749 if (unlikely(ipw2100_corruption_check(priv, i))) { |
2758 ipw2100_corruption_detected(priv, i); | 2750 ipw2100_corruption_detected(priv, i); |
2759 goto increment; | 2751 goto increment; |
2760 } | 2752 } |
(...skipping 3918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6679 * or we risk an unlikely race condition on someone accessing | 6671 * or we risk an unlikely race condition on someone accessing |
6680 * uninitialized data in the PCI dev struct through /proc. | 6672 * uninitialized data in the PCI dev struct through /proc. |
6681 */ | 6673 */ |
6682 static int __init ipw2100_init(void) | 6674 static int __init ipw2100_init(void) |
6683 { | 6675 { |
6684 int ret; | 6676 int ret; |
6685 | 6677 |
6686 printk(KERN_INFO DRV_NAME ": %s, %s\n", DRV_DESCRIPTION, DRV_VERSION); | 6678 printk(KERN_INFO DRV_NAME ": %s, %s\n", DRV_DESCRIPTION, DRV_VERSION); |
6687 printk(KERN_INFO DRV_NAME ": %s\n", DRV_COPYRIGHT); | 6679 printk(KERN_INFO DRV_NAME ": %s\n", DRV_COPYRIGHT); |
6688 | 6680 |
| 6681 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) |
| 6682 pm_qos_add_request(&ipw2100_pm_qos_req, PM_QOS_CPU_DMA_LATENCY, |
| 6683 PM_QOS_DEFAULT_VALUE); |
| 6684 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) |
| 6685 ipw2100_pm_qos_req = pm_qos_add_request(PM_QOS_CPU_DMA_LATENCY, |
| 6686 PM_QOS_DEFAULT_VALUE); |
| 6687 #else |
| 6688 pm_qos_add_requirement(PM_QOS_CPU_DMA_LATENCY, "ipw2100", |
| 6689 PM_QOS_DEFAULT_VALUE); |
| 6690 #endif |
| 6691 |
6689 ret = pci_register_driver(&ipw2100_pci_driver); | 6692 ret = pci_register_driver(&ipw2100_pci_driver); |
6690 if (ret) | 6693 if (ret) |
6691 goto out; | 6694 goto out; |
6692 | 6695 |
6693 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) | |
6694 pm_qos_add_request(&ipw2100_pm_qos_req, PM_QOS_CPU_DMA_LATENCY, | |
6695 PM_QOS_DEFAULT_VALUE); | |
6696 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) | |
6697 ipw2100_pm_qos_req = pm_qos_add_request(PM_QOS_CPU_DMA_LATENCY, | |
6698 PM_QOS_DEFAULT_VALUE); | |
6699 #else | |
6700 pm_qos_add_requirement(PM_QOS_CPU_DMA_LATENCY, "ipw2100", | |
6701 PM_QOS_DEFAULT_VALUE); | |
6702 #endif | |
6703 #ifdef CONFIG_IPW2100_DEBUG | 6696 #ifdef CONFIG_IPW2100_DEBUG |
6704 ipw2100_debug_level = debug; | 6697 ipw2100_debug_level = debug; |
6705 ret = driver_create_file(&ipw2100_pci_driver.driver, | 6698 ret = driver_create_file(&ipw2100_pci_driver.driver, |
6706 &driver_attr_debug_level); | 6699 &driver_attr_debug_level); |
6707 #endif | 6700 #endif |
6708 | 6701 |
6709 out: | 6702 out: |
6710 return ret; | 6703 return ret; |
6711 } | 6704 } |
6712 | 6705 |
(...skipping 2067 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8780 if (i == 30) { | 8773 if (i == 30) { |
8781 printk(KERN_ERR DRV_NAME | 8774 printk(KERN_ERR DRV_NAME |
8782 ": %s: No response from Symbol - hw not alive\n", | 8775 ": %s: No response from Symbol - hw not alive\n", |
8783 dev->name); | 8776 dev->name); |
8784 printk_buf(IPW_DL_ERROR, (u8 *) & response, sizeof(response)); | 8777 printk_buf(IPW_DL_ERROR, (u8 *) & response, sizeof(response)); |
8785 return -EIO; | 8778 return -EIO; |
8786 } | 8779 } |
8787 | 8780 |
8788 return 0; | 8781 return 0; |
8789 } | 8782 } |
OLD | NEW |