Re: [PATCH v3 1/3] docs-rst: usb: update old usbfs-related documentation

2017-04-18 Thread Greg Kroah-Hartman
On Sun, Apr 16, 2017 at 01:40:03PM -0300, Mauro Carvalho Chehab wrote:
> There's no usbfs anymore. The old features are now either
> exported to /dev/bus/usb or via debugfs.
> 
> Update documentation accordingly, pointing to the new
> places where the character devices and usb/devices are
> now placed.
> 
> Signed-off-by: Mauro Carvalho Chehab 

Acked-by: Greg Kroah-Hartman 
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 1/3] docs-rst: usb: update old usbfs-related documentation

2017-04-16 Thread Mauro Carvalho Chehab
There's no usbfs anymore. The old features are now either
exported to /dev/bus/usb or via debugfs.

Update documentation accordingly, pointing to the new
places where the character devices and usb/devices are
now placed.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/driver-api/usb/usb.rst  | 180 --
 Documentation/networking/cdc_mbim.txt |   2 +-
 Documentation/usb/acm.txt |   2 +-
 Documentation/usb/gadget_serial.txt   |   4 +-
 Documentation/usb/proc_usb_info.txt   |  20 ++--
 5 files changed, 74 insertions(+), 134 deletions(-)

diff --git a/Documentation/driver-api/usb/usb.rst 
b/Documentation/driver-api/usb/usb.rst
index 6824089ef4c8..a98f78c91ab6 100644
--- a/Documentation/driver-api/usb/usb.rst
+++ b/Documentation/driver-api/usb/usb.rst
@@ -111,7 +111,8 @@ USB-Standard Types
 
 In  you will find the USB data types defined in
 chapter 9 of the USB specification. These data types are used throughout
-USB, and in APIs including this host side API, gadget APIs, and usbfs.
+USB, and in APIs including this host side API, gadget APIs, usb character
+devices and debugfs interfaces.
 
 .. kernel-doc:: include/linux/usb/ch9.h
:internal:
@@ -204,40 +205,32 @@ significantly reduce hcd-specific behaviors.
 .. kernel-doc:: drivers/usb/core/buffer.c
:internal:
 
-The USB Filesystem (usbfs)
-==
+The USB character device nodes
+==
 
-This chapter presents the Linux *usbfs*. You may prefer to avoid writing
-new kernel code for your USB driver; that's the problem that usbfs set
-out to solve. User mode device drivers are usually packaged as
-applications or libraries, and may use usbfs through some programming
-library that wraps it. Such libraries include
+This chapter presents the Linux character device nodes. You may prefer
+to avoid writing new kernel code for your USB driver. User mode device
+drivers are usually packaged as applications or libraries, and may use
+character devices through some programming library that wraps it.
+Such libraries include
 `libusb `__ for C/C++, and
 `jUSB `__ for Java.
 
 .. note::
 
-This particular documentation is incomplete, especially with respect
-to the asynchronous mode. As of kernel 2.5.66 the code and this
-(new) documentation need to be cross-reviewed.
+  - They were used to be implemented via *usbfs*, but this is not part of
+the sysfs debug interface.
 
-Configure usbfs into Linux kernels by enabling the *USB filesystem*
-option (CONFIG_USB_DEVICEFS), and you get basic support for user mode
-USB device drivers. Until relatively recently it was often (confusingly)
-called *usbdevfs* although it wasn't solving what *devfs* was. Every USB
-device will appear in usbfs, regardless of whether or not it has a
-kernel driver.
+   - This particular documentation is incomplete, especially with respect
+ to the asynchronous mode. As of kernel 2.5.66 the code and this
+ (new) documentation need to be cross-reviewed.
 
-What files are in "usbfs"?
---
+What files are in "devtmpfs"?
+-
 
-Conventionally mounted at ``/proc/bus/usb``, usbfs features include:
+Conventionally mounted at ``/dev/bus/usb/``, usbfs features include:
 
--  ``/proc/bus/usb/devices`` ... a text file showing each of the USB
-   devices on known to the kernel, and their configuration descriptors.
-   You can also poll() this to learn about new devices.
-
--  ``/proc/bus/usb/BBB/DDD`` ... magic files exposing the each device's
+-  ``/dev/bus/usb//BBB/DDD`` ... magic files exposing the each device's
configuration descriptors, and supporting a series of ioctls for
making device requests, including I/O to devices. (Purely for access
by programs.)
@@ -252,100 +245,7 @@ them. HID and networking devices expose these stable IDs, 
so that for
 example you can be sure that you told the right UPS to power down its
 second server. "usbfs" doesn't (yet) expose those IDs.
 
-Mounting and Access Control

-
-There are a number of mount options for usbfs, which will be of most
-interest to you if you need to override the default access control
-policy. That policy is that only root may read or write device files
-(``/proc/bus/BBB/DDD``) although anyone may read the ``devices`` or
-``drivers`` files. I/O requests to the device also need the
-CAP_SYS_RAWIO capability,
-
-The significance of that is that by default, all user mode device
-drivers need super-user privileges. You can change modes or ownership in
-a driver setup when the device hotplugs, or maye just start the driver
-right then, as a privileged server (or some activity within one). That's
-the most secure approach for multi-user systems, but for single user
-systems ("trusted" by that user) it's more convenient just to grant
-everyone all access (using