pkt.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /****************************************************************************
  2. ******* *******
  3. ******* P A C K E T H E A D E R F I L E
  4. ******* *******
  5. ****************************************************************************
  6. Author : Ian Nandhra / Jeremy Rolls
  7. Date :
  8. *
  9. * (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK.
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License as published by
  13. * the Free Software Foundation; either version 2 of the License, or
  14. * (at your option) any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with this program; if not, write to the Free Software
  23. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  24. Version : 0.01
  25. Mods
  26. ----------------------------------------------------------------------------
  27. Date By Description
  28. ----------------------------------------------------------------------------
  29. ***************************************************************************/
  30. #ifndef _pkt_h
  31. #define _pkt_h 1
  32. #define PKT_CMD_BIT ((ushort) 0x080)
  33. #define PKT_CMD_DATA ((ushort) 0x080)
  34. #define PKT_ACK ((ushort) 0x040)
  35. #define PKT_TGL ((ushort) 0x020)
  36. #define PKT_LEN_MASK ((ushort) 0x07f)
  37. #define DATA_WNDW ((ushort) 0x10)
  38. #define PKT_TTL_MASK ((ushort) 0x0f)
  39. #define PKT_MAX_DATA_LEN 72
  40. #define PKT_LENGTH sizeof(struct PKT)
  41. #define SYNC_PKT_LENGTH (PKT_LENGTH + 4)
  42. #define CONTROL_PKT_LEN_MASK PKT_LEN_MASK
  43. #define CONTROL_PKT_CMD_BIT PKT_CMD_BIT
  44. #define CONTROL_PKT_ACK (PKT_ACK << 8)
  45. #define CONTROL_PKT_TGL (PKT_TGL << 8)
  46. #define CONTROL_PKT_TTL_MASK (PKT_TTL_MASK << 8)
  47. #define CONTROL_DATA_WNDW (DATA_WNDW << 8)
  48. struct PKT {
  49. u8 dest_unit; /* Destination Unit Id */
  50. u8 dest_port; /* Destination POrt */
  51. u8 src_unit; /* Source Unit Id */
  52. u8 src_port; /* Source POrt */
  53. u8 len;
  54. u8 control;
  55. u8 data[PKT_MAX_DATA_LEN];
  56. /* Actual data :-) */
  57. u16 csum; /* C-SUM */
  58. };
  59. #endif
  60. /*********** end of file ***********/