blob: b08c8e10d211b9e27193188b70d1f39faca39cd3 [file] [log] [blame]
Sage Ahn247e9cf2012-05-15 13:20:36 +09001/*
2 * Copyright (c) 2012 GCT Semiconductor, Inc. All rights reserved.
3 *
4 * This software is licensed under the terms of the GNU General Public
5 * License version 2, as published by the Free Software Foundation, and
6 * may be copied, distributed, and modified under those terms.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 */
13
YAMANE Toshiaki2d839022012-10-29 20:04:42 +090014#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
15
Sage Ahn247e9cf2012-05-15 13:20:36 +090016#include <linux/etherdevice.h>
17#include <asm/byteorder.h>
18
19#include <linux/ip.h>
20#include <linux/tcp.h>
21#include <linux/if_ether.h>
22
23#include "gdm_wimax.h"
24#include "hci.h"
25#include "gdm_qos.h"
26
Michalis Pappasac1a3bf2014-05-09 18:08:28 +080027#define B2H(x) __be16_to_cpu(x)
Sage Ahn247e9cf2012-05-15 13:20:36 +090028
Sage Ahn247e9cf2012-05-15 13:20:36 +090029#define MAX_FREE_LIST_CNT 32
30static struct {
31 struct list_head head;
32 int cnt;
33 spinlock_t lock;
34} qos_free_list;
35
36static void init_qos_entry_list(void)
37{
38 qos_free_list.cnt = 0;
39 INIT_LIST_HEAD(&qos_free_list.head);
40 spin_lock_init(&qos_free_list.lock);
41}
42
43static void *alloc_qos_entry(void)
44{
45 struct qos_entry_s *entry;
46 unsigned long flags;
47
48 spin_lock_irqsave(&qos_free_list.lock, flags);
49 if (qos_free_list.cnt) {
Davide Gianfortea3709f72014-05-23 22:06:44 +020050 entry = list_entry(qos_free_list.head.prev, struct qos_entry_s,
51 list);
Sage Ahn247e9cf2012-05-15 13:20:36 +090052 list_del(&entry->list);
53 qos_free_list.cnt--;
54 spin_unlock_irqrestore(&qos_free_list.lock, flags);
55 return entry;
56 }
57 spin_unlock_irqrestore(&qos_free_list.lock, flags);
58
Michalis Pappasbaad5ee2014-05-09 18:08:22 +080059 entry = kmalloc(sizeof(*entry), GFP_ATOMIC);
Sage Ahn247e9cf2012-05-15 13:20:36 +090060 return entry;
61}
62
63static void free_qos_entry(void *entry)
64{
Michalis Pappas39c511f2014-05-09 18:08:27 +080065 struct qos_entry_s *qentry = (struct qos_entry_s *)entry;
Sage Ahn247e9cf2012-05-15 13:20:36 +090066 unsigned long flags;
67
68 spin_lock_irqsave(&qos_free_list.lock, flags);
69 if (qos_free_list.cnt < MAX_FREE_LIST_CNT) {
70 list_add(&qentry->list, &qos_free_list.head);
71 qos_free_list.cnt++;
72 spin_unlock_irqrestore(&qos_free_list.lock, flags);
73 return;
74 }
75 spin_unlock_irqrestore(&qos_free_list.lock, flags);
76
77 kfree(entry);
78}
79
80static void free_qos_entry_list(struct list_head *free_list)
81{
82 struct qos_entry_s *entry, *n;
83 int total_free = 0;
84
85 list_for_each_entry_safe(entry, n, free_list, list) {
86 list_del(&entry->list);
87 kfree(entry);
88 total_free++;
89 }
90
YAMANE Toshiaki2d839022012-10-29 20:04:42 +090091 pr_debug("%s: total_free_cnt=%d\n", __func__, total_free);
Sage Ahn247e9cf2012-05-15 13:20:36 +090092}
93
94void gdm_qos_init(void *nic_ptr)
95{
96 struct nic *nic = nic_ptr;
97 struct qos_cb_s *qcb = &nic->qos;
98 int i;
99
Masanari Iida0f4a97f2013-12-14 03:32:53 +0900100 for (i = 0; i < QOS_MAX; i++) {
Sage Ahn247e9cf2012-05-15 13:20:36 +0900101 INIT_LIST_HEAD(&qcb->qos_list[i]);
Macpaul Lin13b26632012-09-11 15:55:31 +0800102 qcb->csr[i].qos_buf_count = 0;
Ben Chan8fea7d02014-06-27 23:17:25 -0700103 qcb->csr[i].enabled = false;
Sage Ahn247e9cf2012-05-15 13:20:36 +0900104 }
105
106 qcb->qos_list_cnt = 0;
107 qcb->qos_null_idx = QOS_MAX-1;
108 qcb->qos_limit_size = 255;
109
110 spin_lock_init(&qcb->qos_lock);
111
112 init_qos_entry_list();
113}
114
115void gdm_qos_release_list(void *nic_ptr)
116{
117 struct nic *nic = nic_ptr;
118 struct qos_cb_s *qcb = &nic->qos;
119 unsigned long flags;
120 struct qos_entry_s *entry, *n;
121 struct list_head free_list;
122 int i;
123
124 INIT_LIST_HEAD(&free_list);
125
126 spin_lock_irqsave(&qcb->qos_lock, flags);
127
128 for (i = 0; i < QOS_MAX; i++) {
Macpaul Lin13b26632012-09-11 15:55:31 +0800129 qcb->csr[i].qos_buf_count = 0;
Ben Chan8fea7d02014-06-27 23:17:25 -0700130 qcb->csr[i].enabled = false;
Sage Ahn247e9cf2012-05-15 13:20:36 +0900131 }
132
133 qcb->qos_list_cnt = 0;
134 qcb->qos_null_idx = QOS_MAX-1;
135
136 for (i = 0; i < QOS_MAX; i++) {
137 list_for_each_entry_safe(entry, n, &qcb->qos_list[i], list) {
138 list_move_tail(&entry->list, &free_list);
139 }
140 }
141 spin_unlock_irqrestore(&qcb->qos_lock, flags);
142 free_qos_entry_list(&free_list);
143}
144
Ben Chane60cc3b2014-06-27 23:17:26 -0700145static int chk_ipv4_rule(struct gdm_wimax_csr_s *csr, u8 *stream, u8 *port)
Sage Ahn247e9cf2012-05-15 13:20:36 +0900146{
147 int i;
148
Macpaul Lin13b26632012-09-11 15:55:31 +0800149 if (csr->classifier_rule_en&IPTYPEOFSERVICE) {
Michalis Pappas633c8a22014-05-09 18:08:24 +0800150 if (((stream[1] & csr->ip2s_mask) < csr->ip2s_lo) ||
Michalis Pappas39c511f2014-05-09 18:08:27 +0800151 ((stream[1] & csr->ip2s_mask) > csr->ip2s_hi))
Sage Ahn247e9cf2012-05-15 13:20:36 +0900152 return 1;
153 }
154
Macpaul Lin13b26632012-09-11 15:55:31 +0800155 if (csr->classifier_rule_en&PROTOCOL) {
Michalis Pappas633c8a22014-05-09 18:08:24 +0800156 if (stream[9] != csr->protocol)
Sage Ahn247e9cf2012-05-15 13:20:36 +0900157 return 1;
158 }
159
Macpaul Lin13b26632012-09-11 15:55:31 +0800160 if (csr->classifier_rule_en&IPMASKEDSRCADDRESS) {
Sage Ahn247e9cf2012-05-15 13:20:36 +0900161 for (i = 0; i < 4; i++) {
Michalis Pappas633c8a22014-05-09 18:08:24 +0800162 if ((stream[12 + i] & csr->ipsrc_addrmask[i]) !=
Macpaul Lin13b26632012-09-11 15:55:31 +0800163 (csr->ipsrc_addr[i] & csr->ipsrc_addrmask[i]))
Sage Ahn247e9cf2012-05-15 13:20:36 +0900164 return 1;
165 }
166 }
167
Macpaul Lin13b26632012-09-11 15:55:31 +0800168 if (csr->classifier_rule_en&IPMASKEDDSTADDRESS) {
Sage Ahn247e9cf2012-05-15 13:20:36 +0900169 for (i = 0; i < 4; i++) {
Michalis Pappas633c8a22014-05-09 18:08:24 +0800170 if ((stream[16 + i] & csr->ipdst_addrmask[i]) !=
Macpaul Lin13b26632012-09-11 15:55:31 +0800171 (csr->ipdst_addr[i] & csr->ipdst_addrmask[i]))
Sage Ahn247e9cf2012-05-15 13:20:36 +0900172 return 1;
173 }
174 }
175
Macpaul Lin13b26632012-09-11 15:55:31 +0800176 if (csr->classifier_rule_en&PROTOCOLSRCPORTRANGE) {
Sage Ahn247e9cf2012-05-15 13:20:36 +0900177 i = ((port[0]<<8)&0xff00)+port[1];
Macpaul Lin13b26632012-09-11 15:55:31 +0800178 if ((i < csr->srcport_lo) || (i > csr->srcport_hi))
Sage Ahn247e9cf2012-05-15 13:20:36 +0900179 return 1;
180 }
181
Macpaul Lin13b26632012-09-11 15:55:31 +0800182 if (csr->classifier_rule_en&PROTOCOLDSTPORTRANGE) {
Sage Ahn247e9cf2012-05-15 13:20:36 +0900183 i = ((port[2]<<8)&0xff00)+port[3];
Macpaul Lin13b26632012-09-11 15:55:31 +0800184 if ((i < csr->dstport_lo) || (i > csr->dstport_hi))
Sage Ahn247e9cf2012-05-15 13:20:36 +0900185 return 1;
186 }
187
188 return 0;
189}
190
Ben Chane60cc3b2014-06-27 23:17:26 -0700191static int get_qos_index(struct nic *nic, u8 *iph, u8 *tcpudph)
Sage Ahn247e9cf2012-05-15 13:20:36 +0900192{
Ben Chanc047b442014-06-27 23:17:27 -0700193 int ip_ver, i;
Sage Ahn247e9cf2012-05-15 13:20:36 +0900194 struct qos_cb_s *qcb = &nic->qos;
195
196 if (iph == NULL || tcpudph == NULL)
197 return -1;
198
Ben Chanc047b442014-06-27 23:17:27 -0700199 ip_ver = (iph[0]>>4)&0xf;
Sage Ahn247e9cf2012-05-15 13:20:36 +0900200
Ben Chanc047b442014-06-27 23:17:27 -0700201 if (ip_ver != 4)
Michalis Pappas39c511f2014-05-09 18:08:27 +0800202 return -1;
203
204 for (i = 0; i < QOS_MAX; i++) {
205 if (!qcb->csr[i].enabled)
206 continue;
207 if (!qcb->csr[i].classifier_rule_en)
208 continue;
209 if (chk_ipv4_rule(&qcb->csr[i], iph, tcpudph) == 0)
210 return i;
Sage Ahn247e9cf2012-05-15 13:20:36 +0900211 }
212
213 return -1;
214}
215
Ben Chane60cc3b2014-06-27 23:17:26 -0700216static void extract_qos_list(struct nic *nic, struct list_head *head)
Sage Ahn247e9cf2012-05-15 13:20:36 +0900217{
218 struct qos_cb_s *qcb = &nic->qos;
219 struct qos_entry_s *entry;
220 int i;
221
222 INIT_LIST_HEAD(head);
223
224 for (i = 0; i < QOS_MAX; i++) {
Michalis Pappas39c511f2014-05-09 18:08:27 +0800225 if (!qcb->csr[i].enabled)
226 continue;
227 if (qcb->csr[i].qos_buf_count >= qcb->qos_limit_size)
228 continue;
229 if (list_empty(&qcb->qos_list[i]))
230 continue;
Sage Ahn247e9cf2012-05-15 13:20:36 +0900231
Davide Gianfortea3709f72014-05-23 22:06:44 +0200232 entry = list_entry(qcb->qos_list[i].prev, struct qos_entry_s,
233 list);
Michalis Pappas39c511f2014-05-09 18:08:27 +0800234
235 list_move_tail(&entry->list, head);
236 qcb->csr[i].qos_buf_count++;
237
238 if (!list_empty(&qcb->qos_list[i]))
239 netdev_warn(nic->netdev, "Index(%d) is piled!!\n", i);
Sage Ahn247e9cf2012-05-15 13:20:36 +0900240 }
Sage Ahn247e9cf2012-05-15 13:20:36 +0900241}
242
243static void send_qos_list(struct nic *nic, struct list_head *head)
244{
245 struct qos_entry_s *entry, *n;
246
247 list_for_each_entry_safe(entry, n, head, list) {
248 list_del(&entry->list);
Sage Ahn247e9cf2012-05-15 13:20:36 +0900249 gdm_wimax_send_tx(entry->skb, entry->dev);
Dan Carpenterf2a6fed2013-07-22 11:00:53 +0300250 free_qos_entry(entry);
Sage Ahn247e9cf2012-05-15 13:20:36 +0900251 }
252}
253
254int gdm_qos_send_hci_pkt(struct sk_buff *skb, struct net_device *dev)
255{
256 struct nic *nic = netdev_priv(dev);
257 int index;
258 struct qos_cb_s *qcb = &nic->qos;
259 unsigned long flags;
Michalis Pappas39c511f2014-05-09 18:08:27 +0800260 struct ethhdr *ethh = (struct ethhdr *)(skb->data + HCI_HEADER_SIZE);
261 struct iphdr *iph = (struct iphdr *)((char *)ethh + ETH_HLEN);
Sage Ahn247e9cf2012-05-15 13:20:36 +0900262 struct tcphdr *tcph;
263 struct qos_entry_s *entry = NULL;
264 struct list_head send_list;
265 int ret = 0;
266
Michalis Pappas39c511f2014-05-09 18:08:27 +0800267 tcph = (struct tcphdr *)iph + iph->ihl*4;
Sage Ahn247e9cf2012-05-15 13:20:36 +0900268
269 if (B2H(ethh->h_proto) == ETH_P_IP) {
270 if (qcb->qos_list_cnt && !qos_free_list.cnt) {
271 entry = alloc_qos_entry();
272 entry->skb = skb;
273 entry->dev = dev;
YAMANE Toshiaki2d839022012-10-29 20:04:42 +0900274 netdev_dbg(dev, "qcb->qos_list_cnt=%d\n",
275 qcb->qos_list_cnt);
Sage Ahn247e9cf2012-05-15 13:20:36 +0900276 }
277
278 spin_lock_irqsave(&qcb->qos_lock, flags);
279 if (qcb->qos_list_cnt) {
Michalis Pappas39c511f2014-05-09 18:08:27 +0800280 index = get_qos_index(nic, (u8 *)iph, (u8 *)tcph);
Sage Ahn247e9cf2012-05-15 13:20:36 +0900281 if (index == -1)
282 index = qcb->qos_null_idx;
283
284 if (!entry) {
285 entry = alloc_qos_entry();
286 entry->skb = skb;
287 entry->dev = dev;
288 }
289
290 list_add_tail(&entry->list, &qcb->qos_list[index]);
291 extract_qos_list(nic, &send_list);
292 spin_unlock_irqrestore(&qcb->qos_lock, flags);
293 send_qos_list(nic, &send_list);
294 goto out;
295 }
296 spin_unlock_irqrestore(&qcb->qos_lock, flags);
297 if (entry)
298 free_qos_entry(entry);
299 }
300
301 ret = gdm_wimax_send_tx(skb, dev);
302out:
303 return ret;
304}
305
Ben Chanc047b442014-06-27 23:17:27 -0700306static int get_csr(struct qos_cb_s *qcb, u32 sfid, int mode)
Sage Ahn247e9cf2012-05-15 13:20:36 +0900307{
308 int i;
309
310 for (i = 0; i < qcb->qos_list_cnt; i++) {
Ben Chanc047b442014-06-27 23:17:27 -0700311 if (qcb->csr[i].sfid == sfid)
Sage Ahn247e9cf2012-05-15 13:20:36 +0900312 return i;
313 }
314
315 if (mode) {
316 for (i = 0; i < QOS_MAX; i++) {
Ben Chan8fea7d02014-06-27 23:17:25 -0700317 if (!qcb->csr[i].enabled) {
318 qcb->csr[i].enabled = true;
Sage Ahn247e9cf2012-05-15 13:20:36 +0900319 qcb->qos_list_cnt++;
320 return i;
321 }
322 }
323 }
324 return -1;
325}
326
327#define QOS_CHANGE_DEL 0xFC
328#define QOS_ADD 0xFD
329#define QOS_REPORT 0xFE
330
331void gdm_recv_qos_hci_packet(void *nic_ptr, u8 *buf, int size)
332{
333 struct nic *nic = nic_ptr;
Ben Chane60cc3b2014-06-27 23:17:26 -0700334 int i, index, pos;
Ben Chanc047b442014-06-27 23:17:27 -0700335 u32 sfid;
Michalis Pappas633c8a22014-05-09 18:08:24 +0800336 u8 sub_cmd_evt;
Sage Ahn247e9cf2012-05-15 13:20:36 +0900337 struct qos_cb_s *qcb = &nic->qos;
338 struct qos_entry_s *entry, *n;
339 struct list_head send_list;
340 struct list_head free_list;
341 unsigned long flags;
342
Michalis Pappas633c8a22014-05-09 18:08:24 +0800343 sub_cmd_evt = (u8)buf[4];
Sage Ahn247e9cf2012-05-15 13:20:36 +0900344
Michalis Pappas633c8a22014-05-09 18:08:24 +0800345 if (sub_cmd_evt == QOS_REPORT) {
Sage Ahn247e9cf2012-05-15 13:20:36 +0900346 spin_lock_irqsave(&qcb->qos_lock, flags);
347 for (i = 0; i < qcb->qos_list_cnt; i++) {
Ben Chanc047b442014-06-27 23:17:27 -0700348 sfid = ((buf[(i*5)+6]<<24)&0xff000000);
349 sfid += ((buf[(i*5)+7]<<16)&0xff0000);
350 sfid += ((buf[(i*5)+8]<<8)&0xff00);
351 sfid += (buf[(i*5)+9]);
352 index = get_csr(qcb, sfid, 0);
Sage Ahn247e9cf2012-05-15 13:20:36 +0900353 if (index == -1) {
354 spin_unlock_irqrestore(&qcb->qos_lock, flags);
YAMANE Toshiaki2d839022012-10-29 20:04:42 +0900355 netdev_err(nic->netdev, "QoS ERROR: No SF\n");
Sage Ahn247e9cf2012-05-15 13:20:36 +0900356 return;
357 }
Macpaul Lin13b26632012-09-11 15:55:31 +0800358 qcb->csr[index].qos_buf_count = buf[(i*5)+10];
Sage Ahn247e9cf2012-05-15 13:20:36 +0900359 }
360
361 extract_qos_list(nic, &send_list);
362 spin_unlock_irqrestore(&qcb->qos_lock, flags);
363 send_qos_list(nic, &send_list);
364 return;
Peter Huewed3852912013-02-19 18:50:20 +0100365 }
Sage Ahn247e9cf2012-05-15 13:20:36 +0900366
Michalis Pappas633c8a22014-05-09 18:08:24 +0800367 /* sub_cmd_evt == QOS_ADD || sub_cmd_evt == QOS_CHANG_DEL */
Peter Huewed3852912013-02-19 18:50:20 +0100368 pos = 6;
Ben Chanc047b442014-06-27 23:17:27 -0700369 sfid = ((buf[pos++]<<24)&0xff000000);
370 sfid += ((buf[pos++]<<16)&0xff0000);
371 sfid += ((buf[pos++]<<8)&0xff00);
372 sfid += (buf[pos++]);
Sage Ahn247e9cf2012-05-15 13:20:36 +0900373
Ben Chanc047b442014-06-27 23:17:27 -0700374 index = get_csr(qcb, sfid, 1);
Peter Huewed3852912013-02-19 18:50:20 +0100375 if (index == -1) {
376 netdev_err(nic->netdev,
Michalis Pappas39c511f2014-05-09 18:08:27 +0800377 "QoS ERROR: csr Update Error / Wrong index (%d)\n",
Peter Huewed3852912013-02-19 18:50:20 +0100378 index);
379 return;
380 }
Sage Ahn247e9cf2012-05-15 13:20:36 +0900381
Michalis Pappas633c8a22014-05-09 18:08:24 +0800382 if (sub_cmd_evt == QOS_ADD) {
YAMANE Toshiaki2d839022012-10-29 20:04:42 +0900383 netdev_dbg(nic->netdev, "QOS_ADD SFID = 0x%x, index=%d\n",
Ben Chanc047b442014-06-27 23:17:27 -0700384 sfid, index);
Sage Ahn247e9cf2012-05-15 13:20:36 +0900385
386 spin_lock_irqsave(&qcb->qos_lock, flags);
Ben Chanc047b442014-06-27 23:17:27 -0700387 qcb->csr[index].sfid = sfid;
Macpaul Lin13b26632012-09-11 15:55:31 +0800388 qcb->csr[index].classifier_rule_en = ((buf[pos++]<<8)&0xff00);
389 qcb->csr[index].classifier_rule_en += buf[pos++];
390 if (qcb->csr[index].classifier_rule_en == 0)
Sage Ahn247e9cf2012-05-15 13:20:36 +0900391 qcb->qos_null_idx = index;
Macpaul Lin13b26632012-09-11 15:55:31 +0800392 qcb->csr[index].ip2s_mask = buf[pos++];
393 qcb->csr[index].ip2s_lo = buf[pos++];
394 qcb->csr[index].ip2s_hi = buf[pos++];
395 qcb->csr[index].protocol = buf[pos++];
396 qcb->csr[index].ipsrc_addrmask[0] = buf[pos++];
397 qcb->csr[index].ipsrc_addrmask[1] = buf[pos++];
398 qcb->csr[index].ipsrc_addrmask[2] = buf[pos++];
399 qcb->csr[index].ipsrc_addrmask[3] = buf[pos++];
400 qcb->csr[index].ipsrc_addr[0] = buf[pos++];
401 qcb->csr[index].ipsrc_addr[1] = buf[pos++];
402 qcb->csr[index].ipsrc_addr[2] = buf[pos++];
403 qcb->csr[index].ipsrc_addr[3] = buf[pos++];
404 qcb->csr[index].ipdst_addrmask[0] = buf[pos++];
405 qcb->csr[index].ipdst_addrmask[1] = buf[pos++];
406 qcb->csr[index].ipdst_addrmask[2] = buf[pos++];
407 qcb->csr[index].ipdst_addrmask[3] = buf[pos++];
408 qcb->csr[index].ipdst_addr[0] = buf[pos++];
409 qcb->csr[index].ipdst_addr[1] = buf[pos++];
410 qcb->csr[index].ipdst_addr[2] = buf[pos++];
411 qcb->csr[index].ipdst_addr[3] = buf[pos++];
412 qcb->csr[index].srcport_lo = ((buf[pos++]<<8)&0xff00);
413 qcb->csr[index].srcport_lo += buf[pos++];
414 qcb->csr[index].srcport_hi = ((buf[pos++]<<8)&0xff00);
415 qcb->csr[index].srcport_hi += buf[pos++];
416 qcb->csr[index].dstport_lo = ((buf[pos++]<<8)&0xff00);
417 qcb->csr[index].dstport_lo += buf[pos++];
418 qcb->csr[index].dstport_hi = ((buf[pos++]<<8)&0xff00);
419 qcb->csr[index].dstport_hi += buf[pos++];
Sage Ahn247e9cf2012-05-15 13:20:36 +0900420
421 qcb->qos_limit_size = 254/qcb->qos_list_cnt;
422 spin_unlock_irqrestore(&qcb->qos_lock, flags);
Michalis Pappas633c8a22014-05-09 18:08:24 +0800423 } else if (sub_cmd_evt == QOS_CHANGE_DEL) {
YAMANE Toshiaki2d839022012-10-29 20:04:42 +0900424 netdev_dbg(nic->netdev, "QOS_CHANGE_DEL SFID = 0x%x, index=%d\n",
Ben Chanc047b442014-06-27 23:17:27 -0700425 sfid, index);
Sage Ahn247e9cf2012-05-15 13:20:36 +0900426
427 INIT_LIST_HEAD(&free_list);
428
429 spin_lock_irqsave(&qcb->qos_lock, flags);
Ben Chan8fea7d02014-06-27 23:17:25 -0700430 qcb->csr[index].enabled = false;
Sage Ahn247e9cf2012-05-15 13:20:36 +0900431 qcb->qos_list_cnt--;
432 qcb->qos_limit_size = 254/qcb->qos_list_cnt;
433
Davide Gianfortea3709f72014-05-23 22:06:44 +0200434 list_for_each_entry_safe(entry, n, &qcb->qos_list[index],
435 list) {
Sage Ahn247e9cf2012-05-15 13:20:36 +0900436 list_move_tail(&entry->list, &free_list);
437 }
438 spin_unlock_irqrestore(&qcb->qos_lock, flags);
439 free_qos_entry_list(&free_list);
440 }
441}