Commit 08313f1a authored by Anjan Chanda's avatar Anjan Chanda

create 'ap' or 'backhaul' object based on wifi mode

parent e606469e
......@@ -99,7 +99,7 @@ static int wifimngr_cmd_main(struct ubus_context *ctx)
for (i = 0; i < num_ifs; i++) {
//ret = wifimngr_add_object(wmngr, ctx, ifs[i].iface, interface);
ret = wifimngr_add_interface_object(wmngr, ctx, ifs[i].iface);
ret = wifimngr_add_interface_object(wmngr, ctx, &ifs[i]);
if (ret) {
fprintf(stderr,
"Failed to add 'wifi.ap' ubus object: %s\n",
......
This diff is collapsed.
......@@ -37,6 +37,28 @@ struct wifimngr {
struct list_head iflist; /* list of wifi_ubus_objects */
};
#define WIFI_DEV_MAX_NUM 16
#define WIFI_IF_MAX_NUM 16
struct wifimngr_device {
char device[16];
};
enum iface_mode {
WIFI_AP,
WIFI_STA,
};
struct wifimngr_iface {
char iface[16];
char device[16];
int mode;
};
int wifimngr_get_wifi_devices(char devs[][WIFI_DEV_MAX_NUM]);
int wifimngr_get_wifi_interfaces(struct wifimngr_iface ifs[]);
//#define wifimngr_add_object(w, u, n, type) ubus_add_## type ##_object(w, u, n)
#define UBUS_METHOD_ADD(_tab, iter, __m) \
......@@ -60,27 +82,13 @@ extern int wifimngr_add_radio_object(struct wifimngr *w,
extern int wifimngr_add_interface_object(struct wifimngr *w,
struct ubus_context *ctx,
const char *objname);
struct wifimngr_iface *iface);
extern int wifimngr_init(struct wifimngr **w);
extern int wifimngr_exit(struct wifimngr *w);
extern void wifimngr_version(void);
#define WIFI_DEV_MAX_NUM 16
#define WIFI_IF_MAX_NUM 16
struct wifimngr_device {
char device[16];
};
struct wifimngr_iface {
char iface[16];
char device[16];
};
int wifimngr_get_wifi_devices(char devs[][WIFI_DEV_MAX_NUM]);
int wifimngr_get_wifi_interfaces(struct wifimngr_iface ifs[]);
#if 0
extern int ubus_add_wifi_object(struct wifimngr *w,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment