ecard.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. };