Search Linux Wireless

Question regarding netif_stop/wake queue and libertas

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux