gdm_usb.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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_USB_H__
  14. #define __GDM72XX_GDM_USB_H__
  15. #include <linux/types.h>
  16. #include <linux/usb.h>
  17. #include <linux/list.h>
  18. #define B_DIFF_DL_DRV (1 << 4)
  19. #define B_DOWNLOAD (1 << 5)
  20. #define MAX_NR_SDU_BUF 64
  21. struct usb_tx {
  22. struct list_head list;
  23. #if defined(CONFIG_WIMAX_GDM72XX_USB_PM) || defined(CONFIG_WIMAX_GDM72XX_K_MODE)
  24. struct list_head p_list;
  25. #endif
  26. struct tx_cxt *tx_cxt;
  27. struct urb *urb;
  28. u8 *buf;
  29. void (*callback)(void *cb_data);
  30. void *cb_data;
  31. };
  32. struct tx_cxt {
  33. struct list_head free_list;
  34. struct list_head sdu_list;
  35. struct list_head hci_list;
  36. #if defined(CONFIG_WIMAX_GDM72XX_USB_PM) || defined(CONFIG_WIMAX_GDM72XX_K_MODE)
  37. struct list_head pending_list;
  38. #endif
  39. spinlock_t lock;
  40. };
  41. struct usb_rx {
  42. struct list_head list;
  43. struct rx_cxt *rx_cxt;
  44. struct urb *urb;
  45. u8 *buf;
  46. void (*callback)(void *cb_data, void *data, int len);
  47. void *cb_data;
  48. };
  49. struct rx_cxt {
  50. struct list_head free_list;
  51. struct list_head used_list;
  52. spinlock_t lock;
  53. };
  54. struct usbwm_dev {
  55. struct usb_device *usbdev;
  56. #ifdef CONFIG_WIMAX_GDM72XX_USB_PM
  57. struct work_struct pm_ws;
  58. struct usb_interface *intf;
  59. #endif
  60. #ifdef CONFIG_WIMAX_GDM72XX_K_MODE
  61. int bw_switch;
  62. struct list_head list;
  63. #endif
  64. struct tx_cxt tx;
  65. struct rx_cxt rx;
  66. int padding;
  67. };
  68. #endif /* __GDM72XX_GDM_USB_H__ */