Date: Mon, 24 Dec 2007 22:29:05 GMT From: Hans Petter Selasky <hselasky@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 131548 for review Message-ID: <200712242229.lBOMT5pn037976@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=131548 Change 131548 by hselasky@hselasky_laptop001 on 2007/12/24 22:28:58 Lock "bus->mtx" before calling "set_config" method. Affected files ... .. //depot/projects/usb/src/sys/dev/usb/usb_requests.c#15 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb/usb_requests.c#15 (text+ko) ==== @@ -652,16 +652,17 @@ PRINTF(("setting config %d\n", conf)); - /* If we have a "set_config" method then call it */ + /* call "set_config" method, if any */ if (udev->bus->methods->set_config) { + mtx_lock(&(udev->bus->mtx)); (udev->bus->methods->set_config) (udev, (conf == USB_UNCONFIG_NO) ? NULL : udev->cdesc); + mtx_unlock(&(udev->bus->mtx)); } - if (udev->flags.usb_mode == USB_MODE_DEVICE) { - return (0); /* success */ - } + /* do "set configuration" request */ + req.bmRequestType = UT_WRITE_DEVICE; req.bRequest = UR_SET_CONFIG; req.wValue[0] = conf;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200712242229.lBOMT5pn037976>