Hi Oliver,
Thanks for the fix. You need to set an invalid return code, too.
Regards,
Guido
-Original Message-
From: Andrey Konovalov
Sent: Wednesday, August 14, 2019 3:52 PM
To: syzbot
Cc: Greg Kroah-Hartman ; Kiener Guido 1DS1
; USB list ; Oliver
Neukum ; steve_bayl...@keysight.co
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
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 --
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
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
From: Guido Kiener
A reset e.g. calling ep_reset_338x() can happen while endpoints
are enabled. The ep_reset_338x() sets ep->desc = NULL to mark
endpoint being invalid. A subsequent call of net2280_disable will
fail and return -EINVAL to parent function usb_ep_disable(),
which will fail,
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 reading queue entries with a length that is
not equal to a multiple of
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/drivers/usb/gadget/udc/net2280.c
index 1cb58fd5d1c6..430d582d8b6e 100644
Hi Felipe,
We use the Netchip 228x and PLX 2380/338x family in our devices and I have some
small patches that I can share with the community.
Some patches are common and should be ok for all environments. However I also
have 1-2 patches that are mandatory in our environment, but I cannot estimat
From: Guido Kiener
Fix uninitialized symbol 'actual' in function usbtmc_ioctl_clear.
When symbol 'actual' is not initialized and usb_bulk_msg() fails,
the subsequent kernel debug message shows a random value.
Signed-off-by: Guido Kiener
Fixes: dfee02ac4bce (&qu
From: Guido Kiener
Kernel memory is allocated twice in new function
usbtmc_ioctl_request and creates a memory leak.
This fix removes the superfluous kmalloc().
Signed-off-by: Guido Kiener
Fixes: 658f24f4523e ("usb: usbtmc: Add ioctl for generic requests on control")
---
drivers
Additionally the unitialized symbol 'actual' can cause similar
problems and show wrong debug kernel messages in the other functions
usbtmc_read() and usbtmc_ioctl_clear().
Guido Kiener (4):
usb: usbtmc: Fix memory leak in usbtmc_ioctl_request
usb: usbtmc: uninitialized symb
From: Guido Kiener
Fix uninitialized symbol 'actual' in function usbtmc_read.
When symbol 'actual' is not initialized and usb_bulk_msg() fails,
the subsequent kernel debug message shows a random value.
Signed-off-by: Guido Kiener
Fixes: d7604ff0dc01 ("usb: usb
From: Guido Kiener
Fix uninitialized symbol 'actual' in function
usbtmc_ioctl_abort_bulk_in_tag().
When symbol 'actual' is not initialized and usb_bulk_msg() fails,
the subsequent kernel debug message shows invalid data.
Signed-off-by: Guido Kiener
Fixes: cbe743f1333b (&qu
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
As all the properties of the usbtmc driver can now be
controlled on a per file descriptor basis by ioctl functions
the sysfs interface is of limited use.
We are not aware about applications that are using the sysfs
parameter TermChar, TermCharEnabled or auto_abort.
Signed-off-by: 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 c476b53b6237..26a779d0c89b 100644
--- a/drivers/usb
.
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 0d8aa4bc3fa7..dc6c04fdfdff 100644
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
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
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 ---
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
Reserve a suitable range of ioctl numbers for USBTMC driver.
Signed-off-by: Guido Kiener
Reviewed-by: Steve Bayless
---
Documentation/ioctl/ioctl-number.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/ioctl/ioctl-number.txt
b/Documentation/ioctl/ioctl
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
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
when changing tmc.h
with new flags, ioctls or when changing a significant behavior
of the driver.
Signed-off-by: Guido Kiener
Reviewed-by: Steve Bayless
---
drivers/usb/class/usbtmc.c | 9 +
include/uapi/linux/usb/tmc.h | 1 +
2 files changed, 10 insertions(+)
diff --git a/drivers/usb
Remove redundant code and fix debug messages.
Signed-off-by: Guido Kiener
Reviewed-by: Steve Bayless
---
drivers/usb/class/usbtmc.c | 25 -
1 file changed, 8 insertions(+), 17 deletions(-)
diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c
index
Signed-off-by: Guido Kiener
Reviewed-by: Steve Bayless
---
drivers/usb/class/usbtmc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c
index ad3932ca4d8d..b9e505cbe6b4 100644
--- a/drivers/usb/class/usbtmc.c
+++ b
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
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
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
applications running on 64 bit systems. 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.
Signed-off-by: Guido Kiener
Reviewed-by: Steve Bayless
t/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 gen
ioctl USBTMC_IOCTL_WRITE_RESULT copies current out_transfer_size
to given __u32 pointer and returns current out_status of the last
(asnynchronous) USBTMC_IOCTL_WRITE call.
Signed-off-by: Guido Kiener
Reviewed-by: Steve Bayless
---
drivers/usb/class/usbtmc.c | 25
bit
applications running on 64 bit systems. 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.
Signed-off-by: Guido Kiener
Reviewed-by: Steve
Signed-off-by: Guido Kiener
Reviewed-by: Steve Bayless
---
drivers/usb/class/usbtmc.c | 6 --
1 file changed, 6 deletions(-)
diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c
index 5b6cdb1237ab..ad3932ca4d8d 100644
--- a/drivers/usb/class/usbtmc.c
+++ b/drivers/usb/class
applications as well. Note that 32 bit applications running
on 32 bit target systems are not affected by this limitation.
Signed-off-by: Guido Kiener
Reviewed-by: Steve Bayless
---
drivers/usb/class/usbtmc.c | 336 ++-
include/uapi/linux/usb/tmc.h | 2 +
2 files
Reserve a suitable range of ioctl numbers for USBTMC driver.
Signed-off-by: Guido Kiener
Reviewed-by: Steve Bayless
---
Documentation/ioctl/ioctl-number.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/ioctl/ioctl-number.txt
b/Documentation/ioctl/ioctl
Signed-off-by: Guido Kiener
Reviewed-by: Steve Bayless
---
drivers/usb/class/usbtmc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c
index 785eee3a6b89..6aef3447adcc 100644
--- a/drivers/usb/class/usbtmc.c
+++ b
As all the properties of the usbtmc driver can now be
controlled on a per file descriptor basis by ioctl functions
the sysfs interface is of limited use.
We are not aware about applications that are using the sysfs
parameter TermChar, TermCharEnabled or auto_abort.
Signed-off-by: Guido Kiener
Signed-off-by: Guido Kiener
Reviewed-by: Steve Bayless
---
drivers/usb/class/usbtmc.c | 6 --
1 file changed, 6 deletions(-)
diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c
index 81144c0c4772..785eee3a6b89 100644
--- a/drivers/usb/class/usbtmc.c
+++ b/drivers/usb/class
Remove redundant code and fix debug messages.
Signed-off-by: Guido Kiener
Reviewed-by: Steve Bayless
---
drivers/usb/class/usbtmc.c | 25 -
1 file changed, 8 insertions(+), 17 deletions(-)
diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c
index
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
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
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
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
ioctl USBTMC_IOCTL_WRITE_RESULT copies current out_transfer_size
to given __u32 pointer and returns current out_status of the last
(asnynchronous) USBTMC_IOCTL_WRITE call.
Signed-off-by: Guido Kiener
Reviewed-by: Steve Bayless
---
drivers/usb/class/usbtmc.c | 25
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)
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
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 | 336 ++-
include/uapi/linux/usb/tmc.h | 2 +
2 files
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 ---
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
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
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
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
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
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
: 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 6d5f514b3081..11225c6d6c69 100644
--- a/drivers/usb
when changing tmc.h
with new flags, ioctls or when changing a significant behavior
of the driver.
Signed-off-by: Guido Kiener
Reviewed-by: Steve Bayless
---
drivers/usb/class/usbtmc.c | 9 +
include/uapi/linux/usb/tmc.h | 1 +
2 files changed, 10 insertions(+)
diff --git a/drivers/usb
.
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 e78176ef0e42..b8a4140bd161 100644
As all the properties of the usbtmc driver can now be
controlled on a per file descriptor basis by ioctl functions
the sysfs interface is of limited use.
We are not aware about applications that are using the sysfs
parameter TermChar, TermCharEnabled or auto_abort.
Signed-off-by: Guido Kiener
Reserve a suitable range of ioctl numbers for USBTMC driver.
Signed-off-by: Guido Kiener
Reviewed-by: Steve Bayless
---
Documentation/ioctl/ioctl-number.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/ioctl/ioctl-number.txt
b/Documentation/ioctl/ioctl
Signed-off-by: Guido Kiener
Reviewed-by: Steve Bayless
---
drivers/usb/class/usbtmc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c
index 785eee3a6b89..6aef3447adcc 100644
--- a/drivers/usb/class/usbtmc.c
+++ b
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
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
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
Remove redundant code and fix debug messages.
Signed-off-by: Guido Kiener
Reviewed-by: Steve Bayless
---
drivers/usb/class/usbtmc.c | 25 -
1 file changed, 8 insertions(+), 17 deletions(-)
diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c
index
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
: 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 6d5f514b3081..11225c6d6c69 100644
--- a/drivers/usb
when changing tmc.h
with new flags, ioctls or when changing a significant behavior
of the driver.
Signed-off-by: Guido Kiener
Reviewed-by: Steve Bayless
---
drivers/usb/class/usbtmc.c | 9 +
include/uapi/linux/usb/tmc.h | 1 +
2 files changed, 10 insertions(+)
diff --git a/drivers/usb
Signed-off-by: Guido Kiener
Reviewed-by: Steve Bayless
---
drivers/usb/class/usbtmc.c | 6 --
1 file changed, 6 deletions(-)
diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c
index 81144c0c4772..785eee3a6b89 100644
--- a/drivers/usb/class/usbtmc.c
+++ b/drivers/usb/class
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 ---
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
ioctl USBTMC_IOCTL_WRITE_RESULT copies current out_transfer_size
to given __u32 pointer and returns current out_status of the last
(asnynchronous) USBTMC_IOCTL_WRITE call.
Signed-off-by: Guido Kiener
Reviewed-by: Steve Bayless
---
drivers/usb/class/usbtmc.c | 25
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
.
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 e78176ef0e42..b8a4140bd161 100644
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
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
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
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
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 (22):
usb: usbtmc: Add ioctl for generic requests on control
usb: usbtmc: Add ioctl for vendor specific write
usb: usbtmc: Add ioctl USBTMC_IOCTL
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
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 | 336 ++-
include/uapi/linux/usb/tmc.h | 2 +
2 files
Signed-off-by: Guido Kiener
Reviewed-by: Steve Bayless
---
drivers/usb/class/usbtmc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c
index ddc2e4b78a3b..9a6312a49b55 100644
--- a/drivers/usb/class/usbtmc.c
+++ b
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
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 ---
Remove redundant code and fix debug messages.
Signed-off-by: Guido Kiener
Reviewed-by: Steve Bayless
---
drivers/usb/class/usbtmc.c | 25 -
1 file changed, 8 insertions(+), 17 deletions(-)
diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c
index
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
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 (23):
usb: usbtmc: Add support for 32 bit compat applications
usb: usbtmc: Add ioctl for generic requests on control
usb: usbtmc: Add ioctl for ve
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
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
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
when changing tmc.h
with new flags, ioctls or when changing a significant behavior
of the driver.
Signed-off-by: Guido Kiener
Reviewed-by: Steve Bayless
---
drivers/usb/class/usbtmc.c | 9 +
include/uapi/linux/usb/tmc.h | 1 +
2 files changed, 10 insertions(+)
diff --git a/drivers/usb
.
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 67cdf5df90d7..fe140d400e1d 100644
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
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
As all the properties of the usbtmc driver can now be
controlled on a per file descriptor basis by ioctl functions
the sysfs interface is of limited use.
We are not aware about applications that are using the sysfs
parameter TermChar, TermCharEnabled or auto_abort.
Signed-off-by: Guido Kiener
Signed-off-by: Guido Kiener
Reviewed-by: Steve Bayless
---
drivers/usb/class/usbtmc.c | 6 --
1 file changed, 6 deletions(-)
diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c
index a6482e850532..ddc2e4b78a3b 100644
--- a/drivers/usb/class/usbtmc.c
+++ b/drivers/usb/class
Reserve a suitable range of ioctl numbers for USBTMC driver.
Signed-off-by: Guido Kiener
Reviewed-by: Steve Bayless
---
Documentation/ioctl/ioctl-number.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/ioctl/ioctl-number.txt
b/Documentation/ioctl/ioctl
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 | 4
1 file changed, 4 insertions(+)
diff --git
1 - 100 of 157 matches
Mail list logo