[PATCH] libertas: monitor mode support for OLPC

Holger Schurig hs4233 at mail.mn-solutions.de
Thu Jul 5 02:42:01 EDT 2007


To activate monitor mode,

echo mode > /sys/class/net/{ethX,mshX}/device/libertas_rtap

Any technical reason why you went the echo-to-proc-sys way and 
not the "iwconfig eth1 mode monitor" ?  I like this latter 
approach better:

a) it is standard
b) it works better with tools like kismet. Now kismet and similar 
tools would have to be told another, non-standard way to enable 
monitor mode.

So please re-consider your interface.



> libertas_mesh_pre_start_xmit(struct sk_buff *skb, int ret;
>
>  	lbs_deb_enter(LBS_DEB_MESH);
> +	if(priv->adapter->monitormode != WLAN_MONITOR_OFF) {
> +		netif_stop_queue(dev);
> +		return -EOPNOTSUPP;
> +	}
>
>  	SET_MESH_FRAME(skb);
>

When you stop ethX and mshX anyway, then you won't really need an 
extra "monitormode" variable. You should re-use adapter->mode 
for this.


> +	priv->prom_net_dev = NULL ;

prom_net_dev is a really weird name, e.g. libertas_add_prom() 
really adds a "rtap" device. So maybe you rename every 
occurence "prom" (Programmable Read Only Memory) into "rtap" 
(Radio tap) ?!?  That said, keep in mind that I'm not a fan of 
an extra "rtapXXX" interface at all, so maybe this can go away 
completely.



> int libertas_add_prom (wlan_private *priv)

Kernel coding style says that there's no " " before the "(". But 
this is nitpicking, sorry :-)



> @@ -292,21 +295,22 @@ static u8 convert_mv_rate_to_radiotap(u8
> rate) 
>                 return 11;
>         case 3:         /*  11 Mbps */
>                 return 22;
> -       case 4:         /*   6 Mbps */
> +       /* case 4: reserved */
> +       case 5:         /*   6 Mbps */
>                 return 12;
> -       case 5:         /*   9 Mbps */
> +       case 6:         /*   9 Mbps */
>                 return 18;
> -       case 6:         /*  12 Mbps */
> +       case 7:         /*  12 Mbps */
>                 return 24;
> -       case 7:         /*  18 Mbps */
> +       case 8:         /*  18 Mbps */
>                 return 36;
> -       case 8:         /*  24 Mbps */
> +       case 9:         /*  24 Mbps */
>                 return 48;
> -       case 9:         /*  36 Mbps */
> +       case 10:                /*  36 Mbps */
>                 return 72;
> -       case 10:                /*  48 Mbps */
> +       case 11:                /*  48 Mbps */
>                 return 96;
> -       case 11:                /*  54 Mbps */
> +       case 12:                /*  54 Mbps */
>                 return 108;
>         }

Couldn't this be a table?



More information about the libertas-dev mailing list