From owner-svn-src-all@FreeBSD.ORG Tue Aug 5 18:35:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C8E94EAF for ; Tue, 5 Aug 2014 18:35:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F84924DE for ; Tue, 5 Aug 2014 18:35:34 +0000 (UTC) Received: from hselasky (uid 1241) (envelope-from hselasky@FreeBSD.org) id 59cd by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 05 Aug 2014 18:35:34 +0000 From: Hans Petter Selasky Date: Tue, 5 Aug 2014 18:35:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269602 - head/sys/dev/usb/gadget X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e123f6.59cd.1ec0630f@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 18:35:34 -0000 Author: hselasky Date: Tue Aug 5 18:35:34 2014 New Revision: 269602 URL: http://svnweb.freebsd.org/changeset/base/269602 Log: Add handler for read-back of USB audio volume levels. Modified: head/sys/dev/usb/gadget/g_audio.c Modified: head/sys/dev/usb/gadget/g_audio.c ============================================================================== --- head/sys/dev/usb/gadget/g_audio.c Tue Aug 5 18:19:51 2014 (r269601) +++ head/sys/dev/usb/gadget/g_audio.c Tue Aug 5 18:35:34 2014 (r269602) @@ -587,6 +587,16 @@ g_audio_handle_request(device_t dev, *plen = 0; } return (0); + } else if ((req->bmRequestType == UT_READ_CLASS_INTERFACE) && + (req->bRequest == 0x81 /* get value */ )) { + + if (offset == 0) { + *plen = sizeof(sc->sc_volume_setting); + *pptr = &sc->sc_volume_setting; + } else { + *plen = 0; + } + return (0); } else if ((req->bmRequestType == UT_WRITE_CLASS_INTERFACE) && (req->bRequest == 0x01 /* set value */ )) {