xref: /OK3568_Linux_fs/kernel/drivers/net/wireless/rockchip_wlan/mvl88w8977/mlan/mlan_uap.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /** @file mlan_uap.h
2  *
3  *  @brief This file contains related macros, enum, and struct
4  *  of uap functionalities
5  *
6  *  Copyright (C) 2009-2017, Marvell International Ltd.
7  *
8  *  This software file (the "File") is distributed by Marvell International
9  *  Ltd. under the terms of the GNU General Public License Version 2, June 1991
10  *  (the "License").  You may use, redistribute and/or modify this File in
11  *  accordance with the terms and conditions of the License, a copy of which
12  *  is available by writing to the Free Software Foundation, Inc.,
13  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
14  *  worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
15  *
16  *  THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
17  *  IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
18  *  ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
19  *  this warranty disclaimer.
20  */
21 
22 /********************************************************
23 Change log:
24     02/05/2009: initial version
25 ********************************************************/
26 
27 #ifndef _MLAN_UAP_H_
28 #define _MLAN_UAP_H_
29 
30 #ifdef BIG_ENDIAN_SUPPORT
31 /** Convert TxPD to little endian format from CPU format */
32 #define uap_endian_convert_TxPD(x)                                          \
33 	{                                                                   \
34 	    (x)->tx_pkt_length = wlan_cpu_to_le16((x)->tx_pkt_length);      \
35 	    (x)->tx_pkt_offset = wlan_cpu_to_le16((x)->tx_pkt_offset);      \
36 	    (x)->tx_pkt_type   = wlan_cpu_to_le16((x)->tx_pkt_type);        \
37 	    (x)->tx_control    = wlan_cpu_to_le32((x)->tx_control);         \
38         (x)->tx_control_1  = wlan_cpu_to_le32((x)->tx_control_1);         \
39 	}
40 /** Convert RxPD from little endian format to CPU format */
41 #define uap_endian_convert_RxPD(x)                                          \
42 	{                                                                   \
43 	    (x)->rx_pkt_length = wlan_le16_to_cpu((x)->rx_pkt_length);      \
44 	    (x)->rx_pkt_offset = wlan_le16_to_cpu((x)->rx_pkt_offset);      \
45 	    (x)->rx_pkt_type   = wlan_le16_to_cpu((x)->rx_pkt_type);        \
46 	    (x)->seq_num       = wlan_le16_to_cpu((x)->seq_num);            \
47         (x)->rx_info       = wlan_le32_to_cpu((x)->rx_info);            \
48 	}
49 #else
50 /** Convert TxPD to little endian format from CPU format */
51 #define uap_endian_convert_TxPD(x)  do {} while (0)
52 /** Convert RxPD from little endian format to CPU format */
53 #define uap_endian_convert_RxPD(x)  do {} while (0)
54 #endif /* BIG_ENDIAN_SUPPORT */
55 
56 mlan_status wlan_uap_get_channel(IN pmlan_private pmpriv);
57 
58 mlan_status wlan_uap_set_channel(IN pmlan_private pmpriv,
59 				 IN Band_Config_t uap_band_cfg,
60 				 IN t_u8 channel);
61 
62 mlan_status wlan_uap_get_beacon_dtim(IN pmlan_private pmpriv);
63 
64 mlan_status wlan_ops_uap_ioctl(t_void *adapter, pmlan_ioctl_req pioctl_req);
65 
66 mlan_status wlan_ops_uap_prepare_cmd(IN t_void *priv,
67 				     IN t_u16 cmd_no,
68 				     IN t_u16 cmd_action,
69 				     IN t_u32 cmd_oid,
70 				     IN t_void *pioctl_buf,
71 				     IN t_void *pdata_buf, IN t_void *pcmd_buf);
72 
73 mlan_status wlan_ops_uap_process_cmdresp(IN t_void *priv,
74 					 IN t_u16 cmdresp_no,
75 					 IN t_void *pcmd_buf,
76 					 IN t_void *pioctl);
77 
78 mlan_status wlan_ops_uap_process_rx_packet(IN t_void *adapter,
79 					   IN pmlan_buffer pmbuf);
80 
81 mlan_status wlan_ops_uap_process_event(IN t_void *priv);
82 
83 t_void *wlan_ops_uap_process_txpd(IN t_void *priv, IN pmlan_buffer pmbuf);
84 
85 mlan_status wlan_ops_uap_init_cmd(IN t_void *priv, IN t_u8 first_bss);
86 
87 #endif /* _MLAN_UAP_H_ */
88