mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-22 13:02:44 +01:00
netdev: Add netdev_get_path
This commit is contained in:
parent
a277a424f3
commit
0ad8f7e0d6
10
src/netdev.c
10
src/netdev.c
@ -25,6 +25,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
#include <linux/rtnetlink.h>
|
#include <linux/rtnetlink.h>
|
||||||
#include <net/if_arp.h>
|
#include <net/if_arp.h>
|
||||||
#include <linux/if.h>
|
#include <linux/if.h>
|
||||||
@ -296,6 +297,15 @@ struct device *netdev_get_device(struct netdev *netdev)
|
|||||||
return netdev->device;
|
return netdev->device;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char *netdev_get_path(struct netdev *netdev)
|
||||||
|
{
|
||||||
|
static char path[26];
|
||||||
|
|
||||||
|
snprintf(path, sizeof(path), "%s/%u", wiphy_get_path(netdev->wiphy),
|
||||||
|
netdev->index);
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
|
||||||
static void netdev_set_powered_result(int error, uint16_t type,
|
static void netdev_set_powered_result(int error, uint16_t type,
|
||||||
const void *data,
|
const void *data,
|
||||||
uint32_t len, void *user_data)
|
uint32_t len, void *user_data)
|
||||||
|
@ -109,6 +109,7 @@ bool netdev_get_4addr(struct netdev *netdev);
|
|||||||
const char *netdev_get_name(struct netdev *netdev);
|
const char *netdev_get_name(struct netdev *netdev);
|
||||||
bool netdev_get_is_up(struct netdev *netdev);
|
bool netdev_get_is_up(struct netdev *netdev);
|
||||||
struct device *netdev_get_device(struct netdev *netdev);
|
struct device *netdev_get_device(struct netdev *netdev);
|
||||||
|
const char *netdev_get_path(struct netdev *netdev);
|
||||||
|
|
||||||
struct handshake_state *netdev_handshake_state_new(struct netdev *netdev);
|
struct handshake_state *netdev_handshake_state_new(struct netdev *netdev);
|
||||||
struct handshake_state *netdev_get_handshake(struct netdev *netdev);
|
struct handshake_state *netdev_get_handshake(struct netdev *netdev);
|
||||||
|
Loading…
Reference in New Issue
Block a user