提交 9012b28a 编写于 作者: H Holger Schurig 提交者: John W. Linville

[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: NHolger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 46868202
...@@ -95,7 +95,7 @@ static u8 wlan_get_chan_11d(u8 band, u8 firstchan, u8 nrchan, u8 * chan) ...@@ -95,7 +95,7 @@ static u8 wlan_get_chan_11d(u8 band, u8 firstchan, u8 nrchan, u8 * chan)
for (i = 0; i < cfp_no; i++) { for (i = 0; i < cfp_no; i++) {
if ((cfp + i)->channel == firstchan) { if ((cfp + i)->channel == firstchan) {
lbs_pr_debug(1, "firstchan found\n"); lbs_deb_11d("firstchan found\n");
break; break;
} }
} }
...@@ -129,12 +129,12 @@ static u8 wlan_channel_known_11d(u8 chan, ...@@ -129,12 +129,12 @@ static u8 wlan_channel_known_11d(u8 chan,
for (i = 0; i < nr_chan; i++) { for (i = 0; i < nr_chan; i++) {
if (chan == chanpwr[i].chan) { if (chan == chanpwr[i].chan) {
lbs_pr_debug(1, "11D: Found Chan:%d\n", chan); lbs_deb_11d("11D: Found Chan:%d\n", chan);
return 1; return 1;
} }
} }
lbs_pr_debug(1, "11D: Not Find Chan:%d\n", chan); lbs_deb_11d("11D: Not Find Chan:%d\n", chan);
return 0; return 0;
} }
...@@ -174,7 +174,7 @@ static int generate_domain_info_11d(struct parsed_region_chan_11d ...@@ -174,7 +174,7 @@ static int generate_domain_info_11d(struct parsed_region_chan_11d
memcpy(domaininfo->countrycode, parsed_region_chan->countrycode, memcpy(domaininfo->countrycode, parsed_region_chan->countrycode,
COUNTRY_CODE_LEN); COUNTRY_CODE_LEN);
lbs_pr_debug(1, "11D:nrchan=%d\n", nr_chan); lbs_deb_11d("11D:nrchan=%d\n", nr_chan);
lbs_dbg_hex("11D:parsed_region_chan:", (char *)parsed_region_chan, lbs_dbg_hex("11D:parsed_region_chan:", (char *)parsed_region_chan,
sizeof(struct parsed_region_chan_11d)); sizeof(struct parsed_region_chan_11d));
...@@ -212,7 +212,7 @@ static int generate_domain_info_11d(struct parsed_region_chan_11d ...@@ -212,7 +212,7 @@ static int generate_domain_info_11d(struct parsed_region_chan_11d
} }
domaininfo->nr_subband = nr_subband; domaininfo->nr_subband = nr_subband;
lbs_pr_debug(1, "nr_subband=%x\n", domaininfo->nr_subband); lbs_deb_11d("nr_subband=%x\n", domaininfo->nr_subband);
lbs_dbg_hex("11D:domaininfo:", (char *)domaininfo, lbs_dbg_hex("11D:domaininfo:", (char *)domaininfo,
COUNTRY_CODE_LEN + 1 + COUNTRY_CODE_LEN + 1 +
sizeof(struct ieeetypes_subbandset) * nr_subband); sizeof(struct ieeetypes_subbandset) * nr_subband);
...@@ -233,13 +233,13 @@ static void wlan_generate_parsed_region_chan_11d(struct region_channel * region_ ...@@ -233,13 +233,13 @@ static void wlan_generate_parsed_region_chan_11d(struct region_channel * region_
struct chan_freq_power *cfp; struct chan_freq_power *cfp;
if (region_chan == NULL) { if (region_chan == NULL) {
lbs_pr_debug(1, "11D: region_chan is NULL\n"); lbs_deb_11d("11D: region_chan is NULL\n");
return; return;
} }
cfp = region_chan->CFP; cfp = region_chan->CFP;
if (cfp == NULL) { if (cfp == NULL) {
lbs_pr_debug(1, "11D: cfp equal NULL \n"); lbs_deb_11d("11D: cfp equal NULL \n");
return; return;
} }
...@@ -248,19 +248,19 @@ static void wlan_generate_parsed_region_chan_11d(struct region_channel * region_ ...@@ -248,19 +248,19 @@ static void wlan_generate_parsed_region_chan_11d(struct region_channel * region_
memcpy(parsed_region_chan->countrycode, memcpy(parsed_region_chan->countrycode,
wlan_code_2_region(region_chan->region), COUNTRY_CODE_LEN); wlan_code_2_region(region_chan->region), COUNTRY_CODE_LEN);
lbs_pr_debug(1, "11D: region[0x%x] band[%d]\n", parsed_region_chan->region, lbs_deb_11d("11D: region[0x%x] band[%d]\n", parsed_region_chan->region,
parsed_region_chan->band); parsed_region_chan->band);
for (i = 0; i < region_chan->nrcfp; i++, cfp++) { for (i = 0; i < region_chan->nrcfp; i++, cfp++) {
parsed_region_chan->chanpwr[i].chan = cfp->channel; parsed_region_chan->chanpwr[i].chan = cfp->channel;
parsed_region_chan->chanpwr[i].pwr = cfp->maxtxpower; parsed_region_chan->chanpwr[i].pwr = cfp->maxtxpower;
lbs_pr_debug(1, "11D: Chan[%d] Pwr[%d]\n", lbs_deb_11d("11D: Chan[%d] Pwr[%d]\n",
parsed_region_chan->chanpwr[i].chan, parsed_region_chan->chanpwr[i].chan,
parsed_region_chan->chanpwr[i].pwr); parsed_region_chan->chanpwr[i].pwr);
} }
parsed_region_chan->nr_chan = region_chan->nrcfp; parsed_region_chan->nr_chan = region_chan->nrcfp;
lbs_pr_debug(1, "11D: nrchan[%d]\n", parsed_region_chan->nr_chan); lbs_deb_11d("11D: nrchan[%d]\n", parsed_region_chan->nr_chan);
return; return;
} }
...@@ -277,8 +277,9 @@ static u8 wlan_region_chan_supported_11d(u8 region, u8 band, u8 chan) ...@@ -277,8 +277,9 @@ static u8 wlan_region_chan_supported_11d(u8 region, u8 band, u8 chan)
struct chan_freq_power *cfp; struct chan_freq_power *cfp;
int cfp_no; int cfp_no;
u8 idx; u8 idx;
int ret = 0;
ENTER(); lbs_deb_enter(LBS_DEB_11D);
cfp = libertas_get_region_cfp_table(region, band, &cfp_no); cfp = libertas_get_region_cfp_table(region, band, &cfp_no);
if (cfp == NULL) if (cfp == NULL)
...@@ -288,16 +289,19 @@ static u8 wlan_region_chan_supported_11d(u8 region, u8 band, u8 chan) ...@@ -288,16 +289,19 @@ static u8 wlan_region_chan_supported_11d(u8 region, u8 band, u8 chan)
if (chan == (cfp + idx)->channel) { if (chan == (cfp + idx)->channel) {
/* If Mrvl Chip Supported? */ /* If Mrvl Chip Supported? */
if ((cfp + idx)->unsupported) { if ((cfp + idx)->unsupported) {
return 0; ret = 0;
} else { } else {
return 1; ret = 1;
} }
goto done;
} }
} }
/*chan is not in the region table */ /*chan is not in the region table */
LEAVE();
return 0; done:
lbs_deb_leave_args(LBS_DEB_11D, "ret %d", ret);
return ret;
} }
/** /**
...@@ -321,7 +325,7 @@ static int parse_domain_info_11d(struct ieeetypes_countryinfofullset* ...@@ -321,7 +325,7 @@ static int parse_domain_info_11d(struct ieeetypes_countryinfofullset*
u8 j, i; u8 j, i;
ENTER(); lbs_deb_enter(LBS_DEB_11D);
/*validation Rules: /*validation Rules:
1. valid region Code 1. valid region Code
...@@ -337,15 +341,14 @@ static int parse_domain_info_11d(struct ieeetypes_countryinfofullset* ...@@ -337,15 +341,14 @@ static int parse_domain_info_11d(struct ieeetypes_countryinfofullset*
if ((*(countryinfo->countrycode)) == 0 if ((*(countryinfo->countrycode)) == 0
|| (countryinfo->len <= COUNTRY_CODE_LEN)) { || (countryinfo->len <= COUNTRY_CODE_LEN)) {
/* No region Info or Wrong region info: treat as No 11D info */ /* No region Info or Wrong region info: treat as No 11D info */
LEAVE(); goto done;
return 0;
} }
/*Step1: check region_code */ /*Step1: check region_code */
parsed_region_chan->region = region = parsed_region_chan->region = region =
wlan_region_2_code(countryinfo->countrycode); wlan_region_2_code(countryinfo->countrycode);
lbs_pr_debug(1, "regioncode=%x\n", (u8) parsed_region_chan->region); lbs_deb_11d("regioncode=%x\n", (u8) parsed_region_chan->region);
lbs_dbg_hex("CountryCode:", (char *)countryinfo->countrycode, lbs_dbg_hex("CountryCode:", (char *)countryinfo->countrycode,
COUNTRY_CODE_LEN); COUNTRY_CODE_LEN);
...@@ -361,7 +364,7 @@ static int parse_domain_info_11d(struct ieeetypes_countryinfofullset* ...@@ -361,7 +364,7 @@ static int parse_domain_info_11d(struct ieeetypes_countryinfofullset*
if (countryinfo->subband[j].firstchan <= lastchan) { if (countryinfo->subband[j].firstchan <= lastchan) {
/*Step2&3. Check First Chan Num increment and no overlap */ /*Step2&3. Check First Chan Num increment and no overlap */
lbs_pr_debug(1, "11D: Chan[%d>%d] Overlap\n", lbs_deb_11d("11D: Chan[%d>%d] Overlap\n",
countryinfo->subband[j].firstchan, lastchan); countryinfo->subband[j].firstchan, lastchan);
continue; continue;
} }
...@@ -374,7 +377,7 @@ static int parse_domain_info_11d(struct ieeetypes_countryinfofullset* ...@@ -374,7 +377,7 @@ static int parse_domain_info_11d(struct ieeetypes_countryinfofullset*
if (!wlan_get_chan_11d(band, firstchan, i, &curchan)) { if (!wlan_get_chan_11d(band, firstchan, i, &curchan)) {
/* Chan is not found in UN table */ /* Chan is not found in UN table */
lbs_pr_debug(1, "chan is not supported: %d \n", i); lbs_deb_11d("chan is not supported: %d \n", i);
break; break;
} }
...@@ -389,7 +392,7 @@ static int parse_domain_info_11d(struct ieeetypes_countryinfofullset* ...@@ -389,7 +392,7 @@ static int parse_domain_info_11d(struct ieeetypes_countryinfofullset*
idx++; idx++;
} else { } else {
/*not supported and ignore the chan */ /*not supported and ignore the chan */
lbs_pr_debug(1, lbs_deb_11d(
"11D:i[%d] chan[%d] unsupported in region[%x] band[%d]\n", "11D:i[%d] chan[%d] unsupported in region[%x] band[%d]\n",
i, curchan, region, band); i, curchan, region, band);
} }
...@@ -401,11 +404,12 @@ static int parse_domain_info_11d(struct ieeetypes_countryinfofullset* ...@@ -401,11 +404,12 @@ static int parse_domain_info_11d(struct ieeetypes_countryinfofullset*
parsed_region_chan->nr_chan = idx; parsed_region_chan->nr_chan = idx;
lbs_pr_debug(1, "nrchan=%x\n", parsed_region_chan->nr_chan); lbs_deb_11d("nrchan=%x\n", parsed_region_chan->nr_chan);
lbs_dbg_hex("11D:parsed_region_chan:", (u8 *) parsed_region_chan, lbs_dbg_hex("11D:parsed_region_chan:", (u8 *) parsed_region_chan,
2 + COUNTRY_CODE_LEN + sizeof(struct parsed_region_chan_11d) * idx); 2 + COUNTRY_CODE_LEN + sizeof(struct parsed_region_chan_11d) * idx);
LEAVE(); done:
lbs_deb_enter(LBS_DEB_11D);
return 0; return 0;
} }
...@@ -420,16 +424,16 @@ u8 libertas_get_scan_type_11d(u8 chan, ...@@ -420,16 +424,16 @@ u8 libertas_get_scan_type_11d(u8 chan,
{ {
u8 scan_type = cmd_scan_type_passive; u8 scan_type = cmd_scan_type_passive;
ENTER(); lbs_deb_enter(LBS_DEB_11D);
if (wlan_channel_known_11d(chan, parsed_region_chan)) { if (wlan_channel_known_11d(chan, parsed_region_chan)) {
lbs_pr_debug(1, "11D: Found and do Active Scan\n"); lbs_deb_11d("11D: Found and do Active Scan\n");
scan_type = cmd_scan_type_active; scan_type = cmd_scan_type_active;
} else { } else {
lbs_pr_debug(1, "11D: Not Find and do Passive Scan\n"); lbs_deb_11d("11D: Not Find and do Passive Scan\n");
} }
LEAVE(); lbs_deb_leave_args(LBS_DEB_11D, "ret scan_type %d", scan_type);
return scan_type; return scan_type;
} }
...@@ -456,7 +460,7 @@ static int wlan_enable_11d(wlan_private * priv, u8 flag) ...@@ -456,7 +460,7 @@ static int wlan_enable_11d(wlan_private * priv, u8 flag)
OID_802_11D_ENABLE, OID_802_11D_ENABLE,
&priv->adapter->enable11d); &priv->adapter->enable11d);
if (ret) if (ret)
lbs_pr_debug(1, "11D: Fail to enable 11D \n"); lbs_deb_11d("11D: Fail to enable 11D \n");
return 0; return 0;
} }
...@@ -471,7 +475,7 @@ static int set_domain_info_11d(wlan_private * priv) ...@@ -471,7 +475,7 @@ static int set_domain_info_11d(wlan_private * priv)
int ret; int ret;
if (!priv->adapter->enable11d) { if (!priv->adapter->enable11d) {
lbs_pr_debug(1, "11D: dnld domain Info with 11d disabled\n"); lbs_deb_11d("11D: dnld domain Info with 11d disabled\n");
return 0; return 0;
} }
...@@ -479,7 +483,7 @@ static int set_domain_info_11d(wlan_private * priv) ...@@ -479,7 +483,7 @@ static int set_domain_info_11d(wlan_private * priv)
cmd_act_set, cmd_act_set,
cmd_option_waitforrsp, 0, NULL); cmd_option_waitforrsp, 0, NULL);
if (ret) if (ret)
lbs_pr_debug(1, "11D: Fail to dnld domain Info\n"); lbs_deb_11d("11D: Fail to dnld domain Info\n");
return ret; return ret;
} }
...@@ -501,7 +505,7 @@ int libertas_set_universaltable(wlan_private * priv, u8 band) ...@@ -501,7 +505,7 @@ int libertas_set_universaltable(wlan_private * priv, u8 band)
adapter->universal_channel[i].nrcfp = adapter->universal_channel[i].nrcfp =
sizeof(channel_freq_power_UN_BG) / size; sizeof(channel_freq_power_UN_BG) / size;
lbs_pr_debug(1, "11D: BG-band nrcfp=%d\n", lbs_deb_11d("11D: BG-band nrcfp=%d\n",
adapter->universal_channel[i].nrcfp); adapter->universal_channel[i].nrcfp);
adapter->universal_channel[i].CFP = channel_freq_power_UN_BG; adapter->universal_channel[i].CFP = channel_freq_power_UN_BG;
...@@ -531,9 +535,9 @@ int libertas_cmd_802_11d_domain_info(wlan_private * priv, ...@@ -531,9 +535,9 @@ int libertas_cmd_802_11d_domain_info(wlan_private * priv,
wlan_adapter *adapter = priv->adapter; wlan_adapter *adapter = priv->adapter;
u8 nr_subband = adapter->domainreg.nr_subband; u8 nr_subband = adapter->domainreg.nr_subband;
ENTER(); lbs_deb_enter(LBS_DEB_11D);
lbs_pr_debug(1, "nr_subband=%x\n", nr_subband); lbs_deb_11d("nr_subband=%x\n", nr_subband);
cmd->command = cpu_to_le16(cmdno); cmd->command = cpu_to_le16(cmdno);
pdomaininfo->action = cpu_to_le16(cmdoption); pdomaininfo->action = cpu_to_le16(cmdoption);
...@@ -542,8 +546,7 @@ int libertas_cmd_802_11d_domain_info(wlan_private * priv, ...@@ -542,8 +546,7 @@ int libertas_cmd_802_11d_domain_info(wlan_private * priv,
cpu_to_le16(sizeof(pdomaininfo->action) + S_DS_GEN); cpu_to_le16(sizeof(pdomaininfo->action) + S_DS_GEN);
lbs_dbg_hex("11D: 802_11D_DOMAIN_INFO:", (u8 *) cmd, lbs_dbg_hex("11D: 802_11D_DOMAIN_INFO:", (u8 *) cmd,
(int)(cmd->size)); (int)(cmd->size));
LEAVE(); goto done;
return 0;
} }
domain->header.type = cpu_to_le16(TLV_TYPE_DOMAIN); domain->header.type = cpu_to_le16(TLV_TYPE_DOMAIN);
...@@ -569,8 +572,8 @@ int libertas_cmd_802_11d_domain_info(wlan_private * priv, ...@@ -569,8 +572,8 @@ int libertas_cmd_802_11d_domain_info(wlan_private * priv,
lbs_dbg_hex("11D:802_11D_DOMAIN_INFO:", (u8 *) cmd, (int)(cmd->size)); lbs_dbg_hex("11D:802_11D_DOMAIN_INFO:", (u8 *) cmd, (int)(cmd->size));
LEAVE(); done:
lbs_deb_enter(LBS_DEB_11D);
return 0; return 0;
} }
...@@ -585,17 +588,17 @@ int libertas_cmd_enable_11d(wlan_private * priv, struct iwreq *wrq) ...@@ -585,17 +588,17 @@ int libertas_cmd_enable_11d(wlan_private * priv, struct iwreq *wrq)
int data = 0; int data = 0;
int *val; int *val;
ENTER(); lbs_deb_enter(LBS_DEB_11D);
data = SUBCMD_DATA(wrq); data = SUBCMD_DATA(wrq);
lbs_pr_debug(1, "enable 11D: %s\n", lbs_deb_11d("enable 11D: %s\n",
(data == 1) ? "enable" : "Disable"); (data == 1) ? "enable" : "Disable");
wlan_enable_11d(priv, data); wlan_enable_11d(priv, data);
val = (int *)wrq->u.name; val = (int *)wrq->u.name;
*val = priv->adapter->enable11d; *val = priv->adapter->enable11d;
LEAVE(); lbs_deb_enter(LBS_DEB_11D);
return 0; return 0;
} }
...@@ -615,7 +618,7 @@ int libertas_ret_802_11d_domain_info(wlan_private * priv, ...@@ -615,7 +618,7 @@ int libertas_ret_802_11d_domain_info(wlan_private * priv,
s16 ret = 0; s16 ret = 0;
u8 nr_subband = 0; u8 nr_subband = 0;
ENTER(); lbs_deb_enter(LBS_DEB_11D);
lbs_dbg_hex("11D DOMAIN Info Rsp Data:", (u8 *) resp, lbs_dbg_hex("11D DOMAIN Info Rsp Data:", (u8 *) resp,
(int)le16_to_cpu(resp->size)); (int)le16_to_cpu(resp->size));
...@@ -623,10 +626,10 @@ int libertas_ret_802_11d_domain_info(wlan_private * priv, ...@@ -623,10 +626,10 @@ int libertas_ret_802_11d_domain_info(wlan_private * priv,
nr_subband = (domain->header.len - 3) / sizeof(struct ieeetypes_subbandset); nr_subband = (domain->header.len - 3) / sizeof(struct ieeetypes_subbandset);
/* countrycode 3 bytes */ /* countrycode 3 bytes */
lbs_pr_debug(1, "11D Domain Info Resp: nr_subband=%d\n", nr_subband); lbs_deb_11d("11D Domain Info Resp: nr_subband=%d\n", nr_subband);
if (nr_subband > MRVDRV_MAX_SUBBAND_802_11D) { if (nr_subband > MRVDRV_MAX_SUBBAND_802_11D) {
lbs_pr_debug(1, "Invalid Numrer of Subband returned!!\n"); lbs_deb_11d("Invalid Numrer of Subband returned!!\n");
return -1; return -1;
} }
...@@ -637,12 +640,12 @@ int libertas_ret_802_11d_domain_info(wlan_private * priv, ...@@ -637,12 +640,12 @@ int libertas_ret_802_11d_domain_info(wlan_private * priv,
case cmd_act_get: case cmd_act_get:
break; break;
default: default:
lbs_pr_debug(1, "Invalid action:%d\n", domaininfo->action); lbs_deb_11d("Invalid action:%d\n", domaininfo->action);
ret = -1; ret = -1;
break; break;
} }
LEAVE(); lbs_deb_leave_args(LBS_DEB_11D, "ret %d", ret);
return ret; return ret;
} }
...@@ -656,7 +659,7 @@ int libertas_parse_dnld_countryinfo_11d(wlan_private * priv) ...@@ -656,7 +659,7 @@ int libertas_parse_dnld_countryinfo_11d(wlan_private * priv)
int ret; int ret;
wlan_adapter *adapter = priv->adapter; wlan_adapter *adapter = priv->adapter;
ENTER(); lbs_deb_enter(LBS_DEB_11D);
if (priv->adapter->enable11d) { if (priv->adapter->enable11d) {
memset(&adapter->parsed_region_chan, 0, memset(&adapter->parsed_region_chan, 0,
sizeof(struct parsed_region_chan_11d)); sizeof(struct parsed_region_chan_11d));
...@@ -665,9 +668,8 @@ int libertas_parse_dnld_countryinfo_11d(wlan_private * priv) ...@@ -665,9 +668,8 @@ int libertas_parse_dnld_countryinfo_11d(wlan_private * priv)
&adapter->parsed_region_chan); &adapter->parsed_region_chan);
if (ret == -1) { if (ret == -1) {
lbs_pr_debug(1, "11D: Err Parse domain_info from AP..\n"); lbs_deb_11d("11D: Err Parse domain_info from AP..\n");
LEAVE(); goto done;
return ret;
} }
memset(&adapter->domainreg, 0, memset(&adapter->domainreg, 0,
...@@ -678,13 +680,15 @@ int libertas_parse_dnld_countryinfo_11d(wlan_private * priv) ...@@ -678,13 +680,15 @@ int libertas_parse_dnld_countryinfo_11d(wlan_private * priv)
ret = set_domain_info_11d(priv); ret = set_domain_info_11d(priv);
if (ret) { if (ret) {
lbs_pr_debug(1, "11D: Err set domainInfo to FW\n"); lbs_deb_11d("11D: Err set domainInfo to FW\n");
LEAVE(); goto done;
return ret;
} }
} }
LEAVE(); ret = 0;
return 0;
done:
lbs_deb_leave_args(LBS_DEB_11D, "ret %d", ret);
return ret;
} }
/** /**
...@@ -699,8 +703,8 @@ int libertas_create_dnld_countryinfo_11d(wlan_private * priv) ...@@ -699,8 +703,8 @@ int libertas_create_dnld_countryinfo_11d(wlan_private * priv)
struct region_channel *region_chan; struct region_channel *region_chan;
u8 j; u8 j;
ENTER(); lbs_deb_enter(LBS_DEB_11D);
lbs_pr_debug(1, "11D:curbssparams.band[%d]\n", adapter->curbssparams.band); lbs_deb_11d("11D:curbssparams.band[%d]\n", adapter->curbssparams.band);
if (priv->adapter->enable11d) { if (priv->adapter->enable11d) {
/* update parsed_region_chan_11; dnld domaininf to FW */ /* update parsed_region_chan_11; dnld domaininf to FW */
...@@ -709,7 +713,7 @@ int libertas_create_dnld_countryinfo_11d(wlan_private * priv) ...@@ -709,7 +713,7 @@ int libertas_create_dnld_countryinfo_11d(wlan_private * priv)
sizeof(adapter->region_channel[0]); j++) { sizeof(adapter->region_channel[0]); j++) {
region_chan = &adapter->region_channel[j]; region_chan = &adapter->region_channel[j];
lbs_pr_debug(1, "11D:[%d] region_chan->band[%d]\n", j, lbs_deb_11d("11D:[%d] region_chan->band[%d]\n", j,
region_chan->band); region_chan->band);
if (!region_chan || !region_chan->valid if (!region_chan || !region_chan->valid
...@@ -722,10 +726,10 @@ int libertas_create_dnld_countryinfo_11d(wlan_private * priv) ...@@ -722,10 +726,10 @@ int libertas_create_dnld_countryinfo_11d(wlan_private * priv)
if (j >= sizeof(adapter->region_channel) / if (j >= sizeof(adapter->region_channel) /
sizeof(adapter->region_channel[0])) { sizeof(adapter->region_channel[0])) {
lbs_pr_debug(1, "11D:region_chan not found. band[%d]\n", lbs_deb_11d("11D:region_chan not found. band[%d]\n",
adapter->curbssparams.band); adapter->curbssparams.band);
LEAVE(); ret = -1;
return -1; goto done;
} }
memset(&adapter->parsed_region_chan, 0, memset(&adapter->parsed_region_chan, 0,
...@@ -742,13 +746,14 @@ int libertas_create_dnld_countryinfo_11d(wlan_private * priv) ...@@ -742,13 +746,14 @@ int libertas_create_dnld_countryinfo_11d(wlan_private * priv)
ret = set_domain_info_11d(priv); ret = set_domain_info_11d(priv);
if (ret) { if (ret) {
lbs_pr_debug(1, "11D: Err set domainInfo to FW\n"); lbs_deb_11d("11D: Err set domainInfo to FW\n");
LEAVE(); goto done;
return ret;
} }
} }
ret = 0;
LEAVE(); done:
return 0; lbs_deb_leave_args(LBS_DEB_11D, "ret %d", ret);
return ret;
} }
...@@ -20,9 +20,9 @@ static int assoc_helper_essid(wlan_private *priv, ...@@ -20,9 +20,9 @@ static int assoc_helper_essid(wlan_private *priv,
int ret = 0; int ret = 0;
int i; int i;
ENTER(); lbs_deb_enter(LBS_DEB_ASSOC);
lbs_pr_debug(1, "New SSID requested: %s\n", assoc_req->ssid.ssid); lbs_deb_assoc("New SSID requested: %s\n", assoc_req->ssid.ssid);
if (assoc_req->mode == IW_MODE_INFRA) { if (assoc_req->mode == IW_MODE_INFRA) {
if (adapter->prescan) { if (adapter->prescan) {
libertas_send_specific_SSID_scan(priv, &assoc_req->ssid, 1); libertas_send_specific_SSID_scan(priv, &assoc_req->ssid, 1);
...@@ -31,7 +31,7 @@ static int assoc_helper_essid(wlan_private *priv, ...@@ -31,7 +31,7 @@ static int assoc_helper_essid(wlan_private *priv,
i = libertas_find_SSID_in_list(adapter, &assoc_req->ssid, i = libertas_find_SSID_in_list(adapter, &assoc_req->ssid,
NULL, IW_MODE_INFRA); NULL, IW_MODE_INFRA);
if (i >= 0) { if (i >= 0) {
lbs_pr_debug(1, lbs_deb_assoc(
"SSID found in scan list ... associating...\n"); "SSID found in scan list ... associating...\n");
ret = wlan_associate(priv, &adapter->scantable[i]); ret = wlan_associate(priv, &adapter->scantable[i]);
...@@ -41,7 +41,7 @@ static int assoc_helper_essid(wlan_private *priv, ...@@ -41,7 +41,7 @@ static int assoc_helper_essid(wlan_private *priv,
ETH_ALEN); ETH_ALEN);
} }
} else { } else {
lbs_pr_debug(1, "SSID '%s' not found; cannot associate\n", lbs_deb_assoc("SSID '%s' not found; cannot associate\n",
assoc_req->ssid.ssid); assoc_req->ssid.ssid);
} }
} else if (assoc_req->mode == IW_MODE_ADHOC) { } else if (assoc_req->mode == IW_MODE_ADHOC) {
...@@ -54,18 +54,18 @@ static int assoc_helper_essid(wlan_private *priv, ...@@ -54,18 +54,18 @@ static int assoc_helper_essid(wlan_private *priv,
i = libertas_find_SSID_in_list(adapter, &assoc_req->ssid, NULL, i = libertas_find_SSID_in_list(adapter, &assoc_req->ssid, NULL,
IW_MODE_ADHOC); IW_MODE_ADHOC);
if (i >= 0) { if (i >= 0) {
lbs_pr_debug(1, "SSID found at %d in List, so join\n", ret); lbs_deb_assoc("SSID found at %d in List, so join\n", ret);
libertas_join_adhoc_network(priv, &adapter->scantable[i]); libertas_join_adhoc_network(priv, &adapter->scantable[i]);
} else { } else {
/* else send START command */ /* else send START command */
lbs_pr_debug(1, "SSID not found in list, so creating adhoc" lbs_deb_assoc("SSID not found in list, so creating adhoc"
" with SSID '%s'\n", assoc_req->ssid.ssid); " with SSID '%s'\n", assoc_req->ssid.ssid);
libertas_start_adhoc_network(priv, &assoc_req->ssid); libertas_start_adhoc_network(priv, &assoc_req->ssid);
} }
memcpy(&assoc_req->bssid, &adapter->current_addr, ETH_ALEN); memcpy(&assoc_req->bssid, &adapter->current_addr, ETH_ALEN);
} }
LEAVE(); lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret);
return ret; return ret;
} }
...@@ -76,23 +76,21 @@ static int assoc_helper_bssid(wlan_private *priv, ...@@ -76,23 +76,21 @@ static int assoc_helper_bssid(wlan_private *priv,
wlan_adapter *adapter = priv->adapter; wlan_adapter *adapter = priv->adapter;
int i, ret = 0; int i, ret = 0;
ENTER(); lbs_deb_enter_args(LBS_DEB_ASSOC, "BSSID" MAC_FMT "\n",
lbs_pr_debug(1, "ASSOC: WAP: BSSID = " MAC_FMT "\n",
MAC_ARG(assoc_req->bssid)); MAC_ARG(assoc_req->bssid));
/* Search for index position in list for requested MAC */ /* Search for index position in list for requested MAC */
i = libertas_find_BSSID_in_list(adapter, assoc_req->bssid, i = libertas_find_BSSID_in_list(adapter, assoc_req->bssid,
assoc_req->mode); assoc_req->mode);
if (i < 0) { if (i < 0) {
lbs_pr_debug(1, "ASSOC: WAP: BSSID " MAC_FMT " not found, " lbs_deb_assoc("ASSOC: WAP: BSSID " MAC_FMT " not found, "
"cannot associate.\n", MAC_ARG(assoc_req->bssid)); "cannot associate.\n", MAC_ARG(assoc_req->bssid));
goto out; goto out;
} }
if (assoc_req->mode == IW_MODE_INFRA) { if (assoc_req->mode == IW_MODE_INFRA) {
ret = wlan_associate(priv, &adapter->scantable[i]); ret = wlan_associate(priv, &adapter->scantable[i]);
lbs_pr_debug(1, "ASSOC: return from wlan_associate(bssd) was %d\n", ret); lbs_deb_assoc("ASSOC: return from wlan_associate(bssd) was %d\n", ret);
} else if (assoc_req->mode == IW_MODE_ADHOC) { } else if (assoc_req->mode == IW_MODE_ADHOC) {
libertas_join_adhoc_network(priv, &adapter->scantable[i]); libertas_join_adhoc_network(priv, &adapter->scantable[i]);
} }
...@@ -100,7 +98,7 @@ static int assoc_helper_bssid(wlan_private *priv, ...@@ -100,7 +98,7 @@ static int assoc_helper_bssid(wlan_private *priv,
sizeof(struct WLAN_802_11_SSID)); sizeof(struct WLAN_802_11_SSID));
out: out:
LEAVE(); lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret);
return ret; return ret;
} }
...@@ -118,7 +116,7 @@ static int assoc_helper_associate(wlan_private *priv, ...@@ -118,7 +116,7 @@ static int assoc_helper_associate(wlan_private *priv,
ret = assoc_helper_bssid(priv, assoc_req); ret = assoc_helper_bssid(priv, assoc_req);
done = 1; done = 1;
if (ret) { if (ret) {
lbs_pr_debug(1, "ASSOC: bssid: ret = %d\n", ret); lbs_deb_assoc("ASSOC: bssid: ret = %d\n", ret);
} }
} }
} }
...@@ -126,7 +124,7 @@ static int assoc_helper_associate(wlan_private *priv, ...@@ -126,7 +124,7 @@ static int assoc_helper_associate(wlan_private *priv,
if (!done && test_bit(ASSOC_FLAG_SSID, &assoc_req->flags)) { if (!done && test_bit(ASSOC_FLAG_SSID, &assoc_req->flags)) {
ret = assoc_helper_essid(priv, assoc_req); ret = assoc_helper_essid(priv, assoc_req);
if (ret) { if (ret) {
lbs_pr_debug(1, "ASSOC: bssid: ret = %d\n", ret); lbs_deb_assoc("ASSOC: bssid: ret = %d\n", ret);
} }
} }
...@@ -140,12 +138,10 @@ static int assoc_helper_mode(wlan_private *priv, ...@@ -140,12 +138,10 @@ static int assoc_helper_mode(wlan_private *priv,
wlan_adapter *adapter = priv->adapter; wlan_adapter *adapter = priv->adapter;
int ret = 0; int ret = 0;
ENTER(); lbs_deb_enter(LBS_DEB_ASSOC);
if (assoc_req->mode == adapter->mode) { if (assoc_req->mode == adapter->mode)
LEAVE(); goto done;
return 0;
}
if (assoc_req->mode == IW_MODE_INFRA) { if (assoc_req->mode == IW_MODE_INFRA) {
if (adapter->psstate != PS_STATE_FULL_POWER) if (adapter->psstate != PS_STATE_FULL_POWER)
...@@ -160,7 +156,8 @@ static int assoc_helper_mode(wlan_private *priv, ...@@ -160,7 +156,8 @@ static int assoc_helper_mode(wlan_private *priv,
OID_802_11_INFRASTRUCTURE_MODE, OID_802_11_INFRASTRUCTURE_MODE,
(void *) (size_t) assoc_req->mode); (void *) (size_t) assoc_req->mode);
LEAVE(); done:
lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret);
return ret; return ret;
} }
...@@ -172,7 +169,7 @@ static int assoc_helper_wep_keys(wlan_private *priv, ...@@ -172,7 +169,7 @@ static int assoc_helper_wep_keys(wlan_private *priv,
int i; int i;
int ret = 0; int ret = 0;
ENTER(); lbs_deb_enter(LBS_DEB_ASSOC);
/* Set or remove WEP keys */ /* Set or remove WEP keys */
if ( assoc_req->wep_keys[0].len if ( assoc_req->wep_keys[0].len
...@@ -216,7 +213,7 @@ static int assoc_helper_wep_keys(wlan_private *priv, ...@@ -216,7 +213,7 @@ static int assoc_helper_wep_keys(wlan_private *priv,
mutex_unlock(&adapter->lock); mutex_unlock(&adapter->lock);
out: out:
LEAVE(); lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret);
return ret; return ret;
} }
...@@ -226,14 +223,14 @@ static int assoc_helper_secinfo(wlan_private *priv, ...@@ -226,14 +223,14 @@ static int assoc_helper_secinfo(wlan_private *priv,
wlan_adapter *adapter = priv->adapter; wlan_adapter *adapter = priv->adapter;
int ret = 0; int ret = 0;
ENTER(); lbs_deb_enter(LBS_DEB_ASSOC);
memcpy(&adapter->secinfo, &assoc_req->secinfo, memcpy(&adapter->secinfo, &assoc_req->secinfo,
sizeof(struct wlan_802_11_security)); sizeof(struct wlan_802_11_security));
ret = libertas_set_mac_packet_filter(priv); ret = libertas_set_mac_packet_filter(priv);
LEAVE(); lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret);
return ret; return ret;
} }
...@@ -243,7 +240,7 @@ static int assoc_helper_wpa_keys(wlan_private *priv, ...@@ -243,7 +240,7 @@ static int assoc_helper_wpa_keys(wlan_private *priv,
{ {
int ret = 0; int ret = 0;
ENTER(); lbs_deb_enter(LBS_DEB_ASSOC);
/* enable/Disable RSN */ /* enable/Disable RSN */
ret = libertas_prepare_and_send_command(priv, ret = libertas_prepare_and_send_command(priv,
...@@ -261,7 +258,7 @@ static int assoc_helper_wpa_keys(wlan_private *priv, ...@@ -261,7 +258,7 @@ static int assoc_helper_wpa_keys(wlan_private *priv,
0, assoc_req); 0, assoc_req);
out: out:
LEAVE(); lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret);
return ret; return ret;
} }
...@@ -272,7 +269,7 @@ static int assoc_helper_wpa_ie(wlan_private *priv, ...@@ -272,7 +269,7 @@ static int assoc_helper_wpa_ie(wlan_private *priv,
wlan_adapter *adapter = priv->adapter; wlan_adapter *adapter = priv->adapter;
int ret = 0; int ret = 0;
ENTER(); lbs_deb_enter(LBS_DEB_ASSOC);
if (assoc_req->secinfo.WPAenabled || assoc_req->secinfo.WPA2enabled) { if (assoc_req->secinfo.WPAenabled || assoc_req->secinfo.WPA2enabled) {
memcpy(&adapter->wpa_ie, &assoc_req->wpa_ie, assoc_req->wpa_ie_len); memcpy(&adapter->wpa_ie, &assoc_req->wpa_ie, assoc_req->wpa_ie_len);
...@@ -282,7 +279,7 @@ static int assoc_helper_wpa_ie(wlan_private *priv, ...@@ -282,7 +279,7 @@ static int assoc_helper_wpa_ie(wlan_private *priv,
adapter->wpa_ie_len = 0; adapter->wpa_ie_len = 0;
} }
LEAVE(); lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret);
return ret; return ret;
} }
...@@ -294,21 +291,21 @@ static int should_deauth_infrastructure(wlan_adapter *adapter, ...@@ -294,21 +291,21 @@ static int should_deauth_infrastructure(wlan_adapter *adapter,
return 0; return 0;
if (test_bit(ASSOC_FLAG_SSID, &assoc_req->flags)) { if (test_bit(ASSOC_FLAG_SSID, &assoc_req->flags)) {
lbs_pr_debug(1, "Deauthenticating due to new SSID in " lbs_deb_assoc("Deauthenticating due to new SSID in "
" configuration request.\n"); " configuration request.\n");
return 1; return 1;
} }
if (test_bit(ASSOC_FLAG_SECINFO, &assoc_req->flags)) { if (test_bit(ASSOC_FLAG_SECINFO, &assoc_req->flags)) {
if (adapter->secinfo.auth_mode != assoc_req->secinfo.auth_mode) { if (adapter->secinfo.auth_mode != assoc_req->secinfo.auth_mode) {
lbs_pr_debug(1, "Deauthenticating due to updated security " lbs_deb_assoc("Deauthenticating due to updated security "
"info in configuration request.\n"); "info in configuration request.\n");
return 1; return 1;
} }
} }
if (test_bit(ASSOC_FLAG_BSSID, &assoc_req->flags)) { if (test_bit(ASSOC_FLAG_BSSID, &assoc_req->flags)) {
lbs_pr_debug(1, "Deauthenticating due to new BSSID in " lbs_deb_assoc("Deauthenticating due to new BSSID in "
" configuration request.\n"); " configuration request.\n");
return 1; return 1;
} }
...@@ -353,19 +350,17 @@ void libertas_association_worker(struct work_struct *work) ...@@ -353,19 +350,17 @@ void libertas_association_worker(struct work_struct *work)
int ret = 0; int ret = 0;
int find_any_ssid = 0; int find_any_ssid = 0;
ENTER(); lbs_deb_enter(LBS_DEB_ASSOC);
mutex_lock(&adapter->lock); mutex_lock(&adapter->lock);
assoc_req = adapter->assoc_req; assoc_req = adapter->assoc_req;
adapter->assoc_req = NULL; adapter->assoc_req = NULL;
mutex_unlock(&adapter->lock); mutex_unlock(&adapter->lock);
if (!assoc_req) { if (!assoc_req)
LEAVE(); goto done;
return;
}
lbs_pr_debug(1, "ASSOC: starting new association request: flags = 0x%lX\n", lbs_deb_assoc("ASSOC: starting new association request: flags = 0x%lX\n",
assoc_req->flags); assoc_req->flags);
/* If 'any' SSID was specified, find an SSID to associate with */ /* If 'any' SSID was specified, find an SSID to associate with */
...@@ -386,7 +381,7 @@ void libertas_association_worker(struct work_struct *work) ...@@ -386,7 +381,7 @@ void libertas_association_worker(struct work_struct *work)
ret = libertas_find_best_network_SSID(priv, &assoc_req->ssid, ret = libertas_find_best_network_SSID(priv, &assoc_req->ssid,
assoc_req->mode, &new_mode); assoc_req->mode, &new_mode);
if (ret) { if (ret) {
lbs_pr_debug(1, "Could not find best network\n"); lbs_deb_assoc("Could not find best network\n");
ret = -ENETUNREACH; ret = -ENETUNREACH;
goto out; goto out;
} }
...@@ -406,7 +401,7 @@ void libertas_association_worker(struct work_struct *work) ...@@ -406,7 +401,7 @@ void libertas_association_worker(struct work_struct *work)
if (should_deauth_infrastructure(adapter, assoc_req)) { if (should_deauth_infrastructure(adapter, assoc_req)) {
ret = libertas_send_deauthentication(priv); ret = libertas_send_deauthentication(priv);
if (ret) { if (ret) {
lbs_pr_debug(1, "Deauthentication due to new " lbs_deb_assoc("Deauthentication due to new "
"configuration request failed: %d\n", "configuration request failed: %d\n",
ret); ret);
} }
...@@ -415,7 +410,7 @@ void libertas_association_worker(struct work_struct *work) ...@@ -415,7 +410,7 @@ void libertas_association_worker(struct work_struct *work)
if (should_stop_adhoc(adapter, assoc_req)) { if (should_stop_adhoc(adapter, assoc_req)) {
ret = libertas_stop_adhoc_network(priv); ret = libertas_stop_adhoc_network(priv);
if (ret) { if (ret) {
lbs_pr_debug(1, "Teardown of AdHoc network due to " lbs_deb_assoc("Teardown of AdHoc network due to "
"new configuration request failed: %d\n", "new configuration request failed: %d\n",
ret); ret);
} }
...@@ -427,7 +422,7 @@ void libertas_association_worker(struct work_struct *work) ...@@ -427,7 +422,7 @@ void libertas_association_worker(struct work_struct *work)
if (test_bit(ASSOC_FLAG_MODE, &assoc_req->flags)) { if (test_bit(ASSOC_FLAG_MODE, &assoc_req->flags)) {
ret = assoc_helper_mode(priv, assoc_req); ret = assoc_helper_mode(priv, assoc_req);
if (ret) { if (ret) {
lbs_pr_debug(1, "ASSOC(:%d) mode: ret = %d\n", __LINE__, ret); lbs_deb_assoc("ASSOC(:%d) mode: ret = %d\n", __LINE__, ret);
goto out; goto out;
} }
} }
...@@ -436,7 +431,7 @@ lbs_pr_debug(1, "ASSOC(:%d) mode: ret = %d\n", __LINE__, ret); ...@@ -436,7 +431,7 @@ lbs_pr_debug(1, "ASSOC(:%d) mode: ret = %d\n", __LINE__, ret);
|| test_bit(ASSOC_FLAG_WEP_TX_KEYIDX, &assoc_req->flags)) { || test_bit(ASSOC_FLAG_WEP_TX_KEYIDX, &assoc_req->flags)) {
ret = assoc_helper_wep_keys(priv, assoc_req); ret = assoc_helper_wep_keys(priv, assoc_req);
if (ret) { if (ret) {
lbs_pr_debug(1, "ASSOC(:%d) wep_keys: ret = %d\n", __LINE__, ret); lbs_deb_assoc("ASSOC(:%d) wep_keys: ret = %d\n", __LINE__, ret);
goto out; goto out;
} }
} }
...@@ -444,7 +439,7 @@ lbs_pr_debug(1, "ASSOC(:%d) wep_keys: ret = %d\n", __LINE__, ret); ...@@ -444,7 +439,7 @@ lbs_pr_debug(1, "ASSOC(:%d) wep_keys: ret = %d\n", __LINE__, ret);
if (test_bit(ASSOC_FLAG_SECINFO, &assoc_req->flags)) { if (test_bit(ASSOC_FLAG_SECINFO, &assoc_req->flags)) {
ret = assoc_helper_secinfo(priv, assoc_req); ret = assoc_helper_secinfo(priv, assoc_req);
if (ret) { if (ret) {
lbs_pr_debug(1, "ASSOC(:%d) secinfo: ret = %d\n", __LINE__, ret); lbs_deb_assoc("ASSOC(:%d) secinfo: ret = %d\n", __LINE__, ret);
goto out; goto out;
} }
} }
...@@ -452,7 +447,7 @@ lbs_pr_debug(1, "ASSOC(:%d) secinfo: ret = %d\n", __LINE__, ret); ...@@ -452,7 +447,7 @@ lbs_pr_debug(1, "ASSOC(:%d) secinfo: ret = %d\n", __LINE__, ret);
if (test_bit(ASSOC_FLAG_WPA_IE, &assoc_req->flags)) { if (test_bit(ASSOC_FLAG_WPA_IE, &assoc_req->flags)) {
ret = assoc_helper_wpa_ie(priv, assoc_req); ret = assoc_helper_wpa_ie(priv, assoc_req);
if (ret) { if (ret) {
lbs_pr_debug(1, "ASSOC(:%d) wpa_ie: ret = %d\n", __LINE__, ret); lbs_deb_assoc("ASSOC(:%d) wpa_ie: ret = %d\n", __LINE__, ret);
goto out; goto out;
} }
} }
...@@ -461,7 +456,7 @@ lbs_pr_debug(1, "ASSOC(:%d) wpa_ie: ret = %d\n", __LINE__, ret); ...@@ -461,7 +456,7 @@ lbs_pr_debug(1, "ASSOC(:%d) wpa_ie: ret = %d\n", __LINE__, ret);
|| test_bit(ASSOC_FLAG_WPA_UCAST_KEY, &assoc_req->flags)) { || test_bit(ASSOC_FLAG_WPA_UCAST_KEY, &assoc_req->flags)) {
ret = assoc_helper_wpa_keys(priv, assoc_req); ret = assoc_helper_wpa_keys(priv, assoc_req);
if (ret) { if (ret) {
lbs_pr_debug(1, "ASSOC(:%d) wpa_keys: ret = %d\n", __LINE__, ret); lbs_deb_assoc("ASSOC(:%d) wpa_keys: ret = %d\n", __LINE__, ret);
goto out; goto out;
} }
} }
...@@ -475,19 +470,19 @@ lbs_pr_debug(1, "ASSOC(:%d) wpa_keys: ret = %d\n", __LINE__, ret); ...@@ -475,19 +470,19 @@ lbs_pr_debug(1, "ASSOC(:%d) wpa_keys: ret = %d\n", __LINE__, ret);
ret = assoc_helper_associate(priv, assoc_req); ret = assoc_helper_associate(priv, assoc_req);
if (ret) { if (ret) {
lbs_pr_debug(1, "ASSOC: association attempt unsuccessful: %d\n", lbs_deb_assoc("ASSOC: association attempt unsuccessful: %d\n",
ret); ret);
success = 0; success = 0;
} }
if (adapter->connect_status != libertas_connected) { if (adapter->connect_status != libertas_connected) {
lbs_pr_debug(1, "ASSOC: assoication attempt unsuccessful, " lbs_deb_assoc("ASSOC: assoication attempt unsuccessful, "
"not connected.\n"); "not connected.\n");
success = 0; success = 0;
} }
if (success) { if (success) {
lbs_pr_debug(1, "ASSOC: association attempt successful. " lbs_deb_assoc("ASSOC: association attempt successful. "
"Associated to '%s' (" MAC_FMT ")\n", "Associated to '%s' (" MAC_FMT ")\n",
assoc_req->ssid.ssid, MAC_ARG(assoc_req->bssid)); assoc_req->ssid.ssid, MAC_ARG(assoc_req->bssid));
libertas_prepare_and_send_command(priv, libertas_prepare_and_send_command(priv,
...@@ -505,11 +500,13 @@ lbs_pr_debug(1, "ASSOC(:%d) wpa_keys: ret = %d\n", __LINE__, ret); ...@@ -505,11 +500,13 @@ lbs_pr_debug(1, "ASSOC(:%d) wpa_keys: ret = %d\n", __LINE__, ret);
out: out:
if (ret) { if (ret) {
lbs_pr_debug(1, "ASSOC: reconfiguration attempt unsuccessful: %d\n", lbs_deb_assoc("ASSOC: reconfiguration attempt unsuccessful: %d\n",
ret); ret);
} }
kfree(assoc_req); kfree(assoc_req);
LEAVE();
done:
lbs_deb_leave(LBS_DEB_ASSOC);
} }
......
此差异已折叠。
...@@ -32,7 +32,7 @@ void libertas_mac_event_disconnected(wlan_private * priv) ...@@ -32,7 +32,7 @@ void libertas_mac_event_disconnected(wlan_private * priv)
if (adapter->connect_status != libertas_connected) if (adapter->connect_status != libertas_connected)
return; return;
lbs_pr_debug(1, "Handles disconnect event.\n"); lbs_deb_cmd("Handles disconnect event.\n");
memset(wrqu.ap_addr.sa_data, 0x00, ETH_ALEN); memset(wrqu.ap_addr.sa_data, 0x00, ETH_ALEN);
wrqu.ap_addr.sa_family = ARPHRD_ETHER; wrqu.ap_addr.sa_family = ARPHRD_ETHER;
...@@ -62,10 +62,10 @@ void libertas_mac_event_disconnected(wlan_private * priv) ...@@ -62,10 +62,10 @@ void libertas_mac_event_disconnected(wlan_private * priv)
adapter->nextSNRNF = 0; adapter->nextSNRNF = 0;
adapter->numSNRNF = 0; adapter->numSNRNF = 0;
adapter->rxpd_rate = 0; adapter->rxpd_rate = 0;
lbs_pr_debug(1, "Current SSID=%s, ssid length=%u\n", lbs_deb_cmd("Current SSID=%s, ssid length=%u\n",
adapter->curbssparams.ssid.ssid, adapter->curbssparams.ssid.ssid,
adapter->curbssparams.ssid.ssidlength); adapter->curbssparams.ssid.ssidlength);
lbs_pr_debug(1, "Previous SSID=%s, ssid length=%u\n", lbs_deb_cmd("Previous SSID=%s, ssid length=%u\n",
adapter->previousssid.ssid, adapter->previousssid.ssidlength); adapter->previousssid.ssid, adapter->previousssid.ssidlength);
/* reset internal flags */ /* reset internal flags */
...@@ -90,7 +90,7 @@ void libertas_mac_event_disconnected(wlan_private * priv) ...@@ -90,7 +90,7 @@ void libertas_mac_event_disconnected(wlan_private * priv)
if (adapter->psstate != PS_STATE_FULL_POWER) { if (adapter->psstate != PS_STATE_FULL_POWER) {
/* make firmware to exit PS mode */ /* make firmware to exit PS mode */
lbs_pr_debug(1, "Disconnected, so exit PS mode.\n"); lbs_deb_cmd("Disconnected, so exit PS mode.\n");
libertas_ps_wakeup(priv, 0); libertas_ps_wakeup(priv, 0);
} }
} }
...@@ -122,9 +122,10 @@ static void handle_mic_failureevent(wlan_private * priv, u32 event) ...@@ -122,9 +122,10 @@ static void handle_mic_failureevent(wlan_private * priv, u32 event)
static int wlan_ret_reg_access(wlan_private * priv, static int wlan_ret_reg_access(wlan_private * priv,
u16 type, struct cmd_ds_command *resp) u16 type, struct cmd_ds_command *resp)
{ {
int ret = 0;
wlan_adapter *adapter = priv->adapter; wlan_adapter *adapter = priv->adapter;
ENTER(); lbs_deb_enter(LBS_DEB_CMD);
switch (type) { switch (type) {
case cmd_ret_mac_reg_access: case cmd_ret_mac_reg_access:
...@@ -165,12 +166,11 @@ static int wlan_ret_reg_access(wlan_private * priv, ...@@ -165,12 +166,11 @@ static int wlan_ret_reg_access(wlan_private * priv,
} }
default: default:
LEAVE(); ret = -1;
return -1;
} }
LEAVE(); lbs_deb_enter_args(LBS_DEB_CMD, "ret %d", ret);
return 0; return ret;
} }
static int wlan_ret_get_hw_spec(wlan_private * priv, static int wlan_ret_get_hw_spec(wlan_private * priv,
...@@ -181,19 +181,19 @@ static int wlan_ret_get_hw_spec(wlan_private * priv, ...@@ -181,19 +181,19 @@ static int wlan_ret_get_hw_spec(wlan_private * priv,
wlan_adapter *adapter = priv->adapter; wlan_adapter *adapter = priv->adapter;
int ret = 0; int ret = 0;
ENTER(); lbs_deb_enter(LBS_DEB_CMD);
adapter->fwcapinfo = le32_to_cpu(hwspec->fwcapinfo); adapter->fwcapinfo = le32_to_cpu(hwspec->fwcapinfo);
adapter->fwreleasenumber = hwspec->fwreleasenumber; adapter->fwreleasenumber = hwspec->fwreleasenumber;
lbs_pr_debug(1, "GET_HW_SPEC: FWReleaseVersion- 0x%X\n", lbs_deb_cmd("GET_HW_SPEC: FWReleaseVersion- 0x%X\n",
adapter->fwreleasenumber); adapter->fwreleasenumber);
lbs_pr_debug(1, "GET_HW_SPEC: Permanent addr- %2x:%2x:%2x:%2x:%2x:%2x\n", lbs_deb_cmd("GET_HW_SPEC: Permanent addr- %2x:%2x:%2x:%2x:%2x:%2x\n",
hwspec->permanentaddr[0], hwspec->permanentaddr[1], hwspec->permanentaddr[0], hwspec->permanentaddr[1],
hwspec->permanentaddr[2], hwspec->permanentaddr[3], hwspec->permanentaddr[2], hwspec->permanentaddr[3],
hwspec->permanentaddr[4], hwspec->permanentaddr[5]); hwspec->permanentaddr[4], hwspec->permanentaddr[5]);
lbs_pr_debug(1, "GET_HW_SPEC: hwifversion=0x%X version=0x%X\n", lbs_deb_cmd("GET_HW_SPEC: hwifversion=0x%X version=0x%X\n",
hwspec->hwifversion, hwspec->version); hwspec->hwifversion, hwspec->version);
adapter->regioncode = le16_to_cpu(hwspec->regioncode); adapter->regioncode = le16_to_cpu(hwspec->regioncode);
...@@ -232,8 +232,8 @@ static int wlan_ret_get_hw_spec(wlan_private * priv, ...@@ -232,8 +232,8 @@ static int wlan_ret_get_hw_spec(wlan_private * priv,
goto done; goto done;
} }
done: done:
LEAVE(); lbs_deb_enter_args(LBS_DEB_CMD, "ret %d", ret);
return ret; return ret;
} }
...@@ -243,9 +243,9 @@ static int wlan_ret_802_11_sleep_params(wlan_private * priv, ...@@ -243,9 +243,9 @@ static int wlan_ret_802_11_sleep_params(wlan_private * priv,
struct cmd_ds_802_11_sleep_params *sp = &resp->params.sleep_params; struct cmd_ds_802_11_sleep_params *sp = &resp->params.sleep_params;
wlan_adapter *adapter = priv->adapter; wlan_adapter *adapter = priv->adapter;
ENTER(); lbs_deb_enter(LBS_DEB_CMD);
lbs_pr_debug(1, "error=%x offset=%x stabletime=%x calcontrol=%x\n" lbs_deb_cmd("error=%x offset=%x stabletime=%x calcontrol=%x\n"
" extsleepclk=%x\n", sp->error, sp->offset, " extsleepclk=%x\n", sp->error, sp->offset,
sp->stabletime, sp->calcontrol, sp->externalsleepclk); sp->stabletime, sp->calcontrol, sp->externalsleepclk);
adapter->sp.sp_error = le16_to_cpu(sp->error); adapter->sp.sp_error = le16_to_cpu(sp->error);
...@@ -255,7 +255,7 @@ static int wlan_ret_802_11_sleep_params(wlan_private * priv, ...@@ -255,7 +255,7 @@ static int wlan_ret_802_11_sleep_params(wlan_private * priv,
adapter->sp.sp_extsleepclk = le16_to_cpu(sp->externalsleepclk); adapter->sp.sp_extsleepclk = le16_to_cpu(sp->externalsleepclk);
adapter->sp.sp_reserved = le16_to_cpu(sp->reserved); adapter->sp.sp_reserved = le16_to_cpu(sp->reserved);
LEAVE(); lbs_deb_enter(LBS_DEB_CMD);
return 0; return 0;
} }
...@@ -281,11 +281,11 @@ static int wlan_ret_802_11_snmp_mib(wlan_private * priv, ...@@ -281,11 +281,11 @@ static int wlan_ret_802_11_snmp_mib(wlan_private * priv,
u16 oid = le16_to_cpu(smib->oid); u16 oid = le16_to_cpu(smib->oid);
u16 querytype = le16_to_cpu(smib->querytype); u16 querytype = le16_to_cpu(smib->querytype);
ENTER(); lbs_deb_enter(LBS_DEB_CMD);
lbs_pr_debug(1, "SNMP_RESP: value of the oid = %x, querytype=%x\n", oid, lbs_deb_cmd("SNMP_RESP: value of the oid = %x, querytype=%x\n", oid,
querytype); querytype);
lbs_pr_debug(1, "SNMP_RESP: Buf size = %x\n", lbs_deb_cmd("SNMP_RESP: Buf size = %x\n",
le16_to_cpu(smib->bufsize)); le16_to_cpu(smib->bufsize));
if (querytype == cmd_act_get) { if (querytype == cmd_act_get) {
...@@ -294,21 +294,21 @@ static int wlan_ret_802_11_snmp_mib(wlan_private * priv, ...@@ -294,21 +294,21 @@ static int wlan_ret_802_11_snmp_mib(wlan_private * priv,
priv->adapter->fragthsd = priv->adapter->fragthsd =
le16_to_cpu(* le16_to_cpu(*
((unsigned short *)(smib->value))); ((unsigned short *)(smib->value)));
lbs_pr_debug(1, "SNMP_RESP: fragthsd =%u\n", lbs_deb_cmd("SNMP_RESP: fragthsd =%u\n",
priv->adapter->fragthsd); priv->adapter->fragthsd);
break; break;
case rtsthresh_i: case rtsthresh_i:
priv->adapter->rtsthsd = priv->adapter->rtsthsd =
le16_to_cpu(* le16_to_cpu(*
((unsigned short *)(smib->value))); ((unsigned short *)(smib->value)));
lbs_pr_debug(1, "SNMP_RESP: rtsthsd =%u\n", lbs_deb_cmd("SNMP_RESP: rtsthsd =%u\n",
priv->adapter->rtsthsd); priv->adapter->rtsthsd);
break; break;
case short_retrylim_i: case short_retrylim_i:
priv->adapter->txretrycount = priv->adapter->txretrycount =
le16_to_cpu(* le16_to_cpu(*
((unsigned short *)(smib->value))); ((unsigned short *)(smib->value)));
lbs_pr_debug(1, "SNMP_RESP: txretrycount =%u\n", lbs_deb_cmd("SNMP_RESP: txretrycount =%u\n",
priv->adapter->rtsthsd); priv->adapter->rtsthsd);
break; break;
default: default:
...@@ -316,7 +316,7 @@ static int wlan_ret_802_11_snmp_mib(wlan_private * priv, ...@@ -316,7 +316,7 @@ static int wlan_ret_802_11_snmp_mib(wlan_private * priv,
} }
} }
LEAVE(); lbs_deb_enter(LBS_DEB_CMD);
return 0; return 0;
} }
...@@ -328,7 +328,7 @@ static int wlan_ret_802_11_key_material(wlan_private * priv, ...@@ -328,7 +328,7 @@ static int wlan_ret_802_11_key_material(wlan_private * priv,
wlan_adapter *adapter = priv->adapter; wlan_adapter *adapter = priv->adapter;
u16 action = le16_to_cpu(pkeymaterial->action); u16 action = le16_to_cpu(pkeymaterial->action);
ENTER(); lbs_deb_enter(LBS_DEB_CMD);
/* Copy the returned key to driver private data */ /* Copy the returned key to driver private data */
if (action == cmd_act_get) { if (action == cmd_act_get) {
...@@ -371,7 +371,7 @@ static int wlan_ret_802_11_key_material(wlan_private * priv, ...@@ -371,7 +371,7 @@ static int wlan_ret_802_11_key_material(wlan_private * priv,
} }
} }
LEAVE(); lbs_deb_enter(LBS_DEB_CMD);
return 0; return 0;
} }
...@@ -381,11 +381,11 @@ static int wlan_ret_802_11_mac_address(wlan_private * priv, ...@@ -381,11 +381,11 @@ static int wlan_ret_802_11_mac_address(wlan_private * priv,
struct cmd_ds_802_11_mac_address *macadd = &resp->params.macadd; struct cmd_ds_802_11_mac_address *macadd = &resp->params.macadd;
wlan_adapter *adapter = priv->adapter; wlan_adapter *adapter = priv->adapter;
ENTER(); lbs_deb_enter(LBS_DEB_CMD);
memcpy(adapter->current_addr, macadd->macadd, ETH_ALEN); memcpy(adapter->current_addr, macadd->macadd, ETH_ALEN);
LEAVE(); lbs_deb_enter(LBS_DEB_CMD);
return 0; return 0;
} }
...@@ -395,13 +395,13 @@ static int wlan_ret_802_11_rf_tx_power(wlan_private * priv, ...@@ -395,13 +395,13 @@ static int wlan_ret_802_11_rf_tx_power(wlan_private * priv,
struct cmd_ds_802_11_rf_tx_power *rtp = &resp->params.txp; struct cmd_ds_802_11_rf_tx_power *rtp = &resp->params.txp;
wlan_adapter *adapter = priv->adapter; wlan_adapter *adapter = priv->adapter;
ENTER(); lbs_deb_enter(LBS_DEB_CMD);
adapter->txpowerlevel = le16_to_cpu(rtp->currentlevel); adapter->txpowerlevel = le16_to_cpu(rtp->currentlevel);
lbs_pr_debug(1, "Current TxPower Level = %d\n", adapter->txpowerlevel); lbs_deb_cmd("Current TxPower Level = %d\n", adapter->txpowerlevel);
LEAVE(); lbs_deb_enter(LBS_DEB_CMD);
return 0; return 0;
} }
...@@ -420,7 +420,7 @@ static int wlan_ret_802_11_rf_antenna(wlan_private * priv, ...@@ -420,7 +420,7 @@ static int wlan_ret_802_11_rf_antenna(wlan_private * priv,
adapter->txantennamode = adapter->txantennamode =
le16_to_cpu(pAntenna->antennamode); le16_to_cpu(pAntenna->antennamode);
lbs_pr_debug(1, "RF_ANT_RESP: action = 0x%x, mode = 0x%04x\n", lbs_deb_cmd("RF_ANT_RESP: action = 0x%x, mode = 0x%04x\n",
action, le16_to_cpu(pAntenna->antennamode)); action, le16_to_cpu(pAntenna->antennamode));
return 0; return 0;
...@@ -433,15 +433,14 @@ static int wlan_ret_802_11_rate_adapt_rateset(wlan_private * priv, ...@@ -433,15 +433,14 @@ static int wlan_ret_802_11_rate_adapt_rateset(wlan_private * priv,
&resp->params.rateset; &resp->params.rateset;
wlan_adapter *adapter = priv->adapter; wlan_adapter *adapter = priv->adapter;
ENTER(); lbs_deb_enter(LBS_DEB_CMD);
if (rates->action == cmd_act_get) { if (rates->action == cmd_act_get) {
adapter->enablehwauto = rates->enablehwauto; adapter->enablehwauto = rates->enablehwauto;
adapter->ratebitmap = rates->bitmap; adapter->ratebitmap = rates->bitmap;
} }
LEAVE(); lbs_deb_enter(LBS_DEB_CMD);
return 0; return 0;
} }
...@@ -452,7 +451,7 @@ static int wlan_ret_802_11_data_rate(wlan_private * priv, ...@@ -452,7 +451,7 @@ static int wlan_ret_802_11_data_rate(wlan_private * priv,
wlan_adapter *adapter = priv->adapter; wlan_adapter *adapter = priv->adapter;
u8 dot11datarate; u8 dot11datarate;
ENTER(); lbs_deb_enter(LBS_DEB_CMD);
lbs_dbg_hex("DATA_RATE_RESP: data_rate- ", lbs_dbg_hex("DATA_RATE_RESP: data_rate- ",
(u8 *) pdatarate, sizeof(struct cmd_ds_802_11_data_rate)); (u8 *) pdatarate, sizeof(struct cmd_ds_802_11_data_rate));
...@@ -464,7 +463,7 @@ static int wlan_ret_802_11_data_rate(wlan_private * priv, ...@@ -464,7 +463,7 @@ static int wlan_ret_802_11_data_rate(wlan_private * priv,
} }
adapter->datarate = libertas_index_to_data_rate(dot11datarate); adapter->datarate = libertas_index_to_data_rate(dot11datarate);
LEAVE(); lbs_deb_enter(LBS_DEB_CMD);
return 0; return 0;
} }
...@@ -477,18 +476,18 @@ static int wlan_ret_802_11_rf_channel(wlan_private * priv, ...@@ -477,18 +476,18 @@ static int wlan_ret_802_11_rf_channel(wlan_private * priv,
u16 action = le16_to_cpu(rfchannel->action); u16 action = le16_to_cpu(rfchannel->action);
u16 newchannel = le16_to_cpu(rfchannel->currentchannel); u16 newchannel = le16_to_cpu(rfchannel->currentchannel);
ENTER(); lbs_deb_enter(LBS_DEB_CMD);
if (action == cmd_opt_802_11_rf_channel_get if (action == cmd_opt_802_11_rf_channel_get
&& adapter->curbssparams.channel != newchannel) { && adapter->curbssparams.channel != newchannel) {
lbs_pr_debug(1, "channel Switch: %d to %d\n", lbs_deb_cmd("channel Switch: %d to %d\n",
adapter->curbssparams.channel, newchannel); adapter->curbssparams.channel, newchannel);
/* Update the channel again */ /* Update the channel again */
adapter->curbssparams.channel = newchannel; adapter->curbssparams.channel = newchannel;
} }
LEAVE(); lbs_deb_enter(LBS_DEB_CMD);
return 0; return 0;
} }
...@@ -515,7 +514,7 @@ static int wlan_ret_802_11_rssi(wlan_private * priv, ...@@ -515,7 +514,7 @@ static int wlan_ret_802_11_rssi(wlan_private * priv,
CAL_RSSI(adapter->SNR[TYPE_BEACON][TYPE_AVG] / AVG_SCALE, CAL_RSSI(adapter->SNR[TYPE_BEACON][TYPE_AVG] / AVG_SCALE,
adapter->NF[TYPE_BEACON][TYPE_AVG] / AVG_SCALE); adapter->NF[TYPE_BEACON][TYPE_AVG] / AVG_SCALE);
lbs_pr_debug(1, "Beacon RSSI value = 0x%x\n", lbs_deb_cmd("Beacon RSSI value = 0x%x\n",
adapter->RSSI[TYPE_BEACON][TYPE_AVG]); adapter->RSSI[TYPE_BEACON][TYPE_AVG]);
return 0; return 0;
...@@ -528,11 +527,11 @@ static int wlan_ret_802_11_eeprom_access(wlan_private * priv, ...@@ -528,11 +527,11 @@ static int wlan_ret_802_11_eeprom_access(wlan_private * priv,
struct wlan_ioctl_regrdwr *pbuf; struct wlan_ioctl_regrdwr *pbuf;
pbuf = (struct wlan_ioctl_regrdwr *) adapter->prdeeprom; pbuf = (struct wlan_ioctl_regrdwr *) adapter->prdeeprom;
lbs_pr_debug(1, "eeprom read len=%x\n", lbs_deb_cmd("eeprom read len=%x\n",
le16_to_cpu(resp->params.rdeeprom.bytecount)); le16_to_cpu(resp->params.rdeeprom.bytecount));
if (pbuf->NOB < le16_to_cpu(resp->params.rdeeprom.bytecount)) { if (pbuf->NOB < le16_to_cpu(resp->params.rdeeprom.bytecount)) {
pbuf->NOB = 0; pbuf->NOB = 0;
lbs_pr_debug(1, "eeprom read return length is too big\n"); lbs_deb_cmd("eeprom read return length is too big\n");
return -1; return -1;
} }
pbuf->NOB = le16_to_cpu(resp->params.rdeeprom.bytecount); pbuf->NOB = le16_to_cpu(resp->params.rdeeprom.bytecount);
...@@ -553,13 +552,13 @@ static int wlan_ret_get_log(wlan_private * priv, ...@@ -553,13 +552,13 @@ static int wlan_ret_get_log(wlan_private * priv,
(struct cmd_ds_802_11_get_log *)&resp->params.glog; (struct cmd_ds_802_11_get_log *)&resp->params.glog;
wlan_adapter *adapter = priv->adapter; wlan_adapter *adapter = priv->adapter;
ENTER(); lbs_deb_enter(LBS_DEB_CMD);
/* TODO Convert it to Big Endian before copy */ /* TODO Convert it to Big Endian before copy */
memcpy(&adapter->logmsg, logmessage, memcpy(&adapter->logmsg, logmessage,
sizeof(struct cmd_ds_802_11_get_log)); sizeof(struct cmd_ds_802_11_get_log));
LEAVE(); lbs_deb_enter(LBS_DEB_CMD);
return 0; return 0;
} }
...@@ -663,7 +662,7 @@ static inline int handle_cmd_response(u16 respcmd, ...@@ -663,7 +662,7 @@ static inline int handle_cmd_response(u16 respcmd,
break; break;
case cmd_ret_802_11_key_material: case cmd_ret_802_11_key_material:
lbs_pr_debug(1, "CMD_RESP: KEY_MATERIAL command response\n"); lbs_deb_cmd("CMD_RESP: KEY_MATERIAL command response\n");
ret = wlan_ret_802_11_key_material(priv, resp); ret = wlan_ret_802_11_key_material(priv, resp);
break; break;
...@@ -739,7 +738,7 @@ static inline int handle_cmd_response(u16 respcmd, ...@@ -739,7 +738,7 @@ static inline int handle_cmd_response(u16 respcmd,
priv->adapter->txrate = resp->params.txrate.txrate; priv->adapter->txrate = resp->params.txrate.txrate;
break; break;
default: default:
lbs_pr_debug(1, "CMD_RESP: Unknown command response %#x\n", lbs_deb_cmd("CMD_RESP: Unknown command response %#x\n",
resp->command); resp->command);
break; break;
} }
...@@ -755,9 +754,9 @@ int libertas_process_rx_command(wlan_private * priv) ...@@ -755,9 +754,9 @@ int libertas_process_rx_command(wlan_private * priv)
ulong flags; ulong flags;
u16 result; u16 result;
ENTER(); lbs_deb_enter(LBS_DEB_CMD);
lbs_pr_debug(1, "CMD_RESP: @ %lu\n", jiffies); lbs_deb_cmd("CMD_RESP: @ %lu\n", jiffies);
/* Now we got response from FW, cancel the command timer */ /* Now we got response from FW, cancel the command timer */
del_timer(&adapter->command_timer); del_timer(&adapter->command_timer);
...@@ -766,7 +765,7 @@ int libertas_process_rx_command(wlan_private * priv) ...@@ -766,7 +765,7 @@ int libertas_process_rx_command(wlan_private * priv)
spin_lock_irqsave(&adapter->driver_lock, flags); spin_lock_irqsave(&adapter->driver_lock, flags);
if (!adapter->cur_cmd) { if (!adapter->cur_cmd) {
lbs_pr_debug(1, "CMD_RESP: NULL cur_cmd=%p\n", adapter->cur_cmd); lbs_deb_cmd("CMD_RESP: NULL cur_cmd=%p\n", adapter->cur_cmd);
ret = -1; ret = -1;
spin_unlock_irqrestore(&adapter->driver_lock, flags); spin_unlock_irqrestore(&adapter->driver_lock, flags);
goto done; goto done;
...@@ -780,11 +779,11 @@ int libertas_process_rx_command(wlan_private * priv) ...@@ -780,11 +779,11 @@ int libertas_process_rx_command(wlan_private * priv)
result = le16_to_cpu(resp->result); result = le16_to_cpu(resp->result);
lbs_pr_debug(1, "CMD_RESP: %x result: %d length: %d\n", respcmd, lbs_deb_cmd("CMD_RESP: %x result: %d length: %d\n", respcmd,
result, priv->wlan_dev.upld_len); result, priv->wlan_dev.upld_len);
if (!(respcmd & 0x8000)) { if (!(respcmd & 0x8000)) {
lbs_pr_debug(1, "Invalid response to command!"); lbs_deb_cmd("Invalid response to command!");
adapter->cur_cmd_retcode = -1; adapter->cur_cmd_retcode = -1;
__libertas_cleanup_and_insert_cmd(priv, adapter->cur_cmd); __libertas_cleanup_and_insert_cmd(priv, adapter->cur_cmd);
adapter->nr_cmd_pending--; adapter->nr_cmd_pending--;
...@@ -801,13 +800,13 @@ int libertas_process_rx_command(wlan_private * priv) ...@@ -801,13 +800,13 @@ int libertas_process_rx_command(wlan_private * priv)
struct cmd_ds_802_11_ps_mode *psmode; struct cmd_ds_802_11_ps_mode *psmode;
psmode = &resp->params.psmode; psmode = &resp->params.psmode;
lbs_pr_debug(1, lbs_deb_cmd(
"CMD_RESP: PS_MODE cmd reply result=%#x action=0x%X\n", "CMD_RESP: PS_MODE cmd reply result=%#x action=0x%X\n",
resp->result, psmode->action); resp->result, psmode->action);
psmode->action = cpu_to_le16(psmode->action); psmode->action = cpu_to_le16(psmode->action);
if (result) { if (result) {
lbs_pr_debug(1, "CMD_RESP: PS command failed- %#x \n", lbs_deb_cmd("CMD_RESP: PS command failed- %#x \n",
resp->result); resp->result);
if (adapter->mode == IW_MODE_ADHOC) { if (adapter->mode == IW_MODE_ADHOC) {
/* /*
...@@ -823,13 +822,13 @@ int libertas_process_rx_command(wlan_private * priv) ...@@ -823,13 +822,13 @@ int libertas_process_rx_command(wlan_private * priv)
adapter->needtowakeup = 0; adapter->needtowakeup = 0;
adapter->psstate = PS_STATE_AWAKE; adapter->psstate = PS_STATE_AWAKE;
lbs_pr_debug(1, "CMD_RESP: Enter_PS command response\n"); lbs_deb_cmd("CMD_RESP: Enter_PS command response\n");
if (adapter->connect_status != libertas_connected) { if (adapter->connect_status != libertas_connected) {
/* /*
* When Deauth Event received before Enter_PS command * When Deauth Event received before Enter_PS command
* response, We need to wake up the firmware. * response, We need to wake up the firmware.
*/ */
lbs_pr_debug(1, lbs_deb_cmd(
"Disconnected, Going to invoke libertas_ps_wakeup\n"); "Disconnected, Going to invoke libertas_ps_wakeup\n");
mutex_unlock(&adapter->lock); mutex_unlock(&adapter->lock);
...@@ -841,9 +840,9 @@ int libertas_process_rx_command(wlan_private * priv) ...@@ -841,9 +840,9 @@ int libertas_process_rx_command(wlan_private * priv)
} else if (psmode->action == cmd_subcmd_exit_ps) { } else if (psmode->action == cmd_subcmd_exit_ps) {
adapter->needtowakeup = 0; adapter->needtowakeup = 0;
adapter->psstate = PS_STATE_FULL_POWER; adapter->psstate = PS_STATE_FULL_POWER;
lbs_pr_debug(1, "CMD_RESP: Exit_PS command response\n"); lbs_deb_cmd("CMD_RESP: Exit_PS command response\n");
} else { } else {
lbs_pr_debug(1, "CMD_RESP: PS- action=0x%X\n", lbs_deb_cmd("CMD_RESP: PS- action=0x%X\n",
psmode->action); psmode->action);
} }
...@@ -865,7 +864,7 @@ int libertas_process_rx_command(wlan_private * priv) ...@@ -865,7 +864,7 @@ int libertas_process_rx_command(wlan_private * priv)
/* If the command is not successful, cleanup and return failure */ /* If the command is not successful, cleanup and return failure */
if ((result != 0 || !(respcmd & 0x8000))) { if ((result != 0 || !(respcmd & 0x8000))) {
lbs_pr_debug(1, "CMD_RESP: command reply %#x result=%#x\n", lbs_deb_cmd("CMD_RESP: command reply %#x result=%#x\n",
resp->command, resp->result); resp->command, resp->result);
/* /*
* Handling errors here * Handling errors here
...@@ -873,7 +872,7 @@ int libertas_process_rx_command(wlan_private * priv) ...@@ -873,7 +872,7 @@ int libertas_process_rx_command(wlan_private * priv)
switch (respcmd) { switch (respcmd) {
case cmd_ret_hw_spec_info: case cmd_ret_hw_spec_info:
case cmd_ret_802_11_reset: case cmd_ret_802_11_reset:
lbs_pr_debug(1, "CMD_RESP: Reset command failed\n"); lbs_deb_cmd("CMD_RESP: Reset command failed\n");
break; break;
} }
...@@ -903,7 +902,7 @@ int libertas_process_rx_command(wlan_private * priv) ...@@ -903,7 +902,7 @@ int libertas_process_rx_command(wlan_private * priv)
done: done:
mutex_unlock(&adapter->lock); mutex_unlock(&adapter->lock);
LEAVE(); lbs_deb_enter_args(LBS_DEB_CMD, "ret %d", ret);
return ret; return ret;
} }
...@@ -917,37 +916,37 @@ int libertas_process_event(wlan_private * priv) ...@@ -917,37 +916,37 @@ int libertas_process_event(wlan_private * priv)
eventcause = adapter->eventcause; eventcause = adapter->eventcause;
spin_unlock_irq(&adapter->driver_lock); spin_unlock_irq(&adapter->driver_lock);
ENTER(); lbs_deb_enter(LBS_DEB_CMD);
lbs_pr_debug(1, "EVENT Cause %x\n", eventcause); lbs_deb_cmd("EVENT Cause %x\n", eventcause);
switch (eventcause >> SBI_EVENT_CAUSE_SHIFT) { switch (eventcause >> SBI_EVENT_CAUSE_SHIFT) {
case MACREG_INT_CODE_LINK_SENSED: case MACREG_INT_CODE_LINK_SENSED:
lbs_pr_debug(1, "EVENT: MACREG_INT_CODE_LINK_SENSED\n"); lbs_deb_cmd("EVENT: MACREG_INT_CODE_LINK_SENSED\n");
break; break;
case MACREG_INT_CODE_DEAUTHENTICATED: case MACREG_INT_CODE_DEAUTHENTICATED:
lbs_pr_debug(1, "EVENT: Deauthenticated\n"); lbs_deb_cmd("EVENT: Deauthenticated\n");
libertas_mac_event_disconnected(priv); libertas_mac_event_disconnected(priv);
break; break;
case MACREG_INT_CODE_DISASSOCIATED: case MACREG_INT_CODE_DISASSOCIATED:
lbs_pr_debug(1, "EVENT: Disassociated\n"); lbs_deb_cmd("EVENT: Disassociated\n");
libertas_mac_event_disconnected(priv); libertas_mac_event_disconnected(priv);
break; break;
case MACREG_INT_CODE_LINK_LOSE_NO_SCAN: case MACREG_INT_CODE_LINK_LOSE_NO_SCAN:
lbs_pr_debug(1, "EVENT: Link lost\n"); lbs_deb_cmd("EVENT: Link lost\n");
libertas_mac_event_disconnected(priv); libertas_mac_event_disconnected(priv);
break; break;
case MACREG_INT_CODE_PS_SLEEP: case MACREG_INT_CODE_PS_SLEEP:
lbs_pr_debug(1, "EVENT: SLEEP\n"); lbs_deb_cmd("EVENT: SLEEP\n");
lbs_pr_debug(1, "_"); lbs_deb_cmd("_");
/* handle unexpected PS SLEEP event */ /* handle unexpected PS SLEEP event */
if (adapter->psstate == PS_STATE_FULL_POWER) { if (adapter->psstate == PS_STATE_FULL_POWER) {
lbs_pr_debug(1, lbs_deb_cmd(
"EVENT: In FULL POWER mode - ignore PS SLEEP\n"); "EVENT: In FULL POWER mode - ignore PS SLEEP\n");
break; break;
} }
...@@ -958,12 +957,12 @@ int libertas_process_event(wlan_private * priv) ...@@ -958,12 +957,12 @@ int libertas_process_event(wlan_private * priv)
break; break;
case MACREG_INT_CODE_PS_AWAKE: case MACREG_INT_CODE_PS_AWAKE:
lbs_pr_debug(1, "EVENT: AWAKE \n"); lbs_deb_cmd("EVENT: AWAKE \n");
lbs_pr_debug(1, "|"); lbs_deb_cmd("|");
/* handle unexpected PS AWAKE event */ /* handle unexpected PS AWAKE event */
if (adapter->psstate == PS_STATE_FULL_POWER) { if (adapter->psstate == PS_STATE_FULL_POWER) {
lbs_pr_debug(1, lbs_deb_cmd(
"EVENT: In FULL POWER mode - ignore PS AWAKE\n"); "EVENT: In FULL POWER mode - ignore PS AWAKE\n");
break; break;
} }
...@@ -977,18 +976,18 @@ int libertas_process_event(wlan_private * priv) ...@@ -977,18 +976,18 @@ int libertas_process_event(wlan_private * priv)
* adapter->needtowakeup will be set to FALSE * adapter->needtowakeup will be set to FALSE
* in libertas_ps_wakeup() * in libertas_ps_wakeup()
*/ */
lbs_pr_debug(1, "Waking up...\n"); lbs_deb_cmd("Waking up...\n");
libertas_ps_wakeup(priv, 0); libertas_ps_wakeup(priv, 0);
} }
break; break;
case MACREG_INT_CODE_MIC_ERR_UNICAST: case MACREG_INT_CODE_MIC_ERR_UNICAST:
lbs_pr_debug(1, "EVENT: UNICAST MIC ERROR\n"); lbs_deb_cmd("EVENT: UNICAST MIC ERROR\n");
handle_mic_failureevent(priv, MACREG_INT_CODE_MIC_ERR_UNICAST); handle_mic_failureevent(priv, MACREG_INT_CODE_MIC_ERR_UNICAST);
break; break;
case MACREG_INT_CODE_MIC_ERR_MULTICAST: case MACREG_INT_CODE_MIC_ERR_MULTICAST:
lbs_pr_debug(1, "EVENT: MULTICAST MIC ERROR\n"); lbs_deb_cmd("EVENT: MULTICAST MIC ERROR\n");
handle_mic_failureevent(priv, MACREG_INT_CODE_MIC_ERR_MULTICAST); handle_mic_failureevent(priv, MACREG_INT_CODE_MIC_ERR_MULTICAST);
break; break;
case MACREG_INT_CODE_MIB_CHANGED: case MACREG_INT_CODE_MIB_CHANGED:
...@@ -996,7 +995,7 @@ int libertas_process_event(wlan_private * priv) ...@@ -996,7 +995,7 @@ int libertas_process_event(wlan_private * priv)
break; break;
case MACREG_INT_CODE_ADHOC_BCN_LOST: case MACREG_INT_CODE_ADHOC_BCN_LOST:
lbs_pr_debug(1, "EVENT: HWAC - ADHOC BCN LOST\n"); lbs_deb_cmd("EVENT: HWAC - ADHOC BCN LOST\n");
break; break;
case MACREG_INT_CODE_RSSI_LOW: case MACREG_INT_CODE_RSSI_LOW:
...@@ -1024,6 +1023,7 @@ int libertas_process_event(wlan_private * priv) ...@@ -1024,6 +1023,7 @@ int libertas_process_event(wlan_private * priv)
spin_lock_irq(&adapter->driver_lock); spin_lock_irq(&adapter->driver_lock);
adapter->eventcause = 0; adapter->eventcause = 0;
spin_unlock_irq(&adapter->driver_lock); spin_unlock_irq(&adapter->driver_lock);
LEAVE();
lbs_deb_enter_args(LBS_DEB_CMD, "ret %d", ret);
return ret; return ret;
} }
...@@ -402,11 +402,11 @@ static int libertas_event_initcmd(wlan_private *priv, void **response_buf, ...@@ -402,11 +402,11 @@ static int libertas_event_initcmd(wlan_private *priv, void **response_buf,
u16 wait_option = cmd_option_waitforrsp; u16 wait_option = cmd_option_waitforrsp;
if (!(*cmdnode = libertas_get_free_cmd_ctrl_node(priv))) { if (!(*cmdnode = libertas_get_free_cmd_ctrl_node(priv))) {
lbs_pr_debug(1, "failed libertas_get_free_cmd_ctrl_node\n"); lbs_deb_debugfs("failed libertas_get_free_cmd_ctrl_node\n");
return -ENOMEM; return -ENOMEM;
} }
if (!(*response_buf = kmalloc(3000, GFP_KERNEL))) { if (!(*response_buf = kmalloc(3000, GFP_KERNEL))) {
lbs_pr_debug(1, "failed to allocate response buffer!\n"); lbs_deb_debugfs("failed to allocate response buffer!\n");
return -ENOMEM; return -ENOMEM;
} }
libertas_set_cmd_ctrl_node(priv, *cmdnode, 0, wait_option, NULL); libertas_set_cmd_ctrl_node(priv, *cmdnode, 0, wait_option, NULL);
...@@ -1864,7 +1864,7 @@ static ssize_t wlan_debugfs_write(struct file *f, const char __user *buf, ...@@ -1864,7 +1864,7 @@ static ssize_t wlan_debugfs_write(struct file *f, const char __user *buf,
return 0; return 0;
if (copy_from_user(pdata, buf, cnt)) { if (copy_from_user(pdata, buf, cnt)) {
lbs_pr_debug(1, "Copy from user failed\n"); lbs_deb_debugfs("Copy from user failed\n");
kfree(pdata); kfree(pdata);
return 0; return 0;
} }
......
...@@ -7,14 +7,77 @@ ...@@ -7,14 +7,77 @@
#include <linux/spinlock.h> #include <linux/spinlock.h>
extern unsigned int libertas_debug;
#ifdef CONFIG_LIBERTAS_DEBUG #ifdef CONFIG_LIBERTAS_DEBUG
#define DEBUG #define DEBUG
#define PROC_DEBUG #define PROC_DEBUG
#endif #endif
#define DRV_NAME "usb8xxx" #define DRV_NAME "usb8xxx"
#define LBS_DEB_ENTER (1<<0)
#define LBS_DEB_LEAVE (1<<1)
#define LBS_DEB_MAIN (1<<2)
#define LBS_DEB_NET (1<<3)
#define LBS_DEB_MESH (1<<4)
#define LBS_DEB_WEXT (1<<5)
#define LBS_DEB_IOCTL (1<<6)
#define LBS_DEB_SCAN (1<<7)
#define LBS_DEB_ASSOC (1<<8)
#define LBS_DEB_JOIN (1<<9)
#define LBS_DEB_11D (1<<10)
#define LBS_DEB_DEBUGFS (1<<11)
#define LBS_DEB_ETHTOOL (1<<12)
#define LBS_DEB_HOST (1<<13)
#define LBS_DEB_CMD (1<<14)
#define LBS_DEB_RX (1<<15)
#define LBS_DEB_TX (1<<16)
#define LBS_DEB_FW (1<<17)
#define LBS_DEB_USB (1<<18)
#define LBS_DEB_CS (1<<19)
#define LBS_DEB_THREAD (1<<20)
#define LBS_DEB_HEX (1<<21)
extern unsigned int libertas_debug_flags;
#ifdef DEBUG
#define LBS_DEB_LL(grp, fmt, args...) \
do { if ((libertas_debug_flags & (grp)) == (grp)) \
printk(KERN_DEBUG DRV_NAME "%s: " fmt, \
in_interrupt() ? " (INT)" : "", ## args); } while (0)
#else
#define LBS_DEB_LL(grp, fmt, args...) do {} while (0)
#endif
#define lbs_deb_enter(grp) \
LBS_DEB_LL(grp | LBS_DEB_ENTER, "%s() %d enter\n", __FUNCTION__, __LINE__);
#define lbs_deb_enter_args(grp, fmt, args...) \
LBS_DEB_LL(grp | LBS_DEB_ENTER, "%s(" fmt "):%d\n", __FUNCTION__, ## args, __LINE__);
#define lbs_deb_leave(grp) \
LBS_DEB_LL(grp | LBS_DEB_LEAVE, "%s():%d leave\n", __FUNCTION__, __LINE__);
#define lbs_deb_leave_args(grp, fmt, args...) \
LBS_DEB_LL(grp | LBS_DEB_LEAVE, "%s():%d leave, " fmt "\n", \
__FUNCTION__, __LINE__, ##args);
#define lbs_deb_main(fmt, args...) LBS_DEB_LL(LBS_DEB_MAIN, fmt, ##args)
#define lbs_deb_net(fmt, args...) LBS_DEB_LL(LBS_DEB_NET, fmt, ##args)
#define lbs_deb_mesh(fmt, args...) LBS_DEB_LL(LBS_DEB_MESH, fmt, ##args)
#define lbs_deb_wext(fmt, args...) LBS_DEB_LL(LBS_DEB_WEXT, fmt, ##args)
#define lbs_deb_ioctl(fmt, args...) LBS_DEB_LL(LBS_DEB_IOCTL, fmt, ##args)
#define lbs_deb_scan(fmt, args...) LBS_DEB_LL(LBS_DEB_SCAN, fmt, ##args)
#define lbs_deb_assoc(fmt, args...) LBS_DEB_LL(LBS_DEB_ASSOC, fmt, ##args)
#define lbs_deb_join(fmt, args...) LBS_DEB_LL(LBS_DEB_JOIN, fmt, ##args)
#define lbs_deb_11d(fmt, args...) LBS_DEB_LL(LBS_DEB_11D, fmt, ##args)
#define lbs_deb_debugfs(fmt, args...) LBS_DEB_LL(LBS_DEB_DEBUGFS, fmt, ##args)
#define lbs_deb_ethtool(fmt, args...) LBS_DEB_LL(LBS_DEB_ETHTOOL, fmt, ##args)
#define lbs_deb_host(fmt, args...) LBS_DEB_LL(LBS_DEB_HOST, fmt, ##args)
#define lbs_deb_cmd(fmt, args...) LBS_DEB_LL(LBS_DEB_CMD, fmt, ##args)
#define lbs_deb_rx(fmt, args...) LBS_DEB_LL(LBS_DEB_RX, fmt, ##args)
#define lbs_deb_tx(fmt, args...) LBS_DEB_LL(LBS_DEB_TX, fmt, ##args)
#define lbs_deb_fw(fmt, args...) LBS_DEB_LL(LBS_DEB_FW, fmt, ##args)
#define lbs_deb_usb(fmt, args...) LBS_DEB_LL(LBS_DEB_USB, fmt, ##args)
#define lbs_deb_usbd(dev, fmt, args...) LBS_DEB_LL(LBS_DEB_USB, "%s:" fmt, (dev)->bus_id, ##args)
#define lbs_deb_cs(fmt, args...) LBS_DEB_LL(LBS_DEB_CS, fmt, ##args)
#define lbs_deb_thread(fmt, args...) LBS_DEB_LL(LBS_DEB_THREAD, fmt, ##args)
#define lbs_pr_info(format, args...) \ #define lbs_pr_info(format, args...) \
printk(KERN_INFO DRV_NAME": " format, ## args) printk(KERN_INFO DRV_NAME": " format, ## args)
...@@ -24,37 +87,25 @@ extern unsigned int libertas_debug; ...@@ -24,37 +87,25 @@ extern unsigned int libertas_debug;
printk(KERN_ALERT DRV_NAME": " format, ## args) printk(KERN_ALERT DRV_NAME": " format, ## args)
#ifdef DEBUG #ifdef DEBUG
#define lbs_pr_debug(level, format, args...) \
do { if (libertas_debug >= level) \
printk(KERN_INFO DRV_NAME": " format, ##args); } while (0)
#define lbs_dev_dbg(level, device, format, args...) \
lbs_pr_debug(level, "%s: " format, \
(device)->bus_id , ## args)
static inline void lbs_dbg_hex(char *prompt, u8 * buf, int len) static inline void lbs_dbg_hex(char *prompt, u8 * buf, int len)
{ {
int i = 0; int i = 0;
if (!libertas_debug) if (!(libertas_debug_flags & LBS_DEB_HEX))
return; return;
printk(KERN_DEBUG "%s: ", prompt); printk(KERN_DEBUG "%s: ", prompt);
for (i = 1; i <= len; i++) { for (i = 1; i <= len; i++) {
printk(KERN_DEBUG "%02x ", (u8) * buf); printk("%02x ", (u8) * buf);
buf++; buf++;
} }
printk("\n"); printk("\n");
} }
#else #else
#define lbs_pr_debug(level, format, args...) do {} while (0)
#define lbs_dev_dbg(level, device, format, args...) do {} while (0)
#define lbs_dbg_hex(x,y,z) do {} while (0) #define lbs_dbg_hex(x,y,z) do {} while (0)
#endif #endif
#define ENTER() lbs_pr_debug(1, "Enter: %s:%i\n", \
__FUNCTION__, __LINE__)
#define LEAVE() lbs_pr_debug(1, "Leave: %s:%i\n", \
__FUNCTION__, __LINE__)
/** Buffer Constants */ /** Buffer Constants */
......
...@@ -69,7 +69,7 @@ static int libertas_ethtool_get_eeprom(struct net_device *dev, ...@@ -69,7 +69,7 @@ static int libertas_ethtool_get_eeprom(struct net_device *dev,
/* +14 is for action, offset, and NOB in /* +14 is for action, offset, and NOB in
* response */ * response */
lbs_pr_debug(1, "action:%d offset: %x NOB: %02x\n", lbs_deb_ethtool("action:%d offset: %x NOB: %02x\n",
regctrl.action, regctrl.offset, regctrl.NOB); regctrl.action, regctrl.offset, regctrl.NOB);
ret = libertas_prepare_and_send_command(priv, ret = libertas_prepare_and_send_command(priv,
...@@ -81,8 +81,7 @@ static int libertas_ethtool_get_eeprom(struct net_device *dev, ...@@ -81,8 +81,7 @@ static int libertas_ethtool_get_eeprom(struct net_device *dev,
if (ret) { if (ret) {
if (adapter->prdeeprom) if (adapter->prdeeprom)
kfree(adapter->prdeeprom); kfree(adapter->prdeeprom);
LEAVE(); goto done;
return ret;
} }
mdelay(10); mdelay(10);
...@@ -101,7 +100,11 @@ static int libertas_ethtool_get_eeprom(struct net_device *dev, ...@@ -101,7 +100,11 @@ static int libertas_ethtool_get_eeprom(struct net_device *dev,
kfree(adapter->prdeeprom); kfree(adapter->prdeeprom);
// mutex_unlock(&priv->mutex); // mutex_unlock(&priv->mutex);
return 0; ret = 0;
done:
lbs_deb_enter_args(LBS_DEB_ETHTOOL, "ret %d", ret);
return ret;
} }
static void libertas_ethtool_get_stats(struct net_device * dev, static void libertas_ethtool_get_stats(struct net_device * dev,
...@@ -109,7 +112,7 @@ static void libertas_ethtool_get_stats(struct net_device * dev, ...@@ -109,7 +112,7 @@ static void libertas_ethtool_get_stats(struct net_device * dev,
{ {
wlan_private *priv = dev->priv; wlan_private *priv = dev->priv;
ENTER(); lbs_deb_enter(LBS_DEB_ETHTOOL);
stats->cmd = ETHTOOL_GSTATS; stats->cmd = ETHTOOL_GSTATS;
BUG_ON(stats->n_stats != MESH_STATS_NUM); BUG_ON(stats->n_stats != MESH_STATS_NUM);
...@@ -122,7 +125,7 @@ static void libertas_ethtool_get_stats(struct net_device * dev, ...@@ -122,7 +125,7 @@ static void libertas_ethtool_get_stats(struct net_device * dev,
data[5] = priv->mstats.fwd_bcast_cnt; data[5] = priv->mstats.fwd_bcast_cnt;
data[6] = priv->mstats.drop_blind; data[6] = priv->mstats.drop_blind;
LEAVE(); lbs_deb_enter(LBS_DEB_ETHTOOL);
} }
static int libertas_ethtool_get_stats_count(struct net_device * dev) static 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,15 +134,16 @@ static int libertas_ethtool_get_stats_count(struct net_device * dev)
wlan_private *priv = dev->priv; wlan_private *priv = dev->priv;
struct cmd_ds_mesh_access mesh_access; struct cmd_ds_mesh_access mesh_access;
ENTER(); lbs_deb_enter(LBS_DEB_ETHTOOL);
/* Get Mesh Statistics */ /* Get Mesh Statistics */
ret = libertas_prepare_and_send_command(priv, ret = libertas_prepare_and_send_command(priv,
cmd_mesh_access, cmd_act_mesh_get_stats, cmd_mesh_access, cmd_act_mesh_get_stats,
cmd_option_waitforrsp, 0, &mesh_access); cmd_option_waitforrsp, 0, &mesh_access);
if (ret) { if (ret) {
LEAVE(); ret = 0;
return 0; goto done;
} }
priv->mstats.fwd_drop_rbt = mesh_access.data[0]; 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,8 +154,11 @@ static int libertas_ethtool_get_stats_count(struct net_device * dev)
priv->mstats.fwd_bcast_cnt = mesh_access.data[5]; priv->mstats.fwd_bcast_cnt = mesh_access.data[5];
priv->mstats.drop_blind = mesh_access.data[6]; priv->mstats.drop_blind = mesh_access.data[6];
LEAVE(); ret = MESH_STATS_NUM;
return MESH_STATS_NUM;
done:
lbs_deb_enter_args(LBS_DEB_ETHTOOL, "ret %d", ret);
return ret;
} }
static void libertas_ethtool_get_strings (struct net_device * dev, static void libertas_ethtool_get_strings (struct net_device * dev,
...@@ -160,7 +167,8 @@ static void libertas_ethtool_get_strings (struct net_device * dev, ...@@ -160,7 +167,8 @@ static void libertas_ethtool_get_strings (struct net_device * dev,
{ {
int i; int i;
ENTER(); lbs_deb_enter(LBS_DEB_ETHTOOL);
switch (stringset) { switch (stringset) {
case ETH_SS_STATS: case ETH_SS_STATS:
for (i=0; i < MESH_STATS_NUM; i++) { for (i=0; i < MESH_STATS_NUM; i++) {
...@@ -170,7 +178,7 @@ static void libertas_ethtool_get_strings (struct net_device * dev, ...@@ -170,7 +178,7 @@ static void libertas_ethtool_get_strings (struct net_device * dev,
} }
break; break;
} }
LEAVE(); lbs_deb_enter(LBS_DEB_ETHTOOL);
} }
struct ethtool_ops libertas_ethtool_ops = { struct ethtool_ops libertas_ethtool_ops = {
......
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
char *libertas_fw_name = NULL; char *libertas_fw_name = NULL;
module_param_named(fw_name, libertas_fw_name, charp, 0644); module_param_named(fw_name, libertas_fw_name, charp, 0644);
unsigned int libertas_debug = 0; unsigned int libertas_debug_flags = 0;
module_param(libertas_debug, int, 0); module_param_named(debug, libertas_debug_flags, int, 0);
/** /**
* @brief This function checks the validity of Boot2/FW image. * @brief This function checks the validity of Boot2/FW image.
...@@ -61,9 +61,9 @@ static int check_fwfile_format(u8 *data, u32 totlen) ...@@ -61,9 +61,9 @@ static int check_fwfile_format(u8 *data, u32 totlen)
} while (!exit); } while (!exit);
if (ret) if (ret)
lbs_pr_err("bin file format check FAIL...\n"); lbs_pr_err("firmware file format check FAIL\n");
else else
lbs_pr_debug(1, "bin file format check PASS...\n"); lbs_deb_fw("firmware file format check PASS\n");
return ret; return ret;
} }
...@@ -81,13 +81,13 @@ static int wlan_setup_station_hw(wlan_private * priv) ...@@ -81,13 +81,13 @@ static int wlan_setup_station_hw(wlan_private * priv)
int ret = -1; int ret = -1;
wlan_adapter *adapter = priv->adapter; wlan_adapter *adapter = priv->adapter;
ENTER(); lbs_deb_enter(LBS_DEB_FW);
if ((ret = request_firmware(&priv->firmware, libertas_fw_name, if ((ret = request_firmware(&priv->firmware, libertas_fw_name,
priv->hotplug_device)) < 0) { priv->hotplug_device)) < 0) {
lbs_pr_err("request_firmware() failed, error code = %#x\n", lbs_pr_err("request_firmware() failed with %#x\n",
ret); ret);
lbs_pr_err("%s not found in /lib/firmware\n", libertas_fw_name); lbs_pr_err("firmware %s not found\n", libertas_fw_name);
goto done; goto done;
} }
...@@ -101,7 +101,7 @@ static int wlan_setup_station_hw(wlan_private * priv) ...@@ -101,7 +101,7 @@ static int wlan_setup_station_hw(wlan_private * priv)
release_firmware(priv->firmware); release_firmware(priv->firmware);
if (ret) { if (ret) {
lbs_pr_debug(1, "Bootloader in invalid state!\n"); lbs_deb_fw("bootloader in invalid state\n");
ret = -1; ret = -1;
goto done; goto done;
} }
...@@ -133,9 +133,8 @@ static int wlan_setup_station_hw(wlan_private * priv) ...@@ -133,9 +133,8 @@ static int wlan_setup_station_hw(wlan_private * priv)
ret = 0; ret = 0;
done: done:
LEAVE(); lbs_deb_leave_args(LBS_DEB_FW, "ret %d", ret);
return ret;
return (ret);
} }
static int wlan_allocate_adapter(wlan_private * priv) static int wlan_allocate_adapter(wlan_private * priv)
...@@ -264,7 +263,7 @@ int libertas_init_fw(wlan_private * priv) ...@@ -264,7 +263,7 @@ int libertas_init_fw(wlan_private * priv)
int ret = -1; int ret = -1;
wlan_adapter *adapter = priv->adapter; wlan_adapter *adapter = priv->adapter;
ENTER(); lbs_deb_enter(LBS_DEB_FW);
/* Allocate adapter structure */ /* Allocate adapter structure */
if ((ret = wlan_allocate_adapter(priv)) != 0) if ((ret = wlan_allocate_adapter(priv)) != 0)
...@@ -288,7 +287,7 @@ int libertas_init_fw(wlan_private * priv) ...@@ -288,7 +287,7 @@ int libertas_init_fw(wlan_private * priv)
ret = 0; ret = 0;
done: done:
LEAVE(); lbs_deb_leave_args(LBS_DEB_FW, "ret %d", ret);
return ret; return ret;
} }
...@@ -297,25 +296,24 @@ void libertas_free_adapter(wlan_private * priv) ...@@ -297,25 +296,24 @@ void libertas_free_adapter(wlan_private * priv)
wlan_adapter *adapter = priv->adapter; wlan_adapter *adapter = priv->adapter;
if (!adapter) { if (!adapter) {
lbs_pr_debug(1, "Why double free adapter?:)\n"); lbs_deb_fw("why double free adapter?\n");
return; return;
} }
lbs_pr_debug(1, "Free command buffer\n"); lbs_deb_fw("free command buffer\n");
libertas_free_cmd_buffer(priv); libertas_free_cmd_buffer(priv);
lbs_pr_debug(1, "Free commandTimer\n"); lbs_deb_fw("free command_timer\n");
del_timer(&adapter->command_timer); del_timer(&adapter->command_timer);
lbs_pr_debug(1, "Free scantable\n"); lbs_deb_fw("free scantable\n");
if (adapter->scantable) { if (adapter->scantable) {
kfree(adapter->scantable); kfree(adapter->scantable);
adapter->scantable = NULL; adapter->scantable = NULL;
} }
lbs_pr_debug(1, "Free adapter\n");
/* Free the adapter object itself */ /* Free the adapter object itself */
lbs_deb_fw("free adapter\n");
kfree(adapter); kfree(adapter);
priv->adapter = NULL; priv->adapter = NULL;
} }
...@@ -334,17 +332,17 @@ static void command_timer_fn(unsigned long data) ...@@ -334,17 +332,17 @@ static void command_timer_fn(unsigned long data)
ptempnode = adapter->cur_cmd; ptempnode = adapter->cur_cmd;
if (ptempnode == NULL) { if (ptempnode == NULL) {
lbs_pr_debug(1, "PTempnode Empty\n"); lbs_deb_fw("ptempnode empty\n");
return; return;
} }
cmd = (struct cmd_ds_command *)ptempnode->bufvirtualaddr; cmd = (struct cmd_ds_command *)ptempnode->bufvirtualaddr;
if (!cmd) { if (!cmd) {
lbs_pr_debug(1, "cmd is NULL\n"); lbs_deb_fw("cmd is NULL\n");
return; return;
} }
lbs_pr_info("command_timer_fn fired (%x)\n", cmd->command); lbs_deb_fw("command_timer_fn fired, cmd %x\n", cmd->command);
if (!adapter->fw_ready) if (!adapter->fw_ready)
return; return;
...@@ -353,7 +351,7 @@ static void command_timer_fn(unsigned long data) ...@@ -353,7 +351,7 @@ static void command_timer_fn(unsigned long data)
adapter->cur_cmd = NULL; adapter->cur_cmd = NULL;
spin_unlock_irqrestore(&adapter->driver_lock, flags); spin_unlock_irqrestore(&adapter->driver_lock, flags);
lbs_pr_debug(1, "Re-sending same command as it timeout...!\n"); lbs_deb_fw("re-sending same command because of timeout\n");
libertas_queue_cmd(adapter, ptempnode, 0); libertas_queue_cmd(adapter, ptempnode, 0);
wake_up_interruptible(&priv->mainthread.waitq); wake_up_interruptible(&priv->mainthread.waitq);
......
...@@ -46,9 +46,11 @@ static void if_usb_write_bulk_callback(struct urb *urb) ...@@ -46,9 +46,11 @@ static void if_usb_write_bulk_callback(struct urb *urb)
/* print the failure status number for debug */ /* print the failure status number for debug */
lbs_pr_info("URB in failure status\n"); lbs_pr_info("URB in failure status\n");
} else { } else {
lbs_dev_dbg(2, &urb->dev->dev, "URB status is successfull\n"); /*
lbs_dev_dbg(2, &urb->dev->dev, "Actual length transmitted %d\n", lbs_deb_usbd(&urb->dev->dev, "URB status is successfull\n");
lbs_deb_usbd(&urb->dev->dev, "Actual length transmitted %d\n",
urb->actual_length); urb->actual_length);
*/
priv->wlan_dev.dnld_sent = DNLD_RES_RECEIVED; priv->wlan_dev.dnld_sent = DNLD_RES_RECEIVED;
/* Wake main thread if commands are pending */ /* Wake main thread if commands are pending */
if (!adapter->cur_cmd) if (!adapter->cur_cmd)
...@@ -67,7 +69,7 @@ static void if_usb_write_bulk_callback(struct urb *urb) ...@@ -67,7 +69,7 @@ static void if_usb_write_bulk_callback(struct urb *urb)
*/ */
void if_usb_free(struct usb_card_rec *cardp) void if_usb_free(struct usb_card_rec *cardp)
{ {
ENTER(); lbs_deb_enter(LBS_DEB_USB);
/* Unlink tx & rx urb */ /* Unlink tx & rx urb */
usb_kill_urb(cardp->tx_urb); usb_kill_urb(cardp->tx_urb);
...@@ -82,8 +84,7 @@ void if_usb_free(struct usb_card_rec *cardp) ...@@ -82,8 +84,7 @@ void if_usb_free(struct usb_card_rec *cardp)
kfree(cardp->bulk_out_buffer); kfree(cardp->bulk_out_buffer);
cardp->bulk_out_buffer = NULL; cardp->bulk_out_buffer = NULL;
LEAVE(); lbs_deb_leave(LBS_DEB_USB);
return;
} }
/** /**
...@@ -113,7 +114,7 @@ static int if_usb_probe(struct usb_interface *intf, ...@@ -113,7 +114,7 @@ static int if_usb_probe(struct usb_interface *intf,
usb_cardp->udev = udev; usb_cardp->udev = udev;
iface_desc = intf->cur_altsetting; iface_desc = intf->cur_altsetting;
lbs_dev_dbg(1, &udev->dev, "bcdUSB = 0x%X bDeviceClass = 0x%X" lbs_deb_usbd(&udev->dev, "bcdUSB = 0x%X bDeviceClass = 0x%X"
" bDeviceSubClass = 0x%X, bDeviceProtocol = 0x%X\n", " bDeviceSubClass = 0x%X, bDeviceProtocol = 0x%X\n",
udev->descriptor.bcdUSB, udev->descriptor.bcdUSB,
udev->descriptor.bDeviceClass, udev->descriptor.bDeviceClass,
...@@ -126,12 +127,12 @@ static int if_usb_probe(struct usb_interface *intf, ...@@ -126,12 +127,12 @@ static int if_usb_probe(struct usb_interface *intf,
&& ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == && ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
USB_ENDPOINT_XFER_BULK)) { USB_ENDPOINT_XFER_BULK)) {
/* we found a bulk in endpoint */ /* we found a bulk in endpoint */
lbs_dev_dbg(1, &udev->dev, "Bulk in size is %d\n", lbs_deb_usbd(&udev->dev, "Bulk in size is %d\n",
endpoint->wMaxPacketSize); endpoint->wMaxPacketSize);
if (! if (!
(usb_cardp->rx_urb = (usb_cardp->rx_urb =
usb_alloc_urb(0, GFP_KERNEL))) { usb_alloc_urb(0, GFP_KERNEL))) {
lbs_dev_dbg(1, &udev->dev, lbs_deb_usbd(&udev->dev,
"Rx URB allocation failed\n"); "Rx URB allocation failed\n");
goto dealloc; goto dealloc;
} }
...@@ -142,7 +143,7 @@ static int if_usb_probe(struct usb_interface *intf, ...@@ -142,7 +143,7 @@ static int if_usb_probe(struct usb_interface *intf,
usb_cardp->bulk_in_endpointAddr = usb_cardp->bulk_in_endpointAddr =
(endpoint-> (endpoint->
bEndpointAddress & USB_ENDPOINT_NUMBER_MASK); bEndpointAddress & USB_ENDPOINT_NUMBER_MASK);
lbs_dev_dbg(1, &udev->dev, "in_endpoint = %d\n", lbs_deb_usbd(&udev->dev, "in_endpoint = %d\n",
endpoint->bEndpointAddress); endpoint->bEndpointAddress);
} }
...@@ -155,26 +156,26 @@ static int if_usb_probe(struct usb_interface *intf, ...@@ -155,26 +156,26 @@ static int if_usb_probe(struct usb_interface *intf,
if (! if (!
(usb_cardp->tx_urb = (usb_cardp->tx_urb =
usb_alloc_urb(0, GFP_KERNEL))) { usb_alloc_urb(0, GFP_KERNEL))) {
lbs_dev_dbg(1,&udev->dev, lbs_deb_usbd(&udev->dev,
"Tx URB allocation failed\n"); "Tx URB allocation failed\n");
goto dealloc; goto dealloc;
} }
usb_cardp->bulk_out_size = usb_cardp->bulk_out_size =
endpoint->wMaxPacketSize; endpoint->wMaxPacketSize;
lbs_dev_dbg(1, &udev->dev, lbs_deb_usbd(&udev->dev,
"Bulk out size is %d\n", "Bulk out size is %d\n",
endpoint->wMaxPacketSize); endpoint->wMaxPacketSize);
usb_cardp->bulk_out_endpointAddr = usb_cardp->bulk_out_endpointAddr =
endpoint->bEndpointAddress; endpoint->bEndpointAddress;
lbs_dev_dbg(1, &udev->dev, "out_endpoint = %d\n", lbs_deb_usbd(&udev->dev, "out_endpoint = %d\n",
endpoint->bEndpointAddress); endpoint->bEndpointAddress);
usb_cardp->bulk_out_buffer = usb_cardp->bulk_out_buffer =
kmalloc(MRVDRV_ETH_TX_PACKET_BUFFER_SIZE, kmalloc(MRVDRV_ETH_TX_PACKET_BUFFER_SIZE,
GFP_KERNEL); GFP_KERNEL);
if (!usb_cardp->bulk_out_buffer) { if (!usb_cardp->bulk_out_buffer) {
lbs_dev_dbg(1, &udev->dev, lbs_deb_usbd(&udev->dev,
"Could not allocate buffer\n"); "Could not allocate buffer\n");
goto dealloc; goto dealloc;
} }
...@@ -226,7 +227,7 @@ static void if_usb_disconnect(struct usb_interface *intf) ...@@ -226,7 +227,7 @@ static void if_usb_disconnect(struct usb_interface *intf)
adapter->surpriseremoved = 1; adapter->surpriseremoved = 1;
/* card is removed and we can call wlan_remove_card */ /* card is removed and we can call wlan_remove_card */
lbs_dev_dbg(1, &cardp->udev->dev, "call remove card\n"); lbs_deb_usbd(&cardp->udev->dev, "call remove card\n");
wlan_remove_card(cardp); wlan_remove_card(cardp);
/* Unlink and free urb */ /* Unlink and free urb */
...@@ -262,8 +263,10 @@ static int if_prog_firmware(wlan_private * priv) ...@@ -262,8 +263,10 @@ static int if_prog_firmware(wlan_private * priv)
cardp->fwseqnum = cardp->lastseqnum - 1; cardp->fwseqnum = cardp->lastseqnum - 1;
} }
lbs_dev_dbg(2, &cardp->udev->dev, "totalbytes = %d\n", /*
lbs_deb_usbd(&cardp->udev->dev, "totalbytes = %d\n",
cardp->totalbytes); cardp->totalbytes);
*/
memcpy(fwheader, &firmware[cardp->totalbytes], memcpy(fwheader, &firmware[cardp->totalbytes],
sizeof(struct fwheader)); sizeof(struct fwheader));
...@@ -271,12 +274,14 @@ static int if_prog_firmware(wlan_private * priv) ...@@ -271,12 +274,14 @@ static int if_prog_firmware(wlan_private * priv)
cardp->fwlastblksent = cardp->totalbytes; cardp->fwlastblksent = cardp->totalbytes;
cardp->totalbytes += sizeof(struct fwheader); cardp->totalbytes += sizeof(struct fwheader);
lbs_dev_dbg(2, &cardp->udev->dev,"Copy Data\n"); /* lbs_deb_usbd(&cardp->udev->dev,"Copy Data\n"); */
memcpy(fwdata->data, &firmware[cardp->totalbytes], memcpy(fwdata->data, &firmware[cardp->totalbytes],
fwdata->fwheader.datalength); fwdata->fwheader.datalength);
lbs_dev_dbg(2, &cardp->udev->dev, /*
lbs_deb_usbd(&cardp->udev->dev,
"Data length = %d\n", fwdata->fwheader.datalength); "Data length = %d\n", fwdata->fwheader.datalength);
*/
cardp->fwseqnum = cardp->fwseqnum + 1; cardp->fwseqnum = cardp->fwseqnum + 1;
...@@ -285,26 +290,32 @@ static int if_prog_firmware(wlan_private * priv) ...@@ -285,26 +290,32 @@ static int if_prog_firmware(wlan_private * priv)
cardp->totalbytes += fwdata->fwheader.datalength; cardp->totalbytes += fwdata->fwheader.datalength;
if (fwheader->dnldcmd == FW_HAS_DATA_TO_RECV) { if (fwheader->dnldcmd == FW_HAS_DATA_TO_RECV) {
lbs_dev_dbg(2, &cardp->udev->dev, "There is data to follow\n"); /*
lbs_dev_dbg(2, &cardp->udev->dev, lbs_deb_usbd(&cardp->udev->dev, "There is data to follow\n");
lbs_deb_usbd(&cardp->udev->dev,
"seqnum = %d totalbytes = %d\n", cardp->fwseqnum, "seqnum = %d totalbytes = %d\n", cardp->fwseqnum,
cardp->totalbytes); cardp->totalbytes);
*/
memcpy(cardp->bulk_out_buffer, fwheader, FW_DATA_XMIT_SIZE); memcpy(cardp->bulk_out_buffer, fwheader, FW_DATA_XMIT_SIZE);
usb_tx_block(priv, cardp->bulk_out_buffer, FW_DATA_XMIT_SIZE); usb_tx_block(priv, cardp->bulk_out_buffer, FW_DATA_XMIT_SIZE);
} else if (fwdata->fwheader.dnldcmd == FW_HAS_LAST_BLOCK) { } else if (fwdata->fwheader.dnldcmd == FW_HAS_LAST_BLOCK) {
lbs_dev_dbg(2, &cardp->udev->dev, /*
lbs_deb_usbd(&cardp->udev->dev,
"Host has finished FW downloading\n"); "Host has finished FW downloading\n");
lbs_dev_dbg(2, &cardp->udev->dev, lbs_deb_usbd(&cardp->udev->dev,
"Donwloading FW JUMP BLOCK\n"); "Donwloading FW JUMP BLOCK\n");
*/
memcpy(cardp->bulk_out_buffer, fwheader, FW_DATA_XMIT_SIZE); memcpy(cardp->bulk_out_buffer, fwheader, FW_DATA_XMIT_SIZE);
usb_tx_block(priv, cardp->bulk_out_buffer, FW_DATA_XMIT_SIZE); usb_tx_block(priv, cardp->bulk_out_buffer, FW_DATA_XMIT_SIZE);
cardp->fwfinalblk = 1; cardp->fwfinalblk = 1;
} }
lbs_dev_dbg(2, &cardp->udev->dev, /*
lbs_deb_usbd(&cardp->udev->dev,
"The firmware download is done size is %d\n", "The firmware download is done size is %d\n",
cardp->totalbytes); cardp->totalbytes);
*/
kfree(fwdata); kfree(fwdata);
...@@ -340,7 +351,7 @@ int usb_tx_block(wlan_private * priv, u8 * payload, u16 nb) ...@@ -340,7 +351,7 @@ int usb_tx_block(wlan_private * priv, u8 * payload, u16 nb)
/* check if device is removed */ /* check if device is removed */
if (priv->adapter->surpriseremoved) { if (priv->adapter->surpriseremoved) {
lbs_dev_dbg(1, &cardp->udev->dev, "Device removed\n"); lbs_deb_usbd(&cardp->udev->dev, "Device removed\n");
goto tx_ret; goto tx_ret;
} }
...@@ -353,10 +364,10 @@ int usb_tx_block(wlan_private * priv, u8 * payload, u16 nb) ...@@ -353,10 +364,10 @@ int usb_tx_block(wlan_private * priv, u8 * payload, u16 nb)
if ((ret = usb_submit_urb(cardp->tx_urb, GFP_ATOMIC))) { if ((ret = usb_submit_urb(cardp->tx_urb, GFP_ATOMIC))) {
/* transfer failed */ /* transfer failed */
lbs_dev_dbg(1, &cardp->udev->dev, "usb_submit_urb failed\n"); lbs_deb_usbd(&cardp->udev->dev, "usb_submit_urb failed\n");
ret = -1; ret = -1;
} else { } else {
lbs_dev_dbg(2, &cardp->udev->dev, "usb_submit_urb success\n"); /* lbs_deb_usbd(&cardp->udev->dev, "usb_submit_urb success\n"); */
ret = 0; ret = 0;
} }
...@@ -390,13 +401,13 @@ static int __if_usb_submit_rx_urb(wlan_private * priv, ...@@ -390,13 +401,13 @@ static int __if_usb_submit_rx_urb(wlan_private * priv,
cardp->rx_urb->transfer_flags |= URB_ZERO_PACKET; cardp->rx_urb->transfer_flags |= URB_ZERO_PACKET;
lbs_dev_dbg(2, &cardp->udev->dev, "Pointer for rx_urb %p\n", cardp->rx_urb); /* lbs_deb_usbd(&cardp->udev->dev, "Pointer for rx_urb %p\n", cardp->rx_urb); */
if ((ret = usb_submit_urb(cardp->rx_urb, GFP_ATOMIC))) { if ((ret = usb_submit_urb(cardp->rx_urb, GFP_ATOMIC))) {
/* handle failure conditions */ /* handle failure conditions */
lbs_dev_dbg(1, &cardp->udev->dev, "Submit Rx URB failed\n"); lbs_deb_usbd(&cardp->udev->dev, "Submit Rx URB failed\n");
ret = -1; ret = -1;
} else { } else {
lbs_dev_dbg(2, &cardp->udev->dev, "Submit Rx URB success\n"); /* lbs_deb_usbd(&cardp->udev->dev, "Submit Rx URB success\n"); */
ret = 0; ret = 0;
} }
...@@ -424,7 +435,7 @@ static void if_usb_receive_fwload(struct urb *urb) ...@@ -424,7 +435,7 @@ static void if_usb_receive_fwload(struct urb *urb)
struct bootcmdrespStr bootcmdresp; struct bootcmdrespStr bootcmdresp;
if (urb->status) { if (urb->status) {
lbs_dev_dbg(1, &cardp->udev->dev, lbs_deb_usbd(&cardp->udev->dev,
"URB status is failed during fw load\n"); "URB status is failed during fw load\n");
kfree_skb(skb); kfree_skb(skb);
return; return;
...@@ -437,7 +448,7 @@ static void if_usb_receive_fwload(struct urb *urb) ...@@ -437,7 +448,7 @@ static void if_usb_receive_fwload(struct urb *urb)
kfree_skb(skb); kfree_skb(skb);
if_usb_submit_rx_urb_fwload(priv); if_usb_submit_rx_urb_fwload(priv);
cardp->bootcmdresp = 1; cardp->bootcmdresp = 1;
lbs_dev_dbg(1, &cardp->udev->dev, lbs_deb_usbd(&cardp->udev->dev,
"Received valid boot command response\n"); "Received valid boot command response\n");
return; return;
} }
...@@ -455,7 +466,7 @@ static void if_usb_receive_fwload(struct urb *urb) ...@@ -455,7 +466,7 @@ static void if_usb_receive_fwload(struct urb *urb)
bootcmdresp.u8result); bootcmdresp.u8result);
} else { } else {
cardp->bootcmdresp = 1; cardp->bootcmdresp = 1;
lbs_dev_dbg(1, &cardp->udev->dev, lbs_deb_usbd(&cardp->udev->dev,
"Received valid boot command response\n"); "Received valid boot command response\n");
} }
kfree_skb(skb); kfree_skb(skb);
...@@ -465,7 +476,7 @@ static void if_usb_receive_fwload(struct urb *urb) ...@@ -465,7 +476,7 @@ static void if_usb_receive_fwload(struct urb *urb)
syncfwheader = kmalloc(sizeof(struct fwsyncheader), GFP_ATOMIC); syncfwheader = kmalloc(sizeof(struct fwsyncheader), GFP_ATOMIC);
if (!syncfwheader) { if (!syncfwheader) {
lbs_dev_dbg(1, &cardp->udev->dev, "Failure to allocate syncfwheader\n"); lbs_deb_usbd(&cardp->udev->dev, "Failure to allocate syncfwheader\n");
kfree_skb(skb); kfree_skb(skb);
return; return;
} }
...@@ -474,14 +485,16 @@ static void if_usb_receive_fwload(struct urb *urb) ...@@ -474,14 +485,16 @@ static void if_usb_receive_fwload(struct urb *urb)
sizeof(struct fwsyncheader)); sizeof(struct fwsyncheader));
if (!syncfwheader->cmd) { if (!syncfwheader->cmd) {
lbs_dev_dbg(2, &cardp->udev->dev, /*
lbs_deb_usbd(&cardp->udev->dev,
"FW received Blk with correct CRC\n"); "FW received Blk with correct CRC\n");
lbs_dev_dbg(2, &cardp->udev->dev, lbs_deb_usbd(&cardp->udev->dev,
"FW received Blk seqnum = %d\n", "FW received Blk seqnum = %d\n",
syncfwheader->seqnum); syncfwheader->seqnum);
*/
cardp->CRC_OK = 1; cardp->CRC_OK = 1;
} else { } else {
lbs_dev_dbg(1, &cardp->udev->dev, lbs_deb_usbd(&cardp->udev->dev,
"FW received Blk with CRC error\n"); "FW received Blk with CRC error\n");
cardp->CRC_OK = 0; cardp->CRC_OK = 0;
} }
...@@ -511,7 +524,7 @@ static inline void process_cmdtypedata(int recvlength, struct sk_buff *skb, ...@@ -511,7 +524,7 @@ static inline void process_cmdtypedata(int recvlength, struct sk_buff *skb,
{ {
if (recvlength > MRVDRV_ETH_RX_PACKET_BUFFER_SIZE + if (recvlength > MRVDRV_ETH_RX_PACKET_BUFFER_SIZE +
MESSAGE_HEADER_LEN || recvlength < MRVDRV_MIN_PKT_LEN) { MESSAGE_HEADER_LEN || recvlength < MRVDRV_MIN_PKT_LEN) {
lbs_dev_dbg(1, &cardp->udev->dev, lbs_deb_usbd(&cardp->udev->dev,
"Packet length is Invalid\n"); "Packet length is Invalid\n");
kfree_skb(skb); kfree_skb(skb);
return; return;
...@@ -531,7 +544,7 @@ static inline void process_cmdrequest(int recvlength, u8 *recvbuff, ...@@ -531,7 +544,7 @@ static inline void process_cmdrequest(int recvlength, u8 *recvbuff,
{ {
u8 *cmdbuf; u8 *cmdbuf;
if (recvlength > MRVDRV_SIZE_OF_CMD_BUFFER) { if (recvlength > MRVDRV_SIZE_OF_CMD_BUFFER) {
lbs_dev_dbg(1, &cardp->udev->dev, lbs_deb_usbd(&cardp->udev->dev,
"The receive buffer is too large\n"); "The receive buffer is too large\n");
kfree_skb(skb); kfree_skb(skb);
return; return;
...@@ -558,7 +571,7 @@ static inline void process_cmdrequest(int recvlength, u8 *recvbuff, ...@@ -558,7 +571,7 @@ static inline void process_cmdrequest(int recvlength, u8 *recvbuff,
libertas_interrupt(priv->wlan_dev.netdev); libertas_interrupt(priv->wlan_dev.netdev);
spin_unlock(&priv->adapter->driver_lock); spin_unlock(&priv->adapter->driver_lock);
lbs_dev_dbg(1, &cardp->udev->dev, lbs_deb_usbd(&cardp->udev->dev,
"Wake up main thread to handle cmd response\n"); "Wake up main thread to handle cmd response\n");
return; return;
...@@ -582,11 +595,11 @@ static void if_usb_receive(struct urb *urb) ...@@ -582,11 +595,11 @@ static void if_usb_receive(struct urb *urb)
u8 *recvbuff = NULL; u8 *recvbuff = NULL;
u32 recvtype; u32 recvtype;
ENTER(); lbs_deb_enter(LBS_DEB_USB);
if (recvlength) { if (recvlength) {
if (urb->status) { if (urb->status) {
lbs_dev_dbg(1, &cardp->udev->dev, lbs_deb_usbd(&cardp->udev->dev,
"URB status is failed\n"); "URB status is failed\n");
kfree_skb(skb); kfree_skb(skb);
goto setup_for_next; goto setup_for_next;
...@@ -594,12 +607,12 @@ static void if_usb_receive(struct urb *urb) ...@@ -594,12 +607,12 @@ static void if_usb_receive(struct urb *urb)
recvbuff = skb->data + IPFIELD_ALIGN_OFFSET; recvbuff = skb->data + IPFIELD_ALIGN_OFFSET;
memcpy(&recvtype, recvbuff, sizeof(u32)); memcpy(&recvtype, recvbuff, sizeof(u32));
lbs_dev_dbg(1, &cardp->udev->dev, lbs_deb_usbd(&cardp->udev->dev,
"Recv length = 0x%x\n", recvlength); "Recv length = 0x%x\n", recvlength);
lbs_dev_dbg(1, &cardp->udev->dev, lbs_deb_usbd(&cardp->udev->dev,
"Receive type = 0x%X\n", recvtype); "Receive type = 0x%X\n", recvtype);
recvtype = le32_to_cpu(recvtype); recvtype = le32_to_cpu(recvtype);
lbs_dev_dbg(1, &cardp->udev->dev, lbs_deb_usbd(&cardp->udev->dev,
"Receive type after = 0x%X\n", recvtype); "Receive type after = 0x%X\n", recvtype);
} else if (urb->status) } else if (urb->status)
goto rx_exit; goto rx_exit;
...@@ -618,7 +631,7 @@ static void if_usb_receive(struct urb *urb) ...@@ -618,7 +631,7 @@ static void if_usb_receive(struct urb *urb)
/* Event cause handling */ /* Event cause handling */
spin_lock(&priv->adapter->driver_lock); spin_lock(&priv->adapter->driver_lock);
cardp->usb_event_cause = *(u32 *) (recvbuff + MESSAGE_HEADER_LEN); cardp->usb_event_cause = *(u32 *) (recvbuff + MESSAGE_HEADER_LEN);
lbs_dev_dbg(1, &cardp->udev->dev,"**EVENT** 0x%X\n", lbs_deb_usbd(&cardp->udev->dev,"**EVENT** 0x%X\n",
cardp->usb_event_cause); cardp->usb_event_cause);
if (cardp->usb_event_cause & 0xffff0000) { if (cardp->usb_event_cause & 0xffff0000) {
libertas_send_tx_feedback(priv); libertas_send_tx_feedback(priv);
...@@ -639,8 +652,7 @@ static void if_usb_receive(struct urb *urb) ...@@ -639,8 +652,7 @@ static void if_usb_receive(struct urb *urb)
setup_for_next: setup_for_next:
if_usb_submit_rx_urb(priv); if_usb_submit_rx_urb(priv);
rx_exit: rx_exit:
LEAVE(); lbs_deb_leave(LBS_DEB_USB);
return;
} }
/** /**
...@@ -657,8 +669,8 @@ int libertas_sbi_host_to_card(wlan_private * priv, u8 type, u8 * payload, u16 nb ...@@ -657,8 +669,8 @@ int libertas_sbi_host_to_card(wlan_private * priv, u8 type, u8 * payload, u16 nb
u32 tmp; u32 tmp;
struct usb_card_rec *cardp = (struct usb_card_rec *)priv->wlan_dev.card; struct usb_card_rec *cardp = (struct usb_card_rec *)priv->wlan_dev.card;
lbs_dev_dbg(1, &cardp->udev->dev,"*** type = %u\n", type); lbs_deb_usbd(&cardp->udev->dev,"*** type = %u\n", type);
lbs_dev_dbg(1, &cardp->udev->dev,"size after = %d\n", nb); lbs_deb_usbd(&cardp->udev->dev,"size after = %d\n", nb);
if (type == MVMS_CMD) { if (type == MVMS_CMD) {
tmp = cpu_to_le32(CMD_TYPE_REQUEST); tmp = cpu_to_le32(CMD_TYPE_REQUEST);
...@@ -689,7 +701,7 @@ int libertas_sbi_get_int_status(wlan_private * priv, u8 * ireg) ...@@ -689,7 +701,7 @@ int libertas_sbi_get_int_status(wlan_private * priv, u8 * ireg)
*ireg = cardp->usb_int_cause; *ireg = cardp->usb_int_cause;
cardp->usb_int_cause = 0; cardp->usb_int_cause = 0;
lbs_dev_dbg(1, &cardp->udev->dev,"Int cause is 0x%X\n", *ireg); lbs_deb_usbd(&cardp->udev->dev,"Int cause is 0x%X\n", *ireg);
return 0; return 0;
} }
...@@ -736,9 +748,9 @@ int libertas_sbi_unregister_dev(wlan_private * priv) ...@@ -736,9 +748,9 @@ int libertas_sbi_unregister_dev(wlan_private * priv)
*/ */
int libertas_sbi_register_dev(wlan_private * priv) int libertas_sbi_register_dev(wlan_private * priv)
{ {
struct usb_card_rec *cardp = (struct usb_card_rec *)priv->wlan_dev.card; struct usb_card_rec *cardp = (struct usb_card_rec *)priv->wlan_dev.card;
ENTER();
lbs_deb_enter(LBS_DEB_USB);
cardp->priv = priv; cardp->priv = priv;
cardp->eth_dev = priv->wlan_dev.netdev; cardp->eth_dev = priv->wlan_dev.netdev;
...@@ -746,10 +758,10 @@ int libertas_sbi_register_dev(wlan_private * priv) ...@@ -746,10 +758,10 @@ int libertas_sbi_register_dev(wlan_private * priv)
SET_NETDEV_DEV(cardp->eth_dev, &(cardp->udev->dev)); SET_NETDEV_DEV(cardp->eth_dev, &(cardp->udev->dev));
lbs_dev_dbg(1, &cardp->udev->dev, "udev pointer is at %p\n", lbs_deb_usbd(&cardp->udev->dev, "udev pointer is at %p\n",
cardp->udev); cardp->udev);
LEAVE(); lbs_deb_leave(LBS_DEB_USB);
return 0; return 0;
} }
...@@ -760,16 +772,17 @@ int libertas_sbi_prog_firmware(wlan_private * priv) ...@@ -760,16 +772,17 @@ int libertas_sbi_prog_firmware(wlan_private * priv)
struct usb_card_rec *cardp = priv->wlan_dev.card; struct usb_card_rec *cardp = priv->wlan_dev.card;
int i = 0; int i = 0;
static int reset_count = 10; static int reset_count = 10;
int ret = 0;
ENTER(); lbs_deb_enter(LBS_DEB_USB);
cardp->rinfo.priv = priv; cardp->rinfo.priv = priv;
restart: restart:
if (if_usb_submit_rx_urb_fwload(priv) < 0) { if (if_usb_submit_rx_urb_fwload(priv) < 0) {
lbs_dev_dbg(1, &cardp->udev->dev, "URB submission is failed\n"); lbs_deb_usbd(&cardp->udev->dev, "URB submission is failed\n");
LEAVE(); ret = -1;
return -1; goto done;
} }
cardp->bootcmdresp = 0; cardp->bootcmdresp = 0;
...@@ -807,7 +820,7 @@ int libertas_sbi_prog_firmware(wlan_private * priv) ...@@ -807,7 +820,7 @@ int libertas_sbi_prog_firmware(wlan_private * priv)
if_prog_firmware(priv); if_prog_firmware(priv);
do { do {
lbs_dev_dbg(1, &cardp->udev->dev,"Wlan sched timeout\n"); lbs_deb_usbd(&cardp->udev->dev,"Wlan sched timeout\n");
i++; i++;
msleep_interruptible(100); msleep_interruptible(100);
if (priv->adapter->surpriseremoved || i >= 20) if (priv->adapter->surpriseremoved || i >= 20)
...@@ -822,8 +835,8 @@ int libertas_sbi_prog_firmware(wlan_private * priv) ...@@ -822,8 +835,8 @@ int libertas_sbi_prog_firmware(wlan_private * priv)
} }
lbs_pr_info("FW download failure, time = %d ms\n", i * 100); lbs_pr_info("FW download failure, time = %d ms\n", i * 100);
LEAVE(); ret = -1;
return -1; goto done;
} }
if_usb_submit_rx_urb(priv); if_usb_submit_rx_urb(priv);
...@@ -833,8 +846,9 @@ int libertas_sbi_prog_firmware(wlan_private * priv) ...@@ -833,8 +846,9 @@ int libertas_sbi_prog_firmware(wlan_private * priv)
priv->adapter->fw_ready = 1; priv->adapter->fw_ready = 1;
LEAVE(); done:
return 0; lbs_deb_leave_args(LBS_DEB_USB, "ret %d", ret);
return ret;
} }
/** /**
...@@ -854,7 +868,7 @@ static int if_usb_suspend(struct usb_interface *intf, pm_message_t message) ...@@ -854,7 +868,7 @@ static int if_usb_suspend(struct usb_interface *intf, pm_message_t message)
struct usb_card_rec *cardp = usb_get_intfdata(intf); struct usb_card_rec *cardp = usb_get_intfdata(intf);
wlan_private *priv = cardp->priv; wlan_private *priv = cardp->priv;
ENTER(); lbs_deb_enter(LBS_DEB_USB);
if (priv->adapter->psstate != PS_STATE_FULL_POWER) if (priv->adapter->psstate != PS_STATE_FULL_POWER)
return -1; return -1;
...@@ -867,7 +881,7 @@ static int if_usb_suspend(struct usb_interface *intf, pm_message_t message) ...@@ -867,7 +881,7 @@ static int if_usb_suspend(struct usb_interface *intf, pm_message_t message)
cardp->rx_urb_recall = 1; cardp->rx_urb_recall = 1;
LEAVE(); lbs_deb_leave(LBS_DEB_USB);
return 0; return 0;
} }
...@@ -875,7 +889,7 @@ static int if_usb_resume(struct usb_interface *intf) ...@@ -875,7 +889,7 @@ static int if_usb_resume(struct usb_interface *intf)
{ {
struct usb_card_rec *cardp = usb_get_intfdata(intf); struct usb_card_rec *cardp = usb_get_intfdata(intf);
ENTER(); lbs_deb_enter(LBS_DEB_USB);
cardp->rx_urb_recall = 0; cardp->rx_urb_recall = 0;
...@@ -883,7 +897,7 @@ static int if_usb_resume(struct usb_interface *intf) ...@@ -883,7 +897,7 @@ static int if_usb_resume(struct usb_interface *intf)
netif_device_attach(cardp->eth_dev); netif_device_attach(cardp->eth_dev);
LEAVE(); lbs_deb_leave(LBS_DEB_USB);
return 0; return 0;
} }
#else #else
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
static int wlan_set_region(wlan_private * priv, u16 region_code) static int wlan_set_region(wlan_private * priv, u16 region_code)
{ {
int i; int i;
int ret = 0;
for (i = 0; i < MRVDRV_MAX_REGION_CODE; i++) { for (i = 0; i < MRVDRV_MAX_REGION_CODE; i++) {
// use the region code to search for the index // use the region code to search for the index
...@@ -42,17 +43,18 @@ static int wlan_set_region(wlan_private * priv, u16 region_code) ...@@ -42,17 +43,18 @@ static int wlan_set_region(wlan_private * priv, u16 region_code)
// if it's unidentified region code // if it's unidentified region code
if (i >= MRVDRV_MAX_REGION_CODE) { if (i >= MRVDRV_MAX_REGION_CODE) {
lbs_pr_debug(1, "region Code not identified\n"); lbs_deb_ioctl("region Code not identified\n");
LEAVE(); ret = -1;
return -1; goto done;
} }
if (libertas_set_regiontable(priv, priv->adapter->regioncode, 0)) { if (libertas_set_regiontable(priv, priv->adapter->regioncode, 0)) {
LEAVE(); ret = -EINVAL;
return -EINVAL;
} }
return 0; done:
lbs_deb_leave_args(LBS_DEB_IOCTL, "ret %d", ret);
return ret;
} }
static inline int hex2int(char c) static inline int hex2int(char c)
...@@ -125,8 +127,10 @@ static int wlan_bt_add_ioctl(wlan_private * priv, struct ifreq *req) ...@@ -125,8 +127,10 @@ static int wlan_bt_add_ioctl(wlan_private * priv, struct ifreq *req)
char ethaddrs_str[18]; char ethaddrs_str[18];
char *pos; char *pos;
u8 ethaddr[ETH_ALEN]; u8 ethaddr[ETH_ALEN];
int ret;
lbs_deb_enter(LBS_DEB_IOCTL);
ENTER();
if (copy_from_user(ethaddrs_str, wrq->u.data.pointer, if (copy_from_user(ethaddrs_str, wrq->u.data.pointer,
sizeof(ethaddrs_str))) sizeof(ethaddrs_str)))
return -EFAULT; return -EFAULT;
...@@ -136,11 +140,12 @@ static int wlan_bt_add_ioctl(wlan_private * priv, struct ifreq *req) ...@@ -136,11 +140,12 @@ static int wlan_bt_add_ioctl(wlan_private * priv, struct ifreq *req)
return -EINVAL; return -EINVAL;
} }
lbs_pr_debug(1, "BT: adding %s\n", ethaddrs_str); lbs_deb_ioctl("BT: adding %s\n", ethaddrs_str);
LEAVE(); ret = libertas_prepare_and_send_command(priv, cmd_bt_access,
return (libertas_prepare_and_send_command(priv, cmd_bt_access,
cmd_act_bt_access_add, cmd_act_bt_access_add,
cmd_option_waitforrsp, 0, ethaddr)); cmd_option_waitforrsp, 0, ethaddr);
lbs_deb_leave_args(LBS_DEB_IOCTL, "ret %d", ret);
return ret;
} }
/** /**
...@@ -156,7 +161,8 @@ static int wlan_bt_del_ioctl(wlan_private * priv, struct ifreq *req) ...@@ -156,7 +161,8 @@ static int wlan_bt_del_ioctl(wlan_private * priv, struct ifreq *req)
u8 ethaddr[ETH_ALEN]; u8 ethaddr[ETH_ALEN];
char *pos; char *pos;
ENTER(); lbs_deb_enter(LBS_DEB_IOCTL);
if (copy_from_user(ethaddrs_str, wrq->u.data.pointer, if (copy_from_user(ethaddrs_str, wrq->u.data.pointer,
sizeof(ethaddrs_str))) sizeof(ethaddrs_str)))
return -EFAULT; return -EFAULT;
...@@ -166,13 +172,14 @@ static int wlan_bt_del_ioctl(wlan_private * priv, struct ifreq *req) ...@@ -166,13 +172,14 @@ static int wlan_bt_del_ioctl(wlan_private * priv, struct ifreq *req)
return -EINVAL; return -EINVAL;
} }
lbs_pr_debug(1, "BT: deleting %s\n", ethaddrs_str); lbs_deb_ioctl("BT: deleting %s\n", ethaddrs_str);
return (libertas_prepare_and_send_command(priv, return (libertas_prepare_and_send_command(priv,
cmd_bt_access, cmd_bt_access,
cmd_act_bt_access_del, cmd_act_bt_access_del,
cmd_option_waitforrsp, 0, ethaddr)); cmd_option_waitforrsp, 0, ethaddr));
LEAVE();
lbs_deb_leave(LBS_DEB_IOCTL);
return 0; return 0;
} }
...@@ -183,7 +190,7 @@ static int wlan_bt_del_ioctl(wlan_private * priv, struct ifreq *req) ...@@ -183,7 +190,7 @@ static int wlan_bt_del_ioctl(wlan_private * priv, struct ifreq *req)
*/ */
static int wlan_bt_reset_ioctl(wlan_private * priv) static int wlan_bt_reset_ioctl(wlan_private * priv)
{ {
ENTER(); lbs_deb_enter(LBS_DEB_IOCTL);
lbs_pr_alert( "BT: resetting\n"); lbs_pr_alert( "BT: resetting\n");
...@@ -192,7 +199,7 @@ static int wlan_bt_reset_ioctl(wlan_private * priv) ...@@ -192,7 +199,7 @@ static int wlan_bt_reset_ioctl(wlan_private * priv)
cmd_act_bt_access_reset, cmd_act_bt_access_reset,
cmd_option_waitforrsp, 0, NULL)); cmd_option_waitforrsp, 0, NULL));
LEAVE(); lbs_deb_leave(LBS_DEB_IOCTL);
return 0; return 0;
} }
...@@ -216,10 +223,10 @@ static int wlan_bt_list_ioctl(wlan_private * priv, struct ifreq *req) ...@@ -216,10 +223,10 @@ static int wlan_bt_list_ioctl(wlan_private * priv, struct ifreq *req)
char *pbuf = outstr; char *pbuf = outstr;
int ret; int ret;
ENTER(); lbs_deb_enter(LBS_DEB_IOCTL);
if (copy_from_user(outstr, wrq->u.data.pointer, sizeof(outstr))) { if (copy_from_user(outstr, wrq->u.data.pointer, sizeof(outstr))) {
lbs_pr_debug(1, "Copy from user failed\n"); lbs_deb_ioctl("Copy from user failed\n");
return -1; return -1;
} }
param.id = simple_strtoul(outstr, NULL, 10); param.id = simple_strtoul(outstr, NULL, 10);
...@@ -246,11 +253,11 @@ static int wlan_bt_list_ioctl(wlan_private * priv, struct ifreq *req) ...@@ -246,11 +253,11 @@ static int wlan_bt_list_ioctl(wlan_private * priv, struct ifreq *req)
wrq->u.data.length = strlen(outstr); wrq->u.data.length = strlen(outstr);
if (copy_to_user(wrq->u.data.pointer, (char *)outstr, if (copy_to_user(wrq->u.data.pointer, (char *)outstr,
wrq->u.data.length)) { wrq->u.data.length)) {
lbs_pr_debug(1, "BT_LIST: Copy to user failed!\n"); lbs_deb_ioctl("BT_LIST: Copy to user failed!\n");
return -EFAULT; return -EFAULT;
} }
LEAVE(); lbs_deb_leave(LBS_DEB_IOCTL);
return 0; return 0;
} }
...@@ -278,8 +285,10 @@ static int wlan_fwt_add_ioctl(wlan_private * priv, struct ifreq *req) ...@@ -278,8 +285,10 @@ static int wlan_fwt_add_ioctl(wlan_private * priv, struct ifreq *req)
char in_str[128]; char in_str[128];
static struct cmd_ds_fwt_access fwt_access; static struct cmd_ds_fwt_access fwt_access;
char *ptr; char *ptr;
int ret;
lbs_deb_enter(LBS_DEB_IOCTL);
ENTER();
if (copy_from_user(in_str, wrq->u.data.pointer, sizeof(in_str))) if (copy_from_user(in_str, wrq->u.data.pointer, sizeof(in_str)))
return -EFAULT; return -EFAULT;
...@@ -348,20 +357,22 @@ static int wlan_fwt_add_ioctl(wlan_private * priv, struct ifreq *req) ...@@ -348,20 +357,22 @@ static int wlan_fwt_add_ioctl(wlan_private * priv, struct ifreq *req)
char ethaddr1_str[18], ethaddr2_str[18]; char ethaddr1_str[18], ethaddr2_str[18];
eth_addr2str(fwt_access.da, ethaddr1_str); eth_addr2str(fwt_access.da, ethaddr1_str);
eth_addr2str(fwt_access.ra, ethaddr2_str); eth_addr2str(fwt_access.ra, ethaddr2_str);
lbs_pr_debug(1, "FWT_ADD: adding (da:%s,%i,ra:%s)\n", ethaddr1_str, lbs_deb_ioctl("FWT_ADD: adding (da:%s,%i,ra:%s)\n", ethaddr1_str,
fwt_access.dir, ethaddr2_str); fwt_access.dir, ethaddr2_str);
lbs_pr_debug(1, "FWT_ADD: ssn:%u dsn:%u met:%u hop:%u ttl:%u exp:%u slp:%u snr:%u\n", lbs_deb_ioctl("FWT_ADD: ssn:%u dsn:%u met:%u hop:%u ttl:%u exp:%u slp:%u snr:%u\n",
fwt_access.ssn, fwt_access.dsn, fwt_access.metric, fwt_access.ssn, fwt_access.dsn, fwt_access.metric,
fwt_access.hopcount, fwt_access.ttl, fwt_access.expiration, fwt_access.hopcount, fwt_access.ttl, fwt_access.expiration,
fwt_access.sleepmode, fwt_access.snr); fwt_access.sleepmode, fwt_access.snr);
} }
#endif #endif
LEAVE(); ret = libertas_prepare_and_send_command(priv, cmd_fwt_access,
return (libertas_prepare_and_send_command(priv, cmd_fwt_access, cmd_act_fwt_access_add,
cmd_act_fwt_access_add, cmd_option_waitforrsp, 0,
cmd_option_waitforrsp, 0, (void *)&fwt_access);
(void *)&fwt_access));
lbs_deb_leave_args(LBS_DEB_IOCTL, "ret %d", ret);
return ret;
} }
/** /**
...@@ -376,8 +387,10 @@ static int wlan_fwt_del_ioctl(wlan_private * priv, struct ifreq *req) ...@@ -376,8 +387,10 @@ static int wlan_fwt_del_ioctl(wlan_private * priv, struct ifreq *req)
char in_str[64]; char in_str[64];
static struct cmd_ds_fwt_access fwt_access; static struct cmd_ds_fwt_access fwt_access;
char *ptr; char *ptr;
int ret;
lbs_deb_enter(LBS_DEB_IOCTL);
ENTER();
if (copy_from_user(in_str, wrq->u.data.pointer, sizeof(in_str))) if (copy_from_user(in_str, wrq->u.data.pointer, sizeof(in_str)))
return -EFAULT; return -EFAULT;
...@@ -399,20 +412,21 @@ static int wlan_fwt_del_ioctl(wlan_private * priv, struct ifreq *req) ...@@ -399,20 +412,21 @@ static int wlan_fwt_del_ioctl(wlan_private * priv, struct ifreq *req)
#ifdef DEBUG #ifdef DEBUG
{ {
char ethaddr1_str[18], ethaddr2_str[18]; char ethaddr1_str[18], ethaddr2_str[18];
lbs_pr_debug(1, "FWT_DEL: line is %s\n", in_str); lbs_deb_ioctl("FWT_DEL: line is %s\n", in_str);
eth_addr2str(fwt_access.da, ethaddr1_str); eth_addr2str(fwt_access.da, ethaddr1_str);
eth_addr2str(fwt_access.ra, ethaddr2_str); eth_addr2str(fwt_access.ra, ethaddr2_str);
lbs_pr_debug(1, "FWT_DEL: removing (da:%s,ra:%s,dir:%d)\n", ethaddr1_str, lbs_deb_ioctl("FWT_DEL: removing (da:%s,ra:%s,dir:%d)\n", ethaddr1_str,
ethaddr2_str, fwt_access.dir); ethaddr2_str, fwt_access.dir);
} }
#endif #endif
LEAVE(); ret = libertas_prepare_and_send_command(priv,
return (libertas_prepare_and_send_command(priv, cmd_fwt_access,
cmd_fwt_access, cmd_act_fwt_access_del,
cmd_act_fwt_access_del, cmd_option_waitforrsp, 0,
cmd_option_waitforrsp, 0, (void *)&fwt_access);
(void *)&fwt_access)); lbs_deb_leave_args(LBS_DEB_IOCTL, "ret %d", ret);
return ret;
} }
...@@ -453,7 +467,8 @@ static int wlan_fwt_lookup_ioctl(wlan_private * priv, struct ifreq *req) ...@@ -453,7 +467,8 @@ static int wlan_fwt_lookup_ioctl(wlan_private * priv, struct ifreq *req)
static char out_str[128]; static char out_str[128];
int ret; int ret;
ENTER(); lbs_deb_enter(LBS_DEB_IOCTL);
if (copy_from_user(in_str, wrq->u.data.pointer, sizeof(in_str))) if (copy_from_user(in_str, wrq->u.data.pointer, sizeof(in_str)))
return -EFAULT; return -EFAULT;
...@@ -465,9 +480,9 @@ static int wlan_fwt_lookup_ioctl(wlan_private * priv, struct ifreq *req) ...@@ -465,9 +480,9 @@ static int wlan_fwt_lookup_ioctl(wlan_private * priv, struct ifreq *req)
#ifdef DEBUG #ifdef DEBUG
{ {
char ethaddr1_str[18]; char ethaddr1_str[18];
lbs_pr_debug(1, "FWT_LOOKUP: line is %s\n", in_str); lbs_deb_ioctl("FWT_LOOKUP: line is %s\n", in_str);
eth_addr2str(fwt_access.da, ethaddr1_str); eth_addr2str(fwt_access.da, ethaddr1_str);
lbs_pr_debug(1, "FWT_LOOKUP: looking for (da:%s)\n", ethaddr1_str); lbs_deb_ioctl("FWT_LOOKUP: looking for (da:%s)\n", ethaddr1_str);
} }
#endif #endif
...@@ -485,11 +500,11 @@ static int wlan_fwt_lookup_ioctl(wlan_private * priv, struct ifreq *req) ...@@ -485,11 +500,11 @@ static int wlan_fwt_lookup_ioctl(wlan_private * priv, struct ifreq *req)
wrq->u.data.length = strlen(out_str); wrq->u.data.length = strlen(out_str);
if (copy_to_user(wrq->u.data.pointer, (char *)out_str, if (copy_to_user(wrq->u.data.pointer, (char *)out_str,
wrq->u.data.length)) { wrq->u.data.length)) {
lbs_pr_debug(1, "FWT_LOOKUP: Copy to user failed!\n"); lbs_deb_ioctl("FWT_LOOKUP: Copy to user failed!\n");
return -EFAULT; return -EFAULT;
} }
LEAVE(); lbs_deb_leave(LBS_DEB_IOCTL);
return 0; return 0;
} }
...@@ -500,7 +515,7 @@ static int wlan_fwt_lookup_ioctl(wlan_private * priv, struct ifreq *req) ...@@ -500,7 +515,7 @@ static int wlan_fwt_lookup_ioctl(wlan_private * priv, struct ifreq *req)
*/ */
static int wlan_fwt_reset_ioctl(wlan_private * priv) static int wlan_fwt_reset_ioctl(wlan_private * priv)
{ {
lbs_pr_debug(1, "FWT: resetting\n"); lbs_deb_ioctl("FWT: resetting\n");
return (libertas_prepare_and_send_command(priv, return (libertas_prepare_and_send_command(priv,
cmd_fwt_access, cmd_fwt_access,
...@@ -524,7 +539,8 @@ static int wlan_fwt_list_ioctl(wlan_private * priv, struct ifreq *req) ...@@ -524,7 +539,8 @@ static int wlan_fwt_list_ioctl(wlan_private * priv, struct ifreq *req)
char *pbuf = out_str; char *pbuf = out_str;
int ret; int ret;
ENTER(); lbs_deb_enter(LBS_DEB_IOCTL);
if (copy_from_user(in_str, wrq->u.data.pointer, sizeof(in_str))) if (copy_from_user(in_str, wrq->u.data.pointer, sizeof(in_str)))
return -EFAULT; return -EFAULT;
...@@ -532,8 +548,8 @@ static int wlan_fwt_list_ioctl(wlan_private * priv, struct ifreq *req) ...@@ -532,8 +548,8 @@ static int wlan_fwt_list_ioctl(wlan_private * priv, struct ifreq *req)
#ifdef DEBUG #ifdef DEBUG
{ {
lbs_pr_debug(1, "FWT_LIST: line is %s\n", in_str); lbs_deb_ioctl("FWT_LIST: line is %s\n", in_str);
lbs_pr_debug(1, "FWT_LIST: listing id:%i\n", le32_to_cpu(fwt_access.id)); lbs_deb_ioctl("FWT_LIST: listing id:%i\n", le32_to_cpu(fwt_access.id));
} }
#endif #endif
...@@ -549,11 +565,11 @@ static int wlan_fwt_list_ioctl(wlan_private * priv, struct ifreq *req) ...@@ -549,11 +565,11 @@ static int wlan_fwt_list_ioctl(wlan_private * priv, struct ifreq *req)
wrq->u.data.length = strlen(out_str); wrq->u.data.length = strlen(out_str);
if (copy_to_user(wrq->u.data.pointer, (char *)out_str, if (copy_to_user(wrq->u.data.pointer, (char *)out_str,
wrq->u.data.length)) { wrq->u.data.length)) {
lbs_pr_debug(1, "FWT_LIST: Copy to user failed!\n"); lbs_deb_ioctl("FWT_LIST: Copy to user failed!\n");
return -EFAULT; return -EFAULT;
} }
LEAVE(); lbs_deb_leave(LBS_DEB_IOCTL);
return 0; return 0;
} }
...@@ -573,7 +589,8 @@ static int wlan_fwt_list_route_ioctl(wlan_private * priv, struct ifreq *req) ...@@ -573,7 +589,8 @@ static int wlan_fwt_list_route_ioctl(wlan_private * priv, struct ifreq *req)
char *pbuf = out_str; char *pbuf = out_str;
int ret; int ret;
ENTER(); lbs_deb_enter(LBS_DEB_IOCTL);
if (copy_from_user(in_str, wrq->u.data.pointer, sizeof(in_str))) if (copy_from_user(in_str, wrq->u.data.pointer, sizeof(in_str)))
return -EFAULT; return -EFAULT;
...@@ -581,8 +598,8 @@ static int wlan_fwt_list_route_ioctl(wlan_private * priv, struct ifreq *req) ...@@ -581,8 +598,8 @@ static int wlan_fwt_list_route_ioctl(wlan_private * priv, struct ifreq *req)
#ifdef DEBUG #ifdef DEBUG
{ {
lbs_pr_debug(1, "FWT_LIST_ROUTE: line is %s\n", in_str); lbs_deb_ioctl("FWT_LIST_ROUTE: line is %s\n", in_str);
lbs_pr_debug(1, "FWT_LIST_ROUTE: listing id:%i\n", le32_to_cpu(fwt_access.id)); lbs_deb_ioctl("FWT_LIST_ROUTE: listing id:%i\n", le32_to_cpu(fwt_access.id));
} }
#endif #endif
...@@ -608,11 +625,11 @@ static int wlan_fwt_list_route_ioctl(wlan_private * priv, struct ifreq *req) ...@@ -608,11 +625,11 @@ static int wlan_fwt_list_route_ioctl(wlan_private * priv, struct ifreq *req)
wrq->u.data.length = strlen(out_str); wrq->u.data.length = strlen(out_str);
if (copy_to_user(wrq->u.data.pointer, (char *)out_str, if (copy_to_user(wrq->u.data.pointer, (char *)out_str,
wrq->u.data.length)) { wrq->u.data.length)) {
lbs_pr_debug(1, "FWT_LIST_ROUTE: Copy to user failed!\n"); lbs_deb_ioctl("FWT_LIST_ROUTE: Copy to user failed!\n");
return -EFAULT; return -EFAULT;
} }
LEAVE(); lbs_deb_leave(LBS_DEB_IOCTL);
return 0; return 0;
} }
...@@ -632,7 +649,8 @@ static int wlan_fwt_list_neighbor_ioctl(wlan_private * priv, struct ifreq *req) ...@@ -632,7 +649,8 @@ static int wlan_fwt_list_neighbor_ioctl(wlan_private * priv, struct ifreq *req)
char *pbuf = out_str; char *pbuf = out_str;
int ret; int ret;
ENTER(); lbs_deb_enter(LBS_DEB_IOCTL);
if (copy_from_user(in_str, wrq->u.data.pointer, sizeof(in_str))) if (copy_from_user(in_str, wrq->u.data.pointer, sizeof(in_str)))
return -EFAULT; return -EFAULT;
...@@ -641,8 +659,8 @@ static int wlan_fwt_list_neighbor_ioctl(wlan_private * priv, struct ifreq *req) ...@@ -641,8 +659,8 @@ static int wlan_fwt_list_neighbor_ioctl(wlan_private * priv, struct ifreq *req)
#ifdef DEBUG #ifdef DEBUG
{ {
lbs_pr_debug(1, "FWT_LIST_NEIGHBOR: line is %s\n", in_str); lbs_deb_ioctl("FWT_LIST_NEIGHBOR: line is %s\n", in_str);
lbs_pr_debug(1, "FWT_LIST_NEIGHBOR: listing id:%i\n", le32_to_cpu(fwt_access.id)); lbs_deb_ioctl("FWT_LIST_NEIGHBOR: listing id:%i\n", le32_to_cpu(fwt_access.id));
} }
#endif #endif
...@@ -663,11 +681,11 @@ static int wlan_fwt_list_neighbor_ioctl(wlan_private * priv, struct ifreq *req) ...@@ -663,11 +681,11 @@ static int wlan_fwt_list_neighbor_ioctl(wlan_private * priv, struct ifreq *req)
wrq->u.data.length = strlen(out_str); wrq->u.data.length = strlen(out_str);
if (copy_to_user(wrq->u.data.pointer, (char *)out_str, if (copy_to_user(wrq->u.data.pointer, (char *)out_str,
wrq->u.data.length)) { wrq->u.data.length)) {
lbs_pr_debug(1, "FWT_LIST_NEIGHBOR: Copy to user failed!\n"); lbs_deb_ioctl("FWT_LIST_NEIGHBOR: Copy to user failed!\n");
return -EFAULT; return -EFAULT;
} }
LEAVE(); lbs_deb_leave(LBS_DEB_IOCTL);
return 0; return 0;
} }
...@@ -684,9 +702,9 @@ static int wlan_fwt_cleanup_ioctl(wlan_private * priv, struct ifreq *req) ...@@ -684,9 +702,9 @@ static int wlan_fwt_cleanup_ioctl(wlan_private * priv, struct ifreq *req)
static struct cmd_ds_fwt_access fwt_access; static struct cmd_ds_fwt_access fwt_access;
int ret; int ret;
ENTER(); lbs_deb_enter(LBS_DEB_IOCTL);
lbs_pr_debug(1, "FWT: cleaning up\n"); lbs_deb_ioctl("FWT: cleaning up\n");
memset(&fwt_access, 0, sizeof(fwt_access)); memset(&fwt_access, 0, sizeof(fwt_access));
...@@ -700,7 +718,7 @@ static int wlan_fwt_cleanup_ioctl(wlan_private * priv, struct ifreq *req) ...@@ -700,7 +718,7 @@ static int wlan_fwt_cleanup_ioctl(wlan_private * priv, struct ifreq *req)
else else
return -EFAULT; return -EFAULT;
LEAVE(); lbs_deb_leave(LBS_DEB_IOCTL);
return 0; return 0;
} }
...@@ -716,9 +734,9 @@ static int wlan_fwt_time_ioctl(wlan_private * priv, struct ifreq *req) ...@@ -716,9 +734,9 @@ static int wlan_fwt_time_ioctl(wlan_private * priv, struct ifreq *req)
static struct cmd_ds_fwt_access fwt_access; static struct cmd_ds_fwt_access fwt_access;
int ret; int ret;
ENTER(); lbs_deb_enter(LBS_DEB_IOCTL);
lbs_pr_debug(1, "FWT: getting time\n"); lbs_deb_ioctl("FWT: getting time\n");
memset(&fwt_access, 0, sizeof(fwt_access)); memset(&fwt_access, 0, sizeof(fwt_access));
...@@ -732,7 +750,7 @@ static int wlan_fwt_time_ioctl(wlan_private * priv, struct ifreq *req) ...@@ -732,7 +750,7 @@ static int wlan_fwt_time_ioctl(wlan_private * priv, struct ifreq *req)
else else
return -EFAULT; return -EFAULT;
LEAVE(); lbs_deb_leave(LBS_DEB_IOCTL);
return 0; return 0;
} }
...@@ -748,7 +766,7 @@ static int wlan_mesh_get_ttl_ioctl(wlan_private * priv, struct ifreq *req) ...@@ -748,7 +766,7 @@ static int wlan_mesh_get_ttl_ioctl(wlan_private * priv, struct ifreq *req)
struct cmd_ds_mesh_access mesh_access; struct cmd_ds_mesh_access mesh_access;
int ret; int ret;
ENTER(); lbs_deb_enter(LBS_DEB_IOCTL);
memset(&mesh_access, 0, sizeof(mesh_access)); memset(&mesh_access, 0, sizeof(mesh_access));
...@@ -762,7 +780,7 @@ static int wlan_mesh_get_ttl_ioctl(wlan_private * priv, struct ifreq *req) ...@@ -762,7 +780,7 @@ static int wlan_mesh_get_ttl_ioctl(wlan_private * priv, struct ifreq *req)
else else
return -EFAULT; return -EFAULT;
LEAVE(); lbs_deb_leave(LBS_DEB_IOCTL);
return 0; return 0;
} }
...@@ -777,7 +795,7 @@ static int wlan_mesh_set_ttl_ioctl(wlan_private * priv, int ttl) ...@@ -777,7 +795,7 @@ static int wlan_mesh_set_ttl_ioctl(wlan_private * priv, int ttl)
struct cmd_ds_mesh_access mesh_access; struct cmd_ds_mesh_access mesh_access;
int ret; int ret;
ENTER(); lbs_deb_enter(LBS_DEB_IOCTL);
if( (ttl > 0xff) || (ttl < 0) ) if( (ttl > 0xff) || (ttl < 0) )
return -EINVAL; return -EINVAL;
...@@ -793,7 +811,7 @@ static int wlan_mesh_set_ttl_ioctl(wlan_private * priv, int ttl) ...@@ -793,7 +811,7 @@ static int wlan_mesh_set_ttl_ioctl(wlan_private * priv, int ttl)
if (ret != 0) if (ret != 0)
ret = -EFAULT; ret = -EFAULT;
LEAVE(); lbs_deb_leave(LBS_DEB_IOCTL);
return ret; return ret;
} }
...@@ -815,9 +833,9 @@ int libertas_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd) ...@@ -815,9 +833,9 @@ int libertas_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
wlan_adapter *adapter = priv->adapter; wlan_adapter *adapter = priv->adapter;
struct iwreq *wrq = (struct iwreq *)req; struct iwreq *wrq = (struct iwreq *)req;
ENTER(); lbs_deb_enter(LBS_DEB_IOCTL);
lbs_pr_debug(1, "libertas_do_ioctl: ioctl cmd = 0x%x\n", cmd); lbs_deb_ioctl("libertas_do_ioctl: ioctl cmd = 0x%x\n", cmd);
switch (cmd) { switch (cmd) {
case WLAN_SETNONE_GETNONE: /* set WPA mode on/off ioctl #20 */ case WLAN_SETNONE_GETNONE: /* set WPA mode on/off ioctl #20 */
switch (wrq->u.data.flags) { switch (wrq->u.data.flags) {
...@@ -937,7 +955,7 @@ int libertas_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd) ...@@ -937,7 +955,7 @@ int libertas_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
(data, wrq->u.data.pointer, (data, wrq->u.data.pointer,
sizeof(int) * sizeof(int) *
wrq->u.data.length)) { wrq->u.data.length)) {
lbs_pr_debug(1, lbs_deb_ioctl(
"Copy from user failed\n"); "Copy from user failed\n");
return -EFAULT; return -EFAULT;
} }
...@@ -970,7 +988,7 @@ int libertas_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd) ...@@ -970,7 +988,7 @@ int libertas_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
if (copy_to_user(wrq->u.data.pointer, data, if (copy_to_user(wrq->u.data.pointer, data,
sizeof(int) * sizeof(int) *
gpio->header.len)) { gpio->header.len)) {
lbs_pr_debug(1, "Copy to user failed\n"); lbs_deb_ioctl("Copy to user failed\n");
return -EFAULT; return -EFAULT;
} }
...@@ -984,7 +1002,8 @@ int libertas_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd) ...@@ -984,7 +1002,8 @@ int libertas_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
ret = -EINVAL; ret = -EINVAL;
break; break;
} }
LEAVE();
lbs_deb_leave_args(LBS_DEB_IOCTL, "ret %d", ret);
return ret; return ret;
} }
......
...@@ -60,7 +60,7 @@ static int get_common_rates(wlan_adapter * adapter, u8 * rate1, ...@@ -60,7 +60,7 @@ static int get_common_rates(wlan_adapter * adapter, u8 * rate1,
lbs_dbg_hex("rate1 (AP) rates:", tmp, sizeof(tmp)); lbs_dbg_hex("rate1 (AP) rates:", tmp, sizeof(tmp));
lbs_dbg_hex("rate2 (Card) rates:", rate2, rate2_size); lbs_dbg_hex("rate2 (Card) rates:", rate2, rate2_size);
lbs_dbg_hex("Common rates:", ptr, rate1_size); lbs_dbg_hex("Common rates:", ptr, rate1_size);
lbs_pr_debug(1, "Tx datarate is set to 0x%X\n", adapter->datarate); lbs_deb_join("Tx datarate is set to 0x%X\n", adapter->datarate);
if (!adapter->is_datarate_auto) { if (!adapter->is_datarate_auto) {
while (*ptr) { while (*ptr) {
...@@ -109,16 +109,14 @@ int wlan_associate(wlan_private * priv, struct bss_descriptor * pbssdesc) ...@@ -109,16 +109,14 @@ int wlan_associate(wlan_private * priv, struct bss_descriptor * pbssdesc)
wlan_adapter *adapter = priv->adapter; wlan_adapter *adapter = priv->adapter;
int ret; int ret;
ENTER(); lbs_deb_enter(LBS_DEB_JOIN);
ret = libertas_prepare_and_send_command(priv, cmd_802_11_authenticate, ret = libertas_prepare_and_send_command(priv, cmd_802_11_authenticate,
0, cmd_option_waitforrsp, 0, cmd_option_waitforrsp,
0, pbssdesc->macaddress); 0, pbssdesc->macaddress);
if (ret) { if (ret)
LEAVE(); goto done;
return ret;
}
/* set preamble to firmware */ /* set preamble to firmware */
if (adapter->capinfo.shortpreamble && pbssdesc->cap.shortpreamble) if (adapter->capinfo.shortpreamble && pbssdesc->cap.shortpreamble)
...@@ -131,7 +129,8 @@ int wlan_associate(wlan_private * priv, struct bss_descriptor * pbssdesc) ...@@ -131,7 +129,8 @@ int wlan_associate(wlan_private * priv, struct bss_descriptor * pbssdesc)
ret = libertas_prepare_and_send_command(priv, cmd_802_11_associate, ret = libertas_prepare_and_send_command(priv, cmd_802_11_associate,
0, cmd_option_waitforrsp, 0, pbssdesc); 0, cmd_option_waitforrsp, 0, pbssdesc);
LEAVE(); done:
lbs_deb_leave_args(LBS_DEB_JOIN, "ret %d", ret);
return ret; return ret;
} }
...@@ -150,19 +149,19 @@ int libertas_start_adhoc_network(wlan_private * priv, struct WLAN_802_11_SSID *a ...@@ -150,19 +149,19 @@ int libertas_start_adhoc_network(wlan_private * priv, struct WLAN_802_11_SSID *a
adapter->adhoccreate = 1; adapter->adhoccreate = 1;
if (!adapter->capinfo.shortpreamble) { if (!adapter->capinfo.shortpreamble) {
lbs_pr_debug(1, "AdhocStart: Long preamble\n"); lbs_deb_join("AdhocStart: Long preamble\n");
adapter->preamble = cmd_type_long_preamble; adapter->preamble = cmd_type_long_preamble;
} else { } else {
lbs_pr_debug(1, "AdhocStart: Short preamble\n"); lbs_deb_join("AdhocStart: Short preamble\n");
adapter->preamble = cmd_type_short_preamble; adapter->preamble = cmd_type_short_preamble;
} }
libertas_set_radio_control(priv); libertas_set_radio_control(priv);
lbs_pr_debug(1, "Adhoc channel = %d\n", adapter->adhocchannel); lbs_deb_join("Adhoc channel = %d\n", adapter->adhocchannel);
lbs_pr_debug(1, "curbssparams.channel = %d\n", lbs_deb_join("curbssparams.channel = %d\n",
adapter->curbssparams.channel); adapter->curbssparams.channel);
lbs_pr_debug(1, "curbssparams.band = %d\n", adapter->curbssparams.band); lbs_deb_join("curbssparams.band = %d\n", adapter->curbssparams.band);
ret = libertas_prepare_and_send_command(priv, cmd_802_11_ad_hoc_start, ret = libertas_prepare_and_send_command(priv, cmd_802_11_ad_hoc_start,
0, cmd_option_waitforrsp, 0, adhocssid); 0, cmd_option_waitforrsp, 0, adhocssid);
...@@ -184,12 +183,12 @@ int libertas_join_adhoc_network(wlan_private * priv, struct bss_descriptor * pbs ...@@ -184,12 +183,12 @@ int libertas_join_adhoc_network(wlan_private * priv, struct bss_descriptor * pbs
wlan_adapter *adapter = priv->adapter; wlan_adapter *adapter = priv->adapter;
int ret = 0; int ret = 0;
lbs_pr_debug(1, "libertas_join_adhoc_network: CurBss.ssid =%s\n", lbs_deb_join("libertas_join_adhoc_network: CurBss.ssid =%s\n",
adapter->curbssparams.ssid.ssid); adapter->curbssparams.ssid.ssid);
lbs_pr_debug(1, "libertas_join_adhoc_network: CurBss.ssid_len =%u\n", lbs_deb_join("libertas_join_adhoc_network: CurBss.ssid_len =%u\n",
adapter->curbssparams.ssid.ssidlength); adapter->curbssparams.ssid.ssidlength);
lbs_pr_debug(1, "libertas_join_adhoc_network: ssid =%s\n", pbssdesc->ssid.ssid); lbs_deb_join("libertas_join_adhoc_network: ssid =%s\n", pbssdesc->ssid.ssid);
lbs_pr_debug(1, "libertas_join_adhoc_network: ssid len =%u\n", lbs_deb_join("libertas_join_adhoc_network: ssid len =%u\n",
pbssdesc->ssid.ssidlength); pbssdesc->ssid.ssidlength);
/* check if the requested SSID is already joined */ /* check if the requested SSID is already joined */
...@@ -197,7 +196,7 @@ int libertas_join_adhoc_network(wlan_private * priv, struct bss_descriptor * pbs ...@@ -197,7 +196,7 @@ int libertas_join_adhoc_network(wlan_private * priv, struct bss_descriptor * pbs
&& !libertas_SSID_cmp(&pbssdesc->ssid, &adapter->curbssparams.ssid) && !libertas_SSID_cmp(&pbssdesc->ssid, &adapter->curbssparams.ssid)
&& (adapter->mode == IW_MODE_ADHOC)) { && (adapter->mode == IW_MODE_ADHOC)) {
lbs_pr_debug(1, lbs_deb_join(
"ADHOC_J_CMD: New ad-hoc SSID is the same as current, " "ADHOC_J_CMD: New ad-hoc SSID is the same as current, "
"not attempting to re-join"); "not attempting to re-join");
...@@ -207,18 +206,18 @@ int libertas_join_adhoc_network(wlan_private * priv, struct bss_descriptor * pbs ...@@ -207,18 +206,18 @@ int libertas_join_adhoc_network(wlan_private * priv, struct bss_descriptor * pbs
/*Use shortpreamble only when both creator and card supports /*Use shortpreamble only when both creator and card supports
short preamble */ short preamble */
if (!pbssdesc->cap.shortpreamble || !adapter->capinfo.shortpreamble) { if (!pbssdesc->cap.shortpreamble || !adapter->capinfo.shortpreamble) {
lbs_pr_debug(1, "AdhocJoin: Long preamble\n"); lbs_deb_join("AdhocJoin: Long preamble\n");
adapter->preamble = cmd_type_long_preamble; adapter->preamble = cmd_type_long_preamble;
} else { } else {
lbs_pr_debug(1, "AdhocJoin: Short preamble\n"); lbs_deb_join("AdhocJoin: Short preamble\n");
adapter->preamble = cmd_type_short_preamble; adapter->preamble = cmd_type_short_preamble;
} }
libertas_set_radio_control(priv); libertas_set_radio_control(priv);
lbs_pr_debug(1, "curbssparams.channel = %d\n", lbs_deb_join("curbssparams.channel = %d\n",
adapter->curbssparams.channel); adapter->curbssparams.channel);
lbs_pr_debug(1, "curbssparams.band = %c\n", adapter->curbssparams.band); lbs_deb_join("curbssparams.band = %c\n", adapter->curbssparams.band);
adapter->adhoccreate = 0; adapter->adhoccreate = 0;
...@@ -281,14 +280,14 @@ int libertas_cmd_80211_authenticate(wlan_private * priv, ...@@ -281,14 +280,14 @@ int libertas_cmd_80211_authenticate(wlan_private * priv,
pauthenticate->authtype = 0x80; pauthenticate->authtype = 0x80;
break; break;
default: default:
lbs_pr_debug(1, "AUTH_CMD: invalid auth alg 0x%X\n", lbs_deb_join("AUTH_CMD: invalid auth alg 0x%X\n",
adapter->secinfo.auth_mode); adapter->secinfo.auth_mode);
goto out; goto out;
} }
memcpy(pauthenticate->macaddr, bssid, ETH_ALEN); memcpy(pauthenticate->macaddr, bssid, ETH_ALEN);
lbs_pr_debug(1, "AUTH_CMD: Bssid is : %x:%x:%x:%x:%x:%x\n", lbs_deb_join("AUTH_CMD: Bssid is : %x:%x:%x:%x:%x:%x\n",
bssid[0], bssid[1], bssid[2], bssid[3], bssid[4], bssid[5]); bssid[0], bssid[1], bssid[2], bssid[3], bssid[4], bssid[5]);
ret = 0; ret = 0;
...@@ -302,7 +301,7 @@ int libertas_cmd_80211_deauthenticate(wlan_private * priv, ...@@ -302,7 +301,7 @@ int libertas_cmd_80211_deauthenticate(wlan_private * priv,
wlan_adapter *adapter = priv->adapter; wlan_adapter *adapter = priv->adapter;
struct cmd_ds_802_11_deauthenticate *dauth = &cmd->params.deauth; struct cmd_ds_802_11_deauthenticate *dauth = &cmd->params.deauth;
ENTER(); lbs_deb_enter(LBS_DEB_JOIN);
cmd->command = cpu_to_le16(cmd_802_11_deauthenticate); cmd->command = cpu_to_le16(cmd_802_11_deauthenticate);
cmd->size = cmd->size =
...@@ -317,7 +316,7 @@ int libertas_cmd_80211_deauthenticate(wlan_private * priv, ...@@ -317,7 +316,7 @@ int libertas_cmd_80211_deauthenticate(wlan_private * priv,
#define REASON_CODE_STA_LEAVING 3 #define REASON_CODE_STA_LEAVING 3
dauth->reasoncode = cpu_to_le16(REASON_CODE_STA_LEAVING); dauth->reasoncode = cpu_to_le16(REASON_CODE_STA_LEAVING);
LEAVE(); lbs_deb_leave(LBS_DEB_JOIN);
return 0; return 0;
} }
...@@ -338,7 +337,7 @@ int libertas_cmd_80211_associate(wlan_private * priv, ...@@ -338,7 +337,7 @@ int libertas_cmd_80211_associate(wlan_private * priv,
struct mrvlietypes_ratesparamset *rates; struct mrvlietypes_ratesparamset *rates;
struct mrvlietypes_rsnparamset *rsn; struct mrvlietypes_rsnparamset *rsn;
ENTER(); lbs_deb_enter(LBS_DEB_JOIN);
pbssdesc = pdata_buf; pbssdesc = pdata_buf;
pos = (u8 *) passo; pos = (u8 *) passo;
...@@ -427,7 +426,7 @@ int libertas_cmd_80211_associate(wlan_private * priv, ...@@ -427,7 +426,7 @@ int libertas_cmd_80211_associate(wlan_private * priv,
memcpy(&adapter->curbssparams.datarates, &rates->rates, memcpy(&adapter->curbssparams.datarates, &rates->rates,
min_t(size_t, sizeof(adapter->curbssparams.datarates), rates->header.len)); min_t(size_t, sizeof(adapter->curbssparams.datarates), rates->header.len));
lbs_pr_debug(1, "ASSOC_CMD: rates->header.len = %d\n", rates->header.len); lbs_deb_join("ASSOC_CMD: rates->header.len = %d\n", rates->header.len);
/* set IBSS field */ /* set IBSS field */
if (pbssdesc->mode == IW_MODE_INFRA) { if (pbssdesc->mode == IW_MODE_INFRA) {
...@@ -445,13 +444,13 @@ int libertas_cmd_80211_associate(wlan_private * priv, ...@@ -445,13 +444,13 @@ int libertas_cmd_80211_associate(wlan_private * priv,
/* set the capability info at last */ /* set the capability info at last */
memcpy(&tmpcap, &pbssdesc->cap, sizeof(passo->capinfo)); memcpy(&tmpcap, &pbssdesc->cap, sizeof(passo->capinfo));
tmpcap &= CAPINFO_MASK; tmpcap &= CAPINFO_MASK;
lbs_pr_debug(1, "ASSOC_CMD: tmpcap=%4X CAPINFO_MASK=%4X\n", lbs_deb_join("ASSOC_CMD: tmpcap=%4X CAPINFO_MASK=%4X\n",
tmpcap, CAPINFO_MASK); tmpcap, CAPINFO_MASK);
tmpcap = cpu_to_le16(tmpcap); tmpcap = cpu_to_le16(tmpcap);
memcpy(&passo->capinfo, &tmpcap, sizeof(passo->capinfo)); memcpy(&passo->capinfo, &tmpcap, sizeof(passo->capinfo));
done: done:
LEAVE(); lbs_deb_leave_args(LBS_DEB_JOIN, "ret %d", ret);
return ret; return ret;
} }
...@@ -467,7 +466,7 @@ int libertas_cmd_80211_ad_hoc_start(wlan_private * priv, ...@@ -467,7 +466,7 @@ int libertas_cmd_80211_ad_hoc_start(wlan_private * priv,
struct bss_descriptor *pbssdesc; struct bss_descriptor *pbssdesc;
struct WLAN_802_11_SSID *ssid = pssid; struct WLAN_802_11_SSID *ssid = pssid;
ENTER(); lbs_deb_enter(LBS_DEB_JOIN);
if (!adapter) { if (!adapter) {
ret = -1; ret = -1;
...@@ -495,7 +494,7 @@ int libertas_cmd_80211_ad_hoc_start(wlan_private * priv, ...@@ -495,7 +494,7 @@ int libertas_cmd_80211_ad_hoc_start(wlan_private * priv,
memcpy(adhs->SSID, ssid->ssid, ssid->ssidlength); memcpy(adhs->SSID, ssid->ssid, ssid->ssidlength);
lbs_pr_debug(1, "ADHOC_S_CMD: SSID = %s\n", adhs->SSID); lbs_deb_join("ADHOC_S_CMD: SSID = %s\n", adhs->SSID);
memset(pbssdesc->ssid.ssid, 0, IW_ESSID_MAX_SIZE); memset(pbssdesc->ssid.ssid, 0, IW_ESSID_MAX_SIZE);
memcpy(pbssdesc->ssid.ssid, ssid->ssid, ssid->ssidlength); memcpy(pbssdesc->ssid.ssid, ssid->ssid, ssid->ssidlength);
...@@ -516,7 +515,7 @@ int libertas_cmd_80211_ad_hoc_start(wlan_private * priv, ...@@ -516,7 +515,7 @@ int libertas_cmd_80211_ad_hoc_start(wlan_private * priv,
WARN_ON(!adapter->adhocchannel); WARN_ON(!adapter->adhocchannel);
lbs_pr_debug(1, "ADHOC_S_CMD: Creating ADHOC on channel %d\n", lbs_deb_join("ADHOC_S_CMD: Creating ADHOC on channel %d\n",
adapter->adhocchannel); adapter->adhocchannel);
adapter->curbssparams.channel = adapter->adhocchannel; adapter->curbssparams.channel = adapter->adhocchannel;
...@@ -547,11 +546,11 @@ int libertas_cmd_80211_ad_hoc_start(wlan_private * priv, ...@@ -547,11 +546,11 @@ int libertas_cmd_80211_ad_hoc_start(wlan_private * priv,
/* set up privacy in adapter->scantable[i] */ /* set up privacy in adapter->scantable[i] */
if (adapter->secinfo.wep_enabled) { if (adapter->secinfo.wep_enabled) {
lbs_pr_debug(1, "ADHOC_S_CMD: WEP enabled, setting privacy on\n"); lbs_deb_join("ADHOC_S_CMD: WEP enabled, setting privacy on\n");
pbssdesc->privacy = wlan802_11privfilter8021xWEP; pbssdesc->privacy = wlan802_11privfilter8021xWEP;
adhs->cap.privacy = AD_HOC_CAP_PRIVACY_ON; adhs->cap.privacy = AD_HOC_CAP_PRIVACY_ON;
} else { } else {
lbs_pr_debug(1, "ADHOC_S_CMD: WEP disabled, setting privacy off\n"); lbs_deb_join("ADHOC_S_CMD: WEP disabled, setting privacy off\n");
pbssdesc->privacy = wlan802_11privfilteracceptall; pbssdesc->privacy = wlan802_11privfilteracceptall;
} }
...@@ -574,14 +573,14 @@ int libertas_cmd_80211_ad_hoc_start(wlan_private * priv, ...@@ -574,14 +573,14 @@ int libertas_cmd_80211_ad_hoc_start(wlan_private * priv,
memcpy(&adapter->curbssparams.datarates, memcpy(&adapter->curbssparams.datarates,
&adhs->datarate, adapter->curbssparams.numofrates); &adhs->datarate, adapter->curbssparams.numofrates);
lbs_pr_debug(1, "ADHOC_S_CMD: rates=%02x %02x %02x %02x \n", lbs_deb_join("ADHOC_S_CMD: rates=%02x %02x %02x %02x \n",
adhs->datarate[0], adhs->datarate[1], adhs->datarate[0], adhs->datarate[1],
adhs->datarate[2], adhs->datarate[3]); adhs->datarate[2], adhs->datarate[3]);
lbs_pr_debug(1, "ADHOC_S_CMD: AD HOC Start command is ready\n"); lbs_deb_join("ADHOC_S_CMD: AD HOC Start command is ready\n");
if (libertas_create_dnld_countryinfo_11d(priv)) { if (libertas_create_dnld_countryinfo_11d(priv)) {
lbs_pr_debug(1, "ADHOC_S_CMD: dnld_countryinfo_11d failed\n"); lbs_deb_join("ADHOC_S_CMD: dnld_countryinfo_11d failed\n");
ret = -1; ret = -1;
goto done; goto done;
} }
...@@ -596,7 +595,7 @@ int libertas_cmd_80211_ad_hoc_start(wlan_private * priv, ...@@ -596,7 +595,7 @@ int libertas_cmd_80211_ad_hoc_start(wlan_private * priv,
ret = 0; ret = 0;
done: done:
LEAVE(); lbs_deb_leave_args(LBS_DEB_JOIN, "ret %d", ret);
return ret; return ret;
} }
...@@ -622,7 +621,7 @@ int libertas_cmd_80211_ad_hoc_join(wlan_private * priv, ...@@ -622,7 +621,7 @@ int libertas_cmd_80211_ad_hoc_join(wlan_private * priv,
u16 tmpcap; u16 tmpcap;
int i; int i;
ENTER(); lbs_deb_enter(LBS_DEB_JOIN);
adapter->pattemptedbssdesc = pbssdesc; adapter->pattemptedbssdesc = pbssdesc;
...@@ -647,13 +646,13 @@ int libertas_cmd_80211_ad_hoc_join(wlan_private * priv, ...@@ -647,13 +646,13 @@ int libertas_cmd_80211_ad_hoc_join(wlan_private * priv,
memcpy(&tmpcap, &pbssdesc->cap, sizeof(struct ieeetypes_capinfo)); memcpy(&tmpcap, &pbssdesc->cap, sizeof(struct ieeetypes_capinfo));
tmpcap &= CAPINFO_MASK; tmpcap &= CAPINFO_MASK;
lbs_pr_debug(1, "ADHOC_J_CMD: tmpcap=%4X CAPINFO_MASK=%4X\n", lbs_deb_join("ADHOC_J_CMD: tmpcap=%4X CAPINFO_MASK=%4X\n",
tmpcap, CAPINFO_MASK); tmpcap, CAPINFO_MASK);
memcpy(&padhocjoin->bssdescriptor.cap, &tmpcap, memcpy(&padhocjoin->bssdescriptor.cap, &tmpcap,
sizeof(struct ieeetypes_capinfo)); sizeof(struct ieeetypes_capinfo));
/* information on BSSID descriptor passed to FW */ /* information on BSSID descriptor passed to FW */
lbs_pr_debug(1, lbs_deb_join(
"ADHOC_J_CMD: BSSID = %2x-%2x-%2x-%2x-%2x-%2x, SSID = %s\n", "ADHOC_J_CMD: BSSID = %2x-%2x-%2x-%2x-%2x-%2x, SSID = %s\n",
padhocjoin->bssdescriptor.BSSID[0], padhocjoin->bssdescriptor.BSSID[0],
padhocjoin->bssdescriptor.BSSID[1], padhocjoin->bssdescriptor.BSSID[1],
...@@ -685,7 +684,7 @@ int libertas_cmd_80211_ad_hoc_join(wlan_private * priv, ...@@ -685,7 +684,7 @@ int libertas_cmd_80211_ad_hoc_join(wlan_private * priv,
if (get_common_rates(adapter, padhocjoin->bssdescriptor.datarates, if (get_common_rates(adapter, padhocjoin->bssdescriptor.datarates,
sizeof(padhocjoin->bssdescriptor.datarates), sizeof(padhocjoin->bssdescriptor.datarates),
card_rates, card_rates_size)) { card_rates, card_rates_size)) {
lbs_pr_debug(1, "ADHOC_J_CMD: get_common_rates returns error.\n"); lbs_deb_join("ADHOC_J_CMD: get_common_rates returns error.\n");
ret = -1; ret = -1;
goto done; goto done;
} }
...@@ -742,8 +741,8 @@ int libertas_cmd_80211_ad_hoc_join(wlan_private * priv, ...@@ -742,8 +741,8 @@ int libertas_cmd_80211_ad_hoc_join(wlan_private * priv,
memcpy(&padhocjoin->bssdescriptor.cap, memcpy(&padhocjoin->bssdescriptor.cap,
&tmpcap, sizeof(struct ieeetypes_capinfo)); &tmpcap, sizeof(struct ieeetypes_capinfo));
done: done:
LEAVE(); lbs_deb_leave_args(LBS_DEB_JOIN, "ret %d", ret);
return ret; return ret;
} }
...@@ -756,7 +755,7 @@ int libertas_ret_80211_associate(wlan_private * priv, ...@@ -756,7 +755,7 @@ int libertas_ret_80211_associate(wlan_private * priv,
struct ieeetypes_assocrsp *passocrsp; struct ieeetypes_assocrsp *passocrsp;
struct bss_descriptor *pbssdesc; struct bss_descriptor *pbssdesc;
ENTER(); lbs_deb_enter(LBS_DEB_JOIN);
passocrsp = (struct ieeetypes_assocrsp *) & resp->params; passocrsp = (struct ieeetypes_assocrsp *) & resp->params;
...@@ -764,9 +763,8 @@ int libertas_ret_80211_associate(wlan_private * priv, ...@@ -764,9 +763,8 @@ int libertas_ret_80211_associate(wlan_private * priv,
libertas_mac_event_disconnected(priv); libertas_mac_event_disconnected(priv);
lbs_pr_debug(1, lbs_deb_join("ASSOC_RESP: Association failed, status code = %d\n",
"ASSOC_RESP: Association failed, status code = %d\n", passocrsp->statuscode);
passocrsp->statuscode);
ret = -1; ret = -1;
goto done; goto done;
...@@ -781,7 +779,7 @@ int libertas_ret_80211_associate(wlan_private * priv, ...@@ -781,7 +779,7 @@ int libertas_ret_80211_associate(wlan_private * priv,
/* Set the attempted BSSID Index to current */ /* Set the attempted BSSID Index to current */
pbssdesc = adapter->pattemptedbssdesc; pbssdesc = adapter->pattemptedbssdesc;
lbs_pr_debug(1, "ASSOC_RESP: %s\n", pbssdesc->ssid.ssid); lbs_deb_join("ASSOC_RESP: %s\n", pbssdesc->ssid.ssid);
/* Set the new SSID to current SSID */ /* Set the new SSID to current SSID */
memcpy(&adapter->curbssparams.ssid, memcpy(&adapter->curbssparams.ssid,
...@@ -795,7 +793,7 @@ int libertas_ret_80211_associate(wlan_private * priv, ...@@ -795,7 +793,7 @@ int libertas_ret_80211_associate(wlan_private * priv,
memcpy(&adapter->curbssparams.bssdescriptor, memcpy(&adapter->curbssparams.bssdescriptor,
pbssdesc, sizeof(struct bss_descriptor)); pbssdesc, sizeof(struct bss_descriptor));
lbs_pr_debug(1, "ASSOC_RESP: currentpacketfilter is %x\n", lbs_deb_join("ASSOC_RESP: currentpacketfilter is %x\n",
adapter->currentpacketfilter); adapter->currentpacketfilter);
adapter->SNR[TYPE_RXPD][TYPE_AVG] = 0; adapter->SNR[TYPE_RXPD][TYPE_AVG] = 0;
...@@ -809,25 +807,25 @@ int libertas_ret_80211_associate(wlan_private * priv, ...@@ -809,25 +807,25 @@ int libertas_ret_80211_associate(wlan_private * priv,
netif_carrier_on(priv->wlan_dev.netdev); netif_carrier_on(priv->wlan_dev.netdev);
netif_wake_queue(priv->wlan_dev.netdev); netif_wake_queue(priv->wlan_dev.netdev);
lbs_pr_debug(1, "ASSOC_RESP: Associated \n"); lbs_deb_join("ASSOC_RESP: Associated \n");
memcpy(wrqu.ap_addr.sa_data, adapter->curbssparams.bssid, ETH_ALEN); memcpy(wrqu.ap_addr.sa_data, adapter->curbssparams.bssid, ETH_ALEN);
wrqu.ap_addr.sa_family = ARPHRD_ETHER; wrqu.ap_addr.sa_family = ARPHRD_ETHER;
wireless_send_event(priv->wlan_dev.netdev, SIOCGIWAP, &wrqu, NULL); wireless_send_event(priv->wlan_dev.netdev, SIOCGIWAP, &wrqu, NULL);
done: done:
LEAVE(); lbs_deb_leave_args(LBS_DEB_JOIN, "ret %d", ret);
return ret; return ret;
} }
int libertas_ret_80211_disassociate(wlan_private * priv, int libertas_ret_80211_disassociate(wlan_private * priv,
struct cmd_ds_command *resp) struct cmd_ds_command *resp)
{ {
ENTER(); lbs_deb_enter(LBS_DEB_JOIN);
libertas_mac_event_disconnected(priv); libertas_mac_event_disconnected(priv);
LEAVE(); lbs_deb_leave(LBS_DEB_JOIN);
return 0; return 0;
} }
...@@ -842,13 +840,13 @@ int libertas_ret_80211_ad_hoc_start(wlan_private * priv, ...@@ -842,13 +840,13 @@ int libertas_ret_80211_ad_hoc_start(wlan_private * priv,
union iwreq_data wrqu; union iwreq_data wrqu;
struct bss_descriptor *pbssdesc; struct bss_descriptor *pbssdesc;
ENTER(); lbs_deb_enter(LBS_DEB_JOIN);
padhocresult = &resp->params.result; padhocresult = &resp->params.result;
lbs_pr_debug(1, "ADHOC_S_RESP: size = %d\n", le16_to_cpu(resp->size)); lbs_deb_join("ADHOC_S_RESP: size = %d\n", le16_to_cpu(resp->size));
lbs_pr_debug(1, "ADHOC_S_RESP: command = %x\n", command); lbs_deb_join("ADHOC_S_RESP: command = %x\n", command);
lbs_pr_debug(1, "ADHOC_S_RESP: result = %x\n", result); lbs_deb_join("ADHOC_S_RESP: result = %x\n", result);
pbssdesc = adapter->pattemptedbssdesc; pbssdesc = adapter->pattemptedbssdesc;
...@@ -856,7 +854,7 @@ int libertas_ret_80211_ad_hoc_start(wlan_private * priv, ...@@ -856,7 +854,7 @@ int libertas_ret_80211_ad_hoc_start(wlan_private * priv,
* Join result code 0 --> SUCCESS * Join result code 0 --> SUCCESS
*/ */
if (result) { if (result) {
lbs_pr_debug(1, "ADHOC_RESP failed\n"); lbs_deb_join("ADHOC_RESP failed\n");
if (adapter->connect_status == libertas_connected) { if (adapter->connect_status == libertas_connected) {
libertas_mac_event_disconnected(priv); libertas_mac_event_disconnected(priv);
} }
...@@ -864,15 +862,15 @@ int libertas_ret_80211_ad_hoc_start(wlan_private * priv, ...@@ -864,15 +862,15 @@ int libertas_ret_80211_ad_hoc_start(wlan_private * priv,
memset(&adapter->curbssparams.bssdescriptor, memset(&adapter->curbssparams.bssdescriptor,
0x00, sizeof(adapter->curbssparams.bssdescriptor)); 0x00, sizeof(adapter->curbssparams.bssdescriptor));
LEAVE(); ret = -1;
return -1; goto done;
} }
/* /*
* Now the join cmd should be successful * Now the join cmd should be successful
* If BSSID has changed use SSID to compare instead of BSSID * If BSSID has changed use SSID to compare instead of BSSID
*/ */
lbs_pr_debug(1, "ADHOC_J_RESP %s\n", pbssdesc->ssid.ssid); lbs_deb_join("ADHOC_J_RESP %s\n", pbssdesc->ssid.ssid);
/* Send a Media Connected event, according to the Spec */ /* Send a Media Connected event, according to the Spec */
adapter->connect_status = libertas_connected; adapter->connect_status = libertas_connected;
...@@ -906,24 +904,25 @@ int libertas_ret_80211_ad_hoc_start(wlan_private * priv, ...@@ -906,24 +904,25 @@ int libertas_ret_80211_ad_hoc_start(wlan_private * priv,
wrqu.ap_addr.sa_family = ARPHRD_ETHER; wrqu.ap_addr.sa_family = ARPHRD_ETHER;
wireless_send_event(priv->wlan_dev.netdev, SIOCGIWAP, &wrqu, NULL); wireless_send_event(priv->wlan_dev.netdev, SIOCGIWAP, &wrqu, NULL);
lbs_pr_debug(1, "ADHOC_RESP: - Joined/Started Ad Hoc\n"); lbs_deb_join("ADHOC_RESP: - Joined/Started Ad Hoc\n");
lbs_pr_debug(1, "ADHOC_RESP: channel = %d\n", adapter->adhocchannel); lbs_deb_join("ADHOC_RESP: channel = %d\n", adapter->adhocchannel);
lbs_pr_debug(1, "ADHOC_RESP: BSSID = %02x:%02x:%02x:%02x:%02x:%02x\n", lbs_deb_join("ADHOC_RESP: BSSID = %02x:%02x:%02x:%02x:%02x:%02x\n",
padhocresult->BSSID[0], padhocresult->BSSID[1], padhocresult->BSSID[0], padhocresult->BSSID[1],
padhocresult->BSSID[2], padhocresult->BSSID[3], padhocresult->BSSID[2], padhocresult->BSSID[3],
padhocresult->BSSID[4], padhocresult->BSSID[5]); padhocresult->BSSID[4], padhocresult->BSSID[5]);
LEAVE(); done:
lbs_deb_leave_args(LBS_DEB_JOIN, "ret %d", ret);
return ret; return ret;
} }
int libertas_ret_80211_ad_hoc_stop(wlan_private * priv, int libertas_ret_80211_ad_hoc_stop(wlan_private * priv,
struct cmd_ds_command *resp) struct cmd_ds_command *resp)
{ {
ENTER(); lbs_deb_enter(LBS_DEB_JOIN);
libertas_mac_event_disconnected(priv); libertas_mac_event_disconnected(priv);
LEAVE(); lbs_deb_leave(LBS_DEB_JOIN);
return 0; return 0;
} }
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <linux/if_arp.h> #include <linux/if_arp.h>
#include <net/iw_handler.h> #include <net/iw_handler.h>
#include <net/ieee80211.h>
#include "host.h" #include "host.h"
#include "sbi.h" #include "sbi.h"
...@@ -227,7 +228,8 @@ static DEVICE_ATTR(libertas_mpp, 0644, libertas_mpp_get, ...@@ -227,7 +228,8 @@ static DEVICE_ATTR(libertas_mpp, 0644, libertas_mpp_get,
* function to work around the issue. * function to work around the issue.
* *
*/ */
static int pre_open_check(struct net_device *dev) { static int pre_open_check(struct net_device *dev)
{
wlan_private *priv = (wlan_private *) dev->priv; wlan_private *priv = (wlan_private *) dev->priv;
wlan_adapter *adapter = priv->adapter; wlan_adapter *adapter = priv->adapter;
int i = 0; int i = 0;
...@@ -237,8 +239,7 @@ static int pre_open_check(struct net_device *dev) { ...@@ -237,8 +239,7 @@ static int pre_open_check(struct net_device *dev) {
msleep_interruptible(100); msleep_interruptible(100);
} }
if (!adapter->fw_ready) { if (!adapter->fw_ready) {
lbs_pr_info("FW not ready, pre_open_check() return failure\n"); lbs_pr_err("firmware not ready\n");
LEAVE();
return -1; return -1;
} }
...@@ -256,8 +257,7 @@ static int wlan_dev_open(struct net_device *dev) ...@@ -256,8 +257,7 @@ static int wlan_dev_open(struct net_device *dev)
wlan_private *priv = (wlan_private *) dev->priv; wlan_private *priv = (wlan_private *) dev->priv;
wlan_adapter *adapter = priv->adapter; wlan_adapter *adapter = priv->adapter;
ENTER(); lbs_deb_enter(LBS_DEB_NET);
priv->open = 1; priv->open = 1;
...@@ -266,7 +266,7 @@ static int wlan_dev_open(struct net_device *dev) ...@@ -266,7 +266,7 @@ static int wlan_dev_open(struct net_device *dev)
} else } else
netif_carrier_off(priv->wlan_dev.netdev); netif_carrier_off(priv->wlan_dev.netdev);
LEAVE(); lbs_deb_leave(LBS_DEB_NET);
return 0; return 0;
} }
/** /**
...@@ -311,12 +311,12 @@ static int wlan_dev_close(struct net_device *dev) ...@@ -311,12 +311,12 @@ static int wlan_dev_close(struct net_device *dev)
{ {
wlan_private *priv = dev->priv; wlan_private *priv = dev->priv;
ENTER(); lbs_deb_enter(LBS_DEB_NET);
netif_carrier_off(priv->wlan_dev.netdev); netif_carrier_off(priv->wlan_dev.netdev);
priv->open = 0; priv->open = 0;
LEAVE(); lbs_deb_leave(LBS_DEB_NET);
return 0; return 0;
} }
...@@ -361,7 +361,7 @@ static int wlan_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -361,7 +361,7 @@ static int wlan_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
int ret = 0; int ret = 0;
wlan_private *priv = dev->priv; wlan_private *priv = dev->priv;
ENTER(); lbs_deb_enter(LBS_DEB_NET);
if (priv->wlan_dev.dnld_sent || priv->adapter->TxLockFlag) { if (priv->wlan_dev.dnld_sent || priv->adapter->TxLockFlag) {
priv->stats.tx_dropped++; priv->stats.tx_dropped++;
...@@ -373,7 +373,7 @@ static int wlan_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -373,7 +373,7 @@ static int wlan_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
if (libertas_process_tx(priv, skb) == 0) if (libertas_process_tx(priv, skb) == 0)
dev->trans_start = jiffies; dev->trans_start = jiffies;
done: done:
LEAVE(); lbs_deb_leave_args(LBS_DEB_NET, "ret %d", ret);
return ret; return ret;
} }
...@@ -384,31 +384,41 @@ static int wlan_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -384,31 +384,41 @@ static int wlan_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
static int mesh_pre_start_xmit(struct sk_buff *skb, struct net_device *dev) static int mesh_pre_start_xmit(struct sk_buff *skb, struct net_device *dev)
{ {
wlan_private *priv = dev->priv; wlan_private *priv = dev->priv;
ENTER(); int ret;
lbs_deb_enter(LBS_DEB_MESH);
SET_MESH_FRAME(skb); SET_MESH_FRAME(skb);
LEAVE();
return wlan_hard_start_xmit(skb, priv->wlan_dev.netdev); ret = wlan_hard_start_xmit(skb, priv->wlan_dev.netdev);
lbs_deb_leave_args(LBS_DEB_MESH, "ret %d", ret);
return ret;
} }
/** /**
* @brief Mark non-mesh packets and handover them to wlan_hard_start_xmit * @brief Mark non-mesh packets and handover them to wlan_hard_start_xmit
* *
*/ */
static int wlan_pre_start_xmit(struct sk_buff *skb, struct net_device *dev) { static int wlan_pre_start_xmit(struct sk_buff *skb, struct net_device *dev)
ENTER(); {
int ret;
lbs_deb_enter(LBS_DEB_NET);
UNSET_MESH_FRAME(skb); UNSET_MESH_FRAME(skb);
LEAVE();
return wlan_hard_start_xmit(skb, dev); ret = wlan_hard_start_xmit(skb, dev);
lbs_deb_leave_args(LBS_DEB_NET, "ret %d", ret);
return ret;
} }
static void wlan_tx_timeout(struct net_device *dev) static void wlan_tx_timeout(struct net_device *dev)
{ {
wlan_private *priv = (wlan_private *) dev->priv; wlan_private *priv = (wlan_private *) dev->priv;
ENTER(); lbs_deb_enter(LBS_DEB_TX);
lbs_pr_err("tx watch dog timeout!\n"); lbs_pr_err("tx watch dog timeout\n");
priv->wlan_dev.dnld_sent = DNLD_RES_RECEIVED; priv->wlan_dev.dnld_sent = DNLD_RES_RECEIVED;
dev->trans_start = jiffies; dev->trans_start = jiffies;
...@@ -424,7 +434,7 @@ static void wlan_tx_timeout(struct net_device *dev) ...@@ -424,7 +434,7 @@ static void wlan_tx_timeout(struct net_device *dev)
} else if (priv->adapter->connect_status == libertas_connected) } else if (priv->adapter->connect_status == libertas_connected)
netif_wake_queue(priv->wlan_dev.netdev); netif_wake_queue(priv->wlan_dev.netdev);
LEAVE(); lbs_deb_leave(LBS_DEB_TX);
} }
/** /**
...@@ -447,7 +457,7 @@ static int wlan_set_mac_address(struct net_device *dev, void *addr) ...@@ -447,7 +457,7 @@ static int wlan_set_mac_address(struct net_device *dev, void *addr)
wlan_adapter *adapter = priv->adapter; wlan_adapter *adapter = priv->adapter;
struct sockaddr *phwaddr = addr; struct sockaddr *phwaddr = addr;
ENTER(); lbs_deb_enter(LBS_DEB_NET);
memset(adapter->current_addr, 0, ETH_ALEN); memset(adapter->current_addr, 0, ETH_ALEN);
...@@ -462,7 +472,7 @@ static int wlan_set_mac_address(struct net_device *dev, void *addr) ...@@ -462,7 +472,7 @@ static int wlan_set_mac_address(struct net_device *dev, void *addr)
cmd_option_waitforrsp, 0, NULL); cmd_option_waitforrsp, 0, NULL);
if (ret) { if (ret) {
lbs_pr_debug(1, "set mac address failed.\n"); lbs_deb_net("set MAC address failed\n");
ret = -1; ret = -1;
goto done; goto done;
} }
...@@ -472,7 +482,7 @@ static int wlan_set_mac_address(struct net_device *dev, void *addr) ...@@ -472,7 +482,7 @@ static int wlan_set_mac_address(struct net_device *dev, void *addr)
memcpy(((wlan_private *) dev->priv)->mesh_dev->dev_addr, adapter->current_addr, ETH_ALEN); memcpy(((wlan_private *) dev->priv)->mesh_dev->dev_addr, adapter->current_addr, ETH_ALEN);
done: done:
LEAVE(); lbs_deb_leave_args(LBS_DEB_NET, "ret %d", ret);
return ret; return ret;
} }
...@@ -497,12 +507,12 @@ static void wlan_set_multicast_list(struct net_device *dev) ...@@ -497,12 +507,12 @@ static void wlan_set_multicast_list(struct net_device *dev)
wlan_adapter *adapter = priv->adapter; wlan_adapter *adapter = priv->adapter;
int oldpacketfilter; int oldpacketfilter;
ENTER(); lbs_deb_enter(LBS_DEB_NET);
oldpacketfilter = adapter->currentpacketfilter; oldpacketfilter = adapter->currentpacketfilter;
if (dev->flags & IFF_PROMISC) { if (dev->flags & IFF_PROMISC) {
lbs_pr_debug(1, "enable Promiscuous mode\n"); lbs_deb_net("enable promiscuous mode\n");
adapter->currentpacketfilter |= adapter->currentpacketfilter |=
cmd_act_mac_promiscuous_enable; cmd_act_mac_promiscuous_enable;
adapter->currentpacketfilter &= adapter->currentpacketfilter &=
...@@ -515,7 +525,7 @@ static void wlan_set_multicast_list(struct net_device *dev) ...@@ -515,7 +525,7 @@ static void wlan_set_multicast_list(struct net_device *dev)
if (dev->flags & IFF_ALLMULTI || dev->mc_count > if (dev->flags & IFF_ALLMULTI || dev->mc_count >
MRVDRV_MAX_MULTICAST_LIST_SIZE) { MRVDRV_MAX_MULTICAST_LIST_SIZE) {
lbs_pr_debug(1, "Enabling All Multicast!\n"); lbs_deb_net( "enabling all multicast\n");
adapter->currentpacketfilter |= adapter->currentpacketfilter |=
cmd_act_mac_all_multicast_enable; cmd_act_mac_all_multicast_enable;
adapter->currentpacketfilter &= adapter->currentpacketfilter &=
...@@ -525,8 +535,8 @@ static void wlan_set_multicast_list(struct net_device *dev) ...@@ -525,8 +535,8 @@ static void wlan_set_multicast_list(struct net_device *dev)
~cmd_act_mac_all_multicast_enable; ~cmd_act_mac_all_multicast_enable;
if (!dev->mc_count) { if (!dev->mc_count) {
lbs_pr_debug(1, "No multicast addresses - " lbs_deb_net("no multicast addresses, "
"disabling multicast!\n"); "disabling multicast\n");
adapter->currentpacketfilter &= adapter->currentpacketfilter &=
~cmd_act_mac_multicast_enable; ~cmd_act_mac_multicast_enable;
} else { } else {
...@@ -538,12 +548,12 @@ static void wlan_set_multicast_list(struct net_device *dev) ...@@ -538,12 +548,12 @@ static void wlan_set_multicast_list(struct net_device *dev)
adapter->nr_of_multicastmacaddr = adapter->nr_of_multicastmacaddr =
wlan_copy_multicast_address(adapter, dev); wlan_copy_multicast_address(adapter, dev);
lbs_pr_debug(1, "Multicast addresses: %d\n", lbs_deb_net("multicast addresses: %d\n",
dev->mc_count); dev->mc_count);
for (i = 0; i < dev->mc_count; i++) { for (i = 0; i < dev->mc_count; i++) {
lbs_pr_debug(1, "Multicast address %d:" lbs_deb_net("Multicast address %d:"
"%x %x %x %x %x %x\n", i, MAC_FMT "\n", i,
adapter->multicastlist[i][0], adapter->multicastlist[i][0],
adapter->multicastlist[i][1], adapter->multicastlist[i][1],
adapter->multicastlist[i][2], adapter->multicastlist[i][2],
...@@ -551,7 +561,7 @@ static void wlan_set_multicast_list(struct net_device *dev) ...@@ -551,7 +561,7 @@ static void wlan_set_multicast_list(struct net_device *dev)
adapter->multicastlist[i][4], adapter->multicastlist[i][4],
adapter->multicastlist[i][5]); adapter->multicastlist[i][5]);
} }
/* set multicast addresses to firmware */ /* send multicast addresses to firmware */
libertas_prepare_and_send_command(priv, libertas_prepare_and_send_command(priv,
cmd_mac_multicast_adr, cmd_mac_multicast_adr,
cmd_act_set, 0, 0, cmd_act_set, 0, 0,
...@@ -564,13 +574,13 @@ static void wlan_set_multicast_list(struct net_device *dev) ...@@ -564,13 +574,13 @@ static void wlan_set_multicast_list(struct net_device *dev)
libertas_set_mac_packet_filter(priv); libertas_set_mac_packet_filter(priv);
} }
LEAVE(); lbs_deb_leave(LBS_DEB_NET);
} }
/** /**
* @brief This function hanldes the major job in WLAN driver. * @brief This function handles the major jobs in the WLAN driver.
* it handles the event generated by firmware, rx data received * It handles all events generated by firmware, RX data received
* from firmware and tx data sent from kernel. * from firmware and TX data sent from kernel.
* *
* @param data A pointer to wlan_thread structure * @param data A pointer to wlan_thread structure
* @return 0 * @return 0
...@@ -583,14 +593,14 @@ static int wlan_service_main_thread(void *data) ...@@ -583,14 +593,14 @@ static int wlan_service_main_thread(void *data)
wait_queue_t wait; wait_queue_t wait;
u8 ireg = 0; u8 ireg = 0;
ENTER(); lbs_deb_enter(LBS_DEB_THREAD);
wlan_activate_thread(thread); wlan_activate_thread(thread);
init_waitqueue_entry(&wait, current); init_waitqueue_entry(&wait, current);
for (;;) { for (;;) {
lbs_pr_debug(1, "main-thread 111: intcounter=%d " lbs_deb_thread( "main-thread 111: intcounter=%d "
"currenttxskb=%p dnld_sent=%d\n", "currenttxskb=%p dnld_sent=%d\n",
adapter->intcounter, adapter->intcounter,
adapter->currenttxskb, priv->wlan_dev.dnld_sent); adapter->currenttxskb, priv->wlan_dev.dnld_sent);
...@@ -602,7 +612,7 @@ static int wlan_service_main_thread(void *data) ...@@ -602,7 +612,7 @@ static int wlan_service_main_thread(void *data)
(!adapter->intcounter (!adapter->intcounter
&& (priv->wlan_dev.dnld_sent || adapter->cur_cmd || && (priv->wlan_dev.dnld_sent || adapter->cur_cmd ||
list_empty(&adapter->cmdpendingq)))) { list_empty(&adapter->cmdpendingq)))) {
lbs_pr_debug(1, lbs_deb_thread(
"main-thread sleeping... Conn=%d IntC=%d PS_mode=%d PS_State=%d\n", "main-thread sleeping... Conn=%d IntC=%d PS_mode=%d PS_State=%d\n",
adapter->connect_status, adapter->intcounter, adapter->connect_status, adapter->intcounter,
adapter->psmode, adapter->psstate); adapter->psmode, adapter->psstate);
...@@ -612,7 +622,7 @@ static int wlan_service_main_thread(void *data) ...@@ -612,7 +622,7 @@ static int wlan_service_main_thread(void *data)
spin_unlock_irq(&adapter->driver_lock); spin_unlock_irq(&adapter->driver_lock);
lbs_pr_debug(1, lbs_deb_thread(
"main-thread 222 (waking up): intcounter=%d currenttxskb=%p " "main-thread 222 (waking up): intcounter=%d currenttxskb=%p "
"dnld_sent=%d\n", adapter->intcounter, "dnld_sent=%d\n", adapter->intcounter,
adapter->currenttxskb, priv->wlan_dev.dnld_sent); adapter->currenttxskb, priv->wlan_dev.dnld_sent);
...@@ -621,14 +631,14 @@ static int wlan_service_main_thread(void *data) ...@@ -621,14 +631,14 @@ static int wlan_service_main_thread(void *data)
remove_wait_queue(&thread->waitq, &wait); remove_wait_queue(&thread->waitq, &wait);
try_to_freeze(); try_to_freeze();
lbs_pr_debug(1, "main-thread 333: intcounter=%d currenttxskb=%p " lbs_deb_thread("main-thread 333: intcounter=%d currenttxskb=%p "
"dnld_sent=%d\n", "dnld_sent=%d\n",
adapter->intcounter, adapter->intcounter,
adapter->currenttxskb, priv->wlan_dev.dnld_sent); adapter->currenttxskb, priv->wlan_dev.dnld_sent);
if (kthread_should_stop() if (kthread_should_stop()
|| adapter->surpriseremoved) { || adapter->surpriseremoved) {
lbs_pr_debug(1, lbs_deb_thread(
"main-thread: break from main thread: surpriseremoved=0x%x\n", "main-thread: break from main thread: surpriseremoved=0x%x\n",
adapter->surpriseremoved); adapter->surpriseremoved);
break; break;
...@@ -642,7 +652,7 @@ static int wlan_service_main_thread(void *data) ...@@ -642,7 +652,7 @@ static int wlan_service_main_thread(void *data)
int_status = libertas_sbi_get_int_status(priv, &ireg); int_status = libertas_sbi_get_int_status(priv, &ireg);
if (int_status) { if (int_status) {
lbs_pr_debug(1, lbs_deb_thread(
"main-thread: reading HOST_INT_STATUS_REG failed\n"); "main-thread: reading HOST_INT_STATUS_REG failed\n");
spin_unlock_irq(&adapter->driver_lock); spin_unlock_irq(&adapter->driver_lock);
continue; continue;
...@@ -650,14 +660,14 @@ static int wlan_service_main_thread(void *data) ...@@ -650,14 +660,14 @@ static int wlan_service_main_thread(void *data)
adapter->hisregcpy |= ireg; adapter->hisregcpy |= ireg;
} }
lbs_pr_debug(1, "main-thread 444: intcounter=%d currenttxskb=%p " lbs_deb_thread("main-thread 444: intcounter=%d currenttxskb=%p "
"dnld_sent=%d\n", "dnld_sent=%d\n",
adapter->intcounter, adapter->intcounter,
adapter->currenttxskb, priv->wlan_dev.dnld_sent); adapter->currenttxskb, priv->wlan_dev.dnld_sent);
/* command response? */ /* command response? */
if (adapter->hisregcpy & his_cmdupldrdy) { if (adapter->hisregcpy & his_cmdupldrdy) {
lbs_pr_debug(1, "main-thread: cmd response ready.\n"); lbs_deb_thread("main-thread: cmd response ready\n");
adapter->hisregcpy &= ~his_cmdupldrdy; adapter->hisregcpy &= ~his_cmdupldrdy;
spin_unlock_irq(&adapter->driver_lock); spin_unlock_irq(&adapter->driver_lock);
...@@ -667,13 +677,13 @@ static int wlan_service_main_thread(void *data) ...@@ -667,13 +677,13 @@ static int wlan_service_main_thread(void *data)
/* Any Card Event */ /* Any Card Event */
if (adapter->hisregcpy & his_cardevent) { if (adapter->hisregcpy & his_cardevent) {
lbs_pr_debug(1, "main-thread: Card Event Activity.\n"); lbs_deb_thread("main-thread: Card Event Activity\n");
adapter->hisregcpy &= ~his_cardevent; adapter->hisregcpy &= ~his_cardevent;
if (libertas_sbi_read_event_cause(priv)) { if (libertas_sbi_read_event_cause(priv)) {
lbs_pr_alert( lbs_pr_alert(
"main-thread: libertas_sbi_read_event_cause failed.\n"); "main-thread: libertas_sbi_read_event_cause failed\n");
spin_unlock_irq(&adapter->driver_lock); spin_unlock_irq(&adapter->driver_lock);
continue; continue;
} }
...@@ -687,7 +697,7 @@ static int wlan_service_main_thread(void *data) ...@@ -687,7 +697,7 @@ static int wlan_service_main_thread(void *data)
if (!priv->wlan_dev.dnld_sent && !adapter->cur_cmd) { if (!priv->wlan_dev.dnld_sent && !adapter->cur_cmd) {
if (adapter->connect_status == if (adapter->connect_status ==
libertas_connected) { libertas_connected) {
lbs_pr_debug(1, lbs_deb_thread(
"main_thread: PRE_SLEEP--intcounter=%d currenttxskb=%p " "main_thread: PRE_SLEEP--intcounter=%d currenttxskb=%p "
"dnld_sent=%d cur_cmd=%p, confirm now\n", "dnld_sent=%d cur_cmd=%p, confirm now\n",
adapter->intcounter, adapter->intcounter,
...@@ -735,7 +745,7 @@ static int wlan_service_main_thread(void *data) ...@@ -735,7 +745,7 @@ static int wlan_service_main_thread(void *data)
wake_up_all(&adapter->cmd_pending); wake_up_all(&adapter->cmd_pending);
wlan_deactivate_thread(thread); wlan_deactivate_thread(thread);
LEAVE(); lbs_deb_leave(LBS_DEB_THREAD);
return 0; return 0;
} }
...@@ -752,11 +762,11 @@ wlan_private *wlan_add_card(void *card) ...@@ -752,11 +762,11 @@ wlan_private *wlan_add_card(void *card)
struct net_device *mesh_dev = NULL; struct net_device *mesh_dev = NULL;
wlan_private *priv = NULL; wlan_private *priv = NULL;
ENTER(); lbs_deb_enter(LBS_DEB_NET);
/* Allocate an Ethernet device and register it */ /* Allocate an Ethernet device and register it */
if (!(dev = alloc_etherdev(sizeof(wlan_private)))) { if (!(dev = alloc_etherdev(sizeof(wlan_private)))) {
lbs_pr_alert( "Init ethernet device failed!\n"); lbs_pr_err("init ethX device failed\n");
return NULL; return NULL;
} }
...@@ -764,13 +774,13 @@ wlan_private *wlan_add_card(void *card) ...@@ -764,13 +774,13 @@ wlan_private *wlan_add_card(void *card)
/* allocate buffer for wlan_adapter */ /* allocate buffer for wlan_adapter */
if (!(priv->adapter = kmalloc(sizeof(wlan_adapter), GFP_KERNEL))) { if (!(priv->adapter = kmalloc(sizeof(wlan_adapter), GFP_KERNEL))) {
lbs_pr_alert( "Allocate buffer for wlan_adapter failed!\n"); lbs_pr_err("allocate buffer for wlan_adapter failed\n");
goto err_kmalloc; goto err_kmalloc;
} }
/* Allocate a virtual mesh device */ /* Allocate a virtual mesh device */
if (!(mesh_dev = alloc_netdev(0, "msh%d", ether_setup))) { if (!(mesh_dev = alloc_netdev(0, "msh%d", ether_setup))) {
lbs_pr_debug(1, "Init ethernet device failed!\n"); lbs_deb_mesh("init mshX device failed\n");
return NULL; return NULL;
} }
...@@ -827,7 +837,7 @@ wlan_private *wlan_add_card(void *card) ...@@ -827,7 +837,7 @@ wlan_private *wlan_add_card(void *card)
init_waitqueue_head(&priv->adapter->cmd_pending); init_waitqueue_head(&priv->adapter->cmd_pending);
priv->adapter->nr_cmd_pending = 0; priv->adapter->nr_cmd_pending = 0;
lbs_pr_debug(1, "Starting kthread...\n"); lbs_deb_thread("Starting kthread...\n");
priv->mainthread.priv = priv; priv->mainthread.priv = priv;
wlan_create_thread(wlan_service_main_thread, wlan_create_thread(wlan_service_main_thread,
&priv->mainthread, "wlan_main_service"); &priv->mainthread, "wlan_main_service");
...@@ -842,28 +852,28 @@ wlan_private *wlan_add_card(void *card) ...@@ -842,28 +852,28 @@ wlan_private *wlan_add_card(void *card)
* IRQ. * IRQ.
*/ */
if (libertas_sbi_register_dev(priv) < 0) { if (libertas_sbi_register_dev(priv) < 0) {
lbs_pr_info("failed to register wlan device!\n"); lbs_pr_err("failed to register WLAN device\n");
goto err_registerdev; goto err_registerdev;
} }
/* init FW and HW */ /* init FW and HW */
if (libertas_init_fw(priv)) { if (libertas_init_fw(priv)) {
lbs_pr_debug(1, "Firmware Init failed\n"); lbs_pr_err("firmware init failed\n");
goto err_registerdev; goto err_registerdev;
} }
if (register_netdev(dev)) { if (register_netdev(dev)) {
lbs_pr_err("Cannot register network device!\n"); lbs_pr_err("cannot register ethX device\n");
goto err_init_fw; goto err_init_fw;
} }
/* Register virtual mesh interface */ /* Register virtual mesh interface */
if (register_netdev(mesh_dev)) { if (register_netdev(mesh_dev)) {
lbs_pr_info("Cannot register mesh virtual interface!\n"); lbs_pr_err("cannot register mshX virtual interface\n");
goto err_init_fw; goto err_init_fw;
} }
lbs_pr_info("%s: Marvell Wlan 802.11 adapter\n", dev->name); lbs_pr_info("%s: Marvell WLAN 802.11 adapter\n", dev->name);
libertas_debugfs_init_one(priv, dev); libertas_debugfs_init_one(priv, dev);
...@@ -874,7 +884,7 @@ wlan_private *wlan_add_card(void *card) ...@@ -874,7 +884,7 @@ wlan_private *wlan_add_card(void *card)
if (device_create_file(&(mesh_dev->dev), &dev_attr_libertas_mpp)) if (device_create_file(&(mesh_dev->dev), &dev_attr_libertas_mpp))
goto err_create_file; goto err_create_file;
LEAVE(); lbs_deb_leave_args(LBS_DEB_NET, "priv %p", priv);
return priv; return priv;
err_create_file: err_create_file:
...@@ -891,7 +901,7 @@ wlan_private *wlan_add_card(void *card) ...@@ -891,7 +901,7 @@ wlan_private *wlan_add_card(void *card)
free_netdev(dev); free_netdev(dev);
free_netdev(mesh_dev); free_netdev(mesh_dev);
LEAVE(); lbs_deb_leave_args(LBS_DEB_NET, "priv NULL");
return NULL; return NULL;
} }
...@@ -900,6 +910,8 @@ static void wake_pending_cmdnodes(wlan_private *priv) ...@@ -900,6 +910,8 @@ static void wake_pending_cmdnodes(wlan_private *priv)
struct cmd_ctrl_node *cmdnode; struct cmd_ctrl_node *cmdnode;
unsigned long flags; unsigned long flags;
lbs_deb_enter(LBS_DEB_CMD);
spin_lock_irqsave(&priv->adapter->driver_lock, flags); spin_lock_irqsave(&priv->adapter->driver_lock, flags);
list_for_each_entry(cmdnode, &priv->adapter->cmdpendingq, list) { list_for_each_entry(cmdnode, &priv->adapter->cmdpendingq, list) {
cmdnode->cmdwaitqwoken = 1; cmdnode->cmdwaitqwoken = 1;
...@@ -918,19 +930,15 @@ int wlan_remove_card(void *card) ...@@ -918,19 +930,15 @@ int wlan_remove_card(void *card)
union iwreq_data wrqu; union iwreq_data wrqu;
int i; int i;
ENTER(); lbs_deb_enter(LBS_DEB_NET);
if (!priv) { if (!priv)
LEAVE(); goto out;
return 0;
}
adapter = priv->adapter; adapter = priv->adapter;
if (!adapter) { if (!adapter)
LEAVE(); goto out;
return 0;
}
dev = priv->wlan_dev.netdev; dev = priv->wlan_dev.netdev;
mesh_dev = priv->mesh_dev; mesh_dev = priv->mesh_dev;
...@@ -964,7 +972,7 @@ int wlan_remove_card(void *card) ...@@ -964,7 +972,7 @@ int wlan_remove_card(void *card)
libertas_debugfs_remove_one(priv); libertas_debugfs_remove_one(priv);
lbs_pr_debug(1, "Free adapter\n"); lbs_deb_net("free adapter\n");
libertas_free_adapter(priv); libertas_free_adapter(priv);
for (i = 0; i<libertas_found; i++) { for (i = 0; i<libertas_found; i++) {
...@@ -975,14 +983,15 @@ int wlan_remove_card(void *card) ...@@ -975,14 +983,15 @@ int wlan_remove_card(void *card)
} }
} }
lbs_pr_debug(1, "Unregister finish\n"); lbs_deb_net("unregister finish\n");
priv->wlan_dev.netdev = NULL; priv->wlan_dev.netdev = NULL;
priv->mesh_dev = NULL ; priv->mesh_dev = NULL ;
free_netdev(mesh_dev); free_netdev(mesh_dev);
free_netdev(dev); free_netdev(dev);
LEAVE(); out:
lbs_deb_leave(LBS_DEB_NET);
return 0; return 0;
} }
...@@ -999,33 +1008,34 @@ struct chan_freq_power *libertas_get_region_cfp_table(u8 region, u8 band, int *c ...@@ -999,33 +1008,34 @@ struct chan_freq_power *libertas_get_region_cfp_table(u8 region, u8 band, int *c
{ {
int i, end; int i, end;
ENTER(); lbs_deb_enter(LBS_DEB_MAIN);
end = sizeof(region_cfp_table)/sizeof(struct region_cfp_table); end = sizeof(region_cfp_table)/sizeof(struct region_cfp_table);
for (i = 0; i < end ; i++) { for (i = 0; i < end ; i++) {
lbs_pr_debug(1, "region_cfp_table[i].region=%d\n", lbs_deb_main("region_cfp_table[i].region=%d\n",
region_cfp_table[i].region); region_cfp_table[i].region);
if (region_cfp_table[i].region == region) { if (region_cfp_table[i].region == region) {
*cfp_no = region_cfp_table[i].cfp_no_BG; *cfp_no = region_cfp_table[i].cfp_no_BG;
LEAVE(); lbs_deb_leave(LBS_DEB_MAIN);
return region_cfp_table[i].cfp_BG; return region_cfp_table[i].cfp_BG;
} }
} }
LEAVE(); lbs_deb_leave_args(LBS_DEB_MAIN, "ret NULL");
return NULL; return NULL;
} }
int libertas_set_regiontable(wlan_private * priv, u8 region, u8 band) int libertas_set_regiontable(wlan_private * priv, u8 region, u8 band)
{ {
wlan_adapter *adapter = priv->adapter; wlan_adapter *adapter = priv->adapter;
int ret = 0;
int i = 0; int i = 0;
struct chan_freq_power *cfp; struct chan_freq_power *cfp;
int cfp_no; int cfp_no;
ENTER(); lbs_deb_enter(LBS_DEB_MAIN);
memset(adapter->region_channel, 0, sizeof(adapter->region_channel)); memset(adapter->region_channel, 0, sizeof(adapter->region_channel));
...@@ -1035,17 +1045,19 @@ int libertas_set_regiontable(wlan_private * priv, u8 region, u8 band) ...@@ -1035,17 +1045,19 @@ int libertas_set_regiontable(wlan_private * priv, u8 region, u8 band)
adapter->region_channel[i].nrcfp = cfp_no; adapter->region_channel[i].nrcfp = cfp_no;
adapter->region_channel[i].CFP = cfp; adapter->region_channel[i].CFP = cfp;
} else { } else {
lbs_pr_debug(1, "wrong region code %#x in band B-G\n", lbs_deb_main("wrong region code %#x in band B/G\n",
region); region);
return -1; ret = -1;
goto out;
} }
adapter->region_channel[i].valid = 1; adapter->region_channel[i].valid = 1;
adapter->region_channel[i].region = region; adapter->region_channel[i].region = region;
adapter->region_channel[i].band = band; adapter->region_channel[i].band = band;
i++; i++;
} }
LEAVE(); out:
return 0; lbs_deb_leave_args(LBS_DEB_MAIN, "ret %d", ret);
return ret;
} }
/** /**
...@@ -1060,9 +1072,9 @@ void libertas_interrupt(struct net_device *dev) ...@@ -1060,9 +1072,9 @@ void libertas_interrupt(struct net_device *dev)
{ {
wlan_private *priv = dev->priv; wlan_private *priv = dev->priv;
ENTER(); lbs_deb_enter(LBS_DEB_MAIN);
lbs_pr_debug(1, "libertas_interrupt: intcounter=%d\n", lbs_deb_main("libertas_interrupt: intcounter=%d\n",
priv->adapter->intcounter); priv->adapter->intcounter);
priv->adapter->intcounter++; priv->adapter->intcounter++;
...@@ -1074,14 +1086,14 @@ void libertas_interrupt(struct net_device *dev) ...@@ -1074,14 +1086,14 @@ void libertas_interrupt(struct net_device *dev)
wake_up_interruptible(&priv->mainthread.waitq); wake_up_interruptible(&priv->mainthread.waitq);
LEAVE(); lbs_deb_leave(LBS_DEB_MAIN);
} }
static int wlan_init_module(void) static int wlan_init_module(void)
{ {
int ret = 0; int ret = 0;
ENTER(); lbs_deb_enter(LBS_DEB_MAIN);
if (libertas_fw_name == NULL) { if (libertas_fw_name == NULL) {
libertas_fw_name = default_fw_name; libertas_fw_name = default_fw_name;
...@@ -1092,11 +1104,9 @@ static int wlan_init_module(void) ...@@ -1092,11 +1104,9 @@ static int wlan_init_module(void)
if (libertas_sbi_register()) { if (libertas_sbi_register()) {
ret = -1; ret = -1;
libertas_debugfs_remove(); libertas_debugfs_remove();
goto done;
} }
done: lbs_deb_leave_args(LBS_DEB_MAIN, "ret %d", ret);
LEAVE();
return ret; return ret;
} }
...@@ -1104,7 +1114,7 @@ static void wlan_cleanup_module(void) ...@@ -1104,7 +1114,7 @@ static void wlan_cleanup_module(void)
{ {
int i; int i;
ENTER(); lbs_deb_enter(LBS_DEB_MAIN);
for (i = 0; i<libertas_found; i++) { for (i = 0; i<libertas_found; i++) {
wlan_private *priv = libertas_devs[i]->priv; wlan_private *priv = libertas_devs[i]->priv;
...@@ -1114,7 +1124,7 @@ static void wlan_cleanup_module(void) ...@@ -1114,7 +1124,7 @@ static void wlan_cleanup_module(void)
libertas_sbi_unregister(); libertas_sbi_unregister();
libertas_debugfs_remove(); libertas_debugfs_remove();
LEAVE(); lbs_deb_leave(LBS_DEB_MAIN);
} }
module_init(wlan_init_module); module_init(wlan_init_module);
......
...@@ -106,10 +106,10 @@ static void wlan_compute_rssi(wlan_private * priv, struct rxpd *p_rx_pd) ...@@ -106,10 +106,10 @@ static void wlan_compute_rssi(wlan_private * priv, struct rxpd *p_rx_pd)
{ {
wlan_adapter *adapter = priv->adapter; wlan_adapter *adapter = priv->adapter;
ENTER(); lbs_deb_enter(LBS_DEB_RX);
lbs_pr_debug(1, "rxpd: SNR = %d, NF = %d\n", p_rx_pd->snr, p_rx_pd->nf); lbs_deb_rx("rxpd: SNR %d, NF %d\n", p_rx_pd->snr, p_rx_pd->nf);
lbs_pr_debug(1, "Before computing SNR: SNR- avg = %d, NF-avg = %d\n", lbs_deb_rx("before computing SNR: SNR-avg = %d, NF-avg = %d\n",
adapter->SNR[TYPE_RXPD][TYPE_AVG] / AVG_SCALE, adapter->SNR[TYPE_RXPD][TYPE_AVG] / AVG_SCALE,
adapter->NF[TYPE_RXPD][TYPE_AVG] / AVG_SCALE); adapter->NF[TYPE_RXPD][TYPE_AVG] / AVG_SCALE);
...@@ -121,7 +121,7 @@ static void wlan_compute_rssi(wlan_private * priv, struct rxpd *p_rx_pd) ...@@ -121,7 +121,7 @@ static void wlan_compute_rssi(wlan_private * priv, struct rxpd *p_rx_pd)
adapter->SNR[TYPE_RXPD][TYPE_AVG] = wlan_getavgsnr(priv) * AVG_SCALE; adapter->SNR[TYPE_RXPD][TYPE_AVG] = wlan_getavgsnr(priv) * AVG_SCALE;
adapter->NF[TYPE_RXPD][TYPE_AVG] = wlan_getavgnf(priv) * AVG_SCALE; adapter->NF[TYPE_RXPD][TYPE_AVG] = wlan_getavgnf(priv) * AVG_SCALE;
lbs_pr_debug(1, "After computing SNR: SNR-avg = %d, NF-avg = %d\n", lbs_deb_rx("after computing SNR: SNR-avg = %d, NF-avg = %d\n",
adapter->SNR[TYPE_RXPD][TYPE_AVG] / AVG_SCALE, adapter->SNR[TYPE_RXPD][TYPE_AVG] / AVG_SCALE,
adapter->NF[TYPE_RXPD][TYPE_AVG] / AVG_SCALE); adapter->NF[TYPE_RXPD][TYPE_AVG] / AVG_SCALE);
...@@ -133,12 +133,12 @@ static void wlan_compute_rssi(wlan_private * priv, struct rxpd *p_rx_pd) ...@@ -133,12 +133,12 @@ static void wlan_compute_rssi(wlan_private * priv, struct rxpd *p_rx_pd)
CAL_RSSI(adapter->SNR[TYPE_RXPD][TYPE_AVG] / AVG_SCALE, CAL_RSSI(adapter->SNR[TYPE_RXPD][TYPE_AVG] / AVG_SCALE,
adapter->NF[TYPE_RXPD][TYPE_AVG] / AVG_SCALE); adapter->NF[TYPE_RXPD][TYPE_AVG] / AVG_SCALE);
LEAVE(); lbs_deb_leave(LBS_DEB_RX);
} }
void libertas_upload_rx_packet(wlan_private * priv, struct sk_buff *skb) void libertas_upload_rx_packet(wlan_private * priv, struct sk_buff *skb)
{ {
lbs_pr_debug(1, "skb->data=%p\n", skb->data); lbs_deb_rx("skb->data %p\n", skb->data);
if(IS_MESH_FRAME(skb)) if(IS_MESH_FRAME(skb))
skb->dev = priv->mesh_dev; skb->dev = priv->mesh_dev;
...@@ -171,7 +171,7 @@ int libertas_process_rxed_packet(wlan_private * priv, struct sk_buff *skb) ...@@ -171,7 +171,7 @@ int libertas_process_rxed_packet(wlan_private * priv, struct sk_buff *skb)
const u8 rfc1042_eth_hdr[] = { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 }; const u8 rfc1042_eth_hdr[] = { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 };
ENTER(); lbs_deb_enter(LBS_DEB_RX);
if (priv->adapter->debugmode & MRVDRV_DEBUG_RX_PATH) if (priv->adapter->debugmode & MRVDRV_DEBUG_RX_PATH)
lbs_dbg_hex("RX packet: ", skb->data, lbs_dbg_hex("RX packet: ", skb->data,
...@@ -191,7 +191,7 @@ int libertas_process_rxed_packet(wlan_private * priv, struct sk_buff *skb) ...@@ -191,7 +191,7 @@ int libertas_process_rxed_packet(wlan_private * priv, struct sk_buff *skb)
min_t(unsigned int, skb->len, 100)); min_t(unsigned int, skb->len, 100));
if (skb->len < (ETH_HLEN + 8 + sizeof(struct rxpd))) { if (skb->len < (ETH_HLEN + 8 + sizeof(struct rxpd))) {
lbs_pr_debug(1, "RX error: FRAME RECEIVED WITH BAD LENGTH\n"); lbs_deb_rx("rx err: frame received with bad length\n");
priv->stats.rx_length_errors++; priv->stats.rx_length_errors++;
ret = 0; ret = 0;
goto done; goto done;
...@@ -201,14 +201,14 @@ int libertas_process_rxed_packet(wlan_private * priv, struct sk_buff *skb) ...@@ -201,14 +201,14 @@ int libertas_process_rxed_packet(wlan_private * priv, struct sk_buff *skb)
* Check rxpd status and update 802.3 stat, * Check rxpd status and update 802.3 stat,
*/ */
if (!(p_rx_pd->status & MRVDRV_RXPD_STATUS_OK)) { if (!(p_rx_pd->status & MRVDRV_RXPD_STATUS_OK)) {
lbs_pr_debug(1, "RX error: frame received with bad status\n"); lbs_deb_rx("rx err: frame received with bad status\n");
lbs_pr_alert("rxpd Not OK\n"); lbs_pr_alert("rxpd not ok\n");
priv->stats.rx_errors++; priv->stats.rx_errors++;
ret = 0; ret = 0;
goto done; goto done;
} }
lbs_pr_debug(1, "RX Data: skb->len - sizeof(RxPd) = %d - %zd = %zd\n", lbs_deb_rx("rx data: skb->len-sizeof(RxPd) = %d-%zd = %zd\n",
skb->len, sizeof(struct rxpd), skb->len - sizeof(struct rxpd)); skb->len, sizeof(struct rxpd), skb->len - sizeof(struct rxpd));
lbs_dbg_hex("RX Data: Dest", p_rx_pkt->eth803_hdr.dest_addr, 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,7 +266,7 @@ int libertas_process_rxed_packet(wlan_private * priv, struct sk_buff *skb)
wlan_compute_rssi(priv, p_rx_pd); wlan_compute_rssi(priv, p_rx_pd);
lbs_pr_debug(1, "RX Data: size of actual packet = %d\n", skb->len); lbs_deb_rx("rx data: size of actual packet %d\n", skb->len);
priv->stats.rx_bytes += skb->len; priv->stats.rx_bytes += skb->len;
priv->stats.rx_packets++; priv->stats.rx_packets++;
...@@ -274,8 +274,7 @@ int libertas_process_rxed_packet(wlan_private * priv, struct sk_buff *skb) ...@@ -274,8 +274,7 @@ int libertas_process_rxed_packet(wlan_private * priv, struct sk_buff *skb)
ret = 0; ret = 0;
done: done:
LEAVE(); lbs_deb_leave_args(LBS_DEB_RX, "ret %d", ret);
return ret; return ret;
} }
...@@ -314,7 +313,7 @@ static u8 convert_mv_rate_to_radiotap(u8 rate) ...@@ -314,7 +313,7 @@ static u8 convert_mv_rate_to_radiotap(u8 rate)
case 11: /* 54 Mbps */ case 11: /* 54 Mbps */
return 108; return 108;
} }
lbs_pr_alert( "Invalid Marvell WLAN rate (%i)\n", rate); lbs_pr_alert("Invalid Marvell WLAN rate %i\n", rate);
return 0; return 0;
} }
...@@ -336,7 +335,7 @@ static int process_rxed_802_11_packet(wlan_private * priv, struct sk_buff *skb) ...@@ -336,7 +335,7 @@ static int process_rxed_802_11_packet(wlan_private * priv, struct sk_buff *skb)
struct rx_radiotap_hdr radiotap_hdr; struct rx_radiotap_hdr radiotap_hdr;
struct rx_radiotap_hdr *pradiotap_hdr; struct rx_radiotap_hdr *pradiotap_hdr;
ENTER(); lbs_deb_enter(LBS_DEB_RX);
p_rx_pkt = (struct rx80211packethdr *) skb->data; p_rx_pkt = (struct rx80211packethdr *) skb->data;
prxpd = &p_rx_pkt->rx_pd; 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,7 +343,7 @@ static int process_rxed_802_11_packet(wlan_private * priv, struct sk_buff *skb)
// lbs_dbg_hex("RX Data: Before chop rxpd", skb->data, min(skb->len, 100)); // lbs_dbg_hex("RX Data: Before chop rxpd", skb->data, min(skb->len, 100));
if (skb->len < (ETH_HLEN + 8 + sizeof(struct rxpd))) { if (skb->len < (ETH_HLEN + 8 + sizeof(struct rxpd))) {
lbs_pr_debug(1, "RX error: FRAME RECEIVED WITH BAD LENGTH\n"); lbs_deb_rx("rx err: frame received wit bad length\n");
priv->stats.rx_length_errors++; priv->stats.rx_length_errors++;
ret = 0; ret = 0;
goto done; goto done;
...@@ -354,11 +353,11 @@ static int process_rxed_802_11_packet(wlan_private * priv, struct sk_buff *skb) ...@@ -354,11 +353,11 @@ static int process_rxed_802_11_packet(wlan_private * priv, struct sk_buff *skb)
* Check rxpd status and update 802.3 stat, * Check rxpd status and update 802.3 stat,
*/ */
if (!(prxpd->status & MRVDRV_RXPD_STATUS_OK)) { if (!(prxpd->status & MRVDRV_RXPD_STATUS_OK)) {
//lbs_pr_debug(1, "RX error: frame received with bad status\n"); //lbs_deb_rx("rx err: frame received with bad status\n");
priv->stats.rx_errors++; priv->stats.rx_errors++;
} }
lbs_pr_debug(1, "RX Data: skb->len - sizeof(RxPd) = %d - %zd = %zd\n", lbs_deb_rx("rx data: skb->len-sizeof(RxPd) = %d-%zd = %zd\n",
skb->len, sizeof(struct rxpd), skb->len - sizeof(struct rxpd)); skb->len, sizeof(struct rxpd), skb->len - sizeof(struct rxpd));
/* create the exported radio header */ /* create the exported radio header */
...@@ -399,7 +398,7 @@ static int process_rxed_802_11_packet(wlan_private * priv, struct sk_buff *skb) ...@@ -399,7 +398,7 @@ static int process_rxed_802_11_packet(wlan_private * priv, struct sk_buff *skb)
if ((skb_headroom(skb) < sizeof(struct rx_radiotap_hdr)) && if ((skb_headroom(skb) < sizeof(struct rx_radiotap_hdr)) &&
pskb_expand_head(skb, sizeof(struct rx_radiotap_hdr), 0, pskb_expand_head(skb, sizeof(struct rx_radiotap_hdr), 0,
GFP_ATOMIC)) { GFP_ATOMIC)) {
lbs_pr_alert( "%s: couldn't pskb_expand_head\n", lbs_pr_alert("%s: couldn't pskb_expand_head\n",
__func__); __func__);
} }
...@@ -414,7 +413,7 @@ static int process_rxed_802_11_packet(wlan_private * priv, struct sk_buff *skb) ...@@ -414,7 +413,7 @@ static int process_rxed_802_11_packet(wlan_private * priv, struct sk_buff *skb)
default: default:
/* unknown header */ /* unknown header */
lbs_pr_alert( "Unknown radiomode (%i)\n", lbs_pr_alert("Unknown radiomode %i\n",
priv->adapter->radiomode); priv->adapter->radiomode);
/* don't export any header */ /* don't export any header */
/* chop the rxpd */ /* chop the rxpd */
...@@ -431,15 +430,16 @@ static int process_rxed_802_11_packet(wlan_private * priv, struct sk_buff *skb) ...@@ -431,15 +430,16 @@ static int process_rxed_802_11_packet(wlan_private * priv, struct sk_buff *skb)
wlan_compute_rssi(priv, prxpd); wlan_compute_rssi(priv, prxpd);
lbs_pr_debug(1, "RX Data: size of actual packet = %d\n", skb->len); lbs_deb_rx("rx data: size of actual packet %d\n", skb->len);
priv->stats.rx_bytes += skb->len; priv->stats.rx_bytes += skb->len;
priv->stats.rx_packets++; priv->stats.rx_packets++;
libertas_upload_rx_packet(priv, skb); libertas_upload_rx_packet(priv, skb);
ret = 0; ret = 0;
done:
LEAVE();
return (ret); done:
skb->protocol = __constant_htons(0x0019); /* ETH_P_80211_RAW */
lbs_deb_leave_args(LBS_DEB_RX, "ret %d", ret);
return ret;
} }
...@@ -21,11 +21,11 @@ static inline void wlan_activate_thread(struct wlan_thread * thr) ...@@ -21,11 +21,11 @@ static inline void wlan_activate_thread(struct wlan_thread * thr)
static inline void wlan_deactivate_thread(struct wlan_thread * thr) static inline void wlan_deactivate_thread(struct wlan_thread * thr)
{ {
ENTER(); lbs_deb_enter(LBS_DEB_THREAD);
thr->pid = 0; thr->pid = 0;
LEAVE(); lbs_deb_leave(LBS_DEB_THREAD);
} }
static inline void wlan_create_thread(int (*wlanfunc) (void *), static inline void wlan_create_thread(int (*wlanfunc) (void *),
...@@ -36,7 +36,7 @@ static inline void wlan_create_thread(int (*wlanfunc) (void *), ...@@ -36,7 +36,7 @@ static inline void wlan_create_thread(int (*wlanfunc) (void *),
static inline int wlan_terminate_thread(struct wlan_thread * thr) static inline int wlan_terminate_thread(struct wlan_thread * thr)
{ {
ENTER(); lbs_deb_enter(LBS_DEB_THREAD);
/* Check if the thread is active or not */ /* Check if the thread is active or not */
if (!thr->pid) { if (!thr->pid) {
...@@ -45,7 +45,7 @@ static inline int wlan_terminate_thread(struct wlan_thread * thr) ...@@ -45,7 +45,7 @@ static inline int wlan_terminate_thread(struct wlan_thread * thr)
} }
kthread_stop(thr->task); kthread_stop(thr->task);
LEAVE(); lbs_deb_leave(LBS_DEB_THREAD);
return 0; return 0;
} }
......
...@@ -68,7 +68,7 @@ static int SendSinglePacket(wlan_private * priv, struct sk_buff *skb) ...@@ -68,7 +68,7 @@ static int SendSinglePacket(wlan_private * priv, struct sk_buff *skb)
u32 new_rate; u32 new_rate;
u8 *ptr = priv->adapter->tmptxbuf; u8 *ptr = priv->adapter->tmptxbuf;
ENTER(); lbs_deb_enter(LBS_DEB_TX);
if (priv->adapter->surpriseremoved) if (priv->adapter->surpriseremoved)
return -1; return -1;
...@@ -78,7 +78,7 @@ static int SendSinglePacket(wlan_private * priv, struct sk_buff *skb) ...@@ -78,7 +78,7 @@ static int SendSinglePacket(wlan_private * priv, struct sk_buff *skb)
min_t(unsigned int, skb->len, 100)); min_t(unsigned int, skb->len, 100));
if (!skb->len || (skb->len > MRVDRV_ETH_TX_PACKET_BUFFER_SIZE)) { if (!skb->len || (skb->len > MRVDRV_ETH_TX_PACKET_BUFFER_SIZE)) {
lbs_pr_debug(1, "Tx error: Bad skb length %d : %zd\n", lbs_deb_tx("tx err: skb length %d 0 or > %zd\n",
skb->len, MRVDRV_ETH_TX_PACKET_BUFFER_SIZE); skb->len, MRVDRV_ETH_TX_PACKET_BUFFER_SIZE);
ret = -1; ret = -1;
goto done; goto done;
...@@ -138,13 +138,13 @@ static int SendSinglePacket(wlan_private * priv, struct sk_buff *skb) ...@@ -138,13 +138,13 @@ static int SendSinglePacket(wlan_private * priv, struct sk_buff *skb)
sizeof(struct txpd)); sizeof(struct txpd));
if (ret) { if (ret) {
lbs_pr_debug(1, "Tx error: libertas_sbi_host_to_card failed: 0x%X\n", ret); lbs_deb_tx("tx err: libertas_sbi_host_to_card returned 0x%X\n", ret);
goto done; goto done;
} }
lbs_pr_debug(1, "SendSinglePacket succeeds\n"); lbs_deb_tx("SendSinglePacket succeeds\n");
done: done:
if (!ret) { if (!ret) {
priv->stats.tx_packets++; priv->stats.tx_packets++;
priv->stats.tx_bytes += skb->len; priv->stats.tx_bytes += skb->len;
...@@ -166,7 +166,7 @@ static int SendSinglePacket(wlan_private * priv, struct sk_buff *skb) ...@@ -166,7 +166,7 @@ static int SendSinglePacket(wlan_private * priv, struct sk_buff *skb)
priv->adapter->currenttxskb = NULL; priv->adapter->currenttxskb = NULL;
} }
LEAVE(); lbs_deb_leave_args(LBS_DEB_TX, "ret %d", ret);
return ret; return ret;
} }
...@@ -214,8 +214,7 @@ int libertas_process_tx(wlan_private * priv, struct sk_buff *skb) ...@@ -214,8 +214,7 @@ int libertas_process_tx(wlan_private * priv, struct sk_buff *skb)
{ {
int ret = -1; int ret = -1;
ENTER(); lbs_deb_enter(LBS_DEB_TX);
lbs_dbg_hex("TX Data", skb->data, min_t(unsigned int, skb->len, 100)); lbs_dbg_hex("TX Data", skb->data, min_t(unsigned int, skb->len, 100));
if (priv->wlan_dev.dnld_sent) { if (priv->wlan_dev.dnld_sent) {
...@@ -234,7 +233,7 @@ int libertas_process_tx(wlan_private * priv, struct sk_buff *skb) ...@@ -234,7 +233,7 @@ int libertas_process_tx(wlan_private * priv, struct sk_buff *skb)
ret = SendSinglePacket(priv, skb); ret = SendSinglePacket(priv, skb);
done: done:
LEAVE(); lbs_deb_leave_args(LBS_DEB_TX, "ret %d", ret);
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册