From patchwork Wed Sep 12 08:50:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guido Kiener X-Patchwork-Id: 10596935 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9434413B8 for ; Wed, 12 Sep 2018 07:59:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8805C297E2 for ; Wed, 12 Sep 2018 07:59:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7B13F297E8; Wed, 12 Sep 2018 07:59:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 00A38297E2 for ; Wed, 12 Sep 2018 07:59:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727417AbeILNC6 (ORCPT ); Wed, 12 Sep 2018 09:02:58 -0400 Received: from mr02.mx01.tldhost.de ([62.108.41.231]:54686 "EHLO mr02.mx01.tldhost.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726358AbeILNC6 (ORCPT ); Wed, 12 Sep 2018 09:02:58 -0400 X-Greylist: delayed 303 seconds by postgrey-1.27 at vger.kernel.org; Wed, 12 Sep 2018 09:02:57 EDT Received: from mx01.tldhost.de (localhost [127.0.0.1]) by mx01.tldhost.de (Postfix) with ESMTP id 572CF120EED for ; Wed, 12 Sep 2018 09:54:34 +0200 (CEST) Received: by mx01.tldhost.de (Postfix, from userid 1001) id 357EB120F11; Wed, 12 Sep 2018 09:54:34 +0200 (CEST) Received: from server12.tldhost.de (server12.tldhost.de [84.19.26.112]) by mx01.tldhost.de (Postfix) with ESMTPS id 1DD1E120EED; Wed, 12 Sep 2018 09:54:32 +0200 (CEST) From: Guido Kiener To: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, guido.kiener@rohde-schwarz.com, pankaj.adhikari@ni.com, steve_bayless@keysight.com, dpenkler@gmail.com Cc: Guido Kiener Subject: [PATCH v6 00/22] usb: usbtmc: Changes needed for compatible IVI/VISA library Date: Wed, 12 Sep 2018 10:50:50 +0200 Message-Id: <20180912085112.4891-1-guido@kiener-muenchen.de> X-PPP-Message-ID: <20180912075432.4576.96906@server12.tldhost.de> X-PPP-Vhost: kiener-muenchen.de X-POWERED-BY: TLDHost.de - AV:CLEAN SPAM:OK Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The working group "VISA for Linux" of the IVI Foundation www.ivifoundation.org specifies common rules, shared libraries and drivers to implement the specification of "VPP-4.3: The VISA Library" on Linux to be compatible with implementations on other operating systems. The USBTMC protocol is part of the "VISA Library" that is used by many popular T&M applications. Initial implementations for Linux based on libusb has been created. However using one common USBTMC driver results in more benefits: - Multiple applications can share access to the same instruments. - The driver handles SRQ conflicts. - Simplifies definition of udev rules for USBTMC devices. - Simplifies development of applications using T&M instruments. The following collaborative patches meet the requirements of the IVI Foundation to implement the library based on the usbtmc driver. Improvements in the data transfer rate of over 130 MByte/s for usb 3.x connections have been measured. V6: Using void __user* pointer again and drop 32 bit compatibility for the following 3 iotcls: USBTMC_IOCTL_CTRL_REQUEST USBTMC_IOCTL_WRITE, USBTMC_IOCTL_READ to simplify kernel driver and user applications. Note that supporting 32 bit applications running on 64 bit target systems are not in the focus of the IVI Foundation. However all other convenient ioctls of the USBTMC driver can still be used in 32 bit applications as well. Note that 32 bit applications running on 32 bit target systems are not affected by this limitation. V5: Added this version history. No change to patches. V4: Removed redundant #ifdef CONFIG_COMPAT. V3: Replaced data pointer of type void* in structs usbtmc_ctrlrequest and usbtmc_message with data pointer of type __u64 to avoid double implementation of ioctls with different structure sizes for 32 and 64 bit applications. Following patch is added to usb-next branch: usb: usbtmc: Add support for 32 bit compat applications V2: Split patch series into smaller patches. Add compatible ioctls and structs to support 32 bit applications. Incorporates feedback from reviewers. Following patches are added to usb-next branch: usb: usbtmc: Add ioctl for termination character usb: usbtmc: Add ioctl for EOM bit usb: usbtmc: Add ioctl for trigger usb: usbtmc: Add ioctls to set/get usb timeout usb: usbtmc: use consistent timeout error usb: usbtmc: Support Read Status Byte with SRQ per file V1: usb: usbtmc: Remove rigol_quirk (accepted) https://patchwork.kernel.org/patch/10407097/ Guido Kiener, Dave Penkler, Steve Bayless (22): usb: usbtmc: Add ioctl for generic requests on control usb: usbtmc: Add ioctl for vendor specific write usb: usbtmc: Add ioctl USBTMC_IOCTL_WRITE_RESULT usb: usbtmc: Add ioctl for vendor specific read usb: usbtmc: Add ioctl USBTMC_IOCTL_CANCEL_IO usb: usbtmc: Add ioctl USBTMC_IOCTL_CLEANUP_IO usb: usbtmc: Fix suspend/resume usb: usbtmc: Add ioctl USBTMC488_IOCTL_WAIT_SRQ usb: usbtmc: add ioctl USBTMC_IOCTL_MSG_IN_ATTR usb: usbtmc: Add ioctl USBTMC_IOCTL_AUTO_ABORT usb: usbtmc: Optimize usbtmc_write usb: usbtmc: Optimize usbtmc_read usb: usbtmc: Fix ioctl USBTMC_IOCTL_CLEAR usb: usbtmc: Fix ioctl USBTMC_IOCTL_ABORT_BULK_IN usb: usbtmc: Fix ioctl USBTMC_IOCTL_ABORT_BULK_OUT usb: usbtmc: Replace USBTMC_TIMEOUT macros for control messages usb: usbtmc: Add ioctl USBTMC_IOCTL_API_VERSION usb: usbtmc: Update ioctl-number.txt usb: usbtmc: Remove redundant code usb: usbtmc: Remove redundant macro USBTMC_SIZE_IOBUFFER usb: usbtmc: Fix split quoted string in debug message usb: usbtmc: Remove sysfs group TermChar and auto_abort .../ABI/stable/sysfs-driver-usb-usbtmc | 35 - Documentation/ioctl/ioctl-number.txt | 2 +- drivers/usb/class/usbtmc.c | 1644 +++++++++++++---- include/uapi/linux/usb/tmc.h | 41 + 4 files changed, 1283 insertions(+), 439 deletions(-)