[00d7e1b] | 1 | /*
|
---|
| 2 | * Copyright (c) 2011 Radim Vansa
|
---|
| 3 | * All rights reserved.
|
---|
| 4 | *
|
---|
| 5 | * Redistribution and use in source and binary forms, with or without
|
---|
| 6 | * modification, are permitted provided that the following conditions
|
---|
| 7 | * are met:
|
---|
| 8 | *
|
---|
| 9 | * - Redistributions of source code must retain the above copyright
|
---|
| 10 | * notice, this list of conditions and the following disclaimer.
|
---|
| 11 | * - Redistributions in binary form must reproduce the above copyright
|
---|
| 12 | * notice, this list of conditions and the following disclaimer in the
|
---|
| 13 | * documentation and/or other materials provided with the distribution.
|
---|
| 14 | * - The name of the author may not be used to endorse or promote products
|
---|
| 15 | * derived from this software without specific prior written permission.
|
---|
| 16 | *
|
---|
| 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
---|
| 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
---|
| 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
---|
| 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
---|
| 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
---|
| 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
---|
| 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
---|
| 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
---|
| 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
---|
| 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
---|
| 27 | */
|
---|
| 28 |
|
---|
| 29 | /**
|
---|
| 30 | * @addtogroup libnic
|
---|
| 31 | * @{
|
---|
| 32 | */
|
---|
| 33 | /**
|
---|
| 34 | * @file
|
---|
| 35 | * @brief Prototypes of default DDF NIC interface methods implementations
|
---|
| 36 | */
|
---|
| 37 |
|
---|
| 38 | #ifndef NIC_IMPL_H__
|
---|
| 39 | #define NIC_IMPL_H__
|
---|
| 40 |
|
---|
| 41 | #include <assert.h>
|
---|
[cf9cb36] | 42 | #include <nic/nic.h>
|
---|
[00d7e1b] | 43 | #include <ddf/driver.h>
|
---|
| 44 |
|
---|
[7c3fb9b] | 45 | /*
|
---|
| 46 | * Inclusion of this file is not prohibited, because drivers could want to
|
---|
| 47 | * inject some adaptation layer between the DDF call and NICF implementation
|
---|
| 48 | */
|
---|
[00d7e1b] | 49 |
|
---|
[b7fd2a0] | 50 | extern errno_t nic_get_address_impl(ddf_fun_t *dev_fun, nic_address_t *address);
|
---|
| 51 | extern errno_t nic_send_frame_impl(ddf_fun_t *dev_fun, void *data, size_t size);
|
---|
| 52 | extern errno_t nic_callback_create_impl(ddf_fun_t *dev_fun);
|
---|
| 53 | extern errno_t nic_get_state_impl(ddf_fun_t *dev_fun, nic_device_state_t *state);
|
---|
| 54 | extern errno_t nic_set_state_impl(ddf_fun_t *dev_fun, nic_device_state_t state);
|
---|
| 55 | extern errno_t nic_get_stats_impl(ddf_fun_t *dev_fun, nic_device_stats_t *stats);
|
---|
| 56 | extern errno_t nic_unicast_get_mode_impl(ddf_fun_t *dev_fun,
|
---|
[77ad86c] | 57 | nic_unicast_mode_t *, size_t, nic_address_t *, size_t *);
|
---|
[b7fd2a0] | 58 | extern errno_t nic_unicast_set_mode_impl(ddf_fun_t *dev_fun,
|
---|
[77ad86c] | 59 | nic_unicast_mode_t, const nic_address_t *, size_t);
|
---|
[b7fd2a0] | 60 | extern errno_t nic_multicast_get_mode_impl(ddf_fun_t *dev_fun,
|
---|
[77ad86c] | 61 | nic_multicast_mode_t *, size_t, nic_address_t *, size_t *);
|
---|
[b7fd2a0] | 62 | extern errno_t nic_multicast_set_mode_impl(ddf_fun_t *dev_fun,
|
---|
[77ad86c] | 63 | nic_multicast_mode_t, const nic_address_t *, size_t);
|
---|
[b7fd2a0] | 64 | extern errno_t nic_broadcast_get_mode_impl(ddf_fun_t *, nic_broadcast_mode_t *);
|
---|
| 65 | extern errno_t nic_broadcast_set_mode_impl(ddf_fun_t *, nic_broadcast_mode_t);
|
---|
| 66 | extern errno_t nic_blocked_sources_get_impl(ddf_fun_t *,
|
---|
[77ad86c] | 67 | size_t, nic_address_t *, size_t *);
|
---|
[b7fd2a0] | 68 | extern errno_t nic_blocked_sources_set_impl(ddf_fun_t *, const nic_address_t *, size_t);
|
---|
| 69 | extern errno_t nic_vlan_get_mask_impl(ddf_fun_t *, nic_vlan_mask_t *);
|
---|
| 70 | extern errno_t nic_vlan_set_mask_impl(ddf_fun_t *, const nic_vlan_mask_t *);
|
---|
| 71 | extern errno_t nic_wol_virtue_add_impl(ddf_fun_t *dev_fun, nic_wv_type_t type,
|
---|
[77ad86c] | 72 | const void *data, size_t length, nic_wv_id_t *new_id);
|
---|
[b7fd2a0] | 73 | extern errno_t nic_wol_virtue_remove_impl(ddf_fun_t *dev_fun, nic_wv_id_t id);
|
---|
| 74 | extern errno_t nic_wol_virtue_probe_impl(ddf_fun_t *dev_fun, nic_wv_id_t id,
|
---|
[77ad86c] | 75 | nic_wv_type_t *type, size_t max_length, void *data, size_t *length);
|
---|
[b7fd2a0] | 76 | extern errno_t nic_wol_virtue_list_impl(ddf_fun_t *dev_fun, nic_wv_type_t type,
|
---|
[77ad86c] | 77 | size_t max_count, nic_wv_id_t *id_list, size_t *id_count);
|
---|
[b7fd2a0] | 78 | extern errno_t nic_wol_virtue_get_caps_impl(ddf_fun_t *, nic_wv_type_t, int *);
|
---|
| 79 | extern errno_t nic_poll_get_mode_impl(ddf_fun_t *,
|
---|
[bd41ac52] | 80 | nic_poll_mode_t *, struct timespec *);
|
---|
[b7fd2a0] | 81 | extern errno_t nic_poll_set_mode_impl(ddf_fun_t *,
|
---|
[bd41ac52] | 82 | nic_poll_mode_t, const struct timespec *);
|
---|
[b7fd2a0] | 83 | extern errno_t nic_poll_now_impl(ddf_fun_t *);
|
---|
[00d7e1b] | 84 |
|
---|
[984a9ba] | 85 | extern void nic_default_handler_impl(ddf_fun_t *dev_fun, ipc_call_t *call);
|
---|
[b7fd2a0] | 86 | extern errno_t nic_open_impl(ddf_fun_t *fun);
|
---|
[00d7e1b] | 87 | extern void nic_close_impl(ddf_fun_t *fun);
|
---|
| 88 |
|
---|
| 89 | extern void nic_device_added_impl(ddf_dev_t *dev);
|
---|
| 90 |
|
---|
| 91 | #endif
|
---|
| 92 |
|
---|
| 93 | /** @}
|
---|
| 94 | */
|
---|