Changeset 0a087ae in mainline
- Timestamp:
- 2018-05-30T20:42:58Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0d3bfb9e
- Parents:
- 211b17a1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/nic/virtio-net/virtio-net.c
r211b17a1 r0a087ae 295 295 } 296 296 297 static nic_iface_t virtio_net_nic_iface; 297 static errno_t virtio_net_get_device_info(ddf_fun_t *fun, 298 nic_device_info_t *info) 299 { 300 nic_t *nic_data = nic_get_from_ddf_fun(fun); 301 if (!nic_data) 302 return ENOENT; 303 304 str_cpy(info->vendor_name, sizeof(info->vendor_name), "Red Hat, Inc."); 305 str_cpy(info->model_name, sizeof(info->model_name), 306 "Virtio network device"); 307 308 return EOK; 309 } 310 311 static errno_t virtio_net_get_cable_state(ddf_fun_t *fun, 312 nic_cable_state_t *state) 313 { 314 *state = NIC_CS_PLUGGED; 315 return EOK; 316 } 317 318 static errno_t virtio_net_get_operation_mode(ddf_fun_t *fun, int *speed, 319 nic_channel_mode_t *duplex, nic_role_t *role) 320 { 321 *speed = 1000; 322 *duplex = NIC_CM_FULL_DUPLEX; 323 *role = NIC_ROLE_UNKNOWN; 324 return EOK; 325 } 326 327 static nic_iface_t virtio_net_nic_iface = { 328 .get_device_info = virtio_net_get_device_info, 329 .get_cable_state = virtio_net_get_cable_state, 330 .get_operation_mode = virtio_net_get_operation_mode, 331 }; 298 332 299 333 int main(void)
Note:
See TracChangeset
for help on using the changeset viewer.