Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1 | /* |
Yun Park | 196641d | 2017-04-06 22:29:34 -0700 | [diff] [blame] | 2 | * Copyright (c) 2013-2017 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 _WDI_EVENT_H_ |
| 29 | #define _WDI_EVENT_H_ |
| 30 | |
| 31 | #include "athdefs.h" |
Nirav Shah | cbc6d72 | 2016-03-01 16:24:53 +0530 | [diff] [blame] | 32 | #include "qdf_nbuf.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 33 | #define WDI_EVENT_BASE 0x100 /* Event starting number */ |
| 34 | |
Venkata Sharath Chandra Manchala | 1240fc7 | 2017-10-26 17:32:29 -0700 | [diff] [blame^] | 35 | #define WDI_NO_VAL (-1) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 36 | enum WDI_EVENT { |
| 37 | WDI_EVENT_TX_STATUS = WDI_EVENT_BASE, |
| 38 | WDI_EVENT_RX_DESC, |
| 39 | WDI_EVENT_RX_DESC_REMOTE, |
| 40 | WDI_EVENT_RATE_FIND, |
| 41 | WDI_EVENT_RATE_UPDATE, |
Nirav Shah | dcc4c87 | 2016-07-28 11:35:26 +0530 | [diff] [blame] | 42 | WDI_EVENT_SW_EVENT, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 43 | WDI_EVENT_RX_PEER_INVALID, |
Venkata Sharath Chandra Manchala | 1240fc7 | 2017-10-26 17:32:29 -0700 | [diff] [blame^] | 44 | /* From WIN definations */ |
| 45 | WDI_EVENT_LITE_RX, |
| 46 | WDI_EVENT_LITE_T2H, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 47 | /* End of new event items */ |
| 48 | |
| 49 | WDI_EVENT_LAST |
| 50 | }; |
| 51 | |
| 52 | struct wdi_event_rx_peer_invalid_msg { |
Nirav Shah | cbc6d72 | 2016-03-01 16:24:53 +0530 | [diff] [blame] | 53 | qdf_nbuf_t msdu; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 54 | struct ieee80211_frame *wh; |
| 55 | uint8_t vdev_id; |
| 56 | }; |
| 57 | |
| 58 | #define WDI_NUM_EVENTS (WDI_EVENT_LAST - WDI_EVENT_BASE) |
| 59 | |
| 60 | #define WDI_EVENT_NOTIFY_BASE 0x200 |
| 61 | enum WDI_EVENT_NOTIFY { |
| 62 | WDI_EVENT_SUB_DEALLOCATE = WDI_EVENT_NOTIFY_BASE, |
| 63 | /* End of new notification types */ |
| 64 | |
| 65 | WDI_EVENT_NOTIFY_LAST |
| 66 | }; |
| 67 | |
| 68 | /* Opaque event callback */ |
Venkata Sharath Chandra Manchala | 1240fc7 | 2017-10-26 17:32:29 -0700 | [diff] [blame^] | 69 | typedef void (*wdi_event_cb)(void *pdev, enum WDI_EVENT event, void *data, |
| 70 | u_int16_t peer_id, uint32_t status); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 71 | |
| 72 | /* Opaque event notify */ |
| 73 | typedef void (*wdi_event_notify)(enum WDI_EVENT_NOTIFY notify, |
| 74 | enum WDI_EVENT event); |
| 75 | |
| 76 | /** |
| 77 | * @typedef wdi_event_subscribe |
| 78 | * @brief Used by consumers to subscribe to WDI event notifications. |
| 79 | * @details |
| 80 | * The event_subscribe struct includes pointers to other event_subscribe |
| 81 | * objects. These pointers are simply to simplify the management of |
| 82 | * lists of event subscribers. These pointers are set during the |
| 83 | * event_sub() function, and shall not be modified except by the |
| 84 | * WDI event management SW, until after the object's event subscription |
| 85 | * is canceled by calling event_unsub(). |
| 86 | */ |
| 87 | |
| 88 | typedef struct wdi_event_subscribe_t { |
Yun Park | 196641d | 2017-04-06 22:29:34 -0700 | [diff] [blame] | 89 | /* subscriber event callback structure head */ |
| 90 | wdi_event_cb callback; |
| 91 | /* subscriber object that processes the event callback */ |
| 92 | void *context; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 93 | struct { |
Yun Park | 196641d | 2017-04-06 22:29:34 -0700 | [diff] [blame] | 94 | /* |
| 95 | * private - the event subscriber SW shall not use this struct |
| 96 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 97 | struct wdi_event_subscribe_t *next; |
| 98 | struct wdi_event_subscribe_t *prev; |
| 99 | } priv; |
| 100 | } wdi_event_subscribe; |
| 101 | |
| 102 | #endif |