RE: [PATCH v5 1/2] Bluetooth: btusb: use usb vid/pid for initializing hal callbacks

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

 



Hi Marcel,

> -----Original Message-----
> From: Marcel Holtmann <marcel@xxxxxxxxxxxx>
> Sent: Saturday, October 3, 2020 1:57 PM
> To: Kiran K <kiraank@xxxxxxxxx>
> Cc: linux-bluetooth <linux-bluetooth@xxxxxxxxxxxxxxx>; Narasimman, Sathish
> <sathish.narasimman@xxxxxxxxx>; Tumkur Narayan, Chethan
> <chethan.tumkur.narayan@xxxxxxxxx>; Srivatsa, Ravishankar
> <ravishankar.srivatsa@xxxxxxxxx>; K, Kiran <kiran.k@xxxxxxxxx>
> Subject: Re: [PATCH v5 1/2] Bluetooth: btusb: use usb vid/pid for initializing
> hal callbacks
> 
> Hi Kiran,
> 
> > For Intel controllers, use vid/pid for initalizing hardware
> > abstraction layer callbacks to avoid defining new quirk flags for new
> products.
> >
> > Signed-off-by: Kiran K <kiran.k@xxxxxxxxx>
> > ---
> > Changes in v5:
> > * Use usb vid/pid combination to identify controller type istead of
> > using flags
> >
> > Changes in previous versions:
> > None. This is a new patch created part of v5
> >
> > drivers/bluetooth/btusb.c | 79
> > ++++++++++++++++++++++++++++-------------------
> > 1 file changed, 48 insertions(+), 31 deletions(-)
> >
> > diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
> > index 1005b6e..e2cd78d 100644
> > --- a/drivers/bluetooth/btusb.c
> > +++ b/drivers/bluetooth/btusb.c
> > @@ -3969,13 +3969,21 @@ static int btusb_probe(struct usb_interface
> *intf,
> > 	init_usb_anchor(&data->ctrl_anchor);
> > 	spin_lock_init(&data->rxlock);
> >
> > -	if (id->driver_info & BTUSB_INTEL_NEW) {
> > -		data->recv_event = btusb_recv_event_intel;
> > -		data->recv_bulk = btusb_recv_bulk_intel;
> > -		set_bit(BTUSB_BOOTLOADER, &data->flags);
> > -	} else {
> > -		data->recv_event = hci_recv_frame;
> > -		data->recv_bulk = btusb_recv_bulk;
> > +	data->recv_event = hci_recv_frame;
> > +	data->recv_bulk = btusb_recv_bulk;
> > +
> > +	if (id->idVendor == 0x8087) {
> > +		switch (id->idProduct) {
> > +		case 0x0025:
> > +		case 0x0026:
> > +		case 0x0029:
> > +		case 0x0a2b:
> > +		case 0x0aaa:
> > +			data->recv_event = btusb_recv_event_intel;
> > +			data->recv_bulk = btusb_recv_bulk_intel;
> > +			set_bit(BTUSB_BOOTLOADER, &data->flags);
> > +			break;
> > +		}
> > 	}
> 
> please don’t do this. This is exactly what I didn’t want. Listing PID in the
> device table and then also again in the probe callback is bound to be error
> prone.
> 

Got your point. I will send the fix with BTUSB_INTEL_NEWGEN as discussed earlier.  Thanks.

> Regards
> 
> Marcel

Regards,
Kiran






[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux