Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 161012
b: refs/heads/master
c: 5a84bae
h: refs/heads/master
v: v3
  • Loading branch information
Yi Zou authored and James Bottomley committed Aug 22, 2009
1 parent 385e87e commit a00c4df
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7a7f0c7f7a0cbda062d1ff2ff1d3f99d0e41d2af
refs/heads/master: 5a84baeaf7b8bb4188219140cb326a3e859b2312
12 changes: 9 additions & 3 deletions trunk/drivers/scsi/fcoe/libfcoe.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,10 +413,18 @@ static int fcoe_ctlr_encaps(struct fcoe_ctlr *fip,
struct fip_mac_desc *mac;
struct fcoe_fcf *fcf;
size_t dlen;
u16 fip_flags;

fcf = fip->sel_fcf;
if (!fcf)
return -ENODEV;

/* set flags according to both FCF and lport's capability on SPMA */
fip_flags = fcf->flags;
fip_flags &= fip->spma ? FIP_FL_SPMA | FIP_FL_FPMA : FIP_FL_FPMA;
if (!fip_flags)
return -ENODEV;

dlen = sizeof(struct fip_encaps) + skb->len; /* len before push */
cap = (struct fip_encaps_head *)skb_push(skb, sizeof(*cap));

Expand All @@ -429,9 +437,7 @@ static int fcoe_ctlr_encaps(struct fcoe_ctlr *fip,
cap->fip.fip_op = htons(FIP_OP_LS);
cap->fip.fip_subcode = FIP_SC_REQ;
cap->fip.fip_dl_len = htons((dlen + sizeof(*mac)) / FIP_BPW);
cap->fip.fip_flags = htons(FIP_FL_FPMA);
if (fip->spma)
cap->fip.fip_flags |= htons(FIP_FL_SPMA);
cap->fip.fip_flags = htons(fip_flags);

cap->encaps.fd_desc.fip_dtype = dtype;
cap->encaps.fd_desc.fip_dlen = dlen / FIP_BPW;
Expand Down

0 comments on commit a00c4df

Please sign in to comment.