cosa.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. /* $Id: cosa.h,v 1.6 1999/01/06 14:02:44 kas Exp $ */
  2. /*
  3. * Copyright (C) 1995-1997 Jan "Yenya" Kasprzak <kas@fi.muni.cz>
  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
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18. */
  19. #ifndef COSA_H__
  20. #define COSA_H__
  21. #include <linux/ioctl.h>
  22. #ifdef __KERNEL__
  23. /* status register - output bits */
  24. #define SR_RX_DMA_ENA 0x04 /* receiver DMA enable bit */
  25. #define SR_TX_DMA_ENA 0x08 /* transmitter DMA enable bit */
  26. #define SR_RST 0x10 /* SRP reset */
  27. #define SR_USR_INT_ENA 0x20 /* user interrupt enable bit */
  28. #define SR_TX_INT_ENA 0x40 /* transmitter interrupt enable bit */
  29. #define SR_RX_INT_ENA 0x80 /* receiver interrupt enable bit */
  30. /* status register - input bits */
  31. #define SR_USR_RQ 0x20 /* user interrupt request pending */
  32. #define SR_TX_RDY 0x40 /* transmitter empty (ready) */
  33. #define SR_RX_RDY 0x80 /* receiver data ready */
  34. #define SR_UP_REQUEST 0x02 /* request from SRP to transfer data
  35. up to PC */
  36. #define SR_DOWN_REQUEST 0x01 /* SRP is able to transfer data down
  37. from PC to SRP */
  38. #define SR_END_OF_TRANSFER 0x03 /* SRP signalize end of
  39. transfer (up or down) */
  40. #define SR_CMD_FROM_SRP_MASK 0x03 /* mask to get SRP command */
  41. /* bits in driver status byte definitions : */
  42. #define SR_RDY_RCV 0x01 /* ready to receive packet */
  43. #define SR_RDY_SND 0x02 /* ready to send packet */
  44. #define SR_CMD_PND 0x04 /* command pending */ /* not currently used */
  45. /* ???? */
  46. #define SR_PKT_UP 0x01 /* transfer of packet up in progress */
  47. #define SR_PKT_DOWN 0x02 /* transfer of packet down in progress */
  48. #endif /* __KERNEL__ */
  49. #define SR_LOAD_ADDR 0x4400 /* SRP microcode load address */
  50. #define SR_START_ADDR 0x4400 /* SRP microcode start address */
  51. #define COSA_LOAD_ADDR 0x400 /* SRP microcode load address */
  52. #define COSA_MAX_FIRMWARE_SIZE 0x10000
  53. /* ioctls */
  54. struct cosa_download {
  55. int addr, len;
  56. char __user *code;
  57. };
  58. /* Reset the device */
  59. #define COSAIORSET _IO('C',0xf0)
  60. /* Start microcode at given address */
  61. #define COSAIOSTRT _IOW('C',0xf1, int)
  62. /* Read the block from the device memory */
  63. #define COSAIORMEM _IOWR('C',0xf2, struct cosa_download *)
  64. /* actually the struct cosa_download itself; this is to keep
  65. * the ioctl number same as in 2.4 in order to keep the user-space
  66. * utils compatible. */
  67. /* Write the block to the device memory (i.e. download the microcode) */
  68. #define COSAIODOWNLD _IOW('C',0xf2, struct cosa_download *)
  69. /* actually the struct cosa_download itself; this is to keep
  70. * the ioctl number same as in 2.4 in order to keep the user-space
  71. * utils compatible. */
  72. /* Read the device type (one of "srp", "cosa", and "cosa8" for now) */
  73. #define COSAIORTYPE _IOR('C',0xf3, char *)
  74. /* Read the device identification string */
  75. #define COSAIORIDSTR _IOR('C',0xf4, char *)
  76. /* Maximum length of the identification string. */
  77. #define COSA_MAX_ID_STRING 128
  78. /* Increment/decrement the module usage count :-) */
  79. /* #define COSAIOMINC _IO('C',0xf5) */
  80. /* #define COSAIOMDEC _IO('C',0xf6) */
  81. /* Get the total number of cards installed */
  82. #define COSAIONRCARDS _IO('C',0xf7)
  83. /* Get the number of channels on this card */
  84. #define COSAIONRCHANS _IO('C',0xf8)
  85. /* Set the driver for the bus-master operations */
  86. #define COSAIOBMSET _IOW('C', 0xf9, unsigned short)
  87. #define COSA_BM_OFF 0 /* Bus-mastering off - use ISA DMA (default) */
  88. #define COSA_BM_ON 1 /* Bus-mastering on - faster but untested */
  89. /* Gets the busmaster status */
  90. #define COSAIOBMGET _IO('C', 0xfa)
  91. #endif /* !COSA_H__ */