linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mario Limonciello <mario_limonciello@dell.com>
To: linux-hotplug@vger.kernel.org
Subject: Re: [PATCH] Explicitly disable BT radio using rfkill interface on
Date: Wed, 15 Jul 2009 22:24:31 +0000	[thread overview]
Message-ID: <4A5E571F.7070300@dell.com> (raw)
In-Reply-To: <4A4A8B6D.3060509@dell.com>

[-- Attachment #1: Type: text/plain, Size: 3448 bytes --]

Hi Kay & Alan

Kay Sievers wrote:
> On Wed, Jul 15, 2009 at 04:07, Alan Stern<stern@rowland.harvard.edu> wrote:
>   
>> On Wed, 15 Jul 2009, Kay Sievers wrote:
>>
>>     
>>>> What kind of directory is that? I've never seen such a thing:
>>>>  sprintf(devname, "%s/usb/hid/hiddev%d", devpath, i);
>>>>         
>>> That all needs to be fixed. We are not hooking into USB device events
>>> and write to hard-coded /dev/hidraw* devices. If these devices need to
>>> be handled with hidraw, the tools needs to hook into hidraw events.
>>>       
>> That's absolutely right.  At the time the USB device event takes place,
>> the HID driver might not even be loaded yet!
>>     
>
> Right, and even when it's loaded, there is no guarantee, that this
> device is already created by udev.
>
>   
So this code for switch_logitech was originally authored by Marcel.  I
can try to help clean this part up, but I'd like to treat that as an
independent problem to follow up to after I get the logic for getting
this Dell HW working after S3.
>>>> Why do you need to *find* the device at all? Same question for the
>>>> normal call case too, not only the resume case.
>>>>         
>> This is the difficult aspect of the application.  The program needs to
>> poke at an HID device when it receives an event concerning an HCI
>> device.  Mario doesn't want to assume there will be any fixed relation
>> between the two devices (although it should be safe to assume they will
>> always have the same parent hub).
>>
>> Thus some sort of search appears to be necessary.  It's not clear
>> whether the search result can be saved (say in udev's database) so that
>> later "resuscitate" invocations don't need to repeat the search.
>>     
>
> Yeah, what a hardware. :) These are all *devices* not *interfaces*
> right? And we poke a sibling device which is a HID device to manage
> the other sibling which shows up as the bluetooth device then?
>   
Yes, these are all individual devices.  It would be a safe assumption
that they have the same parent hub, so perhaps the search could be
simplified.
>   
>>> Seems libusb is too stupid to handle a specific device, and
>>> unfortunately even the new libusb seems to be not better regarding
>>> this. It really needs an interface to select a specific device by
>>> whatever _unique_ property, not by vid/pid, instead of this braindead
>>> brute-force searching across all possible devices to find itself.
>>>       
>> The unique identifier appropriate for libusb is a (bus number, device
>> number) pair.
>>     
>
> Yeah, that would be good to use. That's what the device nodes use too.
>   

>   
>> These values will not change across a suspend/resume.
>> I don't know whether libusb has an API to open the particular device
>> given by those numbers, but it ought to.
>>     
>
> I didn't see anything like that. If that can't be done, I'll just add
> the few needed things to switch the device to code inside of udev and
> drop that libusb thing entirely.
>
>   
I'll look into switching to this pair instead.  I didn't see any obvious
method to select devices by these properties, but I've just skimmed
libusb source looking for them.  If I don't find them, i'll resubmit the
patch with Marcel's recommendations of using more pointers for readability.
-- 
Mario Limonciello
*Dell | Linux Engineering*
mario_limonciello@dell.com


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

  parent reply	other threads:[~2009-07-15 22:24 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-30 22:02 [PATCH] Explicitly disable BT radio using rfkill interface on Mario Limonciello
2009-06-30 22:26 ` Kay Sievers
2009-07-01  3:53 ` [PATCH] Explicitly disable BT radio using rfkill interface on suspend Mario_Limonciello
2009-07-01 12:06 ` [PATCH] Explicitly disable BT radio using rfkill interface on Marcel Holtmann
2009-07-01 13:13 ` [PATCH] Explicitly disable BT radio using rfkill interface on suspend Mario_Limonciello
2009-07-01 15:03 ` [PATCH] Explicitly disable BT radio using rfkill interface on Marcel Holtmann
2009-07-01 17:12 ` Mario Limonciello
2009-07-01 17:18 ` Matthew Garrett
2009-07-01 22:13 ` Marcel Holtmann
2009-07-01 22:16 ` Matthew Garrett
2009-07-01 22:23 ` Mario Limonciello
2009-07-01 22:49 ` Marcel Holtmann
2009-07-01 22:52 ` Matthew Garrett
2009-07-02 14:02 ` Alan Stern
2009-07-10 14:46 ` Alan Stern
2009-07-14 16:40 ` Mario Limonciello
2009-07-14 16:51 ` Alan Stern
2009-07-14 16:52 ` Kay Sievers
2009-07-14 17:32 ` Mario Limonciello
2009-07-14 18:46 ` Marcel Holtmann
2009-07-14 19:12 ` Kay Sievers
2009-07-14 21:00 ` Mario Limonciello
2009-07-14 21:20 ` Marcel Holtmann
2009-07-14 21:24 ` Kay Sievers
2009-07-14 22:45 ` Kay Sievers
2009-07-15  2:07 ` Alan Stern
2009-07-15  2:26 ` Kay Sievers
2009-07-15 22:15 ` Mario Limonciello
2009-07-15 22:24 ` Mario Limonciello [this message]
2009-07-15 23:27 ` Kay Sievers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A5E571F.7070300@dell.com \
    --to=mario_limonciello@dell.com \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).