svn commit: r213338 - in user/weongyo/usb/sys/dev/usb: . controller

Weongyo Jeong weongyo at FreeBSD.org
Fri Oct 1 23:13:57 UTC 2010


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 ***


More information about the svn-src-user mailing list