linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Patong Yang <patong.mxl@gmail.com>
Cc: pyang@maxlinear.com, johan@kernel.org, linux-usb@vger.kernel.org
Subject: Driver for MaxLinear/Exar USB (UART) Serial Adapters
Date: Thu, 16 Aug 2018 12:05:54 +0200	[thread overview]
Message-ID: <20180816100554.GB9141@kroah.com> (raw)

On Thu, Aug 16, 2018 at 01:28:54AM -0700, Patong Yang wrote:
> On Thu, Aug 16, 2018 at 08:34:47AM +0200, Greg KH wrote:
> > On Wed, Aug 15, 2018 at 10:56:47PM -0700, Patong Yang wrote:
> > > Greg,
> > > 
> > > Please see my response inline below.
> > > 
> > > Patong
> > > 
> > > > But there is a bigger problem here:
> > > > 
> > > > > +	xrusb_tty_driver = alloc_tty_driver(XRUSB_TTY_MINORS);
> > > > > +	if (!xrusb_tty_driver)
> > > > > +		return -ENOMEM;
> > > > 
> > > > Why are you not using the usb serial core here?  You need to do that,
> > > > not try to provide your own custom tty driver.  That way userspace
> > > > programs will "just work" with your new device, no changes needed as
> > > > your major/minor number and device name would be custom only for your
> > > > device, which is not acceptable.
> > > 
> > > The MaxLinear/USB serial devices support the CDC-ACM commands.
> > > Therefore, we used the cdc-acm driver instead of the usb serial driver
> > > as the starting point for developing the driver.  We replaced "ACM" 
> > > with "XRUSB" throughout the driver.  Would it be better if we just used 
> > > the same major/minor number as the CDC-ACM driver since it was based on
> > > the cdc-acm driver?  
> > 
> > No, just use the cdc-acm driver itself and add your product/device id to
> > it and it should work just fine.  Why do you need to write a whole new
> > driver at all?
> 
> The basic TX/RX functionality works fine now with the cdc-acm driver.
> That's the driver that is loaded because it's advertised as a cdc-acm
> compatible device in the device descriptors.    
> 
> However, the cdc-acm driver (and spec) does not have support all of the 
> features in the MaxLinear/Exar USB UARTs.  Hence the reason for a separate
> and new driver.  

So your device should not be exposing itself as a cdc-acm driver if it
is doing vendor-specific things, right?

Ok, that's fine, but then you still need to tie into the usb-serial
core, just use that and do not implement all of the duplicated tty
handling logic that you have done here.  You will end up with a ttyUSB*
device node, which is what you, and your users want, not some
custom-name that no program supports.

thanks,

greg k-h

             reply	other threads:[~2018-08-16 10:05 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-16 10:05 Greg Kroah-Hartman [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-08-16  8:28 Driver for MaxLinear/Exar USB (UART) Serial Adapters Patong Yang
2018-08-16  8:26 Oliver Neukum
2018-08-16  6:34 Greg Kroah-Hartman
2018-08-16  5:56 Patong Yang
2018-07-26 10:57 Greg Kroah-Hartman
2018-07-25  7:38 Oliver Neukum
2018-07-24 22:36 Patong Yang
2018-04-06 14:45 Driver for MaxLinear/Exar USB (UART) Serial adapters Greg Kroah-Hartman
2018-04-05  7:38 Oliver Neukum
2018-04-05  6:26 Greg Kroah-Hartman
2018-04-04  8:00 Greg Kroah-Hartman
2018-04-04  7:59 Greg Kroah-Hartman
2018-04-04  7:38 Oliver Neukum
2018-04-04  7:06 Patong Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180816100554.GB9141@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=johan@kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=patong.mxl@gmail.com \
    --cc=pyang@maxlinear.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).