/* driver/hid/usb/hid/rep-proc.h
 *
 * (c) 2002 Simtec Electronics
 *
 * Ben Dooks
 *
 * USB HID - report processing structure
 *
 * $Id: rep-proc.h,v 1.4 2003/08/08 11:17:17 ben Exp $
 *
 * This Library file is part of the Simtec Electronics USB stack development
 *   suite.
 * Specific licence is granted to use this file by third parties for the
 *   development of USB device drivers.
 *
*/

#ifndef __USB_HID_REP_PROC_H
#define __USB_HID_REP_PROC_H "$Id: rep-proc.h,v 1.4 2003/08/08 11:17:17 ben Exp $"

struct hid_report_proc_state_s {
  struct hid_dev       *dev;        /* device we are processing */
  struct hid_data_ptr  *ptr;        /* current parse state */
  struct hid_data_defn *defn;       /* current data defn */
  struct hid_data_item *item;       /* current item */
};

typedef struct hid_report_proc_state_s hid_report_proc_state_t;

struct hid_report_proc_s {
  const char        *name;                               /* processor's name */

  void             (*start)(hid_report_proc_state_t *);  /* start report */
  void             (*proc)(hid_report_proc_state_t *,
                           hid_usage_t, int);            /* process report */
  void             (*end)(hid_report_proc_state_t *);    /* end report */
};

typedef int (*hid_report_build_fn_t)(hid_report_proc_state_t *, hid_usage_t);

extern int  hid_report_build(struct hid_dev *dev,
                             struct hid_data_ptr *ptr,
                             struct hid_data_defn *defn,
                             hid_report_build_fn_t fn);

#endif /* __USB_HID_REP_PROC_H */
