USB驱动学习 ---- USB设备每换一个新口,就的重新安装驱动,正常吗?
来源:互联网 发布:杀红眼知乎 编辑:程序博客网 时间:2024/06/02 09:50
USB设备每换一个新口,就的重新安装驱动,正常吗?
这种情况是因为 USB 设备没有 Serial Number(或Serial Number无效)。所以bus driver 就根据它的位置信息来生成 InstanceID。如果 USB device 指定了有效的 SerialNumber,则系统始终将该设备识别成同一个设备(Instance ID就是SerialNumber)。
参考文档:
http://blogs.msdn.com/oldnewthing/archive/2004/11/10/255047.aspx
You may have noticed that if you take a USB device and plug it into your computer, Windows recognizes it and configures it. Then if you unplug it and replug it into a different USB port, Windows gets a bout of amnesia and thinks that it's a completely different device instead of using the settings that applied when you plugged it in last time. Why is that?
The USB device people explained that this happens when the device lacks a USB serial number.
Serial numbers are optional on USB devices. If the device has one, then Windows recognizes the device no matter which USB port you plug it into. But if it doesn't have a serial number, then Windows treats each appearance on a different USB port as if it were a new device.
(I remember that one major manufacturer of USB devices didn't quite understand how serial numbers worked. They gave all of their devices serial numbers, that's great, but they all got the same serial number. Exciting things happened if you plugged two of their devices into a computer at the same time.)
But why does Windows treat it as a different device if it lacks a serial number and shows up on a different port? Why can't it just say, "Oh, there you are, over there on another port."
Because that creates random behavior once you plug in two such devices. Depending on the order in which the devices get enumerated by Plug and Play, the two sets of settings would get assigned seemingly randomly at each boot. Today the settings match up one way, but tomorrow when the devices are enumerated in the other order, the settings are swapped. (You get similarly baffling behavior if you plug in the devices in different order.)
In other words: Things suck because (1) things were already in bad shape—this would not have been a problem if the device had a proper serial number—and (2) once you're in this bad state, the alternative sucks more. The USB stack is just trying to make the best of a bad situation without making it any worse.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
What characters or bytes are valid in a USB serial number?
A USB device has two choices for storing serial numbers in the iSerialNumber field (in the USB device descriptor):
(1) iSerialNumber == 0x00 : The USB device has no serial number.
(2) iSerialNumber != 0x00 : The USB device has a serial number and it is stored at the string index indicated in iSerialNumber.
If the device has a serial number, Microsoft requires that the serial number uniquely identify each instance of the same device. For example, if two device descriptors have identical values for the idVendor, idProduct, and bcdDevice fields, the iSerialNumber field will distinguish one from the other.
Windows Plug and Play requires that serial numbers across multiple buses follow specified rules. Every byte in a USB serial number is checked for correctness. If a single invalid byte is found, the serial number is discarded and the device is treated as if it had no serial number.
Invalid bytes in serial numbers are indicated below:
(1) Byte values less than 0x20 are invalid.
(2) Byte values greater than 0x7F are invalid.
(3) Byte value 0x2C is invalid.
- USB驱动学习 ---- USB设备每换一个新口,就的重新安装驱动,正常吗?
- USB设备每换一个新口,就要重新安装驱动
- Platform Cable USB 的驱动重新安装方法
- [USB] USB 设备驱动的移植
- USB设备的驱动移植
- USB设备的驱动状态
- USB设备硬件、驱动、及USB口的读写
- USB设备硬件、驱动、及USB口的读写
- USB 设备、USB 驱动、USB 应用程序
- USB设备驱动小结
- usb audio设备驱动
- USB设备驱动
- USB设备驱动调试
- usb设备控制驱动
- USB设备驱动
- USB设备驱动
- usb5-usb设备驱动
- USB设备驱动
- NDIS中间层的驱动包截获技术教程
- linux下修改IP、DNS、路由命令行设置
- sqlserver 读取 excel中的数据
- 内省的使用
- CRC16校验
- USB驱动学习 ---- USB设备每换一个新口,就的重新安装驱动,正常吗?
- Python/C interface
- MeeGo中css主题文件的使用方法
- 《华清远见学习手记》 之3G智能机器人——移植lynx2.8.5浏览器到FS2410
- DataGrid与GridView
- 真他妈的操蛋
- iis7.0 下配置可上传文件大小
- SQL Server数据库开发的二十一条军规
- 新技术学习方法思考