anchor.diff:                                                 (* i (mezzano.supervisor::align-up +rtl8168-mtu+ 128)))))
       (setf (rtl8168-tx-used-count nic) 0
             (rtl8168-tx-current nic) 0
  -          (rtl8168-tx-tail nic) 0
  -          (rtl8168-tx-pending nic) '())
  +          (rtl8168-tx-tail nic) 0)
       ;; Reset the RX ring.
       (dotimes (i +rtl8168-n-rx-descriptors+)
         (setf (rtl8168-rx-desc-flags nic i) (logior (ash +rtl8168-mtu+ +rtl8168-descriptor-Frame_Length+)
  
positive.code:     (debug-print-line "RTL8168 " name " bounce buffer at " phys)
      (values phys virt)))
  
  (defmethod nic:mac-address ((nic rtl8168-network-card))
    (rtl8168-mac (slot-value nic 'nic)))
  
  (defmethod nic:statistics ((nic rtl8168-network-card))
    (rtl8168-stats (slot-value nic 'nic)))
  
  (defmethod nic:mtu ((nic rtl8168-network-card))
    +rtl8168-mtu+)
  
  (defmethod nic:device-transmit-packet ((nic rtl8168-network-card) packet)
    (rtl8168-transmit (slot-value nic 'nic) packet))
  
  (pci:define-pci-driver rtl8168 rtl8168-pci-register
    ((#x10EC #x8168))
  
negative.code: (defconstant +rtl8168-descriptor-TCPCS+ 16 "TCP checksum offload")
  (defconstant +rtl8168-descriptor-Frame_Length+ 0)
  
  (defclass rtl8168 (nic:network-card)
    ((%pci-location :initarg :pci-location :accessor rtl8168-pci-location)
     (%mac :initarg :mac :accessor rtl8168-mac :reader nic:mac-address)
     (%worker-thread :initarg :worker-thread :accessor rtl8168-worker-thread)
     (%tx-mailbox :accessor rtl8168-tx-mailbox)
     (%irq :initarg :irq :accessor rtl8168-irq)
     (%irq-handler :initarg :irq-handler :accessor rtl8168-irq-handler)
     (%io-base :initarg :io-base :accessor rtl8168-io-base)
  
     (%tx-ring-phys :initarg :tx-ring-phys :accessor rtl8168-tx-ring-phys)
     (%tx-ring-virt :initarg :tx-ring-virt :accessor rtl8168-tx-ring-virt)
     (%tx-bounce-phys :initarg :tx-bounce-phys :accessor rtl8168-tx-bounce-phys)
     (%tx-bounce-virt :initarg :tx-bounce-virt :accessor rtl8168-tx-bounce-virt)
     ;; Number of outstanding packets (passed to card, but not yet transmitted).
     (%tx-used-count :initarg :tx-used-count :accessor rtl8168-tx-used-count)
     (%tx-current :initarg :tx-current :accessor rtl8168-tx-current)
     (%tx-tail :initarg :tx-tail :accessor rtl8168-tx-tail)
  
     (%rx-ring-phys :initarg :rx-ring-phys :accessor rtl8168-rx-ring-phys)
     (%rx-ring-virt :initarg :rx-ring-virt :accessor rtl8168-rx-ring-virt)
     (%rx-bounce-phys :initarg :rx-bounce-phys :accessor rtl8168-rx-bounce-phys)
     (%rx-bounce-virt :initarg :rx-bounce-virt :accessor rtl8168-rx-bounce-virt)
     (%rx-current :initarg :rx-current :accessor rtl8168-rx-current)
     ))
  
  (defun rtl8168-boot-id (nic)
    (pci:pci-device-boot-id (rtl8168-pci-location nic)))
  
  (defun rtl8168-pci-register (location)
    (let ((nic (make-instance 'rtl8168
                              :pci-location location
                              :io-base (pci:pci-io-region location 2 256)
                              :irq (pci:pci-intr-line location))))
      (setf (rtl8168-tx-mailbox nic) (sync:make-mailbox :name `(tx-mailbox ,nic)))
      (setf (rtl8168-worker-thread nic)
            (make-thread (lambda () (rtl8168-worker nic))
                         :name "RTL8168 NIC worker")))
  