[IPoIB] This patch reuses ipoib_mac_from_general_guid and contains important bugfix...
[mirror/winof/.git] / ulp / ipoib / kernel / ipoib_driver.c
index 04fa5bb..0b2b40f 100644 (file)
@@ -150,6 +150,8 @@ typedef struct _IPOIB_REG_ENTRY
 \r
 IPOIB_REG_ENTRY HCARegTable[] = {\r
        // reg value name             If Required  Offset in parentr struct             Field size                  Default         Min     Max\r
+       {NDIS_STRING_CONST("GUIDMask"),         1, IPOIB_OFFSET(guid_mask),             IPOIB_SIZE(guid_mask),          0,          0,    MAX_GUID_MAX},\r
+       /* GUIDMask should be the first element */\r
        {NDIS_STRING_CONST("RqDepth"),          1, IPOIB_OFFSET(rq_depth),              IPOIB_SIZE(rq_depth),           512,        128,    1024},\r
        {NDIS_STRING_CONST("RqLowWatermark"),   0, IPOIB_OFFSET(rq_low_watermark),      IPOIB_SIZE(rq_low_watermark),   4,          2,      8},\r
        {NDIS_STRING_CONST("SqDepth"),          1, IPOIB_OFFSET(sq_depth),              IPOIB_SIZE(sq_depth),           512,        128,    1024},\r
@@ -160,16 +162,14 @@ IPOIB_REG_ENTRY HCARegTable[] = {
        {NDIS_STRING_CONST("RecvRatio"),        1, IPOIB_OFFSET(recv_pool_ratio),       IPOIB_SIZE(recv_pool_ratio),    1,          1,      10},\r
        {NDIS_STRING_CONST("PayloadMtu"),       1, IPOIB_OFFSET(payload_mtu),           IPOIB_SIZE(payload_mtu),        2044,       60,   4092},\r
        {NDIS_STRING_CONST("lso"),              0, IPOIB_OFFSET(lso),                   IPOIB_SIZE(lso),                0,          0,      1},\r
-       {NDIS_STRING_CONST("MCLeaveRescan"),    1, IPOIB_OFFSET(mc_leave_rescan),       IPOIB_SIZE(mc_leave_rescan),    260,        1,    3600},\r
-       {NDIS_STRING_CONST("GUIDMask"),         1, IPOIB_OFFSET(guid_mask),             IPOIB_SIZE(guid_mask),          0,          0,    MAX_GUID_MAX}\r
-       \r
+       {NDIS_STRING_CONST("MCLeaveRescan"),    1, IPOIB_OFFSET(mc_leave_rescan),       IPOIB_SIZE(mc_leave_rescan),    260,        1,    3600}\r
        \r
 };  \r
 \r
 #define IPOIB_NUM_REG_PARAMS (sizeof (HCARegTable) / sizeof(IPOIB_REG_ENTRY))\r
 \r
 \r
-static void\r
+void\r
 ipoib_create_log(\r
        NDIS_HANDLE h_adapter,\r
        UINT ind,\r
@@ -484,13 +484,13 @@ ipoib_unload(
 NDIS_STATUS\r
 ipoib_get_adapter_params(\r
        IN                              NDIS_HANDLE* const                      wrapper_config_context,\r
-       IN      OUT                     ipoib_adapter_t                         *p_adapter )\r
+       IN      OUT                     ipoib_adapter_t                         *p_adapter,\r
+       OUT                             PUCHAR                                          *p_mac,\r
+       OUT                             UINT                                            *p_len)\r
 {\r
        NDIS_STATUS                                             status;\r
        NDIS_HANDLE                                             h_config;\r
        NDIS_CONFIGURATION_PARAMETER    *p_param;\r
-       PUCHAR                                                  mac;\r
-       UINT                                                    len;\r
        UINT                            value;\r
        PIPOIB_REG_ENTRY                pRegEntry;\r
        UINT                            i;\r
@@ -598,26 +598,8 @@ ipoib_get_adapter_params(
                        p_adapter->params.rq_depth / p_adapter->params.rq_low_watermark;\r
 \r
        p_adapter->params.xfer_block_size = (sizeof(eth_hdr_t) + p_adapter->params.payload_mtu);\r
-       NdisReadNetworkAddress( &status, &mac, &len, h_config );\r
+       NdisReadNetworkAddress( &status, p_mac, p_len, h_config );\r
 \r
-       ETH_COPY_NETWORK_ADDRESS( p_adapter->params.conf_mac.addr, p_adapter->mac.addr );\r
-       /* If there is a NetworkAddress override in registry, use it */\r
-       if( (status == NDIS_STATUS_SUCCESS) && (len == HW_ADDR_LEN) )\r
-       {\r
-               if( ETH_IS_MULTICAST(mac) || ETH_IS_BROADCAST(mac) ||\r
-                       !ETH_IS_LOCALLY_ADMINISTERED(mac) )\r
-               {\r
-                       IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_INIT,\r
-                               ("Overriding NetworkAddress is invalid - "\r
-                               "%02x-%02x-%02x-%02x-%02x-%02x\n",\r
-                               mac[0], mac[1], mac[2],\r
-                               mac[3], mac[4], mac[5]) );\r
-               }\r
-               else\r
-               {\r
-                       ETH_COPY_NETWORK_ADDRESS( p_adapter->params.conf_mac.addr, mac );\r
-               }\r
-       }\r
 \r
        NdisCloseConfiguration( h_config );\r
 \r