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

device: Move device_get_path out of wiphy.c

This commit is contained in:
Denis Kenzior 2016-06-14 11:31:48 -05:00
parent e0c27a2ca8
commit 6e57e4a00c
2 changed files with 10 additions and 8 deletions

View File

@ -24,6 +24,8 @@
#include <config.h> #include <config.h>
#endif #endif
#include <stdio.h>
#include <ell/ell.h> #include <ell/ell.h>
#include "src/common.h" #include "src/common.h"
@ -121,6 +123,14 @@ struct network *device_get_connected_network(struct device *device)
return device->connected_network; return device->connected_network;
} }
const char *device_get_path(struct device *device)
{
static char path[12];
snprintf(path, sizeof(path), "/%u", device->index);
return path;
}
void device_disassociated(struct device *device) void device_disassociated(struct device *device)
{ {
struct network *network = device->connected_network; struct network *network = device->connected_network;

View File

@ -221,14 +221,6 @@ static void network_free(void *data)
network_remove(network, -ESHUTDOWN); network_remove(network, -ESHUTDOWN);
} }
const char *device_get_path(struct device *device)
{
static char path[12];
snprintf(path, sizeof(path), "/%u", device->index);
return path;
}
const uint8_t *device_get_address(struct device *device) const uint8_t *device_get_address(struct device *device)
{ {
return netdev_get_address(device->netdev); return netdev_get_address(device->netdev);