Skip to content

Commit 22bcd22

Browse files
Joe EykholtJames Bottomley
authored andcommitted
[SCSI] libfcoe: Allow FIP to be disabled by the driver
Allow FIP to be disabled by the driver for devices that want to use libfcoe in non-FIP mode. The driver merely sets the fcoe_ctlr mode to the state which should be entered when the link comes up. The default is auto. No change is needed for fcoe.c which uses auto mode. Signed-off-by: Joe Eykholt <jeykholt@cisco.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
1 parent 84c3e1a commit 22bcd22

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

‎drivers/scsi/fcoe/libfcoe.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ static inline int fcoe_ctlr_fcf_usable(struct fcoe_fcf *fcf)
109109
void fcoe_ctlr_init(struct fcoe_ctlr *fip)
110110
{
111111
fip->state = FIP_ST_LINK_WAIT;
112+
fip->mode = FIP_ST_AUTO;
112113
INIT_LIST_HEAD(&fip->fcfs);
113114
spin_lock_init(&fip->lock);
114115
fip->flogi_oxid = FC_XID_UNKNOWN;
@@ -261,11 +262,12 @@ void fcoe_ctlr_link_up(struct fcoe_ctlr *fip)
261262
spin_unlock_bh(&fip->lock);
262263
fc_linkup(fip->lp);
263264
} else if (fip->state == FIP_ST_LINK_WAIT) {
264-
fip->state = FIP_ST_AUTO;
265+
fip->state = fip->mode;
265266
fip->last_link = 1;
266267
fip->link = 1;
267268
spin_unlock_bh(&fip->lock);
268-
LIBFCOE_FIP_DBG("%s", "setting AUTO mode.\n");
269+
if (fip->state == FIP_ST_AUTO)
270+
LIBFCOE_FIP_DBG("%s", "setting AUTO mode.\n");
269271
fc_linkup(fip->lp);
270272
fcoe_ctlr_solicit(fip, NULL);
271273
} else

‎include/scsi/libfcoe.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ enum fip_state {
5555
/**
5656
* struct fcoe_ctlr - FCoE Controller and FIP state
5757
* @state: internal FIP state for network link and FIP or non-FIP mode.
58+
* @mode: LLD-selected mode.
5859
* @lp: &fc_lport: libfc local port.
5960
* @sel_fcf: currently selected FCF, or NULL.
6061
* @fcfs: list of discovered FCFs.
@@ -89,6 +90,7 @@ enum fip_state {
8990
*/
9091
struct fcoe_ctlr {
9192
enum fip_state state;
93+
enum fip_state mode;
9294
struct fc_lport *lp;
9395
struct fcoe_fcf *sel_fcf;
9496
struct list_head fcfs;

0 commit comments

Comments
 (0)