This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / drivers / net / wireless / prism54 / oid_mgt.c
index 333926d..470466d 100644 (file)
@@ -28,6 +28,10 @@ const int frequency_list_bg[] = { 2412, 2417, 2422, 2427, 2432, 2437, 2442,
        2447, 2452, 2457, 2462, 2467, 2472, 2484
 };
 
+const int frequency_list_a[] = { 5170, 5180, 5190, 5200, 5210, 5220, 5230,
+       5240, 5260, 5280, 5300, 5320
+};
+
 int
 channel_of_freq(int f)
 {
@@ -37,8 +41,10 @@ channel_of_freq(int f)
                while ((c < 14) && (f != frequency_list_bg[c]))
                        c++;
                return (c >= 14) ? 0 : ++c;
-       } else if ((f >= (int) 5000) && (f <= (int) 6000)) {
-               return ( (f - 5000) / 5 );
+       } else if ((f >= (int) 5170) && (f <= (int) 5320)) {
+               while ((c < 12) && (f != frequency_list_a[c]))
+                       c++;
+               return (c >= 12) ? 0 : (c + 37);
        } else
                return 0;
 }
@@ -62,7 +68,7 @@ struct oid_t isl_oid[] = {
 
        /* 802.11 */
        OID_U32_C(DOT11_OID_BSSTYPE, 0x10000000),
-       OID_STRUCT_C(DOT11_OID_BSSID, 0x10000001, u8[6], OID_TYPE_RAW),
+       OID_STRUCT_C(DOT11_OID_BSSID, 0x10000001, u8[6], OID_TYPE_SSID),
        OID_STRUCT_C(DOT11_OID_SSID, 0x10000002, struct obj_ssid,
                     OID_TYPE_SSID),
        OID_U32(DOT11_OID_STATE, 0x10000003),
@@ -219,7 +225,7 @@ struct oid_t isl_oid[] = {
        OID_UNKNOWN(OID_INL_MEMORY, 0xFF020002),
        OID_U32_C(OID_INL_MODE, 0xFF020003),
        OID_UNKNOWN(OID_INL_COMPONENT_NR, 0xFF020004),
-       OID_STRUCT(OID_INL_VERSION, 0xFF020005, u8[8], OID_TYPE_RAW),
+       OID_UNKNOWN(OID_INL_VERSION, 0xFF020005),
        OID_UNKNOWN(OID_INL_INTERFACE_ID, 0xFF020006),
        OID_UNKNOWN(OID_INL_COMPONENT_ID, 0xFF020007),
        OID_U32_C(OID_INL_CONFIG, 0xFF020008),
@@ -408,7 +414,7 @@ int
 mgt_set_request(islpci_private *priv, enum oid_num_t n, int extra, void *data)
 {
        int ret = 0;
-       struct islpci_mgmtframe *response = NULL;
+       struct islpci_mgmtframe *response;
        int response_op = PIMFOR_OP_ERROR;
        int dlen;
        void *cache, *_data = data;
@@ -481,8 +487,6 @@ mgt_get_request(islpci_private *priv, enum oid_num_t n, int extra, void *data,
        BUG_ON(OID_NUM_LAST <= n);
        BUG_ON(extra > isl_oid[n].range);
 
-       res->ptr = NULL;
-
        if (!priv->mib)
                /* memory has been freed */
                return -1;
@@ -615,16 +619,14 @@ static enum oid_num_t commit_part2[] = {
        DOT11_OID_DEFKEYID,
        DOT11_OID_DOT1XENABLE,
        OID_INL_DOT11D_CONFORMANCE,
-       /* Do not initialize this - fw < 1.0.4.3 rejects it
        OID_INL_OUTPUTPOWER,
-       */
 };
 
 /* update the MAC addr. */
 static int
 mgt_update_addr(islpci_private *priv)
 {
-       struct islpci_mgmtframe *res = NULL;
+       struct islpci_mgmtframe *res;
        int ret;
 
        ret = islpci_mgt_transaction(priv->ndev, PIMFOR_OP_GET,
@@ -673,7 +675,7 @@ mgt_commit(islpci_private *priv)
 
 /* This will tell you if you are allowed to answer a mlme(ex) request .*/
 
-int
+inline int
 mgt_mlme_answer(islpci_private *priv)
 {
        u32 mlmeautolevel;
@@ -690,7 +692,7 @@ mgt_mlme_answer(islpci_private *priv)
                (mlmeautolevel >= DOT11_MLME_INTERMEDIATE));
 }
 
-enum oid_num_t
+inline enum oid_num_t
 mgt_oidtonum(u32 oid)
 {
        int i;
@@ -774,9 +776,8 @@ mgt_response_to_str(enum oid_num_t n, union oid_res_t *r, char *str)
        case OID_TYPE_SSID:{
                        struct obj_ssid *ssid = r->ptr;
                        return snprintf(str, PRIV_STR_SIZE,
-                                       "length=%u\noctets=%.*s\n",
-                                       ssid->length, ssid->length,
-                                       ssid->octets);
+                                       "length=%u\noctets=%s\n",
+                                       ssid->length, ssid->octets);
                }
                break;
        case OID_TYPE_KEY:{