diff options
author | Christof Schmitt <christof.schmitt@de.ibm.com> | 2008-07-02 04:56:34 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-07-12 09:22:34 -0400 |
commit | 5d4e226246331087799a01c267ec72e5931ff190 (patch) | |
tree | 4e9c740de12db68fa5594e3b8c83bf64461fbed8 /drivers/s390 | |
parent | 7afe29f7dd6dccbe454d7fd6cd6a5a7f7bcbc530 (diff) |
[SCSI] zfcp: Small QDIO cleanups
QBUFF_PER_PAGE is only used inside the qdio module, so move it to
zfcp_qdio.c
zfcp_qdio_zero_sbals is now only used in the qdio module, so make it
static.
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/scsi/zfcp_def.h | 2 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_ext.h | 1 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_qdio.c | 27 |
3 files changed, 11 insertions, 19 deletions
diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h index 202f7e66c446..e8383b7331b4 100644 --- a/drivers/s390/scsi/zfcp_def.h +++ b/drivers/s390/scsi/zfcp_def.h | |||
@@ -100,8 +100,6 @@ zfcp_address_to_sg(void *address, struct scatterlist *list, unsigned int size) | |||
100 | 100 | ||
101 | #define ZFCP_TYPE2_RECOVERY_TIME 8 /* seconds */ | 101 | #define ZFCP_TYPE2_RECOVERY_TIME 8 /* seconds */ |
102 | 102 | ||
103 | #define QBUFF_PER_PAGE (PAGE_SIZE / sizeof(struct qdio_buffer)) | ||
104 | |||
105 | /********************* FSF SPECIFIC DEFINES *********************************/ | 103 | /********************* FSF SPECIFIC DEFINES *********************************/ |
106 | 104 | ||
107 | #define ZFCP_ULP_INFO_VERSION 26 | 105 | #define ZFCP_ULP_INFO_VERSION 26 |
diff --git a/drivers/s390/scsi/zfcp_ext.h b/drivers/s390/scsi/zfcp_ext.h index c3b51338abfa..368b304d1e3f 100644 --- a/drivers/s390/scsi/zfcp_ext.h +++ b/drivers/s390/scsi/zfcp_ext.h | |||
@@ -43,7 +43,6 @@ extern void _zfcp_scan_ports_later(struct work_struct *work); | |||
43 | /******************************* S/390 IO ************************************/ | 43 | /******************************* S/390 IO ************************************/ |
44 | extern int zfcp_ccw_register(void); | 44 | extern int zfcp_ccw_register(void); |
45 | 45 | ||
46 | extern void zfcp_qdio_zero_sbals(struct qdio_buffer **, int, int); | ||
47 | extern int zfcp_qdio_allocate(struct zfcp_adapter *); | 46 | extern int zfcp_qdio_allocate(struct zfcp_adapter *); |
48 | extern void zfcp_qdio_free(struct zfcp_adapter *); | 47 | extern void zfcp_qdio_free(struct zfcp_adapter *); |
49 | extern int zfcp_qdio_send(struct zfcp_fsf_req *fsf_req); | 48 | extern int zfcp_qdio_send(struct zfcp_fsf_req *fsf_req); |
diff --git a/drivers/s390/scsi/zfcp_qdio.c b/drivers/s390/scsi/zfcp_qdio.c index bd6561d53589..b8ed42bb5c9e 100644 --- a/drivers/s390/scsi/zfcp_qdio.c +++ b/drivers/s390/scsi/zfcp_qdio.c | |||
@@ -11,6 +11,7 @@ | |||
11 | /* FIXME(tune): free space should be one max. SBAL chain plus what? */ | 11 | /* FIXME(tune): free space should be one max. SBAL chain plus what? */ |
12 | #define ZFCP_QDIO_PCI_INTERVAL (QDIO_MAX_BUFFERS_PER_Q \ | 12 | #define ZFCP_QDIO_PCI_INTERVAL (QDIO_MAX_BUFFERS_PER_Q \ |
13 | - (ZFCP_MAX_SBALS_PER_REQ + 4)) | 13 | - (ZFCP_MAX_SBALS_PER_REQ + 4)) |
14 | #define QBUFF_PER_PAGE (PAGE_SIZE / sizeof(struct qdio_buffer)) | ||
14 | 15 | ||
15 | static int zfcp_qdio_buffers_enqueue(struct qdio_buffer **sbal) | 16 | static int zfcp_qdio_buffers_enqueue(struct qdio_buffer **sbal) |
16 | { | 17 | { |
@@ -63,6 +64,16 @@ static void zfcp_qdio_handler_error(struct zfcp_adapter *adapter, u8 id) | |||
63 | ZFCP_STATUS_COMMON_ERP_FAILED, id, NULL); | 64 | ZFCP_STATUS_COMMON_ERP_FAILED, id, NULL); |
64 | } | 65 | } |
65 | 66 | ||
67 | static void zfcp_qdio_zero_sbals(struct qdio_buffer *sbal[], int first, int cnt) | ||
68 | { | ||
69 | int i, sbal_idx; | ||
70 | |||
71 | for (i = first; i < first + cnt; i++) { | ||
72 | sbal_idx = i % QDIO_MAX_BUFFERS_PER_Q; | ||
73 | memset(sbal[sbal_idx], 0, sizeof(struct qdio_buffer)); | ||
74 | } | ||
75 | } | ||
76 | |||
66 | static void zfcp_qdio_int_req(struct ccw_device *cdev, unsigned int status, | 77 | static void zfcp_qdio_int_req(struct ccw_device *cdev, unsigned int status, |
67 | unsigned int qdio_err, unsigned int siga_err, | 78 | unsigned int qdio_err, unsigned int siga_err, |
68 | unsigned int queue_no, int first, int count, | 79 | unsigned int queue_no, int first, int count, |
@@ -366,22 +377,6 @@ int zfcp_qdio_send(struct zfcp_fsf_req *fsf_req) | |||
366 | } | 377 | } |
367 | 378 | ||
368 | /** | 379 | /** |
369 | * zfcp_qdio_zero_sbals - zero all sbals of the specified area and queue | ||
370 | * @buf: pointer to array of SBALS | ||
371 | * @first: integer specifying the SBAL number to start | ||
372 | * @count: integer specifying the number of SBALS to process | ||
373 | */ | ||
374 | void zfcp_qdio_zero_sbals(struct qdio_buffer *sbal[], int first, int count) | ||
375 | { | ||
376 | int i, sbal_idx; | ||
377 | |||
378 | for (i = first; i < first + count; i++) { | ||
379 | sbal_idx = i % QDIO_MAX_BUFFERS_PER_Q; | ||
380 | memset(sbal[sbal_idx], 0, sizeof(struct qdio_buffer)); | ||
381 | } | ||
382 | } | ||
383 | |||
384 | /** | ||
385 | * zfcp_qdio_allocate - allocate queue memory and initialize QDIO data | 380 | * zfcp_qdio_allocate - allocate queue memory and initialize QDIO data |
386 | * @adapter: pointer to struct zfcp_adapter | 381 | * @adapter: pointer to struct zfcp_adapter |
387 | * Returns: -ENOMEM on memory allocation error or return value from | 382 | * Returns: -ENOMEM on memory allocation error or return value from |