Commit b8c76267 authored by Abhijeet Kolekar's avatar Abhijeet Kolekar Committed by Reinette Chatre

iwlwifi: add debugfs ops to iwlwifi

Seperate debugfs functions into iwlagn specific
debugfs file and Add debugfs ops to iwlwifi.
Signed-off-by: default avatarAbhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: default avatarReinette Chatre <reinette.chatre@intel.com>
parent 69e72801
...@@ -12,6 +12,7 @@ obj-$(CONFIG_IWLAGN) += iwlagn.o ...@@ -12,6 +12,7 @@ obj-$(CONFIG_IWLAGN) += iwlagn.o
iwlagn-objs := iwl-agn.o iwl-agn-rs.o iwl-agn-led.o iwl-agn-ict.o iwlagn-objs := iwl-agn.o iwl-agn-rs.o iwl-agn-led.o iwl-agn-ict.o
iwlagn-objs += iwl-agn-ucode.o iwl-agn-hcmd.o iwl-agn-tx.o iwlagn-objs += iwl-agn-ucode.o iwl-agn-hcmd.o iwl-agn-tx.o
iwlagn-objs += iwl-agn-lib.o iwlagn-objs += iwl-agn-lib.o
iwlagn-$(CONFIG_IWLWIFI_DEBUGFS) += iwl-agn-debugfs.o
iwlagn-$(CONFIG_IWL4965) += iwl-4965.o iwlagn-$(CONFIG_IWL4965) += iwl-4965.o
iwlagn-$(CONFIG_IWL5000) += iwl-5000.o iwlagn-$(CONFIG_IWL5000) += iwl-5000.o
......
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
#include "iwl-helpers.h" #include "iwl-helpers.h"
#include "iwl-agn-hw.h" #include "iwl-agn-hw.h"
#include "iwl-agn-led.h" #include "iwl-agn-led.h"
#include "iwl-agn-debugfs.h"
/* Highest firmware API version supported */ /* Highest firmware API version supported */
#define IWL1000_UCODE_API_MAX 3 #define IWL1000_UCODE_API_MAX 3
...@@ -212,6 +213,11 @@ static struct iwl_lib_ops iwl1000_lib = { ...@@ -212,6 +213,11 @@ static struct iwl_lib_ops iwl1000_lib = {
.set_ct_kill = iwl1000_set_ct_threshold, .set_ct_kill = iwl1000_set_ct_threshold,
}, },
.add_bcast_station = iwl_add_bcast_station, .add_bcast_station = iwl_add_bcast_station,
.debugfs_ops = {
.rx_stats_read = iwl_ucode_rx_stats_read,
.tx_stats_read = iwl_ucode_tx_stats_read,
.general_stats_read = iwl_ucode_general_stats_read,
},
.recover_from_tx_stall = iwl_bg_monitor_recover, .recover_from_tx_stall = iwl_bg_monitor_recover,
.check_plcp_health = iwl_good_plcp_health, .check_plcp_health = iwl_good_plcp_health,
.check_ack_health = iwl_good_ack_health, .check_ack_health = iwl_good_ack_health,
......
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
#include "iwl-sta.h" #include "iwl-sta.h"
#include "iwl-agn-led.h" #include "iwl-agn-led.h"
#include "iwl-agn.h" #include "iwl-agn.h"
#include "iwl-agn-debugfs.h"
static int iwl4965_send_tx_power(struct iwl_priv *priv); static int iwl4965_send_tx_power(struct iwl_priv *priv);
static int iwl4965_hw_get_temperature(struct iwl_priv *priv); static int iwl4965_hw_get_temperature(struct iwl_priv *priv);
...@@ -2217,6 +2218,11 @@ static struct iwl_lib_ops iwl4965_lib = { ...@@ -2217,6 +2218,11 @@ static struct iwl_lib_ops iwl4965_lib = {
.set_ct_kill = iwl4965_set_ct_threshold, .set_ct_kill = iwl4965_set_ct_threshold,
}, },
.add_bcast_station = iwl_add_bcast_station, .add_bcast_station = iwl_add_bcast_station,
.debugfs_ops = {
.rx_stats_read = iwl_ucode_rx_stats_read,
.tx_stats_read = iwl_ucode_tx_stats_read,
.general_stats_read = iwl_ucode_general_stats_read,
},
.check_plcp_health = iwl_good_plcp_health, .check_plcp_health = iwl_good_plcp_health,
}; };
......
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
#include "iwl-agn-led.h" #include "iwl-agn-led.h"
#include "iwl-agn-hw.h" #include "iwl-agn-hw.h"
#include "iwl-5000-hw.h" #include "iwl-5000-hw.h"
#include "iwl-agn-debugfs.h"
/* Highest firmware API version supported */ /* Highest firmware API version supported */
#define IWL5000_UCODE_API_MAX 2 #define IWL5000_UCODE_API_MAX 2
...@@ -320,6 +321,11 @@ static struct iwl_lib_ops iwl5000_lib = { ...@@ -320,6 +321,11 @@ static struct iwl_lib_ops iwl5000_lib = {
.set_ct_kill = iwl5000_set_ct_threshold, .set_ct_kill = iwl5000_set_ct_threshold,
}, },
.add_bcast_station = iwl_add_bcast_station, .add_bcast_station = iwl_add_bcast_station,
.debugfs_ops = {
.rx_stats_read = iwl_ucode_rx_stats_read,
.tx_stats_read = iwl_ucode_tx_stats_read,
.general_stats_read = iwl_ucode_general_stats_read,
},
.recover_from_tx_stall = iwl_bg_monitor_recover, .recover_from_tx_stall = iwl_bg_monitor_recover,
.check_plcp_health = iwl_good_plcp_health, .check_plcp_health = iwl_good_plcp_health,
.check_ack_health = iwl_good_ack_health, .check_ack_health = iwl_good_ack_health,
...@@ -377,6 +383,11 @@ static struct iwl_lib_ops iwl5150_lib = { ...@@ -377,6 +383,11 @@ static struct iwl_lib_ops iwl5150_lib = {
.set_ct_kill = iwl5150_set_ct_threshold, .set_ct_kill = iwl5150_set_ct_threshold,
}, },
.add_bcast_station = iwl_add_bcast_station, .add_bcast_station = iwl_add_bcast_station,
.debugfs_ops = {
.rx_stats_read = iwl_ucode_rx_stats_read,
.tx_stats_read = iwl_ucode_tx_stats_read,
.general_stats_read = iwl_ucode_general_stats_read,
},
.recover_from_tx_stall = iwl_bg_monitor_recover, .recover_from_tx_stall = iwl_bg_monitor_recover,
.check_plcp_health = iwl_good_plcp_health, .check_plcp_health = iwl_good_plcp_health,
.check_ack_health = iwl_good_ack_health, .check_ack_health = iwl_good_ack_health,
......
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
#include "iwl-agn-hw.h" #include "iwl-agn-hw.h"
#include "iwl-6000-hw.h" #include "iwl-6000-hw.h"
#include "iwl-agn-led.h" #include "iwl-agn-led.h"
#include "iwl-agn-debugfs.h"
/* Highest firmware API version supported */ /* Highest firmware API version supported */
#define IWL6000_UCODE_API_MAX 4 #define IWL6000_UCODE_API_MAX 4
...@@ -284,6 +285,11 @@ static struct iwl_lib_ops iwl6000_lib = { ...@@ -284,6 +285,11 @@ static struct iwl_lib_ops iwl6000_lib = {
.set_ct_kill = iwl6000_set_ct_threshold, .set_ct_kill = iwl6000_set_ct_threshold,
}, },
.add_bcast_station = iwl_add_bcast_station, .add_bcast_station = iwl_add_bcast_station,
.debugfs_ops = {
.rx_stats_read = iwl_ucode_rx_stats_read,
.tx_stats_read = iwl_ucode_tx_stats_read,
.general_stats_read = iwl_ucode_general_stats_read,
},
.recover_from_tx_stall = iwl_bg_monitor_recover, .recover_from_tx_stall = iwl_bg_monitor_recover,
.check_plcp_health = iwl_good_plcp_health, .check_plcp_health = iwl_good_plcp_health,
.check_ack_health = iwl_good_ack_health, .check_ack_health = iwl_good_ack_health,
...@@ -352,6 +358,11 @@ static struct iwl_lib_ops iwl6050_lib = { ...@@ -352,6 +358,11 @@ static struct iwl_lib_ops iwl6050_lib = {
.set_calib_version = iwl6050_set_calib_version, .set_calib_version = iwl6050_set_calib_version,
}, },
.add_bcast_station = iwl_add_bcast_station, .add_bcast_station = iwl_add_bcast_station,
.debugfs_ops = {
.rx_stats_read = iwl_ucode_rx_stats_read,
.tx_stats_read = iwl_ucode_tx_stats_read,
.general_stats_read = iwl_ucode_general_stats_read,
},
.recover_from_tx_stall = iwl_bg_monitor_recover, .recover_from_tx_stall = iwl_bg_monitor_recover,
.check_plcp_health = iwl_good_plcp_health, .check_plcp_health = iwl_good_plcp_health,
.check_ack_health = iwl_good_ack_health, .check_ack_health = iwl_good_ack_health,
......
This diff is collapsed.
/******************************************************************************
*
* GPL LICENSE SUMMARY
*
* Copyright(c) 2008 - 2010 Intel Corporation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
* USA
*
* The full GNU General Public License is included in this distribution
* in the file called LICENSE.GPL.
*
* Contact Information:
* Intel Linux Wireless <ilw@linux.intel.com>
* Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*****************************************************************************/
#include "iwl-dev.h"
#include "iwl-core.h"
#include "iwl-debug.h"
#ifdef CONFIG_IWLWIFI_DEBUGFS
ssize_t iwl_ucode_rx_stats_read(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos);
ssize_t iwl_ucode_tx_stats_read(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos);
ssize_t iwl_ucode_general_stats_read(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos);
#else
static ssize_t iwl_ucode_rx_stats_read(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
{
return 0;
}
static ssize_t iwl_ucode_tx_stats_read(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
{
return 0;
}
static ssize_t iwl_ucode_general_stats_read(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
{
return 0;
}
#endif
...@@ -115,6 +115,15 @@ struct iwl_apm_ops { ...@@ -115,6 +115,15 @@ struct iwl_apm_ops {
int (*set_pwr_src)(struct iwl_priv *priv, enum iwl_pwr_src src); int (*set_pwr_src)(struct iwl_priv *priv, enum iwl_pwr_src src);
}; };
struct iwl_debugfs_ops {
ssize_t (*rx_stats_read)(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos);
ssize_t (*tx_stats_read)(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos);
ssize_t (*general_stats_read)(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos);
};
struct iwl_temp_ops { struct iwl_temp_ops {
void (*temperature)(struct iwl_priv *priv); void (*temperature)(struct iwl_priv *priv);
void (*set_ct_kill)(struct iwl_priv *priv); void (*set_ct_kill)(struct iwl_priv *priv);
...@@ -200,6 +209,7 @@ struct iwl_lib_ops { ...@@ -200,6 +209,7 @@ struct iwl_lib_ops {
/* check for ack health */ /* check for ack health */
bool (*check_ack_health)(struct iwl_priv *priv, bool (*check_ack_health)(struct iwl_priv *priv,
struct iwl_rx_packet *pkt); struct iwl_rx_packet *pkt);
struct iwl_debugfs_ops debugfs_ops;
}; };
struct iwl_led_ops { struct iwl_led_ops {
......
...@@ -78,6 +78,8 @@ static inline void iwl_print_hex_dump(struct iwl_priv *priv, int level, ...@@ -78,6 +78,8 @@ static inline void iwl_print_hex_dump(struct iwl_priv *priv, int level,
#ifdef CONFIG_IWLWIFI_DEBUGFS #ifdef CONFIG_IWLWIFI_DEBUGFS
int iwl_dbgfs_register(struct iwl_priv *priv, const char *name); int iwl_dbgfs_register(struct iwl_priv *priv, const char *name);
void iwl_dbgfs_unregister(struct iwl_priv *priv); void iwl_dbgfs_unregister(struct iwl_priv *priv);
extern int iwl_dbgfs_statistics_flag(struct iwl_priv *priv, char *buf,
int bufsz);
#else #else
static inline int iwl_dbgfs_register(struct iwl_priv *priv, const char *name) static inline int iwl_dbgfs_register(struct iwl_priv *priv, const char *name)
{ {
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment