All of lore.kernel.org
 help / color / mirror / Atom feed
From: Antti Palosaari <crope@iki.fi>
To: "István Váradi" <ivaradi@gmail.com>
Cc: linux-media@vger.kernel.org
Subject: Re: Smart card reader support for Anysee DVB devices
Date: Mon, 15 Aug 2011 02:51:29 +0300	[thread overview]
Message-ID: <4E485F81.9020700@iki.fi> (raw)
In-Reply-To: <CAFk-VPxQvGiEUdd+X4jjUqcygPO-JsT0gTFvrX-q4cGAW6tq_Q@mail.gmail.com>

Hello,
I looked your codes and examined also some more. About your driver, I
don't like you put so much functionality to the Kernel driver. Just put
this functionality to the userspace driver all and offer only lowest
possible interface (read + write) from Kernel. If you look other IFDs it
is like that.
On the other hand I see it could be possible to add some glue and
functionality to the Kernel driver if you find already existing
userspace protocol (IFD driver) which can be used. Add some emulation to
Kernel and use existing user space. Select some well supported serial
smartcard reader and make Anysee driver speak like that.

Biggest problem I see whole thing is poor application support. OpenCT is
rather legacy but there is no good alternative. All this kind of serial
drivers seems to be OpenCT currently.

regards
Antti

On 07/17/2011 05:18 PM, István Váradi wrote:
> Hi,
> 
> I have developed smart card reader support for the Anysee devices by
> extending Antti Palosaari's driver. I attached the patches for it. It
> registers a character device named /dev/anysee_scN for each Anysee
> device.
> 
> The character device supports two ioctl's (see anysee_sc), one for
> detecting the presence of a card, the other one for resetting the card
> and querying the ATR. The write() operation writes to the card by
> packaging the bytes into USB commands. The read() operation issues an
> appropriate command over USB and returns the reply. I have also
> written a simple OpenCT driver (attached) which shows the usage.
> 
> I would like to have the kernel driver included in the official
> sources. For this reason I corresponded with Antti, and he suggested
> the perhaps the kernel driver should have a lower-level interface. I
> had the following proposal:
> 
> We would continue having the two ioctls, ANYSEE_SC_ACTIVATE and
> ANYSEE_SC_PRESENT, however, ANYSEE_SC_ACTIVATE would do only the
> register reading and writing.
> 
> Besides these two we need access to the anysee_ctrl_msg() function
> somehow. I think the cleanest way would be via another ioctl() call in
> which we would pass the return buffer as well, with the length so that
> we know how many bytes to copy. Another possibility would be that a
> call to write() calls anysee_ctrl_msg() and stores the return data in
> a 64 byte buffer that we allocate for each device. The read()
> following a write() would read this buffer, then discard it. Further
> read() attempts would fail with EAGAIN, or we could maintain an offset
> into the 64 byte buffer, and read as long as there is data, and fail
> only then. A write() would cause losing any unread data.
> 
> What do you think?
> 
> Thanks,
> 
> Istvan


-- 
http://palosaari.fi/

  reply	other threads:[~2011-08-14 23:51 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-17 14:18 Smart card reader support for Anysee DVB devices István Váradi
2011-08-14 23:51 ` Antti Palosaari [this message]
2011-08-15 11:14   ` Antti Palosaari
2011-08-17 20:41     ` Antti Palosaari
2011-08-29 14:44       ` István Váradi
2011-08-29 14:50         ` Antti Palosaari
2011-08-29 15:13           ` István Váradi
2011-08-29 15:23             ` Antti Palosaari
2011-09-02 11:04               ` Bjørn Mork
2011-09-02 13:32                 ` Antti Palosaari
2011-09-28 14:32                   ` Antti Palosaari
2011-09-30 15:36                     ` Antti Palosaari
2011-10-02 21:06                       ` HoP
2011-10-03 17:56                       ` Bjørn Mork
2011-10-03 12:36           ` James Courtier-Dutton
2011-10-03 12:50             ` Antti Palosaari

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=4E485F81.9020700@iki.fi \
    --to=crope@iki.fi \
    --cc=ivaradi@gmail.com \
    --cc=linux-media@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.