From patchwork Wed Aug 5 20:32:50 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave X-Patchwork-Id: 39440 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n75KXAlH008692 for ; Wed, 5 Aug 2009 20:33:10 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752653AbZHEUdH (ORCPT ); Wed, 5 Aug 2009 16:33:07 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752642AbZHEUdH (ORCPT ); Wed, 5 Aug 2009 16:33:07 -0400 Received: from mail-ew0-f214.google.com ([209.85.219.214]:35125 "EHLO mail-ew0-f214.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752629AbZHEUdG (ORCPT ); Wed, 5 Aug 2009 16:33:06 -0400 Received: by mail-ew0-f214.google.com with SMTP id 10so291644ewy.37 for ; Wed, 05 Aug 2009 13:33:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:received:from:to:cc:subject :date:message-id:x-mailer:in-reply-to:references; bh=KoKKKjS2nltOVsxY47hnrH728BQhaVpIsKDouUhmdc8=; b=XyJ2YHcDU4pUZTwVujM2LqqBQuW4JWkGbgYLx8yev9aYViYjJDhRJtALeVhnlIcR+t uFIF7F6SVaZX3/G+LokgdnkoSZYoULcQwQPbMie21q0O4hZX7y/3IV8/Ot1eIYpNBfQj lfTc1UeiTkucC/xaZj+nO9/2A+YbY1Ey1+lfA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=FUviZ4lIDBxiW8/17ON68MHLFhViZAtujYo7suS+axi8srretloK+0g7lRNvtoWHtH jeB8n6ynR3AtuxnFLp8sS8RQV/GUTAxEMfW5/S0hDcynWHzDdddMYCHs+udWc4veITo5 2DWXXCXPDTtVuiTpbJkuKLW2eXLLcHcxRfQD4= Received: by 10.210.132.2 with SMTP id f2mr1132672ebd.94.1249504387296; Wed, 05 Aug 2009 13:33:07 -0700 (PDT) Received: from borken (5ac998cf.bb.sky.com [90.201.152.207]) by mx.google.com with ESMTPS id 5sm1253710eyf.18.2009.08.05.13.33.04 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 05 Aug 2009 13:33:06 -0700 (PDT) Received: by borken (sSMTP sendmail emulation); Wed, 05 Aug 2009 21:33:03 +0100 From: David Kilroy To: linux-wireless@vger.kernel.org Cc: orinoco-devel@lists.sourceforge.net, David Kilroy Subject: [RFC 2/4] orinoco: add cfg80211 join_ibss and leave_ibss Date: Wed, 5 Aug 2009 21:32:50 +0100 Message-Id: <1249504372-17063-3-git-send-email-kilroyd@googlemail.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1249504372-17063-1-git-send-email-kilroyd@googlemail.com> References: <1249504372-17063-1-git-send-email-kilroyd@googlemail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Basic ad-hoc support. Signed-off-by: David Kilroy --- 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, };