emlxs_dhchap.c (e2ca2865) emlxs_dhchap.c (a9800beb)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 6 unchanged lines hidden (view full) ---

15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22/*
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 6 unchanged lines hidden (view full) ---

15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22/*
23 * Copyright 2009 Emulex. All rights reserved.
23 * Copyright 2010 Emulex. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27
28#include <emlxs.h>
29
30#ifdef DHCHAP_SUPPORT
31

--- 80 unchanged lines hidden (view full) ---

112 union challenge_val un_cval, uint8_t *dhval, uint32_t dhvallen);
113static fc_packet_t *emlxs_prep_els_fc_pkt(emlxs_port_t *port,
114 uint32_t d_id, uint32_t cmd_size, uint32_t rsp_size,
115 uint32_t datalen, int32_t sleepflag);
116
117static uint32_t *emlxs_hash_vrf(emlxs_port_t *port,
118 emlxs_port_dhc_t *port_dhc, NODELIST *ndlp, uint32_t tran_id,
119 union challenge_val un_cval);
24 * Use is subject to license terms.
25 */
26
27
28#include <emlxs.h>
29
30#ifdef DHCHAP_SUPPORT
31

--- 80 unchanged lines hidden (view full) ---

112 union challenge_val un_cval, uint8_t *dhval, uint32_t dhvallen);
113static fc_packet_t *emlxs_prep_els_fc_pkt(emlxs_port_t *port,
114 uint32_t d_id, uint32_t cmd_size, uint32_t rsp_size,
115 uint32_t datalen, int32_t sleepflag);
116
117static uint32_t *emlxs_hash_vrf(emlxs_port_t *port,
118 emlxs_port_dhc_t *port_dhc, NODELIST *ndlp, uint32_t tran_id,
119 union challenge_val un_cval);
120static void emlxs_md5_digest_to_hex(const uint8_t digest[MD5_LEN],
121 char *output);
122static void emlxs_sha1_digest_to_hex(const uint8_t digest[SHA1_LEN],
123 char *output);
124
120
121
125static BIG_ERR_CODE
126emlxs_interm_hash(emlxs_port_t *port, emlxs_port_dhc_t *port_dhc,
127 NODELIST *ndlp, void *hash_val, uint32_t tran_id,
128 union challenge_val un_cval, uint8_t *dhval, uint32_t *);
129
130static BIG_ERR_CODE
131emlxs_BIGNUM_get_pubkey(emlxs_port_t *port, emlxs_port_dhc_t *port_dhc,
132 NODELIST *ndlp, uint8_t *dhval, uint32_t *dhvallen,

--- 72 unchanged lines hidden (view full) ---

205emlxs_cmpl_auth_msg_dhchap_success_issue_wait4next(emlxs_port_t *port,
206 void *arg1, void *arg2, void *arg3, void *arg4, uint32_t evt);
207static uint32_t
208emlxs_rcv_auth_msg_dhchap_success_cmpl_wait4next(emlxs_port_t *port,
209 void *arg1, void *arg2, void *arg3, void *arg4, uint32_t evt);
210static uint32_t
211emlxs_cmpl_auth_msg_dhchap_success_cmpl_wait4next(emlxs_port_t *port,
212 void *arg1, void *arg2, void *arg3, void *arg4, uint32_t evt);
122static BIG_ERR_CODE
123emlxs_interm_hash(emlxs_port_t *port, emlxs_port_dhc_t *port_dhc,
124 NODELIST *ndlp, void *hash_val, uint32_t tran_id,
125 union challenge_val un_cval, uint8_t *dhval, uint32_t *);
126
127static BIG_ERR_CODE
128emlxs_BIGNUM_get_pubkey(emlxs_port_t *port, emlxs_port_dhc_t *port_dhc,
129 NODELIST *ndlp, uint8_t *dhval, uint32_t *dhvallen,

--- 72 unchanged lines hidden (view full) ---

202emlxs_cmpl_auth_msg_dhchap_success_issue_wait4next(emlxs_port_t *port,
203 void *arg1, void *arg2, void *arg3, void *arg4, uint32_t evt);
204static uint32_t
205emlxs_rcv_auth_msg_dhchap_success_cmpl_wait4next(emlxs_port_t *port,
206 void *arg1, void *arg2, void *arg3, void *arg4, uint32_t evt);
207static uint32_t
208emlxs_cmpl_auth_msg_dhchap_success_cmpl_wait4next(emlxs_port_t *port,
209 void *arg1, void *arg2, void *arg3, void *arg4, uint32_t evt);
213static uint32_t emlxs_device_rm_plogi_issue(emlxs_port_t *port, void *arg1,
214 void *arg2, void *arg3, void *arg4, uint32_t evt);
215static uint32_t emlxs_device_recov_plogi_issue(emlxs_port_t *port,
216 void *arg1, void *arg2, void *arg3, void *arg4, uint32_t evt);
217static uint32_t emlxs_device_rm_adisc_issue(emlxs_port_t *port, void *arg1,
218 void *arg2, void *arg3, void *arg4, uint32_t evt);
219static uint32_t emlxs_device_recov_adisc_issue(emlxs_port_t *port,
220 void *arg1, void *arg2, void *arg3, void *arg4, uint32_t evt);
221static uint32_t emlxs_device_rm_reglogin_issue(emlxs_port_t *port,
222 void *arg1, void *arg2, void *arg3, void *arg4, uint32_t evt);
223static uint32_t emlxs_device_recov_reglogin_issue(emlxs_port_t *port,
224 void *arg1, void *arg2, void *arg3, void *arg4, uint32_t evt);
225static uint32_t emlxs_device_rm_prli_issue(emlxs_port_t *port, void *arg1,
226 void *arg2, void *arg3, void *arg4, uint32_t evt);
227static uint32_t emlxs_device_recov_prli_issue(emlxs_port_t *port,
228 void *arg1, void *arg2, void *arg3, void *arg4, uint32_t evt);
210
211
229static uint32_t emlxs_device_recov_unmapped_node(emlxs_port_t *port,
230 void *arg1, void *arg2, void *arg3, void *arg4, uint32_t evt);
212static uint32_t emlxs_device_recov_unmapped_node(emlxs_port_t *port,
213 void *arg1, void *arg2, void *arg3, void *arg4, uint32_t evt);
231static uint32_t emlxs_device_recov_mapped_node(emlxs_port_t *port,
232 void *arg1, void *arg2, void *arg3, void *arg4, uint32_t evt);
233static uint32_t emlxs_device_rm_npr_node(emlxs_port_t *port, void *arg1,
234 void *arg2, void *arg3, void *arg4, uint32_t evt);
235static uint32_t emlxs_device_recov_npr_node(emlxs_port_t *port, void *arg1,
236 void *arg2, void *arg3, void *arg4, uint32_t evt);
237static uint32_t emlxs_device_rem_auth(emlxs_port_t *port, void *arg1,
238 void *arg2, void *arg3, void *arg4, uint32_t evt);
239static uint32_t emlxs_device_recov_auth(emlxs_port_t *port, void *arg1,
240 void *arg2, void *arg3, void *arg4, uint32_t evt);
241
214static uint32_t emlxs_device_rm_npr_node(emlxs_port_t *port, void *arg1,
215 void *arg2, void *arg3, void *arg4, uint32_t evt);
216static uint32_t emlxs_device_recov_npr_node(emlxs_port_t *port, void *arg1,
217 void *arg2, void *arg3, void *arg4, uint32_t evt);
218static uint32_t emlxs_device_rem_auth(emlxs_port_t *port, void *arg1,
219 void *arg2, void *arg3, void *arg4, uint32_t evt);
220static uint32_t emlxs_device_recov_auth(emlxs_port_t *port, void *arg1,
221 void *arg2, void *arg3, void *arg4, uint32_t evt);
222
223static uint8_t emlxs_null_wwn[8] =
224 {0, 0, 0, 0, 0, 0, 0, 0};
225static uint8_t emlxs_fabric_wwn[8] =
226 {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
242
243unsigned char dhgp1_pVal[] =
244{0xEE, 0xAF, 0x0A, 0xB9, 0xAD, 0xB3, 0x8D, 0xD6, 0x9C, 0x33, 0xF8, 0x0A, 0xFA,
2450x8F, 0xC5, 0xE8,
2460x60, 0x72, 0x61, 0x87, 0x75, 0xFF, 0x3C, 0x0B, 0x9E, 0xA2, 0x31, 0x4C, 0x9C,
2470x25, 0x65, 0x76,
2480xD6, 0x74, 0xDF, 0x74, 0x96, 0xEA, 0x81, 0xD3, 0x38, 0x3B, 0x48, 0x13, 0xD6,
2490x92, 0xC6, 0xE0,

--- 187 unchanged lines hidden (view full) ---

437
438 if ((state != NODE_STATE_NOCHANGE) && (node_dhc->state != state)) {
439 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcsp_state_msg,
440 "Node:0x%x %s --> %s", ndlp->nlp_DID,
441 emlxs_dhc_nstate_xlate(node_dhc->state),
442 emlxs_dhc_nstate_xlate(state));
443
444 node_dhc->prev_state = node_dhc->state;
227
228unsigned char dhgp1_pVal[] =
229{0xEE, 0xAF, 0x0A, 0xB9, 0xAD, 0xB3, 0x8D, 0xD6, 0x9C, 0x33, 0xF8, 0x0A, 0xFA,
2300x8F, 0xC5, 0xE8,
2310x60, 0x72, 0x61, 0x87, 0x75, 0xFF, 0x3C, 0x0B, 0x9E, 0xA2, 0x31, 0x4C, 0x9C,
2320x25, 0x65, 0x76,
2330xD6, 0x74, 0xDF, 0x74, 0x96, 0xEA, 0x81, 0xD3, 0x38, 0x3B, 0x48, 0x13, 0xD6,
2340x92, 0xC6, 0xE0,

--- 187 unchanged lines hidden (view full) ---

422
423 if ((state != NODE_STATE_NOCHANGE) && (node_dhc->state != state)) {
424 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcsp_state_msg,
425 "Node:0x%x %s --> %s", ndlp->nlp_DID,
426 emlxs_dhc_nstate_xlate(node_dhc->state),
427 emlxs_dhc_nstate_xlate(state));
428
429 node_dhc->prev_state = node_dhc->state;
445 node_dhc->state = state;
430 node_dhc->state = (uint16_t)state;
446
447 /* Perform common functions based on state */
448 switch (state) {
449 case NODE_STATE_UNKNOWN:
450 case NODE_STATE_AUTH_DISABLED:
451 node_dhc->nlp_authrsp_tmo = 0;
452 node_dhc->nlp_authrsp_tmocnt = 0;
453 emlxs_dhc_set_reauth_time(port, ndlp, DISABLE);

--- 3611 unchanged lines hidden (view full) ---

4065
4066 return (node_dhc->state);
4067
4068} /* emlxs_cmpl_auth_msg_dhchap_success_issue */
4069
4070
4071/* ARGSUSED */
4072static uint32_t
431
432 /* Perform common functions based on state */
433 switch (state) {
434 case NODE_STATE_UNKNOWN:
435 case NODE_STATE_AUTH_DISABLED:
436 node_dhc->nlp_authrsp_tmo = 0;
437 node_dhc->nlp_authrsp_tmocnt = 0;
438 emlxs_dhc_set_reauth_time(port, ndlp, DISABLE);

--- 3611 unchanged lines hidden (view full) ---

4050
4051 return (node_dhc->state);
4052
4053} /* emlxs_cmpl_auth_msg_dhchap_success_issue */
4054
4055
4056/* ARGSUSED */
4057static uint32_t
4073emlxs_device_rm_plogi_issue(
4074 emlxs_port_t *port,
4075 void *arg1,
4076 void *arg2,
4077 void *arg3,
4078 void *arg4,
4079 uint32_t evt)
4080{
4081 NODELIST *ndlp = (NODELIST *)arg4;
4082
4083 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcsp_error_msg,
4084 "device_rm_plogi_issue called. did=0x%x. Not implemented.",
4085 ndlp->nlp_DID);
4086
4087 return (0);
4088
4089} /* emlxs_device_rm_plogi_issue */
4090
4091
4092/* ARGSUSED */
4093static uint32_t
4094emlxs_device_recov_plogi_issue(
4095 emlxs_port_t *port,
4096 void *arg1,
4097 void *arg2,
4098 void *arg3,
4099 void *arg4,
4100 uint32_t evt)
4101{
4102 NODELIST *ndlp = (NODELIST *)arg4;
4103
4104 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcsp_error_msg,
4105 "emlxs_device_recov_plogi_issue called. 0x%x. Not implemented.",
4106 ndlp->nlp_DID);
4107
4108 return (0);
4109
4110} /* emlxs_device_recov_plogi_issue */
4111
4112
4113/* ARGSUSED */
4114static uint32_t
4115emlxs_device_rm_adisc_issue(
4116 emlxs_port_t *port,
4117 void *arg1,
4118 void *arg2,
4119 void *arg3,
4120 void *arg4,
4121 uint32_t evt)
4122{
4123 NODELIST *ndlp = (NODELIST *) arg4;
4124
4125 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcsp_error_msg,
4126 "emlxs_device_rm_adisc_issue called. 0x%x. Not implemented.",
4127 ndlp->nlp_DID);
4128
4129 return (0);
4130
4131} /* emlxs_device_rm_adisc_issue */
4132
4133
4134/* ARGSUSED */
4135static uint32_t
4136emlxs_device_recov_adisc_issue(
4137 emlxs_port_t *port,
4138 void *arg1,
4139 void *arg2,
4140 void *arg3,
4141 void *arg4,
4142 uint32_t evt)
4143{
4144 NODELIST *ndlp = (NODELIST *)arg4;
4145
4146 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcsp_error_msg,
4147 "emlxs_device_recov_adisc_issue called. 0x%x. Not implemented.",
4148 ndlp->nlp_DID);
4149
4150 return (0);
4151
4152} /* emlxs_device_recov_adisc_issue */
4153
4154
4155/* ARGSUSED */
4156static uint32_t
4157emlxs_device_rm_reglogin_issue(
4158 emlxs_port_t *port,
4159 void *arg1,
4160 void *arg2,
4161 void *arg3,
4162 void *arg4,
4163 uint32_t evt)
4164{
4165 NODELIST *ndlp = (NODELIST *)arg4;
4166
4167 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcsp_error_msg,
4168 "emlxs_device_rm_reglogin_issue called. 0x%x. Not implemented.",
4169 ndlp->nlp_DID);
4170
4171 return (0);
4172
4173} /* emlxs_device_rm_reglogin_issue */
4174
4175
4176/* ARGSUSED */
4177static uint32_t
4178emlxs_device_recov_reglogin_issue(
4179 emlxs_port_t *port,
4180 void *arg1,
4181 void *arg2,
4182 void *arg3,
4183 void *arg4,
4184 uint32_t evt)
4185{
4186 NODELIST *ndlp = (NODELIST *)arg4;
4187
4188 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcsp_error_msg,
4189 "emlxs_device_recov_reglogin_issue called. 0x%x. Not implemented.",
4190 ndlp->nlp_DID);
4191
4192 return (0);
4193
4194} /* emlxs_device_recov_reglogin_issue */
4195
4196
4197/* ARGSUSED */
4198static uint32_t
4199emlxs_device_rm_prli_issue(
4200 emlxs_port_t *port,
4201 void *arg1,
4202 void *arg2,
4203 void *arg3,
4204 void *arg4,
4205 uint32_t evt)
4206{
4207 NODELIST *ndlp = (NODELIST *)arg4;
4208
4209 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcsp_error_msg,
4210 "emlxs_device_rm_prli_issue called. 0x%x. Not implemented.",
4211 ndlp->nlp_DID);
4212
4213 return (0);
4214
4215} /* emlxs_device_rm_prli_issue */
4216
4217
4218/* ARGSUSED */
4219static uint32_t
4220emlxs_device_recov_prli_issue(
4221 emlxs_port_t *port,
4222 void *arg1,
4223 void *arg2,
4224 void *arg3,
4225 void *arg4,
4226 uint32_t evt)
4227{
4228 NODELIST *ndlp = (NODELIST *)arg4;
4229
4230 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcsp_error_msg,
4231 "emlxs_device_recov_prli_issue called. 0x%x. Not implemented.",
4232 ndlp->nlp_DID);
4233
4234 return (0);
4235
4236} /* emlxs_device_recov_prli_issue */
4237
4238/* ARGSUSED */
4239static uint32_t
4240emlxs_device_recov_unmapped_node(
4241 emlxs_port_t *port,
4242 void *arg1,
4243 void *arg2,
4244 void *arg3,
4245 void *arg4,
4246 uint32_t evt)
4247{
4248 NODELIST *ndlp = (NODELIST *)arg4;
4249
4250 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcsp_error_msg,
4251 "emlxs_device_recov_unmapped_node called. 0x%x. Not implemented.",
4252 ndlp->nlp_DID);
4253
4254 return (0);
4255
4256} /* emlxs_device_recov_unmapped_node */
4257
4058emlxs_device_recov_unmapped_node(
4059 emlxs_port_t *port,
4060 void *arg1,
4061 void *arg2,
4062 void *arg3,
4063 void *arg4,
4064 uint32_t evt)
4065{
4066 NODELIST *ndlp = (NODELIST *)arg4;
4067
4068 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcsp_error_msg,
4069 "emlxs_device_recov_unmapped_node called. 0x%x. Not implemented.",
4070 ndlp->nlp_DID);
4071
4072 return (0);
4073
4074} /* emlxs_device_recov_unmapped_node */
4075
4258/* ARGSUSED */
4259static uint32_t
4260emlxs_device_recov_mapped_node(
4261 emlxs_port_t *port,
4262 void *arg1,
4263 void *arg2,
4264 void *arg3,
4265 void *arg4,
4266 uint32_t evt)
4267{
4268 NODELIST *ndlp = (NODELIST *)arg4;
4269
4076
4270 EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_fcsp_error_msg,
4271 "emlxs_device_recov_mapped_node called. 0x%x. Not implemented.",
4272 ndlp->nlp_DID);
4273
4077
4274 return (0);
4275
4276} /* emlxs_device_recov_mapped_node */
4277
4278
4279/* ARGSUSED */
4280static uint32_t
4281emlxs_device_rm_npr_node(
4282 emlxs_port_t *port,
4283 void *arg1,
4284 void *arg2,
4285 void *arg3,
4286 void *arg4,

--- 919 unchanged lines hidden (view full) ---

5206 ReasonCodeExplanation);
5207 emlxs_dhc_auth_complete(port, ndlp, 1);
5208
5209 return (node_dhc->state);
5210
5211} /* emlxs_rcv_auth_msg_unmapped_node */
5212
5213
4078/* ARGSUSED */
4079static uint32_t
4080emlxs_device_rm_npr_node(
4081 emlxs_port_t *port,
4082 void *arg1,
4083 void *arg2,
4084 void *arg3,
4085 void *arg4,

--- 919 unchanged lines hidden (view full) ---

5005 ReasonCodeExplanation);
5006 emlxs_dhc_auth_complete(port, ndlp, 1);
5007
5008 return (node_dhc->state);
5009
5010} /* emlxs_rcv_auth_msg_unmapped_node */
5011
5012
5214void
5215emlxs_sha1_digest_to_hex(const uint8_t digest[SHA1_LEN], char *output)
5216{
5217 int i, j;
5218 char *c = output;
5219
5013
5220 for (i = 0; i < SHA1_LEN / 4; i++) {
5221 for (j = 0; j < 4; j++) {
5222 (void) sprintf(c, "%02X", digest[i * 4 + j]);
5223 c += 2;
5224 }
5225 (void) sprintf(c, " ");
5226 c += 1;
5227 }
5228 *(c - 1) = '\0';
5229
5014
5230} /* emlxs_sha1_digest_to_hex */
5231
5232
5233static void
5234emlxs_md5_digest_to_hex(const uint8_t digest[MD5_LEN], char *output)
5235{
5236 int i, j;
5237 char *c = output;
5238
5239 for (i = 0; i < MD5_LEN / 4; i++) {
5240 for (j = 0; j < 4; j++) {
5241 (void) sprintf(c, "%02X", digest[i * 4 + j]);
5242 c += 2;
5243 }
5244 (void) sprintf(c, " ");
5245 c += 1;
5246 }
5247 *(c - 1) = '\0';
5248
5249} /* emlxs_md5_digest_to_hex */
5250
5251
5252/*
5253 * emlxs_hash_vrf for verification only the host is the initiator in
5254 * the routine.
5255 */
5256/* ARGSUSED */
5257static uint32_t *
5258emlxs_hash_vrf(
5259 emlxs_port_t *port,

--- 2225 unchanged lines hidden (view full) ---

7485
7486static void
7487emlxs_dhc_auth_complete(
7488 emlxs_port_t *port,
7489 emlxs_node_t *ndlp,
7490 uint32_t status)
7491{
7492 emlxs_node_dhc_t *node_dhc = &ndlp->node_dhc;
5015/*
5016 * emlxs_hash_vrf for verification only the host is the initiator in
5017 * the routine.
5018 */
5019/* ARGSUSED */
5020static uint32_t *
5021emlxs_hash_vrf(
5022 emlxs_port_t *port,

--- 2225 unchanged lines hidden (view full) ---

7248
7249static void
7250emlxs_dhc_auth_complete(
7251 emlxs_port_t *port,
7252 emlxs_node_t *ndlp,
7253 uint32_t status)
7254{
7255 emlxs_node_dhc_t *node_dhc = &ndlp->node_dhc;
7493 emlxs_buf_t *sbp;
7494 fc_unsol_buf_t *ubp;
7495 uint32_t fabric;
7496 uint32_t fabric_switch;
7497
7498 fabric = ((ndlp->nlp_DID & FABRIC_DID_MASK) == FABRIC_DID_MASK) ? 1 : 0;
7499 fabric_switch = ((ndlp->nlp_DID == FABRIC_DID) ? 1 : 0);
7500
7501 EMLXS_MSGF(EMLXS_CONTEXT,
7502 &emlxs_fcsp_complete_msg,

--- 13 unchanged lines hidden (view full) ---

7516 /* Send a LOGO if authentication was not successful */
7517 if (status == 1) {
7518 EMLXS_MSGF(EMLXS_CONTEXT,
7519 &emlxs_fcsp_complete_msg,
7520 "Sending LOGO to did=0x%x...",
7521 ndlp->nlp_DID);
7522 emlxs_send_logo(port, ndlp->nlp_DID);
7523 }
7256 uint32_t fabric;
7257 uint32_t fabric_switch;
7258
7259 fabric = ((ndlp->nlp_DID & FABRIC_DID_MASK) == FABRIC_DID_MASK) ? 1 : 0;
7260 fabric_switch = ((ndlp->nlp_DID == FABRIC_DID) ? 1 : 0);
7261
7262 EMLXS_MSGF(EMLXS_CONTEXT,
7263 &emlxs_fcsp_complete_msg,

--- 13 unchanged lines hidden (view full) ---

7277 /* Send a LOGO if authentication was not successful */
7278 if (status == 1) {
7279 EMLXS_MSGF(EMLXS_CONTEXT,
7280 &emlxs_fcsp_complete_msg,
7281 "Sending LOGO to did=0x%x...",
7282 ndlp->nlp_DID);
7283 emlxs_send_logo(port, ndlp->nlp_DID);
7284 }
7524 /* If a packet is being held then complete it now */
7525 if ((sbp = (emlxs_buf_t *)node_dhc->deferred_sbp) != 0) {
7526 node_dhc->deferred_sbp = 0;
7527
7285
7528 if (status != 0) {
7529 /* Set error status */
7530 sbp->pkt_flags &= ~PACKET_STATE_VALID;
7531 emlxs_set_pkt_state(sbp, IOSTAT_LOCAL_REJECT,
7532 IOERR_NO_RESOURCES, 1);
7533 }
7534 emlxs_pkt_complete(sbp, -1, 0, 1);
7535 }
7536 /* If a buffer is being held then handle it now */
7537 if ((ubp = (fc_unsol_buf_t *)node_dhc->deferred_ubp) != 0) {
7538 node_dhc->deferred_ubp = 0;
7286 /* Process deferred cmpl now */
7287 emlxs_mb_deferred_cmpl(port, status,
7288 (emlxs_buf_t *)node_dhc->deferred_sbp,
7289 (fc_unsol_buf_t *)node_dhc->deferred_ubp, 0);
7539
7290
7540 if (status == 0) {
7541 emlxs_ub_callback(port, ubp);
7542 } else {
7543 (void) emlxs_ub_release(port, 1, &ubp->ub_token);
7544 }
7545 }
7291 node_dhc->deferred_sbp = 0;
7292 node_dhc->deferred_ubp = 0;
7293
7546 return;
7547
7548} /* emlxs_dhc_auth_complete */
7549
7550
7551extern void
7552emlxs_dhc_attach(emlxs_hba_t *hba)
7553{

--- 814 unchanged lines hidden (view full) ---

8368 } else {
8369 EMLXS_MSGF(EMLXS_CONTEXT,
8370 &emlxs_attach_debug_msg,
8371 "Cfg err: Invalid LWWPN found. %d %c",
8372 j, c1);
8373 errors++;
8374 }
8375
7294 return;
7295
7296} /* emlxs_dhc_auth_complete */
7297
7298
7299extern void
7300emlxs_dhc_attach(emlxs_hba_t *hba)
7301{

--- 814 unchanged lines hidden (view full) ---

8116 } else {
8117 EMLXS_MSGF(EMLXS_CONTEXT,
8118 &emlxs_attach_debug_msg,
8119 "Cfg err: Invalid LWWPN found. %d %c",
8120 j, c1);
8121 errors++;
8122 }
8123
8376 *np++ = sum;
8124 *np++ = (uint8_t)sum;
8377 }
8378
8379 if (*s++ != ':') {
8380 EMLXS_MSGF(EMLXS_CONTEXT,
8381 &emlxs_attach_debug_msg,
8382 "Cfg err: Invalid delimiter after LWWPN.");
8383 goto out;
8384 }

--- 25 unchanged lines hidden (view full) ---

8410 } else {
8411 EMLXS_MSGF(EMLXS_CONTEXT,
8412 &emlxs_attach_debug_msg,
8413 "Cfg err: Invalid RWWPN found. %d %c",
8414 j, c1);
8415 errors++;
8416 }
8417
8125 }
8126
8127 if (*s++ != ':') {
8128 EMLXS_MSGF(EMLXS_CONTEXT,
8129 &emlxs_attach_debug_msg,
8130 "Cfg err: Invalid delimiter after LWWPN.");
8131 goto out;
8132 }

--- 25 unchanged lines hidden (view full) ---

8158 } else {
8159 EMLXS_MSGF(EMLXS_CONTEXT,
8160 &emlxs_attach_debug_msg,
8161 "Cfg err: Invalid RWWPN found. %d %c",
8162 j, c1);
8163 errors++;
8164 }
8165
8418 *np++ = sum;
8166 *np++ = (uint8_t)sum;
8419 }
8420
8421 if (*s++ != ':') {
8422 EMLXS_MSGF(EMLXS_CONTEXT,
8423 &emlxs_attach_debug_msg,
8424 "Cfg err: Invalid delimiter after RWWPN.");
8425 goto out;
8426 }

--- 589 unchanged lines hidden (view full) ---

9016 } else {
9017 EMLXS_MSGF(EMLXS_CONTEXT,
9018 &emlxs_attach_debug_msg,
9019 "Cfg err: Invalid LWWPN found. %d %c",
9020 j, c1);
9021 errors++;
9022 }
9023
8167 }
8168
8169 if (*s++ != ':') {
8170 EMLXS_MSGF(EMLXS_CONTEXT,
8171 &emlxs_attach_debug_msg,
8172 "Cfg err: Invalid delimiter after RWWPN.");
8173 goto out;
8174 }

--- 589 unchanged lines hidden (view full) ---

8764 } else {
8765 EMLXS_MSGF(EMLXS_CONTEXT,
8766 &emlxs_attach_debug_msg,
8767 "Cfg err: Invalid LWWPN found. %d %c",
8768 j, c1);
8769 errors++;
8770 }
8771
9024 *np++ = sum;
8772 *np++ = (uint8_t)sum;
9025 }
9026
9027 if (*s++ != ':') {
9028 EMLXS_MSGF(EMLXS_CONTEXT,
9029 &emlxs_attach_debug_msg,
9030 "Cfg err: Invalid delimiter after LWWPN.");
9031 goto out;
9032 }

--- 25 unchanged lines hidden (view full) ---

