[Prism54-devel] Patch to control output power (iwconfig txpower)

Rafiq Shaikh rafiq.shaikh@analog.com
Tue, 30 Dec 2003 14:14:03 -0800


This is a multi-part message in MIME format.
--------------030409090300030105020800
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi Barret Lee,

The OID_INL_OUTPUTPOWER is 0xFF02000F and it is of type "long".
This object specifies the output power in units of 0.25 dBm.
I hope this helps.

Regards,
-Rafiq.


Barret,Lee wrote:

>Sorry, can you tell me how to find the OID for OID_INL_OUTPUTPOWER.
>i could not find in RM034. in RM034 Appendix A, OID_802_11_TX_POWER_LEVEL
>was TBD.
>I think you were using this object (aOutputPowerTable ).
>PHY OBJ aOutputPowerTable (WRITE ONLY, define in RM034 PHY-OBJ):
>This object configures the output power table. The structure and its values
>are implementation dependent.
>
>but, who know the structure of this object?
>
>best regard.
>Barret Lee
>
>  
>
>>----- Original Message ----- 
>>From: "kaleda" <gadeanta@soften.ktu.lt>
>>To: "prism54" <prism54-devel@prism54.org>
>>Sent: Friday, December 19, 2003 9:25 PM
>>Subject: [Prism54-devel] Patch to control output power (iwconfig txpower)
>>
>>
>>    
>>
>>>Made a patch to manage output power.
>>>Currently only fixed value is supported
>>>(I think the main in AP mode).
>>>Still don't know a way to turn off the radio (anyone knows it) ?
>>>
>>>Kaleda
>>>
>>>diff -uNr prism54.orig/ksrc/isl_ioctl.c prism54/ksrc/isl_ioctl.c
>>>--- prism54.orig/ksrc/isl_ioctl.c 2003-12-17 08:16:38.000000000 +0200
>>>+++ prism54/ksrc/isl_ioctl.c 2003-12-19 14:04:28.000000000 +0200
>>>@@ -880,6 +880,9 @@
>>>  range->max_retry = 65535;
>>>  range->min_r_time = 1024;
>>>  range->max_r_time = 65535 * 1024;
>>>+
>>>+ /* txpower is supported in dBm's */
>>>+ range->txpower_capa = IW_TXPOW_DBM;
>>>
>>>  /* Request the device for the supported frequencies
>>>  * not really revelant since some devices will report the 5 GHz band
>>>@@ -1638,6 +1641,47 @@
>>>  return 0;
>>> }
>>>
>>>+
>>>+int prism54_get_txpower(struct net_device *ndev, struct iw_request_info
>>>*info,
>>>+ struct iw_param *vwrq, char *extra)
>>>+{
>>>+ islpci_private *priv = ndev->priv;
>>>+ u32 u;
>>>+ memset(vwrq, 0, sizeof(struct iw_param));
>>>+ MGT_GET_REQUEST_U32(priv, OID_INL_OUTPUTPOWER, &u, fixedtxpower);
>>>+ // intersil firmware operates in 0.25 dBm (1/4 dBm)
>>>+ vwrq->value = u / 4;
>>>+ vwrq->fixed = 1; // fixed value is set
>>>+ // radio is not turned of
>>>+ // btw: how is possible to turn off only the radio ?
>>>+ vwrq->disabled = 0;
>>>+ return 0;
>>>+} // isl_ioctl_gettxpow
>>>+
>>>+int prism54_set_txpower(struct net_device *ndev, struct iw_request_info
>>>*info,
>>>+ struct iw_param *vwrq, char *extra)
>>>+{
>>>+ islpci_private *priv = ndev->priv;
>>>+ // intersil firmware operates in 0.25 dBm (1/4)
>>>+ u32 u = vwrq->value;
>>>+ u *= 4;
>>>+ if (vwrq->disabled) {
>>>+ // don't know how to disable radio
>>>+ printk(KERN_DEBUG "%s: %s() disabling radio is not yet supported.\n",
>>>priv->ndev->name, __FUNCTION__);
>>>+ return -ENOTSUPP;
>>>+ } else if (vwrq->fixed) {
>>>+ // currently only fixed value is supported
>>>+ MGT_SET_REQUEST_U32(priv, OID_INL_OUTPUTPOWER , u, fixedtxpower);
>>>+ return 0;
>>>+ } else {
>>>+ printk(KERN_DEBUG "%s: %s() auto power will be implemented later.\n",
>>>+ priv->ndev->name, __FUNCTION__);
>>>+ return -ENOTSUPP;
>>>+ }
>>>+} // isl_ioctl_settxpow
>>>+
>>>+
>>>+
>>> int
>>> prism54_reset(struct net_device *ndev, struct iw_request_info *info,
>>>        __u32 *uwrq, char *extra)
>>>diff -uNr prism54.orig/ksrc/isl_ioctl.h prism54/ksrc/isl_ioctl.h
>>>--- prism54.orig/ksrc/isl_ioctl.h 2003-12-17 08:16:38.000000000 +0200
>>>+++ prism54/ksrc/isl_ioctl.h 2003-12-19 10:36:12.000000000 +0200
>>>@@ -94,6 +94,10 @@
>>>         struct iw_point *, char *);
>>> int prism54_get_encode(struct net_device *, struct iw_request_info *,
>>>         struct iw_point *, char *);
>>>+int prism54_set_txpower(struct net_device *, struct iw_request_info *,
>>>+      struct iw_param *, char *);
>>>+int prism54_get_txpower(struct net_device *, struct iw_request_info *,
>>>+      struct iw_param *, char *);
>>>
>>> int prism54_reset(struct net_device *, struct iw_request_info *,
>>>    __u32 *, char *);
>>>@@ -189,8 +193,8 @@
>>>  (iw_handler) prism54_get_rts, /* SIOCGIWRTS */
>>>  (iw_handler) prism54_set_frag, /* SIOCSIWFRAG */
>>>  (iw_handler) prism54_get_frag, /* SIOCGIWFRAG */
>>>- (iw_handler) NULL, /* SIOCSIWTXPOW */
>>>- (iw_handler) NULL, /* SIOCGIWTXPOW */
>>>+ (iw_handler) prism54_set_txpower, /* SIOCSIWTXPOW */
>>>+ (iw_handler) prism54_get_txpower, /* SIOCGIWTXPOW */
>>>  (iw_handler) prism54_set_retry, /* SIOCSIWRETRY */
>>>  (iw_handler) prism54_get_retry, /* SIOCGIWRETRY */
>>>  (iw_handler) prism54_set_encode, /* SIOCSIWENCODE */
>>>diff -uNr prism54.orig/ksrc/islpci_dev.h prism54/ksrc/islpci_dev.h
>>>--- prism54.orig/ksrc/islpci_dev.h 2003-12-17 08:16:39.000000000 +0200
>>>+++ prism54/ksrc/islpci_dev.h 2003-12-19 10:19:55.000000000 +0200
>>>@@ -85,6 +85,7 @@
>>>  volatile u32 shortretries;
>>>  volatile u32 longretries;
>>>  volatile u32 maxtxlifetime;
>>>+ volatile u32 fixedtxpower;
>>>
>>>  struct semaphore sem;
>>> };
>>>diff -uNr prism54.orig/ksrc/islpci_mgt.h prism54/ksrc/islpci_mgt.h
>>>--- prism54.orig/ksrc/islpci_mgt.h 2003-12-17 08:16:39.000000000 +0200
>>>+++ prism54/ksrc/islpci_mgt.h 2003-12-19 13:59:17.000000000 +0200
>>>@@ -79,6 +79,8 @@
>>> #define OID_INL_COMPONENT_ID                    0xFF020007
>>> #define OID_INL_CONFIG                          0xFF020008
>>> #define OID_INL_DOT11D_CONFORMANCE              0xFF02000C
>>>+#define OID_INL_OUTPUTPOWER 0xFF02000F
>>>+
>>>
>>> /* The dot11d conformance level configures the 802.11d conformance
>>>levels.
>>>  * The following conformance levels exist:*/
>>>
>>>_______________________________________________
>>>Prism54-devel mailing list
>>>Prism54-devel@prism54.org
>>>http://prism54.org/mailman/listinfo/prism54-devel
>>>
>>>      
>>>
>
>_______________________________________________
>Prism54-devel mailing list
>Prism54-devel@prism54.org
>http://prism54.org/mailman/listinfo/prism54-devel
>
>
>  
>

