[Prism54-devel] [PATCH] make all 32bit OIDs settable/gettable via iwpriv

vda@port.imtp.ilyichevsk.odessa.ua vda@port.imtp.ilyichevsk.odessa.ua
Tue, 10 Feb 2004 01:58:36 +0200


Against patch-2.6.2-prism54-cvs20040204.
Tested.

NB: wireless tools were not designed to cope
with that many ioctls. You'll need to
increase this to 256 or more:

#define IW_MAX_PRIV_DEF 256

in wireless tools, iwpriv.c
--
vda

diff -urN prism54.orig/isl_ioctl.c prism54/isl_ioctl.c
--- prism54.orig/isl_ioctl.c    Tue Feb 10 01:29:01 2004
+++ prism54/isl_ioctl.c Tue Feb 10 01:32:53 2004
@@ -2011,8 +2011,134 @@
         "get_wpa"},
        {PRISM54_SET_WPA, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0,
         "set_wpa"},
+
+#define PRISM54_SET_U32           SIOCIWFIRSTPRIV+16
+#define PRISM54_GET_U32           SIOCIWFIRSTPRIV+17
+        /* --- raw access to sub-ioctls --- */
+        { PRISM54_SET_U32,
+          IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, 0, "prism54_set_u32" },
+        { PRISM54_GET_U32,
+          IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
+          IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "prism54_get_u32" },
+        /* --- sub-ioctls handlers --- */
+        { PRISM54_SET_U32, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "" },
+        { PRISM54_GET_U32, 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "" },
+        /* --- sub-ioctls definitions --- */
+#define PRIVATE_ARGS(oid,name) \
+        { oid, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "s" #name }, \
+        { oid, 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "g" #name },
+/*
+    NB: increase this to 256 or more:
+    #define IW_MAX_PRIV_DEF 256
+    in wireless tools, iwpriv.c
+*/
+/*PRIVATE_ARGS(                                        ,[============]         )*/
+  PRIVATE_ARGS(GEN_OID_LINKSTATE               ,gLINKSTATE             )
+  PRIVATE_ARGS(DOT11_OID_BSSTYPE               ,BSSTYPE                )
+  PRIVATE_ARGS(DOT11_OID_STATE                 ,STATE                  )
+  PRIVATE_ARGS(DOT11_OID_AID                   ,AID                    )
+  PRIVATE_ARGS(DOT11_OID_MEDIUMLIMIT           ,MEDIUMLIMIT            )
+  PRIVATE_ARGS(DOT11_OID_BEACONPERIOD          ,BEACONPERIOD           )
+  PRIVATE_ARGS(DOT11_OID_DTIMPERIOD            ,DTIMPERIOD             )
+  PRIVATE_ARGS(DOT11_OID_ATIMWINDOW            ,ATIMWINDOW             )
+  PRIVATE_ARGS(DOT11_OID_LISTENINTERVAL                ,LISTENINTERVAL         )
+  PRIVATE_ARGS(DOT11_OID_CFPPERIOD             ,CFPPERIOD              )
+  PRIVATE_ARGS(DOT11_OID_CFPDURATION           ,CFPDURATION            )
+  PRIVATE_ARGS(DOT11_OID_AUTHENABLE            ,AUTHENABLE             )
+  PRIVATE_ARGS(DOT11_OID_PRIVACYINVOKED                ,PRIVACYINVOKED         )
+  PRIVATE_ARGS(DOT11_OID_EXUNENCRYPTED         ,EXUNENCRYPTED          )
+  PRIVATE_ARGS(DOT11_OID_DEFKEYID              ,DEFKEYID               )
+  PRIVATE_ARGS(DOT11_OID_REKEYTHRESHOLD                ,REKEYTHRESHOLD         )
+  PRIVATE_ARGS(DOT11_OID_PRIVTXREJECTED                ,PRIVTXREJECTED         )
+  PRIVATE_ARGS(DOT11_OID_PRIVRXPLAIN           ,PRIVRXPLAIN            )
+  PRIVATE_ARGS(DOT11_OID_PRIVRXFAILED          ,PRIVRXFAILED           )
+  PRIVATE_ARGS(DOT11_OID_PRIVRXNOKEY           ,PRIVRXNOKEY            )
+  PRIVATE_ARGS(DOT11_OID_RTSTHRESH             ,RTSTHRESH              )
+  PRIVATE_ARGS(DOT11_OID_FRAGTHRESH            ,FRAGTHRESH             )
+  PRIVATE_ARGS(DOT11_OID_SHORTRETRIES          ,SHORTRETRIES           )
+  PRIVATE_ARGS(DOT11_OID_LONGRETRIES           ,LONGRETRIES            )
+  PRIVATE_ARGS(DOT11_OID_MAXTXLIFETIME         ,MAXTXLIFETIME          )
+  PRIVATE_ARGS(DOT11_OID_MAXRXLIFETIME         ,MAXRXLIFETIME          )
+  PRIVATE_ARGS(DOT11_OID_AUTHRESPTIMEOUT       ,AUTHRESPTIMEO          )
+  PRIVATE_ARGS(DOT11_OID_ASSOCRESPTIMEOUT      ,ASSOCRESPTIMEO         )
+  PRIVATE_ARGS(DOT11_OID_ALOFT_FIXEDRATE       ,ALOFT_FIXEDRT          )
+  PRIVATE_ARGS(DOT11_OID_MAXFRAMEBURST         ,MAXFRAMEBURST          )
+  PRIVATE_ARGS(DOT11_OID_PSM                   ,PSM                    )
+  PRIVATE_ARGS(DOT11_OID_CAMTIMEOUT            ,CAMTIMEOUT             )
+  PRIVATE_ARGS(DOT11_OID_RECEIVEDTIMS          ,RECEIVEDTIMS           )
+  PRIVATE_ARGS(DOT11_OID_ROAMPREFERENCE                ,ROAMPREFERENCE         )
+  PRIVATE_ARGS(DOT11_OID_BRIDGELOCAL           ,BRIDGELOCAL            )
+  PRIVATE_ARGS(DOT11_OID_CLIENTS               ,CLIENTS                )
+  PRIVATE_ARGS(DOT11_OID_CLIENTSASSOCIATED     ,CLIENTSASSOCIA         )
+  PRIVATE_ARGS(DOT11_OID_DOT1XENABLE           ,DOT1XENABLE            )
+  PRIVATE_ARGS(DOT11_OID_MPDUTXSUCCESSFUL      ,MPDUTXSUCCESS          )
+  PRIVATE_ARGS(DOT11_OID_MPDUTXONERETRY                ,MPDUTXONERETRY         )
+
+  PRIVATE_ARGS(DOT11_OID_MPDUTXMULTIPLERETRIES ,MPDUTXMULTIRTR         )
+  PRIVATE_ARGS(DOT11_OID_MPDUTXFAILED          ,MPDUTXFAILED           )
+  PRIVATE_ARGS(DOT11_OID_MPDURXSUCCESSFUL      ,MPDURXSUCCESS          )
+  PRIVATE_ARGS(DOT11_OID_MPDURXDUPS            ,MPDURXDUPS             )
+  PRIVATE_ARGS(DOT11_OID_RTSSUCCESSFUL         ,RTSSUCCESSFUL          )
+  PRIVATE_ARGS(DOT11_OID_RTSFAILED             ,RTSFAILED              )
+  PRIVATE_ARGS(DOT11_OID_ACKFAILED             ,ACKFAILED              )
+  PRIVATE_ARGS(DOT11_OID_FRAMERECEIVES         ,FRAMERECEIVES          )
+  PRIVATE_ARGS(DOT11_OID_FRAMEERRORS           ,FRAMEERRORS            )
+  PRIVATE_ARGS(DOT11_OID_FRAMEABORTS           ,FRAMEABORTS            )
+  PRIVATE_ARGS(DOT11_OID_FRAMEABORTSPHY                ,FRAMEABORTSPHY         )
+  PRIVATE_ARGS(DOT11_OID_SLOTTIME              ,SLOTTIME               )
+  PRIVATE_ARGS(DOT11_OID_CWMIN                 ,CWMIN                  )
+  PRIVATE_ARGS(DOT11_OID_CWMAX                 ,CWMAX                  )
+  PRIVATE_ARGS(DOT11_OID_ACKWINDOW             ,ACKWINDOW              )
+  PRIVATE_ARGS(DOT11_OID_ANTENNARX             ,ANTENNARX              )
+  PRIVATE_ARGS(DOT11_OID_ANTENNATX             ,ANTENNATX              )
+  PRIVATE_ARGS(DOT11_OID_ANTENNADIVERSITY      ,ANTENNADIVERS          )
+  PRIVATE_ARGS(DOT11_OID_CHANNEL               ,CHANNEL                )
+  PRIVATE_ARGS(DOT11_OID_EDTHRESHOLD           ,EDTHRESHOLD            )
+  
+  PRIVATE_ARGS(DOT11_OID_PREAMBLESETTINGS      ,PREAMBLE               )
+  PRIVATE_ARGS(DOT11_OID_CCAMODESUPPORTED      ,CCAMODESUPORTD         )
+  PRIVATE_ARGS(DOT11_OID_CCAMODE               ,CCAMODE                )
+  PRIVATE_ARGS(DOT11_OID_RSSIVECTOR            ,RSSIVECTOR             )
+  PRIVATE_ARGS(DOT11_OID_OUTPUTPOWERTABLE      ,OUTPUTPOWERTBL         )
+  PRIVATE_ARGS(DOT11_OID_OUTPUTPOWER           ,OUTPUTPOWER            )
+  PRIVATE_ARGS(DOT11_OID_FREQUENCY             ,FREQUENCY              )
+  PRIVATE_ARGS(DOT11_OID_NOISEFLOOR            ,NOISEFLOOR             )
+  PRIVATE_ARGS(DOT11_OID_NONERPPROTECTION      ,NONERPPROTECTN         )
+  PRIVATE_ARGS(DOT11_OID_SLOTSETTINGS          ,SLOTSETTINGS           )
+  PRIVATE_ARGS(DOT11_OID_NONERPTIMEOUT         ,NONERPTIMEOUT          )
+  PRIVATE_ARGS(DOT11_OID_PROFILES              ,PROFILES               )
+  PRIVATE_ARGS(DOT11_OID_NONERPSTATUS          ,NONERPSTATUS           )
+  PRIVATE_ARGS(DOT11_OID_STATIMEOUT            ,STATIMEOUT             )
+  PRIVATE_ARGS(DOT11_OID_MLMEAUTOLEVEL         ,MLMEAUTOLEVEL          )
+  PRIVATE_ARGS(DOT11_OID_BSSTIMEOUT            ,BSSTIMEOUT             )
+  PRIVATE_ARGS(DOT11_OID_BSSS                  ,BSSS                   )
+  PRIVATE_ARGS(OID_INL_MODE                    ,iMODE                  )
+  PRIVATE_ARGS(OID_INL_CONFIG                  ,iCONFIG                )
+  PRIVATE_ARGS(OID_INL_DOT11D_CONFORMANCE      ,iDOT11DCONFORM         )
+  PRIVATE_ARGS(OID_INL_PHYCAPABILITIES         ,iPHYCAPS               )
+  PRIVATE_ARGS(OID_INL_OUTPUTPOWER             ,iOUTPUTPOWER           )
 };
 
+static int prism54_set_u32(struct net_device *ndev,
+       struct iw_request_info *info, void *wrqu, char *extra)
+{
+        int *i = (int *) extra;
+        int rvalue = mgt_set_request((islpci_private *) ndev->priv,
+                                    i[0], 0, &i[1]);
+        return (rvalue ? rvalue : -EINPROGRESS);
+}
+
+static int prism54_get_u32(struct net_device *ndev,
+       struct iw_request_info *info, void *wrqu, char *extra)
+{
+        union oid_res_t r;
+        int *param = (int *) extra;
+        int rvalue = mgt_get_request((islpci_private *) ndev->priv,
+                            *param, 0, NULL, &r);
+        *param = r.u;
+        return rvalue;
+}
+
 static const iw_handler prism54_private_handler[] = {
        (iw_handler) prism54_reset,
        (iw_handler) prism54_get_beacon,
@@ -2029,6 +2155,9 @@
        (iw_handler) prism54_kick_all,
        (iw_handler) prism54_get_wpa,
        (iw_handler) prism54_set_wpa,
+       (iw_handler) NULL,
+       (iw_handler) prism54_set_u32,
+       (iw_handler) prism54_get_u32,
 };
 
 const struct iw_handler_def prism54_handler_def = {