9058 } else {
9059 EMLXS_MSGF(EMLXS_CONTEXT,
9060 &emlxs_attach_debug_msg,
9061 "Cfg err: Invalid RWWPN found. %d %c",
9062 j, c1);
9063 errors++;
9064 }
9065
8773 }
8774
8775 if (*s++ != ':') {
8776 EMLXS_MSGF(EMLXS_CONTEXT,
8777 &emlxs_attach_debug_msg,
8778 "Cfg err: Invalid delimiter after LWWPN.");
8779 goto out;
8780 }

--- 25 unchanged lines hidden (view full) ---

8806 } else {
8807 EMLXS_MSGF(EMLXS_CONTEXT,
8808 &emlxs_attach_debug_msg,
8809 "Cfg err: Invalid RWWPN found. %d %c",
8810 j, c1);
8811 errors++;
8812 }
8813
9066 *np++ = sum;
8814 *np++ = (uint8_t)sum;
9067 }
9068
9069 if (*s++ != ':') {
9070 EMLXS_MSGF(EMLXS_CONTEXT,
9071 &emlxs_attach_debug_msg,
9072 "Cfg err: Invalid delimiter after RWWPN.");
9073 goto out;
9074 }

--- 12 unchanged lines hidden (view full) ---

9087 &emlxs_attach_debug_msg,
9088 "Cfg err: Invalid lpwd type found. %c %d",
9089 c1, sum);
9090
9091 errors++;
9092 }
9093
9094 } while (*s != ':' && *s != 0);
8815 }
8816
8817 if (*s++ != ':') {
8818 EMLXS_MSGF(EMLXS_CONTEXT,
8819 &emlxs_attach_debug_msg,
8820 "Cfg err: Invalid delimiter after RWWPN.");
8821 goto out;
8822 }

