aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/ethtool.c
diff options
context:
space:
mode:
authorHolger Schurig <hs4233@mail.mn-solutions.de>2007-05-25 11:27:16 -0400
committerJohn W. Linville <linville@tuxdriver.com>2007-06-11 14:28:37 -0400
commit9012b28a407511fb355f6d2176a12d4653489672 (patch)
tree771b0f7adb9dbab5c907981bd4fa3a7f6219587d /drivers/net/wireless/libertas/ethtool.c
parent46868202b2dd22156460a220553a223f406f4f22 (diff)
[PATCH] libertas: make debug configurable
The debug output of libertas was either not present or it was overwhelming. This patch adds the possibility to specify a bitmask for the area of interest. One should then only get the desired output. Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/ethtool.c')
-rw-r--r--drivers/net/wireless/libertas/ethtool.c34
1 files changed, 21 insertions, 13 deletions
diff --git a/drivers/net/wireless/libertas/ethtool.c b/drivers/net/wireless/libertas/ethtool.c
index 0064de542963..4655953730cc 100644
--- a/drivers/net/wireless/libertas/ethtool.c
+++ b/drivers/net/wireless/libertas/ethtool.c
@@ -69,7 +69,7 @@ static int libertas_ethtool_get_eeprom(struct net_device *dev,
69 69
70 /* +14 is for action, offset, and NOB in 70 /* +14 is for action, offset, and NOB in
71 * response */ 71 * response */
72 lbs_pr_debug(1, "action:%d offset: %x NOB: %02x\n", 72 lbs_deb_ethtool("action:%d offset: %x NOB: %02x\n",
73 regctrl.action, regctrl.offset, regctrl.NOB); 73 regctrl.action, regctrl.offset, regctrl.NOB);
74 74
75 ret = libertas_prepare_and_send_command(priv, 75 ret = libertas_prepare_and_send_command(priv,
@@ -81,8 +81,7 @@ static int libertas_ethtool_get_eeprom(struct net_device *dev,
81 if (ret) { 81 if (ret) {
82 if (adapter->prdeeprom) 82 if (adapter->prdeeprom)
83 kfree(adapter->prdeeprom); 83 kfree(adapter->prdeeprom);
84 LEAVE(); 84 goto done;
85 return ret;
86 } 85 }
87 86
88 mdelay(10); 87 mdelay(10);
@@ -101,7 +100,11 @@ static int libertas_ethtool_get_eeprom(struct net_device *dev,
101 kfree(adapter->prdeeprom); 100 kfree(adapter->prdeeprom);
102// mutex_unlock(&priv->mutex); 101// mutex_unlock(&priv->mutex);
103 102
104 return 0; 103 ret = 0;
104
105done:
106 lbs_deb_enter_args(LBS_DEB_ETHTOOL, "ret %d", ret);
107 return ret;
105} 108}
106 109
107static void libertas_ethtool_get_stats(struct net_device * dev, 110static void libertas_ethtool_get_stats(struct net_device * dev,
@@ -109,7 +112,7 @@ static void libertas_ethtool_get_stats(struct net_device * dev,
109{ 112{
110 wlan_private *priv = dev->priv; 113 wlan_private *priv = dev->priv;
111 114
112 ENTER(); 115 lbs_deb_enter(LBS_DEB_ETHTOOL);
113 116
114 stats->cmd = ETHTOOL_GSTATS; 117 stats->cmd = ETHTOOL_GSTATS;
115 BUG_ON(stats->n_stats != MESH_STATS_NUM); 118 BUG_ON(stats->n_stats != MESH_STATS_NUM);
@@ -122,7 +125,7 @@ static void libertas_ethtool_get_stats(struct net_device * dev,
122 data[5] = priv->mstats.fwd_bcast_cnt; 125 data[5] = priv->mstats.fwd_bcast_cnt;
123 data[6] = priv->mstats.drop_blind; 126 data[6] = priv->mstats.drop_blind;
124 127
125 LEAVE(); 128 lbs_deb_enter(LBS_DEB_ETHTOOL);
126} 129}
127 130
128static int libertas_ethtool_get_stats_count(struct net_device * dev) 131static int libertas_ethtool_get_stats_count(struct net_device * dev)
@@ -131,15 +134,16 @@ static int libertas_ethtool_get_stats_count(struct net_device * dev)
131 wlan_private *priv = dev->priv; 134 wlan_private *priv = dev->priv;
132 struct cmd_ds_mesh_access mesh_access; 135 struct cmd_ds_mesh_access mesh_access;
133 136
134 ENTER(); 137 lbs_deb_enter(LBS_DEB_ETHTOOL);
138
135 /* Get Mesh Statistics */ 139 /* Get Mesh Statistics */
136 ret = libertas_prepare_and_send_command(priv, 140 ret = libertas_prepare_and_send_command(priv,
137 cmd_mesh_access, cmd_act_mesh_get_stats, 141 cmd_mesh_access, cmd_act_mesh_get_stats,
138 cmd_option_waitforrsp, 0, &mesh_access); 142 cmd_option_waitforrsp, 0, &mesh_access);
139 143
140 if (ret) { 144 if (ret) {
141 LEAVE(); 145 ret = 0;
142 return 0; 146 goto done;
143 } 147 }
144 148
145 priv->mstats.fwd_drop_rbt = mesh_access.data[0]; 149 priv->mstats.fwd_drop_rbt = mesh_access.data[0];
@@ -150,8 +154,11 @@ static int libertas_ethtool_get_stats_count(struct net_device * dev)
150 priv->mstats.fwd_bcast_cnt = mesh_access.data[5]; 154 priv->mstats.fwd_bcast_cnt = mesh_access.data[5];
151 priv->mstats.drop_blind = mesh_access.data[6]; 155 priv->mstats.drop_blind = mesh_access.data[6];
152 156
153 LEAVE(); 157 ret = MESH_STATS_NUM;
154 return MESH_STATS_NUM; 158
159done:
160 lbs_deb_enter_args(LBS_DEB_ETHTOOL, "ret %d", ret);
161 return ret;
155} 162}
156 163
157static void libertas_ethtool_get_strings (struct net_device * dev, 164static void libertas_ethtool_get_strings (struct net_device * dev,
@@ -160,7 +167,8 @@ static void libertas_ethtool_get_strings (struct net_device * dev,
160{ 167{
161 int i; 168 int i;
162 169
163 ENTER(); 170 lbs_deb_enter(LBS_DEB_ETHTOOL);
171
164 switch (stringset) { 172 switch (stringset) {
165 case ETH_SS_STATS: 173 case ETH_SS_STATS:
166 for (i=0; i < MESH_STATS_NUM; i++) { 174 for (i=0; i < MESH_STATS_NUM; i++) {
@@ -170,7 +178,7 @@ static void libertas_ethtool_get_strings (struct net_device * dev,
170 } 178 }
171 break; 179 break;
172 } 180 }
173 LEAVE(); 181 lbs_deb_enter(LBS_DEB_ETHTOOL);
174} 182}
175 183
176struct ethtool_ops libertas_ethtool_ops = { 184struct ethtool_ops libertas_ethtool_ops = {