aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/11d.c
diff options
context:
space:
mode:
authorHolger Schurig <hs4233@mail.mn-solutions.de>2007-08-02 11:53:06 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:49:53 -0400
commitece561919326236c7fb791a5e883f0eb76af029e (patch)
tree69d81daf8f8de4182ca89ab3b722defc585ffa80 /drivers/net/wireless/libertas/11d.c
parenta9f38d023b65c9fe2602303c1101c868be4fcbcc (diff)
[PATCH] libertas: make the hex dumper nicer
Currently, when you define LBS_DEB_HEX, you get every hex dump in the whole driver, e.g. for LBS_DEB_CMD, LBS_DEB_RX, LBS_DEB_TX etc. This patch makes sure that you only get the hexdump that you're interested in. Renamed lbs_dbg_hex() into lbs_deb_hex(), like the other lbs_deb_XXX() macros. Made lbs_deb_hex() issue a line feed (and a new prompt) after 16 bytes. As lbs_deb_hex() now prints the ":" after the prompt by itself, removed the misc colons in the various *.c files. lbs_deb_XXX() now print the debug category as well. As lbs_deb_XXX() --- and especially lbs_deb_11d() --- now print the category, I removed various "11D:" prefixes in 11d.c as well. 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/11d.c')
-rw-r--r--drivers/net/wireless/libertas/11d.c62
1 files changed, 31 insertions, 31 deletions
diff --git a/drivers/net/wireless/libertas/11d.c b/drivers/net/wireless/libertas/11d.c
index ba4cbcb59113..8b366ef2fe95 100644
--- a/drivers/net/wireless/libertas/11d.c
+++ b/drivers/net/wireless/libertas/11d.c
@@ -124,17 +124,17 @@ static u8 wlan_channel_known_11d(u8 chan,
124 u8 nr_chan = parsed_region_chan->nr_chan; 124 u8 nr_chan = parsed_region_chan->nr_chan;
125 u8 i = 0; 125 u8 i = 0;
126 126
127 lbs_dbg_hex("11D:parsed_region_chan:", (char *)chanpwr, 127 lbs_deb_hex(LBS_DEB_11D, "parsed_region_chan", (char *)chanpwr,
128 sizeof(struct chan_power_11d) * nr_chan); 128 sizeof(struct chan_power_11d) * nr_chan);
129 129
130 for (i = 0; i < nr_chan; i++) { 130 for (i = 0; i < nr_chan; i++) {
131 if (chan == chanpwr[i].chan) { 131 if (chan == chanpwr[i].chan) {
132 lbs_deb_11d("11D: Found Chan:%d\n", chan); 132 lbs_deb_11d("found chan %d\n", chan);
133 return 1; 133 return 1;
134 } 134 }
135 } 135 }
136 136
137 lbs_deb_11d("11D: Not Find Chan:%d\n", chan); 137 lbs_deb_11d("chan %d not found\n", chan);
138 return 0; 138 return 0;
139} 139}
140 140
@@ -174,8 +174,8 @@ static int generate_domain_info_11d(struct parsed_region_chan_11d
174 memcpy(domaininfo->countrycode, parsed_region_chan->countrycode, 174 memcpy(domaininfo->countrycode, parsed_region_chan->countrycode,
175 COUNTRY_CODE_LEN); 175 COUNTRY_CODE_LEN);
176 176
177 lbs_deb_11d("11D:nrchan=%d\n", nr_chan); 177 lbs_deb_11d("nrchan %d\n", nr_chan);
178 lbs_dbg_hex("11D:parsed_region_chan:", (char *)parsed_region_chan, 178 lbs_deb_hex(LBS_DEB_11D, "parsed_region_chan", (char *)parsed_region_chan,
179 sizeof(struct parsed_region_chan_11d)); 179 sizeof(struct parsed_region_chan_11d));
180 180
181 for (i = 0; i < nr_chan; i++) { 181 for (i = 0; i < nr_chan; i++) {
@@ -213,7 +213,7 @@ static int generate_domain_info_11d(struct parsed_region_chan_11d
213 domaininfo->nr_subband = nr_subband; 213 domaininfo->nr_subband = nr_subband;
214 214
215 lbs_deb_11d("nr_subband=%x\n", domaininfo->nr_subband); 215 lbs_deb_11d("nr_subband=%x\n", domaininfo->nr_subband);
216 lbs_dbg_hex("11D:domaininfo:", (char *)domaininfo, 216 lbs_deb_hex(LBS_DEB_11D, "domaininfo", (char *)domaininfo,
217 COUNTRY_CODE_LEN + 1 + 217 COUNTRY_CODE_LEN + 1 +
218 sizeof(struct ieeetypes_subbandset) * nr_subband); 218 sizeof(struct ieeetypes_subbandset) * nr_subband);
219 return 0; 219 return 0;
@@ -233,13 +233,13 @@ static void wlan_generate_parsed_region_chan_11d(struct region_channel * region_
233 struct chan_freq_power *cfp; 233 struct chan_freq_power *cfp;
234 234
235 if (region_chan == NULL) { 235 if (region_chan == NULL) {
236 lbs_deb_11d("11D: region_chan is NULL\n"); 236 lbs_deb_11d("region_chan is NULL\n");
237 return; 237 return;
238 } 238 }
239 239
240 cfp = region_chan->CFP; 240 cfp = region_chan->CFP;
241 if (cfp == NULL) { 241 if (cfp == NULL) {
242 lbs_deb_11d("11D: cfp equal NULL \n"); 242 lbs_deb_11d("cfp is NULL \n");
243 return; 243 return;
244 } 244 }
245 245
@@ -248,19 +248,19 @@ static void wlan_generate_parsed_region_chan_11d(struct region_channel * region_
248 memcpy(parsed_region_chan->countrycode, 248 memcpy(parsed_region_chan->countrycode,
249 wlan_code_2_region(region_chan->region), COUNTRY_CODE_LEN); 249 wlan_code_2_region(region_chan->region), COUNTRY_CODE_LEN);
250 250
251 lbs_deb_11d("11D: region[0x%x] band[%d]\n", parsed_region_chan->region, 251 lbs_deb_11d("region 0x%x, band %d\n", parsed_region_chan->region,
252 parsed_region_chan->band); 252 parsed_region_chan->band);
253 253
254 for (i = 0; i < region_chan->nrcfp; i++, cfp++) { 254 for (i = 0; i < region_chan->nrcfp; i++, cfp++) {
255 parsed_region_chan->chanpwr[i].chan = cfp->channel; 255 parsed_region_chan->chanpwr[i].chan = cfp->channel;
256 parsed_region_chan->chanpwr[i].pwr = cfp->maxtxpower; 256 parsed_region_chan->chanpwr[i].pwr = cfp->maxtxpower;
257 lbs_deb_11d("11D: Chan[%d] Pwr[%d]\n", 257 lbs_deb_11d("chan %d, pwr %d\n",
258 parsed_region_chan->chanpwr[i].chan, 258 parsed_region_chan->chanpwr[i].chan,
259 parsed_region_chan->chanpwr[i].pwr); 259 parsed_region_chan->chanpwr[i].pwr);
260 } 260 }
261 parsed_region_chan->nr_chan = region_chan->nrcfp; 261 parsed_region_chan->nr_chan = region_chan->nrcfp;
262 262
263 lbs_deb_11d("11D: nrchan[%d]\n", parsed_region_chan->nr_chan); 263 lbs_deb_11d("nrchan %d\n", parsed_region_chan->nr_chan);
264 264
265 return; 265 return;
266} 266}
@@ -336,7 +336,7 @@ static int parse_domain_info_11d(struct ieeetypes_countryinfofullset*
336 6. Others 336 6. Others
337 */ 337 */
338 338
339 lbs_dbg_hex("CountryInfo:", (u8 *) countryinfo, 30); 339 lbs_deb_hex(LBS_DEB_11D, "countryinfo", (u8 *) countryinfo, 30);
340 340
341 if ((*(countryinfo->countrycode)) == 0 341 if ((*(countryinfo->countrycode)) == 0
342 || (countryinfo->len <= COUNTRY_CODE_LEN)) { 342 || (countryinfo->len <= COUNTRY_CODE_LEN)) {
@@ -349,7 +349,7 @@ static int parse_domain_info_11d(struct ieeetypes_countryinfofullset*
349 wlan_region_2_code(countryinfo->countrycode); 349 wlan_region_2_code(countryinfo->countrycode);
350 350
351 lbs_deb_11d("regioncode=%x\n", (u8) parsed_region_chan->region); 351 lbs_deb_11d("regioncode=%x\n", (u8) parsed_region_chan->region);
352 lbs_dbg_hex("CountryCode:", (char *)countryinfo->countrycode, 352 lbs_deb_hex(LBS_DEB_11D, "countrycode", (char *)countryinfo->countrycode,
353 COUNTRY_CODE_LEN); 353 COUNTRY_CODE_LEN);
354 354
355 parsed_region_chan->band = band; 355 parsed_region_chan->band = band;
@@ -364,7 +364,7 @@ static int parse_domain_info_11d(struct ieeetypes_countryinfofullset*
364 364
365 if (countryinfo->subband[j].firstchan <= lastchan) { 365 if (countryinfo->subband[j].firstchan <= lastchan) {
366 /*Step2&3. Check First Chan Num increment and no overlap */ 366 /*Step2&3. Check First Chan Num increment and no overlap */
367 lbs_deb_11d("11D: Chan[%d>%d] Overlap\n", 367 lbs_deb_11d("chan %d>%d, overlap\n",
368 countryinfo->subband[j].firstchan, lastchan); 368 countryinfo->subband[j].firstchan, lastchan);
369 continue; 369 continue;
370 } 370 }
@@ -393,7 +393,7 @@ static int parse_domain_info_11d(struct ieeetypes_countryinfofullset*
393 } else { 393 } else {
394 /*not supported and ignore the chan */ 394 /*not supported and ignore the chan */
395 lbs_deb_11d( 395 lbs_deb_11d(
396 "11D:i[%d] chan[%d] unsupported in region[%x] band[%d]\n", 396 "i %d, chan %d unsupported in region %x, band %d\n",
397 i, curchan, region, band); 397 i, curchan, region, band);
398 } 398 }
399 } 399 }
@@ -405,7 +405,7 @@ static int parse_domain_info_11d(struct ieeetypes_countryinfofullset*
405 parsed_region_chan->nr_chan = idx; 405 parsed_region_chan->nr_chan = idx;
406 406
407 lbs_deb_11d("nrchan=%x\n", parsed_region_chan->nr_chan); 407 lbs_deb_11d("nrchan=%x\n", parsed_region_chan->nr_chan);
408 lbs_dbg_hex("11D:parsed_region_chan:", (u8 *) parsed_region_chan, 408 lbs_deb_hex(LBS_DEB_11D, "parsed_region_chan", (u8 *) parsed_region_chan,
409 2 + COUNTRY_CODE_LEN + sizeof(struct parsed_region_chan_11d) * idx); 409 2 + COUNTRY_CODE_LEN + sizeof(struct parsed_region_chan_11d) * idx);
410 410
411done: 411done:
@@ -427,10 +427,10 @@ u8 libertas_get_scan_type_11d(u8 chan,
427 lbs_deb_enter(LBS_DEB_11D); 427 lbs_deb_enter(LBS_DEB_11D);
428 428
429 if (wlan_channel_known_11d(chan, parsed_region_chan)) { 429 if (wlan_channel_known_11d(chan, parsed_region_chan)) {
430 lbs_deb_11d("11D: Found and do Active Scan\n"); 430 lbs_deb_11d("found, do active scan\n");
431 scan_type = CMD_SCAN_TYPE_ACTIVE; 431 scan_type = CMD_SCAN_TYPE_ACTIVE;
432 } else { 432 } else {
433 lbs_deb_11d("11D: Not Find and do Passive Scan\n"); 433 lbs_deb_11d("not found, do passive scan\n");
434 } 434 }
435 435
436 lbs_deb_leave_args(LBS_DEB_11D, "ret scan_type %d", scan_type); 436 lbs_deb_leave_args(LBS_DEB_11D, "ret scan_type %d", scan_type);
@@ -456,7 +456,7 @@ static int set_domain_info_11d(wlan_private * priv)
456 int ret; 456 int ret;
457 457
458 if (!priv->adapter->enable11d) { 458 if (!priv->adapter->enable11d) {
459 lbs_deb_11d("11D: dnld domain Info with 11d disabled\n"); 459 lbs_deb_11d("dnld domain Info with 11d disabled\n");
460 return 0; 460 return 0;
461 } 461 }
462 462
@@ -464,7 +464,7 @@ static int set_domain_info_11d(wlan_private * priv)
464 CMD_ACT_SET, 464 CMD_ACT_SET,
465 CMD_OPTION_WAITFORRSP, 0, NULL); 465 CMD_OPTION_WAITFORRSP, 0, NULL);
466 if (ret) 466 if (ret)
467 lbs_deb_11d("11D: Fail to dnld domain Info\n"); 467 lbs_deb_11d("fail to dnld domain info\n");
468 468
469 return ret; 469 return ret;
470} 470}
@@ -486,7 +486,7 @@ int libertas_set_universaltable(wlan_private * priv, u8 band)
486 486
487 adapter->universal_channel[i].nrcfp = 487 adapter->universal_channel[i].nrcfp =
488 sizeof(channel_freq_power_UN_BG) / size; 488 sizeof(channel_freq_power_UN_BG) / size;
489 lbs_deb_11d("11D: BG-band nrcfp=%d\n", 489 lbs_deb_11d("BG-band nrcfp %d\n",
490 adapter->universal_channel[i].nrcfp); 490 adapter->universal_channel[i].nrcfp);
491 491
492 adapter->universal_channel[i].CFP = channel_freq_power_UN_BG; 492 adapter->universal_channel[i].CFP = channel_freq_power_UN_BG;
@@ -525,7 +525,7 @@ int libertas_cmd_802_11d_domain_info(wlan_private * priv,
525 if (cmdoption == CMD_ACT_GET) { 525 if (cmdoption == CMD_ACT_GET) {
526 cmd->size = 526 cmd->size =
527 cpu_to_le16(sizeof(pdomaininfo->action) + S_DS_GEN); 527 cpu_to_le16(sizeof(pdomaininfo->action) + S_DS_GEN);
528 lbs_dbg_hex("11D: 802_11D_DOMAIN_INFO:", (u8 *) cmd, 528 lbs_deb_hex(LBS_DEB_11D, "802_11D_DOMAIN_INFO", (u8 *) cmd,
529 (int)(cmd->size)); 529 (int)(cmd->size));
530 goto done; 530 goto done;
531 } 531 }
@@ -551,7 +551,7 @@ int libertas_cmd_802_11d_domain_info(wlan_private * priv,
551 cpu_to_le16(sizeof(pdomaininfo->action) + S_DS_GEN); 551 cpu_to_le16(sizeof(pdomaininfo->action) + S_DS_GEN);
552 } 552 }
553 553
554 lbs_dbg_hex("11D:802_11D_DOMAIN_INFO:", (u8 *) cmd, le16_to_cpu(cmd->size)); 554 lbs_deb_hex(LBS_DEB_11D, "802_11D_DOMAIN_INFO", (u8 *) cmd, le16_to_cpu(cmd->size));
555 555
556done: 556done:
557 lbs_deb_enter(LBS_DEB_11D); 557 lbs_deb_enter(LBS_DEB_11D);
@@ -575,13 +575,13 @@ int libertas_ret_802_11d_domain_info(wlan_private * priv,
575 575
576 lbs_deb_enter(LBS_DEB_11D); 576 lbs_deb_enter(LBS_DEB_11D);
577 577
578 lbs_dbg_hex("11D DOMAIN Info Rsp Data:", (u8 *) resp, 578 lbs_deb_hex(LBS_DEB_11D, "domain info resp", (u8 *) resp,
579 (int)le16_to_cpu(resp->size)); 579 (int)le16_to_cpu(resp->size));
580 580
581 nr_subband = (le16_to_cpu(domain->header.len) - COUNTRY_CODE_LEN) / 581 nr_subband = (le16_to_cpu(domain->header.len) - COUNTRY_CODE_LEN) /
582 sizeof(struct ieeetypes_subbandset); 582 sizeof(struct ieeetypes_subbandset);
583 583
584 lbs_deb_11d("11D Domain Info Resp: nr_subband=%d\n", nr_subband); 584 lbs_deb_11d("domain info resp: nr_subband %d\n", nr_subband);
585 585
586 if (nr_subband > MRVDRV_MAX_SUBBAND_802_11D) { 586 if (nr_subband > MRVDRV_MAX_SUBBAND_802_11D) {
587 lbs_deb_11d("Invalid Numrer of Subband returned!!\n"); 587 lbs_deb_11d("Invalid Numrer of Subband returned!!\n");
@@ -623,7 +623,7 @@ int libertas_parse_dnld_countryinfo_11d(wlan_private * priv,
623 &adapter->parsed_region_chan); 623 &adapter->parsed_region_chan);
624 624
625 if (ret == -1) { 625 if (ret == -1) {
626 lbs_deb_11d("11D: Err Parse domain_info from AP..\n"); 626 lbs_deb_11d("error parsing domain_info from AP\n");
627 goto done; 627 goto done;
628 } 628 }
629 629
@@ -635,7 +635,7 @@ int libertas_parse_dnld_countryinfo_11d(wlan_private * priv,
635 ret = set_domain_info_11d(priv); 635 ret = set_domain_info_11d(priv);
636 636
637 if (ret) { 637 if (ret) {
638 lbs_deb_11d("11D: Err set domainInfo to FW\n"); 638 lbs_deb_11d("error setting domain info\n");
639 goto done; 639 goto done;
640 } 640 }
641 } 641 }
@@ -659,7 +659,7 @@ int libertas_create_dnld_countryinfo_11d(wlan_private * priv)
659 u8 j; 659 u8 j;
660 660
661 lbs_deb_enter(LBS_DEB_11D); 661 lbs_deb_enter(LBS_DEB_11D);
662 lbs_deb_11d("11D:curbssparams.band[%d]\n", adapter->curbssparams.band); 662 lbs_deb_11d("curbssparams.band %d\n", adapter->curbssparams.band);
663 663
664 if (priv->adapter->enable11d) { 664 if (priv->adapter->enable11d) {
665 /* update parsed_region_chan_11; dnld domaininf to FW */ 665 /* update parsed_region_chan_11; dnld domaininf to FW */
@@ -668,7 +668,7 @@ int libertas_create_dnld_countryinfo_11d(wlan_private * priv)
668 sizeof(adapter->region_channel[0]); j++) { 668 sizeof(adapter->region_channel[0]); j++) {
669 region_chan = &adapter->region_channel[j]; 669 region_chan = &adapter->region_channel[j];
670 670
671 lbs_deb_11d("11D:[%d] region_chan->band[%d]\n", j, 671 lbs_deb_11d("%d region_chan->band %d\n", j,
672 region_chan->band); 672 region_chan->band);
673 673
674 if (!region_chan || !region_chan->valid 674 if (!region_chan || !region_chan->valid
@@ -681,7 +681,7 @@ int libertas_create_dnld_countryinfo_11d(wlan_private * priv)
681 681
682 if (j >= sizeof(adapter->region_channel) / 682 if (j >= sizeof(adapter->region_channel) /
683 sizeof(adapter->region_channel[0])) { 683 sizeof(adapter->region_channel[0])) {
684 lbs_deb_11d("11D:region_chan not found. band[%d]\n", 684 lbs_deb_11d("region_chan not found, band %d\n",
685 adapter->curbssparams.band); 685 adapter->curbssparams.band);
686 ret = -1; 686 ret = -1;
687 goto done; 687 goto done;
@@ -701,7 +701,7 @@ int libertas_create_dnld_countryinfo_11d(wlan_private * priv)
701 ret = set_domain_info_11d(priv); 701 ret = set_domain_info_11d(priv);
702 702
703 if (ret) { 703 if (ret) {
704 lbs_deb_11d("11D: Err set domainInfo to FW\n"); 704 lbs_deb_11d("error setting domain info\n");
705 goto done; 705 goto done;
706 } 706 }
707 707