Patchwork [U-Boot,5/9] Generate appropriate responses for DFU

login
register
mail settings
Submitter Pantelis Antoniou
Date Nov. 28, 2012, 12:43 p.m.
Message ID <1354106642-4587-6-git-send-email-panto@antoniou-consulting.com>
Download mbox | patch
Permalink /patch/202243/
State Superseded
Delegated to: Marek Vasut
Headers show

Comments

Marek Vasut - Nov. 28, 2012, 2:46 a.m.
Dear Pantelis Antoniou,

> Make sure appropriate responses for the DFU protocal are
> generated.

I dont understand this patch, please explain it properly in the commit message.

> Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
> ---
>  drivers/usb/gadget/composite.c | 9 +++++++++
>  drivers/usb/gadget/ep0.c       | 1 +
>  2 files changed, 10 insertions(+)
> 
> diff --git a/drivers/usb/gadget/composite.c
> b/drivers/usb/gadget/composite.c index ebb5131..1ae318c 100644
> --- a/drivers/usb/gadget/composite.c
> +++ b/drivers/usb/gadget/composite.c
> @@ -773,6 +773,15 @@ composite_setup(struct usb_gadget *gadget, const
> struct usb_ctrlrequest *ctrl) if (value >= 0)
>  				value = min(w_length, (u16) value);
>  			break;
> +
> +#ifdef CONFIG_DFU_FUNCTION
> +		case DFU_DT_FUNC:	/* DFU */
> +			value = config_desc(cdev, w_value);
> +			if (value >= 0)
> +				value = min(w_length, (u16) value);
> +			break;
> +#endif
> +
>  		default:
>  			goto unknown;
>  		}
> diff --git a/drivers/usb/gadget/ep0.c b/drivers/usb/gadget/ep0.c
> index aa8f916..971d846 100644
> --- a/drivers/usb/gadget/ep0.c
> +++ b/drivers/usb/gadget/ep0.c
> @@ -221,6 +221,7 @@ static int ep0_get_descriptor (struct
> usb_device_instance *device, break;
> 
>  	case USB_DESCRIPTOR_TYPE_CONFIGURATION:
> +	case USB_DESCRIPTOR_TYPE_OTHER_SPEED_CONFIGURATION:
>  		{
>  			struct usb_configuration_descriptor
>  				*configuration_descriptor;

Best regards,
Marek Vasut
Pantelis Antoniou - Nov. 28, 2012, 8:27 a.m.
Hi Marek,

On Nov 28, 2012, at 4:46 AM, Marek Vasut wrote:

> Dear Pantelis Antoniou,
> 
>> Make sure appropriate responses for the DFU protocal are
>> generated.
> 
> I dont understand this patch, please explain it properly in the commit message.
> 

Turns out this is not even quite correct... Updated patchset in a little bit.

>> Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
>> ---
>> drivers/usb/gadget/composite.c | 9 +++++++++
>> drivers/usb/gadget/ep0.c       | 1 +
>> 2 files changed, 10 insertions(+)
>> 
>> diff --git a/drivers/usb/gadget/composite.c
>> b/drivers/usb/gadget/composite.c index ebb5131..1ae318c 100644
>> --- a/drivers/usb/gadget/composite.c
>> +++ b/drivers/usb/gadget/composite.c
>> @@ -773,6 +773,15 @@ composite_setup(struct usb_gadget *gadget, const
>> struct usb_ctrlrequest *ctrl) if (value >= 0)
>> 				value = min(w_length, (u16) value);
>> 			break;
>> +
>> +#ifdef CONFIG_DFU_FUNCTION
>> +		case DFU_DT_FUNC:	/* DFU */
>> +			value = config_desc(cdev, w_value);
>> +			if (value >= 0)
>> +				value = min(w_length, (u16) value);
>> +			break;
>> +#endif
>> +
>> 		default:
>> 			goto unknown;
>> 		}
>> diff --git a/drivers/usb/gadget/ep0.c b/drivers/usb/gadget/ep0.c
>> index aa8f916..971d846 100644
>> --- a/drivers/usb/gadget/ep0.c
>> +++ b/drivers/usb/gadget/ep0.c
>> @@ -221,6 +221,7 @@ static int ep0_get_descriptor (struct
>> usb_device_instance *device, break;
>> 
>> 	case USB_DESCRIPTOR_TYPE_CONFIGURATION:
>> +	case USB_DESCRIPTOR_TYPE_OTHER_SPEED_CONFIGURATION:
>> 		{
>> 			struct usb_configuration_descriptor
>> 				*configuration_descriptor;
> 
> Best regards,
> Marek Vasut
Pantelis Antoniou - Nov. 28, 2012, 12:43 p.m.
Make sure appropriate responses for the DFU protocal are
generated.

Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
---
 drivers/usb/gadget/composite.c | 9 +++++++++
 drivers/usb/gadget/ep0.c       | 1 +
 2 files changed, 10 insertions(+)

Patch

diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index ebb5131..1ae318c 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -773,6 +773,15 @@  composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
 			if (value >= 0)
 				value = min(w_length, (u16) value);
 			break;
+
+#ifdef CONFIG_DFU_FUNCTION
+		case DFU_DT_FUNC:	/* DFU */
+			value = config_desc(cdev, w_value);
+			if (value >= 0)
+				value = min(w_length, (u16) value);
+			break;
+#endif
+
 		default:
 			goto unknown;
 		}
diff --git a/drivers/usb/gadget/ep0.c b/drivers/usb/gadget/ep0.c
index aa8f916..971d846 100644
--- a/drivers/usb/gadget/ep0.c
+++ b/drivers/usb/gadget/ep0.c
@@ -221,6 +221,7 @@  static int ep0_get_descriptor (struct usb_device_instance *device,
 		break;
 
 	case USB_DESCRIPTOR_TYPE_CONFIGURATION:
+	case USB_DESCRIPTOR_TYPE_OTHER_SPEED_CONFIGURATION:
 		{
 			struct usb_configuration_descriptor
 				*configuration_descriptor;