Skip to content

Commit 06506d0

Browse files
Andreas HerrmannJames Bottomley
authored andcommitted
[SCSI] zfcp: (cleanup) removed superfluous macros, struct members, typedefs
Removed some macros, struct members and typedefs which were unused or not necessary. Signed-off-by: Andreas Herrmann <aherrman@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
1 parent ec4081c commit 06506d0

File tree

7 files changed

+41
-122
lines changed

7 files changed

+41
-122
lines changed

drivers/s390/scsi/zfcp_aux.c

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ struct zfcp_unit *
740740
zfcp_unit_enqueue(struct zfcp_port *port, fcp_lun_t fcp_lun)
741741
{
742742
struct zfcp_unit *unit, *tmp_unit;
743-
scsi_lun_t scsi_lun;
743+
unsigned int scsi_lun;
744744
int found;
745745

746746
/*
@@ -991,12 +991,6 @@ zfcp_adapter_enqueue(struct ccw_device *ccw_device)
991991
/* intitialise SCSI ER timer */
992992
init_timer(&adapter->scsi_er_timer);
993993

994-
/* set FC service class used per default */
995-
adapter->fc_service_class = ZFCP_FC_SERVICE_CLASS_DEFAULT;
996-
997-
sprintf(adapter->name, "%s", zfcp_get_busid_by_adapter(adapter));
998-
ASCEBC(adapter->name, strlen(adapter->name));
999-
1000994
/* mark adapter unusable as long as sysfs registration is not complete */
1001995
atomic_set_mask(ZFCP_STATUS_COMMON_REMOVE, &adapter->status);
1002996

@@ -1347,18 +1341,19 @@ static void
13471341
zfcp_fsf_incoming_els_plogi(struct zfcp_adapter *adapter,
13481342
struct fsf_status_read_buffer *status_buffer)
13491343
{
1350-
logi *els_logi = (logi *) status_buffer->payload;
1344+
struct fsf_plogi *els_plogi;
13511345
struct zfcp_port *port;
13521346
unsigned long flags;
13531347

1348+
els_plogi = (struct fsf_plogi *) status_buffer->payload;
13541349
read_lock_irqsave(&zfcp_data.config_lock, flags);
13551350
list_for_each_entry(port, &adapter->port_list_head, list) {
1356-
if (port->wwpn == (*(wwn_t *) & els_logi->nport_wwn))
1351+
if (port->wwpn == (*(wwn_t *) &els_plogi->serv_param.wwpn))
13571352
break;
13581353
}
13591354
read_unlock_irqrestore(&zfcp_data.config_lock, flags);
13601355

1361-
if (!port || (port->wwpn != (*(wwn_t *) & els_logi->nport_wwn))) {
1356+
if (!port || (port->wwpn != (*(wwn_t *) &els_plogi->serv_param.wwpn))) {
13621357
ZFCP_LOG_DEBUG("ignored incoming PLOGI for nonexisting port "
13631358
"with d_id 0x%08x on adapter %s\n",
13641359
status_buffer->d_id,

drivers/s390/scsi/zfcp_def.h

Lines changed: 6 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
#include <scsi/scsi_host.h>
4040
#include <scsi/scsi_transport.h>
4141
#include <scsi/scsi_transport_fc.h>
42-
#include "../../fc4/fc.h"
4342
#include "zfcp_fsf.h"
4443
#include <asm/ccwdev.h>
4544
#include <asm/qdio.h>
@@ -78,13 +77,9 @@ zfcp_address_to_sg(void *address, struct scatterlist *list)
7877
list->offset = ((unsigned long) address) & (PAGE_SIZE - 1);
7978
}
8079

81-
/********************* SCSI SPECIFIC DEFINES *********************************/
82-
83-
/* 32 bit for SCSI ID and LUN as long as the SCSI stack uses this type */
84-
typedef u32 scsi_id_t;
85-
typedef u32 scsi_lun_t;
80+
#define REQUEST_LIST_SIZE 128
8681

87-
#define ZFCP_ERP_SCSI_LOW_MEM_TIMEOUT (100*HZ)
82+
/********************* SCSI SPECIFIC DEFINES *********************************/
8883
#define ZFCP_SCSI_ER_TIMEOUT (100*HZ)
8984

9085
/********************* CIO/QDIO SPECIFIC DEFINES *****************************/
@@ -222,8 +217,9 @@ struct fcp_rsp_iu {
222217
#define RSP_CODE_TASKMAN_FAILED 5
223218

224219
/* see fc-fs */
225-
#define LS_FAN 0x60000000
226-
#define LS_RSCN 0x61040000
220+
#define LS_RSCN 0x61040000
221+
#define LS_LOGO 0x05000000
222+
#define LS_PLOGI 0x03000000
227223

228224
struct fcp_rscn_head {
229225
u8 command;
@@ -252,13 +248,6 @@ struct fcp_rscn_element {
252248
#define ZFCP_NO_PORTS_PER_DOMAIN 0x10000
253249
#define ZFCP_NO_PORTS_PER_FABRIC 0x1000000
254250

255-
struct fcp_fan {
256-
u32 command;
257-
u32 fport_did;
258-
wwn_t fport_wwpn;
259-
wwn_t fport_wwname;
260-
} __attribute__((packed));
261-
262251
/* see fc-ph */
263252
struct fcp_logo {
264253
u32 command;
@@ -496,9 +485,6 @@ struct zfcp_rc_entry {
496485

497486
#define ZFCP_NAME "zfcp"
498487

499-
/* read-only LUN sharing switch initial value */
500-
#define ZFCP_RO_LUN_SHARING_DEFAULTS 0
501-
502488
/* independent log areas */
503489
#define ZFCP_LOG_AREA_OTHER 0
504490
#define ZFCP_LOG_AREA_SCSI 1
@@ -597,7 +583,6 @@ do { \
597583
* and unit
598584
*/
599585
#define ZFCP_COMMON_FLAGS 0xfff00000
600-
#define ZFCP_SPECIFIC_FLAGS 0x000fffff
601586

602587
/* common status bits */
603588
#define ZFCP_STATUS_COMMON_REMOVE 0x80000000
@@ -622,11 +607,6 @@ do { \
622607
#define ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED 0x00000200
623608
#define ZFCP_STATUS_ADAPTER_XPORT_OK 0x00000800
624609

625-
#define ZFCP_STATUS_ADAPTER_SCSI_UP \
626-
(ZFCP_STATUS_COMMON_UNBLOCKED | \
627-
ZFCP_STATUS_ADAPTER_REGISTERED)
628-
629-
630610
/* FC-PH/FC-GS well-known address identifiers for generic services */
631611
#define ZFCP_DID_MANAGEMENT_SERVICE 0xFFFFFA
632612
#define ZFCP_DID_TIME_SERVICE 0xFFFFFB
@@ -641,7 +621,6 @@ do { \
641621
#define ZFCP_STATUS_PORT_NO_WWPN 0x00000008
642622
#define ZFCP_STATUS_PORT_NO_SCSI_ID 0x00000010
643623
#define ZFCP_STATUS_PORT_INVALID_WWPN 0x00000020
644-
#define ZFCP_STATUS_PORT_ACCESS_DENIED 0x00000040
645624

646625
/* for ports with well known addresses */
647626
#define ZFCP_STATUS_PORT_WKA \
@@ -897,15 +876,12 @@ struct zfcp_adapter {
897876
wwn_t peer_wwpn; /* P2P peer WWPN */
898877
u32 peer_d_id; /* P2P peer D_ID */
899878
struct ccw_device *ccw_device; /* S/390 ccw device */
900-
u8 fc_service_class;
901879
u32 hydra_version; /* Hydra version */
902880
u32 fsf_lic_version;
903881
u32 adapter_features; /* FCP channel features */
904882
u32 connection_features; /* host connection features */
905883
u32 hardware_version; /* of FCP channel */
906884
struct Scsi_Host *scsi_host; /* Pointer to mid-layer */
907-
unsigned short scsi_host_no; /* Assigned host number */
908-
unsigned char name[9];
909885
struct list_head port_list_head; /* remote port list */
910886
struct list_head port_remove_lh; /* head of ports to be
911887
removed */
@@ -997,7 +973,7 @@ struct zfcp_unit {
997973
refcount drop to zero */
998974
struct zfcp_port *port; /* remote port of unit */
999975
atomic_t status; /* status of this logical unit */
1000-
scsi_lun_t scsi_lun; /* own SCSI LUN */
976+
unsigned int scsi_lun; /* own SCSI LUN */
1001977
fcp_lun_t fcp_lun; /* own FCP_LUN */
1002978
u32 handle; /* handle assigned by FSF */
1003979
struct scsi_device *device; /* scsi device struct pointer */
@@ -1041,11 +1017,6 @@ struct zfcp_data {
10411017
struct list_head adapter_list_head; /* head of adapter list */
10421018
struct list_head adapter_remove_lh; /* head of adapters to be
10431019
removed */
1044-
rwlock_t status_read_lock; /* for status read thread */
1045-
struct list_head status_read_receive_head;
1046-
struct list_head status_read_send_head;
1047-
struct semaphore status_read_sema;
1048-
wait_queue_head_t status_read_thread_wqh;
10491020
u32 adapters; /* # of adapters in list */
10501021
rwlock_t config_lock; /* serialises changes
10511022
to adapter/port/unit
@@ -1084,19 +1055,13 @@ struct zfcp_fsf_req_pool_element {
10841055

10851056
/********************** ZFCP SPECIFIC DEFINES ********************************/
10861057

1087-
#define ZFCP_FSFREQ_CLEANUP_TIMEOUT HZ/10
1088-
1089-
#define ZFCP_KNOWN 0x00000001
10901058
#define ZFCP_REQ_AUTO_CLEANUP 0x00000002
10911059
#define ZFCP_WAIT_FOR_SBAL 0x00000004
10921060
#define ZFCP_REQ_NO_QTCB 0x00000008
10931061

10941062
#define ZFCP_SET 0x00000100
10951063
#define ZFCP_CLEAR 0x00000200
10961064

1097-
#define ZFCP_INTERRUPTIBLE 1
1098-
#define ZFCP_UNINTERRUPTIBLE 0
1099-
11001065
#ifndef atomic_test_mask
11011066
#define atomic_test_mask(mask, target) \
11021067
((atomic_read(target) & mask) == mask)

drivers/s390/scsi/zfcp_erp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3407,7 +3407,7 @@ zfcp_erp_adapter_access_changed(struct zfcp_adapter *adapter)
34073407
return;
34083408

34093409
debug_text_event(adapter->erp_dbf, 3, "a_access_recover");
3410-
debug_event(adapter->erp_dbf, 3, &adapter->name, 8);
3410+
debug_event(adapter->erp_dbf, 3, zfcp_get_busid_by_adapter(adapter), 8);
34113411

34123412
read_lock_irqsave(&zfcp_data.config_lock, flags);
34133413
if (adapter->nameserver_port)

drivers/s390/scsi/zfcp_fsf.c

Lines changed: 20 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1416,7 +1416,8 @@ zfcp_fsf_send_ct(struct zfcp_send_ct *ct, mempool_t *pool,
14161416

14171417
/* settings in QTCB */
14181418
fsf_req->qtcb->header.port_handle = port->handle;
1419-
fsf_req->qtcb->bottom.support.service_class = adapter->fc_service_class;
1419+
fsf_req->qtcb->bottom.support.service_class =
1420+
ZFCP_FC_SERVICE_CLASS_DEFAULT;
14201421
fsf_req->qtcb->bottom.support.timeout = ct->timeout;
14211422
fsf_req->data = (unsigned long) ct;
14221423

@@ -1485,18 +1486,10 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req)
14851486
break;
14861487

14871488
case FSF_SERVICE_CLASS_NOT_SUPPORTED:
1488-
if (adapter->fc_service_class <= 3) {
1489-
ZFCP_LOG_INFO("error: adapter %s does not support fc "
1490-
"class %d.\n",
1491-
zfcp_get_busid_by_port(port),
1492-
adapter->fc_service_class);
1493-
} else {
1494-
ZFCP_LOG_INFO("bug: The fibre channel class at the "
1495-
"adapter %s is invalid. "
1496-
"(debug info %d)\n",
1497-
zfcp_get_busid_by_port(port),
1498-
adapter->fc_service_class);
1499-
}
1489+
ZFCP_LOG_INFO("error: adapter %s does not support fc "
1490+
"class %d.\n",
1491+
zfcp_get_busid_by_port(port),
1492+
ZFCP_FC_SERVICE_CLASS_DEFAULT);
15001493
/* stop operation for this adapter */
15011494
debug_text_exception(adapter->erp_dbf, 0, "fsf_s_class_nsup");
15021495
zfcp_erp_adapter_shutdown(adapter, 0);
@@ -1719,7 +1712,8 @@ zfcp_fsf_send_els(struct zfcp_send_els *els)
17191712

17201713
/* settings in QTCB */
17211714
fsf_req->qtcb->bottom.support.d_id = d_id;
1722-
fsf_req->qtcb->bottom.support.service_class = adapter->fc_service_class;
1715+
fsf_req->qtcb->bottom.support.service_class =
1716+
ZFCP_FC_SERVICE_CLASS_DEFAULT;
17231717
fsf_req->qtcb->bottom.support.timeout = ZFCP_ELS_TIMEOUT;
17241718
fsf_req->data = (unsigned long) els;
17251719

@@ -1789,18 +1783,10 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req)
17891783
break;
17901784

17911785
case FSF_SERVICE_CLASS_NOT_SUPPORTED:
1792-
if (adapter->fc_service_class <= 3) {
1793-
ZFCP_LOG_INFO("error: adapter %s does "
1794-
"not support fibrechannel class %d.\n",
1795-
zfcp_get_busid_by_adapter(adapter),
1796-
adapter->fc_service_class);
1797-
} else {
1798-
ZFCP_LOG_INFO("bug: The fibrechannel class at "
1799-
"adapter %s is invalid. "
1800-
"(debug info %d)\n",
1801-
zfcp_get_busid_by_adapter(adapter),
1802-
adapter->fc_service_class);
1803-
}
1786+
ZFCP_LOG_INFO("error: adapter %s does not support fc "
1787+
"class %d.\n",
1788+
zfcp_get_busid_by_adapter(adapter),
1789+
ZFCP_FC_SERVICE_CLASS_DEFAULT);
18041790
/* stop operation for this adapter */
18051791
debug_text_exception(adapter->erp_dbf, 0, "fsf_s_class_nsup");
18061792
zfcp_erp_adapter_shutdown(adapter, 0);
@@ -2974,8 +2960,8 @@ zfcp_fsf_open_unit(struct zfcp_erp_action *erp_action)
29742960
erp_action->fsf_req->qtcb->bottom.support.fcp_lun =
29752961
erp_action->unit->fcp_lun;
29762962
if (!(erp_action->adapter->connection_features & FSF_FEATURE_NPIV_MODE))
2977-
erp_action->fsf_req->qtcb->bottom.support.option =
2978-
FSF_OPEN_LUN_SUPPRESS_BOXING;
2963+
erp_action->fsf_req->qtcb->bottom.support.option =
2964+
FSF_OPEN_LUN_SUPPRESS_BOXING;
29792965
atomic_set_mask(ZFCP_STATUS_COMMON_OPENING, &erp_action->unit->status);
29802966
erp_action->fsf_req->data = (unsigned long) erp_action->unit;
29812967
erp_action->fsf_req->erp_action = erp_action;
@@ -3550,7 +3536,7 @@ zfcp_fsf_send_fcp_command_task(struct zfcp_adapter *adapter,
35503536
}
35513537

35523538
/* set FC service class in QTCB (3 per default) */
3553-
fsf_req->qtcb->bottom.io.service_class = adapter->fc_service_class;
3539+
fsf_req->qtcb->bottom.io.service_class = ZFCP_FC_SERVICE_CLASS_DEFAULT;
35543540

35553541
/* set FCP_LUN in FCP_CMND IU in QTCB */
35563542
fcp_cmnd_iu->fcp_lun = unit->fcp_lun;
@@ -3689,7 +3675,7 @@ zfcp_fsf_send_fcp_command_task_management(struct zfcp_adapter *adapter,
36893675
fsf_req->qtcb->header.lun_handle = unit->handle;
36903676
fsf_req->qtcb->header.port_handle = unit->port->handle;
36913677
fsf_req->qtcb->bottom.io.data_direction = FSF_DATADIR_CMND;
3692-
fsf_req->qtcb->bottom.io.service_class = adapter->fc_service_class;
3678+
fsf_req->qtcb->bottom.io.service_class = ZFCP_FC_SERVICE_CLASS_DEFAULT;
36933679
fsf_req->qtcb->bottom.io.fcp_cmnd_length =
36943680
sizeof (struct fcp_cmnd_iu) + sizeof (fcp_dl_t);
36953681

@@ -3812,18 +3798,10 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req)
38123798
break;
38133799

38143800
case FSF_SERVICE_CLASS_NOT_SUPPORTED:
3815-
if (fsf_req->adapter->fc_service_class <= 3) {
3816-
ZFCP_LOG_NORMAL("error: The adapter %s does "
3817-
"not support fibrechannel class %d.\n",
3818-
zfcp_get_busid_by_unit(unit),
3819-
fsf_req->adapter->fc_service_class);
3820-
} else {
3821-
ZFCP_LOG_NORMAL("bug: The fibrechannel class at "
3822-
"adapter %s is invalid. "
3823-
"(debug info %d)\n",
3824-
zfcp_get_busid_by_unit(unit),
3825-
fsf_req->adapter->fc_service_class);
3826-
}
3801+
ZFCP_LOG_INFO("error: adapter %s does not support fc "
3802+
"class %d.\n",
3803+
zfcp_get_busid_by_unit(unit),
3804+
ZFCP_FC_SERVICE_CLASS_DEFAULT);
38273805
/* stop operation for this adapter */
38283806
debug_text_exception(fsf_req->adapter->erp_dbf, 0,
38293807
"fsf_s_class_nsup");

drivers/s390/scsi/zfcp_fsf.h

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@
2222
#ifndef FSF_H
2323
#define FSF_H
2424

25-
#define FSF_QTCB_VERSION1 0x00000001
26-
#define FSF_QTCB_CURRENT_VERSION FSF_QTCB_VERSION1
25+
#define FSF_QTCB_CURRENT_VERSION 0x00000001
2726

2827
/* FSF commands */
2928
#define FSF_QTCB_FCP_CMND 0x00000001
@@ -53,7 +52,7 @@
5352
#define FSF_CFDC_OPTION_FULL_ACCESS 0x00000002
5453
#define FSF_CFDC_OPTION_RESTRICTED_ACCESS 0x00000004
5554

56-
/* FSF protocol stati */
55+
/* FSF protocol states */
5756
#define FSF_PROT_GOOD 0x00000001
5857
#define FSF_PROT_QTCB_VERSION_ERROR 0x00000010
5958
#define FSF_PROT_SEQ_NUMB_ERROR 0x00000020
@@ -65,7 +64,7 @@
6564
#define FSF_PROT_REEST_QUEUE 0x00000800
6665
#define FSF_PROT_ERROR_STATE 0x01000000
6766

68-
/* FSF stati */
67+
/* FSF states */
6968
#define FSF_GOOD 0x00000000
7069
#define FSF_PORT_ALREADY_OPEN 0x00000001
7170
#define FSF_LUN_ALREADY_OPEN 0x00000002
@@ -258,20 +257,6 @@
258257
#define FSF_UNIT_ACCESS_EXCLUSIVE 0x02000000
259258
#define FSF_UNIT_ACCESS_OUTBOUND_TRANSFER 0x10000000
260259

261-
struct fsf_queue_designator;
262-
struct fsf_status_read_buffer;
263-
struct fsf_port_closed_payload;
264-
struct fsf_bit_error_payload;
265-
union fsf_prot_status_qual;
266-
struct fsf_qual_version_error;
267-
struct fsf_qual_sequence_error;
268-
struct fsf_qtcb_prefix;
269-
struct fsf_qtcb_header;
270-
struct fsf_qtcb_bottom_config;
271-
struct fsf_qtcb_bottom_support;
272-
struct fsf_qtcb_bottom_io;
273-
union fsf_qtcb_bottom;
274-
275260
struct fsf_queue_designator {
276261
u8 cssid;
277262
u8 chpid;

drivers/s390/scsi/zfcp_qdio.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,8 @@ zfcp_qdio_allocate(struct zfcp_adapter *adapter)
168168

169169
init_data->cdev = adapter->ccw_device;
170170
init_data->q_format = QDIO_SCSI_QFMT;
171-
memcpy(init_data->adapter_name, &adapter->name, 8);
171+
memcpy(init_data->adapter_name, zfcp_get_busid_by_adapter(adapter), 8);
172+
ASCEBC(init_data->adapter_name, 8);
172173
init_data->qib_param_field_format = 0;
173174
init_data->qib_param_field = NULL;
174175
init_data->input_slib_elements = NULL;

0 commit comments

Comments
 (0)