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

Changeset 6413967 in mainline


Ignore:
Timestamp:
2018-05-22T19:06:49Z (3 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master
Children:
e07257e
Parents:
033ebc25
git-author:
Jakub Jermar <jakub@…> (2018-04-08 08:42:35)
git-committer:
Jakub Jermar <jakub@…> (2018-05-22 19:06:49)
Message:

Add more scaffolding

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • boot/Makefile.common

    r033ebc25 r6413967  
    140140        nic/rtl8169 \
    141141        nic/ar9271 \
     142        nic/virtio-net \
    142143        block/ahci
    143144
  • uspace/drv/nic/virtio-net/virtio-net.c

    r033ebc25 r6413967  
    2727 */
    2828
     29#include <stdio.h>
     30
     31#include <ddf/driver.h>
     32#include <ddf/log.h>
     33#include <ops/nic.h>
     34
     35#include <nic.h>
     36
     37#define NAME    "virtio-net"
     38
     39static errno_t virtio_net_dev_add(ddf_dev_t *dev)
     40{
     41        ddf_msg(LVL_NOTE, "%s %s (handle = %zu)", __func__,
     42            ddf_dev_get_name(dev), ddf_dev_get_handle(dev));
     43
     44        return ENOTSUP;
     45}
     46
     47static ddf_dev_ops_t virtio_net_dev_ops;
     48
     49static driver_ops_t virtio_net_driver_ops = {
     50        .dev_add = virtio_net_dev_add
     51};
     52
     53static driver_t virtio_net_driver = {
     54        .name = NAME,
     55        .driver_ops = &virtio_net_driver_ops
     56};
     57
     58static nic_iface_t virtio_net_nic_iface;
     59
    2960int main(void)
    3061{
    31         return 0;
     62        printf("%s: HelenOS virtio-net driver\n", NAME);
     63
     64        if (nic_driver_init(NAME) != EOK)
     65                return 1;
     66
     67        nic_driver_implement(&virtio_net_driver_ops, &virtio_net_dev_ops,
     68            &virtio_net_nic_iface);
     69
     70        (void) ddf_log_init(NAME);
     71        return ddf_driver_main(&virtio_net_driver);
    3272}
Note: See TracChangeset for help on using the changeset viewer.