Basic ad-hoc support. Signed-off-by: David Kilroy <kilroyd@xxxxxxxxxxxxxx> --- drivers/net/wireless/orinoco/cfg.c | 51 ++++++++++++++++++++++++++++++++++++ 1 files changed, 51 insertions(+), 0 deletions(-) diff --git a/drivers/net/wireless/orinoco/cfg.c b/drivers/net/wireless/orinoco/cfg.c index 56bd4f1..84a7884 100644 --- a/drivers/net/wireless/orinoco/cfg.c +++ b/drivers/net/wireless/orinoco/cfg.c @@ -390,9 +390,60 @@ static int orinoco_disconnect(struct wiphy *wiphy, struct net_device *dev, return err; } +static int orinoco_join_ibss(struct wiphy *wiphy, struct net_device *dev, + struct cfg80211_ibss_params *params) +{ + struct orinoco_private *priv = wiphy_priv(wiphy); + unsigned long lock; + int err; + + if (orinoco_lock(priv, &lock) != 0) + return -EBUSY; + + /* Setup the requested parameters in priv. If the card is not + * capable, then the driver will just ignore the settings that + * it can't do. */ + + err = __orinoco_connect(wiphy, params->channel, params->bssid, + params->ssid, params->ssid_len); + if (err) + goto out; + + /* Ignore information elements and beacon interval */ + + err = orinoco_commit(priv); + out: + orinoco_unlock(priv, &lock); + + return err; +} + +static int orinoco_leave_ibss(struct wiphy *wiphy, struct net_device *dev) +{ + struct orinoco_private *priv = wiphy_priv(wiphy); + unsigned long lock; + int err; + + if (orinoco_lock(priv, &lock) != 0) + return -EBUSY; + + /* Do we need to disassociate as well? */ + + memset(priv->desired_bssid, 0, ETH_ALEN); + memset(priv->desired_essid, 0, sizeof(priv->desired_essid)); + + err = orinoco_commit(priv); + + orinoco_unlock(priv, &lock); + + return err; +} + const struct cfg80211_ops orinoco_cfg_ops = { .change_virtual_intf = orinoco_change_vif, .scan = orinoco_scan, .connect = orinoco_connect, .disconnect = orinoco_disconnect, + .join_ibss = orinoco_join_ibss, + .leave_ibss = orinoco_leave_ibss, }; -- 1.6.3.3 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html