1
0

u3.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /**
  2. * u3_tool - U3 USB stick manager
  3. * Copyright (C) 2007 Daviedev, daviedev@users.sourceforge.net
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License along
  16. * with this program; if not, write to the Free Software Foundation, Inc.,
  17. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  18. */
  19. #ifndef __U3_H__
  20. #define __U3_H__
  21. #include <stdint.h>
  22. #define U3_MAX_ERROR_LEN 1024 // Max. length of error msg.
  23. #define U3_SECTOR_SIZE 512 // size of one sector in the u3 system
  24. #define U3_BLOCK_SIZE 2048 // size of one block in the u3 system
  25. extern int debug;
  26. /**
  27. * Handle for a U3 device
  28. */
  29. struct u3_handle {
  30. void *dev; /* Raw SCSI interface handle, This is a void *
  31. * to be independent of the raw SCSI interface
  32. * used(eg. sg, usb, etc.) */
  33. char err_msg[U3_MAX_ERROR_LEN];
  34. };
  35. typedef struct u3_handle u3_handle_t;
  36. /**
  37. * Return values of U3 functions.
  38. */
  39. enum {
  40. U3_SUCCESS = 0,
  41. U3_FAILURE = -1
  42. };
  43. #endif // __U3_H__