wireless.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2007 - 2017 Realtek Corporation.
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms of version 2 of the GNU General Public License as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  12. * more details.
  13. *
  14. *****************************************************************************/
  15. #ifndef _LINUX_WIRELESS_H
  16. #define _LINUX_WIRELESS_H
  17. /***************************** INCLUDES *****************************/
  18. #if 0
  19. #include <linux/types.h> /* for __u* and __s* typedefs */
  20. #include <linux/socket.h> /* for "struct sockaddr" et al */
  21. #include <linux/if.h> /* for IFNAMSIZ and co... */
  22. #else
  23. #define __user
  24. /* typedef uint16_t __u16; */
  25. #include <sys/socket.h> /* for "struct sockaddr" et al */
  26. #include <net/if.h> /* for IFNAMSIZ and co... */
  27. #endif
  28. /****************************** TYPES ******************************/
  29. #ifdef CONFIG_COMPAT
  30. struct compat_iw_point {
  31. compat_caddr_t pointer;
  32. __u16 length;
  33. __u16 flags;
  34. };
  35. #endif
  36. /* --------------------------- SUBTYPES --------------------------- */
  37. /*
  38. * For all data larger than 16 octets, we need to use a
  39. * pointer to memory allocated in user space.
  40. */
  41. struct iw_point {
  42. void __user *pointer; /* Pointer to the data (in user space) */
  43. __u16 length; /* number of fields or size in bytes */
  44. __u16 flags; /* Optional params */
  45. };
  46. /* ------------------------ IOCTL REQUEST ------------------------ */
  47. /*
  48. * This structure defines the payload of an ioctl, and is used
  49. * below.
  50. *
  51. * Note that this structure should fit on the memory footprint
  52. * of iwreq (which is the same as ifreq), which mean a max size of
  53. * 16 octets = 128 bits. Warning, pointers might be 64 bits wide...
  54. * You should check this when increasing the structures defined
  55. * above in this file...
  56. */
  57. union iwreq_data {
  58. /* Config - generic */
  59. char name[IFNAMSIZ];
  60. /* Name : used to verify the presence of wireless extensions.
  61. * Name of the protocol/provider... */
  62. struct iw_point data; /* Other large parameters */
  63. };
  64. /*
  65. * The structure to exchange data for ioctl.
  66. * This structure is the same as 'struct ifreq', but (re)defined for
  67. * convenience...
  68. * Do I need to remind you about structure size (32 octets) ?
  69. */
  70. struct iwreq {
  71. union {
  72. char ifrn_name[IFNAMSIZ]; /* if name, e.g. "eth0" */
  73. } ifr_ifrn;
  74. /* Data part (defined just above) */
  75. union iwreq_data u;
  76. };
  77. #endif /* _LINUX_WIRELESS_H */