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