Date: Mon, 13 Jul 2009 09:20:14 GMT From: Sylvestre Gallon <syl@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 165992 for review Message-ID: <200907130920.n6D9KErs066174@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=165992 Change 165992 by syl@syl_pablo on 2009/07/13 09:19:45 Implement get_hw_ep_profile. Implement ep_init. Affected files ... .. //depot/projects/soc2009/syl_usb/src/sys/dev/usb/controller/s3c24xxdci.c#2 edit .. //depot/projects/soc2009/syl_usb/src/sys/dev/usb/controller/s3c24xxdci.h#3 edit Differences ... ==== //depot/projects/soc2009/syl_usb/src/sys/dev/usb/controller/s3c24xxdci.c#2 (text+ko) ==== @@ -72,6 +72,208 @@ "s3c24xxdci debug level"); #endif +/* + * Here is a list of what the chip supports. + */ + +static const struct usb_hw_ep_profile +s3c24dci_ep_profile[S3C24XX_DCI_EP_MAX] = { + [0] = { + .max_in_frame_size = 8, + .max_out_frame_size = 8, + .is_simplex = 1, + .support_control = 1, + }, + [1] = { + .max_in_frame_size = 64, + .max_out_frame_size = 64, + .is_simplex = 1, + .support_multi_buffer = 1, + .support_bulk = 1, + .support_interrupt = 1, + .support_isochronous = 1 , + .support_in = 1, + .support_out = 1 , + }, + [2] = { + .max_in_frame_size = 64, + .max_out_frame_size = 64, + .is_simplex = 1, + .support_multi_buffer = 1, + .support_bulk = 1, + .support_interrupt = 1, + .support_isochronous = 1 , + .support_in = 1, + .support_out = 1 , + }, + [3] = { + .max_in_frame_size = 64, + .max_out_frame_size = 64, + .is_simplex = 1, + .support_multi_buffer = 1, + .support_bulk = 1, + .support_interrupt = 1, + .support_isochronous = 1 , + .support_in = 1, + .support_out = 1 , + }, + [4] = { + .max_in_frame_size = 64, + .max_out_frame_size = 64, + .is_simplex = 1, + .support_multi_buffer = 1, + .support_bulk = 1, + .support_interrupt = 1, + .support_isochronous = 1 , + .support_in = 1, + .support_out = 1 , + }, +}; + +/* + * s3c24xxdci ctrl support + */ + +static void +s3c24dci_device_ctrl_open(struct usb_xfer *xfer) +{ + return ; +} + +static void +s3c24dci_device_ctrl_close(struct usb_xfer *xfer) +{ + return ; +} + +static void +s3c24dci_device_ctrl_start(struct usb_xfer *xfer) +{ + return ; +} + +static void +s3c24dci_device_ctrl_enter(struct usb_xfer *xfer) +{ + return ; +} + +struct usb_pipe_methods s3c24dci_device_ctrl_methods = { + .open = s3c24dci_device_ctrl_open, + .close = s3c24dci_device_ctrl_close, + .enter = s3c24dci_device_ctrl_enter, + .start = s3c24dci_device_ctrl_start, +}; + +/* + * s3c24xxdci bulk support + */ + +static void +s3c24dci_device_bulk_open(struct usb_xfer *xfer) +{ + return ; +} + +static void +s3c24dci_device_bulk_close(struct usb_xfer *xfer) +{ + return ; +} + +static void +s3c24dci_device_bulk_start(struct usb_xfer *xfer) +{ + return ; +} + +static void +s3c24dci_device_bulk_enter(struct usb_xfer *xfer) +{ + return ; +} + +struct usb_pipe_methods s3c24dci_device_bulk_methods = { + .open = s3c24dci_device_bulk_open, + .close = s3c24dci_device_bulk_close, + .enter = s3c24dci_device_bulk_enter, + .start = s3c24dci_device_bulk_start, +}; + +/* + * s3c24xxdci interrupt support + */ + +static void +s3c24dci_device_intr_open(struct usb_xfer *xfer) +{ + return ; +} + +static void +s3c24dci_device_intr_close(struct usb_xfer *xfer) +{ + return ; +} + +static void +s3c24dci_device_intr_start(struct usb_xfer *xfer) +{ + return ; +} + +static void +s3c24dci_device_intr_enter(struct usb_xfer *xfer) +{ + return ; +} + +struct usb_pipe_methods s3c24dci_device_bulk_methods = { + .open = s3c24dci_device_intr_open, + .close = s3c24dci_device_intr_close, + .enter = s3c24dci_device_intr_enter, + .start = s3c24dci_device_intr_start, +}; + +/* + * s3c24xxdci isochronous support + */ + +static void +s3c24dci_device_isoc_fs_open(struct usb_xfer *xfer) +{ + return ; +} + +static void +s3c24dci_device_isoc_fs_close(struct usb_xfer *xfer) +{ + return ; +} + +static void +s3c24dci_device_isoc_fs_start(struct usb_xfer *xfer) +{ + return ; +} + +static void +s3c24dci_device_isoc_fs_enter(struct usb_xfer *xfer) +{ + return ; +} + +struct usb_pipe_methods s3c24dci_device_bulk_methods = { + .open = s3c24dci_device_isoc_fs_open, + .close = s3c24dci_device_isoc_fs_close, + .enter = s3c24dci_device_isoc_fs_enter, + .start = s3c24dci_device_isoc_fs_start, +}; + +/* + * USB FN interface + */ + usb_error_t s3c24dci_init(struct s3c24dci_softc *sc) { return 0; @@ -99,7 +301,10 @@ s3c24dci_get_hw_ep_profile(struct usb_device *udev, const struct usb_hw_ep_profile **ppf, uint8_t ep_addr) { - return ; + if (ep_addr < S3C24XX_DCI_EP_MAX) + *ppf = (s3c24dci_ep_profile + ep_addr); + else + *ppf = NULL; } static usb_error_t @@ -133,16 +338,26 @@ if (udev->device_index != sc->sc_rt_addr) { if (udev->flags.usb_mode != USB_MODE_DEVICE) { + /* not supported */ return ; } if (udev->speed != USB_SPEED_FULL) { + /* not supported */ return ; } switch (edesc->bmAttributes & UE_XFERTYPE) { case UE_CONTROL: + ep->methods = &s3c24dci_device_ctrl_methods; + break ; case UE_INTERRUPT: + ep->methods = &s3c24dci_device_intr_methods; + break ; case UE_ISOCHRONOUS: + ep->methods = &s3c24dci_device_isoc_fs_methods; + break ; case UE_BULK: + ep->methods = &s3c24dci_device_bulk_methods; + break ; default: break; } ==== //depot/projects/soc2009/syl_usb/src/sys/dev/usb/controller/s3c24xxdci.h#3 (text+ko) ==== @@ -167,6 +167,8 @@ #define S3C24_DCI_IN_DMA_RUN (1<<1) #define S3C24_DCI_DMA_MODE_EN (1<<0) +#define S3C24XX_DCI_EP_MAX 5 + struct s3c24dci_softc { struct usb_bus sc_bus;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200907130920.n6D9KErs066174>