.. | .. |
---|
75 | 75 | #include <linux/tcp.h> |
---|
76 | 76 | #include <linux/uaccess.h> |
---|
77 | 77 | #include <linux/io.h> |
---|
| 78 | +#include <linux/io-64-nonatomic-lo-hi.h> |
---|
78 | 79 | #include <linux/slab.h> |
---|
79 | 80 | #include <linux/prefetch.h> |
---|
80 | 81 | #include <net/tcp.h> |
---|
.. | .. |
---|
491 | 492 | }; |
---|
492 | 493 | |
---|
493 | 494 | /* A simplifier macro used both by init and free shared_mem Fns(). */ |
---|
494 | | -#define TXD_MEM_PAGE_CNT(len, per_each) ((len+per_each - 1) / per_each) |
---|
| 495 | +#define TXD_MEM_PAGE_CNT(len, per_each) DIV_ROUND_UP(len, per_each) |
---|
495 | 496 | |
---|
496 | 497 | /* netqueue manipulation helper functions */ |
---|
497 | 498 | static inline void s2io_stop_all_tx_queue(struct s2io_nic *sp) |
---|
.. | .. |
---|
639 | 640 | int k = 0; |
---|
640 | 641 | dma_addr_t tmp_p; |
---|
641 | 642 | void *tmp_v; |
---|
642 | | - tmp_v = pci_alloc_consistent(nic->pdev, |
---|
643 | | - PAGE_SIZE, &tmp_p); |
---|
| 643 | + tmp_v = dma_alloc_coherent(&nic->pdev->dev, PAGE_SIZE, |
---|
| 644 | + &tmp_p, GFP_KERNEL); |
---|
644 | 645 | if (!tmp_v) { |
---|
645 | 646 | DBG_PRINT(INFO_DBG, |
---|
646 | | - "pci_alloc_consistent failed for TxDL\n"); |
---|
| 647 | + "dma_alloc_coherent failed for TxDL\n"); |
---|
647 | 648 | return -ENOMEM; |
---|
648 | 649 | } |
---|
649 | 650 | /* If we got a zero DMA address(can happen on |
---|
.. | .. |
---|
657 | 658 | "%s: Zero DMA address for TxDL. " |
---|
658 | 659 | "Virtual address %p\n", |
---|
659 | 660 | dev->name, tmp_v); |
---|
660 | | - tmp_v = pci_alloc_consistent(nic->pdev, |
---|
661 | | - PAGE_SIZE, &tmp_p); |
---|
| 661 | + tmp_v = dma_alloc_coherent(&nic->pdev->dev, |
---|
| 662 | + PAGE_SIZE, &tmp_p, |
---|
| 663 | + GFP_KERNEL); |
---|
662 | 664 | if (!tmp_v) { |
---|
663 | 665 | DBG_PRINT(INFO_DBG, |
---|
664 | | - "pci_alloc_consistent failed for TxDL\n"); |
---|
| 666 | + "dma_alloc_coherent failed for TxDL\n"); |
---|
665 | 667 | return -ENOMEM; |
---|
666 | 668 | } |
---|
667 | 669 | mem_allocated += PAGE_SIZE; |
---|
.. | .. |
---|
733 | 735 | |
---|
734 | 736 | rx_blocks = &ring->rx_blocks[j]; |
---|
735 | 737 | size = SIZE_OF_BLOCK; /* size is always page size */ |
---|
736 | | - tmp_v_addr = pci_alloc_consistent(nic->pdev, size, |
---|
737 | | - &tmp_p_addr); |
---|
| 738 | + tmp_v_addr = dma_alloc_coherent(&nic->pdev->dev, size, |
---|
| 739 | + &tmp_p_addr, GFP_KERNEL); |
---|
738 | 740 | if (tmp_v_addr == NULL) { |
---|
739 | 741 | /* |
---|
740 | 742 | * In case of failure, free_shared_mem() |
---|
.. | .. |
---|
746 | 748 | return -ENOMEM; |
---|
747 | 749 | } |
---|
748 | 750 | mem_allocated += size; |
---|
749 | | - memset(tmp_v_addr, 0, size); |
---|
750 | 751 | |
---|
751 | 752 | size = sizeof(struct rxd_info) * |
---|
752 | 753 | rxd_count[nic->rxd_mode]; |
---|
.. | .. |
---|
835 | 836 | /* Allocation and initialization of Statistics block */ |
---|
836 | 837 | size = sizeof(struct stat_block); |
---|
837 | 838 | mac_control->stats_mem = |
---|
838 | | - pci_alloc_consistent(nic->pdev, size, |
---|
839 | | - &mac_control->stats_mem_phy); |
---|
| 839 | + dma_alloc_coherent(&nic->pdev->dev, size, |
---|
| 840 | + &mac_control->stats_mem_phy, GFP_KERNEL); |
---|
840 | 841 | |
---|
841 | 842 | if (!mac_control->stats_mem) { |
---|
842 | 843 | /* |
---|
.. | .. |
---|
906 | 907 | fli = &fifo->list_info[mem_blks]; |
---|
907 | 908 | if (!fli->list_virt_addr) |
---|
908 | 909 | break; |
---|
909 | | - pci_free_consistent(nic->pdev, PAGE_SIZE, |
---|
910 | | - fli->list_virt_addr, |
---|
911 | | - fli->list_phy_addr); |
---|
| 910 | + dma_free_coherent(&nic->pdev->dev, PAGE_SIZE, |
---|
| 911 | + fli->list_virt_addr, |
---|
| 912 | + fli->list_phy_addr); |
---|
912 | 913 | swstats->mem_freed += PAGE_SIZE; |
---|
913 | 914 | } |
---|
914 | 915 | /* If we got a zero DMA address during allocation, |
---|
915 | 916 | * free the page now |
---|
916 | 917 | */ |
---|
917 | 918 | if (mac_control->zerodma_virt_addr) { |
---|
918 | | - pci_free_consistent(nic->pdev, PAGE_SIZE, |
---|
919 | | - mac_control->zerodma_virt_addr, |
---|
920 | | - (dma_addr_t)0); |
---|
| 919 | + dma_free_coherent(&nic->pdev->dev, PAGE_SIZE, |
---|
| 920 | + mac_control->zerodma_virt_addr, |
---|
| 921 | + (dma_addr_t)0); |
---|
921 | 922 | DBG_PRINT(INIT_DBG, |
---|
922 | 923 | "%s: Freeing TxDL with zero DMA address. " |
---|
923 | 924 | "Virtual address %p\n", |
---|
.. | .. |
---|
939 | 940 | tmp_p_addr = ring->rx_blocks[j].block_dma_addr; |
---|
940 | 941 | if (tmp_v_addr == NULL) |
---|
941 | 942 | break; |
---|
942 | | - pci_free_consistent(nic->pdev, size, |
---|
943 | | - tmp_v_addr, tmp_p_addr); |
---|
| 943 | + dma_free_coherent(&nic->pdev->dev, size, tmp_v_addr, |
---|
| 944 | + tmp_p_addr); |
---|
944 | 945 | swstats->mem_freed += size; |
---|
945 | 946 | kfree(ring->rx_blocks[j].rxds); |
---|
946 | 947 | swstats->mem_freed += sizeof(struct rxd_info) * |
---|
.. | .. |
---|
993 | 994 | |
---|
994 | 995 | if (mac_control->stats_mem) { |
---|
995 | 996 | swstats->mem_freed += mac_control->stats_mem_sz; |
---|
996 | | - pci_free_consistent(nic->pdev, |
---|
997 | | - mac_control->stats_mem_sz, |
---|
998 | | - mac_control->stats_mem, |
---|
999 | | - mac_control->stats_mem_phy); |
---|
| 997 | + dma_free_coherent(&nic->pdev->dev, mac_control->stats_mem_sz, |
---|
| 998 | + mac_control->stats_mem, |
---|
| 999 | + mac_control->stats_mem_phy); |
---|
1000 | 1000 | } |
---|
1001 | 1001 | } |
---|
1002 | 1002 | |
---|
1003 | | -/** |
---|
| 1003 | +/* |
---|
1004 | 1004 | * s2io_verify_pci_mode - |
---|
1005 | 1005 | */ |
---|
1006 | 1006 | |
---|
.. | .. |
---|
1035 | 1035 | } |
---|
1036 | 1036 | |
---|
1037 | 1037 | static int bus_speed[8] = {33, 133, 133, 200, 266, 133, 200, 266}; |
---|
1038 | | -/** |
---|
| 1038 | +/* |
---|
1039 | 1039 | * s2io_print_pci_mode - |
---|
1040 | 1040 | */ |
---|
1041 | 1041 | static int s2io_print_pci_mode(struct s2io_nic *nic) |
---|
.. | .. |
---|
2064 | 2064 | |
---|
2065 | 2065 | /** |
---|
2066 | 2066 | * verify_pcc_quiescent- Checks for PCC quiescent state |
---|
| 2067 | + * @sp : private member of the device structure, which is a pointer to the |
---|
| 2068 | + * s2io_nic structure. |
---|
| 2069 | + * @flag: boolean controlling function path |
---|
2067 | 2070 | * Return: 1 If PCC is quiescence |
---|
2068 | 2071 | * 0 If PCC is not quiescence |
---|
2069 | 2072 | */ |
---|
.. | .. |
---|
2099 | 2102 | } |
---|
2100 | 2103 | /** |
---|
2101 | 2104 | * verify_xena_quiescence - Checks whether the H/W is ready |
---|
| 2105 | + * @sp : private member of the device structure, which is a pointer to the |
---|
| 2106 | + * s2io_nic structure. |
---|
2102 | 2107 | * Description: Returns whether the H/W is ready to go or not. Depending |
---|
2103 | 2108 | * on whether adapter enable bit was written or not the comparison |
---|
2104 | 2109 | * differs and the calling function passes the input argument flag to |
---|
.. | .. |
---|
2305 | 2310 | } |
---|
2306 | 2311 | /** |
---|
2307 | 2312 | * s2io_txdl_getskb - Get the skb from txdl, unmap and return skb |
---|
| 2313 | + * @fifo_data: fifo data pointer |
---|
| 2314 | + * @txdlp: descriptor |
---|
| 2315 | + * @get_off: unused |
---|
2308 | 2316 | */ |
---|
2309 | 2317 | static struct sk_buff *s2io_txdl_getskb(struct fifo_info *fifo_data, |
---|
2310 | 2318 | struct TxD *txdlp, int get_off) |
---|
.. | .. |
---|
2316 | 2324 | |
---|
2317 | 2325 | txds = txdlp; |
---|
2318 | 2326 | if (txds->Host_Control == (u64)(long)fifo_data->ufo_in_band_v) { |
---|
2319 | | - pci_unmap_single(nic->pdev, (dma_addr_t)txds->Buffer_Pointer, |
---|
2320 | | - sizeof(u64), PCI_DMA_TODEVICE); |
---|
| 2327 | + dma_unmap_single(&nic->pdev->dev, |
---|
| 2328 | + (dma_addr_t)txds->Buffer_Pointer, |
---|
| 2329 | + sizeof(u64), DMA_TO_DEVICE); |
---|
2321 | 2330 | txds++; |
---|
2322 | 2331 | } |
---|
2323 | 2332 | |
---|
.. | .. |
---|
2326 | 2335 | memset(txdlp, 0, (sizeof(struct TxD) * fifo_data->max_txds)); |
---|
2327 | 2336 | return NULL; |
---|
2328 | 2337 | } |
---|
2329 | | - pci_unmap_single(nic->pdev, (dma_addr_t)txds->Buffer_Pointer, |
---|
2330 | | - skb_headlen(skb), PCI_DMA_TODEVICE); |
---|
| 2338 | + dma_unmap_single(&nic->pdev->dev, (dma_addr_t)txds->Buffer_Pointer, |
---|
| 2339 | + skb_headlen(skb), DMA_TO_DEVICE); |
---|
2331 | 2340 | frg_cnt = skb_shinfo(skb)->nr_frags; |
---|
2332 | 2341 | if (frg_cnt) { |
---|
2333 | 2342 | txds++; |
---|
.. | .. |
---|
2335 | 2344 | const skb_frag_t *frag = &skb_shinfo(skb)->frags[j]; |
---|
2336 | 2345 | if (!txds->Buffer_Pointer) |
---|
2337 | 2346 | break; |
---|
2338 | | - pci_unmap_page(nic->pdev, |
---|
| 2347 | + dma_unmap_page(&nic->pdev->dev, |
---|
2339 | 2348 | (dma_addr_t)txds->Buffer_Pointer, |
---|
2340 | | - skb_frag_size(frag), PCI_DMA_TODEVICE); |
---|
| 2349 | + skb_frag_size(frag), DMA_TO_DEVICE); |
---|
2341 | 2350 | } |
---|
2342 | 2351 | } |
---|
2343 | 2352 | memset(txdlp, 0, (sizeof(struct TxD) * fifo_data->max_txds)); |
---|
.. | .. |
---|
2375 | 2384 | skb = s2io_txdl_getskb(&mac_control->fifos[i], txdp, j); |
---|
2376 | 2385 | if (skb) { |
---|
2377 | 2386 | swstats->mem_freed += skb->truesize; |
---|
2378 | | - dev_kfree_skb(skb); |
---|
| 2387 | + dev_kfree_skb_irq(skb); |
---|
2379 | 2388 | cnt++; |
---|
2380 | 2389 | } |
---|
2381 | 2390 | } |
---|
.. | .. |
---|
2390 | 2399 | |
---|
2391 | 2400 | /** |
---|
2392 | 2401 | * stop_nic - To stop the nic |
---|
2393 | | - * @nic ; device private variable. |
---|
| 2402 | + * @nic : device private variable. |
---|
2394 | 2403 | * Description: |
---|
2395 | 2404 | * This function does exactly the opposite of what the start_nic() |
---|
2396 | 2405 | * function does. This function is called to stop the device. |
---|
.. | .. |
---|
2418 | 2427 | |
---|
2419 | 2428 | /** |
---|
2420 | 2429 | * fill_rx_buffers - Allocates the Rx side skbs |
---|
2421 | | - * @ring_info: per ring structure |
---|
| 2430 | + * @nic : device private variable. |
---|
| 2431 | + * @ring: per ring structure |
---|
2422 | 2432 | * @from_card_up: If this is true, we will map the buffer to get |
---|
2423 | 2433 | * the dma address for buf0 and buf1 to give it to the card. |
---|
2424 | 2434 | * Else we will sync the already mapped buffer to give it to the card. |
---|
.. | .. |
---|
2521 | 2531 | memset(rxdp, 0, sizeof(struct RxD1)); |
---|
2522 | 2532 | skb_reserve(skb, NET_IP_ALIGN); |
---|
2523 | 2533 | rxdp1->Buffer0_ptr = |
---|
2524 | | - pci_map_single(ring->pdev, skb->data, |
---|
| 2534 | + dma_map_single(&ring->pdev->dev, skb->data, |
---|
2525 | 2535 | size - NET_IP_ALIGN, |
---|
2526 | | - PCI_DMA_FROMDEVICE); |
---|
2527 | | - if (pci_dma_mapping_error(nic->pdev, |
---|
2528 | | - rxdp1->Buffer0_ptr)) |
---|
| 2536 | + DMA_FROM_DEVICE); |
---|
| 2537 | + if (dma_mapping_error(&nic->pdev->dev, rxdp1->Buffer0_ptr)) |
---|
2529 | 2538 | goto pci_map_failed; |
---|
2530 | 2539 | |
---|
2531 | 2540 | rxdp->Control_2 = |
---|
.. | .. |
---|
2557 | 2566 | |
---|
2558 | 2567 | if (from_card_up) { |
---|
2559 | 2568 | rxdp3->Buffer0_ptr = |
---|
2560 | | - pci_map_single(ring->pdev, ba->ba_0, |
---|
2561 | | - BUF0_LEN, |
---|
2562 | | - PCI_DMA_FROMDEVICE); |
---|
2563 | | - if (pci_dma_mapping_error(nic->pdev, |
---|
2564 | | - rxdp3->Buffer0_ptr)) |
---|
| 2569 | + dma_map_single(&ring->pdev->dev, |
---|
| 2570 | + ba->ba_0, BUF0_LEN, |
---|
| 2571 | + DMA_FROM_DEVICE); |
---|
| 2572 | + if (dma_mapping_error(&nic->pdev->dev, rxdp3->Buffer0_ptr)) |
---|
2565 | 2573 | goto pci_map_failed; |
---|
2566 | 2574 | } else |
---|
2567 | | - pci_dma_sync_single_for_device(ring->pdev, |
---|
2568 | | - (dma_addr_t)rxdp3->Buffer0_ptr, |
---|
2569 | | - BUF0_LEN, |
---|
2570 | | - PCI_DMA_FROMDEVICE); |
---|
| 2575 | + dma_sync_single_for_device(&ring->pdev->dev, |
---|
| 2576 | + (dma_addr_t)rxdp3->Buffer0_ptr, |
---|
| 2577 | + BUF0_LEN, |
---|
| 2578 | + DMA_FROM_DEVICE); |
---|
2571 | 2579 | |
---|
2572 | 2580 | rxdp->Control_2 = SET_BUFFER0_SIZE_3(BUF0_LEN); |
---|
2573 | 2581 | if (ring->rxd_mode == RXD_MODE_3B) { |
---|
.. | .. |
---|
2577 | 2585 | * Buffer2 will have L3/L4 header plus |
---|
2578 | 2586 | * L4 payload |
---|
2579 | 2587 | */ |
---|
2580 | | - rxdp3->Buffer2_ptr = pci_map_single(ring->pdev, |
---|
| 2588 | + rxdp3->Buffer2_ptr = dma_map_single(&ring->pdev->dev, |
---|
2581 | 2589 | skb->data, |
---|
2582 | 2590 | ring->mtu + 4, |
---|
2583 | | - PCI_DMA_FROMDEVICE); |
---|
| 2591 | + DMA_FROM_DEVICE); |
---|
2584 | 2592 | |
---|
2585 | | - if (pci_dma_mapping_error(nic->pdev, |
---|
2586 | | - rxdp3->Buffer2_ptr)) |
---|
| 2593 | + if (dma_mapping_error(&nic->pdev->dev, rxdp3->Buffer2_ptr)) |
---|
2587 | 2594 | goto pci_map_failed; |
---|
2588 | 2595 | |
---|
2589 | 2596 | if (from_card_up) { |
---|
2590 | 2597 | rxdp3->Buffer1_ptr = |
---|
2591 | | - pci_map_single(ring->pdev, |
---|
| 2598 | + dma_map_single(&ring->pdev->dev, |
---|
2592 | 2599 | ba->ba_1, |
---|
2593 | 2600 | BUF1_LEN, |
---|
2594 | | - PCI_DMA_FROMDEVICE); |
---|
| 2601 | + DMA_FROM_DEVICE); |
---|
2595 | 2602 | |
---|
2596 | | - if (pci_dma_mapping_error(nic->pdev, |
---|
2597 | | - rxdp3->Buffer1_ptr)) { |
---|
2598 | | - pci_unmap_single(ring->pdev, |
---|
| 2603 | + if (dma_mapping_error(&nic->pdev->dev, |
---|
| 2604 | + rxdp3->Buffer1_ptr)) { |
---|
| 2605 | + dma_unmap_single(&ring->pdev->dev, |
---|
2599 | 2606 | (dma_addr_t)(unsigned long) |
---|
2600 | 2607 | skb->data, |
---|
2601 | 2608 | ring->mtu + 4, |
---|
2602 | | - PCI_DMA_FROMDEVICE); |
---|
| 2609 | + DMA_FROM_DEVICE); |
---|
2603 | 2610 | goto pci_map_failed; |
---|
2604 | 2611 | } |
---|
2605 | 2612 | } |
---|
.. | .. |
---|
2668 | 2675 | continue; |
---|
2669 | 2676 | if (sp->rxd_mode == RXD_MODE_1) { |
---|
2670 | 2677 | rxdp1 = (struct RxD1 *)rxdp; |
---|
2671 | | - pci_unmap_single(sp->pdev, |
---|
| 2678 | + dma_unmap_single(&sp->pdev->dev, |
---|
2672 | 2679 | (dma_addr_t)rxdp1->Buffer0_ptr, |
---|
2673 | 2680 | dev->mtu + |
---|
2674 | 2681 | HEADER_ETHERNET_II_802_3_SIZE + |
---|
2675 | 2682 | HEADER_802_2_SIZE + HEADER_SNAP_SIZE, |
---|
2676 | | - PCI_DMA_FROMDEVICE); |
---|
| 2683 | + DMA_FROM_DEVICE); |
---|
2677 | 2684 | memset(rxdp, 0, sizeof(struct RxD1)); |
---|
2678 | 2685 | } else if (sp->rxd_mode == RXD_MODE_3B) { |
---|
2679 | 2686 | rxdp3 = (struct RxD3 *)rxdp; |
---|
2680 | | - pci_unmap_single(sp->pdev, |
---|
| 2687 | + dma_unmap_single(&sp->pdev->dev, |
---|
2681 | 2688 | (dma_addr_t)rxdp3->Buffer0_ptr, |
---|
2682 | | - BUF0_LEN, |
---|
2683 | | - PCI_DMA_FROMDEVICE); |
---|
2684 | | - pci_unmap_single(sp->pdev, |
---|
| 2689 | + BUF0_LEN, DMA_FROM_DEVICE); |
---|
| 2690 | + dma_unmap_single(&sp->pdev->dev, |
---|
2685 | 2691 | (dma_addr_t)rxdp3->Buffer1_ptr, |
---|
2686 | | - BUF1_LEN, |
---|
2687 | | - PCI_DMA_FROMDEVICE); |
---|
2688 | | - pci_unmap_single(sp->pdev, |
---|
| 2692 | + BUF1_LEN, DMA_FROM_DEVICE); |
---|
| 2693 | + dma_unmap_single(&sp->pdev->dev, |
---|
2689 | 2694 | (dma_addr_t)rxdp3->Buffer2_ptr, |
---|
2690 | | - dev->mtu + 4, |
---|
2691 | | - PCI_DMA_FROMDEVICE); |
---|
| 2695 | + dev->mtu + 4, DMA_FROM_DEVICE); |
---|
2692 | 2696 | memset(rxdp, 0, sizeof(struct RxD3)); |
---|
2693 | 2697 | } |
---|
2694 | 2698 | swstats->mem_freed += skb->truesize; |
---|
.. | .. |
---|
2869 | 2873 | |
---|
2870 | 2874 | /** |
---|
2871 | 2875 | * rx_intr_handler - Rx interrupt handler |
---|
2872 | | - * @ring_info: per ring structure. |
---|
| 2876 | + * @ring_data: per ring structure. |
---|
2873 | 2877 | * @budget: budget for napi processing. |
---|
2874 | 2878 | * Description: |
---|
2875 | 2879 | * If the interrupt is because of a received frame or if the |
---|
.. | .. |
---|
2919 | 2923 | } |
---|
2920 | 2924 | if (ring_data->rxd_mode == RXD_MODE_1) { |
---|
2921 | 2925 | rxdp1 = (struct RxD1 *)rxdp; |
---|
2922 | | - pci_unmap_single(ring_data->pdev, (dma_addr_t) |
---|
2923 | | - rxdp1->Buffer0_ptr, |
---|
| 2926 | + dma_unmap_single(&ring_data->pdev->dev, |
---|
| 2927 | + (dma_addr_t)rxdp1->Buffer0_ptr, |
---|
2924 | 2928 | ring_data->mtu + |
---|
2925 | 2929 | HEADER_ETHERNET_II_802_3_SIZE + |
---|
2926 | 2930 | HEADER_802_2_SIZE + |
---|
2927 | 2931 | HEADER_SNAP_SIZE, |
---|
2928 | | - PCI_DMA_FROMDEVICE); |
---|
| 2932 | + DMA_FROM_DEVICE); |
---|
2929 | 2933 | } else if (ring_data->rxd_mode == RXD_MODE_3B) { |
---|
2930 | 2934 | rxdp3 = (struct RxD3 *)rxdp; |
---|
2931 | | - pci_dma_sync_single_for_cpu(ring_data->pdev, |
---|
2932 | | - (dma_addr_t)rxdp3->Buffer0_ptr, |
---|
2933 | | - BUF0_LEN, |
---|
2934 | | - PCI_DMA_FROMDEVICE); |
---|
2935 | | - pci_unmap_single(ring_data->pdev, |
---|
| 2935 | + dma_sync_single_for_cpu(&ring_data->pdev->dev, |
---|
| 2936 | + (dma_addr_t)rxdp3->Buffer0_ptr, |
---|
| 2937 | + BUF0_LEN, DMA_FROM_DEVICE); |
---|
| 2938 | + dma_unmap_single(&ring_data->pdev->dev, |
---|
2936 | 2939 | (dma_addr_t)rxdp3->Buffer2_ptr, |
---|
2937 | | - ring_data->mtu + 4, |
---|
2938 | | - PCI_DMA_FROMDEVICE); |
---|
| 2940 | + ring_data->mtu + 4, DMA_FROM_DEVICE); |
---|
2939 | 2941 | } |
---|
2940 | 2942 | prefetch(skb->data); |
---|
2941 | 2943 | rx_osm_handler(ring_data, rxdp); |
---|
.. | .. |
---|
2979 | 2981 | |
---|
2980 | 2982 | /** |
---|
2981 | 2983 | * tx_intr_handler - Transmit interrupt handler |
---|
2982 | | - * @nic : device private variable |
---|
| 2984 | + * @fifo_data : fifo data pointer |
---|
2983 | 2985 | * Description: |
---|
2984 | 2986 | * If an interrupt was raised to indicate DMA complete of the |
---|
2985 | 2987 | * Tx packet, this function is called. It identifies the last TxD |
---|
.. | .. |
---|
3054 | 3056 | |
---|
3055 | 3057 | /* Updating the statistics block */ |
---|
3056 | 3058 | swstats->mem_freed += skb->truesize; |
---|
3057 | | - dev_kfree_skb_irq(skb); |
---|
| 3059 | + dev_consume_skb_irq(skb); |
---|
3058 | 3060 | |
---|
3059 | 3061 | get_info.offset++; |
---|
3060 | 3062 | if (get_info.offset == get_info.fifo_len + 1) |
---|
.. | .. |
---|
3160 | 3162 | /** |
---|
3161 | 3163 | * s2io_chk_xpak_counter - Function to check the status of the xpak counters |
---|
3162 | 3164 | * @counter : counter value to be updated |
---|
| 3165 | + * @regs_stat : registers status |
---|
| 3166 | + * @index : index |
---|
3163 | 3167 | * @flag : flag to indicate the status |
---|
3164 | 3168 | * @type : counter type |
---|
3165 | 3169 | * Description: |
---|
.. | .. |
---|
3316 | 3320 | |
---|
3317 | 3321 | /** |
---|
3318 | 3322 | * wait_for_cmd_complete - waits for a command to complete. |
---|
3319 | | - * @sp : private member of the device structure, which is a pointer to the |
---|
3320 | | - * s2io_nic structure. |
---|
| 3323 | + * @addr: address |
---|
| 3324 | + * @busy_bit: bit to check for busy |
---|
| 3325 | + * @bit_state: state to check |
---|
3321 | 3326 | * Description: Function that waits for a command to Write into RMAC |
---|
3322 | 3327 | * ADDR DATA registers to be completed and returns either success or |
---|
3323 | 3328 | * error depending on whether the command was complete or not. |
---|
.. | .. |
---|
3679 | 3684 | writeq(nic->msix_info[i].data, &bar0->xmsi_data); |
---|
3680 | 3685 | val64 = (s2BIT(7) | s2BIT(15) | vBIT(msix_index, 26, 6)); |
---|
3681 | 3686 | writeq(val64, &bar0->xmsi_access); |
---|
3682 | | - if (wait_for_msix_trans(nic, msix_index)) { |
---|
| 3687 | + if (wait_for_msix_trans(nic, msix_index)) |
---|
3683 | 3688 | DBG_PRINT(ERR_DBG, "%s: index: %d failed\n", |
---|
3684 | 3689 | __func__, msix_index); |
---|
3685 | | - continue; |
---|
3686 | | - } |
---|
3687 | 3690 | } |
---|
3688 | 3691 | } |
---|
3689 | 3692 | |
---|
.. | .. |
---|
4119 | 4122 | } |
---|
4120 | 4123 | |
---|
4121 | 4124 | frg_len = skb_headlen(skb); |
---|
4122 | | - txdp->Buffer_Pointer = pci_map_single(sp->pdev, skb->data, |
---|
4123 | | - frg_len, PCI_DMA_TODEVICE); |
---|
4124 | | - if (pci_dma_mapping_error(sp->pdev, txdp->Buffer_Pointer)) |
---|
| 4125 | + txdp->Buffer_Pointer = dma_map_single(&sp->pdev->dev, skb->data, |
---|
| 4126 | + frg_len, DMA_TO_DEVICE); |
---|
| 4127 | + if (dma_mapping_error(&sp->pdev->dev, txdp->Buffer_Pointer)) |
---|
4125 | 4128 | goto pci_map_failed; |
---|
4126 | 4129 | |
---|
4127 | 4130 | txdp->Host_Control = (unsigned long)skb; |
---|
.. | .. |
---|
4153 | 4156 | val64 |= TX_FIFO_SPECIAL_FUNC; |
---|
4154 | 4157 | |
---|
4155 | 4158 | writeq(val64, &tx_fifo->List_Control); |
---|
4156 | | - |
---|
4157 | | - mmiowb(); |
---|
4158 | 4159 | |
---|
4159 | 4160 | put_off++; |
---|
4160 | 4161 | if (put_off == fifo->tx_curr_put_info.fifo_len + 1) |
---|
.. | .. |
---|
4346 | 4347 | |
---|
4347 | 4348 | /** |
---|
4348 | 4349 | * s2io_handle_errors - Xframe error indication handler |
---|
4349 | | - * @nic: device private variable |
---|
| 4350 | + * @dev_id: opaque handle to dev |
---|
4350 | 4351 | * Description: Handle alarms such as loss of link, single or |
---|
4351 | 4352 | * double ECC errors, critical and serious errors. |
---|
4352 | 4353 | * Return Value: |
---|
.. | .. |
---|
4750 | 4751 | return IRQ_HANDLED; |
---|
4751 | 4752 | } |
---|
4752 | 4753 | |
---|
4753 | | -/** |
---|
| 4754 | +/* |
---|
4754 | 4755 | * s2io_updt_stats - |
---|
4755 | 4756 | */ |
---|
4756 | 4757 | static void s2io_updt_stats(struct s2io_nic *sp) |
---|
.. | .. |
---|
5159 | 5160 | /* read mac entries from CAM */ |
---|
5160 | 5161 | static u64 do_s2io_read_unicast_mc(struct s2io_nic *sp, int offset) |
---|
5161 | 5162 | { |
---|
5162 | | - u64 tmp64 = 0xffffffffffff0000ULL, val64; |
---|
| 5163 | + u64 tmp64, val64; |
---|
5163 | 5164 | struct XENA_dev_config __iomem *bar0 = sp->bar0; |
---|
5164 | 5165 | |
---|
5165 | 5166 | /* read mac addr */ |
---|
.. | .. |
---|
5179 | 5180 | return tmp64 >> 16; |
---|
5180 | 5181 | } |
---|
5181 | 5182 | |
---|
5182 | | -/** |
---|
| 5183 | +/* |
---|
5183 | 5184 | * s2io_set_mac_addr - driver entry point |
---|
5184 | 5185 | */ |
---|
5185 | 5186 | |
---|
.. | .. |
---|
5254 | 5255 | |
---|
5255 | 5256 | /** |
---|
5256 | 5257 | * s2io_ethtool_set_link_ksettings - Sets different link parameters. |
---|
5257 | | - * @sp : private member of the device structure, which is a pointer to the |
---|
5258 | | - * s2io_nic structure. |
---|
| 5258 | + * @dev : pointer to netdev |
---|
5259 | 5259 | * @cmd: pointer to the structure with parameters given by ethtool to set |
---|
5260 | 5260 | * link information. |
---|
5261 | 5261 | * Description: |
---|
.. | .. |
---|
5284 | 5284 | |
---|
5285 | 5285 | /** |
---|
5286 | 5286 | * s2io_ethtol_get_link_ksettings - Return link specific information. |
---|
5287 | | - * @sp : private member of the device structure, pointer to the |
---|
5288 | | - * s2io_nic structure. |
---|
| 5287 | + * @dev: pointer to netdev |
---|
5289 | 5288 | * @cmd : pointer to the structure with parameters given by ethtool |
---|
5290 | 5289 | * to return link information. |
---|
5291 | 5290 | * Description: |
---|
.. | .. |
---|
5324 | 5323 | |
---|
5325 | 5324 | /** |
---|
5326 | 5325 | * s2io_ethtool_gdrvinfo - Returns driver specific information. |
---|
5327 | | - * @sp : private member of the device structure, which is a pointer to the |
---|
5328 | | - * s2io_nic structure. |
---|
| 5326 | + * @dev: pointer to netdev |
---|
5329 | 5327 | * @info : pointer to the structure with parameters given by ethtool to |
---|
5330 | 5328 | * return driver information. |
---|
5331 | 5329 | * Description: |
---|
.. | .. |
---|
5346 | 5344 | |
---|
5347 | 5345 | /** |
---|
5348 | 5346 | * s2io_ethtool_gregs - dumps the entire space of Xfame into the buffer. |
---|
5349 | | - * @sp: private member of the device structure, which is a pointer to the |
---|
5350 | | - * s2io_nic structure. |
---|
| 5347 | + * @dev: pointer to netdev |
---|
5351 | 5348 | * @regs : pointer to the structure with parameters given by ethtool for |
---|
5352 | | - * dumping the registers. |
---|
5353 | | - * @reg_space: The input argument into which all the registers are dumped. |
---|
| 5349 | + * dumping the registers. |
---|
| 5350 | + * @space: The input argument into which all the registers are dumped. |
---|
5354 | 5351 | * Description: |
---|
5355 | 5352 | * Dumps the entire register space of xFrame NIC into the user given |
---|
5356 | 5353 | * buffer area. |
---|
.. | .. |
---|
5482 | 5479 | |
---|
5483 | 5480 | /** |
---|
5484 | 5481 | * s2io_ethtool_getpause_data -Pause frame frame generation and reception. |
---|
5485 | | - * @sp : private member of the device structure, which is a pointer to the |
---|
5486 | | - * s2io_nic structure. |
---|
| 5482 | + * @dev: pointer to netdev |
---|
5487 | 5483 | * @ep : pointer to the structure with pause parameters given by ethtool. |
---|
5488 | 5484 | * Description: |
---|
5489 | 5485 | * Returns the Pause frame generation and reception capability of the NIC. |
---|
.. | .. |
---|
5507 | 5503 | |
---|
5508 | 5504 | /** |
---|
5509 | 5505 | * s2io_ethtool_setpause_data - set/reset pause frame generation. |
---|
5510 | | - * @sp : private member of the device structure, which is a pointer to the |
---|
5511 | | - * s2io_nic structure. |
---|
| 5506 | + * @dev: pointer to netdev |
---|
5512 | 5507 | * @ep : pointer to the structure with pause parameters given by ethtool. |
---|
5513 | 5508 | * Description: |
---|
5514 | 5509 | * It can be used to set or reset Pause frame generation or reception |
---|
.. | .. |
---|
5537 | 5532 | return 0; |
---|
5538 | 5533 | } |
---|
5539 | 5534 | |
---|
| 5535 | +#define S2IO_DEV_ID 5 |
---|
5540 | 5536 | /** |
---|
5541 | 5537 | * read_eeprom - reads 4 bytes of data from user given offset. |
---|
5542 | 5538 | * @sp : private member of the device structure, which is a pointer to the |
---|
.. | .. |
---|
5552 | 5548 | * Return value: |
---|
5553 | 5549 | * -1 on failure and 0 on success. |
---|
5554 | 5550 | */ |
---|
5555 | | - |
---|
5556 | | -#define S2IO_DEV_ID 5 |
---|
5557 | 5551 | static int read_eeprom(struct s2io_nic *sp, int off, u64 *data) |
---|
5558 | 5552 | { |
---|
5559 | 5553 | int ret = -1; |
---|
.. | .. |
---|
5745 | 5739 | |
---|
5746 | 5740 | /** |
---|
5747 | 5741 | * s2io_ethtool_geeprom - reads the value stored in the Eeprom. |
---|
5748 | | - * @sp : private member of the device structure, which is a pointer to the |
---|
5749 | | - * s2io_nic structure. |
---|
| 5742 | + * @dev: pointer to netdev |
---|
5750 | 5743 | * @eeprom : pointer to the user level structure provided by ethtool, |
---|
5751 | 5744 | * containing all relevant information. |
---|
5752 | 5745 | * @data_buf : user defined value to be written into Eeprom. |
---|
.. | .. |
---|
5782 | 5775 | |
---|
5783 | 5776 | /** |
---|
5784 | 5777 | * s2io_ethtool_seeprom - tries to write the user provided value in Eeprom |
---|
5785 | | - * @sp : private member of the device structure, which is a pointer to the |
---|
5786 | | - * s2io_nic structure. |
---|
| 5778 | + * @dev: pointer to netdev |
---|
5787 | 5779 | * @eeprom : pointer to the user level structure provided by ethtool, |
---|
5788 | 5780 | * containing all relevant information. |
---|
5789 | | - * @data_buf ; user defined value to be written into Eeprom. |
---|
| 5781 | + * @data_buf : user defined value to be written into Eeprom. |
---|
5790 | 5782 | * Description: |
---|
5791 | 5783 | * Tries to write the user provided value in the Eeprom, at the offset |
---|
5792 | 5784 | * given by the user. |
---|
.. | .. |
---|
6038 | 6030 | |
---|
6039 | 6031 | /** |
---|
6040 | 6032 | * s2io_link_test - verifies the link state of the nic |
---|
6041 | | - * @sp ; private member of the device structure, which is a pointer to the |
---|
| 6033 | + * @sp: private member of the device structure, which is a pointer to the |
---|
6042 | 6034 | * s2io_nic structure. |
---|
6043 | 6035 | * @data: variable that returns the result of each of the test conducted by |
---|
6044 | 6036 | * the driver. |
---|
.. | .. |
---|
6161 | 6153 | |
---|
6162 | 6154 | /** |
---|
6163 | 6155 | * s2io_ethtool_test - conducts 6 tsets to determine the health of card. |
---|
6164 | | - * @sp : private member of the device structure, which is a pointer to the |
---|
6165 | | - * s2io_nic structure. |
---|
| 6156 | + * @dev: pointer to netdev |
---|
6166 | 6157 | * @ethtest : pointer to a ethtool command specific structure that will be |
---|
6167 | 6158 | * returned to the user. |
---|
6168 | 6159 | * @data : variable that returns the result of each of the test |
---|
.. | .. |
---|
6608 | 6599 | /** |
---|
6609 | 6600 | * s2io_ioctl - Entry point for the Ioctl |
---|
6610 | 6601 | * @dev : Device pointer. |
---|
6611 | | - * @ifr : An IOCTL specefic structure, that can contain a pointer to |
---|
| 6602 | + * @rq : An IOCTL specefic structure, that can contain a pointer to |
---|
6612 | 6603 | * a proprietary structure used to pass information to the driver. |
---|
6613 | 6604 | * @cmd : This is used to distinguish between the different commands that |
---|
6614 | 6605 | * can be passed to the IOCTL functions. |
---|
.. | .. |
---|
6661 | 6652 | |
---|
6662 | 6653 | /** |
---|
6663 | 6654 | * s2io_set_link - Set the LInk status |
---|
6664 | | - * @data: long pointer to device private structue |
---|
| 6655 | + * @work: work struct containing a pointer to device private structue |
---|
6665 | 6656 | * Description: Sets the link status for the adapter |
---|
6666 | 6657 | */ |
---|
6667 | 6658 | |
---|
.. | .. |
---|
6776 | 6767 | * Host Control is NULL |
---|
6777 | 6768 | */ |
---|
6778 | 6769 | rxdp1->Buffer0_ptr = *temp0 = |
---|
6779 | | - pci_map_single(sp->pdev, (*skb)->data, |
---|
| 6770 | + dma_map_single(&sp->pdev->dev, (*skb)->data, |
---|
6780 | 6771 | size - NET_IP_ALIGN, |
---|
6781 | | - PCI_DMA_FROMDEVICE); |
---|
6782 | | - if (pci_dma_mapping_error(sp->pdev, rxdp1->Buffer0_ptr)) |
---|
| 6772 | + DMA_FROM_DEVICE); |
---|
| 6773 | + if (dma_mapping_error(&sp->pdev->dev, rxdp1->Buffer0_ptr)) |
---|
6783 | 6774 | goto memalloc_failed; |
---|
6784 | 6775 | rxdp->Host_Control = (unsigned long) (*skb); |
---|
6785 | 6776 | } |
---|
.. | .. |
---|
6802 | 6793 | } |
---|
6803 | 6794 | stats->mem_allocated += (*skb)->truesize; |
---|
6804 | 6795 | rxdp3->Buffer2_ptr = *temp2 = |
---|
6805 | | - pci_map_single(sp->pdev, (*skb)->data, |
---|
6806 | | - dev->mtu + 4, |
---|
6807 | | - PCI_DMA_FROMDEVICE); |
---|
6808 | | - if (pci_dma_mapping_error(sp->pdev, rxdp3->Buffer2_ptr)) |
---|
| 6796 | + dma_map_single(&sp->pdev->dev, (*skb)->data, |
---|
| 6797 | + dev->mtu + 4, DMA_FROM_DEVICE); |
---|
| 6798 | + if (dma_mapping_error(&sp->pdev->dev, rxdp3->Buffer2_ptr)) |
---|
6809 | 6799 | goto memalloc_failed; |
---|
6810 | 6800 | rxdp3->Buffer0_ptr = *temp0 = |
---|
6811 | | - pci_map_single(sp->pdev, ba->ba_0, BUF0_LEN, |
---|
6812 | | - PCI_DMA_FROMDEVICE); |
---|
6813 | | - if (pci_dma_mapping_error(sp->pdev, |
---|
6814 | | - rxdp3->Buffer0_ptr)) { |
---|
6815 | | - pci_unmap_single(sp->pdev, |
---|
| 6801 | + dma_map_single(&sp->pdev->dev, ba->ba_0, |
---|
| 6802 | + BUF0_LEN, DMA_FROM_DEVICE); |
---|
| 6803 | + if (dma_mapping_error(&sp->pdev->dev, rxdp3->Buffer0_ptr)) { |
---|
| 6804 | + dma_unmap_single(&sp->pdev->dev, |
---|
6816 | 6805 | (dma_addr_t)rxdp3->Buffer2_ptr, |
---|
6817 | 6806 | dev->mtu + 4, |
---|
6818 | | - PCI_DMA_FROMDEVICE); |
---|
| 6807 | + DMA_FROM_DEVICE); |
---|
6819 | 6808 | goto memalloc_failed; |
---|
6820 | 6809 | } |
---|
6821 | 6810 | rxdp->Host_Control = (unsigned long) (*skb); |
---|
6822 | 6811 | |
---|
6823 | 6812 | /* Buffer-1 will be dummy buffer not used */ |
---|
6824 | 6813 | rxdp3->Buffer1_ptr = *temp1 = |
---|
6825 | | - pci_map_single(sp->pdev, ba->ba_1, BUF1_LEN, |
---|
6826 | | - PCI_DMA_FROMDEVICE); |
---|
6827 | | - if (pci_dma_mapping_error(sp->pdev, |
---|
6828 | | - rxdp3->Buffer1_ptr)) { |
---|
6829 | | - pci_unmap_single(sp->pdev, |
---|
| 6814 | + dma_map_single(&sp->pdev->dev, ba->ba_1, |
---|
| 6815 | + BUF1_LEN, DMA_FROM_DEVICE); |
---|
| 6816 | + if (dma_mapping_error(&sp->pdev->dev, rxdp3->Buffer1_ptr)) { |
---|
| 6817 | + dma_unmap_single(&sp->pdev->dev, |
---|
6830 | 6818 | (dma_addr_t)rxdp3->Buffer0_ptr, |
---|
6831 | | - BUF0_LEN, PCI_DMA_FROMDEVICE); |
---|
6832 | | - pci_unmap_single(sp->pdev, |
---|
| 6819 | + BUF0_LEN, DMA_FROM_DEVICE); |
---|
| 6820 | + dma_unmap_single(&sp->pdev->dev, |
---|
6833 | 6821 | (dma_addr_t)rxdp3->Buffer2_ptr, |
---|
6834 | 6822 | dev->mtu + 4, |
---|
6835 | | - PCI_DMA_FROMDEVICE); |
---|
| 6823 | + DMA_FROM_DEVICE); |
---|
6836 | 6824 | goto memalloc_failed; |
---|
6837 | 6825 | } |
---|
6838 | 6826 | } |
---|
.. | .. |
---|
7126 | 7114 | if (ret) { |
---|
7127 | 7115 | DBG_PRINT(ERR_DBG, "%s: Out of memory in Open\n", |
---|
7128 | 7116 | dev->name); |
---|
7129 | | - s2io_reset(sp); |
---|
7130 | | - free_rx_buffers(sp); |
---|
7131 | | - return -ENOMEM; |
---|
| 7117 | + ret = -ENOMEM; |
---|
| 7118 | + goto err_fill_buff; |
---|
7132 | 7119 | } |
---|
7133 | 7120 | DBG_PRINT(INFO_DBG, "Buf in ring:%d is %d:\n", i, |
---|
7134 | 7121 | ring->rx_bufs_left); |
---|
.. | .. |
---|
7166 | 7153 | /* Enable Rx Traffic and interrupts on the NIC */ |
---|
7167 | 7154 | if (start_nic(sp)) { |
---|
7168 | 7155 | DBG_PRINT(ERR_DBG, "%s: Starting NIC failed\n", dev->name); |
---|
7169 | | - s2io_reset(sp); |
---|
7170 | | - free_rx_buffers(sp); |
---|
7171 | | - return -ENODEV; |
---|
| 7156 | + ret = -ENODEV; |
---|
| 7157 | + goto err_out; |
---|
7172 | 7158 | } |
---|
7173 | 7159 | |
---|
7174 | 7160 | /* Add interrupt service routine */ |
---|
7175 | 7161 | if (s2io_add_isr(sp) != 0) { |
---|
7176 | 7162 | if (sp->config.intr_type == MSI_X) |
---|
7177 | 7163 | s2io_rem_isr(sp); |
---|
7178 | | - s2io_reset(sp); |
---|
7179 | | - free_rx_buffers(sp); |
---|
7180 | | - return -ENODEV; |
---|
| 7164 | + ret = -ENODEV; |
---|
| 7165 | + goto err_out; |
---|
7181 | 7166 | } |
---|
7182 | 7167 | |
---|
7183 | 7168 | timer_setup(&sp->alarm_timer, s2io_alarm_handle, 0); |
---|
.. | .. |
---|
7197 | 7182 | } |
---|
7198 | 7183 | |
---|
7199 | 7184 | return 0; |
---|
| 7185 | + |
---|
| 7186 | +err_out: |
---|
| 7187 | + if (config->napi) { |
---|
| 7188 | + if (config->intr_type == MSI_X) { |
---|
| 7189 | + for (i = 0; i < sp->config.rx_ring_num; i++) |
---|
| 7190 | + napi_disable(&sp->mac_control.rings[i].napi); |
---|
| 7191 | + } else { |
---|
| 7192 | + napi_disable(&sp->napi); |
---|
| 7193 | + } |
---|
| 7194 | + } |
---|
| 7195 | +err_fill_buff: |
---|
| 7196 | + s2io_reset(sp); |
---|
| 7197 | + free_rx_buffers(sp); |
---|
| 7198 | + return ret; |
---|
7200 | 7199 | } |
---|
7201 | 7200 | |
---|
7202 | 7201 | /** |
---|
7203 | 7202 | * s2io_restart_nic - Resets the NIC. |
---|
7204 | | - * @data : long pointer to the device private structure |
---|
| 7203 | + * @work : work struct containing a pointer to the device private structure |
---|
7205 | 7204 | * Description: |
---|
7206 | 7205 | * This function is scheduled to be run by the s2io_tx_watchdog |
---|
7207 | 7206 | * function after 0.5 secs to reset the NIC. The idea is to reduce |
---|
.. | .. |
---|
7232 | 7231 | /** |
---|
7233 | 7232 | * s2io_tx_watchdog - Watchdog for transmit side. |
---|
7234 | 7233 | * @dev : Pointer to net device structure |
---|
| 7234 | + * @txqueue: index of the hanging queue |
---|
7235 | 7235 | * Description: |
---|
7236 | 7236 | * This function is triggered if the Tx Queue is stopped |
---|
7237 | 7237 | * for a pre-defined amount of time when the Interface is still up. |
---|
.. | .. |
---|
7242 | 7242 | * void |
---|
7243 | 7243 | */ |
---|
7244 | 7244 | |
---|
7245 | | -static void s2io_tx_watchdog(struct net_device *dev) |
---|
| 7245 | +static void s2io_tx_watchdog(struct net_device *dev, unsigned int txqueue) |
---|
7246 | 7246 | { |
---|
7247 | 7247 | struct s2io_nic *sp = netdev_priv(dev); |
---|
7248 | 7248 | struct swStat *swstats = &sp->mac_control.stats_info->sw_stat; |
---|
.. | .. |
---|
7256 | 7256 | |
---|
7257 | 7257 | /** |
---|
7258 | 7258 | * rx_osm_handler - To perform some OS related operations on SKB. |
---|
7259 | | - * @sp: private member of the device structure,pointer to s2io_nic structure. |
---|
7260 | | - * @skb : the socket buffer pointer. |
---|
7261 | | - * @len : length of the packet |
---|
7262 | | - * @cksum : FCS checksum of the frame. |
---|
7263 | | - * @ring_no : the ring from which this RxD was extracted. |
---|
| 7259 | + * @ring_data : the ring from which this RxD was extracted. |
---|
| 7260 | + * @rxdp: descriptor |
---|
7264 | 7261 | * Description: |
---|
7265 | 7262 | * This function is called by the Rx interrupt serivce routine to perform |
---|
7266 | 7263 | * some OS related operations on the SKB before passing it to the upper |
---|
.. | .. |
---|
7280 | 7277 | int ring_no = ring_data->ring_no; |
---|
7281 | 7278 | u16 l3_csum, l4_csum; |
---|
7282 | 7279 | unsigned long long err = rxdp->Control_1 & RXD_T_CODE; |
---|
7283 | | - struct lro *uninitialized_var(lro); |
---|
| 7280 | + struct lro *lro; |
---|
7284 | 7281 | u8 err_mask; |
---|
7285 | 7282 | struct swStat *swstats = &sp->mac_control.stats_info->sw_stat; |
---|
7286 | 7283 | |
---|
.. | .. |
---|
7590 | 7587 | } |
---|
7591 | 7588 | |
---|
7592 | 7589 | /** |
---|
7593 | | - * rts_ds_steer - Receive traffic steering based on IPv4 or IPv6 TOS |
---|
7594 | | - * or Traffic class respectively. |
---|
| 7590 | + * rts_ds_steer - Receive traffic steering based on IPv4 or IPv6 TOS or Traffic class respectively. |
---|
7595 | 7591 | * @nic: device private variable |
---|
| 7592 | + * @ds_codepoint: data |
---|
| 7593 | + * @ring: ring index |
---|
7596 | 7594 | * Description: The function configures the receive steering to |
---|
7597 | 7595 | * desired receive ring. |
---|
7598 | 7596 | * Return Value: SUCCESS on success and |
---|
.. | .. |
---|
7679 | 7677 | return ret; |
---|
7680 | 7678 | } |
---|
7681 | 7679 | |
---|
7682 | | - if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) { |
---|
| 7680 | + if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(64))) { |
---|
7683 | 7681 | DBG_PRINT(INIT_DBG, "%s: Using 64bit DMA\n", __func__); |
---|
7684 | 7682 | dma_flag = true; |
---|
7685 | | - if (pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64))) { |
---|
| 7683 | + if (dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64))) { |
---|
7686 | 7684 | DBG_PRINT(ERR_DBG, |
---|
7687 | | - "Unable to obtain 64bit DMA " |
---|
7688 | | - "for consistent allocations\n"); |
---|
| 7685 | + "Unable to obtain 64bit DMA for coherent allocations\n"); |
---|
7689 | 7686 | pci_disable_device(pdev); |
---|
7690 | 7687 | return -ENOMEM; |
---|
7691 | 7688 | } |
---|
7692 | | - } else if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) { |
---|
| 7689 | + } else if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(32))) { |
---|
7693 | 7690 | DBG_PRINT(INIT_DBG, "%s: Using 32bit DMA\n", __func__); |
---|
7694 | 7691 | } else { |
---|
7695 | 7692 | pci_disable_device(pdev); |
---|