Re: Probe function question

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

 



> On Tue, 2014-06-17 at 12:19 +0200, Vlad Ungureanu wrote:
> > > On Tue, 2014-06-17 at 11:18 +0200, Vlad Ungureanu wrote:
> > > > > 
> > > 
> > > > > If that is not your intention, then you need to be more specific in the match table.
> > > > Yes, it matches the whole device so that is why every interface gets probed. I
> > > > will change that.
> > > 
> > > That's problematic. You need to find out what happens if both interfaces
> > > are used at the same time.
> > 
> > My device has 2 interfaces in normal mode and 2 interfaces in ADK mode.
> > Interface 0 has just ep0 which is control endpoint. Interface 1 has 2 bulk EPs:
> > IN, OUT. I should check the macro how to define them nicely in the device
> > table.
> 
> No, don't do that.
> 
> First of all, you are conflating two issues.
> Switching between normal and ADK mode should indeed be done in user
> space. How is it done in fact?

To go into ADK mode the host needs to send the Android device a series of usb
control messages with different data. This yes can be done from userspace but
when the device goes into the ADK mode I need to handle it into Kernel space.
The end goal of the project is to simulate the displayLink driver using an
Android device instead of a DisplayLink compatible screen. In ADK mode I will
need just interface 1 which has 2 bulk EPs. No other interaction from userspace
will be with the device in ADK mode.

> 
> Secondly the interfaces. Restricting the matching creates a problem
> in cooperation with usbfs. At least if you both need them, like btusb
> or the CDC drivers.
> 
> Suppose you need both interfaces. Then you need to claim both interfaces
> in probe(). However interfaces can be claimed from user space also
> and freed in arbitrary order.
> Now, if you change your matching so that you match only on the first
> interface, binding will fail if user spaces unclaims the first
> interface before the second. That's because your probe needs to fail
> as the second interface is still claimed by user space. You can solve
> this issue by matching on both interfaces and claiming the corresponding
> interface in probe()

In probe as I see it now I should claim just interface 1 because the Android
Open Accessory standard does not offer support of communication over ep0 when
in ADK mode so it would be useless.

> 
> 	Regards
> 		Oliver
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Vlad Ungureanu

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux