diff options
author | Holger Schurig <hs4233@mail.mn-solutions.de> | 2009-10-22 09:30:50 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-10-27 16:48:37 -0400 |
commit | c14951fec6c292dca60e3cf8ab0edfdf11e6c0e2 (patch) | |
tree | f5e9abc6e44968b0cda3810a18905d5625d503a1 /drivers/net/wireless | |
parent | 5e047692245c7b8d338ddeece156721d594ca985 (diff) |
libertas: get current channel out of priv->curbssparams
... as priv->curbssparams won't exist once libertas+cfg80211 lands.
Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/libertas/assoc.c | 18 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/assoc.h | 3 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/cmd.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/dev.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/main.c | 10 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/wext.c | 10 |
6 files changed, 25 insertions, 25 deletions
diff --git a/drivers/net/wireless/libertas/assoc.c b/drivers/net/wireless/libertas/assoc.c index 2ccfeca32cd..b8bdba67ad1 100644 --- a/drivers/net/wireless/libertas/assoc.c +++ b/drivers/net/wireless/libertas/assoc.c | |||
@@ -376,7 +376,7 @@ static int lbs_associate(struct lbs_private *priv, | |||
376 | (u16)(pos - (u8 *) &cmd.iebuf)); | 376 | (u16)(pos - (u8 *) &cmd.iebuf)); |
377 | 377 | ||
378 | /* update curbssparams */ | 378 | /* update curbssparams */ |
379 | priv->curbssparams.channel = bss->phy.ds.channel; | 379 | priv->channel = bss->phy.ds.channel; |
380 | 380 | ||
381 | ret = lbs_cmd_with_response(priv, command, &cmd); | 381 | ret = lbs_cmd_with_response(priv, command, &cmd); |
382 | if (ret == 0) { | 382 | if (ret == 0) { |
@@ -489,7 +489,7 @@ static int lbs_adhoc_post(struct lbs_private *priv, | |||
489 | lbs_deb_join("ADHOC_RESP: Joined/started '%s', BSSID %pM, channel %d\n", | 489 | lbs_deb_join("ADHOC_RESP: Joined/started '%s', BSSID %pM, channel %d\n", |
490 | print_ssid(ssid, bss->ssid, bss->ssid_len), | 490 | print_ssid(ssid, bss->ssid, bss->ssid_len), |
491 | priv->curbssparams.bssid, | 491 | priv->curbssparams.bssid, |
492 | priv->curbssparams.channel); | 492 | priv->channel); |
493 | 493 | ||
494 | done: | 494 | done: |
495 | lbs_deb_leave_args(LBS_DEB_JOIN, "ret %d", ret); | 495 | lbs_deb_leave_args(LBS_DEB_JOIN, "ret %d", ret); |
@@ -562,7 +562,7 @@ static int lbs_adhoc_join(struct lbs_private *priv, | |||
562 | lbs_deb_join("AdhocJoin: band = %c\n", assoc_req->band); | 562 | lbs_deb_join("AdhocJoin: band = %c\n", assoc_req->band); |
563 | 563 | ||
564 | priv->adhoccreate = 0; | 564 | priv->adhoccreate = 0; |
565 | priv->curbssparams.channel = bss->channel; | 565 | priv->channel = bss->channel; |
566 | 566 | ||
567 | /* Build the join command */ | 567 | /* Build the join command */ |
568 | memset(&cmd, 0, sizeof(cmd)); | 568 | memset(&cmd, 0, sizeof(cmd)); |
@@ -1196,7 +1196,7 @@ static int assoc_helper_channel(struct lbs_private *priv, | |||
1196 | goto done; | 1196 | goto done; |
1197 | } | 1197 | } |
1198 | 1198 | ||
1199 | if (assoc_req->channel == priv->curbssparams.channel) | 1199 | if (assoc_req->channel == priv->channel) |
1200 | goto done; | 1200 | goto done; |
1201 | 1201 | ||
1202 | if (priv->mesh_dev) { | 1202 | if (priv->mesh_dev) { |
@@ -1208,7 +1208,7 @@ static int assoc_helper_channel(struct lbs_private *priv, | |||
1208 | } | 1208 | } |
1209 | 1209 | ||
1210 | lbs_deb_assoc("ASSOC: channel: %d -> %d\n", | 1210 | lbs_deb_assoc("ASSOC: channel: %d -> %d\n", |
1211 | priv->curbssparams.channel, assoc_req->channel); | 1211 | priv->channel, assoc_req->channel); |
1212 | 1212 | ||
1213 | ret = lbs_set_channel(priv, assoc_req->channel); | 1213 | ret = lbs_set_channel(priv, assoc_req->channel); |
1214 | if (ret < 0) | 1214 | if (ret < 0) |
@@ -1223,7 +1223,7 @@ static int assoc_helper_channel(struct lbs_private *priv, | |||
1223 | goto done; | 1223 | goto done; |
1224 | } | 1224 | } |
1225 | 1225 | ||
1226 | if (assoc_req->channel != priv->curbssparams.channel) { | 1226 | if (assoc_req->channel != priv->channel) { |
1227 | lbs_deb_assoc("ASSOC: channel: failed to update channel to %d\n", | 1227 | lbs_deb_assoc("ASSOC: channel: failed to update channel to %d\n", |
1228 | assoc_req->channel); | 1228 | assoc_req->channel); |
1229 | goto restore_mesh; | 1229 | goto restore_mesh; |
@@ -1244,7 +1244,7 @@ static int assoc_helper_channel(struct lbs_private *priv, | |||
1244 | restore_mesh: | 1244 | restore_mesh: |
1245 | if (priv->mesh_dev) | 1245 | if (priv->mesh_dev) |
1246 | lbs_mesh_config(priv, CMD_ACT_MESH_CONFIG_START, | 1246 | lbs_mesh_config(priv, CMD_ACT_MESH_CONFIG_START, |
1247 | priv->curbssparams.channel); | 1247 | priv->channel); |
1248 | 1248 | ||
1249 | done: | 1249 | done: |
1250 | lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); | 1250 | lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); |
@@ -1466,7 +1466,7 @@ static int should_stop_adhoc(struct lbs_private *priv, | |||
1466 | } | 1466 | } |
1467 | 1467 | ||
1468 | if (test_bit(ASSOC_FLAG_CHANNEL, &assoc_req->flags)) { | 1468 | if (test_bit(ASSOC_FLAG_CHANNEL, &assoc_req->flags)) { |
1469 | if (assoc_req->channel != priv->curbssparams.channel) | 1469 | if (assoc_req->channel != priv->channel) |
1470 | return 1; | 1470 | return 1; |
1471 | } | 1471 | } |
1472 | 1472 | ||
@@ -1771,7 +1771,7 @@ struct assoc_request *lbs_get_association_request(struct lbs_private *priv) | |||
1771 | } | 1771 | } |
1772 | 1772 | ||
1773 | if (!test_bit(ASSOC_FLAG_CHANNEL, &assoc_req->flags)) | 1773 | if (!test_bit(ASSOC_FLAG_CHANNEL, &assoc_req->flags)) |
1774 | assoc_req->channel = priv->curbssparams.channel; | 1774 | assoc_req->channel = priv->channel; |
1775 | 1775 | ||
1776 | if (!test_bit(ASSOC_FLAG_BAND, &assoc_req->flags)) | 1776 | if (!test_bit(ASSOC_FLAG_BAND, &assoc_req->flags)) |
1777 | assoc_req->band = priv->curbssparams.band; | 1777 | assoc_req->band = priv->curbssparams.band; |
diff --git a/drivers/net/wireless/libertas/assoc.h b/drivers/net/wireless/libertas/assoc.h index 610d14c14cd..d8c266895dd 100644 --- a/drivers/net/wireless/libertas/assoc.h +++ b/drivers/net/wireless/libertas/assoc.h | |||
@@ -36,8 +36,7 @@ struct current_bss_params { | |||
36 | 36 | ||
37 | /** band */ | 37 | /** band */ |
38 | u8 band; | 38 | u8 band; |
39 | /** channel */ | 39 | /** channel is directly in priv->channel */ |
40 | u8 channel; | ||
41 | /** zero-terminated array of supported data rates */ | 40 | /** zero-terminated array of supported data rates */ |
42 | u8 rates[MAX_RATES + 1]; | 41 | u8 rates[MAX_RATES + 1]; |
43 | }; | 42 | }; |
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c index ec65be0c4d9..076cf7e625f 100644 --- a/drivers/net/wireless/libertas/cmd.c +++ b/drivers/net/wireless/libertas/cmd.c | |||
@@ -880,7 +880,7 @@ int lbs_update_channel(struct lbs_private *priv) | |||
880 | 880 | ||
881 | ret = lbs_get_channel(priv); | 881 | ret = lbs_get_channel(priv); |
882 | if (ret > 0) { | 882 | if (ret > 0) { |
883 | priv->curbssparams.channel = ret; | 883 | priv->channel = ret; |
884 | ret = 0; | 884 | ret = 0; |
885 | } | 885 | } |
886 | lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); | 886 | 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 | { | 899 | { |
900 | struct cmd_ds_802_11_rf_channel cmd; | 900 | struct cmd_ds_802_11_rf_channel cmd; |
901 | #ifdef DEBUG | 901 | #ifdef DEBUG |
902 | u8 old_channel = priv->curbssparams.channel; | 902 | u8 old_channel = priv->channel; |
903 | #endif | 903 | #endif |
904 | int ret = 0; | 904 | int ret = 0; |
905 | 905 | ||
@@ -914,9 +914,9 @@ int lbs_set_channel(struct lbs_private *priv, u8 channel) | |||
914 | if (ret) | 914 | if (ret) |
915 | goto out; | 915 | goto out; |
916 | 916 | ||
917 | priv->curbssparams.channel = (uint8_t) le16_to_cpu(cmd.channel); | 917 | priv->channel = (uint8_t) le16_to_cpu(cmd.channel); |
918 | lbs_deb_cmd("channel switch from %d to %d\n", old_channel, | 918 | lbs_deb_cmd("channel switch from %d to %d\n", old_channel, |
919 | priv->curbssparams.channel); | 919 | priv->channel); |
920 | 920 | ||
921 | out: | 921 | out: |
922 | lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret); | 922 | lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret); |
diff --git a/drivers/net/wireless/libertas/dev.h b/drivers/net/wireless/libertas/dev.h index 27f0f1f2a58..1a675111300 100644 --- a/drivers/net/wireless/libertas/dev.h +++ b/drivers/net/wireless/libertas/dev.h | |||
@@ -165,6 +165,7 @@ struct lbs_private { | |||
165 | /* NIC/link operation characteristics */ | 165 | /* NIC/link operation characteristics */ |
166 | u16 mac_control; | 166 | u16 mac_control; |
167 | u8 radio_on; | 167 | u8 radio_on; |
168 | u8 channel; | ||
168 | s16 txpower_cur; | 169 | s16 txpower_cur; |
169 | s16 txpower_min; | 170 | s16 txpower_min; |
170 | s16 txpower_max; | 171 | s16 txpower_max; |
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c index ee089333455..eb61f6955e9 100644 --- a/drivers/net/wireless/libertas/main.c +++ b/drivers/net/wireless/libertas/main.c | |||
@@ -285,7 +285,7 @@ static ssize_t lbs_mesh_set(struct device *dev, | |||
285 | return count; | 285 | return count; |
286 | if (enable) | 286 | if (enable) |
287 | action = CMD_ACT_MESH_CONFIG_START; | 287 | action = CMD_ACT_MESH_CONFIG_START; |
288 | ret = lbs_mesh_config(priv, action, priv->curbssparams.channel); | 288 | ret = lbs_mesh_config(priv, action, priv->channel); |
289 | if (ret) | 289 | if (ret) |
290 | return ret; | 290 | return ret; |
291 | 291 | ||
@@ -1046,7 +1046,7 @@ static int lbs_init_adapter(struct lbs_private *priv) | |||
1046 | priv->mesh_connect_status = LBS_DISCONNECTED; | 1046 | priv->mesh_connect_status = LBS_DISCONNECTED; |
1047 | priv->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM; | 1047 | priv->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM; |
1048 | priv->mode = IW_MODE_INFRA; | 1048 | priv->mode = IW_MODE_INFRA; |
1049 | priv->curbssparams.channel = DEFAULT_AD_HOC_CHANNEL; | 1049 | priv->channel = DEFAULT_AD_HOC_CHANNEL; |
1050 | priv->mac_control = CMD_ACT_MAC_RX_ON | CMD_ACT_MAC_TX_ON; | 1050 | priv->mac_control = CMD_ACT_MAC_RX_ON | CMD_ACT_MAC_TX_ON; |
1051 | priv->radio_on = 1; | 1051 | priv->radio_on = 1; |
1052 | priv->enablehwauto = 1; | 1052 | priv->enablehwauto = 1; |
@@ -1314,10 +1314,10 @@ int lbs_start_card(struct lbs_private *priv) | |||
1314 | 1314 | ||
1315 | priv->mesh_tlv = TLV_TYPE_OLD_MESH_ID; | 1315 | priv->mesh_tlv = TLV_TYPE_OLD_MESH_ID; |
1316 | if (lbs_mesh_config(priv, CMD_ACT_MESH_CONFIG_START, | 1316 | if (lbs_mesh_config(priv, CMD_ACT_MESH_CONFIG_START, |
1317 | priv->curbssparams.channel)) { | 1317 | priv->channel)) { |
1318 | priv->mesh_tlv = TLV_TYPE_MESH_ID; | 1318 | priv->mesh_tlv = TLV_TYPE_MESH_ID; |
1319 | if (lbs_mesh_config(priv, CMD_ACT_MESH_CONFIG_START, | 1319 | if (lbs_mesh_config(priv, CMD_ACT_MESH_CONFIG_START, |
1320 | priv->curbssparams.channel)) | 1320 | priv->channel)) |
1321 | priv->mesh_tlv = 0; | 1321 | priv->mesh_tlv = 0; |
1322 | } | 1322 | } |
1323 | } else if (priv->mesh_fw_ver == MESH_FW_NEW) { | 1323 | } else if (priv->mesh_fw_ver == MESH_FW_NEW) { |
@@ -1326,7 +1326,7 @@ int lbs_start_card(struct lbs_private *priv) | |||
1326 | */ | 1326 | */ |
1327 | priv->mesh_tlv = TLV_TYPE_MESH_ID; | 1327 | priv->mesh_tlv = TLV_TYPE_MESH_ID; |
1328 | if (lbs_mesh_config(priv, CMD_ACT_MESH_CONFIG_START, | 1328 | if (lbs_mesh_config(priv, CMD_ACT_MESH_CONFIG_START, |
1329 | priv->curbssparams.channel)) | 1329 | priv->channel)) |
1330 | priv->mesh_tlv = 0; | 1330 | priv->mesh_tlv = 0; |
1331 | } | 1331 | } |
1332 | if (priv->mesh_tlv) { | 1332 | if (priv->mesh_tlv) { |
diff --git a/drivers/net/wireless/libertas/wext.c b/drivers/net/wireless/libertas/wext.c index 3e8be9a578e..c688ca7ab32 100644 --- a/drivers/net/wireless/libertas/wext.c +++ b/drivers/net/wireless/libertas/wext.c | |||
@@ -164,12 +164,12 @@ static int lbs_get_freq(struct net_device *dev, struct iw_request_info *info, | |||
164 | lbs_deb_enter(LBS_DEB_WEXT); | 164 | lbs_deb_enter(LBS_DEB_WEXT); |
165 | 165 | ||
166 | cfp = lbs_find_cfp_by_band_and_channel(priv, 0, | 166 | cfp = lbs_find_cfp_by_band_and_channel(priv, 0, |
167 | priv->curbssparams.channel); | 167 | priv->channel); |
168 | 168 | ||
169 | if (!cfp) { | 169 | if (!cfp) { |
170 | if (priv->curbssparams.channel) | 170 | if (priv->channel) |
171 | lbs_deb_wext("invalid channel %d\n", | 171 | lbs_deb_wext("invalid channel %d\n", |
172 | priv->curbssparams.channel); | 172 | priv->channel); |
173 | return -EINVAL; | 173 | return -EINVAL; |
174 | } | 174 | } |
175 | 175 | ||
@@ -986,7 +986,7 @@ static int lbs_mesh_set_freq(struct net_device *dev, | |||
986 | goto out; | 986 | goto out; |
987 | } | 987 | } |
988 | 988 | ||
989 | if (fwrq->m != priv->curbssparams.channel) { | 989 | if (fwrq->m != priv->channel) { |
990 | lbs_deb_wext("mesh channel change forces eth disconnect\n"); | 990 | lbs_deb_wext("mesh channel change forces eth disconnect\n"); |
991 | if (priv->mode == IW_MODE_INFRA) | 991 | if (priv->mode == IW_MODE_INFRA) |
992 | lbs_cmd_80211_deauthenticate(priv, | 992 | lbs_cmd_80211_deauthenticate(priv, |
@@ -2100,7 +2100,7 @@ static int lbs_mesh_set_essid(struct net_device *dev, | |||
2100 | } | 2100 | } |
2101 | 2101 | ||
2102 | lbs_mesh_config(priv, CMD_ACT_MESH_CONFIG_START, | 2102 | lbs_mesh_config(priv, CMD_ACT_MESH_CONFIG_START, |
2103 | priv->curbssparams.channel); | 2103 | priv->channel); |
2104 | out: | 2104 | out: |
2105 | lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); | 2105 | lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); |
2106 | return ret; | 2106 | return ret; |