Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 204258
b: refs/heads/master
c: 3d902ac
h: refs/heads/master
v: v3
  • Loading branch information
Joe Eykholt authored and James Bottomley committed Jul 28, 2010
1 parent b263bd0 commit df7c8ee
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 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: 0685230c59b5482e04ab50e7afc51119ceaba651
refs/heads/master: 3d902ac09a2812b359edf633425d1327a18399e9
2 changes: 1 addition & 1 deletion trunk/drivers/scsi/fcoe/fcoe.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ static struct fcoe_interface *fcoe_interface_create(struct net_device *netdev)
/*
* Initialize FIP.
*/
fcoe_ctlr_init(&fcoe->ctlr);
fcoe_ctlr_init(&fcoe->ctlr, FIP_MODE_AUTO);
fcoe->ctlr.send = fcoe_fip_send;
fcoe->ctlr.update_mac = fcoe_update_src_mac;
fcoe->ctlr.get_src_addr = fcoe_get_src_mac;
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/scsi/fcoe/libfcoe.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ static inline int fcoe_ctlr_fcf_usable(struct fcoe_fcf *fcf)
* fcoe_ctlr_init() - Initialize the FCoE Controller instance
* @fip: The FCoE controller to initialize
*/
void fcoe_ctlr_init(struct fcoe_ctlr *fip)
void fcoe_ctlr_init(struct fcoe_ctlr *fip, enum fip_state mode)
{
fip->state = FIP_ST_LINK_WAIT;
fip->mode = FIP_ST_AUTO;
fip->mode = mode;
INIT_LIST_HEAD(&fip->fcfs);
mutex_init(&fip->ctlr_mutex);
fip->flogi_oxid = FC_XID_UNKNOWN;
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/scsi/fnic/fnic_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -617,18 +617,18 @@ static int __devinit fnic_probe(struct pci_dev *pdev,
fnic->ctlr.send = fnic_eth_send;
fnic->ctlr.update_mac = fnic_update_mac;
fnic->ctlr.get_src_addr = fnic_get_mac;
fcoe_ctlr_init(&fnic->ctlr);
if (fnic->config.flags & VFCF_FIP_CAPABLE) {
shost_printk(KERN_INFO, fnic->lport->host,
"firmware supports FIP\n");
/* enable directed and multicast */
vnic_dev_packet_filter(fnic->vdev, 1, 1, 0, 0, 0);
vnic_dev_add_addr(fnic->vdev, FIP_ALL_ENODE_MACS);
vnic_dev_add_addr(fnic->vdev, fnic->ctlr.ctl_src_addr);
fcoe_ctlr_init(&fnic->ctlr, FIP_MODE_AUTO);
} else {
shost_printk(KERN_INFO, fnic->lport->host,
"firmware uses non-FIP mode\n");
fnic->ctlr.mode = FIP_ST_NON_FIP;
fcoe_ctlr_init(&fnic->ctlr, FIP_MODE_NON_FIP);
}
fnic->state = FNIC_IN_FC_MODE;

Expand Down
11 changes: 10 additions & 1 deletion trunk/include/scsi/libfcoe.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@ enum fip_state {
FIP_ST_ENABLED,
};

/*
* Modes:
* The mode is the state that is to be entered after link up.
* It must not change after fcoe_ctlr_init() sets it.
*/
#define FIP_MODE_AUTO FIP_ST_AUTO
#define FIP_MODE_NON_FIP FIP_ST_NON_FIP
#define FIP_MODE_FABRIC FIP_ST_ENABLED

/**
* struct fcoe_ctlr - FCoE Controller and FIP state
* @state: internal FIP state for network link and FIP or non-FIP mode.
Expand Down Expand Up @@ -152,7 +161,7 @@ struct fcoe_fcf {
};

/* FIP API functions */
void fcoe_ctlr_init(struct fcoe_ctlr *);
void fcoe_ctlr_init(struct fcoe_ctlr *, enum fip_state);
void fcoe_ctlr_destroy(struct fcoe_ctlr *);
void fcoe_ctlr_link_up(struct fcoe_ctlr *);
int fcoe_ctlr_link_down(struct fcoe_ctlr *);
Expand Down

0 comments on commit df7c8ee

Please sign in to comment.