diff options
author | Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> | 2014-06-16 12:37:13 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-06-19 15:49:25 -0400 |
commit | 9eb82d43da0618f6bab78de0f18e7405085dd955 (patch) | |
tree | 25adbd213a82c87f9669b4ef64dc7f7bc44a0bbe /drivers/net | |
parent | d45cff9f6151bf40006a97804a83e55abccbc21b (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')
-rw-r--r-- | drivers/net/wireless/ath/wil6210/cfg80211.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/ath/wil6210/debugfs.c | 76 | ||||
-rw-r--r-- | drivers/net/wireless/ath/wil6210/wil6210.h | 2 |
3 files changed, 80 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/wil6210/cfg80211.c b/drivers/net/wireless/ath/wil6210/cfg80211.c index 850a2f11e0f9..4ac2c208c9ba 100644 --- a/drivers/net/wireless/ath/wil6210/cfg80211.c +++ b/drivers/net/wireless/ath/wil6210/cfg80211.c | |||
@@ -104,8 +104,8 @@ int wil_iftype_nl2wmi(enum nl80211_iftype type) | |||
104 | return -EOPNOTSUPP; | 104 | return -EOPNOTSUPP; |
105 | } | 105 | } |
106 | 106 | ||
107 | static int wil_cid_fill_sinfo(struct wil6210_priv *wil, int cid, | 107 | int wil_cid_fill_sinfo(struct wil6210_priv *wil, int cid, |
108 | struct station_info *sinfo) | 108 | struct station_info *sinfo) |
109 | { | 109 | { |
110 | struct wmi_notify_req_cmd cmd = { | 110 | struct wmi_notify_req_cmd cmd = { |
111 | .cid = cid, | 111 | .cid = cid, |
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------------*/ | ||
777 | static 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 | |||
788 | static 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 | |||
793 | static 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------------*/ | ||
801 | static 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 | |||
838 | static 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 | |||
843 | static 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------------*/ |
777 | static void wil_print_rxtid(struct seq_file *s, struct wil_tid_ampdu_rx *r) | 851 | static 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; |
diff --git a/drivers/net/wireless/ath/wil6210/wil6210.h b/drivers/net/wireless/ath/wil6210/wil6210.h index 4cbb8cec29c6..fd6ff0926f3b 100644 --- a/drivers/net/wireless/ath/wil6210/wil6210.h +++ b/drivers/net/wireless/ath/wil6210/wil6210.h | |||
@@ -512,6 +512,8 @@ int wil_cfg80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, | |||
512 | 512 | ||
513 | int wil6210_debugfs_init(struct wil6210_priv *wil); | 513 | int wil6210_debugfs_init(struct wil6210_priv *wil); |
514 | void wil6210_debugfs_remove(struct wil6210_priv *wil); | 514 | void wil6210_debugfs_remove(struct wil6210_priv *wil); |
515 | int wil_cid_fill_sinfo(struct wil6210_priv *wil, int cid, | ||
516 | struct station_info *sinfo); | ||
515 | 517 | ||
516 | struct wireless_dev *wil_cfg80211_init(struct device *dev); | 518 | struct wireless_dev *wil_cfg80211_init(struct device *dev); |
517 | void wil_wdev_free(struct wil6210_priv *wil); | 519 | void wil_wdev_free(struct wil6210_priv *wil); |