gdm_sdio.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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_SDIO_H__
  14. #define __GDM72XX_GDM_SDIO_H__
  15. #include <linux/types.h>
  16. #include <linux/time.h>
  17. #define MAX_NR_SDU_BUF 64
  18. struct sdio_tx {
  19. struct list_head list;
  20. struct tx_cxt *tx_cxt;
  21. u8 *buf;
  22. int len;
  23. void (*callback)(void *cb_data);
  24. void *cb_data;
  25. };
  26. struct tx_cxt {
  27. struct list_head free_list;
  28. struct list_head sdu_list;
  29. struct list_head hci_list;
  30. struct timeval sdu_stamp;
  31. u8 *sdu_buf;
  32. spinlock_t lock;
  33. int can_send;
  34. int stop_sdu_tx;
  35. };
  36. struct sdio_rx {
  37. struct list_head list;
  38. struct rx_cxt *rx_cxt;
  39. void (*callback)(void *cb_data, void *data, int len);
  40. void *cb_data;
  41. };
  42. struct rx_cxt {
  43. struct list_head free_list;
  44. struct list_head req_list;
  45. u8 *rx_buf;
  46. spinlock_t lock;
  47. };
  48. struct sdiowm_dev {
  49. struct sdio_func *func;
  50. struct tx_cxt tx;
  51. struct rx_cxt rx;
  52. struct work_struct ws;
  53. };
  54. #endif /* __GDM72XX_GDM_SDIO_H__ */