blob: 34ece3a39f305c1cb6827aef8ba05575ad938ec3 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Gopichand Nakkala92f07d82013-01-08 21:16:34 -08002 * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
3 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 *
7 * Permission to use, copy, modify, and/or distribute this software for
8 * any purpose with or without fee is hereby granted, provided that the
9 * above copyright notice and this permission notice appear in all
10 * copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 * PERFORMANCE OF THIS SOFTWARE.
20 */
21/*
Jeff Johnson32d95a32012-09-10 13:15:23 -070022 * Copyright (c) 2012, The Linux Foundation. All rights reserved.
Jeff Johnson295189b2012-06-20 16:38:30 -070023 *
24 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
25 *
26 *
27 * Permission to use, copy, modify, and/or distribute this software for
28 * any purpose with or without fee is hereby granted, provided that the
29 * above copyright notice and this permission notice appear in all
30 * copies.
31 *
32 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
33 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
34 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
35 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
36 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
37 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
38 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
39 * PERFORMANCE OF THIS SOFTWARE.
40 */
41
42/*===========================================================================
43 \file wlan_nlink_common.h
44
45 Exports and types for the Netlink Service interface. This header file contains
46 message types and definitions that is shared between the user space service
47 (e.g. BTC service) and WLAN kernel module.
48
49 Copyright (c) 2009 QUALCOMM Incorporated.
50 All Rights Reserved.
51 Qualcomm Confidential and Proprietary
52
53===========================================================================*/
54
55#ifndef WLAN_NLINK_COMMON_H__
56#define WLAN_NLINK_COMMON_H__
57
58#include <linux/netlink.h>
59
60/*---------------------------------------------------------------------------
61 * External Functions
62 *-------------------------------------------------------------------------*/
63
64/*---------------------------------------------------------------------------
65 * Preprocessor Definitions and Constants
66 *-------------------------------------------------------------------------*/
67#define WLAN_NL_MAX_PAYLOAD 256 /* maximum size for netlink message*/
68#define WLAN_NLINK_PROTO_FAMILY NETLINK_USERSOCK
69#define WLAN_NLINK_MCAST_GRP_ID 0x01
70
71/*---------------------------------------------------------------------------
72 * Type Declarations
73 *-------------------------------------------------------------------------*/
74
75/*
76 * The following enum defines the target service within WLAN driver for which the
77 * message is intended for. Each service along with its counterpart
78 * in the user space, define a set of messages they recognize.
79 * Each of this message will have an header of type tAniMsgHdr defined below.
80 * Each Netlink message to/from a kernel module will contain only one
81 * message which is preceded by a tAniMsgHdr. The maximun size (in bytes) of
82 * a netlink message is assumed to be MAX_PAYLOAD bytes.
83 *
84 * +------------+-------+----------+----------+
85 * |Netlink hdr | Align |tAniMsgHdr| msg body |
86 * +------------+-------+----------|----------+
87 */
88
89// Message Types
90#define WLAN_BTC_QUERY_STATE_REQ 0x01 // BTC --> WLAN
91#define WLAN_BTC_BT_EVENT_IND 0x02 // BTC --> WLAN
92#define WLAN_BTC_QUERY_STATE_RSP 0x03 // WLAN --> BTC
93#define WLAN_MODULE_UP_IND 0x04 // WLAN --> BTC
94#define WLAN_MODULE_DOWN_IND 0x05 // WLAN --> BTC
95#define WLAN_STA_ASSOC_DONE_IND 0x06 // WLAN --> BTC
96#define WLAN_STA_DISASSOC_DONE_IND 0x07 // WLAN --> BTC
97
98// Special Message Type used by AMP, intercepted by send_btc_nlink_msg() and
99// replaced by WLAN_STA_ASSOC_DONE_IND or WLAN_STA_DISASSOC_DONE_IND
100#define WLAN_AMP_ASSOC_DONE_IND 0x10
101
102// Special Message Type used by SoftAP, intercepted by send_btc_nlink_msg() and
103// replaced by WLAN_STA_ASSOC_DONE_IND
104#define WLAN_BTC_SOFTAP_BSS_START 0x11
105
106
107// Event data for WLAN_BTC_QUERY_STATE_RSP & WLAN_STA_ASSOC_DONE_IND
108typedef struct
109{
110 unsigned char channel; // 0 implies STA not associated to AP
111} tWlanAssocData;
112
113#define ANI_NL_MSG_BASE 0x10 /* Some arbitrary base */
114
115typedef enum eAniNlModuleTypes {
116 ANI_NL_MSG_PUMAC = ANI_NL_MSG_BASE + 0x01,// PTT Socket App
117 ANI_NL_MSG_PTT = ANI_NL_MSG_BASE + 0x07,// Quarky GUI
118 WLAN_NL_MSG_BTC,
119 ANI_NL_MSG_MAX
120} tAniNlModTypes, tWlanNlModTypes;
121
122#define WLAN_NL_MSG_BASE ANI_NL_MSG_BASE
123#define WLAN_NL_MSG_MAX ANI_NL_MSG_MAX
124
125//All Netlink messages must contain this header
126typedef struct sAniHdr {
127 unsigned short type;
128 unsigned short length;
129} tAniHdr, tAniMsgHdr;
130
131#endif //WLAN_NLINK_COMMON_H__