@@ -227,7 +227,6 @@ static void ath_rx_edma_cleanup(struct ath_softc *sc)
227
227
static void ath_rx_edma_init_queue (struct ath_rx_edma * rx_edma , int size )
228
228
{
229
229
skb_queue_head_init (& rx_edma -> rx_fifo );
230
- skb_queue_head_init (& rx_edma -> rx_buffers );
231
230
rx_edma -> rx_fifo_hwsize = size ;
232
231
}
233
232
@@ -653,7 +652,9 @@ static void ath_rx_ps(struct ath_softc *sc, struct sk_buff *skb, bool mybeacon)
653
652
}
654
653
655
654
static bool ath_edma_get_buffers (struct ath_softc * sc ,
656
- enum ath9k_rx_qtype qtype )
655
+ enum ath9k_rx_qtype qtype ,
656
+ struct ath_rx_status * rs ,
657
+ struct ath_buf * * dest )
657
658
{
658
659
struct ath_rx_edma * rx_edma = & sc -> rx .rx_edma [qtype ];
659
660
struct ath_hw * ah = sc -> sc_ah ;
@@ -672,7 +673,7 @@ static bool ath_edma_get_buffers(struct ath_softc *sc,
672
673
dma_sync_single_for_cpu (sc -> dev , bf -> bf_buf_addr ,
673
674
common -> rx_bufsize , DMA_FROM_DEVICE );
674
675
675
- ret = ath9k_hw_process_rxdesc_edma (ah , NULL , skb -> data );
676
+ ret = ath9k_hw_process_rxdesc_edma (ah , rs , skb -> data );
676
677
if (ret == - EINPROGRESS ) {
677
678
/*let device gain the buffer again*/
678
679
dma_sync_single_for_device (sc -> dev , bf -> bf_buf_addr ,
@@ -685,39 +686,37 @@ static bool ath_edma_get_buffers(struct ath_softc *sc,
685
686
/* corrupt descriptor, skip this one and the following one */
686
687
list_add_tail (& bf -> list , & sc -> rx .rxbuf );
687
688
ath_rx_edma_buf_link (sc , qtype );
688
- skb = skb_peek (& rx_edma -> rx_fifo );
689
- if (!skb )
690
- return true;
691
689
692
- bf = SKB_CB_ATHBUF (skb );
693
- BUG_ON (!bf );
690
+ skb = skb_peek (& rx_edma -> rx_fifo );
691
+ if (skb ) {
692
+ bf = SKB_CB_ATHBUF (skb );
693
+ BUG_ON (!bf );
694
694
695
- __skb_unlink (skb , & rx_edma -> rx_fifo );
696
- list_add_tail (& bf -> list , & sc -> rx .rxbuf );
697
- ath_rx_edma_buf_link (sc , qtype );
698
- return true;
695
+ __skb_unlink (skb , & rx_edma -> rx_fifo );
696
+ list_add_tail (& bf -> list , & sc -> rx .rxbuf );
697
+ ath_rx_edma_buf_link (sc , qtype );
698
+ } else {
699
+ bf = NULL ;
700
+ }
699
701
}
700
- skb_queue_tail (& rx_edma -> rx_buffers , skb );
701
702
703
+ * dest = bf ;
702
704
return true;
703
705
}
704
706
705
707
static struct ath_buf * ath_edma_get_next_rx_buf (struct ath_softc * sc ,
706
708
struct ath_rx_status * rs ,
707
709
enum ath9k_rx_qtype qtype )
708
710
{
709
- struct ath_rx_edma * rx_edma = & sc -> rx .rx_edma [qtype ];
710
- struct sk_buff * skb ;
711
- struct ath_buf * bf ;
711
+ struct ath_buf * bf = NULL ;
712
712
713
- while (ath_edma_get_buffers (sc , qtype ));
714
- skb = __skb_dequeue (& rx_edma -> rx_buffers );
715
- if (!skb )
716
- return NULL ;
713
+ while (ath_edma_get_buffers (sc , qtype , rs , & bf )) {
714
+ if (!bf )
715
+ continue ;
717
716
718
- bf = SKB_CB_ATHBUF ( skb ) ;
719
- ath9k_hw_process_rxdesc_edma ( sc -> sc_ah , rs , skb -> data );
720
- return bf ;
717
+ return bf ;
718
+ }
719
+ return NULL ;
721
720
}
722
721
723
722
static struct ath_buf * ath_get_next_rx_buf (struct ath_softc * sc ,
0 commit comments