Commit d37b4fdd authored by Holger Schurig's avatar Holger Schurig Committed by John W. Linville

libertas: remove unused 11d code

Most of the 11d code was protected with an "if (priv->enable11d)" clause.
But there was no code that anywhere that was able to set this
variable to true. So all 11d code was dead for almost a year and no one
complained. That's enought incentive to remove this code.

Besides removing old cruft, we gain back the 11d capability in a common way
when we merge the cfg80211 functionality.
Signed-off-by: default avatarHolger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: default avatarDan Williams <dcbw@redhat.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 7f4013f0
This diff is collapsed.
......@@ -79,27 +79,4 @@ struct region_code_mapping {
u8 code;
};
struct lbs_private;
u8 lbs_get_scan_type_11d(u8 chan,
struct parsed_region_chan_11d *parsed_region_chan);
u32 lbs_chan_2_freq(u8 chan);
void lbs_init_11d(struct lbs_private *priv);
int lbs_set_universaltable(struct lbs_private *priv, u8 band);
int lbs_cmd_802_11d_domain_info(struct lbs_private *priv,
struct cmd_ds_command *cmd, u16 cmdno,
u16 cmdOption);
int lbs_ret_802_11d_domain_info(struct cmd_ds_command *resp);
struct bss_descriptor;
int lbs_parse_dnld_countryinfo_11d(struct lbs_private *priv,
struct bss_descriptor * bss);
int lbs_create_dnld_countryinfo_11d(struct lbs_private *priv);
#endif
libertas-y += 11d.o
libertas-y += assoc.o
libertas-y += cfg.o
libertas-y += cmd.o
......
......@@ -371,11 +371,6 @@ static int lbs_associate(struct lbs_private *priv,
/* update curbssparams */
priv->curbssparams.channel = bss->phy.ds.channel;
if (lbs_parse_dnld_countryinfo_11d(priv, bss)) {
ret = -1;
goto done;
}
ret = lbs_cmd_with_response(priv, command, &cmd);
if (ret == 0) {
ret = lbs_assoc_post(priv,
......@@ -633,11 +628,6 @@ static int lbs_adhoc_join(struct lbs_private *priv,
}
}
if (lbs_parse_dnld_countryinfo_11d(priv, bss)) {
ret = -1;
goto out;
}
ret = lbs_cmd_with_response(priv, CMD_802_11_AD_HOC_JOIN, &cmd);
if (ret == 0) {
ret = lbs_adhoc_post(priv,
......@@ -737,12 +727,6 @@ static int lbs_adhoc_start(struct lbs_private *priv,
lbs_deb_join("ADHOC_START: rates=%02x %02x %02x %02x\n",
cmd.rates[0], cmd.rates[1], cmd.rates[2], cmd.rates[3]);
if (lbs_create_dnld_countryinfo_11d(priv)) {
lbs_deb_join("ADHOC_START: dnld_countryinfo_11d failed\n");
ret = -1;
goto out;
}
lbs_deb_join("ADHOC_START: Starting Ad-Hoc BSS on channel %d, band %d\n",
assoc_req->channel, assoc_req->band);
......
......@@ -190,11 +190,6 @@ int lbs_update_hw_spec(struct lbs_private *priv)
goto out;
}
if (lbs_set_universaltable(priv, 0)) {
ret = -1;
goto out;
}
out:
lbs_deb_leave(LBS_DEB_CMD);
return ret;
......@@ -1511,11 +1506,6 @@ int lbs_prepare_and_send_command(struct lbs_private *priv,
ret = 0;
goto done;
case CMD_802_11D_DOMAIN_INFO:
ret = lbs_cmd_802_11d_domain_info(priv, cmdptr,
cmd_no, cmd_action);
break;
case CMD_802_11_TPC_CFG:
cmdptr->command = cpu_to_le16(CMD_802_11_TPC_CFG);
cmdptr->size =
......
......@@ -228,10 +228,6 @@ static inline int handle_cmd_response(struct lbs_private *priv,
ret = lbs_ret_802_11_rssi(priv, resp);
break;
case CMD_RET(CMD_802_11D_DOMAIN_INFO):
ret = lbs_ret_802_11d_domain_info(resp);
break;
case CMD_RET(CMD_802_11_TPC_CFG):
spin_lock_irqsave(&priv->driver_lock, flags);
memmove((void *)priv->cur_cmd->callback_arg, &resp->params.tpccfg,
......
......@@ -325,15 +325,6 @@ struct lbs_private {
/** region channel data */
struct region_channel region_channel[MAX_REGION_CHANNEL_NUM];
struct region_channel universal_channel[MAX_REGION_CHANNEL_NUM];
/** 11D and Domain Regulatory Data */
struct lbs_802_11d_domain_reg domainreg;
struct parsed_region_chan_11d parsed_region_chan;
/** FSM variable for 11d support */
u32 enable11d;
/** MISCELLANEOUS */
struct lbs_offset_value offsetvalue;
......
......@@ -1408,9 +1408,6 @@ int lbs_start_card(struct lbs_private *priv)
if (ret)
goto done;
/* init 802.11d */
lbs_init_11d(priv);
if (lbs_cfg_register(priv)) {
lbs_pr_err("cannot register device\n");
goto done;
......
......@@ -161,31 +161,15 @@ static int lbs_scan_create_channel_list(struct lbs_private *priv,
scantype = CMD_SCAN_TYPE_ACTIVE;
for (rgnidx = 0; rgnidx < ARRAY_SIZE(priv->region_channel); rgnidx++) {
if (priv->enable11d && (priv->connect_status != LBS_CONNECTED)
&& (priv->mesh_connect_status != LBS_CONNECTED)) {
/* Scan all the supported chan for the first scan */
if (!priv->universal_channel[rgnidx].valid)
continue;
scanregion = &priv->universal_channel[rgnidx];
/* clear the parsed_region_chan for the first scan */
memset(&priv->parsed_region_chan, 0x00,
sizeof(priv->parsed_region_chan));
} else {
if (!priv->region_channel[rgnidx].valid)
continue;
scanregion = &priv->region_channel[rgnidx];
}
if (!priv->region_channel[rgnidx].valid)
continue;
scanregion = &priv->region_channel[rgnidx];
for (nextchan = 0; nextchan < scanregion->nrcfp; nextchan++, chanidx++) {
struct chanscanparamset *chan = &scanchanlist[chanidx];
cfp = scanregion->CFP + nextchan;
if (priv->enable11d)
scantype = lbs_get_scan_type_11d(cfp->channel,
&priv->parsed_region_chan);
if (scanregion->band == BAND_B || scanregion->band == BAND_G)
chan->radiotype = CMD_SCAN_RADIO_TYPE_BG;
......
......@@ -65,8 +65,6 @@ struct chan_freq_power *lbs_find_cfp_by_band_and_channel(
for (j = 0; !cfp && (j < ARRAY_SIZE(priv->region_channel)); j++) {
rc = &priv->region_channel[j];
if (priv->enable11d)
rc = &priv->universal_channel[j];
if (!rc->valid || !rc->CFP)
continue;
if (rc->band != band)
......@@ -106,8 +104,6 @@ static struct chan_freq_power *find_cfp_by_band_and_freq(
for (j = 0; !cfp && (j < ARRAY_SIZE(priv->region_channel)); j++) {
rc = &priv->region_channel[j];
if (priv->enable11d)
rc = &priv->universal_channel[j];
if (!rc->valid || !rc->CFP)
continue;
if (rc->band != band)
......@@ -546,8 +542,6 @@ static int lbs_get_range(struct net_device *dev, struct iw_request_info *info,
struct chan_freq_power *cfp;
u8 rates[MAX_RATES + 1];
u8 flag = 0;
lbs_deb_enter(LBS_DEB_WEXT);
dwrq->length = sizeof(struct iw_range);
......@@ -569,52 +563,21 @@ static int lbs_get_range(struct net_device *dev, struct iw_request_info *info,
range->scan_capa = IW_SCAN_CAPA_ESSID;
if (priv->enable11d &&
(priv->connect_status == LBS_CONNECTED ||
priv->mesh_connect_status == LBS_CONNECTED)) {
u8 chan_no;
u8 band;
struct parsed_region_chan_11d *parsed_region_chan =
&priv->parsed_region_chan;
if (parsed_region_chan == NULL) {
lbs_deb_wext("11d: parsed_region_chan is NULL\n");
goto out;
}
band = parsed_region_chan->band;
lbs_deb_wext("band %d, nr_char %d\n", band,
parsed_region_chan->nr_chan);
for (j = 0; (range->num_frequency < IW_MAX_FREQUENCIES)
&& (j < ARRAY_SIZE(priv->region_channel)); j++) {
cfp = priv->region_channel[j].CFP;
for (i = 0; (range->num_frequency < IW_MAX_FREQUENCIES)
&& (i < parsed_region_chan->nr_chan); i++) {
chan_no = parsed_region_chan->chanpwr[i].chan;
lbs_deb_wext("chan_no %d\n", chan_no);
range->freq[range->num_frequency].i = (long)chan_no;
&& priv->region_channel[j].valid
&& cfp
&& (i < priv->region_channel[j].nrcfp); i++) {
range->freq[range->num_frequency].i =
(long)cfp->channel;
range->freq[range->num_frequency].m =
(long)lbs_chan_2_freq(chan_no) * 100000;
(long)cfp->freq * 100000;
range->freq[range->num_frequency].e = 1;
cfp++;
range->num_frequency++;
}
flag = 1;
}
if (!flag) {
for (j = 0; (range->num_frequency < IW_MAX_FREQUENCIES)
&& (j < ARRAY_SIZE(priv->region_channel)); j++) {
cfp = priv->region_channel[j].CFP;
for (i = 0; (range->num_frequency < IW_MAX_FREQUENCIES)
&& priv->region_channel[j].valid
&& cfp
&& (i < priv->region_channel[j].nrcfp); i++) {
range->freq[range->num_frequency].i =
(long)cfp->channel;
range->freq[range->num_frequency].m =
(long)cfp->freq * 100000;
range->freq[range->num_frequency].e = 1;
cfp++;
range->num_frequency++;
}
}
}
lbs_deb_wext("IW_MAX_FREQUENCIES %d, num_frequency %d\n",
......@@ -699,7 +662,6 @@ static int lbs_get_range(struct net_device *dev, struct iw_request_info *info,
| IW_ENC_CAPA_CIPHER_CCMP;
}
out:
lbs_deb_leave(LBS_DEB_WEXT);
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment