#ifndef _HINT_H_
#define _HINT_H_

#include <pthread.h>
#include "list.h"
#include "hint_data.h"

#define MAX_LUNS (128)

typedef struct hint_container_s {
  struct list_head list;
  hint_data_t *hint_data;
} hint_container_t;

typedef struct hint_service_template_s {
  struct scsi_lu *lu;
  void (*notify_unregister)(struct scsi_lu *lu);
  void (*notify_hint)(struct scsi_lu *lu, hint_data_t *hint);
} hint_service_template_t;

typedef struct hint_device_info_s {
  pthread_t read_thread;

  struct list_head read_list;
  struct list_head ssd_send_hint_list;

  pthread_cond_t read_cond;
  pthread_cond_t ssd_send_hint_cond;


  pthread_mutex_t read_lock;
  pthread_mutex_t ssd_send_hint_lock;
  
  int stop_threads;


  hint_service_template_t *ssd_devices[MAX_LUNS];
  
} hint_device_info_t;

typedef struct scsi_cmd_container_s {
  struct list_head list;
  struct scsi_cmd *cmd;
} scsi_cmd_container_t;


int hint_register(hint_service_template_t *template);
void hint_unregister(struct scsi_lu *ssd_lu);
int hint_send(struct scsi_lu *ssd_lu, hint_data_t *hint);

#endif /* _HINT_H_ */

