Just to follow up, I finally figured out I could just use rtdm_device->device_data to point to my private structure, and then access it from device operations by context->device->device_data.
Steve On Thu, Sep 24, 2009 at 5:12 PM, Stephen Sinclair <[email protected]> wrote: > Hi, > > I'm trying to port a PCI driver to Xenomai/RTDM. I'm a bit confused > about how to handle private data. The open/close/ioctl functions > receive a context pointer, which is a struct + the context_size > length. So this is where I guess you are supposed to put private > data, initialized in the open() function. > > However, the driver I'm porting does initialization (i.e,. gets base > addresses, etc) in the probe() function. It gets base addresses from > the pci_dev struct which is passed to it. In the probe function I > have no rtdm_dev_context, so I can't initialize the private data > there. In the open function I have no pci_dev so I can't do it there > either. I could allocate some memory and store it in > rtdm_device.device_data, but this isn't available to the > open/close/ioctl functions. > > So I presume rtdm_context is created sometime during > rtdm_dev_register() (called in probe), but how do I access it for > writing? > > thanks, > Steve > _______________________________________________ Xenomai-help mailing list [email protected] https://mail.gna.org/listinfo/xenomai-help
