1 /*******************************************************************
2 * This file is part of the Emulex Linux Device Driver for *
3 * Fibre Channel Host Bus Adapters. *
4 * Copyright (C) 2004-2006 Emulex. All rights reserved. *
5 * EMULEX and SLI are trademarks of Emulex. *
8 * This program is free software; you can redistribute it and/or *
9 * modify it under the terms of version 2 of the GNU General *
10 * Public License as published by the Free Software Foundation. *
11 * This program is distributed in the hope that it will be useful. *
12 * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND *
13 * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, *
14 * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE *
15 * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD *
16 * TO BE LEGALLY INVALID. See the GNU General Public License for *
17 * more details, a copy of which can be found in the file COPYING *
18 * included with this package. *
19 *******************************************************************/
22 * Fibre Channel SCSI LAN Device Driver CT support
25 #include <linux/blkdev.h>
26 #include <linux/pci.h>
27 #include <linux/interrupt.h>
28 #include <linux/utsname.h>
30 #include <scsi/scsi.h>
31 #include <scsi/scsi_device.h>
32 #include <scsi/scsi_host.h>
33 #include <scsi/scsi_transport_fc.h>
37 #include "lpfc_disc.h"
38 #include "lpfc_scsi.h"
40 #include "lpfc_logmsg.h"
41 #include "lpfc_crtn.h"
42 #include "lpfc_version.h"
44 #define HBA_PORTSPEED_UNKNOWN 0 /* Unknown - transceiver
45 * incapable of reporting */
46 #define HBA_PORTSPEED_1GBIT 1 /* 1 GBit/sec */
47 #define HBA_PORTSPEED_2GBIT 2 /* 2 GBit/sec */
48 #define HBA_PORTSPEED_4GBIT 8 /* 4 GBit/sec */
49 #define HBA_PORTSPEED_8GBIT 16 /* 8 GBit/sec */
50 #define HBA_PORTSPEED_10GBIT 4 /* 10 GBit/sec */
51 #define HBA_PORTSPEED_NOT_NEGOTIATED 5 /* Speed not established */
56 static char *lpfc_release_version
= LPFC_DRIVER_VERSION
;
62 lpfc_ct_unsol_event(struct lpfc_hba
* phba
,
63 struct lpfc_sli_ring
* pring
, struct lpfc_iocbq
* piocbq
)
66 struct lpfc_iocbq
*next_piocbq
;
67 struct lpfc_dmabuf
*pmbuf
= NULL
;
68 struct lpfc_dmabuf
*matp
, *next_matp
;
69 uint32_t ctx
= 0, size
= 0, cnt
= 0;
70 IOCB_t
*icmd
= &piocbq
->iocb
;
71 IOCB_t
*save_icmd
= icmd
;
73 struct list_head head
;
75 if ((icmd
->ulpStatus
== IOSTAT_LOCAL_REJECT
) &&
76 ((icmd
->un
.ulpWord
[4] & 0xff) == IOERR_RCV_BUFFER_WAITING
)) {
77 /* Not enough posted buffers; Try posting more buffers */
78 phba
->fc_stat
.NoRcvBuf
++;
79 lpfc_post_buffer(phba
, pring
, 0, 1);
83 /* If there are no BDEs associated with this IOCB,
84 * there is nothing to do.
86 if (icmd
->ulpBdeCount
== 0)
89 INIT_LIST_HEAD(&head
);
90 list_add_tail(&head
, &piocbq
->list
);
92 list_for_each_entry_safe(piocbq
, next_piocbq
, &head
, list
) {
95 ctx
= (uint32_t) (icmd
->ulpContext
);
96 if (icmd
->ulpBdeCount
== 0)
99 for (i
= 0; i
< icmd
->ulpBdeCount
; i
++) {
100 matp
= lpfc_sli_ringpostbuf_get(phba
, pring
,
108 /* Insert lpfc log message here */
109 lpfc_post_buffer(phba
, pring
, cnt
, 1);
111 goto ct_unsol_event_exit_piocbq
;
114 /* Typically for Unsolicited CT requests */
117 INIT_LIST_HEAD(&pmbuf
->list
);
119 list_add_tail(&matp
->list
, &pmbuf
->list
);
121 size
+= icmd
->un
.cont64
[i
].tus
.f
.bdeSize
;
125 icmd
->ulpBdeCount
= 0;
128 lpfc_post_buffer(phba
, pring
, cnt
, 1);
129 if (save_icmd
->ulpStatus
) {
133 ct_unsol_event_exit_piocbq
:
136 list_for_each_entry_safe(matp
, next_matp
, &pmbuf
->list
, list
) {
137 lpfc_mbuf_free(phba
, matp
->virt
, matp
->phys
);
138 list_del(&matp
->list
);
141 lpfc_mbuf_free(phba
, pmbuf
->virt
, pmbuf
->phys
);
148 lpfc_free_ct_rsp(struct lpfc_hba
* phba
, struct lpfc_dmabuf
* mlist
)
150 struct lpfc_dmabuf
*mlast
, *next_mlast
;
152 list_for_each_entry_safe(mlast
, next_mlast
, &mlist
->list
, list
) {
153 lpfc_mbuf_free(phba
, mlast
->virt
, mlast
->phys
);
154 list_del(&mlast
->list
);
157 lpfc_mbuf_free(phba
, mlist
->virt
, mlist
->phys
);
162 static struct lpfc_dmabuf
*
163 lpfc_alloc_ct_rsp(struct lpfc_hba
* phba
, int cmdcode
, struct ulp_bde64
* bpl
,
164 uint32_t size
, int *entries
)
166 struct lpfc_dmabuf
*mlist
= NULL
;
167 struct lpfc_dmabuf
*mp
;
170 /* We get chucks of FCELSSIZE */
171 cnt
= size
> FCELSSIZE
? FCELSSIZE
: size
;
174 /* Allocate buffer for rsp payload */
175 mp
= kmalloc(sizeof(struct lpfc_dmabuf
), GFP_KERNEL
);
178 lpfc_free_ct_rsp(phba
, mlist
);
182 INIT_LIST_HEAD(&mp
->list
);
184 if (cmdcode
== be16_to_cpu(SLI_CTNS_GID_FT
))
185 mp
->virt
= lpfc_mbuf_alloc(phba
, MEM_PRI
, &(mp
->phys
));
187 mp
->virt
= lpfc_mbuf_alloc(phba
, 0, &(mp
->phys
));
192 lpfc_free_ct_rsp(phba
, mlist
);
196 /* Queue it to a linked list */
200 list_add_tail(&mp
->list
, &mlist
->list
);
202 bpl
->tus
.f
.bdeFlags
= BUFF_USE_RCV
;
203 /* build buffer ptr list for IOCB */
204 bpl
->addrLow
= le32_to_cpu( putPaddrLow(mp
->phys
) );
205 bpl
->addrHigh
= le32_to_cpu( putPaddrHigh(mp
->phys
) );
206 bpl
->tus
.f
.bdeSize
= (uint16_t) cnt
;
207 bpl
->tus
.w
= le32_to_cpu(bpl
->tus
.w
);
219 lpfc_gen_req(struct lpfc_hba
*phba
, struct lpfc_dmabuf
*bmp
,
220 struct lpfc_dmabuf
*inp
, struct lpfc_dmabuf
*outp
,
221 void (*cmpl
) (struct lpfc_hba
*, struct lpfc_iocbq
*,
222 struct lpfc_iocbq
*),
223 struct lpfc_nodelist
*ndlp
, uint32_t usr_flg
, uint32_t num_entry
,
227 struct lpfc_sli
*psli
= &phba
->sli
;
228 struct lpfc_sli_ring
*pring
= &psli
->ring
[LPFC_ELS_RING
];
230 struct lpfc_iocbq
*geniocb
;
232 /* Allocate buffer for command iocb */
233 spin_lock_irq(phba
->host
->host_lock
);
234 geniocb
= lpfc_sli_get_iocbq(phba
);
235 spin_unlock_irq(phba
->host
->host_lock
);
240 icmd
= &geniocb
->iocb
;
241 icmd
->un
.genreq64
.bdl
.ulpIoTag32
= 0;
242 icmd
->un
.genreq64
.bdl
.addrHigh
= putPaddrHigh(bmp
->phys
);
243 icmd
->un
.genreq64
.bdl
.addrLow
= putPaddrLow(bmp
->phys
);
244 icmd
->un
.genreq64
.bdl
.bdeFlags
= BUFF_TYPE_BDL
;
245 icmd
->un
.genreq64
.bdl
.bdeSize
= (num_entry
* sizeof (struct ulp_bde64
));
248 geniocb
->context3
= NULL
;
250 geniocb
->context3
= (uint8_t *) bmp
;
252 /* Save for completion so we can release these resources */
253 geniocb
->context1
= (uint8_t *) inp
;
254 geniocb
->context2
= (uint8_t *) outp
;
256 /* Fill in payload, bp points to frame payload */
257 icmd
->ulpCommand
= CMD_GEN_REQUEST64_CR
;
259 /* Fill in rest of iocb */
260 icmd
->un
.genreq64
.w5
.hcsw
.Fctl
= (SI
| LA
);
261 icmd
->un
.genreq64
.w5
.hcsw
.Dfctl
= 0;
262 icmd
->un
.genreq64
.w5
.hcsw
.Rctl
= FC_UNSOL_CTL
;
263 icmd
->un
.genreq64
.w5
.hcsw
.Type
= FC_COMMON_TRANSPORT_ULP
;
266 /* FC spec states we need 3 * ratov for CT requests */
267 tmo
= (3 * phba
->fc_ratov
);
269 icmd
->ulpTimeout
= tmo
;
270 icmd
->ulpBdeCount
= 1;
272 icmd
->ulpClass
= CLASS3
;
273 icmd
->ulpContext
= ndlp
->nlp_rpi
;
275 /* Issue GEN REQ IOCB for NPORT <did> */
276 lpfc_printf_log(phba
, KERN_INFO
, LOG_ELS
,
277 "%d:0119 Issue GEN REQ IOCB for NPORT x%x "
278 "Data: x%x x%x\n", phba
->brd_no
, icmd
->un
.ulpWord
[5],
279 icmd
->ulpIoTag
, phba
->hba_state
);
280 geniocb
->iocb_cmpl
= cmpl
;
281 geniocb
->drvrTimeout
= icmd
->ulpTimeout
+ LPFC_DRVR_TIMEOUT
;
282 spin_lock_irq(phba
->host
->host_lock
);
283 if (lpfc_sli_issue_iocb(phba
, pring
, geniocb
, 0) == IOCB_ERROR
) {
284 lpfc_sli_release_iocbq(phba
, geniocb
);
285 spin_unlock_irq(phba
->host
->host_lock
);
288 spin_unlock_irq(phba
->host
->host_lock
);
294 lpfc_ct_cmd(struct lpfc_hba
*phba
, struct lpfc_dmabuf
*inmp
,
295 struct lpfc_dmabuf
*bmp
, struct lpfc_nodelist
*ndlp
,
296 void (*cmpl
) (struct lpfc_hba
*, struct lpfc_iocbq
*,
297 struct lpfc_iocbq
*),
300 struct ulp_bde64
*bpl
= (struct ulp_bde64
*) bmp
->virt
;
301 struct lpfc_dmabuf
*outmp
;
303 int cmdcode
= ((struct lpfc_sli_ct_request
*) inmp
->virt
)->
304 CommandResponse
.bits
.CmdRsp
;
306 bpl
++; /* Skip past ct request */
308 /* Put buffer(s) for ct rsp in bpl */
309 outmp
= lpfc_alloc_ct_rsp(phba
, cmdcode
, bpl
, rsp_size
, &cnt
);
313 status
= lpfc_gen_req(phba
, bmp
, inmp
, outmp
, cmpl
, ndlp
, 0,
316 lpfc_free_ct_rsp(phba
, outmp
);
323 lpfc_ns_rsp(struct lpfc_hba
* phba
, struct lpfc_dmabuf
* mp
, uint32_t Size
)
325 struct lpfc_sli_ct_request
*Response
=
326 (struct lpfc_sli_ct_request
*) mp
->virt
;
327 struct lpfc_nodelist
*ndlp
= NULL
;
328 struct lpfc_dmabuf
*mlast
, *next_mp
;
329 uint32_t *ctptr
= (uint32_t *) & Response
->un
.gid
.PortType
;
333 struct list_head head
;
335 lpfc_set_disctmo(phba
);
337 Cnt
= Size
> FCELSSIZE
? FCELSSIZE
: Size
;
339 list_add_tail(&head
, &mp
->list
);
340 list_for_each_entry_safe(mp
, next_mp
, &head
, list
) {
346 ctptr
= (uint32_t *) mlast
->virt
;
348 Cnt
-= 16; /* subtract length of CT header */
350 /* Loop through entire NameServer list of DIDs */
353 /* Get next DID from NameServer List */
355 Did
= ((be32_to_cpu(CTentry
)) & Mask_DID
);
358 if (Did
!= phba
->fc_myDID
) {
359 /* Check for rscn processing or not */
360 ndlp
= lpfc_setup_disc_node(phba
, Did
);
362 /* Mark all node table entries that are in the
366 lpfc_printf_log(phba
, KERN_INFO
, LOG_DISCOVERY
,
367 "%d:0238 Process x%x NameServer"
368 " Rsp Data: x%x x%x x%x\n",
372 phba
->fc_rscn_id_cnt
);
375 lpfc_printf_log(phba
,
378 "%d:0239 Skip x%x NameServer "
379 "Rsp Data: x%x x%x x%x\n",
381 Did
, Size
, phba
->fc_flag
,
382 phba
->fc_rscn_id_cnt
);
385 if (CTentry
& (be32_to_cpu(SLI_CT_LAST_ENTRY
)))
387 Cnt
-= sizeof (uint32_t);
397 * The driver has cycled through all Nports in the RSCN payload.
398 * Complete the handling by cleaning up and marking the
399 * current driver state.
401 if (phba
->hba_state
== LPFC_HBA_READY
) {
402 lpfc_els_flush_rscn(phba
);
403 spin_lock_irq(phba
->host
->host_lock
);
404 phba
->fc_flag
|= FC_RSCN_MODE
; /* we are still in RSCN mode */
405 spin_unlock_irq(phba
->host
->host_lock
);
414 lpfc_cmpl_ct_cmd_gid_ft(struct lpfc_hba
* phba
, struct lpfc_iocbq
* cmdiocb
,
415 struct lpfc_iocbq
* rspiocb
)
418 struct lpfc_sli
*psli
;
419 struct lpfc_dmabuf
*bmp
;
420 struct lpfc_dmabuf
*inp
;
421 struct lpfc_dmabuf
*outp
;
422 struct lpfc_nodelist
*ndlp
;
423 struct lpfc_sli_ct_request
*CTrsp
;
426 /* we pass cmdiocb to state machine which needs rspiocb as well */
427 cmdiocb
->context_un
.rsp_iocb
= rspiocb
;
429 inp
= (struct lpfc_dmabuf
*) cmdiocb
->context1
;
430 outp
= (struct lpfc_dmabuf
*) cmdiocb
->context2
;
431 bmp
= (struct lpfc_dmabuf
*) cmdiocb
->context3
;
433 irsp
= &rspiocb
->iocb
;
434 if (irsp
->ulpStatus
) {
435 if ((irsp
->ulpStatus
== IOSTAT_LOCAL_REJECT
) &&
436 ((irsp
->un
.ulpWord
[4] == IOERR_SLI_DOWN
) ||
437 (irsp
->un
.ulpWord
[4] == IOERR_SLI_ABORTED
))) {
441 /* Check for retry */
442 if (phba
->fc_ns_retry
< LPFC_MAX_NS_RETRY
) {
444 /* CT command is being retried */
446 lpfc_findnode_did(phba
, NLP_SEARCH_UNMAPPED
,
449 if (lpfc_ns_cmd(phba
, ndlp
, SLI_CTNS_GID_FT
) ==
456 /* Good status, continue checking */
457 CTrsp
= (struct lpfc_sli_ct_request
*) outp
->virt
;
458 if (CTrsp
->CommandResponse
.bits
.CmdRsp
==
459 be16_to_cpu(SLI_CT_RESPONSE_FS_ACC
)) {
460 lpfc_printf_log(phba
, KERN_INFO
, LOG_DISCOVERY
,
461 "%d:0208 NameServer Rsp "
465 lpfc_ns_rsp(phba
, outp
,
466 (uint32_t) (irsp
->un
.genreq64
.bdl
.bdeSize
));
467 } else if (CTrsp
->CommandResponse
.bits
.CmdRsp
==
468 be16_to_cpu(SLI_CT_RESPONSE_FS_RJT
)) {
469 /* NameServer Rsp Error */
470 lpfc_printf_log(phba
, KERN_INFO
, LOG_DISCOVERY
,
471 "%d:0240 NameServer Rsp Error "
472 "Data: x%x x%x x%x x%x\n",
474 CTrsp
->CommandResponse
.bits
.CmdRsp
,
475 (uint32_t) CTrsp
->ReasonCode
,
476 (uint32_t) CTrsp
->Explanation
,
479 /* NameServer Rsp Error */
480 lpfc_printf_log(phba
,
483 "%d:0241 NameServer Rsp Error "
484 "Data: x%x x%x x%x x%x\n",
486 CTrsp
->CommandResponse
.bits
.CmdRsp
,
487 (uint32_t) CTrsp
->ReasonCode
,
488 (uint32_t) CTrsp
->Explanation
,
492 /* Link up / RSCN discovery */
493 lpfc_disc_start(phba
);
495 lpfc_free_ct_rsp(phba
, outp
);
496 lpfc_mbuf_free(phba
, inp
->virt
, inp
->phys
);
497 lpfc_mbuf_free(phba
, bmp
->virt
, bmp
->phys
);
500 spin_lock_irq(phba
->host
->host_lock
);
501 lpfc_sli_release_iocbq(phba
, cmdiocb
);
502 spin_unlock_irq(phba
->host
->host_lock
);
507 lpfc_cmpl_ct_cmd_rft_id(struct lpfc_hba
* phba
, struct lpfc_iocbq
* cmdiocb
,
508 struct lpfc_iocbq
* rspiocb
)
510 struct lpfc_sli
*psli
;
511 struct lpfc_dmabuf
*bmp
;
512 struct lpfc_dmabuf
*inp
;
513 struct lpfc_dmabuf
*outp
;
515 struct lpfc_sli_ct_request
*CTrsp
;
518 /* we pass cmdiocb to state machine which needs rspiocb as well */
519 cmdiocb
->context_un
.rsp_iocb
= rspiocb
;
521 inp
= (struct lpfc_dmabuf
*) cmdiocb
->context1
;
522 outp
= (struct lpfc_dmabuf
*) cmdiocb
->context2
;
523 bmp
= (struct lpfc_dmabuf
*) cmdiocb
->context3
;
524 irsp
= &rspiocb
->iocb
;
526 CTrsp
= (struct lpfc_sli_ct_request
*) outp
->virt
;
528 /* RFT request completes status <ulpStatus> CmdRsp <CmdRsp> */
529 lpfc_printf_log(phba
, KERN_INFO
, LOG_DISCOVERY
,
530 "%d:0209 RFT request completes ulpStatus x%x "
531 "CmdRsp x%x\n", phba
->brd_no
, irsp
->ulpStatus
,
532 CTrsp
->CommandResponse
.bits
.CmdRsp
);
534 lpfc_free_ct_rsp(phba
, outp
);
535 lpfc_mbuf_free(phba
, inp
->virt
, inp
->phys
);
536 lpfc_mbuf_free(phba
, bmp
->virt
, bmp
->phys
);
539 spin_lock_irq(phba
->host
->host_lock
);
540 lpfc_sli_release_iocbq(phba
, cmdiocb
);
541 spin_unlock_irq(phba
->host
->host_lock
);
546 lpfc_cmpl_ct_cmd_rnn_id(struct lpfc_hba
* phba
, struct lpfc_iocbq
* cmdiocb
,
547 struct lpfc_iocbq
* rspiocb
)
549 lpfc_cmpl_ct_cmd_rft_id(phba
, cmdiocb
, rspiocb
);
554 lpfc_cmpl_ct_cmd_rsnn_nn(struct lpfc_hba
* phba
, struct lpfc_iocbq
* cmdiocb
,
555 struct lpfc_iocbq
* rspiocb
)
557 lpfc_cmpl_ct_cmd_rft_id(phba
, cmdiocb
, rspiocb
);
562 lpfc_get_hba_sym_node_name(struct lpfc_hba
* phba
, uint8_t * symbp
)
566 lpfc_decode_firmware_rev(phba
, fwrev
, 0);
568 sprintf(symbp
, "Emulex %s FV%s DV%s", phba
->ModelName
,
569 fwrev
, lpfc_release_version
);
576 * Issue Cmd to NameServer
581 lpfc_ns_cmd(struct lpfc_hba
* phba
, struct lpfc_nodelist
* ndlp
, int cmdcode
)
583 struct lpfc_dmabuf
*mp
, *bmp
;
584 struct lpfc_sli_ct_request
*CtReq
;
585 struct ulp_bde64
*bpl
;
586 void (*cmpl
) (struct lpfc_hba
*, struct lpfc_iocbq
*,
587 struct lpfc_iocbq
*) = NULL
;
588 uint32_t rsp_size
= 1024;
590 /* fill in BDEs for command */
591 /* Allocate buffer for command payload */
592 mp
= kmalloc(sizeof (struct lpfc_dmabuf
), GFP_KERNEL
);
596 INIT_LIST_HEAD(&mp
->list
);
597 mp
->virt
= lpfc_mbuf_alloc(phba
, MEM_PRI
, &(mp
->phys
));
601 /* Allocate buffer for Buffer ptr list */
602 bmp
= kmalloc(sizeof (struct lpfc_dmabuf
), GFP_KERNEL
);
604 goto ns_cmd_free_mpvirt
;
606 INIT_LIST_HEAD(&bmp
->list
);
607 bmp
->virt
= lpfc_mbuf_alloc(phba
, MEM_PRI
, &(bmp
->phys
));
609 goto ns_cmd_free_bmp
;
612 lpfc_printf_log(phba
,
615 "%d:0236 NameServer Req Data: x%x x%x x%x\n",
616 phba
->brd_no
, cmdcode
, phba
->fc_flag
,
617 phba
->fc_rscn_id_cnt
);
619 bpl
= (struct ulp_bde64
*) bmp
->virt
;
620 memset(bpl
, 0, sizeof(struct ulp_bde64
));
621 bpl
->addrHigh
= le32_to_cpu( putPaddrHigh(mp
->phys
) );
622 bpl
->addrLow
= le32_to_cpu( putPaddrLow(mp
->phys
) );
623 bpl
->tus
.f
.bdeFlags
= 0;
624 if (cmdcode
== SLI_CTNS_GID_FT
)
625 bpl
->tus
.f
.bdeSize
= GID_REQUEST_SZ
;
626 else if (cmdcode
== SLI_CTNS_RFT_ID
)
627 bpl
->tus
.f
.bdeSize
= RFT_REQUEST_SZ
;
628 else if (cmdcode
== SLI_CTNS_RNN_ID
)
629 bpl
->tus
.f
.bdeSize
= RNN_REQUEST_SZ
;
630 else if (cmdcode
== SLI_CTNS_RSNN_NN
)
631 bpl
->tus
.f
.bdeSize
= RSNN_REQUEST_SZ
;
633 bpl
->tus
.f
.bdeSize
= 0;
634 bpl
->tus
.w
= le32_to_cpu(bpl
->tus
.w
);
636 CtReq
= (struct lpfc_sli_ct_request
*) mp
->virt
;
637 memset(CtReq
, 0, sizeof (struct lpfc_sli_ct_request
));
638 CtReq
->RevisionId
.bits
.Revision
= SLI_CT_REVISION
;
639 CtReq
->RevisionId
.bits
.InId
= 0;
640 CtReq
->FsType
= SLI_CT_DIRECTORY_SERVICE
;
641 CtReq
->FsSubType
= SLI_CT_DIRECTORY_NAME_SERVER
;
642 CtReq
->CommandResponse
.bits
.Size
= 0;
644 case SLI_CTNS_GID_FT
:
645 CtReq
->CommandResponse
.bits
.CmdRsp
=
646 be16_to_cpu(SLI_CTNS_GID_FT
);
647 CtReq
->un
.gid
.Fc4Type
= SLI_CTPT_FCP
;
648 if (phba
->hba_state
< LPFC_HBA_READY
)
649 phba
->hba_state
= LPFC_NS_QRY
;
650 lpfc_set_disctmo(phba
);
651 cmpl
= lpfc_cmpl_ct_cmd_gid_ft
;
652 rsp_size
= FC_MAX_NS_RSP
;
655 case SLI_CTNS_RFT_ID
:
656 CtReq
->CommandResponse
.bits
.CmdRsp
=
657 be16_to_cpu(SLI_CTNS_RFT_ID
);
658 CtReq
->un
.rft
.PortId
= be32_to_cpu(phba
->fc_myDID
);
659 CtReq
->un
.rft
.fcpReg
= 1;
660 cmpl
= lpfc_cmpl_ct_cmd_rft_id
;
663 case SLI_CTNS_RNN_ID
:
664 CtReq
->CommandResponse
.bits
.CmdRsp
=
665 be16_to_cpu(SLI_CTNS_RNN_ID
);
666 CtReq
->un
.rnn
.PortId
= be32_to_cpu(phba
->fc_myDID
);
667 memcpy(CtReq
->un
.rnn
.wwnn
, &phba
->fc_nodename
,
668 sizeof (struct lpfc_name
));
669 cmpl
= lpfc_cmpl_ct_cmd_rnn_id
;
672 case SLI_CTNS_RSNN_NN
:
673 CtReq
->CommandResponse
.bits
.CmdRsp
=
674 be16_to_cpu(SLI_CTNS_RSNN_NN
);
675 memcpy(CtReq
->un
.rsnn
.wwnn
, &phba
->fc_nodename
,
676 sizeof (struct lpfc_name
));
677 lpfc_get_hba_sym_node_name(phba
, CtReq
->un
.rsnn
.symbname
);
678 CtReq
->un
.rsnn
.len
= strlen(CtReq
->un
.rsnn
.symbname
);
679 cmpl
= lpfc_cmpl_ct_cmd_rsnn_nn
;
683 if (!lpfc_ct_cmd(phba
, mp
, bmp
, ndlp
, cmpl
, rsp_size
))
684 /* On success, The cmpl function will free the buffers */
687 lpfc_mbuf_free(phba
, bmp
->virt
, bmp
->phys
);
691 lpfc_mbuf_free(phba
, mp
->virt
, mp
->phys
);
699 lpfc_cmpl_ct_cmd_fdmi(struct lpfc_hba
* phba
,
700 struct lpfc_iocbq
* cmdiocb
, struct lpfc_iocbq
* rspiocb
)
702 struct lpfc_dmabuf
*bmp
= cmdiocb
->context3
;
703 struct lpfc_dmabuf
*inp
= cmdiocb
->context1
;
704 struct lpfc_dmabuf
*outp
= cmdiocb
->context2
;
705 struct lpfc_sli_ct_request
*CTrsp
= outp
->virt
;
706 struct lpfc_sli_ct_request
*CTcmd
= inp
->virt
;
707 struct lpfc_nodelist
*ndlp
;
708 uint16_t fdmi_cmd
= CTcmd
->CommandResponse
.bits
.CmdRsp
;
709 uint16_t fdmi_rsp
= CTrsp
->CommandResponse
.bits
.CmdRsp
;
711 ndlp
= lpfc_findnode_did(phba
, NLP_SEARCH_ALL
, FDMI_DID
);
712 if (fdmi_rsp
== be16_to_cpu(SLI_CT_RESPONSE_FS_RJT
)) {
713 /* FDMI rsp failed */
714 lpfc_printf_log(phba
,
717 "%d:0220 FDMI rsp failed Data: x%x\n",
719 be16_to_cpu(fdmi_cmd
));
722 switch (be16_to_cpu(fdmi_cmd
)) {
724 lpfc_fdmi_cmd(phba
, ndlp
, SLI_MGMT_RPA
);
731 lpfc_fdmi_cmd(phba
, ndlp
, SLI_MGMT_DPRT
);
735 lpfc_fdmi_cmd(phba
, ndlp
, SLI_MGMT_RHBA
);
739 lpfc_free_ct_rsp(phba
, outp
);
740 lpfc_mbuf_free(phba
, inp
->virt
, inp
->phys
);
741 lpfc_mbuf_free(phba
, bmp
->virt
, bmp
->phys
);
744 spin_lock_irq(phba
->host
->host_lock
);
745 lpfc_sli_release_iocbq(phba
, cmdiocb
);
746 spin_unlock_irq(phba
->host
->host_lock
);
750 lpfc_fdmi_cmd(struct lpfc_hba
* phba
, struct lpfc_nodelist
* ndlp
, int cmdcode
)
752 struct lpfc_dmabuf
*mp
, *bmp
;
753 struct lpfc_sli_ct_request
*CtReq
;
754 struct ulp_bde64
*bpl
;
758 REG_PORT_ATTRIBUTE
*pab
;
761 void (*cmpl
) (struct lpfc_hba
*, struct lpfc_iocbq
*,
762 struct lpfc_iocbq
*);
765 /* fill in BDEs for command */
766 /* Allocate buffer for command payload */
767 mp
= kmalloc(sizeof (struct lpfc_dmabuf
), GFP_KERNEL
);
771 mp
->virt
= lpfc_mbuf_alloc(phba
, 0, &(mp
->phys
));
773 goto fdmi_cmd_free_mp
;
775 /* Allocate buffer for Buffer ptr list */
776 bmp
= kmalloc(sizeof (struct lpfc_dmabuf
), GFP_KERNEL
);
778 goto fdmi_cmd_free_mpvirt
;
780 bmp
->virt
= lpfc_mbuf_alloc(phba
, 0, &(bmp
->phys
));
782 goto fdmi_cmd_free_bmp
;
784 INIT_LIST_HEAD(&mp
->list
);
785 INIT_LIST_HEAD(&bmp
->list
);
788 lpfc_printf_log(phba
,
791 "%d:0218 FDMI Request Data: x%x x%x x%x\n",
793 phba
->fc_flag
, phba
->hba_state
, cmdcode
);
795 CtReq
= (struct lpfc_sli_ct_request
*) mp
->virt
;
797 memset(CtReq
, 0, sizeof(struct lpfc_sli_ct_request
));
798 CtReq
->RevisionId
.bits
.Revision
= SLI_CT_REVISION
;
799 CtReq
->RevisionId
.bits
.InId
= 0;
801 CtReq
->FsType
= SLI_CT_MANAGEMENT_SERVICE
;
802 CtReq
->FsSubType
= SLI_CT_FDMI_Subtypes
;
808 lpfc_vpd_t
*vp
= &phba
->vpd
;
812 CtReq
->CommandResponse
.bits
.CmdRsp
=
813 be16_to_cpu(SLI_MGMT_RHBA
);
814 CtReq
->CommandResponse
.bits
.Size
= 0;
815 rh
= (REG_HBA
*) & CtReq
->un
.PortID
;
816 memcpy(&rh
->hi
.PortName
, &phba
->fc_sparam
.portName
,
817 sizeof (struct lpfc_name
));
818 /* One entry (port) per adapter */
819 rh
->rpl
.EntryCnt
= be32_to_cpu(1);
820 memcpy(&rh
->rpl
.pe
, &phba
->fc_sparam
.portName
,
821 sizeof (struct lpfc_name
));
823 /* point to the HBA attribute block */
824 size
= 2 * sizeof (struct lpfc_name
) + FOURBYTES
;
825 ab
= (ATTRIBUTE_BLOCK
*) ((uint8_t *) rh
+ size
);
828 /* Point to the beginning of the first HBA attribute
830 /* #1 HBA attribute entry */
832 ae
= (ATTRIBUTE_ENTRY
*) ((uint8_t *) rh
+ size
);
833 ae
->ad
.bits
.AttrType
= be16_to_cpu(NODE_NAME
);
834 ae
->ad
.bits
.AttrLen
= be16_to_cpu(FOURBYTES
835 + sizeof (struct lpfc_name
));
836 memcpy(&ae
->un
.NodeName
, &phba
->fc_sparam
.nodeName
,
837 sizeof (struct lpfc_name
));
839 size
+= FOURBYTES
+ sizeof (struct lpfc_name
);
841 /* #2 HBA attribute entry */
842 ae
= (ATTRIBUTE_ENTRY
*) ((uint8_t *) rh
+ size
);
843 ae
->ad
.bits
.AttrType
= be16_to_cpu(MANUFACTURER
);
844 strcpy(ae
->un
.Manufacturer
, "Emulex Corporation");
845 len
= strlen(ae
->un
.Manufacturer
);
846 len
+= (len
& 3) ? (4 - (len
& 3)) : 4;
847 ae
->ad
.bits
.AttrLen
= be16_to_cpu(FOURBYTES
+ len
);
849 size
+= FOURBYTES
+ len
;
851 /* #3 HBA attribute entry */
852 ae
= (ATTRIBUTE_ENTRY
*) ((uint8_t *) rh
+ size
);
853 ae
->ad
.bits
.AttrType
= be16_to_cpu(SERIAL_NUMBER
);
854 strcpy(ae
->un
.SerialNumber
, phba
->SerialNumber
);
855 len
= strlen(ae
->un
.SerialNumber
);
856 len
+= (len
& 3) ? (4 - (len
& 3)) : 4;
857 ae
->ad
.bits
.AttrLen
= be16_to_cpu(FOURBYTES
+ len
);
859 size
+= FOURBYTES
+ len
;
861 /* #4 HBA attribute entry */
862 ae
= (ATTRIBUTE_ENTRY
*) ((uint8_t *) rh
+ size
);
863 ae
->ad
.bits
.AttrType
= be16_to_cpu(MODEL
);
864 strcpy(ae
->un
.Model
, phba
->ModelName
);
865 len
= strlen(ae
->un
.Model
);
866 len
+= (len
& 3) ? (4 - (len
& 3)) : 4;
867 ae
->ad
.bits
.AttrLen
= be16_to_cpu(FOURBYTES
+ len
);
869 size
+= FOURBYTES
+ len
;
871 /* #5 HBA attribute entry */
872 ae
= (ATTRIBUTE_ENTRY
*) ((uint8_t *) rh
+ size
);
873 ae
->ad
.bits
.AttrType
= be16_to_cpu(MODEL_DESCRIPTION
);
874 strcpy(ae
->un
.ModelDescription
, phba
->ModelDesc
);
875 len
= strlen(ae
->un
.ModelDescription
);
876 len
+= (len
& 3) ? (4 - (len
& 3)) : 4;
877 ae
->ad
.bits
.AttrLen
= be16_to_cpu(FOURBYTES
+ len
);
879 size
+= FOURBYTES
+ len
;
881 /* #6 HBA attribute entry */
882 ae
= (ATTRIBUTE_ENTRY
*) ((uint8_t *) rh
+ size
);
883 ae
->ad
.bits
.AttrType
= be16_to_cpu(HARDWARE_VERSION
);
884 ae
->ad
.bits
.AttrLen
= be16_to_cpu(FOURBYTES
+ 8);
885 /* Convert JEDEC ID to ascii for hardware version */
886 incr
= vp
->rev
.biuRev
;
887 for (i
= 0; i
< 8; i
++) {
890 ae
->un
.HardwareVersion
[7 - i
] =
891 (char)((uint8_t) 0x30 +
894 ae
->un
.HardwareVersion
[7 - i
] =
895 (char)((uint8_t) 0x61 +
900 size
+= FOURBYTES
+ 8;
902 /* #7 HBA attribute entry */
903 ae
= (ATTRIBUTE_ENTRY
*) ((uint8_t *) rh
+ size
);
904 ae
->ad
.bits
.AttrType
= be16_to_cpu(DRIVER_VERSION
);
905 strcpy(ae
->un
.DriverVersion
, lpfc_release_version
);
906 len
= strlen(ae
->un
.DriverVersion
);
907 len
+= (len
& 3) ? (4 - (len
& 3)) : 4;
908 ae
->ad
.bits
.AttrLen
= be16_to_cpu(FOURBYTES
+ len
);
910 size
+= FOURBYTES
+ len
;
912 /* #8 HBA attribute entry */
913 ae
= (ATTRIBUTE_ENTRY
*) ((uint8_t *) rh
+ size
);
914 ae
->ad
.bits
.AttrType
= be16_to_cpu(OPTION_ROM_VERSION
);
915 strcpy(ae
->un
.OptionROMVersion
, phba
->OptionROMVersion
);
916 len
= strlen(ae
->un
.OptionROMVersion
);
917 len
+= (len
& 3) ? (4 - (len
& 3)) : 4;
918 ae
->ad
.bits
.AttrLen
= be16_to_cpu(FOURBYTES
+ len
);
920 size
+= FOURBYTES
+ len
;
922 /* #9 HBA attribute entry */
923 ae
= (ATTRIBUTE_ENTRY
*) ((uint8_t *) rh
+ size
);
924 ae
->ad
.bits
.AttrType
= be16_to_cpu(FIRMWARE_VERSION
);
925 lpfc_decode_firmware_rev(phba
, ae
->un
.FirmwareVersion
,
927 len
= strlen(ae
->un
.FirmwareVersion
);
928 len
+= (len
& 3) ? (4 - (len
& 3)) : 4;
929 ae
->ad
.bits
.AttrLen
= be16_to_cpu(FOURBYTES
+ len
);
931 size
+= FOURBYTES
+ len
;
933 /* #10 HBA attribute entry */
934 ae
= (ATTRIBUTE_ENTRY
*) ((uint8_t *) rh
+ size
);
935 ae
->ad
.bits
.AttrType
= be16_to_cpu(OS_NAME_VERSION
);
936 sprintf(ae
->un
.OsNameVersion
, "%s %s %s",
937 init_utsname()->sysname
, init_utsname()->release
,
938 init_utsname()->version
);
939 len
= strlen(ae
->un
.OsNameVersion
);
940 len
+= (len
& 3) ? (4 - (len
& 3)) : 4;
941 ae
->ad
.bits
.AttrLen
= be16_to_cpu(FOURBYTES
+ len
);
943 size
+= FOURBYTES
+ len
;
945 /* #11 HBA attribute entry */
946 ae
= (ATTRIBUTE_ENTRY
*) ((uint8_t *) rh
+ size
);
947 ae
->ad
.bits
.AttrType
= be16_to_cpu(MAX_CT_PAYLOAD_LEN
);
948 ae
->ad
.bits
.AttrLen
= be16_to_cpu(FOURBYTES
+ 4);
949 ae
->un
.MaxCTPayloadLen
= (65 * 4096);
951 size
+= FOURBYTES
+ 4;
953 ab
->EntryCnt
= be32_to_cpu(ab
->EntryCnt
);
955 size
= GID_REQUEST_SZ
- 4 + size
;
962 struct serv_parm
*hsp
;
967 CtReq
->CommandResponse
.bits
.CmdRsp
=
968 be16_to_cpu(SLI_MGMT_RPA
);
969 CtReq
->CommandResponse
.bits
.Size
= 0;
970 pab
= (REG_PORT_ATTRIBUTE
*) & CtReq
->un
.PortID
;
971 size
= sizeof (struct lpfc_name
) + FOURBYTES
;
972 memcpy((uint8_t *) & pab
->PortName
,
973 (uint8_t *) & phba
->fc_sparam
.portName
,
974 sizeof (struct lpfc_name
));
975 pab
->ab
.EntryCnt
= 0;
977 /* #1 Port attribute entry */
978 ae
= (ATTRIBUTE_ENTRY
*) ((uint8_t *) pab
+ size
);
979 ae
->ad
.bits
.AttrType
= be16_to_cpu(SUPPORTED_FC4_TYPES
);
980 ae
->ad
.bits
.AttrLen
= be16_to_cpu(FOURBYTES
+ 32);
981 ae
->un
.SupportFC4Types
[2] = 1;
982 ae
->un
.SupportFC4Types
[7] = 1;
984 size
+= FOURBYTES
+ 32;
986 /* #2 Port attribute entry */
987 ae
= (ATTRIBUTE_ENTRY
*) ((uint8_t *) pab
+ size
);
988 ae
->ad
.bits
.AttrType
= be16_to_cpu(SUPPORTED_SPEED
);
989 ae
->ad
.bits
.AttrLen
= be16_to_cpu(FOURBYTES
+ 4);
991 ae
->un
.SupportSpeed
= 0;
992 if (phba
->lmt
& LMT_10Gb
)
993 ae
->un
.SupportSpeed
= HBA_PORTSPEED_10GBIT
;
994 if (phba
->lmt
& LMT_8Gb
)
995 ae
->un
.SupportSpeed
|= HBA_PORTSPEED_8GBIT
;
996 if (phba
->lmt
& LMT_4Gb
)
997 ae
->un
.SupportSpeed
|= HBA_PORTSPEED_4GBIT
;
998 if (phba
->lmt
& LMT_2Gb
)
999 ae
->un
.SupportSpeed
|= HBA_PORTSPEED_2GBIT
;
1000 if (phba
->lmt
& LMT_1Gb
)
1001 ae
->un
.SupportSpeed
|= HBA_PORTSPEED_1GBIT
;
1004 size
+= FOURBYTES
+ 4;
1006 /* #3 Port attribute entry */
1007 ae
= (ATTRIBUTE_ENTRY
*) ((uint8_t *) pab
+ size
);
1008 ae
->ad
.bits
.AttrType
= be16_to_cpu(PORT_SPEED
);
1009 ae
->ad
.bits
.AttrLen
= be16_to_cpu(FOURBYTES
+ 4);
1010 switch(phba
->fc_linkspeed
) {
1012 ae
->un
.PortSpeed
= HBA_PORTSPEED_1GBIT
;
1015 ae
->un
.PortSpeed
= HBA_PORTSPEED_2GBIT
;
1018 ae
->un
.PortSpeed
= HBA_PORTSPEED_4GBIT
;
1022 HBA_PORTSPEED_UNKNOWN
;
1026 size
+= FOURBYTES
+ 4;
1028 /* #4 Port attribute entry */
1029 ae
= (ATTRIBUTE_ENTRY
*) ((uint8_t *) pab
+ size
);
1030 ae
->ad
.bits
.AttrType
= be16_to_cpu(MAX_FRAME_SIZE
);
1031 ae
->ad
.bits
.AttrLen
= be16_to_cpu(FOURBYTES
+ 4);
1032 hsp
= (struct serv_parm
*) & phba
->fc_sparam
;
1033 ae
->un
.MaxFrameSize
=
1034 (((uint32_t) hsp
->cmn
.
1035 bbRcvSizeMsb
) << 8) | (uint32_t) hsp
->cmn
.
1038 size
+= FOURBYTES
+ 4;
1040 /* #5 Port attribute entry */
1041 ae
= (ATTRIBUTE_ENTRY
*) ((uint8_t *) pab
+ size
);
1042 ae
->ad
.bits
.AttrType
= be16_to_cpu(OS_DEVICE_NAME
);
1043 strcpy((char *)ae
->un
.OsDeviceName
, LPFC_DRIVER_NAME
);
1044 len
= strlen((char *)ae
->un
.OsDeviceName
);
1045 len
+= (len
& 3) ? (4 - (len
& 3)) : 4;
1046 ae
->ad
.bits
.AttrLen
= be16_to_cpu(FOURBYTES
+ len
);
1048 size
+= FOURBYTES
+ len
;
1050 if (phba
->cfg_fdmi_on
== 2) {
1051 /* #6 Port attribute entry */
1052 ae
= (ATTRIBUTE_ENTRY
*) ((uint8_t *) pab
+
1054 ae
->ad
.bits
.AttrType
= be16_to_cpu(HOST_NAME
);
1055 sprintf(ae
->un
.HostName
, "%s",
1056 init_utsname()->nodename
);
1057 len
= strlen(ae
->un
.HostName
);
1058 len
+= (len
& 3) ? (4 - (len
& 3)) : 4;
1059 ae
->ad
.bits
.AttrLen
=
1060 be16_to_cpu(FOURBYTES
+ len
);
1062 size
+= FOURBYTES
+ len
;
1065 pab
->ab
.EntryCnt
= be32_to_cpu(pab
->ab
.EntryCnt
);
1067 size
= GID_REQUEST_SZ
- 4 + size
;
1072 CtReq
->CommandResponse
.bits
.CmdRsp
= be16_to_cpu(SLI_MGMT_DHBA
);
1073 CtReq
->CommandResponse
.bits
.Size
= 0;
1074 pe
= (PORT_ENTRY
*) & CtReq
->un
.PortID
;
1075 memcpy((uint8_t *) & pe
->PortName
,
1076 (uint8_t *) & phba
->fc_sparam
.portName
,
1077 sizeof (struct lpfc_name
));
1078 size
= GID_REQUEST_SZ
- 4 + sizeof (struct lpfc_name
);
1082 CtReq
->CommandResponse
.bits
.CmdRsp
= be16_to_cpu(SLI_MGMT_DPRT
);
1083 CtReq
->CommandResponse
.bits
.Size
= 0;
1084 pe
= (PORT_ENTRY
*) & CtReq
->un
.PortID
;
1085 memcpy((uint8_t *) & pe
->PortName
,
1086 (uint8_t *) & phba
->fc_sparam
.portName
,
1087 sizeof (struct lpfc_name
));
1088 size
= GID_REQUEST_SZ
- 4 + sizeof (struct lpfc_name
);
1092 bpl
= (struct ulp_bde64
*) bmp
->virt
;
1093 bpl
->addrHigh
= le32_to_cpu( putPaddrHigh(mp
->phys
) );
1094 bpl
->addrLow
= le32_to_cpu( putPaddrLow(mp
->phys
) );
1095 bpl
->tus
.f
.bdeFlags
= 0;
1096 bpl
->tus
.f
.bdeSize
= size
;
1097 bpl
->tus
.w
= le32_to_cpu(bpl
->tus
.w
);
1099 cmpl
= lpfc_cmpl_ct_cmd_fdmi
;
1101 if (!lpfc_ct_cmd(phba
, mp
, bmp
, ndlp
, cmpl
, FC_MAX_NS_RSP
))
1104 lpfc_mbuf_free(phba
, bmp
->virt
, bmp
->phys
);
1107 fdmi_cmd_free_mpvirt
:
1108 lpfc_mbuf_free(phba
, mp
->virt
, mp
->phys
);
1112 /* Issue FDMI request failed */
1113 lpfc_printf_log(phba
,
1116 "%d:0244 Issue FDMI request failed Data: x%x\n",
1123 lpfc_fdmi_tmo(unsigned long ptr
)
1125 struct lpfc_hba
*phba
= (struct lpfc_hba
*)ptr
;
1126 unsigned long iflag
;
1128 spin_lock_irqsave(phba
->host
->host_lock
, iflag
);
1129 if (!(phba
->work_hba_events
& WORKER_FDMI_TMO
)) {
1130 phba
->work_hba_events
|= WORKER_FDMI_TMO
;
1131 if (phba
->work_wait
)
1132 wake_up(phba
->work_wait
);
1134 spin_unlock_irqrestore(phba
->host
->host_lock
,iflag
);
1138 lpfc_fdmi_tmo_handler(struct lpfc_hba
*phba
)
1140 struct lpfc_nodelist
*ndlp
;
1142 ndlp
= lpfc_findnode_did(phba
, NLP_SEARCH_ALL
, FDMI_DID
);
1144 if (init_utsname()->nodename
[0] != '\0') {
1145 lpfc_fdmi_cmd(phba
, ndlp
, SLI_MGMT_DHBA
);
1147 mod_timer(&phba
->fc_fdmitmo
, jiffies
+ HZ
* 60);
1155 lpfc_decode_firmware_rev(struct lpfc_hba
* phba
, char *fwrevision
, int flag
)
1157 struct lpfc_sli
*psli
= &phba
->sli
;
1158 lpfc_vpd_t
*vp
= &phba
->vpd
;
1159 uint32_t b1
, b2
, b3
, b4
, i
, rev
;
1161 uint32_t *ptr
, str
[4];
1165 if (psli
->sli_flag
& LPFC_SLI2_ACTIVE
)
1166 rev
= vp
->rev
.sli2FwRev
;
1168 rev
= vp
->rev
.sli1FwRev
;
1170 b1
= (rev
& 0x0000f000) >> 12;
1171 b2
= (rev
& 0x00000f00) >> 8;
1172 b3
= (rev
& 0x000000c0) >> 6;
1173 b4
= (rev
& 0x00000030) >> 4;
1189 b4
= (rev
& 0x0000000f);
1191 if (psli
->sli_flag
& LPFC_SLI2_ACTIVE
)
1192 fwname
= vp
->rev
.sli2FwName
;
1194 fwname
= vp
->rev
.sli1FwName
;
1196 for (i
= 0; i
< 16; i
++)
1197 if (fwname
[i
] == 0x20)
1200 ptr
= (uint32_t*)fwname
;
1202 for (i
= 0; i
< 3; i
++)
1203 str
[i
] = be32_to_cpu(*ptr
++);
1207 sprintf(fwrevision
, "%d.%d%d (%s)",
1208 b1
, b2
, b3
, (char *)str
);
1210 sprintf(fwrevision
, "%d.%d%d", b1
,
1214 sprintf(fwrevision
, "%d.%d%d%c%d (%s)",
1218 sprintf(fwrevision
, "%d.%d%d%c%d",
1222 rev
= vp
->rev
.smFwRev
;
1224 b1
= (rev
& 0xff000000) >> 24;
1225 b2
= (rev
& 0x00f00000) >> 20;
1226 b3
= (rev
& 0x000f0000) >> 16;
1227 c
= (rev
& 0x0000ff00) >> 8;
1228 b4
= (rev
& 0x000000ff);
1231 sprintf(fwrevision
, "%d.%d%d%c%d ", b1
,
1234 sprintf(fwrevision
, "%d.%d%d%c%d ", b1
,