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

libertas: get current channel out of priv->curbssparams

... as priv->curbssparams won't exist once libertas+cfg80211 lands.
Signed-off-by: default avatarHolger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 5e047692
...@@ -376,7 +376,7 @@ static int lbs_associate(struct lbs_private *priv, ...@@ -376,7 +376,7 @@ static int lbs_associate(struct lbs_private *priv,
(u16)(pos - (u8 *) &cmd.iebuf)); (u16)(pos - (u8 *) &cmd.iebuf));
/* update curbssparams */ /* update curbssparams */
priv->curbssparams.channel = bss->phy.ds.channel; priv->channel = bss->phy.ds.channel;
ret = lbs_cmd_with_response(priv, command, &cmd); ret = lbs_cmd_with_response(priv, command, &cmd);
if (ret == 0) { if (ret == 0) {
...@@ -489,7 +489,7 @@ static int lbs_adhoc_post(struct lbs_private *priv, ...@@ -489,7 +489,7 @@ static int lbs_adhoc_post(struct lbs_private *priv,
lbs_deb_join("ADHOC_RESP: Joined/started '%s', BSSID %pM, channel %d\n", lbs_deb_join("ADHOC_RESP: Joined/started '%s', BSSID %pM, channel %d\n",
print_ssid(ssid, bss->ssid, bss->ssid_len), print_ssid(ssid, bss->ssid, bss->ssid_len),
priv->curbssparams.bssid, priv->curbssparams.bssid,
priv->curbssparams.channel); priv->channel);
done: done:
lbs_deb_leave_args(LBS_DEB_JOIN, "ret %d", ret); lbs_deb_leave_args(LBS_DEB_JOIN, "ret %d", ret);
...@@ -562,7 +562,7 @@ static int lbs_adhoc_join(struct lbs_private *priv, ...@@ -562,7 +562,7 @@ static int lbs_adhoc_join(struct lbs_private *priv,
lbs_deb_join("AdhocJoin: band = %c\n", assoc_req->band); lbs_deb_join("AdhocJoin: band = %c\n", assoc_req->band);
priv->adhoccreate = 0; priv->adhoccreate = 0;
priv->curbssparams.channel = bss->channel; priv->channel = bss->channel;
/* Build the join command */ /* Build the join command */
memset(&cmd, 0, sizeof(cmd)); memset(&cmd, 0, sizeof(cmd));
...@@ -1196,7 +1196,7 @@ static int assoc_helper_channel(struct lbs_private *priv, ...@@ -1196,7 +1196,7 @@ static int assoc_helper_channel(struct lbs_private *priv,
goto done; goto done;
} }
if (assoc_req->channel == priv->curbssparams.channel) if (assoc_req->channel == priv->channel)
goto done; goto done;
if (priv->mesh_dev) { if (priv->mesh_dev) {
...@@ -1208,7 +1208,7 @@ static int assoc_helper_channel(struct lbs_private *priv, ...@@ -1208,7 +1208,7 @@ static int assoc_helper_channel(struct lbs_private *priv,
} }
lbs_deb_assoc("ASSOC: channel: %d -> %d\n", lbs_deb_assoc("ASSOC: channel: %d -> %d\n",
priv->curbssparams.channel, assoc_req->channel); priv->channel, assoc_req->channel);
ret = lbs_set_channel(priv, assoc_req->channel); ret = lbs_set_channel(priv, assoc_req->channel);
if (ret < 0) if (ret < 0)
...@@ -1223,7 +1223,7 @@ static int assoc_helper_channel(struct lbs_private *priv, ...@@ -1223,7 +1223,7 @@ static int assoc_helper_channel(struct lbs_private *priv,
goto done; goto done;
} }
if (assoc_req->channel != priv->curbssparams.channel) { if (assoc_req->channel != priv->channel) {
lbs_deb_assoc("ASSOC: channel: failed to update channel to %d\n", lbs_deb_assoc("ASSOC: channel: failed to update channel to %d\n",
assoc_req->channel); assoc_req->channel);
goto restore_mesh; goto restore_mesh;
...@@ -1244,7 +1244,7 @@ static int assoc_helper_channel(struct lbs_private *priv, ...@@ -1244,7 +1244,7 @@ static int assoc_helper_channel(struct lbs_private *priv,
restore_mesh: restore_mesh:
if (priv->mesh_dev) if (priv->mesh_dev)
lbs_mesh_config(priv, CMD_ACT_MESH_CONFIG_START, lbs_mesh_config(priv, CMD_ACT_MESH_CONFIG_START,
priv->curbssparams.channel); priv->channel);
done: done:
lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret);
...@@ -1466,7 +1466,7 @@ static int should_stop_adhoc(struct lbs_private *priv, ...@@ -1466,7 +1466,7 @@ static int should_stop_adhoc(struct lbs_private *priv,
} }
if (test_bit(ASSOC_FLAG_CHANNEL, &assoc_req->flags)) { if (test_bit(ASSOC_FLAG_CHANNEL, &assoc_req->flags)) {
if (assoc_req->channel != priv->curbssparams.channel) if (assoc_req->channel != priv->channel)
return 1; return 1;
} }
...@@ -1771,7 +1771,7 @@ struct assoc_request *lbs_get_association_request(struct lbs_private *priv) ...@@ -1771,7 +1771,7 @@ struct assoc_request *lbs_get_association_request(struct lbs_private *priv)
} }
if (!test_bit(ASSOC_FLAG_CHANNEL, &assoc_req->flags)) if (!test_bit(ASSOC_FLAG_CHANNEL, &assoc_req->flags))
assoc_req->channel = priv->curbssparams.channel; assoc_req->channel = priv->channel;
if (!test_bit(ASSOC_FLAG_BAND, &assoc_req->flags)) if (!test_bit(ASSOC_FLAG_BAND, &assoc_req->flags))
assoc_req->band = priv->curbssparams.band; assoc_req->band = priv->curbssparams.band;
......
...@@ -36,8 +36,7 @@ struct current_bss_params { ...@@ -36,8 +36,7 @@ struct current_bss_params {
/** band */ /** band */
u8 band; u8 band;
/** channel */ /** channel is directly in priv->channel */
u8 channel;
/** zero-terminated array of supported data rates */ /** zero-terminated array of supported data rates */
u8 rates[MAX_RATES + 1]; u8 rates[MAX_RATES + 1];
}; };
......
...@@ -880,7 +880,7 @@ int lbs_update_channel(struct lbs_private *priv) ...@@ -880,7 +880,7 @@ int lbs_update_channel(struct lbs_private *priv)
ret = lbs_get_channel(priv); ret = lbs_get_channel(priv);
if (ret > 0) { if (ret > 0) {
priv->curbssparams.channel = ret; priv->channel = ret;
ret = 0; ret = 0;
} }
lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret);
...@@ -899,7 +899,7 @@ int lbs_set_channel(struct lbs_private *priv, u8 channel) ...@@ -899,7 +899,7 @@ int lbs_set_channel(struct lbs_private *priv, u8 channel)
{ {
struct cmd_ds_802_11_rf_channel cmd; struct cmd_ds_802_11_rf_channel cmd;
#ifdef DEBUG #ifdef DEBUG
u8 old_channel = priv->curbssparams.channel; u8 old_channel = priv->channel;
#endif #endif
int ret = 0; int ret = 0;
...@@ -914,9 +914,9 @@ int lbs_set_channel(struct lbs_private *priv, u8 channel) ...@@ -914,9 +914,9 @@ int lbs_set_channel(struct lbs_private *priv, u8 channel)
if (ret) if (ret)
goto out; goto out;
priv->curbssparams.channel = (uint8_t) le16_to_cpu(cmd.channel); priv->channel = (uint8_t) le16_to_cpu(cmd.channel);
lbs_deb_cmd("channel switch from %d to %d\n", old_channel, lbs_deb_cmd("channel switch from %d to %d\n", old_channel,
priv->curbssparams.channel); priv->channel);
out: out:
lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret); lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret);
......
...@@ -165,6 +165,7 @@ struct lbs_private { ...@@ -165,6 +165,7 @@ struct lbs_private {
/* NIC/link operation characteristics */ /* NIC/link operation characteristics */
u16 mac_control; u16 mac_control;
u8 radio_on; u8 radio_on;
u8 channel;
s16 txpower_cur; s16 txpower_cur;
s16 txpower_min; s16 txpower_min;
s16 txpower_max; s16 txpower_max;
......
...@@ -285,7 +285,7 @@ static ssize_t lbs_mesh_set(struct device *dev, ...@@ -285,7 +285,7 @@ static ssize_t lbs_mesh_set(struct device *dev,
return count; return count;
if (enable) if (enable)
action = CMD_ACT_MESH_CONFIG_START; action = CMD_ACT_MESH_CONFIG_START;
ret = lbs_mesh_config(priv, action, priv->curbssparams.channel); ret = lbs_mesh_config(priv, action, priv->channel);
if (ret) if (ret)
return ret; return ret;
...@@ -1046,7 +1046,7 @@ static int lbs_init_adapter(struct lbs_private *priv) ...@@ -1046,7 +1046,7 @@ static int lbs_init_adapter(struct lbs_private *priv)
priv->mesh_connect_status = LBS_DISCONNECTED; priv->mesh_connect_status = LBS_DISCONNECTED;
priv->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM; priv->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM;
priv->mode = IW_MODE_INFRA; priv->mode = IW_MODE_INFRA;
priv->curbssparams.channel = DEFAULT_AD_HOC_CHANNEL; priv->channel = DEFAULT_AD_HOC_CHANNEL;
priv->mac_control = CMD_ACT_MAC_RX_ON | CMD_ACT_MAC_TX_ON; priv->mac_control = CMD_ACT_MAC_RX_ON | CMD_ACT_MAC_TX_ON;
priv->radio_on = 1; priv->radio_on = 1;
priv->enablehwauto = 1; priv->enablehwauto = 1;
...@@ -1314,10 +1314,10 @@ int lbs_start_card(struct lbs_private *priv) ...@@ -1314,10 +1314,10 @@ int lbs_start_card(struct lbs_private *priv)
priv->mesh_tlv = TLV_TYPE_OLD_MESH_ID; priv->mesh_tlv = TLV_TYPE_OLD_MESH_ID;
if (lbs_mesh_config(priv, CMD_ACT_MESH_CONFIG_START, if (lbs_mesh_config(priv, CMD_ACT_MESH_CONFIG_START,
priv->curbssparams.channel)) { priv->channel)) {
priv->mesh_tlv = TLV_TYPE_MESH_ID; priv->mesh_tlv = TLV_TYPE_MESH_ID;
if (lbs_mesh_config(priv, CMD_ACT_MESH_CONFIG_START, if (lbs_mesh_config(priv, CMD_ACT_MESH_CONFIG_START,
priv->curbssparams.channel)) priv->channel))
priv->mesh_tlv = 0; priv->mesh_tlv = 0;
} }
} else if (priv->mesh_fw_ver == MESH_FW_NEW) { } else if (priv->mesh_fw_ver == MESH_FW_NEW) {
...@@ -1326,7 +1326,7 @@ int lbs_start_card(struct lbs_private *priv) ...@@ -1326,7 +1326,7 @@ int lbs_start_card(struct lbs_private *priv)
*/ */
priv->mesh_tlv = TLV_TYPE_MESH_ID; priv->mesh_tlv = TLV_TYPE_MESH_ID;
if (lbs_mesh_config(priv, CMD_ACT_MESH_CONFIG_START, if (lbs_mesh_config(priv, CMD_ACT_MESH_CONFIG_START,
priv->curbssparams.channel)) priv->channel))
priv->mesh_tlv = 0; priv->mesh_tlv = 0;
} }
if (priv->mesh_tlv) { if (priv->mesh_tlv) {
......
...@@ -164,12 +164,12 @@ static int lbs_get_freq(struct net_device *dev, struct iw_request_info *info, ...@@ -164,12 +164,12 @@ static int lbs_get_freq(struct net_device *dev, struct iw_request_info *info,
lbs_deb_enter(LBS_DEB_WEXT); lbs_deb_enter(LBS_DEB_WEXT);
cfp = lbs_find_cfp_by_band_and_channel(priv, 0, cfp = lbs_find_cfp_by_band_and_channel(priv, 0,
priv->curbssparams.channel); priv->channel);
if (!cfp) { if (!cfp) {
if (priv->curbssparams.channel) if (priv->channel)
lbs_deb_wext("invalid channel %d\n", lbs_deb_wext("invalid channel %d\n",
priv->curbssparams.channel); priv->channel);
return -EINVAL; return -EINVAL;
} }
...@@ -986,7 +986,7 @@ static int lbs_mesh_set_freq(struct net_device *dev, ...@@ -986,7 +986,7 @@ static int lbs_mesh_set_freq(struct net_device *dev,
goto out; goto out;
} }
if (fwrq->m != priv->curbssparams.channel) { if (fwrq->m != priv->channel) {
lbs_deb_wext("mesh channel change forces eth disconnect\n"); lbs_deb_wext("mesh channel change forces eth disconnect\n");
if (priv->mode == IW_MODE_INFRA) if (priv->mode == IW_MODE_INFRA)
lbs_cmd_80211_deauthenticate(priv, lbs_cmd_80211_deauthenticate(priv,
...@@ -2100,7 +2100,7 @@ static int lbs_mesh_set_essid(struct net_device *dev, ...@@ -2100,7 +2100,7 @@ static int lbs_mesh_set_essid(struct net_device *dev,
} }
lbs_mesh_config(priv, CMD_ACT_MESH_CONFIG_START, lbs_mesh_config(priv, CMD_ACT_MESH_CONFIG_START,
priv->curbssparams.channel); priv->channel);
out: out:
lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret);
return ret; return ret;
......
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