From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Guido Kiener <guido@kiener-muenchen.de>
Cc: linux-usb@vger.kernel.org, guido.kiener@rohde-schwarz.com,
steve_bayless@keysight.com, dpenkler@gmail.com
Subject: [v2,09/29] usb: usbtmc: Add ioctl for vendor specific write
Date: Sat, 21 Jul 2018 08:29:21 +0200 [thread overview]
Message-ID: <20180721062921.GD24695@kroah.com> (raw)
On Wed, Jul 18, 2018 at 10:45:42AM +0200, Guido Kiener wrote:
> The new ioctl USBTMC_IOCTL_WRITE sends a generic message to bulk OUT.
> This ioctl is used for vendor specific or asynchronous I/O as well.
>
> The message is split into chunks of 4k (page size).
> Message size is aligned to 32 bit boundaries.
>
> With flag USBTMC_FLAG_ASYNC the ioctl is non blocking.
> With 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 <guido.kiener@rohde-schwarz.com>
> Reviewed-by: Steve Bayless <steve_bayless@keysight.com>
> ---
> drivers/usb/class/usbtmc.c | 416 ++++++++++++++++++++++++++++++++++-
> include/uapi/linux/usb/tmc.h | 14 ++
> 2 files changed, 428 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c
> index 846599dd0c84..c46280f53f39 100644
> --- a/drivers/usb/class/usbtmc.c
> +++ b/drivers/usb/class/usbtmc.c
> @@ -37,6 +37,8 @@
> /* Default USB timeout (in milliseconds) */
> #define USBTMC_TIMEOUT 5000
>
> +/* Max number of urbs used in write transfers */
> +#define MAX_URBS_IN_FLIGHT 16
> /* I/O buffer size used in generic read/write functions */
> #define USBTMC_BUFSIZE (4096)
>
> @@ -125,9 +127,19 @@ struct usbtmc_file_data {
> u32 timeout;
> u8 srq_byte;
> atomic_t srq_asserted;
> +
> u8 eom_val;
> u8 term_char;
> bool term_char_enabled;
> +
> + spinlock_t err_lock; /* lock for errors */
> +
> + struct usb_anchor submitted;
> +
> + /* data for generic_write */
> + struct semaphore limit_write_sem;
> + u32 out_transfer_size;
> + int out_status;
> };
>
> #ifdef CONFIG_COMPAT
> @@ -137,12 +149,21 @@ struct compat_usbtmc_ctrlrequest {
> compat_uptr_t data;
> } __packed;
>
> +struct compat_usbtmc_message {
> + __u32 transfer_size;
> + __u32 transferred;
> + __u32 flags;
> + compat_uptr_t message;
> +} __packed;
Same here, no need for this at all.
I've stopped reviewing in the series here. I've applied the first 6
patches in the series, please rework the remaining ones to not have any
compatibility ioctls needed and resend. Or you can restructure what you
already have and resend everything without the new ioctls so I can
review/take them if you need more time to redo the ioctls stuff.
thanks,
greg k-h
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next reply other threads:[~2018-07-21 6:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-21 6:29 Greg Kroah-Hartman [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-07-18 8:45 [v2,09/29] usb: usbtmc: Add ioctl for vendor specific write Guido Kiener
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180721062921.GD24695@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=dpenkler@gmail.com \
--cc=guido.kiener@rohde-schwarz.com \
--cc=guido@kiener-muenchen.de \
--cc=linux-usb@vger.kernel.org \
--cc=steve_bayless@keysight.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).