snsc.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * SN Platform system controller communication support
  3. *
  4. * This file is subject to the terms and conditions of the GNU General Public
  5. * License. See the file "COPYING" in the main directory of this archive
  6. * for more details.
  7. *
  8. * Copyright (C) 2004 Silicon Graphics, Inc. All rights reserved.
  9. */
  10. /*
  11. * This file contains macros and data types for communication with the
  12. * system controllers in SGI SN systems.
  13. */
  14. #ifndef _SN_SYSCTL_H_
  15. #define _SN_SYSCTL_H_
  16. #include <linux/types.h>
  17. #include <linux/spinlock.h>
  18. #include <linux/wait.h>
  19. #include <linux/kobject.h>
  20. #include <linux/fs.h>
  21. #include <linux/cdev.h>
  22. #include <asm/sn/types.h>
  23. #include <asm/semaphore.h>
  24. #define CHUNKSIZE 127
  25. /* This structure is used to track an open subchannel. */
  26. struct subch_data_s {
  27. nasid_t sd_nasid; /* node on which the subchannel was opened */
  28. int sd_subch; /* subchannel number */
  29. spinlock_t sd_rlock; /* monitor lock for rsv */
  30. spinlock_t sd_wlock; /* monitor lock for wsv */
  31. wait_queue_head_t sd_rq; /* wait queue for readers */
  32. wait_queue_head_t sd_wq; /* wait queue for writers */
  33. struct semaphore sd_rbs; /* semaphore for read buffer */
  34. struct semaphore sd_wbs; /* semaphore for write buffer */
  35. char sd_rb[CHUNKSIZE]; /* read buffer */
  36. char sd_wb[CHUNKSIZE]; /* write buffer */
  37. };
  38. struct sysctl_data_s {
  39. struct cdev scd_cdev; /* Character device info */
  40. nasid_t scd_nasid; /* Node on which subchannels are opened. */
  41. };
  42. #endif /* _SN_SYSCTL_H_ */