Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1 | /* |
Nirav Shah | 7f337db | 2016-05-25 10:49:02 +0530 | [diff] [blame] | 2 | * Copyright (c) 2012, 2014, 2016 The Linux Foundation. All rights reserved. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 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 | |
| 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 | |
| 28 | #ifndef __HTC_SERVICES_H__ |
| 29 | #define __HTC_SERVICES_H__ |
| 30 | |
| 31 | /* Current service IDs */ |
| 32 | |
| 33 | typedef enum { |
| 34 | RSVD_SERVICE_GROUP = 0, |
| 35 | WMI_SERVICE_GROUP = 1, |
| 36 | NMI_SERVICE_GROUP = 2, |
| 37 | HTT_SERVICE_GROUP = 3, |
| 38 | CFG_NV_SERVICE_GROUP = 4, |
| 39 | WDI_IPA_SERVICE_GROUP = 5, |
Nirav Shah | 7f337db | 2016-05-25 10:49:02 +0530 | [diff] [blame] | 40 | PACKET_LOG_SERVICE_GROUP = 6, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 41 | HTC_TEST_GROUP = 254, |
| 42 | HTC_SERVICE_GROUP_LAST = 255 |
| 43 | } HTC_SERVICE_GROUP_IDS; |
| 44 | |
| 45 | #define MAKE_SERVICE_ID(group,index) \ |
| 46 | (int)(((int)group << 8) | (int)(index)) |
| 47 | |
| 48 | /* NOTE: service ID of 0x0000 is reserved and should never be used */ |
| 49 | #define HTC_CTRL_RSVD_SVC MAKE_SERVICE_ID(RSVD_SERVICE_GROUP,1) |
| 50 | #define WMI_CONTROL_SVC MAKE_SERVICE_ID(WMI_SERVICE_GROUP,0) |
| 51 | #define WMI_DATA_BE_SVC MAKE_SERVICE_ID(WMI_SERVICE_GROUP,1) |
| 52 | #define WMI_DATA_BK_SVC MAKE_SERVICE_ID(WMI_SERVICE_GROUP,2) |
| 53 | #define WMI_DATA_VI_SVC MAKE_SERVICE_ID(WMI_SERVICE_GROUP,3) |
| 54 | #define WMI_DATA_VO_SVC MAKE_SERVICE_ID(WMI_SERVICE_GROUP,4) |
| 55 | #define WMI_MAX_SERVICES 5 |
| 56 | |
| 57 | #define NMI_CONTROL_SVC MAKE_SERVICE_ID(NMI_SERVICE_GROUP,0) |
| 58 | #define NMI_DATA_SVC MAKE_SERVICE_ID(NMI_SERVICE_GROUP,1) |
| 59 | |
| 60 | #define HTT_DATA_MSG_SVC MAKE_SERVICE_ID(HTT_SERVICE_GROUP,0) |
| 61 | #define HTT_DATA2_MSG_SVC MAKE_SERVICE_ID(HTT_SERVICE_GROUP,1) |
Govind Singh | 805ac5b | 2016-06-09 18:36:01 +0530 | [diff] [blame] | 62 | #define HTT_DATA3_MSG_SVC MAKE_SERVICE_ID(HTT_SERVICE_GROUP, 2) |
Nirav Shah | 7f337db | 2016-05-25 10:49:02 +0530 | [diff] [blame] | 63 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 64 | /* raw stream service (i.e. flash, tcmd, calibration apps) */ |
| 65 | #define HTC_RAW_STREAMS_SVC MAKE_SERVICE_ID(HTC_TEST_GROUP,0) |
| 66 | |
| 67 | #define CFG_NV_SVC MAKE_SERVICE_ID(CFG_NV_SERVICE_GROUP,0) |
| 68 | #define WDI_IPA_TX_SVC MAKE_SERVICE_ID(WDI_IPA_SERVICE_GROUP,0) |
| 69 | |
Govind Singh | 55b8daf | 2016-06-09 16:02:47 +0530 | [diff] [blame] | 70 | #define PACKET_LOG_SVC MAKE_SERVICE_ID(PACKET_LOG_SERVICE_GROUP, 0) |
| 71 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 72 | /* |
| 73 | * Directions for interconnect pipe configuration. |
| 74 | * These definitions may be used during configuration and are shared |
| 75 | * between Host and Target. |
| 76 | * |
| 77 | * Pipe Directions are relative to the Host, so PIPEDIR_IN means |
| 78 | * "coming IN over air through Target to Host" as with a WiFi Rx operation. |
| 79 | * Conversely, PIPEDIR_OUT means "going OUT from Host through Target over air" |
| 80 | * as with a WiFi Tx operation. This is somewhat awkward for the "middle-man" |
| 81 | * Target since things that are "PIPEDIR_OUT" are coming IN to the Target |
| 82 | * over the interconnect. |
| 83 | */ |
| 84 | typedef A_UINT32 PIPEDIR; |
Govind Singh | 55b8daf | 2016-06-09 16:02:47 +0530 | [diff] [blame] | 85 | #define PIPEDIR_NONE 0 |
| 86 | #define PIPEDIR_IN 1 /* Target-->Host, WiFi Rx direction */ |
| 87 | #define PIPEDIR_OUT 2 /* Host->Target, WiFi Tx direction */ |
| 88 | #define PIPEDIR_INOUT 3 /* bidirectional, target to target */ |
| 89 | #define PIPEDIR_INOUT_T2T PIPEDIR_INOUT |
| 90 | #define PIPEDIR_INOUT_H2H 4 /* bidirectional, host to host */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 91 | #define PIPEDIR_MATCH(d1, d2) (((PIPEDIR)(d1) & (PIPEDIR)(d2)) != 0) |
| 92 | |
| 93 | /* Establish a mapping between a service/direction and a pipe. */ |
| 94 | struct service_to_pipe { |
| 95 | A_UINT32 service_id; |
| 96 | A_UINT32 pipedir; |
| 97 | A_UINT32 pipenum; |
| 98 | }; |
| 99 | |
| 100 | #endif /*HTC_SERVICES_H_ */ |