aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2009-10-06 10:49:21 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-12-11 15:23:07 -0500
commit116badfe08c0ab8bcd54492a73b23bacb218ef54 (patch)
tree6e7bac1f2ce8b70a7974bfb33e27fb9a1b7ce757
parentf432c55e14e3eae2258c0f222b8631255bcc0031 (diff)
Staging: et131x: Remove old SendWaitQueue code
The Linux driver doesn't keep a pending queue as the old one did. so we can remove all the code related to it. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/staging/et131x/et1310_tx.c52
-rw-r--r--drivers/staging/et131x/et1310_tx.h4
-rw-r--r--drivers/staging/et131x/et131x_adapter.h1
-rw-r--r--drivers/staging/et131x/et131x_initpci.c1
4 files changed, 4 insertions, 54 deletions
diff --git a/drivers/staging/et131x/et1310_tx.c b/drivers/staging/et131x/et1310_tx.c
index b2e4950b002..4aabfa31226 100644
--- a/drivers/staging/et131x/et1310_tx.c
+++ b/drivers/staging/et131x/et1310_tx.c
@@ -95,7 +95,6 @@
95 95
96 96
97static void et131x_update_tcb_list(struct et131x_adapter *etdev); 97static void et131x_update_tcb_list(struct et131x_adapter *etdev);
98static void et131x_check_send_wait_list(struct et131x_adapter *etdev);
99static inline void et131x_free_send_packet(struct et131x_adapter *etdev, 98static inline void et131x_free_send_packet(struct et131x_adapter *etdev,
100 struct tcb *tcb); 99 struct tcb *tcb);
101static int et131x_send_packet(struct sk_buff *skb, 100static int et131x_send_packet(struct sk_buff *skb,
@@ -310,8 +309,6 @@ void et131x_init_send(struct et131x_adapter *adapter)
310 /* Curr send queue should now be empty */ 309 /* Curr send queue should now be empty */
311 tx_ring->CurrSendHead = NULL; 310 tx_ring->CurrSendHead = NULL;
312 tx_ring->CurrSendTail = NULL; 311 tx_ring->CurrSendTail = NULL;
313
314 INIT_LIST_HEAD(&adapter->tx_ring.SendWaitQueue);
315} 312}
316 313
317/** 314/**
@@ -334,9 +331,8 @@ int et131x_send_packets(struct sk_buff *skb, struct net_device *netdev)
334 * to Tx, so the PacketCount and it's array used makes no sense here 331 * to Tx, so the PacketCount and it's array used makes no sense here
335 */ 332 */
336 333
337 /* Queue is not empty or TCB is not available */ 334 /* TCB is not available */
338 if (!list_empty(&etdev->tx_ring.SendWaitQueue) || 335 if (MP_TCB_RESOURCES_NOT_AVAILABLE(etdev)) {
339 MP_TCB_RESOURCES_NOT_AVAILABLE(etdev)) {
340 /* NOTE: If there's an error on send, no need to queue the 336 /* NOTE: If there's an error on send, no need to queue the
341 * packet under Linux; if we just send an error up to the 337 * packet under Linux; if we just send an error up to the
342 * netif layer, it will resend the skb to us. 338 * netif layer, it will resend the skb to us.
@@ -392,7 +388,7 @@ static int et131x_send_packet(struct sk_buff *skb,
392{ 388{
393 int status = 0; 389 int status = 0;
394 struct tcb *tcb = NULL; 390 struct tcb *tcb = NULL;
395 uint16_t *shbufva; 391 u16 *shbufva;
396 unsigned long flags; 392 unsigned long flags;
397 393
398 /* All packets must have at least a MAC address and a protocol type */ 394 /* All packets must have at least a MAC address and a protocol type */
@@ -420,7 +416,7 @@ static int et131x_send_packet(struct sk_buff *skb,
420 tcb->Packet = skb; 416 tcb->Packet = skb;
421 417
422 if ((skb->data != NULL) && ((skb->len - skb->data_len) >= 6)) { 418 if ((skb->data != NULL) && ((skb->len - skb->data_len) >= 6)) {
423 shbufva = (uint16_t *) skb->data; 419 shbufva = (u16 *) skb->data;
424 420
425 if ((shbufva[0] == 0xffff) && 421 if ((shbufva[0] == 0xffff) &&
426 (shbufva[1] == 0xffff) && (shbufva[2] == 0xffff)) { 422 (shbufva[1] == 0xffff) && (shbufva[2] == 0xffff)) {
@@ -755,17 +751,6 @@ void et131x_free_busy_send_packets(struct et131x_adapter *etdev)
755 unsigned long flags; 751 unsigned long flags;
756 u32 freed = 0; 752 u32 freed = 0;
757 753
758 while (!list_empty(&etdev->tx_ring.SendWaitQueue)) {
759 spin_lock_irqsave(&etdev->SendWaitLock, flags);
760
761 etdev->tx_ring.nWaitSend--;
762 spin_unlock_irqrestore(&etdev->SendWaitLock, flags);
763
764 entry = etdev->tx_ring.SendWaitQueue.next;
765 }
766
767 etdev->tx_ring.nWaitSend = 0;
768
769 /* Any packets being sent? Check the first TCB on the send list */ 754 /* Any packets being sent? Check the first TCB on the send list */
770 spin_lock_irqsave(&etdev->TCBSendQLock, flags); 755 spin_lock_irqsave(&etdev->TCBSendQLock, flags);
771 756
@@ -811,11 +796,6 @@ void et131x_handle_send_interrupt(struct et131x_adapter *etdev)
811{ 796{
812 /* Mark as completed any packets which have been sent by the device. */ 797 /* Mark as completed any packets which have been sent by the device. */
813 et131x_update_tcb_list(etdev); 798 et131x_update_tcb_list(etdev);
814
815 /* If we queued any transmits because we didn't have any TCBs earlier,
816 * dequeue and send those packets now, as long as we have free TCBs.
817 */
818 et131x_check_send_wait_list(etdev);
819} 799}
820 800
821/** 801/**
@@ -881,27 +861,3 @@ static void et131x_update_tcb_list(struct et131x_adapter *etdev)
881 spin_unlock_irqrestore(&etdev->TCBSendQLock, flags); 861 spin_unlock_irqrestore(&etdev->TCBSendQLock, flags);
882} 862}
883 863
884/**
885 * et131x_check_send_wait_list - Helper routine for the interrupt handler
886 * @etdev: pointer to our adapter
887 *
888 * Takes packets from the send wait queue and posts them to the device (if
889 * room available).
890 */
891static void et131x_check_send_wait_list(struct et131x_adapter *etdev)
892{
893 unsigned long flags;
894
895 spin_lock_irqsave(&etdev->SendWaitLock, flags);
896
897 while (!list_empty(&etdev->tx_ring.SendWaitQueue) &&
898 MP_TCB_RESOURCES_AVAILABLE(etdev)) {
899 struct list_head *entry;
900
901 entry = etdev->tx_ring.SendWaitQueue.next;
902
903 etdev->tx_ring.nWaitSend--;
904 }
905
906 spin_unlock_irqrestore(&etdev->SendWaitLock, flags);
907}
diff --git a/drivers/staging/et131x/et1310_tx.h b/drivers/staging/et131x/et1310_tx.h
index 9a31e97405e..44ea9bb05b2 100644
--- a/drivers/staging/et131x/et1310_tx.h
+++ b/drivers/staging/et131x/et1310_tx.h
@@ -155,10 +155,6 @@ struct tx_ring {
155 struct tcb *CurrSendTail; 155 struct tcb *CurrSendTail;
156 int nBusySend; 156 int nBusySend;
157 157
158 /* List of packets (not TCBs) that were queued for lack of resources */
159 struct list_head SendWaitQueue;
160 int nWaitSend;
161
162 /* The actual descriptor ring */ 158 /* The actual descriptor ring */
163 struct tx_desc *tx_desc_ring; 159 struct tx_desc *tx_desc_ring;
164 dma_addr_t tx_desc_ring_pa; 160 dma_addr_t tx_desc_ring_pa;
diff --git a/drivers/staging/et131x/et131x_adapter.h b/drivers/staging/et131x/et131x_adapter.h
index 283d08aa31e..a512f62469f 100644
--- a/drivers/staging/et131x/et131x_adapter.h
+++ b/drivers/staging/et131x/et131x_adapter.h
@@ -203,7 +203,6 @@ struct et131x_adapter {
203 spinlock_t TCBSendQLock; 203 spinlock_t TCBSendQLock;
204 spinlock_t TCBReadyQLock; 204 spinlock_t TCBReadyQLock;
205 spinlock_t SendHWLock; 205 spinlock_t SendHWLock;
206 spinlock_t SendWaitLock;
207 206
208 spinlock_t RcvLock; 207 spinlock_t RcvLock;
209 spinlock_t RcvPendLock; 208 spinlock_t RcvPendLock;
diff --git a/drivers/staging/et131x/et131x_initpci.c b/drivers/staging/et131x/et131x_initpci.c
index b76fa73395e..6ac7502a405 100644
--- a/drivers/staging/et131x/et131x_initpci.c
+++ b/drivers/staging/et131x/et131x_initpci.c
@@ -555,7 +555,6 @@ static struct et131x_adapter *et131x_adapter_init(struct net_device *netdev,
555 spin_lock_init(&etdev->TCBSendQLock); 555 spin_lock_init(&etdev->TCBSendQLock);
556 spin_lock_init(&etdev->TCBReadyQLock); 556 spin_lock_init(&etdev->TCBReadyQLock);
557 spin_lock_init(&etdev->SendHWLock); 557 spin_lock_init(&etdev->SendHWLock);
558 spin_lock_init(&etdev->SendWaitLock);
559 spin_lock_init(&etdev->RcvLock); 558 spin_lock_init(&etdev->RcvLock);
560 spin_lock_init(&etdev->RcvPendLock); 559 spin_lock_init(&etdev->RcvPendLock);
561 spin_lock_init(&etdev->FbrLock); 560 spin_lock_init(&etdev->FbrLock);