linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: Add SIOCGIWTXPOWER routine
@ 2007-08-07 18:08 Larry Finger
  2007-08-07 18:13 ` Michael Buesch
  2007-08-08  7:04 ` Tomas Winkler
  0 siblings, 2 replies; 3+ messages in thread
From: Larry Finger @ 2007-08-07 18:08 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless

The wireless extensions ioctl's implemented in mac80211 do not include
SIOCGIWTXPOWER. This patch adds the necessary code.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---

Index: wireless-dev/net/mac80211/ieee80211_ioctl.c
===================================================================
--- wireless-dev.orig/net/mac80211/ieee80211_ioctl.c
+++ wireless-dev/net/mac80211/ieee80211_ioctl.c
@@ -1925,6 +1925,20 @@ static int ieee80211_ioctl_giwrate(struc
 	return 0;
 }
 
+static int ieee80211_ioctl_giwtxpower(struct net_device *dev,
+				   struct iw_request_info *info,
+				   union iwreq_data *data, char *extra)
+{
+	struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
+
+	data->txpower.fixed = 1;
+	data->txpower.disabled = 0;
+	data->txpower.value = local->hw.conf.power_level;
+	data->txpower.flags = IW_TXPOW_DBM;
+
+	return 0;
+}
+
 static int ieee80211_ioctl_siwrts(struct net_device *dev,
 				  struct iw_request_info *info,
 				  struct iw_param *rts, char *extra)
@@ -2881,7 +2895,7 @@ static const iw_handler ieee80211_handle
 	(iw_handler) ieee80211_ioctl_siwfrag,		/* SIOCSIWFRAG */
 	(iw_handler) ieee80211_ioctl_giwfrag,		/* SIOCGIWFRAG */
 	(iw_handler) NULL,				/* SIOCSIWTXPOW */
-	(iw_handler) NULL,				/* SIOCGIWTXPOW */
+	(iw_handler) ieee80211_ioctl_giwtxpower,	/* SIOCGIWTXPOW */
 	(iw_handler) ieee80211_ioctl_siwretry,		/* SIOCSIWRETRY */
 	(iw_handler) ieee80211_ioctl_giwretry,		/* SIOCGIWRETRY */
 	(iw_handler) ieee80211_ioctl_siwencode,		/* SIOCSIWENCODE */


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mac80211: Add SIOCGIWTXPOWER routine
  2007-08-07 18:08 [PATCH] mac80211: Add SIOCGIWTXPOWER routine Larry Finger
@ 2007-08-07 18:13 ` Michael Buesch
  2007-08-08  7:04 ` Tomas Winkler
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Buesch @ 2007-08-07 18:13 UTC (permalink / raw)
  To: Larry Finger; +Cc: John Linville, linux-wireless

On Tuesday 07 August 2007 20:08:49 Larry Finger wrote:
> The wireless extensions ioctl's implemented in mac80211 do not include
> SIOCGIWTXPOWER. This patch adds the necessary code.
> 
> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
> ---
> 
> Index: wireless-dev/net/mac80211/ieee80211_ioctl.c
> ===================================================================
> --- wireless-dev.orig/net/mac80211/ieee80211_ioctl.c
> +++ wireless-dev/net/mac80211/ieee80211_ioctl.c
> @@ -1925,6 +1925,20 @@ static int ieee80211_ioctl_giwrate(struc
>  	return 0;
>  }
>  
> +static int ieee80211_ioctl_giwtxpower(struct net_device *dev,
> +				   struct iw_request_info *info,
> +				   union iwreq_data *data, char *extra)
> +{
> +	struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
> +
> +	data->txpower.fixed = 1;
> +	data->txpower.disabled = 0;
> +	data->txpower.value = local->hw.conf.power_level;
> +	data->txpower.flags = IW_TXPOW_DBM;
> +
> +	return 0;
> +}
> +
>  static int ieee80211_ioctl_siwrts(struct net_device *dev,
>  				  struct iw_request_info *info,
>  				  struct iw_param *rts, char *extra)
> @@ -2881,7 +2895,7 @@ static const iw_handler ieee80211_handle
>  	(iw_handler) ieee80211_ioctl_siwfrag,		/* SIOCSIWFRAG */
>  	(iw_handler) ieee80211_ioctl_giwfrag,		/* SIOCGIWFRAG */
>  	(iw_handler) NULL,				/* SIOCSIWTXPOW */
> -	(iw_handler) NULL,				/* SIOCGIWTXPOW */
> +	(iw_handler) ieee80211_ioctl_giwtxpower,	/* SIOCGIWTXPOW */
>  	(iw_handler) ieee80211_ioctl_siwretry,		/* SIOCSIWRETRY */
>  	(iw_handler) ieee80211_ioctl_giwretry,		/* SIOCGIWRETRY */
>  	(iw_handler) ieee80211_ioctl_siwencode,		/* SIOCSIWENCODE */

