Commit 1917d42d authored by Hannes Reinecke's avatar Hannes Reinecke Committed by Martin K. Petersen

fcoe: use enum for fip_mode

The FIP mode is independent on the FIP state machine, so use a separate
enum for that instead of overloading it with state machine values.
Signed-off-by: default avatarHannes Reinecke <hare@suse.com>
Acked-by: default avatarJohannes Thumshirn <jth@kernel.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 6a551c11
...@@ -57,7 +57,7 @@ static struct scsi_host_template bnx2fc_shost_template; ...@@ -57,7 +57,7 @@ static struct scsi_host_template bnx2fc_shost_template;
static struct fc_function_template bnx2fc_transport_function; static struct fc_function_template bnx2fc_transport_function;
static struct fcoe_sysfs_function_template bnx2fc_fcoe_sysfs_templ; static struct fcoe_sysfs_function_template bnx2fc_fcoe_sysfs_templ;
static struct fc_function_template bnx2fc_vport_xport_function; static struct fc_function_template bnx2fc_vport_xport_function;
static int bnx2fc_create(struct net_device *netdev, enum fip_state fip_mode); static int bnx2fc_create(struct net_device *netdev, enum fip_mode fip_mode);
static void __bnx2fc_destroy(struct bnx2fc_interface *interface); static void __bnx2fc_destroy(struct bnx2fc_interface *interface);
static int bnx2fc_destroy(struct net_device *net_device); static int bnx2fc_destroy(struct net_device *net_device);
static int bnx2fc_enable(struct net_device *netdev); static int bnx2fc_enable(struct net_device *netdev);
...@@ -2260,7 +2260,7 @@ enum bnx2fc_create_link_state { ...@@ -2260,7 +2260,7 @@ enum bnx2fc_create_link_state {
* Returns: 0 for success * Returns: 0 for success
*/ */
static int _bnx2fc_create(struct net_device *netdev, static int _bnx2fc_create(struct net_device *netdev,
enum fip_state fip_mode, enum fip_mode fip_mode,
enum bnx2fc_create_link_state link_state) enum bnx2fc_create_link_state link_state)
{ {
struct fcoe_ctlr_device *cdev; struct fcoe_ctlr_device *cdev;
...@@ -2412,7 +2412,7 @@ static int _bnx2fc_create(struct net_device *netdev, ...@@ -2412,7 +2412,7 @@ static int _bnx2fc_create(struct net_device *netdev,
* *
* Returns: 0 for success * Returns: 0 for success
*/ */
static int bnx2fc_create(struct net_device *netdev, enum fip_state fip_mode) static int bnx2fc_create(struct net_device *netdev, enum fip_mode fip_mode)
{ {
return _bnx2fc_create(netdev, fip_mode, BNX2FC_CREATE_LINK_UP); return _bnx2fc_create(netdev, fip_mode, BNX2FC_CREATE_LINK_UP);
} }
......
...@@ -107,7 +107,7 @@ static int fcoe_dcb_app_notification(struct notifier_block *notifier, ...@@ -107,7 +107,7 @@ static int fcoe_dcb_app_notification(struct notifier_block *notifier,
ulong event, void *ptr); ulong event, void *ptr);
static bool fcoe_match(struct net_device *netdev); static bool fcoe_match(struct net_device *netdev);
static int fcoe_create(struct net_device *netdev, enum fip_state fip_mode); static int fcoe_create(struct net_device *netdev, enum fip_mode fip_mode);
static int fcoe_destroy(struct net_device *netdev); static int fcoe_destroy(struct net_device *netdev);
static int fcoe_enable(struct net_device *netdev); static int fcoe_enable(struct net_device *netdev);
static int fcoe_disable(struct net_device *netdev); static int fcoe_disable(struct net_device *netdev);
...@@ -2133,7 +2133,7 @@ enum fcoe_create_link_state { ...@@ -2133,7 +2133,7 @@ enum fcoe_create_link_state {
* consolidation of code can be done when that interface is * consolidation of code can be done when that interface is
* removed. * removed.
*/ */
static int _fcoe_create(struct net_device *netdev, enum fip_state fip_mode, static int _fcoe_create(struct net_device *netdev, enum fip_mode fip_mode,
enum fcoe_create_link_state link_state) enum fcoe_create_link_state link_state)
{ {
int rc = 0; int rc = 0;
...@@ -2222,7 +2222,7 @@ static int _fcoe_create(struct net_device *netdev, enum fip_state fip_mode, ...@@ -2222,7 +2222,7 @@ static int _fcoe_create(struct net_device *netdev, enum fip_state fip_mode,
* *
* Returns: 0 for success * Returns: 0 for success
*/ */
static int fcoe_create(struct net_device *netdev, enum fip_state fip_mode) static int fcoe_create(struct net_device *netdev, enum fip_mode fip_mode)
{ {
return _fcoe_create(netdev, fip_mode, FCOE_CREATE_LINK_UP); return _fcoe_create(netdev, fip_mode, FCOE_CREATE_LINK_UP);
} }
......
...@@ -2864,7 +2864,7 @@ static void fcoe_ctlr_vn_timeout(struct fcoe_ctlr *fip) ...@@ -2864,7 +2864,7 @@ static void fcoe_ctlr_vn_timeout(struct fcoe_ctlr *fip)
* when nothing is happening. * when nothing is happening.
*/ */
static void fcoe_ctlr_mode_set(struct fc_lport *lport, struct fcoe_ctlr *fip, static void fcoe_ctlr_mode_set(struct fc_lport *lport, struct fcoe_ctlr *fip,
enum fip_state fip_mode) enum fip_mode fip_mode)
{ {
void *priv; void *priv;
......
...@@ -1308,7 +1308,7 @@ void fnic_handle_fip_timer(struct fnic *fnic) ...@@ -1308,7 +1308,7 @@ void fnic_handle_fip_timer(struct fnic *fnic)
} }
spin_unlock_irqrestore(&fnic->fnic_lock, flags); spin_unlock_irqrestore(&fnic->fnic_lock, flags);
if (fnic->ctlr.mode == FIP_ST_NON_FIP) if (fnic->ctlr.mode == FIP_MODE_NON_FIP)
return; return;
spin_lock_irqsave(&fnic->vlans_lock, flags); spin_lock_irqsave(&fnic->vlans_lock, flags);
......
...@@ -78,10 +78,12 @@ enum fip_state { ...@@ -78,10 +78,12 @@ enum fip_state {
* The mode is the state that is to be entered after link up. * The mode is the state that is to be entered after link up.
* It must not change after fcoe_ctlr_init() sets it. * It must not change after fcoe_ctlr_init() sets it.
*/ */
#define FIP_MODE_AUTO FIP_ST_AUTO enum fip_mode {
#define FIP_MODE_NON_FIP FIP_ST_NON_FIP FIP_MODE_AUTO = FIP_ST_AUTO,
#define FIP_MODE_FABRIC FIP_ST_ENABLED FIP_MODE_NON_FIP,
#define FIP_MODE_VN2VN FIP_ST_VNMP_START FIP_MODE_FABRIC,
FIP_MODE_VN2VN,
};
/** /**
* struct fcoe_ctlr - FCoE Controller and FIP state * struct fcoe_ctlr - FCoE Controller and FIP state
...@@ -124,7 +126,7 @@ enum fip_state { ...@@ -124,7 +126,7 @@ enum fip_state {
*/ */
struct fcoe_ctlr { struct fcoe_ctlr {
enum fip_state state; enum fip_state state;
enum fip_state mode; enum fip_mode mode;
struct fc_lport *lp; struct fc_lport *lp;
struct fcoe_fcf *sel_fcf; struct fcoe_fcf *sel_fcf;
struct list_head fcfs; struct list_head fcfs;
...@@ -311,7 +313,7 @@ struct fcoe_transport { ...@@ -311,7 +313,7 @@ struct fcoe_transport {
struct list_head list; struct list_head list;
bool (*match) (struct net_device *device); bool (*match) (struct net_device *device);
int (*alloc) (struct net_device *device); int (*alloc) (struct net_device *device);
int (*create) (struct net_device *device, enum fip_state fip_mode); int (*create) (struct net_device *device, enum fip_mode fip_mode);
int (*destroy) (struct net_device *device); int (*destroy) (struct net_device *device);
int (*enable) (struct net_device *device); int (*enable) (struct net_device *device);
int (*disable) (struct net_device *device); int (*disable) (struct net_device *device);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment