Search Linux Wireless

Re: [PATCH 8/8] rsi: miscallaneous changes for 9116 and common

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

 



On Wed, 2019-04-03 at 09:43 +0530, Siva Rebbagondla wrote:
> 
>  static int rsi_usb_reg_write(struct usb_device *usbdev,
>  			     u32 reg,
> -			     u16 value,
> +			     u32 value,
>  			     u16 len)
>  {
>  	u8 *usb_reg_buf;
> @@ -226,17 +226,17 @@ static int rsi_usb_reg_write(struct usb_device *usbdev,
>  	if (!usb_reg_buf)
>  		return status;
>  
> -	usb_reg_buf[0] = (value & 0x00ff);
> -	usb_reg_buf[1] = (value & 0xff00) >> 8;
> -	usb_reg_buf[2] = 0x0;
> -	usb_reg_buf[3] = 0x0;
> +	usb_reg_buf[0] = (cpu_to_le32(value) & 0x00ff);
> +	usb_reg_buf[1] = (cpu_to_le32(value) & 0xff00) >> 8;
> +	usb_reg_buf[2] = (cpu_to_le32(value) & 0x00ff0000) >> 16;
> +	usb_reg_buf[3] = (cpu_to_le32(value) & 0xff000000) >> 24;


The cpu_to_le32() was wrong here, it's already contained in the shifting
that happened here ...


Easier to just write that as

 __le32 *usb_reg_buf;

 ...

 usb_reg_buf[0] = cpu_to_le32(value);

however.

 
>  	status = usb_control_msg(usbdev,
>  				 usb_sndctrlpipe(usbdev, 0),
>  				 USB_VENDOR_REGISTER_WRITE,
>  				 RSI_USB_REQ_OUT,
> -				 ((reg & 0xffff0000) >> 16),
> -				 (reg & 0xffff),
> +				 ((cpu_to_le32(reg) & 0xffff0000) >> 16),
> +				 (cpu_to_le32(reg) & 0xffff),

This change also seems completely wrong, and we should probably revert
it?

johannes





[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux