Changeset 3a26925 in mainline


Ignore:
Timestamp:
2018-05-13T20:14:39Z (6 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
47e00b83
Parents:
f134413
Message:

ne2k: Implement additional nic_iface_t ops

This commit implements the minimal set of nic_iface_t operations to make
the nic command successfully print out an entry for the NE2000 NIC.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/nic/ne2k/ne2k.c

    rf134413 r3a26925  
    287287}
    288288
     289static errno_t ne2k_get_device_info(ddf_fun_t *fun, nic_device_info_t *info)
     290{
     291        nic_t *nic_data = nic_get_from_ddf_fun(fun);
     292        if (!nic_data)
     293                return ENOENT;
     294
     295        str_cpy(info->vendor_name, sizeof(info->vendor_name), "Novell");
     296        str_cpy(info->model_name, sizeof(info->model_name), "NE2000");
     297
     298        return EOK;
     299}
     300
     301static errno_t ne2k_get_cable_state(ddf_fun_t *fun, nic_cable_state_t *state)
     302{
     303        *state = NIC_CS_PLUGGED;
     304        return EOK;
     305}
     306
     307static errno_t ne2k_get_operation_mode(ddf_fun_t *fun, int *speed,
     308    nic_channel_mode_t *duplex, nic_role_t *role)
     309{
     310        *speed = 10;
     311        *duplex = NIC_CM_HALF_DUPLEX;   // XXX
     312        *role = NIC_ROLE_UNKNOWN;
     313        return EOK;
     314}
     315
    289316static errno_t ne2k_on_unicast_mode_change(nic_t *nic_data,
    290317    nic_unicast_mode_t new_mode,
     
    427454
    428455static nic_iface_t ne2k_nic_iface = {
    429         .set_address = ne2k_set_address
     456        .set_address = ne2k_set_address,
     457        .get_device_info = ne2k_get_device_info,
     458        .get_cable_state = ne2k_get_cable_state,
     459        .get_operation_mode = ne2k_get_operation_mode,
    430460};
    431461
Note: See TracChangeset for help on using the changeset viewer.