From 48c41661bc603ffdc6d6117417bc50ed9cc46c0c Mon Sep 17 00:00:00 2001 From: Hauke Petersen Date: Fri, 13 Mar 2015 19:39:32 +0100 Subject: [PATCH] net/ng_netdev: changed semantics of get function --- sys/include/net/ng_netdev.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sys/include/net/ng_netdev.h b/sys/include/net/ng_netdev.h index 24147e87e5..563b485fe6 100644 --- a/sys/include/net/ng_netdev.h +++ b/sys/include/net/ng_netdev.h @@ -115,17 +115,17 @@ typedef struct { * @param[in] dev network device descriptor * @param[in] opt option type * @param[out] value pointer to store the option's value in - * @param[in,out] value_len the length of @p value. Must be initialized to - * the available space in @p value on call. + * @param[in] max_len maximal amount of byte that fit into @p value * - * @return 0 on success + * @return number of bytes written to @p value * @return -ENODEV if @p dev is invalid * @return -ENOTSUP if @p opt is not supported * @return -EOVERFLOW if available space in @p value given in - * @p value_len is too small to store the option value + * @p max_len is too small to store the option value + * @return -ECANCELED if internal driver error occurred */ int (*get)(ng_netdev_t *dev, ng_netconf_opt_t opt, - void *value, size_t *value_len); + void *value, size_t max_len); /** * @brief Set an option value for a given network device @@ -135,10 +135,11 @@ typedef struct { * @param[in] value value to set * @param[in] value_len the length of @p value * - * @return 0 on success + * @return number of bytes used from @p value * @return -ENODEV if @p dev is invalid * @return -ENOTSUP if @p opt is not supported * @return -EINVAL if @p value is invalid + * @return -ECANCELED if internal driver error occurred */ int (*set)(ng_netdev_t *dev, ng_netconf_opt_t opt, void *value, size_t value_len);