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