Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4464391ybi; Tue, 11 Jun 2019 07:07:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqwp59pbojborVW1mM4ePW2kWmjLTLZuClTgBJ0mTsJHIi8g1zsyJt2O37ZydQw53ACQF3FH X-Received: by 2002:a17:90a:af8a:: with SMTP id w10mr27587338pjq.132.1560262031004; Tue, 11 Jun 2019 07:07:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560262030; cv=none; d=google.com; s=arc-20160816; b=a4frcCgH7IuvLLzMU20g+RIiO9H22H8R3ZUebiTezIPucdUdhPArHwCMO4xb82Mq/+ SAMpsbcMuvKIFpGbNX3lxa6B/fhQql8+bGdTzAjX48izeOdk6NuEba+dz9Efr2nkIbyf JZiWAlsf07UTd5WnvFq8KRqOTYK/Twn863GoTWDqxiUed6kfuCc64ue9k2iIjgSWZVBu Ui2DZYA7/psjDTCSuFVJmuW5fd2D02eyTrVjP5FyDHA+goRw/HBYnrsLF+XbXZCDezGQ ErJy+sXRJc4inYBtzF2c24B/JOKo/s5DfsG3CMAkvKfMDAogD2tMvBSBkjDMYK7U4eg2 lNAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:in-reply-to :subject:cc:to:from:date; bh=Z8JdK/4vqgC3cAGhYUeg/8YAPSraw6wNCD/nb+mpbH4=; b=iQNa77zO2kZjshr3VNGsXaoLIJrJaHeT81qNNPUMSVbbccOhFavAsA+H3F7a574CyC b4mq+VC6ciw16b+8FqtjFAXcKSeoOthbubPtWIDXNNK7LN3WfHmqm65oeVslLZ6N0Yal IJ0CkXm48a6W3HXYHuJ7Huv2FCHHvsZtM29NtfiaXGdGk+lVYjA867x5e+aY1zMSv8g2 0fZf3Hr/2NnxTohuah7ntplvHBwUqOnM75NGKRpTEGYcFjRpirm2Z5lqdrFluOuuIlVn /1O/kLxcSHmTKaM4gODSITTSWwT0yiZD1T2VjBDt2RfdhJQEwvkcepLxFSsX59zlgAce 53gw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o3si11949149pgp.146.2019.06.11.07.06.54; Tue, 11 Jun 2019 07:07:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391320AbfFKNum (ORCPT + 99 others); Tue, 11 Jun 2019 09:50:42 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:35662 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S2387866AbfFKNul (ORCPT ); Tue, 11 Jun 2019 09:50:41 -0400 Received: (qmail 1721 invoked by uid 2102); 11 Jun 2019 09:50:40 -0400 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 11 Jun 2019 09:50:40 -0400 Date: Tue, 11 Jun 2019 09:50:40 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Dmitry Torokhov cc: Greg Kroah-Hartman , , , , Subject: Re: [PATCH] USB: add usbfs ioctl to retrieve the connection parameters In-Reply-To: <20190610223658.GA162167@dtor-ws> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 10 Jun 2019, Dmitry Torokhov wrote: > Recently usfbs gained availability to retrieve device speed, but there > is sill no way to determine the bus number or list of ports the device > is connected to when using usbfs. While this information can be obtained > from sysfs, not all environments allow sysfs access. In a jailed > environment a program might be simply given an opened file descriptor to > usbfs device, and it is really important that all data can be gathered > from said file descriptor. > > This patch introduces a new ioctl, USBDEVFS_CONNINFO_EX, which return > extended connection information for the device, including the bus > number, address, port list and speed. The API allows kernel to extend > amount of data returned by the ioctl and userspace has an option of > adjusting the amount of data it is willing to consume. A new capability, > USBDEVFS_CAP_CONNINFO_EX, is introduced to help userspace in determining > whether the kernel supports this new ioctl. > > Signed-off-by: Dmitry Torokhov Acked-by: Alan Stern