--------------030409090300030105020800
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html;charset=Big5">
  <title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
Hi Barret Lee,<br>
<br>
The OID_INL_OUTPUTPOWER is 0xFF02000F and it is of type "long".<br>
This object specifies the output power in units of 0.25 dBm.<br>
I hope this helps.<br>
<br>
Regards,<br>
-Rafiq.<br>
<br>
<br>
Barret,Lee wrote:<br>
<blockquote type="cite" cite="mid001601c3c8a9$ceead2f0$0301a8c0@NB">
  <pre wrap="">Sorry, can you tell me how to find the OID for OID_INL_OUTPUTPOWER.
i could not find in RM034. in RM034 Appendix A, OID_802_11_TX_POWER_LEVEL
was TBD.
I think you were using this object (aOutputPowerTable ).
PHY OBJ aOutputPowerTable (WRITE ONLY, define in RM034 PHY-OBJ):
This object configures the output power table. The structure and its values
are implementation dependent.

but, who know the structure of this object?

best regard.
Barret Lee

  </pre>
  <blockquote type="cite">
    <pre wrap="">----- Original Message ----- 
From: "kaleda" <a class="moz-txt-link-rfc2396E" href="mailto:gadeanta@soften.ktu.lt">&lt;gadeanta@soften.ktu.lt&gt;</a>
To: "prism54" <a class="moz-txt-link-rfc2396E" href="mailto:prism54-devel@prism54.org">&lt;prism54-devel@prism54.org&gt;</a>
Sent: Friday, December 19, 2003 9:25 PM
Subject: [Prism54-devel] Patch to control output power (iwconfig txpower)


    </pre>
    <blockquote type="cite">
      <pre wrap="">Made a patch to manage output power.
