2005-11-18 13:20:17

by Jan De Luyck

[permalink] [raw]
Subject: [2.6.14.2] port smartcard driver to new pcmcia infrastructure?

Hello list,

I'm currently looking into getting my smartcard driver to work. O2Micro was
nice enough to opensource the driver [1]. The driver compiles without
problems, and can be insmod' without triggering any problem. The main problem
lies that it doesn't seem to be calling the ozscrx_attach function, which
sets up the irq's and everything, thus causing the subsequent open of the
device to fail with -ENODEV.

The laptop in question is an Acer TM803, with an
in-the-cardbus-system-integrated SmartCard reader.

Does anyone have any idea how i can continue debugging this?

Thanks.

Jan

[1] ftp://scrdriver:[email protected]/Linux or
http://www.musclecard.com/drivers/readers/files/O2Micro_PCMCIA_SCR_202_Linux_Kernel26_OpenSource.tar.gz


--
Se o filme fosse ga?cho...

Mam?e Faz Cem anos -- A V?ia t? Cheirando a Defunto


2005-12-07 11:02:46

by Dominik Brodowski

[permalink] [raw]
Subject: Re: [2.6.14.2] port smartcard driver to new pcmcia infrastructure?

Hi!

> I'm currently looking into getting my smartcard driver to work. O2Micro was
> nice enough to opensource the driver [1]. The driver compiles without
> problems, and can be insmod' without triggering any problem. The main problem
> lies that it doesn't seem to be calling the ozscrx_attach function, which
> sets up the irq's and everything, thus causing the subsequent open of the
> device to fail with -ENODEV.
>
> Does anyone have any idea how i can continue debugging this?

The problem is that one, possibly two of the required changes haven't yet
propagated to their driver.

* event handler initialization in struct pcmcia_driver (as of 2.6.13)
The event handler is notified of all events, and must be initialized
as the event() callback in the driver's struct pcmcia_driver.
Example patch:
http://kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=1e212f3645a6b355de8c43a23376bc0e2ac49a63

and

* in-kernel device<->driver matching (as of 2.6.13)
PCMCIA devices and their correct drivers can now be matched in
kernelspace. See 'devicetable.txt' for details.
Example patch:
http://kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blobdiff;h=cdcc46e1f11d6dfbf4e741d7c77ec83a4b7c09ac;hp=f3ea4a9f2bf196a0b884cde3d44a2cec27f9db13;hb=ce8a0037e110c1f4ec2fac7a3d791043e4e38cfc;f=drivers/net/pcmcia/pcnet_cs.c
the correct ID is, AFAICS:
PCMCIA_DEVICE_PROD_ID123("O2Micro", "SmartCardBus Reader", "V1.0", 0x97299583, 0xb8501ba9, 0xe611e659);


For -mm (and for 2.6.16, not .15) there are quite more changes necessary,
which are also described in Documentation/pcmcia/driver-changes.txt.


Dominik