+enum {
+ RPC_A_DEVICE,
+ RPC_A_MACADDR,
+ __RPC_A_MAX,
+};
+
+static const struct blobmsg_policy rpc_assoclist_policy[__RPC_A_MAX] = {
+ [RPC_A_DEVICE] = { .name = "device", .type = BLOBMSG_TYPE_STRING },
+ [RPC_A_MACADDR] = { .name = "mac", .type = BLOBMSG_TYPE_STRING },
+};
+
+static int
+__rpc_iwinfo_open(struct blob_attr *device)
+{
+ if (!device)
+ return UBUS_STATUS_INVALID_ARGUMENT;
+
+ ifname = blobmsg_data(device);
+ iw = iwinfo_backend(ifname);
+
+ return iw ? UBUS_STATUS_OK : UBUS_STATUS_NOT_FOUND;
+}