LT4000 PCMCIA device driver CardServices undefined problem

randy_dunlap rdunlap at xenotime.net
Thu Jul 21 14:12:21 EDT 2005


On Thu, 21 Jul 2005 22:51:48 +0800 mail mail wrote:

> Hi,
> I downloaded the source code of LT4000 from http://www.linuxnet.com/
> and I found that it can only run on kernel 2.4. It doesn't work in
> kernel 2.6. I do some modification in order to run in kernel 2.6. Here
> is some of my work.

Any idea why this driver isn't in the kernel tree?

> 1. add kref instead of MOD_INC_USE_COUNT and MOD_DEC_USE_COUNT (not
> finished yet.) In fact, I don't know how to add kref support yet. Can
> you help me?
> 2. use pcmcia_register_driver instead of register_pccard_driver. I
> find some useful tips in http://linux.bkbits.com/. There is some diff
> files in the chargelog of pcmcia.
> 3. use pcmcia_unregister_driver instead of unregister_pccard_driver.
> The same as the former one.
> 4. use new Makefile. I learn this from LDD3.

Even simpler one below.

> 5. add struct pcmcia_driver. 
> 
> Now I compile the source code and it said "*** Warning: "CardServices"
> [/root/lt4000-1.0.0.2/kernel/LT4000_cs.ko] undefined!". My environment
> is "Linux 2.6.11-1.14_FC3 i686 i386 GNU/Linux" on NEC VERSA NOTE VXi
> laptop.
> 
> I have spent quite some time to search using Google but found nothing
> userful. Is anybody available to help me out? Why CardServices is not
> support by kernel 2.6?

CardServices() in 2.4 is just a big switch statement to call various
services.  In 2.6, all of those entry points are exported and called
directly (except for pcmcia_report_error(), just use cs_error() instead).

Dominik, can we get this added to Doc/pcmcia/driver-changes.txt?

I'm attaching a patch to your posted source file.  It fixes most of
the CardServices() calls except for the one to pccard_validate_cis()
and these 2 usages:

#define CS_CHECK(fn, args...) \
while ((last_ret=CardServices(last_fn=(fn),args))!=0) goto cs_failed

#define CFG_CHECK(fn, args...) \
if (CardServices(fn, args) != 0) goto next_entry

The call to pccard_validate_cis() wants a socket, which I
didnt' declare or initialize (i.e., syntax error there is on purpose).



There's still a ton of CodingStyle work to be done to the driver,
but I didn't address that for the most part.

---
~Randy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lt4000_rdd1.patch
Type: application/octet-stream
Size: 4759 bytes
Desc: not available
Url : http://lists.infradead.org/pipermail/linux-pcmcia/attachments/20050721/00a1dd71/lt4000_rdd1.obj


More information about the linux-pcmcia mailing list