Search Linux Wireless

Re: [PATCH] ath5k: add debugfs entries for registers, tsf, beacon, reset

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/10/2007 09:22 AM, Bruno Randolf wrote:
> i resend this patch to address jiris comments and with some small improvements.
> 
> 'registers' prints the name and value of some registers. this should be adapted
> to what we actually need later and is supposed to replace the hwdump facility i
> removed in my earlier debugging changes.
> 
> 'tsf' prints the current HW TSF. writing "reset" into the file will reset the
> TSF.
> 
> 'beacon' shows beacon relevant registers.  it is good for watching the beacon
> timers with something like "watch -n0 cat /dbg/ath5k/phy0/beacon". writing
> "enable" into the file will try to enable beacons by setting the flag
> AR5K_BEACON_ENABLE, "disable" will disable that bit.
> 
> 'reset' can be used to trigger a HW reset, by writing "reset" into it.
> 
> Changes-licensed-under: GPL
> 
> Signed-off-by: Bruno Randolf <bruno@xxxxxxxxxxxxx>
> Acked-by: Luis R. Rodriguez <mgrof@xxxxxxxxxxxxxxxxxx>
> ---
>  drivers/net/wireless/ath5k/debug.c |  267 ++++++++++++++++++++++++++++++++++++
>  drivers/net/wireless/ath5k/debug.h |    4 +
>  2 files changed, 271 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath5k/debug.c b/drivers/net/wireless/ath5k/debug.c
> index 7427506..7e34684 100644
> --- a/drivers/net/wireless/ath5k/debug.c
> +++ b/drivers/net/wireless/ath5k/debug.c
[...]
> +static int open_file_registers(struct inode *inode, struct file *file)
> +{
> +	struct seq_file *s;
> +	int res;
> +	res = seq_open(file, &register_seq_ops);
> +	s = file->private_data;
> +	s->private = inode->i_private;

Sorry for not noticing this earlier, if res is nonzero, you are dereferencing
NULL (s) here.

> +	return res;
> +}

regards,
-- 
Jiri Slaby (jirislaby@xxxxxxxxx)
Faculty of Informatics, Masaryk University
-
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux