diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2006-09-24 21:53:53 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-24 23:07:48 -0400 |
commit | ee111d111b69c2a216d674081107fe3b3829aa9a (patch) | |
tree | 3696a452a000ef30c9aaa037e43465f9467aa947 /drivers | |
parent | 8a1cdc9ca264c49ad0b896e43468fe6a4b0b646c (diff) |
[PATCH] qla3xxx iomem annotations
the driver is still shite, though...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/qla3xxx.c | 49 | ||||
-rw-r--r-- | drivers/net/qla3xxx.h | 2 |
2 files changed, 25 insertions, 26 deletions
diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c index 09a481a71838..c184cd80a9fc 100644 --- a/drivers/net/qla3xxx.c +++ b/drivers/net/qla3xxx.c | |||
@@ -189,31 +189,31 @@ static u32 ql_read_page0_reg(struct ql3_adapter *qdev, u32 __iomem *reg) | |||
189 | } | 189 | } |
190 | 190 | ||
191 | static void ql_write_common_reg_l(struct ql3_adapter *qdev, | 191 | static void ql_write_common_reg_l(struct ql3_adapter *qdev, |
192 | u32 * reg, u32 value) | 192 | u32 __iomem *reg, u32 value) |
193 | { | 193 | { |
194 | unsigned long hw_flags; | 194 | unsigned long hw_flags; |
195 | 195 | ||
196 | spin_lock_irqsave(&qdev->hw_lock, hw_flags); | 196 | spin_lock_irqsave(&qdev->hw_lock, hw_flags); |
197 | writel(value, (u32 *) reg); | 197 | writel(value, reg); |
198 | readl(reg); | 198 | readl(reg); |
199 | spin_unlock_irqrestore(&qdev->hw_lock, hw_flags); | 199 | spin_unlock_irqrestore(&qdev->hw_lock, hw_flags); |
200 | return; | 200 | return; |
201 | } | 201 | } |
202 | 202 | ||
203 | static void ql_write_common_reg(struct ql3_adapter *qdev, | 203 | static void ql_write_common_reg(struct ql3_adapter *qdev, |
204 | u32 * reg, u32 value) | 204 | u32 __iomem *reg, u32 value) |
205 | { | 205 | { |
206 | writel(value, (u32 *) reg); | 206 | writel(value, reg); |
207 | readl(reg); | 207 | readl(reg); |
208 | return; | 208 | return; |
209 | } | 209 | } |
210 | 210 | ||
211 | static void ql_write_page0_reg(struct ql3_adapter *qdev, | 211 | static void ql_write_page0_reg(struct ql3_adapter *qdev, |
212 | u32 * reg, u32 value) | 212 | u32 __iomem *reg, u32 value) |
213 | { | 213 | { |
214 | if (qdev->current_page != 0) | 214 | if (qdev->current_page != 0) |
215 | ql_set_register_page(qdev,0); | 215 | ql_set_register_page(qdev,0); |
216 | writel(value, (u32 *) reg); | 216 | writel(value, reg); |
217 | readl(reg); | 217 | readl(reg); |
218 | return; | 218 | return; |
219 | } | 219 | } |
@@ -222,11 +222,11 @@ static void ql_write_page0_reg(struct ql3_adapter *qdev, | |||
222 | * Caller holds hw_lock. Only called during init. | 222 | * Caller holds hw_lock. Only called during init. |
223 | */ | 223 | */ |
224 | static void ql_write_page1_reg(struct ql3_adapter *qdev, | 224 | static void ql_write_page1_reg(struct ql3_adapter *qdev, |
225 | u32 * reg, u32 value) | 225 | u32 __iomem *reg, u32 value) |
226 | { | 226 | { |
227 | if (qdev->current_page != 1) | 227 | if (qdev->current_page != 1) |
228 | ql_set_register_page(qdev,1); | 228 | ql_set_register_page(qdev,1); |
229 | writel(value, (u32 *) reg); | 229 | writel(value, reg); |
230 | readl(reg); | 230 | readl(reg); |
231 | return; | 231 | return; |
232 | } | 232 | } |
@@ -235,11 +235,11 @@ static void ql_write_page1_reg(struct ql3_adapter *qdev, | |||
235 | * Caller holds hw_lock. Only called during init. | 235 | * Caller holds hw_lock. Only called during init. |
236 | */ | 236 | */ |
237 | static void ql_write_page2_reg(struct ql3_adapter *qdev, | 237 | static void ql_write_page2_reg(struct ql3_adapter *qdev, |
238 | u32 * reg, u32 value) | 238 | u32 __iomem *reg, u32 value) |
239 | { | 239 | { |
240 | if (qdev->current_page != 2) | 240 | if (qdev->current_page != 2) |
241 | ql_set_register_page(qdev,2); | 241 | ql_set_register_page(qdev,2); |
242 | writel(value, (u32 *) reg); | 242 | writel(value, reg); |
243 | readl(reg); | 243 | readl(reg); |
244 | return; | 244 | return; |
245 | } | 245 | } |
@@ -1687,7 +1687,7 @@ static void ql_update_lrg_bufq_prod_index(struct ql3_adapter *qdev) | |||
1687 | qdev->lrg_buf_next_free = lrg_buf_q_ele; | 1687 | qdev->lrg_buf_next_free = lrg_buf_q_ele; |
1688 | 1688 | ||
1689 | ql_write_common_reg(qdev, | 1689 | ql_write_common_reg(qdev, |
1690 | (u32 *) & port_regs->CommonRegs. | 1690 | &port_regs->CommonRegs. |
1691 | rxLargeQProducerIndex, | 1691 | rxLargeQProducerIndex, |
1692 | qdev->lrg_buf_q_producer_index); | 1692 | qdev->lrg_buf_q_producer_index); |
1693 | } | 1693 | } |
@@ -1924,13 +1924,13 @@ static int ql_tx_rx_clean(struct ql3_adapter *qdev, | |||
1924 | } | 1924 | } |
1925 | 1925 | ||
1926 | ql_write_common_reg(qdev, | 1926 | ql_write_common_reg(qdev, |
1927 | (u32 *) & port_regs->CommonRegs. | 1927 | &port_regs->CommonRegs. |
1928 | rxSmallQProducerIndex, | 1928 | rxSmallQProducerIndex, |
1929 | qdev->small_buf_q_producer_index); | 1929 | qdev->small_buf_q_producer_index); |
1930 | } | 1930 | } |
1931 | 1931 | ||
1932 | ql_write_common_reg(qdev, | 1932 | ql_write_common_reg(qdev, |
1933 | (u32 *) & port_regs->CommonRegs.rspQConsumerIndex, | 1933 | &port_regs->CommonRegs.rspQConsumerIndex, |
1934 | qdev->rsp_consumer_index); | 1934 | qdev->rsp_consumer_index); |
1935 | spin_unlock_irqrestore(&qdev->hw_lock, hw_flags); | 1935 | spin_unlock_irqrestore(&qdev->hw_lock, hw_flags); |
1936 | 1936 | ||
@@ -2057,7 +2057,7 @@ static int ql3xxx_send(struct sk_buff *skb, struct net_device *ndev) | |||
2057 | qdev->req_producer_index = 0; | 2057 | qdev->req_producer_index = 0; |
2058 | wmb(); | 2058 | wmb(); |
2059 | ql_write_common_reg_l(qdev, | 2059 | ql_write_common_reg_l(qdev, |
2060 | (u32 *) & port_regs->CommonRegs.reqQProducerIndex, | 2060 | &port_regs->CommonRegs.reqQProducerIndex, |
2061 | qdev->req_producer_index); | 2061 | qdev->req_producer_index); |
2062 | 2062 | ||
2063 | ndev->trans_start = jiffies; | 2063 | ndev->trans_start = jiffies; |
@@ -2474,8 +2474,8 @@ static void ql_free_mem_resources(struct ql3_adapter *qdev) | |||
2474 | 2474 | ||
2475 | static int ql_init_misc_registers(struct ql3_adapter *qdev) | 2475 | static int ql_init_misc_registers(struct ql3_adapter *qdev) |
2476 | { | 2476 | { |
2477 | struct ql3xxx_local_ram_registers *local_ram = | 2477 | struct ql3xxx_local_ram_registers __iomem *local_ram = |
2478 | (struct ql3xxx_local_ram_registers *)qdev->mem_map_registers; | 2478 | (void __iomem *)qdev->mem_map_registers; |
2479 | 2479 | ||
2480 | if(ql_sem_spinlock(qdev, QL_DDR_RAM_SEM_MASK, | 2480 | if(ql_sem_spinlock(qdev, QL_DDR_RAM_SEM_MASK, |
2481 | (QL_RESOURCE_BITS_BASE_CODE | (qdev->mac_index) * | 2481 | (QL_RESOURCE_BITS_BASE_CODE | (qdev->mac_index) * |
@@ -2535,7 +2535,7 @@ static int ql_adapter_initialize(struct ql3_adapter *qdev) | |||
2535 | u32 value; | 2535 | u32 value; |
2536 | struct ql3xxx_port_registers __iomem *port_regs = qdev->mem_map_registers; | 2536 | struct ql3xxx_port_registers __iomem *port_regs = qdev->mem_map_registers; |
2537 | struct ql3xxx_host_memory_registers __iomem *hmem_regs = | 2537 | struct ql3xxx_host_memory_registers __iomem *hmem_regs = |
2538 | (struct ql3xxx_host_memory_registers *)port_regs; | 2538 | (void __iomem *)port_regs; |
2539 | u32 delay = 10; | 2539 | u32 delay = 10; |
2540 | int status = 0; | 2540 | int status = 0; |
2541 | 2541 | ||
@@ -2640,11 +2640,11 @@ static int ql_adapter_initialize(struct ql3_adapter *qdev) | |||
2640 | qdev->lrg_buf_free_tail = NULL; | 2640 | qdev->lrg_buf_free_tail = NULL; |
2641 | 2641 | ||
2642 | ql_write_common_reg(qdev, | 2642 | ql_write_common_reg(qdev, |
2643 | (u32 *) & port_regs->CommonRegs. | 2643 | &port_regs->CommonRegs. |
2644 | rxSmallQProducerIndex, | 2644 | rxSmallQProducerIndex, |
2645 | qdev->small_buf_q_producer_index); | 2645 | qdev->small_buf_q_producer_index); |
2646 | ql_write_common_reg(qdev, | 2646 | ql_write_common_reg(qdev, |
2647 | (u32 *) & port_regs->CommonRegs. | 2647 | &port_regs->CommonRegs. |
2648 | rxLargeQProducerIndex, | 2648 | rxLargeQProducerIndex, |
2649 | qdev->lrg_buf_q_producer_index); | 2649 | qdev->lrg_buf_q_producer_index); |
2650 | 2650 | ||
@@ -2787,7 +2787,7 @@ static int ql_adapter_reset(struct ql3_adapter *qdev) | |||
2787 | "%s: Issue soft reset to chip.\n", | 2787 | "%s: Issue soft reset to chip.\n", |
2788 | qdev->ndev->name); | 2788 | qdev->ndev->name); |
2789 | ql_write_common_reg(qdev, | 2789 | ql_write_common_reg(qdev, |
2790 | (u32 *) & port_regs->CommonRegs.ispControlStatus, | 2790 | &port_regs->CommonRegs.ispControlStatus, |
2791 | ((ISP_CONTROL_SR << 16) | ISP_CONTROL_SR)); | 2791 | ((ISP_CONTROL_SR << 16) | ISP_CONTROL_SR)); |
2792 | 2792 | ||
2793 | /* Wait 3 seconds for reset to complete. */ | 2793 | /* Wait 3 seconds for reset to complete. */ |
@@ -2817,7 +2817,7 @@ static int ql_adapter_reset(struct ql3_adapter *qdev) | |||
2817 | printk(KERN_DEBUG PFX | 2817 | printk(KERN_DEBUG PFX |
2818 | "ql_adapter_reset: clearing RI after reset.\n"); | 2818 | "ql_adapter_reset: clearing RI after reset.\n"); |
2819 | ql_write_common_reg(qdev, | 2819 | ql_write_common_reg(qdev, |
2820 | (u32 *) & port_regs->CommonRegs. | 2820 | &port_regs->CommonRegs. |
2821 | ispControlStatus, | 2821 | ispControlStatus, |
2822 | ((ISP_CONTROL_RI << 16) | ISP_CONTROL_RI)); | 2822 | ((ISP_CONTROL_RI << 16) | ISP_CONTROL_RI)); |
2823 | } | 2823 | } |
@@ -2825,7 +2825,7 @@ static int ql_adapter_reset(struct ql3_adapter *qdev) | |||
2825 | if (max_wait_time == 0) { | 2825 | if (max_wait_time == 0) { |
2826 | /* Issue Force Soft Reset */ | 2826 | /* Issue Force Soft Reset */ |
2827 | ql_write_common_reg(qdev, | 2827 | ql_write_common_reg(qdev, |
2828 | (u32 *) & port_regs->CommonRegs. | 2828 | &port_regs->CommonRegs. |
2829 | ispControlStatus, | 2829 | ispControlStatus, |
2830 | ((ISP_CONTROL_FSR << 16) | | 2830 | ((ISP_CONTROL_FSR << 16) | |
2831 | ISP_CONTROL_FSR)); | 2831 | ISP_CONTROL_FSR)); |
@@ -3243,8 +3243,7 @@ static void ql_reset_work(struct ql3_adapter *qdev) | |||
3243 | "%s: clearing NRI after reset.\n", | 3243 | "%s: clearing NRI after reset.\n", |
3244 | qdev->ndev->name); | 3244 | qdev->ndev->name); |
3245 | ql_write_common_reg(qdev, | 3245 | ql_write_common_reg(qdev, |
3246 | (u32 *) & | 3246 | &port_regs-> |
3247 | port_regs-> | ||
3248 | CommonRegs. | 3247 | CommonRegs. |
3249 | ispControlStatus, | 3248 | ispControlStatus, |
3250 | ((ISP_CONTROL_RI << | 3249 | ((ISP_CONTROL_RI << |
@@ -3509,7 +3508,7 @@ static void __devexit ql3xxx_remove(struct pci_dev *pdev) | |||
3509 | qdev->workqueue = NULL; | 3508 | qdev->workqueue = NULL; |
3510 | } | 3509 | } |
3511 | 3510 | ||
3512 | iounmap((void *)qdev->mmap_virt_base); | 3511 | iounmap(qdev->mmap_virt_base); |
3513 | pci_release_regions(pdev); | 3512 | pci_release_regions(pdev); |
3514 | pci_set_drvdata(pdev, NULL); | 3513 | pci_set_drvdata(pdev, NULL); |
3515 | free_netdev(ndev); | 3514 | free_netdev(ndev); |
diff --git a/drivers/net/qla3xxx.h b/drivers/net/qla3xxx.h index 9492cee6b083..65da2c0bfda6 100644 --- a/drivers/net/qla3xxx.h +++ b/drivers/net/qla3xxx.h | |||
@@ -1093,7 +1093,7 @@ struct ql3_adapter { | |||
1093 | spinlock_t hw_lock; | 1093 | spinlock_t hw_lock; |
1094 | 1094 | ||
1095 | /* PCI Bus Relative Register Addresses */ | 1095 | /* PCI Bus Relative Register Addresses */ |
1096 | u8 *mmap_virt_base; /* stores return value from ioremap() */ | 1096 | u8 __iomem *mmap_virt_base; /* stores return value from ioremap() */ |
1097 | struct ql3xxx_port_registers __iomem *mem_map_registers; | 1097 | struct ql3xxx_port_registers __iomem *mem_map_registers; |
1098 | u32 current_page; /* tracks current register page */ | 1098 | u32 current_page; /* tracks current register page */ |
1099 | 1099 | ||