Fix ath5k crash on load (#4689)
[openwrt.git] / package / mac80211 / patches / 317-rt2x00-Export-all-register-stats-through-debugfs.patch
1 From 208d46bb33a37ef16b4044d15d58c21ebc89552f Mon Sep 17 00:00:00 2001
2 From: Ivo van Doorn <IvDoorn@gmail.com>
3 Date: Sun, 8 Feb 2009 17:39:35 +0100
4 Subject: [PATCH] rt2x00: Export all register stats through debugfs
5
6 By exporting the register base, and word size to userspace
7 through debugfs it will be easier to create scripts which
8 parse the register information. This makes debugging and
9 register dumps information easier.
10 This will unfortunately not be backward compatible with
11 the previous approach, but that is not important in this case
12 since manually fixing the layout of the dumpfile to match the
13 new style then interpreting the data without a script.
14
15 Also be more consistent with using tabs to seperate different
16 fields.
17
18 Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
19 ---
20 drivers/net/wireless/rt2x00/rt2x00debug.c | 33 ++++++++++++++++++++--------
21 1 files changed, 23 insertions(+), 10 deletions(-)
22
23 diff --git a/drivers/net/wireless/rt2x00/rt2x00debug.c b/drivers/net/wireless/rt2x00/rt2x00debug.c
24 index 8d47389..07d378e 100644
25 --- a/drivers/net/wireless/rt2x00/rt2x00debug.c
26 +++ b/drivers/net/wireless/rt2x00/rt2x00debug.c
27 @@ -547,9 +547,9 @@ static struct dentry *rt2x00debug_create_file_driver(const char *name,
28 return NULL;
29
30 blob->data = data;
31 - data += sprintf(data, "driver: %s\n", intf->rt2x00dev->ops->name);
32 - data += sprintf(data, "version: %s\n", DRV_VERSION);
33 - data += sprintf(data, "compiled: %s %s\n", __DATE__, __TIME__);
34 + data += sprintf(data, "driver:\t%s\n", intf->rt2x00dev->ops->name);
35 + data += sprintf(data, "version:\t%s\n", DRV_VERSION);
36 + data += sprintf(data, "compiled:\t%s %s\n", __DATE__, __TIME__);
37 blob->size = strlen(blob->data);
38
39 return debugfs_create_blob(name, S_IRUSR, intf->driver_folder, blob);
40 @@ -570,14 +570,27 @@ static struct dentry *rt2x00debug_create_file_chipset(const char *name,
41 return NULL;
42
43 blob->data = data;
44 - data += sprintf(data, "rt chip: %04x\n", intf->rt2x00dev->chip.rt);
45 - data += sprintf(data, "rf chip: %04x\n", intf->rt2x00dev->chip.rf);
46 - data += sprintf(data, "revision:%08x\n", intf->rt2x00dev->chip.rev);
47 + data += sprintf(data, "rt chip:\t%04x\n", intf->rt2x00dev->chip.rt);
48 + data += sprintf(data, "rf chip:\t%04x\n", intf->rt2x00dev->chip.rf);
49 + data += sprintf(data, "revision:\t%08x\n", intf->rt2x00dev->chip.rev);
50 data += sprintf(data, "\n");
51 - data += sprintf(data, "csr length: %d\n", debug->csr.word_count);
52 - data += sprintf(data, "eeprom length: %d\n", debug->eeprom.word_count);
53 - data += sprintf(data, "bbp length: %d\n", debug->bbp.word_count);
54 - data += sprintf(data, "rf length: %d\n", debug->rf.word_count);
55 + data += sprintf(data, "register\tbase\twords\twordsize\n");
56 + data += sprintf(data, "csr\t%d\t%d\t%d\n",
57 + debug->csr.word_base,
58 + debug->csr.word_count,
59 + debug->csr.word_size);
60 + data += sprintf(data, "eeprom\t%d\t%d\t%d\n",
61 + debug->eeprom.word_base,
62 + debug->eeprom.word_count,
63 + debug->eeprom.word_size);
64 + data += sprintf(data, "bbp\t%d\t%d\t%d\n",
65 + debug->bbp.word_base,
66 + debug->bbp.word_count,
67 + debug->bbp.word_size);
68 + data += sprintf(data, "rf\t%d\t%d\t%d\n",
69 + debug->rf.word_base,
70 + debug->rf.word_count,
71 + debug->rf.word_size);
72 blob->size = strlen(blob->data);
73
74 return debugfs_create_blob(name, S_IRUSR, intf->driver_folder, blob);
75 --
76 1.6.0
77
This page took 0.0567 seconds and 5 git commands to generate.