Skip to content

Commit 1917d42

Browse files
hreineckemartinkpetersen
authored andcommitted
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: Hannes Reinecke <hare@suse.com> Acked-by: Johannes Thumshirn <jth@kernel.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 6a551c1 commit 1917d42

File tree

5 files changed

+16
-14
lines changed

5 files changed

+16
-14
lines changed

drivers/scsi/bnx2fc/bnx2fc_fcoe.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ static struct scsi_host_template bnx2fc_shost_template;
5757
static struct fc_function_template bnx2fc_transport_function;
5858
static struct fcoe_sysfs_function_template bnx2fc_fcoe_sysfs_templ;
5959
static struct fc_function_template bnx2fc_vport_xport_function;
60-
static int bnx2fc_create(struct net_device *netdev, enum fip_state fip_mode);
60+
static int bnx2fc_create(struct net_device *netdev, enum fip_mode fip_mode);
6161
static void __bnx2fc_destroy(struct bnx2fc_interface *interface);
6262
static int bnx2fc_destroy(struct net_device *net_device);
6363
static int bnx2fc_enable(struct net_device *netdev);
@@ -2260,7 +2260,7 @@ enum bnx2fc_create_link_state {
22602260
* Returns: 0 for success
22612261
*/
22622262
static int _bnx2fc_create(struct net_device *netdev,
2263-
enum fip_state fip_mode,
2263+
enum fip_mode fip_mode,
22642264
enum bnx2fc_create_link_state link_state)
22652265
{
22662266
struct fcoe_ctlr_device *cdev;
@@ -2412,7 +2412,7 @@ static int _bnx2fc_create(struct net_device *netdev,
24122412
*
24132413
* Returns: 0 for success
24142414
*/
2415-
static int bnx2fc_create(struct net_device *netdev, enum fip_state fip_mode)
2415+
static int bnx2fc_create(struct net_device *netdev, enum fip_mode fip_mode)
24162416
{
24172417
return _bnx2fc_create(netdev, fip_mode, BNX2FC_CREATE_LINK_UP);
24182418
}

drivers/scsi/fcoe/fcoe.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ static int fcoe_dcb_app_notification(struct notifier_block *notifier,
107107
ulong event, void *ptr);
108108

109109
static bool fcoe_match(struct net_device *netdev);
110-
static int fcoe_create(struct net_device *netdev, enum fip_state fip_mode);
110+
static int fcoe_create(struct net_device *netdev, enum fip_mode fip_mode);
111111
static int fcoe_destroy(struct net_device *netdev);
112112
static int fcoe_enable(struct net_device *netdev);
113113
static int fcoe_disable(struct net_device *netdev);
@@ -2133,7 +2133,7 @@ enum fcoe_create_link_state {
21332133
* consolidation of code can be done when that interface is
21342134
* removed.
21352135
*/
2136-
static int _fcoe_create(struct net_device *netdev, enum fip_state fip_mode,
2136+
static int _fcoe_create(struct net_device *netdev, enum fip_mode fip_mode,
21372137
enum fcoe_create_link_state link_state)
21382138
{
21392139
int rc = 0;
@@ -2222,7 +2222,7 @@ static int _fcoe_create(struct net_device *netdev, enum fip_state fip_mode,
22222222
*
22232223
* Returns: 0 for success
22242224
*/
2225-
static int fcoe_create(struct net_device *netdev, enum fip_state fip_mode)
2225+
static int fcoe_create(struct net_device *netdev, enum fip_mode fip_mode)
22262226
{
22272227
return _fcoe_create(netdev, fip_mode, FCOE_CREATE_LINK_UP);
22282228
}

drivers/scsi/fcoe/fcoe_ctlr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2864,7 +2864,7 @@ static void fcoe_ctlr_vn_timeout(struct fcoe_ctlr *fip)
28642864
* when nothing is happening.
28652865
*/
28662866
static void fcoe_ctlr_mode_set(struct fc_lport *lport, struct fcoe_ctlr *fip,
2867-
enum fip_state fip_mode)
2867+
enum fip_mode fip_mode)
28682868
{
28692869
void *priv;
28702870

drivers/scsi/fnic/fnic_fcs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1308,7 +1308,7 @@ void fnic_handle_fip_timer(struct fnic *fnic)
13081308
}
13091309
spin_unlock_irqrestore(&fnic->fnic_lock, flags);
13101310

1311-
if (fnic->ctlr.mode == FIP_ST_NON_FIP)
1311+
if (fnic->ctlr.mode == FIP_MODE_NON_FIP)
13121312
return;
13131313

13141314
spin_lock_irqsave(&fnic->vlans_lock, flags);

include/scsi/libfcoe.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,12 @@ enum fip_state {
7878
* The mode is the state that is to be entered after link up.
7979
* It must not change after fcoe_ctlr_init() sets it.
8080
*/
81-
#define FIP_MODE_AUTO FIP_ST_AUTO
82-
#define FIP_MODE_NON_FIP FIP_ST_NON_FIP
83-
#define FIP_MODE_FABRIC FIP_ST_ENABLED
84-
#define FIP_MODE_VN2VN FIP_ST_VNMP_START
81+
enum fip_mode {
82+
FIP_MODE_AUTO = FIP_ST_AUTO,
83+
FIP_MODE_NON_FIP,
84+
FIP_MODE_FABRIC,
85+
FIP_MODE_VN2VN,
86+
};
8587

8688
/**
8789
* struct fcoe_ctlr - FCoE Controller and FIP state
@@ -124,7 +126,7 @@ enum fip_state {
124126
*/
125127
struct fcoe_ctlr {
126128
enum fip_state state;
127-
enum fip_state mode;
129+
enum fip_mode mode;
128130
struct fc_lport *lp;
129131
struct fcoe_fcf *sel_fcf;
130132
struct list_head fcfs;
@@ -311,7 +313,7 @@ struct fcoe_transport {
311313
struct list_head list;
312314
bool (*match) (struct net_device *device);
313315
int (*alloc) (struct net_device *device);
314-
int (*create) (struct net_device *device, enum fip_state fip_mode);
316+
int (*create) (struct net_device *device, enum fip_mode fip_mode);
315317
int (*destroy) (struct net_device *device);
316318
int (*enable) (struct net_device *device);
317319
int (*disable) (struct net_device *device);

0 commit comments

Comments
 (0)