Lines Matching defs:pipe

30  * The DBRI is a 32 pipe machine, each pipe can transfer some bits between
37 * (the second one is a monitor/tee pipe, valid only for serial input).
283 int nextpipe; /* Next pipe in linked list */
296 int pipe; /* Data pipe used */
419 #define D_TS_MONITOR (2<<10) /* Monitor pipe */
519 #define D_P_16 16 /* CHI anchor pipe */
800 ************************** DBRI data pipe management ***********************
812 static inline int pipe_active(struct snd_dbri *dbri, int pipe)
814 return ((pipe >= 0) && (dbri->pipes[pipe].desc != -1));
817 /* reset_pipe(dbri, pipe)
819 * Called on an in-use pipe to clear anything being transmitted or received
822 static void reset_pipe(struct snd_dbri *dbri, int pipe)
828 if (pipe < 0 || pipe > DBRI_MAX_PIPE) {
830 "illegal pipe number\n");
834 sdp = dbri->pipes[pipe].sdp;
837 "on uninitialized pipe\n");
847 desc = dbri->pipes[pipe].first_desc;
853 } while (desc != -1 && desc != dbri->pipes[pipe].first_desc);
855 dbri->pipes[pipe].desc = -1;
856 dbri->pipes[pipe].first_desc = -1;
862 static void setup_pipe(struct snd_dbri *dbri, int pipe, int sdp)
864 if (pipe < 0 || pipe > DBRI_MAX_PIPE) {
866 "with illegal pipe number\n");
876 /* If this is a fixed receive pipe, arrange for an interrupt
882 sdp |= D_PIPE(pipe);
883 dbri->pipes[pipe].sdp = sdp;
884 dbri->pipes[pipe].desc = -1;
885 dbri->pipes[pipe].first_desc = -1;
887 reset_pipe(dbri, pipe);
893 static void link_time_slot(struct snd_dbri *dbri, int pipe,
900 if (pipe < 0 || pipe > DBRI_MAX_PIPE
904 "DBRI: link_time_slot called with illegal pipe number\n");
908 if (dbri->pipes[pipe].sdp == 0
912 "on uninitialized pipe\n");
916 dbri->pipes[prevpipe].nextpipe = pipe;
917 dbri->pipes[pipe].nextpipe = nextpipe;
918 dbri->pipes[pipe].length = length;
922 if (dbri->pipes[pipe].sdp & D_SDP_TO_SER) {
931 val = D_DTS_VO | D_DTS_INS | D_DTS_PRVOUT(prevpipe) | pipe;
937 val = D_DTS_VI | D_DTS_INS | D_DTS_PRVIN(prevpipe) | pipe;
952 static void unlink_time_slot(struct snd_dbri *dbri, int pipe,
959 if (pipe < 0 || pipe > DBRI_MAX_PIPE
963 "DBRI: unlink_time_slot called with illegal pipe number\n");
970 val = D_DTS_VI | D_DTS_DEL | D_DTS_PRVIN(prevpipe) | pipe;
975 val = D_DTS_VO | D_DTS_DEL | D_DTS_PRVOUT(prevpipe) | pipe;
988 * Transmit/receive data on a "fixed" pipe - i.e, one whose contents are not
1002 static void xmit_fixed(struct snd_dbri *dbri, int pipe, unsigned int data)
1007 if (pipe < 16 || pipe > DBRI_MAX_PIPE) {
1008 printk(KERN_ERR "DBRI: xmit_fixed: Illegal pipe number\n");
1012 if (D_SDP_MODE(dbri->pipes[pipe].sdp) == 0) {
1014 "Uninitialized pipe %d\n", pipe);
1018 if (D_SDP_MODE(dbri->pipes[pipe].sdp) != D_SDP_FIXED) {
1019 printk(KERN_ERR "DBRI: xmit_fixed: Non-fixed pipe %d\n", pipe);
1023 if (!(dbri->pipes[pipe].sdp & D_SDP_TO_SER)) {
1024 printk(KERN_ERR "DBRI: xmit_fixed: Called on receive pipe %d\n",
1025 pipe);
1031 if (dbri->pipes[pipe].sdp & D_SDP_MSB)
1032 data = reverse_bytes(data, dbri->pipes[pipe].length);
1036 *(cmd++) = DBRI_CMD(D_SSP, 0, pipe);
1047 static void recv_fixed(struct snd_dbri *dbri, int pipe, volatile __u32 *ptr)
1049 if (pipe < 16 || pipe > DBRI_MAX_PIPE) {
1051 "illegal pipe number\n");
1055 if (D_SDP_MODE(dbri->pipes[pipe].sdp) != D_SDP_FIXED) {
1057 "non-fixed pipe %d\n", pipe);
1061 if (dbri->pipes[pipe].sdp & D_SDP_TO_SER) {
1063 "transmit pipe %d\n", pipe);
1067 dbri->pipes[pipe].recv_fixed_ptr = ptr;
1072 * Setup transmit/receive data on a "long" pipe - i.e, one associated
1075 * Only pipe numbers 0-15 can be used in this mode.
1096 if (info->pipe < 0 || info->pipe > 15) {
1097 printk(KERN_ERR "DBRI: setup_descs: Illegal pipe number\n");
1101 if (dbri->pipes[info->pipe].sdp == 0) {
1102 printk(KERN_ERR "DBRI: setup_descs: Uninitialized pipe %d\n",
1103 info->pipe);
1111 if (!(dbri->pipes[info->pipe].sdp & D_SDP_TO_SER)) {
1113 "Called on receive pipe %d\n", info->pipe);
1117 if (dbri->pipes[info->pipe].sdp & D_SDP_TO_SER) {
1119 "DBRI: setup_descs: Called on transmit pipe %d\n",
1120 info->pipe);
1124 * to receive on a pipe
1126 if (pipe_active(dbri, info->pipe)) {
1128 "Called on active pipe %d\n", info->pipe);
1136 /* Free descriptors if pipe has any */
1137 desc = dbri->pipes[info->pipe].first_desc;
1144 desc != dbri->pipes[info->pipe].first_desc);
1146 dbri->pipes[info->pipe].desc = -1;
1147 dbri->pipes[info->pipe].first_desc = -1;
1207 dbri->pipes[info->pipe].first_desc = first_desc;
1208 dbri->pipes[info->pipe].desc = first_desc;
1722 if (info->pipe >= 0) {
1723 first_td = dbri->pipes[info->pipe].first_desc;
1731 dbri->pipes[info->pipe].sdp
1737 /* Reset our admin of the pipe. */
1738 dbri->pipes[info->pipe].desc = first_td;
1744 if (info->pipe >= 0) {
1745 first_td = dbri->pipes[info->pipe].first_desc;
1753 dbri->pipes[info->pipe].sdp
1759 /* Reset our admin of the pipe. */
1760 dbri->pipes[info->pipe].desc = first_td;
1770 * on a pipe (interrupt triggered by the B bit in a transmit descriptor).
1772 * Walks through the pipe's list of transmit buffer descriptors and marks
1781 static void transmission_complete_intr(struct snd_dbri *dbri, int pipe)
1784 int td = dbri->pipes[pipe].desc;
1789 printk(KERN_ERR "DBRI: invalid td on pipe %d\n", pipe);
1803 dbri->pipes[pipe].desc = td;
1812 static void reception_complete_intr(struct snd_dbri *dbri, int pipe)
1815 int rd = dbri->pipes[pipe].desc;
1819 printk(KERN_ERR "DBRI: invalid rd on pipe %d\n", pipe);
1823 dbri->pipes[pipe].desc = dbri->next_desc[rd];
1873 * resend SDP command with clear pipe bit (C) set
1880 int pipe = channel;
1881 int td = dbri->pipes[pipe].desc;
1886 dbri->pipes[pipe].sdp
1964 * if you let a transmit pipe underrun, then try to CDP it.
2058 info->pipe = -1;
2143 if (info->pipe != -1) {
2144 reset_pipe(dbri, info->pipe);
2145 info->pipe = -1;
2159 info->pipe = 4; /* Send pipe */
2161 info->pipe = 6; /* Receive pipe */
2193 reset_pipe(dbri, info->pipe);
2485 int pipe;
2488 for (pipe = 0; pipe < 32; pipe++) {
2489 if (pipe_active(dbri, pipe)) {
2490 struct dbri_pipe *pptr = &dbri->pipes[pipe];
2494 pipe,