diff options
Diffstat (limited to 'drivers/net/qla3xxx.c')
-rw-r--r-- | drivers/net/qla3xxx.c | 72 |
1 files changed, 33 insertions, 39 deletions
diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c index 4ef0afbcbe1b..54ebb65ada18 100644 --- a/drivers/net/qla3xxx.c +++ b/drivers/net/qla3xxx.c | |||
@@ -222,7 +222,6 @@ static void ql_write_common_reg_l(struct ql3_adapter *qdev, | |||
222 | writel(value, reg); | 222 | writel(value, reg); |
223 | readl(reg); | 223 | readl(reg); |
224 | spin_unlock_irqrestore(&qdev->hw_lock, hw_flags); | 224 | spin_unlock_irqrestore(&qdev->hw_lock, hw_flags); |
225 | return; | ||
226 | } | 225 | } |
227 | 226 | ||
228 | static void ql_write_common_reg(struct ql3_adapter *qdev, | 227 | static void ql_write_common_reg(struct ql3_adapter *qdev, |
@@ -230,7 +229,6 @@ static void ql_write_common_reg(struct ql3_adapter *qdev, | |||
230 | { | 229 | { |
231 | writel(value, reg); | 230 | writel(value, reg); |
232 | readl(reg); | 231 | readl(reg); |
233 | return; | ||
234 | } | 232 | } |
235 | 233 | ||
236 | static void ql_write_nvram_reg(struct ql3_adapter *qdev, | 234 | static void ql_write_nvram_reg(struct ql3_adapter *qdev, |
@@ -239,7 +237,6 @@ static void ql_write_nvram_reg(struct ql3_adapter *qdev, | |||
239 | writel(value, reg); | 237 | writel(value, reg); |
240 | readl(reg); | 238 | readl(reg); |
241 | udelay(1); | 239 | udelay(1); |
242 | return; | ||
243 | } | 240 | } |
244 | 241 | ||
245 | static void ql_write_page0_reg(struct ql3_adapter *qdev, | 242 | static void ql_write_page0_reg(struct ql3_adapter *qdev, |
@@ -249,7 +246,6 @@ static void ql_write_page0_reg(struct ql3_adapter *qdev, | |||
249 | ql_set_register_page(qdev,0); | 246 | ql_set_register_page(qdev,0); |
250 | writel(value, reg); | 247 | writel(value, reg); |
251 | readl(reg); | 248 | readl(reg); |
252 | return; | ||
253 | } | 249 | } |
254 | 250 | ||
255 | /* | 251 | /* |
@@ -262,7 +258,6 @@ static void ql_write_page1_reg(struct ql3_adapter *qdev, | |||
262 | ql_set_register_page(qdev,1); | 258 | ql_set_register_page(qdev,1); |
263 | writel(value, reg); | 259 | writel(value, reg); |
264 | readl(reg); | 260 | readl(reg); |
265 | return; | ||
266 | } | 261 | } |
267 | 262 | ||
268 | /* | 263 | /* |
@@ -275,7 +270,6 @@ static void ql_write_page2_reg(struct ql3_adapter *qdev, | |||
275 | ql_set_register_page(qdev,2); | 270 | ql_set_register_page(qdev,2); |
276 | writel(value, reg); | 271 | writel(value, reg); |
277 | readl(reg); | 272 | readl(reg); |
278 | return; | ||
279 | } | 273 | } |
280 | 274 | ||
281 | static void ql_disable_interrupts(struct ql3_adapter *qdev) | 275 | static void ql_disable_interrupts(struct ql3_adapter *qdev) |
@@ -343,8 +337,8 @@ static void ql_release_to_lrg_buf_free_list(struct ql3_adapter *qdev, | |||
343 | cpu_to_le32(LS_64BITS(map)); | 337 | cpu_to_le32(LS_64BITS(map)); |
344 | lrg_buf_cb->buf_phy_addr_high = | 338 | lrg_buf_cb->buf_phy_addr_high = |
345 | cpu_to_le32(MS_64BITS(map)); | 339 | cpu_to_le32(MS_64BITS(map)); |
346 | pci_unmap_addr_set(lrg_buf_cb, mapaddr, map); | 340 | dma_unmap_addr_set(lrg_buf_cb, mapaddr, map); |
347 | pci_unmap_len_set(lrg_buf_cb, maplen, | 341 | dma_unmap_len_set(lrg_buf_cb, maplen, |
348 | qdev->lrg_buffer_len - | 342 | qdev->lrg_buffer_len - |
349 | QL_HEADER_SPACE); | 343 | QL_HEADER_SPACE); |
350 | } | 344 | } |
@@ -1924,8 +1918,8 @@ static int ql_populate_free_queue(struct ql3_adapter *qdev) | |||
1924 | cpu_to_le32(LS_64BITS(map)); | 1918 | cpu_to_le32(LS_64BITS(map)); |
1925 | lrg_buf_cb->buf_phy_addr_high = | 1919 | lrg_buf_cb->buf_phy_addr_high = |
1926 | cpu_to_le32(MS_64BITS(map)); | 1920 | cpu_to_le32(MS_64BITS(map)); |
1927 | pci_unmap_addr_set(lrg_buf_cb, mapaddr, map); | 1921 | dma_unmap_addr_set(lrg_buf_cb, mapaddr, map); |
1928 | pci_unmap_len_set(lrg_buf_cb, maplen, | 1922 | dma_unmap_len_set(lrg_buf_cb, maplen, |
1929 | qdev->lrg_buffer_len - | 1923 | qdev->lrg_buffer_len - |
1930 | QL_HEADER_SPACE); | 1924 | QL_HEADER_SPACE); |
1931 | --qdev->lrg_buf_skb_check; | 1925 | --qdev->lrg_buf_skb_check; |
@@ -2041,16 +2035,16 @@ static void ql_process_mac_tx_intr(struct ql3_adapter *qdev, | |||
2041 | } | 2035 | } |
2042 | 2036 | ||
2043 | pci_unmap_single(qdev->pdev, | 2037 | pci_unmap_single(qdev->pdev, |
2044 | pci_unmap_addr(&tx_cb->map[0], mapaddr), | 2038 | dma_unmap_addr(&tx_cb->map[0], mapaddr), |
2045 | pci_unmap_len(&tx_cb->map[0], maplen), | 2039 | dma_unmap_len(&tx_cb->map[0], maplen), |
2046 | PCI_DMA_TODEVICE); | 2040 | PCI_DMA_TODEVICE); |
2047 | tx_cb->seg_count--; | 2041 | tx_cb->seg_count--; |
2048 | if (tx_cb->seg_count) { | 2042 | if (tx_cb->seg_count) { |
2049 | for (i = 1; i < tx_cb->seg_count; i++) { | 2043 | for (i = 1; i < tx_cb->seg_count; i++) { |
2050 | pci_unmap_page(qdev->pdev, | 2044 | pci_unmap_page(qdev->pdev, |
2051 | pci_unmap_addr(&tx_cb->map[i], | 2045 | dma_unmap_addr(&tx_cb->map[i], |
2052 | mapaddr), | 2046 | mapaddr), |
2053 | pci_unmap_len(&tx_cb->map[i], maplen), | 2047 | dma_unmap_len(&tx_cb->map[i], maplen), |
2054 | PCI_DMA_TODEVICE); | 2048 | PCI_DMA_TODEVICE); |
2055 | } | 2049 | } |
2056 | } | 2050 | } |
@@ -2119,8 +2113,8 @@ static void ql_process_mac_rx_intr(struct ql3_adapter *qdev, | |||
2119 | 2113 | ||
2120 | skb_put(skb, length); | 2114 | skb_put(skb, length); |
2121 | pci_unmap_single(qdev->pdev, | 2115 | pci_unmap_single(qdev->pdev, |
2122 | pci_unmap_addr(lrg_buf_cb2, mapaddr), | 2116 | dma_unmap_addr(lrg_buf_cb2, mapaddr), |
2123 | pci_unmap_len(lrg_buf_cb2, maplen), | 2117 | dma_unmap_len(lrg_buf_cb2, maplen), |
2124 | PCI_DMA_FROMDEVICE); | 2118 | PCI_DMA_FROMDEVICE); |
2125 | prefetch(skb->data); | 2119 | prefetch(skb->data); |
2126 | skb->ip_summed = CHECKSUM_NONE; | 2120 | skb->ip_summed = CHECKSUM_NONE; |
@@ -2165,8 +2159,8 @@ static void ql_process_macip_rx_intr(struct ql3_adapter *qdev, | |||
2165 | 2159 | ||
2166 | skb_put(skb2, length); /* Just the second buffer length here. */ | 2160 | skb_put(skb2, length); /* Just the second buffer length here. */ |
2167 | pci_unmap_single(qdev->pdev, | 2161 | pci_unmap_single(qdev->pdev, |
2168 | pci_unmap_addr(lrg_buf_cb2, mapaddr), | 2162 | dma_unmap_addr(lrg_buf_cb2, mapaddr), |
2169 | pci_unmap_len(lrg_buf_cb2, maplen), | 2163 | dma_unmap_len(lrg_buf_cb2, maplen), |
2170 | PCI_DMA_FROMDEVICE); | 2164 | PCI_DMA_FROMDEVICE); |
2171 | prefetch(skb2->data); | 2165 | prefetch(skb2->data); |
2172 | 2166 | ||
@@ -2258,7 +2252,7 @@ static int ql_tx_rx_clean(struct ql3_adapter *qdev, | |||
2258 | "%x.\n", | 2252 | "%x.\n", |
2259 | ndev->name, net_rsp->opcode); | 2253 | ndev->name, net_rsp->opcode); |
2260 | printk(KERN_ERR PFX | 2254 | printk(KERN_ERR PFX |
2261 | "0x%08lx 0x%08lx 0x%08lx 0x%08lx \n", | 2255 | "0x%08lx 0x%08lx 0x%08lx 0x%08lx\n", |
2262 | (unsigned long int)tmp[0], | 2256 | (unsigned long int)tmp[0], |
2263 | (unsigned long int)tmp[1], | 2257 | (unsigned long int)tmp[1], |
2264 | (unsigned long int)tmp[2], | 2258 | (unsigned long int)tmp[2], |
@@ -2454,8 +2448,8 @@ static int ql_send_map(struct ql3_adapter *qdev, | |||
2454 | oal_entry->dma_lo = cpu_to_le32(LS_64BITS(map)); | 2448 | oal_entry->dma_lo = cpu_to_le32(LS_64BITS(map)); |
2455 | oal_entry->dma_hi = cpu_to_le32(MS_64BITS(map)); | 2449 | oal_entry->dma_hi = cpu_to_le32(MS_64BITS(map)); |
2456 | oal_entry->len = cpu_to_le32(len); | 2450 | oal_entry->len = cpu_to_le32(len); |
2457 | pci_unmap_addr_set(&tx_cb->map[seg], mapaddr, map); | 2451 | dma_unmap_addr_set(&tx_cb->map[seg], mapaddr, map); |
2458 | pci_unmap_len_set(&tx_cb->map[seg], maplen, len); | 2452 | dma_unmap_len_set(&tx_cb->map[seg], maplen, len); |
2459 | seg++; | 2453 | seg++; |
2460 | 2454 | ||
2461 | if (seg_cnt == 1) { | 2455 | if (seg_cnt == 1) { |
@@ -2488,9 +2482,9 @@ static int ql_send_map(struct ql3_adapter *qdev, | |||
2488 | oal_entry->len = | 2482 | oal_entry->len = |
2489 | cpu_to_le32(sizeof(struct oal) | | 2483 | cpu_to_le32(sizeof(struct oal) | |
2490 | OAL_CONT_ENTRY); | 2484 | OAL_CONT_ENTRY); |
2491 | pci_unmap_addr_set(&tx_cb->map[seg], mapaddr, | 2485 | dma_unmap_addr_set(&tx_cb->map[seg], mapaddr, |
2492 | map); | 2486 | map); |
2493 | pci_unmap_len_set(&tx_cb->map[seg], maplen, | 2487 | dma_unmap_len_set(&tx_cb->map[seg], maplen, |
2494 | sizeof(struct oal)); | 2488 | sizeof(struct oal)); |
2495 | oal_entry = (struct oal_entry *)oal; | 2489 | oal_entry = (struct oal_entry *)oal; |
2496 | oal++; | 2490 | oal++; |
@@ -2512,8 +2506,8 @@ static int ql_send_map(struct ql3_adapter *qdev, | |||
2512 | oal_entry->dma_lo = cpu_to_le32(LS_64BITS(map)); | 2506 | oal_entry->dma_lo = cpu_to_le32(LS_64BITS(map)); |
2513 | oal_entry->dma_hi = cpu_to_le32(MS_64BITS(map)); | 2507 | oal_entry->dma_hi = cpu_to_le32(MS_64BITS(map)); |
2514 | oal_entry->len = cpu_to_le32(frag->size); | 2508 | oal_entry->len = cpu_to_le32(frag->size); |
2515 | pci_unmap_addr_set(&tx_cb->map[seg], mapaddr, map); | 2509 | dma_unmap_addr_set(&tx_cb->map[seg], mapaddr, map); |
2516 | pci_unmap_len_set(&tx_cb->map[seg], maplen, | 2510 | dma_unmap_len_set(&tx_cb->map[seg], maplen, |
2517 | frag->size); | 2511 | frag->size); |
2518 | } | 2512 | } |
2519 | /* Terminate the last segment. */ | 2513 | /* Terminate the last segment. */ |
@@ -2539,22 +2533,22 @@ map_error: | |||
2539 | (seg == 12 && seg_cnt > 13) || /* but necessary. */ | 2533 | (seg == 12 && seg_cnt > 13) || /* but necessary. */ |
2540 | (seg == 17 && seg_cnt > 18)) { | 2534 | (seg == 17 && seg_cnt > 18)) { |
2541 | pci_unmap_single(qdev->pdev, | 2535 | pci_unmap_single(qdev->pdev, |
2542 | pci_unmap_addr(&tx_cb->map[seg], mapaddr), | 2536 | dma_unmap_addr(&tx_cb->map[seg], mapaddr), |
2543 | pci_unmap_len(&tx_cb->map[seg], maplen), | 2537 | dma_unmap_len(&tx_cb->map[seg], maplen), |
2544 | PCI_DMA_TODEVICE); | 2538 | PCI_DMA_TODEVICE); |
2545 | oal++; | 2539 | oal++; |
2546 | seg++; | 2540 | seg++; |
2547 | } | 2541 | } |
2548 | 2542 | ||
2549 | pci_unmap_page(qdev->pdev, | 2543 | pci_unmap_page(qdev->pdev, |
2550 | pci_unmap_addr(&tx_cb->map[seg], mapaddr), | 2544 | dma_unmap_addr(&tx_cb->map[seg], mapaddr), |
2551 | pci_unmap_len(&tx_cb->map[seg], maplen), | 2545 | dma_unmap_len(&tx_cb->map[seg], maplen), |
2552 | PCI_DMA_TODEVICE); | 2546 | PCI_DMA_TODEVICE); |
2553 | } | 2547 | } |
2554 | 2548 | ||
2555 | pci_unmap_single(qdev->pdev, | 2549 | pci_unmap_single(qdev->pdev, |
2556 | pci_unmap_addr(&tx_cb->map[0], mapaddr), | 2550 | dma_unmap_addr(&tx_cb->map[0], mapaddr), |
2557 | pci_unmap_addr(&tx_cb->map[0], maplen), | 2551 | dma_unmap_addr(&tx_cb->map[0], maplen), |
2558 | PCI_DMA_TODEVICE); | 2552 | PCI_DMA_TODEVICE); |
2559 | 2553 | ||
2560 | return NETDEV_TX_BUSY; | 2554 | return NETDEV_TX_BUSY; |
@@ -2841,8 +2835,8 @@ static void ql_free_large_buffers(struct ql3_adapter *qdev) | |||
2841 | if (lrg_buf_cb->skb) { | 2835 | if (lrg_buf_cb->skb) { |
2842 | dev_kfree_skb(lrg_buf_cb->skb); | 2836 | dev_kfree_skb(lrg_buf_cb->skb); |
2843 | pci_unmap_single(qdev->pdev, | 2837 | pci_unmap_single(qdev->pdev, |
2844 | pci_unmap_addr(lrg_buf_cb, mapaddr), | 2838 | dma_unmap_addr(lrg_buf_cb, mapaddr), |
2845 | pci_unmap_len(lrg_buf_cb, maplen), | 2839 | dma_unmap_len(lrg_buf_cb, maplen), |
2846 | PCI_DMA_FROMDEVICE); | 2840 | PCI_DMA_FROMDEVICE); |
2847 | memset(lrg_buf_cb, 0, sizeof(struct ql_rcv_buf_cb)); | 2841 | memset(lrg_buf_cb, 0, sizeof(struct ql_rcv_buf_cb)); |
2848 | } else { | 2842 | } else { |
@@ -2912,8 +2906,8 @@ static int ql_alloc_large_buffers(struct ql3_adapter *qdev) | |||
2912 | return -ENOMEM; | 2906 | return -ENOMEM; |
2913 | } | 2907 | } |
2914 | 2908 | ||
2915 | pci_unmap_addr_set(lrg_buf_cb, mapaddr, map); | 2909 | dma_unmap_addr_set(lrg_buf_cb, mapaddr, map); |
2916 | pci_unmap_len_set(lrg_buf_cb, maplen, | 2910 | dma_unmap_len_set(lrg_buf_cb, maplen, |
2917 | qdev->lrg_buffer_len - | 2911 | qdev->lrg_buffer_len - |
2918 | QL_HEADER_SPACE); | 2912 | QL_HEADER_SPACE); |
2919 | lrg_buf_cb->buf_phy_addr_low = | 2913 | lrg_buf_cb->buf_phy_addr_low = |
@@ -3793,13 +3787,13 @@ static void ql_reset_work(struct work_struct *work) | |||
3793 | "%s: Freeing lost SKB.\n", | 3787 | "%s: Freeing lost SKB.\n", |
3794 | qdev->ndev->name); | 3788 | qdev->ndev->name); |
3795 | pci_unmap_single(qdev->pdev, | 3789 | pci_unmap_single(qdev->pdev, |
3796 | pci_unmap_addr(&tx_cb->map[0], mapaddr), | 3790 | dma_unmap_addr(&tx_cb->map[0], mapaddr), |
3797 | pci_unmap_len(&tx_cb->map[0], maplen), | 3791 | dma_unmap_len(&tx_cb->map[0], maplen), |
3798 | PCI_DMA_TODEVICE); | 3792 | PCI_DMA_TODEVICE); |
3799 | for(j=1;j<tx_cb->seg_count;j++) { | 3793 | for(j=1;j<tx_cb->seg_count;j++) { |
3800 | pci_unmap_page(qdev->pdev, | 3794 | pci_unmap_page(qdev->pdev, |
3801 | pci_unmap_addr(&tx_cb->map[j],mapaddr), | 3795 | dma_unmap_addr(&tx_cb->map[j],mapaddr), |
3802 | pci_unmap_len(&tx_cb->map[j],maplen), | 3796 | dma_unmap_len(&tx_cb->map[j],maplen), |
3803 | PCI_DMA_TODEVICE); | 3797 | PCI_DMA_TODEVICE); |
3804 | } | 3798 | } |
3805 | dev_kfree_skb(tx_cb->skb); | 3799 | dev_kfree_skb(tx_cb->skb); |