bfa_fcbuild.c (6a18b1675fdf08a6dc861e39c3f94309a03e7f16) | bfa_fcbuild.c (ba816ea8e2eacbf3d198ad1859f413c2d6213434) |
---|---|
1/* 2 * Copyright (c) 2005-2010 Brocade Communications Systems, Inc. 3 * All rights reserved 4 * www.brocade.com 5 * 6 * Linux driver for Brocade Fibre Channel Host Bus Adapter. 7 * 8 * This program is free software; you can redistribute it and/or modify it --- 80 unchanged lines hidden (view full) --- 89 ba_acc_tmpl.low_seq_cnt = 0; 90 ba_acc_tmpl.high_seq_cnt = 0xFFFF; 91 92 /* 93 * plogi_tmpl 94 */ 95 plogi_tmpl.csp.verhi = FC_PH_VER_PH_3; 96 plogi_tmpl.csp.verlo = FC_PH_VER_4_3; | 1/* 2 * Copyright (c) 2005-2010 Brocade Communications Systems, Inc. 3 * All rights reserved 4 * www.brocade.com 5 * 6 * Linux driver for Brocade Fibre Channel Host Bus Adapter. 7 * 8 * This program is free software; you can redistribute it and/or modify it --- 80 unchanged lines hidden (view full) --- 89 ba_acc_tmpl.low_seq_cnt = 0; 90 ba_acc_tmpl.high_seq_cnt = 0xFFFF; 91 92 /* 93 * plogi_tmpl 94 */ 95 plogi_tmpl.csp.verhi = FC_PH_VER_PH_3; 96 plogi_tmpl.csp.verlo = FC_PH_VER_4_3; |
97 plogi_tmpl.csp.bbcred = bfa_os_htons(0x0004); | 97 plogi_tmpl.csp.bbcred = cpu_to_be16(0x0004); |
98 plogi_tmpl.csp.ciro = 0x1; 99 plogi_tmpl.csp.cisc = 0x0; 100 plogi_tmpl.csp.altbbcred = 0x0; | 98 plogi_tmpl.csp.ciro = 0x1; 99 plogi_tmpl.csp.cisc = 0x0; 100 plogi_tmpl.csp.altbbcred = 0x0; |
101 plogi_tmpl.csp.conseq = bfa_os_htons(0x00FF); 102 plogi_tmpl.csp.ro_bitmap = bfa_os_htons(0x0002); 103 plogi_tmpl.csp.e_d_tov = bfa_os_htonl(2000); | 101 plogi_tmpl.csp.conseq = cpu_to_be16(0x00FF); 102 plogi_tmpl.csp.ro_bitmap = cpu_to_be16(0x0002); 103 plogi_tmpl.csp.e_d_tov = cpu_to_be32(2000); |
104 105 plogi_tmpl.class3.class_valid = 1; 106 plogi_tmpl.class3.sequential = 1; 107 plogi_tmpl.class3.conseq = 0xFF; 108 plogi_tmpl.class3.ospx = 1; 109 110 /* 111 * prli_tmpl 112 */ 113 prli_tmpl.command = FC_ELS_PRLI; 114 prli_tmpl.pglen = 0x10; | 104 105 plogi_tmpl.class3.class_valid = 1; 106 plogi_tmpl.class3.sequential = 1; 107 plogi_tmpl.class3.conseq = 0xFF; 108 plogi_tmpl.class3.ospx = 1; 109 110 /* 111 * prli_tmpl 112 */ 113 prli_tmpl.command = FC_ELS_PRLI; 114 prli_tmpl.pglen = 0x10; |
115 prli_tmpl.pagebytes = bfa_os_htons(0x0014); | 115 prli_tmpl.pagebytes = cpu_to_be16(0x0014); |
116 prli_tmpl.parampage.type = FC_TYPE_FCP; 117 prli_tmpl.parampage.imagepair = 1; 118 prli_tmpl.parampage.servparams.rxrdisab = 1; 119 120 /* 121 * rrq_tmpl 122 */ 123 rrq_tmpl.els_cmd.els_code = FC_ELS_RRQ; --- 19 unchanged lines hidden (view full) --- 143 fchs->cat_info = FC_CAT_UNSOLICIT_CTRL; 144 fchs->type = FC_TYPE_SERVICES; 145 fchs->f_ctl = 146 bfa_os_hton3b(FCTL_SEQ_INI | FCTL_FS_EXCH | FCTL_END_SEQ | 147 FCTL_SI_XFER); 148 fchs->rx_id = FC_RXID_ANY; 149 fchs->d_id = (d_id); 150 fchs->s_id = (s_id); | 116 prli_tmpl.parampage.type = FC_TYPE_FCP; 117 prli_tmpl.parampage.imagepair = 1; 118 prli_tmpl.parampage.servparams.rxrdisab = 1; 119 120 /* 121 * rrq_tmpl 122 */ 123 rrq_tmpl.els_cmd.els_code = FC_ELS_RRQ; --- 19 unchanged lines hidden (view full) --- 143 fchs->cat_info = FC_CAT_UNSOLICIT_CTRL; 144 fchs->type = FC_TYPE_SERVICES; 145 fchs->f_ctl = 146 bfa_os_hton3b(FCTL_SEQ_INI | FCTL_FS_EXCH | FCTL_END_SEQ | 147 FCTL_SI_XFER); 148 fchs->rx_id = FC_RXID_ANY; 149 fchs->d_id = (d_id); 150 fchs->s_id = (s_id); |
151 fchs->ox_id = bfa_os_htons(ox_id); | 151 fchs->ox_id = cpu_to_be16(ox_id); |
152 153 /** 154 * @todo no need to set ox_id for request 155 * no need to set rx_id for response 156 */ 157} 158 159void 160fc_els_req_build(struct fchs_s *fchs, u32 d_id, u32 s_id, u16 ox_id) 161{ 162 memcpy(fchs, &fc_els_req_tmpl, sizeof(struct fchs_s)); 163 fchs->d_id = (d_id); 164 fchs->s_id = (s_id); | 152 153 /** 154 * @todo no need to set ox_id for request 155 * no need to set rx_id for response 156 */ 157} 158 159void 160fc_els_req_build(struct fchs_s *fchs, u32 d_id, u32 s_id, u16 ox_id) 161{ 162 memcpy(fchs, &fc_els_req_tmpl, sizeof(struct fchs_s)); 163 fchs->d_id = (d_id); 164 fchs->s_id = (s_id); |
165 fchs->ox_id = bfa_os_htons(ox_id); | 165 fchs->ox_id = cpu_to_be16(ox_id); |
166} 167 168static void 169fc_els_rsp_build(struct fchs_s *fchs, u32 d_id, u32 s_id, u16 ox_id) 170{ 171 memcpy(fchs, &fc_els_rsp_tmpl, sizeof(struct fchs_s)); 172 fchs->d_id = d_id; 173 fchs->s_id = s_id; --- 40 unchanged lines hidden (view full) --- 214 memcpy(plogi, &plogi_tmpl, sizeof(struct fc_logi_s)); 215 216 plogi->els_cmd.els_code = els_code; 217 if (els_code == FC_ELS_PLOGI) 218 fc_els_req_build(fchs, d_id, s_id, ox_id); 219 else 220 fc_els_rsp_build(fchs, d_id, s_id, ox_id); 221 | 166} 167 168static void 169fc_els_rsp_build(struct fchs_s *fchs, u32 d_id, u32 s_id, u16 ox_id) 170{ 171 memcpy(fchs, &fc_els_rsp_tmpl, sizeof(struct fchs_s)); 172 fchs->d_id = d_id; 173 fchs->s_id = s_id; --- 40 unchanged lines hidden (view full) --- 214 memcpy(plogi, &plogi_tmpl, sizeof(struct fc_logi_s)); 215 216 plogi->els_cmd.els_code = els_code; 217 if (els_code == FC_ELS_PLOGI) 218 fc_els_req_build(fchs, d_id, s_id, ox_id); 219 else 220 fc_els_rsp_build(fchs, d_id, s_id, ox_id); 221 |
222 plogi->csp.rxsz = plogi->class3.rxsz = bfa_os_htons(pdu_size); | 222 plogi->csp.rxsz = plogi->class3.rxsz = cpu_to_be16(pdu_size); |
223 224 memcpy(&plogi->port_name, &port_name, sizeof(wwn_t)); 225 memcpy(&plogi->node_name, &node_name, sizeof(wwn_t)); 226 227 return sizeof(struct fc_logi_s); 228} 229 230u16 --- 4 unchanged lines hidden (view full) --- 235 u32 d_id = bfa_os_hton3b(FC_FABRIC_PORT); 236 u32 *vvl_info; 237 238 memcpy(flogi, &plogi_tmpl, sizeof(struct fc_logi_s)); 239 240 flogi->els_cmd.els_code = FC_ELS_FLOGI; 241 fc_els_req_build(fchs, d_id, s_id, ox_id); 242 | 223 224 memcpy(&plogi->port_name, &port_name, sizeof(wwn_t)); 225 memcpy(&plogi->node_name, &node_name, sizeof(wwn_t)); 226 227 return sizeof(struct fc_logi_s); 228} 229 230u16 --- 4 unchanged lines hidden (view full) --- 235 u32 d_id = bfa_os_hton3b(FC_FABRIC_PORT); 236 u32 *vvl_info; 237 238 memcpy(flogi, &plogi_tmpl, sizeof(struct fc_logi_s)); 239 240 flogi->els_cmd.els_code = FC_ELS_FLOGI; 241 fc_els_req_build(fchs, d_id, s_id, ox_id); 242 |
243 flogi->csp.rxsz = flogi->class3.rxsz = bfa_os_htons(pdu_size); | 243 flogi->csp.rxsz = flogi->class3.rxsz = cpu_to_be16(pdu_size); |
244 flogi->port_name = port_name; 245 flogi->node_name = node_name; 246 247 /* 248 * Set the NPIV Capability Bit ( word 1, bit 31) of Common 249 * Service Parameters. 250 */ 251 flogi->csp.ciro = set_npiv; 252 253 /* set AUTH capability */ 254 flogi->csp.security = set_auth; 255 | 244 flogi->port_name = port_name; 245 flogi->node_name = node_name; 246 247 /* 248 * Set the NPIV Capability Bit ( word 1, bit 31) of Common 249 * Service Parameters. 250 */ 251 flogi->csp.ciro = set_npiv; 252 253 /* set AUTH capability */ 254 flogi->csp.security = set_auth; 255 |
256 flogi->csp.bbcred = bfa_os_htons(local_bb_credits); | 256 flogi->csp.bbcred = cpu_to_be16(local_bb_credits); |
257 258 /* Set brcd token in VVL */ 259 vvl_info = (u32 *)&flogi->vvl[0]; 260 261 /* set the flag to indicate the presence of VVL */ 262 flogi->csp.npiv_supp = 1; /* @todo. field name is not correct */ | 257 258 /* Set brcd token in VVL */ 259 vvl_info = (u32 *)&flogi->vvl[0]; 260 261 /* set the flag to indicate the presence of VVL */ 262 flogi->csp.npiv_supp = 1; /* @todo. field name is not correct */ |
263 vvl_info[0] = bfa_os_htonl(FLOGI_VVL_BRCD); | 263 vvl_info[0] = cpu_to_be32(FLOGI_VVL_BRCD); |
264 265 return sizeof(struct fc_logi_s); 266} 267 268u16 269fc_flogi_acc_build(struct fchs_s *fchs, struct fc_logi_s *flogi, u32 s_id, 270 u16 ox_id, wwn_t port_name, wwn_t node_name, 271 u16 pdu_size, u16 local_bb_credits) 272{ 273 u32 d_id = 0; 274 275 memcpy(flogi, &plogi_tmpl, sizeof(struct fc_logi_s)); 276 fc_els_rsp_build(fchs, d_id, s_id, ox_id); 277 278 flogi->els_cmd.els_code = FC_ELS_ACC; | 264 265 return sizeof(struct fc_logi_s); 266} 267 268u16 269fc_flogi_acc_build(struct fchs_s *fchs, struct fc_logi_s *flogi, u32 s_id, 270 u16 ox_id, wwn_t port_name, wwn_t node_name, 271 u16 pdu_size, u16 local_bb_credits) 272{ 273 u32 d_id = 0; 274 275 memcpy(flogi, &plogi_tmpl, sizeof(struct fc_logi_s)); 276 fc_els_rsp_build(fchs, d_id, s_id, ox_id); 277 278 flogi->els_cmd.els_code = FC_ELS_ACC; |
279 flogi->csp.rxsz = flogi->class3.rxsz = bfa_os_htons(pdu_size); | 279 flogi->csp.rxsz = flogi->class3.rxsz = cpu_to_be16(pdu_size); |
280 flogi->port_name = port_name; 281 flogi->node_name = node_name; 282 | 280 flogi->port_name = port_name; 281 flogi->node_name = node_name; 282 |
283 flogi->csp.bbcred = bfa_os_htons(local_bb_credits); | 283 flogi->csp.bbcred = cpu_to_be16(local_bb_credits); |
284 285 return sizeof(struct fc_logi_s); 286} 287 288u16 289fc_fdisc_build(struct fchs_s *fchs, struct fc_logi_s *flogi, u32 s_id, 290 u16 ox_id, wwn_t port_name, wwn_t node_name, u16 pdu_size) 291{ 292 u32 d_id = bfa_os_hton3b(FC_FABRIC_PORT); 293 294 memcpy(flogi, &plogi_tmpl, sizeof(struct fc_logi_s)); 295 296 flogi->els_cmd.els_code = FC_ELS_FDISC; 297 fc_els_req_build(fchs, d_id, s_id, ox_id); 298 | 284 285 return sizeof(struct fc_logi_s); 286} 287 288u16 289fc_fdisc_build(struct fchs_s *fchs, struct fc_logi_s *flogi, u32 s_id, 290 u16 ox_id, wwn_t port_name, wwn_t node_name, u16 pdu_size) 291{ 292 u32 d_id = bfa_os_hton3b(FC_FABRIC_PORT); 293 294 memcpy(flogi, &plogi_tmpl, sizeof(struct fc_logi_s)); 295 296 flogi->els_cmd.els_code = FC_ELS_FDISC; 297 fc_els_req_build(fchs, d_id, s_id, ox_id); 298 |
299 flogi->csp.rxsz = flogi->class3.rxsz = bfa_os_htons(pdu_size); | 299 flogi->csp.rxsz = flogi->class3.rxsz = cpu_to_be16(pdu_size); |
300 flogi->port_name = port_name; 301 flogi->node_name = node_name; 302 303 return sizeof(struct fc_logi_s); 304} 305 306u16 307fc_plogi_build(struct fchs_s *fchs, void *pld, u32 d_id, u32 s_id, --- 33 unchanged lines hidden (view full) --- 341 return FC_PARSE_FAILURE; 342 343 if (!wwn_is_equal(plogi->port_name, port_name)) 344 return FC_PARSE_FAILURE; 345 346 if (!plogi->class3.class_valid) 347 return FC_PARSE_FAILURE; 348 | 300 flogi->port_name = port_name; 301 flogi->node_name = node_name; 302 303 return sizeof(struct fc_logi_s); 304} 305 306u16 307fc_plogi_build(struct fchs_s *fchs, void *pld, u32 d_id, u32 s_id, --- 33 unchanged lines hidden (view full) --- 341 return FC_PARSE_FAILURE; 342 343 if (!wwn_is_equal(plogi->port_name, port_name)) 344 return FC_PARSE_FAILURE; 345 346 if (!plogi->class3.class_valid) 347 return FC_PARSE_FAILURE; 348 |
349 if (bfa_os_ntohs(plogi->class3.rxsz) < (FC_MIN_PDUSZ)) | 349 if (be16_to_cpu(plogi->class3.rxsz) < (FC_MIN_PDUSZ)) |
350 return FC_PARSE_FAILURE; 351 352 return FC_PARSE_OK; 353 default: 354 return FC_PARSE_FAILURE; 355 } 356} 357 358enum fc_parse_status 359fc_plogi_parse(struct fchs_s *fchs) 360{ 361 struct fc_logi_s *plogi = (struct fc_logi_s *) (fchs + 1); 362 363 if (plogi->class3.class_valid != 1) 364 return FC_PARSE_FAILURE; 365 | 350 return FC_PARSE_FAILURE; 351 352 return FC_PARSE_OK; 353 default: 354 return FC_PARSE_FAILURE; 355 } 356} 357 358enum fc_parse_status 359fc_plogi_parse(struct fchs_s *fchs) 360{ 361 struct fc_logi_s *plogi = (struct fc_logi_s *) (fchs + 1); 362 363 if (plogi->class3.class_valid != 1) 364 return FC_PARSE_FAILURE; 365 |
366 if ((bfa_os_ntohs(plogi->class3.rxsz) < FC_MIN_PDUSZ) 367 || (bfa_os_ntohs(plogi->class3.rxsz) > FC_MAX_PDUSZ) | 366 if ((be16_to_cpu(plogi->class3.rxsz) < FC_MIN_PDUSZ) 367 || (be16_to_cpu(plogi->class3.rxsz) > FC_MAX_PDUSZ) |
368 || (plogi->class3.rxsz == 0)) 369 return FC_PARSE_FAILURE; 370 371 return FC_PARSE_OK; 372} 373 374u16 375fc_prli_build(struct fchs_s *fchs, void *pld, u32 d_id, u32 s_id, --- 156 unchanged lines hidden (view full) --- 532enum fc_parse_status 533fc_pdisc_parse(struct fchs_s *fchs, wwn_t node_name, wwn_t port_name) 534{ 535 struct fc_logi_s *pdisc = (struct fc_logi_s *) (fchs + 1); 536 537 if (pdisc->class3.class_valid != 1) 538 return FC_PARSE_FAILURE; 539 | 368 || (plogi->class3.rxsz == 0)) 369 return FC_PARSE_FAILURE; 370 371 return FC_PARSE_OK; 372} 373 374u16 375fc_prli_build(struct fchs_s *fchs, void *pld, u32 d_id, u32 s_id, --- 156 unchanged lines hidden (view full) --- 532enum fc_parse_status 533fc_pdisc_parse(struct fchs_s *fchs, wwn_t node_name, wwn_t port_name) 534{ 535 struct fc_logi_s *pdisc = (struct fc_logi_s *) (fchs + 1); 536 537 if (pdisc->class3.class_valid != 1) 538 return FC_PARSE_FAILURE; 539 |
540 if ((bfa_os_ntohs(pdisc->class3.rxsz) < | 540 if ((be16_to_cpu(pdisc->class3.rxsz) < |
541 (FC_MIN_PDUSZ - sizeof(struct fchs_s))) 542 || (pdisc->class3.rxsz == 0)) 543 return FC_PARSE_FAILURE; 544 545 if (!wwn_is_equal(pdisc->port_name, port_name)) 546 return FC_PARSE_FAILURE; 547 548 if (!wwn_is_equal(pdisc->node_name, node_name)) --- 4 unchanged lines hidden (view full) --- 553 554u16 555fc_abts_build(struct fchs_s *fchs, u32 d_id, u32 s_id, u16 ox_id) 556{ 557 memcpy(fchs, &fc_bls_req_tmpl, sizeof(struct fchs_s)); 558 fchs->cat_info = FC_CAT_ABTS; 559 fchs->d_id = (d_id); 560 fchs->s_id = (s_id); | 541 (FC_MIN_PDUSZ - sizeof(struct fchs_s))) 542 || (pdisc->class3.rxsz == 0)) 543 return FC_PARSE_FAILURE; 544 545 if (!wwn_is_equal(pdisc->port_name, port_name)) 546 return FC_PARSE_FAILURE; 547 548 if (!wwn_is_equal(pdisc->node_name, node_name)) --- 4 unchanged lines hidden (view full) --- 553 554u16 555fc_abts_build(struct fchs_s *fchs, u32 d_id, u32 s_id, u16 ox_id) 556{ 557 memcpy(fchs, &fc_bls_req_tmpl, sizeof(struct fchs_s)); 558 fchs->cat_info = FC_CAT_ABTS; 559 fchs->d_id = (d_id); 560 fchs->s_id = (s_id); |
561 fchs->ox_id = bfa_os_htons(ox_id); | 561 fchs->ox_id = cpu_to_be16(ox_id); |
562 563 return sizeof(struct fchs_s); 564} 565 566enum fc_parse_status 567fc_abts_rsp_parse(struct fchs_s *fchs, int len) 568{ 569 if ((fchs->cat_info == FC_CAT_BA_ACC) --- 9 unchanged lines hidden (view full) --- 579{ 580 fc_els_req_build(fchs, d_id, s_id, ox_id); 581 582 /* 583 * build rrq payload 584 */ 585 memcpy(rrq, &rrq_tmpl, sizeof(struct fc_rrq_s)); 586 rrq->s_id = (s_id); | 562 563 return sizeof(struct fchs_s); 564} 565 566enum fc_parse_status 567fc_abts_rsp_parse(struct fchs_s *fchs, int len) 568{ 569 if ((fchs->cat_info == FC_CAT_BA_ACC) --- 9 unchanged lines hidden (view full) --- 579{ 580 fc_els_req_build(fchs, d_id, s_id, ox_id); 581 582 /* 583 * build rrq payload 584 */ 585 memcpy(rrq, &rrq_tmpl, sizeof(struct fc_rrq_s)); 586 rrq->s_id = (s_id); |
587 rrq->ox_id = bfa_os_htons(rrq_oxid); | 587 rrq->ox_id = cpu_to_be16(rrq_oxid); |
588 rrq->rx_id = FC_RXID_ANY; 589 590 return sizeof(struct fc_rrq_s); 591} 592 593u16 594fc_logo_acc_build(struct fchs_s *fchs, void *pld, u32 d_id, u32 s_id, 595 u16 ox_id) --- 55 unchanged lines hidden (view full) --- 651fc_logout_params_pages(struct fchs_s *fc_frame, u8 els_code) 652{ 653 int num_pages = 0; 654 struct fc_prlo_s *prlo; 655 struct fc_tprlo_s *tprlo; 656 657 if (els_code == FC_ELS_PRLO) { 658 prlo = (struct fc_prlo_s *) (fc_frame + 1); | 588 rrq->rx_id = FC_RXID_ANY; 589 590 return sizeof(struct fc_rrq_s); 591} 592 593u16 594fc_logo_acc_build(struct fchs_s *fchs, void *pld, u32 d_id, u32 s_id, 595 u16 ox_id) --- 55 unchanged lines hidden (view full) --- 651fc_logout_params_pages(struct fchs_s *fc_frame, u8 els_code) 652{ 653 int num_pages = 0; 654 struct fc_prlo_s *prlo; 655 struct fc_tprlo_s *tprlo; 656 657 if (els_code == FC_ELS_PRLO) { 658 prlo = (struct fc_prlo_s *) (fc_frame + 1); |
659 num_pages = (bfa_os_ntohs(prlo->payload_len) - 4) / 16; | 659 num_pages = (be16_to_cpu(prlo->payload_len) - 4) / 16; |
660 } else { 661 tprlo = (struct fc_tprlo_s *) (fc_frame + 1); | 660 } else { 661 tprlo = (struct fc_tprlo_s *) (fc_frame + 1); |
662 num_pages = (bfa_os_ntohs(tprlo->payload_len) - 4) / 16; | 662 num_pages = (be16_to_cpu(tprlo->payload_len) - 4) / 16; |
663 } 664 return num_pages; 665} 666 667u16 668fc_tprlo_acc_build(struct fchs_s *fchs, struct fc_tprlo_acc_s *tprlo_acc, 669 u32 d_id, u32 s_id, u16 ox_id, int num_pages) 670{ 671 int page; 672 673 fc_els_rsp_build(fchs, d_id, s_id, ox_id); 674 675 memset(tprlo_acc, 0, (num_pages * 16) + 4); 676 tprlo_acc->command = FC_ELS_ACC; 677 678 tprlo_acc->page_len = 0x10; | 663 } 664 return num_pages; 665} 666 667u16 668fc_tprlo_acc_build(struct fchs_s *fchs, struct fc_tprlo_acc_s *tprlo_acc, 669 u32 d_id, u32 s_id, u16 ox_id, int num_pages) 670{ 671 int page; 672 673 fc_els_rsp_build(fchs, d_id, s_id, ox_id); 674 675 memset(tprlo_acc, 0, (num_pages * 16) + 4); 676 tprlo_acc->command = FC_ELS_ACC; 677 678 tprlo_acc->page_len = 0x10; |
679 tprlo_acc->payload_len = bfa_os_htons((num_pages * 16) + 4); | 679 tprlo_acc->payload_len = cpu_to_be16((num_pages * 16) + 4); |
680 681 for (page = 0; page < num_pages; page++) { 682 tprlo_acc->tprlo_acc_params[page].opa_valid = 0; 683 tprlo_acc->tprlo_acc_params[page].rpa_valid = 0; 684 tprlo_acc->tprlo_acc_params[page].fc4type_csp = FC_TYPE_FCP; 685 tprlo_acc->tprlo_acc_params[page].orig_process_assc = 0; 686 tprlo_acc->tprlo_acc_params[page].resp_process_assc = 0; 687 } | 680 681 for (page = 0; page < num_pages; page++) { 682 tprlo_acc->tprlo_acc_params[page].opa_valid = 0; 683 tprlo_acc->tprlo_acc_params[page].rpa_valid = 0; 684 tprlo_acc->tprlo_acc_params[page].fc4type_csp = FC_TYPE_FCP; 685 tprlo_acc->tprlo_acc_params[page].orig_process_assc = 0; 686 tprlo_acc->tprlo_acc_params[page].resp_process_assc = 0; 687 } |
688 return bfa_os_ntohs(tprlo_acc->payload_len); | 688 return be16_to_cpu(tprlo_acc->payload_len); |
689} 690 691u16 692fc_prlo_acc_build(struct fchs_s *fchs, struct fc_prlo_acc_s *prlo_acc, u32 d_id, 693 u32 s_id, u16 ox_id, int num_pages) 694{ 695 int page; 696 697 fc_els_rsp_build(fchs, d_id, s_id, ox_id); 698 699 memset(prlo_acc, 0, (num_pages * 16) + 4); 700 prlo_acc->command = FC_ELS_ACC; 701 prlo_acc->page_len = 0x10; | 689} 690 691u16 692fc_prlo_acc_build(struct fchs_s *fchs, struct fc_prlo_acc_s *prlo_acc, u32 d_id, 693 u32 s_id, u16 ox_id, int num_pages) 694{ 695 int page; 696 697 fc_els_rsp_build(fchs, d_id, s_id, ox_id); 698 699 memset(prlo_acc, 0, (num_pages * 16) + 4); 700 prlo_acc->command = FC_ELS_ACC; 701 prlo_acc->page_len = 0x10; |
702 prlo_acc->payload_len = bfa_os_htons((num_pages * 16) + 4); | 702 prlo_acc->payload_len = cpu_to_be16((num_pages * 16) + 4); |
703 704 for (page = 0; page < num_pages; page++) { 705 prlo_acc->prlo_acc_params[page].opa_valid = 0; 706 prlo_acc->prlo_acc_params[page].rpa_valid = 0; 707 prlo_acc->prlo_acc_params[page].fc4type_csp = FC_TYPE_FCP; 708 prlo_acc->prlo_acc_params[page].orig_process_assc = 0; 709 prlo_acc->prlo_acc_params[page].resp_process_assc = 0; 710 } 711 | 703 704 for (page = 0; page < num_pages; page++) { 705 prlo_acc->prlo_acc_params[page].opa_valid = 0; 706 prlo_acc->prlo_acc_params[page].rpa_valid = 0; 707 prlo_acc->prlo_acc_params[page].fc4type_csp = FC_TYPE_FCP; 708 prlo_acc->prlo_acc_params[page].orig_process_assc = 0; 709 prlo_acc->prlo_acc_params[page].resp_process_assc = 0; 710 } 711 |
712 return bfa_os_ntohs(prlo_acc->payload_len); | 712 return be16_to_cpu(prlo_acc->payload_len); |
713} 714 715u16 716fc_rnid_build(struct fchs_s *fchs, struct fc_rnid_cmd_s *rnid, u32 d_id, 717 u32 s_id, u16 ox_id, u32 data_format) 718{ 719 fc_els_req_build(fchs, d_id, s_id, ox_id); 720 --- 52 unchanged lines hidden (view full) --- 773 u32 dctlr_id = FC_DOMAIN_CTRLR(bfa_os_hton3b(d_id)); 774 int i = 0; 775 776 fc_els_req_build(fchs, bfa_os_hton3b(dctlr_id), s_id, 0); 777 778 memset(rpsc2, 0, sizeof(struct fc_rpsc2_cmd_s)); 779 780 rpsc2->els_cmd.els_code = FC_ELS_RPSC; | 713} 714 715u16 716fc_rnid_build(struct fchs_s *fchs, struct fc_rnid_cmd_s *rnid, u32 d_id, 717 u32 s_id, u16 ox_id, u32 data_format) 718{ 719 fc_els_req_build(fchs, d_id, s_id, ox_id); 720 --- 52 unchanged lines hidden (view full) --- 773 u32 dctlr_id = FC_DOMAIN_CTRLR(bfa_os_hton3b(d_id)); 774 int i = 0; 775 776 fc_els_req_build(fchs, bfa_os_hton3b(dctlr_id), s_id, 0); 777 778 memset(rpsc2, 0, sizeof(struct fc_rpsc2_cmd_s)); 779 780 rpsc2->els_cmd.els_code = FC_ELS_RPSC; |
781 rpsc2->token = bfa_os_htonl(FC_BRCD_TOKEN); 782 rpsc2->num_pids = bfa_os_htons(npids); | 781 rpsc2->token = cpu_to_be32(FC_BRCD_TOKEN); 782 rpsc2->num_pids = cpu_to_be16(npids); |
783 for (i = 0; i < npids; i++) 784 rpsc2->pid_list[i].pid = pid_list[i]; 785 786 return sizeof(struct fc_rpsc2_cmd_s) + ((npids - 1) * (sizeof(u32))); 787} 788 789u16 790fc_rpsc_acc_build(struct fchs_s *fchs, struct fc_rpsc_acc_s *rpsc_acc, 791 u32 d_id, u32 s_id, u16 ox_id, 792 struct fc_rpsc_speed_info_s *oper_speed) 793{ 794 memset(rpsc_acc, 0, sizeof(struct fc_rpsc_acc_s)); 795 796 fc_els_rsp_build(fchs, d_id, s_id, ox_id); 797 798 rpsc_acc->command = FC_ELS_ACC; | 783 for (i = 0; i < npids; i++) 784 rpsc2->pid_list[i].pid = pid_list[i]; 785 786 return sizeof(struct fc_rpsc2_cmd_s) + ((npids - 1) * (sizeof(u32))); 787} 788 789u16 790fc_rpsc_acc_build(struct fchs_s *fchs, struct fc_rpsc_acc_s *rpsc_acc, 791 u32 d_id, u32 s_id, u16 ox_id, 792 struct fc_rpsc_speed_info_s *oper_speed) 793{ 794 memset(rpsc_acc, 0, sizeof(struct fc_rpsc_acc_s)); 795 796 fc_els_rsp_build(fchs, d_id, s_id, ox_id); 797 798 rpsc_acc->command = FC_ELS_ACC; |
799 rpsc_acc->num_entries = bfa_os_htons(1); | 799 rpsc_acc->num_entries = cpu_to_be16(1); |
800 801 rpsc_acc->speed_info[0].port_speed_cap = | 800 801 rpsc_acc->speed_info[0].port_speed_cap = |
802 bfa_os_htons(oper_speed->port_speed_cap); | 802 cpu_to_be16(oper_speed->port_speed_cap); |
803 804 rpsc_acc->speed_info[0].port_op_speed = | 803 804 rpsc_acc->speed_info[0].port_op_speed = |
805 bfa_os_htons(oper_speed->port_op_speed); | 805 cpu_to_be16(oper_speed->port_op_speed); |
806 807 return sizeof(struct fc_rpsc_acc_s); 808} 809 810/* 811 * TBD - 812 * . get rid of unnecessary memsets 813 */ --- 16 unchanged lines hidden (view full) --- 830{ 831 struct fc_logi_s *pdisc = (struct fc_logi_s *) (fchs + 1); 832 833 memcpy(pdisc, &plogi_tmpl, sizeof(struct fc_logi_s)); 834 835 pdisc->els_cmd.els_code = FC_ELS_PDISC; 836 fc_els_req_build(fchs, d_id, s_id, ox_id); 837 | 806 807 return sizeof(struct fc_rpsc_acc_s); 808} 809 810/* 811 * TBD - 812 * . get rid of unnecessary memsets 813 */ --- 16 unchanged lines hidden (view full) --- 830{ 831 struct fc_logi_s *pdisc = (struct fc_logi_s *) (fchs + 1); 832 833 memcpy(pdisc, &plogi_tmpl, sizeof(struct fc_logi_s)); 834 835 pdisc->els_cmd.els_code = FC_ELS_PDISC; 836 fc_els_req_build(fchs, d_id, s_id, ox_id); 837 |
838 pdisc->csp.rxsz = pdisc->class3.rxsz = bfa_os_htons(pdu_size); | 838 pdisc->csp.rxsz = pdisc->class3.rxsz = cpu_to_be16(pdu_size); |
839 pdisc->port_name = port_name; 840 pdisc->node_name = node_name; 841 842 return sizeof(struct fc_logi_s); 843} 844 845u16 846fc_pdisc_rsp_parse(struct fchs_s *fchs, int len, wwn_t port_name) --- 7 unchanged lines hidden (view full) --- 854 return FC_PARSE_ACC_INVAL; 855 856 if (!wwn_is_equal(pdisc->port_name, port_name)) 857 return FC_PARSE_PWWN_NOT_EQUAL; 858 859 if (!pdisc->class3.class_valid) 860 return FC_PARSE_NWWN_NOT_EQUAL; 861 | 839 pdisc->port_name = port_name; 840 pdisc->node_name = node_name; 841 842 return sizeof(struct fc_logi_s); 843} 844 845u16 846fc_pdisc_rsp_parse(struct fchs_s *fchs, int len, wwn_t port_name) --- 7 unchanged lines hidden (view full) --- 854 return FC_PARSE_ACC_INVAL; 855 856 if (!wwn_is_equal(pdisc->port_name, port_name)) 857 return FC_PARSE_PWWN_NOT_EQUAL; 858 859 if (!pdisc->class3.class_valid) 860 return FC_PARSE_NWWN_NOT_EQUAL; 861 |
862 if (bfa_os_ntohs(pdisc->class3.rxsz) < (FC_MIN_PDUSZ)) | 862 if (be16_to_cpu(pdisc->class3.rxsz) < (FC_MIN_PDUSZ)) |
863 return FC_PARSE_RXSZ_INVAL; 864 865 return FC_PARSE_OK; 866} 867 868u16 869fc_prlo_build(struct fchs_s *fchs, u32 d_id, u32 s_id, u16 ox_id, 870 int num_pages) 871{ 872 struct fc_prlo_s *prlo = (struct fc_prlo_s *) (fchs + 1); 873 int page; 874 875 fc_els_req_build(fchs, d_id, s_id, ox_id); 876 memset(prlo, 0, (num_pages * 16) + 4); 877 prlo->command = FC_ELS_PRLO; 878 prlo->page_len = 0x10; | 863 return FC_PARSE_RXSZ_INVAL; 864 865 return FC_PARSE_OK; 866} 867 868u16 869fc_prlo_build(struct fchs_s *fchs, u32 d_id, u32 s_id, u16 ox_id, 870 int num_pages) 871{ 872 struct fc_prlo_s *prlo = (struct fc_prlo_s *) (fchs + 1); 873 int page; 874 875 fc_els_req_build(fchs, d_id, s_id, ox_id); 876 memset(prlo, 0, (num_pages * 16) + 4); 877 prlo->command = FC_ELS_PRLO; 878 prlo->page_len = 0x10; |
879 prlo->payload_len = bfa_os_htons((num_pages * 16) + 4); | 879 prlo->payload_len = cpu_to_be16((num_pages * 16) + 4); |
880 881 for (page = 0; page < num_pages; page++) { 882 prlo->prlo_params[page].type = FC_TYPE_FCP; 883 prlo->prlo_params[page].opa_valid = 0; 884 prlo->prlo_params[page].rpa_valid = 0; 885 prlo->prlo_params[page].orig_process_assc = 0; 886 prlo->prlo_params[page].resp_process_assc = 0; 887 } 888 | 880 881 for (page = 0; page < num_pages; page++) { 882 prlo->prlo_params[page].type = FC_TYPE_FCP; 883 prlo->prlo_params[page].opa_valid = 0; 884 prlo->prlo_params[page].rpa_valid = 0; 885 prlo->prlo_params[page].orig_process_assc = 0; 886 prlo->prlo_params[page].resp_process_assc = 0; 887 } 888 |
889 return bfa_os_ntohs(prlo->payload_len); | 889 return be16_to_cpu(prlo->payload_len); |
890} 891 892u16 893fc_prlo_rsp_parse(struct fchs_s *fchs, int len) 894{ 895 struct fc_prlo_acc_s *prlo = (struct fc_prlo_acc_s *) (fchs + 1); 896 int num_pages = 0; 897 int page = 0; 898 899 len = len; 900 901 if (prlo->command != FC_ELS_ACC) 902 return FC_PARSE_FAILURE; 903 | 890} 891 892u16 893fc_prlo_rsp_parse(struct fchs_s *fchs, int len) 894{ 895 struct fc_prlo_acc_s *prlo = (struct fc_prlo_acc_s *) (fchs + 1); 896 int num_pages = 0; 897 int page = 0; 898 899 len = len; 900 901 if (prlo->command != FC_ELS_ACC) 902 return FC_PARSE_FAILURE; 903 |
904 num_pages = ((bfa_os_ntohs(prlo->payload_len)) - 4) / 16; | 904 num_pages = ((be16_to_cpu(prlo->payload_len)) - 4) / 16; |
905 906 for (page = 0; page < num_pages; page++) { 907 if (prlo->prlo_acc_params[page].type != FC_TYPE_FCP) 908 return FC_PARSE_FAILURE; 909 910 if (prlo->prlo_acc_params[page].opa_valid != 0) 911 return FC_PARSE_FAILURE; 912 --- 16 unchanged lines hidden (view full) --- 929{ 930 struct fc_tprlo_s *tprlo = (struct fc_tprlo_s *) (fchs + 1); 931 int page; 932 933 fc_els_req_build(fchs, d_id, s_id, ox_id); 934 memset(tprlo, 0, (num_pages * 16) + 4); 935 tprlo->command = FC_ELS_TPRLO; 936 tprlo->page_len = 0x10; | 905 906 for (page = 0; page < num_pages; page++) { 907 if (prlo->prlo_acc_params[page].type != FC_TYPE_FCP) 908 return FC_PARSE_FAILURE; 909 910 if (prlo->prlo_acc_params[page].opa_valid != 0) 911 return FC_PARSE_FAILURE; 912 --- 16 unchanged lines hidden (view full) --- 929{ 930 struct fc_tprlo_s *tprlo = (struct fc_tprlo_s *) (fchs + 1); 931 int page; 932 933 fc_els_req_build(fchs, d_id, s_id, ox_id); 934 memset(tprlo, 0, (num_pages * 16) + 4); 935 tprlo->command = FC_ELS_TPRLO; 936 tprlo->page_len = 0x10; |
937 tprlo->payload_len = bfa_os_htons((num_pages * 16) + 4); | 937 tprlo->payload_len = cpu_to_be16((num_pages * 16) + 4); |
938 939 for (page = 0; page < num_pages; page++) { 940 tprlo->tprlo_params[page].type = FC_TYPE_FCP; 941 tprlo->tprlo_params[page].opa_valid = 0; 942 tprlo->tprlo_params[page].rpa_valid = 0; 943 tprlo->tprlo_params[page].orig_process_assc = 0; 944 tprlo->tprlo_params[page].resp_process_assc = 0; 945 if (tprlo_type == FC_GLOBAL_LOGO) { 946 tprlo->tprlo_params[page].global_process_logout = 1; 947 } else if (tprlo_type == FC_TPR_LOGO) { 948 tprlo->tprlo_params[page].tpo_nport_valid = 1; 949 tprlo->tprlo_params[page].tpo_nport_id = (tpr_id); 950 } 951 } 952 | 938 939 for (page = 0; page < num_pages; page++) { 940 tprlo->tprlo_params[page].type = FC_TYPE_FCP; 941 tprlo->tprlo_params[page].opa_valid = 0; 942 tprlo->tprlo_params[page].rpa_valid = 0; 943 tprlo->tprlo_params[page].orig_process_assc = 0; 944 tprlo->tprlo_params[page].resp_process_assc = 0; 945 if (tprlo_type == FC_GLOBAL_LOGO) { 946 tprlo->tprlo_params[page].global_process_logout = 1; 947 } else if (tprlo_type == FC_TPR_LOGO) { 948 tprlo->tprlo_params[page].tpo_nport_valid = 1; 949 tprlo->tprlo_params[page].tpo_nport_id = (tpr_id); 950 } 951 } 952 |
953 return bfa_os_ntohs(tprlo->payload_len); | 953 return be16_to_cpu(tprlo->payload_len); |
954} 955 956u16 957fc_tprlo_rsp_parse(struct fchs_s *fchs, int len) 958{ 959 struct fc_tprlo_acc_s *tprlo = (struct fc_tprlo_acc_s *) (fchs + 1); 960 int num_pages = 0; 961 int page = 0; 962 963 len = len; 964 965 if (tprlo->command != FC_ELS_ACC) 966 return FC_PARSE_ACC_INVAL; 967 | 954} 955 956u16 957fc_tprlo_rsp_parse(struct fchs_s *fchs, int len) 958{ 959 struct fc_tprlo_acc_s *tprlo = (struct fc_tprlo_acc_s *) (fchs + 1); 960 int num_pages = 0; 961 int page = 0; 962 963 len = len; 964 965 if (tprlo->command != FC_ELS_ACC) 966 return FC_PARSE_ACC_INVAL; 967 |
968 num_pages = (bfa_os_ntohs(tprlo->payload_len) - 4) / 16; | 968 num_pages = (be16_to_cpu(tprlo->payload_len) - 4) / 16; |
969 970 for (page = 0; page < num_pages; page++) { 971 if (tprlo->tprlo_acc_params[page].type != FC_TYPE_FCP) 972 return FC_PARSE_NOT_FCP; 973 if (tprlo->tprlo_acc_params[page].opa_valid != 0) 974 return FC_PARSE_OPAFLAG_INVAL; 975 if (tprlo->tprlo_acc_params[page].rpa_valid != 0) 976 return FC_PARSE_RPAFLAG_INVAL; --- 33 unchanged lines hidden (view full) --- 1010 1011static void 1012fc_gs_cthdr_build(struct ct_hdr_s *cthdr, u32 s_id, u16 cmd_code) 1013{ 1014 memset(cthdr, 0, sizeof(struct ct_hdr_s)); 1015 cthdr->rev_id = CT_GS3_REVISION; 1016 cthdr->gs_type = CT_GSTYPE_DIRSERVICE; 1017 cthdr->gs_sub_type = CT_GSSUBTYPE_NAMESERVER; | 969 970 for (page = 0; page < num_pages; page++) { 971 if (tprlo->tprlo_acc_params[page].type != FC_TYPE_FCP) 972 return FC_PARSE_NOT_FCP; 973 if (tprlo->tprlo_acc_params[page].opa_valid != 0) 974 return FC_PARSE_OPAFLAG_INVAL; 975 if (tprlo->tprlo_acc_params[page].rpa_valid != 0) 976 return FC_PARSE_RPAFLAG_INVAL; --- 33 unchanged lines hidden (view full) --- 1010 1011static void 1012fc_gs_cthdr_build(struct ct_hdr_s *cthdr, u32 s_id, u16 cmd_code) 1013{ 1014 memset(cthdr, 0, sizeof(struct ct_hdr_s)); 1015 cthdr->rev_id = CT_GS3_REVISION; 1016 cthdr->gs_type = CT_GSTYPE_DIRSERVICE; 1017 cthdr->gs_sub_type = CT_GSSUBTYPE_NAMESERVER; |
1018 cthdr->cmd_rsp_code = bfa_os_htons(cmd_code); | 1018 cthdr->cmd_rsp_code = cpu_to_be16(cmd_code); |
1019} 1020 1021static void 1022fc_gs_fdmi_cthdr_build(struct ct_hdr_s *cthdr, u32 s_id, u16 cmd_code) 1023{ 1024 memset(cthdr, 0, sizeof(struct ct_hdr_s)); 1025 cthdr->rev_id = CT_GS3_REVISION; 1026 cthdr->gs_type = CT_GSTYPE_MGMTSERVICE; 1027 cthdr->gs_sub_type = CT_GSSUBTYPE_HBA_MGMTSERVER; | 1019} 1020 1021static void 1022fc_gs_fdmi_cthdr_build(struct ct_hdr_s *cthdr, u32 s_id, u16 cmd_code) 1023{ 1024 memset(cthdr, 0, sizeof(struct ct_hdr_s)); 1025 cthdr->rev_id = CT_GS3_REVISION; 1026 cthdr->gs_type = CT_GSTYPE_MGMTSERVICE; 1027 cthdr->gs_sub_type = CT_GSSUBTYPE_HBA_MGMTSERVER; |
1028 cthdr->cmd_rsp_code = bfa_os_htons(cmd_code); | 1028 cthdr->cmd_rsp_code = cpu_to_be16(cmd_code); |
1029} 1030 1031static void 1032fc_gs_ms_cthdr_build(struct ct_hdr_s *cthdr, u32 s_id, u16 cmd_code, 1033 u8 sub_type) 1034{ 1035 memset(cthdr, 0, sizeof(struct ct_hdr_s)); 1036 cthdr->rev_id = CT_GS3_REVISION; 1037 cthdr->gs_type = CT_GSTYPE_MGMTSERVICE; 1038 cthdr->gs_sub_type = sub_type; | 1029} 1030 1031static void 1032fc_gs_ms_cthdr_build(struct ct_hdr_s *cthdr, u32 s_id, u16 cmd_code, 1033 u8 sub_type) 1034{ 1035 memset(cthdr, 0, sizeof(struct ct_hdr_s)); 1036 cthdr->rev_id = CT_GS3_REVISION; 1037 cthdr->gs_type = CT_GSTYPE_MGMTSERVICE; 1038 cthdr->gs_sub_type = sub_type; |
1039 cthdr->cmd_rsp_code = bfa_os_htons(cmd_code); | 1039 cthdr->cmd_rsp_code = cpu_to_be16(cmd_code); |
1040} 1041 1042u16 1043fc_gidpn_build(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id, 1044 wwn_t port_name) 1045{ 1046 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; 1047 struct fcgs_gidpn_req_s *gidpn = (struct fcgs_gidpn_req_s *)(cthdr + 1); --- 37 unchanged lines hidden (view full) --- 1085 memset(gnnid, 0, sizeof(fcgs_gnnid_req_t)); 1086 gnnid->dap = port_id; 1087 return sizeof(fcgs_gnnid_req_t) + sizeof(struct ct_hdr_s); 1088} 1089 1090u16 1091fc_ct_rsp_parse(struct ct_hdr_s *cthdr) 1092{ | 1040} 1041 1042u16 1043fc_gidpn_build(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id, 1044 wwn_t port_name) 1045{ 1046 struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld; 1047 struct fcgs_gidpn_req_s *gidpn = (struct fcgs_gidpn_req_s *)(cthdr + 1); --- 37 unchanged lines hidden (view full) --- 1085 memset(gnnid, 0, sizeof(fcgs_gnnid_req_t)); 1086 gnnid->dap = port_id; 1087 return sizeof(fcgs_gnnid_req_t) + sizeof(struct ct_hdr_s); 1088} 1089 1090u16 1091fc_ct_rsp_parse(struct ct_hdr_s *cthdr) 1092{ |
1093 if (bfa_os_ntohs(cthdr->cmd_rsp_code) != CT_RSP_ACCEPT) { | 1093 if (be16_to_cpu(cthdr->cmd_rsp_code) != CT_RSP_ACCEPT) { |
1094 if (cthdr->reason_code == CT_RSN_LOGICAL_BUSY) 1095 return FC_PARSE_BUSY; 1096 else 1097 return FC_PARSE_FAILURE; 1098 } 1099 1100 return FC_PARSE_OK; 1101} --- 22 unchanged lines hidden (view full) --- 1124 u32 d_id = bfa_os_hton3b(FC_FABRIC_CONTROLLER); 1125 u16 payldlen; 1126 1127 fc_els_req_build(fchs, d_id, s_id, ox_id); 1128 rscn->command = FC_ELS_RSCN; 1129 rscn->pagelen = sizeof(rscn->event[0]); 1130 1131 payldlen = sizeof(u32) + rscn->pagelen; | 1094 if (cthdr->reason_code == CT_RSN_LOGICAL_BUSY) 1095 return FC_PARSE_BUSY; 1096 else 1097 return FC_PARSE_FAILURE; 1098 } 1099 1100 return FC_PARSE_OK; 1101} --- 22 unchanged lines hidden (view full) --- 1124 u32 d_id = bfa_os_hton3b(FC_FABRIC_CONTROLLER); 1125 u16 payldlen; 1126 1127 fc_els_req_build(fchs, d_id, s_id, ox_id); 1128 rscn->command = FC_ELS_RSCN; 1129 rscn->pagelen = sizeof(rscn->event[0]); 1130 1131 payldlen = sizeof(u32) + rscn->pagelen; |
1132 rscn->payldlen = bfa_os_htons(payldlen); | 1132 rscn->payldlen = cpu_to_be16(payldlen); |
1133 1134 rscn->event[0].format = FC_RSCN_FORMAT_PORTID; 1135 rscn->event[0].portid = s_id; 1136 1137 return sizeof(struct fc_rscn_pl_s); 1138} 1139 1140u16 --- 10 unchanged lines hidden (view full) --- 1151 1152 memset(rftid, 0, sizeof(struct fcgs_rftid_req_s)); 1153 1154 rftid->dap = s_id; 1155 1156 /* By default, FCP FC4 Type is registered */ 1157 index = FC_TYPE_FCP >> 5; 1158 type_value = 1 << (FC_TYPE_FCP % 32); | 1133 1134 rscn->event[0].format = FC_RSCN_FORMAT_PORTID; 1135 rscn->event[0].portid = s_id; 1136 1137 return sizeof(struct fc_rscn_pl_s); 1138} 1139 1140u16 --- 10 unchanged lines hidden (view full) --- 1151 1152 memset(rftid, 0, sizeof(struct fcgs_rftid_req_s)); 1153 1154 rftid->dap = s_id; 1155 1156 /* By default, FCP FC4 Type is registered */ 1157 index = FC_TYPE_FCP >> 5; 1158 type_value = 1 << (FC_TYPE_FCP % 32); |
1159 rftid->fc4_type[index] = bfa_os_htonl(type_value); | 1159 rftid->fc4_type[index] = cpu_to_be32(type_value); |
1160 1161 return sizeof(struct fcgs_rftid_req_s) + sizeof(struct ct_hdr_s); 1162} 1163 1164u16 1165fc_rftid_build_sol(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id, 1166 u8 *fc4_bitmap, u32 bitmap_size) 1167{ --- 192 unchanged lines hidden (view full) --- 1360 u32 type_value; 1361 1362 /* 1363 * @todo : Check for bitmask size 1364 */ 1365 1366 index = fc4_type >> 5; 1367 type_value = 1 << (fc4_type % 32); | 1160 1161 return sizeof(struct fcgs_rftid_req_s) + sizeof(struct ct_hdr_s); 1162} 1163 1164u16 1165fc_rftid_build_sol(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id, 1166 u8 *fc4_bitmap, u32 bitmap_size) 1167{ --- 192 unchanged lines hidden (view full) --- 1360 u32 type_value; 1361 1362 /* 1363 * @todo : Check for bitmask size 1364 */ 1365 1366 index = fc4_type >> 5; 1367 type_value = 1 << (fc4_type % 32); |
1368 ptr[index] = bfa_os_htonl(type_value); | 1368 ptr[index] = cpu_to_be32(type_value); |
1369 1370} 1371 1372/* 1373 * GMAL Request 1374 */ 1375u16 1376fc_gmal_req_build(struct fchs_s *fchs, void *pyld, u32 s_id, wwn_t wwn) --- 34 unchanged lines hidden --- | 1369 1370} 1371 1372/* 1373 * GMAL Request 1374 */ 1375u16 1376fc_gmal_req_build(struct fchs_s *fchs, void *pyld, u32 s_id, wwn_t wwn) --- 34 unchanged lines hidden --- |