Re: [ath9k-devel] [PATCH] ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries

2015-01-15 Thread Kalle Valo
Arend van Spriel ar...@broadcom.com writes:

 Use the helper to get rid of the file operations per debugfs file. The
 device driver data contains struct ieee80211_hw pointer and the
 struct ath9k_softc pointer is assigned to ieee80211_hw::priv so it can
 be accessed in the seq_file read operation.

 Cc: ath9k-devel@lists.ath9k.org
 Signed-off-by: Arend van Spriel ar...@broadcom.com

Thanks, applied to wireless-drivers-next.git.

-- 
Kalle Valo
___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel


Re: [ath9k-devel] [PATCH] ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries

2015-01-09 Thread Arend van Spriel
On 01/09/15 01:34, Sujith Manoharan wrote:
 Arend van Spriel wrote:
 So the content of the modified debugfs files looks sane?

 Yep, as sane as the code populating the debug data. :-)

:-D

Thanks,
Arend

 Sujith

___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel


Re: [ath9k-devel] [PATCH] ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries

2015-01-08 Thread Sujith Manoharan
Arend van Spriel wrote:
 So the content of the modified debugfs files looks sane?

Yep, as sane as the code populating the debug data. :-)

Sujith
___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel


Re: [ath9k-devel] [PATCH] ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries

2015-01-08 Thread Arend van Spriel
On 01/08/15 04:19, Sujith Manoharan wrote:
 Arend van Sprielar...@broadcom.com  writes:

 Use the helper to get rid of the file operations per debugfs file. The
 device driver data contains struct ieee80211_hw pointer and the
 struct ath9k_softc pointer is assigned to ieee80211_hw::priv so it can
 be accessed in the seq_file read operation.

 Cc: ath9k-devel@lists.ath9k.org
 Signed-off-by: Arend van Sprielar...@broadcom.com

 Thanks for the patch.

 Can someone with ath9k hardware test this, please? I'm hesitant to apply
 this without testing.

 I tested it and there were no crashes.

Thanks, Sujith

So the content of the modified debugfs files looks sane?

Regards,
Arend

 Sujith

___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel


Re: [ath9k-devel] [PATCH] ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries

2015-01-07 Thread Sujith Manoharan
 Arend van Spriel ar...@broadcom.com writes:
 
  Use the helper to get rid of the file operations per debugfs file. The
  device driver data contains struct ieee80211_hw pointer and the
  struct ath9k_softc pointer is assigned to ieee80211_hw::priv so it can
  be accessed in the seq_file read operation.
 
  Cc: ath9k-devel@lists.ath9k.org
  Signed-off-by: Arend van Spriel ar...@broadcom.com

Thanks for the patch.

 Can someone with ath9k hardware test this, please? I'm hesitant to apply
 this without testing.

I tested it and there were no crashes.

Sujith
___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel


Re: [ath9k-devel] [PATCH] ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries

2015-01-07 Thread Kalle Valo
Arend van Spriel ar...@broadcom.com writes:

 Use the helper to get rid of the file operations per debugfs file. The
 device driver data contains struct ieee80211_hw pointer and the
 struct ath9k_softc pointer is assigned to ieee80211_hw::priv so it can
 be accessed in the seq_file read operation.

 Cc: ath9k-devel@lists.ath9k.org
 Signed-off-by: Arend van Spriel ar...@broadcom.com
 ---
 Hi Kalle,

 This patch was reverted in the driver-core repository as I overlooked
 the use of driver data and caused ath9k driver to crash. I believe this
 revised patch properly uses it now although I have no ath9k hardware to
 test this. So I hope some ath9k developers out there can give this patch
 a run for its money. It compiles and no checkpatch or sparse warnings.

 The patch applies to the master branch of the wireless-drivers-next
 repository.

Can someone with ath9k hardware test this, please? I'm hesitant to apply
this without testing.

-- 
Kalle Valo
___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel


[ath9k-devel] [PATCH] ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries

2014-12-27 Thread Arend van Spriel
Use the helper to get rid of the file operations per debugfs file. The
device driver data contains struct ieee80211_hw pointer and the
struct ath9k_softc pointer is assigned to ieee80211_hw::priv so it can
be accessed in the seq_file read operation.

Cc: ath9k-devel@lists.ath9k.org
Signed-off-by: Arend van Spriel ar...@broadcom.com
---
Hi Kalle,

This patch was reverted in the driver-core repository as I overlooked
the use of driver data and caused ath9k driver to crash. I believe this
revised patch properly uses it now although I have no ath9k hardware to
test this. So I hope some ath9k developers out there can give this patch
a run for its money. It compiles and no checkpatch or sparse warnings.