--- 12 unchanged lines hidden (view full) ---

8835 &emlxs_attach_debug_msg,
8836 "Cfg err: Invalid lpwd type found. %c %d",
8837 c1, sum);
8838
8839 errors++;
8840 }
8841
8842 } while (*s != ':' && *s != 0);
9095 auth_key->local_password_type = sum;
8843 auth_key->local_password_type = (uint16_t)sum;
9096
9097 if (*s++ != ':') {
9098 EMLXS_MSGF(EMLXS_CONTEXT,
9099 &emlxs_attach_debug_msg,
9100 "Cfg err: Invalid delimiter after lpwd type.");
9101 goto out;
9102 }
9103 /* Read lpwd */

--- 34 unchanged lines hidden (view full) ---

9138 } else {
9139 EMLXS_MSGF(EMLXS_CONTEXT,
9140 &emlxs_attach_debug_msg,
9141 "Cfg err: Invalid lpwd found. %d %c",
9142 j, c1);
9143 errors++;
9144 }
9145
8844
8845 if (*s++ != ':') {
8846 EMLXS_MSGF(EMLXS_CONTEXT,
8847 &emlxs_attach_debug_msg,
8848 "Cfg err: Invalid delimiter after lpwd type.");
8849 goto out;
8850 }
8851 /* Read lpwd */