Currently only fixed value is supported
(I think the main in AP mode).
Still don't know a way to turn off the radio (anyone knows it) ?

Kaleda

diff -uNr prism54.orig/ksrc/isl_ioctl.c prism54/ksrc/isl_ioctl.c
--- prism54.orig/ksrc/isl_ioctl.c 2003-12-17 08:16:38.000000000 +0200
+++ prism54/ksrc/isl_ioctl.c 2003-12-19 14:04:28.000000000 +0200
@@ -880,6 +880,9 @@
  range-&gt;max_retry = 65535;
  range-&gt;min_r_time = 1024;
  range-&gt;max_r_time = 65535 * 1024;
+
+ /* txpower is supported in dBm's */
+ range-&gt;txpower_capa = IW_TXPOW_DBM;

  /* Request the device for the supported frequencies
  * not really revelant since some devices will report the 5 GHz band
@@ -1638,6 +1641,47 @@
  return 0;
 }

+
+int prism54_get_txpower(struct net_device *ndev, struct iw_request_info
*info,
+ struct iw_param *vwrq, char *extra)
+{
+ islpci_private *priv = ndev-&gt;priv;
+ u32 u;
+ memset(vwrq, 0, sizeof(struct iw_param));
+ MGT_GET_REQUEST_U32(priv, OID_INL_OUTPUTPOWER, &amp;u, fixedtxpower);
+ // intersil firmware operates in 0.25 dBm (1/4 dBm)
+ vwrq-&gt;value = u / 4;
+ vwrq-&gt;fixed = 1; // fixed value is set
+ // radio is not turned of
+ // btw: how is possible to turn off only the radio ?
+ vwrq-&gt;disabled = 0;
+ return 0;
+} // isl_ioctl_gettxpow
+
+int prism54_set_txpower(struct net_device *ndev, struct iw_request_info
*info,
+ struct iw_param *vwrq, char *extra)
+{
+ islpci_private *priv = ndev-&gt;priv;
+ // intersil firmware operates in 0.25 dBm (1/4)
+ u32 u = vwrq-&gt;value;
+ u *= 4;
+ if (vwrq-&gt;disabled) {
+ // don't know how to disable radio
+ printk(KERN_DEBUG "%s: %s() disabling radio is not yet supported.\n",
priv-&gt;ndev-&gt;name, __FUNCTION__);
+ return -ENOTSUPP;
+ } else if (vwrq-&gt;fixed) {
+ // currently only fixed value is supported
+ MGT_SET_REQUEST_U32(priv, OID_INL_OUTPUTPOWER , u, fixedtxpower);
+ return 0;
+ } else {
+ printk(KERN_DEBUG "%s: %s() auto power will be implemented later.\n",
+ priv-&gt;ndev-&gt;name, __FUNCTION__);
+ return -ENOTSUPP;
+ }
+} // isl_ioctl_settxpow
+
+
+
 int
 prism54_reset(struct net_device *ndev, struct iw_request_info *info,
        __u32 *uwrq, char *extra)
diff -uNr prism54.orig/ksrc/isl_ioctl.h prism54/ksrc/isl_ioctl.h
--- prism54.orig/ksrc/isl_ioctl.h 2003-12-17 08:16:38.000000000 +0200
+++ prism54/ksrc/isl_ioctl.h 2003-12-19 10:36:12.000000000 +0200
@@ -94,6 +94,10 @@
         struct iw_point *, char *);
 int prism54_get_encode(struct net_device *, struct iw_request_info *,
         struct iw_point *, char *);
+int prism54_set_txpower(struct net_device *, struct iw_request_info *,
+      struct iw_param *, char *);
+int prism54_get_txpower(struct net_device *, struct iw_request_info *,
+      struct iw_param *, char *);

 int prism54_reset(struct net_device *, struct iw_request_info *,
    __u32 *, char *);
@@ -189,8 +193,8 @@
  (iw_handler) prism54_get_rts, /* SIOCGIWRTS */
  (iw_handler) prism54_set_frag, /* SIOCSIWFRAG */
  (iw_handler) prism54_get_frag, /* SIOCGIWFRAG */
