Changeset b7fd2a0 in mainline for uspace/lib/nic/include/nic_impl.h


Ignore:
Timestamp:
2018-01-13T03:10:29Z (7 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a53ed3a
Parents:
36f0738
Message:

Use errno_t in all uspace and kernel code.

Change type of every variable, parameter and return value that holds an
<errno.h> constant to either errno_t (the usual case), or sys_errno_t
(some places in kernel). This is for the purpose of self-documentation,
as well as for type-checking with a bit of type definition hackery.

Although this is a massive commit, it is a simple text replacement, and thus
is very easy to verify. Simply do the following:

`
git checkout <this commit's hash>
git reset HEAD
git add .
tools/srepl '\berrno_t\b' int
git add .
tools/srepl '\bsys_errno_t\b' sysarg_t
git reset
git diff
`

While this doesn't ensure that the replacements are correct, it does ensure
that the commit doesn't do anything except those replacements. Since errno_t
is typedef'd to int in the usual case (and sys_errno_t to sysarg_t), even if
incorrect, this commit cannot change behavior.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/nic/include/nic_impl.h

    r36f0738 rb7fd2a0  
    4646 * inject some adaptation layer between the DDF call and NICF implementation */
    4747
    48 extern int nic_get_address_impl(ddf_fun_t *dev_fun, nic_address_t *address);
    49 extern int nic_send_frame_impl(ddf_fun_t *dev_fun, void *data, size_t size);
    50 extern int nic_callback_create_impl(ddf_fun_t *dev_fun);
    51 extern int nic_get_state_impl(ddf_fun_t *dev_fun, nic_device_state_t *state);
    52 extern int nic_set_state_impl(ddf_fun_t *dev_fun, nic_device_state_t state);
    53 extern int nic_get_stats_impl(ddf_fun_t *dev_fun, nic_device_stats_t *stats);
    54 extern int nic_unicast_get_mode_impl(ddf_fun_t *dev_fun,
     48extern errno_t nic_get_address_impl(ddf_fun_t *dev_fun, nic_address_t *address);
     49extern errno_t nic_send_frame_impl(ddf_fun_t *dev_fun, void *data, size_t size);
     50extern errno_t nic_callback_create_impl(ddf_fun_t *dev_fun);
     51extern errno_t nic_get_state_impl(ddf_fun_t *dev_fun, nic_device_state_t *state);
     52extern errno_t nic_set_state_impl(ddf_fun_t *dev_fun, nic_device_state_t state);
     53extern errno_t nic_get_stats_impl(ddf_fun_t *dev_fun, nic_device_stats_t *stats);
     54extern errno_t nic_unicast_get_mode_impl(ddf_fun_t *dev_fun,
    5555    nic_unicast_mode_t *, size_t, nic_address_t *, size_t *);
    56 extern int nic_unicast_set_mode_impl(ddf_fun_t *dev_fun,
     56extern errno_t nic_unicast_set_mode_impl(ddf_fun_t *dev_fun,
    5757    nic_unicast_mode_t, const nic_address_t *, size_t);
    58 extern int nic_multicast_get_mode_impl(ddf_fun_t *dev_fun,
     58extern errno_t nic_multicast_get_mode_impl(ddf_fun_t *dev_fun,
    5959    nic_multicast_mode_t *, size_t, nic_address_t *, size_t *);
    60 extern int nic_multicast_set_mode_impl(ddf_fun_t *dev_fun,
     60extern errno_t nic_multicast_set_mode_impl(ddf_fun_t *dev_fun,
    6161    nic_multicast_mode_t, const nic_address_t *, size_t);
    62 extern int nic_broadcast_get_mode_impl(ddf_fun_t *, nic_broadcast_mode_t *);
    63 extern int nic_broadcast_set_mode_impl(ddf_fun_t *, nic_broadcast_mode_t);
    64 extern int nic_blocked_sources_get_impl(ddf_fun_t *,
     62extern errno_t nic_broadcast_get_mode_impl(ddf_fun_t *, nic_broadcast_mode_t *);
     63extern errno_t nic_broadcast_set_mode_impl(ddf_fun_t *, nic_broadcast_mode_t);
     64extern errno_t nic_blocked_sources_get_impl(ddf_fun_t *,
    6565    size_t, nic_address_t *, size_t *);
    66 extern int nic_blocked_sources_set_impl(ddf_fun_t *, const nic_address_t *, size_t);
    67 extern int nic_vlan_get_mask_impl(ddf_fun_t *, nic_vlan_mask_t *);
    68 extern int nic_vlan_set_mask_impl(ddf_fun_t *, const nic_vlan_mask_t *);
    69 extern int nic_wol_virtue_add_impl(ddf_fun_t *dev_fun, nic_wv_type_t type,
     66extern errno_t nic_blocked_sources_set_impl(ddf_fun_t *, const nic_address_t *, size_t);
     67extern errno_t nic_vlan_get_mask_impl(ddf_fun_t *, nic_vlan_mask_t *);
     68extern errno_t nic_vlan_set_mask_impl(ddf_fun_t *, const nic_vlan_mask_t *);
     69extern errno_t nic_wol_virtue_add_impl(ddf_fun_t *dev_fun, nic_wv_type_t type,
    7070    const void *data, size_t length, nic_wv_id_t *new_id);
    71 extern int nic_wol_virtue_remove_impl(ddf_fun_t *dev_fun, nic_wv_id_t id);
    72 extern int nic_wol_virtue_probe_impl(ddf_fun_t *dev_fun, nic_wv_id_t id,
     71extern errno_t nic_wol_virtue_remove_impl(ddf_fun_t *dev_fun, nic_wv_id_t id);
     72extern errno_t nic_wol_virtue_probe_impl(ddf_fun_t *dev_fun, nic_wv_id_t id,
    7373    nic_wv_type_t *type, size_t max_length, void *data, size_t *length);
    74 extern int nic_wol_virtue_list_impl(ddf_fun_t *dev_fun, nic_wv_type_t type,
     74extern errno_t nic_wol_virtue_list_impl(ddf_fun_t *dev_fun, nic_wv_type_t type,
    7575    size_t max_count, nic_wv_id_t *id_list, size_t *id_count);
    76 extern int nic_wol_virtue_get_caps_impl(ddf_fun_t *, nic_wv_type_t, int *);
    77 extern int nic_poll_get_mode_impl(ddf_fun_t *,
     76extern errno_t nic_wol_virtue_get_caps_impl(ddf_fun_t *, nic_wv_type_t, int *);
     77extern errno_t nic_poll_get_mode_impl(ddf_fun_t *,
    7878    nic_poll_mode_t *, struct timeval *);
    79 extern int nic_poll_set_mode_impl(ddf_fun_t *,
     79extern errno_t nic_poll_set_mode_impl(ddf_fun_t *,
    8080    nic_poll_mode_t, const struct timeval *);
    81 extern int nic_poll_now_impl(ddf_fun_t *);
     81extern errno_t nic_poll_now_impl(ddf_fun_t *);
    8282
    8383extern void nic_default_handler_impl(ddf_fun_t *dev_fun,
    8484        ipc_callid_t callid, ipc_call_t *call);
    85 extern int nic_open_impl(ddf_fun_t *fun);
     85extern errno_t nic_open_impl(ddf_fun_t *fun);
    8686extern void nic_close_impl(ddf_fun_t *fun);
    8787
Note: See TracChangeset for help on using the changeset viewer.