KDB 4.1 on the project page for 2.4.20 will not compile against 2.4.20
with USB keyboard enabled.
Some types were changed (urb_t removed in favor of just struct urb) and
it looks like functions were moved, creating implicit declarations and
all the badness that follows. There are also three unused variables
that were removed.
The attached patch gets it to compile.
Thanks
-steve
diff -uNr linux-2.4.20-kdb-applied/arch/i386/kdb/kdba_io.c
linux-2.4.20-kdb-keyboardfix/arch/i386/kdb/kdba_io.c
--- linux-2.4.20-kdb-applied/arch/i386/kdb/kdba_io.c Tue Apr 29 16:40:59 2003
+++ linux-2.4.20-kdb-keyboardfix/arch/i386/kdb/kdba_io.c Tue Apr 29
17:46:34 2003
@@ -90,7 +90,7 @@
return -1;
/* Transfer char if they are present */
- (*kdb_usb_infos.poll_func)(kdb_usb_infos.uhci, (urb_t
*)kdb_usb_infos.urb);
+ (*kdb_usb_infos.poll_func)(kdb_usb_infos.uhci, (struct urb
*)kdb_usb_infos.urb);
spec = kdb_usb_infos.buffer[0];
keycode = kdb_usb_infos.buffer[2];
diff -uNr linux-2.4.20-kdb-applied/drivers/usb/usb-uhci.c
linux-2.4.20-kdb-keyboardfix/drivers/usb/usb-uhci.c
--- linux-2.4.20-kdb-applied/drivers/usb/usb-uhci.c Tue Apr 29 16:40:52 2003
+++ linux-2.4.20-kdb-keyboardfix/drivers/usb/usb-uhci.c Tue Apr 29 17:40:46 2003
@@ -137,114 +137,6 @@
/* used by userspace UHCI data structure dumper */
uhci_t **uhci_devices = &devs;
-/* ------------------------------------------------------------------ */
-/* KDB part */
-
-#if defined(CONFIG_KDB_USB)
-/*
-* The part of the code of UHCI controller that
-* process the interrupt transfer
-*/
-
-void uhci_process_kdb_interrupt (uhci_t *s, urb_t *urb)
-{
- int i, ret = -EINPROGRESS;
- urb_priv_t *urb_priv = urb->hcpriv;
- struct list_head *p = urb_priv->desc_list.next;
- uhci_desc_t *desc = list_entry (urb_priv->desc_list.prev, uhci_desc_t,
desc_list);
-
- int actual_length;
- int status = 0;
-
- for (i = 0; p != &urb_priv->desc_list; p = p->next, i++) //
Maybe we allow more than one TD later ;-)
- {
- desc = list_entry (p, uhci_desc_t, desc_list);
-
- if (is_td_active(desc)) {
- // do not process active TDs
- //dbg("TD ACT Status @%p
%08x",desc,le32_to_cpu(desc->hw.td.status));
- break;
- }
-
- if (!(desc->hw.td.status & cpu_to_le32(TD_CTRL_IOC))) {
- // do not process one-shot TDs, no recycling
- break;
- }
- // extract transfer parameters from TD
-
- actual_length =
uhci_actual_length(le32_to_cpu(desc->hw.td.status));
- status = uhci_map_status (uhci_status_bits
(le32_to_cpu(desc->hw.td.status)), usb_pipeout (urb->pipe));
-
- // see if EP is stalled
- if (status == -EPIPE) {
- // set up stalled condition
- usb_endpoint_halt (urb->dev, usb_pipeendpoint
(urb->pipe), usb_pipeout (urb->pipe));
- }
-
- // if any error occurred: ignore this td, and continue
- if (status != 0) {
- //uhci_show_td (desc);
- urb->error_count++;
- goto recycle;
- }
- else
- urb->actual_length = actual_length;
-
-recycle:
- uhci_urb_dma_sync(s, urb, urb->hcpriv);
-
- if ((urb->status != -ECONNABORTED) && (urb->status !=
ECONNRESET) &&
- (urb->status != -ENOENT)) {
-
- urb->status = -EINPROGRESS;
-
- // Recycle INT-TD if interval!=0, else mark TD as
one-shot
- if (urb->interval) {
-
- desc->hw.td.info &= cpu_to_le32(~(1 <<
TD_TOKEN_TOGGLE));
- if (status==0) {
- desc->hw.td.info |=
cpu_to_le32((usb_gettoggle (urb->dev, usb_pipeendpoint (urb->pipe),
- usb_pipeout
(urb->pipe)) << TD_TOKEN_TOGGLE));
- usb_dotoggle (urb->dev,
usb_pipeendpoint (urb->pipe), usb_pipeout (urb->pipe));
- } else {
- desc->hw.td.info |=
cpu_to_le32((!usb_gettoggle (urb->dev, usb_pipeendpoint (urb->pipe),
- usb_pipeout
(urb->pipe)) << TD_TOKEN_TOGGLE));
- }
- desc->hw.td.status= cpu_to_le32((urb->pipe &
TD_CTRL_LS) | TD_CTRL_ACTIVE | TD_CTRL_IOC |
-
(urb->transfer_flags & USB_DISABLE_SPD ? 0 : TD_CTRL_SPD) | (3 << 27));
- mb();
- } else {
- uhci_unlink_urb_async(s, urb,
UNLINK_ASYNC_STORE_URB);
- // correct toggle after unlink
- usb_dotoggle (urb->dev, usb_pipeendpoint
(urb->pipe), usb_pipeout (urb->pipe));
- clr_td_ioc(desc); // inactivate TD
- }
- }
- }
-}
-
-/* uhci_kdb_poll
- * This function is a minimalist version of the
- * controller interrupt handler
- */
-void uhci_kdb_poll (void *__uhci, urb_t *urb)
-{
- uhci_t *s = __uhci;
- unsigned int io_addr = s->io_addr;
- unsigned short status;
-
- /* Reset input timer to be able to quit KDB */
- (*kdb_usb_infos.reset_timer)();
-
- s->unlink_urb_done=0;
- uhci_process_kdb_interrupt (s, urb);
-
- clean_descs(s, CLEAN_NOT_FORCED);
- uhci_cleanup_unlink(s, CLEAN_NOT_FORCED);
- uhci_switch_timer_int(s);
-}
-#endif
-/*-------------------------------------------------------------------*/
// Cleans up collected QHs, but not more than 100 in one go
void clean_descs(uhci_t *s, int force)
{
@@ -3026,6 +2918,112 @@
}
#endif
+/* ------------------------------------------------------------------ */
+/* KDB part */
+
+#if defined(CONFIG_KDB_USB)
+/*
+* The part of the code of UHCI controller that
+* process the interrupt transfer
+*/
+
+void uhci_process_kdb_interrupt (uhci_t *s, struct urb *urb)
+{
+ int i;
+ urb_priv_t *urb_priv = urb->hcpriv;
+ struct list_head *p = urb_priv->desc_list.next;
+ uhci_desc_t *desc = list_entry (urb_priv->desc_list.prev, uhci_desc_t,
desc_list);
+
+ int actual_length;
+ int status = 0;
+
+ for (i = 0; p != &urb_priv->desc_list; p = p->next, i++) //
Maybe we allow more than one TD later ;-)
+ {
+ desc = list_entry (p, uhci_desc_t, desc_list);
+
+ if (is_td_active(desc)) {
+ // do not process active TDs
+ //dbg("TD ACT Status @%p
%08x",desc,le32_to_cpu(desc->hw.td.status));
+ break;
+ }
+
+ if (!(desc->hw.td.status & cpu_to_le32(TD_CTRL_IOC))) {
+ // do not process one-shot TDs, no recycling
+ break;
+ }
+ // extract transfer parameters from TD
+
+ actual_length =
uhci_actual_length(le32_to_cpu(desc->hw.td.status));
+ status = uhci_map_status (uhci_status_bits
(le32_to_cpu(desc->hw.td.status)), usb_pipeout (urb->pipe));
+
+ // see if EP is stalled
+ if (status == -EPIPE) {
+ // set up stalled condition
+ usb_endpoint_halt (urb->dev, usb_pipeendpoint
(urb->pipe), usb_pipeout (urb->pipe));
+ }
+
+ // if any error occurred: ignore this td, and continue
+ if (status != 0) {
+ //uhci_show_td (desc);
+ urb->error_count++;
+ goto recycle;
+ }
+ else
+ urb->actual_length = actual_length;
+
+recycle:
+ uhci_urb_dma_sync(s, urb, urb->hcpriv);
+
+ if ((urb->status != -ECONNABORTED) && (urb->status !=
ECONNRESET) &&
+ (urb->status != -ENOENT)) {
+
+ urb->status = -EINPROGRESS;
+
+ // Recycle INT-TD if interval!=0, else mark TD as
one-shot
+ if (urb->interval) {
+
+ desc->hw.td.info &= cpu_to_le32(~(1 <<
TD_TOKEN_TOGGLE));
+ if (status==0) {
+ desc->hw.td.info |=
cpu_to_le32((usb_gettoggle (urb->dev, usb_pipeendpoint (urb->pipe),
+ usb_pipeout
(urb->pipe)) << TD_TOKEN_TOGGLE));
+ usb_dotoggle (urb->dev,
usb_pipeendpoint (urb->pipe), usb_pipeout (urb->pipe));
+ } else {
+ desc->hw.td.info |=
cpu_to_le32((!usb_gettoggle (urb->dev, usb_pipeendpoint (urb->pipe),
+ usb_pipeout
(urb->pipe)) << TD_TOKEN_TOGGLE));
+ }
+ desc->hw.td.status= cpu_to_le32((urb->pipe &
TD_CTRL_LS) | TD_CTRL_ACTIVE | TD_CTRL_IOC |
+
(urb->transfer_flags & USB_DISABLE_SPD ? 0 : TD_CTRL_SPD) | (3 << 27));
+ mb();
+ } else {
+ uhci_unlink_urb_async(s, urb,
UNLINK_ASYNC_STORE_URB);
+ // correct toggle after unlink
+ usb_dotoggle (urb->dev, usb_pipeendpoint
(urb->pipe), usb_pipeout (urb->pipe));
+ clr_td_ioc(desc); // inactivate TD
+ }
+ }
+ }
+}
+
+/* uhci_kdb_poll
+ * This function is a minimalist version of the
+ * controller interrupt handler
+ */
+void uhci_kdb_poll (void *__uhci, struct urb *urb)
+{
+ uhci_t *s = __uhci;
+
+ /* Reset input timer to be able to quit KDB */
+ (*kdb_usb_infos.reset_timer)();
+
+ s->unlink_urb_done=0;
+ uhci_process_kdb_interrupt (s, urb);
+
+ clean_descs(s, CLEAN_NOT_FORCED);
+ uhci_cleanup_unlink(s, CLEAN_NOT_FORCED);
+ uhci_switch_timer_int(s);
+}
+#endif
+/*-------------------------------------------------------------------*/
_static int __devinit alloc_uhci (struct pci_dev *dev, int irq, unsigned int
io_addr, unsigned int io_size)
{
uhci_t *s;
|