usb.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. * Atheros AR9170 USB driver
  3. *
  4. * Driver specific definitions
  5. *
  6. * Copyright 2008, Johannes Berg <johannes@sipsolutions.net>
  7. * Copyright 2009, Christian Lamparter <chunkeey@web.de>
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation; either version 2 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; see the file COPYING. If not, see
  21. * http://www.gnu.org/licenses/.
  22. *
  23. * This file incorporates work covered by the following copyright and
  24. * permission notice:
  25. * Copyright (c) 2007-2008 Atheros Communications, Inc.
  26. *
  27. * Permission to use, copy, modify, and/or distribute this software for any
  28. * purpose with or without fee is hereby granted, provided that the above
  29. * copyright notice and this permission notice appear in all copies.
  30. *
  31. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  32. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  33. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  34. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  35. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  36. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  37. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  38. */
  39. #ifndef __USB_H
  40. #define __USB_H
  41. #include <linux/usb.h>
  42. #include <linux/completion.h>
  43. #include <linux/spinlock.h>
  44. #include <linux/leds.h>
  45. #include <net/cfg80211.h>
  46. #include <net/mac80211.h>
  47. #include <linux/firmware.h>
  48. #include "eeprom.h"
  49. #include "hw.h"
  50. #include "ar9170.h"
  51. #define AR9170_NUM_RX_URBS 16
  52. #define AR9170_NUM_TX_URBS 8
  53. struct firmware;
  54. struct ar9170_usb {
  55. struct ar9170 common;
  56. struct usb_device *udev;
  57. struct usb_interface *intf;
  58. struct usb_anchor rx_submitted;
  59. struct usb_anchor tx_pending;
  60. struct usb_anchor tx_submitted;
  61. bool req_one_stage_fw;
  62. spinlock_t tx_urb_lock;
  63. atomic_t tx_submitted_urbs;
  64. unsigned int tx_pending_urbs;
  65. struct completion cmd_wait;
  66. struct completion firmware_loading_complete;
  67. int readlen;
  68. u8 *readbuf;
  69. const struct firmware *init_values;
  70. const struct firmware *firmware;
  71. };
  72. #endif /* __USB_H */