|
@@ -23,13 +23,13 @@ static int assoc_helper_essid(wlan_private *priv,
|
|
ENTER();
|
|
ENTER();
|
|
|
|
|
|
lbs_pr_debug(1, "New SSID requested: %s\n", assoc_req->ssid.ssid);
|
|
lbs_pr_debug(1, "New SSID requested: %s\n", assoc_req->ssid.ssid);
|
|
- if (assoc_req->mode == wlan802_11infrastructure) {
|
|
|
|
|
|
+ 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);
|
|
}
|
|
}
|
|
|
|
|
|
i = libertas_find_SSID_in_list(adapter, &assoc_req->ssid,
|
|
i = libertas_find_SSID_in_list(adapter, &assoc_req->ssid,
|
|
- NULL, wlan802_11infrastructure);
|
|
|
|
|
|
+ NULL, IW_MODE_INFRA);
|
|
if (i >= 0) {
|
|
if (i >= 0) {
|
|
lbs_pr_debug(1,
|
|
lbs_pr_debug(1,
|
|
"SSID found in scan list ... associating...\n");
|
|
"SSID found in scan list ... associating...\n");
|
|
@@ -44,7 +44,7 @@ static int assoc_helper_essid(wlan_private *priv,
|
|
lbs_pr_debug(1, "SSID '%s' not found; cannot associate\n",
|
|
lbs_pr_debug(1, "SSID '%s' not found; cannot associate\n",
|
|
assoc_req->ssid.ssid);
|
|
assoc_req->ssid.ssid);
|
|
}
|
|
}
|
|
- } else if (assoc_req->mode == wlan802_11ibss) {
|
|
|
|
|
|
+ } else if (assoc_req->mode == IW_MODE_ADHOC) {
|
|
/* Scan for the network, do not save previous results. Stale
|
|
/* Scan for the network, do not save previous results. Stale
|
|
* scan data will cause us to join a non-existant adhoc network
|
|
* scan data will cause us to join a non-existant adhoc network
|
|
*/
|
|
*/
|
|
@@ -52,7 +52,7 @@ static int assoc_helper_essid(wlan_private *priv,
|
|
|
|
|
|
/* Search for the requested SSID in the scan table */
|
|
/* Search for the requested SSID in the scan table */
|
|
i = libertas_find_SSID_in_list(adapter, &assoc_req->ssid, NULL,
|
|
i = libertas_find_SSID_in_list(adapter, &assoc_req->ssid, NULL,
|
|
- wlan802_11ibss);
|
|
|
|
|
|
+ IW_MODE_ADHOC);
|
|
if (i >= 0) {
|
|
if (i >= 0) {
|
|
lbs_pr_debug(1, "SSID found at %d in List, so join\n", ret);
|
|
lbs_pr_debug(1, "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]);
|
|
@@ -90,10 +90,10 @@ static int assoc_helper_bssid(wlan_private *priv,
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
|
|
|
|
- if (assoc_req->mode == wlan802_11infrastructure) {
|
|
|
|
|
|
+ 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_pr_debug(1, "ASSOC: return from wlan_associate(bssd) was %d\n", ret);
|
|
- } else if (assoc_req->mode == wlan802_11ibss) {
|
|
|
|
|
|
+ } else if (assoc_req->mode == IW_MODE_ADHOC) {
|
|
libertas_join_adhoc_network(priv, &adapter->scantable[i]);
|
|
libertas_join_adhoc_network(priv, &adapter->scantable[i]);
|
|
}
|
|
}
|
|
memcpy(&assoc_req->ssid, &adapter->scantable[i].ssid,
|
|
memcpy(&assoc_req->ssid, &adapter->scantable[i].ssid,
|
|
@@ -142,23 +142,23 @@ static int assoc_helper_mode(wlan_private *priv,
|
|
|
|
|
|
ENTER();
|
|
ENTER();
|
|
|
|
|
|
- if (assoc_req->mode == adapter->inframode) {
|
|
|
|
|
|
+ if (assoc_req->mode == adapter->mode) {
|
|
LEAVE();
|
|
LEAVE();
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
- if (assoc_req->mode == wlan802_11infrastructure) {
|
|
|
|
|
|
+ if (assoc_req->mode == IW_MODE_INFRA) {
|
|
if (adapter->psstate != PS_STATE_FULL_POWER)
|
|
if (adapter->psstate != PS_STATE_FULL_POWER)
|
|
libertas_ps_wakeup(priv, cmd_option_waitforrsp);
|
|
libertas_ps_wakeup(priv, cmd_option_waitforrsp);
|
|
adapter->psmode = wlan802_11powermodecam;
|
|
adapter->psmode = wlan802_11powermodecam;
|
|
}
|
|
}
|
|
|
|
|
|
- adapter->inframode = assoc_req->mode;
|
|
|
|
|
|
+ adapter->mode = assoc_req->mode;
|
|
ret = libertas_prepare_and_send_command(priv,
|
|
ret = libertas_prepare_and_send_command(priv,
|
|
cmd_802_11_snmp_mib,
|
|
cmd_802_11_snmp_mib,
|
|
0, cmd_option_waitforrsp,
|
|
0, cmd_option_waitforrsp,
|
|
OID_802_11_INFRASTRUCTURE_MODE,
|
|
OID_802_11_INFRASTRUCTURE_MODE,
|
|
- (void *) assoc_req->mode);
|
|
|
|
|
|
+ (void *) (size_t) assoc_req->mode);
|
|
|
|
|
|
LEAVE();
|
|
LEAVE();
|
|
return ret;
|
|
return ret;
|
|
@@ -315,7 +315,7 @@ static int should_deauth_infrastructure(wlan_adapter *adapter,
|
|
|
|
|
|
/* FIXME: deal with 'auto' mode somehow */
|
|
/* FIXME: deal with 'auto' mode somehow */
|
|
if (test_bit(ASSOC_FLAG_MODE, &assoc_req->flags)) {
|
|
if (test_bit(ASSOC_FLAG_MODE, &assoc_req->flags)) {
|
|
- if (assoc_req->mode != wlan802_11infrastructure)
|
|
|
|
|
|
+ if (assoc_req->mode != IW_MODE_INFRA)
|
|
return 1;
|
|
return 1;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -337,7 +337,7 @@ static int should_stop_adhoc(wlan_adapter *adapter,
|
|
|
|
|
|
/* FIXME: deal with 'auto' mode somehow */
|
|
/* FIXME: deal with 'auto' mode somehow */
|
|
if (test_bit(ASSOC_FLAG_MODE, &assoc_req->flags)) {
|
|
if (test_bit(ASSOC_FLAG_MODE, &assoc_req->flags)) {
|
|
- if (assoc_req->mode != wlan802_11ibss)
|
|
|
|
|
|
+ if (assoc_req->mode != IW_MODE_ADHOC)
|
|
return 1;
|
|
return 1;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -381,7 +381,7 @@ void wlan_association_worker(struct work_struct *work)
|
|
}
|
|
}
|
|
|
|
|
|
if (find_any_ssid) {
|
|
if (find_any_ssid) {
|
|
- enum WLAN_802_11_NETWORK_INFRASTRUCTURE new_mode;
|
|
|
|
|
|
+ u8 new_mode;
|
|
|
|
|
|
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);
|
|
@@ -392,7 +392,7 @@ void wlan_association_worker(struct work_struct *work)
|
|
}
|
|
}
|
|
|
|
|
|
/* Ensure we switch to the mode of the AP */
|
|
/* Ensure we switch to the mode of the AP */
|
|
- if (assoc_req->mode == wlan802_11autounknown) {
|
|
|
|
|
|
+ if (assoc_req->mode == IW_MODE_AUTO) {
|
|
set_bit(ASSOC_FLAG_MODE, &assoc_req->flags);
|
|
set_bit(ASSOC_FLAG_MODE, &assoc_req->flags);
|
|
assoc_req->mode = new_mode;
|
|
assoc_req->mode = new_mode;
|
|
}
|
|
}
|
|
@@ -402,7 +402,7 @@ void wlan_association_worker(struct work_struct *work)
|
|
* Check if the attributes being changing require deauthentication
|
|
* Check if the attributes being changing require deauthentication
|
|
* from the currently associated infrastructure access point.
|
|
* from the currently associated infrastructure access point.
|
|
*/
|
|
*/
|
|
- if (adapter->inframode == wlan802_11infrastructure) {
|
|
|
|
|
|
+ if (adapter->mode == IW_MODE_INFRA) {
|
|
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) {
|
|
@@ -411,7 +411,7 @@ void wlan_association_worker(struct work_struct *work)
|
|
ret);
|
|
ret);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- } else if (adapter->inframode == wlan802_11ibss) {
|
|
|
|
|
|
+ } else if (adapter->mode == IW_MODE_ADHOC) {
|
|
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) {
|
|
@@ -542,7 +542,7 @@ struct assoc_request * wlan_get_association_request(wlan_adapter *adapter)
|
|
assoc_req->channel = adapter->curbssparams.channel;
|
|
assoc_req->channel = adapter->curbssparams.channel;
|
|
|
|
|
|
if (!test_bit(ASSOC_FLAG_MODE, &assoc_req->flags))
|
|
if (!test_bit(ASSOC_FLAG_MODE, &assoc_req->flags))
|
|
- assoc_req->mode = adapter->inframode;
|
|
|
|
|
|
+ assoc_req->mode = adapter->mode;
|
|
|
|
|
|
if (!test_bit(ASSOC_FLAG_BSSID, &assoc_req->flags)) {
|
|
if (!test_bit(ASSOC_FLAG_BSSID, &assoc_req->flags)) {
|
|
memcpy(&assoc_req->bssid, adapter->curbssparams.bssid,
|
|
memcpy(&assoc_req->bssid, adapter->curbssparams.bssid,
|