Re: [PATCH v2 1/3] usb: gadget: net2280: Fix overrun of OUT messages

2019-03-18 Thread guido
Zitat von Alan Stern : On Mon, 18 Mar 2019, Guido Kiener wrote: The OUT endpoint normally blocks (NAK) subsequent packets when a short packet was received and returns an incomplete queue entry to the gadget driver. Thereby the gadget driver can detect a short packet when reading queue

Re: [PATCH v2 1/3] usb: gadget: net2280: Fix overrun of OUT messages

2019-03-19 Thread guido
the conditions are met. This ensures that all received data is delivered to the gadget driver, which can detect a short packet now before new packets are appended to the last short packet. Thank you. Sounds good. Guido

Re: [PATCH v2 3/3] usb: gadget: net2272: Fix net2272_dequeue()

2019-03-19 Thread guido
Zitat von Guido Kiener : Restore the status of ep->stopped in function net2272_dequeue(). When the given request is not found in the endpoint queue the function returns -EINVAL without restoring the state of ep->stopped. Thus the endpoint keeps blocked and does not transfer any data a

Re: [PATCH 02/12] usb: usbtmc: Support Read Status Byte with SRQ per file handle

2018-05-18 Thread guido
Zitat von Greg KH : On Thu, May 17, 2018 at 07:03:26PM +0200, Guido Kiener wrote: - Add 'struct usbtmc_file_data' for each file handle to cache last srq_byte (=Status Byte with SRQ) received by usbtmc_interrupt(..) - usbtmc488_ioctl_read_stb returns cached srq_byte when ava

Re: [PATCH 00/12] usb: usbtmc: Changes needed for compatible IVI/VISA library

2018-05-18 Thread guido
Zitat von Greg KH : On Thu, May 17, 2018 at 07:03:24PM +0200, Guido Kiener wrote: 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&

Re: [PATCH 04/12] usb: usbtmc: Add ioctls for trigger, EOM bit and TermChar

2018-05-18 Thread guido
Zitat von Greg KH : On Thu, May 17, 2018 at 07:03:28PM +0200, Guido Kiener wrote: - add USBTMC488_IOCTL_TRIGGER to send TRIGGER Bulk-OUT header according to Subclass USB488 Specification The usbtmc trigger command is equivalent to the IEEE 488 GET (Group Execute Trigger) action. While

Re: [PATCH 02/12] usb: usbtmc: Support Read Status Byte with SRQ per file handle

2018-05-18 Thread guido
Zitat von Greg KH : On Fri, May 18, 2018 at 11:52:36AM +, gu...@kiener-muenchen.de wrote: Zitat von Greg KH : > On Thu, May 17, 2018 at 07:03:26PM +0200, Guido Kiener wrote: > > - Add 'struct usbtmc_file_data' for each file handle to cache last > > srq_by

Re: [PATCH 05/12] usb: usbtmc: Add ioctl for generic requests on control pipe

2018-05-18 Thread guido
Zitat von Greg KH : On Thu, May 17, 2018 at 07:03:29PM +0200, Guido Kiener wrote: Add USBTMC_IOCTL_CTRL_REQUEST to send arbitrary requests on the control pipe. Used by specific applications of IVI Foundation, Inc. to implement VISA API functions: viUsbControlIn/Out. Signed-off-by: Guido

Re: [PATCH 06/12] usb: usbtmc: Add vendor specific/asynchronous read/write ioctls

2018-05-18 Thread guido
Zitat von Greg KH : On Thu, May 17, 2018 at 07:03:30PM +0200, Guido Kiener wrote: - ioctl USBTMC_IOCTL_WRITE sends an (a)synchronous generic message to bulk OUT. The message is split into chunks of 4k (page size). Message size is aligned to 32 bit boundaries. With flag

Re: [PATCH 06/12] usb: usbtmc: Add vendor specific/asynchronous read/write ioctls

2018-05-18 Thread guido
Zitat von Greg KH : On Thu, May 17, 2018 at 07:03:30PM +0200, Guido Kiener wrote: +/* + * usbtmc_message->flags: + */ +#define USBTMC_FLAG_ASYNC 0x0001 +#define USBTMC_FLAG_APPEND 0x0002 +#define USBTMC_FLAG_IGNORE_TRAILER 0x0004 + +struct usbtmc_mess

Re: [PATCH 03/12] usb: usbtmc: Add ioctls to set/get usb timeout

2018-05-18 Thread guido
Zitat von Greg KH : On Thu, May 17, 2018 at 07:03:27PM +0200, Guido Kiener wrote: Add ioctls USBTMC_IOCTL_GET_TIMEOUT / USBTMC_IOCTL_SET_TIMEOUT to get/set I/O timeout for specific file handle. Different operations on an instrument can take different lengths of time thus it is important to

Re: [PATCH 07/12] usb: usbtmc: Add ioctl USBTMC488_IOCTL_WAIT_SRQ

