struct connman_iface_driver {
const char *name;
const char *capability;
+
int (*probe) (struct connman_iface *iface);
void (*remove) (struct connman_iface *iface);
+ int (*start) (struct connman_iface *iface);
+ int (*stop) (struct connman_iface *iface);
+
int (*scan) (struct connman_iface *iface);
int (*connect) (struct connman_iface *iface,
struct connman_network *network);
ifr.ifr_flags |= IFF_UP;
- if (ioctl(sk, SIOCSIFFLAGS, &ifr) < 0)
+ if (ioctl(sk, SIOCSIFFLAGS, &ifr) < 0) {
err = -errno;
+ goto done;
+ }
+
+ if (iface->driver->start)
+ err = iface->driver->start(iface);
else
err = 0;
DBG("iface %p", iface);
+ if (iface->driver->stop) {
+ err = iface->driver->stop(iface);
+ if (err < 0)
+ return err;
+ }
+
sk = socket(PF_INET, SOCK_DGRAM, 0);
if (sk < 0)
return -errno;