From owner-svn-src-user@FreeBSD.ORG Fri Oct 1 23:13:57 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18C2F106564A; Fri, 1 Oct 2010 23:13:57 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 073988FC0A; Fri, 1 Oct 2010 23:13:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o91NDvpP020170; Fri, 1 Oct 2010 23:13:57 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o91NDuV4020161; Fri, 1 Oct 2010 23:13:56 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <201010012313.o91NDuV4020161@svn.freebsd.org> From: Weongyo Jeong Date: Fri, 1 Oct 2010 23:13:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213338 - in user/weongyo/usb/sys/dev/usb: . controller X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2010 23:13:57 -0000 Author: weongyo Date: Fri Oct 1 23:13:56 2010 New Revision: 213338 URL: http://svn.freebsd.org/changeset/base/213338 Log: Removes `struct usb_xfer_flags_int' structure. It's replaced with uint32_t status variable. Modified: user/weongyo/usb/sys/dev/usb/controller/at91dci.c user/weongyo/usb/sys/dev/usb/controller/atmegadci.c user/weongyo/usb/sys/dev/usb/controller/avr32dci.c user/weongyo/usb/sys/dev/usb/controller/ehci.c user/weongyo/usb/sys/dev/usb/controller/musb_otg.c user/weongyo/usb/sys/dev/usb/controller/ohci.c user/weongyo/usb/sys/dev/usb/controller/uhci.c user/weongyo/usb/sys/dev/usb/controller/uss820dci.c user/weongyo/usb/sys/dev/usb/usb_busdma.c user/weongyo/usb/sys/dev/usb/usb_compat_linux.c user/weongyo/usb/sys/dev/usb/usb_core.h user/weongyo/usb/sys/dev/usb/usb_generic.c user/weongyo/usb/sys/dev/usb/usb_handle_request.c user/weongyo/usb/sys/dev/usb/usb_hub.c user/weongyo/usb/sys/dev/usb/usb_transfer.c Modified: user/weongyo/usb/sys/dev/usb/controller/at91dci.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/controller/at91dci.c Fri Oct 1 20:14:36 2010 (r213337) +++ user/weongyo/usb/sys/dev/usb/controller/at91dci.c Fri Oct 1 23:13:56 2010 (r213338) @@ -897,16 +897,17 @@ at91dci_setup_standard_chain(struct usb_ temp.td = NULL; temp.td_next = xfer->td_start[0]; temp.offset = 0; - temp.setup_alt_next = xfer->flags_int.short_frames_ok; - temp.did_stall = !xfer->flags_int.control_stall; + temp.setup_alt_next = (xfer->status & XFER_STATUS_SHORTFRAME_OK) ? + 1 : 0; + temp.did_stall = !(xfer->status & XFER_STATUS_CTRLSTALL); sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); ep_no = (xfer->endpointno & UE_ADDR); /* check if we should prepend a setup message */ - if (xfer->flags_int.control_xfr) { - if (xfer->flags_int.control_hdr) { + if ((xfer->status & XFER_STATUS_CTRLXFER) != 0) { + if ((xfer->status & XFER_STATUS_CTRLHDR) != 0) { temp.func = &at91dci_setup_rx; temp.len = xfer->frlengths[0]; @@ -915,7 +916,8 @@ at91dci_setup_standard_chain(struct usb_ /* check for last frame */ if (xfer->nframes == 1) { /* no STATUS stage yet, SETUP is last */ - if (xfer->flags_int.control_act) + if ((xfer->status & + XFER_STATUS_CTRLACTIVE) != 0) temp.setup_alt_next = 0; } @@ -949,8 +951,9 @@ at91dci_setup_standard_chain(struct usb_ x++; if (x == xfer->nframes) { - if (xfer->flags_int.control_xfr) { - if (xfer->flags_int.control_act) { + if ((xfer->status & XFER_STATUS_CTRLXFER) != 0) { + if ((xfer->status & + XFER_STATUS_CTRLACTIVE) != 0) { temp.setup_alt_next = 0; } } else { @@ -972,7 +975,7 @@ at91dci_setup_standard_chain(struct usb_ at91dci_setup_standard_chain_sub(&temp); - if (xfer->flags_int.isochronous_xfr) { + if ((xfer->status & XFER_STATUS_ISOCXFER) != 0) { temp.offset += temp.len; } else { /* get next Page Cache pointer */ @@ -981,7 +984,7 @@ at91dci_setup_standard_chain(struct usb_ } /* check for control transfer */ - if (xfer->flags_int.control_xfr) { + if ((xfer->status & XFER_STATUS_CTRLXFER) != 0) { /* always setup a valid "pc" pointer for status and sync */ temp.pc = xfer->frbuffers + 0; @@ -997,7 +1000,7 @@ at91dci_setup_standard_chain(struct usb_ } /* check if we should append a status stage */ - if (!xfer->flags_int.control_act) { + if ((xfer->status & XFER_STATUS_CTRLACTIVE) == 0) { /* * Send a DATA1 message and invert the current @@ -1123,7 +1126,7 @@ at91dci_standard_done_sub(struct usb_xfe } /* Check for short transfer */ if (len > 0) { - if (xfer->flags_int.short_frames_ok) { + if ((xfer->status & XFER_STATUS_SHORTFRAME_OK) != 0) { /* follow alt next */ if (td->alt_next) { td = td->obj_next; @@ -1165,9 +1168,9 @@ at91dci_standard_done(struct usb_xfer *x xfer->td_transfer_cache = xfer->td_transfer_first; - if (xfer->flags_int.control_xfr) { + if ((xfer->status & XFER_STATUS_CTRLXFER) != 0) { - if (xfer->flags_int.control_hdr) { + if ((xfer->status & XFER_STATUS_CTRLHDR) != 0) { err = at91dci_standard_done_sub(xfer); } @@ -1187,8 +1190,8 @@ at91dci_standard_done(struct usb_xfer *x } } - if (xfer->flags_int.control_xfr && - !xfer->flags_int.control_act) { + if ((xfer->status & XFER_STATUS_CTRLXFER) != 0 && + (xfer->status & XFER_STATUS_CTRLACTIVE) == 0) { err = at91dci_standard_done_sub(xfer); } @@ -1213,7 +1216,7 @@ at91dci_device_done(struct usb_xfer *xfe DPRINTFN(2, "xfer=%p, endpoint=%p, error=%d\n", xfer, xfer->endpoint, error); - if (xfer->flags_int.usb_mode == USB_MODE_DEVICE) { + if (xfer->usb_mode == USB_MODE_DEVICE) { ep_no = (xfer->endpointno & UE_ADDR); /* disable endpoint interrupt */ Modified: user/weongyo/usb/sys/dev/usb/controller/atmegadci.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/controller/atmegadci.c Fri Oct 1 20:14:36 2010 (r213337) +++ user/weongyo/usb/sys/dev/usb/controller/atmegadci.c Fri Oct 1 23:13:56 2010 (r213338) @@ -800,16 +800,17 @@ atmegadci_setup_standard_chain(struct us temp.td = NULL; temp.td_next = xfer->td_start[0]; temp.offset = 0; - temp.setup_alt_next = xfer->flags_int.short_frames_ok; - temp.did_stall = !xfer->flags_int.control_stall; + temp.setup_alt_next = (xfer->status & XFER_STATUS_SHORTFRAME_OK) ? + 1 : 0; + temp.did_stall = !(xfer->status & XFER_STATUS_CTRLSTALL); sc = ATMEGA_BUS2SC(xfer->xroot->bus); ep_no = (xfer->endpointno & UE_ADDR); /* check if we should prepend a setup message */ - if (xfer->flags_int.control_xfr) { - if (xfer->flags_int.control_hdr) { + if ((xfer->status & XFER_STATUS_CTRLXFER) != 0) { + if ((xfer->status & XFER_STATUS_CTRLHDR) != 0) { temp.func = &atmegadci_setup_rx; temp.len = xfer->frlengths[0]; @@ -818,7 +819,8 @@ atmegadci_setup_standard_chain(struct us /* check for last frame */ if (xfer->nframes == 1) { /* no STATUS stage yet, SETUP is last */ - if (xfer->flags_int.control_act) + if ((xfer->status & + XFER_STATUS_CTRLACTIVE) != 0) temp.setup_alt_next = 0; } @@ -852,8 +854,9 @@ atmegadci_setup_standard_chain(struct us x++; if (x == xfer->nframes) { - if (xfer->flags_int.control_xfr) { - if (xfer->flags_int.control_act) { + if ((xfer->status & XFER_STATUS_CTRLXFER) != 0) { + if ((xfer->status & + XFER_STATUS_CTRLACTIVE) != 0) { temp.setup_alt_next = 0; } } else { @@ -875,7 +878,7 @@ atmegadci_setup_standard_chain(struct us atmegadci_setup_standard_chain_sub(&temp); - if (xfer->flags_int.isochronous_xfr) { + if ((xfer->status & XFER_STATUS_ISOCXFER) != 0) { temp.offset += temp.len; } else { /* get next Page Cache pointer */ @@ -883,7 +886,7 @@ atmegadci_setup_standard_chain(struct us } } - if (xfer->flags_int.control_xfr) { + if ((xfer->status & XFER_STATUS_CTRLXFER) != 0) { /* always setup a valid "pc" pointer for status and sync */ temp.pc = xfer->frbuffers + 0; @@ -899,7 +902,7 @@ atmegadci_setup_standard_chain(struct us } /* check if we should append a status stage */ - if (!xfer->flags_int.control_act) { + if ((xfer->status & XFER_STATUS_CTRLACTIVE) == 0) { /* * Send a DATA1 message and invert the current @@ -1006,7 +1009,7 @@ atmegadci_standard_done_sub(struct usb_x } /* Check for short transfer */ if (len > 0) { - if (xfer->flags_int.short_frames_ok) { + if ((xfer->status & XFER_STATUS_SHORTFRAME_OK) != 0) { /* follow alt next */ if (td->alt_next) { td = td->obj_next; @@ -1048,9 +1051,9 @@ atmegadci_standard_done(struct usb_xfer xfer->td_transfer_cache = xfer->td_transfer_first; - if (xfer->flags_int.control_xfr) { + if ((xfer->status & XFER_STATUS_CTRLXFER) != 0) { - if (xfer->flags_int.control_hdr) { + if ((xfer->status & XFER_STATUS_CTRLHDR) != 0) { err = atmegadci_standard_done_sub(xfer); } @@ -1070,8 +1073,8 @@ atmegadci_standard_done(struct usb_xfer } } - if (xfer->flags_int.control_xfr && - !xfer->flags_int.control_act) { + if ((xfer->status & XFER_STATUS_CTRLXFER) != 0 && + (xfer->status & XFER_STATUS_CTRLACTIVE) == 0) { err = atmegadci_standard_done_sub(xfer); } @@ -1096,7 +1099,7 @@ atmegadci_device_done(struct usb_xfer *x DPRINTFN(9, "xfer=%p, endpoint=%p, error=%d\n", xfer, xfer->endpoint, error); - if (xfer->flags_int.usb_mode == USB_MODE_DEVICE) { + if (xfer->usb_mode == USB_MODE_DEVICE) { ep_no = (xfer->endpointno & UE_ADDR); /* select endpoint number */ Modified: user/weongyo/usb/sys/dev/usb/controller/avr32dci.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/controller/avr32dci.c Fri Oct 1 20:14:36 2010 (r213337) +++ user/weongyo/usb/sys/dev/usb/controller/avr32dci.c Fri Oct 1 23:13:56 2010 (r213338) @@ -770,16 +770,17 @@ avr32dci_setup_standard_chain(struct usb temp.td = NULL; temp.td_next = xfer->td_start[0]; temp.offset = 0; - temp.setup_alt_next = xfer->flags_int.short_frames_ok; - temp.did_stall = !xfer->flags_int.control_stall; + temp.setup_alt_next = (xfer->status & XFER_STATUS_SHORTFRAME_OK) ? + 1 : 0; + temp.did_stall = !(xfer->status & XFER_STATUS_CTRLSTALL); sc = AVR32_BUS2SC(xfer->xroot->bus); ep_no = (xfer->endpoint & UE_ADDR); /* check if we should prepend a setup message */ - if (xfer->flags_int.control_xfr) { - if (xfer->flags_int.control_hdr) { + if ((xfer->status & XFER_STATUS_CTRLXFER) != 0) { + if ((xfer->status & XFER_STATUS_CTRLHDR) != 0) { temp.func = &avr32dci_setup_rx; temp.len = xfer->frlengths[0]; @@ -788,7 +789,8 @@ avr32dci_setup_standard_chain(struct usb /* check for last frame */ if (xfer->nframes == 1) { /* no STATUS stage yet, SETUP is last */ - if (xfer->flags_int.control_act) + if ((xfer->status & + XFER_STATUS_CTRLACTIVE) != 0) temp.setup_alt_next = 0; } avr32dci_setup_standard_chain_sub(&temp); @@ -821,8 +823,9 @@ avr32dci_setup_standard_chain(struct usb x++; if (x == xfer->nframes) { - if (xfer->flags_int.control_xfr) { - if (xfer->flags_int.control_act) { + if ((xfer->status & XFER_STATUS_CTRLXFER) != 0) { + if ((xfer->status & + XFER_STATUS_CTRLACTIVE) != 0) { temp.setup_alt_next = 0; } } else { @@ -844,7 +847,7 @@ avr32dci_setup_standard_chain(struct usb avr32dci_setup_standard_chain_sub(&temp); - if (xfer->flags_int.isochronous_xfr) { + if ((xfer->status & XFER_STATUS_ISOCXFER) != 0) { temp.offset += temp.len; } else { /* get next Page Cache pointer */ @@ -852,7 +855,7 @@ avr32dci_setup_standard_chain(struct usb } } - if (xfer->flags_int.control_xfr) { + if ((xfer->status & XFER_STATUS_CTRLXFER) != 0) { /* always setup a valid "pc" pointer for status and sync */ temp.pc = xfer->frbuffers + 0; @@ -867,7 +870,7 @@ avr32dci_setup_standard_chain(struct usb avr32dci_setup_standard_chain_sub(&temp); } /* check if we should append a status stage */ - if (!xfer->flags_int.control_act) { + if ((xfer->status & XFER_STATUS_CTRLACTIVE) == 0) { /* * Send a DATA1 message and invert the current @@ -977,7 +980,7 @@ avr32dci_standard_done_sub(struct usb_xf } /* Check for short transfer */ if (len > 0) { - if (xfer->flags_int.short_frames_ok) { + if ((xfer->status & XFER_STATUS_SHORTFRAME_OK) != 0) { /* follow alt next */ if (td->alt_next) { td = td->obj_next; @@ -1019,9 +1022,9 @@ avr32dci_standard_done(struct usb_xfer * xfer->td_transfer_cache = xfer->td_transfer_first; - if (xfer->flags_int.control_xfr) { + if ((xfer->status & XFER_STATUS_CTRLXFER) != 0) { - if (xfer->flags_int.control_hdr) { + if ((xfer->status & XFER_STATUS_CTRLHDR) != 0) { err = avr32dci_standard_done_sub(xfer); } @@ -1041,8 +1044,8 @@ avr32dci_standard_done(struct usb_xfer * } } - if (xfer->flags_int.control_xfr && - !xfer->flags_int.control_act) { + if ((xfer->status & XFER_STATUS_CTRLXFER) != 0 && + (xfer->status & XFER_STATUS_CTRLACTIVE) == 0) { err = avr32dci_standard_done_sub(xfer); } @@ -1067,7 +1070,7 @@ avr32dci_device_done(struct usb_xfer *xf DPRINTFN(9, "xfer=%p, pipe=%p, error=%d\n", xfer, xfer->pipe, error); - if (xfer->flags_int.usb_mode == USB_MODE_DEVICE) { + if (xfer->usb_mode == USB_MODE_DEVICE) { ep_no = (xfer->endpoint & UE_ADDR); /* disable endpoint interrupt */ Modified: user/weongyo/usb/sys/dev/usb/controller/ehci.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/controller/ehci.c Fri Oct 1 20:14:36 2010 (r213337) +++ user/weongyo/usb/sys/dev/usb/controller/ehci.c Fri Oct 1 23:13:56 2010 (r213338) @@ -1207,7 +1207,7 @@ ehci_non_isoc_done_sub(struct usb_xfer * } /* Check for short transfer */ if (len > 0) { - if (xfer->flags_int.short_frames_ok) { + if ((xfer->status & XFER_STATUS_SHORTFRAME_OK) != 0) { /* follow alt next */ td = td->alt_next; } else { @@ -1269,7 +1269,7 @@ ehci_non_isoc_done(struct usb_xfer *xfer /* extract data toggle directly from the QH's overlay area */ - qh = xfer->qh_start[xfer->flags_int.curr_dma_set]; + qh = xfer->qh_start[xfer->curr_dma_set]; usb_pc_cpu_invalidate(qh->page_cache); @@ -1282,9 +1282,9 @@ ehci_non_isoc_done(struct usb_xfer *xfer xfer->td_transfer_cache = xfer->td_transfer_first; - if (xfer->flags_int.control_xfr) { + if ((xfer->status & XFER_STATUS_CTRLXFER) != 0) { - if (xfer->flags_int.control_hdr) { + if ((xfer->status & XFER_STATUS_CTRLHDR) != 0) { err = ehci_non_isoc_done_sub(xfer); } @@ -1304,8 +1304,8 @@ ehci_non_isoc_done(struct usb_xfer *xfer } } - if (xfer->flags_int.control_xfr && - !xfer->flags_int.control_act) { + if ((xfer->status & XFER_STATUS_CTRLXFER) != 0 && + (xfer->status & XFER_STATUS_CTRLACTIVE) == 0) { err = ehci_non_isoc_done_sub(xfer); } @@ -1395,7 +1395,7 @@ ehci_check_transfer(struct usb_xfer *xfe */ td = xfer->td_transfer_cache; - qh = xfer->qh_start[xfer->flags_int.curr_dma_set]; + qh = xfer->qh_start[xfer->curr_dma_set]; usb_pc_cpu_invalidate(qh->page_cache); @@ -1443,7 +1443,8 @@ ehci_check_transfer(struct usb_xfer *xfe * packet also makes the transfer done */ if (EHCI_QTD_GET_BYTES(status)) { - if (xfer->flags_int.short_frames_ok) { + if ((xfer->status & + XFER_STATUS_SHORTFRAME_OK) != 0) { /* follow alt next */ if (td->alt_next) { td = td->alt_next; @@ -1832,10 +1833,10 @@ ehci_setup_standard_chain(struct usb_xfe temp.sc = EHCI_BUS2SC(xfer->xroot->bus); /* toggle the DMA set we are using */ - xfer->flags_int.curr_dma_set ^= 1; + xfer->curr_dma_set ^= 1; /* get next DMA set */ - td = xfer->td_start[xfer->flags_int.curr_dma_set]; + td = xfer->td_start[xfer->curr_dma_set]; xfer->td_transfer_first = td; xfer->td_transfer_cache = td; @@ -1844,11 +1845,12 @@ ehci_setup_standard_chain(struct usb_xfe temp.td_next = td; temp.qtd_status = 0; temp.last_frame = 0; - temp.setup_alt_next = xfer->flags_int.short_frames_ok; - temp.can_use_next = (xfer->flags_int.control_xfr || + temp.setup_alt_next = (xfer->status & XFER_STATUS_SHORTFRAME_OK) ? + 1 : 0; + temp.can_use_next = ((xfer->status & XFER_STATUS_CTRLXFER) != 0 || (UE_GET_DIR(xfer->endpointno) == UE_DIR_OUT)); - if (xfer->flags_int.control_xfr) { + if ((xfer->status & XFER_STATUS_CTRLXFER) != 0) { if (xfer->endpoint->toggle_next) { /* DATA1 is next */ temp.qtd_status |= @@ -1866,8 +1868,8 @@ ehci_setup_standard_chain(struct usb_xfe } /* check if we should prepend a setup message */ - if (xfer->flags_int.control_xfr) { - if (xfer->flags_int.control_hdr) { + if ((xfer->status & XFER_STATUS_CTRLXFER) != 0) { + if ((xfer->status & XFER_STATUS_CTRLHDR) != 0) { temp.qtd_status &= htohc32(temp.sc, EHCI_QTD_SET_CERR(3)); @@ -1882,7 +1884,8 @@ ehci_setup_standard_chain(struct usb_xfe /* check for last frame */ if (xfer->nframes == 1) { /* no STATUS stage yet, SETUP is last */ - if (xfer->flags_int.control_act) { + if ((xfer->status & + XFER_STATUS_CTRLACTIVE) != 0) { temp.last_frame = 1; temp.setup_alt_next = 0; } @@ -1904,9 +1907,10 @@ ehci_setup_standard_chain(struct usb_xfe x++; if (x == xfer->nframes) { - if (xfer->flags_int.control_xfr) { + if ((xfer->status & XFER_STATUS_CTRLXFER) != 0) { /* no STATUS stage yet, DATA is last */ - if (xfer->flags_int.control_act) { + if ((xfer->status & + XFER_STATUS_CTRLACTIVE) != 0) { temp.last_frame = 1; temp.setup_alt_next = 0; } @@ -1948,8 +1952,8 @@ ehci_setup_standard_chain(struct usb_xfe /* check if we should append a status stage */ - if (xfer->flags_int.control_xfr && - !xfer->flags_int.control_act) { + if ((xfer->status & XFER_STATUS_CTRLXFER) != 0 && + (xfer->status & XFER_STATUS_CTRLACTIVE) == 0) { /* * Send a DATA1 message and invert the current endpoint @@ -1998,7 +2002,7 @@ ehci_setup_standard_chain(struct usb_xfe methods = xfer->endpoint->methods; - qh = xfer->qh_start[xfer->flags_int.curr_dma_set]; + qh = xfer->qh_start[xfer->curr_dma_set]; /* the "qh_link" field is filled when the QH is added */ @@ -2242,11 +2246,11 @@ ehci_device_done(struct usb_xfer *xfer, } #endif - EHCI_REMOVE_QH(xfer->qh_start[xfer->flags_int.curr_dma_set], + EHCI_REMOVE_QH(xfer->qh_start[xfer->curr_dma_set], sc->sc_async_p_last); } if (methods == &ehci_device_intr_methods) { - EHCI_REMOVE_QH(xfer->qh_start[xfer->flags_int.curr_dma_set], + EHCI_REMOVE_QH(xfer->qh_start[xfer->curr_dma_set], sc->sc_intr_p_last[xfer->qh_pos]); } /* @@ -2574,10 +2578,10 @@ ehci_device_isoc_fs_enter(struct usb_xfe plen = xfer->frlengths; /* toggle the DMA set we are using */ - xfer->flags_int.curr_dma_set ^= 1; + xfer->curr_dma_set ^= 1; /* get next DMA set */ - td = xfer->td_start[xfer->flags_int.curr_dma_set]; + td = xfer->td_start[xfer->curr_dma_set]; xfer->td_transfer_first = td; pp_last = &sc->sc_isoc_fs_p_last[xfer->endpoint->isoc_next]; @@ -2866,10 +2870,10 @@ ehci_device_isoc_hs_enter(struct usb_xfe plen = xfer->frlengths; /* toggle the DMA set we are using */ - xfer->flags_int.curr_dma_set ^= 1; + xfer->curr_dma_set ^= 1; /* get next DMA set */ - td = xfer->td_start[xfer->flags_int.curr_dma_set]; + td = xfer->td_start[xfer->curr_dma_set]; xfer->td_transfer_first = td; pp_last = &sc->sc_isoc_hs_p_last[xfer->endpoint->isoc_next]; @@ -3552,7 +3556,7 @@ ehci_xfer_setup(struct usb_setup_params parm->hc_max_packet_size = 0x400; parm->hc_max_packet_count = 1; parm->hc_max_frame_size = EHCI_QTD_PAYLOAD_MAX; - xfer->flags_int.bdma_enable = 1; + xfer->status |= XFER_STATUS_DMAENABLE; usbd_transfer_setup_sub(parm); @@ -3565,7 +3569,7 @@ ehci_xfer_setup(struct usb_setup_params parm->hc_max_packet_size = 0x400; parm->hc_max_packet_count = 1; parm->hc_max_frame_size = EHCI_QTD_PAYLOAD_MAX; - xfer->flags_int.bdma_enable = 1; + xfer->status |= XFER_STATUS_DMAENABLE; usbd_transfer_setup_sub(parm); @@ -3587,7 +3591,7 @@ ehci_xfer_setup(struct usb_setup_params } parm->hc_max_frame_size = EHCI_QTD_PAYLOAD_MAX; - xfer->flags_int.bdma_enable = 1; + xfer->status |= XFER_STATUS_DMAENABLE; usbd_transfer_setup_sub(parm); @@ -3600,7 +3604,7 @@ ehci_xfer_setup(struct usb_setup_params parm->hc_max_packet_size = 0x3FF; parm->hc_max_packet_count = 1; parm->hc_max_frame_size = 0x3FF; - xfer->flags_int.bdma_enable = 1; + xfer->status |= XFER_STATUS_DMAENABLE; usbd_transfer_setup_sub(parm); @@ -3611,7 +3615,7 @@ ehci_xfer_setup(struct usb_setup_params parm->hc_max_packet_size = 0x400; parm->hc_max_packet_count = 3; parm->hc_max_frame_size = 0xC00; - xfer->flags_int.bdma_enable = 1; + xfer->status |= XFER_STATUS_DMAENABLE; usbd_transfer_setup_sub(parm); @@ -3709,7 +3713,7 @@ alloc_dma_set: usb_pc_cpu_flush(pc + n); } } - xfer->td_start[xfer->flags_int.curr_dma_set] = last_obj; + xfer->td_start[xfer->curr_dma_set] = last_obj; last_obj = NULL; @@ -3737,10 +3741,10 @@ alloc_dma_set: usb_pc_cpu_flush(pc + n); } } - xfer->qh_start[xfer->flags_int.curr_dma_set] = last_obj; + xfer->qh_start[xfer->curr_dma_set] = last_obj; - if (!xfer->flags_int.curr_dma_set) { - xfer->flags_int.curr_dma_set = 1; + if (!xfer->curr_dma_set) { + xfer->curr_dma_set = 1; goto alloc_dma_set; } } @@ -3831,11 +3835,11 @@ ehci_device_resume(struct usb_device *ud if ((methods == &ehci_device_bulk_methods) || (methods == &ehci_device_ctrl_methods)) { - EHCI_APPEND_QH(xfer->qh_start[xfer->flags_int.curr_dma_set], + EHCI_APPEND_QH(xfer->qh_start[xfer->curr_dma_set], sc->sc_async_p_last); } if (methods == &ehci_device_intr_methods) { - EHCI_APPEND_QH(xfer->qh_start[xfer->flags_int.curr_dma_set], + EHCI_APPEND_QH(xfer->qh_start[xfer->curr_dma_set], sc->sc_intr_p_last[xfer->qh_pos]); } } @@ -3865,11 +3869,11 @@ ehci_device_suspend(struct usb_device *u if ((methods == &ehci_device_bulk_methods) || (methods == &ehci_device_ctrl_methods)) { - EHCI_REMOVE_QH(xfer->qh_start[xfer->flags_int.curr_dma_set], + EHCI_REMOVE_QH(xfer->qh_start[xfer->curr_dma_set], sc->sc_async_p_last); } if (methods == &ehci_device_intr_methods) { - EHCI_REMOVE_QH(xfer->qh_start[xfer->flags_int.curr_dma_set], + EHCI_REMOVE_QH(xfer->qh_start[xfer->curr_dma_set], sc->sc_intr_p_last[xfer->qh_pos]); } } Modified: user/weongyo/usb/sys/dev/usb/controller/musb_otg.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/controller/musb_otg.c Fri Oct 1 20:14:36 2010 (r213337) +++ user/weongyo/usb/sys/dev/usb/controller/musb_otg.c Fri Oct 1 23:13:56 2010 (r213338) @@ -1147,16 +1147,17 @@ musbotg_setup_standard_chain(struct usb_ temp.td = NULL; temp.td_next = xfer->td_start[0]; temp.offset = 0; - temp.setup_alt_next = xfer->flags_int.short_frames_ok; - temp.did_stall = !xfer->flags_int.control_stall; + temp.setup_alt_next = (xfer->status & XFER_STATUS_SHORTFRAME_OK) ? + 1 : 0; + temp.did_stall = !(xfer->status & XFER_STATUS_CTRLSTALL); sc = MUSBOTG_BUS2SC(xfer->xroot->bus); ep_no = (xfer->endpointno & UE_ADDR); /* check if we should prepend a setup message */ - if (xfer->flags_int.control_xfr) { - if (xfer->flags_int.control_hdr) { + if ((xfer->status & XFER_STATUS_CTRLXFER) != 0) { + if ((xfer->status & XFER_STATUS_CTRLHDR) != 0) { temp.func = &musbotg_setup_rx; temp.len = xfer->frlengths[0]; @@ -1172,12 +1173,12 @@ musbotg_setup_standard_chain(struct usb_ if (x != xfer->nframes) { if (xfer->endpointno & UE_DIR_IN) { - if (xfer->flags_int.control_xfr) + if ((xfer->status & XFER_STATUS_CTRLXFER) != 0) temp.func = &musbotg_setup_data_tx; else temp.func = &musbotg_data_tx; } else { - if (xfer->flags_int.control_xfr) + if ((xfer->status & XFER_STATUS_CTRLXFER) != 0) temp.func = &musbotg_setup_data_rx; else temp.func = &musbotg_data_rx; @@ -1195,8 +1196,9 @@ musbotg_setup_standard_chain(struct usb_ x++; if (x == xfer->nframes) { - if (xfer->flags_int.control_xfr) { - if (xfer->flags_int.control_act) { + if ((xfer->status & XFER_STATUS_CTRLXFER) != 0) { + if ((xfer->status & + XFER_STATUS_CTRLACTIVE) != 0) { temp.setup_alt_next = 0; } } else { @@ -1218,7 +1220,7 @@ musbotg_setup_standard_chain(struct usb_ musbotg_setup_standard_chain_sub(&temp); - if (xfer->flags_int.isochronous_xfr) { + if ((xfer->status & XFER_STATUS_ISOCXFER) != 0) { temp.offset += temp.len; } else { /* get next Page Cache pointer */ @@ -1227,7 +1229,7 @@ musbotg_setup_standard_chain(struct usb_ } /* check for control transfer */ - if (xfer->flags_int.control_xfr) { + if ((xfer->status & XFER_STATUS_CTRLXFER) != 0) { /* always setup a valid "pc" pointer for status and sync */ temp.pc = xfer->frbuffers + 0; @@ -1236,7 +1238,7 @@ musbotg_setup_standard_chain(struct usb_ temp.setup_alt_next = 0; /* check if we should append a status stage */ - if (!xfer->flags_int.control_act) { + if ((xfer->status & XFER_STATUS_CTRLACTIVE) == 0) { /* * Send a DATA1 message and invert the current * endpoint direction. @@ -1374,7 +1376,7 @@ musbotg_standard_done_sub(struct usb_xfe } /* Check for short transfer */ if (len > 0) { - if (xfer->flags_int.short_frames_ok) { + if ((xfer->status & XFER_STATUS_SHORTFRAME_OK) != 0) { /* follow alt next */ if (td->alt_next) { td = td->obj_next; @@ -1416,9 +1418,9 @@ musbotg_standard_done(struct usb_xfer *x xfer->td_transfer_cache = xfer->td_transfer_first; - if (xfer->flags_int.control_xfr) { + if ((xfer->status & XFER_STATUS_CTRLXFER) != 0) { - if (xfer->flags_int.control_hdr) { + if ((xfer->status & XFER_STATUS_CTRLHDR) != 0) { err = musbotg_standard_done_sub(xfer); } @@ -1438,8 +1440,8 @@ musbotg_standard_done(struct usb_xfer *x } } - if (xfer->flags_int.control_xfr && - !xfer->flags_int.control_act) { + if ((xfer->status & XFER_STATUS_CTRLXFER) != 0 && + (xfer->status & XFER_STATUS_CTRLACTIVE) == 0) { err = musbotg_standard_done_sub(xfer); } @@ -1461,7 +1463,7 @@ musbotg_device_done(struct usb_xfer *xfe DPRINTFN(2, "xfer=%p, endpoint=%p, error=%d\n", xfer, xfer->endpoint, error); - if (xfer->flags_int.usb_mode == USB_MODE_DEVICE) { + if (xfer->usb_mode == USB_MODE_DEVICE) { musbotg_ep_int_set(xfer, 0); Modified: user/weongyo/usb/sys/dev/usb/controller/ohci.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/controller/ohci.c Fri Oct 1 20:14:36 2010 (r213337) +++ user/weongyo/usb/sys/dev/usb/controller/ohci.c Fri Oct 1 23:13:56 2010 (r213338) @@ -900,7 +900,7 @@ ohci_non_isoc_done_sub(struct usb_xfer * } /* Check for short transfer */ if (phy_start) { - if (xfer->flags_int.short_frames_ok) { + if ((xfer->status & XFER_STATUS_SHORTFRAME_OK) != 0) { /* follow alt next */ td = td->alt_next; } else { @@ -946,9 +946,9 @@ ohci_non_isoc_done(struct usb_xfer *xfer xfer->td_transfer_cache = xfer->td_transfer_first; - if (xfer->flags_int.control_xfr) { + if ((xfer->status & XFER_STATUS_CTRLXFER) != 0) { - if (xfer->flags_int.control_hdr) { + if ((xfer->status & XFER_STATUS_CTRLHDR) != 0) { err = ohci_non_isoc_done_sub(xfer); } @@ -968,8 +968,8 @@ ohci_non_isoc_done(struct usb_xfer *xfer } } - if (xfer->flags_int.control_xfr && - !xfer->flags_int.control_act) { + if ((xfer->status & XFER_STATUS_CTRLXFER) != 0 && + (xfer->status & XFER_STATUS_CTRLACTIVE) == 0) { err = ohci_non_isoc_done_sub(xfer); } @@ -1031,7 +1031,7 @@ ohci_check_transfer_sub(struct usb_xfer if (td) { - ed = xfer->qh_start[xfer->flags_int.curr_dma_set]; + ed = xfer->qh_start[xfer->curr_dma_set]; ed->ed_headp = td->td_self; usb_pc_cpu_flush(ed->page_cache); @@ -1073,7 +1073,7 @@ ohci_check_transfer(struct usb_xfer *xfe DPRINTFN(13, "xfer=%p checking transfer\n", xfer); - ed = xfer->qh_start[xfer->flags_int.curr_dma_set]; + ed = xfer->qh_start[xfer->curr_dma_set]; usb_pc_cpu_invalidate(ed->page_cache); ed_headp = le32toh(ed->ed_headp); @@ -1085,7 +1085,7 @@ ohci_check_transfer(struct usb_xfer *xfe /* isochronous transfer */ ohci_isoc_done(xfer); } else { - if (xfer->flags_int.short_frames_ok) { + if ((xfer->status & XFER_STATUS_SHORTFRAME_OK) != 0) { ohci_check_transfer_sub(xfer); if (xfer->td_transfer_cache) { /* not finished yet */ @@ -1445,10 +1445,10 @@ ohci_setup_standard_chain(struct usb_xfe temp.max_frame_size = xfer->max_frame_size; /* toggle the DMA set we are using */ - xfer->flags_int.curr_dma_set ^= 1; + xfer->curr_dma_set ^= 1; /* get next DMA set */ - td = xfer->td_start[xfer->flags_int.curr_dma_set]; + td = xfer->td_start[xfer->curr_dma_set]; xfer->td_transfer_first = td; xfer->td_transfer_cache = td; @@ -1456,14 +1456,15 @@ ohci_setup_standard_chain(struct usb_xfe temp.td = NULL; temp.td_next = td; temp.last_frame = 0; - temp.setup_alt_next = xfer->flags_int.short_frames_ok; + temp.setup_alt_next = (xfer->status & XFER_STATUS_SHORTFRAME_OK) ? + 1 : 0; methods = xfer->endpoint->methods; /* check if we should prepend a setup message */ - if (xfer->flags_int.control_xfr) { - if (xfer->flags_int.control_hdr) { + if ((xfer->status & XFER_STATUS_CTRLXFER) != 0) { + if ((xfer->status & XFER_STATUS_CTRLHDR) != 0) { temp.td_flags = htole32(OHCI_TD_SETUP | OHCI_TD_NOCC | OHCI_TD_TOGGLE_0 | OHCI_TD_NOINTR); @@ -1474,7 +1475,8 @@ ohci_setup_standard_chain(struct usb_xfe /* check for last frame */ if (xfer->nframes == 1) { /* no STATUS stage yet, SETUP is last */ - if (xfer->flags_int.control_act) { + if ((xfer->status & + XFER_STATUS_CTRLACTIVE) != 0) { temp.last_frame = 1; temp.setup_alt_next = 0; } @@ -1519,9 +1521,10 @@ ohci_setup_standard_chain(struct usb_xfe x++; if (x == xfer->nframes) { - if (xfer->flags_int.control_xfr) { + if ((xfer->status & XFER_STATUS_CTRLXFER) != 0) { /* no STATUS stage yet, DATA is last */ - if (xfer->flags_int.control_act) { + if ((xfer->status & + XFER_STATUS_CTRLACTIVE) != 0) { temp.last_frame = 1; temp.setup_alt_next = 0; } @@ -1548,8 +1551,8 @@ ohci_setup_standard_chain(struct usb_xfe /* check if we should append a status stage */ - if (xfer->flags_int.control_xfr && - !xfer->flags_int.control_act) { + if ((xfer->status & XFER_STATUS_CTRLXFER) != 0 && + (xfer->status & XFER_STATUS_CTRLACTIVE) == 0) { /* * Send a DATA1 message and invert the current endpoint @@ -1595,7 +1598,7 @@ ohci_setup_standard_chain(struct usb_xfe } #endif - ed = xfer->qh_start[xfer->flags_int.curr_dma_set]; + ed = xfer->qh_start[xfer->curr_dma_set]; ed_flags = (OHCI_ED_SET_FA(xfer->address) | OHCI_ED_SET_EN(UE_GET_ADDR(xfer->endpointno)) | @@ -1680,7 +1683,7 @@ ohci_device_done(struct usb_xfer *xfer, DPRINTFN(2, "xfer=%p, endpoint=%p, error=%d\n", xfer, xfer->endpoint, error); - ed = xfer->qh_start[xfer->flags_int.curr_dma_set]; + ed = xfer->qh_start[xfer->curr_dma_set]; if (ed) { usb_pc_cpu_invalidate(ed->page_cache); } @@ -1932,10 +1935,10 @@ ohci_device_isoc_enter(struct usb_xfer * plen = xfer->frlengths; /* toggle the DMA set we are using */ - xfer->flags_int.curr_dma_set ^= 1; + xfer->curr_dma_set ^= 1; /* get next DMA set */ - td = xfer->td_start[xfer->flags_int.curr_dma_set]; + td = xfer->td_start[xfer->curr_dma_set]; xfer->td_transfer_first = td; @@ -2024,7 +2027,7 @@ ohci_device_isoc_enter(struct usb_xfer * ohci_dump_itds(xfer->td_transfer_first); } #endif - ed = xfer->qh_start[xfer->flags_int.curr_dma_set]; + ed = xfer->qh_start[xfer->curr_dma_set]; if (UE_GET_DIR(xfer->endpointno) == UE_DIR_IN) ed_flags = (OHCI_ED_DIR_IN | OHCI_ED_FORMAT_ISO); @@ -2445,7 +2448,7 @@ ohci_xfer_setup(struct usb_setup_params * calculate ntd and nqh */ if (parm->methods == &ohci_device_ctrl_methods) { - xfer->flags_int.bdma_enable = 1; + xfer->status |= XFER_STATUS_DMAENABLE; usbd_transfer_setup_sub(parm); @@ -2455,7 +2458,7 @@ ohci_xfer_setup(struct usb_setup_params nqh = 1; } else if (parm->methods == &ohci_device_bulk_methods) { - xfer->flags_int.bdma_enable = 1; + xfer->status |= XFER_STATUS_DMAENABLE; usbd_transfer_setup_sub(parm); @@ -2465,7 +2468,7 @@ ohci_xfer_setup(struct usb_setup_params nqh = 1; } else if (parm->methods == &ohci_device_intr_methods) { - xfer->flags_int.bdma_enable = 1; + xfer->status |= XFER_STATUS_DMAENABLE; usbd_transfer_setup_sub(parm); @@ -2475,7 +2478,7 @@ ohci_xfer_setup(struct usb_setup_params nqh = 1; } else if (parm->methods == &ohci_device_isoc_methods) { - xfer->flags_int.bdma_enable = 1; + xfer->status |= XFER_STATUS_DMAENABLE; usbd_transfer_setup_sub(parm); @@ -2549,7 +2552,7 @@ alloc_dma_set: usb_pc_cpu_flush(pc + n); } } - xfer->td_start[xfer->flags_int.curr_dma_set] = last_obj; + xfer->td_start[xfer->curr_dma_set] = last_obj; last_obj = NULL; @@ -2577,10 +2580,10 @@ alloc_dma_set: usb_pc_cpu_flush(pc + n); } } - xfer->qh_start[xfer->flags_int.curr_dma_set] = last_obj; + xfer->qh_start[xfer->curr_dma_set] = last_obj; - if (!xfer->flags_int.curr_dma_set) { - xfer->flags_int.curr_dma_set = 1; + if (!xfer->curr_dma_set) { + xfer->curr_dma_set = 1; goto alloc_dma_set; } } @@ -2656,7 +2659,7 @@ ohci_device_resume(struct usb_device *ud if (xfer->xroot->udev == udev) { methods = xfer->endpoint->methods; - ed = xfer->qh_start[xfer->flags_int.curr_dma_set]; + ed = xfer->qh_start[xfer->curr_dma_set]; if (methods == &ohci_device_bulk_methods) { OHCI_APPEND_QH(ed, sc->sc_bulk_p_last); @@ -2694,7 +2697,7 @@ ohci_device_suspend(struct usb_device *u if (xfer->xroot->udev == udev) { methods = xfer->endpoint->methods; - ed = xfer->qh_start[xfer->flags_int.curr_dma_set]; + ed = xfer->qh_start[xfer->curr_dma_set]; if (methods == &ohci_device_bulk_methods) { OHCI_REMOVE_QH(ed, sc->sc_bulk_p_last); Modified: user/weongyo/usb/sys/dev/usb/controller/uhci.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/controller/uhci.c Fri Oct 1 20:14:36 2010 (r213337) +++ user/weongyo/usb/sys/dev/usb/controller/uhci.c Fri Oct 1 23:13:56 2010 (r213338) @@ -1151,7 +1151,7 @@ uhci_non_isoc_done_sub(struct usb_xfer * } /* Check for short transfer */ if (len != td->len) { - if (xfer->flags_int.short_frames_ok) { + if ((xfer->status & XFER_STATUS_SHORTFRAME_OK) != 0) { /* follow alt next */ td = td->alt_next; } else { @@ -1220,8 +1220,8 @@ uhci_non_isoc_done(struct usb_xfer *xfer xfer->td_transfer_cache = xfer->td_transfer_first; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Sat Oct 2 00:57:41 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6CC5106566B; Sat, 2 Oct 2010 00:57:41 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B4B4E8FC13; Sat, 2 Oct 2010 00:57:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o920vfgI022238; Sat, 2 Oct 2010 00:57:41 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o920vfwt022231; Sat, 2 Oct 2010 00:57:41 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <201010020057.o920vfwt022231@svn.freebsd.org> From: Weongyo Jeong Date: Sat, 2 Oct 2010 00:57:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213339 - in user/weongyo/usb/sys/dev/usb: . controller input misc net quirk serial storage template wlan X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Oct 2010 00:57:41 -0000 Author: weongyo Date: Sat Oct 2 00:57:41 2010 New Revision: 213339 URL: http://svn.freebsd.org/changeset/base/213339 Log: Removes unnecessary spaces and style(9). Modified: user/weongyo/usb/sys/dev/usb/controller/at91dci.c user/weongyo/usb/sys/dev/usb/controller/at91dci_atmelarm.c user/weongyo/usb/sys/dev/usb/controller/atmegadci.c user/weongyo/usb/sys/dev/usb/controller/atmegadci_atmelarm.c user/weongyo/usb/sys/dev/usb/controller/avr32dci.c user/weongyo/usb/sys/dev/usb/controller/ehci.c user/weongyo/usb/sys/dev/usb/controller/ehci_ixp4xx.c user/weongyo/usb/sys/dev/usb/controller/ehci_pci.c user/weongyo/usb/sys/dev/usb/controller/musb_otg.c user/weongyo/usb/sys/dev/usb/controller/musb_otg_atmelarm.c user/weongyo/usb/sys/dev/usb/controller/ohci.c user/weongyo/usb/sys/dev/usb/controller/ohci_atmelarm.c user/weongyo/usb/sys/dev/usb/controller/ohci_pci.c user/weongyo/usb/sys/dev/usb/controller/ohci_s3c24x0.c user/weongyo/usb/sys/dev/usb/controller/uhci.c user/weongyo/usb/sys/dev/usb/controller/usb_controller.c user/weongyo/usb/sys/dev/usb/controller/uss820dci.c user/weongyo/usb/sys/dev/usb/controller/uss820dci_atmelarm.c user/weongyo/usb/sys/dev/usb/input/atp.c user/weongyo/usb/sys/dev/usb/input/uhid.c user/weongyo/usb/sys/dev/usb/input/ukbd.c user/weongyo/usb/sys/dev/usb/input/ums.c user/weongyo/usb/sys/dev/usb/misc/udbp.c user/weongyo/usb/sys/dev/usb/net/if_aue.c user/weongyo/usb/sys/dev/usb/net/if_axe.c user/weongyo/usb/sys/dev/usb/net/if_cdce.c user/weongyo/usb/sys/dev/usb/net/if_cue.c user/weongyo/usb/sys/dev/usb/net/if_kue.c user/weongyo/usb/sys/dev/usb/net/if_rue.c user/weongyo/usb/sys/dev/usb/net/if_udav.c user/weongyo/usb/sys/dev/usb/net/uhso.c user/weongyo/usb/sys/dev/usb/quirk/usb_quirk.c user/weongyo/usb/sys/dev/usb/serial/u3g.c user/weongyo/usb/sys/dev/usb/serial/uark.c user/weongyo/usb/sys/dev/usb/serial/ubsa.c user/weongyo/usb/sys/dev/usb/serial/ubser.c user/weongyo/usb/sys/dev/usb/serial/uchcom.c user/weongyo/usb/sys/dev/usb/serial/ucycom.c user/weongyo/usb/sys/dev/usb/serial/ufoma.c user/weongyo/usb/sys/dev/usb/serial/uftdi.c user/weongyo/usb/sys/dev/usb/serial/ugensa.c user/weongyo/usb/sys/dev/usb/serial/uipaq.c user/weongyo/usb/sys/dev/usb/serial/ulpt.c user/weongyo/usb/sys/dev/usb/serial/umct.c user/weongyo/usb/sys/dev/usb/serial/umodem.c user/weongyo/usb/sys/dev/usb/serial/umoscom.c user/weongyo/usb/sys/dev/usb/serial/uplcom.c user/weongyo/usb/sys/dev/usb/serial/usb_serial.c user/weongyo/usb/sys/dev/usb/serial/uslcom.c user/weongyo/usb/sys/dev/usb/serial/uvisor.c user/weongyo/usb/sys/dev/usb/serial/uvscom.c user/weongyo/usb/sys/dev/usb/storage/umass.c user/weongyo/usb/sys/dev/usb/storage/urio.c user/weongyo/usb/sys/dev/usb/storage/ustorage_fs.c user/weongyo/usb/sys/dev/usb/template/usb_template.c user/weongyo/usb/sys/dev/usb/usb_busdma.c user/weongyo/usb/sys/dev/usb/usb_compat_linux.c user/weongyo/usb/sys/dev/usb/usb_debug.c user/weongyo/usb/sys/dev/usb/usb_dev.c user/weongyo/usb/sys/dev/usb/usb_device.c user/weongyo/usb/sys/dev/usb/usb_dynamic.c user/weongyo/usb/sys/dev/usb/usb_error.c user/weongyo/usb/sys/dev/usb/usb_generic.c user/weongyo/usb/sys/dev/usb/usb_handle_request.c user/weongyo/usb/sys/dev/usb/usb_hid.c user/weongyo/usb/sys/dev/usb/usb_hub.c user/weongyo/usb/sys/dev/usb/usb_lookup.c user/weongyo/usb/sys/dev/usb/usb_mbuf.c user/weongyo/usb/sys/dev/usb/usb_msctest.c user/weongyo/usb/sys/dev/usb/usb_parse.c user/weongyo/usb/sys/dev/usb/usb_request.c user/weongyo/usb/sys/dev/usb/usb_transfer.c user/weongyo/usb/sys/dev/usb/usb_util.c user/weongyo/usb/sys/dev/usb/wlan/if_rum.c user/weongyo/usb/sys/dev/usb/wlan/if_run.c user/weongyo/usb/sys/dev/usb/wlan/if_uath.c user/weongyo/usb/sys/dev/usb/wlan/if_upgt.c user/weongyo/usb/sys/dev/usb/wlan/if_ural.c user/weongyo/usb/sys/dev/usb/wlan/if_zyd.c Modified: user/weongyo/usb/sys/dev/usb/controller/at91dci.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/controller/at91dci.c Fri Oct 1 23:13:56 2010 (r213338) +++ user/weongyo/usb/sys/dev/usb/controller/at91dci.c Sat Oct 2 00:57:41 2010 (r213339) @@ -136,7 +136,6 @@ static void at91dci_root_intr(struct at9 */ static const struct usb_hw_ep_profile at91dci_ep_profile[AT91_UDP_EP_MAX] = { - [0] = { .max_in_frame_size = 8, .max_out_frame_size = 8, @@ -202,6 +201,7 @@ static void at91dci_get_hw_ep_profile(struct usb_device *udev, const struct usb_hw_ep_profile **ppf, uint8_t ep_addr) { + if (ep_addr < AT91_UDP_EP_MAX) { *ppf = (at91dci_ep_profile + ep_addr); } else { @@ -212,11 +212,10 @@ at91dci_get_hw_ep_profile(struct usb_dev static void at91dci_clocks_on(struct at91dci_softc *sc) { + if (sc->sc_flags.clocks_off && sc->sc_flags.port_powered) { - DPRINTFN(5, "\n"); - if (sc->sc_clocks_on) { (sc->sc_clocks_on) (sc->sc_clocks_arg); } @@ -230,8 +229,8 @@ at91dci_clocks_on(struct at91dci_softc * static void at91dci_clocks_off(struct at91dci_softc *sc) { - if (!sc->sc_flags.clocks_off) { + if (!sc->sc_flags.clocks_off) { DPRINTFN(5, "\n"); /* disable Transceiver */ @@ -247,8 +246,8 @@ at91dci_clocks_off(struct at91dci_softc static void at91dci_pull_up(struct at91dci_softc *sc) { - /* pullup D+, if possible */ + /* pullup D+, if possible */ if (!sc->sc_flags.d_pulled_up && sc->sc_flags.port_powered) { sc->sc_flags.d_pulled_up = 1; @@ -259,8 +258,8 @@ at91dci_pull_up(struct at91dci_softc *sc static void at91dci_pull_down(struct at91dci_softc *sc) { - /* pulldown D+, if possible */ + /* pulldown D+, if possible */ if (sc->sc_flags.d_pulled_up) { sc->sc_flags.d_pulled_up = 0; (sc->sc_pull_down) (sc->sc_pull_arg); @@ -270,6 +269,7 @@ at91dci_pull_down(struct at91dci_softc * static void at91dci_wakeup_peer(struct at91dci_softc *sc) { + if (!(sc->sc_flags.status_suspend)) { return; } @@ -286,6 +286,7 @@ at91dci_wakeup_peer(struct at91dci_softc static void at91dci_set_address(struct at91dci_softc *sc, uint8_t addr) { + DPRINTFN(5, "addr=%d\n", addr); AT91_UDP_WRITE_4(sc, AT91_UDP_FADDR, addr | @@ -367,7 +368,6 @@ at91dci_setup_rx(struct at91dci_td *td) bus_space_write_4(td->io_tag, td->io_hdl, td->status_reg, csr); return (0); /* complete */ - not_complete: /* abort any ongoing transfer */ if (!td->did_stall) { @@ -384,7 +384,6 @@ not_complete: td->status_reg, csr); } return (1); /* not complete */ - } static uint8_t @@ -524,7 +523,6 @@ at91dci_data_tx(struct at91dci_td *td) uint8_t to; to = 2; /* don't loop forever! */ - repeat: /* read out FIFO status */ @@ -566,7 +564,6 @@ repeat: count = td->remainder; } while (count > 0) { - usbd_get_page(td->pc, td->offset, &buf_res); /* get correct length */ @@ -649,7 +646,6 @@ repeat: td->status_reg, csr); return (0); /* complete */ - not_complete: if (temp) { /* write command */ @@ -702,7 +698,6 @@ at91dci_xfer_do_fifo(struct usb_xfer *xf td->fifo_bank = 1; } return (1); /* not complete */ - done: sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); temp = (xfer->endpointno & UE_ADDR); @@ -715,7 +710,6 @@ done: } /* compute all actual lengths */ - at91dci_standard_done(xfer); return (0); /* complete */ @@ -738,6 +732,7 @@ repeat: void at91dci_vbus_interrupt(struct at91dci_softc *sc, uint8_t is_on) { + DPRINTFN(5, "vbus = %u\n", is_on); USB_BUS_LOCK(&sc->sc_bus); @@ -778,17 +773,13 @@ at91dci_interrupt(struct at91dci_softc * return; } /* acknowledge interrupts */ - AT91_UDP_WRITE_4(sc, AT91_UDP_ICR, status); /* check for any bus state change interrupts */ - if (status & AT91_UDP_INT_BUS) { - DPRINTFN(5, "real bus interrupt 0x%08x\n", status); if (status & AT91_UDP_INT_END_BR) { - /* set correct state */ sc->sc_flags.status_bus_reset = 1; sc->sc_flags.status_suspend = 0; @@ -837,9 +828,7 @@ at91dci_interrupt(struct at91dci_softc * at91dci_root_intr(sc); } /* check for any endpoint interrupts */ - if (status & AT91_UDP_INT_EPS) { - DPRINTFN(5, "real endpoint interrupt 0x%08x\n", status); at91dci_interrupt_poll(sc); @@ -892,7 +881,6 @@ at91dci_setup_standard_chain(struct usb_ xfer->td_transfer_cache = td; /* setup temp */ - temp.pc = NULL; temp.td = NULL; temp.td_next = xfer->td_start[0]; @@ -905,10 +893,8 @@ at91dci_setup_standard_chain(struct usb_ ep_no = (xfer->endpointno & UE_ADDR); /* check if we should prepend a setup message */ - if ((xfer->status & XFER_STATUS_CTRLXFER) != 0) { if ((xfer->status & XFER_STATUS_CTRLHDR) != 0) { - temp.func = &at91dci_setup_rx; temp.len = xfer->frlengths[0]; temp.pc = xfer->frbuffers + 0; @@ -943,9 +929,7 @@ at91dci_setup_standard_chain(struct usb_ need_sync = 0; } while (x != xfer->nframes) { - /* DATA0 / DATA1 message */ - temp.len = xfer->frlengths[x]; x++; @@ -961,15 +945,11 @@ at91dci_setup_standard_chain(struct usb_ } } if (temp.len == 0) { - /* make sure that we send an USB packet */ - temp.short_pkt = 0; } else { - /* regular data transfer */ - temp.short_pkt = (xfer->flags.force_short_xfer) ? 0 : 1; } @@ -985,7 +965,6 @@ at91dci_setup_standard_chain(struct usb_ /* check for control transfer */ if ((xfer->status & XFER_STATUS_CTRLXFER) != 0) { - /* always setup a valid "pc" pointer for status and sync */ temp.pc = xfer->frbuffers + 0; temp.len = 0; @@ -1001,7 +980,6 @@ at91dci_setup_standard_chain(struct usb_ /* check if we should append a status stage */ if ((xfer->status & XFER_STATUS_CTRLACTIVE) == 0) { - /* * Send a DATA1 message and invert the current * endpoint direction. @@ -1050,11 +1028,11 @@ at91dci_timeout(void *arg) static void at91dci_start_standard_chain(struct usb_xfer *xfer) { + DPRINTFN(9, "\n"); /* poll one time */ if (at91dci_xfer_do_fifo(xfer)) { - struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); uint8_t ep_no = xfer->endpointno & UE_ADDR; @@ -1081,6 +1059,7 @@ at91dci_start_standard_chain(struct usb_ static void at91dci_root_intr(struct at91dci_softc *sc) { + DPRINTFN(9, "\n"); USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); @@ -1149,7 +1128,6 @@ at91dci_standard_done_sub(struct usb_xfe } while (0); /* update transfer cache */ - xfer->td_transfer_cache = td; return (error ? @@ -1165,13 +1143,10 @@ at91dci_standard_done(struct usb_xfer *x xfer, xfer->endpoint); /* reset scanner */ - xfer->td_transfer_cache = xfer->td_transfer_first; if ((xfer->status & XFER_STATUS_CTRLXFER) != 0) { - if ((xfer->status & XFER_STATUS_CTRLHDR) != 0) { - err = at91dci_standard_done_sub(xfer); } xfer->aframes = 1; @@ -1181,7 +1156,6 @@ at91dci_standard_done(struct usb_xfer *x } } while (xfer->aframes != xfer->nframes) { - err = at91dci_standard_done_sub(xfer); xfer->aframes++; @@ -1192,7 +1166,6 @@ at91dci_standard_done(struct usb_xfer *x if ((xfer->status & XFER_STATUS_CTRLXFER) != 0 && (xfer->status & XFER_STATUS_CTRLACTIVE) == 0) { - err = at91dci_standard_done_sub(xfer); } done: @@ -1292,7 +1265,6 @@ at91dci_clear_stall_sub(struct at91dci_s /* release FIFO banks, if any */ for (to = 0; to != 2; to++) { - /* get csr value */ csr_val = AT91_UDP_READ_4(sc, csr_reg); @@ -1392,7 +1364,6 @@ at91dci_init(struct at91dci_softc *sc) USB_BUS_LOCK(&sc->sc_bus); /* turn on clocks */ - if (sc->sc_clocks_on) { (sc->sc_clocks_on) (sc->sc_clocks_arg); } @@ -1400,44 +1371,35 @@ at91dci_init(struct at91dci_softc *sc) usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 1000); /* disable and clear all interrupts */ - AT91_UDP_WRITE_4(sc, AT91_UDP_IDR, 0xFFFFFFFF); AT91_UDP_WRITE_4(sc, AT91_UDP_ICR, 0xFFFFFFFF); /* compute default CSR value */ - csr_val = 0; AT91_CSR_ACK(csr_val, 0); /* disable all endpoints */ - for (n = 0; n != AT91_UDP_EP_MAX; n++) { - /* disable endpoint */ AT91_UDP_WRITE_4(sc, AT91_UDP_CSR(n), csr_val); } /* enable the control endpoint */ - AT91_CSR_ACK(csr_val, AT91_UDP_CSR_ET_CTRL | AT91_UDP_CSR_EPEDS); /* write to FIFO control register */ - AT91_UDP_WRITE_4(sc, AT91_UDP_CSR(0), csr_val); /* enable the interrupts we want */ - AT91_UDP_WRITE_4(sc, AT91_UDP_IER, AT91_UDP_INT_BUS); /* turn off clocks */ - at91dci_clocks_off(sc); USB_BUS_UNLOCK(&sc->sc_bus); /* catch any lost interrupts */ - at91dci_do_poll(&sc->sc_bus); return (0); /* success */ @@ -1446,6 +1408,7 @@ at91dci_init(struct at91dci_softc *sc) void at91dci_uninit(struct at91dci_softc *sc) { + USB_BUS_LOCK(&sc->sc_bus); /* disable and clear all interrupts */ @@ -1467,12 +1430,14 @@ at91dci_uninit(struct at91dci_softc *sc) void at91dci_suspend(struct at91dci_softc *sc) { + return; } void at91dci_resume(struct at91dci_softc *sc) { + return; } @@ -1623,7 +1588,6 @@ at91dci_device_isoc_fs_enter(struct usb_ xfer, xfer->endpoint->isoc_next, xfer->nframes); /* get the current frame index */ - nframes = AT91_UDP_READ_4(sc, AT91_UDP_FRM); /* @@ -1789,7 +1753,6 @@ at91dci_roothub_exec(struct usb_device * index = UGETW(req->wIndex); /* demultiplex the control request */ - switch (req->bmRequestType) { case UT_READ_DEVICE: switch (req->bRequest) { @@ -2111,7 +2074,6 @@ tr_handle_get_port_status: } /* Select FULL-speed and Device Side Mode */ - value = UPS_PORT_MODE_DEVICE; if (sc->sc_flags.port_powered) { @@ -2193,24 +2155,19 @@ at91dci_xfer_setup(struct usb_setup_para * compute maximum number of TDs */ if (parm->methods == &at91dci_device_ctrl_methods) { - ntd = xfer->nframes + 1 /* STATUS */ + 1 /* SYNC 1 */ + 1 /* SYNC 2 */ ; } else if (parm->methods == &at91dci_device_bulk_methods) { - ntd = xfer->nframes + 1 /* SYNC */ ; } else if (parm->methods == &at91dci_device_intr_methods) { - ntd = xfer->nframes + 1 /* SYNC */ ; } else if (parm->methods == &at91dci_device_isoc_fs_methods) { - ntd = xfer->nframes + 1 /* SYNC */ ; } else { - ntd = 0; } @@ -2229,7 +2186,6 @@ at91dci_xfer_setup(struct usb_setup_para * get profile stuff */ if (ntd) { - ep_no = xfer->endpointno & UE_ADDR; at91dci_get_hw_ep_profile(parm->udev, &pf, ep_no); @@ -2247,11 +2203,9 @@ at91dci_xfer_setup(struct usb_setup_para parm->size[0] += ((-parm->size[0]) & (USB_HOST_ALIGN - 1)); for (n = 0; n != ntd; n++) { - struct at91dci_td *td; if (parm->buf) { - td = USB_ADD_BYTES(parm->buf, parm->size[0]); /* init TD */ @@ -2291,7 +2245,6 @@ at91dci_ep_init(struct usb_device *udev, sc->sc_rt_addr); if (udev->device_index != sc->sc_rt_addr) { - if (udev->flags.usb_mode != USB_MODE_DEVICE) { /* not supported */ return; Modified: user/weongyo/usb/sys/dev/usb/controller/at91dci_atmelarm.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/controller/at91dci_atmelarm.c Fri Oct 1 23:13:56 2010 (r213338) +++ user/weongyo/usb/sys/dev/usb/controller/at91dci_atmelarm.c Sat Oct 2 00:57:41 2010 (r213339) @@ -94,11 +94,9 @@ at91_vbus_poll(struct at91_udp_softc *sc uint8_t vbus_val; /* XXX temporary clear interrupts here */ - temp = at91_pio_gpio_clear_interrupt(VBUS_BASE); /* just forward it */ - vbus_val = at91_pio_gpio_get(VBUS_BASE, VBUS_MASK); at91dci_vbus_interrupt(&sc->sc_dci, vbus_val); } @@ -124,18 +122,21 @@ at91_udp_clocks_off(void *arg) static void at91_udp_pull_up(void *arg) { + at91_pio_gpio_set(PULLUP_BASE, PULLUP_MASK); } static void at91_udp_pull_down(void *arg) { + at91_pio_gpio_clear(PULLUP_BASE, PULLUP_MASK); } static int at91_udp_probe(device_t dev) { + device_set_desc(dev, "AT91 integrated AT91_UDP controller"); return (0); } @@ -148,7 +149,6 @@ at91_udp_attach(device_t dev) int rid; /* setup AT9100 USB device controller interface softc */ - sc->sc_dci.sc_clocks_on = &at91_udp_clocks_on; sc->sc_dci.sc_clocks_off = &at91_udp_clocks_off; sc->sc_dci.sc_clocks_arg = sc; Modified: user/weongyo/usb/sys/dev/usb/controller/atmegadci.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/controller/atmegadci.c Fri Oct 1 23:13:56 2010 (r213338) +++ user/weongyo/usb/sys/dev/usb/controller/atmegadci.c Sat Oct 2 00:57:41 2010 (r213339) @@ -110,7 +110,6 @@ static void atmegadci_root_intr(struct a */ static const struct usb_hw_ep_profile atmegadci_ep_profile[2] = { - [0] = { .max_in_frame_size = 64, .max_out_frame_size = 64, @@ -133,6 +132,7 @@ static void atmegadci_get_hw_ep_profile(struct usb_device *udev, const struct usb_hw_ep_profile **ppf, uint8_t ep_addr) { + if (ep_addr == 0) *ppf = atmegadci_ep_profile; else if (ep_addr < ATMEGA_EP_MAX) @@ -144,9 +144,9 @@ atmegadci_get_hw_ep_profile(struct usb_d static void atmegadci_clocks_on(struct atmegadci_softc *sc) { + if (sc->sc_flags.clocks_off && sc->sc_flags.port_powered) { - DPRINTFN(5, "\n"); /* turn on clocks */ @@ -166,12 +166,11 @@ atmegadci_clocks_on(struct atmegadci_sof static void atmegadci_clocks_off(struct atmegadci_softc *sc) { - if (!sc->sc_flags.clocks_off) { + if (!sc->sc_flags.clocks_off) { DPRINTFN(5, "\n"); /* disable Transceiver ? */ - ATMEGA_WRITE_1(sc, ATMEGA_USBCON, ATMEGA_USBCON_USBE | ATMEGA_USBCON_OTGPADE | @@ -188,8 +187,8 @@ atmegadci_clocks_off(struct atmegadci_so static void atmegadci_pull_up(struct atmegadci_softc *sc) { - /* pullup D+, if possible */ + /* pullup D+, if possible */ if (!sc->sc_flags.d_pulled_up && sc->sc_flags.port_powered) { sc->sc_flags.d_pulled_up = 1; @@ -200,8 +199,8 @@ atmegadci_pull_up(struct atmegadci_softc static void atmegadci_pull_down(struct atmegadci_softc *sc) { - /* pulldown D+, if possible */ + /* pulldown D+, if possible */ if (sc->sc_flags.d_pulled_up) { sc->sc_flags.d_pulled_up = 0; ATMEGA_WRITE_1(sc, ATMEGA_UDCON, ATMEGA_UDCON_DETACH); @@ -230,6 +229,7 @@ atmegadci_wakeup_peer(struct atmegadci_s static void atmegadci_set_address(struct atmegadci_softc *sc, uint8_t addr) { + DPRINTFN(5, "addr=%d\n", addr); addr |= ATMEGA_UDADDR_ADDEN; @@ -446,7 +446,6 @@ atmegadci_data_tx(struct atmegadci_td *t uint8_t temp; to = 3; /* don't loop forever! */ - /* get pointer to softc */ sc = ATMEGA_PC2SC(td->pc); @@ -482,7 +481,6 @@ repeat: count = td->remainder; } while (count > 0) { - usbd_get_page(td->pc, td->offset, &buf_res); /* get correct length */ @@ -604,7 +602,6 @@ atmegadci_xfer_do_fifo(struct usb_xfer * done: /* compute all actual lengths */ - atmegadci_standard_done(xfer); return (0); /* complete */ } @@ -626,6 +623,7 @@ repeat: static void atmegadci_vbus_interrupt(struct atmegadci_softc *sc, uint8_t is_on) { + DPRINTFN(5, "vbus = %u\n", is_on); if (is_on) { @@ -633,7 +631,6 @@ atmegadci_vbus_interrupt(struct atmegadc sc->sc_flags.status_vbus = 1; /* complete root HUB interrupt endpoint */ - atmegadci_root_intr(sc); } } else { @@ -645,7 +642,6 @@ atmegadci_vbus_interrupt(struct atmegadc sc->sc_flags.change_connect = 1; /* complete root HUB interrupt endpoint */ - atmegadci_root_intr(sc); } } @@ -668,7 +664,6 @@ atmegadci_interrupt(struct atmegadci_sof /* check for any bus state change interrupts */ if (status & ATMEGA_UDINT_EORSTI) { - DPRINTFN(5, "end of reset\n"); /* set correct state */ @@ -691,7 +686,6 @@ atmegadci_interrupt(struct atmegadci_sof * milliseconds of inactivity on the USB BUS. */ if (status & ATMEGA_UDINT_WAKEUPI) { - DPRINTFN(5, "resume interrupt\n"); if (sc->sc_flags.status_suspend) { @@ -708,7 +702,6 @@ atmegadci_interrupt(struct atmegadci_sof atmegadci_root_intr(sc); } } else if (status & ATMEGA_UDINT_SUSPI) { - DPRINTFN(5, "suspend interrupt\n"); if (!sc->sc_flags.status_suspend) { @@ -743,7 +736,6 @@ atmegadci_interrupt(struct atmegadci_sof status = ATMEGA_READ_1(sc, ATMEGA_UEINT); /* the hardware will clear the UEINT bits automatically */ if (status) { - DPRINTFN(5, "real endpoint interrupt UEINT=0x%02x\n", status); atmegadci_interrupt_poll(sc); @@ -795,7 +787,6 @@ atmegadci_setup_standard_chain(struct us xfer->td_transfer_cache = td; /* setup temp */ - temp.pc = NULL; temp.td = NULL; temp.td_next = xfer->td_start[0]; @@ -808,10 +799,8 @@ atmegadci_setup_standard_chain(struct us ep_no = (xfer->endpointno & UE_ADDR); /* check if we should prepend a setup message */ - if ((xfer->status & XFER_STATUS_CTRLXFER) != 0) { if ((xfer->status & XFER_STATUS_CTRLHDR) != 0) { - temp.func = &atmegadci_setup_rx; temp.len = xfer->frlengths[0]; temp.pc = xfer->frbuffers + 0; @@ -846,9 +835,7 @@ atmegadci_setup_standard_chain(struct us need_sync = 0; } while (x != xfer->nframes) { - /* DATA0 / DATA1 message */ - temp.len = xfer->frlengths[x]; x++; @@ -864,15 +851,11 @@ atmegadci_setup_standard_chain(struct us } } if (temp.len == 0) { - /* make sure that we send an USB packet */ - temp.short_pkt = 0; } else { - /* regular data transfer */ - temp.short_pkt = (xfer->flags.force_short_xfer) ? 0 : 1; } @@ -887,7 +870,6 @@ atmegadci_setup_standard_chain(struct us } if ((xfer->status & XFER_STATUS_CTRLXFER) != 0) { - /* always setup a valid "pc" pointer for status and sync */ temp.pc = xfer->frbuffers + 0; temp.len = 0; @@ -903,7 +885,6 @@ atmegadci_setup_standard_chain(struct us /* check if we should append a status stage */ if ((xfer->status & XFER_STATUS_CTRLACTIVE) == 0) { - /* * Send a DATA1 message and invert the current * endpoint direction. @@ -945,11 +926,11 @@ atmegadci_timeout(void *arg) static void atmegadci_start_standard_chain(struct usb_xfer *xfer) { + DPRINTFN(9, "\n"); /* poll one time - will turn on interrupts */ if (atmegadci_xfer_do_fifo(xfer)) { - /* put transfer on interrupt queue */ usbd_transfer_enqueue(&xfer->xroot->bus->intr_q, xfer); @@ -964,6 +945,7 @@ atmegadci_start_standard_chain(struct us static void atmegadci_root_intr(struct atmegadci_softc *sc) { + DPRINTFN(9, "\n"); USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); @@ -1032,7 +1014,6 @@ atmegadci_standard_done_sub(struct usb_x } while (0); /* update transfer cache */ - xfer->td_transfer_cache = td; return (error ? @@ -1048,13 +1029,10 @@ atmegadci_standard_done(struct usb_xfer xfer, xfer->endpoint); /* reset scanner */ - xfer->td_transfer_cache = xfer->td_transfer_first; if ((xfer->status & XFER_STATUS_CTRLXFER) != 0) { - if ((xfer->status & XFER_STATUS_CTRLHDR) != 0) { - err = atmegadci_standard_done_sub(xfer); } xfer->aframes = 1; @@ -1064,7 +1042,6 @@ atmegadci_standard_done(struct usb_xfer } } while (xfer->aframes != xfer->nframes) { - err = atmegadci_standard_done_sub(xfer); xfer->aframes++; @@ -1075,7 +1052,6 @@ atmegadci_standard_done(struct usb_xfer if ((xfer->status & XFER_STATUS_CTRLXFER) != 0 && (xfer->status & XFER_STATUS_CTRLACTIVE) == 0) { - err = atmegadci_standard_done_sub(xfer); } done: @@ -1291,7 +1267,6 @@ atmegadci_init(struct atmegadci_softc *s /* disable all endpoints */ for (n = 0; n != ATMEGA_EP_MAX; n++) { - /* select endpoint */ ATMEGA_WRITE_1(sc, ATMEGA_UENUM, n); @@ -1303,18 +1278,15 @@ atmegadci_init(struct atmegadci_softc *s } /* turn off clocks */ - atmegadci_clocks_off(sc); /* read initial VBUS state */ - n = ATMEGA_READ_1(sc, ATMEGA_USBSTA); atmegadci_vbus_interrupt(sc, n & ATMEGA_USBSTA_VBUS); USB_BUS_UNLOCK(&sc->sc_bus); /* catch any lost interrupts */ - atmegadci_do_poll(&sc->sc_bus); return (0); /* success */ @@ -1323,6 +1295,7 @@ atmegadci_init(struct atmegadci_softc *s void atmegadci_uninit(struct atmegadci_softc *sc) { + USB_BUS_LOCK(&sc->sc_bus); /* turn on clocks */ @@ -1357,12 +1330,14 @@ atmegadci_uninit(struct atmegadci_softc void atmegadci_suspend(struct atmegadci_softc *sc) { + return; } void atmegadci_resume(struct atmegadci_softc *sc) { + return; } @@ -1384,24 +1359,28 @@ atmegadci_do_poll(struct usb_bus *bus) static void atmegadci_device_non_isoc_open(struct usb_xfer *xfer) { + return; } static void atmegadci_device_non_isoc_close(struct usb_xfer *xfer) { + atmegadci_device_done(xfer, USB_ERR_CANCELLED); } static void atmegadci_device_non_isoc_enter(struct usb_xfer *xfer) { + return; } static void atmegadci_device_non_isoc_start(struct usb_xfer *xfer) { + /* setup TDs */ atmegadci_setup_standard_chain(xfer); atmegadci_start_standard_chain(xfer); @@ -1421,12 +1400,14 @@ struct usb_pipe_methods atmegadci_device static void atmegadci_device_isoc_fs_open(struct usb_xfer *xfer) { + return; } static void atmegadci_device_isoc_fs_close(struct usb_xfer *xfer) { + atmegadci_device_done(xfer, USB_ERR_CANCELLED); } @@ -1441,7 +1422,6 @@ atmegadci_device_isoc_fs_enter(struct us xfer, xfer->endpoint->isoc_next, xfer->nframes); /* get the current frame index */ - nframes = (ATMEGA_READ_1(sc, ATMEGA_UDFNUMH) << 8) | (ATMEGA_READ_1(sc, ATMEGA_UDFNUML)); @@ -1489,6 +1469,7 @@ atmegadci_device_isoc_fs_enter(struct us static void atmegadci_device_isoc_fs_start(struct usb_xfer *xfer) { + /* start TD chain */ atmegadci_start_standard_chain(xfer); } @@ -1612,7 +1593,6 @@ atmegadci_roothub_exec(struct usb_device index = UGETW(req->wIndex); /* demultiplex the control request */ - switch (req->bmRequestType) { case UT_READ_DEVICE: switch (req->bRequest) { @@ -1971,7 +1951,6 @@ tr_handle_get_port_status: } /* Select FULL-speed and Device Side Mode */ - value = UPS_PORT_MODE_DEVICE; if (sc->sc_flags.port_powered) { @@ -2047,11 +2026,9 @@ atmegadci_xfer_setup(struct usb_setup_pa * compute maximum number of TDs */ if ((xfer->endpoint->edesc->bmAttributes & UE_XFERTYPE) == UE_CONTROL) { - ntd = xfer->nframes + 1 /* STATUS */ + 1 /* SYNC 1 */ + 1 /* SYNC 2 */ ; } else { - ntd = xfer->nframes + 1 /* SYNC */ ; } @@ -2082,11 +2059,9 @@ atmegadci_xfer_setup(struct usb_setup_pa parm->size[0] += ((-parm->size[0]) & (USB_HOST_ALIGN - 1)); for (n = 0; n != ntd; n++) { - struct atmegadci_td *td; if (parm->buf) { - td = USB_ADD_BYTES(parm->buf, parm->size[0]); /* init TD */ @@ -2123,7 +2098,6 @@ atmegadci_ep_init(struct usb_device *ude sc->sc_rt_addr, udev->device_index); if (udev->device_index != sc->sc_rt_addr) { - if (udev->flags.usb_mode != USB_MODE_DEVICE) { /* not supported */ return; Modified: user/weongyo/usb/sys/dev/usb/controller/atmegadci_atmelarm.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/controller/atmegadci_atmelarm.c Fri Oct 1 23:13:56 2010 (r213338) +++ user/weongyo/usb/sys/dev/usb/controller/atmegadci_atmelarm.c Sat Oct 2 00:57:41 2010 (r213339) @@ -71,18 +71,21 @@ struct atmegadci_super_softc { static void atmegadci_clocks_on(struct usb_bus *bus) { + /* TODO */ } static void atmegadci_clocks_off(struct usb_bus *bus) { + /* TODO */ } static int atmegadci_probe(device_t dev) { + device_set_desc(dev, "ATMEL OTG integrated USB controller"); return (0); } Modified: user/weongyo/usb/sys/dev/usb/controller/avr32dci.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/controller/avr32dci.c Fri Oct 1 23:13:56 2010 (r213338) +++ user/weongyo/usb/sys/dev/usb/controller/avr32dci.c Sat Oct 2 00:57:41 2010 (r213339) @@ -110,7 +110,6 @@ static void avr32dci_root_intr(struct av */ static const struct usb_hw_ep_profile avr32dci_ep_profile[4] = { - [0] = { .max_in_frame_size = 64, .max_out_frame_size = 64, @@ -155,6 +154,7 @@ static void avr32dci_get_hw_ep_profile(struct usb_device *udev, const struct usb_hw_ep_profile **ppf, uint8_t ep_addr) { + if (ep_addr == 0) *ppf = avr32dci_ep_profile; else if (ep_addr < 3) @@ -192,9 +192,9 @@ avr32dci_mod_ien(struct avr32dci_softc * static void avr32dci_clocks_on(struct avr32dci_softc *sc) { + if (sc->sc_flags.clocks_off && sc->sc_flags.port_powered) { - DPRINTFN(5, "\n"); /* turn on clocks */ @@ -209,8 +209,8 @@ avr32dci_clocks_on(struct avr32dci_softc static void avr32dci_clocks_off(struct avr32dci_softc *sc) { - if (!sc->sc_flags.clocks_off) { + if (!sc->sc_flags.clocks_off) { DPRINTFN(5, "\n"); avr32dci_mod_ctrl(sc, 0, AVR32_CTRL_DEV_EN_USBA); @@ -225,8 +225,8 @@ avr32dci_clocks_off(struct avr32dci_soft static void avr32dci_pull_up(struct avr32dci_softc *sc) { - /* pullup D+, if possible */ + /* pullup D+, if possible */ if (!sc->sc_flags.d_pulled_up && sc->sc_flags.port_powered) { sc->sc_flags.d_pulled_up = 1; @@ -237,8 +237,8 @@ avr32dci_pull_up(struct avr32dci_softc * static void avr32dci_pull_down(struct avr32dci_softc *sc) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Sat Oct 2 02:29:10 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC531106564A; Sat, 2 Oct 2010 02:29:10 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9A1F58FC0A; Sat, 2 Oct 2010 02:29:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o922TAK6024133; Sat, 2 Oct 2010 02:29:10 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o922TAma024126; Sat, 2 Oct 2010 02:29:10 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <201010020229.o922TAma024126@svn.freebsd.org> From: Weongyo Jeong Date: Sat, 2 Oct 2010 02:29:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213343 - in user/weongyo/usb/sys/dev/usb: . controller input misc net quirk serial storage template wlan X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Oct 2010 02:29:10 -0000 Author: weongyo Date: Sat Oct 2 02:29:10 2010 New Revision: 213343 URL: http://svn.freebsd.org/changeset/base/213343 Log: no braces for single statement. Modified: user/weongyo/usb/sys/dev/usb/controller/at91dci.c user/weongyo/usb/sys/dev/usb/controller/at91dci_atmelarm.c user/weongyo/usb/sys/dev/usb/controller/atmegadci.c user/weongyo/usb/sys/dev/usb/controller/atmegadci_atmelarm.c user/weongyo/usb/sys/dev/usb/controller/avr32dci.c user/weongyo/usb/sys/dev/usb/controller/ehci.c user/weongyo/usb/sys/dev/usb/controller/ehci_ixp4xx.c user/weongyo/usb/sys/dev/usb/controller/ehci_mv.c user/weongyo/usb/sys/dev/usb/controller/ehci_pci.c user/weongyo/usb/sys/dev/usb/controller/musb_otg.c user/weongyo/usb/sys/dev/usb/controller/musb_otg_atmelarm.c user/weongyo/usb/sys/dev/usb/controller/ohci.c user/weongyo/usb/sys/dev/usb/controller/ohci_atmelarm.c user/weongyo/usb/sys/dev/usb/controller/ohci_pci.c user/weongyo/usb/sys/dev/usb/controller/ohci_s3c24x0.c user/weongyo/usb/sys/dev/usb/controller/uhci.c user/weongyo/usb/sys/dev/usb/controller/uhci_pci.c user/weongyo/usb/sys/dev/usb/controller/usb_controller.c user/weongyo/usb/sys/dev/usb/controller/uss820dci.c user/weongyo/usb/sys/dev/usb/controller/uss820dci_atmelarm.c user/weongyo/usb/sys/dev/usb/input/atp.c user/weongyo/usb/sys/dev/usb/input/uhid.c user/weongyo/usb/sys/dev/usb/input/ukbd.c user/weongyo/usb/sys/dev/usb/input/ums.c user/weongyo/usb/sys/dev/usb/misc/udbp.c user/weongyo/usb/sys/dev/usb/misc/ufm.c user/weongyo/usb/sys/dev/usb/net/if_axe.c user/weongyo/usb/sys/dev/usb/net/if_cdce.c user/weongyo/usb/sys/dev/usb/net/if_udav.c user/weongyo/usb/sys/dev/usb/net/uhso.c user/weongyo/usb/sys/dev/usb/quirk/usb_quirk.c user/weongyo/usb/sys/dev/usb/serial/u3g.c user/weongyo/usb/sys/dev/usb/serial/uark.c user/weongyo/usb/sys/dev/usb/serial/ubsa.c user/weongyo/usb/sys/dev/usb/serial/ubser.c user/weongyo/usb/sys/dev/usb/serial/uchcom.c user/weongyo/usb/sys/dev/usb/serial/ucycom.c user/weongyo/usb/sys/dev/usb/serial/ufoma.c user/weongyo/usb/sys/dev/usb/serial/uftdi.c user/weongyo/usb/sys/dev/usb/serial/ugensa.c user/weongyo/usb/sys/dev/usb/serial/uipaq.c user/weongyo/usb/sys/dev/usb/serial/ulpt.c user/weongyo/usb/sys/dev/usb/serial/umct.c user/weongyo/usb/sys/dev/usb/serial/umodem.c user/weongyo/usb/sys/dev/usb/serial/umoscom.c user/weongyo/usb/sys/dev/usb/serial/uplcom.c user/weongyo/usb/sys/dev/usb/serial/usb_serial.c user/weongyo/usb/sys/dev/usb/serial/uslcom.c user/weongyo/usb/sys/dev/usb/serial/uvisor.c user/weongyo/usb/sys/dev/usb/serial/uvscom.c user/weongyo/usb/sys/dev/usb/storage/umass.c user/weongyo/usb/sys/dev/usb/storage/urio.c user/weongyo/usb/sys/dev/usb/storage/ustorage_fs.c user/weongyo/usb/sys/dev/usb/template/usb_template.c user/weongyo/usb/sys/dev/usb/template/usb_template_cdce.c user/weongyo/usb/sys/dev/usb/template/usb_template_msc.c user/weongyo/usb/sys/dev/usb/template/usb_template_mtp.c user/weongyo/usb/sys/dev/usb/usb_busdma.c user/weongyo/usb/sys/dev/usb/usb_compat_linux.c user/weongyo/usb/sys/dev/usb/usb_debug.c user/weongyo/usb/sys/dev/usb/usb_dev.c user/weongyo/usb/sys/dev/usb/usb_device.c user/weongyo/usb/sys/dev/usb/usb_generic.c user/weongyo/usb/sys/dev/usb/usb_handle_request.c user/weongyo/usb/sys/dev/usb/usb_hid.c user/weongyo/usb/sys/dev/usb/usb_hub.c user/weongyo/usb/sys/dev/usb/usb_lookup.c user/weongyo/usb/sys/dev/usb/usb_mbuf.c user/weongyo/usb/sys/dev/usb/usb_msctest.c user/weongyo/usb/sys/dev/usb/usb_parse.c user/weongyo/usb/sys/dev/usb/usb_request.c user/weongyo/usb/sys/dev/usb/usb_transfer.c user/weongyo/usb/sys/dev/usb/usb_util.c user/weongyo/usb/sys/dev/usb/wlan/if_rum.c user/weongyo/usb/sys/dev/usb/wlan/if_run.c user/weongyo/usb/sys/dev/usb/wlan/if_ural.c user/weongyo/usb/sys/dev/usb/wlan/if_zyd.c Modified: user/weongyo/usb/sys/dev/usb/controller/at91dci.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/controller/at91dci.c Sat Oct 2 01:29:09 2010 (r213342) +++ user/weongyo/usb/sys/dev/usb/controller/at91dci.c Sat Oct 2 02:29:10 2010 (r213343) @@ -204,9 +204,8 @@ at91dci_get_hw_ep_profile(struct usb_dev if (ep_addr < AT91_UDP_EP_MAX) { *ppf = (at91dci_ep_profile + ep_addr); - } else { + } else *ppf = NULL; - } } static void @@ -216,9 +215,8 @@ at91dci_clocks_on(struct at91dci_softc * if (sc->sc_flags.clocks_off && sc->sc_flags.port_powered) { DPRINTFN(5, "\n"); - if (sc->sc_clocks_on) { + if (sc->sc_clocks_on) (sc->sc_clocks_on) (sc->sc_clocks_arg); - } sc->sc_flags.clocks_off = 0; /* enable Transceiver */ @@ -236,9 +234,8 @@ at91dci_clocks_off(struct at91dci_softc /* disable Transceiver */ AT91_UDP_WRITE_4(sc, AT91_UDP_TXVC, AT91_UDP_TXVC_DIS); - if (sc->sc_clocks_off) { + if (sc->sc_clocks_off) (sc->sc_clocks_off) (sc->sc_clocks_arg); - } sc->sc_flags.clocks_off = 1; } } @@ -270,9 +267,8 @@ static void at91dci_wakeup_peer(struct at91dci_softc *sc) { - if (!(sc->sc_flags.status_suspend)) { + if (!(sc->sc_flags.status_suspend)) return; - } AT91_UDP_WRITE_4(sc, AT91_UDP_GSTATE, AT91_UDP_GSTATE_ESR); @@ -315,9 +311,8 @@ at91dci_setup_rx(struct at91dci_td *td) AT91_UDP_CSR_RXSETUP | AT91_UDP_CSR_TXCOMP); - if (!(csr & AT91_UDP_CSR_RXSETUP)) { + if (!(csr & AT91_UDP_CSR_RXSETUP)) goto not_complete; - } /* clear did stall */ td->did_stall = 0; @@ -352,16 +347,14 @@ at91dci_setup_rx(struct at91dci_td *td) if ((req.bmRequestType == UT_WRITE_DEVICE) && (req.bRequest == UR_SET_ADDRESS)) { sc->sc_dv_addr = req.wValue[0] & 0x7F; - } else { + } else sc->sc_dv_addr = 0xFF; - } /* sneak peek the endpoint direction */ if (req.bmRequestType & UE_DIR_IN) { csr |= AT91_UDP_CSR_DIR; - } else { + } else csr &= ~AT91_UDP_CSR_DIR; - } /* write the direction of the control transfer */ AT91_CSR_ACK(csr, temp); @@ -462,9 +455,8 @@ repeat: usbd_get_page(td->pc, td->offset, &buf_res); /* get correct length */ - if (buf_res.length > count) { + if (buf_res.length > count) buf_res.length = count; - } /* receive data */ bus_space_read_multi_1(td->io_tag, td->io_hdl, td->fifo_reg, buf_res.buffer, buf_res.length); @@ -507,9 +499,8 @@ repeat: } /* else need to receive a zero length packet */ } - if (--to) { + if (--to) goto repeat; - } return (1); /* not complete */ } @@ -567,9 +558,8 @@ repeat: usbd_get_page(td->pc, td->offset, &buf_res); /* get correct length */ - if (buf_res.length > count) { + if (buf_res.length > count) buf_res.length = count; - } /* transmit data */ bus_space_write_multi_1(td->io_tag, td->io_hdl, td->fifo_reg, buf_res.buffer, buf_res.length); @@ -587,14 +577,12 @@ repeat: /* check remainder */ if (td->remainder == 0) { - if (td->short_pkt) { + if (td->short_pkt) return (0); /* complete */ - } /* else we need to transmit a short packet */ } - if (--to) { + if (--to) goto repeat; - } return (1); /* not complete */ } @@ -625,12 +613,10 @@ repeat: AT91_UDP_CSR_TXCOMP); /* check status */ - if (csr & AT91_UDP_CSR_TXPKTRDY) { + if (csr & AT91_UDP_CSR_TXPKTRDY) goto not_complete; - } - if (!(csr & AT91_UDP_CSR_TXCOMP)) { + if (!(csr & AT91_UDP_CSR_TXCOMP)) goto not_complete; - } sc = AT9100_DCI_PC2SC(td->pc); if (sc->sc_dv_addr != 0xFF) { /* @@ -671,9 +657,8 @@ at91dci_xfer_do_fifo(struct usb_xfer *xf /* operation in progress */ break; } - if (((void *)td) == xfer->td_transfer_last) { + if (((void *)td) == xfer->td_transfer_last) goto done; - } if (td->error) { goto done; } else if (td->remainder > 0) { @@ -681,9 +666,8 @@ at91dci_xfer_do_fifo(struct usb_xfer *xf * We had a short transfer. If there is no alternate * next, stop processing ! */ - if (!td->alt_next) { + if (!td->alt_next) goto done; - } } /* * Fetch the next transfer descriptor and transfer @@ -705,9 +689,8 @@ done: /* update FIFO bank flag and multi buffer */ if (td->fifo_bank) { sc->sc_ep_flags[temp].fifo_bank = 1; - } else { + } else sc->sc_ep_flags[temp].fifo_bank = 0; - } /* compute all actual lengths */ at91dci_standard_done(xfer); @@ -910,9 +893,8 @@ at91dci_setup_standard_chain(struct usb_ at91dci_setup_standard_chain_sub(&temp); } x = 1; - } else { + } else x = 0; - } if (x != xfer->nframes) { if (xfer->endpointno & UE_DIR_IN) { @@ -925,9 +907,8 @@ at91dci_setup_standard_chain(struct usb_ /* setup "pc" pointer */ temp.pc = xfer->frbuffers + x; - } else { + } else need_sync = 0; - } while (x != xfer->nframes) { /* DATA0 / DATA1 message */ temp.len = xfer->frlengths[x]; @@ -937,12 +918,10 @@ at91dci_setup_standard_chain(struct usb_ if (x == xfer->nframes) { if ((xfer->status & XFER_STATUS_CTRLXFER) != 0) { if ((xfer->status & - XFER_STATUS_CTRLACTIVE) != 0) { + XFER_STATUS_CTRLACTIVE) != 0) temp.setup_alt_next = 0; - } - } else { + } else temp.setup_alt_next = 0; - } } if (temp.len == 0) { /* make sure that we send an USB packet */ @@ -1092,9 +1071,8 @@ at91dci_standard_done_sub(struct usb_xfe */ if (len > xfer->frlengths[xfer->aframes]) { td->error = 1; - } else { + } else xfer->frlengths[xfer->aframes] -= len; - } } /* Check for transfer error */ if (td->error) { @@ -1109,9 +1087,8 @@ at91dci_standard_done_sub(struct usb_xfe /* follow alt next */ if (td->alt_next) { td = td->obj_next; - } else { + } else td = NULL; - } } else { /* the transfer is finished */ td = NULL; @@ -1146,28 +1123,24 @@ at91dci_standard_done(struct usb_xfer *x xfer->td_transfer_cache = xfer->td_transfer_first; if ((xfer->status & XFER_STATUS_CTRLXFER) != 0) { - if ((xfer->status & XFER_STATUS_CTRLHDR) != 0) { + if ((xfer->status & XFER_STATUS_CTRLHDR) != 0) err = at91dci_standard_done_sub(xfer); - } xfer->aframes = 1; - if (xfer->td_transfer_cache == NULL) { + if (xfer->td_transfer_cache == NULL) goto done; - } } while (xfer->aframes != xfer->nframes) { err = at91dci_standard_done_sub(xfer); xfer->aframes++; - if (xfer->td_transfer_cache == NULL) { + if (xfer->td_transfer_cache == NULL) goto done; - } } if ((xfer->status & XFER_STATUS_CTRLXFER) != 0 && - (xfer->status & XFER_STATUS_CTRLACTIVE) == 0) { + (xfer->status & XFER_STATUS_CTRLACTIVE) == 0) err = at91dci_standard_done_sub(xfer); - } done: at91dci_device_done(xfer, err); } @@ -1283,9 +1256,8 @@ at91dci_clear_stall_sub(struct at91dci_s temp = (AT91_UDP_CSR_RX_DATA_BK0 | AT91_UDP_CSR_RX_DATA_BK1); } - } else { + } else temp = 0; - } /* clear FORCESTALL */ temp |= AT91_UDP_CSR_STALLSENT; @@ -1309,12 +1281,10 @@ at91dci_clear_stall_sub(struct at91dci_s csr_val |= AT91_UDP_CSR_ET_BULK; } else if (ep_type == UE_INTERRUPT) { csr_val |= AT91_UDP_CSR_ET_INT; - } else { + } else csr_val |= AT91_UDP_CSR_ET_ISO; - } - if (ep_dir & UE_DIR_IN) { + if (ep_dir & UE_DIR_IN) csr_val |= AT91_UDP_CSR_ET_DIR_IN; - } } /* enable endpoint */ @@ -1364,9 +1334,8 @@ at91dci_init(struct at91dci_softc *sc) USB_BUS_LOCK(&sc->sc_bus); /* turn on clocks */ - if (sc->sc_clocks_on) { + if (sc->sc_clocks_on) (sc->sc_clocks_on) (sc->sc_clocks_arg); - } /* wait a little for things to stabilise */ usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 1000); @@ -1912,16 +1881,14 @@ at91dci_roothub_exec(struct usb_device * tr_handle_get_descriptor: switch (value >> 8) { case UDESC_DEVICE: - if (value & 0xff) { + if (value & 0xff) goto tr_stalled; - } len = sizeof(at91dci_devd); ptr = (const void *)&at91dci_devd; goto tr_valid; case UDESC_CONFIG: - if (value & 0xff) { + if (value & 0xff) goto tr_stalled; - } len = sizeof(at91dci_confd); ptr = (const void *)&at91dci_confd; goto tr_valid; @@ -1961,16 +1928,14 @@ tr_handle_get_status: goto tr_valid; tr_handle_set_address: - if (value & 0xFF00) { + if (value & 0xFF00) goto tr_stalled; - } sc->sc_rt_addr = value; goto tr_valid; tr_handle_set_config: - if (value >= 2) { + if (value >= 2) goto tr_stalled; - } sc->sc_conf = value; goto tr_valid; @@ -1995,9 +1960,8 @@ tr_handle_clear_halt: goto tr_valid; tr_handle_clear_port_feature: - if (index != 1) { + if (index != 1) goto tr_stalled; - } DPRINTFN(9, "UR_CLEAR_PORT_FEATURE on port %d\n", index); switch (value) { @@ -2034,9 +1998,8 @@ tr_handle_clear_port_feature: goto tr_valid; tr_handle_set_port_feature: - if (index != 1) { + if (index != 1) goto tr_stalled; - } DPRINTFN(9, "UR_SET_PORT_FEATURE\n"); switch (value) { @@ -2062,9 +2025,8 @@ tr_handle_get_port_status: DPRINTFN(9, "UR_GET_PORT_STATUS\n"); - if (index != 1) { + if (index != 1) goto tr_stalled; - } if (sc->sc_flags.status_vbus) { at91dci_clocks_on(sc); at91dci_pull_up(sc); @@ -2076,19 +2038,15 @@ tr_handle_get_port_status: /* Select FULL-speed and Device Side Mode */ value = UPS_PORT_MODE_DEVICE; - if (sc->sc_flags.port_powered) { + if (sc->sc_flags.port_powered) value |= UPS_PORT_POWER; - } - if (sc->sc_flags.port_enabled) { + if (sc->sc_flags.port_enabled) value |= UPS_PORT_ENABLED; - } if (sc->sc_flags.status_vbus && - sc->sc_flags.status_bus_reset) { + sc->sc_flags.status_bus_reset) value |= UPS_CURRENT_CONNECT_STATUS; - } - if (sc->sc_flags.status_suspend) { + if (sc->sc_flags.status_suspend) value |= UPS_SUSPEND; - } USETW(sc->sc_hub_temp.ps.wPortStatus, value); value = 0; @@ -2102,17 +2060,15 @@ tr_handle_get_port_status: bzero(sc->sc_ep_flags, sizeof(sc->sc_ep_flags)); } } - if (sc->sc_flags.change_suspend) { + if (sc->sc_flags.change_suspend) value |= UPS_C_SUSPEND; - } USETW(sc->sc_hub_temp.ps.wPortChange, value); len = sizeof(sc->sc_hub_temp.ps); goto tr_valid; tr_handle_get_class_descriptor: - if (value & 0xFF) { + if (value & 0xFF) goto tr_stalled; - } ptr = (const void *)&at91dci_hubd; len = sizeof(at91dci_hubd); goto tr_valid; @@ -2167,16 +2123,14 @@ at91dci_xfer_setup(struct usb_setup_para } else if (parm->methods == &at91dci_device_isoc_fs_methods) { ntd = xfer->nframes + 1 /* SYNC */ ; - } else { + } else ntd = 0; - } /* * check if "usbd_transfer_setup_sub" set an error */ - if (parm->err) { + if (parm->err) return; - } /* * allocate transfer descriptors */ @@ -2214,9 +2168,8 @@ at91dci_xfer_setup(struct usb_setup_para td->max_packet_size = xfer->max_packet_size; td->status_reg = AT91_UDP_CSR(ep_no); td->fifo_reg = AT91_UDP_FDR(ep_no); - if (pf->support_multi_buffer) { + if (pf->support_multi_buffer) td->support_multi_buffer = 1; - } td->obj_next = last_obj; last_obj = td; Modified: user/weongyo/usb/sys/dev/usb/controller/at91dci_atmelarm.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/controller/at91dci_atmelarm.c Sat Oct 2 01:29:09 2010 (r213342) +++ user/weongyo/usb/sys/dev/usb/controller/at91dci_atmelarm.c Sat Oct 2 02:29:10 2010 (r213343) @@ -199,19 +199,16 @@ at91_udp_attach(device_t dev) rid = 0; sc->sc_dci.sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); - if (!(sc->sc_dci.sc_irq_res)) { + if (!(sc->sc_dci.sc_irq_res)) goto error; - } rid = 1; sc->sc_vbus_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); - if (!(sc->sc_vbus_irq_res)) { + if (!(sc->sc_vbus_irq_res)) goto error; - } sc->sc_dci.sc_bus.bdev = device_add_child(dev, "usbus", -1); - if (!(sc->sc_dci.sc_bus.bdev)) { + if (!(sc->sc_dci.sc_bus.bdev)) goto error; - } device_set_ivars(sc->sc_dci.sc_bus.bdev, &sc->sc_dci.sc_bus); #if (__FreeBSD_version >= 700031) @@ -237,9 +234,8 @@ at91_udp_attach(device_t dev) goto error; } err = at91dci_init(&sc->sc_dci); - if (!err) { + if (!err) err = device_probe_and_attach(sc->sc_dci.sc_bus.bdev); - } if (err) { goto error; } else { Modified: user/weongyo/usb/sys/dev/usb/controller/atmegadci.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/controller/atmegadci.c Sat Oct 2 01:29:09 2010 (r213342) +++ user/weongyo/usb/sys/dev/usb/controller/atmegadci.c Sat Oct 2 02:29:10 2010 (r213343) @@ -212,9 +212,8 @@ atmegadci_wakeup_peer(struct atmegadci_s { uint8_t temp; - if (!sc->sc_flags.status_suspend) { + if (!sc->sc_flags.status_suspend) return; - } temp = ATMEGA_READ_1(sc, ATMEGA_UDCON); ATMEGA_WRITE_1(sc, ATMEGA_UDCON, temp | ATMEGA_UDCON_RMWKUP); @@ -256,9 +255,8 @@ atmegadci_setup_rx(struct atmegadci_td * DPRINTFN(5, "UEINTX=0x%02x\n", temp); - if (!(temp & ATMEGA_UEINTX_RXSTPI)) { + if (!(temp & ATMEGA_UEINTX_RXSTPI)) goto not_complete; - } /* clear did stall */ td->did_stall = 0; /* get the packet byte count */ @@ -296,9 +294,8 @@ atmegadci_setup_rx(struct atmegadci_td * sc->sc_dv_addr = req.wValue[0] & 0x7F; /* must write address before ZLP */ ATMEGA_WRITE_1(sc, ATMEGA_UDADDR, sc->sc_dv_addr); - } else { + } else sc->sc_dv_addr = 0xFF; - } /* Clear SETUP packet interrupt and all other previous interrupts */ ATMEGA_WRITE_1(sc, ATMEGA_UEINTX, 0); @@ -399,9 +396,8 @@ repeat: usbd_get_page(td->pc, td->offset, &buf_res); /* get correct length */ - if (buf_res.length > count) { + if (buf_res.length > count) buf_res.length = count; - } /* receive data */ ATMEGA_READ_MULTI_1(sc, ATMEGA_UEDATX, buf_res.buffer, buf_res.length); @@ -426,9 +422,8 @@ repeat: } /* else need to receive a zero length packet */ } - if (--to) { + if (--to) goto repeat; - } not_complete: /* we only want to know if there is a SETUP packet or OUT packet */ ATMEGA_WRITE_1(sc, ATMEGA_UEIENX, @@ -484,9 +479,8 @@ repeat: usbd_get_page(td->pc, td->offset, &buf_res); /* get correct length */ - if (buf_res.length > count) { + if (buf_res.length > count) buf_res.length = count; - } /* transmit data */ ATMEGA_WRITE_MULTI_1(sc, ATMEGA_UEDATX, buf_res.buffer, buf_res.length); @@ -505,14 +499,12 @@ repeat: /* check remainder */ if (td->remainder == 0) { - if (td->short_pkt) { + if (td->short_pkt) return (0); /* complete */ - } /* else we need to transmit a short packet */ } - if (--to) { + if (--to) goto repeat; - } not_complete: /* we only want to know if there is a SETUP packet or free IN packet */ ATMEGA_WRITE_1(sc, ATMEGA_UEIENX, @@ -577,9 +569,8 @@ atmegadci_xfer_do_fifo(struct usb_xfer * /* operation in progress */ break; } - if (((void *)td) == xfer->td_transfer_last) { + if (((void *)td) == xfer->td_transfer_last) goto done; - } if (td->error) { goto done; } else if (td->remainder > 0) { @@ -587,9 +578,8 @@ atmegadci_xfer_do_fifo(struct usb_xfer * * We had a short transfer. If there is no alternate * next, stop processing ! */ - if (!td->alt_next) { + if (!td->alt_next) goto done; - } } /* * Fetch the next transfer descriptor and transfer @@ -816,9 +806,8 @@ atmegadci_setup_standard_chain(struct us atmegadci_setup_standard_chain_sub(&temp); } x = 1; - } else { + } else x = 0; - } if (x != xfer->nframes) { if (xfer->endpointno & UE_DIR_IN) { @@ -831,9 +820,8 @@ atmegadci_setup_standard_chain(struct us /* setup "pc" pointer */ temp.pc = xfer->frbuffers + x; - } else { + } else need_sync = 0; - } while (x != xfer->nframes) { /* DATA0 / DATA1 message */ temp.len = xfer->frlengths[x]; @@ -843,12 +831,10 @@ atmegadci_setup_standard_chain(struct us if (x == xfer->nframes) { if ((xfer->status & XFER_STATUS_CTRLXFER) != 0) { if ((xfer->status & - XFER_STATUS_CTRLACTIVE) != 0) { + XFER_STATUS_CTRLACTIVE) != 0) temp.setup_alt_next = 0; - } - } else { + } else temp.setup_alt_next = 0; - } } if (temp.len == 0) { /* make sure that we send an USB packet */ @@ -978,9 +964,8 @@ atmegadci_standard_done_sub(struct usb_x */ if (len > xfer->frlengths[xfer->aframes]) { td->error = 1; - } else { + } else xfer->frlengths[xfer->aframes] -= len; - } } /* Check for transfer error */ if (td->error) { @@ -995,9 +980,8 @@ atmegadci_standard_done_sub(struct usb_x /* follow alt next */ if (td->alt_next) { td = td->obj_next; - } else { + } else td = NULL; - } } else { /* the transfer is finished */ td = NULL; @@ -1032,28 +1016,24 @@ atmegadci_standard_done(struct usb_xfer xfer->td_transfer_cache = xfer->td_transfer_first; if ((xfer->status & XFER_STATUS_CTRLXFER) != 0) { - if ((xfer->status & XFER_STATUS_CTRLHDR) != 0) { + if ((xfer->status & XFER_STATUS_CTRLHDR) != 0) err = atmegadci_standard_done_sub(xfer); - } xfer->aframes = 1; - if (xfer->td_transfer_cache == NULL) { + if (xfer->td_transfer_cache == NULL) goto done; - } } while (xfer->aframes != xfer->nframes) { err = atmegadci_standard_done_sub(xfer); xfer->aframes++; - if (xfer->td_transfer_cache == NULL) { + if (xfer->td_transfer_cache == NULL) goto done; - } } if ((xfer->status & XFER_STATUS_CTRLXFER) != 0 && - (xfer->status & XFER_STATUS_CTRLACTIVE) == 0) { + (xfer->status & XFER_STATUS_CTRLACTIVE) == 0) err = atmegadci_standard_done_sub(xfer); - } done: atmegadci_device_done(xfer, err); } @@ -1155,12 +1135,10 @@ atmegadci_clear_stall_sub(struct atmegad temp = ATMEGA_UECFG0X_EPTYPE2; } else if (ep_type == UE_INTERRUPT) { temp = ATMEGA_UECFG0X_EPTYPE3; - } else { + } else temp = ATMEGA_UECFG0X_EPTYPE1; - } - if (ep_dir & UE_DIR_IN) { + if (ep_dir & UE_DIR_IN) temp |= ATMEGA_UECFG0X_EPDIR; - } /* two banks, 64-bytes wMaxPacket */ ATMEGA_WRITE_1(sc, ATMEGA_UECFG0X, temp); ATMEGA_WRITE_1(sc, ATMEGA_UECFG1X, @@ -1752,16 +1730,14 @@ atmegadci_roothub_exec(struct usb_device tr_handle_get_descriptor: switch (value >> 8) { case UDESC_DEVICE: - if (value & 0xff) { + if (value & 0xff) goto tr_stalled; - } len = sizeof(atmegadci_devd); ptr = (const void *)&atmegadci_devd; goto tr_valid; case UDESC_CONFIG: - if (value & 0xff) { + if (value & 0xff) goto tr_stalled; - } len = sizeof(atmegadci_confd); ptr = (const void *)&atmegadci_confd; goto tr_valid; @@ -1801,16 +1777,14 @@ tr_handle_get_status: goto tr_valid; tr_handle_set_address: - if (value & 0xFF00) { + if (value & 0xFF00) goto tr_stalled; - } sc->sc_rt_addr = value; goto tr_valid; tr_handle_set_config: - if (value >= 2) { + if (value >= 2) goto tr_stalled; - } sc->sc_conf = value; goto tr_valid; @@ -1835,9 +1809,8 @@ tr_handle_clear_halt: goto tr_valid; tr_handle_clear_port_feature: - if (index != 1) { + if (index != 1) goto tr_stalled; - } DPRINTFN(9, "UR_CLEAR_PORT_FEATURE on port %d\n", index); switch (value) { @@ -1911,9 +1884,8 @@ tr_handle_clear_port_feature: goto tr_valid; tr_handle_set_port_feature: - if (index != 1) { + if (index != 1) goto tr_stalled; - } DPRINTFN(9, "UR_SET_PORT_FEATURE\n"); switch (value) { @@ -1939,9 +1911,8 @@ tr_handle_get_port_status: DPRINTFN(9, "UR_GET_PORT_STATUS\n"); - if (index != 1) { + if (index != 1) goto tr_stalled; - } if (sc->sc_flags.status_vbus) { atmegadci_clocks_on(sc); atmegadci_pull_up(sc); @@ -1953,37 +1924,30 @@ tr_handle_get_port_status: /* Select FULL-speed and Device Side Mode */ value = UPS_PORT_MODE_DEVICE; - if (sc->sc_flags.port_powered) { + if (sc->sc_flags.port_powered) value |= UPS_PORT_POWER; - } - if (sc->sc_flags.port_enabled) { + if (sc->sc_flags.port_enabled) value |= UPS_PORT_ENABLED; - } if (sc->sc_flags.status_vbus && - sc->sc_flags.status_bus_reset) { + sc->sc_flags.status_bus_reset) value |= UPS_CURRENT_CONNECT_STATUS; - } - if (sc->sc_flags.status_suspend) { + if (sc->sc_flags.status_suspend) value |= UPS_SUSPEND; - } USETW(sc->sc_hub_temp.ps.wPortStatus, value); value = 0; - if (sc->sc_flags.change_connect) { + if (sc->sc_flags.change_connect) value |= UPS_C_CONNECT_STATUS; - } - if (sc->sc_flags.change_suspend) { + if (sc->sc_flags.change_suspend) value |= UPS_C_SUSPEND; - } USETW(sc->sc_hub_temp.ps.wPortChange, value); len = sizeof(sc->sc_hub_temp.ps); goto tr_valid; tr_handle_get_class_descriptor: - if (value & 0xFF) { + if (value & 0xFF) goto tr_stalled; - } ptr = (const void *)&atmegadci_hubd; len = sizeof(atmegadci_hubd); goto tr_valid; @@ -2028,9 +1992,8 @@ atmegadci_xfer_setup(struct usb_setup_pa if ((xfer->endpoint->edesc->bmAttributes & UE_XFERTYPE) == UE_CONTROL) { ntd = xfer->nframes + 1 /* STATUS */ + 1 /* SYNC 1 */ + 1 /* SYNC 2 */ ; - } else { + } else ntd = xfer->nframes + 1 /* SYNC */ ; - } /* * check if "usbd_transfer_setup_sub" set an error @@ -2067,9 +2030,8 @@ atmegadci_xfer_setup(struct usb_setup_pa /* init TD */ td->max_packet_size = xfer->max_packet_size; td->ep_no = ep_no; - if (pf->support_multi_buffer) { + if (pf->support_multi_buffer) td->support_multi_buffer = 1; - } td->obj_next = last_obj; last_obj = td; Modified: user/weongyo/usb/sys/dev/usb/controller/atmegadci_atmelarm.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/controller/atmegadci_atmelarm.c Sat Oct 2 01:29:09 2010 (r213342) +++ user/weongyo/usb/sys/dev/usb/controller/atmegadci_atmelarm.c Sat Oct 2 02:29:10 2010 (r213343) @@ -120,13 +120,11 @@ atmegadci_attach(device_t dev) rid = 0; sc->sc_otg.sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); - if (!(sc->sc_otg.sc_irq_res)) { + if (!(sc->sc_otg.sc_irq_res)) goto error; - } sc->sc_otg.sc_bus.bdev = device_add_child(dev, "usbus", -1); - if (!(sc->sc_otg.sc_bus.bdev)) { + if (!(sc->sc_otg.sc_bus.bdev)) goto error; - } device_set_ivars(sc->sc_otg.sc_bus.bdev, &sc->sc_otg.sc_bus); err = bus_setup_intr(dev, sc->sc_otg.sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, @@ -136,12 +134,10 @@ atmegadci_attach(device_t dev) goto error; } err = atmegadci_init(&sc->sc_otg); - if (!err) { + if (!err) err = device_probe_and_attach(sc->sc_otg.sc_bus.bdev); - } - if (err) { + if (err) goto error; - } return (0); error: Modified: user/weongyo/usb/sys/dev/usb/controller/avr32dci.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/controller/avr32dci.c Sat Oct 2 01:29:09 2010 (r213342) +++ user/weongyo/usb/sys/dev/usb/controller/avr32dci.c Sat Oct 2 02:29:10 2010 (r213343) @@ -249,9 +249,8 @@ static void avr32dci_wakeup_peer(struct avr32dci_softc *sc) { - if (!sc->sc_flags.status_suspend) { + if (!sc->sc_flags.status_suspend) return; - } avr32dci_mod_ctrl(sc, AVR32_CTRL_DEV_REWAKEUP, 0); /* wait 8 milliseconds */ @@ -286,9 +285,8 @@ avr32dci_setup_rx(struct avr32dci_td *td DPRINTFN(5, "EPTSTA(%u)=0x%08x\n", td->ep_no, temp); - if (!(temp & AVR32_EPTSTA_RX_SETUP)) { + if (!(temp & AVR32_EPTSTA_RX_SETUP)) goto not_complete; - } /* clear did stall */ td->did_stall = 0; /* get the packet byte count */ @@ -322,9 +320,8 @@ avr32dci_setup_rx(struct avr32dci_td *td avr32dci_mod_ctrl(sc, 0, AVR32_CTRL_DEV_FADDR_EN | AVR32_CTRL_DEV_ADDR); avr32dci_mod_ctrl(sc, sc->sc_dv_addr, 0); - } else { + } else sc->sc_dv_addr = 0xFF; - } /* clear SETUP packet interrupt */ AVR32_WRITE_4(sc, AVR32_EPTCLRSTA(td->ep_no), AVR32_EPTSTA_RX_SETUP); @@ -413,9 +410,8 @@ repeat: usbd_get_page(td->pc, td->offset, &buf_res); /* get correct length */ - if (buf_res.length > count) { + if (buf_res.length > count) buf_res.length = count; - } /* receive data */ bcopy(sc->physdata + (AVR32_EPTSTA_CURRENT_BANK(temp) << td->bank_shift) + @@ -438,9 +434,8 @@ repeat: } /* else need to receive a zero length packet */ } - if (--to) { + if (--to) goto repeat; - } not_complete: return (1); /* not complete */ } @@ -487,9 +482,8 @@ repeat: usbd_get_page(td->pc, td->offset, &buf_res); /* get correct length */ - if (buf_res.length > count) { + if (buf_res.length > count) buf_res.length = count; - } /* transmit data */ bcopy(buf_res.buffer, sc->physdata + (AVR32_EPTSTA_CURRENT_BANK(temp) << td->bank_shift) + @@ -506,14 +500,12 @@ repeat: /* check remainder */ if (td->remainder == 0) { - if (td->short_pkt) { + if (td->short_pkt) return (0); /* complete */ - } /* else we need to transmit a short packet */ } - if (--to) { + if (--to) goto repeat; - } not_complete: return (1); /* not complete */ } @@ -568,9 +560,8 @@ avr32dci_xfer_do_fifo(struct usb_xfer *x /* operation in progress */ break; } - if (((void *)td) == xfer->td_transfer_last) { + if (((void *)td) == xfer->td_transfer_last) goto done; - } if (td->error) { goto done; } else if (td->remainder > 0) { @@ -578,9 +569,8 @@ avr32dci_xfer_do_fifo(struct usb_xfer *x * We had a short transfer. If there is no alternate * next, stop processing ! */ - if (!td->alt_next) { + if (!td->alt_next) goto done; - } } /* * Fetch the next transfer descriptor and transfer @@ -787,9 +777,8 @@ avr32dci_setup_standard_chain(struct usb avr32dci_setup_standard_chain_sub(&temp); } x = 1; - } else { + } else x = 0; - } if (x != xfer->nframes) { if (xfer->endpoint & UE_DIR_IN) { @@ -802,9 +791,8 @@ avr32dci_setup_standard_chain(struct usb /* setup "pc" pointer */ temp.pc = xfer->frbuffers + x; - } else { + } else need_sync = 0; - } while (x != xfer->nframes) { /* DATA0 / DATA1 message */ temp.len = xfer->frlengths[x]; @@ -814,12 +802,10 @@ avr32dci_setup_standard_chain(struct usb if (x == xfer->nframes) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Sat Oct 2 02:46:32 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF387106566C; Sat, 2 Oct 2010 02:46:32 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE5D78FC17; Sat, 2 Oct 2010 02:46:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o922kWDw024518; Sat, 2 Oct 2010 02:46:32 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o922kWQB024496; Sat, 2 Oct 2010 02:46:32 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <201010020246.o922kWQB024496@svn.freebsd.org> From: Weongyo Jeong Date: Sat, 2 Oct 2010 02:46:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213344 - user/weongyo/usb/sys/dev/usb X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Oct 2010 02:46:33 -0000 Author: weongyo Date: Sat Oct 2 02:46:32 2010 New Revision: 213344 URL: http://svn.freebsd.org/changeset/base/213344 Log: White space tweaks and style(9) Modified: user/weongyo/usb/sys/dev/usb/usb_bus.h user/weongyo/usb/sys/dev/usb/usb_busdma.c user/weongyo/usb/sys/dev/usb/usb_compat_linux.c user/weongyo/usb/sys/dev/usb/usb_compat_linux.h user/weongyo/usb/sys/dev/usb/usb_controller.h user/weongyo/usb/sys/dev/usb/usb_dev.c user/weongyo/usb/sys/dev/usb/usb_device.c user/weongyo/usb/sys/dev/usb/usb_device.h user/weongyo/usb/sys/dev/usb/usb_dynamic.c user/weongyo/usb/sys/dev/usb/usb_generic.c user/weongyo/usb/sys/dev/usb/usb_handle_request.c user/weongyo/usb/sys/dev/usb/usb_hid.c user/weongyo/usb/sys/dev/usb/usb_hub.c user/weongyo/usb/sys/dev/usb/usb_hub.h user/weongyo/usb/sys/dev/usb/usb_mbuf.h user/weongyo/usb/sys/dev/usb/usb_msctest.c user/weongyo/usb/sys/dev/usb/usb_request.c user/weongyo/usb/sys/dev/usb/usb_request.h user/weongyo/usb/sys/dev/usb/usb_sleepout.c user/weongyo/usb/sys/dev/usb/usb_transfer.c user/weongyo/usb/sys/dev/usb/usbdi.h Modified: user/weongyo/usb/sys/dev/usb/usb_bus.h ============================================================================== --- user/weongyo/usb/sys/dev/usb/usb_bus.h Sat Oct 2 02:29:10 2010 (r213343) +++ user/weongyo/usb/sys/dev/usb/usb_bus.h Sat Oct 2 02:46:32 2010 (r213344) @@ -94,7 +94,7 @@ struct usb_bus { uint8_t devices_max; /* maximum number of USB devices */ uint8_t do_probe; /* set if USB BUS should be re-probed */ - /* + /* * The scratch area can only be used inside the explore thread * belonging to the give serial bus. */ Modified: user/weongyo/usb/sys/dev/usb/usb_busdma.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/usb_busdma.c Sat Oct 2 02:29:10 2010 (r213343) +++ user/weongyo/usb/sys/dev/usb/usb_busdma.c Sat Oct 2 02:46:32 2010 (r213344) @@ -485,10 +485,10 @@ usb_pc_alloc_mem(struct usb_page_cache * goto error; if (align != 1) { /* - * The alignment must be greater or equal to the - * "size" else the object can be split between two - * memory pages and we get a problem! - */ + * The alignment must be greater or equal to the + * "size" else the object can be split between two + * memory pages and we get a problem! + */ while (align < size) align *= 2; #if 1 Modified: user/weongyo/usb/sys/dev/usb/usb_compat_linux.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/usb_compat_linux.c Sat Oct 2 02:29:10 2010 (r213343) +++ user/weongyo/usb/sys/dev/usb/usb_compat_linux.c Sat Oct 2 02:46:32 2010 (r213344) @@ -394,11 +394,11 @@ usb_submit_urb(struct urb *urb, uint16_t } /* - * Check to see if the urb is in the process of being killed - * and stop a urb that is in the process of being killed from - * being re-submitted (e.g. from its completion callback - * function). - */ + * Check to see if the urb is in the process of being killed + * and stop a urb that is in the process of being killed from + * being re-submitted (e.g. from its completion callback + * function). + */ if (urb->kill_count != 0) { err = -EPERM; goto done; @@ -871,8 +871,10 @@ usb_linux_create_usb_device(struct usb_d (iface_index == 0)) break; if (p_uhe) { - bcopy(ed, &p_uhe->desc, sizeof(p_uhe->desc)); - p_uhe->bsd_iface_index = iface_index - 1; + bcopy(ed, &p_uhe->desc, + sizeof(p_uhe->desc)); + p_uhe->bsd_iface_index = + iface_index - 1; TAILQ_INIT(&p_uhe->bsd_urb_list); p_uhe++; } @@ -886,7 +888,8 @@ usb_linux_create_usb_device(struct usb_d if (id->bLength < sizeof(*id)) break; if (p_uhi) { - bcopy(id, &p_uhi->desc, sizeof(p_uhi->desc)); + bcopy(id, &p_uhi->desc, + sizeof(p_uhi->desc)); p_uhi->desc.bNumEndpoints = 0; p_uhi->endpoint = p_uhe; p_uhi->string = ""; @@ -898,9 +901,11 @@ usb_linux_create_usb_device(struct usb_d if (iface_no_curr != iface_no) { if (p_ui) { p_ui->altsetting = p_uhi - 1; - p_ui->cur_altsetting = p_uhi - 1; + p_ui->cur_altsetting = + p_uhi - 1; p_ui->num_altsetting = 1; - p_ui->bsd_iface_index = iface_index; + p_ui->bsd_iface_index = + iface_index; p_ui->linux_udev = udev; p_ui++; } @@ -960,9 +965,11 @@ usb_alloc_urb(uint16_t iso_packets, uint * FreeBSD specific magic value to ask for control transfer * memory allocation: */ - size = sizeof(*urb) + sizeof(struct usb_device_request) + mem_flags; + size = sizeof(*urb) + sizeof(struct usb_device_request) + + mem_flags; } else - size = sizeof(*urb) + (iso_packets * sizeof(urb->iso_frame_desc[0])); + size = sizeof(*urb) + + (iso_packets * sizeof(urb->iso_frame_desc[0])); urb = malloc(size, M_USBDEV, M_WAITOK | M_ZERO); if (urb) { @@ -1076,7 +1083,8 @@ usb_ifnum_to_if(struct usb_device *dev, * usb_buffer_alloc *------------------------------------------------------------------------*/ void * -usb_buffer_alloc(struct usb_device *dev, usb_size_t size, uint16_t mem_flags, uint8_t *dma_addr) +usb_buffer_alloc(struct usb_device *dev, usb_size_t size, uint16_t mem_flags, + uint8_t *dma_addr) { return (malloc(size, M_USBDEV, M_WAITOK | M_ZERO)); @@ -1321,7 +1329,8 @@ usb_linux_isoc_callback(struct usb_xfer for (x = 0; x < urb->number_of_packets; x++) { uipd = urb->iso_frame_desc + x; if (uipd->length > xfer->frlengths[x]) { - if (urb->transfer_flags & URB_SHORT_NOT_OK) { + if (urb->transfer_flags & + URB_SHORT_NOT_OK) { /* XXX should be EREMOTEIO */ uipd->status = -EPIPE; } else @@ -1387,11 +1396,13 @@ tr_setup: urb = usbd_xfer_get_priv(xfer); } - urb->bsd_isread = (uhe->desc.bEndpointAddress & UE_DIR_IN) ? 1 : 0; + urb->bsd_isread = + (uhe->desc.bEndpointAddress & UE_DIR_IN) ? 1 : 0; if (xfer->flags.ext_buffer) { /* set virtual address to load */ - usbd_xfer_set_frame_data(xfer, 0, urb->transfer_buffer, 0); + usbd_xfer_set_frame_data(xfer, 0, + urb->transfer_buffer, 0); } if (!(urb->bsd_isread)) { /* copy out data with regard to the URB */ @@ -1534,9 +1545,9 @@ tr_setup: if ((xfer->status & XFER_STATUS_CTRLXFER) != 0) { /* - * USB control transfers need special handling. - * First copy in the header, then copy in data! - */ + * USB control transfers need special handling. + * First copy in the header, then copy in data! + */ if (!xfer->flags.ext_buffer) { usbd_copy_in(xfer->frbuffers, 0, urb->setup_packet, REQ_SIZE); @@ -1661,7 +1672,7 @@ usb_bulk_msg(struct usb_device *udev, st if (urb == NULL) return (-ENOMEM); - usb_fill_bulk_urb(urb, udev, uhe, data, len, + usb_fill_bulk_urb(urb, udev, uhe, data, len, usb_linux_wait_complete, NULL); err = usb_start_wait_urb(urb, timeout, pactlen); Modified: user/weongyo/usb/sys/dev/usb/usb_compat_linux.h ============================================================================== --- user/weongyo/usb/sys/dev/usb/usb_compat_linux.h Sat Oct 2 02:29:10 2010 (r213343) +++ user/weongyo/usb/sys/dev/usb/usb_compat_linux.h Sat Oct 2 02:46:32 2010 (r213344) @@ -56,12 +56,12 @@ struct usb_driver { const char *name; int (*probe) (struct usb_interface *intf, - const struct usb_device_id *id); + const struct usb_device_id *id); void (*disconnect) (struct usb_interface *intf); int (*ioctl) (struct usb_interface *intf, unsigned int code, - void *buf); + void *buf); int (*suspend) (struct usb_interface *intf, pm_message_t message); int (*resume) (struct usb_interface *intf); @@ -264,7 +264,7 @@ struct urb { uint8_t bsd_isread; uint8_t kill_count; /* FreeBSD specific */ - struct usb_iso_packet_descriptor iso_frame_desc[]; /* (in) ISO ONLY */ + struct usb_iso_packet_descriptor iso_frame_desc[]; /* (in) ISO ONLY */ }; /* various prototypes */ @@ -291,7 +291,8 @@ void *usb_buffer_alloc(struct usb_devi uint16_t mem_flags, uint8_t *dma_addr); void *usbd_get_intfdata(struct usb_interface *intf); -void usb_buffer_free(struct usb_device *dev, usb_size_t size, void *addr, uint8_t dma_addr); +void usb_buffer_free(struct usb_device *dev, usb_size_t size, void *addr, + uint8_t dma_addr); void usb_free_urb(struct urb *urb); void usb_init_urb(struct urb *urb); void usb_kill_urb(struct urb *urb); Modified: user/weongyo/usb/sys/dev/usb/usb_controller.h ============================================================================== --- user/weongyo/usb/sys/dev/usb/usb_controller.h Sat Oct 2 02:29:10 2010 (r213343) +++ user/weongyo/usb/sys/dev/usb/usb_controller.h Sat Oct 2 02:46:32 2010 (r213344) @@ -96,9 +96,12 @@ struct usb_bus_methods { /* USB Device mode only - Mandatory */ - void (*get_hw_ep_profile) (struct usb_device *udev, const struct usb_hw_ep_profile **ppf, uint8_t ep_addr); - void (*set_stall) (struct usb_device *udev, struct usb_xfer *xfer, struct usb_endpoint *ep, uint8_t *did_stall); - void (*clear_stall) (struct usb_device *udev, struct usb_endpoint *ep); + void (*get_hw_ep_profile) (struct usb_device *udev, + const struct usb_hw_ep_profile **ppf, uint8_t ep_addr); + void (*set_stall) (struct usb_device *udev, struct usb_xfer *xfer, + struct usb_endpoint *ep, uint8_t *did_stall); + void (*clear_stall) (struct usb_device *udev, + struct usb_endpoint *ep); /* Optional transfer polling support */ @@ -194,7 +197,7 @@ struct usb_temp_setup { int usb_bus_struct_init(struct usb_bus *bus, device_t dev, struct usb_device **udevs, uint8_t udevsmax, void (*busmem_func)(struct usb_bus *, - usb_bus_mem_callback_t *)); + usb_bus_mem_callback_t *)); void usb_bus_struct_fini(struct usb_bus *bus); void usb_bus_mem_flush_all(struct usb_bus *bus); uint16_t usb_isoc_time_expand(struct usb_bus *bus, Modified: user/weongyo/usb/sys/dev/usb/usb_dev.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/usb_dev.c Sat Oct 2 02:29:10 2010 (r213343) +++ user/weongyo/usb/sys/dev/usb/usb_dev.c Sat Oct 2 02:46:32 2010 (r213344) @@ -97,7 +97,7 @@ TUNABLE_INT("hw.usb.dev.debug", &usb_fif /* prototypes */ -static int usb_fifo_open(struct usb_cdev_privdata *, +static int usb_fifo_open(struct usb_cdev_privdata *, struct usb_fifo *, int); static void usb_fifo_close(struct usb_fifo *, int); static void usb_dev_init(void *); @@ -112,9 +112,12 @@ static struct usb_endpoint *usb_dev_get_ static void usb_loc_fill(struct usb_fs_privdata *, struct usb_cdev_privdata *); static void usb_close(void *); -static usb_error_t usb_ref_device(struct usb_cdev_privdata *, struct usb_cdev_refdata *, int); -static usb_error_t usb_usb_ref_device(struct usb_cdev_privdata *, struct usb_cdev_refdata *); -static void usb_unref_device(struct usb_cdev_privdata *, struct usb_cdev_refdata *); +static usb_error_t usb_ref_device(struct usb_cdev_privdata *, + struct usb_cdev_refdata *, int); +static usb_error_t usb_usb_ref_device(struct usb_cdev_privdata *, + struct usb_cdev_refdata *); +static void usb_unref_device(struct usb_cdev_privdata *, + struct usb_cdev_refdata *); static d_open_t usb_open; static d_ioctl_t usb_ioctl; @@ -183,7 +186,7 @@ usb_loc_fill(struct usb_fs_privdata* pd, * Else: Failure. *------------------------------------------------------------------------*/ static usb_error_t -usb_ref_device(struct usb_cdev_privdata *cpd, +usb_ref_device(struct usb_cdev_privdata *cpd, struct usb_cdev_refdata *crd, int need_uref) { struct usb_fifo **ppf; @@ -223,7 +226,7 @@ usb_ref_device(struct usb_cdev_privdata mtx_lock(&usb_ref_lock); - /* + /* * Set "is_uref" after grabbing the default SX lock */ crd->is_uref = 1; @@ -637,7 +640,7 @@ usb_dev_get_ep(struct usb_device *udev, * Else: Failure *------------------------------------------------------------------------*/ static int -usb_fifo_open(struct usb_cdev_privdata *cpd, +usb_fifo_open(struct usb_cdev_privdata *cpd, struct usb_fifo *f, int fflags) { int err; @@ -930,7 +933,8 @@ usb_dev_init_post(void *arg) DPRINTFN(0, "Could not create usb bus device\n"); } -SYSINIT(usb_dev_init_post, SI_SUB_KICK_SCHEDULER, SI_ORDER_FIRST, usb_dev_init_post, NULL); +SYSINIT(usb_dev_init_post, SI_SUB_KICK_SCHEDULER, SI_ORDER_FIRST, + usb_dev_init_post, NULL); static void usb_dev_uninit(void *arg) @@ -939,13 +943,13 @@ usb_dev_uninit(void *arg) if (usb_dev != NULL) { destroy_dev(usb_dev); usb_dev = NULL; - } mtx_destroy(&usb_ref_lock); sx_destroy(&usb_sym_lock); } -SYSUNINIT(usb_dev_uninit, SI_SUB_KICK_SCHEDULER, SI_ORDER_ANY, usb_dev_uninit, NULL); +SYSUNINIT(usb_dev_uninit, SI_SUB_KICK_SCHEDULER, SI_ORDER_ANY, + usb_dev_uninit, NULL); static int usb_ioctl_f_sub(struct usb_fifo *f, u_long cmd, void *addr, @@ -957,11 +961,9 @@ usb_ioctl_f_sub(struct usb_fifo *f, u_lo case FIODTYPE: *(int *)addr = 0; /* character device */ break; - case FIONBIO: /* handled by upper FS layer */ break; - case FIOASYNC: if (*(int *)addr) { if (f->async_p != NULL) { @@ -972,7 +974,6 @@ usb_ioctl_f_sub(struct usb_fifo *f, u_lo } else f->async_p = NULL; break; - /* XXX this is not the most general solution */ case TIOCSPGRP: if (f->async_p == NULL) { @@ -995,7 +996,8 @@ usb_ioctl_f_sub(struct usb_fifo *f, u_lo * usb_ioctl - cdev callback *------------------------------------------------------------------------*/ static int -usb_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int fflag, struct thread* td) +usb_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int fflag, + struct thread* td) { struct usb_cdev_refdata refs; struct usb_cdev_privdata* cpd; @@ -1009,7 +1011,7 @@ usb_ioctl(struct cdev *dev, u_long cmd, if (err != 0) return (err); - /* + /* * Performance optimisation: We try to check for IOCTL's that * don't need the USB reference first. Then we grab the USB * reference if we need it! @@ -1678,7 +1680,8 @@ usb_fifo_attach(struct usb_device *udev, * Initialize device private data - this is used to find the * actual USB device itself. */ - pd = malloc(sizeof(struct usb_fs_privdata), M_USBDEV, M_WAITOK | M_ZERO); + pd = malloc(sizeof(struct usb_fs_privdata), M_USBDEV, + M_WAITOK | M_ZERO); pd->bus_index = device_get_unit(udev->bus->bdev); pd->dev_index = udev->device_index; pd->ep_addr = -1; /* not an endpoint */ @@ -1743,7 +1746,7 @@ usb_fifo_free_buffer(struct usb_fifo *f) } static void -usb_fifo_cleanup(void* ptr) +usb_fifo_cleanup(void* ptr) { free(ptr, M_USBDEV); @@ -1762,7 +1765,7 @@ usb_fifo_detach(struct usb_fifo_sc *f_sc f_sc->fp[USB_FIFO_RX] = NULL; if (f_sc->dev != NULL) { - destroy_dev_sched_cb(f_sc->dev, + destroy_dev_sched_cb(f_sc->dev, usb_fifo_cleanup, f_sc->dev->si_drv1); f_sc->dev = NULL; } Modified: user/weongyo/usb/sys/dev/usb/usb_device.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/usb_device.c Sat Oct 2 02:29:10 2010 (r213343) +++ user/weongyo/usb/sys/dev/usb/usb_device.c Sat Oct 2 02:46:32 2010 (r213344) @@ -92,7 +92,7 @@ static void usbd_clear_stall_proc(void * usb_error_t usb_config_parse(struct usb_device *, uint8_t, uint8_t); static void usbd_set_device_strings(struct usb_device *); #if USB_HAVE_UGEN -static void usb_notify_addq(const char *type, struct usb_device *); +static void usb_notify_addq(const char *, struct usb_device *); static void usb_fifo_free_wrap(struct usb_device *, uint8_t, uint8_t); static struct cdev *usb_make_dev(struct usb_device *, int, int); static void usb_cdev_create(struct usb_device *); @@ -675,7 +675,10 @@ usb_config_parse(struct usb_device *udev } else { /* reset endpoint */ memset(ep, 0, sizeof(*ep)); - /* make sure we don't zero the endpoint again */ + /* + * make sure we don't zero + * the endpoint again + */ ep->iface_index = USB_IFACE_INDEX_ANY; } } @@ -699,7 +702,7 @@ usb_config_parse(struct usb_device *udev /* check for specific interface match */ if (cmd == USB_CFG_INIT) { - if ((iface_index != USB_IFACE_INDEX_ANY) && + if ((iface_index != USB_IFACE_INDEX_ANY) && (iface_index != ips.iface_index)) { /* wrong interface */ do_init = 0; @@ -741,7 +744,7 @@ usb_config_parse(struct usb_device *udev ep = udev->endpoints + temp; if (do_init) { - usb_init_endpoint(udev, + usb_init_endpoint(udev, ips.iface_index, ed, ep); } @@ -762,7 +765,7 @@ usb_config_parse(struct usb_device *udev udev->ifaces = NULL; if (udev->ifaces_max != 0) { udev->ifaces = malloc(sizeof(*iface) * udev->ifaces_max, - M_USB, M_WAITOK | M_ZERO); + M_USB, M_WAITOK | M_ZERO); if (udev->ifaces == NULL) { err = USB_ERR_NOMEM; goto done; @@ -770,7 +773,7 @@ usb_config_parse(struct usb_device *udev } if (ep_max != 0) { udev->endpoints = malloc(sizeof(*ep) * ep_max, - M_USB, M_WAITOK | M_ZERO); + M_USB, M_WAITOK | M_ZERO); if (udev->endpoints == NULL) { err = USB_ERR_NOMEM; goto done; @@ -842,7 +845,7 @@ usbd_set_alt_interface_index(struct usb_ goto done; } if (iface->alt_index == alt_index) { - /* + /* * Optimise away duplicate setting of * alternate setting in USB Host Mode! */ @@ -910,9 +913,9 @@ usbd_set_endpoint_stall(struct usb_devic if ((et != UE_BULK) && (et != UE_INTERRUPT)) { /* - * Should not stall control - * nor isochronous endpoints. - */ + * Should not stall control + * nor isochronous endpoints. + */ DPRINTF("Invalid endpoint\n"); return (0); } @@ -1150,7 +1153,8 @@ attached: if (udev->flags.peer_suspended) { err = DEVICE_SUSPEND(iface->subdev); if (err) - device_printf(iface->subdev, "Suspend failed\n"); + device_printf(iface->subdev, + "Suspend failed\n"); } return (0); /* success */ } @@ -1317,7 +1321,8 @@ done: * be executed on an USB device. *------------------------------------------------------------------------*/ static void -usb_suspend_resume_sub(struct usb_device *udev, device_t dev, uint8_t do_suspend) +usb_suspend_resume_sub(struct usb_device *udev, device_t dev, + uint8_t do_suspend) { int err; @@ -1576,7 +1581,8 @@ usb_alloc_device(device_t parent_dev, st /* Setup USB descriptors */ err = (usb_temp_setup_by_index_p) (udev, usb_template); if (err) { - DPRINTFN(0, "setting up USB template failed maybe the USB " + DPRINTFN(0, + "setting up USB template failed maybe the USB " "template module has not been loaded\n"); goto done; } @@ -1751,7 +1757,8 @@ repeat_set_config: err = 0; goto config_done; } - if (!config_quirk && config_index + 1 < udev->ddesc.bNumConfigurations) { + if (!config_quirk && + config_index + 1 < udev->ddesc.bNumConfigurations) { if ((udev->cdesc->bNumInterface < 2) && usbd_get_no_descriptors(udev->cdesc, UDESC_ENDPOINT) == 0) { DPRINTFN(0, "Found no endpoints, trying next config\n"); Modified: user/weongyo/usb/sys/dev/usb/usb_device.h ============================================================================== --- user/weongyo/usb/sys/dev/usb/usb_device.h Sat Oct 2 02:29:10 2010 (r213343) +++ user/weongyo/usb/sys/dev/usb/usb_device.h Sat Oct 2 02:46:32 2010 (r213344) @@ -208,7 +208,8 @@ void usb_devinfo(struct usb_device *udev void usb_free_device(struct usb_device *, uint8_t); void usb_linux_free_device(struct usb_device *dev); uint8_t usb_peer_can_wakeup(struct usb_device *udev); -struct usb_endpoint *usb_endpoint_foreach(struct usb_device *udev, struct usb_endpoint *ep); +struct usb_endpoint *usb_endpoint_foreach(struct usb_device *udev, + struct usb_endpoint *ep); void usb_set_device_state(struct usb_device *udev, enum usb_dev_state state); void usbd_enum_lock(struct usb_device *); Modified: user/weongyo/usb/sys/dev/usb/usb_dynamic.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/usb_dynamic.c Sat Oct 2 02:29:10 2010 (r213343) +++ user/weongyo/usb/sys/dev/usb/usb_dynamic.c Sat Oct 2 02:46:32 2010 (r213344) @@ -60,7 +60,8 @@ static usb_quirk_ioctl_t usb_quirk_ioctl /* global variables */ usb_handle_req_t *usb_temp_get_desc_p = &usb_temp_get_desc_w; -usb_temp_setup_by_index_t *usb_temp_setup_by_index_p = &usb_temp_setup_by_index_w; +usb_temp_setup_by_index_t *usb_temp_setup_by_index_p = + &usb_temp_setup_by_index_w; usb_temp_unsetup_t *usb_temp_unsetup_p = &usb_temp_unsetup_w; usb_test_quirk_t *usb_test_quirk_p = &usb_test_quirk_w; usb_quirk_ioctl_t *usb_quirk_ioctl_p = &usb_quirk_ioctl_w; @@ -88,7 +89,8 @@ usb_quirk_ioctl_w(unsigned long cmd, cad } static usb_error_t -usb_temp_get_desc_w(struct usb_device *udev, struct usb_device_request *req, const void **pPtr, uint16_t *pLength) +usb_temp_get_desc_w(struct usb_device *udev, struct usb_device_request *req, + const void **pPtr, uint16_t *pLength) { /* stall */ Modified: user/weongyo/usb/sys/dev/usb/usb_generic.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/usb_generic.c Sat Oct 2 02:29:10 2010 (r213343) +++ user/weongyo/usb/sys/dev/usb/usb_generic.c Sat Oct 2 02:46:32 2010 (r213344) @@ -74,7 +74,7 @@ #define UGEN_BULK_FS_BUFFER_SIZE (64*32) /* bytes */ #define UGEN_BULK_HS_BUFFER_SIZE (1024*32) /* bytes */ -#define UGEN_HW_FRAMES 50 /* number of milliseconds per transfer */ +#define UGEN_HW_FRAMES 50 /* number of milliseconds per transfer */ /* function prototypes */ @@ -102,13 +102,14 @@ static int ugen_set_config(struct usb_fi static int ugen_set_interface(struct usb_fifo *, uint8_t, uint8_t); static int ugen_get_cdesc(struct usb_fifo *, struct usb_gen_descriptor *); static int ugen_get_sdesc(struct usb_fifo *, struct usb_gen_descriptor *); -static int ugen_get_iface_driver(struct usb_fifo *f, struct usb_gen_descriptor *ugd); +static int ugen_get_iface_driver(struct usb_fifo *, + struct usb_gen_descriptor *); static int usb_gen_fill_deviceinfo(struct usb_fifo *, struct usb_device_info *); static int ugen_re_enumerate(struct usb_fifo *); static int ugen_iface_ioctl(struct usb_fifo *, u_long, void *, int); static uint8_t ugen_fs_get_complete(struct usb_fifo *, uint8_t *); -static int ugen_fs_uninit(struct usb_fifo *f); +static int ugen_fs_uninit(struct usb_fifo *); /* structures */ @@ -427,7 +428,8 @@ ugen_ctrl_read_callback(struct usb_xfer } USB_IF_POLL(&f->free_q, m); if (m) { - usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer)); + usbd_xfer_set_frame_len(xfer, 0, + usbd_xfer_max_len(xfer)); usbd_transfer_submit(xfer); } break; @@ -805,8 +807,10 @@ usb_gen_fill_deviceinfo(struct usb_fifo di->udi_addr = udev->address; di->udi_index = udev->device_index; strlcpy(di->udi_serial, usb_get_serial(udev), sizeof(di->udi_serial)); - strlcpy(di->udi_vendor, usb_get_manufacturer(udev), sizeof(di->udi_vendor)); - strlcpy(di->udi_product, usb_get_product(udev), sizeof(di->udi_product)); + strlcpy(di->udi_vendor, usb_get_manufacturer(udev), + sizeof(di->udi_vendor)); + strlcpy(di->udi_product, usb_get_product(udev), + sizeof(di->udi_product)); usb_printbcd(di->udi_release, sizeof(di->udi_release), UGETW(udev->ddesc.bcdDevice)); di->udi_vendorNo = UGETW(udev->ddesc.idVendor); @@ -1412,7 +1416,8 @@ ugen_ioctl(struct usb_fifo *f, u_long cm usb_config[0].type = ed->bmAttributes & UE_XFERTYPE; usb_config[0].endpoint = ed->bEndpointAddress & UE_ADDR; - usb_config[0].direction = ed->bEndpointAddress & (UE_DIR_OUT | UE_DIR_IN); + usb_config[0].direction = + ed->bEndpointAddress & (UE_DIR_OUT | UE_DIR_IN); usb_config[0].interval = USB_DEFAULT_INTERVAL; usb_config[0].flags.proxy_buffer = 1; usb_config[0].callback = &ugen_ctrl_fs_callback; Modified: user/weongyo/usb/sys/dev/usb/usb_handle_request.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/usb_handle_request.c Sat Oct 2 02:29:10 2010 (r213343) +++ user/weongyo/usb/sys/dev/usb/usb_handle_request.c Sat Oct 2 02:46:32 2010 (r213344) @@ -734,9 +734,9 @@ tr_valid: rem = usbd_xfer_max_len(xfer); if ((rem != max_len) && (is_complete != 0)) { /* - * If we don't transfer the data we can transfer, then - * the transfer is short ! - */ + * If we don't transfer the data we can transfer, then + * the transfer is short ! + */ xfer->flags.force_short_xfer = 1; xfer->nframes = 2; } else { Modified: user/weongyo/usb/sys/dev/usb/usb_hid.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/usb_hid.c Sat Oct 2 02:29:10 2010 (r213343) +++ user/weongyo/usb/sys/dev/usb/usb_hid.c Sat Oct 2 02:46:32 2010 (r213344) @@ -353,7 +353,7 @@ hid_get_item(struct hid_data *s, struct } else s->ncount = c->loc.count; - /* + /* * The "top" loop will return * one and one item: */ @@ -504,9 +504,9 @@ hid_get_item(struct hid_data *s, struct if ((s->nusage < MAXUSAGE) && (c->usage_minimum <= c->usage_maximum)) { /* add usage range */ - s->usages_min[s->nusage] = + s->usages_min[s->nusage] = c->usage_minimum; - s->usages_max[s->nusage] = + s->usages_max[s->nusage] = c->usage_maximum; s->nusage ++; } else @@ -655,7 +655,7 @@ hid_get_data_sub(const uint8_t *buf, usb if (hsize > 32) hsize = 32; - /* Get data in a safe way */ + /* Get data in a safe way */ data = 0; rpos = (hpos / 8); n = (hsize + 7) / 8; @@ -689,10 +689,11 @@ hid_get_data(const uint8_t *buf, usb_siz } uint32_t -hid_get_data_unsigned(const uint8_t *buf, usb_size_t len, struct hid_location *loc) +hid_get_data_unsigned(const uint8_t *buf, usb_size_t len, + struct hid_location *loc) { - return (hid_get_data_sub(buf, len, loc, 0)); + return (hid_get_data_sub(buf, len, loc, 0)); } /*------------------------------------------------------------------------* Modified: user/weongyo/usb/sys/dev/usb/usb_hub.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/usb_hub.c Sat Oct 2 02:29:10 2010 (r213343) +++ user/weongyo/usb/sys/dev/usb/usb_hub.c Sat Oct 2 02:46:32 2010 (r213344) @@ -27,7 +27,7 @@ */ /* - * USB spec: http://www.usb.org/developers/docs/usbspec.zip + * USB spec: http://www.usb.org/developers/docs/usbspec.zip */ #include @@ -200,7 +200,8 @@ uhub_intr_callback(struct usb_xfer *xfer * the USB stack. */ usbd_xfer_set_stall(xfer); - usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer)); + usbd_xfer_set_frame_len(xfer, 0, + usbd_xfer_max_len(xfer)); usbd_transfer_submit(xfer); } break; @@ -341,7 +342,7 @@ repeat: } /* USB Host Mode */ /* wait for maximum device power up time */ - usb_pause_mtx(NULL, + usb_pause_mtx(NULL, USB_MS_TO_TICKS(USB_PORT_POWERUP_DELAY)); /* reset port, which implies enabling it */ @@ -860,7 +861,8 @@ uhub_detach(device_t dev) /* Detach all ports */ for (x = 0; x != hub->nports; x++) { - child = usb_bus_port_get_device(sc->sc_udev->bus, hub->ports + x); + child = usb_bus_port_get_device(sc->sc_udev->bus, + hub->ports + x); if (child == NULL) continue; @@ -967,8 +969,10 @@ uhub_child_location_string(device_t pare buf[0] = '\0'; goto done; } - snprintf(buf, buflen, "bus=%u hubaddr=%u port=%u devaddr=%u interface=%u", - (res.udev->parent_hub != NULL) ? res.udev->parent_hub->device_index : 0, + snprintf(buf, buflen, + "bus=%u hubaddr=%u port=%u devaddr=%u interface=%u", + (res.udev->parent_hub != NULL) ? + res.udev->parent_hub->device_index : 0, res.portno, device_get_unit(res.udev->bus->bdev), res.udev->device_index, res.iface_index); done: @@ -1131,11 +1135,11 @@ usb_hs_bandwidth_adjust(struct usb_devic if (speed == USB_SPEED_LOW) len *= 8; /* - * The Host Controller Driver should have - * performed checks so that the lookup - * below does not result in a NULL pointer - * access. - */ + * The Host Controller Driver should have + * performed checks so that the lookup + * below does not result in a NULL pointer + * access. + */ hub = udev->parent_hs_hub->hub; if (slot >= USB_HS_MICRO_FRAMES_MAX) { @@ -1236,8 +1240,8 @@ usb_hs_bandwidth_alloc(struct usb_xfer * break; } - DPRINTFN(11, "slot=%d, mask=0x%02x\n", - xfer->endpoint->usb_uframe, + DPRINTFN(11, "slot=%d, mask=0x%02x\n", + xfer->endpoint->usb_uframe, xfer->endpoint->usb_smask >> xfer->endpoint->usb_uframe); } @@ -1269,11 +1273,11 @@ usb_hs_bandwidth_free(struct usb_xfer *x slot = xfer->endpoint->usb_uframe; mask = xfer->endpoint->usb_smask; - /* free microframe slot(s): */ + /* free microframe slot(s): */ usb_hs_bandwidth_adjust(udev, -xfer->max_frame_size, slot, mask >> slot); - DPRINTFN(11, "slot=%d, mask=0x%02x\n", + DPRINTFN(11, "slot=%d, mask=0x%02x\n", slot, mask >> slot); xfer->endpoint->usb_uframe = 0; @@ -1497,7 +1501,7 @@ usb_bus_port_set_device(struct usb_bus * /* * There is only one case where we don't * have an USB port, and that is the Root Hub! - */ + */ if (up) { if (udev) { up->device_index = device_index; @@ -2014,7 +2018,8 @@ repeat: NULL, udev->port_no, UHF_PORT_SUSPEND); /* resume settle time */ - usb_pause_mtx(NULL, USB_MS_TO_TICKS(USB_PORT_RESUME_DELAY)); + usb_pause_mtx(NULL, + USB_MS_TO_TICKS(USB_PORT_RESUME_DELAY)); } DPRINTF("Suspend was cancelled!\n"); return; @@ -2076,7 +2081,7 @@ usbd_set_power_mode(struct usb_device *u (power_mode != USB_POWER_MODE_OFF)) power_mode = USB_POWER_MODE_SAVE; - power_mode = usbd_filter_power_mode(udev, power_mode); + power_mode = usbd_filter_power_mode(udev, power_mode); udev->power_mode = power_mode; /* update copy of power mode */ Modified: user/weongyo/usb/sys/dev/usb/usb_hub.h ============================================================================== --- user/weongyo/usb/sys/dev/usb/usb_hub.h Sat Oct 2 02:29:10 2010 (r213343) +++ user/weongyo/usb/sys/dev/usb/usb_hub.h Sat Oct 2 02:46:32 2010 (r213344) @@ -28,7 +28,7 @@ #define _USB_HUB_H_ /* - * The following structure defines an USB port. + * The following structure defines an USB port. */ struct usb_port { uint8_t restartcnt; Modified: user/weongyo/usb/sys/dev/usb/usb_mbuf.h ============================================================================== --- user/weongyo/usb/sys/dev/usb/usb_mbuf.h Sat Oct 2 02:29:10 2010 (r213343) +++ user/weongyo/usb/sys/dev/usb/usb_mbuf.h Sat Oct 2 02:46:32 2010 (r213344) @@ -43,45 +43,45 @@ struct usb_mbuf { uint8_t unused:7; }; -#define USB_IF_ENQUEUE(ifq, m) do { \ - (m)->usb_nextpkt = NULL; \ - if ((ifq)->ifq_tail == NULL) \ - (ifq)->ifq_head = (m); \ - else \ - (ifq)->ifq_tail->usb_nextpkt = (m); \ - (ifq)->ifq_tail = (m); \ - (ifq)->ifq_len++; \ - } while (0) - -#define USB_IF_DEQUEUE(ifq, m) do { \ - (m) = (ifq)->ifq_head; \ - if (m) { \ - if (((ifq)->ifq_head = (m)->usb_nextpkt) == NULL) { \ - (ifq)->ifq_tail = NULL; \ - } \ - (m)->usb_nextpkt = NULL; \ - (ifq)->ifq_len--; \ - } \ - } while (0) - -#define USB_IF_PREPEND(ifq, m) do { \ - (m)->usb_nextpkt = (ifq)->ifq_head; \ - if ((ifq)->ifq_tail == NULL) { \ - (ifq)->ifq_tail = (m); \ - } \ - (ifq)->ifq_head = (m); \ - (ifq)->ifq_len++; \ - } while (0) +#define USB_IF_ENQUEUE(ifq, m) do { \ + (m)->usb_nextpkt = NULL; \ + if ((ifq)->ifq_tail == NULL) \ + (ifq)->ifq_head = (m); \ + else \ + (ifq)->ifq_tail->usb_nextpkt = (m); \ + (ifq)->ifq_tail = (m); \ + (ifq)->ifq_len++; \ +} while (0) + +#define USB_IF_DEQUEUE(ifq, m) do { \ + (m) = (ifq)->ifq_head; \ + if (m) { \ + if (((ifq)->ifq_head = (m)->usb_nextpkt) == NULL) { \ + (ifq)->ifq_tail = NULL; \ + } \ + (m)->usb_nextpkt = NULL; \ + (ifq)->ifq_len--; \ + } \ +} while (0) + +#define USB_IF_PREPEND(ifq, m) do { \ + (m)->usb_nextpkt = (ifq)->ifq_head; \ + if ((ifq)->ifq_tail == NULL) { \ + (ifq)->ifq_tail = (m); \ + } \ + (ifq)->ifq_head = (m); \ + (ifq)->ifq_len++; \ +} while (0) #define USB_IF_QFULL(ifq) ((ifq)->ifq_len >= (ifq)->ifq_maxlen) #define USB_IF_QLEN(ifq) ((ifq)->ifq_len) #define USB_IF_POLL(ifq, m) ((m) = (ifq)->ifq_head) #define USB_MBUF_RESET(m) do { \ - (m)->cur_data_ptr = (m)->min_data_ptr; \ - (m)->cur_data_len = (m)->max_data_len; \ - (m)->last_packet = 0; \ - } while (0) + (m)->cur_data_ptr = (m)->min_data_ptr; \ + (m)->cur_data_len = (m)->max_data_len; \ + (m)->last_packet = 0; \ +} while (0) /* prototypes */ void *usb_alloc_mbufs(struct malloc_type *type, struct usb_ifqueue *ifq, Modified: user/weongyo/usb/sys/dev/usb/usb_msctest.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/usb_msctest.c Sat Oct 2 02:29:10 2010 (r213343) +++ user/weongyo/usb/sys/dev/usb/usb_msctest.c Sat Oct 2 02:46:32 2010 (r213344) @@ -284,7 +284,8 @@ bbb_command_callback(struct usb_xfer *xf USETDW(sc->cbw.dCBWSignature, CBWSIGNATURE); USETDW(sc->cbw.dCBWTag, tag); USETDW(sc->cbw.dCBWDataTransferLength, (uint32_t)sc->data_len); - sc->cbw.bCBWFlags = ((sc->dir == DIR_IN) ? CBWFLAGS_IN : CBWFLAGS_OUT); + sc->cbw.bCBWFlags = + ((sc->dir == DIR_IN) ? CBWFLAGS_IN : CBWFLAGS_OUT); sc->cbw.bCBWLUN = sc->lun; sc->cbw.bCDBLength = sc->cmd_len; if (sc->cbw.bCDBLength > sizeof(sc->cbw.CBWCDB)) { Modified: user/weongyo/usb/sys/dev/usb/usb_request.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/usb_request.c Sat Oct 2 02:29:10 2010 (r213343) +++ user/weongyo/usb/sys/dev/usb/usb_request.c Sat Oct 2 02:46:32 2010 (r213344) @@ -24,7 +24,7 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - */ + */ #include #include @@ -248,7 +248,7 @@ usb_do_clear_stall_callback(struct usb_x case USB_ST_SETUP: tr_setup: if (to == 0) - break; /* no endpoints - nothing to do */ + break; /* no endpoints - nothing to do */ if ((ep < ep_first) || (ep >= ep_end)) ep = ep_first; /* endpoint wrapped around */ if (ep->edesc && @@ -539,7 +539,7 @@ usbd_do_request_flags(struct usb_device if (dbg.ds_delay > 0) { usb_pause_mtx( xfer->xroot->xfer_mtx, - USB_MS_TO_TICKS(dbg.ds_delay)); + USB_MS_TO_TICKS(dbg.ds_delay)); /* make sure we don't time out */ start_ticks = ticks; } @@ -1405,8 +1405,8 @@ usbd_req_set_protocol(struct usb_device * Else: Failure *------------------------------------------------------------------------*/ usb_error_t -usbd_req_set_report(struct usb_device *udev, struct mtx *mtx, void *data, uint16_t len, - uint8_t iface_index, uint8_t type, uint8_t id) +usbd_req_set_report(struct usb_device *udev, struct mtx *mtx, + void *data, uint16_t len, uint8_t iface_index, uint8_t type, uint8_t id) { struct usb_interface *iface = usbd_get_iface(udev, iface_index); struct usb_device_request req; @@ -1579,7 +1579,7 @@ usbd_req_re_enumerate(struct usb_device retry: err = usbd_req_reset_port(parent_hub, mtx, udev->port_no); if (err) { - DPRINTFN(0, "addr=%d, port reset failed, %s\n", + DPRINTFN(0, "addr=%d, port reset failed, %s\n", old_addr, usbd_errstr(err)); goto done; } @@ -1620,7 +1620,7 @@ retry: err = usbd_req_get_device_desc(udev, mtx, &udev->ddesc); if (err) { DPRINTFN(0, "addr=%d, getting device " - "descriptor failed, %s\n", old_addr, + "descriptor failed, %s\n", old_addr, usbd_errstr(err)); goto done; } Modified: user/weongyo/usb/sys/dev/usb/usb_request.h ============================================================================== --- user/weongyo/usb/sys/dev/usb/usb_request.h Sat Oct 2 02:29:10 2010 (r213343) +++ user/weongyo/usb/sys/dev/usb/usb_request.h Sat Oct 2 02:46:32 2010 (r213344) @@ -69,7 +69,9 @@ usb_error_t usbd_req_set_hub_feature(str usb_error_t usbd_req_set_port_feature(struct usb_device *udev, struct mtx *mtx, uint8_t port, uint16_t sel); usb_error_t usbd_req_re_enumerate(struct usb_device *udev, struct mtx *mtx); -usb_error_t usbd_req_clear_device_feature(struct usb_device *udev, struct mtx *mtx, uint16_t sel); -usb_error_t usbd_req_set_device_feature(struct usb_device *udev, struct mtx *mtx, uint16_t sel); +usb_error_t usbd_req_clear_device_feature(struct usb_device *udev, + struct mtx *mtx, uint16_t sel); +usb_error_t usbd_req_set_device_feature(struct usb_device *udev, + struct mtx *mtx, uint16_t sel); #endif /* _USB_REQUEST_H_ */ Modified: user/weongyo/usb/sys/dev/usb/usb_sleepout.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/usb_sleepout.c Sat Oct 2 02:29:10 2010 (r213343) +++ user/weongyo/usb/sys/dev/usb/usb_sleepout.c Sat Oct 2 02:46:32 2010 (r213344) @@ -119,5 +119,4 @@ sleepout_drain(struct sleepout_task *st) taskqueue_drain(s->s_taskqueue, &st->st_task); return (callout_drain(&st->st_callout)); - } Modified: user/weongyo/usb/sys/dev/usb/usb_transfer.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/usb_transfer.c Sat Oct 2 02:29:10 2010 (r213343) +++ user/weongyo/usb/sys/dev/usb/usb_transfer.c Sat Oct 2 02:46:32 2010 (r213344) @@ -22,7 +22,7 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - */ + */ #include #include @@ -107,7 +107,7 @@ static void usbd_callback_wrapper(struct static void usb_dma_delay_done_cb(void *); static void usbd_transfer_start_cb(void *); static uint8_t usbd_callback_wrapper_sub(struct usb_xfer *); -static void usbd_get_std_packet_size(struct usb_std_packet_size *ptr, +static void usbd_get_std_packet_size(struct usb_std_packet_size *ptr, uint8_t type, enum usb_dev_speed speed); /*------------------------------------------------------------------------* @@ -443,7 +443,7 @@ usbd_transfer_setup_sub(struct usb_setup else if (xfer->interval > 16) xfer->interval = (1<<(16-4)); else - xfer->interval = + xfer->interval = (1 << (xfer->interval-4)); break; case USB_SPEED_HIGH: @@ -1225,9 +1225,9 @@ usbd_setup_ctrl_transfer(struct usb_xfer } /* - * Check if there is a control - * transfer in progress: - */ + * Check if there is a control + * transfer in progress: + */ if ((xfer->status & XFER_STATUS_CTRLACTIVE) != 0) { if ((xfer->status & XFER_STATUS_CTRLHDR) != 0) { /* clear send header flag */ @@ -1253,10 +1253,10 @@ usbd_setup_ctrl_transfer(struct usb_xfer /* check number of frames */ if (xfer->nframes != 1) { /* - * We need to receive the setup - * message first so that we know the - * data direction! - */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Sat Oct 2 06:43:40 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 155861065670; Sat, 2 Oct 2010 06:43:40 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 034FB8FC19; Sat, 2 Oct 2010 06:43:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o926hdfH030039; Sat, 2 Oct 2010 06:43:40 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o926hdSq030016; Sat, 2 Oct 2010 06:43:39 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <201010020643.o926hdSq030016@svn.freebsd.org> From: Weongyo Jeong Date: Sat, 2 Oct 2010 06:43:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213347 - in user/weongyo/usb/sys/dev/usb: . controller input misc net serial storage template wlan X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Oct 2010 06:43:40 -0000 Author: weongyo Date: Sat Oct 2 06:43:39 2010 New Revision: 213347 URL: http://svn.freebsd.org/changeset/base/213347 Log: no braces for single statement. Modified: user/weongyo/usb/sys/dev/usb/controller/at91dci.c user/weongyo/usb/sys/dev/usb/controller/at91dci_atmelarm.c user/weongyo/usb/sys/dev/usb/controller/atmegadci.c user/weongyo/usb/sys/dev/usb/controller/avr32dci.c user/weongyo/usb/sys/dev/usb/controller/ehci.c user/weongyo/usb/sys/dev/usb/controller/musb_otg.c user/weongyo/usb/sys/dev/usb/controller/musb_otg_atmelarm.c user/weongyo/usb/sys/dev/usb/controller/ohci.c user/weongyo/usb/sys/dev/usb/controller/uhci.c user/weongyo/usb/sys/dev/usb/controller/uss820dci.c user/weongyo/usb/sys/dev/usb/input/atp.c user/weongyo/usb/sys/dev/usb/input/uep.c user/weongyo/usb/sys/dev/usb/input/uhid.c user/weongyo/usb/sys/dev/usb/input/ukbd.c user/weongyo/usb/sys/dev/usb/input/ums.c user/weongyo/usb/sys/dev/usb/misc/udbp.c user/weongyo/usb/sys/dev/usb/net/if_axe.c user/weongyo/usb/sys/dev/usb/net/if_cdce.c user/weongyo/usb/sys/dev/usb/net/if_udav.c user/weongyo/usb/sys/dev/usb/serial/ucycom.c user/weongyo/usb/sys/dev/usb/serial/ufoma.c user/weongyo/usb/sys/dev/usb/serial/uftdi.c user/weongyo/usb/sys/dev/usb/serial/ulpt.c user/weongyo/usb/sys/dev/usb/serial/umodem.c user/weongyo/usb/sys/dev/usb/serial/uplcom.c user/weongyo/usb/sys/dev/usb/serial/usb_serial.c user/weongyo/usb/sys/dev/usb/serial/uvisor.c user/weongyo/usb/sys/dev/usb/serial/uvscom.c user/weongyo/usb/sys/dev/usb/storage/umass.c user/weongyo/usb/sys/dev/usb/storage/ustorage_fs.c user/weongyo/usb/sys/dev/usb/template/usb_template.c user/weongyo/usb/sys/dev/usb/usb_dev.c user/weongyo/usb/sys/dev/usb/usb_device.c user/weongyo/usb/sys/dev/usb/usb_generic.c user/weongyo/usb/sys/dev/usb/usb_handle_request.c user/weongyo/usb/sys/dev/usb/usb_hid.c user/weongyo/usb/sys/dev/usb/usb_hub.c user/weongyo/usb/sys/dev/usb/usb_msctest.c user/weongyo/usb/sys/dev/usb/usb_parse.c user/weongyo/usb/sys/dev/usb/usb_request.c user/weongyo/usb/sys/dev/usb/usb_transfer.c user/weongyo/usb/sys/dev/usb/usb_util.c user/weongyo/usb/sys/dev/usb/wlan/if_run.c user/weongyo/usb/sys/dev/usb/wlan/if_urtw.c user/weongyo/usb/sys/dev/usb/wlan/if_zyd.c Modified: user/weongyo/usb/sys/dev/usb/controller/at91dci.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/controller/at91dci.c Sat Oct 2 05:43:17 2010 (r213346) +++ user/weongyo/usb/sys/dev/usb/controller/at91dci.c Sat Oct 2 06:43:39 2010 (r213347) @@ -202,9 +202,9 @@ at91dci_get_hw_ep_profile(struct usb_dev const struct usb_hw_ep_profile **ppf, uint8_t ep_addr) { - if (ep_addr < AT91_UDP_EP_MAX) { + if (ep_addr < AT91_UDP_EP_MAX) *ppf = (at91dci_ep_profile + ep_addr); - } else + else *ppf = NULL; } @@ -345,15 +345,15 @@ at91dci_setup_rx(struct at91dci_td *td) /* sneak peek the set address */ if ((req.bmRequestType == UT_WRITE_DEVICE) && - (req.bRequest == UR_SET_ADDRESS)) { + (req.bRequest == UR_SET_ADDRESS)) sc->sc_dv_addr = req.wValue[0] & 0x7F; - } else + else sc->sc_dv_addr = 0xFF; /* sneak peek the endpoint direction */ - if (req.bmRequestType & UE_DIR_IN) { + if (req.bmRequestType & UE_DIR_IN) csr |= AT91_UDP_CSR_DIR; - } else + else csr &= ~AT91_UDP_CSR_DIR; /* write the direction of the control transfer */ @@ -659,9 +659,9 @@ at91dci_xfer_do_fifo(struct usb_xfer *xf } if (((void *)td) == xfer->td_transfer_last) goto done; - if (td->error) { + if (td->error) goto done; - } else if (td->remainder > 0) { + else if (td->remainder > 0) { /* * We had a short transfer. If there is no alternate * next, stop processing ! @@ -687,9 +687,9 @@ done: temp = (xfer->endpointno & UE_ADDR); /* update FIFO bank flag and multi buffer */ - if (td->fifo_bank) { + if (td->fifo_bank) sc->sc_ep_flags[temp].fifo_bank = 1; - } else + else sc->sc_ep_flags[temp].fifo_bank = 0; /* compute all actual lengths */ @@ -934,9 +934,9 @@ at91dci_setup_standard_chain(struct usb_ at91dci_setup_standard_chain_sub(&temp); - if ((xfer->status & XFER_STATUS_ISOCXFER) != 0) { + if ((xfer->status & XFER_STATUS_ISOCXFER) != 0) temp.offset += temp.len; - } else { + else { /* get next Page Cache pointer */ temp.pc = xfer->frbuffers + x; } @@ -1069,9 +1069,9 @@ at91dci_standard_done_sub(struct usb_xfe * Verify the length and subtract * the remainder from "frlengths[]": */ - if (len > xfer->frlengths[xfer->aframes]) { + if (len > xfer->frlengths[xfer->aframes]) td->error = 1; - } else + else xfer->frlengths[xfer->aframes] -= len; } /* Check for transfer error */ @@ -1085,9 +1085,9 @@ at91dci_standard_done_sub(struct usb_xfe if (len > 0) { if ((xfer->status & XFER_STATUS_SHORTFRAME_OK) != 0) { /* follow alt next */ - if (td->alt_next) { + if (td->alt_next) td = td->obj_next; - } else + else td = NULL; } else { /* the transfer is finished */ @@ -1274,14 +1274,14 @@ at91dci_clear_stall_sub(struct at91dci_s csr_val &= ~AT91_UDP_CSR_ET_MASK; csr_val |= AT91_UDP_CSR_EPEDS; - if (ep_type == UE_CONTROL) { + if (ep_type == UE_CONTROL) csr_val |= AT91_UDP_CSR_ET_CTRL; - } else { - if (ep_type == UE_BULK) { + else { + if (ep_type == UE_BULK) csr_val |= AT91_UDP_CSR_ET_BULK; - } else if (ep_type == UE_INTERRUPT) { + else if (ep_type == UE_INTERRUPT) csr_val |= AT91_UDP_CSR_ET_INT; - } else + else csr_val |= AT91_UDP_CSR_ET_ISO; if (ep_dir & UE_DIR_IN) csr_val |= AT91_UDP_CSR_ET_DIR_IN; Modified: user/weongyo/usb/sys/dev/usb/controller/at91dci_atmelarm.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/controller/at91dci_atmelarm.c Sat Oct 2 05:43:17 2010 (r213346) +++ user/weongyo/usb/sys/dev/usb/controller/at91dci_atmelarm.c Sat Oct 2 06:43:39 2010 (r213347) @@ -236,9 +236,9 @@ at91_udp_attach(device_t dev) err = at91dci_init(&sc->sc_dci); if (!err) err = device_probe_and_attach(sc->sc_dci.sc_bus.bdev); - if (err) { + if (err) goto error; - } else { + else { /* poll VBUS one time */ at91_vbus_poll(sc); } Modified: user/weongyo/usb/sys/dev/usb/controller/atmegadci.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/controller/atmegadci.c Sat Oct 2 05:43:17 2010 (r213346) +++ user/weongyo/usb/sys/dev/usb/controller/atmegadci.c Sat Oct 2 06:43:39 2010 (r213347) @@ -571,9 +571,9 @@ atmegadci_xfer_do_fifo(struct usb_xfer * } if (((void *)td) == xfer->td_transfer_last) goto done; - if (td->error) { + if (td->error) goto done; - } else if (td->remainder > 0) { + else if (td->remainder > 0) { /* * We had a short transfer. If there is no alternate * next, stop processing ! @@ -847,9 +847,9 @@ atmegadci_setup_standard_chain(struct us atmegadci_setup_standard_chain_sub(&temp); - if ((xfer->status & XFER_STATUS_ISOCXFER) != 0) { + if ((xfer->status & XFER_STATUS_ISOCXFER) != 0) temp.offset += temp.len; - } else { + else { /* get next Page Cache pointer */ temp.pc = xfer->frbuffers + x; } @@ -962,9 +962,9 @@ atmegadci_standard_done_sub(struct usb_x * Verify the length and subtract * the remainder from "frlengths[]": */ - if (len > xfer->frlengths[xfer->aframes]) { + if (len > xfer->frlengths[xfer->aframes]) td->error = 1; - } else + else xfer->frlengths[xfer->aframes] -= len; } /* Check for transfer error */ @@ -978,9 +978,9 @@ atmegadci_standard_done_sub(struct usb_x if (len > 0) { if ((xfer->status & XFER_STATUS_SHORTFRAME_OK) != 0) { /* follow alt next */ - if (td->alt_next) { + if (td->alt_next) td = td->obj_next; - } else + else td = NULL; } else { /* the transfer is finished */ @@ -1131,11 +1131,11 @@ atmegadci_clear_stall_sub(struct atmegad ATMEGA_UECONX_STALLRQC); do { - if (ep_type == UE_BULK) { + if (ep_type == UE_BULK) temp = ATMEGA_UECFG0X_EPTYPE2; - } else if (ep_type == UE_INTERRUPT) { + else if (ep_type == UE_INTERRUPT) temp = ATMEGA_UECFG0X_EPTYPE3; - } else + else temp = ATMEGA_UECFG0X_EPTYPE1; if (ep_dir & UE_DIR_IN) temp |= ATMEGA_UECFG0X_EPDIR; Modified: user/weongyo/usb/sys/dev/usb/controller/avr32dci.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/controller/avr32dci.c Sat Oct 2 05:43:17 2010 (r213346) +++ user/weongyo/usb/sys/dev/usb/controller/avr32dci.c Sat Oct 2 06:43:39 2010 (r213347) @@ -562,9 +562,9 @@ avr32dci_xfer_do_fifo(struct usb_xfer *x } if (((void *)td) == xfer->td_transfer_last) goto done; - if (td->error) { + if (td->error) goto done; - } else if (td->remainder > 0) { + else if (td->remainder > 0) { /* * We had a short transfer. If there is no alternate * next, stop processing ! @@ -818,9 +818,9 @@ avr32dci_setup_standard_chain(struct usb avr32dci_setup_standard_chain_sub(&temp); - if ((xfer->status & XFER_STATUS_ISOCXFER) != 0) { + if ((xfer->status & XFER_STATUS_ISOCXFER) != 0) temp.offset += temp.len; - } else { + else { /* get next Page Cache pointer */ temp.pc = xfer->frbuffers + x; } @@ -936,9 +936,9 @@ avr32dci_standard_done_sub(struct usb_xf * Verify the length and subtract * the remainder from "frlengths[]": */ - if (len > xfer->frlengths[xfer->aframes]) { + if (len > xfer->frlengths[xfer->aframes]) td->error = 1; - } else + else xfer->frlengths[xfer->aframes] -= len; } /* Check for transfer error */ @@ -952,9 +952,9 @@ avr32dci_standard_done_sub(struct usb_xf if (len > 0) { if ((xfer->status & XFER_STATUS_SHORTFRAME_OK) != 0) { /* follow alt next */ - if (td->alt_next) { + if (td->alt_next) td = td->obj_next; - } else + else td = NULL; } else { /* the transfer is finished */ @@ -1088,14 +1088,12 @@ avr32dci_clear_stall_sub(struct avr32dci /* clear stall */ AVR32_WRITE_4(sc, AVR32_EPTCLRSTA(ep_no), AVR32_EPTSTA_FRCESTALL); - if (ep_type == UE_BULK) { + if (ep_type == UE_BULK) temp = AVR32_EPTCFG_TYPE_BULK; - } else if (ep_type == UE_INTERRUPT) { + else if (ep_type == UE_INTERRUPT) temp = AVR32_EPTCFG_TYPE_INTR; - } else { - temp = AVR32_EPTCFG_TYPE_ISOC | - AVR32_EPTCFG_NB_TRANS(1); - } + else + temp = AVR32_EPTCFG_TYPE_ISOC | AVR32_EPTCFG_NB_TRANS(1); if (ep_dir & UE_DIR_IN) temp |= AVR32_EPTCFG_EPDIR_IN; avr32dci_get_hw_ep_profile(NULL, &pf, ep_no); @@ -1119,9 +1117,9 @@ avr32dci_clear_stall_sub(struct avr32dci temp = AVR32_READ_4(sc, AVR32_EPTCFG(ep_no)); - if (!(temp & AVR32_EPTCFG_EPT_MAPD)) { + if (!(temp & AVR32_EPTCFG_EPT_MAPD)) device_printf(sc->sc_bus.bdev, "Chip rejected configuration\n"); - } else { + else { AVR32_WRITE_4(sc, AVR32_EPTCTLENB(ep_no), AVR32_EPTCTL_EPT_ENABL); } Modified: user/weongyo/usb/sys/dev/usb/controller/ehci.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/controller/ehci.c Sat Oct 2 05:43:17 2010 (r213346) +++ user/weongyo/usb/sys/dev/usb/controller/ehci.c Sat Oct 2 06:43:39 2010 (r213347) @@ -1733,9 +1733,9 @@ restart: precompute = 0; /* setup alt next pointer, if any */ - if (temp->last_frame) { + if (temp->last_frame) td_alt_next = NULL; - } else { + else { /* we use this field internally */ td_alt_next = td_next; } @@ -1935,9 +1935,9 @@ ehci_setup_standard_chain(struct usb_xfe if (methods != &ehci_device_intr_methods) qh_endp |= EHCI_QH_SET_NRL(8); } else { - if (usbd_get_speed(xfer->xroot->udev) == USB_SPEED_FULL) { + if (usbd_get_speed(xfer->xroot->udev) == USB_SPEED_FULL) qh_endp |= EHCI_QH_SET_EPS(EHCI_QH_SPEED_FULL); - } else + else qh_endp |= EHCI_QH_SET_EPS(EHCI_QH_SPEED_LOW); if (methods == &ehci_device_ctrl_methods) @@ -2043,9 +2043,9 @@ ehci_isoc_fs_done(ehci_softc_t *sc, stru DPRINTFN(2, "status=0x%08x, rem=%u\n", status, len); - if (*plen >= len) { + if (*plen >= len) len = *plen - len; - } else + else len = 0; *plen = len; @@ -2557,9 +2557,9 @@ ehci_device_isoc_fs_enter(struct usb_xfe tlen += sa; - if (tlen >= 8) { + if (tlen >= 8) sb = 0; - } else + else sb = (1 << tlen); sa = (1 << sa); @@ -3660,9 +3660,9 @@ ehci_ep_init(struct usb_device *udev, st ep->methods = &ehci_device_intr_methods; break; case UE_ISOCHRONOUS: - if (udev->speed == USB_SPEED_HIGH) { + if (udev->speed == USB_SPEED_HIGH) ep->methods = &ehci_device_isoc_hs_methods; - } else if (udev->speed == USB_SPEED_FULL) + else if (udev->speed == USB_SPEED_FULL) ep->methods = &ehci_device_isoc_fs_methods; break; case UE_BULK: Modified: user/weongyo/usb/sys/dev/usb/controller/musb_otg.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/controller/musb_otg.c Sat Oct 2 05:43:17 2010 (r213346) +++ user/weongyo/usb/sys/dev/usb/controller/musb_otg.c Sat Oct 2 06:43:39 2010 (r213347) @@ -322,9 +322,9 @@ musbotg_setup_rx(struct musbotg_td *td) /* sneak peek the set address */ if ((req.bmRequestType == UT_WRITE_DEVICE) && - (req.bRequest == UR_SET_ADDRESS)) { + (req.bRequest == UR_SET_ADDRESS)) sc->sc_dv_addr = req.wValue[0] & 0x7F; - } else + else sc->sc_dv_addr = 0xFF; return (0); /* complete */ @@ -888,9 +888,9 @@ musbotg_xfer_do_fifo(struct usb_xfer *xf } if (((void *)td) == xfer->td_transfer_last) goto done; - if (td->error) { + if (td->error) goto done; - } else if (td->remainder > 0) { + else if (td->remainder > 0) { /* * We had a short transfer. If there is no alternate * next, stop processing ! @@ -1169,9 +1169,9 @@ musbotg_setup_standard_chain(struct usb_ musbotg_setup_standard_chain_sub(&temp); - if ((xfer->status & XFER_STATUS_ISOCXFER) != 0) { + if ((xfer->status & XFER_STATUS_ISOCXFER) != 0) temp.offset += temp.len; - } else { + else { /* get next Page Cache pointer */ temp.pc = xfer->frbuffers + x; } @@ -1310,9 +1310,9 @@ musbotg_standard_done_sub(struct usb_xfe * Verify the length and subtract * the remainder from "frlengths[]": */ - if (len > xfer->frlengths[xfer->aframes]) { + if (len > xfer->frlengths[xfer->aframes]) td->error = 1; - } else + else xfer->frlengths[xfer->aframes] -= len; } /* Check for transfer error */ @@ -1326,9 +1326,9 @@ musbotg_standard_done_sub(struct usb_xfe if (len > 0) { if ((xfer->status & XFER_STATUS_SHORTFRAME_OK) != 0) { /* follow alt next */ - if (td->alt_next) { + if (td->alt_next) td = td->obj_next; - } else + else td = NULL; } else { /* the transfer is finished */ @@ -2015,9 +2015,9 @@ musbotg_device_isoc_enter(struct usb_xfe */ temp = (nframes - xfer->endpoint->isoc_next) & MUSB2_MASK_FRAME; - if (usbd_get_speed(xfer->xroot->udev) == USB_SPEED_HIGH) { + if (usbd_get_speed(xfer->xroot->udev) == USB_SPEED_HIGH) fs_frames = (xfer->nframes + 7) / 8; - } else + else fs_frames = xfer->nframes; if ((xfer->endpoint->is_synced == 0) || Modified: user/weongyo/usb/sys/dev/usb/controller/musb_otg_atmelarm.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/controller/musb_otg_atmelarm.c Sat Oct 2 05:43:17 2010 (r213346) +++ user/weongyo/usb/sys/dev/usb/controller/musb_otg_atmelarm.c Sat Oct 2 06:43:39 2010 (r213347) @@ -154,9 +154,9 @@ musbotg_attach(device_t dev) err = musbotg_init(&sc->sc_otg); if (!err) err = device_probe_and_attach(sc->sc_otg.sc_bus.bdev); - if (err) { + if (err) goto error; - } else { + else { /* poll VBUS one time */ musbotg_vbus_poll(sc); } Modified: user/weongyo/usb/sys/dev/usb/controller/ohci.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/controller/ohci.c Sat Oct 2 05:43:17 2010 (r213346) +++ user/weongyo/usb/sys/dev/usb/controller/ohci.c Sat Oct 2 06:43:39 2010 (r213347) @@ -410,9 +410,9 @@ ohci_init(ohci_softc_t *sc) sc->sc_bus.usbrev = USB_REV_1_0; - if (ohci_controller_init(sc)) { + if (ohci_controller_init(sc)) return (USB_ERR_INVAL); - } else { + else { /* catch any lost interrupts */ ohci_do_poll(&sc->sc_bus); return (USB_ERR_NORMAL_COMPLETION); @@ -772,9 +772,9 @@ ohci_isoc_done(struct usb_xfer *xfer) while (nframes--) { len = le16toh(*olen); - if ((len >> 12) == OHCI_CC_NOT_ACCESSED) { + if ((len >> 12) == OHCI_CC_NOT_ACCESSED) len = 0; - } else + else len &= ((1 << 12) - 1); if (len > *plen) @@ -1010,9 +1010,9 @@ ohci_check_transfer_sub(struct usb_xfer * Make sure that the OHCI re-scans the schedule by * writing the BLF and CLF bits: */ - if (xfer->xroot->udev->flags.self_suspended) { - /* nothing to do */ - } else if (xfer->endpoint->methods == &ohci_device_bulk_methods) { + if (xfer->xroot->udev->flags.self_suspended) + ; /* nothing to do */ + else if (xfer->endpoint->methods == &ohci_device_bulk_methods) { ohci_softc_t *sc = OHCI_BUS2SC(xfer->xroot->bus); OWRITE4(sc, OHCI_COMMAND_STATUS, OHCI_BLF); @@ -1060,9 +1060,9 @@ ohci_check_transfer(struct usb_xfer *xfe } } /* store data-toggle */ - if (ed_headp & OHCI_TOGGLECARRY) { + if (ed_headp & OHCI_TOGGLECARRY) xfer->endpoint->toggle_next = 1; - } else + else xfer->endpoint->toggle_next = 0; /* non-isochronous transfer */ @@ -1264,9 +1264,9 @@ ohci_setup_standard_chain_sub(struct ohc precompute = 1; /* software is used to detect short incoming transfers */ - if ((temp->td_flags & htole32(OHCI_TD_DP_MASK)) == htole32(OHCI_TD_IN)) { + if ((temp->td_flags & htole32(OHCI_TD_DP_MASK)) == htole32(OHCI_TD_IN)) temp->td_flags |= htole32(OHCI_TD_R); - } else + else temp->td_flags &= ~htole32(OHCI_TD_R); restart: @@ -1439,15 +1439,15 @@ ohci_setup_standard_chain(struct usb_xfe temp.td_flags = htole32(OHCI_TD_NOCC | OHCI_TD_NOINTR); /* set data toggle */ - if (xfer->endpoint->toggle_next) { + if (xfer->endpoint->toggle_next) temp.td_flags |= htole32(OHCI_TD_TOGGLE_1); - } else + else temp.td_flags |= htole32(OHCI_TD_TOGGLE_0); /* set endpoint direction */ - if (UE_GET_DIR(xfer->endpointno) == UE_DIR_IN) { + if (UE_GET_DIR(xfer->endpointno) == UE_DIR_IN) temp.td_flags |= htole32(OHCI_TD_IN); - } else + else temp.td_flags |= htole32(OHCI_TD_OUT); while (x != xfer->nframes) { Modified: user/weongyo/usb/sys/dev/usb/controller/uhci.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/controller/uhci.c Sat Oct 2 05:43:17 2010 (r213346) +++ user/weongyo/usb/sys/dev/usb/controller/uhci.c Sat Oct 2 06:43:39 2010 (r213347) @@ -1481,9 +1481,9 @@ uhci_setup_standard_chain_sub(struct uhc precompute = 1; /* software is used to detect short incoming transfers */ - if ((temp->td_token & htole32(UHCI_TD_PID)) == htole32(UHCI_TD_PID_IN)) { + if ((temp->td_token & htole32(UHCI_TD_PID)) == htole32(UHCI_TD_PID_IN)) temp->td_status |= htole32(UHCI_TD_SPD); - } else + else temp->td_status &= ~htole32(UHCI_TD_SPD); temp->ml.buf_offset = 0; @@ -1571,9 +1571,9 @@ restart: precompute = 0; /* setup alt next pointer, if any */ - if (temp->last_frame) { + if (temp->last_frame) td_alt_next = NULL; - } else { + else { /* we use this field internally */ td_alt_next = td_next; } @@ -1774,9 +1774,9 @@ uhci_device_done(struct usb_xfer *xfer, if (methods == &uhci_device_bulk_methods) UHCI_REMOVE_QH(qh, sc->sc_bulk_p_last); if (methods == &uhci_device_ctrl_methods) { - if (xfer->xroot->udev->speed == USB_SPEED_LOW) { + if (xfer->xroot->udev->speed == USB_SPEED_LOW) UHCI_REMOVE_QH(qh, sc->sc_ls_ctl_p_last); - } else + else UHCI_REMOVE_QH(qh, sc->sc_fs_ctl_p_last); } if (methods == &uhci_device_intr_methods) @@ -1894,9 +1894,9 @@ uhci_device_ctrl_start(struct usb_xfer * * transfers */ if (xfer->xroot->udev->flags.self_suspended == 0) { - if (xfer->xroot->udev->speed == USB_SPEED_LOW) { + if (xfer->xroot->udev->speed == USB_SPEED_LOW) UHCI_APPEND_QH(qh, sc->sc_ls_ctl_p_last); - } else + else UHCI_APPEND_QH(qh, sc->sc_fs_ctl_p_last); } else usb_pc_cpu_flush(qh->page_cache); @@ -2989,9 +2989,9 @@ uhci_device_resume(struct usb_device *ud xfer->status |= XFER_STATUS_BWRECLAIMED; } if (methods == &uhci_device_ctrl_methods) { - if (xfer->xroot->udev->speed == USB_SPEED_LOW) { + if (xfer->xroot->udev->speed == USB_SPEED_LOW) UHCI_APPEND_QH(qh, sc->sc_ls_ctl_p_last); - } else + else UHCI_APPEND_QH(qh, sc->sc_fs_ctl_p_last); } if (methods == &uhci_device_intr_methods) @@ -3028,9 +3028,9 @@ uhci_device_suspend(struct usb_device *u if (methods == &uhci_device_bulk_methods) UHCI_REMOVE_QH(qh, sc->sc_bulk_p_last); if (methods == &uhci_device_ctrl_methods) { - if (xfer->xroot->udev->speed == USB_SPEED_LOW) { + if (xfer->xroot->udev->speed == USB_SPEED_LOW) UHCI_REMOVE_QH(qh, sc->sc_ls_ctl_p_last); - } else + else UHCI_REMOVE_QH(qh, sc->sc_fs_ctl_p_last); } if (methods == &uhci_device_intr_methods) Modified: user/weongyo/usb/sys/dev/usb/controller/uss820dci.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/controller/uss820dci.c Sat Oct 2 05:43:17 2010 (r213346) +++ user/weongyo/usb/sys/dev/usb/controller/uss820dci.c Sat Oct 2 06:43:39 2010 (r213347) @@ -168,15 +168,15 @@ static void uss820dci_get_hw_ep_profile(struct usb_device *udev, const struct usb_hw_ep_profile **ppf, uint8_t ep_addr) { - if (ep_addr == 0) { + if (ep_addr == 0) *ppf = uss820dci_ep_profile + 0; - } else if (ep_addr < 5) { + else if (ep_addr < 5) *ppf = uss820dci_ep_profile + 1; - } else if (ep_addr < 7) { + else if (ep_addr < 7) *ppf = uss820dci_ep_profile + 2; - } else if (ep_addr == 7) { + else if (ep_addr == 7) *ppf = uss820dci_ep_profile + 3; - } else + else *ppf = NULL; } @@ -322,9 +322,9 @@ uss820dci_setup_rx(struct uss820dci_td * /* sneak peek the set address */ if ((req.bmRequestType == UT_WRITE_DEVICE) && - (req.bRequest == UR_SET_ADDRESS)) { + (req.bRequest == UR_SET_ADDRESS)) sc->sc_dv_addr = req.wValue[0] & 0x7F; - } else + else sc->sc_dv_addr = 0xFF; /* reset TX FIFO */ @@ -660,9 +660,9 @@ uss820dci_xfer_do_fifo(struct usb_xfer * } if (((void *)td) == xfer->td_transfer_last) goto done; - if (td->error) { + if (td->error) goto done; - } else if (td->remainder > 0) { + else if (td->remainder > 0) { /* * We had a short transfer. If there is no alternate * next, stop processing ! @@ -870,9 +870,9 @@ uss820dci_setup_standard_chain(struct us x = 0; if (x != xfer->nframes) { - if (xfer->endpointno & UE_DIR_IN) { + if (xfer->endpointno & UE_DIR_IN) temp.func = &uss820dci_data_tx; - } else + else temp.func = &uss820dci_data_rx; /* setup "pc" pointer */ @@ -903,9 +903,9 @@ uss820dci_setup_standard_chain(struct us uss820dci_setup_standard_chain_sub(&temp); - if ((xfer->status & XFER_STATUS_ISOCXFER) != 0) { + if ((xfer->status & XFER_STATUS_ISOCXFER) != 0) temp.offset += temp.len; - } else { + else { /* get next Page Cache pointer */ temp.pc = xfer->frbuffers + x; } @@ -973,27 +973,27 @@ uss820dci_intr_set(struct usb_xfer *xfer DPRINTFN(15, "endpoint 0x%02x\n", xfer->endpointno); - if (ep_no > 3) { + if (ep_no > 3) ep_reg = USS820_SBIE1; - } else + else ep_reg = USS820_SBIE; ep_no &= 3; ep_no = 1 << (2 * ep_no); if ((xfer->status & XFER_STATUS_CTRLXFER) != 0) { - if ((xfer->status & XFER_STATUS_CTRLHDR) != 0) { + if ((xfer->status & XFER_STATUS_CTRLHDR) != 0) ep_no <<= 1; /* RX interrupt only */ - } else + else ep_no |= (ep_no << 1); /* RX and TX interrupt */ } else { if (!(xfer->endpointno & UE_DIR_IN)) ep_no <<= 1; } temp = USS820_READ_1(sc, ep_reg); - if (set) { + if (set) temp |= ep_no; - } else + else temp &= ~ep_no; USS820_WRITE_1(sc, ep_reg, temp); } @@ -1058,9 +1058,9 @@ uss820dci_standard_done_sub(struct usb_x * Verify the length and subtract * the remainder from "frlengths[]": */ - if (len > xfer->frlengths[xfer->aframes]) { + if (len > xfer->frlengths[xfer->aframes]) td->error = 1; - } else + else xfer->frlengths[xfer->aframes] -= len; } /* Check for transfer error */ @@ -1074,9 +1074,9 @@ uss820dci_standard_done_sub(struct usb_x if (len > 0) { if ((xfer->status & XFER_STATUS_SHORTFRAME_OK) != 0) { /* follow alt next */ - if (td->alt_next) { + if (td->alt_next) td = td->obj_next; - } else + else td = NULL; } else { /* the transfer is finished */ @@ -1185,9 +1185,9 @@ uss820dci_set_stall(struct usb_device *u } USS820_WRITE_1(sc, USS820_EPINDEX, ep_no); - if (ep_dir == UE_DIR_IN) { + if (ep_dir == UE_DIR_IN) temp = USS820_EPCON_TXSTL; - } else + else temp = USS820_EPCON_RXSTL; uss820dci_update_shared_1(sc, USS820_EPCON, 0xFF, temp); } @@ -2083,9 +2083,9 @@ tr_handle_get_port_status: if (index != 1) goto tr_stalled; - if (sc->sc_flags.status_vbus) { + if (sc->sc_flags.status_vbus) uss820dci_pull_up(sc); - } else + else uss820dci_pull_down(sc); /* Select FULL-speed and Device Side Mode */ Modified: user/weongyo/usb/sys/dev/usb/input/atp.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/input/atp.c Sat Oct 2 05:43:17 2010 (r213346) +++ user/weongyo/usb/sys/dev/usb/input/atp.c Sat Oct 2 06:43:39 2010 (r213347) @@ -1036,9 +1036,9 @@ atp_update_strokes(struct atp_softc *sc, for (i = 0; i < sc->sc_n_strokes; i++) { stroke = &sc->sc_strokes[i]; if (stroke->components[X].matched && - stroke->components[Y].matched) { + stroke->components[Y].matched) atp_advance_stroke_state(sc, stroke, &movement); - } else { + else { /* * At least one component of this stroke * didn't match against current pspans; @@ -1248,9 +1248,9 @@ atp_advance_stroke_state(struct atp_soft return; /* Convert touch strokes to slides upon detecting movement or age. */ - if (stroke->cum_movement >= atp_slide_min_movement) { + if (stroke->cum_movement >= atp_slide_min_movement) atp_convert_to_slide(sc, stroke); - } else { + else { /* If a touch stroke is found to be older than the * touch-timeout threshold, it should be converted to * a slide; except if there is a co-incident sibling Modified: user/weongyo/usb/sys/dev/usb/input/uep.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/input/uep.c Sat Oct 2 05:43:17 2010 (r213346) +++ user/weongyo/usb/sys/dev/usb/input/uep.c Sat Oct 2 06:43:39 2010 (r213347) @@ -246,9 +246,9 @@ uep_intr_callback(struct usb_xfer *xfer, goto tr_setup; /* full packet: process */ - if (pkt_len <= len) { + if (pkt_len <= len) uep_process_pkt(sc, p); - } else { + else { /* incomplete packet: save in buffer */ memcpy(sc->buf, p, len); sc->buf_len = len; Modified: user/weongyo/usb/sys/dev/usb/input/uhid.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/input/uhid.c Sat Oct 2 05:43:17 2010 (r213346) +++ user/weongyo/usb/sys/dev/usb/input/uhid.c Sat Oct 2 06:43:39 2010 (r213347) @@ -354,9 +354,9 @@ uhid_start_read(struct usb_fifo *fifo) { struct uhid_softc *sc = usb_fifo_softc(fifo); - if (sc->sc_flags & UHID_FLAG_IMMED) { + if (sc->sc_flags & UHID_FLAG_IMMED) usbd_transfer_start(sc->sc_xfer[UHID_CTRL_DT_RD]); - } else + else usbd_transfer_start(sc->sc_xfer[UHID_INTR_DT_RD]); } @@ -495,9 +495,9 @@ uhid_ioctl(struct usb_fifo *fifo, u_long switch (cmd) { case USB_GET_REPORT_DESC: ugd = addr; - if (sc->sc_repdesc_size > ugd->ugd_maxlen) { + if (sc->sc_repdesc_size > ugd->ugd_maxlen) size = ugd->ugd_maxlen; - } else + else size = sc->sc_repdesc_size; ugd->ugd_actlen = size; if (ugd->ugd_data == NULL) Modified: user/weongyo/usb/sys/dev/usb/input/ukbd.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/input/ukbd.c Sat Oct 2 05:43:17 2010 (r213346) +++ user/weongyo/usb/sys/dev/usb/input/ukbd.c Sat Oct 2 06:43:39 2010 (r213347) @@ -379,9 +379,9 @@ ukbd_get_key(struct ukbd_softc *sc, uint if (sc->sc_flags & UKBD_FLAG_POLLING) ukbd_do_poll(sc, wait); - if (sc->sc_inputs == 0) { + if (sc->sc_inputs == 0) c = -1; - } else { + else { c = sc->sc_input[sc->sc_inputhead]; --(sc->sc_inputs); ++(sc->sc_inputhead); @@ -513,9 +513,9 @@ ukbd_timeout(void *arg) /* Make sure any leftover key events gets read out */ ukbd_event_keyinput(sc); - if (ukbd_any_key_pressed(sc) || (sc->sc_inputs != 0)) { + if (ukbd_any_key_pressed(sc) || (sc->sc_inputs != 0)) ukbd_start_timer(sc); - } else + else sc->sc_flags &= ~UKBD_FLAG_TIMER_RUNNING; } Modified: user/weongyo/usb/sys/dev/usb/input/ums.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/input/ums.c Sat Oct 2 05:43:17 2010 (r213346) +++ user/weongyo/usb/sys/dev/usb/input/ums.c Sat Oct 2 06:43:39 2010 (r213347) @@ -816,9 +816,9 @@ ums_ioctl(struct usb_fifo *fifo, u_long case MOUSE_SETMODE: mode = *(mousemode_t *)addr; - if (mode.level == -1) { - /* don't change the current setting */ - } else if ((mode.level < 0) || (mode.level > 1)) { + if (mode.level == -1) + ; /* don't change the current setting */ + else if ((mode.level < 0) || (mode.level > 1)) { error = EINVAL; goto done; } else Modified: user/weongyo/usb/sys/dev/usb/misc/udbp.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/misc/udbp.c Sat Oct 2 05:43:17 2010 (r213346) +++ user/weongyo/usb/sys/dev/usb/misc/udbp.c Sat Oct 2 06:43:39 2010 (r213347) @@ -608,9 +608,9 @@ ng_udbp_newhook(node_p node, hook_p hook return (EINVAL); mtx_lock(&sc->sc_mtx); - if (sc->sc_hook != NULL) { + if (sc->sc_hook != NULL) error = EISCONN; - } else { + else { sc->sc_hook = hook; NG_HOOK_SET_PRIVATE(hook, NULL); } @@ -815,9 +815,9 @@ ng_udbp_disconnect(hook_p hook) if (sc != NULL) { mtx_lock(&sc->sc_mtx); - if (hook != sc->sc_hook) { + if (hook != sc->sc_hook) error = EINVAL; - } else { + else { /* stop bulk-in transfer */ usbd_transfer_stop(sc->sc_xfer[UDBP_T_RD_CS]); usbd_transfer_stop(sc->sc_xfer[UDBP_T_RD]); Modified: user/weongyo/usb/sys/dev/usb/net/if_axe.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/net/if_axe.c Sat Oct 2 05:43:17 2010 (r213346) +++ user/weongyo/usb/sys/dev/usb/net/if_axe.c Sat Oct 2 06:43:39 2010 (r213347) @@ -1247,9 +1247,9 @@ axe_setpromisc(struct axe_softc *sc) rxmode = le16toh(rxmode); - if (ifp->if_flags & IFF_PROMISC) { + if (ifp->if_flags & IFF_PROMISC) rxmode |= AXE_RXCMD_PROMISC; - } else + else rxmode &= ~AXE_RXCMD_PROMISC; axe_cmd(sc, AXE_CMD_RXCTL_WRITE, 0, rxmode, NULL); Modified: user/weongyo/usb/sys/dev/usb/net/if_cdce.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/net/if_cdce.c Sat Oct 2 05:43:17 2010 (r213346) +++ user/weongyo/usb/sys/dev/usb/net/if_cdce.c Sat Oct 2 06:43:39 2010 (r213347) @@ -526,9 +526,9 @@ alloc_transfers: (uaa->device, NULL, uaa->info.bIfaceIndex, UDESC_CS_INTERFACE, 0 - 1, UDESCSUB_CDC_ENF, 0 - 1); - if ((ued == NULL) || (ued->bLength < sizeof(*ued))) { + if ((ued == NULL) || (ued->bLength < sizeof(*ued))) error = USB_ERR_INVAL; - } else { + else { error = usbd_req_get_string_any(uaa->device, NULL, eaddr_str, sizeof(eaddr_str), ued->iMacAddress); } @@ -1234,9 +1234,9 @@ cdce_ncm_bulk_read_callback(struct usb_x m = NULL; /* silently ignore this frame */ continue; - } else if (temp > (MHLEN - ETHER_ALIGN)) { + } else if (temp > (MHLEN - ETHER_ALIGN)) m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); - } else + else m = m_gethdr(M_DONTWAIT, MT_DATA); DPRINTFN(16, "frame %u, offset = %u, length = %u \n", Modified: user/weongyo/usb/sys/dev/usb/net/if_udav.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/net/if_udav.c Sat Oct 2 05:43:17 2010 (r213346) +++ user/weongyo/usb/sys/dev/usb/net/if_udav.c Sat Oct 2 06:43:39 2010 (r213347) @@ -630,9 +630,9 @@ tr_setup: return; if (m->m_pkthdr.len > MCLBYTES) m->m_pkthdr.len = MCLBYTES; - if (m->m_pkthdr.len < UDAV_MIN_FRAME_LEN) { + if (m->m_pkthdr.len < UDAV_MIN_FRAME_LEN) extra_len = UDAV_MIN_FRAME_LEN - m->m_pkthdr.len; - } else + else extra_len = 0; temp_len = (m->m_pkthdr.len + extra_len); Modified: user/weongyo/usb/sys/dev/usb/serial/ucycom.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/serial/ucycom.c Sat Oct 2 05:43:17 2010 (r213346) +++ user/weongyo/usb/sys/dev/usb/serial/ucycom.c Sat Oct 2 06:43:39 2010 (r213347) @@ -468,9 +468,9 @@ ucycom_cfg_param(struct ucom_softc *ucom DPRINTF("\n"); - if (t->c_cflag & CIGNORE) { + if (t->c_cflag & CIGNORE) cfg = sc->sc_cfg; - } else { + else { cfg = 0; switch (t->c_cflag & CSIZE) { default: Modified: user/weongyo/usb/sys/dev/usb/serial/ufoma.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/serial/ufoma.c Sat Oct 2 05:43:17 2010 (r213346) +++ user/weongyo/usb/sys/dev/usb/serial/ufoma.c Sat Oct 2 06:43:39 2010 (r213347) @@ -402,9 +402,9 @@ ufoma_attach(device_t dev) goto detach; } if ((mad->bType == UMCPC_ACM_TYPE_AB5) || - (mad->bType == UMCPC_ACM_TYPE_AB6)) { + (mad->bType == UMCPC_ACM_TYPE_AB6)) sc->sc_nobulk = 1; - } else { + else { sc->sc_nobulk = 0; if (ufoma_modem_setup(dev, sc, uaa)) goto detach; @@ -580,9 +580,9 @@ tr_setup: DPRINTF("error = %s\n", usbd_errstr(error)); - if (error == USB_ERR_CANCELLED) { + if (error == USB_ERR_CANCELLED) return; - } else + else goto tr_setup; goto tr_transferred; @@ -624,9 +624,9 @@ tr_setup: default: /* Error */ DPRINTF("error = %s\n", usbd_errstr(error)); - if (error == USB_ERR_CANCELLED) { + if (error == USB_ERR_CANCELLED) return; - } else + else goto tr_setup; goto tr_transferred; @@ -923,15 +923,15 @@ ufoma_cfg_param(struct ucom_softc *ucom, USETDW(ls.dwDTERate, t->c_ospeed); - if (t->c_cflag & CSTOPB) { + if (t->c_cflag & CSTOPB) ls.bCharFormat = UCDC_STOP_BIT_2; - } else + else ls.bCharFormat = UCDC_STOP_BIT_1; if (t->c_cflag & PARENB) { - if (t->c_cflag & PARODD) { + if (t->c_cflag & PARODD) ls.bParityType = UCDC_PARITY_ODD; - } else + else ls.bParityType = UCDC_PARITY_EVEN; } else ls.bParityType = UCDC_PARITY_NONE; @@ -1037,9 +1037,9 @@ ufoma_start_read(struct ucom_softc *ucom usbd_transfer_start(sc->sc_ctrl_xfer[UFOMA_CTRL_ENDPT_INTR]); /* start data transfer */ - if (sc->sc_nobulk) { + if (sc->sc_nobulk) usbd_transfer_start(sc->sc_ctrl_xfer[UFOMA_CTRL_ENDPT_READ]); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Sat Oct 2 09:46:01 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7420D106566C; Sat, 2 Oct 2010 09:46:01 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 61E1D8FC0C; Sat, 2 Oct 2010 09:46:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o929k1PF034542; Sat, 2 Oct 2010 09:46:01 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o929k0MK034499; Sat, 2 Oct 2010 09:46:00 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <201010020946.o929k0MK034499@svn.freebsd.org> From: Weongyo Jeong Date: Sat, 2 Oct 2010 09:46:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213357 - in user/weongyo/usb/sys/dev/usb: . controller input misc net serial storage wlan X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Oct 2010 09:46:01 -0000 Author: weongyo Date: Sat Oct 2 09:46:00 2010 New Revision: 213357 URL: http://svn.freebsd.org/changeset/base/213357 Log: Removes struct usb_xfer_flags and converted to uint32_t flags. Modified: user/weongyo/usb/sys/dev/usb/controller/at91dci.c user/weongyo/usb/sys/dev/usb/controller/atmegadci.c user/weongyo/usb/sys/dev/usb/controller/avr32dci.c user/weongyo/usb/sys/dev/usb/controller/ehci.c user/weongyo/usb/sys/dev/usb/controller/musb_otg.c user/weongyo/usb/sys/dev/usb/controller/ohci.c user/weongyo/usb/sys/dev/usb/controller/uhci.c user/weongyo/usb/sys/dev/usb/controller/uss820dci.c user/weongyo/usb/sys/dev/usb/input/atp.c user/weongyo/usb/sys/dev/usb/input/uhid.c user/weongyo/usb/sys/dev/usb/input/ukbd.c user/weongyo/usb/sys/dev/usb/input/ums.c user/weongyo/usb/sys/dev/usb/misc/udbp.c user/weongyo/usb/sys/dev/usb/net/if_aue.c user/weongyo/usb/sys/dev/usb/net/if_axe.c user/weongyo/usb/sys/dev/usb/net/if_cdce.c user/weongyo/usb/sys/dev/usb/net/if_cue.c user/weongyo/usb/sys/dev/usb/net/if_kue.c user/weongyo/usb/sys/dev/usb/net/if_rue.c user/weongyo/usb/sys/dev/usb/net/if_udav.c user/weongyo/usb/sys/dev/usb/net/uhso.c user/weongyo/usb/sys/dev/usb/serial/u3g.c user/weongyo/usb/sys/dev/usb/serial/uark.c user/weongyo/usb/sys/dev/usb/serial/ubsa.c user/weongyo/usb/sys/dev/usb/serial/ubser.c user/weongyo/usb/sys/dev/usb/serial/uchcom.c user/weongyo/usb/sys/dev/usb/serial/ucycom.c user/weongyo/usb/sys/dev/usb/serial/ufoma.c user/weongyo/usb/sys/dev/usb/serial/uftdi.c user/weongyo/usb/sys/dev/usb/serial/ugensa.c user/weongyo/usb/sys/dev/usb/serial/uipaq.c user/weongyo/usb/sys/dev/usb/serial/ulpt.c user/weongyo/usb/sys/dev/usb/serial/umct.c user/weongyo/usb/sys/dev/usb/serial/umodem.c user/weongyo/usb/sys/dev/usb/serial/umoscom.c user/weongyo/usb/sys/dev/usb/serial/uplcom.c user/weongyo/usb/sys/dev/usb/serial/uslcom.c user/weongyo/usb/sys/dev/usb/serial/uvisor.c user/weongyo/usb/sys/dev/usb/serial/uvscom.c user/weongyo/usb/sys/dev/usb/storage/umass.c user/weongyo/usb/sys/dev/usb/storage/urio.c user/weongyo/usb/sys/dev/usb/storage/ustorage_fs.c user/weongyo/usb/sys/dev/usb/usb_compat_linux.c user/weongyo/usb/sys/dev/usb/usb_core.h user/weongyo/usb/sys/dev/usb/usb_generic.c user/weongyo/usb/sys/dev/usb/usb_handle_request.c user/weongyo/usb/sys/dev/usb/usb_hub.c user/weongyo/usb/sys/dev/usb/usb_msctest.c user/weongyo/usb/sys/dev/usb/usb_request.c user/weongyo/usb/sys/dev/usb/usb_transfer.c user/weongyo/usb/sys/dev/usb/usbdi.h user/weongyo/usb/sys/dev/usb/wlan/if_rum.c user/weongyo/usb/sys/dev/usb/wlan/if_run.c user/weongyo/usb/sys/dev/usb/wlan/if_uath.c user/weongyo/usb/sys/dev/usb/wlan/if_upgt.c user/weongyo/usb/sys/dev/usb/wlan/if_ural.c user/weongyo/usb/sys/dev/usb/wlan/if_urtw.c user/weongyo/usb/sys/dev/usb/wlan/if_zyd.c Modified: user/weongyo/usb/sys/dev/usb/controller/at91dci.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/controller/at91dci.c Sat Oct 2 08:28:15 2010 (r213356) +++ user/weongyo/usb/sys/dev/usb/controller/at91dci.c Sat Oct 2 09:46:00 2010 (r213357) @@ -929,7 +929,10 @@ at91dci_setup_standard_chain(struct usb_ } else { /* regular data transfer */ - temp.short_pkt = (xfer->flags.force_short_xfer) ? 0 : 1; + if ((xfer->flags & USBD_FORCE_SHORT_XFER) != 0) + temp.short_pkt = 0; + else + temp.short_pkt = 1; } at91dci_setup_standard_chain_sub(&temp); Modified: user/weongyo/usb/sys/dev/usb/controller/atmegadci.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/controller/atmegadci.c Sat Oct 2 08:28:15 2010 (r213356) +++ user/weongyo/usb/sys/dev/usb/controller/atmegadci.c Sat Oct 2 09:46:00 2010 (r213357) @@ -842,7 +842,10 @@ atmegadci_setup_standard_chain(struct us } else { /* regular data transfer */ - temp.short_pkt = (xfer->flags.force_short_xfer) ? 0 : 1; + if ((xfer->flags & USBD_FORCE_SHORT_XFER) != 0) + temp.short_pkt = 0; + else + temp.short_pkt = 1; } atmegadci_setup_standard_chain_sub(&temp); Modified: user/weongyo/usb/sys/dev/usb/controller/avr32dci.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/controller/avr32dci.c Sat Oct 2 08:28:15 2010 (r213356) +++ user/weongyo/usb/sys/dev/usb/controller/avr32dci.c Sat Oct 2 09:46:00 2010 (r213357) @@ -813,7 +813,10 @@ avr32dci_setup_standard_chain(struct usb } else { /* regular data transfer */ - temp.short_pkt = (xfer->flags.force_short_xfer) ? 0 : 1; + if ((xfer->flags & USBD_FORCE_SHORT_XFER) != 0) + temp.short_pkt = 0; + else + temp.short_pkt = 1; } avr32dci_setup_standard_chain_sub(&temp); Modified: user/weongyo/usb/sys/dev/usb/controller/ehci.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/controller/ehci.c Sat Oct 2 08:28:15 2010 (r213356) +++ user/weongyo/usb/sys/dev/usb/controller/ehci.c Sat Oct 2 09:46:00 2010 (r213357) @@ -1860,7 +1860,10 @@ ehci_setup_standard_chain(struct usb_xfe } else { /* regular data transfer */ - temp.shortpkt = (xfer->flags.force_short_xfer) ? 0 : 1; + if ((xfer->flags & USBD_FORCE_SHORT_XFER) != 0) + temp.shortpkt = 0; + else + temp.shortpkt = 1; } /* set endpoint direction */ @@ -3425,8 +3428,9 @@ ehci_xfer_setup(struct usb_setup_params * For the remainder of an USB transfer modulo * "max_data_length" we need two USB transfer descriptors. * One to transfer the remaining data and one to finalise - * with a zero length packet in case the "force_short_xfer" - * flag is set. We only need two USB transfer descriptors in + * with a zero length packet in case + * the USBD_FORCE_SHORT_XFER flag is set. + * We only need two USB transfer descriptors in * the case where the transfer length of the first one is a * factor of "max_frame_size". The rest of the needed USB * transfer descriptors is given by the buffer size divided Modified: user/weongyo/usb/sys/dev/usb/controller/musb_otg.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/controller/musb_otg.c Sat Oct 2 08:28:15 2010 (r213356) +++ user/weongyo/usb/sys/dev/usb/controller/musb_otg.c Sat Oct 2 09:46:00 2010 (r213357) @@ -1164,7 +1164,10 @@ musbotg_setup_standard_chain(struct usb_ } else { /* regular data transfer */ - temp.short_pkt = (xfer->flags.force_short_xfer) ? 0 : 1; + if ((xfer->flags & USBD_FORCE_SHORT_XFER) != 0) + temp.short_pkt = 0; + else + temp.short_pkt = 1; } musbotg_setup_standard_chain_sub(&temp); Modified: user/weongyo/usb/sys/dev/usb/controller/ohci.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/controller/ohci.c Sat Oct 2 08:28:15 2010 (r213356) +++ user/weongyo/usb/sys/dev/usb/controller/ohci.c Sat Oct 2 09:46:00 2010 (r213357) @@ -1476,7 +1476,10 @@ ohci_setup_standard_chain(struct usb_xfe } else { /* regular data transfer */ - temp.shortpkt = (xfer->flags.force_short_xfer) ? 0 : 1; + if ((xfer->flags & USBD_FORCE_SHORT_XFER) != 0) + temp.shortpkt = 0; + else + temp.shortpkt = 1; } ohci_setup_standard_chain_sub(&temp); Modified: user/weongyo/usb/sys/dev/usb/controller/uhci.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/controller/uhci.c Sat Oct 2 08:28:15 2010 (r213356) +++ user/weongyo/usb/sys/dev/usb/controller/uhci.c Sat Oct 2 09:46:00 2010 (r213357) @@ -1691,7 +1691,10 @@ uhci_setup_standard_chain(struct usb_xfe } else { /* regular data transfer */ - temp.shortpkt = (xfer->flags.force_short_xfer) ? 0 : 1; + if ((xfer->flags & USBD_FORCE_SHORT_XFER) != 0) + temp.shortpkt = 0; + else + temp.shortpkt = 1; } /* set endpoint direction */ Modified: user/weongyo/usb/sys/dev/usb/controller/uss820dci.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/controller/uss820dci.c Sat Oct 2 08:28:15 2010 (r213356) +++ user/weongyo/usb/sys/dev/usb/controller/uss820dci.c Sat Oct 2 09:46:00 2010 (r213357) @@ -898,7 +898,10 @@ uss820dci_setup_standard_chain(struct us } else { /* regular data transfer */ - temp.short_pkt = (xfer->flags.force_short_xfer) ? 0 : 1; + if ((xfer->flags & USBD_FORCE_SHORT_XFER) != 0) + temp.short_pkt = 0; + else + temp.short_pkt = 1; } uss820dci_setup_standard_chain_sub(&temp); Modified: user/weongyo/usb/sys/dev/usb/input/atp.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/input/atp.c Sat Oct 2 08:28:15 2010 (r213356) +++ user/weongyo/usb/sys/dev/usb/input/atp.c Sat Oct 2 09:46:00 2010 (r213357) @@ -1612,10 +1612,7 @@ static const struct usb_config atp_confi .type = UE_INTERRUPT, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .flags = { - .pipe_bof = 1, - .short_xfer_ok = 1, - }, + .flags = USBD_PIPE_BOF | USBD_SHORT_XFER_OK, .bufsize = 0, /* use wMaxPacketSize */ .callback = &atp_intr, }, Modified: user/weongyo/usb/sys/dev/usb/input/uhid.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/input/uhid.c Sat Oct 2 08:28:15 2010 (r213356) +++ user/weongyo/usb/sys/dev/usb/input/uhid.c Sat Oct 2 09:46:00 2010 (r213357) @@ -325,7 +325,7 @@ static const struct usb_config uhid_conf .type = UE_INTERRUPT, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .flags = USBD_PIPE_BOF | USBD_SHORT_XFER_OK, .bufsize = UHID_BSIZE, .callback = &uhid_intr_callback, }, Modified: user/weongyo/usb/sys/dev/usb/input/ukbd.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/input/ukbd.c Sat Oct 2 08:28:15 2010 (r213356) +++ user/weongyo/usb/sys/dev/usb/input/ukbd.c Sat Oct 2 09:46:00 2010 (r213357) @@ -711,7 +711,7 @@ static const struct usb_config ukbd_conf .type = UE_INTERRUPT, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .flags = USBD_PIPE_BOF | USBD_SHORT_XFER_OK, .bufsize = 0, /* use wMaxPacketSize */ .callback = &ukbd_intr_callback, }, Modified: user/weongyo/usb/sys/dev/usb/input/ums.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/input/ums.c Sat Oct 2 08:28:15 2010 (r213356) +++ user/weongyo/usb/sys/dev/usb/input/ums.c Sat Oct 2 09:46:00 2010 (r213357) @@ -345,7 +345,7 @@ static const struct usb_config ums_confi .type = UE_INTERRUPT, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .flags = USBD_PIPE_BOF | USBD_SHORT_XFER_OK, .bufsize = 0, /* use wMaxPacketSize */ .callback = &ums_intr_callback, }, Modified: user/weongyo/usb/sys/dev/usb/misc/udbp.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/misc/udbp.c Sat Oct 2 08:28:15 2010 (r213356) +++ user/weongyo/usb/sys/dev/usb/misc/udbp.c Sat Oct 2 09:46:00 2010 (r213357) @@ -205,7 +205,7 @@ static const struct usb_config udbp_conf .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .bufsize = UDBP_BUFFERSIZE, - .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .flags = USBD_PIPE_BOF | USBD_FORCE_SHORT_XFER, .callback = &udbp_bulk_write_callback, .timeout = UDBP_TIMEOUT, }, @@ -215,7 +215,7 @@ static const struct usb_config udbp_conf .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .bufsize = UDBP_BUFFERSIZE, - .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .flags = USBD_PIPE_BOF | USBD_SHORT_XFER_OK, .callback = &udbp_bulk_read_callback, }, Modified: user/weongyo/usb/sys/dev/usb/net/if_aue.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/net/if_aue.c Sat Oct 2 08:28:15 2010 (r213356) +++ user/weongyo/usb/sys/dev/usb/net/if_aue.c Sat Oct 2 09:46:00 2010 (r213357) @@ -240,7 +240,7 @@ static const struct usb_config aue_confi .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .bufsize = (MCLBYTES + 2), - .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .flags = USBD_PIPE_BOF | USBD_FORCE_SHORT_XFER, .callback = aue_bulk_write_callback, .timeout = 10000, /* 10 seconds */ }, @@ -250,7 +250,7 @@ static const struct usb_config aue_confi .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .bufsize = (MCLBYTES + 4 + ETHER_CRC_LEN), - .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .flags = USBD_PIPE_BOF | USBD_SHORT_XFER_OK, .callback = aue_bulk_read_callback, }, @@ -258,7 +258,7 @@ static const struct usb_config aue_confi .type = UE_INTERRUPT, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .flags = USBD_PIPE_BOF | USBD_SHORT_XFER_OK, .bufsize = 0, /* use wMaxPacketSize */ .callback = aue_intr_callback, }, Modified: user/weongyo/usb/sys/dev/usb/net/if_axe.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/net/if_axe.c Sat Oct 2 08:28:15 2010 (r213356) +++ user/weongyo/usb/sys/dev/usb/net/if_axe.c Sat Oct 2 09:46:00 2010 (r213357) @@ -213,7 +213,7 @@ static const struct usb_config axe_confi .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .bufsize = AXE_BULK_BUF_SIZE, - .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .flags = USBD_PIPE_BOF | USBD_FORCE_SHORT_XFER, .callback = axe_bulk_write_callback, .timeout = 10000, /* 10 seconds */ }, @@ -223,7 +223,7 @@ static const struct usb_config axe_confi .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .bufsize = 16384, /* bytes */ - .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .flags = USBD_PIPE_BOF | USBD_SHORT_XFER_OK, .callback = axe_bulk_read_callback, .timeout = 0, /* no timeout */ }, @@ -232,7 +232,7 @@ static const struct usb_config axe_confi .type = UE_INTERRUPT, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .flags = USBD_PIPE_BOF | USBD_SHORT_XFER_OK, .bufsize = 0, /* use wMaxPacketSize */ .callback = axe_intr_callback, }, Modified: user/weongyo/usb/sys/dev/usb/net/if_cdce.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/net/if_cdce.c Sat Oct 2 08:28:15 2010 (r213356) +++ user/weongyo/usb/sys/dev/usb/net/if_cdce.c Sat Oct 2 09:46:00 2010 (r213357) @@ -131,7 +131,8 @@ static const struct usb_config cdce_conf .if_index = 0, .frames = CDCE_FRAMES_MAX, .bufsize = (CDCE_FRAMES_MAX * MCLBYTES), - .flags = {.pipe_bof = 1,.short_frames_ok = 1,.short_xfer_ok = 1,.ext_buffer = 1,}, + .flags = USBD_PIPE_BOF | USBD_SHORT_FRAME_OK | + USBD_SHORT_XFER_OK | USBD_EXT_BUFFER, .callback = cdce_bulk_read_callback, .timeout = 0, /* no timeout */ .usb_mode = USB_MODE_DUAL, /* both modes */ @@ -144,7 +145,8 @@ static const struct usb_config cdce_conf .if_index = 0, .frames = CDCE_FRAMES_MAX, .bufsize = (CDCE_FRAMES_MAX * MCLBYTES), - .flags = {.pipe_bof = 1,.force_short_xfer = 1,.ext_buffer = 1,}, + .flags = USBD_PIPE_BOF | USBD_FORCE_SHORT_XFER | + USBD_EXT_BUFFER, .callback = cdce_bulk_write_callback, .timeout = 10000, /* 10 seconds */ .usb_mode = USB_MODE_DUAL, /* both modes */ @@ -156,7 +158,8 @@ static const struct usb_config cdce_conf .direction = UE_DIR_RX, .if_index = 1, .bufsize = CDCE_IND_SIZE_MAX, - .flags = {.pipe_bof = 1,.short_xfer_ok = 1,.no_pipe_ok = 1,}, + .flags = USBD_PIPE_BOF | USBD_SHORT_XFER_OK | + USBD_NO_PIPE_OK, .callback = cdce_intr_read_callback, .timeout = 0, .usb_mode = USB_MODE_HOST, @@ -168,7 +171,8 @@ static const struct usb_config cdce_conf .direction = UE_DIR_TX, .if_index = 1, .bufsize = CDCE_IND_SIZE_MAX, - .flags = {.pipe_bof = 1,.force_short_xfer = 1,.no_pipe_ok = 1,}, + .flags = USBD_PIPE_BOF | USBD_FORCE_SHORT_XFER | + USBD_NO_PIPE_OK, .callback = cdce_intr_write_callback, .timeout = 10000, /* 10 seconds */ .usb_mode = USB_MODE_DEVICE, @@ -184,7 +188,8 @@ static const struct usb_config cdce_ncm_ .if_index = 0, .frames = CDCE_NCM_RX_FRAMES_MAX, .bufsize = (CDCE_NCM_RX_FRAMES_MAX * CDCE_NCM_RX_MAXLEN), - .flags = {.pipe_bof = 1,.short_frames_ok = 1,.short_xfer_ok = 1,}, + .flags = USBD_PIPE_BOF | USBD_SHORT_FRAME_OK | + USBD_SHORT_XFER_OK, .callback = cdce_ncm_bulk_read_callback, .timeout = 0, /* no timeout */ .usb_mode = USB_MODE_DUAL, /* both modes */ @@ -197,7 +202,7 @@ static const struct usb_config cdce_ncm_ .if_index = 0, .frames = CDCE_NCM_TX_FRAMES_MAX, .bufsize = (CDCE_NCM_TX_FRAMES_MAX * CDCE_NCM_TX_MAXLEN), - .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .flags = USBD_PIPE_BOF | USBD_FORCE_SHORT_XFER, .callback = cdce_ncm_bulk_write_callback, .timeout = 10000, /* 10 seconds */ .usb_mode = USB_MODE_DUAL, /* both modes */ @@ -209,7 +214,8 @@ static const struct usb_config cdce_ncm_ .direction = UE_DIR_RX, .if_index = 1, .bufsize = CDCE_IND_SIZE_MAX, - .flags = {.pipe_bof = 1,.short_xfer_ok = 1,.no_pipe_ok = 1,}, + .flags = USBD_PIPE_BOF | USBD_SHORT_XFER_OK | + USBD_NO_PIPE_OK, .callback = cdce_intr_read_callback, .timeout = 0, .usb_mode = USB_MODE_HOST, @@ -221,7 +227,8 @@ static const struct usb_config cdce_ncm_ .direction = UE_DIR_TX, .if_index = 1, .bufsize = CDCE_IND_SIZE_MAX, - .flags = {.pipe_bof = 1,.force_short_xfer = 1,.no_pipe_ok = 1,}, + .flags = USBD_PIPE_BOF | USBD_FORCE_SHORT_XFER | + USBD_NO_PIPE_OK, .callback = cdce_intr_write_callback, .timeout = 10000, /* 10 seconds */ .usb_mode = USB_MODE_DEVICE, Modified: user/weongyo/usb/sys/dev/usb/net/if_cue.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/net/if_cue.c Sat Oct 2 08:28:15 2010 (r213356) +++ user/weongyo/usb/sys/dev/usb/net/if_cue.c Sat Oct 2 09:46:00 2010 (r213357) @@ -146,7 +146,7 @@ static const struct usb_config cue_confi .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .bufsize = (MCLBYTES + 2), - .flags = {.pipe_bof = 1,}, + .flags = USBD_PIPE_BOF, .callback = cue_bulk_write_callback, .timeout = 10000, /* 10 seconds */ }, @@ -155,7 +155,7 @@ static const struct usb_config cue_confi .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .bufsize = (MCLBYTES + 2), - .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .flags = USBD_PIPE_BOF | USBD_SHORT_XFER_OK, .callback = cue_bulk_read_callback, }, }; Modified: user/weongyo/usb/sys/dev/usb/net/if_kue.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/net/if_kue.c Sat Oct 2 08:28:15 2010 (r213356) +++ user/weongyo/usb/sys/dev/usb/net/if_kue.c Sat Oct 2 09:46:00 2010 (r213357) @@ -184,7 +184,7 @@ static const struct usb_config kue_confi .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .bufsize = (MCLBYTES + 2 + 64), - .flags = {.pipe_bof = 1,}, + .flags = USBD_PIPE_BOF, .callback = kue_bulk_write_callback, .timeout = 10000, /* 10 seconds */ }, @@ -194,7 +194,7 @@ static const struct usb_config kue_confi .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .bufsize = (MCLBYTES + 2), - .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .flags = USBD_PIPE_BOF | USBD_SHORT_XFER_OK, .callback = kue_bulk_read_callback, .timeout = 0, /* no timeout */ }, Modified: user/weongyo/usb/sys/dev/usb/net/if_rue.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/net/if_rue.c Sat Oct 2 08:28:15 2010 (r213356) +++ user/weongyo/usb/sys/dev/usb/net/if_rue.c Sat Oct 2 09:46:00 2010 (r213357) @@ -167,7 +167,7 @@ static const struct usb_config rue_confi .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .bufsize = MCLBYTES, - .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .flags = USBD_PIPE_BOF | USBD_FORCE_SHORT_XFER, .callback = rue_bulk_write_callback, .timeout = 10000, /* 10 seconds */ }, @@ -177,7 +177,7 @@ static const struct usb_config rue_confi .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .bufsize = (MCLBYTES + 4), - .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .flags = USBD_PIPE_BOF | USBD_SHORT_XFER_OK, .callback = rue_bulk_read_callback, .timeout = 0, /* no timeout */ }, @@ -186,7 +186,7 @@ static const struct usb_config rue_confi .type = UE_INTERRUPT, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .flags = USBD_PIPE_BOF | USBD_SHORT_XFER_OK, .bufsize = 0, /* use wMaxPacketSize */ .callback = rue_intr_callback, }, Modified: user/weongyo/usb/sys/dev/usb/net/if_udav.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/net/if_udav.c Sat Oct 2 08:28:15 2010 (r213356) +++ user/weongyo/usb/sys/dev/usb/net/if_udav.c Sat Oct 2 09:46:00 2010 (r213357) @@ -129,7 +129,7 @@ static const struct usb_config udav_conf .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .bufsize = (MCLBYTES + 2), - .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .flags = USBD_PIPE_BOF | USBD_FORCE_SHORT_XFER, .callback = udav_bulk_write_callback, .timeout = 10000, /* 10 seconds */ }, @@ -138,7 +138,7 @@ static const struct usb_config udav_conf .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .bufsize = (MCLBYTES + 3), - .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .flags = USBD_PIPE_BOF | USBD_SHORT_XFER_OK, .callback = udav_bulk_read_callback, .timeout = 0, /* no timeout */ }, @@ -146,7 +146,7 @@ static const struct usb_config udav_conf .type = UE_INTERRUPT, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .flags = USBD_PIPE_BOF | USBD_SHORT_XFER_OK, .bufsize = 0, /* use wMaxPacketSize */ .callback = udav_intr_callback, }, Modified: user/weongyo/usb/sys/dev/usb/net/uhso.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/net/uhso.c Sat Oct 2 08:28:15 2010 (r213356) +++ user/weongyo/usb/sys/dev/usb/net/uhso.c Sat Oct 2 09:46:00 2010 (r213357) @@ -356,7 +356,7 @@ static const struct usb_config uhso_ctrl .type = UE_CONTROL, .endpoint = 0x00, .direction = UE_DIR_ANY, - .flags = { .pipe_bof = 1, .short_xfer_ok = 1 }, + .flags = USBD_PIPE_BOF | USBD_SHORT_XFER_OK, .bufsize = sizeof(struct usb_device_request) + 1024, .callback = &uhso_mux_read_callback }, @@ -365,7 +365,7 @@ static const struct usb_config uhso_ctrl .type = UE_CONTROL, .endpoint = 0x00, .direction = UE_DIR_ANY, - .flags = { .pipe_bof = 1, .force_short_xfer = 1 }, + .flags = USBD_PIPE_BOF | USBD_FORCE_SHORT_XFER, .bufsize = sizeof(struct usb_device_request) + 1024, .timeout = 1000, .callback = &uhso_mux_write_callback @@ -378,7 +378,7 @@ static const struct usb_config uhso_mux_ .type = UE_INTERRUPT, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .flags = { .short_xfer_ok = 1 }, + .flags = USBD_SHORT_XFER_OK, .bufsize = 0, .callback = &uhso_mux_intr_callback, } @@ -390,7 +390,7 @@ static const struct usb_config uhso_ifne .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .flags = { .pipe_bof = 1, .short_xfer_ok = 1 }, + .flags = USBD_PIPE_BOF | USBD_SHORT_XFER_OK, .bufsize = MCLBYTES, .callback = &uhso_ifnet_read_callback }, @@ -398,7 +398,7 @@ static const struct usb_config uhso_ifne .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, - .flags = { .pipe_bof = 1, .force_short_xfer = 1 }, + .flags = USBD_PIPE_BOF | USBD_FORCE_SHORT_XFER, .bufsize = MCLBYTES, .timeout = 5 * USB_MS_HZ, .callback = &uhso_ifnet_write_callback @@ -411,7 +411,7 @@ static const struct usb_config uhso_bs_c .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .flags = { .pipe_bof = 1, .short_xfer_ok = 1 }, + .flags = USBD_PIPE_BOF | USBD_SHORT_XFER_OK, .bufsize = 4096, .callback = &uhso_bs_read_callback }, @@ -420,7 +420,7 @@ static const struct usb_config uhso_bs_c .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, - .flags = { .pipe_bof = 1, .force_short_xfer = 1 }, + .flags = USBD_PIPE_BOF | USBD_FORCE_SHORT_XFER, .bufsize = 8192, .callback = &uhso_bs_write_callback }, @@ -429,7 +429,7 @@ static const struct usb_config uhso_bs_c .type = UE_INTERRUPT, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .flags = { .short_xfer_ok = 1 }, + .flags = USBD_SHORT_XFER_OK, .bufsize = 0, .callback = &uhso_bs_intr_callback, } Modified: user/weongyo/usb/sys/dev/usb/serial/u3g.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/serial/u3g.c Sat Oct 2 08:28:15 2010 (r213356) +++ user/weongyo/usb/sys/dev/usb/serial/u3g.c Sat Oct 2 09:46:00 2010 (r213357) @@ -136,7 +136,7 @@ static const struct usb_config u3g_confi .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .bufsize = U3G_BSIZE,/* bytes */ - .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .flags = USBD_PIPE_BOF | USBD_FORCE_SHORT_XFER, .callback = &u3g_write_callback, }, @@ -145,7 +145,7 @@ static const struct usb_config u3g_confi .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .bufsize = U3G_BSIZE,/* bytes */ - .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .flags = USBD_PIPE_BOF | USBD_SHORT_XFER_OK, .callback = &u3g_read_callback, }, }; Modified: user/weongyo/usb/sys/dev/usb/serial/uark.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/serial/uark.c Sat Oct 2 08:28:15 2010 (r213356) +++ user/weongyo/usb/sys/dev/usb/serial/uark.c Sat Oct 2 09:46:00 2010 (r213357) @@ -121,7 +121,7 @@ static const struct usb_config .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .bufsize = UARK_BUF_SIZE, - .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .flags = USBD_PIPE_BOF | USBD_FORCE_SHORT_XFER, .callback = &uark_bulk_write_callback, }, @@ -130,7 +130,7 @@ static const struct usb_config .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .bufsize = UARK_BUF_SIZE, - .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .flags = USBD_PIPE_BOF | USBD_SHORT_XFER_OK, .callback = &uark_bulk_read_callback, }, }; Modified: user/weongyo/usb/sys/dev/usb/serial/ubsa.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/serial/ubsa.c Sat Oct 2 08:28:15 2010 (r213356) +++ user/weongyo/usb/sys/dev/usb/serial/ubsa.c Sat Oct 2 09:46:00 2010 (r213357) @@ -200,7 +200,7 @@ static const struct usb_config ubsa_conf .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .bufsize = UBSA_BSIZE, /* bytes */ - .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .flags = USBD_PIPE_BOF | USBD_FORCE_SHORT_XFER, .callback = &ubsa_write_callback, }, @@ -209,7 +209,7 @@ static const struct usb_config ubsa_conf .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .bufsize = UBSA_BSIZE, /* bytes */ - .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .flags = USBD_PIPE_BOF | USBD_SHORT_XFER_OK, .callback = &ubsa_read_callback, }, @@ -217,7 +217,7 @@ static const struct usb_config ubsa_conf .type = UE_INTERRUPT, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .flags = USBD_PIPE_BOF | USBD_SHORT_XFER_OK, .bufsize = 0, /* use wMaxPacketSize */ .callback = &ubsa_intr_callback, }, Modified: user/weongyo/usb/sys/dev/usb/serial/ubser.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/serial/ubser.c Sat Oct 2 08:28:15 2010 (r213356) +++ user/weongyo/usb/sys/dev/usb/serial/ubser.c Sat Oct 2 09:46:00 2010 (r213357) @@ -168,7 +168,7 @@ static const struct usb_config ubser_con .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .bufsize = 0, /* use wMaxPacketSize */ - .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .flags = USBD_PIPE_BOF | USBD_FORCE_SHORT_XFER, .callback = &ubser_write_callback, }, @@ -177,7 +177,7 @@ static const struct usb_config ubser_con .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .bufsize = 0, /* use wMaxPacketSize */ - .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .flags = USBD_PIPE_BOF | USBD_SHORT_XFER_OK, .callback = &ubser_read_callback, }, }; Modified: user/weongyo/usb/sys/dev/usb/serial/uchcom.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/serial/uchcom.c Sat Oct 2 08:28:15 2010 (r213356) +++ user/weongyo/usb/sys/dev/usb/serial/uchcom.c Sat Oct 2 09:46:00 2010 (r213357) @@ -244,7 +244,7 @@ static const struct usb_config uchcom_co .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .bufsize = UCHCOM_BULK_BUF_SIZE, - .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .flags = USBD_PIPE_BOF | USBD_FORCE_SHORT_XFER, .callback = &uchcom_write_callback, }, @@ -253,7 +253,7 @@ static const struct usb_config uchcom_co .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .bufsize = UCHCOM_BULK_BUF_SIZE, - .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .flags = USBD_PIPE_BOF | USBD_SHORT_XFER_OK, .callback = &uchcom_read_callback, }, @@ -261,7 +261,7 @@ static const struct usb_config uchcom_co .type = UE_INTERRUPT, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .flags = USBD_PIPE_BOF | USBD_SHORT_XFER_OK, .bufsize = 0, /* use wMaxPacketSize */ .callback = &uchcom_intr_callback, }, Modified: user/weongyo/usb/sys/dev/usb/serial/ucycom.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/serial/ucycom.c Sat Oct 2 08:28:15 2010 (r213356) +++ user/weongyo/usb/sys/dev/usb/serial/ucycom.c Sat Oct 2 09:46:00 2010 (r213357) @@ -138,7 +138,7 @@ static const struct usb_config ucycom_co .type = UE_INTERRUPT, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .flags = USBD_PIPE_BOF | USBD_SHORT_XFER_OK, .bufsize = UCYCOM_MAX_IOLEN, .callback = &ucycom_intr_read_callback, }, Modified: user/weongyo/usb/sys/dev/usb/serial/ufoma.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/serial/ufoma.c Sat Oct 2 08:28:15 2010 (r213356) +++ user/weongyo/usb/sys/dev/usb/serial/ufoma.c Sat Oct 2 09:46:00 2010 (r213357) @@ -241,7 +241,7 @@ static const struct usb_config .type = UE_INTERRUPT, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .flags = USBD_PIPE_BOF | USBD_SHORT_XFER_OK, .bufsize = sizeof(struct usb_cdc_notification), .callback = &ufoma_intr_callback, }, @@ -251,7 +251,7 @@ static const struct usb_config .endpoint = 0x00, /* Control pipe */ .direction = UE_DIR_ANY, .bufsize = (sizeof(struct usb_device_request) + UFOMA_CMD_BUF_SIZE), - .flags = {.short_xfer_ok = 1,}, + .flags = USBD_SHORT_XFER_OK, .callback = &ufoma_ctrl_read_callback, .timeout = 1000, /* 1 second */ }, @@ -273,7 +273,7 @@ static const struct usb_config .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .bufsize = UFOMA_BULK_BUF_SIZE, - .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .flags = USBD_PIPE_BOF | USBD_FORCE_SHORT_XFER, .callback = &ufoma_bulk_write_callback, }, @@ -282,7 +282,7 @@ static const struct usb_config .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .bufsize = UFOMA_BULK_BUF_SIZE, - .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .flags = USBD_PIPE_BOF | USBD_SHORT_XFER_OK, .callback = &ufoma_bulk_read_callback, }, }; Modified: user/weongyo/usb/sys/dev/usb/serial/uftdi.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/serial/uftdi.c Sat Oct 2 08:28:15 2010 (r213356) +++ user/weongyo/usb/sys/dev/usb/serial/uftdi.c Sat Oct 2 09:46:00 2010 (r213357) @@ -153,7 +153,7 @@ static const struct usb_config uftdi_con .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .bufsize = UFTDI_OBUFSIZE, - .flags = {.pipe_bof = 1,}, + .flags = USBD_PIPE_BOF, .callback = &uftdi_write_callback, }, @@ -162,7 +162,7 @@ static const struct usb_config uftdi_con .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .bufsize = 0, /* use wMaxPacketSize */ - .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .flags = USBD_PIPE_BOF | USBD_SHORT_XFER_OK, .callback = &uftdi_read_callback, }, }; Modified: user/weongyo/usb/sys/dev/usb/serial/ugensa.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/serial/ugensa.c Sat Oct 2 08:28:15 2010 (r213356) +++ user/weongyo/usb/sys/dev/usb/serial/ugensa.c Sat Oct 2 09:46:00 2010 (r213357) @@ -109,7 +109,7 @@ static const struct usb_config ugensa_xf .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .bufsize = UGENSA_BUF_SIZE, - .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .flags = USBD_PIPE_BOF | USBD_FORCE_SHORT_XFER, .callback = &ugensa_bulk_write_callback, }, @@ -118,7 +118,7 @@ static const struct usb_config ugensa_xf .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .bufsize = UGENSA_BUF_SIZE, - .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .flags = USBD_PIPE_BOF | USBD_SHORT_XFER_OK, .callback = &ugensa_bulk_read_callback, }, }; Modified: user/weongyo/usb/sys/dev/usb/serial/uipaq.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/serial/uipaq.c Sat Oct 2 08:28:15 2010 (r213356) +++ user/weongyo/usb/sys/dev/usb/serial/uipaq.c Sat Oct 2 09:46:00 2010 (r213357) @@ -121,7 +121,7 @@ static const struct usb_config uipaq_con .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .bufsize = UIPAQ_BUF_SIZE, - .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .flags = USBD_PIPE_BOF | USBD_FORCE_SHORT_XFER, .callback = &uipaq_write_callback, }, @@ -130,7 +130,7 @@ static const struct usb_config uipaq_con .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .bufsize = UIPAQ_BUF_SIZE, - .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .flags = USBD_PIPE_BOF | USBD_SHORT_XFER_OK, .callback = &uipaq_read_callback, }, }; Modified: user/weongyo/usb/sys/dev/usb/serial/ulpt.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/serial/ulpt.c Sat Oct 2 08:28:15 2010 (r213356) +++ user/weongyo/usb/sys/dev/usb/serial/ulpt.c Sat Oct 2 09:46:00 2010 (r213357) @@ -351,7 +351,7 @@ static const struct usb_config ulpt_conf .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .bufsize = ULPT_BSIZE, - .flags = {.pipe_bof = 1,.proxy_buffer = 1}, + .flags = USBD_PIPE_BOF | USBD_PROXY_BUFFER, .callback = &ulpt_write_callback, }, @@ -360,7 +360,7 @@ static const struct usb_config ulpt_conf .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .bufsize = ULPT_BSIZE, - .flags = {.pipe_bof = 1,.short_xfer_ok = 1,.proxy_buffer = 1}, + .flags = USBD_PIPE_BOF | USBD_SHORT_XFER_OK | USBD_PROXY_BUFFER, .callback = &ulpt_read_callback, }, Modified: user/weongyo/usb/sys/dev/usb/serial/umct.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/serial/umct.c Sat Oct 2 08:28:15 2010 (r213356) +++ user/weongyo/usb/sys/dev/usb/serial/umct.c Sat Oct 2 09:46:00 2010 (r213357) @@ -151,7 +151,7 @@ static const struct usb_config umct_conf .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .bufsize = 0, /* use wMaxPacketSize */ - .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .flags = USBD_PIPE_BOF | USBD_FORCE_SHORT_XFER, .callback = &umct_write_callback, }, @@ -159,7 +159,7 @@ static const struct usb_config umct_conf .type = UE_INTERRUPT, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .flags = USBD_PIPE_BOF | USBD_SHORT_XFER_OK, .bufsize = 0, /* use wMaxPacketSize */ .callback = &umct_read_callback, .ep_index = 0, /* first interrupt endpoint */ @@ -169,7 +169,7 @@ static const struct usb_config umct_conf .type = UE_INTERRUPT, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .flags = USBD_PIPE_BOF | USBD_SHORT_XFER_OK, .bufsize = 0, /* use wMaxPacketSize */ .callback = &umct_intr_callback, .ep_index = 1, /* second interrupt endpoint */ Modified: user/weongyo/usb/sys/dev/usb/serial/umodem.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/serial/umodem.c Sat Oct 2 08:28:15 2010 (r213356) +++ user/weongyo/usb/sys/dev/usb/serial/umodem.c Sat Oct 2 09:46:00 2010 (r213357) @@ -204,7 +204,7 @@ static const struct usb_config umodem_co .direction = UE_DIR_OUT, .if_index = 0, .bufsize = UMODEM_BUF_SIZE, - .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .flags = USBD_PIPE_BOF | USBD_FORCE_SHORT_XFER, .callback = &umodem_write_callback, }, @@ -214,7 +214,7 @@ static const struct usb_config umodem_co .direction = UE_DIR_IN, .if_index = 0, .bufsize = UMODEM_BUF_SIZE, - .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .flags = USBD_PIPE_BOF | USBD_SHORT_XFER_OK, .callback = &umodem_read_callback, }, @@ -223,7 +223,8 @@ static const struct usb_config umodem_co .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .if_index = 1, - .flags = {.pipe_bof = 1,.short_xfer_ok = 1,.no_pipe_ok = 1,}, + .flags = USBD_PIPE_BOF | USBD_SHORT_XFER_OK | + USBD_NO_PIPE_OK, .bufsize = 0, /* use wMaxPacketSize */ .callback = &umodem_intr_callback, }, Modified: user/weongyo/usb/sys/dev/usb/serial/umoscom.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/serial/umoscom.c Sat Oct 2 08:28:15 2010 (r213356) +++ user/weongyo/usb/sys/dev/usb/serial/umoscom.c Sat Oct 2 09:46:00 2010 (r213357) @@ -216,7 +216,7 @@ static const struct usb_config umoscom_c .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .bufsize = UMOSCOM_BUFSIZE, - .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .flags = USBD_PIPE_BOF | USBD_FORCE_SHORT_XFER, .callback = &umoscom_write_callback, }, @@ -225,7 +225,7 @@ static const struct usb_config umoscom_c .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .bufsize = UMOSCOM_BUFSIZE, - .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .flags = USBD_PIPE_BOF | USBD_SHORT_XFER_OK, .callback = &umoscom_read_callback, }, @@ -233,7 +233,7 @@ static const struct usb_config umoscom_c .type = UE_INTERRUPT, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .flags = USBD_PIPE_BOF | USBD_SHORT_XFER_OK, .bufsize = 0, /* use wMaxPacketSize */ .callback = &umoscom_intr_callback, }, Modified: user/weongyo/usb/sys/dev/usb/serial/uplcom.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/serial/uplcom.c Sat Oct 2 08:28:15 2010 (r213356) +++ user/weongyo/usb/sys/dev/usb/serial/uplcom.c Sat Oct 2 09:46:00 2010 (r213357) @@ -202,7 +202,7 @@ static const struct usb_config uplcom_co .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .bufsize = UPLCOM_BULK_BUF_SIZE, - .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .flags = USBD_PIPE_BOF | USBD_FORCE_SHORT_XFER, .callback = &uplcom_write_callback, .if_index = 0, }, @@ -212,7 +212,7 @@ static const struct usb_config uplcom_co .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .bufsize = UPLCOM_BULK_BUF_SIZE, - .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .flags = USBD_PIPE_BOF | USBD_SHORT_XFER_OK, .callback = &uplcom_read_callback, .if_index = 0, }, @@ -221,7 +221,7 @@ static const struct usb_config uplcom_co .type = UE_INTERRUPT, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .flags = USBD_PIPE_BOF | USBD_SHORT_XFER_OK, .bufsize = 0, /* use wMaxPacketSize */ .callback = &uplcom_intr_callback, .if_index = 1, Modified: user/weongyo/usb/sys/dev/usb/serial/uslcom.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/serial/uslcom.c Sat Oct 2 08:28:15 2010 (r213356) +++ user/weongyo/usb/sys/dev/usb/serial/uslcom.c Sat Oct 2 09:46:00 2010 (r213357) @@ -141,7 +141,7 @@ static const struct usb_config uslcom_co .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .bufsize = USLCOM_BULK_BUF_SIZE, - .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .flags = USBD_PIPE_BOF | USBD_FORCE_SHORT_XFER, .callback = &uslcom_write_callback, }, @@ -150,7 +150,7 @@ static const struct usb_config uslcom_co .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .bufsize = USLCOM_BULK_BUF_SIZE, - .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .flags = USBD_PIPE_BOF | USBD_SHORT_XFER_OK, .callback = &uslcom_read_callback, }, }; Modified: user/weongyo/usb/sys/dev/usb/serial/uvisor.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/serial/uvisor.c Sat Oct 2 08:28:15 2010 (r213356) +++ user/weongyo/usb/sys/dev/usb/serial/uvisor.c Sat Oct 2 09:46:00 2010 (r213357) @@ -208,7 +208,7 @@ static const struct usb_config uvisor_co .direction = UE_DIR_OUT, .bufsize = UVISOROBUFSIZE * UVISOROFRAMES, .frames = UVISOROFRAMES, - .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .flags = USBD_PIPE_BOF | USBD_FORCE_SHORT_XFER, .callback = &uvisor_write_callback, }, @@ -217,7 +217,7 @@ static const struct usb_config uvisor_co .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .bufsize = UVISORIBUFSIZE, - .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .flags = USBD_PIPE_BOF | USBD_SHORT_XFER_OK, .callback = &uvisor_read_callback, }, }; Modified: user/weongyo/usb/sys/dev/usb/serial/uvscom.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/serial/uvscom.c Sat Oct 2 08:28:15 2010 (r213356) +++ user/weongyo/usb/sys/dev/usb/serial/uvscom.c Sat Oct 2 09:46:00 2010 (r213357) @@ -191,7 +191,7 @@ static const struct usb_config uvscom_co .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .bufsize = UVSCOM_BULK_BUF_SIZE, - .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .flags = USBD_PIPE_BOF | USBD_FORCE_SHORT_XFER, .callback = &uvscom_write_callback, }, @@ -200,7 +200,7 @@ static const struct usb_config uvscom_co .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .bufsize = UVSCOM_BULK_BUF_SIZE, - .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .flags = USBD_PIPE_BOF | USBD_SHORT_XFER_OK, .callback = &uvscom_read_callback, }, @@ -208,7 +208,7 @@ static const struct usb_config uvscom_co .type = UE_INTERRUPT, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .flags = USBD_PIPE_BOF | USBD_SHORT_XFER_OK, .bufsize = 0, /* use wMaxPacketSize */ .callback = &uvscom_intr_callback, }, Modified: user/weongyo/usb/sys/dev/usb/storage/umass.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/storage/umass.c Sat Oct 2 08:28:15 2010 (r213356) +++ user/weongyo/usb/sys/dev/usb/storage/umass.c Sat Oct 2 09:46:00 2010 (r213357) @@ -141,9 +141,9 @@ __FBSDID("$FreeBSD$"); #define UMASS_EXT_BUFFER #ifdef UMASS_EXT_BUFFER /* this enables loading of virtual buffers into DMA */ -#define UMASS_USB_FLAGS .ext_buffer=1, +#define UMASS_USB_FLAGS USBD_EXT_BUFFER #else -#define UMASS_USB_FLAGS +#define UMASS_USB_FLAGS 0 #endif #ifdef USB_DEBUG @@ -535,7 +535,8 @@ static struct usb_config umass_bbb_confi .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .bufsize = UMASS_BULK_SIZE, - .flags = {.proxy_buffer = 1,.short_xfer_ok = 1, UMASS_USB_FLAGS}, + .flags = USBD_PROXY_BUFFER | USBD_SHORT_XFER_OK | + UMASS_USB_FLAGS, .callback = &umass_t_bbb_data_read_callback, .timeout = 0, /* overwritten later */ }, @@ -554,7 +555,8 @@ static struct usb_config umass_bbb_confi .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .bufsize = UMASS_BULK_SIZE, - .flags = {.proxy_buffer = 1,.short_xfer_ok = 1, UMASS_USB_FLAGS}, + .flags = USBD_PROXY_BUFFER | USBD_SHORT_XFER_OK | + UMASS_USB_FLAGS, .callback = &umass_t_bbb_data_write_callback, .timeout = 0, /* overwritten later */ }, @@ -573,7 +575,7 @@ static struct usb_config umass_bbb_confi .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .bufsize = sizeof(umass_bbb_csw_t), - .flags = {.short_xfer_ok = 1,}, + .flags = USBD_SHORT_XFER_OK, .callback = &umass_t_bbb_status_callback, .timeout = 5000, /* ms */ }, @@ -626,7 +628,8 @@ static struct usb_config umass_cbi_confi .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .bufsize = UMASS_BULK_SIZE, - .flags = {.proxy_buffer = 1,.short_xfer_ok = 1, UMASS_USB_FLAGS}, + .flags = USBD_PROXY_BUFFER | USBD_SHORT_XFER_OK | + UMASS_USB_FLAGS, .callback = &umass_t_cbi_data_read_callback, .timeout = 0, /* overwritten later */ }, @@ -645,7 +648,8 @@ static struct usb_config umass_cbi_confi .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .bufsize = UMASS_BULK_SIZE, - .flags = {.proxy_buffer = 1,.short_xfer_ok = 1, UMASS_USB_FLAGS}, + .flags = USBD_PROXY_BUFFER | USBD_SHORT_XFER_OK | + UMASS_USB_FLAGS, .callback = &umass_t_cbi_data_write_callback, .timeout = 0, /* overwritten later */ }, @@ -663,7 +667,7 @@ static struct usb_config umass_cbi_confi .type = UE_INTERRUPT, *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***