aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/rx.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/rx.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/rx.c')
-rw-r--r--drivers/net/wireless/libertas/rx.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/drivers/net/wireless/libertas/rx.c b/drivers/net/wireless/libertas/rx.c
index 96619a32951b..371cbf17ad48 100644
--- a/drivers/net/wireless/libertas/rx.c
+++ b/drivers/net/wireless/libertas/rx.c
@@ -106,10 +106,10 @@ static void wlan_compute_rssi(wlan_private * priv, struct rxpd *p_rx_pd)
106{ 106{
107 wlan_adapter *adapter = priv->adapter; 107 wlan_adapter *adapter = priv->adapter;
108 108
109 ENTER(); 109 lbs_deb_enter(LBS_DEB_RX);
110 110
111 lbs_pr_debug(1, "rxpd: SNR = %d, NF = %d\n", p_rx_pd->snr, p_rx_pd->nf); 111 lbs_deb_rx("rxpd: SNR %d, NF %d\n", p_rx_pd->snr, p_rx_pd->nf);
112 lbs_pr_debug(1, "Before computing SNR: SNR- avg = %d, NF-avg = %d\n", 112 lbs_deb_rx("before computing SNR: SNR-avg = %d, NF-avg = %d\n",
113 adapter->SNR[TYPE_RXPD][TYPE_AVG] / AVG_SCALE, 113 adapter->SNR[TYPE_RXPD][TYPE_AVG] / AVG_SCALE,
114 adapter->NF[TYPE_RXPD][TYPE_AVG] / AVG_SCALE); 114 adapter->NF[TYPE_RXPD][TYPE_AVG] / AVG_SCALE);
115 115
@@ -121,7 +121,7 @@ static void wlan_compute_rssi(wlan_private * priv, struct rxpd *p_rx_pd)
121 121
122 adapter->SNR[TYPE_RXPD][TYPE_AVG] = wlan_getavgsnr(priv) * AVG_SCALE; 122 adapter->SNR[TYPE_RXPD][TYPE_AVG] = wlan_getavgsnr(priv) * AVG_SCALE;
123 adapter->NF[TYPE_RXPD][TYPE_AVG] = wlan_getavgnf(priv) * AVG_SCALE; 123 adapter->NF[TYPE_RXPD][TYPE_AVG] = wlan_getavgnf(priv) * AVG_SCALE;
124 lbs_pr_debug(1, "After computing SNR: SNR-avg = %d, NF-avg = %d\n", 124 lbs_deb_rx("after computing SNR: SNR-avg = %d, NF-avg = %d\n",
125 adapter->SNR[TYPE_RXPD][TYPE_AVG] / AVG_SCALE, 125 adapter->SNR[TYPE_RXPD][TYPE_AVG] / AVG_SCALE,
126 adapter->NF[TYPE_RXPD][TYPE_AVG] / AVG_SCALE); 126 adapter->NF[TYPE_RXPD][TYPE_AVG] / AVG_SCALE);
127 127
@@ -133,12 +133,12 @@ static void wlan_compute_rssi(wlan_private * priv, struct rxpd *p_rx_pd)
133 CAL_RSSI(adapter->SNR[TYPE_RXPD][TYPE_AVG] / AVG_SCALE, 133 CAL_RSSI(adapter->SNR[TYPE_RXPD][TYPE_AVG] / AVG_SCALE,
134 adapter->NF[TYPE_RXPD][TYPE_AVG] / AVG_SCALE); 134 adapter->NF[TYPE_RXPD][TYPE_AVG] / AVG_SCALE);
135 135
136 LEAVE(); 136 lbs_deb_leave(LBS_DEB_RX);
137} 137}
138 138
139void libertas_upload_rx_packet(wlan_private * priv, struct sk_buff *skb) 139void libertas_upload_rx_packet(wlan_private * priv, struct sk_buff *skb)
140{ 140{
141 lbs_pr_debug(1, "skb->data=%p\n", skb->data); 141 lbs_deb_rx("skb->data %p\n", skb->data);
142 142
143 if(IS_MESH_FRAME(skb)) 143 if(IS_MESH_FRAME(skb))
144 skb->dev = priv->mesh_dev; 144 skb->dev = priv->mesh_dev;
@@ -171,7 +171,7 @@ int libertas_process_rxed_packet(wlan_private * priv, struct sk_buff *skb)
171 171
172 const u8 rfc1042_eth_hdr[] = { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 }; 172 const u8 rfc1042_eth_hdr[] = { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 };
173 173
174 ENTER(); 174 lbs_deb_enter(LBS_DEB_RX);
175 175
176 if (priv->adapter->debugmode & MRVDRV_DEBUG_RX_PATH) 176 if (priv->adapter->debugmode & MRVDRV_DEBUG_RX_PATH)
177 lbs_dbg_hex("RX packet: ", skb->data, 177 lbs_dbg_hex("RX packet: ", skb->data,
@@ -191,7 +191,7 @@ int libertas_process_rxed_packet(wlan_private * priv, struct sk_buff *skb)
191 min_t(unsigned int, skb->len, 100)); 191 min_t(unsigned int, skb->len, 100));
192 192
193 if (skb->len < (ETH_HLEN + 8 + sizeof(struct rxpd))) { 193 if (skb->len < (ETH_HLEN + 8 + sizeof(struct rxpd))) {
194 lbs_pr_debug(1, "RX error: FRAME RECEIVED WITH BAD LENGTH\n"); 194 lbs_deb_rx("rx err: frame received with bad length\n");
195 priv->stats.rx_length_errors++; 195 priv->stats.rx_length_errors++;
196 ret = 0; 196 ret = 0;
197 goto done; 197 goto done;
@@ -201,14 +201,14 @@ int libertas_process_rxed_packet(wlan_private * priv, struct sk_buff *skb)
201 * Check rxpd status and update 802.3 stat, 201 * Check rxpd status and update 802.3 stat,
202 */ 202 */
203 if (!(p_rx_pd->status & MRVDRV_RXPD_STATUS_OK)) { 203 if (!(p_rx_pd->status & MRVDRV_RXPD_STATUS_OK)) {
204 lbs_pr_debug(1, "RX error: frame received with bad status\n"); 204 lbs_deb_rx("rx err: frame received with bad status\n");
205 lbs_pr_alert("rxpd Not OK\n"); 205 lbs_pr_alert("rxpd not ok\n");
206 priv->stats.rx_errors++; 206 priv->stats.rx_errors++;
207 ret = 0; 207 ret = 0;
208 goto done; 208 goto done;
209 } 209 }
210 210
211 lbs_pr_debug(1, "RX Data: skb->len - sizeof(RxPd) = %d - %zd = %zd\n", 211 lbs_deb_rx("rx data: skb->len-sizeof(RxPd) = %d-%zd = %zd\n",
212 skb->len, sizeof(struct rxpd), skb->len - sizeof(struct rxpd)); 212 skb->len, sizeof(struct rxpd), skb->len - sizeof(struct rxpd));
213 213
214 lbs_dbg_hex("RX Data: Dest", p_rx_pkt->eth803_hdr.dest_addr, 214 lbs_dbg_hex("RX Data: Dest", p_rx_pkt->eth803_hdr.dest_addr,
@@ -266,7 +266,7 @@ int libertas_process_rxed_packet(wlan_private * priv, struct sk_buff *skb)
266 266
267 wlan_compute_rssi(priv, p_rx_pd); 267 wlan_compute_rssi(priv, p_rx_pd);
268 268
269 lbs_pr_debug(1, "RX Data: size of actual packet = %d\n", skb->len); 269 lbs_deb_rx("rx data: size of actual packet %d\n", skb->len);
270 priv->stats.rx_bytes += skb->len; 270 priv->stats.rx_bytes += skb->len;
271 priv->stats.rx_packets++; 271 priv->stats.rx_packets++;
272 272
@@ -274,8 +274,7 @@ int libertas_process_rxed_packet(wlan_private * priv, struct sk_buff *skb)
274 274
275 ret = 0; 275 ret = 0;
276done: 276done:
277 LEAVE(); 277 lbs_deb_leave_args(LBS_DEB_RX, "ret %d", ret);
278
279 return ret; 278 return ret;
280} 279}
281 280
@@ -314,7 +313,7 @@ static u8 convert_mv_rate_to_radiotap(u8 rate)
314 case 11: /* 54 Mbps */ 313 case 11: /* 54 Mbps */
315 return 108; 314 return 108;
316 } 315 }
317 lbs_pr_alert( "Invalid Marvell WLAN rate (%i)\n", rate); 316 lbs_pr_alert("Invalid Marvell WLAN rate %i\n", rate);
318 return 0; 317 return 0;
319} 318}
320 319
@@ -336,7 +335,7 @@ static int process_rxed_802_11_packet(wlan_private * priv, struct sk_buff *skb)
336 struct rx_radiotap_hdr radiotap_hdr; 335 struct rx_radiotap_hdr radiotap_hdr;
337 struct rx_radiotap_hdr *pradiotap_hdr; 336 struct rx_radiotap_hdr *pradiotap_hdr;
338 337
339 ENTER(); 338 lbs_deb_enter(LBS_DEB_RX);
340 339
341 p_rx_pkt = (struct rx80211packethdr *) skb->data; 340 p_rx_pkt = (struct rx80211packethdr *) skb->data;
342 prxpd = &p_rx_pkt->rx_pd; 341 prxpd = &p_rx_pkt->rx_pd;
@@ -344,7 +343,7 @@ static int process_rxed_802_11_packet(wlan_private * priv, struct sk_buff *skb)
344 // lbs_dbg_hex("RX Data: Before chop rxpd", skb->data, min(skb->len, 100)); 343 // lbs_dbg_hex("RX Data: Before chop rxpd", skb->data, min(skb->len, 100));
345 344
346 if (skb->len < (ETH_HLEN + 8 + sizeof(struct rxpd))) { 345 if (skb->len < (ETH_HLEN + 8 + sizeof(struct rxpd))) {
347 lbs_pr_debug(1, "RX error: FRAME RECEIVED WITH BAD LENGTH\n"); 346 lbs_deb_rx("rx err: frame received wit bad length\n");
348 priv->stats.rx_length_errors++; 347 priv->stats.rx_length_errors++;
349 ret = 0; 348 ret = 0;
350 goto done; 349 goto done;
@@ -354,11 +353,11 @@ static int process_rxed_802_11_packet(wlan_private * priv, struct sk_buff *skb)
354 * Check rxpd status and update 802.3 stat, 353 * Check rxpd status and update 802.3 stat,
355 */ 354 */
356 if (!(prxpd->status & MRVDRV_RXPD_STATUS_OK)) { 355 if (!(prxpd->status & MRVDRV_RXPD_STATUS_OK)) {
357 //lbs_pr_debug(1, "RX error: frame received with bad status\n"); 356 //lbs_deb_rx("rx err: frame received with bad status\n");
358 priv->stats.rx_errors++; 357 priv->stats.rx_errors++;
359 } 358 }
360 359
361 lbs_pr_debug(1, "RX Data: skb->len - sizeof(RxPd) = %d - %zd = %zd\n", 360 lbs_deb_rx("rx data: skb->len-sizeof(RxPd) = %d-%zd = %zd\n",
362 skb->len, sizeof(struct rxpd), skb->len - sizeof(struct rxpd)); 361 skb->len, sizeof(struct rxpd), skb->len - sizeof(struct rxpd));
363 362
364 /* create the exported radio header */ 363 /* create the exported radio header */
@@ -399,7 +398,7 @@ static int process_rxed_802_11_packet(wlan_private * priv, struct sk_buff *skb)
399 if ((skb_headroom(skb) < sizeof(struct rx_radiotap_hdr)) && 398 if ((skb_headroom(skb) < sizeof(struct rx_radiotap_hdr)) &&
400 pskb_expand_head(skb, sizeof(struct rx_radiotap_hdr), 0, 399 pskb_expand_head(skb, sizeof(struct rx_radiotap_hdr), 0,
401 GFP_ATOMIC)) { 400 GFP_ATOMIC)) {
402 lbs_pr_alert( "%s: couldn't pskb_expand_head\n", 401 lbs_pr_alert("%s: couldn't pskb_expand_head\n",
403 __func__); 402 __func__);
404 } 403 }
405 404
@@ -414,7 +413,7 @@ static int process_rxed_802_11_packet(wlan_private * priv, struct sk_buff *skb)
414 413
415 default: 414 default:
416 /* unknown header */ 415 /* unknown header */
417 lbs_pr_alert( "Unknown radiomode (%i)\n", 416 lbs_pr_alert("Unknown radiomode %i\n",
418 priv->adapter->radiomode); 417 priv->adapter->radiomode);
419 /* don't export any header */ 418 /* don't export any header */
420 /* chop the rxpd */ 419 /* chop the rxpd */
@@ -431,15 +430,16 @@ static int process_rxed_802_11_packet(wlan_private * priv, struct sk_buff *skb)
431 430
432 wlan_compute_rssi(priv, prxpd); 431 wlan_compute_rssi(priv, prxpd);
433 432
434 lbs_pr_debug(1, "RX Data: size of actual packet = %d\n", skb->len); 433 lbs_deb_rx("rx data: size of actual packet %d\n", skb->len);
435 priv->stats.rx_bytes += skb->len; 434 priv->stats.rx_bytes += skb->len;
436 priv->stats.rx_packets++; 435 priv->stats.rx_packets++;
437 436
438 libertas_upload_rx_packet(priv, skb); 437 libertas_upload_rx_packet(priv, skb);
439 438
440 ret = 0; 439 ret = 0;
441done:
442 LEAVE();
443 440
444 return (ret); 441done:
442 skb->protocol = __constant_htons(0x0019); /* ETH_P_80211_RAW */
443 lbs_deb_leave_args(LBS_DEB_RX, "ret %d", ret);
444 return ret;
445} 445}