Page MenuHomeFreeBSD

Expose USB port physical information in ACPI by sysctl.
ClosedPublic

Authored by takawata on Jul 6 2019, 3:07 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Mar 18, 1:41 PM
Unknown Object (File)
Dec 25 2023, 4:08 PM
Unknown Object (File)
Dec 20 2023, 6:21 AM
Unknown Object (File)
Dec 19 2023, 12:52 PM
Unknown Object (File)
Nov 24 2023, 5:10 AM
Unknown Object (File)
Nov 22 2023, 4:16 AM
Unknown Object (File)
Nov 7 2023, 2:50 PM
Unknown Object (File)
Nov 4 2023, 5:24 PM
Subscribers

Details

Summary

This expose USB port physical information (_UPC, _PLD) by sysctl.
This adds per port sysctl node tree with 3 children: upc, pldraw, info
upc is integer value that expose _UPC.
pldraw is buffer that raw PLD value.
info is interpreted version of above two.
example output follows.

sysctl -x dev.uhub.0.port1

dev.uhub.0.port1.info: Handle \_SB_.PCI0.XHC_.RHUB.HS01

Connectable TypeA port                                                  
Width 0 mm Height 0 mm                                                  
Visible                                                                 
PanelPosition: Right                                                    
VertPosition: Center                                                    
HorizPosition: Lower                                                    
Shape: HRect                                                            
Group Orientation Horizontal                                            
GroupToken 0                                                            
GroupPosition 1                                                         
 Eject OSPM

dev.uhub.0.port1.pldraw: Format:A Length:16 Dump:0x81000000000000005912800003000
000
dev.uhub.0.port1.upc: 0x80000000

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 25616
Build 24213: arc lint + arc unit

Event Timeline

Looks good. Some minor nits. Please fix before commit.

sys/dev/usb/usb_hub_acpi.c
217

Please indent this line properly.

222

same here.

373–374

spelling: Skipping

409

{ -> should go to next line

This revision is now accepted and ready to land.Jul 6 2019, 6:39 PM

Please re-base this patch on top of the latest 13-current.

Thank you!

--HPS

This revision now requires review to proceed.Jul 9 2019, 3:47 PM
sys/dev/usb/usb_hub_acpi.c
453

This function is not allowed to fail! Once uhub_attach() returns success, the wrapper attach needs to return success aswell, else we start leaking uhub_softc's because nobody is calling uhub_detach() !

Run detach routine on fail.

sys/dev/usb/usb_hub_acpi.c
500

style: return (ret);

522

style: return (ret);

This revision is now accepted and ready to land.Aug 2 2019, 7:43 AM