Changeset d80fa05 in mainline for uspace/lib/virtio/virtio.c


Ignore:
Timestamp:
2019-02-05T20:25:14Z (6 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a1f173d
Parents:
d066259
git-author:
Jakub Jermar <jakub@…> (2019-02-05 20:12:07)
git-committer:
Jakub Jermar <jakub@…> (2019-02-05 20:25:14)
Message:

Accept VIRTIO_F_VERSION_1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/virtio/virtio.c

    rd066259 rd80fa05  
    319319        uint32_t device_features = pio_read_le32(&cfg->device_feature);
    320320
    321         ddf_msg(LVL_NOTE, "offered features %x", device_features);
     321        uint32_t reserved_features = VIRTIO_F_VERSION_1;
     322        pio_write_le32(&cfg->device_feature_select, VIRTIO_FEATURES_32_63);
     323        uint32_t device_reserved_features = pio_read_le32(&cfg->device_feature);
     324
     325        ddf_msg(LVL_NOTE, "offered features %x, reserved features %x",
     326            device_features, device_reserved_features);
    322327
    323328        if (features != (features & device_features))
     
    325330        features &= device_features;
    326331
     332        if (reserved_features != (reserved_features & device_reserved_features))
     333                return ENOTSUP;
     334        reserved_features &= device_reserved_features;
     335
    327336        /* 4. Write the accepted feature flags */
    328337        pio_write_le32(&cfg->driver_feature_select, VIRTIO_FEATURES_0_31);
    329338        pio_write_le32(&cfg->driver_feature, features);
    330 
    331         ddf_msg(LVL_NOTE, "accepted features %x", features);
     339        pio_write_le32(&cfg->driver_feature_select, VIRTIO_FEATURES_32_63);
     340        pio_write_le32(&cfg->driver_feature, reserved_features);
     341
     342        ddf_msg(LVL_NOTE, "accepted features %x, reserved features %x",
     343            features, reserved_features);
    332344
    333345        /* 5. Set FEATURES_OK */
Note: See TracChangeset for help on using the changeset viewer.