madwifi: fix an unhandle cryptoapi change (wpa2)
[lede.git] / package / madwifi / patches / 301-tx_locking.patch
1 diff -ur madwifi.old/ath/if_ath.c madwifi.dev/ath/if_ath.c
2 --- madwifi.old/ath/if_ath.c    2007-06-01 16:44:25.170898128 +0200
3 +++ madwifi.dev/ath/if_ath.c    2007-06-01 20:01:24.205131816 +0200
4 @@ -2555,7 +2555,7 @@
5         /* NB: use this lock to protect an->an_ff_txbuf in athff_can_aggregate()
6          *     call too.
7          */
8 -       ATH_TXQ_LOCK_IRQ(txq);
9 +       ATH_TXQ_LOCK_BH(txq);
10         if (athff_can_aggregate(sc, eh, an, skb, vap->iv_fragthreshold, &ff_flush)) {
11                 if (an->an_tx_ffbuf[skb->priority]) { /* i.e., frame on the staging queue */
12                         bf = an->an_tx_ffbuf[skb->priority];
13 @@ -2563,6 +2563,7 @@
14                         /* get (and remove) the frame from staging queue */
15                         TAILQ_REMOVE(&txq->axq_stageq, bf, bf_stagelist);
16                         an->an_tx_ffbuf[skb->priority] = NULL;
17 +                       ATH_TXQ_UNLOCK_BH(txq);
18  
19                         /*
20                          * chain skbs and add FF magic
21 @@ -2585,7 +2586,7 @@
22                          */
23                         ATH_HARDSTART_GET_TX_BUF_WITH_LOCK;
24                         if (bf == NULL) {
25 -                               ATH_TXQ_UNLOCK_IRQ_EARLY(txq);
26 +                               ATH_TXQ_UNLOCK_BH(txq);
27                                 goto hardstart_fail;
28                         }
29                         DPRINTF(sc, ATH_DEBUG_XMIT | ATH_DEBUG_FF,
30 @@ -2597,8 +2598,7 @@
31                         an->an_tx_ffbuf[skb->priority] = bf;
32  
33                         TAILQ_INSERT_HEAD(&txq->axq_stageq, bf, bf_stagelist);
34 -
35 -                       ATH_TXQ_UNLOCK_IRQ_EARLY(txq);
36 +                       ATH_TXQ_UNLOCK_BH(txq);
37  
38                         return 0;
39                 }
40 @@ -2650,12 +2650,12 @@
41  
42                 ATH_HARDSTART_GET_TX_BUF_WITH_LOCK;
43                 if (bf == NULL) {
44 -                       ATH_TXQ_UNLOCK_IRQ_EARLY(txq);
45 +                       ATH_TXQ_UNLOCK_BH(txq);
46                         goto hardstart_fail;
47                 }
48 +               ATH_TXQ_UNLOCK_BH(txq);
49         }
50  
51 -       ATH_TXQ_UNLOCK_IRQ(txq);
52  
53  ff_bypass:
54  
55 diff -ur madwifi.old/ath/if_athvar.h madwifi.dev/ath/if_athvar.h
56 --- madwifi.old/ath/if_athvar.h 2007-06-01 16:44:25.149901320 +0200
57 +++ madwifi.dev/ath/if_athvar.h 2007-06-01 20:00:06.916881416 +0200
58 @@ -484,6 +484,8 @@
59  #define ATH_TXQ_INTR_PERIOD            5  /* axq_intrcnt period for intr gen */
60  #define        ATH_TXQ_LOCK_INIT(_tq)          spin_lock_init(&(_tq)->axq_lock)
61  #define        ATH_TXQ_LOCK_DESTROY(_tq)
62 +#define ATH_TXQ_LOCK_BH(_tq)           spin_lock_bh(&(_tq)->axq_lock);
63 +#define ATH_TXQ_UNLOCK_BH(_tq)         spin_unlock_bh(&(_tq)->axq_lock);
64  #define ATH_TXQ_LOCK_IRQ(_tq)          do {                            \
65         unsigned long __axq_lockflags;                                  \
66         spin_lock_irqsave(&(_tq)->axq_lock, __axq_lockflags);
67