xref: /linux/drivers/staging/rtl8712/rtl871x_ioctl.h (revision 4f2c0a4acffbec01079c28f839422e64ddeff004)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __IOCTL_H
3 #define __IOCTL_H
4 
5 #include "osdep_service.h"
6 #include "drv_types.h"
7 
8 #ifndef OID_802_11_CAPABILITY
9 	#define OID_802_11_CAPABILITY                   0x0d010122
10 #endif
11 
12 #ifndef OID_802_11_PMKID
13 	#define OID_802_11_PMKID                        0x0d010123
14 #endif
15 
16 /* For DDK-defined OIDs*/
17 #define OID_NDIS_SEG1	0x00010100
18 #define OID_NDIS_SEG2	0x00010200
19 #define OID_NDIS_SEG3	0x00020100
20 #define OID_NDIS_SEG4	0x01010100
21 #define OID_NDIS_SEG5	0x01020100
22 #define OID_NDIS_SEG6	0x01020200
23 #define OID_NDIS_SEG7	0xFD010100
24 #define OID_NDIS_SEG8	0x0D010100
25 #define OID_NDIS_SEG9	0x0D010200
26 #define OID_NDIS_SEG10	0x0D020200
27 #define SZ_OID_NDIS_SEG1	23
28 #define SZ_OID_NDIS_SEG2	3
29 #define SZ_OID_NDIS_SEG3	6
30 #define SZ_OID_NDIS_SEG4	6
31 #define SZ_OID_NDIS_SEG5	4
32 #define SZ_OID_NDIS_SEG6	8
33 #define SZ_OID_NDIS_SEG7	7
34 #define SZ_OID_NDIS_SEG8	36
35 #define SZ_OID_NDIS_SEG9	24
36 #define SZ_OID_NDIS_SEG10	19
37 
38 /* For Realtek-defined OIDs*/
39 #define OID_MP_SEG1	0xFF871100
40 #define OID_MP_SEG2	0xFF818000
41 #define OID_MP_SEG3	0xFF818700
42 #define OID_MP_SEG4	0xFF011100
43 
44 enum oid_type {
45 	QUERY_OID,
46 	SET_OID
47 };
48 
49 struct oid_funs_node {
50 	unsigned int oid_start; /*the starting number for OID*/
51 	unsigned int oid_end; /*the ending number for OID*/
52 	struct oid_obj_priv *node_array;
53 	unsigned int array_sz; /*the size of node_array*/
54 	int query_counter; /*count the number of query hits for this segment*/
55 	int set_counter; /*count the number of set hits for this segment*/
56 };
57 
58 struct oid_par_priv {
59 	void	*adapter_context;
60 	uint oid;
61 	void *information_buf;
62 	unsigned long information_buf_len;
63 	unsigned long *bytes_rw;
64 	unsigned long *bytes_needed;
65 	enum oid_type	type_of_oid;
66 	unsigned int dbg;
67 };
68 
69 struct oid_obj_priv {
70 	unsigned char	dbg; /* 0: without OID debug message
71 			      * 1: with OID debug message
72 			      */
73 	uint (*oidfuns)(struct oid_par_priv *poid_par_priv);
74 };
75 
76 uint oid_null_function(struct oid_par_priv *poid_par_priv);
77 
78 extern struct iw_handler_def  r871x_handlers_def;
79 
80 uint drv_query_info(struct net_device *MiniportAdapterContext,
81 		    uint Oid,
82 		    void *InformationBuffer,
83 		    u32 InformationBufferLength,
84 		    u32 *BytesWritten,
85 		    u32 *BytesNeeded);
86 
87 uint drv_set_info(struct net_device *MiniportAdapterContext,
88 		  uint Oid,
89 		  void *InformationBuffer,
90 		  u32 InformationBufferLength,
91 		  u32 *BytesRead,
92 		  u32 *BytesNeeded);
93 
94 #endif
95