+void
+wireless_station_create(struct wireless_device *wdev, char *vif, struct blob_attr *data, const char *section)
+{
+ struct wireless_station *sta;
+ struct blob_attr *tb[__STA_ATTR_MAX];
+ struct blob_attr *cur;
+ char *name_buf, *vif_buf;
+ char name[8];
+
+ blobmsg_parse(sta_policy, __STA_ATTR_MAX, tb, blob_data(data), blob_len(data));
+
+ cur = tb[STA_ATTR_DISABLED];
+ if (cur && blobmsg_get_bool(cur))
+ return;
+
+ sprintf(name, "%d", wdev->vlan_idx++);
+
+ sta = calloc_a(sizeof(*sta),
+ &name_buf, strlen(name) + 1,
+ &vif_buf, strlen(vif) + 1);
+ sta->name = strcpy(name_buf, name);
+ sta->vif = strcpy(vif_buf, vif);
+ sta->wdev = wdev;
+ sta->config = data;
+ sta->section = section;
+
+ vlist_add(&wdev->stations, &sta->node, sta->name);
+}
+
+static void
+wireless_station_status(struct wireless_station *sta, struct blob_buf *b)
+{
+ void *i;
+
+ i = blobmsg_open_table(b, NULL);
+ if (sta->section)
+ blobmsg_add_string(b, "section", sta->section);
+ put_container(b, sta->config, "config");
+ blobmsg_close_table(b, i);
+}
+