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