/** * lbs_eth_stop - close the ethX interface * * @dev: A pointer to &net_device structure * returns: 0 */ static int lbs_eth_stop(struct net_device *dev) { struct lbs_private *priv = dev->ml_priv; lbs_deb_enter(LBS_DEB_NET); if (priv->connect_status == LBS_CONNECTED) lbs_disconnect(priv, WLAN_REASON_DEAUTH_LEAVING); spin_lock_irq(&priv->driver_lock); netif_stop_queue(dev); spin_unlock_irq(&priv->driver_lock); lbs_update_mcast(priv); cancel_delayed_work_sync(&priv->scan_work); if (priv->scan_req) { cfg80211_scan_done(priv->scan_req, false); priv->scan_req = NULL; } netif_carrier_off(priv->dev); if (!lbs_iface_active(priv)) lbs_stop_iface(priv); lbs_deb_leave(LBS_DEB_NET); return 0; }
int lbs_set_mac_address(struct net_device *dev, void *addr) { int ret = 0; struct lbs_private *priv = dev->ml_priv; struct sockaddr *phwaddr = addr; lbs_deb_enter(LBS_DEB_NET); /* * Can only set MAC address when all interfaces are down, to be written * to the hardware when one of them is brought up. */ if (lbs_iface_active(priv)) return -EBUSY; /* In case it was called from the mesh device */ dev = priv->dev; memcpy(priv->current_addr, phwaddr->sa_data, ETH_ALEN); memcpy(dev->dev_addr, phwaddr->sa_data, ETH_ALEN); if (priv->mesh_dev) memcpy(priv->mesh_dev->dev_addr, phwaddr->sa_data, ETH_ALEN); lbs_deb_leave_args(LBS_DEB_NET, "ret %d", ret); return ret; }
/** * lbs_mesh_stop - close the mshX interface * * @dev: A pointer to &net_device structure * returns: 0 */ static int lbs_mesh_stop(struct net_device *dev) { struct lbs_private *priv = dev->ml_priv; lbs_mesh_config(priv, CMD_ACT_MESH_CONFIG_STOP, lbs_mesh_get_channel(priv)); spin_lock_irq(&priv->driver_lock); netif_stop_queue(dev); netif_carrier_off(dev); spin_unlock_irq(&priv->driver_lock); lbs_update_mcast(priv); if (!lbs_iface_active(priv)) lbs_stop_iface(priv); return 0; }