[SRP] Handle both SRP I/O Classes, 0xFF from SRP spec r10, and
authorftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Fri, 29 Sep 2006 23:09:57 +0000 (23:09 +0000)
committerftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Fri, 29 Sep 2006 23:09:57 +0000 (23:09 +0000)
0x100 from SRP r15 onward.  The initiator and target port identifier
changed from GUID:ExtensionID to ExtensionID:GUID.

git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@509 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

ulp/srp/kernel/srp.h
ulp/srp/kernel/srp_connection.c
ulp/srp/kernel/srp_connection.h
ulp/srp/kernel/srp_hba.c
ulp/srp/kernel/srp_hca.c
ulp/srp/kernel/srp_hca.h
ulp/srp/kernel/srp_login_req.h
ulp/srp/kernel/srp_session.c
ulp/srp/kernel/srp_session.h

index d8c74f9..44317ea 100644 (file)
@@ -105,17 +105,18 @@ typedef struct _srp_req_sup_db_fmt
        uint8_t     flags; /* IDBD/DDBD */\r
 } PACK_SUFFIX srp_req_sup_db_fmt_t;\r
 \r
-typedef struct _srp_ib_init_port_id\r
+/*\r
+ * The SRP spec r10 defines the port identifiers as\r
+ * GUID:ExtensionID, while the SRP 2.0 spec defines them\r
+ * as ExtensionID:GUID.  Lucky for us the IO_CLASS in the\r
+ * IOC profile changed from 0xFF to 0x100.\r
+ */\r
+typedef struct _srp_ib_port_id\r
 {\r
-       ib_net64_t  guid;\r
-       uint64_t    id_extension;\r
-} PACK_SUFFIX srp_ib_init_port_id_t;\r
+       net64_t         field1;\r
+       net64_t         field2;\r
 \r
-typedef struct _srp_ib_targ_port_id\r
-{\r
-       ib_net64_t  io_ctrl_guid;\r
-       uint64_t    id_extension;\r
-} PACK_SUFFIX srp_ib_targ_port_id_t;\r
+} PACK_SUFFIX srp_ib_port_id_t;\r
 \r
 /* Allowable values for the MultiChannel Action field */\r
 typedef enum multi_channel_action_enum\r
@@ -135,8 +136,8 @@ typedef struct _srp_login_req
        uint8_t                 flags; /* MULTI-CHANNEL ACTION */\r
        uint8_t                 reserved3;\r
        uint8_t                 reserved4[4];\r
-       srp_ib_init_port_id_t   initiator_port_id;\r
-       srp_ib_targ_port_id_t   target_port_id;\r
+       srp_ib_port_id_t                initiator_port_id;\r
+       srp_ib_port_id_t                target_port_id;\r
 } PACK_SUFFIX srp_login_req_t;\r
 \r
 /* Allowable values for the MultiChannel Result field */\r
