Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=823eaa2cc261e3723772aa4aaa4d76c5815b117f
Commit:     823eaa2cc261e3723772aa4aaa4d76c5815b117f
Parent:     f5956bf1e4575175135d636db1b7f3ab950e0dc3
Author:     David Woodhouse <[EMAIL PROTECTED]>
AuthorDate: Tue Dec 11 19:56:28 2007 -0500
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Jan 28 15:06:56 2008 -0800

    libertas: allow setting channel on mshX device
    
    Signed-off-by: David Woodhouse <[EMAIL PROTECTED]>
    Signed-off-by: John W. Linville <[EMAIL PROTECTED]>
---
 drivers/net/wireless/libertas/wext.c |   53 +++++++++++++++++++++++++++++++++-
 1 files changed, 52 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/libertas/wext.c 
b/drivers/net/wireless/libertas/wext.c
index 0a06072..262d4cc 100644
--- a/drivers/net/wireless/libertas/wext.c
+++ b/drivers/net/wireless/libertas/wext.c
@@ -959,6 +959,57 @@ out:
        return ret;
 }
 
+static int lbs_mesh_set_freq(struct net_device *dev,
+                            struct iw_request_info *info,
+                            struct iw_freq *fwrq, char *extra)
+{
+       struct lbs_private *priv = dev->priv;
+       struct chan_freq_power *cfp;
+       int ret = -EINVAL;
+
+       lbs_deb_enter(LBS_DEB_WEXT);
+
+       /* If setting by frequency, convert to a channel */
+       if (fwrq->e == 1) {
+               long f = fwrq->m / 100000;
+
+               cfp = find_cfp_by_band_and_freq(priv, 0, f);
+               if (!cfp) {
+                       lbs_deb_wext("invalid freq %ld\n", f);
+                       goto out;
+               }
+
+               fwrq->e = 0;
+               fwrq->m = (int) cfp->channel;
+       }
+
+       /* Setting by channel number */
+       if (fwrq->m > 1000 || fwrq->e > 0) {
+               goto out;
+       }
+
+       cfp = lbs_find_cfp_by_band_and_channel(priv, 0, fwrq->m);
+       if (!cfp) {
+               goto out;
+       }
+
+       if (fwrq->m != priv->curbssparams.channel) {
+               lbs_deb_wext("mesh channel change forces eth disconnect\n");
+               if (priv->mode == IW_MODE_INFRA)
+                       lbs_send_deauthentication(priv);
+               else if (priv->mode == IW_MODE_ADHOC)
+                       lbs_stop_adhoc_network(priv);
+       }
+       priv->curbssparams.channel = fwrq->m;
+       lbs_mesh_config(priv, 0);
+       lbs_mesh_config(priv, 1);
+       ret = 0;
+
+out:
+       lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret);
+       return ret;
+}
+
 static int lbs_set_rate(struct net_device *dev, struct iw_request_info *info,
                  struct iw_param *vwrq, char *extra)
 {
@@ -2097,7 +2148,7 @@ static const iw_handler mesh_wlan_handler[] = {
        (iw_handler) lbs_get_name,      /* SIOCGIWNAME */
        (iw_handler) NULL,      /* SIOCSIWNWID */
        (iw_handler) NULL,      /* SIOCGIWNWID */
-       (iw_handler) lbs_set_freq,      /* SIOCSIWFREQ */
+       (iw_handler) lbs_mesh_set_freq, /* SIOCSIWFREQ */
        (iw_handler) lbs_get_freq,      /* SIOCGIWFREQ */
        (iw_handler) NULL,              /* SIOCSIWMODE */
        (iw_handler) mesh_wlan_get_mode,        /* SIOCGIWMODE */
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to