source: mainline/uspace/lib/drv/include/ops/nic.h@ d7f7a4a

Last change on this file since d7f7a4a was d7f7a4a, checked in by Jiří Zárevúcky <zarevucky.jiri@…>, 4 years ago

Replace some license headers with SPDX identifier

Headers are replaced using tools/transorm-copyright.sh only
when it can be matched verbatim with the license header used
throughout most of the codebase.

  • Property mode set to 100644
File size: 3.3 KB
Line 
1/*
2 * SPDX-FileCopyrightText: 2011 Radim Vansa
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7/** @addtogroup libdrv
8 * @{
9 */
10/** @file
11 * @brief DDF NIC interface definition
12 */
13
14#ifndef LIBDRV_OPS_NIC_H_
15#define LIBDRV_OPS_NIC_H_
16
17#include <ipc/services.h>
18#include <nic/nic.h>
19#include <time.h>
20#include "../ddf/driver.h"
21
22typedef struct nic_iface {
23 /** Mandatory methods */
24 errno_t (*send_frame)(ddf_fun_t *, void *, size_t);
25 errno_t (*callback_create)(ddf_fun_t *);
26 errno_t (*get_state)(ddf_fun_t *, nic_device_state_t *);
27 errno_t (*set_state)(ddf_fun_t *, nic_device_state_t);
28 errno_t (*get_address)(ddf_fun_t *, nic_address_t *);
29
30 /** Optional methods */
31 errno_t (*set_address)(ddf_fun_t *, const nic_address_t *);
32 errno_t (*get_stats)(ddf_fun_t *, nic_device_stats_t *);
33 errno_t (*get_device_info)(ddf_fun_t *, nic_device_info_t *);
34 errno_t (*get_cable_state)(ddf_fun_t *, nic_cable_state_t *);
35
36 errno_t (*get_operation_mode)(ddf_fun_t *, int *, nic_channel_mode_t *,
37 nic_role_t *);
38 errno_t (*set_operation_mode)(ddf_fun_t *, int, nic_channel_mode_t,
39 nic_role_t);
40 errno_t (*autoneg_enable)(ddf_fun_t *, uint32_t);
41 errno_t (*autoneg_disable)(ddf_fun_t *);
42 errno_t (*autoneg_probe)(ddf_fun_t *, uint32_t *, uint32_t *,
43 nic_result_t *, nic_result_t *);
44 errno_t (*autoneg_restart)(ddf_fun_t *);
45 errno_t (*get_pause)(ddf_fun_t *, nic_result_t *, nic_result_t *,
46 uint16_t *);
47 errno_t (*set_pause)(ddf_fun_t *, int, int, uint16_t);
48
49 errno_t (*unicast_get_mode)(ddf_fun_t *, nic_unicast_mode_t *, size_t,
50 nic_address_t *, size_t *);
51 errno_t (*unicast_set_mode)(ddf_fun_t *, nic_unicast_mode_t,
52 const nic_address_t *, size_t);
53 errno_t (*multicast_get_mode)(ddf_fun_t *, nic_multicast_mode_t *, size_t,
54 nic_address_t *, size_t *);
55 errno_t (*multicast_set_mode)(ddf_fun_t *, nic_multicast_mode_t,
56 const nic_address_t *, size_t);
57 errno_t (*broadcast_get_mode)(ddf_fun_t *, nic_broadcast_mode_t *);
58 errno_t (*broadcast_set_mode)(ddf_fun_t *, nic_broadcast_mode_t);
59 errno_t (*defective_get_mode)(ddf_fun_t *, uint32_t *);
60 errno_t (*defective_set_mode)(ddf_fun_t *, uint32_t);
61 errno_t (*blocked_sources_get)(ddf_fun_t *, size_t, nic_address_t *,
62 size_t *);
63 errno_t (*blocked_sources_set)(ddf_fun_t *, const nic_address_t *, size_t);
64
65 errno_t (*vlan_get_mask)(ddf_fun_t *, nic_vlan_mask_t *);
66 errno_t (*vlan_set_mask)(ddf_fun_t *, const nic_vlan_mask_t *);
67 errno_t (*vlan_set_tag)(ddf_fun_t *, uint16_t, bool, bool);
68
69 errno_t (*wol_virtue_add)(ddf_fun_t *, nic_wv_type_t, const void *,
70 size_t, nic_wv_id_t *);
71 errno_t (*wol_virtue_remove)(ddf_fun_t *, nic_wv_id_t);
72 errno_t (*wol_virtue_probe)(ddf_fun_t *, nic_wv_id_t, nic_wv_type_t *,
73 size_t, void *, size_t *);
74 errno_t (*wol_virtue_list)(ddf_fun_t *, nic_wv_type_t, size_t,
75 nic_wv_id_t *, size_t *);
76 errno_t (*wol_virtue_get_caps)(ddf_fun_t *, nic_wv_type_t, int *);
77 errno_t (*wol_load_info)(ddf_fun_t *, nic_wv_type_t *, size_t,
78 uint8_t *, size_t *);
79
80 errno_t (*offload_probe)(ddf_fun_t *, uint32_t *, uint32_t *);
81 errno_t (*offload_set)(ddf_fun_t *, uint32_t, uint32_t);
82
83 errno_t (*poll_get_mode)(ddf_fun_t *, nic_poll_mode_t *,
84 struct timespec *);
85 errno_t (*poll_set_mode)(ddf_fun_t *, nic_poll_mode_t,
86 const struct timespec *);
87 errno_t (*poll_now)(ddf_fun_t *);
88} nic_iface_t;
89
90#endif
91
92/**
93 * @}
94 */
Note: See TracBrowser for help on using the repository browser.