index 5c8ea0a..5f30fa6 100644 (file)
@@ -346,10 +346,8 @@ __srp_cm_dreq_cb(
                SRP_PRINT( TRACE_LEVEL_VERBOSE, SRP_DBG_DEBUG,\r
                        ("Creating New Session For Service Entry Index %d.\n",\r
                        p_hba->ioc_info.profile.num_svc_entries));\r
-               p_srp_session = srp_new_session( p_hba,\r
-                                                                                p_hba->ioc_info.profile.ioc_guid,\r
-                                                                                &p_hba->p_svc_entries[i],\r
-                                                                                &status );\r
+               p_srp_session = srp_new_session(\r
+                       p_hba, &p_hba->p_svc_entries[i], &status );\r
                if ( p_srp_session == NULL )\r
                {\r
                        status = IB_INSUFFICIENT_MEMORY;\r
@@ -753,18 +751,22 @@ exit:
 Initializes a connection structure\r
 \r
 @param p_connection   - pointer to the connection structure\r
+@param p_profile      - Pointer to IOC profile.\r
+@param ca_guid        - Local CA GUID to use in as initiator GUID.\r
+@param ext_id         - Initiator and target extension ID.\r
 @param p_path_rec     - pointer to the path to the target\r
-@param p_targ_port_id - pointer to the target port id to which we want to connect\r
 @param service_id     - service id to which we want to connect\r
 \r
 @return - always success (for now)\r
 */\r
 ib_api_status_t\r
 srp_init_connection(\r
-       IN OUT  srp_connection_t        *p_connection,\r
+       IN      OUT     srp_connection_t                *p_connection,\r
+       IN              ib_ioc_profile_t* const p_profile,\r
+       IN              net64_t                                 ca_guid,\r
+       IN              net64_t                                 ext_id,\r
        IN      ib_path_rec_t           *p_path_rec,\r
-       IN      srp_ib_targ_port_id_t   *p_targ_port_id,\r
-       IN      ib_net64_t              service_id )\r
+       IN              ib_net64_t                              service_id )\r
 {\r
        SRP_ENTER( SRP_DBG_PNP );\r
 \r
@@ -775,7 +777,25 @@ srp_init_connection(
        p_connection->state = SRP_NOT_CONNECTED;\r
 \r
        p_connection->p_path_rec = p_path_rec;\r
-       p_connection->targ_port_id = *p_targ_port_id;\r
+       switch( p_profile->io_class )\r
+       {\r
+       case 0xFF:\r
+               p_connection->init_port_id.field1 = ca_guid;\r
+               p_connection->init_port_id.field2 = ext_id;\r
+               p_connection->targ_port_id.field1 = p_profile->ioc_guid;\r
+               p_connection->targ_port_id.field2 = ext_id;\r
+               break;\r
+\r
+       case 0x0100:\r
+               p_connection->init_port_id.field1 = ext_id;\r
+               p_connection->init_port_id.field2 = ca_guid;\r
+               p_connection->targ_port_id.field1 = ext_id;\r
+               p_connection->targ_port_id.field2 = p_profile->ioc_guid;\r
+               break;\r
+\r
+       default:\r
+               return IB_INVALID_PARAMETER;\r
+       }\r
        p_connection->service_id = service_id;\r
        p_connection->send_queue_depth = SRP_DEFAULT_SEND_Q_DEPTH;\r
        p_connection->recv_queue_depth = SRP_DEFAULT_RECV_Q_DEPTH;\r
@@ -791,7 +811,6 @@ Orchestrates the processing required to connect to a target device
 \r
 @param p_connection        - pointer to the connection structure\r
 @param p_hca               - pointer to the hca structure used by this connection\r
-@param initiator_extension - value used for id_extension of the initiator port id\r
 @param send_msg_depth      - initial request limit delta value\r
 @param p_session           - context passed to callback functions\r
 \r
@@ -801,7 +820,6 @@ ib_api_status_t
 srp_connect(\r
        IN OUT  srp_connection_t    *p_connection,\r
        IN      srp_hca_t           *p_hca,\r
-       IN      uint64_t            initiator_extension,\r
        IN      uint8_t             send_msg_depth,\r
        IN      p_srp_session_t     p_session )\r
 {\r
@@ -810,9 +828,8 @@ srp_connect(
 \r
        SRP_ENTER( SRP_DBG_PNP );\r
 \r
-       p_connection->init_port_id.guid = p_hca->ca_guid;\r
-       p_connection->init_port_id.id_extension = initiator_extension;\r
-       p_connection->ioc_max_send_msg_size = cl_ntoh32 (p_session->p_hba->ioc_info.profile.send_msg_size);\r
+       p_connection->ioc_max_send_msg_size =\r
+               cl_ntoh32 (p_session->p_hba->ioc_info.profile.send_msg_size);\r
        p_connection->ioc_max_send_msg_depth = send_msg_depth;\r
        p_connection->reject_reason = 0;\r
 \r
index 3108fab..5cfab6f 100644 (file)
@@ -71,8 +71,8 @@ typedef struct _srp_connection
        ib_qp_handle_t          h_qp;\r
 \r
        ib_path_rec_t           *p_path_rec;\r
-       srp_ib_init_port_id_t   init_port_id;\r
-       srp_ib_targ_port_id_t   targ_port_id;\r
+       srp_ib_port_id_t                init_port_id;\r
+       srp_ib_port_id_t                targ_port_id;\r
        ib_net64_t              service_id;\r
 \r
        uint32_t                send_queue_depth;\r
@@ -99,15 +99,16 @@ typedef struct _srp_connection
 ib_api_status_t\r
 srp_init_connection(\r
        IN OUT  srp_connection_t        *p_connection,\r
+       IN              ib_ioc_profile_t* const p_profile,\r
+       IN              net64_t                                 ca_guid,\r
+       IN              net64_t                                 ext_id,\r
        IN      ib_path_rec_t           *p_path_rec,\r
-       IN      srp_ib_targ_port_id_t   *p_targ_port_id,\r
        IN      ib_net64_t              service_id );\r
 \r
 ib_api_status_t\r
 srp_connect(\r
        IN OUT  srp_connection_t    *p_connection,\r
        IN      srp_hca_t           *p_hca,\r
-       IN      uint64_t            initiator_extension,\r
        IN      uint8_t             send_msg_depth,\r
        IN      p_srp_session_t     p_session );\r
 \r
index dbcad9e..5de880b 100644 (file)
@@ -246,12 +246,9 @@ srp_hba_create(
        ib_status = p_hba->ifc.open_al( &p_hba->h_al );\r
        if( ib_status != IB_SUCCESS )\r
        {\r
-               SRP_PRINT( TRACE_LEVEL_VERBOSE, SRP_DBG_DEBUG,\r
-                       ("HBA Object ref_cnt = %d\n", p_hba->obj.ref_cnt) );\r
-               cl_obj_destroy( &p_hba->obj );\r
                SRP_PRINT_EXIT( TRACE_LEVEL_ERROR, SRP_DBG_ERROR,\r
                        ("ib_open_al returned %s\n", p_hba->ifc.get_err_str( ib_status )) );\r
-               return ib_status;\r
+               goto err;\r
        }\r
 \r
        /* Register for IOC events */\r
@@ -266,11 +263,27 @@ srp_hba_create(
        ib_status = p_hba->ifc.reg_pnp( p_hba->h_al, &pnp_req, &p_hba->h_pnp );\r
        if( ib_status != IB_SUCCESS )\r
        {\r
+               SRP_PRINT_EXIT( TRACE_LEVEL_ERROR, SRP_DBG_ERROR,\r
+                       ("ib_reg_pnp returned %s\n", p_hba->ifc.get_err_str( ib_status )) );\r
+               goto err;\r
+       }\r
+       ib_status = IB_ERROR;\r
+       for ( i = 0; i < p_hba->ioc_info.profile.num_svc_entries; i++ )\r
+       {\r
+               if ( p_hba->session_list[i] != NULL )\r
+                       ib_status = IB_SUCCESS;\r
+       }\r
+       \r
+       if( ib_status != IB_SUCCESS )\r
+       {\r
+               SRP_PRINT( TRACE_LEVEL_ERROR, SRP_DBG_ERROR,\r
+                       ("Session Connection Failure.\n") );\r
+\r
+err:\r
                SRP_PRINT( TRACE_LEVEL_VERBOSE, SRP_DBG_DEBUG,\r
                        ("HBA Object ref_cnt = %d\n", p_hba->obj.ref_cnt) );\r
                cl_obj_destroy( &p_hba->obj );\r
-               SRP_PRINT_EXIT( TRACE_LEVEL_ERROR, SRP_DBG_ERROR,\r
-                       ("ib_reg_pnp returned %s\n", p_hba->ifc.get_err_str( ib_status )) );\r
+\r
                return ib_status;\r
        }\r
 \r
@@ -280,18 +293,6 @@ srp_hba_create(
         */\r
        p_ext->p_hba = p_hba;\r
 \r
-       if ( p_hba->session_list[0] == NULL )\r
-       {\r
-               p_ext->p_hba = NULL;\r
-               SRP_PRINT( TRACE_LEVEL_VERBOSE, SRP_DBG_DEBUG,\r
-                       ("HBA Object ref_cnt = %d\n", p_hba->obj.ref_cnt) );\r
-               cl_obj_destroy( &p_hba->obj );\r
-\r
-               SRP_PRINT( TRACE_LEVEL_ERROR, SRP_DBG_ERROR,\r
-                       ("Session Connection Failure.\n") );\r
-               ib_status = IB_ERROR;\r
-       }\r
-\r
        SRP_EXIT( SRP_DBG_PNP );\r
        return ib_status;\r
 }\r
@@ -720,15 +721,31 @@ __srp_connect_sessions(
        uint32_t        i;\r
        srp_session_t   *p_session;\r
        ib_api_status_t status = IB_ERROR;\r
+       BOOLEAN any_ioc_connected = FALSE;\r
 \r
        SRP_ENTER( SRP_DBG_PNP );\r
 \r
        /* Create the session(s). */\r
        for ( i = 0; i < p_hba->ioc_info.profile.num_svc_entries; i++ )\r
        {\r
-               BOOLEAN any_ioc_connected = FALSE;\r
                int     retry_count = 0;\r
 \r
+               SRP_PRINT( TRACE_LEVEL_VERBOSE, SRP_DBG_DEBUG,\r
+                       ("Creating New Session For Service Entry Index %d.\n",\r
+                       p_hba->ioc_info.profile.num_svc_entries));\r
+\r
+               p_session = srp_new_session(\r
+                       p_hba, &p_hba->p_svc_entries[i], &status );\r
+               if( p_session == NULL )\r
+               {\r
+                       status = IB_INSUFFICIENT_MEMORY;\r
+                       continue;\r
+               }\r
+\r
+               SRP_PRINT( TRACE_LEVEL_VERBOSE, SRP_DBG_DEBUG,\r
+                       ("New Session For Service Entry Index %d Created.\n",\r
+                       p_hba->ioc_info.profile.num_svc_entries));\r
+\r
                do\r
                {\r
                        retry_count++;\r
@@ -737,23 +754,6 @@ __srp_connect_sessions(
                                ("Attempting to connect %s. Connection Attempt Count = %d.\n",\r
                                 p_hba->ioc_info.profile.id_string,\r
                                 retry_count) );\r
-\r
-                       SRP_PRINT( TRACE_LEVEL_VERBOSE, SRP_DBG_DEBUG,\r
-                               ("Creating New Session For Service Entry Index %d.\n",\r
-                               p_hba->ioc_info.profile.num_svc_entries));\r
-                       p_session = srp_new_session( p_hba,\r
-                                                                                p_hba->ioc_info.profile.ioc_guid,\r
-                                                                                &p_hba->p_svc_entries[i],\r
-                                                                                &status );\r
-                       if ( p_session == NULL )\r
-                       {\r
-                               status = IB_INSUFFICIENT_MEMORY;\r
-                               break;\r
-                       }\r
-\r
-                       SRP_PRINT( TRACE_LEVEL_VERBOSE, SRP_DBG_DEBUG,\r
-                               ("New Session For Service Entry Index %d Created.\n",\r
-                               p_hba->ioc_info.profile.num_svc_entries));\r
                        SRP_PRINT( TRACE_LEVEL_VERBOSE, SRP_DBG_DEBUG,\r
                                ("Logging Into Session.\n"));\r
                        status = srp_session_login( p_session );\r
@@ -788,24 +788,28 @@ __srp_connect_sessions(
                        {\r
                                SRP_PRINT( TRACE_LEVEL_ERROR, SRP_DBG_ERROR,\r
                                        ("Session Login Failure Status = %d.\n", status));\r
-                               SRP_PRINT( TRACE_LEVEL_VERBOSE, SRP_DBG_DEBUG,\r
-                                       ("Session Object ref_cnt = %d\n", p_session->obj.ref_cnt) );\r
-                               cl_obj_destroy( &p_session->obj );\r
                        }\r
                } while ( (status != IB_SUCCESS) && (retry_count < 3) );\r
 \r
-               if ( any_ioc_connected == TRUE )\r
+               if( status != IB_SUCCESS )\r
                {\r
-                       status = IB_SUCCESS;\r
-                       if ( p_hba->adapter_paused == TRUE )\r
-                       {\r
-                               SRP_PRINT( TRACE_LEVEL_INFORMATION, SRP_DBG_DEBUG,\r
-                                       ("Resuming Adapter for %s.\n",\r
-                                       p_hba->ioc_info.profile.id_string) );\r
-                               p_hba->adapter_paused = FALSE;\r
-                               StorPortReady( p_hba->p_ext );\r
-//                             StorPortNotification( BusChangeDetected, p_hba->p_ext, 0 );\r
-                       }\r
+                       SRP_PRINT( TRACE_LEVEL_VERBOSE, SRP_DBG_DEBUG,\r
+                               ("Session Object ref_cnt = %d\n", p_session->obj.ref_cnt) );\r
+                       cl_obj_destroy( &p_session->obj );\r
+               }\r
+       }\r
+\r
+       if ( any_ioc_connected == TRUE )\r
+       {\r
+               status = IB_SUCCESS;\r
+               if ( p_hba->adapter_paused == TRUE )\r
+               {\r
+                       SRP_PRINT( TRACE_LEVEL_INFORMATION, SRP_DBG_DEBUG,\r
+                               ("Resuming Adapter for %s.\n",\r
+                               p_hba->ioc_info.profile.id_string) );\r
+                       p_hba->adapter_paused = FALSE;\r
+                       StorPortReady( p_hba->p_ext );\r
+                       //StorPortNotification( BusChangeDetected, p_hba->p_ext, 0 );\r
                }\r
        }\r
 \r
index 5f0f2ff..732bbeb 100644 (file)
 /* Amount of physical memory to register. */\r
 #define MEM_REG_SIZE    0xFFFFFFFFFFFFFFFF\r
 \r
-/* srp_open_ca_by_port_gid */\r
+/* srp_open_ca */\r
 /*!\r
-Open the channel adapter associated with the port gid\r
+Open the channel adapter associated with the SRP initiator\r
 Allocates a protection domain and\r
 Registers all of physical memory\r
 \r
 @param p_hca      - pointer to the hca structure\r
-@param h_al       - handle to the ib access layer\r
-@param p_port_gid - pointer to port gid used to find the ca\r
 @param p_context  - context pointer passed back to callback functions\r
 \r
 @return - result of operation\r
 */\r
 ib_api_status_t\r
-srp_open_ca_by_port_gid(\r
+srp_open_ca(\r
        IN OUT  srp_hca_t               *p_hca,\r
-       IN      ib_al_handle_t          h_al,\r
-       IN      ib_gid_t                *p_port_gid,\r
        IN      void                    *p_context )\r
 {\r
        ib_api_status_t     status;\r
@@ -70,17 +66,9 @@ srp_open_ca_by_port_gid(
 \r
        SRP_ENTER( SRP_DBG_PNP );\r
 \r
-       status = p_hca->p_hba->ifc.get_ca_by_gid(\r
-               h_al, p_port_gid, &p_hca->ca_guid );\r
-       if ( status != IB_SUCCESS )\r
-       {\r
-               SRP_PRINT( TRACE_LEVEL_ERROR, SRP_DBG_ERROR,\r
-                       ("Failed to locate Channel Adapter. Status = %d\n", status) );\r
-               goto exit;\r
-       }\r
-\r
-       status = p_hca->p_hba->ifc.open_ca( h_al, p_hca->ca_guid,\r
-               srp_async_event_handler_cb, p_context, &p_hca->h_ca );\r
+       status = p_hca->p_hba->ifc.open_ca( p_hca->p_hba->h_al,\r
+               p_hca->p_hba->info.ca_guid, srp_async_event_handler_cb,\r
+               p_context, &p_hca->h_ca );\r
        if ( status != IB_SUCCESS )\r
        {\r
                SRP_PRINT( TRACE_LEVEL_ERROR, SRP_DBG_ERROR,\r
index 2c6e4b1..c47f965 100644 (file)
@@ -42,7 +42,6 @@ typedef struct _srp_hca
 {\r
        srp_hba_t                               *p_hba;\r
 \r
-       ib_net64_t                              ca_guid;\r
        ib_ca_handle_t                  h_ca;\r
        ib_pd_handle_t                  h_pd;\r
        ib_mr_handle_t                  h_mr;\r
@@ -53,11 +52,9 @@ typedef struct _srp_hca
 }      srp_hca_t;\r
 \r
 ib_api_status_t\r
-srp_open_ca_by_port_gid(\r
+srp_open_ca(\r
        IN      OUT                     srp_hca_t                                       *p_hca,\r
-       IN                              ib_al_handle_t                          h_al,\r
-       IN                              ib_gid_t                                        *p_port_gid,\r
-       IN                              void                                                    *p_context );\r
+       IN                              void                                            *p_context );\r
 \r
 void\r
 srp_close_ca(\r
index 871b5d9..24487ba 100644 (file)
@@ -146,44 +146,6 @@ set_srp_login_request_multi_channel_action(
        p_information_unit->flags |= multi_channel_action;\r
 }\r
 \r
-/* set_Srp_login_request_initiator_port_id */\r
-/*!\r
-Sets the initiator's port id value portion of the I_T nexus value\r
-\r
-@param p_information_unit - pointer to the IU structure\r
-@param pinitiatorPortId - initiator's port id value\r
-\r
-@return - none\r
-*/\r
-static inline\r
-void\r
-set_Srp_login_request_initiator_port_id(\r
-       IN OUT  srp_login_req_t         *p_information_unit,\r
-       IN      srp_ib_init_port_id_t   *p_initiator_port_id )\r
-{\r
-       p_information_unit->initiator_port_id.guid         = p_initiator_port_id->guid;\r
-       p_information_unit->initiator_port_id.id_extension = p_initiator_port_id->id_extension;\r
-}\r
-\r
-/* set_srp_login_request_target_port_id */\r
-/*!\r
-Sets the target's port id value portion of the I_T nexus value\r
-\r
-@param p_information_unit - pointer to the IU structure\r
-@param p_target_port_id   - target's port id value\r
-\r
-@return - none\r
-*/\r
-static inline\r
-void\r
-set_srp_login_request_target_port_id(\r
-       IN OUT  srp_login_req_t         *p_information_unit,\r
-       IN      srp_ib_targ_port_id_t   *p_target_port_id )\r
-{\r
-       p_information_unit->target_port_id.io_ctrl_guid = p_target_port_id->io_ctrl_guid;\r
-       p_information_unit->target_port_id.id_extension = p_target_port_id->id_extension;\r
-}\r
-\r
 /* setSrpLoginRequestITNexus */\r
 /*!\r
 Sets the I_T nexus value\r
@@ -198,11 +160,13 @@ static inline
 void\r
 set_srp_login_request_it_nexus(\r
        IN OUT  srp_login_req_t         *p_information_unit,\r
-       IN      srp_ib_init_port_id_t   *p_initiator_port_id,\r
-       IN      srp_ib_targ_port_id_t   *p_target_port_id )\r
+       IN      srp_ib_port_id_t                *p_initiator_port_id,\r
+       IN      srp_ib_port_id_t                *p_target_port_id )\r
 {\r
-       set_Srp_login_request_initiator_port_id( p_information_unit, p_initiator_port_id );\r
-       set_srp_login_request_target_port_id( p_information_unit, p_target_port_id );\r
+       RtlCopyMemory( &p_information_unit->initiator_port_id,\r
+               p_initiator_port_id, sizeof(srp_ib_port_id_t) );\r
+       RtlCopyMemory( &p_information_unit->target_port_id,\r
+               p_target_port_id, sizeof(srp_ib_port_id_t) );\r
 }\r
 \r
 /* setup_srp_login_request */\r
@@ -227,8 +191,8 @@ setup_srp_login_request(
        IN      uint32_t                        req_max_init_to_targ_iu,\r
        IN      DATA_BUFFER_DESCRIPTOR_FORMAT   data_buffer_descriptor_formats,\r
        IN      MULTI_CHANNEL_ACTION            multi_channel_action,\r
-       IN      srp_ib_init_port_id_t           *p_initiator_port_id,\r
-       IN      srp_ib_targ_port_id_t           *p_target_port_id )\r
+       IN      srp_ib_port_id_t                                *p_initiator_port_id,\r
+       IN      srp_ib_port_id_t                                *p_target_port_id )\r
 {\r
        init_srp_login_request( p_information_unit, iu_tag );\r
        set_srp_login_request_req_max_init_to_targ_iu( p_information_unit, req_max_init_to_targ_iu );\r
@@ -323,7 +287,7 @@ Returns the initiator port identifier
 @return - pointer to initiator port id value\r
 */\r
 static inline\r
-srp_ib_init_port_id_t*\r
+srp_ib_port_id_t*\r
 get_srp_login_request_initiator_port_id(\r
        IN  srp_login_req_t *p_information_unit )\r
 {\r
@@ -339,7 +303,7 @@ Returns the target port identifier
 @return - pointer to target port id value\r
 */\r
 static inline\r
-srp_ib_targ_port_id_t*\r
+srp_ib_port_id_t*\r
 get_srp_login_request_target_port_id(\r
        IN  srp_login_req_t *p_information_unit )\r
 {\r
@@ -378,8 +342,6 @@ set_srp_login_request_from_host_to_network(
 {\r
        set_srp_information_unit_from_host_to_network( ( srp_information_unit_t* ) p_information_unit );\r
        p_information_unit->req_max_init_to_targ_iu        = cl_hton32( p_information_unit->req_max_init_to_targ_iu );\r
-       p_information_unit->initiator_port_id.id_extension = cl_hton64( p_information_unit->initiator_port_id.id_extension );\r
-       p_information_unit->target_port_id.id_extension    = cl_hton64( p_information_unit->target_port_id.id_extension );\r
 }\r
 \r
 /* set_srp_login_request_from_network_to_host */\r
index 69a3a45..ffeb7c7 100644 (file)
@@ -210,6 +210,9 @@ __srp_validate_service_entry(
                multiplier <<= 4;\r
        }\r
 \r
+       /* Swap to network order now. */\r
+       *p_target_id_extension = cl_hton64( *p_target_id_extension );\r
+\r
 exit:\r
        SRP_EXIT( SRP_DBG_PNP );\r
 \r
@@ -230,14 +233,12 @@ Allocates and initializes a session structure and it's sub-structures
 srp_session_t*\r
 srp_new_session(\r
        IN      srp_hba_t       *p_hba,\r
-       IN      ib_net64_t      ioc_guid,\r
        IN      ib_svc_entry_t  *p_svc_entry,\r
        OUT     ib_api_status_t *p_status )\r
 {\r
-       uint64_t                target_id_extension;\r
-       srp_session_t           *p_srp_session = NULL;\r
-       srp_ib_targ_port_id_t   targ_port_id;\r
-       cl_status_t             cl_status;\r
+       uint64_t                                target_id_extension;\r
+       srp_session_t                   *p_srp_session = NULL;\r
+       cl_status_t                             cl_status;\r
 \r
        SRP_ENTER( SRP_DBG_PNP );\r
 \r
@@ -258,12 +259,11 @@ srp_new_session(
 \r
        p_srp_session->p_hba = p_hba;\r
 \r
-       targ_port_id.io_ctrl_guid = ioc_guid;\r
-       targ_port_id.id_extension = target_id_extension;\r
-\r
        *p_status = srp_init_connection( &p_srp_session->connection,\r
+                                                                       &p_hba->ioc_info.profile,\r
+                                                                       p_hba->info.ca_guid,\r
+                                                                       target_id_extension,\r
                                                                         &p_hba->p_srp_path_record->path_rec,\r
-                                                                        &targ_port_id,\r
                                                                         p_svc_entry->id );\r
        if ( *p_status != IB_SUCCESS )\r
        {\r
@@ -331,16 +331,12 @@ srp_session_login(
                goto exit;\r
        }\r
 \r
-       status = srp_open_ca_by_port_gid( &p_srp_session->hca,\r
-                                                                         p_srp_session->p_hba->h_al,\r
-                                                                         &p_srp_session->p_hba->p_srp_path_record->path_rec.sgid,\r
-                                                                         p_srp_session );\r
+       status = srp_open_ca( &p_srp_session->hca, p_srp_session );\r
        if ( status != IB_SUCCESS )\r
                goto exit;\r
 \r
        status = srp_connect( &p_srp_session->connection,\r
                                                  &p_srp_session->hca,\r
-                                                 1, /* initiator_extension */\r
                                                  (uint8_t)p_srp_session->p_hba->ioc_info.profile.send_msg_depth,\r
                                                  p_srp_session );\r
 \r
index dfab555..1da558d 100644 (file)
@@ -63,7 +63,6 @@ typedef struct _srp_session
 srp_session_t*\r
 srp_new_session(\r
        IN      srp_hba_t       *p_hba,\r
-       IN      ib_net64_t      ioc_guid,\r
        IN      ib_svc_entry_t  *p_svc_entry,\r
        OUT     ib_api_status_t *p_status );\r
 \r