{
struct device *dev;
+ if (!external && system_if_force_external(name))
+ return NULL;
+
D(DEVICE, "Create simple device '%s'\n", name);
dev = calloc(1, sizeof(*dev));
dev->external = external;
return 0;
}
+bool system_if_force_external(const char *ifname)
+{
+ return false;
+}
+
int system_if_up(struct device *dev)
{
D(SYSTEM, "ifconfig %s up\n", dev->ifname);
}
}
+bool
+system_if_force_external(const char *ifname)
+{
+ char buf[64];
+ struct stat s;
+
+ snprintf(buf, sizeof(buf), "/sys/class/net/%s/phy80211", ifname);
+ return stat(buf, &s) == 0;
+}
+
int
system_if_dump_info(struct device *dev, struct blob_buf *b)
{
int system_if_dump_info(struct device *dev, struct blob_buf *b);
int system_if_dump_stats(struct device *dev, struct blob_buf *b);
struct device *system_if_get_parent(struct device *dev);
+bool system_if_force_external(const char *ifname);
int system_add_address(struct device *dev, struct device_addr *addr);
int system_del_address(struct device *dev, struct device_addr *addr);