--- 34 unchanged lines hidden (view full) ---

8886 } else {
8887 EMLXS_MSGF(EMLXS_CONTEXT,
8888 &emlxs_attach_debug_msg,
8889 "Cfg err: Invalid lpwd found. %d %c",
8890 j, c1);
8891 errors++;
8892 }
8893
9146 *np++ = sum;
8894 *np++ = (uint8_t)sum;
9147 j++;
9148
9149 } while (*s != ':' && *s != 0);
9150
9151 break;
9152
9153 case 0: /* Ignore */
9154 case 3: /* Ignore */
9155 break;
9156
9157 default:
9158 EMLXS_MSGF(EMLXS_CONTEXT,
9159 &emlxs_attach_debug_msg,
9160 "Config error: Invalid lpwd type found. type=%x",
9161 auth_key->local_password_type);
9162
9163 errors++;
9164 goto out;
9165 }
8895 j++;
8896
8897 } while (*s != ':' && *s != 0);
8898
8899 break;
8900
8901 case 0: /* Ignore */
8902 case 3: /* Ignore */
8903 break;
8904
8905 default:
8906 EMLXS_MSGF(EMLXS_CONTEXT,
8907 &emlxs_attach_debug_msg,
8908 "Config error: Invalid lpwd type found. type=%x",
8909 auth_key->local_password_type);
8910
8911 errors++;
8912 goto out;
8913 }
9166 auth_key->local_password_length = j;
8914 auth_key->local_password_length = (uint16_t)j;
9167
9168 if (*s++ != ':') {
9169 EMLXS_MSGF(EMLXS_CONTEXT,
9170 &emlxs_attach_debug_msg,
9171 "Config error: Invalid delimiter after lpwd.");
9172 goto out;
9173 }
9174 /* Read rpwd type (%x) */

