20 Apr 2010 17:45
ftdi_sio, and usb_serial->interface->dev->driver_data being null
Hi all, I am trying to learn more about interfacing with FT232, and I started with ftdi_sio.c as a base, and my final goal is being able to interface with snd_pcm and ALSA (and I'm trying to use usbaudio functions as examples). For that purpose, I am trying to build a module, where a modification of ftdi_sio.c is one object, and another .c file with corresponding ALSA functions is another object built into this module. Needless to say, I'm quite struggling to keep all the structs involved in mind :) For now, I just want to come to the point where probe and disconnect work. I have tried to add additional commands to ftdi_sio_probe and ftdi_shutdown, so functions (my_extra_probe and my_extra_disconnect) in the other .c file get called. Probe seems to work fine (i.e. a new card can be seen in cat /dev/sndstat), however, it is the disconnect I have a problem with. The problem is that in ftdi_sio_probe, after my_extra_probe, what corresponds to usb_serial->interface->dev->driver_data is a valid pointer -- however, whenever ftdi_shutdown is called, this ...->driver_data is always a null pointer (even if ftdi_open was never called). Unfortunately, the functions from usbaudio are using precisely this "property" to proceed with deregistering. Below is a snippet from these two functions: --- /* Probe function to check for special devices */ static int ftdi_sio_probe(struct usb_serial *serial,(Continue reading)
RSS Feed