From: Oliver Neukum <oneukum@suse.de>
To: Antti Palosaari <crope@iki.fi>
Cc: "Greg KH" <greg@kroah.com>,
linux-serial@vger.kernel.org, linux-media@vger.kernel.org,
linux-usb@vger.kernel.org, "Bjørn Mork" <bjorn@mork.no>,
"James Courtier-Dutton" <james.dutton@gmail.com>,
HoP <jpetrous@gmail.com>, "István Váradi" <ivaradi@gmail.com>
Subject: Re: serial device name for smart card reader that is integrated to Anysee DVB USB device
Date: Wed, 5 Oct 2011 10:16:06 +0200 [thread overview]
Message-ID: <201110051016.06291.oneukum@suse.de> (raw)
In-Reply-To: <4E8BF6DE.1010105@iki.fi>
Am Mittwoch, 5. Oktober 2011, 08:19:10 schrieb Antti Palosaari:
> On 10/05/2011 09:15 AM, Oliver Neukum wrote:
> > But, Greg, Antti makes a very valid point here. The generic code assumes that
> > it owns intfdata, that is you cannot use it as is for access to anything that lacks
> > its own interface. But this is not a fatal flaw. We can alter the generic code to use
> > an accessor function the driver can provide and make it default to get/set_intfdata
> >
> > What do you think?
>
> Oliver, I looked your old thread reply but I didn't catch how you meant
> it to happen. Could you give some small example?
Look at this structure:
struct dvb_usb_device {
struct dvb_usb_device_properties props;
struct dvb_usb_device_description *desc;
struct usb_device *udev;
#define DVB_USB_STATE_INIT 0x000
#define DVB_USB_STATE_I2C 0x001
#define DVB_USB_STATE_DVB 0x002
#define DVB_USB_STATE_REMOTE 0x004
int state;
int powered;
/* locking */
struct mutex usb_mutex;
/* i2c */
struct mutex i2c_mutex;
struct i2c_adapter i2c_adap;
int num_adapters_initialized;
struct dvb_usb_adapter adapter[MAX_NO_OF_ADAPTER_PER_DEVICE];
/* remote control */
struct rc_dev *rc_dev;
struct input_dev *input_dev;
char rc_phys[64];
struct delayed_work rc_query_work;
u32 last_event;
int last_state;
struct module *owner;
void *priv;
};
It contains a pointer to an input device. You could add a pointer to a usb
serial device here. This leaves you with two problems.
1. The USB serial layer will try to set intfdata
We will need to change it to use a function the driver provides to store
a pointer to its private data.
2. The usb serial layer will not learn about events it needs to learn about.
We need to extended the usb dvb code to call into a sufficiently abstracted
method in the usb serial code.
Conceptually the usb serial code is ready to share an interface among
multiple serial ports, but not to share an interface with something else.
I described the steps necesary to allow that. This is new, so there are
no examples.
Regards
Oliver
next prev parent reply other threads:[~2011-10-05 8:15 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-04 21:22 serial device name for smart card reader that is integrated to Anysee DVB USB device Antti Palosaari
[not found] ` <4E8B7901.2050700-X3B1VOXEql0@public.gmane.org>
2011-10-05 4:59 ` Greg KH
2011-10-05 5:58 ` Antti Palosaari
2011-10-05 6:15 ` Oliver Neukum
2011-10-05 6:19 ` Antti Palosaari
2011-10-05 8:16 ` Oliver Neukum [this message]
[not found] ` <201110051016.06291.oneukum-l3A5Bk7waGM@public.gmane.org>
2011-10-14 17:32 ` Oliver Neukum
2011-12-13 16:30 ` Antti Palosaari
2011-12-13 17:41 ` Alan Cox
2011-10-05 7:01 ` Greg KH
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=201110051016.06291.oneukum@suse.de \
--to=oneukum@suse.de \
--cc=bjorn@mork.no \
--cc=crope@iki.fi \
--cc=greg@kroah.com \
--cc=ivaradi@gmail.com \
--cc=james.dutton@gmail.com \
--cc=jpetrous@gmail.com \
--cc=linux-media@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/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).