linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] ftdi_sio driver: use altsetting or cur_altsetting?
@ 2020-10-01 19:20 Mychaela Falconia
  2020-10-02  7:01 ` Johan Hovold
  0 siblings, 1 reply; 4+ messages in thread
From: Mychaela Falconia @ 2020-10-01 19:20 UTC (permalink / raw)
  To: Johan Hovold, linux-usb

Hello esteemed linux-usb folks,

While I am trying to get a little quirk for my custom hardware device
added to the ftdi_sio driver, I noticed an inconsistency between use
of interface->altsetting vs. interface->cur_altsetting in the existing
driver code.  Specifically:

* ftdi_determine_type() function uses this construct to get the number
  of the interface it is operating on:

  inter = serial->interface->altsetting->desc.bInterfaceNumber;

* ftdi_set_max_packet_size() uses interface->cur_altsetting to get to
  desc.bNumEndpoints and endpoint[i].desc

* The JTAG cleanup patch which Johan just applied uses
  intf->cur_altsetting->desc.bInterfaceNumber

So which is the right one to use, intf->altsetting or intf->cur_altsetting?
The comments in include/linux/usb.h say that the altsetting member
points to an array of struct usb_host_interface stored in no particular
order, so using that pointer in ftdi_determine_type() seems wrong -
but then I am a total novice in this area, hence I am hoping that
someone more knowledgeable could confirm.

The most recent version of my DUART28C quirk adding patch uses
serial->interface->altsetting, copied from ftdi_determine_type() -
should I change my proposed patch to use cur_altsetting instead?
Should I also make a patch to ftdi_determine_type() changing it to use
cur_altsetting as well?

TIA,
Mychaela
she/her/hers

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-10-02  8:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-01 19:20 [RFC] ftdi_sio driver: use altsetting or cur_altsetting? Mychaela Falconia
2020-10-02  7:01 ` Johan Hovold
2020-10-02  8:37   ` Mychaela Falconia
2020-10-02  8:40     ` Johan Hovold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).