[PATCH] libertas: make mesh code configurable

Holger Schurig hs4233 at mail.mn-solutions.de
Fri Jun 20 03:06:59 EDT 2008

> Especially for the mesh_dev thing, you should probably have a
> static inline that returns priv->mesh_dev (mesh case) and NULL
> (non-mesh case) and rely on the compiler to elide as much code
> as possible.
> E.g. this:
> >  	if (priv->mesh_dev && (priv->mesh_connect_status ==
> > LBS_CONNECTED)) netif_wake_queue(priv->mesh_dev);
> > +#endif
> wouldn't then need an ifdef.

Ah, I thought that the compiler would barf about the
priv->mesh_connect_status, because this is no longer in
struct lbs_private.

So I tried your suggestion and, yes, the compiler barfs:

static inline struct net_device *lbs_mesh_dev(struct lbs_private *priv)
        return priv->mesh_dev;
        return NULL;

        if (lbs_mesh_dev(priv) && dev == lbs_mesh_dev(priv)) {
                priv->mesh_open = 1;
                priv->mesh_connect_status = LBS_CONNECTED;
        } else {
                priv->infra_open = 1;

                if (priv->connect_status == LBS_CONNECTED)

drivers/net/wireless/libertas/main.c: In function 'lbs_dev_open':
drivers/net/wireless/libertas/main.c:414: error: 'struct lbs_private' has no member named 'mesh_open'
drivers/net/wireless/libertas/main.c:415: error: 'struct lbs_private' has no member named 'mesh_connect_status'

More information about the libertas-dev mailing list