LT4000 PCMCIA device driver CardServices undefined problem

mail mail towergeebulk at gmail.com
Sat Jul 23 06:21:16 EDT 2005


Thanks for randy's detail replying.

I don't know why LT4000 device driver does not appear in the kernel
tree. And I will be very happy if the LT4000 device driver appear in
the 2.6 kernel tree.

Can you tell me what the Coding Style I should use in pcmcia driver
source code? Now I will read some pcmcia driver in kernel 2.6 and hope
to learn some coding style.

I have read the patch file you provied. It does not mention how to use
kref. Can you give me some tips or give me some url so that I can
learn from it?

Thank you again.

On 7/22/05, randy_dunlap <rdunlap at xenotime.net> wrote:
> 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
> 
> 
>



More information about the linux-pcmcia mailing list