diff options
author | Alan Cox <alan@linux.intel.com> | 2011-02-01 10:42:10 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-02-04 16:01:01 -0500 |
commit | ae3e5f0e9a27b0c015570cb2899484c1456846a7 (patch) | |
tree | 5f80ec98498d46d2a2c169f1881f4cd91d81cb6a /drivers | |
parent | 64b728319bed41ef14462a1a504c65656e5a50a4 (diff) |
staging: et131x: Clean up the RFD struct/types
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/et131x/et1310_rx.c | 44 | ||||
-rw-r--r-- | drivers/staging/et131x/et131x.h | 4 | ||||
-rw-r--r-- | drivers/staging/et131x/et131x_adapter.h | 8 |
3 files changed, 28 insertions, 28 deletions
diff --git a/drivers/staging/et131x/et1310_rx.c b/drivers/staging/et131x/et1310_rx.c index 8220f1bf64d..a87da6848f9 100644 --- a/drivers/staging/et131x/et1310_rx.c +++ b/drivers/staging/et131x/et1310_rx.c | |||
@@ -88,7 +88,7 @@ | |||
88 | #include "et1310_rx.h" | 88 | #include "et1310_rx.h" |
89 | #include "et131x.h" | 89 | #include "et131x.h" |
90 | 90 | ||
91 | void nic_return_rfd(struct et131x_adapter *etdev, PMP_RFD pMpRfd); | 91 | void nic_return_rfd(struct et131x_adapter *etdev, struct rfd *rfd); |
92 | 92 | ||
93 | /** | 93 | /** |
94 | * et131x_rx_dma_memory_alloc | 94 | * et131x_rx_dma_memory_alloc |
@@ -372,7 +372,7 @@ int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter) | |||
372 | * RFDs will be allocated from this pool. | 372 | * RFDs will be allocated from this pool. |
373 | */ | 373 | */ |
374 | rx_ring->RecvLookaside = kmem_cache_create(adapter->netdev->name, | 374 | rx_ring->RecvLookaside = kmem_cache_create(adapter->netdev->name, |
375 | sizeof(MP_RFD), | 375 | sizeof(struct rfd), |
376 | 0, | 376 | 0, |
377 | SLAB_CACHE_DMA | | 377 | SLAB_CACHE_DMA | |
378 | SLAB_HWCACHE_ALIGN, | 378 | SLAB_HWCACHE_ALIGN, |
@@ -396,7 +396,7 @@ void et131x_rx_dma_memory_free(struct et131x_adapter *adapter) | |||
396 | u32 index; | 396 | u32 index; |
397 | u32 bufsize; | 397 | u32 bufsize; |
398 | u32 pktStatRingSize; | 398 | u32 pktStatRingSize; |
399 | PMP_RFD rfd; | 399 | struct rfd *rfd; |
400 | struct rx_ring *rx_ring; | 400 | struct rx_ring *rx_ring; |
401 | 401 | ||
402 | /* Setup some convenience pointers */ | 402 | /* Setup some convenience pointers */ |
@@ -406,11 +406,11 @@ void et131x_rx_dma_memory_free(struct et131x_adapter *adapter) | |||
406 | WARN_ON(rx_ring->nReadyRecv != rx_ring->NumRfd); | 406 | WARN_ON(rx_ring->nReadyRecv != rx_ring->NumRfd); |
407 | 407 | ||
408 | while (!list_empty(&rx_ring->RecvList)) { | 408 | while (!list_empty(&rx_ring->RecvList)) { |
409 | rfd = (MP_RFD *) list_entry(rx_ring->RecvList.next, | 409 | rfd = (struct rfd *) list_entry(rx_ring->RecvList.next, |
410 | MP_RFD, list_node); | 410 | struct rfd, list_node); |
411 | 411 | ||
412 | list_del(&rfd->list_node); | 412 | list_del(&rfd->list_node); |
413 | rfd->Packet = NULL; | 413 | rfd->skb = NULL; |
414 | kmem_cache_free(adapter->rx_ring.RecvLookaside, rfd); | 414 | kmem_cache_free(adapter->rx_ring.RecvLookaside, rfd); |
415 | } | 415 | } |
416 | 416 | ||
@@ -537,7 +537,7 @@ void et131x_rx_dma_memory_free(struct et131x_adapter *adapter) | |||
537 | int et131x_init_recv(struct et131x_adapter *adapter) | 537 | int et131x_init_recv(struct et131x_adapter *adapter) |
538 | { | 538 | { |
539 | int status = -ENOMEM; | 539 | int status = -ENOMEM; |
540 | PMP_RFD rfd = NULL; | 540 | struct rfd *rfd = NULL; |
541 | u32 rfdct; | 541 | u32 rfdct; |
542 | u32 numrfd = 0; | 542 | u32 numrfd = 0; |
543 | struct rx_ring *rx_ring; | 543 | struct rx_ring *rx_ring; |
@@ -557,7 +557,7 @@ int et131x_init_recv(struct et131x_adapter *adapter) | |||
557 | continue; | 557 | continue; |
558 | } | 558 | } |
559 | 559 | ||
560 | rfd->Packet = NULL; | 560 | rfd->skb = NULL; |
561 | 561 | ||
562 | /* Add this RFD to the RecvList */ | 562 | /* Add this RFD to the RecvList */ |
563 | list_add_tail(&rfd->list_node, &rx_ring->RecvList); | 563 | list_add_tail(&rfd->list_node, &rx_ring->RecvList); |
@@ -776,12 +776,12 @@ void et131x_rx_dma_enable(struct et131x_adapter *etdev) | |||
776 | * the packet to it, puts the RFD in the RecvPendList, and also returns | 776 | * the packet to it, puts the RFD in the RecvPendList, and also returns |
777 | * the pointer to the RFD. | 777 | * the pointer to the RFD. |
778 | */ | 778 | */ |
779 | PMP_RFD nic_rx_pkts(struct et131x_adapter *etdev) | 779 | struct rfd * nic_rx_pkts(struct et131x_adapter *etdev) |
780 | { | 780 | { |
781 | struct rx_ring *rx_local = &etdev->rx_ring; | 781 | struct rx_ring *rx_local = &etdev->rx_ring; |
782 | struct rx_status_block *status; | 782 | struct rx_status_block *status; |
783 | struct pkt_stat_desc *psr; | 783 | struct pkt_stat_desc *psr; |
784 | PMP_RFD rfd; | 784 | struct rfd *rfd; |
785 | u32 i; | 785 | u32 i; |
786 | u8 *buf; | 786 | u8 *buf; |
787 | unsigned long flags; | 787 | unsigned long flags; |
@@ -858,7 +858,7 @@ PMP_RFD nic_rx_pkts(struct et131x_adapter *etdev) | |||
858 | 858 | ||
859 | rfd = NULL; | 859 | rfd = NULL; |
860 | element = rx_local->RecvList.next; | 860 | element = rx_local->RecvList.next; |
861 | rfd = (PMP_RFD) list_entry(element, MP_RFD, list_node); | 861 | rfd = (struct rfd *) list_entry(element, struct rfd, list_node); |
862 | 862 | ||
863 | if (rfd == NULL) { | 863 | if (rfd == NULL) { |
864 | spin_unlock_irqrestore(&etdev->rcv_lock, flags); | 864 | spin_unlock_irqrestore(&etdev->rcv_lock, flags); |
@@ -938,7 +938,7 @@ PMP_RFD nic_rx_pkts(struct et131x_adapter *etdev) | |||
938 | * of Multicast address we have, then | 938 | * of Multicast address we have, then |
939 | * this means we did not find this | 939 | * this means we did not find this |
940 | * packet's matching address in our | 940 | * packet's matching address in our |
941 | * list. Set the PacketSize to zero, | 941 | * list. Set the len to zero, |
942 | * so we free our RFD when we return | 942 | * so we free our RFD when we return |
943 | * from this function. | 943 | * from this function. |
944 | */ | 944 | */ |
@@ -962,21 +962,21 @@ PMP_RFD nic_rx_pkts(struct et131x_adapter *etdev) | |||
962 | if (len > 0) { | 962 | if (len > 0) { |
963 | struct sk_buff *skb = NULL; | 963 | struct sk_buff *skb = NULL; |
964 | 964 | ||
965 | /* rfd->PacketSize = len - 4; */ | 965 | /*rfd->len = len - 4; */ |
966 | rfd->PacketSize = len; | 966 | rfd->len = len; |
967 | 967 | ||
968 | skb = dev_alloc_skb(rfd->PacketSize + 2); | 968 | skb = dev_alloc_skb(rfd->len + 2); |
969 | if (!skb) { | 969 | if (!skb) { |
970 | dev_err(&etdev->pdev->dev, | 970 | dev_err(&etdev->pdev->dev, |
971 | "Couldn't alloc an SKB for Rx\n"); | 971 | "Couldn't alloc an SKB for Rx\n"); |
972 | return NULL; | 972 | return NULL; |
973 | } | 973 | } |
974 | 974 | ||
975 | etdev->net_stats.rx_bytes += rfd->PacketSize; | 975 | etdev->net_stats.rx_bytes += rfd->len; |
976 | 976 | ||
977 | memcpy(skb_put(skb, rfd->PacketSize), | 977 | memcpy(skb_put(skb, rfd->len), |
978 | rx_local->fbr[rindex]->virt[bindex], | 978 | rx_local->fbr[rindex]->virt[bindex], |
979 | rfd->PacketSize); | 979 | rfd->len); |
980 | 980 | ||
981 | skb->dev = etdev->netdev; | 981 | skb->dev = etdev->netdev; |
982 | skb->protocol = eth_type_trans(skb, etdev->netdev); | 982 | skb->protocol = eth_type_trans(skb, etdev->netdev); |
@@ -984,7 +984,7 @@ PMP_RFD nic_rx_pkts(struct et131x_adapter *etdev) | |||
984 | 984 | ||
985 | netif_rx(skb); | 985 | netif_rx(skb); |
986 | } else { | 986 | } else { |
987 | rfd->PacketSize = 0; | 987 | rfd->len = 0; |
988 | } | 988 | } |
989 | 989 | ||
990 | nic_return_rfd(etdev, rfd); | 990 | nic_return_rfd(etdev, rfd); |
@@ -1011,7 +1011,7 @@ void et131x_reset_recv(struct et131x_adapter *etdev) | |||
1011 | */ | 1011 | */ |
1012 | void et131x_handle_recv_interrupt(struct et131x_adapter *etdev) | 1012 | void et131x_handle_recv_interrupt(struct et131x_adapter *etdev) |
1013 | { | 1013 | { |
1014 | PMP_RFD rfd = NULL; | 1014 | struct rfd *rfd = NULL; |
1015 | u32 count = 0; | 1015 | u32 count = 0; |
1016 | bool done = true; | 1016 | bool done = true; |
1017 | 1017 | ||
@@ -1035,7 +1035,7 @@ void et131x_handle_recv_interrupt(struct et131x_adapter *etdev) | |||
1035 | */ | 1035 | */ |
1036 | if (!etdev->PacketFilter || | 1036 | if (!etdev->PacketFilter || |
1037 | !(etdev->Flags & fMP_ADAPTER_LINK_DETECTION) || | 1037 | !(etdev->Flags & fMP_ADAPTER_LINK_DETECTION) || |
1038 | rfd->PacketSize == 0) { | 1038 | rfd->len == 0) { |
1039 | continue; | 1039 | continue; |
1040 | } | 1040 | } |
1041 | 1041 | ||
@@ -1082,7 +1082,7 @@ static inline u32 bump_fbr(u32 *fbr, u32 limit) | |||
1082 | * @etdev: pointer to our adapter | 1082 | * @etdev: pointer to our adapter |
1083 | * @rfd: pointer to the RFD | 1083 | * @rfd: pointer to the RFD |
1084 | */ | 1084 | */ |
1085 | void nic_return_rfd(struct et131x_adapter *etdev, PMP_RFD rfd) | 1085 | void nic_return_rfd(struct et131x_adapter *etdev, struct rfd *rfd) |
1086 | { | 1086 | { |
1087 | struct rx_ring *rx_local = &etdev->rx_ring; | 1087 | struct rx_ring *rx_local = &etdev->rx_ring; |
1088 | struct rxdma_regs __iomem *rx_dma = &etdev->regs->rxdma; | 1088 | struct rxdma_regs __iomem *rx_dma = &etdev->regs->rxdma; |
diff --git a/drivers/staging/et131x/et131x.h b/drivers/staging/et131x/et131x.h index a8abfe6ca81..8aa3365b83c 100644 --- a/drivers/staging/et131x/et131x.h +++ b/drivers/staging/et131x/et131x.h | |||
@@ -126,9 +126,9 @@ void SetPhy_10BaseTHalfDuplex(struct et131x_adapter *adapter); | |||
126 | int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter); | 126 | int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter); |
127 | void et131x_rx_dma_memory_free(struct et131x_adapter *adapter); | 127 | void et131x_rx_dma_memory_free(struct et131x_adapter *adapter); |
128 | int et131x_rfd_resources_alloc(struct et131x_adapter *adapter, | 128 | int et131x_rfd_resources_alloc(struct et131x_adapter *adapter, |
129 | struct _MP_RFD *pMpRfd); | 129 | struct rfd *rfd); |
130 | void et131x_rfd_resources_free(struct et131x_adapter *adapter, | 130 | void et131x_rfd_resources_free(struct et131x_adapter *adapter, |
131 | struct _MP_RFD *pMpRfd); | 131 | struct rfd *rfd); |
132 | int et131x_init_recv(struct et131x_adapter *adapter); | 132 | int et131x_init_recv(struct et131x_adapter *adapter); |
133 | 133 | ||
134 | void ConfigRxDmaRegs(struct et131x_adapter *adapter); | 134 | void ConfigRxDmaRegs(struct et131x_adapter *adapter); |
diff --git a/drivers/staging/et131x/et131x_adapter.h b/drivers/staging/et131x/et131x_adapter.h index 025d4c40a18..c852f867645 100644 --- a/drivers/staging/et131x/et131x_adapter.h +++ b/drivers/staging/et131x/et131x_adapter.h | |||
@@ -83,13 +83,13 @@ | |||
83 | #define LO_MARK_PERCENT_FOR_RX 15 | 83 | #define LO_MARK_PERCENT_FOR_RX 15 |
84 | 84 | ||
85 | /* RFD (Receive Frame Descriptor) */ | 85 | /* RFD (Receive Frame Descriptor) */ |
86 | typedef struct _MP_RFD { | 86 | struct rfd { |
87 | struct list_head list_node; | 87 | struct list_head list_node; |
88 | struct sk_buff *Packet; | 88 | struct sk_buff *skb; |
89 | u32 PacketSize; /* total size of receive frame */ | 89 | u32 len; /* total size of receive frame */ |
90 | u16 bufferindex; | 90 | u16 bufferindex; |
91 | u8 ringindex; | 91 | u8 ringindex; |
92 | } MP_RFD, *PMP_RFD; | 92 | }; |
93 | 93 | ||
94 | /* Flow Control */ | 94 | /* Flow Control */ |
95 | #define FLOW_BOTH 0 | 95 | #define FLOW_BOTH 0 |