The patch applies to the master branch of the wireless-drivers-next
repository.

Regards,
Arend
---
 drivers/net/wireless/ath/ath9k/debug.c | 129 -
 1 file changed, 29 insertions(+), 100 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/debug.c 
b/drivers/net/wireless/ath/ath9k/debug.c
index c43e2ad..1bed9d7 100644
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
@@ -403,7 +403,8 @@ static const struct file_operations fops_antenna_diversity 
= {
 
 static int read_file_dma(struct seq_file *file, void *data)
 {
-   struct ath_softc *sc = file-private;
+   struct ieee80211_hw *hw = dev_get_drvdata(file-private);
+   struct ath_softc *sc = hw-priv;
struct ath_hw *ah = sc-sc_ah;
u32 val[ATH9K_NUM_DMA_DEBUG_REGS];
int i, qcuOffset = 0, dcuOffset = 0;
@@ -470,20 +471,6 @@ static int read_file_dma(struct seq_file *file, void *data)
return 0;
 }
 
-static int open_file_dma(struct inode *inode, struct file *f)
-{
-   return single_open(f, read_file_dma, inode-i_private);
-}
-
-static const struct file_operations fops_dma = {
-   .open = open_file_dma,
-   .read = seq_read,
-   .owner = THIS_MODULE,
-   .llseek = seq_lseek,
-   .release = single_release,
-};
-
-
 void ath_debug_stat_interrupt(struct ath_softc *sc, enum ath9k_int status)
 {
if (status)
@@ -539,7 +526,8 @@ void ath_debug_stat_interrupt(struct ath_softc *sc, enum 
ath9k_int status)
 
 static int read_file_interrupt(struct seq_file *file, void *data)
 {
-   struct ath_softc *sc = file-private;
+   struct ieee80211_hw *hw = dev_get_drvdata(file-private);
+   struct ath_softc *sc = hw-priv;
 
 #define PR_IS(a, s)\
do {\
@@ -600,22 +588,10 @@ static int read_file_interrupt(struct seq_file *file, 
void *data)
return 0;
 }
 
-static int open_file_interrupt(struct inode *inode, struct file *f)
-{
-   return single_open(f, read_file_interrupt, inode-i_private);
-}
-
-static const struct file_operations fops_interrupt = {
-   .read = seq_read,
-   .open = open_file_interrupt,
-   .owner = THIS_MODULE,
-   .llseek = seq_lseek,
-   .release = single_release,
-};
-
 static int read_file_xmit(struct seq_file *file, void *data)
 {
-   struct ath_softc *sc = file-private;
+   struct ieee80211_hw *hw = dev_get_drvdata(file-private);
+   struct ath_softc *sc = hw-priv;
 
seq_printf(file, %30s %10s%10s%10s\n\n, BE, BK, VI, VO);
 
@@ -661,7 +637,8 @@ static void print_queue(struct ath_softc *sc, struct 
ath_txq *txq,
 
 static int read_file_queues(struct seq_file *file, void *data)
 {
-   struct ath_softc *sc = file-private;
+   struct ieee80211_hw *hw = dev_get_drvdata(file-private);
+   struct ath_softc *sc = hw-priv;
struct ath_txq *txq;
int i;
static const char *qname[4] = {
@@ -682,7 +659,8 @@ static int read_file_queues(struct seq_file *file, void 
*data)
 
 static int read_file_misc(struct seq_file *file, void *data)
 {
-   struct ath_softc *sc = file-private;
+   struct ieee80211_hw *hw = dev_get_drvdata(file-private);
+   struct ath_softc *sc = hw-priv;
struct ath_common *common = ath9k_hw_common(sc-sc_ah);
struct ath9k_vif_iter_data iter_data;
struct ath_chanctx *ctx;
@@ -773,7 +751,8 @@ static int read_file_misc(struct seq_file *file, void *data)
 
 static int read_file_reset(struct seq_file *file, void *data)
 {
-   struct ath_softc *sc = file-private;
+   struct ieee80211_hw *hw = dev_get_drvdata(file-private);
+   struct ath_softc *sc = hw-priv;
static const char * const reset_cause[__RESET_TYPE_MAX] = {
[RESET_TYPE_BB_HANG] = Baseband Hang,
[RESET_TYPE_BB_WATCHDOG] = Baseband Watchdog,
@@ -837,58 +816,6 @@ void ath_debug_stat_tx(struct ath_softc *sc, struct 
ath_buf *bf,
TX_STAT_INC(qnum, delim_underrun);
 }
 
-static int open_file_xmit(struct inode *inode, struct file *f)
-{
-   return single_open(f, read_file_xmit, inode-i_private);
-}
-
-static const struct file_operations fops_xmit = {
-