]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/s390/scsi/zfcp_def.h
[SCSI] zfcp: Hold queue lock when checking port handle for ELS command
[linux-2.6-omap-h63xx.git] / drivers / s390 / scsi / zfcp_def.h
index 326e7ee232cb7cf4cfafd5bb41cda916b863adfc..9e9f6c1e4e5d2e79441ef11c603da7ec228543a0 100644 (file)
@@ -70,12 +70,12 @@ zfcp_sg_to_address(struct scatterlist *list)
  * zfcp_address_to_sg - set up struct scatterlist from kernel address
  * @address: kernel address
  * @list: struct scatterlist
+ * @size: buffer size
  */
 static inline void
-zfcp_address_to_sg(void *address, struct scatterlist *list)
+zfcp_address_to_sg(void *address, struct scatterlist *list, unsigned int size)
 {
-       sg_set_page(list, virt_to_page(address));
-       list->offset = ((unsigned long) address) & (PAGE_SIZE - 1);
+       sg_set_buf(list, address, size);
 }
 
 #define REQUEST_LIST_SIZE 128
@@ -118,7 +118,7 @@ zfcp_address_to_sg(void *address, struct scatterlist *list)
 
 #define ZFCP_SBAL_TIMEOUT               (5*HZ)
 
-#define ZFCP_TYPE2_RECOVERY_TIME        (8*HZ)
+#define ZFCP_TYPE2_RECOVERY_TIME        8      /* seconds */
 
 /* queue polling (values in microseconds) */
 #define ZFCP_MAX_INPUT_THRESHOLD       5000    /* FIXME: tune */
@@ -139,7 +139,7 @@ zfcp_address_to_sg(void *address, struct scatterlist *list)
 #define ZFCP_STATUS_READS_RECOM                        FSF_STATUS_READS_RECOM
 
 /* Do 1st retry in 1 second, then double the timeout for each following retry */
-#define ZFCP_EXCHANGE_CONFIG_DATA_FIRST_SLEEP  100
+#define ZFCP_EXCHANGE_CONFIG_DATA_FIRST_SLEEP  1
 #define ZFCP_EXCHANGE_CONFIG_DATA_RETRIES      7
 
 /* timeout value for "default timer" for fsf requests */
@@ -983,10 +983,6 @@ struct zfcp_unit {
         struct scsi_device     *device;        /* scsi device struct pointer */
        struct zfcp_erp_action erp_action;     /* pending error recovery */
         atomic_t               erp_counter;
-       wait_queue_head_t      scsi_scan_wq;   /* can be used to wait until
-                                                 all scsi_scan_target
-                                                 requests have been
-                                                 completed. */
 };
 
 /* FSF request */
@@ -1127,6 +1123,20 @@ zfcp_reqlist_find(struct zfcp_adapter *adapter, unsigned long req_id)
        return NULL;
 }
 
+static inline struct zfcp_fsf_req *
+zfcp_reqlist_find_safe(struct zfcp_adapter *adapter, struct zfcp_fsf_req *req)
+{
+       struct zfcp_fsf_req *request;
+       unsigned int idx;
+
+       for (idx = 0; idx < REQUEST_LIST_SIZE; idx++) {
+               list_for_each_entry(request, &adapter->req_list[idx], list)
+                       if (request == req)
+                               return request;
+       }
+       return NULL;
+}
+
 /*
  *  functions needed for reference/usage counting
  */