diff options
Diffstat (limited to 'drivers/net/wireless/brcm80211/brcmutil/utils.c')
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmutil/utils.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmutil/utils.c b/drivers/net/wireless/brcm80211/brcmutil/utils.c index 3e6405e06ac0..bf5e50fc21ba 100644 --- a/drivers/net/wireless/brcm80211/brcmutil/utils.c +++ b/drivers/net/wireless/brcm80211/brcmutil/utils.c | |||
@@ -116,6 +116,31 @@ struct sk_buff *brcmu_pktq_pdeq(struct pktq *pq, int prec) | |||
116 | } | 116 | } |
117 | EXPORT_SYMBOL(brcmu_pktq_pdeq); | 117 | EXPORT_SYMBOL(brcmu_pktq_pdeq); |
118 | 118 | ||
119 | /* | ||
120 | * precedence based dequeue with match function. Passing a NULL pointer | ||
121 | * for the match function parameter is considered to be a wildcard so | ||
122 | * any packet on the queue is returned. In that case it is no different | ||
123 | * from brcmu_pktq_pdeq() above. | ||
124 | */ | ||
125 | struct sk_buff *brcmu_pktq_pdeq_match(struct pktq *pq, int prec, | ||
126 | bool (*match_fn)(struct sk_buff *skb, | ||
127 | void *arg), void *arg) | ||
128 | { | ||
129 | struct sk_buff_head *q; | ||
130 | struct sk_buff *p, *next; | ||
131 | |||
132 | q = &pq->q[prec].skblist; | ||
133 | skb_queue_walk_safe(q, p, next) { | ||
134 | if (match_fn == NULL || match_fn(p, arg)) { | ||
135 | skb_unlink(p, q); | ||
136 | pq->len--; | ||
137 | return p; | ||
138 | } | ||
139 | } | ||
140 | return NULL; | ||
141 | } | ||
142 | EXPORT_SYMBOL(brcmu_pktq_pdeq_match); | ||
143 | |||
119 | struct sk_buff *brcmu_pktq_pdeq_tail(struct pktq *pq, int prec) | 144 | struct sk_buff *brcmu_pktq_pdeq_tail(struct pktq *pq, int prec) |
120 | { | 145 | { |
121 | struct sk_buff_head *q; | 146 | struct sk_buff_head *q; |