@@ -1242,31 +1242,29 @@ bool fdls_delete_tport(struct fnic_iport_s *iport, struct fnic_tport_s *tport)
1242
1242
tport -> timer_pending = 0 ;
1243
1243
}
1244
1244
1245
- if (IS_FNIC_FCP_INITIATOR (fnic )) {
1246
- spin_unlock_irqrestore (& fnic -> fnic_lock , fnic -> lock_flags );
1247
- fnic_rport_exch_reset (iport -> fnic , tport -> fcid );
1248
- spin_lock_irqsave (& fnic -> fnic_lock , fnic -> lock_flags );
1245
+ spin_unlock_irqrestore (& fnic -> fnic_lock , fnic -> lock_flags );
1246
+ fnic_rport_exch_reset (iport -> fnic , tport -> fcid );
1247
+ spin_lock_irqsave (& fnic -> fnic_lock , fnic -> lock_flags );
1249
1248
1250
- if (tport -> flags & FNIC_FDLS_SCSI_REGISTERED ) {
1251
- tport_del_evt =
1252
- kzalloc (sizeof (struct fnic_tport_event_s ), GFP_ATOMIC );
1253
- if (!tport_del_evt ) {
1254
- FNIC_FCS_DBG (KERN_INFO , fnic -> host , fnic -> fnic_num ,
1255
- "Failed to allocate memory for tport fcid: 0x%0x\n" ,
1256
- tport -> fcid );
1257
- return false;
1258
- }
1259
- tport_del_evt -> event = TGT_EV_RPORT_DEL ;
1260
- tport_del_evt -> arg1 = (void * ) tport ;
1261
- list_add_tail (& tport_del_evt -> links , & fnic -> tport_event_list );
1262
- queue_work (fnic_event_queue , & fnic -> tport_work );
1263
- } else {
1249
+ if (tport -> flags & FNIC_FDLS_SCSI_REGISTERED ) {
1250
+ tport_del_evt =
1251
+ kzalloc (sizeof (struct fnic_tport_event_s ), GFP_ATOMIC );
1252
+ if (!tport_del_evt ) {
1264
1253
FNIC_FCS_DBG (KERN_INFO , fnic -> host , fnic -> fnic_num ,
1265
- "tport 0x%x not reg with scsi_transport. Freeing locally " ,
1254
+ "Failed to allocate memory for tport fcid: 0x%0x\n " ,
1266
1255
tport -> fcid );
1267
- list_del (& tport -> links );
1268
- kfree (tport );
1256
+ return false;
1269
1257
}
1258
+ tport_del_evt -> event = TGT_EV_RPORT_DEL ;
1259
+ tport_del_evt -> arg1 = (void * ) tport ;
1260
+ list_add_tail (& tport_del_evt -> links , & fnic -> tport_event_list );
1261
+ queue_work (fnic_event_queue , & fnic -> tport_work );
1262
+ } else {
1263
+ FNIC_FCS_DBG (KERN_INFO , fnic -> host , fnic -> fnic_num ,
1264
+ "tport 0x%x not reg with scsi_transport. Freeing locally" ,
1265
+ tport -> fcid );
1266
+ list_del (& tport -> links );
1267
+ kfree (tport );
1270
1268
}
1271
1269
return true;
1272
1270
}
@@ -1388,8 +1386,7 @@ static void fdls_send_register_fc4_types(struct fnic_iport_s *iport)
1388
1386
"0x%x: FDLS send RFT with oxid: 0x%x" , iport -> fcid ,
1389
1387
oxid );
1390
1388
1391
- if (IS_FNIC_FCP_INITIATOR (fnic ))
1392
- prft_id -> rft_id .fr_fts .ff_type_map [0 ] =
1389
+ prft_id -> rft_id .fr_fts .ff_type_map [0 ] =
1393
1390
cpu_to_be32 (1 << FC_TYPE_FCP );
1394
1391
1395
1392
prft_id -> rft_id .fr_fts .ff_type_map [1 ] =
@@ -1451,12 +1448,7 @@ static void fdls_send_register_fc4_features(struct fnic_iport_s *iport)
1451
1448
"0x%x: FDLS send RFF with oxid: 0x%x" , iport -> fcid ,
1452
1449
oxid );
1453
1450
1454
- if (IS_FNIC_FCP_INITIATOR (fnic )) {
1455
- prff_id -> rff_id .fr_type = FC_TYPE_FCP ;
1456
- } else {
1457
- FNIC_FCS_DBG (KERN_INFO , fnic -> host , fnic -> fnic_num ,
1458
- "0x%x: Unknown type" , iport -> fcid );
1459
- }
1451
+ prff_id -> rff_id .fr_type = FC_TYPE_FCP ;
1460
1452
1461
1453
fnic_send_fcoe_frame (iport , frame , frame_size );
1462
1454
@@ -2333,9 +2325,6 @@ static void fdls_send_delete_tport_msg(struct fnic_tport_s *tport)
2333
2325
struct fnic * fnic = iport -> fnic ;
2334
2326
struct fnic_tport_event_s * tport_del_evt ;
2335
2327
2336
- if (!IS_FNIC_FCP_INITIATOR (fnic ))
2337
- return ;
2338
-
2339
2328
tport_del_evt = kzalloc (sizeof (struct fnic_tport_event_s ), GFP_ATOMIC );
2340
2329
if (!tport_del_evt ) {
2341
2330
FNIC_FCS_DBG (KERN_INFO , fnic -> host , fnic -> fnic_num ,
@@ -3485,11 +3474,9 @@ fdls_process_flogi_rsp(struct fnic_iport_s *iport,
3485
3474
"From fabric: R_A_TOV: %d E_D_TOV: %d" ,
3486
3475
iport -> r_a_tov , iport -> e_d_tov );
3487
3476
3488
- if (IS_FNIC_FCP_INITIATOR (fnic )) {
3489
- fc_host_fabric_name (iport -> fnic -> host ) =
3490
- get_unaligned_be64 (& FNIC_LOGI_NODE_NAME (flogi_rsp -> els ));
3491
- fc_host_port_id (iport -> fnic -> host ) = iport -> fcid ;
3492
- }
3477
+ fc_host_fabric_name (iport -> fnic -> host ) =
3478
+ get_unaligned_be64 (& FNIC_LOGI_NODE_NAME (flogi_rsp -> els ));
3479
+ fc_host_port_id (iport -> fnic -> host ) = iport -> fcid ;
3493
3480
3494
3481
fnic_fdls_learn_fcoe_macs (iport , rx_frame , fcid );
3495
3482
@@ -4526,11 +4513,9 @@ void fnic_fdls_disc_start(struct fnic_iport_s *iport)
4526
4513
{
4527
4514
struct fnic * fnic = iport -> fnic ;
4528
4515
4529
- if (IS_FNIC_FCP_INITIATOR (fnic )) {
4530
- fc_host_fabric_name (iport -> fnic -> host ) = 0 ;
4531
- fc_host_post_event (iport -> fnic -> host , fc_get_event_number (),
4532
- FCH_EVT_LIPRESET , 0 );
4533
- }
4516
+ fc_host_fabric_name (iport -> fnic -> host ) = 0 ;
4517
+ fc_host_post_event (iport -> fnic -> host , fc_get_event_number (),
4518
+ FCH_EVT_LIPRESET , 0 );
4534
4519
4535
4520
if (!iport -> usefip ) {
4536
4521
if (iport -> flags & FNIC_FIRST_LINK_UP ) {
@@ -4993,15 +4978,13 @@ void fnic_fdls_link_down(struct fnic_iport_s *iport)
4993
4978
fdls_set_state ((& iport -> fabric ), FDLS_STATE_LINKDOWN );
4994
4979
iport -> fabric .flags = 0 ;
4995
4980
4996
- if (IS_FNIC_FCP_INITIATOR (fnic )) {
4997
- spin_unlock_irqrestore (& fnic -> fnic_lock , fnic -> lock_flags );
4998
- fnic_scsi_fcpio_reset (iport -> fnic );
4999
- spin_lock_irqsave (& fnic -> fnic_lock , fnic -> lock_flags );
5000
- list_for_each_entry_safe (tport , next , & iport -> tport_list , links ) {
5001
- FNIC_FCS_DBG (KERN_INFO , fnic -> host , fnic -> fnic_num ,
5002
- "removing rport: 0x%x" , tport -> fcid );
5003
- fdls_delete_tport (iport , tport );
5004
- }
4981
+ spin_unlock_irqrestore (& fnic -> fnic_lock , fnic -> lock_flags );
4982
+ fnic_scsi_fcpio_reset (iport -> fnic );
4983
+ spin_lock_irqsave (& fnic -> fnic_lock , fnic -> lock_flags );
4984
+ list_for_each_entry_safe (tport , next , & iport -> tport_list , links ) {
4985
+ FNIC_FCS_DBG (KERN_INFO , fnic -> host , fnic -> fnic_num ,
4986
+ "removing rport: 0x%x" , tport -> fcid );
4987
+ fdls_delete_tport (iport , tport );
5005
4988
}
5006
4989
5007
4990
if ((fnic_fdmi_support == 1 ) && (iport -> fabric .fdmi_pending > 0 )) {
0 commit comments