diff options
| author | Joe Eykholt <jeykholt@cisco.com> | 2009-11-03 14:48:11 -0500 |
|---|---|---|
| committer | James Bottomley <James.Bottomley@suse.de> | 2009-12-04 13:01:11 -0500 |
| commit | 22bcd225bfe2107725228758137d2109befa942a (patch) | |
| tree | 48ae2ad5151e55f066fa8006605f06615f00a74d | |
| parent | 84c3e1ad08d4be018a95e7a9964bf3dbc8cf8857 (diff) | |
[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>
| -rw-r--r-- | drivers/scsi/fcoe/libfcoe.c | 6 | ||||
| -rw-r--r-- | include/scsi/libfcoe.h | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/drivers/scsi/fcoe/libfcoe.c b/drivers/scsi/fcoe/libfcoe.c index 6b07a8400889..1ea17a3c8749 100644 --- a/drivers/scsi/fcoe/libfcoe.c +++ b/drivers/scsi/fcoe/libfcoe.c | |||
| @@ -109,6 +109,7 @@ static inline int fcoe_ctlr_fcf_usable(struct fcoe_fcf *fcf) | |||
| 109 | void fcoe_ctlr_init(struct fcoe_ctlr *fip) | 109 | void fcoe_ctlr_init(struct fcoe_ctlr *fip) |
| 110 | { | 110 | { |
| 111 | fip->state = FIP_ST_LINK_WAIT; | 111 | fip->state = FIP_ST_LINK_WAIT; |
| 112 | fip->mode = FIP_ST_AUTO; | ||
| 112 | INIT_LIST_HEAD(&fip->fcfs); | 113 | INIT_LIST_HEAD(&fip->fcfs); |
| 113 | spin_lock_init(&fip->lock); | 114 | spin_lock_init(&fip->lock); |
| 114 | fip->flogi_oxid = FC_XID_UNKNOWN; | 115 | fip->flogi_oxid = FC_XID_UNKNOWN; |
| @@ -261,11 +262,12 @@ void fcoe_ctlr_link_up(struct fcoe_ctlr *fip) | |||
| 261 | spin_unlock_bh(&fip->lock); | 262 | spin_unlock_bh(&fip->lock); |
| 262 | fc_linkup(fip->lp); | 263 | fc_linkup(fip->lp); |
| 263 | } else if (fip->state == FIP_ST_LINK_WAIT) { | 264 | } else if (fip->state == FIP_ST_LINK_WAIT) { |
| 264 | fip->state = FIP_ST_AUTO; | 265 | fip->state = fip->mode; |
| 265 | fip->last_link = 1; | 266 | fip->last_link = 1; |
| 266 | fip->link = 1; | 267 | fip->link = 1; |
| 267 | spin_unlock_bh(&fip->lock); | 268 | 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"); | ||
| 269 | fc_linkup(fip->lp); | 271 | fc_linkup(fip->lp); |
| 270 | fcoe_ctlr_solicit(fip, NULL); | 272 | fcoe_ctlr_solicit(fip, NULL); |
| 271 | } else | 273 | } else |
diff --git a/include/scsi/libfcoe.h b/include/scsi/libfcoe.h index 76d08c9a7678..2344a00e92ef 100644 --- a/include/scsi/libfcoe.h +++ b/include/scsi/libfcoe.h | |||
| @@ -55,6 +55,7 @@ enum fip_state { | |||
| 55 | /** | 55 | /** |
| 56 | * struct fcoe_ctlr - FCoE Controller and FIP state | 56 | * struct fcoe_ctlr - FCoE Controller and FIP state |
| 57 | * @state: internal FIP state for network link and FIP or non-FIP mode. | 57 | * @state: internal FIP state for network link and FIP or non-FIP mode. |
| 58 | * @mode: LLD-selected mode. | ||
| 58 | * @lp: &fc_lport: libfc local port. | 59 | * @lp: &fc_lport: libfc local port. |
| 59 | * @sel_fcf: currently selected FCF, or NULL. | 60 | * @sel_fcf: currently selected FCF, or NULL. |
| 60 | * @fcfs: list of discovered FCFs. | 61 | * @fcfs: list of discovered FCFs. |
| @@ -89,6 +90,7 @@ enum fip_state { | |||
| 89 | */ | 90 | */ |
| 90 | struct fcoe_ctlr { | 91 | struct fcoe_ctlr { |
| 91 | enum fip_state state; | 92 | enum fip_state state; |
| 93 | enum fip_state mode; | ||
| 92 | struct fc_lport *lp; | 94 | struct fc_lport *lp; |
| 93 | struct fcoe_fcf *sel_fcf; | 95 | struct fcoe_fcf *sel_fcf; |
| 94 | struct list_head fcfs; | 96 | struct list_head fcfs; |
