gdm_qos.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. #ifndef __GDM72XX_GDM_QOS_H__
  14. #define __GDM72XX_GDM_QOS_H__
  15. #include <linux/types.h>
  16. #include <linux/usb.h>
  17. #include <linux/list.h>
  18. #define QOS_MAX 16
  19. #define IPTYPEOFSERVICE 0x8000
  20. #define PROTOCOL 0x4000
  21. #define IPMASKEDSRCADDRESS 0x2000
  22. #define IPMASKEDDSTADDRESS 0x1000
  23. #define PROTOCOLSRCPORTRANGE 0x800
  24. #define PROTOCOLDSTPORTRANGE 0x400
  25. #define DSTMACADDR 0x200
  26. #define SRCMACADDR 0x100
  27. #define ETHERTYPE 0x80
  28. #define IEEE802_1DUSERPRIORITY 0x40
  29. #define IEEE802_1QVLANID 0x10
  30. struct gdm_wimax_csr_s {
  31. bool enabled;
  32. u32 sfid;
  33. u8 qos_buf_count;
  34. u16 classifier_rule_en;
  35. u8 ip2s_lo;
  36. u8 ip2s_hi;
  37. u8 ip2s_mask;
  38. u8 protocol;
  39. u8 ipsrc_addr[16];
  40. u8 ipsrc_addrmask[16];
  41. u8 ipdst_addr[16];
  42. u8 ipdst_addrmask[16];
  43. u16 srcport_lo;
  44. u16 srcport_hi;
  45. u16 dstport_lo;
  46. u16 dstport_hi;
  47. };
  48. struct qos_entry_s {
  49. struct list_head list;
  50. struct sk_buff *skb;
  51. struct net_device *dev;
  52. };
  53. struct qos_cb_s {
  54. struct list_head qos_list[QOS_MAX];
  55. int qos_list_cnt;
  56. int qos_null_idx;
  57. struct gdm_wimax_csr_s csr[QOS_MAX];
  58. spinlock_t qos_lock;
  59. int qos_limit_size;
  60. };
  61. void gdm_qos_init(void *nic_ptr);
  62. void gdm_qos_release_list(void *nic_ptr);
  63. int gdm_qos_send_hci_pkt(struct sk_buff *skb, struct net_device *dev);
  64. void gdm_recv_qos_hci_packet(void *nic_ptr, u8 *buf, int size);
  65. #endif /* __GDM72XX_GDM_QOS_H__ */