anchor.diff:      (if (= buf-pointer 0) buf-size (- buf-pointer buf-start))))
   
   ;;======================================================================
  +;;
  +;; td-info holds information used when a td is "retired" by the
  +;; controller.
  +;;
  +;; event-type:
  +;;    if keyword, generate a usb-event with this value as the type
  +;;    if semaphore, signal the semaphore
  +;;    otherwise, it must be a function that is called with:
  +;;        driver object
  +;;        endpoint-num
  +;;        transaction status
  +;;        actual length transfer
  +;;        data buffer
  +;;
  +;;======================================================================
  +
  +(defstruct td-info
  +  event-type
  +  endpoint
  +  buf-size
  +  buf)
  +
  +;;======================================================================
   ;; HCCA (Host Controller Communication Area) - defined in section 4.4
   ;;======================================================================
   
  
positive.code:    (2ms-interrupts    :initarg :2ms-interrupts    :accessor 2ms-interrupts)
     (1ms-interrupts    :initarg :1ms-interrupts    :accessor 1ms-interrupts)
  
     (td->endpoint      :initarg :td->endpoint      :accessor td->endpoint)
     ))
  
  (defmethod delete-controller ((ohci ohci))
  
negative.code:               (delete-isochronous-endpt ohci device endpt-num)))))))
  
  ;;======================================================================
  ;;
  ;;======================================================================
  
  (defun transfer-complete (driver event-type endpt-num device status length buf)
    ;; Signal driver a transfer is complete - based oon the event type
    (cond ((typep event-type 'keyword)
           ;; enqueue an event with this type
           (let ((event (make-usb-event
                         :type event-type
                         :dest driver
                         :device device)))
             (setf (usb-event-plist-value event :endpoint-num) endpt-num
                   (usb-event-plist-value event :status) status
                   (usb-event-plist-value event :length) length
                   (usb-event-plist-value event :buf) buf)
             (enqueue-event event)))
          ((typep event-type 'sync:semaphore)
           ;; this means some thread is waiting on this interrupt
           ;; which may not be a good idea
           (sync:semaphore-up event-type))
          (T
           (funcall event-type driver endpt-num status length buf))))
  
  ;;======================================================================
  ;; Interrupt Endpoint code
  ;;======================================================================
  
  (defun add-td (ohci ed header buf-size)
    (let* ((msg-td (phys-addr->array (ed-tdq-tail ed)))
           (msg-td-info (gethash msg-td (td->td-info ohci)))
           (dummy-td (alloc-td ohci))
           (buf (alloc-buffer/8 (buf-pool ohci) buf-size))
           (buf-phys-addr (array->phys-addr buf)))
  