Re: [PATCH] Allow devices to inhibit scanning through a signal



On Wed, 2009-07-08 at 15:40 +0200, Alexander Sack wrote:
> Just curious, where and how are you planning to implement the
> SCANNING_ALLOWED signal handler? Is there a patch coming for that
> too?

You don't have to implement it -- if there are no handlers then the
behaviour is unchanged (scans are allowed subject to the other
conditions).

The OLPC mesh device does add a signal handler though, on it's companion
wlan device. We want to prevent scans from taking place while we're
looking around for mesh portals.

static gboolean
companion_scan_allowed_cb (NMDeviceWifi *companion, gpointer user_data)
{
	NMDeviceOlpcMesh *self = NM_DEVICE_OLPC_MESH (user_data);
	NMDeviceState state;

	g_object_get (G_OBJECT (self), NM_DEVICE_INTERFACE_STATE, &state, NULL);

	/* Don't allow the companion to scan while configure the mesh interface */
	return state < NM_DEVICE_STATE_PREPARE
		|| state > NM_DEVICE_STATE_IP_CONFIG;
}

I'm sending the patch for the full mesh device implementation right now.

Daniel




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