Print this page
3644 Add virtio-net support into the Illumos
Reviewed by: Alexey Zaytsev, alexey.zaytsev@gmail.com
Reviewed by: Yuri Pankov, yuri.pankov@nexenta.com
Reviewed by: David Hoppner, 0xffea@gmail.com


 167                 unsigned int index);
 168 uint64_t virtio_read_device_config_8(struct virtio_softc *sc,
 169                 unsigned int index);
 170 void virtio_write_device_config_1(struct virtio_softc *sc,
 171                 unsigned int index, uint8_t value);
 172 void virtio_write_device_config_2(struct virtio_softc *sc,
 173                 unsigned int index, uint16_t value);
 174 void virtio_write_device_config_4(struct virtio_softc *sc,
 175                 unsigned int index, uint32_t value);
 176 void virtio_write_device_config_8(struct virtio_softc *sc,
 177                 unsigned int index, uint64_t value);
 178 
 179 struct virtqueue *virtio_alloc_vq(struct virtio_softc *sc,
 180                 unsigned int index, unsigned int size,
 181                 unsigned int indirect_num, const char *name);
 182 void virtio_free_vq(struct virtqueue *);
 183 void virtio_reset(struct virtio_softc *);
 184 struct vq_entry *vq_alloc_entry(struct virtqueue *vq);
 185 void vq_free_entry(struct virtqueue *vq, struct vq_entry *qe);
 186 uint_t vq_num_used(struct virtqueue *vq);

 187 
 188 void virtio_stop_vq_intr(struct virtqueue *);
 189 void virtio_start_vq_intr(struct virtqueue *);
 190 
 191 void virtio_ve_add_cookie(struct vq_entry *qe, ddi_dma_handle_t dma_handle,
 192     ddi_dma_cookie_t dma_cookie, unsigned int ncookies, boolean_t write);
 193 void virtio_ve_add_indirect_buf(struct vq_entry *qe, uint64_t paddr,
 194     uint32_t len, boolean_t write);
 195 void virtio_ve_set(struct vq_entry *qe, uint64_t paddr, uint32_t len,
 196                 boolean_t write);
 197 
 198 void virtio_push_chain(struct vq_entry *qe, boolean_t sync);
 199 struct vq_entry *virtio_pull_chain(struct virtqueue *vq, uint32_t *len);
 200 void virtio_free_chain(struct vq_entry *ve);
 201 void virtio_sync_vq(struct virtqueue *vq);
 202 
 203 int virtio_register_ints(struct virtio_softc *sc,
 204                 struct virtio_int_handler *config_handler,
 205                 struct virtio_int_handler vq_handlers[]);
 206 void virtio_release_ints(struct virtio_softc *sc);


 167                 unsigned int index);
 168 uint64_t virtio_read_device_config_8(struct virtio_softc *sc,
 169                 unsigned int index);
 170 void virtio_write_device_config_1(struct virtio_softc *sc,
 171                 unsigned int index, uint8_t value);
 172 void virtio_write_device_config_2(struct virtio_softc *sc,
 173                 unsigned int index, uint16_t value);
 174 void virtio_write_device_config_4(struct virtio_softc *sc,
 175                 unsigned int index, uint32_t value);
 176 void virtio_write_device_config_8(struct virtio_softc *sc,
 177                 unsigned int index, uint64_t value);
 178 
 179 struct virtqueue *virtio_alloc_vq(struct virtio_softc *sc,
 180                 unsigned int index, unsigned int size,
 181                 unsigned int indirect_num, const char *name);
 182 void virtio_free_vq(struct virtqueue *);
 183 void virtio_reset(struct virtio_softc *);
 184 struct vq_entry *vq_alloc_entry(struct virtqueue *vq);
 185 void vq_free_entry(struct virtqueue *vq, struct vq_entry *qe);
 186 uint_t vq_num_used(struct virtqueue *vq);
 187 unsigned int virtio_ve_indirect_available(struct vq_entry *qe);
 188 
 189 void virtio_stop_vq_intr(struct virtqueue *);
 190 void virtio_start_vq_intr(struct virtqueue *);
 191 
 192 void virtio_ve_add_cookie(struct vq_entry *qe, ddi_dma_handle_t dma_handle,
 193     ddi_dma_cookie_t dma_cookie, unsigned int ncookies, boolean_t write);
 194 void virtio_ve_add_indirect_buf(struct vq_entry *qe, uint64_t paddr,
 195     uint32_t len, boolean_t write);
 196 void virtio_ve_set(struct vq_entry *qe, uint64_t paddr, uint32_t len,
 197                 boolean_t write);
 198 
 199 void virtio_push_chain(struct vq_entry *qe, boolean_t sync);
 200 struct vq_entry *virtio_pull_chain(struct virtqueue *vq, uint32_t *len);
 201 void virtio_free_chain(struct vq_entry *ve);
 202 void virtio_sync_vq(struct virtqueue *vq);
 203 
 204 int virtio_register_ints(struct virtio_softc *sc,
 205                 struct virtio_int_handler *config_handler,
 206                 struct virtio_int_handler vq_handlers[]);
 207 void virtio_release_ints(struct virtio_softc *sc);