Linux wireless drivers development
 help / color / mirror / Atom feed
* Question regarding netif_stop/wake queue and libertas
@ 2009-10-07  7:50 Holger Schurig
  0 siblings, 0 replies; only message in thread
From: Holger Schurig @ 2009-10-07  7:50 UTC (permalink / raw)
  To: linux-wireless

Hi !

In the libertas driver, we did the following before scanning:

	netif_stop_queue(priv->dev);
	netif_carrier_off(priv->dev);
	if (priv->mesh_dev) {
		netif_stop_queue(priv->mesh_dev);
		netif_carrier_off(priv->mesh_dev);
	}

and then, after scanning, we started the queues and carrier
again *IF* connected:

	if (priv->connect_status == LBS_CONNECTED) {
		netif_carrier_on(priv->dev);
		if (!priv->tx_pending_len)
			netif_wake_queue(priv->dev);
	}
	if (priv->mesh_dev && (priv->mesh_connect_status == LBS_CONNECTED)) {
		netif_carrier_on(priv->mesh_dev);
		if (!priv->tx_pending_len)
			netif_wake_queue(priv->mesh_dev);
	}

How should I do this in my CFG80211-based scanning? As I want
to move away from libertas' own association logic in assoc.c,
there will in future be no priv->connect_status.

I now plan to remember the running/carrier state of both the
"normal" and the "mesh" device:

	int running;
	int carrier;
	int mesh_running = false;
	int mesh_carrier = false;

	running = !netif_queue_stopped(priv->dev);
	carrier = netif_carrier_ok(priv->dev);
	if (running)
		netif_stop_queue(priv->dev);
	if (carrier)
		netif_carrier_off(priv->dev);
	if (priv->mesh_dev) {
		mesh_running = !netif_queue_stopped(priv->mesh_dev);
		mesh_carrier = netif_carrier_ok(priv->mesh_dev);
		if (mesh_running)
			netif_stop_queue(priv->mesh_dev);
		if (mesh_carrier)
			netif_carrier_off(priv->mesh_dev);
	}

And after scanning my four channels, I plan to turn them
on again (e.g. this can be 440 ms later when doing a passive
scan):

	if (carrier)
		netif_carrier_on(priv->dev);
	if (running && !priv->tx_pending_len)
		netif_wake_queue(priv->dev);
	if (mesh_carrier)
		netif_carrier_on(priv->mesh_dev);
	if (mesh_running %% !priv->tx_pending_len)
		netif_wake_queue(priv->mesh_dev)

Would I need some kind of locking ?

-- 
M&N Solutions GmbH          Ein Unternehmen der Datagroup AG
Holger Schurig
Raiffeisenstr. 10
61191 Rosbach
Tel: 06003/9141-15          Fax 06003/9141-49
http://www.mn-solutions.de/

Handelsregister Friedberg, HRB 5903
Geschäftsführer: P.Schrittenlocher

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-10-07  7:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-07  7:50 Question regarding netif_stop/wake queue and libertas Holger Schurig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox