3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-21 20:12:37 +01:00

netdev: Move rta_add_u8

Move closer to where it is used
This commit is contained in:
Denis Kenzior 2016-05-05 11:31:51 -05:00
parent 035d78f403
commit 08decb340e

View File

@ -60,17 +60,6 @@ static void do_debug(const char *str, void *user_data)
l_info("%s%s", prefix, str);
}
static size_t rta_add_u8(void *rta_buf, unsigned short type, uint8_t value)
{
struct rtattr *rta = rta_buf;
rta->rta_len = RTA_LENGTH(sizeof(uint8_t));
rta->rta_type = type;
*((uint8_t *) RTA_DATA(rta)) = value;
return RTA_SPACE(sizeof(uint8_t));
}
struct cb_data {
netdev_command_func_t callback;
void *user_data;
@ -89,6 +78,17 @@ static void netlink_result(int error, uint16_t type, const void *data,
l_free(cb_data);
}
static size_t rta_add_u8(void *rta_buf, unsigned short type, uint8_t value)
{
struct rtattr *rta = rta_buf;
rta->rta_len = RTA_LENGTH(sizeof(uint8_t));
rta->rta_type = type;
*((uint8_t *) RTA_DATA(rta)) = value;
return RTA_SPACE(sizeof(uint8_t));
}
void netdev_set_linkmode_and_operstate(uint32_t ifindex,
uint8_t linkmode, uint8_t operstate,
netdev_command_func_t callback, void *user_data)