ecard.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * ecard.h
  3. *
  4. * Copyright 2007 Russell King
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. /* Definitions internal to ecard.c - for it's use only!!
  11. *
  12. * External expansion card header as read from the card
  13. */
  14. struct ex_ecid {
  15. unsigned char r_irq:1;
  16. unsigned char r_zero:1;
  17. unsigned char r_fiq:1;
  18. unsigned char r_id:4;
  19. unsigned char r_a:1;
  20. unsigned char r_cd:1;
  21. unsigned char r_is:1;
  22. unsigned char r_w:2;
  23. unsigned char r_r1:4;
  24. unsigned char r_r2:8;
  25. unsigned char r_prod[2];
  26. unsigned char r_manu[2];
  27. unsigned char r_country;
  28. unsigned char r_fiqmask;
  29. unsigned char r_fiqoff[3];
  30. unsigned char r_irqmask;
  31. unsigned char r_irqoff[3];
  32. };
  33. /*
  34. * Chunk directory entry as read from the card
  35. */
  36. struct ex_chunk_dir {
  37. unsigned char r_id;
  38. unsigned char r_len[3];
  39. unsigned long r_start;
  40. union {
  41. char string[256];
  42. char data[1];
  43. } d;
  44. #define c_id(x) ((x)->r_id)
  45. #define c_len(x) ((x)->r_len[0]|((x)->r_len[1]<<8)|((x)->r_len[2]<<16))
  46. #define c_start(x) ((x)->r_start)
  47. };
  48. typedef enum ecard_type { /* Cards address space */
  49. ECARD_IOC,
  50. ECARD_MEMC,
  51. ECARD_EASI
  52. } card_type_t;
  53. typedef enum { /* Speed for ECARD_IOC space */
  54. ECARD_SLOW = 0,
  55. ECARD_MEDIUM = 1,
  56. ECARD_FAST = 2,
  57. ECARD_SYNC = 3
  58. } card_speed_t;