wil6210_uapi.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*
  2. * Copyright (c) 2014 Qualcomm Atheros, Inc.
  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
  11. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  12. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  13. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  14. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. #ifndef __WIL6210_UAPI_H__
  17. #define __WIL6210_UAPI_H__
  18. #if !defined(__KERNEL__)
  19. #define __user
  20. #endif
  21. #include <linux/sockios.h>
  22. /* Numbers SIOCDEVPRIVATE and SIOCDEVPRIVATE + 1
  23. * are used by Android devices to implement PNO (preferred network offload).
  24. * Albeit it is temporary solution, use different numbers to avoid conflicts
  25. */
  26. /**
  27. * Perform 32-bit I/O operation to the card memory
  28. *
  29. * User code should arrange data in memory like this:
  30. *
  31. * struct wil_memio io;
  32. * struct ifreq ifr = {
  33. * .ifr_data = &io,
  34. * };
  35. */
  36. #define WIL_IOCTL_MEMIO (SIOCDEVPRIVATE + 2)
  37. /**
  38. * Perform block I/O operation to the card memory
  39. *
  40. * User code should arrange data in memory like this:
  41. *
  42. * void *buf;
  43. * struct wil_memio_block io = {
  44. * .block = buf,
  45. * };
  46. * struct ifreq ifr = {
  47. * .ifr_data = &io,
  48. * };
  49. */
  50. #define WIL_IOCTL_MEMIO_BLOCK (SIOCDEVPRIVATE + 3)
  51. /**
  52. * operation to perform
  53. *
  54. * @wil_mmio_op_mask - bits defining operation,
  55. * @wil_mmio_addr_mask - bits defining addressing mode
  56. */
  57. enum wil_memio_op {
  58. wil_mmio_read = 0,
  59. wil_mmio_write = 1,
  60. wil_mmio_op_mask = 0xff,
  61. wil_mmio_addr_linker = 0 << 8,
  62. wil_mmio_addr_ahb = 1 << 8,
  63. wil_mmio_addr_bar = 2 << 8,
  64. wil_mmio_addr_mask = 0xff00,
  65. };
  66. struct wil_memio {
  67. uint32_t op; /* enum wil_memio_op */
  68. uint32_t addr; /* should be 32-bit aligned */
  69. uint32_t val;
  70. };
  71. struct wil_memio_block {
  72. uint32_t op; /* enum wil_memio_op */
  73. uint32_t addr; /* should be 32-bit aligned */
  74. uint32_t size; /* should be multiple of 4 */
  75. void __user *block; /* block address */
  76. };
  77. #endif /* __WIL6210_UAPI_H__ */