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