Skip to contentSkip to conversation

libertas: automatically re-associate

PATCH In review Holger Schurig 3 participants 9 messages Oct 9, 2007 – Oct 11, 2007 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libertas: automatically re-associate

Automatically re-association to an access point when we get de-associated. This is especially helpful if an AP de-associates us because scanning took to long (remember, the my firmware can't send 802.11 powersafe null packets).

* don't free pending_assoc_req in the association worker, keep it as is.
* free pending_assoc_req at adapter removal time.
* when we get a MAC level event saying that we've been de-associated, use the alredy filled in association record to make a new scan and re-associate.
* also moved wlan_postpone_association_work() and wlan_cancel_association_work() from a *.h file to the sole user, into wext.h. Renamed them to libertas_XXX as well.

---

BTW, I've done a little bit of research (err, trying out). At least orinoco_cs, ipw2200 and bcm43xx all automatically re-associate.

Months ago Dan once said that I should add some logic to not re-associate more than X times to an AP. So far I don't know of any fullmac driver that does is. Also I think that this makes things needlessly complicated. And it buys us nothing. If an AP really doesn't want to have a client not associated to itself, it should apply better means, e.g. WPA/WPA2 ...

drivers/net/wireless/libertas/assoc.c +0 -2
Index: libertas-2.6/drivers/net/wireless/libertas/assoc.c
===================================================================
@@ -506,7 +506,6 @@ void libertas_association_worker(struct 
 
 	mutex_lock(&adapter->lock);
 	assoc_req = adapter->pending_assoc_req;
-	adapter->pending_assoc_req = NULL;
 	adapter->in_progress_assoc_req = assoc_req;
 	mutex_unlock(&adapter->lock);
 
@@ -675,7 +674,6 @@ out:
 	mutex_lock(&adapter->lock);
 	adapter->in_progress_assoc_req = NULL;
 	mutex_unlock(&adapter->lock);
-	kfree(assoc_req);
 
 done:
 	lbs_deb_leave(LBS_DEB_ASSOC);
drivers/net/wireless/libertas/assoc.h +0 -18
Index: libertas-2.6/drivers/net/wireless/libertas/assoc.h
===================================================================
@@ -11,22 +11,4 @@ struct assoc_request * wlan_get_associat
 
 void libertas_sync_channel(struct work_struct *work);
 
-#define ASSOC_DELAY (HZ / 2)
-static inline void wlan_postpone_association_work(wlan_private *priv)
-{
-	if (priv->adapter->surpriseremoved)
-		return;
-	cancel_delayed_work(&priv->assoc_work);
-	queue_delayed_work(priv->work_thread, &priv->assoc_work, ASSOC_DELAY);
-}
-
-static inline void wlan_cancel_association_work(wlan_private *priv)
-{
-	cancel_delayed_work(&priv->assoc_work);
-	if (priv->adapter->pending_assoc_req) {
-		kfree(priv->adapter->pending_assoc_req);
-		priv->adapter->pending_assoc_req = NULL;
-	}
-}
-
 #endif /* _WLAN_ASSOC_H */
drivers/net/wireless/libertas/cmdresp.c +7 -0
Index: libertas-2.6/drivers/net/wireless/libertas/cmdresp.c
===================================================================
@@ -79,6 +79,13 @@ void libertas_mac_event_disconnected(wla
 		lbs_deb_cmd("disconnected, so exit PS mode\n");
 		libertas_ps_wakeup(priv, 0);
 	}
+
+	if (adapter->pending_assoc_req) {
+		cancel_delayed_work(&priv->assoc_work);
+		queue_delayed_work(priv->work_thread,
+			&priv->assoc_work, HZ / 4);
+	}
+
 	lbs_deb_leave(LBS_DEB_CMD);
 }
 
drivers/net/wireless/libertas/main.c +8 -7
Index: libertas-2.6/drivers/net/wireless/libertas/main.c
===================================================================
@@ -460,11 +460,17 @@ static int libertas_open(struct net_devi
 static int libertas_dev_close(struct net_device *dev)
 {
 	wlan_private *priv = dev->priv;
+	wlan_adapter *adapter = priv->adapter;
 
 	lbs_deb_enter(LBS_DEB_NET);
 
-	netif_carrier_off(priv->dev);
+	mutex_lock(&adapter->lock);
 	priv->open = 0;
+	adapter->connect_status = LIBERTAS_DISCONNECTED;
+	kfree(adapter->pending_assoc_req);
+	adapter->pending_assoc_req = NULL;
+	mutex_unlock(&adapter->lock);
+	netif_carrier_off(priv->dev);
 
 	lbs_deb_leave(LBS_DEB_NET);
 	return 0;
@@ -1103,15 +1109,10 @@ static void libertas_free_adapter(wlan_p
 		return;
 	}
 
-	lbs_deb_fw("free command buffer\n");
 	libertas_free_cmd_buffer(priv);
-
-	lbs_deb_fw("free command_timer\n");
 	del_timer(&adapter->command_timer);
-
-	lbs_deb_fw("free scan results table\n");
 	kfree(adapter->networks);
-	adapter->networks = NULL;
+	kfree(adapter->pending_assoc_req);
 
 	/* Free the adapter object itself */
 	lbs_deb_fw("free adapter\n");
drivers/net/wireless/libertas/wext.c +30 -16

118 lines not on this page · raw message

#1 lore raw
Quoted 17 lines · Holger Schurig

Automatically re-association to an access point when we get de-associated. This is especially helpful if an AP de-associates us because scanning took to long (remember, the my firmware can't send 802.11 powersafe null packets).

* don't free pending_assoc_req in the association worker, keep it as is.
* free pending_assoc_req at adapter removal time.
* when we get a MAC level event saying that we've been de-associated, use the alredy filled in association record to make a new scan and re-associate.
* also moved wlan_postpone_association_work() and wlan_cancel_association_work() from a *.h file to the sole user, into wext.h. Renamed them to libertas_XXX as well.

---

Quoted 8 lines

BTW, I've done a little bit of research (err, trying out). At least orinoco_cs, ipw2200 and bcm43xx all automatically re-associate.

Months ago Dan once said that I should add some logic to not re-associate more than X times to an AP. So far I don't know of any fullmac driver that does is. Also I think that this makes things needlessly complicated. And it buys us nothing. If an AP really doesn't want to have a client not associated to itself, it should apply better means, e.g. WPA/WPA2 ...

Seriously though, even if other drivers don't do it, that doesn't mean libertas shouldn't do it. If the association fails, doesn't this mean the card just keeps working and keeps trying to associate forever? I think that's just plain wrong. It's not that much more complicated to add an item to the association structure for 'count' and to check that from the disassociation event code, and just not reschedule association if that's > 4.

Dan

Quoted 236 lines

Index: libertas-2.6/drivers/net/wireless/libertas/assoc.c
===================================================================

drivers/net/wireless/libertas/assoc.c +0 -2
@@ -506,7 +506,6 @@ void libertas_association_worker(struct 
 
 	mutex_lock(&adapter->lock);
 	assoc_req = adapter->pending_assoc_req;
-	adapter->pending_assoc_req = NULL;
 	adapter->in_progress_assoc_req = assoc_req;
 	mutex_unlock(&adapter->lock);
 
@@ -675,7 +674,6 @@ out:
 	mutex_lock(&adapter->lock);
 	adapter->in_progress_assoc_req = NULL;
 	mutex_unlock(&adapter->lock);
-	kfree(assoc_req);
 
 done:
 	lbs_deb_leave(LBS_DEB_ASSOC);

Index: libertas-2.6/drivers/net/wireless/libertas/assoc.h
===================================================================

drivers/net/wireless/libertas/assoc.h +0 -18
@@ -11,22 +11,4 @@ struct assoc_request * wlan_get_associat
 
 void libertas_sync_channel(struct work_struct *work);
 
-#define ASSOC_DELAY (HZ / 2)
-static inline void wlan_postpone_association_work(wlan_private *priv)
-{
-	if (priv->adapter->surpriseremoved)
-		return;
-	cancel_delayed_work(&priv->assoc_work);
-	queue_delayed_work(priv->work_thread, &priv->assoc_work, ASSOC_DELAY);
-}
-
-static inline void wlan_cancel_association_work(wlan_private *priv)
-{
-	cancel_delayed_work(&priv->assoc_work);
-	if (priv->adapter->pending_assoc_req) {
-		kfree(priv->adapter->pending_assoc_req);
-		priv->adapter->pending_assoc_req = NULL;
-	}
-}
-
 #endif /* _WLAN_ASSOC_H */

Index: libertas-2.6/drivers/net/wireless/libertas/cmdresp.c
===================================================================

drivers/net/wireless/libertas/cmdresp.c +7 -0
@@ -79,6 +79,13 @@ void libertas_mac_event_disconnected(wla
 		lbs_deb_cmd("disconnected, so exit PS mode\n");
 		libertas_ps_wakeup(priv, 0);
 	}
+
+	if (adapter->pending_assoc_req) {
+		cancel_delayed_work(&priv->assoc_work);
+		queue_delayed_work(priv->work_thread,
+			&priv->assoc_work, HZ / 4);
+	}
+
 	lbs_deb_leave(LBS_DEB_CMD);
 }
 

Index: libertas-2.6/drivers/net/wireless/libertas/main.c
===================================================================

drivers/net/wireless/libertas/main.c +8 -7
@@ -460,11 +460,17 @@ static int libertas_open(struct net_devi
 static int libertas_dev_close(struct net_device *dev)
 {
 	wlan_private *priv = dev->priv;
+	wlan_adapter *adapter = priv->adapter;
 
 	lbs_deb_enter(LBS_DEB_NET);
 
-	netif_carrier_off(priv->dev);
+	mutex_lock(&adapter->lock);
 	priv->open = 0;
+	adapter->connect_status = LIBERTAS_DISCONNECTED;
+	kfree(adapter->pending_assoc_req);
+	adapter->pending_assoc_req = NULL;
+	mutex_unlock(&adapter->lock);
+	netif_carrier_off(priv->dev);
 
 	lbs_deb_leave(LBS_DEB_NET);
 	return 0;
@@ -1103,15 +1109,10 @@ static void libertas_free_adapter(wlan_p
 		return;
 	}
 
-	lbs_deb_fw("free command buffer\n");
 	libertas_free_cmd_buffer(priv);
-
-	lbs_deb_fw("free command_timer\n");
 	del_timer(&adapter->command_timer);
-
-	lbs_deb_fw("free scan results table\n");
 	kfree(adapter->networks);
-	adapter->networks = NULL;
+	kfree(adapter->pending_assoc_req);
 
 	/* Free the adapter object itself */
 	lbs_deb_fw("free adapter\n");

Index: libertas-2.6/drivers/net/wireless/libertas/wext.c
===================================================================

drivers/net/wireless/libertas/wext.c +30 -16
@@ -21,6 +21,20 @@
 #include "assoc.h"
 
 
+static inline void libertas_postpone_association_work(wlan_private *priv)
+{
+	if (priv->adapter->surpriseremoved)
+		return;
+	cancel_delayed_work(&priv->assoc_work);
+	queue_delayed_work(priv->work_thread, &priv->assoc_work, HZ / 2);
+}
+
+static inline void libertas_cancel_association_work(wlan_private *priv)
+{
+	cancel_delayed_work(&priv->assoc_work);
+}
+
+
 /**
  *  @brief Find the channel frequency power info with specific channel
  *
@@ -969,9 +983,9 @@ static int wlan_set_freq(struct net_devi
 out:
 	if (ret == 0) {
 		set_bit(ASSOC_FLAG_CHANNEL, &assoc_req->flags);
-		wlan_postpone_association_work(priv);
+		libertas_postpone_association_work(priv);
 	} else {
-		wlan_cancel_association_work(priv);
+		libertas_cancel_association_work(priv);
 	}
 	mutex_unlock(&adapter->lock);
 
@@ -1070,11 +1084,11 @@ static int wlan_set_mode(struct net_devi
 	assoc_req = wlan_get_association_request(adapter);
 	if (!assoc_req) {
 		ret = -ENOMEM;
-		wlan_cancel_association_work(priv);
+		libertas_cancel_association_work(priv);
 	} else {
 		assoc_req->mode = *uwrq;
 		set_bit(ASSOC_FLAG_MODE, &assoc_req->flags);
-		wlan_postpone_association_work(priv);
+		libertas_postpone_association_work(priv);
 		lbs_deb_wext("Switching to mode: 0x%x\n", *uwrq);
 	}
 	mutex_unlock(&adapter->lock);
@@ -1355,9 +1369,9 @@ static int wlan_set_encode(struct net_de
 out:
 	if (ret == 0) {
 		set_bit(ASSOC_FLAG_SECINFO, &assoc_req->flags);
-		wlan_postpone_association_work(priv);
+		libertas_postpone_association_work(priv);
 	} else {
-		wlan_cancel_association_work(priv);
+		libertas_cancel_association_work(priv);
 	}
 	mutex_unlock(&adapter->lock);
 
@@ -1596,9 +1610,9 @@ static int wlan_set_encodeext(struct net
 
 out:
 	if (ret == 0) {
-		wlan_postpone_association_work(priv);
+		libertas_postpone_association_work(priv);
 	} else {
-		wlan_cancel_association_work(priv);
+		libertas_cancel_association_work(priv);
 	}
 	mutex_unlock(&adapter->lock);
 
@@ -1643,9 +1657,9 @@ static int wlan_set_genie(struct net_dev
 out:
 	if (ret == 0) {
 		set_bit(ASSOC_FLAG_WPA_IE, &assoc_req->flags);
-		wlan_postpone_association_work(priv);
+		libertas_postpone_association_work(priv);
 	} else {
-		wlan_cancel_association_work(priv);
+		libertas_cancel_association_work(priv);
 	}
 	mutex_unlock(&adapter->lock);
 
@@ -1772,9 +1786,9 @@ out:
 	if (ret == 0) {
 		if (updated)
 			set_bit(ASSOC_FLAG_SECINFO, &assoc_req->flags);
-		wlan_postpone_association_work(priv);
+		libertas_postpone_association_work(priv);
 	} else if (ret != -EOPNOTSUPP) {
-		wlan_cancel_association_work(priv);
+		libertas_cancel_association_work(priv);
 	}
 	mutex_unlock(&adapter->lock);
 
@@ -1949,13 +1963,13 @@ out:
 			memcpy(&assoc_req->ssid, &ssid, IW_ESSID_MAX_SIZE);
 			assoc_req->ssid_len = ssid_len;
 			set_bit(ASSOC_FLAG_SSID, &assoc_req->flags);
-			wlan_postpone_association_work(priv);
+			libertas_postpone_association_work(priv);
 		}
 	}
 
 	/* Cancel the association request if there was an error */
 	if (ret != 0) {
-		wlan_cancel_association_work(priv);
+		libertas_cancel_association_work(priv);
 	}
 
 	mutex_unlock(&adapter->lock);
@@ -1993,13 +2007,13 @@ static int wlan_set_wap(struct net_devic
 	/* Get or create the current association request */
 	assoc_req = wlan_get_association_request(adapter);
 	if (!assoc_req) {
-		wlan_cancel_association_work(priv);
+		libertas_cancel_association_work(priv);
 		ret = -ENOMEM;
 	} else {
 		/* Copy the BSSID to the association request */
 		memcpy(&assoc_req->bssid, awrq->sa_data, ETH_ALEN);
 		set_bit(ASSOC_FLAG_BSSID, &assoc_req->flags);
-		wlan_postpone_association_work(priv);
+		libertas_postpone_association_work(priv);
 	}
 
 	mutex_unlock(&adapter->lock);
#2 lore raw
Quoted 4 lines

Seriously though, even if other drivers don't do it, that doesn't mean libertas shouldn't do it. If the association fails, doesn't this mean the card just keeps working and keeps trying to associate forever?

Yes, with a HZ/4 rate.

Maybe in the meantime the user is configuring the right WEP key into his AP?

Quoted 4 lines

It's not that much more complicated to add an item to the association structure for 'count' and to check that from the disassociation event code, and just not reschedule association if that's > 4.

And after this 4 tries the device is again stuck? That's not nice.

Therefore you need some heuristic (I don't dare to name this logic) to reset this counter again. But when do you do it? If you say "5 Minutes", then I simply change my HZ/4 into HZ*60*5 and have the same effect.

So I see that my HZ/4 is as arbitrary as your 4, but my version is fail-safe, because when you move away from a mis-configured AP to a right on, the device will automatically re-associate. You see, I aim for a roaming client, not for a device that stays put at some office desktop.

We also get disassociated from an AP when we're away from the channel for too long, busy scanning for a better AP. The case where someone clicks on a "Deassociate Client") is neglibibly.

But even when I want to have it work automatically, and without any manual user interaction at the WLAN client.

#3 lore raw
Quoted 6 lines · Holger Schurig
Quoted 4 lines

Seriously though, even if other drivers don't do it, that doesn't mean libertas shouldn't do it. If the association fails, doesn't this mean the card just keeps working and keeps trying to associate forever?

Yes, with a HZ/4 rate.

I don't care how _fast_ it tries to reassociate. I care that it doesn't give up after some amount of time.

Quoted 18 lines

Maybe in the meantime the user is configuring the right WEP key into his AP?

Quoted 4 lines

It's not that much more complicated to add an item to the association structure for 'count' and to check that from the disassociation event code, and just not reschedule association if that's > 4.

And after this 4 tries the device is again stuck? That's not nice.

Therefore you need some heuristic (I don't dare to name this logic) to reset this counter again. But when do you do it? If you say "5 Minutes", then I simply change my HZ/4 into HZ*60*5 and have the same effect.

Quoted 5 lines

So I see that my HZ/4 is as arbitrary as your 4, but my version is fail-safe, because when you move away from a mis-configured AP to a right on, the device will automatically re-associate. You see, I aim for a roaming client, not for a device that stays put at some office desktop.

That's fine. The drivers should _not_ be trying to handle all roaming cornercases themselves. And I believe that includes forever trying reassociating. Userspace must come into the equation at some point, especially with WPA!! This reassociation trick _only_ works for WEP. And that immediately makes it less useful.

My point is that the _driver_ should only go so far in trying to guess the intentions of the user and userspace itself. It's not the drivers job to cover every conceivable use-case, especially where the heuristics are quite fuzzy. That sort of thing just doesn't belong in drivers.

Dan

Quoted 7 lines

We also get disassociated from an AP when we're away from the channel for too long, busy scanning for a better AP. The case where someone clicks on a "Deassociate Client") is neglibibly.

But even when I want to have it work automatically, and without any manual user interaction at the WLAN client.

#4 lore raw
Quoted 4 lines
Quoted 1 line

Yes, with a HZ/4 rate.

I don't care how _fast_ it tries to reassociate. I care that it doesn't give up after some amount of time.

And I don't want that the driver get's stuck after some arbitrary time. *NO OTHER DRIVER* that I know of get's stuck. The current libertas code has actually a built-in denial of service attack.

Libertas isn't just used in the OLPC, where can make sure some userspace tools does the job. I'll using libertas in PDA like devices, which used to have some HERMES I or HERMES II chips and have to switch to some other CF card because you can't buy CF cards with those chips any more. And on those device you can't just arbitrarily change the rest of the firmware.

So, at least in the no encryption & WEP obfuscation mode a WLAN driver should work without special user space software, because that's how real-life dictates the operation.

And, as said, otherwise you have a denial of service scenario.

Quoted 2 lines

That's fine. The drivers should _not_ be trying to handle all roaming cornercases themselves.

Either the driver or the firmware should handle all corner cases. With a HERMES II chip and a wlags49_h2_cs.ko driver, I can nicely roam with WPA+wpa_supplicant, and also with plain WEP (and no wpa_supplicant).

I see no technical reason why libertas shouldn't be able to do the same and behave like all other FULLMAC drivers.

Quoted 2 lines

Userspace must come into the equation at some point, especially with WPA!!

I don't see that userspace *MUST* come into the equation at some point. If it *WISHES* to come into the equation: nothing hinders it. Running "iwevent" while killing the station at the AP yields these events:

10:38:43.139777 eth1 New Access Point/Cell
address:Not-Associated

10:38:43.389217   eth1     Scan request completed
10:38:45.161671   eth1     New Access Point/Cell 

address:00:1B:53:11:E2:B0

#5 lore raw
Quoted 11 lines · Holger Schurig
Quoted 4 lines
Quoted 1 line

Yes, with a HZ/4 rate.

I don't care how _fast_ it tries to reassociate. I care that it doesn't give up after some amount of time.

And I don't want that the driver get's stuck after some arbitrary time. *NO OTHER DRIVER* that I know of get's stuck. The current libertas code has actually a built-in denial of service attack.

Libertas isn't just used in the OLPC, where can make sure some userspace tools does the job. I'll using libertas in PDA like

I have personally used it on platforms that are !OLPC. Please don't assume that I only care about libertas on OLPC.

Quoted 8 lines

devices, which used to have some HERMES I or HERMES II chips and have to switch to some other CF card because you can't buy CF cards with those chips any more. And on those device you can't just arbitrarily change the rest of the firmware.

So, at least in the no encryption & WEP obfuscation mode a WLAN driver should work without special user space software, because that's how real-life dictates the operation.

I won't throw a hissy fit over the reassociation patch as long as it only tries this in open & WEP situations where a supplicant is not necessary. That means you cannot simply requeue an association in libertas_mac_event_disconnected(), but you should check the association request and not requeue if:

1) the assoc request's mode is ad-hoc (is there a point to retrying assoc in adhoc?)
2) the assoc request has secinfo->WPAenabled || secinfo->WPA2enabled
3) the assoc request has WPA mcast or unicast keys set
4) the assoc request has a wpa_ie_len > 0

so in libertas_mac_event_disconnected() it should to be something like the following:

if (adapter->pending_assoc_req) {
    if (test_bit(ASSOC_FLAG_MODE, &assoc_req->flags))
        if (assoc_req->mode != IW_MODE_INFRA)
            goto done;

    if (test_bit(ASSOC_FLAG_SECINFO, &assoc_req->flags))
        if (assoc_req->secinfo.WPAenabled ||assoc_req->secinfo.WPA2enabled)
            goto done;

    if (test_bit(ASSOC_FLAG_WPA_MCAST_KEY, &assoc_req->flags))
        if (assoc_req->wpa_mcast_key.len)
            goto done;

    if (test_bit(ASSOC_FLAG_WPA_UCAST_KEY, &assoc_req->flags))
        if (assoc_req->wpa_ucast_key.len)
            goto done;

    if (test_bit(ASSOC_FLAG_WPA_IE, &assoc_req->flags))
        if (assoc_req->wpa_ie_len > 0)
            goto done;

    cancel_delayed_work(&priv->assoc_work);
    queue_delayed_work(priv->work_thread,
            &priv->assoc_work, HZ / 4);

done:

    ;
}

Dan

Quoted 29 lines

And, as said, otherwise you have a denial of service scenario.

Quoted 2 lines

That's fine. The drivers should _not_ be trying to handle all roaming cornercases themselves.

Either the driver or the firmware should handle all corner cases. With a HERMES II chip and a wlags49_h2_cs.ko driver, I can nicely roam with WPA+wpa_supplicant, and also with plain WEP (and no wpa_supplicant).

I see no technical reason why libertas shouldn't be able to do the same and behave like all other FULLMAC drivers.

Quoted 2 lines

Userspace must come into the equation at some point, especially with WPA!!

I don't see that userspace *MUST* come into the equation at some point. If it *WISHES* to come into the equation: nothing hinders it. Running "iwevent" while killing the station at the AP yields these events:

10:38:43.139777 eth1 New Access Point/Cell
address:Not-Associated

10:38:43.389217   eth1     Scan request completed
10:38:45.161671   eth1     New Access Point/Cell 

address:00:1B:53:11:E2:B0

#6 lore raw
Quoted 8 lines · Dan Williams

I won't throw a hissy fit over the reassociation patch as long as it only tries this in open & WEP situations where a supplicant is not necessary. That means you cannot simply requeue an association in libertas_mac_event_disconnected(), but you should check the association request and not requeue if:

1) the assoc request's mode is ad-hoc (is there a point to retrying assoc in adhoc?)

I'm not sure I see why ad-hoc is a special case?

John

Signature · 2 lines
John W. Linville
[email protected]
#7 lore raw
Quoted 8 lines · John W. Linville
Quoted 6 lines · Dan Williams

I won't throw a hissy fit over the reassociation patch as long as it only tries this in open & WEP situations where a supplicant is not necessary. That means you cannot simply requeue an association in libertas_mac_event_disconnected(), but you should check the association request and not requeue if:

Quoted 4 lines
Quoted 2 lines

1) the assoc request's mode is ad-hoc (is there a point to retrying assoc in adhoc?)

I'm not sure I see why ad-hoc is a special case?

A STA can't ever get disassociation management frames in an IBSS, right? I don't believe the firmware will ever disconnect you once you've started an IBSS, but there may be a difference between the start-adhoc and join-adhoc commands that get sent to firmware. However, it's not like loss of becaons in IBSS mode will cause a disconnection, because it just looks like the network split and you are the only member of it, and then your STA takes up beaconing responsibility by itself until the world ends. AFAIK.

Dan

#8 lore raw
In reply to Dan Williams
Quoted 2 lines

so in libertas_mac_event_disconnected() it should to be something like the following:

...

I'll look in some of the next days again into this. Today and tomorrow I'm busy with other things.

Oh, and BTW, today I found by chance another reason why auto-reassoc is
helpful and necessary :-) On a Cisco 1231 AP I played a bit with the
command interface. And there was a command to check how busy all the channels are. When I issued this command, I saw in the log of the Cisco (I'm sending it to the console) and also in the syslog of the machine running the libertas driver that the Cisco IOS sent an disassociation to all clients. Then it went checking for busy channels and gave me some output. After this, two client (one libertas, one other) automatically re-associated and things continued as if nothing would have happened.

Now, in a Cisco AP you can specify the channel for the AP. And you can also say "Use least congested Frequency". This makes the AP does this channel scanning --- that I issued manually --- do automatically. With the current current code, my libertas driven card would have been stuck ...

As for WPA driven environments: you can operate WPA supplicant in two modes. In one modes does WPA does the work of selecting which AP to use. It also sends the equivalent of "iwconfig ethX ap xx:XX:XX:XX:XX:XX" to the card.

In the other mode (I think it is "ap_scan=2"), wpa_supplicant just reacts to a re-association that the driver did without further fuzz.

I guess that your issues are with the first mode?