blob: ba1b3afa1b3365a20f816a6b6c8f3aab59bfe817 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Kiet Lam0fb93dd2014-02-19 00:32:59 -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.
Gopichand Nakkala92f07d82013-01-08 21:16:34 -080020 */
Kiet Lam0fb93dd2014-02-19 00:32:59 -080021
22/*
23 * This file was originally distributed by Qualcomm Atheros, Inc.
24 * under proprietary terms before Copyright ownership was assigned
25 * to the Linux Foundation.
26 */
27
Jeff Johnson295189b2012-06-20 16:38:30 -070028/*===========================================================================
29 \file wlan_nlink_common.h
30
31 Exports and types for the Netlink Service interface. This header file contains
32 message types and definitions that is shared between the user space service
33 (e.g. BTC service) and WLAN kernel module.
34
35 Copyright (c) 2009 QUALCOMM Incorporated.
36 All Rights Reserved.
37 Qualcomm Confidential and Proprietary
38
39===========================================================================*/
40
41#ifndef WLAN_NLINK_COMMON_H__
42#define WLAN_NLINK_COMMON_H__
43
44#include <linux/netlink.h>
45
46/*---------------------------------------------------------------------------
47 * External Functions
48 *-------------------------------------------------------------------------*/
49
50/*---------------------------------------------------------------------------
51 * Preprocessor Definitions and Constants
52 *-------------------------------------------------------------------------*/
53#define WLAN_NL_MAX_PAYLOAD 256 /* maximum size for netlink message*/
54#define WLAN_NLINK_PROTO_FAMILY NETLINK_USERSOCK
55#define WLAN_NLINK_MCAST_GRP_ID 0x01
56
57/*---------------------------------------------------------------------------
58 * Type Declarations
59 *-------------------------------------------------------------------------*/
60
61/*
62 * The following enum defines the target service within WLAN driver for which the
63 * message is intended for. Each service along with its counterpart
64 * in the user space, define a set of messages they recognize.
65 * Each of this message will have an header of type tAniMsgHdr defined below.
66 * Each Netlink message to/from a kernel module will contain only one
67 * message which is preceded by a tAniMsgHdr. The maximun size (in bytes) of
68 * a netlink message is assumed to be MAX_PAYLOAD bytes.
69 *
70 * +------------+-------+----------+----------+
71 * |Netlink hdr | Align |tAniMsgHdr| msg body |
72 * +------------+-------+----------|----------+
73 */
74
75// Message Types
76#define WLAN_BTC_QUERY_STATE_REQ 0x01 // BTC --> WLAN
77#define WLAN_BTC_BT_EVENT_IND 0x02 // BTC --> WLAN
78#define WLAN_BTC_QUERY_STATE_RSP 0x03 // WLAN --> BTC
79#define WLAN_MODULE_UP_IND 0x04 // WLAN --> BTC
80#define WLAN_MODULE_DOWN_IND 0x05 // WLAN --> BTC
81#define WLAN_STA_ASSOC_DONE_IND 0x06 // WLAN --> BTC
82#define WLAN_STA_DISASSOC_DONE_IND 0x07 // WLAN --> BTC
83
84// Special Message Type used by AMP, intercepted by send_btc_nlink_msg() and
85// replaced by WLAN_STA_ASSOC_DONE_IND or WLAN_STA_DISASSOC_DONE_IND
86#define WLAN_AMP_ASSOC_DONE_IND 0x10
87
88// Special Message Type used by SoftAP, intercepted by send_btc_nlink_msg() and
89// replaced by WLAN_STA_ASSOC_DONE_IND
90#define WLAN_BTC_SOFTAP_BSS_START 0x11
91
92
93// Event data for WLAN_BTC_QUERY_STATE_RSP & WLAN_STA_ASSOC_DONE_IND
94typedef struct
95{
96 unsigned char channel; // 0 implies STA not associated to AP
97} tWlanAssocData;
98
99#define ANI_NL_MSG_BASE 0x10 /* Some arbitrary base */
100
101typedef enum eAniNlModuleTypes {
102 ANI_NL_MSG_PUMAC = ANI_NL_MSG_BASE + 0x01,// PTT Socket App
103 ANI_NL_MSG_PTT = ANI_NL_MSG_BASE + 0x07,// Quarky GUI
104 WLAN_NL_MSG_BTC,
Vinay Krishna Erannad938c422014-03-10 17:14:21 +0530105 ANI_NL_MSG_LOG,
Jeff Johnson295189b2012-06-20 16:38:30 -0700106 ANI_NL_MSG_MAX
107} tAniNlModTypes, tWlanNlModTypes;
108
109#define WLAN_NL_MSG_BASE ANI_NL_MSG_BASE
110#define WLAN_NL_MSG_MAX ANI_NL_MSG_MAX
111
112//All Netlink messages must contain this header
113typedef struct sAniHdr {
114 unsigned short type;
115 unsigned short length;
116} tAniHdr, tAniMsgHdr;
117
118#endif //WLAN_NLINK_COMMON_H__