usb.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. * Copyright (c) 2011 Broadcom Corporation
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for any
  5. * purpose with or without fee is hereby granted, provided that the above
  6. * copyright notice and this permission notice appear in all copies.
  7. *
  8. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  9. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  10. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
  11. * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  12. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
  13. * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  14. * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. #ifndef BRCMFMAC_USB_H
  17. #define BRCMFMAC_USB_H
  18. enum brcmf_usb_state {
  19. BCMFMAC_USB_STATE_DL_PENDING,
  20. BCMFMAC_USB_STATE_DL_DONE,
  21. BCMFMAC_USB_STATE_UP,
  22. BCMFMAC_USB_STATE_DOWN,
  23. BCMFMAC_USB_STATE_PNP_FWDL,
  24. BCMFMAC_USB_STATE_DISCONNECT,
  25. BCMFMAC_USB_STATE_SLEEP
  26. };
  27. enum brcmf_usb_pnp_state {
  28. BCMFMAC_USB_PNP_DISCONNECT,
  29. BCMFMAC_USB_PNP_SLEEP,
  30. BCMFMAC_USB_PNP_RESUME,
  31. };
  32. struct brcmf_stats {
  33. u32 tx_errors;
  34. u32 tx_packets;
  35. u32 tx_multicast;
  36. u32 tx_ctlpkts;
  37. u32 tx_ctlerrs;
  38. u32 tx_dropped;
  39. u32 tx_flushed;
  40. u32 rx_errors;
  41. u32 rx_packets;
  42. u32 rx_multicast;
  43. u32 rx_ctlpkts;
  44. u32 rx_ctlerrs;
  45. u32 rx_dropped;
  46. u32 rx_flushed;
  47. };
  48. struct brcmf_usb_attrib {
  49. int bustype;
  50. int vid;
  51. int pid;
  52. int devid;
  53. int chiprev; /* chip revsion number */
  54. int mtu;
  55. int nchan; /* Data Channels */
  56. int has_2nd_bulk_in_ep;
  57. };
  58. struct brcmf_usbdev_info;
  59. struct brcmf_usbdev {
  60. struct brcmf_bus *bus;
  61. struct brcmf_usbdev_info *devinfo;
  62. enum brcmf_usb_state state;
  63. struct brcmf_stats stats;
  64. int ntxq, nrxq, rxsize;
  65. u32 bus_mtu;
  66. struct brcmf_usb_attrib attrib;
  67. };
  68. /* IO Request Block (IRB) */
  69. struct brcmf_usbreq {
  70. struct list_head list;
  71. struct brcmf_usbdev_info *devinfo;
  72. struct urb *urb;
  73. struct sk_buff *skb;
  74. };
  75. #endif /* BRCMFMAC_USB_H */