summaryrefslogtreecommitdiffstats
path: root/src/include/gpxe/virtio-pci.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/gpxe/virtio-pci.h')
-rw-r--r--src/include/gpxe/virtio-pci.h36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/include/gpxe/virtio-pci.h b/src/include/gpxe/virtio-pci.h
index ba0604d5..3fe1a801 100644
--- a/src/include/gpxe/virtio-pci.h
+++ b/src/include/gpxe/virtio-pci.h
@@ -37,58 +37,58 @@
/* Virtio ABI version, this must match exactly */
#define VIRTIO_PCI_ABI_VERSION 0
-static inline u32 vp_get_features(struct nic *nic)
+static inline u32 vp_get_features(unsigned int ioaddr)
{
- return inl(nic->ioaddr + VIRTIO_PCI_HOST_FEATURES);
+ return inl(ioaddr + VIRTIO_PCI_HOST_FEATURES);
}
-static inline void vp_set_features(struct nic *nic, u32 features)
+static inline void vp_set_features(unsigned int ioaddr, u32 features)
{
- outl(features, nic->ioaddr + VIRTIO_PCI_GUEST_FEATURES);
+ outl(features, ioaddr + VIRTIO_PCI_GUEST_FEATURES);
}
-static inline void vp_get(struct nic *nic, unsigned offset,
+static inline void vp_get(unsigned int ioaddr, unsigned offset,
void *buf, unsigned len)
{
u8 *ptr = buf;
unsigned i;
for (i = 0; i < len; i++)
- ptr[i] = inb(nic->ioaddr + VIRTIO_PCI_CONFIG + offset + i);
+ ptr[i] = inb(ioaddr + VIRTIO_PCI_CONFIG + offset + i);
}
-static inline u8 vp_get_status(struct nic *nic)
+static inline u8 vp_get_status(unsigned int ioaddr)
{
- return inb(nic->ioaddr + VIRTIO_PCI_STATUS);
+ return inb(ioaddr + VIRTIO_PCI_STATUS);
}
-static inline void vp_set_status(struct nic *nic, u8 status)
+static inline void vp_set_status(unsigned int ioaddr, u8 status)
{
if (status == 0) /* reset */
return;
- outb(status, nic->ioaddr + VIRTIO_PCI_STATUS);
+ outb(status, ioaddr + VIRTIO_PCI_STATUS);
}
-static inline void vp_reset(struct nic *nic)
+static inline void vp_reset(unsigned int ioaddr)
{
- outb(0, nic->ioaddr + VIRTIO_PCI_STATUS);
- (void)inb(nic->ioaddr + VIRTIO_PCI_ISR);
+ outb(0, ioaddr + VIRTIO_PCI_STATUS);
+ (void)inb(ioaddr + VIRTIO_PCI_ISR);
}
-static inline void vp_notify(struct nic *nic, int queue_index)
+static inline void vp_notify(unsigned int ioaddr, int queue_index)
{
- outw(queue_index, nic->ioaddr + VIRTIO_PCI_QUEUE_NOTIFY);
+ outw(queue_index, ioaddr + VIRTIO_PCI_QUEUE_NOTIFY);
}
-static inline void vp_del_vq(struct nic *nic, int queue_index)
+static inline void vp_del_vq(unsigned int ioaddr, int queue_index)
{
/* select the queue */
- outw(queue_index, nic->ioaddr + VIRTIO_PCI_QUEUE_SEL);
+ outw(queue_index, ioaddr + VIRTIO_PCI_QUEUE_SEL);
/* deactivate the queue */
- outl(0, nic->ioaddr + VIRTIO_PCI_QUEUE_PFN);
+ outl(0, ioaddr + VIRTIO_PCI_QUEUE_PFN);
}
#endif /* _VIRTIO_PCI_H_ */