2018-05-18 Thread guido
Zitat von Greg KH : On Thu, May 17, 2018 at 07:03:31PM +0200, Guido Kiener wrote: @@ -2420,8 +2476,8 @@ static int usbtmc_probe(struct usb_interface *intf, retcode = usb_register_dev(intf, &usbtmc_class); if (retcode) { - dev_err(&intf->dev, "N

Re: [PATCH 06/12] usb: usbtmc: Add vendor specific/asynchronous read/write ioctls

2018-05-18 Thread guido
Zitat von Greg KH : On Fri, May 18, 2018 at 02:48:11PM +, gu...@kiener-muenchen.de wrote: Zitat von Greg KH : > On Thu, May 17, 2018 at 07:03:30PM +0200, Guido Kiener wrote: > > +/* > > + * usbtmc_message->flags: > > + */ > > +#define USBTMC_FLAG_ASYNC

Re: [PATCH 07/12] usb: usbtmc: Add ioctl USBTMC488_IOCTL_WAIT_SRQ

2018-05-18 Thread guido
Zitat von Greg KH : On Fri, May 18, 2018 at 03:02:10PM +, gu...@kiener-muenchen.de wrote: Zitat von Greg KH : > On Thu, May 17, 2018 at 07:03:31PM +0200, Guido Kiener wrote: > > @@ -2420,8 +2476,8 @@ static int usbtmc_probe(struct usb_interface *intf, > > &g

Re: [PATCH 03/12] usb: usbtmc: Add ioctls to set/get usb timeout

2018-05-18 Thread guido
Zitat von Andy Shevchenko : On Thu, May 17, 2018 at 8:03 PM, Guido Kiener wrote: Add ioctls USBTMC_IOCTL_GET_TIMEOUT / USBTMC_IOCTL_SET_TIMEOUT to get/set I/O timeout for specific file handle. +static int usbtmc_ioctl_get_timeout(struct usbtmc_file_data *file_data

Re: [PATCH 06/12] usb: usbtmc: Add vendor specific/asynchronous read/write ioctls

2018-05-21 Thread guido
Zitat von Greg KH : On Fri, May 18, 2018 at 02:48:11PM +, gu...@kiener-muenchen.de wrote: Zitat von Greg KH : > On Thu, May 17, 2018 at 07:03:30PM +0200, Guido Kiener wrote: > > +/* > > + * usbtmc_message->flags: > > + */ > > +#define USBTMC_FLAG_ASYNC

Re: [PATCH 02/12] usb: usbtmc: Support Read Status Byte with SRQ per file handle

2018-05-21 Thread guido
Zitat von Greg KH : @@ -122,7 +141,7 @@ static int usbtmc_open(struct inode *inode, struct file *filp) { struct usb_interface *intf; struct usbtmc_device_data *data; - int retval = 0; + struct usbtmc_file_data *file_data; intf = usb_find_interface(&usbtmc

Re: [PATCH 05/12] usb: usbtmc: Add ioctl for generic requests on control pipe

2018-05-21 Thread guido
Zitat von Greg KH : On Fri, May 18, 2018 at 01:32:51PM +, gu...@kiener-muenchen.de wrote: Zitat von Greg KH : > On Thu, May 17, 2018 at 07:03:29PM +0200, Guido Kiener wrote: > > Add USBTMC_IOCTL_CTRL_REQUEST to send arbitrary requests on the > > control pipe. U

Re: [PATCH 06/12] usb: usbtmc: Add vendor specific/asynchronous read/write ioctls

2018-05-22 Thread guido
Zitat von Greg KH : On Mon, May 21, 2018 at 08:41:22PM +, gu...@kiener-muenchen.de wrote: Zitat von Greg KH : > On Fri, May 18, 2018 at 02:48:11PM +, gu...@kiener-muenchen.de wrote: > > > > Zitat von Greg KH : > > > > > On Thu, May 17, 2018 at 07:03:

Re: [PATCH 02/12] usb: usbtmc: Support Read Status Byte with SRQ per file handle

2018-05-24 Thread guido
Zitat von Oliver Neukum : Am Montag, den 21.05.2018, 21:00 + schrieb guido@kiener- muenchen.de: I looked for a race here, but I do not find a race between open and release, since a refcount of "file_data->data->kref" is always hold by usbtmc_probe/disconnect. Howe

Re: [PATCH 04/12] usb: usbtmc: Add ioctls for trigger, EOM bit and TermChar

2018-05-24 Thread guido
Zitat von Oliver Neukum : Am Donnerstag, den 17.05.2018, 19:03 +0200 schrieb Guido Kiener: +   retval = usb_bulk_msg(data->usb_dev, + usb_sndbulkpipe(data->usb_dev, + data->

Re: [PATCH 07/12] usb: usbtmc: Add ioctl USBTMC488_IOCTL_WAIT_SRQ

2018-05-24 Thread guido
Zitat von Oliver Neukum : Am Donnerstag, den 17.05.2018, 19:03 +0200 schrieb Guido Kiener: +static int usbtmc488_ioctl_wait_srq(struct usbtmc_file_data *file_data, +   unsigned int __user *arg) +{ +   struct usbtmc_device_data *data = file_data->d

Re: [PATCH 07/12] usb: usbtmc: Add ioctl USBTMC488_IOCTL_WAIT_SRQ

2018-05-28 Thread guido
Zitat von Oliver Neukum : Am Donnerstag, den 24.05.2018, 12:59 + schrieb guido@kiener- muenchen.de: Zitat von Oliver Neukum : > Am Donnerstag, den 17.05.2018, 19:03 +0200 schrieb Guido Kiener: > > +static int usbtmc488_ioctl_wait_srq(struct usbtmc_file_data *

Re: [PATCH v2 08/29] usb: usbtmc: Add ioctl for generic requests on control

2018-07-21 Thread guido
Zitat von Greg KH : On Wed, Jul 18, 2018 at 10:45:41AM +0200, Guido Kiener wrote: Add USBTMC_IOCTL_CTRL_REQUEST to send arbitrary requests on the control pipe. Used by specific applications of IVI Foundation, Inc. to implement VISA API functions: viUsbControlIn/Out. The maximum length of

Re: [PATCH v2 08/29] usb: usbtmc: Add ioctl for generic requests on control

2018-07-23 Thread guido
Zitat von Greg KH : On Sat, Jul 21, 2018 at 11:11:55AM +, gu...@kiener-muenchen.de wrote: Zitat von Greg KH : > On Wed, Jul 18, 2018 at 10:45:41AM +0200, Guido Kiener wrote: > > Add USBTMC_IOCTL_CTRL_REQUEST to send arbitrary requests on the > > control pipe. U

Re: [PATCH v3 02/23] usb: usbtmc: Add ioctl for generic requests on control

2018-07-24 Thread guido
Zitat von Greg KH : On Tue, Jul 24, 2018 at 11:05:29AM +0200, Guido Kiener wrote: Add USBTMC_IOCTL_CTRL_REQUEST to send arbitrary requests on the control pipe. Used by specific applications of IVI Foundation, Inc. to implement VISA API functions: viUsbControlIn/Out. The maximum length of

Re: [PATCH v3 02/23] usb: usbtmc: Add ioctl for generic requests on control

2018-07-24 Thread guido
Zitat von Greg KH : On Tue, Jul 24, 2018 at 11:05:29AM +0200, Guido Kiener wrote: +struct usbtmc_ctrlrequest { + struct usbtmc_request req; + __u64 data; /* pointer to user space */ +} __attribute__ ((packed)); Hint, this structure could just be: struct

Re: [PATCH v4 00/22] usb: usbtmc: Changes needed for compatible IVI/VISA library

2018-07-30 Thread guido
Zitat von Greg KH : On Mon, Jul 30, 2018 at 10:04:30AM +0200, Guido Kiener wrote: 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&

Re: [PATCH v5 00/22] usb: usbtmc: Changes needed for compatible IVI/VISA library

2018-09-05 Thread guido
cover/10554819/ Regards, Guido

Re: fixes for ioctl() of usbtmc in testing tree

2018-09-24 Thread guido
I need to push out my testing branch now, 0-day seems to be stalled :( Big sorry! There is a superflous kmalloc line 1270 til 1272. Shall I send the fix? Regards Guido

Re: fixes for ioctl() of usbtmc in testing tree

2018-09-24 Thread guido
internal build system? And I still have to make an official fix, isn't it? Guido

Re: fixes for ioctl() of usbtmc in testing tree

2018-09-28 Thread guido
tem? And I still have to make an official fix, isn't it? Yes, you need to send a "real" patch for anyone to be able to pick it up. I sent the patch series: https://patchwork.kernel.org/cover/10612963/ Anything else I can do to relieve my bad conscience? Regards, Guido

Re: [PATCH] usb: usbtmc: check size before allocating buffer and remove duplicated allocation

2018-09-28 Thread guido
k. I have already sent a patch series here: https://patchwork.kernel.org/cover/10612963/ This includes a similar patch to your proposal: https://patchwork.kernel.org/patch/10612965/ Thank you! Regards, Guido

Re: [PATCH 2/3] udc: net2280: Fix overrun of OUT messages

2019-02-05 Thread guido
Zitat von Alan Stern : On Mon, 4 Feb 2019, Guido Kiener wrote: From: Guido Kiener The OUT endpoint normally blocks (NAK) subsequent packets when a short packet is received and returns an incomplete queue entry to the gadget driver. Thereby the gadget driver can detect a short packet when

Re: [PATCH 3/3] udc: net2280: Fix typo

2019-02-05 Thread guido
Zitat von Alan Stern : On Mon, 4 Feb 2019, Guido Kiener wrote: From: Guido Kiener Fix spelling of automatically. Signed-off-by: Guido Kiener --- drivers/usb/gadget/udc/net2280.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/udc/net2280.c b

Re: [PATCH 1/3] udc: net2280: Fix net2280_disable

2019-02-05 Thread guido
Zitat von Alan Stern : On Mon, 4 Feb 2019, Guido Kiener wrote: From: Guido Kiener A reset e.g. calling ep_reset_338x() can happen while endpoints are enabled. How can this happen? That routine is called from only two places. One is in net2280_disable(), so after the endpoint has

Re: [PATCH 2/3] udc: net2280: Fix overrun of OUT messages

2019-02-05 Thread guido
Zitat von Alan Stern : On Tue, 5 Feb 2019 gu...@kiener-muenchen.de wrote: Zitat von Alan Stern : > On Mon, 4 Feb 2019, Guido Kiener wrote: > >> From: Guido Kiener >> >> The OUT endpoint normally blocks (NAK) subsequent packets when a >> short packet is rece

Re: [PATCH 2/3] udc: net2280: Fix overrun of OUT messages

2019-02-06 Thread guido
Zitat von Alan Stern : On Tue, 5 Feb 2019 gu...@kiener-muenchen.de wrote: Zitat von Alan Stern : > On Mon, 4 Feb 2019, Guido Kiener wrote: > >> From: Guido Kiener >> >> The OUT endpoint normally blocks (NAK) subsequent packets when a >> short packet is rece

Re: [PATCH 2/3] udc: net2280: Fix overrun of OUT messages

2019-02-08 Thread guido
stop_out_naking(ep); } writel(BIT(DMA_START), &dma->dmastat); } start_queue() is only called by start_dma(). I see that we can simplify this patch when we just insert the stop_out_nacking(ep) between line 909 and 910: https://elixir.bootlin.com/linux/v5.0-rc5/source/drivers/usb/gadget/udc/net2280.c#L909 and remove the stop_out_naking() call in start_queue(). I will test this over weekend. Regards, Guido

usb: gadget: net2280: Fix function net2280_dequeue()

2019-02-19 Thread guido
s as expected, although the driver issues the false error message "Request mismatch". What do you think? It's labor-intensive to fix the error message here, or shall we leave it as it is, and only insert the "ep->stopped = stopped;" Regards, Guido

Re: usb: gadget: net2280: Fix function net2280_dequeue()

2019-02-27 Thread guido
910: https://elixir.bootlin.com/linux/v5.0-rc5/source/drivers/usb/gadget/udc/net2280.c#L909 and remove the stop_out_naking() call in start_queue()... I will add this improvement to the new patch sequence. Guido

Re: [PATCH 2/2] usb: gadget: net2280: Add workaround for AB chip Errata 11

2019-08-27 Thread guido
lregs->ll_lfps_timers_2); + writel((val & 0x) | LFPS_TIMERS_2_WORKAROUND_VALUE, + &dev->llregs->ll_lfps_timers_2); + /* * Set Recovery Idle to Recover bit: * - On SS connections, setting Recovery Idle to Recover Fmw improves I'm ok with your patch sequence. -Guido

Re: [PATCH 1/2] usb: gadget: net2280: Move all "ll" registers in one structure

2019-08-28 Thread guido
https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git/ branch usb-next. Please note that [PATCH 1/2] was sent twice. -Guido

[PATCH] usb: Wait before re-enabling a port that has been disabled due to EMI

2016-03-20 Thread Guido Trentalancia
] hub 6-0:1.0: unable to enumerate USB device on port 2 *** NOTE: Device is permanently disabled at this point *** I don't know whether my analysis is correct (and therefore the proposed solution appropriate), as reproducing the problem is very difficult... Regards, Guido Add an option t

Re: [PATCH] usb: Wait before re-enabling a port that has been disabled due to EMI

2016-03-20 Thread Guido Trentalancia
Hello Greg ! On dom, 2016-03-20 at 10:34 -0700, Greg KH wrote: > On Sun, Mar 20, 2016 at 06:09:57PM +0100, Guido Trentalancia wrote: > >  > > [ 1295.575679] usb 6-2: FTDI USB Serial Device converter now > > attached > > to ttyUSB1 > > [ 1302.204285] usb usb6-

Re: [PATCH] usb: Wait before re-enabling a port that has been disabled due to EMI

2016-03-21 Thread Guido Trentalancia
so that it correctly documents Documentation/kernel-parameters.txt. Regards, Guido  Il 21 marzo 2016 09:52:39 CET, Oliver Neukum ha scritto: >On Sun, 2016-03-20 at 18:09 +0100, Guido Trentalancia wrote: >> Hello. >> >> Considering that EM interference can last for a while (gen

Re: [PATCH] usb: Wait before re-enabling a port that has been disabled due to EMI

2016-03-21 Thread Guido Trentalancia
Hello Alan, thanks for getting back on this... Il 21 marzo 2016 16:01:17 CET, Alan Stern ha scritto: >On Sun, 20 Mar 2016, Guido Trentalancia wrote: > >> Hello. >> >> Considering that EM interference can last for a while (generally up >to >> seconds), I a

Re: [PATCH] usb: Wait before re-enabling a port that has been disabled due to EMI

2016-03-21 Thread Guido Trentalancia
study on typical duration of EMI inside buildings... In the meanwhile, I believe 1000 milliseconds (plus configurability) to be safe. Regards, Guido Il 21 marzo 2016 16:42:14 CET, Guido Trentalancia ha scritto: >Hello Alan, > >thanks for getting back on this... > >Il 21 marzo 20

[PATCH v2] usb: Wait before re-enabling a port that has been disabled due to EMI

2016-03-23 Thread Guido Trentalancia
Hello again. On lun, 2016-03-21 at 09:36 -0400, Greg KH wrote: > On Sun, Mar 20, 2016 at 06:57:30PM +0100, Guido Trentalancia wrote: > > > > Hello Greg ! > > > > On dom, 2016-03-20 at 10:34 -0700, Greg KH wrote: > > > > > > On Sun, Mar 20,

[PATCH v2 1/3] usb: gadget: net2280: Fix overrun of OUT messages

2019-03-18 Thread Guido Kiener
packet now before new packets overrun the last short packet. Signed-off-by: Guido Kiener --- drivers/usb/gadget/udc/net2280.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/usb/gadget/udc/net2280.c b/drivers/usb/gadget/udc/net2280.c index f63f82450bf4..e0b413e9e532

[PATCH v2 3/3] usb: gadget: net2272: Fix net2272_dequeue()

2019-03-18 Thread Guido Kiener
ompile-tested, since we do not have a corresponding hardware. An analogous fix was tested in the sibling driver. See "usb: gadget: net2280: Fix net2280_dequeue()" Signed-off-by: Guido Kiener --- drivers/usb/gadget/udc/net2272.c | 1 + 1 file changed, 1 insertion(+) diff --git a/driver

[PATCH v2 2/3] usb: gadget: net2280: Fix net2280_dequeue()

2019-03-18 Thread Guido Kiener
restoring the status ep->stopped. Thus the endpoint keeps blocked and does not receive any data anymore. This fix restores the status and does not issue an error message. Signed-off-by: Guido Kiener --- drivers/usb/gadget/udc/net2280.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --

[PATCH v3] usb: gadget: net2280: Fix overrun of OUT messages

2019-03-19 Thread Guido Kiener
ackets are appended to the last short packet. Signed-off-by: Guido Kiener --- drivers/usb/gadget/udc/net2280.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/usb/gadget/udc/net2280.c b/drivers/usb/gadget/udc/net2280.c index f63f82450bf4..e0b413e9e532 100644 --- a/d

JMicron JMS578 USB-to-SATA HDD enclosure not working

2019-05-17 Thread Guido Trentalancia
Hello. I am trying to use a Digitus DA-71114 USB-to-SATA HDD enclosure. Such unit is reported to use the JMicron JMS578 chipset by the same manufacturer, although it is listed with a different USB VID/PID: 0080:a001. Immediately after plugging in the USB cable, it reports I/O errors, even though

Re: JMicron JMS578 USB-to-SATA HDD enclosure not working

2019-05-18 Thread Guido Trentalancia
disabled or enabled, respectively ? If yes, how ? Thanks very much for your time ! Guido On Fri, 17/05/2019 at 21.32 +0200, Guido Trentalancia wrote: > Hello. > > I am trying to use a Digitus DA-71114 USB-to-SATA HDD enclosure. > > Such unit is reported to use the JMicron JMS578

Re: JMicron JMS578 USB-to-SATA HDD enclosure not working

2019-05-19 Thread Guido Trentalancia
matter of unlocking the drive in the BIOS before connecting it to the JMicron JMS578 enclosure. On Sat, 18/05/2019 at 14.31 +0200, Guido Trentalancia wrote: > Hello again. > > I have now upgraded the original HDD enclosure firmware (version > 46.01.00.01) with the latest available one f

usb: usbtmc: Proposal for new ioctl functions

2018-03-27 Thread Guido . Kiener
ou do not want to get more emails about this topic. -Guido -- 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

RE: usb: usbtmc: Proposal for new ioctl functions

2018-04-04 Thread Guido Kiener
/gather streams) ? Best regards, Guido -Original Message- From: Greg KH Sent: Wednesday, March 28, 2018 7:52 AM To: Kiener Guido 1DC3 Subject: Re: usb: usbtmc: Proposal for new ioctl functions On Tue, Mar 27, 2018 at 08:57:27PM +0200, guido.kie...@rohde-schwarz.com wrote: > Hi a

RE: Re: usb: usbtmc: Proposal for new ioctl functions

2018-04-05 Thread Guido Kiener
[gk] See below -Original Message- From: Greg KH Sent: Thursday, April 05, 2018 3:45 PM To: Kiener Guido Subject: Re: usb: usbtmc: Proposal for new ioctl functions On Wed, Apr 04, 2018 at 10:03:22PM +, Guido Kiener wrote: > Greg, > > Before sending patches we want to be s

RE: Re: usb: usbtmc: Proposal for new ioctl functions

2018-04-06 Thread Guido Kiener
Alan, Thank you for your clarification. Indeed I'm missing some details how USB bulk protocol works. I will discuss your comments with Keysight & NI, and I hope we may ask you the one or other question. Guido -Original Message- From: Alan Stern Sent: Friday, April 06, 2018 4

[PATCH 00/12] usb: usbtmc: Changes needed for compatible IVI/VISA library

2018-05-17 Thread Guido Kiener
the usbtmc driver 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. Guido Kiener, Dave Penkler, Steve Bayless (12):

[PATCH 02/12] usb: usbtmc: Support Read Status Byte with SRQ per file handle

2018-05-17 Thread Guido Kiener
ETIMEOUT instead of ETIME Tested-by: Dave Penkler Reviewed-by: Steve Bayless Signed-off-by: Guido Kiener --- drivers/usb/class/usbtmc.c | 176 - 1 file changed, 136 insertions(+), 40 deletions(-) diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/

[PATCH 05/12] usb: usbtmc: Add ioctl for generic requests on control pipe

2018-05-17 Thread Guido Kiener
Add USBTMC_IOCTL_CTRL_REQUEST to send arbitrary requests on the control pipe. Used by specific applications of IVI Foundation, Inc. to implement VISA API functions: viUsbControlIn/Out. Signed-off-by: Guido Kiener Reviewed-by: Steve Bayless --- drivers/usb/class/usbtmc.c | 61

[PATCH 04/12] usb: usbtmc: Add ioctls for trigger, EOM bit and TermChar

2018-05-17 Thread Guido Kiener
ld 'bmTransferAttributes' of REQUEST_DEV_DEP_MSG_IN BULK-OUT header. Allows enabling/disabling of terminating a read on reception of term_char individually for each read request. Reviewed-by: Steve Bayless Signed-off-by: Dave Penkler Signed-off-by: Guido Kiener

[PATCH 03/12] usb: usbtmc: Add ioctls to set/get usb timeout

2018-05-17 Thread Guido Kiener
to optimise the responsiveness of the application. As the instrument may be shared by multiple applications the timeout should be settable on a per file descriptor basis. Tested-by: Dave Penkler Reviewed-by: Steve Bayless Signed-off-by: Dave Penkler Signed-off-by: Guido Kiener --- drivers/usb

[PATCH 09/12] usb: usbtmc: Fix ioctl USBTMC_IOCTL_CLEAR

2018-05-17 Thread Guido Kiener
Insert a sleep of 50 ms between subsequent CHECK_CLEAR_STATUS control requests to avoid stressing the instrument with repeated requests. Some instruments need time to cleanup internal I/O buffers. Polling and repeated requests slow down the response time of devices. Signed-off-by: Guido Kiener

[PATCH 11/12] usb: usbtmc: Add ioctls to abort with specific tags

2018-05-17 Thread Guido Kiener
different or wrong tag ids. Signed-off-by: Guido Kiener Reviewed-by: Steve Bayless --- drivers/usb/class/usbtmc.c | 151 ++- include/uapi/linux/usb/tmc.h | 2 + 2 files changed, 81 insertions(+), 72 deletions(-) diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb

[PATCH 12/12] usb: usbtmc: Add ioctl to return API version of usbtmc driver

2018-05-17 Thread Guido Kiener
- add ioctl USBTMC_IOCTL_API_VERSION to get current API version - add info message to show API version - replace USBTMC_TIMEOUT macros with common used USB_CTRL_GET_TIMEOUT or USB_CTRL_SET_TIMEOUT macros. - delete some superfluous code lines. - update ioctl-number.txt Signed-off-by: Guido

[PATCH 08/12] usb: usbtmc: Optimize read/write and add ioctls for auto_abort

2018-05-17 Thread Guido Kiener
is always zero when the device does not support termchar feature or when termchar detection is not enabled (see ioctl USBTMC_IOCTL_CONFIG_TERMCHAR). Signed-off-by: Guido Kiener Reviewed-by: Steve Bayless --- drivers/usb/class/usbtmc.c | 357 --- include/uapi

[PATCH 10/12] usb: usbtmc: Add test functions to set HALT Feature (Stall)

2018-05-17 Thread Guido Kiener
The ioctls USBTMC_IOCTL_SET_OUT_HALT or USBTMC_IOCTL_SET_IN_HALT send a SET_FEATURE(HALT) request to the corresponding OUT or IN pipe. Useful for testing devices and client applications: The ioctls force the device to simulate the error state at the specified pipe. Signed-off-by: Guido Kiener

[PATCH 01/12] usb: usbtmc: Remove rigol_quirk

2018-05-17 Thread Guido Kiener
All T&M instruments should also work with rigol_quirk = 1 code path. So remove unnecessary code in rigol_quirk = 0 code path to simplify the driver. Tested-by: Dave Penkler Reviewed-by: Steve Bayless Signed-off-by: Guido Kiener --- drivers/usb/class/usbtmc.c

[PATCH 07/12] usb: usbtmc: Add ioctl USBTMC488_IOCTL_WAIT_SRQ

2018-05-17 Thread Guido Kiener
Wait until an SRQ (service request) is received on the interrupt pipe or until the given period of time is expired. In contrast to the poll() function this ioctl does not return when other (a)synchronous I/O operations fail with EPOLLERR. Signed-off-by: Guido Kiener Reviewed-by: Steve Bayless

[PATCH 06/12] usb: usbtmc: Add vendor specific/asynchronous read/write ioctls

2018-05-17 Thread Guido Kiener
and IN bulk, and clears all received data from IN bulk. Internal transfer counters and error states are reset. - Flush flying urbs when file handle is closed or device is suspended. Signed-off-by: Guido Kiener Reviewed-by: Steve Bayless --- drivers/usb/class/usbtmc.c |

usb: usbtmc: Questions of the IVI Foundation

2017-05-15 Thread Guido . Kiener
mance? 3. Do you have any plans to modify/evolve the USBTMC driver moving forward? 4. Do you know of any other differences between the Linux USBTMC driver and the Windows USBTMC driver? We are looking forward to your comments. Please let us know if some of you would like to participate to the ne

Re: usb: usbtmc: Questions of the IVI Foundation

2017-05-16 Thread Guido . Kiener
e filled up or analyzed in user mode. This allows VISA vendors to be more flexible to maintain their applications. The specification is here: http://ivifoundation.org/downloads/Protocol%20Specifications/Ivi-6%202_USBTMC_2010-03-23.pdf At the moment I'm still not sure about the right way

Re: usb: usbtmc: Questions of the IVI Foundation

2017-05-17 Thread Guido . Kiener
" quirk, which simply uses > a single read request for the entire buffer. (I don't know why the > driver author thought this shouldn't be done for every device.) Thank you for the hint! I think that all T&M instruments should be able to send the entire buffer and I

[PATCH v2 05/29] usb: usbtmc: Add ioctl for EOM bit

2018-07-18 Thread Guido Kiener
er Signed-off-by: Dave Penkler Signed-off-by: Guido Kiener --- drivers/usb/class/usbtmc.c | 28 +++- include/uapi/linux/usb/tmc.h | 2 ++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c index 38

[PATCH v2 11/29] usb: usbtmc: Add ioctl for vendor specific read

2018-07-18 Thread Guido Kiener
already available due to a previous non blocking call the ioctl will return -EINVAL when the message pointer is NULL. Signed-off-by: Guido Kiener Reviewed-by: Steve Bayless --- drivers/usb/class/usbtmc.c | 369 ++- include/uapi/linux/usb/tmc.h | 2 + 2 files

[PATCH v2 00/29] usb: usbtmc: Changes needed for compatible IVI/VISA library

2018-07-18 Thread Guido Kiener
er. Improvements in the data transfer rate of over 130 MByte/s for usb 3.x connections have been measured. Guido Kiener, Dave Penkler, Steve Bayless (29): 01 Support Read Status Byte with SRQ per file 02 Use consistent timeout error 03 Add ioctls to set/get usb timeout 04 Add ioctl for trigger

[PATCH v2 16/29] usb: usbtmc: add ioctl USBTMC_IOCTL_MSG_IN_ATTR

2018-07-18 Thread Guido Kiener
message is received. Bit 1 = is set when the last byte is a termchar (e.g. '\n'). Note that this bit is always zero when the device does not support the termchar feature or when termchar detection is not enabled (see ioctl USBTMC_IOCTL_CONFIG_TERMCHAR). Signed-off-by: Guido Kiener Reviewed

[PATCH v2 06/29] usb: usbtmc: Add ioctl for termination character

2018-07-18 Thread Guido Kiener
dually for each read request. Reviewed-by: Steve Bayless Tested-by: Dave Penkler Signed-off-by: Dave Penkler Signed-off-by: Guido Kiener --- drivers/usb/class/usbtmc.c | 36 ++-- include/uapi/linux/usb/tmc.h | 6 ++ 2 files changed, 40 insertions(+), 2 deleti

[PATCH v2 04/29] usb: usbtmc: Add ioctl for trigger

2018-07-18 Thread Guido Kiener
uations an instrument will be busy and unable to process the data immediately in which case the USBTMC488_IOCTL_TRIGGER can be used to trigger the instrument with lower latency. Reviewed-by: Steve Bayless Tested-by: Dave Penkler Signed-off-by: Dave Penkler Signed-off-by: Guido Kiener --- drivers

[PATCH v2 13/29] usb: usbtmc: Add ioctl USBTMC_IOCTL_CLEANUP_IO

2018-07-18 Thread Guido Kiener
. Signed-off-by: Guido Kiener Reviewed-by: Steve Bayless --- drivers/usb/class/usbtmc.c | 19 +++ include/uapi/linux/usb/tmc.h | 1 + 2 files changed, 20 insertions(+) diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c index d9ebecce65a4..9fc468ed0dee 100644

[PATCH v2 12/29] usb: usbtmc: Add ioctl USBTMC_IOCTL_CANCEL_IO

2018-07-18 Thread Guido Kiener
ioctl USBTMC_IOCTL_CANCEL_IO stops and kills all flying urbs of last USBTMC_IOCTL_READ and USBTMC_IOCTL_WRITE function calls. A subsequent call to USBTMC_IOCTL_READ or USBTMC_IOCTL_WRITE_RESULT returns -ECANCELED with information about current transferred data. Signed-off-by: Guido Kiener

[PATCH v2 09/29] usb: usbtmc: Add ioctl for vendor specific write

2018-07-18 Thread Guido Kiener
flag USBTMC_FLAG_APPEND additional urbs are queued and out_status/out_transfer_size is not reset. EPOLLOUT | EPOLLWRNORM is signaled when all submitted urbs are completed. Flush flying urbs when file handle is closed or device is suspended or reset. Signed-off-by: Guido Kiener Reviewed-by: Steve

[PATCH v2 23/29] usb: usbtmc: Replace USBTMC_TIMEOUT macros for control messages

2018-07-18 Thread Guido Kiener
Use common timeout macro USB_CTRL_GET_TIMEOUT (=5s) for all usb_control_msg() function calls. The macro USBTMC_TIMEOUT should only be used as default value for Bulk IN/OUT transfers. Signed-off-by: Guido Kiener Reviewed-by: Steve Bayless --- drivers/usb/class/usbtmc.c | 8 1 file

[PATCH v2 15/29] usb: usbtmc: Add ioctl USBTMC488_IOCTL_WAIT_SRQ

2018-07-18 Thread Guido Kiener
Wait until an SRQ (service request) is received on the interrupt pipe or until the given period of time is expired. In contrast to the poll() function this ioctl does not return when other (a)synchronous I/O operations fail with EPOLLERR. Signed-off-by: Guido Kiener Reviewed-by: Steve Bayless

[PATCH v2 18/29] usb: usbtmc: Optimize usbtmc_write

2018-07-18 Thread Guido Kiener
Use new usbtmc_generic_write function to maximize bandwidth during long data transfer. The maximum output transfer size is limited to INT_MAX (=2GB). Signed-off-by: Guido Kiener Reviewed-by: Steve Bayless --- drivers/usb/class/usbtmc.c | 176 +++-- 1 file

[PATCH v2 20/29] usb: usbtmc: Fix ioctl USBTMC_IOCTL_CLEAR

2018-07-18 Thread Guido Kiener
CHECK_CLEAR_STATUS response, since other bits are reserved and can change in future versions. Signed-off-by: Guido Kiener Reviewed-by: Steve Bayless --- drivers/usb/class/usbtmc.c | 46 +++--- 1 file changed, 18 insertions(+), 28 deletions(-) diff --git a/drivers/usb/class

[PATCH v2 08/29] usb: usbtmc: Add ioctl for generic requests on control

2018-07-18 Thread Guido Kiener
Add USBTMC_IOCTL_CTRL_REQUEST to send arbitrary requests on the control pipe. Used by specific applications of IVI Foundation, Inc. to implement VISA API functions: viUsbControlIn/Out. The maximum length of control request is set to 4k. Signed-off-by: Guido Kiener Reviewed-by: Steve Bayless

[PATCH v2 07/29] usb: usbtmc: Add support for 32 bit compat applications

2018-07-18 Thread Guido Kiener
32 bit applications can only call ioctl functions on 64 bit systems when the field .compat_ioctl is defined for file operations. Tested-by: Dave Penkler Signed-off-by: Guido Kiener Reviewed-by: Steve Bayless --- drivers/usb/class/usbtmc.c | 12 1 file changed, 12 insertions

[PATCH v2 21/29] usb: usbtmc: Fix ioctl USBTMC_IOCTL_ABORT_BULK_IN

2018-07-18 Thread Guido Kiener
instead of USBTMC_TIMEOUT. Check only bit 0 (field bmAbortBulkIn) of the CHECK_ABORT_BULK_IN_STATUS response, since other bits are reserved and can change in future versions. Signed-off-by: Guido Kiener Reviewed-by: Steve Bayless --- drivers/usb/class/usbtmc.c | 139 ---

[PATCH v2 01/29] usb: usbtmc: Support Read Status Byte with SRQ per file

2018-07-18 Thread Guido Kiener
s EPOLLPRI instead of EPOLLIN since EPOLLIN is now reserved for asynchronous reads Tested-by: Dave Penkler Reviewed-by: Steve Bayless Signed-off-by: Guido Kiener --- drivers/usb/class/usbtmc.c | 136 - 1 file changed, 105 insertions(+), 31 deletions(-) diff --git

[PATCH v2 19/29] usb: usbtmc: Optimize usbtmc_read

2018-07-18 Thread Guido Kiener
: Guido Kiener Reviewed-by: Steve Bayless --- drivers/usb/class/usbtmc.c | 222 ++--- 1 file changed, 105 insertions(+), 117 deletions(-) diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c index f38475ee6d5c..fa8b17947792 100644 --- a/drivers/usb

[PATCH v2 14/29] usb: usbtmc: Fix suspend/resume

2018-07-18 Thread Guido Kiener
Submitted urbs are not allowed when system is suspended. Thus the submitted urb waiting at interrupt pipe is killed during suspend callback and submitted again when system resumes. Signed-off-by: Guido Kiener Reviewed-by: Steve Bayless --- drivers/usb/class/usbtmc.c | 16 +++- 1

[PATCH v2 10/29] usb: usbtmc: Add ioctl USBTMC_IOCTL_WRITE_RESULT

2018-07-18 Thread Guido Kiener
To allow applications to determine the status and progress of the last asynchronous USBTMC_IOCTL_WRITE call, the ioctl USBTMC_IOCTL_WRITE_RESULT copies the current out_transfer_size to the provided __u32 pointer and returns current out_status. Signed-off-by: Guido Kiener Reviewed-by: Steve

[PATCH v2 02/29] usb: usbtmc: use consistent timeout error

2018-07-18 Thread Guido Kiener
- use consistent error value ETIMEOUT instead of ETIME Tested-by: Dave Penkler Reviewed-by: Steve Bayless Signed-off-by: Guido Kiener --- drivers/usb/class/usbtmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c

[PATCH v2 17/29] usb: usbtmc: Add ioctl USBTMC_IOCTL_AUTO_ABORT

2018-07-18 Thread Guido Kiener
Add ioctl USBTMC_IOCTL_AUTO_ABORT to configure auto_abort for each specific file handle. Signed-off-by: Guido Kiener Reviewed-by: Steve Bayless --- drivers/usb/class/usbtmc.c | 23 --- include/uapi/linux/usb/tmc.h | 1 + 2 files changed, 17 insertions(+), 7 deletions

[PATCH v2 03/29] usb: usbtmc: Add ioctls to set/get usb timeout

2018-07-18 Thread Guido Kiener
to optimise the responsiveness of the application. As the instrument may be shared by multiple applications the timeout should be settable on a per file descriptor basis. Tested-by: Dave Penkler Reviewed-by: Steve Bayless Signed-off-by: Dave Penkler Signed-off-by: Guido Kiener --- drivers/usb

[PATCH v2 22/29] usb: usbtmc: Fix ioctl USBTMC_IOCTL_ABORT_BULK_OUT

2018-07-18 Thread Guido Kiener
s to avoid stressing the instrument with repeated requests. Use common macro USB_CTRL_GET_TIMEOUT instead of USBTMC_TIMEOUT. Signed-off-by: Guido Kiener Reviewed-by: Steve Bayless --- drivers/usb/class/usbtmc.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers

  1   2   3   >