[RAMEN9610-20413][9610] wlbt: SCSC Driver version 10.6.1.0
[GitHub/MotorolaMobilityLLC/kernel-slsi.git] / drivers / misc / samsung / scsc / scsc_wifilogger_ring_connectivity_api.h
1 /******************************************************************************
2 *
3 * Copyright (c) 2018 Samsung Electronics Co., Ltd. All rights reserved.
4 *
5 ******************************************************************************/
6 #ifndef __SCSC_WIFILOGGER_RING_CONNECTIVITY_API_H__
7 #define __SCSC_WIFILOGGER_RING_CONNECTIVITY_API_H__
8 /** Android Enhanced Logging
9 *
10 * CONNECTIVITY RING -- Public Producer API
11 *
12 * This ring collects a number of events originated by FW and Driver; given the different
13 * format of the provided payload between FW and Driver the API is splitted in two classes:
14 * once to be invoked on fw events and the other on driver events.
15 */
16
17 #ifdef CONFIG_SCSC_WIFILOGGER
18
19 #include "scsc_wifilogger_ring_connectivity.h"
20 /**
21 * DRIVER-Produced Connectivity Events
22 *
23 * @lev: chosen verbosity level
24 * @driver_event_id: id of the event reported by the driver
25 * @tag_count: number of TLV-TRIPLETS constituting the variadic portion of the call.
26 * Provided TLV triplets are composed as follows:
27 * - Types(Tag) are defined in scsc_wifilogger_types.h
28 * - Length in bytes of value
29 * - Value is a POINTER to the area holding the Length bytes to copy
30 *
31 * This function will take care to build the needed inner record-header and push the
32 * log material to the related ring, adding also a proper driver-built timestamp.
33 *
34 * An example invokation on Association Request received at driver:
35 *
36 * SCSC_WLOG_DRIVER_EVENT(WLOG_NORMAL, WIFI_EVENT_ASSOCIATION_REQUESTED, 3,
37 * WIFI_TAG_BSSID, ETH_ALEN, sme->bssid,
38 * WIFI_TAG_SSID, sme->ssid_len, sme->ssid,
39 * WIFI_TAG_CHANNEL, sizeof(u16), &sme->channel->center_freq);
40 *
41 * BE AWARE THAT tag_count parameeters expects the NUMBER of TRIPLETS
42 * NOT the number of variadic params.
43 */
44 #define SCSC_WLOG_DRIVER_EVENT(lev, driver_event_id, tag_count, tag_args...) \
45 do { \
46 if (cring_lev && (lev) <= cring_lev) \
47 scsc_wifilogger_ring_connectivity_driver_event((lev), (driver_event_id), \
48 (tag_count), tag_args); \
49 } while (0)
50
51 /**
52 * FW-Produced Connectivity Events
53 *
54 * @lev: chosen verbosity level
55 * @fw_event_id: id of the event as provided in the field
56 * MLME-EVENT-LOG.indication[Event]
57 * @fw_timestamp: timestamp of the event as provided in the field
58 * MLME-EVENT-LOG.indication[TSF Time]
59 * @fw_bulk_data: the bulk data contained in the MLME signal.
60 * "The bulk data shall contain TLV encoded parameters for that event"
61 * @fw_blen: the length of the above bulk_data
62 *
63 * This function will take care to build the needed inner record-header and push the
64 * log material to the related ring.
65 */
66 #define SCSC_WLOG_FW_EVENT(lev, fw_event_id, fw_timestamp, fw_bulk_data, fw_blen) \
67 do { \
68 if (cring_lev && (lev) <= cring_lev) \
69 scsc_wifilogger_ring_connectivity_fw_event((lev), (fw_event_id), (fw_timestamp), \
70 (fw_bulk_data), (fw_blen)); \
71 } while (0)
72 #else
73
74 #define SCSC_WLOG_DRIVER_EVENT(lev, driver_event_id, tag_count, tag_args...) do {} while (0)
75 #define SCSC_WLOG_FW_EVENT(lev, fw_event_id, fw_timestamp, fw_bulk_data, fw_blen) do {} while (0)
76
77 #endif /* CONFIG_SCSC_WIFILOGGER */
78
79 #endif /* __SCSC_WIFILOGGER_RING_CONNECTIVITY_API_H__ */