Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (c) 2013-2014 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 | |
| 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" |
| 32 | #include "cdf_nbuf.h" |
| 33 | #define WDI_EVENT_BASE 0x100 /* Event starting number */ |
| 34 | |
| 35 | enum WDI_EVENT { |
| 36 | WDI_EVENT_TX_STATUS = WDI_EVENT_BASE, |
| 37 | WDI_EVENT_RX_DESC, |
| 38 | WDI_EVENT_RX_DESC_REMOTE, |
| 39 | WDI_EVENT_RATE_FIND, |
| 40 | WDI_EVENT_RATE_UPDATE, |
| 41 | WDI_EVENT_RX_PEER_INVALID, |
| 42 | /* End of new event items */ |
| 43 | |
| 44 | WDI_EVENT_LAST |
| 45 | }; |
| 46 | |
| 47 | struct wdi_event_rx_peer_invalid_msg { |
| 48 | cdf_nbuf_t msdu; |
| 49 | struct ieee80211_frame *wh; |
| 50 | uint8_t vdev_id; |
| 51 | }; |
| 52 | |
| 53 | #define WDI_NUM_EVENTS (WDI_EVENT_LAST - WDI_EVENT_BASE) |
| 54 | |
| 55 | #define WDI_EVENT_NOTIFY_BASE 0x200 |
| 56 | enum WDI_EVENT_NOTIFY { |
| 57 | WDI_EVENT_SUB_DEALLOCATE = WDI_EVENT_NOTIFY_BASE, |
| 58 | /* End of new notification types */ |
| 59 | |
| 60 | WDI_EVENT_NOTIFY_LAST |
| 61 | }; |
| 62 | |
| 63 | /* Opaque event callback */ |
| 64 | typedef void (*wdi_event_cb)(void *pdev, enum WDI_EVENT event, void *data); |
| 65 | |
| 66 | /* Opaque event notify */ |
| 67 | typedef void (*wdi_event_notify)(enum WDI_EVENT_NOTIFY notify, |
| 68 | enum WDI_EVENT event); |
| 69 | |
| 70 | /** |
| 71 | * @typedef wdi_event_subscribe |
| 72 | * @brief Used by consumers to subscribe to WDI event notifications. |
| 73 | * @details |
| 74 | * The event_subscribe struct includes pointers to other event_subscribe |
| 75 | * objects. These pointers are simply to simplify the management of |
| 76 | * lists of event subscribers. These pointers are set during the |
| 77 | * event_sub() function, and shall not be modified except by the |
| 78 | * WDI event management SW, until after the object's event subscription |
| 79 | * is canceled by calling event_unsub(). |
| 80 | */ |
| 81 | |
| 82 | typedef struct wdi_event_subscribe_t { |
| 83 | wdi_event_cb callback; /* subscriber event callback structure head */ |
| 84 | void *context; /* subscriber object that processes the event callback */ |
| 85 | struct { |
| 86 | /* private - the event subscriber SW shall not use this struct */ |
| 87 | struct wdi_event_subscribe_t *next; |
| 88 | struct wdi_event_subscribe_t *prev; |
| 89 | } priv; |
| 90 | } wdi_event_subscribe; |
| 91 | |
| 92 | #endif |