/* * Copyright (c) 2014 Redpine Signals Inc. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include"rsi_debugfs.h" #include"rsi_sdio.h"
/** * rsi_sdio_stats_read() - This function returns the sdio status of the driver. * @seq: Pointer to the sequence file structure. * @data: Pointer to the data. * * Return: 0 on success, -1 on failure.
*/ staticint rsi_sdio_stats_read(struct seq_file *seq, void *data)
{ struct rsi_common *common = seq->private; struct rsi_hw *adapter = common->priv; struct rsi_91x_sdiodev *dev = adapter->rsi_dev;
seq_printf(seq, "total_sdio_interrupts: %d\n",
dev->rx_info.sdio_int_counter);
seq_printf(seq, "sdio_msdu_pending_intr_count: %d\n",
dev->rx_info.total_sdio_msdu_pending_intr);
seq_printf(seq, "sdio_buff_full_count : %d\n",
dev->rx_info.buf_full_counter);
seq_printf(seq, "sdio_buf_semi_full_count %d\n",
dev->rx_info.buf_semi_full_counter);
seq_printf(seq, "sdio_unknown_intr_count: %d\n",
dev->rx_info.total_sdio_unknown_intr); /* RX Path Stats */
seq_printf(seq, "BUFFER FULL STATUS : %d\n",
dev->rx_info.buffer_full);
seq_printf(seq, "SEMI BUFFER FULL STATUS : %d\n",
dev->rx_info.semi_buffer_full);
seq_printf(seq, "MGMT BUFFER FULL STATUS : %d\n",
dev->rx_info.mgmt_buffer_full);
seq_printf(seq, "BUFFER FULL COUNTER : %d\n",
dev->rx_info.buf_full_counter);
seq_printf(seq, "BUFFER SEMI FULL COUNTER : %d\n",
dev->rx_info.buf_semi_full_counter);
seq_printf(seq, "MGMT BUFFER FULL COUNTER : %d\n",
dev->rx_info.mgmt_buf_full_counter);
return 0;
}
/** * rsi_sdio_stats_open() - This function calls single open function of seq_file * to open file and read contents from it. * @inode: Pointer to the inode structure. * @file: Pointer to the file structure. * * Return: Pointer to the opened file status: 0 on success, ENOMEM on failure.
*/ staticint rsi_sdio_stats_open(struct inode *inode, struct file *file)
{ return single_open(file, rsi_sdio_stats_read, inode->i_private);
}
/** * rsi_version_read() - This function gives driver and firmware version number. * @seq: Pointer to the sequence file structure. * @data: Pointer to the data. * * Return: 0 on success, -1 on failure.
*/ staticint rsi_version_read(struct seq_file *seq, void *data)
{ struct rsi_common *common = seq->private;
/** * rsi_version_open() - This function calls single open function of seq_file to * open file and read contents from it. * @inode: Pointer to the inode structure. * @file: Pointer to the file structure. * * Return: Pointer to the opened file status: 0 on success, ENOMEM on failure.
*/ staticint rsi_version_open(struct inode *inode, struct file *file)
{ return single_open(file, rsi_version_read, inode->i_private);
}
/** * rsi_stats_read() - This function return the status of the driver. * @seq: Pointer to the sequence file structure. * @data: Pointer to the data. * * Return: 0 on success, -1 on failure.
*/ staticint rsi_stats_read(struct seq_file *seq, void *data)
{ struct rsi_common *common = seq->private;
/** * rsi_stats_open() - This function calls single open function of seq_file to * open file and read contents from it. * @inode: Pointer to the inode structure. * @file: Pointer to the file structure. * * Return: Pointer to the opened file status: 0 on success, ENOMEM on failure.
*/ staticint rsi_stats_open(struct inode *inode, struct file *file)
{ return single_open(file, rsi_stats_read, inode->i_private);
}
/** * rsi_debug_zone_read() - This function display the currently enabled debug zones. * @seq: Pointer to the sequence file structure. * @data: Pointer to the data. * * Return: 0 on success, -1 on failure.
*/ staticint rsi_debug_zone_read(struct seq_file *seq, void *data)
{
rsi_dbg(FSM_ZONE, "%x: rsi_enabled zone", rsi_zone_enabled);
seq_printf(seq, "The zones available are %#x\n",
rsi_zone_enabled); return 0;
}
/** * rsi_debug_read() - This function calls single open function of seq_file to * open file and read contents from it. * @inode: Pointer to the inode structure. * @file: Pointer to the file structure. * * Return: Pointer to the opened file status: 0 on success, ENOMEM on failure.
*/ staticint rsi_debug_read(struct inode *inode, struct file *file)
{ return single_open(file, rsi_debug_zone_read, inode->i_private);
}
/** * rsi_debug_zone_write() - This function writes into hal queues as per user * requirement. * @filp: Pointer to the file structure. * @buff: Pointer to the character buffer. * @len: Length of the data to be written into buffer. * @data: Pointer to the data. * * Return: len: Number of bytes read.
*/ static ssize_t rsi_debug_zone_write(struct file *filp, constchar __user *buff,
size_t len,
loff_t *data)
{ unsignedlong dbg_zone; int ret;
if (!len) return 0;
ret = kstrtoul_from_user(buff, len, 16, &dbg_zone);
/** * rsi_remove_dbgfs() - Removes the previously created dbgfs file entries * in the reverse order of creation. * @adapter: Pointer to the adapter structure. * * Return: None.
*/ void rsi_remove_dbgfs(struct rsi_hw *adapter)
{ struct rsi_debugfs *dev_dbgfs = adapter->dfsentry;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.