Vulupala Shashank Reddy | 9331f42 | 2020-01-25 18:11:48 +0530 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (c) 2020 The Linux Foundation. All rights reserved. |
| 3 | * |
| 4 | * Permission to use, copy, modify, and/or distribute this software for |
| 5 | * any purpose with or without fee is hereby granted, provided that the |
| 6 | * above copyright notice and this permission notice appear in all |
| 7 | * copies. |
| 8 | * |
| 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 10 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 11 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 12 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 13 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 14 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 15 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 16 | * PERFORMANCE OF THIS SOFTWARE. |
| 17 | */ |
| 18 | |
| 19 | /** |
| 20 | * DOC: Declare private API which shall be used internally only |
| 21 | * in pkt_capture component. This file shall include prototypes of |
| 22 | * various notification handlers and logging functions. |
| 23 | * |
| 24 | * Note: This API should be never accessed out of pkt_capture component. |
| 25 | */ |
| 26 | |
| 27 | #ifndef _WLAN_PKT_CAPTURE_MAIN_H_ |
| 28 | #define _WLAN_PKT_CAPTURE_MAIN_H_ |
| 29 | |
| 30 | #include <qdf_types.h> |
| 31 | #include "wlan_pkt_capture_priv.h" |
| 32 | #include "wlan_pkt_capture_objmgr.h" |
| 33 | |
| 34 | #define pkt_capture_log(level, args...) \ |
| 35 | QDF_TRACE(QDF_MODULE_ID_PKT_CAPTURE, level, ## args) |
| 36 | |
| 37 | #define pkt_capture_logfl(level, format, args...) \ |
| 38 | pkt_capture_log(level, FL(format), ## args) |
| 39 | |
| 40 | #define pkt_capture_fatal(format, args...) \ |
| 41 | pkt_capture_logfl(QDF_TRACE_LEVEL_FATAL, format, ## args) |
| 42 | #define pkt_capture_err(format, args...) \ |
| 43 | pkt_capture_logfl(QDF_TRACE_LEVEL_ERROR, format, ## args) |
| 44 | #define pkt_capture_warn(format, args...) \ |
| 45 | pkt_capture_logfl(QDF_TRACE_LEVEL_WARN, format, ## args) |
| 46 | #define pkt_capture_info(format, args...) \ |
| 47 | pkt_capture_logfl(QDF_TRACE_LEVEL_INFO, format, ## args) |
| 48 | #define pkt_capture_debug(format, args...) \ |
| 49 | pkt_capture_logfl(QDF_TRACE_LEVEL_DEBUG, format, ## args) |
| 50 | |
| 51 | #define PKT_CAPTURE_ENTER() pkt_capture_debug("enter") |
| 52 | #define PKT_CAPTURE_EXIT() pkt_capture_debug("exit") |
| 53 | |
| 54 | /** |
| 55 | * pkt_capture_vdev_create_notification() - Handler for vdev create notify. |
| 56 | * @vdev: vdev which is going to be created by objmgr |
| 57 | * @arg: argument for notification handler. |
| 58 | * |
| 59 | * Allocate and attach vdev private object. |
| 60 | * |
| 61 | * Return: QDF_STATUS status in case of success else return error. |
| 62 | */ |
| 63 | QDF_STATUS |
| 64 | pkt_capture_vdev_create_notification(struct wlan_objmgr_vdev *vdev, void *arg); |
| 65 | |
| 66 | /** |
| 67 | * pkt_capture_vdev_destroy_notification() - Handler for vdev destroy notify. |
| 68 | * @vdev: vdev which is going to be destroyed by objmgr |
| 69 | * @arg: argument for notification handler. |
| 70 | * |
| 71 | * Deallocate and detach vdev private object. |
| 72 | * |
| 73 | * Return QDF_STATUS status in case of success else return error |
| 74 | */ |
| 75 | QDF_STATUS |
| 76 | pkt_capture_vdev_destroy_notification(struct wlan_objmgr_vdev *vdev, void *arg); |
| 77 | |
| 78 | #endif /* end of _WLAN_PKT_CAPTURE_MAIN_H_ */ |