Subject: Re: powering down pcmcia/cardbus slots
To: Steven M. Bellovin <smb@cs.columbia.edu>
From: Garrett D'Amore <garrett_damore@tadpole.com>
List: tech-kern
Date: 02/16/2006 12:28:21
Steven M. Bellovin wrote:
> In message <43F4C80A.8090109@tadpole.com>, "Garrett D'Amore" writes:
>   
>> Jachym Holecek wrote:
>>     
>>>> It looks like there is cardbus_function_disable() in the kernel that
>>>> should stop all this and power off the device, but I have no idea how
>>>> you get to it from userland.
>>>>
>>>> Seems like what we really need is a userland routine to detach device
>>>> instances.
>>>>     
>>>>         
>>> see sys/kern/kern_drvctl.c
>>>
>>> 	-- Jachym
>>>   
>>>       
>> Thanks. drvctl(8) should do it.
>>
>>     
> I'm building a kernel with the driver now.  There are no instances of 
> it in GENERIC, nor is there a drvctl(4) page that is referenced by 
> drvctl(8).  I'm unclear on what the arguments should be in my case.
> Again, here's the dmesg:
>
> ohci0 at cardbus0 function 0: NEC USB Host Controller (rev. 0x43)
> ohci0: interrupting at 11
> ohci0: OHCI version 1.0
> usb4 at ohci0: USB revision 1.0
> uhub4 at usb4
> uhub4: NEC OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
> uhub4: 1 port with 1 removable, self powered
> ohci1 at cardbus0 function 1: NEC USB Host Controller (rev. 0x43)
> ohci1: interrupting at 11
> ohci1: OHCI version 1.0
> usb5 at ohci1: USB revision 1.0
> uhub5 at usb5
> uhub5: NEC OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
> uhub5: 1 port with 1 removable, self powered
> umodem0 at uhub4 port 1 configuration 1 interface 0
> umodem0: Curitel Communications, Inc. Curitel Communications, Inc., rev 1.10/0.00, addr 2, iclass 2/2
> umodem0: data interface 1, has CM over data, has break
> umodem0: status change notification available
> ucom0 at umodem0
>
> What is the "device" I'd use with 'drvctl -d'?  ohci0?  Or do I have to 
> do it recursively, starting with ucom0 and uhub5?  And what bus (and 
> perhaps locator or attribute) do I use with 'drvctl -r'?
>   
Those are excellent questions. Unfortunately, I don't have an answer.
Experiment and see what happens.

As they say, "use the Source, Luke".

-- 
Garrett D'Amore, Principal Software Engineer
Tadpole Computer / Computing Technologies Division,
General Dynamics C4 Systems
http://www.tadpolecomputer.com/
Phone: 951 325-2134  Fax: 951 325-2191