From owner-svn-src-stable-8@FreeBSD.ORG Mon May 17 23:59:15 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3472F1065676; Mon, 17 May 2010 23:59:15 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 234468FC13; Mon, 17 May 2010 23:59:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4HNxFvv078377; Mon, 17 May 2010 23:59:15 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4HNxFDi078375; Mon, 17 May 2010 23:59:15 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201005172359.o4HNxFDi078375@svn.freebsd.org> From: Andrew Thompson Date: Mon, 17 May 2010 23:59:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208237 - stable/8/lib/libusb X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 May 2010 23:59:15 -0000 Author: thompsa Date: Mon May 17 23:59:14 2010 New Revision: 208237 URL: http://svn.freebsd.org/changeset/base/208237 Log: MFC r203773 Within libusb 0.1 API, bus number is always faked to 0. Device numbers, however, are possitive and seem to be reverse sorted in the list. Conform device numbering and bring a result that is consistent with the libusb 0.1 API. It is now possible to distinguish a device based on its (bus, dev) numbers. Modified: stable/8/lib/libusb/libusb20_compat01.c Directory Properties: stable/8/lib/libusb/ (props changed) stable/8/lib/libusb/usb.h (props changed) Modified: stable/8/lib/libusb/libusb20_compat01.c ============================================================================== --- stable/8/lib/libusb/libusb20_compat01.c Mon May 17 23:57:34 2010 (r208236) +++ stable/8/lib/libusb/libusb20_compat01.c Mon May 17 23:59:14 2010 (r208237) @@ -829,6 +829,7 @@ usb_find_devices(void) struct libusb20_device *pdev; struct usb_device *udev; struct LIBUSB20_DEVICE_DESC_DECODED *ddesc; + int devnum; int err; /* cleanup after last device search */ @@ -855,6 +856,7 @@ usb_find_devices(void) } /* iterate all devices */ + devnum = 1; pdev = NULL; while ((pdev = libusb20_be_device_foreach(usb_backend, pdev))) { udev = malloc(sizeof(*udev)); @@ -891,6 +893,7 @@ usb_find_devices(void) /* truncate number of configurations */ udev->descriptor.bNumConfigurations = USB_MAXCONFIG; } + udev->devnum = devnum++; /* link together the two structures */ udev->dev = pdev; pdev->privLuData = udev;