Search Linux Wireless

Re: [PATCH 1/3] mt76: usb: use max packet length for m76u_copy

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

 



On Fri, Nov 29, 2019 at 02:47:44PM +0200, Lorenzo Bianconi wrote:
> > +	usb->data_len = usb_maxpacket(udev, usb_sndctrlpipe(udev, 0), 1);
> > +	if (usb->data_len < 32)
> > +		usb->data_len = 32;
> 
> Hi Stanislaw,
> 
> 	usb->data_len = max_t(u16, 32,
> 			      usb_maxpacket(udev, usb_sndctrlpipe(udev, 0), 1));
> 

Why this is better ?

> Moreover are you sure using ctrl endpoint 0 is fine for all devices?

usb_sndctrlpipe(udev, 0) is used in __mt76u_vendor_request() for all 
out requests i.e. on all cases were usb->data is used.

Stanislaw 





[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