There is开发者_StackOverflow社区 any way to I disable/enable a specific USB Port with my application ?
I'm not aware of any way to do this from user space, and even within the kernel it could be tricky: I think you would need to install a dummy I/O Kit driver which matches all USB devices and/or interfaces. This could be tricky as existing drivers would take precedence, so you'd need to work around that. Once matched, you would check the port in the driver's probe()
method and return true if it was one of the disallowed ports. This would stop other drivers from grabbing the device, which would essentially disable it.
精彩评论