[Prev][Next][Index][Thread]

pcmcia support



Hello Again

Well, I'm very proud to let you know that I have finally managed to get my
3Com ethernet pcmcia card working. The pingreply kernel works
flawlessly :) 

Of course It's far from perfekt, more a rude hack than anything else.
But that is something I'm willing to change. But for this I need some
help regarding how things should be done. Best thing I tell what I
have done so far. 

I took the pcmcia-cs-3.1.33 package from David Hinds and dropped a
bunch of files in oskit/linux/src/pcmcia-cs, that is files needed for
my cardbus brigde which is a i82365 and my 3Com card
(3c574_cs). 
Then I copied oskit/linux/dev to oskit/linux/pcmcia and changed them a bit, so
there's no name collision with lib_oskit_linux_dev. In the original
oskit linux sources I had only to changed two things, which privented
the new lib_oskit_pcmcia from building  (excluding __pcibios_read_irq
in linux/src/bios32.h and adding the state field in the task_struct in
linux/src/include/linux/sched.h). 
 
So there is now a new library (liboskit_linux_pcmcia) with all pcmcia stuff
in it and the rest should be untouched. 

And now two questions:

1. The pcmcia-cs package builds modules for the linux kernels, which
   means all entrypoints are design to be used as a module. For
   example I have following code:


static int __init init_3c574_cs(void)
{
	servinfo_t serv;

	DEBUG(0, "%s\n", version);
	CardServices(GetCardServicesInfo, &serv);
	if (serv.Revision != CS_RELEASE_CODE) {
		printk(KERN_NOTICE "3c574_cs: Card Services release "
			   "does not match!\n");
		return -EINVAL;
	}
	register_pccard_driver(&dev_info, &tc574_attach, &tc574_detach);
	return 0;
}

module_init(init_3c574_cs);

  
  I changed them to 


#ifdef OSKIT
int oskit_linux_init_pcmcia_3c574_cs(void)
#else
static int __init init_3c574_cs(void)
#endif
{
        ...
}

  which I think is a quick and dirty hack. What is a good way to have
  these functions and entrypoints exported?

2. The orignial pcmcia-cs approach for detecting activities on the
   sockets is that there is a user space program which does the
   job (adding and removing devices, etc.). 
   I don't know if oskit allows to insert and remove drivers/devices
   at runtime and not only at boot phase. So I just added a small card
   manager which scannes the sockets and inserts the driver during the
   booting. Removing is not implemented but still detected that the
   card is missing. 
   The goal was that the pcmcia library behaves exactly the same way
   as for example the oskit_linux_dev library. I would expect from
   real pcmcia support to be hotplug-able, but that would mess up the
   simple interface to the pcmcia library. What should I do? Trying to
   match the same interface/behavier or adding a new interface? (If
   yes, how should this interface look like?)


I will do some more debugging to see how reliable it etc. Especially if
it's working with oskit-mach. For those who are really brave they sure
can have their fun [1]. Remember just the i82365 and a 3Com [2] are
supported. 

- wagi


[1] http://www.vis.ethz.ch/~wagi/oskit

[2] wagi@aragorn:~$ cardctl ident
Socket 0:
  no product info available
Socket 1:
  product info: "3Com", "OfficeConnect 572B", "B", "001"
  manfid: 0x0101, 0x0574  <-- XXX 
  function: 6 (network)