wireless.h 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
  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. * You should have received a copy of the GNU General Public License along with
  15. * this program; if not, write to the Free Software Foundation, Inc.,
  16. * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
  17. *
  18. *
  19. ******************************************************************************/
  20. #ifndef _LINUX_WIRELESS_H
  21. #define _LINUX_WIRELESS_H
  22. /***************************** INCLUDES *****************************/
  23. #if 0
  24. #include <linux/types.h> /* for __u* and __s* typedefs */
  25. #include <linux/socket.h> /* for "struct sockaddr" et al */
  26. #include <linux/if.h> /* for IFNAMSIZ and co... */
  27. #else
  28. #define __user
  29. /* typedef uint16_t __u16; */
  30. #include <sys/socket.h> /* for "struct sockaddr" et al */
  31. #include <net/if.h> /* for IFNAMSIZ and co... */
  32. #endif
  33. /****************************** TYPES ******************************/
  34. #ifdef CONFIG_COMPAT
  35. struct compat_iw_point {
  36. compat_caddr_t pointer;
  37. __u16 length;
  38. __u16 flags;
  39. };
  40. #endif
  41. /* --------------------------- SUBTYPES --------------------------- */
  42. /*
  43. * For all data larger than 16 octets, we need to use a
  44. * pointer to memory allocated in user space.
  45. */
  46. struct iw_point {
  47. void __user *pointer; /* Pointer to the data (in user space) */
  48. __u16 length; /* number of fields or size in bytes */
  49. __u16 flags; /* Optional params */
  50. };
  51. /* ------------------------ IOCTL REQUEST ------------------------ */
  52. /*
  53. * This structure defines the payload of an ioctl, and is used
  54. * below.
  55. *
  56. * Note that this structure should fit on the memory footprint
  57. * of iwreq (which is the same as ifreq), which mean a max size of
  58. * 16 octets = 128 bits. Warning, pointers might be 64 bits wide...
  59. * You should check this when increasing the structures defined
  60. * above in this file...
  61. */
  62. union iwreq_data {
  63. /* Config - generic */
  64. char name[IFNAMSIZ];
  65. /* Name : used to verify the presence of wireless extensions.
  66. * Name of the protocol/provider... */
  67. struct iw_point data; /* Other large parameters */
  68. };
  69. /*
  70. * The structure to exchange data for ioctl.
  71. * This structure is the same as 'struct ifreq', but (re)defined for
  72. * convenience...
  73. * Do I need to remind you about structure size (32 octets) ?
  74. */
  75. struct iwreq {
  76. union {
  77. char ifrn_name[IFNAMSIZ]; /* if name, e.g. "eth0" */
  78. } ifr_ifrn;
  79. /* Data part (defined just above) */
  80. union iwreq_data u;
  81. };
  82. #endif /* _LINUX_WIRELESS_H */