[PATCH, take 3] libertas: convert RSSI to a direct command

Marcelo Tosatti marcelo at kvack.org
Mon Mar 31 23:15:30 EDT 2008


On Thu, Mar 27, 2008 at 05:24:02PM -0400, Dan Williams wrote:
> On Wed, 2008-03-26 at 10:21 +0100, Holger Schurig wrote:
> > Besided the direct conversion of the CMD_802_11_RSSI command, this
> > patch also changes the following things:
> > 
> > * calls CMD_802_11_RSSI either asynchronosly (in the background)
> >   when main.c thinks the firmware is hosed and just want's to
> >   get a command through
> > * calls CMD_802_11_RSSI synchronously when called to get wireless
> >   statistics.
> > * don't do in-driver averaging anymore, this and the previous point
> >   eliminates the need for any "struct lbs_private" values
> > * use a 100% quality in a  special ADHOC case
> > 
> > Signed-off-by: Holger Schurig <hs4233 at mail.mn-solutions.de>
> 
> Acked-by: Dan Williams <dcbw at redhat.com>
> 
> > Index: wireless-testing/drivers/net/wireless/libertas/cmd.c
> > ===================================================================
> > --- wireless-testing.orig/drivers/net/wireless/libertas/cmd.c	2008-03-26 09:18:24.000000000 +0100
> > +++ wireless-testing/drivers/net/wireless/libertas/cmd.c	2008-03-26 09:18:31.000000000 +0100
> > @@ -692,6 +692,44 @@ static int lbs_cmd_802_11_rate_adapt_rat
> >  	return 0;
> >  }
> >  
> > +int lbs_get_rssi(struct lbs_private *priv, u16 *snr, u16 *nf)
> > +{
> > +	struct cmd_ds_802_11_rssi cmd;
> > +	struct cmd_ds_802_11_rssi_rsp rsp;
> > +	int ret;
> > +	u16 _snr, _nf;
> > +
> > +	lbs_deb_enter(LBS_DEB_CMD);
> > +
> > +	cmd.hdr.size = cpu_to_le16(sizeof(cmd));
> > +	cmd.avg_factor = cpu_to_le16(1);
> > +	rsp.hdr.size = cpu_to_le16(sizeof(rsp));
> > +
> > +	/* main.c might have called us just to un-break a hanging firmware */
> > +	if (!snr && !nf) {
> > +		lbs_cmd_async(priv, CMD_802_11_RSSI, &cmd.hdr, sizeof(cmd));
> > +		return 0;
> > +	}
> > +
> > +	ret = lbs_cmd(priv, CMD_802_11_RSSI,
> > +		&cmd, lbs_cmd_copyback, (unsigned long) &rsp);

Won't this call block? You can't block in the get_wireless handler (it
holds the rtnl lock). See wext_handle_ioctl.



More information about the libertas-dev mailing list