--- 11 unchanged lines hidden (view full) ---

9186 &emlxs_attach_debug_msg,
9187 "Config error: Invalid rpwd type found. %c %d",
9188 c1, sum);
9189
9190 errors++;
9191 }
9192
9193 } while (*s != ':' && *s != 0);
8915
8916 if (*s++ != ':') {
8917 EMLXS_MSGF(EMLXS_CONTEXT,
8918 &emlxs_attach_debug_msg,
8919 "Config error: Invalid delimiter after lpwd.");
8920 goto out;
8921 }
8922 /* Read rpwd type (%x) */

--- 11 unchanged lines hidden (view full) ---

8934 &emlxs_attach_debug_msg,
8935 "Config error: Invalid rpwd type found. %c %d",
8936 c1, sum);
8937
8938 errors++;
8939 }
8940
8941 } while (*s != ':' && *s != 0);
9194 auth_key->remote_password_type = sum;
8942 auth_key->remote_password_type = (uint16_t)sum;
9195
9196 if (*s++ != ':') {
9197 EMLXS_MSGF(EMLXS_CONTEXT,
9198 &emlxs_attach_debug_msg,
9199 "Config error: Invalid delimiter after rpwd type.");
9200 goto out;
9201 }
9202 /* Read rpwd */

--- 34 unchanged lines hidden (view full) ---

