This fixes up a couple of problems I came across while working on
uhci-hcd. There are a couple of places where shifts are used where they
shouldn't be and others where should be.
This cleans up a couple of cases and tidys it up.
The patch is relative to 2.4.19-pre8 and my other patches, but it's
alright to wait for 2.4.20. It should also be applied to 2.5.
Thanks!
JE
diff -ur -X dontdiff linux-2.4.19-pre8.orig/drivers/usb/uhci.c
linux-2.4.19-pre8/drivers/usb/uhci.c
--- linux-2.4.19-pre8.orig/drivers/usb/uhci.c Wed May 15 15:04:53 2002
+++ linux-2.4.19-pre8/drivers/usb/uhci.c Wed May 15 19:39:29 2002
@@ -133,7 +133,7 @@
unsigned long flags;
spin_lock_irqsave(&uhci->frame_list_lock, flags);
- uhci->skel_term_td->status |= TD_CTRL_IOC_BIT;
+ uhci->skel_term_td->status |= TD_CTRL_IOC;
spin_unlock_irqrestore(&uhci->frame_list_lock, flags);
}
@@ -142,7 +142,7 @@
unsigned long flags;
spin_lock_irqsave(&uhci->frame_list_lock, flags);
- uhci->skel_term_td->status &= ~TD_CTRL_IOC_BIT;
+ uhci->skel_term_td->status &= ~TD_CTRL_IOC;
spin_unlock_irqrestore(&uhci->frame_list_lock, flags);
}
@@ -870,7 +870,7 @@
return -ENOMEM;
/* Alternate Data0/1 (start with Data1) */
- destination ^= 1 << TD_TOKEN_TOGGLE;
+ destination ^= TD_TOKEN_TOGGLE;
uhci_add_td_to_urb(urb, td);
uhci_fill_td(td, status, destination | ((pktsze - 1) << 21),
@@ -897,7 +897,7 @@
else
destination |= USB_PID_OUT;
- destination |= 1 << TD_TOKEN_TOGGLE; /* End in Data1 */
+ destination |= TD_TOKEN_TOGGLE; /* End in Data1 */
status &= ~TD_CTRL_SPD;
@@ -1102,7 +1102,7 @@
if (!td)
return -ENOMEM;
- destination |= (usb_gettoggle(urb->dev, usb_pipeendpoint(urb->pipe),
usb_pipeout(urb->pipe)) << TD_TOKEN_TOGGLE);
+ destination |= (usb_gettoggle(urb->dev, usb_pipeendpoint(urb->pipe),
+usb_pipeout(urb->pipe)) << TD_TOKEN_TOGGLE_SHIFT);
destination |= ((urb->transfer_buffer_length - 1) << 21);
usb_dotoggle(urb->dev, usb_pipeendpoint(urb->pipe), usb_pipeout(urb->pipe));
@@ -1195,8 +1195,8 @@
td = list_entry(urbp->td_list.next, struct uhci_td, list);
td->status = (td->status & 0x2F000000) | TD_CTRL_ACTIVE | TD_CTRL_IOC;
- td->info &= ~(1 << TD_TOKEN_TOGGLE);
- td->info |= (usb_gettoggle(urb->dev, usb_pipeendpoint(urb->pipe),
usb_pipeout(urb->pipe)) << TD_TOKEN_TOGGLE);
+ td->info &= ~TD_TOKEN_TOGGLE;
+ td->info |= (usb_gettoggle(urb->dev, usb_pipeendpoint(urb->pipe),
+usb_pipeout(urb->pipe)) << TD_TOKEN_TOGGLE_SHIFT);
usb_dotoggle(urb->dev, usb_pipeendpoint(urb->pipe), usb_pipeout(urb->pipe));
out:
@@ -1252,7 +1252,7 @@
uhci_fill_td(td, status, destination |
(((pktsze - 1) & UHCI_NULL_DATA_SIZE) << 21) |
(usb_gettoggle(urb->dev, usb_pipeendpoint(urb->pipe),
- usb_pipeout(urb->pipe)) << TD_TOKEN_TOGGLE),
+ usb_pipeout(urb->pipe)) << TD_TOKEN_TOGGLE_SHIFT),
data);
data += pktsze;
@@ -1280,7 +1280,7 @@
uhci_fill_td(td, status, destination |
(UHCI_NULL_DATA_SIZE << 21) |
(usb_gettoggle(urb->dev, usb_pipeendpoint(urb->pipe),
- usb_pipeout(urb->pipe)) << TD_TOKEN_TOGGLE),
+ usb_pipeout(urb->pipe)) << TD_TOKEN_TOGGLE_SHIFT),
data);
usb_dotoggle(urb->dev, usb_pipeendpoint(urb->pipe),
diff -ur -X dontdiff linux-2.4.19-pre8.orig/drivers/usb/uhci.h
linux-2.4.19-pre8/drivers/usb/uhci.h
--- linux-2.4.19-pre8.orig/drivers/usb/uhci.h Fri May 10 19:40:39 2002
+++ linux-2.4.19-pre8/drivers/usb/uhci.h Wed May 15 18:43:57 2002
@@ -100,7 +100,6 @@
#define TD_CTRL_C_ERR_SHIFT 27
#define TD_CTRL_LS (1 << 26) /* Low Speed Device */
#define TD_CTRL_IOS (1 << 25) /* Isochronous Select */
-#define TD_CTRL_IOC_BIT 24
#define TD_CTRL_IOC (1 << 24) /* Interrupt on Complete */
#define TD_CTRL_ACTIVE (1 << 23) /* TD Active */
#define TD_CTRL_STALLED (1 << 22) /* TD Stalled */
@@ -120,7 +119,8 @@
/*
* for TD <info>: (a.k.a. Token)
*/
-#define TD_TOKEN_TOGGLE 19
+#define TD_TOKEN_TOGGLE_SHIFT 19
+#define TD_TOKEN_TOGGLE (1 << 19)
#define TD_TOKEN_PID_MASK 0xFF
#define TD_TOKEN_EXPLEN_MASK 0x7FF /* expected length, encoded as n - 1 */
_______________________________________________________________
Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: [EMAIL PROTECTED]
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel