diff options
author | thompsa <thompsa@FreeBSD.org> | 2009-04-25 21:10:06 +0000 |
---|---|---|
committer | thompsa <thompsa@FreeBSD.org> | 2009-04-25 21:10:06 +0000 |
commit | 1253be32753b7ab96a90d57fc07991ae8a154177 (patch) | |
tree | 6204fa982868a9530323799ccff1606ec998c2ba /sys/dev/usb/usb_device.h | |
parent | 50a34549cf93908659f1fb58b36fc7ed8ecfc3b8 (diff) | |
download | FreeBSD-src-1253be32753b7ab96a90d57fc07991ae8a154177.zip FreeBSD-src-1253be32753b7ab96a90d57fc07991ae8a154177.tar.gz |
Track the usb device state as its powered on, addressed and configured. This helps
to avoid touching the device when it is not going to respond and would otherwise
timeout.
Implement the suspend tracking as a udev state too.
Diffstat (limited to 'sys/dev/usb/usb_device.h')
-rw-r--r-- | sys/dev/usb/usb_device.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/usb/usb_device.h b/sys/dev/usb/usb_device.h index 437bf8a..e16127a 100644 --- a/sys/dev/usb/usb_device.h +++ b/sys/dev/usb/usb_device.h @@ -85,7 +85,6 @@ struct usb2_interface { struct usb2_device_flags { uint8_t usb2_mode:1; /* USB mode (see USB_MODE_XXX) */ uint8_t self_powered:1; /* set if USB device is self powered */ - uint8_t suspended:1; /* set if USB device is suspended */ uint8_t no_strings:1; /* set if USB device does not support * strings */ uint8_t remote_wakeup:1; /* set if remote wakeup is enabled */ @@ -101,7 +100,6 @@ struct usb2_power_save { usb2_size_t type_refs[4]; /* transfer reference count */ usb2_size_t read_refs; /* data read references */ usb2_size_t write_refs; /* data write references */ - uint8_t suspended; /* set if USB device is suspended */ }; /* @@ -139,6 +137,7 @@ struct usb2_device { #endif usb2_ticks_t plugtime; /* copy of "ticks" */ + enum usb_dev_state state; uint16_t refcount; #define USB_DEV_REF_MAX 0xffff @@ -205,5 +204,7 @@ void *usb2_find_descriptor(struct usb2_device *udev, void *id, void usb_linux_free_device(struct usb_device *dev); uint8_t usb2_peer_can_wakeup(struct usb2_device *udev); struct usb2_pipe *usb2_pipe_foreach(struct usb2_device *udev, struct usb2_pipe *pipe); +void usb2_set_device_state(struct usb2_device *udev, + enum usb_dev_state state); #endif /* _USB2_DEVICE_H_ */ |