9237 } else {
9238 EMLXS_MSGF(EMLXS_CONTEXT,
9239 &emlxs_attach_debug_msg,
9240 "Cfg err: Invalid rpwd found. %d %c",
9241 j, c1);
9242 errors++;
9243 }
9244
8943
8944 if (*s++ != ':') {
8945 EMLXS_MSGF(EMLXS_CONTEXT,
8946 &emlxs_attach_debug_msg,
8947 "Config error: Invalid delimiter after rpwd type.");
8948 goto out;
8949 }
8950 /* Read rpwd */

--- 34 unchanged lines hidden (view full) ---

8985 } else {
8986 EMLXS_MSGF(EMLXS_CONTEXT,
8987 &emlxs_attach_debug_msg,
8988 "Cfg err: Invalid rpwd found. %d %c",
8989 j, c1);
8990 errors++;
8991 }
8992
9245 *np++ = sum;
8993 *np++ = (uint8_t)sum;
9246 j++;
9247
9248 } while (*s != ':' && *s != 0);
9249
9250 break;
9251
9252 case 0: /* Ignore */
9253 case 3: /* Ignore */
9254 break;
9255
9256 default:
9257 EMLXS_MSGF(EMLXS_CONTEXT,
9258 &emlxs_attach_debug_msg,
9259 "Cfg error: Invalid rpwd type found. type=%x",
9260 auth_key->remote_password_type);
9261
9262 errors++;
9263 goto out;
9264 }
8994 j++;
8995
8996 } while (*s != ':' && *s != 0);
8997
8998 break;
8999
9000 case 0: /* Ignore */
9001 case 3: /* Ignore */
9002 break;
9003
9004 default:
9005 EMLXS_MSGF(EMLXS_CONTEXT,
9006 &emlxs_attach_debug_msg,
9007 "Cfg error: Invalid rpwd type found. type=%x",
9008 auth_key->remote_password_type);
9009
9010 errors++;
9011 goto out;
9012 }
9265 auth_key->remote_password_length = j;
9013 auth_key->remote_password_length = (uint16_t)j;
9266
9267 if (errors) {
9268 goto out;
9269 }
9270 /* Verify values */
9271 if (auth_key->local_password_type == 0 ||
9272 auth_key->local_password_type > 3 ||
9273 auth_key->local_password_length == 0) {

--- 824 unchanged lines hidden ---
9014
9015 if (errors) {
9016 goto out;
9017 }
9018 /* Verify values */
9019 if (auth_key->local_password_type == 0 ||
9020 auth_key->local_password_type > 3 ||
9021 auth_key->local_password_length == 0) {

--- 824 unchanged lines hidden ---