blob: 41d51fb247e9bd89fbc6592bdee454b7aeb16faf [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
Anurag Chouhan6d760662016-02-20 16:05:43 +05302 * Copyright (c) 2014-2016 The Linux Foundation. All rights reserved.
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003 *
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#ifdef HDD_TRACE_RECORD
29
30/**
31 * DOC: wlan_hdd_trace.c
32 *
33 * WLAN Host Device Driver trace implementation
34 *
35 */
36
37#include "cdf_trace.h"
Anurag Chouhan6d760662016-02-20 16:05:43 +053038#include "qdf_types.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080039#include "wlan_hdd_trace.h"
40#include "wlan_hdd_main.h"
41
42/**
43 * hdd_trace_dump() - Dump an HDD-specific trace record
44 * @mac: (unused) global MAC handle
45 * @record: trace record that was previously recorded
46 * @index: index of the trace record
47 *
48 * Return: none
49 */
50static void
51hdd_trace_dump(void *mac, tp_cdf_trace_record record, uint16_t index)
52{
Sreelakshmi Konamkic88f5372015-12-22 12:50:15 +053053 if (TRACE_CODE_HDD_RX_SME_MSG == record->code)
54 hddLog(LOGE, "%04d %012llu S%d %-14s %-30s(0x%x) ",
55 index, record->time, record->session, "RX SME MSG:",
56 get_e_roam_cmd_status_str(record->data), record->data);
57 else
58 hddLog(LOGE, "%04d %012llu S%d %-14s %-30s(0x%x) ",
59 index, record->time, record->session, "HDD Event:",
60 hdd_trace_event_string(record->code), record->data);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080061}
62
63/**
64 * hdd_trace_init() - HDD trace subsystem initialization
65 *
66 * Registers HDD with the debug trace subsystem
67 *
68 * Return: none
69 */
70void hdd_trace_init(void)
71{
Anurag Chouhan6d760662016-02-20 16:05:43 +053072 cdf_trace_register(QDF_MODULE_ID_HDD, hdd_trace_dump);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080073}
74
75#endif /* ifdef HDD_TRACE_RECORD */