|
Lines 171-195
Link Here
|
| 171 |
Should no such device exist an error is reported. |
171 |
Should no such device exist an error is reported. |
| 172 |
.Bd -literal |
172 |
.Bd -literal |
| 173 |
struct usb_device_info { |
173 |
struct usb_device_info { |
| 174 |
u_int8_t bus; |
174 |
u_int8_t udi_bus; |
| 175 |
u_int8_t addr; |
175 |
u_int8_t udi_addr; |
| 176 |
# define USBDEVNAME_NR 4 |
176 |
# define MAXDEVNAMELEN 10 |
| 177 |
# define USBDEVNAME_LEN 10 |
177 |
# define MAXDEVNAMES 4 |
| 178 |
char devnames[USBDEVNAME_NR][USBDEVNAME_LEN]; |
178 |
char udi_devnames[MAXDEVNAMES][MAXDEVNAMELEN]; |
| 179 |
char product[USB_MAX_STRING_LEN]; |
179 |
char udi_product[USB_MAX_STRING_LEN]; |
| 180 |
char vendor[USB_MAX_STRING_LEN]; |
180 |
char udi_vendor[USB_MAX_STRING_LEN]; |
| 181 |
char release[8]; |
181 |
char udi_release[8]; |
| 182 |
u_int16_t productNo; |
182 |
u_int16_t udi_productNo; |
| 183 |
u_int16_t vendorNo; |
183 |
u_int16_t udi_vendorNo; |
| 184 |
u_int16_t releaseNo; |
184 |
u_int16_t udi_releaseNo; |
| 185 |
u_int8_t class; |
185 |
u_int8_t udi_class; |
| 186 |
u_int8_t subclass; |
186 |
u_int8_t udi_subclass; |
| 187 |
u_int8_t protocol; |
187 |
u_int8_t udi_protocol; |
| 188 |
u_int8_t config; |
188 |
u_int8_t udi_config; |
| 189 |
u_int8_t lowspeed; |
189 |
u_int8_t udi_lowspeed; |
| 190 |
int power; |
190 |
int udi_power; |
| 191 |
int nports; |
191 |
int udi_nports; |
| 192 |
u_int8_t ports[16]; |
192 |
u_int8_t udi_ports[16]; |
| 193 |
#define USB_PORT_ENABLED 0xff |
193 |
#define USB_PORT_ENABLED 0xff |
| 194 |
#define USB_PORT_SUSPENDED 0xfe |
194 |
#define USB_PORT_SUSPENDED 0xfe |
| 195 |
#define USB_PORT_POWERED 0xfd |
195 |
#define USB_PORT_POWERED 0xfd |
|
Lines 197-236
Link Here
|
| 197 |
}; |
197 |
}; |
| 198 |
.Ed |
198 |
.Ed |
| 199 |
.Pp |
199 |
.Pp |
| 200 |
.Va bus |
200 |
.Va udi_bus |
| 201 |
and |
201 |
and |
| 202 |
.Va addr |
202 |
.Va udi_addr |
| 203 |
contain the topological information for the device. |
203 |
contain the topological information for the device. |
| 204 |
.Va devnames |
204 |
.Va udi_devnames |
| 205 |
contains the device names of the connected drivers. |
205 |
contains the device names of the connected drivers. |
| 206 |
For example the |
206 |
For example the |
| 207 |
third USB Zip drive connected will be |
207 |
third USB Zip drive connected will be |
| 208 |
.Li umass2 . |
208 |
.Li umass2 . |
| 209 |
The |
209 |
The |
| 210 |
.Va product , vendor |
210 |
.Va udi_product , udi_vendor |
| 211 |
and |
211 |
and |
| 212 |
.Va release |
212 |
.Va udi_release |
| 213 |
fields contain self-explanatory descriptions of the device. |
213 |
fields contain self-explanatory descriptions of the device. |
| 214 |
.Va productNo , vendorNo , releaseNo , class , subclass |
214 |
.Va udi_productNo , udi_vendorNo , udi_releaseNo , udi_class , udi_subclass |
| 215 |
and |
215 |
and |
| 216 |
.Va protocol |
216 |
.Va udi_protocol |
| 217 |
contain the corresponding values from the device descriptors. |
217 |
contain the corresponding values from the device descriptors. |
| 218 |
The |
218 |
The |
| 219 |
.Va config |
219 |
.Va udi_config |
| 220 |
field shows the current configuration of the device. |
220 |
field shows the current configuration of the device. |
| 221 |
.Pp |
221 |
.Pp |
| 222 |
.Va lowspeed |
222 |
.Va udi_lowspeed |
| 223 |
indicates whether the device is a full speed (0) or low speed (1) |
223 |
indicates whether the device is a full speed (0) or low speed (1) |
| 224 |
device. |
224 |
device. |
| 225 |
The |
225 |
The |
| 226 |
.Va power |
226 |
.Va udi_power |
| 227 |
field shows the power consumption in milli-amps drawn at 5 volts, |
227 |
field shows the power consumption in milli-amps drawn at 5 volts, |
| 228 |
or zero if the device is self powered. |
228 |
or zero if the device is self powered. |
| 229 |
.Pp |
229 |
.Pp |
| 230 |
If the device is a hub the |
230 |
If the device is a hub the |
| 231 |
.Va nports |
231 |
.Va udi_nports |
| 232 |
field is non-zero and the |
232 |
field is non-zero and the |
| 233 |
.Va ports |
233 |
.Va udi_ports |
| 234 |
field contains the addresses of the connected devices. |
234 |
field contains the addresses of the connected devices. |
| 235 |
If no device is connected to a port one of the |
235 |
If no device is connected to a port one of the |
| 236 |
.Va USB_PORT_* |
236 |
.Va USB_PORT_* |
|
Lines 239-250
Link Here
|
| 239 |
This command retrieves statistics about the controller. |
239 |
This command retrieves statistics about the controller. |
| 240 |
.Bd -literal |
240 |
.Bd -literal |
| 241 |
struct usb_device_stats { |
241 |
struct usb_device_stats { |
| 242 |
u_long requests[4]; |
242 |
u_long uds_requests[4]; |
| 243 |
}; |
243 |
}; |
| 244 |
.Ed |
244 |
.Ed |
| 245 |
.Pp |
245 |
.Pp |
| 246 |
The |
246 |
The |
| 247 |
.Va requests |
247 |
.Va uds_requests |
| 248 |
field is indexed by the transfer kind, i.e.\& |
248 |
field is indexed by the transfer kind, i.e.\& |
| 249 |
.Va UE_* , |
249 |
.Va UE_* , |
| 250 |
and indicates how many transfers of each kind that has been completed |
250 |
and indicates how many transfers of each kind that has been completed |