* Re: Driver for a SmartCard interface on a SoC
2010-05-07 13:18 Driver for a SmartCard interface on a SoC Juergen Beisert
@ 2010-05-07 13:02 ` Alan Cox
2010-05-07 14:25 ` Juergen Beisert
0 siblings, 1 reply; 7+ messages in thread
From: Alan Cox @ 2010-05-07 13:02 UTC (permalink / raw)
To: Juergen Beisert
Cc: linux-kernel, Greg Kroah-Hartman, Andrew Morton, Rusty Russell,
Jiri Slaby
On Fri, 7 May 2010 15:18:50 +0200
Juergen Beisert <jbe@pengutronix.de> wrote:
> Hi,
>
> most SmartCard readers are external devices, connected via USB or
> serial lines. So, they do not need special in-kernel drivers.
>
> My SmartCard interface is part of a SoC (i.MX25 CPU). So, I need an
> in-kernel driver. Where would be the best place in the kernel tree,
> to add a driver for this kind of device? Maybe "drivers/char"?
> To exchange data with the plugged in SmartCard, only a couple of
> IOCTLs are required (detecting if a card is plugged in, socket power
> on/off, send reset to the card, configuring the communication
> parameters). Data exchange with the SmartCard can be done with simple
> read/write.
I'd say drivers/char if its a generic char device, but if its MX25
specific code entirely then drivers/platform or arch/.../platform.
The other question is one of API - it's going to best if the API isn't
MX25 specific but could reasonably be expected to work with other
future devices. A fake tty interface is probably overkill for that but
it would be good to get general review of any API.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Driver for a SmartCard interface on a SoC
@ 2010-05-07 13:18 Juergen Beisert
2010-05-07 13:02 ` Alan Cox
0 siblings, 1 reply; 7+ messages in thread
From: Juergen Beisert @ 2010-05-07 13:18 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, Andrew Morton, Rusty Russell, Jiri Slaby,
Alan Cox
Hi,
most SmartCard readers are external devices, connected via USB or serial
lines. So, they do not need special in-kernel drivers.
My SmartCard interface is part of a SoC (i.MX25 CPU). So, I need an in-kernel
driver. Where would be the best place in the kernel tree, to add a driver for
this kind of device? Maybe "drivers/char"?
To exchange data with the plugged in SmartCard, only a couple of IOCTLs are
required (detecting if a card is plugged in, socket power on/off, send reset
to the card, configuring the communication parameters). Data exchange with
the SmartCard can be done with simple read/write.
Any idea?
Regards,
Juergen
--
Pengutronix e.K. | Juergen Beisert |
Linux Solutions for Science and Industry | Phone: +49-8766-939 228 |
Vertretung Sued/Muenchen, Germany | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de/ |
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Driver for a SmartCard interface on a SoC
2010-05-07 13:02 ` Alan Cox
@ 2010-05-07 14:25 ` Juergen Beisert
2010-05-11 21:33 ` Alan Cox
0 siblings, 1 reply; 7+ messages in thread
From: Juergen Beisert @ 2010-05-07 14:25 UTC (permalink / raw)
To: linux-kernel
Cc: Alan Cox, Greg Kroah-Hartman, Andrew Morton, Rusty Russell,
Jiri Slaby
Hi Alan,
Alan Cox wrote:
> On Fri, 7 May 2010 15:18:50 +0200
> Juergen Beisert <jbe@pengutronix.de> wrote:
> > most SmartCard readers are external devices, connected via USB or
> > serial lines. So, they do not need special in-kernel drivers.
> >
> > My SmartCard interface is part of a SoC (i.MX25 CPU). So, I need an
> > in-kernel driver. Where would be the best place in the kernel tree,
> > to add a driver for this kind of device? Maybe "drivers/char"?
> > To exchange data with the plugged in SmartCard, only a couple of
> > IOCTLs are required (detecting if a card is plugged in, socket power
> > on/off, send reset to the card, configuring the communication
> > parameters). Data exchange with the SmartCard can be done with simple
> > read/write.
>
> I'd say drivers/char if its a generic char device, but if its MX25
> specific code entirely then drivers/platform or arch/.../platform.
This driver covers a SmartCard core built into this kind of CPU. Its not like
an interrupt controller which is specific to the CPU. Its a component like
the USB and LCD controller, also built into this CPU. Maybe other CPUs will
follow that are also using this SmartCard core (I don't know, only the
manufacture knows).
> The other question is one of API - it's going to best if the API isn't
> MX25 specific but could reasonably be expected to work with other
> future devices. A fake tty interface is probably overkill for that but
> it would be good to get general review of any API.
"faky tty"?
Regards,
Juergen
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Driver for a SmartCard interface on a SoC
2010-05-07 14:25 ` Juergen Beisert
@ 2010-05-11 21:33 ` Alan Cox
2010-05-12 7:38 ` Juergen Beisert
0 siblings, 1 reply; 7+ messages in thread
From: Alan Cox @ 2010-05-11 21:33 UTC (permalink / raw)
To: Juergen Beisert
Cc: linux-kernel, Greg Kroah-Hartman, Andrew Morton, Rusty Russell,
Jiri Slaby
> > I'd say drivers/char if its a generic char device, but if its MX25
> > specific code entirely then drivers/platform or arch/.../platform.
>
> This driver covers a SmartCard core built into this kind of CPU. Its
> not like an interrupt controller which is specific to the CPU. Its a
> component like the USB and LCD controller, also built into this CPU.
> Maybe other CPUs will follow that are also using this SmartCard core
> (I don't know, only the manufacture knows).
The question is really about the interface as seen from userspace - is
that generic or could it be generic so you could write other card
drivers for different hardware to the same user space interface ?
> > The other question is one of API - it's going to best if the API
> > isn't MX25 specific but could reasonably be expected to work with
> > other future devices. A fake tty interface is probably overkill for
> > that but it would be good to get general review of any API.
>
> "faky tty"?
Some systems have before now implemented onchip smart card interfaces
with drivers that pretend to be a serial port talking a serial link to
the smartcard.
Alan
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Driver for a SmartCard interface on a SoC
2010-05-11 21:33 ` Alan Cox
@ 2010-05-12 7:38 ` Juergen Beisert
2010-05-13 9:33 ` Alan Cox
2010-05-13 9:38 ` Alan Cox
0 siblings, 2 replies; 7+ messages in thread
From: Juergen Beisert @ 2010-05-12 7:38 UTC (permalink / raw)
To: linux-kernel
Cc: Alan Cox, Greg Kroah-Hartman, Andrew Morton, Rusty Russell,
Jiri Slaby
Hi Alan,
Alan Cox wrote:
> > > I'd say drivers/char if its a generic char device, but if its MX25
> > > specific code entirely then drivers/platform or arch/.../platform.
> >
> > This driver covers a SmartCard core built into this kind of CPU. Its
> > not like an interrupt controller which is specific to the CPU. Its a
> > component like the USB and LCD controller, also built into this CPU.
> > Maybe other CPUs will follow that are also using this SmartCard core
> > (I don't know, only the manufacture knows).
>
> The question is really about the interface as seen from userspace - is
> that generic or could it be generic so you could write other card
> drivers for different hardware to the same user space interface ?
Yes, the interface can be generic. As the main feature of these cards is the
communication itself, there are only a few additional requirements to make it
work. But these additional requirements are shared by all SmartCards. Where
would be the best place/mail list to discuss this API?
> > > The other question is one of API - it's going to best if the API
> > > isn't MX25 specific but could reasonably be expected to work with
> > > other future devices. A fake tty interface is probably overkill for
> > > that but it would be good to get general review of any API.
> >
> > "faky tty"?
>
> Some systems have before now implemented onchip smart card interfaces
> with drivers that pretend to be a serial port talking a serial link to
> the smartcard.
Do you mean to emulate an external serial device in the kernel driver?
To make it understand the same data sequences these kind of external device
understand? Would be possible, but its more complex than to run the
communication via read()/write() and a few additional IOCTLs for the special
SmartCard handling.
Regards,
Juergen
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Driver for a SmartCard interface on a SoC
2010-05-12 7:38 ` Juergen Beisert
@ 2010-05-13 9:33 ` Alan Cox
2010-05-13 9:38 ` Alan Cox
1 sibling, 0 replies; 7+ messages in thread
From: Alan Cox @ 2010-05-13 9:33 UTC (permalink / raw)
To: Juergen Beisert
Cc: linux-kernel, Greg Kroah-Hartman, Andrew Morton, Rusty Russell,
Jiri Slaby
> requirements to make it work. But these additional requirements are
> shared by all SmartCards. Where would be the best place/mail list to
> discuss this API?
Probably linux-kernel for the kernel view. I don't really know much
about smartcard user space to know if there is another list that might
also be useful.
If you don't get any feedback on an API you suggest I'd then just go
and implement and submit it.
> Do you mean to emulate an external serial device in the kernel driver?
> To make it understand the same data sequences these kind of external
> device understand? Would be possible, but its more complex than to
> run the communication via read()/write() and a few additional IOCTLs
> for the special SmartCard handling.
Agreed - and I don't think the extra complexity is worth it.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Driver for a SmartCard interface on a SoC
2010-05-12 7:38 ` Juergen Beisert
2010-05-13 9:33 ` Alan Cox
@ 2010-05-13 9:38 ` Alan Cox
1 sibling, 0 replies; 7+ messages in thread
From: Alan Cox @ 2010-05-13 9:38 UTC (permalink / raw)
To: Juergen Beisert
Cc: linux-kernel, Greg Kroah-Hartman, Andrew Morton, Rusty Russell,
Jiri Slaby
As a PS: Google seems to think linux-dvb might also be relevant here.
Alan
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2010-05-13 10:19 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-07 13:18 Driver for a SmartCard interface on a SoC Juergen Beisert
2010-05-07 13:02 ` Alan Cox
2010-05-07 14:25 ` Juergen Beisert
2010-05-11 21:33 ` Alan Cox
2010-05-12 7:38 ` Juergen Beisert
2010-05-13 9:33 ` Alan Cox
2010-05-13 9:38 ` Alan Cox
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox