[IBAL] Change CEP DREP API
authorleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Sun, 13 Jul 2008 08:52:24 +0000 (08:52 +0000)
committerleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Sun, 13 Jul 2008 08:52:24 +0000 (08:52 +0000)
The al_cep_drep API currently takes the ib_cm_drep_t structure.  This structure is passed in the IOCTL.  It has en embedded pointer that isn't used since the private data is copied into the IOCTL structure.

This patch removes the ib_cm_drep_t structure from the IOCTL structure, and passes the private data buffer and length in explicitly.

Signed-off-by: Fab Tillier <ftillier@microsoft.com>
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@1374 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

core/al/al_cm_cep.h
core/al/al_cm_qp.c
core/al/al_dev.h
core/al/kernel/al_cm_cep.c
core/al/kernel/al_proxy_cep.c
core/al/user/ual_cm_cep.c
inc/iba/ib_al_ioctl.h

index 10659b9..b4aad3f 100644 (file)
@@ -238,7 +238,8 @@ ib_api_status_t
 al_cep_drep(\r
        IN                              ib_al_handle_t                          h_al,\r
        IN                              net32_t                                         cid,\r
-       IN              const   ib_cm_drep_t* const                     p_cm_drep );\r
+       IN              const   uint8_t* const                          p_pdata OPTIONAL,\r
+       IN              const   uint8_t                                         pdata_len );\r
 \r
 \r
 ib_api_status_t\r
index 0966cb1..ae75442 100644 (file)
@@ -386,7 +386,7 @@ __proc_dconn_timeout(
 \r
 static void\r
 __proc_failed_send(\r
-       IN                              ib_qp_handle_t FUNC_PTR64                               h_qp,\r
+       IN                              ib_qp_handle_t                          h_qp,\r
        IN              const   ib_mad_t* const                         p_mad )\r
 {\r
        AL_ENTER( AL_DBG_CM );\r
@@ -1621,7 +1621,8 @@ ib_cm_drep(
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
-       status = al_cep_drep( h_cm_dreq.h_al, h_cm_dreq.cid, p_cm_drep );\r
+       status = al_cep_drep( h_cm_dreq.h_al, h_cm_dreq.cid,\r
+               p_cm_drep->p_drep_pdata, p_cm_drep->drep_length );\r
        switch( status )\r
        {\r
        case IB_INVALID_SETTING:\r
index 8c8cb02..1b9c9c8 100644 (file)
@@ -55,7 +55,7 @@
 #define AL_DEVICE_NAME L"\\Device\\ibal"\r
 #define        ALDEV_KEY               (0x3B)  /* Matches FILE_DEVICE_INFINIBAND from wdm.h */\r
 \r
-#define AL_IOCTL_VERSION                       (8)\r
+#define AL_IOCTL_VERSION                       (9)\r
 \r
 /* max number of devices with non-default pkey */\r
 #define        MAX_NUM_PKEY    16\r
index 6962bd7..d5cc4e2 100644 (file)
@@ -3393,6 +3393,7 @@ __complete_ndi_irp(
        ib_put_mad( p_mad );\r
 }\r
 \r
+\r
 /* Called with the CEP and CEP manager locks held */\r
 static ib_api_status_t\r
 __cep_queue_mad(\r
@@ -5827,7 +5828,8 @@ ib_api_status_t
 al_cep_drep(\r
        IN                              ib_al_handle_t                          h_al,\r
        IN                              net32_t                                         cid,\r
-       IN              const   ib_cm_drep_t* const                     p_cm_drep )\r
+       IN              const   uint8_t* const                          p_pdata OPTIONAL,\r
+       IN              const   uint8_t                                         pdata_len )\r
 {\r
        ib_api_status_t         status;\r
        kcep_t                          *p_cep;\r
@@ -5855,8 +5857,8 @@ al_cep_drep(
                if( status != IB_SUCCESS )\r
                        break;\r
 \r
-               status = __format_drep( p_cep, p_cm_drep->p_drep_pdata,\r
-                       p_cm_drep->drep_length, (mad_cm_drep_t*)p_mad->p_mad_buf );\r
+               status = __format_drep( p_cep, p_pdata,\r
+                       pdata_len, (mad_cm_drep_t*)p_mad->p_mad_buf );\r
                if( status != IB_SUCCESS )\r
                        break;\r
 \r
index 7691438..8afbf30 100644 (file)
@@ -718,10 +718,8 @@ proxy_cep_drep(
                return CL_INVALID_PARAMETER;\r
        }\r
 \r
-       p_ioctl->cm_drep.p_drep_pdata = p_ioctl->pdata;\r
-\r
        (*(ib_api_status_t*)cl_ioctl_out_buf( h_ioctl )) = al_cep_drep(\r
-               p_context->h_al, p_ioctl->cid, &p_ioctl->cm_drep );\r
+               p_context->h_al, p_ioctl->cid, p_ioctl->pdata, p_ioctl->pdata_len );\r
 \r
        *p_ret_bytes = sizeof(ib_api_status_t);\r
 \r
index dc4cd02..e404fff 100644 (file)
@@ -1196,7 +1196,8 @@ ib_api_status_t
 al_cep_drep(\r
        IN                              ib_al_handle_t                          h_al,\r
        IN                              net32_t                                         cid,\r
-       IN              const   ib_cm_drep_t* const                     p_cm_drep )\r
+       IN              const   uint8_t* const                          p_pdata OPTIONAL,\r
+       IN              const   uint8_t                                         pdata_len )\r
 {\r
        ib_api_status_t                 status;\r
        ual_cep_drep_ioctl_t    ioctl;\r
@@ -1210,26 +1211,23 @@ al_cep_drep(
                return IB_INVALID_HANDLE;\r
        }\r
 \r
-       if( !p_cm_drep )\r
-       {\r
-               AL_EXIT( AL_DBG_CM );\r
-               return IB_INVALID_HANDLE;\r
-       }\r
-    cl_memclr(&ioctl, sizeof(ioctl));\r
        ioctl.cid = cid;\r
-       ioctl.cm_drep = *p_cm_drep;\r
        /* Copy private data, if any. */\r
-       if( p_cm_drep->p_drep_pdata )\r
+       if( p_pdata )\r
        {\r
-               if( p_cm_drep->drep_length > IB_DREP_PDATA_SIZE )\r
+               if( pdata_len > IB_DREP_PDATA_SIZE )\r
                {\r
                        AL_PRINT_EXIT(TRACE_LEVEL_ERROR ,AL_DBG_ERROR,\r
                                ("private data larger than DREP private data.\n") );\r
                        return IB_INVALID_SETTING;\r
                }\r
 \r
-               cl_memcpy(\r
-                       ioctl.pdata, p_cm_drep->p_drep_pdata, p_cm_drep->drep_length );\r
+               cl_memcpy( ioctl.pdata, p_pdata, pdata_len );\r
+               ioctl.pdata_len = pdata_len;\r
+       }\r
+       else\r
+       {\r
+               ioctl.pdata_len = 0;\r
        }\r
 \r
        if( !DeviceIoControl( g_al_device, UAL_CEP_DREP, &ioctl,\r
index 2e4d0c9..b8f046b 100644 (file)
@@ -3030,7 +3030,7 @@ typedef struct _ual_cep_dreq_ioctl
 typedef struct _ual_cep_drep_ioctl\r
 {\r
        net32_t                                         cid;\r
-       ib_cm_drep_t                            cm_drep;\r
+       uint8_t                                         pdata_len;\r
        uint8_t                                         pdata[IB_DREP_PDATA_SIZE];\r
 \r
 }      ual_cep_drep_ioctl_t;\r