microtek.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Driver for Microtek Scanmaker X6 USB scanner and possibly others.
  4. *
  5. * (C) Copyright 2000 John Fremlin <vii@penguinpowered.com>
  6. * (C) Copyright 2000 Oliver Neukum <Oliver.Neukum@lrz.uni-muenchen.de>
  7. *
  8. * See microtek.c for history
  9. *
  10. */
  11. typedef void (*mts_scsi_cmnd_callback)(struct scsi_cmnd *);
  12. struct mts_transfer_context
  13. {
  14. struct mts_desc *instance;
  15. mts_scsi_cmnd_callback final_callback;
  16. struct scsi_cmnd *srb;
  17. void *data;
  18. unsigned data_length;
  19. int data_pipe;
  20. int fragment;
  21. u8 *scsi_status; /* status returned from ep_response after command completion */
  22. };
  23. struct mts_desc {
  24. struct mts_desc *next;
  25. struct mts_desc *prev;
  26. struct usb_device *usb_dev;
  27. struct usb_interface *usb_intf;
  28. /* Endpoint addresses */
  29. u8 ep_out;
  30. u8 ep_response;
  31. u8 ep_image;
  32. struct Scsi_Host *host;
  33. struct urb *urb;
  34. struct mts_transfer_context context;
  35. };
  36. #define MTS_EP_OUT 0x1
  37. #define MTS_EP_RESPONSE 0x2
  38. #define MTS_EP_IMAGE 0x3
  39. #define MTS_EP_TOTAL 0x3
  40. #define MTS_SCSI_ERR_MASK ~0x3fu