From owner-p4-projects@FreeBSD.ORG Mon Jul 13 09:20:15 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 29B6E1065674; Mon, 13 Jul 2009 09:20:15 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE15D1065672 for ; Mon, 13 Jul 2009 09:20:14 +0000 (UTC) (envelope-from syl@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id CC7E58FC14 for ; Mon, 13 Jul 2009 09:20:14 +0000 (UTC) (envelope-from syl@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n6D9KEaf066176 for ; Mon, 13 Jul 2009 09:20:14 GMT (envelope-from syl@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n6D9KErs066174 for perforce@freebsd.org; Mon, 13 Jul 2009 09:20:14 GMT (envelope-from syl@FreeBSD.org) Date: Mon, 13 Jul 2009 09:20:14 GMT Message-Id: <200907130920.n6D9KErs066174@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to syl@FreeBSD.org using -f From: Sylvestre Gallon To: Perforce Change Reviews Cc: Subject: PERFORCE change 165992 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jul 2009 09:20:16 -0000 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;