Search Linux Wireless

Re: [PATCH] libertas: remove some references to IW_MODE_abc

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

 



On Thu, 2009-10-22 at 14:15 +0200, Holger Schurig wrote:
> [PATCH] libertas: remove some references to IW_MODE_abc
> 
> ... in pursue to quaff the wide-spread references to WEXT constants.
> 
> When setting SNMP_MIB_OID_BSS_TYPE, wext.c can directly calculate the value
> the firmware wants.
> 
> Reading of SNMP_MIB_OID_BSS_TYPE doesn't happen anywhere, so no need to
> convert the firmware value into WEXT values anyway.
> 
> Signed-off-by: Holger Schurig <hs4233@xxxxxxxxxxxxxxxxxxxx>

Acked-by: Dan Williams <dcbw@xxxxxxxxxx>

> --- linux-wl.orig/drivers/net/wireless/libertas/cmd.c
> +++ linux-wl/drivers/net/wireless/libertas/cmd.c
> @@ -390,7 +390,7 @@
>  	switch (oid) {
>  	case SNMP_MIB_OID_BSS_TYPE:
>  		cmd.bufsize = cpu_to_le16(sizeof(u8));
> -		cmd.value[0] = (val == IW_MODE_ADHOC) ? 2 : 1;
> +		cmd.value[0] = val;
>  		break;
>  	case SNMP_MIB_OID_11D_ENABLE:
>  	case SNMP_MIB_OID_FRAG_THRESHOLD:
> @@ -443,13 +443,7 @@
>  
>  	switch (le16_to_cpu(cmd.bufsize)) {
>  	case sizeof(u8):
> -		if (oid == SNMP_MIB_OID_BSS_TYPE) {
> -			if (cmd.value[0] == 2)
> -				*out_val = IW_MODE_ADHOC;
> -			else
> -				*out_val = IW_MODE_INFRA;
> -		} else
> -			*out_val = cmd.value[0];
> +		*out_val = cmd.value[0];
>  		break;
>  	case sizeof(u16):
>  		*out_val = le16_to_cpu(*((__le16 *)(&cmd.value)));
> --- linux-wl.orig/drivers/net/wireless/libertas/assoc.c
> +++ linux-wl/drivers/net/wireless/libertas/assoc.c
> @@ -1567,7 +1567,8 @@
>  	}
>  
>  	priv->mode = assoc_req->mode;
> -	ret = lbs_set_snmp_mib(priv, SNMP_MIB_OID_BSS_TYPE, assoc_req->mode);
> +	ret = lbs_set_snmp_mib(priv, SNMP_MIB_OID_BSS_TYPE,
> +		assoc_req->mode == IW_MODE_ADHOC ? 2 : 1);
>  
>  done:
>  	lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret);
> 

--
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