[BACK]Return to usbdi.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / dev / usb

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sys/dev/usb/usbdi.c between version 1.173 and 1.173.2.3

version 1.173, 2017/06/01 02:45:12 version 1.173.2.3, 2018/09/27 14:52:26
Line 77  usbd_dump_iface(struct usbd_interface *i
Line 77  usbd_dump_iface(struct usbd_interface *i
 {  {
         USBHIST_FUNC(); USBHIST_CALLED(usbdebug);          USBHIST_FUNC(); USBHIST_CALLED(usbdebug);
   
         USBHIST_LOG(usbdebug, "iface %p", iface, 0, 0, 0);          USBHIST_LOG(usbdebug, "iface %#jx", (uintptr_t)iface, 0, 0, 0);
         if (iface == NULL)          if (iface == NULL)
                 return;                  return;
         USBHIST_LOG(usbdebug, "     device = %p idesc = %p index = %d",          USBHIST_LOG(usbdebug, "     device = %#jx idesc = %#jx index = %d",
             iface->ui_dev, iface->ui_idesc, iface->ui_index, 0);              (uintptr_t)iface->ui_dev, (uintptr_t)iface->ui_idesc,
         USBHIST_LOG(usbdebug, "     altindex=%d priv=%p",              iface->ui_index, 0);
             iface->ui_altindex, iface->ui_priv, 0, 0);          USBHIST_LOG(usbdebug, "     altindex=%d priv=%#jx",
               iface->ui_altindex, (uintptr_t)iface->ui_priv, 0, 0);
 }  }
   
 void  void
Line 91  usbd_dump_device(struct usbd_device *dev
Line 92  usbd_dump_device(struct usbd_device *dev
 {  {
         USBHIST_FUNC(); USBHIST_CALLED(usbdebug);          USBHIST_FUNC(); USBHIST_CALLED(usbdebug);
   
         USBHIST_LOG(usbdebug, "dev = %p", dev, 0, 0, 0);          USBHIST_LOG(usbdebug, "dev = %#jx", (uintptr_t)dev, 0, 0, 0);
         if (dev == NULL)          if (dev == NULL)
                 return;                  return;
         USBHIST_LOG(usbdebug, "     bus = %p default_pipe = %p",          USBHIST_LOG(usbdebug, "     bus = %#jx default_pipe = %#jx",
             dev->ud_bus, dev->ud_pipe0, 0, 0);              (uintptr_t)dev->ud_bus, (uintptr_t)dev->ud_pipe0, 0, 0);
         USBHIST_LOG(usbdebug, "     address = %d config = %d depth = %d ",          USBHIST_LOG(usbdebug, "     address = %jd config = %jd depth = %jd ",
             dev->ud_addr, dev->ud_config, dev->ud_depth, 0);              dev->ud_addr, dev->ud_config, dev->ud_depth, 0);
         USBHIST_LOG(usbdebug, "     speed = %d self_powered = %d "          USBHIST_LOG(usbdebug, "     speed = %jd self_powered = %jd "
             "power = %d langid = %d",              "power = %jd langid = %jd",
             dev->ud_speed, dev->ud_selfpowered, dev->ud_power, dev->ud_langid);              dev->ud_speed, dev->ud_selfpowered, dev->ud_power, dev->ud_langid);
 }  }
   
Line 108  usbd_dump_endpoint(struct usbd_endpoint 
Line 109  usbd_dump_endpoint(struct usbd_endpoint 
 {  {
         USBHIST_FUNC(); USBHIST_CALLED(usbdebug);          USBHIST_FUNC(); USBHIST_CALLED(usbdebug);
   
         USBHIST_LOG(usbdebug, "endp = %p", endp, 0, 0, 0);          USBHIST_LOG(usbdebug, "endp = %#jx", (uintptr_t)endp, 0, 0, 0);
         if (endp == NULL)          if (endp == NULL)
                 return;                  return;
         USBHIST_LOG(usbdebug, "    edesc = %p refcnt = %d",          USBHIST_LOG(usbdebug, "    edesc = %#jx refcnt = %jd",
             endp->ue_edesc, endp->ue_refcnt, 0, 0);              (uintptr_t)endp->ue_edesc, endp->ue_refcnt, 0, 0);
         if (endp->ue_edesc)          if (endp->ue_edesc)
                 USBHIST_LOG(usbdebug, "     bEndpointAddress=0x%02x",                  USBHIST_LOG(usbdebug, "     bEndpointAddress=0x%02x",
                     endp->ue_edesc->bEndpointAddress, 0, 0, 0);                      endp->ue_edesc->bEndpointAddress, 0, 0, 0);
Line 125  usbd_dump_queue(struct usbd_pipe *pipe)
Line 126  usbd_dump_queue(struct usbd_pipe *pipe)
   
         USBHIST_FUNC(); USBHIST_CALLED(usbdebug);          USBHIST_FUNC(); USBHIST_CALLED(usbdebug);
   
         USBHIST_LOG(usbdebug, "pipe = %p", pipe, 0, 0, 0);          USBHIST_LOG(usbdebug, "pipe = %#jx", (uintptr_t)pipe, 0, 0, 0);
         SIMPLEQ_FOREACH(xfer, &pipe->up_queue, ux_next) {          SIMPLEQ_FOREACH(xfer, &pipe->up_queue, ux_next) {
                 USBHIST_LOG(usbdebug, "     xfer = %p", xfer, 0, 0, 0);                  USBHIST_LOG(usbdebug, "     xfer = %#jx", (uintptr_t)xfer,
                       0, 0, 0);
         }          }
 }  }
   
Line 136  usbd_dump_pipe(struct usbd_pipe *pipe)
Line 138  usbd_dump_pipe(struct usbd_pipe *pipe)
 {  {
         USBHIST_FUNC(); USBHIST_CALLED(usbdebug);          USBHIST_FUNC(); USBHIST_CALLED(usbdebug);
   
         USBHIST_LOG(usbdebug, "pipe = %p", pipe, 0, 0, 0);          USBHIST_LOG(usbdebug, "pipe = %#jx", (uintptr_t)pipe, 0, 0, 0);
         if (pipe == NULL)          if (pipe == NULL)
                 return;                  return;
         usbd_dump_iface(pipe->up_iface);          usbd_dump_iface(pipe->up_iface);
         usbd_dump_device(pipe->up_dev);          usbd_dump_device(pipe->up_dev);
         usbd_dump_endpoint(pipe->up_endpoint);          usbd_dump_endpoint(pipe->up_endpoint);
         USBHIST_LOG(usbdebug, "(usbd_dump_pipe)", 0, 0, 0, 0);          USBHIST_LOG(usbdebug, "(usbd_dump_pipe)", 0, 0, 0, 0);
         USBHIST_LOG(usbdebug, "     running = %d aborting = %d",          USBHIST_LOG(usbdebug, "     running = %jd aborting = %jd",
             pipe->up_running, pipe->up_aborting, 0, 0);              pipe->up_running, pipe->up_aborting, 0, 0);
         USBHIST_LOG(usbdebug, "     intrxfer = %p, repeat = %d, interval = %d",          USBHIST_LOG(usbdebug, "     intrxfer = %#jx, repeat = %jd, "
             pipe->up_intrxfer, pipe->up_repeat, pipe->up_interval, 0);              "interval = %jd", (uintptr_t)pipe->up_intrxfer, pipe->up_repeat,
               pipe->up_interval, 0);
 }  }
 #endif  #endif
   
Line 169  usbd_open_pipe_ival(struct usbd_interfac
Line 172  usbd_open_pipe_ival(struct usbd_interfac
   
         USBHIST_FUNC(); USBHIST_CALLED(usbdebug);          USBHIST_FUNC(); USBHIST_CALLED(usbdebug);
   
         USBHIST_LOG(usbdebug, "iface = %p address = 0x%x flags = 0x%x",          USBHIST_LOG(usbdebug, "iface = %#jx address = 0x%jx flags = 0x%jx",
             iface, address, flags, 0);              (uintptr_t)iface, address, flags, 0);
   
         for (i = 0; i < iface->ui_idesc->bNumEndpoints; i++) {          for (i = 0; i < iface->ui_idesc->bNumEndpoints; i++) {
                 ep = &iface->ui_endpoints[i];                  ep = &iface->ui_endpoints[i];
Line 203  usbd_open_pipe_intr(struct usbd_interfac
Line 206  usbd_open_pipe_intr(struct usbd_interfac
   
         USBHIST_FUNC(); USBHIST_CALLED(usbdebug);          USBHIST_FUNC(); USBHIST_CALLED(usbdebug);
   
         USBHIST_LOG(usbdebug, "address = 0x%x flags = 0x%x len = %d",          USBHIST_LOG(usbdebug, "address = 0x%jx flags = 0x%jx len = %jd",
             address, flags, len, 0);              address, flags, len, 0);
   
         err = usbd_open_pipe_ival(iface, address,          err = usbd_open_pipe_ival(iface, address,
Line 277  usbd_transfer(struct usbd_xfer *xfer)
Line 280  usbd_transfer(struct usbd_xfer *xfer)
         USBHIST_FUNC(); USBHIST_CALLED(usbdebug);          USBHIST_FUNC(); USBHIST_CALLED(usbdebug);
   
         USBHIST_LOG(usbdebug,          USBHIST_LOG(usbdebug,
             "xfer = %p, flags = %#x, pipe = %p, running = %d",              "xfer = %#jx, flags = %#jx, pipe = %#jx, running = %jd",
             xfer, xfer->ux_flags, pipe, pipe->up_running);              (uintptr_t)xfer, xfer->ux_flags, (uintptr_t)pipe, pipe->up_running);
           KASSERT(xfer->ux_status == USBD_NOT_STARTED);
   
 #ifdef USB_DEBUG  #ifdef USB_DEBUG
         if (usbdebug > 5)          if (usbdebug > 5)
Line 287  usbd_transfer(struct usbd_xfer *xfer)
Line 291  usbd_transfer(struct usbd_xfer *xfer)
         xfer->ux_done = 0;          xfer->ux_done = 0;
   
         if (pipe->up_aborting) {          if (pipe->up_aborting) {
                 USBHIST_LOG(usbdebug, "<- done xfer %p, aborting", xfer, 0, 0,                  USBHIST_LOG(usbdebug, "<- done xfer %#jx, aborting",
                     0);                      (uintptr_t)xfer, 0, 0, 0);
                 return USBD_CANCELLED;                  return USBD_CANCELLED;
         }          }
   
Line 321  usbd_transfer(struct usbd_xfer *xfer)
Line 325  usbd_transfer(struct usbd_xfer *xfer)
   
         /* xfer is not valid after the transfer method unless synchronous */          /* xfer is not valid after the transfer method unless synchronous */
         err = pipe->up_methods->upm_transfer(xfer);          err = pipe->up_methods->upm_transfer(xfer);
         USBHIST_LOG(usbdebug, "<- done transfer %p, err = %d", xfer, err, 0, 0);          USBHIST_LOG(usbdebug, "<- done transfer %#jx, err = %jd",
               (uintptr_t)xfer, err, 0, 0);
   
         if (err != USBD_IN_PROGRESS && err) {          if (err != USBD_IN_PROGRESS && err) {
                 /*                  /*
Line 337  usbd_transfer(struct usbd_xfer *xfer)
Line 342  usbd_transfer(struct usbd_xfer *xfer)
         }          }
   
         if (!(flags & USBD_SYNCHRONOUS)) {          if (!(flags & USBD_SYNCHRONOUS)) {
                 USBHIST_LOG(usbdebug, "<- done xfer %p, not sync (err %d)",                  USBHIST_LOG(usbdebug, "<- done xfer %#jx, not sync (err %jd)",
                     xfer, err, 0, 0);                      (uintptr_t)xfer, err, 0, 0);
                 return err;                  return err;
         }          }
   
         if (err != USBD_IN_PROGRESS) {          if (err != USBD_IN_PROGRESS) {
                 USBHIST_LOG(usbdebug, "<- done xfer %p, err %d (complete/error)", xfer,                  USBHIST_LOG(usbdebug, "<- done xfer %#jx, sync (err %jd)"
                     err, 0, 0);                      "(complete/error)", (uintptr_t)xfer, err, 0, 0);
                 return err;                  return err;
         }          }
   
Line 353  usbd_transfer(struct usbd_xfer *xfer)
Line 358  usbd_transfer(struct usbd_xfer *xfer)
         while (!xfer->ux_done) {          while (!xfer->ux_done) {
                 if (pipe->up_dev->ud_bus->ub_usepolling)                  if (pipe->up_dev->ud_bus->ub_usepolling)
                         panic("usbd_transfer: not done");                          panic("usbd_transfer: not done");
                 USBHIST_LOG(usbdebug, "<- sleeping on xfer %p", xfer, 0, 0, 0);                  USBHIST_LOG(usbdebug, "<- sleeping on xfer %#jx",
                       (uintptr_t)xfer, 0, 0, 0);
   
                 err = 0;                  err = 0;
                 if ((flags & USBD_SYNCHRONOUS_SIG) != 0) {                  if ((flags & USBD_SYNCHRONOUS_SIG) != 0) {
Line 471  usbd_alloc_xfer(struct usbd_device *dev,
Line 477  usbd_alloc_xfer(struct usbd_device *dev,
         xfer->ux_bus = dev->ud_bus;          xfer->ux_bus = dev->ud_bus;
         callout_init(&xfer->ux_callout, CALLOUT_MPSAFE);          callout_init(&xfer->ux_callout, CALLOUT_MPSAFE);
         cv_init(&xfer->ux_cv, "usbxfer");          cv_init(&xfer->ux_cv, "usbxfer");
         cv_init(&xfer->ux_hccv, "usbhcxfer");  
   
         USBHIST_LOG(usbdebug, "returns %p", xfer, 0, 0, 0);          USBHIST_LOG(usbdebug, "returns %#jx", (uintptr_t)xfer, 0, 0, 0);
   
         return xfer;          return xfer;
 }  }
Line 483  usbd_free_xfer(struct usbd_xfer *xfer)
Line 488  usbd_free_xfer(struct usbd_xfer *xfer)
 {  {
         USBHIST_FUNC(); USBHIST_CALLED(usbdebug);          USBHIST_FUNC(); USBHIST_CALLED(usbdebug);
   
         USBHIST_LOG(usbdebug, "%p", xfer, 0, 0, 0);          USBHIST_LOG(usbdebug, "%#jx", (uintptr_t)xfer, 0, 0, 0);
         if (xfer->ux_buf) {          if (xfer->ux_buf) {
                 usbd_free_buffer(xfer);                  usbd_free_buffer(xfer);
         }          }
Line 494  usbd_free_xfer(struct usbd_xfer *xfer)
Line 499  usbd_free_xfer(struct usbd_xfer *xfer)
         }          }
 #endif  #endif
         cv_destroy(&xfer->ux_cv);          cv_destroy(&xfer->ux_cv);
         cv_destroy(&xfer->ux_hccv);  
         xfer->ux_bus->ub_methods->ubm_freex(xfer->ux_bus, xfer);          xfer->ux_bus->ub_methods->ubm_freex(xfer->ux_bus, xfer);
         return USBD_NORMAL_COMPLETION;          return USBD_NORMAL_COMPLETION;
 }  }
Line 795  usbd_set_interface(struct usbd_interface
Line 799  usbd_set_interface(struct usbd_interface
   
         endpoints = iface->ui_endpoints;          endpoints = iface->ui_endpoints;
         int nendpt = iface->ui_idesc->bNumEndpoints;          int nendpt = iface->ui_idesc->bNumEndpoints;
         USBHIST_LOG(usbdebug, "iface %p endpoints = %p nendpt", iface,          USBHIST_LOG(usbdebug, "iface %#jx endpoints = %#jx nendpt %jd",
             endpoints, iface->ui_idesc->bNumEndpoints, 0);              (uintptr_t)iface, (uintptr_t)endpoints,
               iface->ui_idesc->bNumEndpoints, 0);
         err = usbd_fill_iface_data(iface->ui_dev, iface->ui_index, altidx);          err = usbd_fill_iface_data(iface->ui_dev, iface->ui_index, altidx);
         if (err)          if (err)
                 return err;                  return err;
   
         /* new setting works, we can free old endpoints */          /* new setting works, we can free old endpoints */
         if (endpoints != NULL) {          if (endpoints != NULL) {
                 USBHIST_LOG(usbdebug, "iface %p endpoints = %p nendpt", iface,                  USBHIST_LOG(usbdebug, "iface %#jx endpoints = %#jx nendpt %jd",
                     endpoints, nendpt, 0);                      (uintptr_t)iface, (uintptr_t)endpoints, nendpt, 0);
                 kmem_free(endpoints, nendpt * sizeof(struct usbd_endpoint));                  kmem_free(endpoints, nendpt * sizeof(struct usbd_endpoint));
         }          }
         KASSERT(iface->ui_idesc != NULL);          KASSERT(iface->ui_idesc != NULL);
Line 866  usbd_ar_pipe(struct usbd_pipe *pipe)
Line 871  usbd_ar_pipe(struct usbd_pipe *pipe)
   
         KASSERT(mutex_owned(pipe->up_dev->ud_bus->ub_lock));          KASSERT(mutex_owned(pipe->up_dev->ud_bus->ub_lock));
   
         USBHIST_LOG(usbdebug, "pipe = %p", pipe, 0, 0, 0);          USBHIST_LOG(usbdebug, "pipe = %#jx", (uintptr_t)pipe, 0, 0, 0);
 #ifdef USB_DEBUG  #ifdef USB_DEBUG
         if (usbdebug > 5)          if (usbdebug > 5)
                 usbd_dump_queue(pipe);                  usbd_dump_queue(pipe);
Line 874  usbd_ar_pipe(struct usbd_pipe *pipe)
Line 879  usbd_ar_pipe(struct usbd_pipe *pipe)
         pipe->up_repeat = 0;          pipe->up_repeat = 0;
         pipe->up_aborting = 1;          pipe->up_aborting = 1;
         while ((xfer = SIMPLEQ_FIRST(&pipe->up_queue)) != NULL) {          while ((xfer = SIMPLEQ_FIRST(&pipe->up_queue)) != NULL) {
                 USBHIST_LOG(usbdebug, "pipe = %p xfer = %p (methods = %p)",                  USBHIST_LOG(usbdebug, "pipe = %#jx xfer = %#jx "
                     pipe, xfer, pipe->up_methods, 0);                      "(methods = %#jx)", (uintptr_t)pipe, (uintptr_t)xfer,
                       (uintptr_t)pipe->up_methods, 0);
                 /* Make the HC abort it (and invoke the callback). */                  /* Make the HC abort it (and invoke the callback). */
                 pipe->up_methods->upm_abort(xfer);                  pipe->up_methods->upm_abort(xfer);
                 /* XXX only for non-0 usbd_clear_endpoint_stall(pipe); */                  /* XXX only for non-0 usbd_clear_endpoint_stall(pipe); */
Line 899  usb_transfer_complete(struct usbd_xfer *
Line 905  usb_transfer_complete(struct usbd_xfer *
   
         USBHIST_FUNC(); USBHIST_CALLED(usbdebug);          USBHIST_FUNC(); USBHIST_CALLED(usbdebug);
   
         USBHIST_LOG(usbdebug, "pipe = %p xfer = %p status = %d actlen = %d",          USBHIST_LOG(usbdebug, "pipe = %#jx xfer = %#jx status = %jd "
                 pipe, xfer, xfer->ux_status, xfer->ux_actlen);              "actlen = %jd", (uintptr_t)pipe, (uintptr_t)xfer, xfer->ux_status,
               xfer->ux_actlen);
   
         KASSERT(polling || mutex_owned(pipe->up_dev->ud_bus->ub_lock));          KASSERT(polling || mutex_owned(pipe->up_dev->ud_bus->ub_lock));
         KASSERT(xfer->ux_state == XFER_ONQU);          KASSERTMSG(xfer->ux_state == XFER_ONQU, "xfer %p state is %x", xfer,
               xfer->ux_state);
         KASSERT(pipe != NULL);          KASSERT(pipe != NULL);
   
         if (!repeat) {          if (!repeat) {
Line 921  usb_transfer_complete(struct usbd_xfer *
Line 929  usb_transfer_complete(struct usbd_xfer *
 #endif  #endif
                 SIMPLEQ_REMOVE_HEAD(&pipe->up_queue, ux_next);                  SIMPLEQ_REMOVE_HEAD(&pipe->up_queue, ux_next);
         }          }
         USBHIST_LOG(usbdebug, "xfer %p: repeat %d new head = %p",          USBHIST_LOG(usbdebug, "xfer %#jx: repeat %jd new head = %#jx",
             xfer, repeat, SIMPLEQ_FIRST(&pipe->up_queue), 0);              (uintptr_t)xfer, repeat, (uintptr_t)SIMPLEQ_FIRST(&pipe->up_queue),
               0);
   
         /* Count completed transfers. */          /* Count completed transfers. */
         ++pipe->up_dev->ud_bus->ub_stats.uds_requests          ++pipe->up_dev->ud_bus->ub_stats.uds_requests
Line 931  usb_transfer_complete(struct usbd_xfer *
Line 940  usb_transfer_complete(struct usbd_xfer *
         xfer->ux_done = 1;          xfer->ux_done = 1;
         if (!xfer->ux_status && xfer->ux_actlen < xfer->ux_length &&          if (!xfer->ux_status && xfer->ux_actlen < xfer->ux_length &&
             !(xfer->ux_flags & USBD_SHORT_XFER_OK)) {              !(xfer->ux_flags & USBD_SHORT_XFER_OK)) {
                 USBHIST_LOG(usbdebug, "short transfer %d < %d",                  USBHIST_LOG(usbdebug, "short transfer %jd < %jd",
                     xfer->ux_actlen, xfer->ux_length, 0, 0);                      xfer->ux_actlen, xfer->ux_length, 0, 0);
                 xfer->ux_status = USBD_SHORT_XFER;                  xfer->ux_status = USBD_SHORT_XFER;
         }          }
   
         USBHIST_LOG(usbdebug, "xfer %p doing done %p", xfer,          USBHIST_LOG(usbdebug, "xfer %#jx doing done %#jx", (uintptr_t)xfer,
             pipe->up_methods->upm_done, 0, 0);              (uintptr_t)pipe->up_methods->upm_done, 0, 0);
         pipe->up_methods->upm_done(xfer);          pipe->up_methods->upm_done(xfer);
   
         if (xfer->ux_length != 0 && xfer->ux_buffer != xfer->ux_buf) {          if (xfer->ux_length != 0 && xfer->ux_buffer != xfer->ux_buf) {
Line 950  usb_transfer_complete(struct usbd_xfer *
Line 959  usb_transfer_complete(struct usbd_xfer *
                 }                  }
         }          }
   
         USBHIST_LOG(usbdebug, "xfer %p doing callback %p status %d",          USBHIST_LOG(usbdebug, "xfer %#jx doing callback %#jx status %jd",
             xfer, xfer->ux_callback, xfer->ux_status, 0);              (uintptr_t)xfer, (uintptr_t)xfer->ux_callback, xfer->ux_status, 0);
   
         if (xfer->ux_callback) {          if (xfer->ux_callback) {
                 if (!polling)                  if (!polling) {
                         mutex_exit(pipe->up_dev->ud_bus->ub_lock);                          mutex_exit(pipe->up_dev->ud_bus->ub_lock);
                           if (!(pipe->up_flags & USBD_MPSAFE))
                 if (!(pipe->up_flags & USBD_MPSAFE))                                  KERNEL_LOCK(1, curlwp);
                         KERNEL_LOCK(1, curlwp);                  }
   
                 xfer->ux_callback(xfer, xfer->ux_priv, xfer->ux_status);                  xfer->ux_callback(xfer, xfer->ux_priv, xfer->ux_status);
   
                 if (!(pipe->up_flags & USBD_MPSAFE))                  if (!polling) {
                         KERNEL_UNLOCK_ONE(curlwp);                          if (!(pipe->up_flags & USBD_MPSAFE))
                                   KERNEL_UNLOCK_ONE(curlwp);
                 if (!polling)  
                         mutex_enter(pipe->up_dev->ud_bus->ub_lock);                          mutex_enter(pipe->up_dev->ud_bus->ub_lock);
                   }
         }          }
   
         if (sync && !polling) {          if (sync && !polling) {
                 USBHIST_LOG(usbdebug, "<- done xfer %p, wakeup", xfer, 0, 0, 0);                  USBHIST_LOG(usbdebug, "<- done xfer %#jx, wakeup",
                       (uintptr_t)xfer, 0, 0, 0);
                 cv_broadcast(&xfer->ux_cv);                  cv_broadcast(&xfer->ux_cv);
         }          }
   
Line 995  usb_insert_transfer(struct usbd_xfer *xf
Line 1005  usb_insert_transfer(struct usbd_xfer *xf
   
         USBHIST_FUNC(); USBHIST_CALLED(usbdebug);          USBHIST_FUNC(); USBHIST_CALLED(usbdebug);
   
         USBHIST_LOG(usbdebug, "xfer = %p pipe = %p running = %d timeout = %d",          USBHIST_LOG(usbdebug, "xfer = %#jx pipe = %#jx running = %jd "
             xfer, pipe, pipe->up_running, xfer->ux_timeout);              "timeout = %jd", (uintptr_t)xfer, (uintptr_t)pipe,
               pipe->up_running, xfer->ux_timeout);
   
         KASSERT(mutex_owned(pipe->up_dev->ud_bus->ub_lock));          KASSERT(mutex_owned(pipe->up_dev->ud_bus->ub_lock));
         KASSERT(xfer->ux_state == XFER_BUSY);          KASSERT(xfer->ux_state == XFER_BUSY);
Line 1011  usb_insert_transfer(struct usbd_xfer *xf
Line 1022  usb_insert_transfer(struct usbd_xfer *xf
                 pipe->up_running = 1;                  pipe->up_running = 1;
                 err = USBD_NORMAL_COMPLETION;                  err = USBD_NORMAL_COMPLETION;
         }          }
         USBHIST_LOG(usbdebug, "<- done xfer %p, err %d", xfer, err, 0, 0);          USBHIST_LOG(usbdebug, "<- done xfer %#jx, err %jd", (uintptr_t)xfer,
               err, 0, 0);
         return err;          return err;
 }  }
   
Line 1034  usbd_start_next(struct usbd_pipe *pipe)
Line 1046  usbd_start_next(struct usbd_pipe *pipe)
   
         /* Get next request in queue. */          /* Get next request in queue. */
         xfer = SIMPLEQ_FIRST(&pipe->up_queue);          xfer = SIMPLEQ_FIRST(&pipe->up_queue);
         USBHIST_LOG(usbdebug, "pipe = %p, xfer = %p", pipe, xfer, 0, 0);          USBHIST_LOG(usbdebug, "pipe = %#jx, xfer = %#jx", (uintptr_t)pipe,
               (uintptr_t)xfer, 0, 0);
         if (xfer == NULL) {          if (xfer == NULL) {
                 pipe->up_running = 0;                  pipe->up_running = 0;
         } else {          } else {
Line 1045  usbd_start_next(struct usbd_pipe *pipe)
Line 1058  usbd_start_next(struct usbd_pipe *pipe)
                         mutex_enter(pipe->up_dev->ud_bus->ub_lock);                          mutex_enter(pipe->up_dev->ud_bus->ub_lock);
   
                 if (err != USBD_IN_PROGRESS) {                  if (err != USBD_IN_PROGRESS) {
                         USBHIST_LOG(usbdebug, "error = %d", err, 0, 0, 0);                          USBHIST_LOG(usbdebug, "error = %jd", err, 0, 0, 0);
                         pipe->up_running = 0;                          pipe->up_running = 0;
                         /* XXX do what? */                          /* XXX do what? */
                 }                  }
Line 1083  usbd_do_request_flags(struct usbd_device
Line 1096  usbd_do_request_flags(struct usbd_device
         err = usbd_sync_transfer(xfer);          err = usbd_sync_transfer(xfer);
 #if defined(USB_DEBUG) || defined(DIAGNOSTIC)  #if defined(USB_DEBUG) || defined(DIAGNOSTIC)
         if (xfer->ux_actlen > xfer->ux_length) {          if (xfer->ux_actlen > xfer->ux_length) {
                 USBHIST_LOG(usbdebug, "overrun addr = %d type = 0x%02x",                  USBHIST_LOG(usbdebug, "overrun addr = %jd type = 0x%02jx",
                     dev->ud_addr, xfer->ux_request.bmRequestType, 0, 0);                      dev->ud_addr, xfer->ux_request.bmRequestType, 0, 0);
                 USBHIST_LOG(usbdebug, "     req = 0x%02x val = %d index = %d",                  USBHIST_LOG(usbdebug, "     req = 0x%02jx val = %jd "
                       "index = %jd",
                     xfer->ux_request.bRequest, UGETW(xfer->ux_request.wValue),                      xfer->ux_request.bRequest, UGETW(xfer->ux_request.wValue),
                     UGETW(xfer->ux_request.wIndex), 0);                      UGETW(xfer->ux_request.wIndex), 0);
                 USBHIST_LOG(usbdebug, "     rlen = %d length = %d actlen = %d",                  USBHIST_LOG(usbdebug, "     rlen = %jd length = %jd "
                       "actlen = %jd",
                     UGETW(xfer->ux_request.wLength),                      UGETW(xfer->ux_request.wLength),
                     xfer->ux_length, xfer->ux_actlen, 0);                      xfer->ux_length, xfer->ux_actlen, 0);
         }          }
Line 1099  usbd_do_request_flags(struct usbd_device
Line 1114  usbd_do_request_flags(struct usbd_device
         usbd_destroy_xfer(xfer);          usbd_destroy_xfer(xfer);
   
         if (err) {          if (err) {
                 USBHIST_LOG(usbdebug, "returning err = %d", err, 0, 0, 0);                  USBHIST_LOG(usbdebug, "returning err = %jd", err, 0, 0, 0);
         }          }
         return err;          return err;
 }  }
Line 1128  usbd_dopoll(struct usbd_interface *iface
Line 1143  usbd_dopoll(struct usbd_interface *iface
 }  }
   
 /*  /*
  * XXX use this more???  ub_usepolling it touched manually all over   * This is for keyboard driver as well, which only operates in polling
    * mode from the ask root, etc., prompt and from DDB.
  */   */
 void  void
 usbd_set_polling(struct usbd_device *dev, int on)  usbd_set_polling(struct usbd_device *dev, int on)

Legend:
Removed from v.1.173  
changed lines
  Added in v.1.173.2.3

CVSweb <webmaster@jp.NetBSD.org>