diff options
author | Marcus Glocker <mglocker@cvs.openbsd.org> | 2008-07-18 21:45:25 +0000 |
---|---|---|
committer | Marcus Glocker <mglocker@cvs.openbsd.org> | 2008-07-18 21:45:25 +0000 |
commit | 7a8547460d6ec0032756d95ce977920f2a86a675 (patch) | |
tree | 91994978d127ee7209888dd6a59e24af46151c42 | |
parent | cfa10c83301a5f76be1340aeddc6a3512a6dd184 (diff) |
For negotation first get the devices default values (GET_DEF) instead
asking for (GET_CUR) directly. This gets us better negotation values.
-rw-r--r-- | sys/dev/usb/uvideo.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/dev/usb/uvideo.c b/sys/dev/usb/uvideo.c index 85a253c209c..d464fc92161 100644 --- a/sys/dev/usb/uvideo.c +++ b/sys/dev/usb/uvideo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvideo.c,v 1.54 2008/07/18 18:49:11 mglocker Exp $ */ +/* $OpenBSD: uvideo.c,v 1.55 2008/07/18 21:45:24 mglocker Exp $ */ /* * Copyright (c) 2008 Robert Nagy <robert@openbsd.org> @@ -91,7 +91,7 @@ int uvideo_desc_len(const usb_descriptor_t *, int, int, int, int); usbd_status uvideo_vs_negotation(struct uvideo_softc *, int); usbd_status uvideo_vs_set_probe(struct uvideo_softc *, uint8_t *); -usbd_status uvideo_vs_get_probe(struct uvideo_softc *, uint8_t *); +usbd_status uvideo_vs_get_probe(struct uvideo_softc *, uint8_t *, uint8_t); usbd_status uvideo_vs_set_commit(struct uvideo_softc *, uint8_t *); usbd_status uvideo_vs_alloc_sample(struct uvideo_softc *); void uvideo_vs_free_sample(struct uvideo_softc *); @@ -943,7 +943,7 @@ uvideo_vs_negotation(struct uvideo_softc *sc, int commit) /* get probe */ bzero(probe_data, sizeof(probe_data)); - error = uvideo_vs_get_probe(sc, probe_data); + error = uvideo_vs_get_probe(sc, probe_data, GET_DEF); if (error != USBD_NORMAL_COMPLETION) return (error); @@ -960,7 +960,7 @@ uvideo_vs_negotation(struct uvideo_softc *sc, int commit) /* get probe */ bzero(probe_data, sizeof(probe_data)); - error = uvideo_vs_get_probe(sc, probe_data); + error = uvideo_vs_get_probe(sc, probe_data, GET_CUR); if (error != USBD_NORMAL_COMPLETION) return (error); @@ -1021,7 +1021,8 @@ uvideo_vs_set_probe(struct uvideo_softc *sc, uint8_t *probe_data) } usbd_status -uvideo_vs_get_probe(struct uvideo_softc *sc, uint8_t *probe_data) +uvideo_vs_get_probe(struct uvideo_softc *sc, uint8_t *probe_data, + uint8_t request) { usb_device_request_t req; usbd_status err; @@ -1029,7 +1030,7 @@ uvideo_vs_get_probe(struct uvideo_softc *sc, uint8_t *probe_data) struct usb_video_probe_commit *pc; req.bmRequestType = UVIDEO_GET_IF; - req.bRequest = GET_CUR; + req.bRequest = request; tmp = VS_PROBE_CONTROL; tmp = tmp << 8; USETW(req.wValue, tmp); |