Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset eda41a9 in mainline


Ignore:
Timestamp:
2018-05-22T19:06:50Z (3 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master
Children:
0180c67
Parents:
2d4faf7
git-author:
Jakub Jermar <jakub@…> (2018-05-06 06:39:52)
git-committer:
Jakub Jermar <jakub@…> (2018-05-22 19:06:50)
Message:

Calculate the notification address for each virtq

Location:
uspace/lib/virtio
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/virtio/virtio-pci.h

    r2d4faf7 reda41a9  
    149149         */
    150150        void **buffers;
     151
     152        /** Address of the queue's notification register */
     153        ioport16_t *notify;
    151154} virtq_t;
    152155
     
    163166
    164167        /** Notification base address */
    165         ioport16_t *notify_base;
     168        void *notify_base;
    166169        /** Notification offset multiplier */
    167170        uint32_t notify_off_multiplier;
  • uspace/lib/virtio/virtio.c

    r2d4faf7 reda41a9  
    119119            num, q->virt, (void *) q->phys, q->size);
    120120
     121        /* Determine virtq's notification address */
     122        q->notify = vdev->notify_base +
     123            pio_read_16(&cfg->queue_notif_off) * vdev->notify_off_multiplier;
     124
     125        ddf_msg(LVL_NOTE, "notification register: %p", q->notify);
     126
    121127        return rc;
    122128}
     
    171177        pio_write_8(&cfg->device_status, status);
    172178
    173         /* 6. Test if the device supports our feature subset */ 
     179        /* 6. Test if the device supports our feature subset */
    174180        status = pio_read_8(&cfg->device_status);
    175181        if (!(status & VIRTIO_DEV_STATUS_FEATURES_OK))
Note: See TracChangeset for help on using the changeset viewer.