usb.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /*
  2. * This file contains definitions for mwifiex USB interface driver.
  3. *
  4. * Copyright (C) 2012, Marvell International Ltd.
  5. *
  6. * This software file (the "File") is distributed by Marvell International
  7. * Ltd. under the terms of the GNU General Public License Version 2, June 1991
  8. * (the "License"). You may use, redistribute and/or modify this File in
  9. * accordance with the terms and conditions of the License, a copy of which
  10. * is available by writing to the Free Software Foundation, Inc.,
  11. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
  12. * worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
  13. *
  14. * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
  15. * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
  16. * ARE EXPRESSLY DISCLAIMED. The License provides additional details about
  17. * this warranty disclaimer.
  18. */
  19. #ifndef _MWIFIEX_USB_H
  20. #define _MWIFIEX_USB_H
  21. #include <linux/usb.h>
  22. #define USB8XXX_VID 0x1286
  23. #define USB8797_PID_1 0x2043
  24. #define USB8797_PID_2 0x2044
  25. #define USB8897_PID_1 0x2045
  26. #define USB8897_PID_2 0x2046
  27. #define USB8XXX_FW_DNLD 1
  28. #define USB8XXX_FW_READY 2
  29. #define USB8XXX_FW_MAX_RETRY 3
  30. #define MWIFIEX_TX_DATA_URB 6
  31. #define MWIFIEX_RX_DATA_URB 6
  32. #define MWIFIEX_USB_TIMEOUT 100
  33. #define USB8797_DEFAULT_FW_NAME "mrvl/usb8797_uapsta.bin"
  34. #define USB8897_DEFAULT_FW_NAME "mrvl/usb8897_uapsta.bin"
  35. #define FW_DNLD_TX_BUF_SIZE 620
  36. #define FW_DNLD_RX_BUF_SIZE 2048
  37. #define FW_HAS_LAST_BLOCK 0x00000004
  38. #define FW_DATA_XMIT_SIZE \
  39. (sizeof(struct fw_header) + dlen + sizeof(u32))
  40. struct urb_context {
  41. struct mwifiex_adapter *adapter;
  42. struct sk_buff *skb;
  43. struct urb *urb;
  44. u8 ep;
  45. };
  46. struct usb_card_rec {
  47. struct mwifiex_adapter *adapter;
  48. struct usb_device *udev;
  49. struct usb_interface *intf;
  50. u8 rx_cmd_ep;
  51. struct urb_context rx_cmd;
  52. atomic_t rx_cmd_urb_pending;
  53. struct urb_context rx_data_list[MWIFIEX_RX_DATA_URB];
  54. u8 usb_boot_state;
  55. u8 rx_data_ep;
  56. atomic_t rx_data_urb_pending;
  57. u8 tx_data_ep;
  58. u8 tx_cmd_ep;
  59. atomic_t tx_data_urb_pending;
  60. atomic_t tx_cmd_urb_pending;
  61. int bulk_out_maxpktsize;
  62. struct urb_context tx_cmd;
  63. int tx_data_ix;
  64. struct urb_context tx_data_list[MWIFIEX_TX_DATA_URB];
  65. };
  66. struct fw_header {
  67. __le32 dnld_cmd;
  68. __le32 base_addr;
  69. __le32 data_len;
  70. __le32 crc;
  71. };
  72. struct fw_sync_header {
  73. __le32 cmd;
  74. __le32 seq_num;
  75. };
  76. struct fw_data {
  77. struct fw_header fw_hdr;
  78. __le32 seq_num;
  79. u8 data[1];
  80. };
  81. /* This function is called after the card has woken up. */
  82. static inline int
  83. mwifiex_pm_wakeup_card_complete(struct mwifiex_adapter *adapter)
  84. {
  85. return 0;
  86. }
  87. #endif /*_MWIFIEX_USB_H */