Linux wireless drivers development
 help / color / mirror / Atom feed
From: Holger Schurig <h.schurig@mn-solutions.de>
To: linux-wireless <linux-wireless@vger.kernel.org>
Subject: Question regarding netif_stop/wake queue and libertas
Date: Wed, 7 Oct 2009 09:50:52 +0200	[thread overview]
Message-ID: <200910070950.52196.h.schurig@mn-solutions.de> (raw)

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

                 reply	other threads:[~2009-10-07  7:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200910070950.52196.h.schurig@mn-solutions.de \
    --to=h.schurig@mn-solutions.de \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox