usteer_local_node_set_assoc(ln, tb[MSG_CLIENTS]);
}
+static void
+usteer_local_node_status_cb(struct ubus_request *req, int type, struct blob_attr *msg)
+{
+ enum {
+ MSG_FREQ,
+ MSG_CHANNEL,
+ MSG_OP_CLASS,
+ __MSG_MAX,
+ };
+ static struct blobmsg_policy policy[__MSG_MAX] = {
+ [MSG_FREQ] = { "freq", BLOBMSG_TYPE_INT32 },
+ [MSG_CHANNEL] = { "channel", BLOBMSG_TYPE_INT32 },
+ [MSG_OP_CLASS] = { "op_class", BLOBMSG_TYPE_INT32 },
+ };
+ struct blob_attr *tb[__MSG_MAX];
+ struct usteer_local_node *ln;
+ struct usteer_node *node;
+
+ ln = container_of(req, struct usteer_local_node, req);
+ node = &ln->node;
+
+ blobmsg_parse(policy, __MSG_MAX, tb, blob_data(msg), blob_len(msg));
+ if (tb[MSG_FREQ])
+ node->freq = blobmsg_get_u32(tb[MSG_FREQ]);
+ if (tb[MSG_CHANNEL])
+ node->channel = blobmsg_get_u32(tb[MSG_CHANNEL]);
+ if (tb[MSG_FREQ])
+ node->op_class = blobmsg_get_u32(tb[MSG_OP_CLASS]);
+}
+
static void
usteer_local_node_rrm_nr_cb(struct ubus_request *req, int type, struct blob_attr *msg)
{
ubus_invoke_async(ubus_ctx, ln->obj_id, "get_clients", b.head, &ln->req);
ln->req.data_cb = usteer_local_node_list_cb;
break;
+ case REQ_STATUS:
+ ubus_invoke_async(ubus_ctx, ln->obj_id, "get_status", b.head, &ln->req);
+ ln->req.data_cb = usteer_local_node_status_cb;
+ break;
case REQ_RRM_SET_LIST:
usteer_local_node_prepare_rrm_set(ln);
ubus_invoke_async(ubus_ctx, ln->obj_id, "rrm_nr_set", b.head, &ln->req);
enum local_req_state {
REQ_IDLE,
REQ_CLIENTS,
+ REQ_STATUS,
REQ_RRM_SET_LIST,
REQ_RRM_GET_OWN,
__REQ_MAX
[APMSG_NODE_LOAD] = { .type = BLOB_ATTR_INT32 },
[APMSG_NODE_RRM_NR] = { .type = BLOB_ATTR_NESTED },
[APMSG_NODE_NODE_INFO] = { .type = BLOB_ATTR_NESTED },
+ [APMSG_NODE_CHANNEL] = { .type = BLOB_ATTR_INT32 },
+ [APMSG_NODE_OP_CLASS] = { .type = BLOB_ATTR_INT32 },
};
struct blob_attr *tb[__APMSG_NODE_MAX];
struct blob_attr *cur;
msg->max_assoc = get_int32(tb[APMSG_NODE_MAX_ASSOC]);
msg->rrm_nr = NULL;
+ if (tb[APMSG_NODE_CHANNEL] && tb[APMSG_NODE_OP_CLASS]) {
+ msg->channel = blob_get_int32(tb[APMSG_NODE_CHANNEL]);
+ msg->op_class = blob_get_int32(tb[APMSG_NODE_OP_CLASS]);
+ }
+
cur = tb[APMSG_NODE_RRM_NR];
if (cur && blob_len(cur) >= sizeof(struct blob_attr) &&
blob_len(cur) >= blob_pad_len(blob_data(cur))) {
node = interface_get_node(host, msg.name);
node->check = 0;
node->node.freq = msg.freq;
+ node->node.channel = msg.channel;
+ node->node.op_class = msg.op_class;
node->node.n_assoc = msg.n_assoc;
node->node.max_assoc = msg.max_assoc;
node->node.noise = msg.noise;
blob_put_int32(&buf, APMSG_NODE_LOAD, node->load);
blob_put_int32(&buf, APMSG_NODE_N_ASSOC, node->n_assoc);
blob_put_int32(&buf, APMSG_NODE_MAX_ASSOC, node->max_assoc);
+ blob_put_int32(&buf, APMSG_NODE_OP_CLASS, node->op_class);
+ blob_put_int32(&buf, APMSG_NODE_CHANNEL, node->channel);
blob_put(&buf, APMSG_NODE_BSSID, node->bssid, sizeof(node->bssid));
if (node->rrm_nr) {
r = blob_nest_start(&buf, APMSG_NODE_RRM_NR);
APMSG_NODE_RRM_NR,
APMSG_NODE_NODE_INFO,
APMSG_NODE_BSSID,
+ APMSG_NODE_CHANNEL,
+ APMSG_NODE_OP_CLASS,
__APMSG_NODE_MAX
};
const char *ssid;
const char *bssid;
int freq;
+ int channel;
+ int op_class;
int n_assoc;
int max_assoc;
int noise;
bool disabled;
int freq;
+ int channel;
+ int op_class;
int noise;
int n_assoc;
int max_assoc;