aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/fcoe/libfcoe.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/fcoe/libfcoe.c')
-rw-r--r--drivers/scsi/fcoe/libfcoe.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/scsi/fcoe/libfcoe.c b/drivers/scsi/fcoe/libfcoe.c
index d6ed3f8255ad..78caa6be1130 100644
--- a/drivers/scsi/fcoe/libfcoe.c
+++ b/drivers/scsi/fcoe/libfcoe.c
@@ -413,10 +413,18 @@ static int fcoe_ctlr_encaps(struct fcoe_ctlr *fip,
413 struct fip_mac_desc *mac; 413 struct fip_mac_desc *mac;
414 struct fcoe_fcf *fcf; 414 struct fcoe_fcf *fcf;
415 size_t dlen; 415 size_t dlen;
416 u16 fip_flags;
416 417
417 fcf = fip->sel_fcf; 418 fcf = fip->sel_fcf;
418 if (!fcf) 419 if (!fcf)
419 return -ENODEV; 420 return -ENODEV;
421
422 /* set flags according to both FCF and lport's capability on SPMA */
423 fip_flags = fcf->flags;
424 fip_flags &= fip->spma ? FIP_FL_SPMA | FIP_FL_FPMA : FIP_FL_FPMA;
425 if (!fip_flags)
426 return -ENODEV;
427
420 dlen = sizeof(struct fip_encaps) + skb->len; /* len before push */ 428 dlen = sizeof(struct fip_encaps) + skb->len; /* len before push */
421 cap = (struct fip_encaps_head *)skb_push(skb, sizeof(*cap)); 429 cap = (struct fip_encaps_head *)skb_push(skb, sizeof(*cap));
422 430
@@ -429,9 +437,7 @@ static int fcoe_ctlr_encaps(struct fcoe_ctlr *fip,
429 cap->fip.fip_op = htons(FIP_OP_LS); 437 cap->fip.fip_op = htons(FIP_OP_LS);
430 cap->fip.fip_subcode = FIP_SC_REQ; 438 cap->fip.fip_subcode = FIP_SC_REQ;
431 cap->fip.fip_dl_len = htons((dlen + sizeof(*mac)) / FIP_BPW); 439 cap->fip.fip_dl_len = htons((dlen + sizeof(*mac)) / FIP_BPW);
432 cap->fip.fip_flags = htons(FIP_FL_FPMA); 440 cap->fip.fip_flags = htons(fip_flags);
433 if (fip->spma)
434 cap->fip.fip_flags |= htons(FIP_FL_SPMA);
435 441
436 cap->encaps.fd_desc.fip_dtype = dtype; 442 cap->encaps.fd_desc.fip_dtype = dtype;
437 cap->encaps.fd_desc.fip_dlen = dlen / FIP_BPW; 443 cap->encaps.fd_desc.fip_dlen = dlen / FIP_BPW;