- (iw_handler) NULL, /* SIOCSIWTXPOW */
- (iw_handler) NULL, /* SIOCGIWTXPOW */
+ (iw_handler) prism54_set_txpower, /* SIOCSIWTXPOW */
+ (iw_handler) prism54_get_txpower, /* SIOCGIWTXPOW */
  (iw_handler) prism54_set_retry, /* SIOCSIWRETRY */
  (iw_handler) prism54_get_retry, /* SIOCGIWRETRY */
  (iw_handler) prism54_set_encode, /* SIOCSIWENCODE */
diff -uNr prism54.orig/ksrc/islpci_dev.h prism54/ksrc/islpci_dev.h
--- prism54.orig/ksrc/islpci_dev.h 2003-12-17 08:16:39.000000000 +0200
+++ prism54/ksrc/islpci_dev.h 2003-12-19 10:19:55.000000000 +0200
@@ -85,6 +85,7 @@
  volatile u32 shortretries;
  volatile u32 longretries;
  volatile u32 maxtxlifetime;
+ volatile u32 fixedtxpower;

  struct semaphore sem;
 };
diff -uNr prism54.orig/ksrc/islpci_mgt.h prism54/ksrc/islpci_mgt.h
--- prism54.orig/ksrc/islpci_mgt.h 2003-12-17 08:16:39.000000000 +0200
+++ prism54/ksrc/islpci_mgt.h 2003-12-19 13:59:17.000000000 +0200
@@ -79,6 +79,8 @@
 #define OID_INL_COMPONENT_ID                    0xFF020007
 #define OID_INL_CONFIG                          0xFF020008
 #define OID_INL_DOT11D_CONFORMANCE              0xFF02000C
+#define OID_INL_OUTPUTPOWER 0xFF02000F
+

 /* The dot11d conformance level configures the 802.11d conformance
levels.
  * The following conformance levels exist:*/

_______________________________________________
Prism54-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Prism54-devel@prism54.org">Prism54-devel@prism54.org</a>
<a class="moz-txt-link-freetext" href="http://prism54.org/mailman/listinfo/prism54-devel">http://prism54.org/mailman/listinfo/prism54-devel</a>

      </pre>
    </blockquote>
  </blockquote>
  <pre wrap=""><!---->
_______________________________________________
Prism54-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Prism54-devel@prism54.org">Prism54-devel@prism54.org</a>
<a class="moz-txt-link-freetext" href="http://prism54.org/mailman/listinfo/prism54-devel">http://prism54.org/mailman/listinfo/prism54-devel</a>


  </pre>
</blockquote>
</body>
</html>

--------------030409090300030105020800--