Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /******************************************************************************
0003  *
0004  * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
0005  *
0006  * Contact Information:
0007  *  Intel Linux Wireless <ilw@linux.intel.com>
0008  * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
0009  *****************************************************************************/
0010 
0011 #include "common.h"
0012 #include "3945.h"
0013 
0014 static int
0015 il3945_stats_flag(struct il_priv *il, char *buf, int bufsz)
0016 {
0017     int p = 0;
0018 
0019     p += scnprintf(buf + p, bufsz - p, "Statistics Flag(0x%X):\n",
0020                le32_to_cpu(il->_3945.stats.flag));
0021     if (le32_to_cpu(il->_3945.stats.flag) & UCODE_STATS_CLEAR_MSK)
0022         p += scnprintf(buf + p, bufsz - p,
0023                    "\tStatistics have been cleared\n");
0024     p += scnprintf(buf + p, bufsz - p, "\tOperational Frequency: %s\n",
0025                (le32_to_cpu(il->_3945.stats.flag) &
0026             UCODE_STATS_FREQUENCY_MSK) ? "2.4 GHz" : "5.2 GHz");
0027     p += scnprintf(buf + p, bufsz - p, "\tTGj Narrow Band: %s\n",
0028                (le32_to_cpu(il->_3945.stats.flag) &
0029             UCODE_STATS_NARROW_BAND_MSK) ? "enabled" : "disabled");
0030     return p;
0031 }
0032 
0033 static ssize_t
0034 il3945_ucode_rx_stats_read(struct file *file, char __user *user_buf,
0035                size_t count, loff_t *ppos)
0036 {
0037     struct il_priv *il = file->private_data;
0038     int pos = 0;
0039     char *buf;
0040     int bufsz =
0041         sizeof(struct iwl39_stats_rx_phy) * 40 +
0042         sizeof(struct iwl39_stats_rx_non_phy) * 40 + 400;
0043     ssize_t ret;
0044     struct iwl39_stats_rx_phy *ofdm, *accum_ofdm, *delta_ofdm, *max_ofdm;
0045     struct iwl39_stats_rx_phy *cck, *accum_cck, *delta_cck, *max_cck;
0046     struct iwl39_stats_rx_non_phy *general, *accum_general;
0047     struct iwl39_stats_rx_non_phy *delta_general, *max_general;
0048 
0049     if (!il_is_alive(il))
0050         return -EAGAIN;
0051 
0052     buf = kzalloc(bufsz, GFP_KERNEL);
0053     if (!buf) {
0054         IL_ERR("Can not allocate Buffer\n");
0055         return -ENOMEM;
0056     }
0057 
0058     /*
0059      * The statistic information display here is based on
0060      * the last stats notification from uCode
0061      * might not reflect the current uCode activity
0062      */
0063     ofdm = &il->_3945.stats.rx.ofdm;
0064     cck = &il->_3945.stats.rx.cck;
0065     general = &il->_3945.stats.rx.general;
0066     accum_ofdm = &il->_3945.accum_stats.rx.ofdm;
0067     accum_cck = &il->_3945.accum_stats.rx.cck;
0068     accum_general = &il->_3945.accum_stats.rx.general;
0069     delta_ofdm = &il->_3945.delta_stats.rx.ofdm;
0070     delta_cck = &il->_3945.delta_stats.rx.cck;
0071     delta_general = &il->_3945.delta_stats.rx.general;
0072     max_ofdm = &il->_3945.max_delta.rx.ofdm;
0073     max_cck = &il->_3945.max_delta.rx.cck;
0074     max_general = &il->_3945.max_delta.rx.general;
0075 
0076     pos += il3945_stats_flag(il, buf, bufsz);
0077     pos +=
0078         scnprintf(buf + pos, bufsz - pos,
0079               "%-32s     current"
0080               "accumulative      delta         max\n",
0081               "Statistics_Rx - OFDM:");
0082     pos +=
0083         scnprintf(buf + pos, bufsz - pos,
0084               "  %-30s %10u  %10u  %10u  %10u\n", "ina_cnt:",
0085               le32_to_cpu(ofdm->ina_cnt), accum_ofdm->ina_cnt,
0086               delta_ofdm->ina_cnt, max_ofdm->ina_cnt);
0087     pos +=
0088         scnprintf(buf + pos, bufsz - pos,
0089               "  %-30s %10u  %10u  %10u  %10u\n", "fina_cnt:",
0090               le32_to_cpu(ofdm->fina_cnt), accum_ofdm->fina_cnt,
0091               delta_ofdm->fina_cnt, max_ofdm->fina_cnt);
0092     pos +=
0093         scnprintf(buf + pos, bufsz - pos,
0094               "  %-30s %10u  %10u  %10u  %10u\n", "plcp_err:",
0095               le32_to_cpu(ofdm->plcp_err), accum_ofdm->plcp_err,
0096               delta_ofdm->plcp_err, max_ofdm->plcp_err);
0097     pos +=
0098         scnprintf(buf + pos, bufsz - pos,
0099               "  %-30s %10u  %10u  %10u  %10u\n", "crc32_err:",
0100               le32_to_cpu(ofdm->crc32_err), accum_ofdm->crc32_err,
0101               delta_ofdm->crc32_err, max_ofdm->crc32_err);
0102     pos +=
0103         scnprintf(buf + pos, bufsz - pos,
0104               "  %-30s %10u  %10u  %10u  %10u\n", "overrun_err:",
0105               le32_to_cpu(ofdm->overrun_err), accum_ofdm->overrun_err,
0106               delta_ofdm->overrun_err, max_ofdm->overrun_err);
0107     pos +=
0108         scnprintf(buf + pos, bufsz - pos,
0109               "  %-30s %10u  %10u  %10u  %10u\n", "early_overrun_err:",
0110               le32_to_cpu(ofdm->early_overrun_err),
0111               accum_ofdm->early_overrun_err,
0112               delta_ofdm->early_overrun_err,
0113               max_ofdm->early_overrun_err);
0114     pos +=
0115         scnprintf(buf + pos, bufsz - pos,
0116               "  %-30s %10u  %10u  %10u  %10u\n", "crc32_good:",
0117               le32_to_cpu(ofdm->crc32_good), accum_ofdm->crc32_good,
0118               delta_ofdm->crc32_good, max_ofdm->crc32_good);
0119     pos +=
0120         scnprintf(buf + pos, bufsz - pos,
0121               "  %-30s %10u  %10u  %10u  %10u\n", "false_alarm_cnt:",
0122               le32_to_cpu(ofdm->false_alarm_cnt),
0123               accum_ofdm->false_alarm_cnt, delta_ofdm->false_alarm_cnt,
0124               max_ofdm->false_alarm_cnt);
0125     pos +=
0126         scnprintf(buf + pos, bufsz - pos,
0127               "  %-30s %10u  %10u  %10u  %10u\n", "fina_sync_err_cnt:",
0128               le32_to_cpu(ofdm->fina_sync_err_cnt),
0129               accum_ofdm->fina_sync_err_cnt,
0130               delta_ofdm->fina_sync_err_cnt,
0131               max_ofdm->fina_sync_err_cnt);
0132     pos +=
0133         scnprintf(buf + pos, bufsz - pos,
0134               "  %-30s %10u  %10u  %10u  %10u\n", "sfd_timeout:",
0135               le32_to_cpu(ofdm->sfd_timeout), accum_ofdm->sfd_timeout,
0136               delta_ofdm->sfd_timeout, max_ofdm->sfd_timeout);
0137     pos +=
0138         scnprintf(buf + pos, bufsz - pos,
0139               "  %-30s %10u  %10u  %10u  %10u\n", "fina_timeout:",
0140               le32_to_cpu(ofdm->fina_timeout), accum_ofdm->fina_timeout,
0141               delta_ofdm->fina_timeout, max_ofdm->fina_timeout);
0142     pos +=
0143         scnprintf(buf + pos, bufsz - pos,
0144               "  %-30s %10u  %10u  %10u  %10u\n", "unresponded_rts:",
0145               le32_to_cpu(ofdm->unresponded_rts),
0146               accum_ofdm->unresponded_rts, delta_ofdm->unresponded_rts,
0147               max_ofdm->unresponded_rts);
0148     pos +=
0149         scnprintf(buf + pos, bufsz - pos,
0150               "  %-30s %10u  %10u  %10u  %10u\n",
0151               "rxe_frame_lmt_ovrun:",
0152               le32_to_cpu(ofdm->rxe_frame_limit_overrun),
0153               accum_ofdm->rxe_frame_limit_overrun,
0154               delta_ofdm->rxe_frame_limit_overrun,
0155               max_ofdm->rxe_frame_limit_overrun);
0156     pos +=
0157         scnprintf(buf + pos, bufsz - pos,
0158               "  %-30s %10u  %10u  %10u  %10u\n", "sent_ack_cnt:",
0159               le32_to_cpu(ofdm->sent_ack_cnt), accum_ofdm->sent_ack_cnt,
0160               delta_ofdm->sent_ack_cnt, max_ofdm->sent_ack_cnt);
0161     pos +=
0162         scnprintf(buf + pos, bufsz - pos,
0163               "  %-30s %10u  %10u  %10u  %10u\n", "sent_cts_cnt:",
0164               le32_to_cpu(ofdm->sent_cts_cnt), accum_ofdm->sent_cts_cnt,
0165               delta_ofdm->sent_cts_cnt, max_ofdm->sent_cts_cnt);
0166 
0167     pos +=
0168         scnprintf(buf + pos, bufsz - pos,
0169               "%-32s     current"
0170               "accumulative      delta         max\n",
0171               "Statistics_Rx - CCK:");
0172     pos +=
0173         scnprintf(buf + pos, bufsz - pos,
0174               "  %-30s %10u  %10u  %10u  %10u\n", "ina_cnt:",
0175               le32_to_cpu(cck->ina_cnt), accum_cck->ina_cnt,
0176               delta_cck->ina_cnt, max_cck->ina_cnt);
0177     pos +=
0178         scnprintf(buf + pos, bufsz - pos,
0179               "  %-30s %10u  %10u  %10u  %10u\n", "fina_cnt:",
0180               le32_to_cpu(cck->fina_cnt), accum_cck->fina_cnt,
0181               delta_cck->fina_cnt, max_cck->fina_cnt);
0182     pos +=
0183         scnprintf(buf + pos, bufsz - pos,
0184               "  %-30s %10u  %10u  %10u  %10u\n", "plcp_err:",
0185               le32_to_cpu(cck->plcp_err), accum_cck->plcp_err,
0186               delta_cck->plcp_err, max_cck->plcp_err);
0187     pos +=
0188         scnprintf(buf + pos, bufsz - pos,
0189               "  %-30s %10u  %10u  %10u  %10u\n", "crc32_err:",
0190               le32_to_cpu(cck->crc32_err), accum_cck->crc32_err,
0191               delta_cck->crc32_err, max_cck->crc32_err);
0192     pos +=
0193         scnprintf(buf + pos, bufsz - pos,
0194               "  %-30s %10u  %10u  %10u  %10u\n", "overrun_err:",
0195               le32_to_cpu(cck->overrun_err), accum_cck->overrun_err,
0196               delta_cck->overrun_err, max_cck->overrun_err);
0197     pos +=
0198         scnprintf(buf + pos, bufsz - pos,
0199               "  %-30s %10u  %10u  %10u  %10u\n", "early_overrun_err:",
0200               le32_to_cpu(cck->early_overrun_err),
0201               accum_cck->early_overrun_err,
0202               delta_cck->early_overrun_err, max_cck->early_overrun_err);
0203     pos +=
0204         scnprintf(buf + pos, bufsz - pos,
0205               "  %-30s %10u  %10u  %10u  %10u\n", "crc32_good:",
0206               le32_to_cpu(cck->crc32_good), accum_cck->crc32_good,
0207               delta_cck->crc32_good, max_cck->crc32_good);
0208     pos +=
0209         scnprintf(buf + pos, bufsz - pos,
0210               "  %-30s %10u  %10u  %10u  %10u\n", "false_alarm_cnt:",
0211               le32_to_cpu(cck->false_alarm_cnt),
0212               accum_cck->false_alarm_cnt, delta_cck->false_alarm_cnt,
0213               max_cck->false_alarm_cnt);
0214     pos +=
0215         scnprintf(buf + pos, bufsz - pos,
0216               "  %-30s %10u  %10u  %10u  %10u\n", "fina_sync_err_cnt:",
0217               le32_to_cpu(cck->fina_sync_err_cnt),
0218               accum_cck->fina_sync_err_cnt,
0219               delta_cck->fina_sync_err_cnt, max_cck->fina_sync_err_cnt);
0220     pos +=
0221         scnprintf(buf + pos, bufsz - pos,
0222               "  %-30s %10u  %10u  %10u  %10u\n", "sfd_timeout:",
0223               le32_to_cpu(cck->sfd_timeout), accum_cck->sfd_timeout,
0224               delta_cck->sfd_timeout, max_cck->sfd_timeout);
0225     pos +=
0226         scnprintf(buf + pos, bufsz - pos,
0227               "  %-30s %10u  %10u  %10u  %10u\n", "fina_timeout:",
0228               le32_to_cpu(cck->fina_timeout), accum_cck->fina_timeout,
0229               delta_cck->fina_timeout, max_cck->fina_timeout);
0230     pos +=
0231         scnprintf(buf + pos, bufsz - pos,
0232               "  %-30s %10u  %10u  %10u  %10u\n", "unresponded_rts:",
0233               le32_to_cpu(cck->unresponded_rts),
0234               accum_cck->unresponded_rts, delta_cck->unresponded_rts,
0235               max_cck->unresponded_rts);
0236     pos +=
0237         scnprintf(buf + pos, bufsz - pos,
0238               "  %-30s %10u  %10u  %10u  %10u\n",
0239               "rxe_frame_lmt_ovrun:",
0240               le32_to_cpu(cck->rxe_frame_limit_overrun),
0241               accum_cck->rxe_frame_limit_overrun,
0242               delta_cck->rxe_frame_limit_overrun,
0243               max_cck->rxe_frame_limit_overrun);
0244     pos +=
0245         scnprintf(buf + pos, bufsz - pos,
0246               "  %-30s %10u  %10u  %10u  %10u\n", "sent_ack_cnt:",
0247               le32_to_cpu(cck->sent_ack_cnt), accum_cck->sent_ack_cnt,
0248               delta_cck->sent_ack_cnt, max_cck->sent_ack_cnt);
0249     pos +=
0250         scnprintf(buf + pos, bufsz - pos,
0251               "  %-30s %10u  %10u  %10u  %10u\n", "sent_cts_cnt:",
0252               le32_to_cpu(cck->sent_cts_cnt), accum_cck->sent_cts_cnt,
0253               delta_cck->sent_cts_cnt, max_cck->sent_cts_cnt);
0254 
0255     pos +=
0256         scnprintf(buf + pos, bufsz - pos,
0257               "%-32s     current"
0258               "accumulative      delta         max\n",
0259               "Statistics_Rx - GENERAL:");
0260     pos +=
0261         scnprintf(buf + pos, bufsz - pos,
0262               "  %-30s %10u  %10u  %10u  %10u\n", "bogus_cts:",
0263               le32_to_cpu(general->bogus_cts), accum_general->bogus_cts,
0264               delta_general->bogus_cts, max_general->bogus_cts);
0265     pos +=
0266         scnprintf(buf + pos, bufsz - pos,
0267               "  %-30s %10u  %10u  %10u  %10u\n", "bogus_ack:",
0268               le32_to_cpu(general->bogus_ack), accum_general->bogus_ack,
0269               delta_general->bogus_ack, max_general->bogus_ack);
0270     pos +=
0271         scnprintf(buf + pos, bufsz - pos,
0272               "  %-30s %10u  %10u  %10u  %10u\n", "non_bssid_frames:",
0273               le32_to_cpu(general->non_bssid_frames),
0274               accum_general->non_bssid_frames,
0275               delta_general->non_bssid_frames,
0276               max_general->non_bssid_frames);
0277     pos +=
0278         scnprintf(buf + pos, bufsz - pos,
0279               "  %-30s %10u  %10u  %10u  %10u\n", "filtered_frames:",
0280               le32_to_cpu(general->filtered_frames),
0281               accum_general->filtered_frames,
0282               delta_general->filtered_frames,
0283               max_general->filtered_frames);
0284     pos +=
0285         scnprintf(buf + pos, bufsz - pos,
0286               "  %-30s %10u  %10u  %10u  %10u\n",
0287               "non_channel_beacons:",
0288               le32_to_cpu(general->non_channel_beacons),
0289               accum_general->non_channel_beacons,
0290               delta_general->non_channel_beacons,
0291               max_general->non_channel_beacons);
0292 
0293     ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos);
0294     kfree(buf);
0295     return ret;
0296 }
0297 
0298 static ssize_t
0299 il3945_ucode_tx_stats_read(struct file *file, char __user *user_buf,
0300                size_t count, loff_t *ppos)
0301 {
0302     struct il_priv *il = file->private_data;
0303     int pos = 0;
0304     char *buf;
0305     int bufsz = (sizeof(struct iwl39_stats_tx) * 48) + 250;
0306     ssize_t ret;
0307     struct iwl39_stats_tx *tx, *accum_tx, *delta_tx, *max_tx;
0308 
0309     if (!il_is_alive(il))
0310         return -EAGAIN;
0311 
0312     buf = kzalloc(bufsz, GFP_KERNEL);
0313     if (!buf) {
0314         IL_ERR("Can not allocate Buffer\n");
0315         return -ENOMEM;
0316     }
0317 
0318     /*
0319      * The statistic information display here is based on
0320      * the last stats notification from uCode
0321      * might not reflect the current uCode activity
0322      */
0323     tx = &il->_3945.stats.tx;
0324     accum_tx = &il->_3945.accum_stats.tx;
0325     delta_tx = &il->_3945.delta_stats.tx;
0326     max_tx = &il->_3945.max_delta.tx;
0327     pos += il3945_stats_flag(il, buf, bufsz);
0328     pos +=
0329         scnprintf(buf + pos, bufsz - pos,
0330               "%-32s     current"
0331               "accumulative      delta         max\n",
0332               "Statistics_Tx:");
0333     pos +=
0334         scnprintf(buf + pos, bufsz - pos,
0335               "  %-30s %10u  %10u  %10u  %10u\n", "preamble:",
0336               le32_to_cpu(tx->preamble_cnt), accum_tx->preamble_cnt,
0337               delta_tx->preamble_cnt, max_tx->preamble_cnt);
0338     pos +=
0339         scnprintf(buf + pos, bufsz - pos,
0340               "  %-30s %10u  %10u  %10u  %10u\n", "rx_detected_cnt:",
0341               le32_to_cpu(tx->rx_detected_cnt),
0342               accum_tx->rx_detected_cnt, delta_tx->rx_detected_cnt,
0343               max_tx->rx_detected_cnt);
0344     pos +=
0345         scnprintf(buf + pos, bufsz - pos,
0346               "  %-30s %10u  %10u  %10u  %10u\n", "bt_prio_defer_cnt:",
0347               le32_to_cpu(tx->bt_prio_defer_cnt),
0348               accum_tx->bt_prio_defer_cnt, delta_tx->bt_prio_defer_cnt,
0349               max_tx->bt_prio_defer_cnt);
0350     pos +=
0351         scnprintf(buf + pos, bufsz - pos,
0352               "  %-30s %10u  %10u  %10u  %10u\n", "bt_prio_kill_cnt:",
0353               le32_to_cpu(tx->bt_prio_kill_cnt),
0354               accum_tx->bt_prio_kill_cnt, delta_tx->bt_prio_kill_cnt,
0355               max_tx->bt_prio_kill_cnt);
0356     pos +=
0357         scnprintf(buf + pos, bufsz - pos,
0358               "  %-30s %10u  %10u  %10u  %10u\n", "few_bytes_cnt:",
0359               le32_to_cpu(tx->few_bytes_cnt), accum_tx->few_bytes_cnt,
0360               delta_tx->few_bytes_cnt, max_tx->few_bytes_cnt);
0361     pos +=
0362         scnprintf(buf + pos, bufsz - pos,
0363               "  %-30s %10u  %10u  %10u  %10u\n", "cts_timeout:",
0364               le32_to_cpu(tx->cts_timeout), accum_tx->cts_timeout,
0365               delta_tx->cts_timeout, max_tx->cts_timeout);
0366     pos +=
0367         scnprintf(buf + pos, bufsz - pos,
0368               "  %-30s %10u  %10u  %10u  %10u\n", "ack_timeout:",
0369               le32_to_cpu(tx->ack_timeout), accum_tx->ack_timeout,
0370               delta_tx->ack_timeout, max_tx->ack_timeout);
0371     pos +=
0372         scnprintf(buf + pos, bufsz - pos,
0373               "  %-30s %10u  %10u  %10u  %10u\n", "expected_ack_cnt:",
0374               le32_to_cpu(tx->expected_ack_cnt),
0375               accum_tx->expected_ack_cnt, delta_tx->expected_ack_cnt,
0376               max_tx->expected_ack_cnt);
0377     pos +=
0378         scnprintf(buf + pos, bufsz - pos,
0379               "  %-30s %10u  %10u  %10u  %10u\n", "actual_ack_cnt:",
0380               le32_to_cpu(tx->actual_ack_cnt), accum_tx->actual_ack_cnt,
0381               delta_tx->actual_ack_cnt, max_tx->actual_ack_cnt);
0382 
0383     ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos);
0384     kfree(buf);
0385     return ret;
0386 }
0387 
0388 static ssize_t
0389 il3945_ucode_general_stats_read(struct file *file, char __user *user_buf,
0390                 size_t count, loff_t *ppos)
0391 {
0392     struct il_priv *il = file->private_data;
0393     int pos = 0;
0394     char *buf;
0395     int bufsz = sizeof(struct iwl39_stats_general) * 10 + 300;
0396     ssize_t ret;
0397     struct iwl39_stats_general *general, *accum_general;
0398     struct iwl39_stats_general *delta_general, *max_general;
0399     struct stats_dbg *dbg, *accum_dbg, *delta_dbg, *max_dbg;
0400     struct iwl39_stats_div *div, *accum_div, *delta_div, *max_div;
0401 
0402     if (!il_is_alive(il))
0403         return -EAGAIN;
0404 
0405     buf = kzalloc(bufsz, GFP_KERNEL);
0406     if (!buf) {
0407         IL_ERR("Can not allocate Buffer\n");
0408         return -ENOMEM;
0409     }
0410 
0411     /*
0412      * The statistic information display here is based on
0413      * the last stats notification from uCode
0414      * might not reflect the current uCode activity
0415      */
0416     general = &il->_3945.stats.general;
0417     dbg = &il->_3945.stats.general.dbg;
0418     div = &il->_3945.stats.general.div;
0419     accum_general = &il->_3945.accum_stats.general;
0420     delta_general = &il->_3945.delta_stats.general;
0421     max_general = &il->_3945.max_delta.general;
0422     accum_dbg = &il->_3945.accum_stats.general.dbg;
0423     delta_dbg = &il->_3945.delta_stats.general.dbg;
0424     max_dbg = &il->_3945.max_delta.general.dbg;
0425     accum_div = &il->_3945.accum_stats.general.div;
0426     delta_div = &il->_3945.delta_stats.general.div;
0427     max_div = &il->_3945.max_delta.general.div;
0428     pos += il3945_stats_flag(il, buf, bufsz);
0429     pos +=
0430         scnprintf(buf + pos, bufsz - pos,
0431               "%-32s     current"
0432               "accumulative      delta         max\n",
0433               "Statistics_General:");
0434     pos +=
0435         scnprintf(buf + pos, bufsz - pos,
0436               "  %-30s %10u  %10u  %10u  %10u\n", "burst_check:",
0437               le32_to_cpu(dbg->burst_check), accum_dbg->burst_check,
0438               delta_dbg->burst_check, max_dbg->burst_check);
0439     pos +=
0440         scnprintf(buf + pos, bufsz - pos,
0441               "  %-30s %10u  %10u  %10u  %10u\n", "burst_count:",
0442               le32_to_cpu(dbg->burst_count), accum_dbg->burst_count,
0443               delta_dbg->burst_count, max_dbg->burst_count);
0444     pos +=
0445         scnprintf(buf + pos, bufsz - pos,
0446               "  %-30s %10u  %10u  %10u  %10u\n", "sleep_time:",
0447               le32_to_cpu(general->sleep_time),
0448               accum_general->sleep_time, delta_general->sleep_time,
0449               max_general->sleep_time);
0450     pos +=
0451         scnprintf(buf + pos, bufsz - pos,
0452               "  %-30s %10u  %10u  %10u  %10u\n", "slots_out:",
0453               le32_to_cpu(general->slots_out), accum_general->slots_out,
0454               delta_general->slots_out, max_general->slots_out);
0455     pos +=
0456         scnprintf(buf + pos, bufsz - pos,
0457               "  %-30s %10u  %10u  %10u  %10u\n", "slots_idle:",
0458               le32_to_cpu(general->slots_idle),
0459               accum_general->slots_idle, delta_general->slots_idle,
0460               max_general->slots_idle);
0461     pos +=
0462         scnprintf(buf + pos, bufsz - pos, "ttl_timestamp:\t\t\t%u\n",
0463               le32_to_cpu(general->ttl_timestamp));
0464     pos +=
0465         scnprintf(buf + pos, bufsz - pos,
0466               "  %-30s %10u  %10u  %10u  %10u\n", "tx_on_a:",
0467               le32_to_cpu(div->tx_on_a), accum_div->tx_on_a,
0468               delta_div->tx_on_a, max_div->tx_on_a);
0469     pos +=
0470         scnprintf(buf + pos, bufsz - pos,
0471               "  %-30s %10u  %10u  %10u  %10u\n", "tx_on_b:",
0472               le32_to_cpu(div->tx_on_b), accum_div->tx_on_b,
0473               delta_div->tx_on_b, max_div->tx_on_b);
0474     pos +=
0475         scnprintf(buf + pos, bufsz - pos,
0476               "  %-30s %10u  %10u  %10u  %10u\n", "exec_time:",
0477               le32_to_cpu(div->exec_time), accum_div->exec_time,
0478               delta_div->exec_time, max_div->exec_time);
0479     pos +=
0480         scnprintf(buf + pos, bufsz - pos,
0481               "  %-30s %10u  %10u  %10u  %10u\n", "probe_time:",
0482               le32_to_cpu(div->probe_time), accum_div->probe_time,
0483               delta_div->probe_time, max_div->probe_time);
0484     ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos);
0485     kfree(buf);
0486     return ret;
0487 }
0488 
0489 const struct il_debugfs_ops il3945_debugfs_ops = {
0490     .rx_stats_read = il3945_ucode_rx_stats_read,
0491     .tx_stats_read = il3945_ucode_tx_stats_read,
0492     .general_stats_read = il3945_ucode_general_stats_read,
0493 };