[S390] zcrypt: fix request timeout handling
[pandora-kernel.git] / drivers / s390 / crypto / ap_bus.h
index 008559e..87c2d64 100644 (file)
@@ -33,6 +33,7 @@
 #define AP_DEVICES 64          /* Number of AP devices. */
 #define AP_DOMAINS 16          /* Number of AP domains. */
 #define AP_MAX_RESET 90                /* Maximum number of resets. */
+#define AP_RESET_TIMEOUT (HZ/2)        /* Time in ticks for reset timeouts. */
 #define AP_CONFIG_TIME 30      /* Time in seconds between AP bus rescans. */
 #define AP_POLL_TIME 1         /* Time in ticks between receive polls. */
 
@@ -83,6 +84,13 @@ struct ap_queue_status {
 #define AP_DEVICE_TYPE_CEX2A   6
 #define AP_DEVICE_TYPE_CEX2C   7
 
+/**
+ * AP reset flag states
+ */
+#define AP_RESET_IGNORE        0       /* request timeout will be ignored */
+#define AP_RESET_ARMED 1       /* request timeout timer is active */
+#define AP_RESET_DO    2       /* AP reset required */
+
 struct ap_device;
 struct ap_message;
 
@@ -95,6 +103,7 @@ struct ap_driver {
        /* receive is called from tasklet context */
        void (*receive)(struct ap_device *, struct ap_message *,
                        struct ap_message *);
+       int request_timeout;            /* request timeout in jiffies */
 };
 
 #define to_ap_drv(x) container_of((x), struct ap_driver, driver)
@@ -112,6 +121,8 @@ struct ap_device {
        int queue_depth;                /* AP queue depth.*/
        int device_type;                /* AP device type. */
        int unregistered;               /* marks AP device as unregistered */
+       struct timer_list timeout;      /* Timer for request timeouts. */
+       int reset;                      /* Reset required after req. timeout. */
 
        int queue_count;                /* # messages currently on AP queue. */