lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <55C3429C.2030200@cogentembedded.com>
Date:	Thu, 6 Aug 2015 14:18:52 +0300
From:	Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To:	Robert Baldyga <r.baldyga@...sung.com>, balbi@...com
Cc:	gregkh@...uxfoundation.org, linux-kernel@...r.kernel.org,
	linux-usb@...r.kernel.org, stern@...land.harvard.edu
Subject: Re: [PATCH v7 7/8] usb: musb: gadget: add musb_match_ep() function

On 8/6/2015 10:58 AM, Robert Baldyga wrote:

> Add 'match_ep' callback to utilize chip-specific knowledge in endpoint matching
> process. Function does the same that was done by chip-specific code inside
> of epautoconf. Now this code can be removed from there to separate generic code
> from platform specific logic.

> Signed-off-by: Robert Baldyga <r.baldyga@...sung.com>
> ---
>   drivers/usb/gadget/epautoconf.c | 23 -----------------------
>   drivers/usb/musb/musb_gadget.c  | 34 ++++++++++++++++++++++++++++++++++
>   2 files changed, 34 insertions(+), 23 deletions(-)

[...]
> diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
> index 4150baf..ac2f188 100644
> --- a/drivers/usb/musb/musb_gadget.c
> +++ b/drivers/usb/musb/musb_gadget.c
> @@ -1684,6 +1684,39 @@ static int musb_gadget_pullup(struct usb_gadget *gadget, int is_on)
>   	return 0;
>   }
>
> +#ifdef CONFIG_BLACKFIN
> +static struct usb_ep *musb_match_ep(struct usb_gadget *g,
> +		struct usb_endpoint_descriptor *desc,
> +		struct usb_ss_ep_comp_descriptor *ep_comp)
> +{
> +	struct usb_ep *ep = NULL;
> +	u8 type = usb_endpoint_type(desc);

    You hardly need this variable.

> +
> +	switch (type) {
> +	case USB_ENDPOINT_XFER_ISOC:
> +	case USB_ENDPOINT_XFER_BULK:
> +		if (usb_endpoint_dir_in(desc))
> +			ep = gadget_find_ep_by_name(g, "ep5in");
> +		else
> +			ep = gadget_find_ep_by_name(g, "ep6out");
> +		break;
> +	case USB_ENDPOINT_XFER_INT:
> +		if (usb_endpoint_dir_in(desc))
> +			ep = gadget_find_ep_by_name(g, "ep1in");
> +		else
> +			ep = gadget_find_ep_by_name(g, "ep2out");
> +	default:
> +	}
> +
> +	if (ep && usb_gadget_ep_match_desc(g, ep, desc, ep_comp))
> +		return ep;
> +
> +	return NULL;
> +}
> +#else
> +#define musb_match_ep NULL
> +#endif
> +
>   static int musb_gadget_start(struct usb_gadget *g,
>   		struct usb_gadget_driver *driver);
>   static int musb_gadget_stop(struct usb_gadget *g);
[...]

MBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