uas: MS UAS Gadget driver - Infrastructure
Subsystems (2)
PATCH v2 2/5 uas: MS UAS Gadget driver - Infrastructure
This patch implements the infrastructure for the UAS gadget driver. The UAS gadget driver registers as a second configuration of the MS gadet driver.
A new module parameter was added to the mass_storage module:
bool use_uasp. (default = 0)
If this parameter is set to true, the mass_storage module will register with the UAS configuration as the devices first configuration and operate according to the UAS protocol.
The number of buffers used by the mass_storage device was increased according to the number of supported streams.
It defines the API for COMMAND/TASK MANAGEMENT IU implementation.
drivers/usb/gadget/f_mass_storage.c +15 -11
@@ -2734,7 +2734,8 @@ static inline void fsg_common_put(struct fsg_common *common)static struct fsg_common *fsg_common_init (struct fsg_common *common,struct usb_composite_dev *cdev, -struct fsg_config *cfg) +struct fsg_config *cfg, +int start_thread) {struct usb_gadget *gadget = cdev->gadget;struct fsg_buffhd *bh;
@@ -2883,12 +2884,14 @@ buffhds_first_it:kref_init (&common->ref);/* Tell the thread to start working */ - common->thread_task = -kthread_create (fsg_main_thread, common, +if (start_thread) { + common->thread_task = +kthread_create (fsg_main_thread, common, cfg->thread_name ?:"file-storage" ); -if (IS_ERR (common->thread_task)) { - rc =PTR_ERR (common->thread_task); - goto error_release; +if (IS_ERR (common->thread_task)) { + rc =PTR_ERR (common->thread_task); + goto error_release; + } }init_completion (&common->thread_notifier);init_waitqueue_head (&common->fsg_wait);
@@ -2919,10 +2922,11 @@ buffhds_first_it: }kfree (pathbuf); -DBG (common,"I/O thread pid: %d\n" ,task_pid_nr (common->thread_task)); - -wake_up_process (common->thread_task); - +if (start_thread) { +DBG (common,"I/O thread pid: %d\n" , +task_pid_nr (common->thread_task)); +wake_up_process (common->thread_task); + }return common; error_luns:
@@ -3190,6 +3194,6 @@ fsg_common_from_params(struct fsg_common *common, {struct fsg_config cfg;fsg_config_from_params (&cfg, params); -return fsg_common_init (common, cdev, &cfg); +return fsg_common_init (common, cdev, &cfg,1 ); }
drivers/usb/gadget/f_uasp.c new file +2454 -0
2,454 lines not on this page · raw message
drivers/usb/gadget/f_uasp.h new file +395 -0
395 lines not on this page · raw message
drivers/usb/gadget/mass_storage.c +61 -6
100 lines not on this page · raw message
drivers/usb/gadget/storage_common.c +15 -4
@@ -220,6 +220,7 @@ struct interrupt_data {#define SS_UNRECOVERED_READ_ERROR 0x031100
Lines of this file are not shown. View the raw message.
drivers/usb/gadget/uasp_cmdiu.c new file +520 -0
520 lines not on this page · raw message
drivers/usb/gadget/uasp_tmiu.c new file +283 -0
283 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 9 lines
1.7.0.4 -- Sent by a Consultant for Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Part of the diff is not shown here. View the raw message.