cachepc-linux

Fork of AMDESE/linux with modifications for CachePC side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-linux
Log | Files | Refs | README | LICENSE | sfeed.txt

debugfs.c (8361B)


      1// SPDX-License-Identifier: GPL-2.0-only
      2/*
      3 * This file is part of wl12xx
      4 *
      5 * Copyright (C) 2009 Nokia Corporation
      6 * Copyright (C) 2011-2012 Texas Instruments
      7 */
      8
      9#include "../wlcore/debugfs.h"
     10#include "../wlcore/wlcore.h"
     11
     12#include "wl12xx.h"
     13#include "acx.h"
     14#include "debugfs.h"
     15
     16#define WL12XX_DEBUGFS_FWSTATS_FILE(a, b, c) \
     17	DEBUGFS_FWSTATS_FILE(a, b, c, wl12xx_acx_statistics)
     18
     19WL12XX_DEBUGFS_FWSTATS_FILE(tx, internal_desc_overflow, "%u");
     20
     21WL12XX_DEBUGFS_FWSTATS_FILE(rx, out_of_mem, "%u");
     22WL12XX_DEBUGFS_FWSTATS_FILE(rx, hdr_overflow, "%u");
     23WL12XX_DEBUGFS_FWSTATS_FILE(rx, hw_stuck, "%u");
     24WL12XX_DEBUGFS_FWSTATS_FILE(rx, dropped, "%u");
     25WL12XX_DEBUGFS_FWSTATS_FILE(rx, fcs_err, "%u");
     26WL12XX_DEBUGFS_FWSTATS_FILE(rx, xfr_hint_trig, "%u");
     27WL12XX_DEBUGFS_FWSTATS_FILE(rx, path_reset, "%u");
     28WL12XX_DEBUGFS_FWSTATS_FILE(rx, reset_counter, "%u");
     29
     30WL12XX_DEBUGFS_FWSTATS_FILE(dma, rx_requested, "%u");
     31WL12XX_DEBUGFS_FWSTATS_FILE(dma, rx_errors, "%u");
     32WL12XX_DEBUGFS_FWSTATS_FILE(dma, tx_requested, "%u");
     33WL12XX_DEBUGFS_FWSTATS_FILE(dma, tx_errors, "%u");
     34
     35WL12XX_DEBUGFS_FWSTATS_FILE(isr, cmd_cmplt, "%u");
     36WL12XX_DEBUGFS_FWSTATS_FILE(isr, fiqs, "%u");
     37WL12XX_DEBUGFS_FWSTATS_FILE(isr, rx_headers, "%u");
     38WL12XX_DEBUGFS_FWSTATS_FILE(isr, rx_mem_overflow, "%u");
     39WL12XX_DEBUGFS_FWSTATS_FILE(isr, rx_rdys, "%u");
     40WL12XX_DEBUGFS_FWSTATS_FILE(isr, irqs, "%u");
     41WL12XX_DEBUGFS_FWSTATS_FILE(isr, tx_procs, "%u");
     42WL12XX_DEBUGFS_FWSTATS_FILE(isr, decrypt_done, "%u");
     43WL12XX_DEBUGFS_FWSTATS_FILE(isr, dma0_done, "%u");
     44WL12XX_DEBUGFS_FWSTATS_FILE(isr, dma1_done, "%u");
     45WL12XX_DEBUGFS_FWSTATS_FILE(isr, tx_exch_complete, "%u");
     46WL12XX_DEBUGFS_FWSTATS_FILE(isr, commands, "%u");
     47WL12XX_DEBUGFS_FWSTATS_FILE(isr, rx_procs, "%u");
     48WL12XX_DEBUGFS_FWSTATS_FILE(isr, hw_pm_mode_changes, "%u");
     49WL12XX_DEBUGFS_FWSTATS_FILE(isr, host_acknowledges, "%u");
     50WL12XX_DEBUGFS_FWSTATS_FILE(isr, pci_pm, "%u");
     51WL12XX_DEBUGFS_FWSTATS_FILE(isr, wakeups, "%u");
     52WL12XX_DEBUGFS_FWSTATS_FILE(isr, low_rssi, "%u");
     53
     54WL12XX_DEBUGFS_FWSTATS_FILE(wep, addr_key_count, "%u");
     55WL12XX_DEBUGFS_FWSTATS_FILE(wep, default_key_count, "%u");
     56/* skipping wep.reserved */
     57WL12XX_DEBUGFS_FWSTATS_FILE(wep, key_not_found, "%u");
     58WL12XX_DEBUGFS_FWSTATS_FILE(wep, decrypt_fail, "%u");
     59WL12XX_DEBUGFS_FWSTATS_FILE(wep, packets, "%u");
     60WL12XX_DEBUGFS_FWSTATS_FILE(wep, interrupt, "%u");
     61
     62WL12XX_DEBUGFS_FWSTATS_FILE(pwr, ps_enter, "%u");
     63WL12XX_DEBUGFS_FWSTATS_FILE(pwr, elp_enter, "%u");
     64WL12XX_DEBUGFS_FWSTATS_FILE(pwr, missing_bcns, "%u");
     65WL12XX_DEBUGFS_FWSTATS_FILE(pwr, wake_on_host, "%u");
     66WL12XX_DEBUGFS_FWSTATS_FILE(pwr, wake_on_timer_exp, "%u");
     67WL12XX_DEBUGFS_FWSTATS_FILE(pwr, tx_with_ps, "%u");
     68WL12XX_DEBUGFS_FWSTATS_FILE(pwr, tx_without_ps, "%u");
     69WL12XX_DEBUGFS_FWSTATS_FILE(pwr, rcvd_beacons, "%u");
     70WL12XX_DEBUGFS_FWSTATS_FILE(pwr, power_save_off, "%u");
     71WL12XX_DEBUGFS_FWSTATS_FILE(pwr, enable_ps, "%u");
     72WL12XX_DEBUGFS_FWSTATS_FILE(pwr, disable_ps, "%u");
     73WL12XX_DEBUGFS_FWSTATS_FILE(pwr, fix_tsf_ps, "%u");
     74/* skipping cont_miss_bcns_spread for now */
     75WL12XX_DEBUGFS_FWSTATS_FILE(pwr, rcvd_awake_beacons, "%u");
     76
     77WL12XX_DEBUGFS_FWSTATS_FILE(mic, rx_pkts, "%u");
     78WL12XX_DEBUGFS_FWSTATS_FILE(mic, calc_failure, "%u");
     79
     80WL12XX_DEBUGFS_FWSTATS_FILE(aes, encrypt_fail, "%u");
     81WL12XX_DEBUGFS_FWSTATS_FILE(aes, decrypt_fail, "%u");
     82WL12XX_DEBUGFS_FWSTATS_FILE(aes, encrypt_packets, "%u");
     83WL12XX_DEBUGFS_FWSTATS_FILE(aes, decrypt_packets, "%u");
     84WL12XX_DEBUGFS_FWSTATS_FILE(aes, encrypt_interrupt, "%u");
     85WL12XX_DEBUGFS_FWSTATS_FILE(aes, decrypt_interrupt, "%u");
     86
     87WL12XX_DEBUGFS_FWSTATS_FILE(event, heart_beat, "%u");
     88WL12XX_DEBUGFS_FWSTATS_FILE(event, calibration, "%u");
     89WL12XX_DEBUGFS_FWSTATS_FILE(event, rx_mismatch, "%u");
     90WL12XX_DEBUGFS_FWSTATS_FILE(event, rx_mem_empty, "%u");
     91WL12XX_DEBUGFS_FWSTATS_FILE(event, rx_pool, "%u");
     92WL12XX_DEBUGFS_FWSTATS_FILE(event, oom_late, "%u");
     93WL12XX_DEBUGFS_FWSTATS_FILE(event, phy_transmit_error, "%u");
     94WL12XX_DEBUGFS_FWSTATS_FILE(event, tx_stuck, "%u");
     95
     96WL12XX_DEBUGFS_FWSTATS_FILE(ps, pspoll_timeouts, "%u");
     97WL12XX_DEBUGFS_FWSTATS_FILE(ps, upsd_timeouts, "%u");
     98WL12XX_DEBUGFS_FWSTATS_FILE(ps, upsd_max_sptime, "%u");
     99WL12XX_DEBUGFS_FWSTATS_FILE(ps, upsd_max_apturn, "%u");
    100WL12XX_DEBUGFS_FWSTATS_FILE(ps, pspoll_max_apturn, "%u");
    101WL12XX_DEBUGFS_FWSTATS_FILE(ps, pspoll_utilization, "%u");
    102WL12XX_DEBUGFS_FWSTATS_FILE(ps, upsd_utilization, "%u");
    103
    104WL12XX_DEBUGFS_FWSTATS_FILE(rxpipe, rx_prep_beacon_drop, "%u");
    105WL12XX_DEBUGFS_FWSTATS_FILE(rxpipe, descr_host_int_trig_rx_data, "%u");
    106WL12XX_DEBUGFS_FWSTATS_FILE(rxpipe, beacon_buffer_thres_host_int_trig_rx_data,
    107			    "%u");
    108WL12XX_DEBUGFS_FWSTATS_FILE(rxpipe, missed_beacon_host_int_trig_rx_data, "%u");
    109WL12XX_DEBUGFS_FWSTATS_FILE(rxpipe, tx_xfr_host_int_trig_rx_data, "%u");
    110
    111int wl12xx_debugfs_add_files(struct wl1271 *wl,
    112			     struct dentry *rootdir)
    113{
    114	struct dentry *stats, *moddir;
    115
    116	moddir = debugfs_create_dir(KBUILD_MODNAME, rootdir);
    117	stats = debugfs_create_dir("fw_stats", moddir);
    118
    119	DEBUGFS_FWSTATS_ADD(tx, internal_desc_overflow);
    120
    121	DEBUGFS_FWSTATS_ADD(rx, out_of_mem);
    122	DEBUGFS_FWSTATS_ADD(rx, hdr_overflow);
    123	DEBUGFS_FWSTATS_ADD(rx, hw_stuck);
    124	DEBUGFS_FWSTATS_ADD(rx, dropped);
    125	DEBUGFS_FWSTATS_ADD(rx, fcs_err);
    126	DEBUGFS_FWSTATS_ADD(rx, xfr_hint_trig);
    127	DEBUGFS_FWSTATS_ADD(rx, path_reset);
    128	DEBUGFS_FWSTATS_ADD(rx, reset_counter);
    129
    130	DEBUGFS_FWSTATS_ADD(dma, rx_requested);
    131	DEBUGFS_FWSTATS_ADD(dma, rx_errors);
    132	DEBUGFS_FWSTATS_ADD(dma, tx_requested);
    133	DEBUGFS_FWSTATS_ADD(dma, tx_errors);
    134
    135	DEBUGFS_FWSTATS_ADD(isr, cmd_cmplt);
    136	DEBUGFS_FWSTATS_ADD(isr, fiqs);
    137	DEBUGFS_FWSTATS_ADD(isr, rx_headers);
    138	DEBUGFS_FWSTATS_ADD(isr, rx_mem_overflow);
    139	DEBUGFS_FWSTATS_ADD(isr, rx_rdys);
    140	DEBUGFS_FWSTATS_ADD(isr, irqs);
    141	DEBUGFS_FWSTATS_ADD(isr, tx_procs);
    142	DEBUGFS_FWSTATS_ADD(isr, decrypt_done);
    143	DEBUGFS_FWSTATS_ADD(isr, dma0_done);
    144	DEBUGFS_FWSTATS_ADD(isr, dma1_done);
    145	DEBUGFS_FWSTATS_ADD(isr, tx_exch_complete);
    146	DEBUGFS_FWSTATS_ADD(isr, commands);
    147	DEBUGFS_FWSTATS_ADD(isr, rx_procs);
    148	DEBUGFS_FWSTATS_ADD(isr, hw_pm_mode_changes);
    149	DEBUGFS_FWSTATS_ADD(isr, host_acknowledges);
    150	DEBUGFS_FWSTATS_ADD(isr, pci_pm);
    151	DEBUGFS_FWSTATS_ADD(isr, wakeups);
    152	DEBUGFS_FWSTATS_ADD(isr, low_rssi);
    153
    154	DEBUGFS_FWSTATS_ADD(wep, addr_key_count);
    155	DEBUGFS_FWSTATS_ADD(wep, default_key_count);
    156	/* skipping wep.reserved */
    157	DEBUGFS_FWSTATS_ADD(wep, key_not_found);
    158	DEBUGFS_FWSTATS_ADD(wep, decrypt_fail);
    159	DEBUGFS_FWSTATS_ADD(wep, packets);
    160	DEBUGFS_FWSTATS_ADD(wep, interrupt);
    161
    162	DEBUGFS_FWSTATS_ADD(pwr, ps_enter);
    163	DEBUGFS_FWSTATS_ADD(pwr, elp_enter);
    164	DEBUGFS_FWSTATS_ADD(pwr, missing_bcns);
    165	DEBUGFS_FWSTATS_ADD(pwr, wake_on_host);
    166	DEBUGFS_FWSTATS_ADD(pwr, wake_on_timer_exp);
    167	DEBUGFS_FWSTATS_ADD(pwr, tx_with_ps);
    168	DEBUGFS_FWSTATS_ADD(pwr, tx_without_ps);
    169	DEBUGFS_FWSTATS_ADD(pwr, rcvd_beacons);
    170	DEBUGFS_FWSTATS_ADD(pwr, power_save_off);
    171	DEBUGFS_FWSTATS_ADD(pwr, enable_ps);
    172	DEBUGFS_FWSTATS_ADD(pwr, disable_ps);
    173	DEBUGFS_FWSTATS_ADD(pwr, fix_tsf_ps);
    174	/* skipping cont_miss_bcns_spread for now */
    175	DEBUGFS_FWSTATS_ADD(pwr, rcvd_awake_beacons);
    176
    177	DEBUGFS_FWSTATS_ADD(mic, rx_pkts);
    178	DEBUGFS_FWSTATS_ADD(mic, calc_failure);
    179
    180	DEBUGFS_FWSTATS_ADD(aes, encrypt_fail);
    181	DEBUGFS_FWSTATS_ADD(aes, decrypt_fail);
    182	DEBUGFS_FWSTATS_ADD(aes, encrypt_packets);
    183	DEBUGFS_FWSTATS_ADD(aes, decrypt_packets);
    184	DEBUGFS_FWSTATS_ADD(aes, encrypt_interrupt);
    185	DEBUGFS_FWSTATS_ADD(aes, decrypt_interrupt);
    186
    187	DEBUGFS_FWSTATS_ADD(event, heart_beat);
    188	DEBUGFS_FWSTATS_ADD(event, calibration);
    189	DEBUGFS_FWSTATS_ADD(event, rx_mismatch);
    190	DEBUGFS_FWSTATS_ADD(event, rx_mem_empty);
    191	DEBUGFS_FWSTATS_ADD(event, rx_pool);
    192	DEBUGFS_FWSTATS_ADD(event, oom_late);
    193	DEBUGFS_FWSTATS_ADD(event, phy_transmit_error);
    194	DEBUGFS_FWSTATS_ADD(event, tx_stuck);
    195
    196	DEBUGFS_FWSTATS_ADD(ps, pspoll_timeouts);
    197	DEBUGFS_FWSTATS_ADD(ps, upsd_timeouts);
    198	DEBUGFS_FWSTATS_ADD(ps, upsd_max_sptime);
    199	DEBUGFS_FWSTATS_ADD(ps, upsd_max_apturn);
    200	DEBUGFS_FWSTATS_ADD(ps, pspoll_max_apturn);
    201	DEBUGFS_FWSTATS_ADD(ps, pspoll_utilization);
    202	DEBUGFS_FWSTATS_ADD(ps, upsd_utilization);
    203
    204	DEBUGFS_FWSTATS_ADD(rxpipe, rx_prep_beacon_drop);
    205	DEBUGFS_FWSTATS_ADD(rxpipe, descr_host_int_trig_rx_data);
    206	DEBUGFS_FWSTATS_ADD(rxpipe, beacon_buffer_thres_host_int_trig_rx_data);
    207	DEBUGFS_FWSTATS_ADD(rxpipe, missed_beacon_host_int_trig_rx_data);
    208	DEBUGFS_FWSTATS_ADD(rxpipe, tx_xfr_host_int_trig_rx_data);
    209
    210	return 0;
    211}