aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/wil6210/debugfs.c
diff options
context:
space:
mode:
authorVladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>2014-06-16 12:37:13 -0400
committerJohn W. Linville <linville@tuxdriver.com>2014-06-19 15:49:25 -0400
commit9eb82d43da0618f6bab78de0f18e7405085dd955 (patch)
tree25adbd213a82c87f9669b4ef64dc7f7bc44a0bbe /drivers/net/wireless/ath/wil6210/debugfs.c
parentd45cff9f6151bf40006a97804a83e55abccbc21b (diff)
wil6210: add 'freq' and 'link' debugfs entries
Expose operational frequency and link info Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/wil6210/debugfs.c')
-rw-r--r--drivers/net/wireless/ath/wil6210/debugfs.c76
1 files changed, 76 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/wil6210/debugfs.c b/drivers/net/wireless/ath/wil6210/debugfs.c
index 89f0d094c5a2..d6acb309dd16 100644
--- a/drivers/net/wireless/ath/wil6210/debugfs.c
+++ b/drivers/net/wireless/ath/wil6210/debugfs.c
@@ -773,6 +773,80 @@ static const struct file_operations fops_temp = {
773 .llseek = seq_lseek, 773 .llseek = seq_lseek,
774}; 774};
775 775
776/*---------freq------------*/
777static int wil_freq_debugfs_show(struct seq_file *s, void *data)
778{
779 struct wil6210_priv *wil = s->private;
780 struct wireless_dev *wdev = wil_to_wdev(wil);
781 u16 freq = wdev->chandef.chan ? wdev->chandef.chan->center_freq : 0;
782
783 seq_printf(s, "Freq = %d\n", freq);
784
785 return 0;
786}
787
788static int wil_freq_seq_open(struct inode *inode, struct file *file)
789{
790 return single_open(file, wil_freq_debugfs_show, inode->i_private);
791}
792
793static const struct file_operations fops_freq = {
794 .open = wil_freq_seq_open,
795 .release = single_release,
796 .read = seq_read,
797 .llseek = seq_lseek,
798};
799
800/*---------link------------*/
801static int wil_link_debugfs_show(struct seq_file *s, void *data)
802{
803 struct wil6210_priv *wil = s->private;
804 struct station_info sinfo;
805 int i, rc;
806
807 for (i = 0; i < ARRAY_SIZE(wil->sta); i++) {
808 struct wil_sta_info *p = &wil->sta[i];
809 char *status = "unknown";
810 switch (p->status) {
811 case wil_sta_unused:
812 status = "unused ";
813 break;
814 case wil_sta_conn_pending:
815 status = "pending ";
816 break;
817 case wil_sta_connected:
818 status = "connected";
819 break;
820 }
821 seq_printf(s, "[%d] %pM %s%s\n", i, p->addr, status,
822 (p->data_port_open ? " data_port_open" : ""));
823
824 if (p->status == wil_sta_connected) {
825 rc = wil_cid_fill_sinfo(wil, i, &sinfo);
826 if (rc)
827 return rc;
828
829 seq_printf(s, " Tx_mcs = %d\n", sinfo.txrate.mcs);
830 seq_printf(s, " Rx_mcs = %d\n", sinfo.rxrate.mcs);
831 seq_printf(s, " SQ = %d\n", sinfo.signal);
832 }
833 }
834
835 return 0;
836}
837
838static int wil_link_seq_open(struct inode *inode, struct file *file)
839{
840 return single_open(file, wil_link_debugfs_show, inode->i_private);
841}
842
843static const struct file_operations fops_link = {
844 .open = wil_link_seq_open,
845 .release = single_release,
846 .read = seq_read,
847 .llseek = seq_lseek,
848};
849
776/*---------Station matrix------------*/ 850/*---------Station matrix------------*/
777static void wil_print_rxtid(struct seq_file *s, struct wil_tid_ampdu_rx *r) 851static void wil_print_rxtid(struct seq_file *s, struct wil_tid_ampdu_rx *r)
778{ 852{
@@ -880,6 +954,8 @@ int wil6210_debugfs_init(struct wil6210_priv *wil)
880 debugfs_create_file("tx_mgmt", S_IWUSR, dbg, wil, &fops_txmgmt); 954 debugfs_create_file("tx_mgmt", S_IWUSR, dbg, wil, &fops_txmgmt);
881 debugfs_create_file("wmi_send", S_IWUSR, dbg, wil, &fops_wmi); 955 debugfs_create_file("wmi_send", S_IWUSR, dbg, wil, &fops_wmi);
882 debugfs_create_file("temp", S_IRUGO, dbg, wil, &fops_temp); 956 debugfs_create_file("temp", S_IRUGO, dbg, wil, &fops_temp);
957 debugfs_create_file("freq", S_IRUGO, dbg, wil, &fops_freq);
958 debugfs_create_file("link", S_IRUGO, dbg, wil, &fops_link);
883 959
884 wil->rgf_blob.data = (void * __force)wil->csr + 0; 960 wil->rgf_blob.data = (void * __force)wil->csr + 0;
885 wil->rgf_blob.size = 0xa000; 961 wil->rgf_blob.size = 0xa000;