Commit 82d7a948 authored by Vivek Kumar Dutta's avatar Vivek Kumar Dutta

wfadatad: Fix standalone compilation

parent 578cad4e
......@@ -6,21 +6,11 @@ OBJS = delm.o delm_utils.o delm_ubus.o delm_dumper.o delm_getter.o
LIBS += -luci -lubus -lubox -ljson-c -lblobmsg_json \
-lnl-genl-3 -lnl-3 \
-lwifi-5 -leasy -leasyutils
-lwifi-5 -leasy
ifeq ($(CONFIG_WFA_DELM_STANDALONE),y)
CFLAGS += -DWFA_DELM_STANDALONE
OBJS += main.o
EXEC = wfa_delm
all: $(EXEC)
else
all: $(PLUGIN)
endif
all: $(EXEC) $(PLUGIN)
%.o: %.c
$(CC) $(CFLAGS) -fPIC -c $< -o $@
......@@ -29,7 +19,7 @@ $(PLUGIN): $(OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) -shared \
-Wl,-soname,$@ -o $@ $^ $(LIBS)
$(EXEC): $(OBJS)
$(EXEC): $(OBJS) main.o
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
clean:
......
......@@ -17,6 +17,8 @@
#include <libubus.h>
#include <libubox/utils.h>
#include "delm_impl.h"
#include <map-agent/plugin.h>
#include <map-agent/mapagent.h>
#include <map-agent/timer.h>
......@@ -26,7 +28,6 @@
#define DELM_OBJNAME "wifi.delm"
int delm_spawn_getter(struct delm_private *p)
{
int ret;
......@@ -47,7 +48,6 @@ static int delm_func_1(void *priv)
return 0;
}
void refresh_timer_cb(atimer_t *t)
{
struct delm_private *p = container_of(t, struct delm_private, t);
......
......@@ -28,6 +28,8 @@
#include <libubus.h>
#include <easy/easy.h>
#include "delm_impl.h"
#include <map-agent/mapagent.h>
#include <map-agent/timer.h>
......
......@@ -25,6 +25,7 @@
#include <libubus.h>
#include "delm_impl.h"
#include <map-agent/mapagent.h>
#include <map-agent/timer.h>
......
#ifndef DELM_IMPL_H
#define DELM_IMPL_H
#define ATIMER_T 1
#include <libubox/uloop.h>
/* uloop timer implementation */
typedef struct uloop_timeout atimer_t;
#endif /* DELM_IMPL_H */
......@@ -27,6 +27,7 @@
#include <libubox/utils.h>
#include <libubus.h>
#include "delm_impl.h"
#include <map-agent/mapagent.h>
#include <map-agent/timer.h>
......
......@@ -27,10 +27,25 @@
#include <libubus.h>
#include <map-agent/mapagent.h>
#include "delm_impl.h"
extern int delm_init(void **priv, void *cfg);
extern int delm_exit(void *priv);
void timer_init(atimer_t *t, void (*function)(atimer_t *))
{
struct uloop_timeout *ut = (struct uloop_timeout *)t;
ut->cb = (uloop_timeout_handler)function;
}
int timer_set(atimer_t *t, uint32_t tmo_ms)
{
struct uloop_timeout *ut = (struct uloop_timeout *)t;
return uloop_timeout_set(ut, tmo_ms);
}
struct wifi_netdev wifi_ifs[WIFI_DEVICE_MAX_NUM];
static void wifi_status_cb(struct ubus_request *req, int type,
......
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