Skip to content

Commit

Permalink
usb: add usb_endpoint_maxp() macro
Browse files Browse the repository at this point in the history
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
kuninori.morimoto.gx@renesas.com authored and Greg Kroah-Hartman committed Aug 22, 2011
1 parent 2310634 commit 939f325
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions include/linux/usb/ch9.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#define __LINUX_USB_CH9_H

#include <linux/types.h> /* __u8 etc */
#include <asm/byteorder.h> /* le16_to_cpu */

/*-------------------------------------------------------------------------*/

Expand Down Expand Up @@ -570,6 +571,17 @@ static inline int usb_endpoint_is_isoc_out(
return usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_out(epd);
}

/**
* usb_endpoint_maxp - get endpoint's max packet size
* @epd: endpoint to be checked
*
* Returns @epd's max packet
*/
static inline int usb_endpoint_maxp(const struct usb_endpoint_descriptor *epd)
{
return le16_to_cpu(epd->wMaxPacketSize);
}

/*-------------------------------------------------------------------------*/

/* USB_DT_SS_ENDPOINT_COMP: SuperSpeed Endpoint Companion descriptor */
Expand Down

0 comments on commit 939f325

Please sign in to comment.