Merge branch 'for-next' of git://git.samba.org/sfrench/cifs-2.6
[firefly-linux-kernel-4.4.55.git] / drivers / staging / gdm72xx / gdm_qos.h
1 /*
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
14 #if !defined(GDM_QOS_H_20090403)
15 #define GDM_QOS_H_20090403
16
17 #include <linux/types.h>
18 #include <linux/usb.h>
19 #include <linux/list.h>
20
21 #define BOOLEAN u8
22
23 #define QOS_MAX                         16
24 #define IPTYPEOFSERVICE                 0x8000
25 #define PROTOCOL                        0x4000
26 #define IPMASKEDSRCADDRESS              0x2000
27 #define IPMASKEDDSTADDRESS              0x1000
28 #define PROTOCOLSRCPORTRANGE            0x800
29 #define PROTOCOLDSTPORTRANGE            0x400
30 #define DSTMACADDR                      0x200
31 #define SRCMACADDR                      0x100
32 #define ETHERTYPE                       0x80
33 #define IEEE802_1DUSERPRIORITY          0x40
34 #define IEEE802_1QVLANID                0x10
35
36 struct gdm_wimax_csr_s {
37         BOOLEAN         enabled;
38         u32             SFID;
39         u8              qos_buf_count;
40         u16             classifier_rule_en;
41         u8              ip2s_lo;
42         u8              ip2s_hi;
43         u8              ip2s_mask;
44         u8              protocol;
45         u8              ipsrc_addr[16];
46         u8              ipsrc_addrmask[16];
47         u8              ipdst_addr[16];
48         u8              ipdst_addrmask[16];
49         u16             srcport_lo;
50         u16             srcport_hi;
51         u16             dstport_lo;
52         u16             dstport_hi;
53 };
54
55 struct qos_entry_s {
56         struct list_head        list;
57         struct sk_buff          *skb;
58         struct net_device       *dev;
59
60 };
61
62 struct qos_cb_s {
63         struct list_head        qos_list[QOS_MAX];
64         u32                     qos_list_cnt;
65         u32                     qos_null_idx;
66         struct gdm_wimax_csr_s  csr[QOS_MAX];
67         spinlock_t              qos_lock;
68         u32                     qos_limit_size;
69 };
70
71 void gdm_qos_init(void *nic_ptr);
72 void gdm_qos_release_list(void *nic_ptr);
73 int gdm_qos_send_hci_pkt(struct sk_buff *skb, struct net_device *dev);
74 void gdm_recv_qos_hci_packet(void *nic_ptr, u8 *buf, int size);
75
76 #endif