Looks good.

Acked-by: Michael Buesch <mb@bu3sch.de>

-- 
Greetings Michael.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mac80211: Add SIOCGIWTXPOWER routine
  2007-08-07 18:08 [PATCH] mac80211: Add SIOCGIWTXPOWER routine Larry Finger
  2007-08-07 18:13 ` Michael Buesch
@ 2007-08-08  7:04 ` Tomas Winkler
  1 sibling, 0 replies; 3+ messages in thread
From: Tomas Winkler @ 2007-08-08  7:04 UTC (permalink / raw)
  To: Larry Finger; +Cc: John Linville, linux-wireless

On 8/7/07, Larry Finger <Larry.Finger@lwfinger.net> wrote:
> The wireless extensions ioctl's implemented in mac80211 do not include
> SIOCGIWTXPOWER. This patch adds the necessary code.
>
> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
> ---
>
> Index: wireless-dev/net/mac80211/ieee80211_ioctl.c
> ===================================================================
> --- wireless-dev.orig/net/mac80211/ieee80211_ioctl.c
> +++ wireless-dev/net/mac80211/ieee80211_ioctl.c
> @@ -1925,6 +1925,20 @@ static int ieee80211_ioctl_giwrate(struc
>         return 0;
>  }
>
> +static int ieee80211_ioctl_giwtxpower(struct net_device *dev,
> +                                  struct iw_request_info *info,
> +                                  union iwreq_data *data, char *extra)
> +{
> +       struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
> +
> +       data->txpower.fixed = 1;
> +       data->txpower.disabled = 0;

 data->txpower.disabled = !(local->conf.radio_enabled)

> +       data->txpower.value = local->hw.conf.power_level;
> +       data->txpower.flags = IW_TXPOW_DBM;
> +
> +       return 0;
> +}
> +
>  static int ieee80211_ioctl_siwrts(struct net_device *dev,
>                                   struct iw_request_info *info,
>                                   struct iw_param *rts, char *extra)
> @@ -2881,7 +2895,7 @@ static const iw_handler ieee80211_handle
>         (iw_handler) ieee80211_ioctl_siwfrag,           /* SIOCSIWFRAG */
>         (iw_handler) ieee80211_ioctl_giwfrag,           /* SIOCGIWFRAG */
>         (iw_handler) NULL,                              /* SIOCSIWTXPOW */
> -       (iw_handler) NULL,                              /* SIOCGIWTXPOW */
> +       (iw_handler) ieee80211_ioctl_giwtxpower,        /* SIOCGIWTXPOW */
>         (iw_handler) ieee80211_ioctl_siwretry,          /* SIOCSIWRETRY */
>         (iw_handler) ieee80211_ioctl_giwretry,          /* SIOCGIWRETRY */
>         (iw_handler) ieee80211_ioctl_siwencode,         /* SIOCSIWENCODE */
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-08-08  7:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-07 18:08 [PATCH] mac80211: Add SIOCGIWTXPOWER routine Larry Finger
2007-08-07 18:13 ` Michael Buesch
2007-08-08  7:04 ` Tomas Winkler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).