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).
282 int nextpipe; /* Next pipe in linked list */
295 int pipe; /* Data pipe used */
418 #define D_TS_MONITOR (2<<10) /* Monitor pipe */
518 #define D_P_16 16 /* CHI anchor pipe */
799 ************************** DBRI data pipe management ***********************
811 static inline int pipe_active(struct snd_dbri *dbri, int pipe)
813 return ((pipe >= 0) && (dbri->pipes[pipe].desc != -1));
816 /* reset_pipe(dbri, pipe)
818 * Called on an in-use pipe to clear anything being transmitted or received
821 static void reset_pipe(struct snd_dbri *dbri, int pipe)
827 if (pipe < 0 || pipe > DBRI_MAX_PIPE) {
829 "illegal pipe number\n");
833 sdp = dbri->pipes[pipe].sdp;
836 "on uninitialized pipe\n");
846 desc = dbri->pipes[pipe].first_desc;
852 } while (desc != -1 && desc != dbri->pipes[pipe].first_desc);
854 dbri->pipes[pipe].desc = -1;
855 dbri->pipes[pipe].first_desc = -1;
861 static void setup_pipe(struct snd_dbri *dbri, int pipe, int sdp)
863 if (pipe < 0 || pipe > DBRI_MAX_PIPE) {
865 "with illegal pipe number\n");
875 /* If this is a fixed receive pipe, arrange for an interrupt
881 sdp |= D_PIPE(pipe);
882 dbri->pipes[pipe].sdp = sdp;
883 dbri->pipes[pipe].desc = -1;
884 dbri->pipes[pipe].first_desc = -1;
886 reset_pipe(dbri, pipe);
892 static void link_time_slot(struct snd_dbri *dbri, int pipe,
899 if (pipe < 0 || pipe > DBRI_MAX_PIPE
903 "DBRI: link_time_slot called with illegal pipe number\n");
907 if (dbri->pipes[pipe].sdp == 0
911 "on uninitialized pipe\n");
915 dbri->pipes[prevpipe].nextpipe = pipe;
916 dbri->pipes[pipe].nextpipe = nextpipe;
917 dbri->pipes[pipe].length = length;
921 if (dbri->pipes[pipe].sdp & D_SDP_TO_SER) {
930 val = D_DTS_VO | D_DTS_INS | D_DTS_PRVOUT(prevpipe) | pipe;
936 val = D_DTS_VI | D_DTS_INS | D_DTS_PRVIN(prevpipe) | pipe;
951 static void unlink_time_slot(struct snd_dbri *dbri, int pipe,
958 if (pipe < 0 || pipe > DBRI_MAX_PIPE
962 "DBRI: unlink_time_slot called with illegal pipe number\n");
969 val = D_DTS_VI | D_DTS_DEL | D_DTS_PRVIN(prevpipe) | pipe;
974 val = D_DTS_VO | D_DTS_DEL | D_DTS_PRVOUT(prevpipe) | pipe;
987 * Transmit/receive data on a "fixed" pipe - i.e, one whose contents are not
1001 static void xmit_fixed(struct snd_dbri *dbri, int pipe, unsigned int data)
1006 if (pipe < 16 || pipe > DBRI_MAX_PIPE) {
1007 printk(KERN_ERR "DBRI: xmit_fixed: Illegal pipe number\n");
1011 if (D_SDP_MODE(dbri->pipes[pipe].sdp) == 0) {
1013 "Uninitialized pipe %d\n", pipe);
1017 if (D_SDP_MODE(dbri->pipes[pipe].sdp) != D_SDP_FIXED) {
1018 printk(KERN_ERR "DBRI: xmit_fixed: Non-fixed pipe %d\n", pipe);
1022 if (!(dbri->pipes[pipe].sdp & D_SDP_TO_SER)) {
1023 printk(KERN_ERR "DBRI: xmit_fixed: Called on receive pipe %d\n",
1024 pipe);
1030 if (dbri->pipes[pipe].sdp & D_SDP_MSB)
1031 data = reverse_bytes(data, dbri->pipes[pipe].length);
1035 *(cmd++) = DBRI_CMD(D_SSP, 0, pipe);
1046 static void recv_fixed(struct snd_dbri *dbri, int pipe, volatile __u32 *ptr)
1048 if (pipe < 16 || pipe > DBRI_MAX_PIPE) {
1050 "illegal pipe number\n");
1054 if (D_SDP_MODE(dbri->pipes[pipe].sdp) != D_SDP_FIXED) {
1056 "non-fixed pipe %d\n", pipe);
1060 if (dbri->pipes[pipe].sdp & D_SDP_TO_SER) {
1062 "transmit pipe %d\n", pipe);
1066 dbri->pipes[pipe].recv_fixed_ptr = ptr;
1071 * Setup transmit/receive data on a "long" pipe - i.e, one associated
1074 * Only pipe numbers 0-15 can be used in this mode.
1095 if (info->pipe < 0 || info->pipe > 15) {
1096 printk(KERN_ERR "DBRI: setup_descs: Illegal pipe number\n");
1100 if (dbri->pipes[info->pipe].sdp == 0) {
1101 printk(KERN_ERR "DBRI: setup_descs: Uninitialized pipe %d\n",
1102 info->pipe);
1110 if (!(dbri->pipes[info->pipe].sdp & D_SDP_TO_SER)) {
1112 "Called on receive pipe %d\n", info->pipe);
1116 if (dbri->pipes[info->pipe].sdp & D_SDP_TO_SER) {
1118 "DBRI: setup_descs: Called on transmit pipe %d\n",
1119 info->pipe);
1123 * to receive on a pipe
1125 if (pipe_active(dbri, info->pipe)) {
1127 "Called on active pipe %d\n", info->pipe);
1135 /* Free descriptors if pipe has any */
1136 desc = dbri->pipes[info->pipe].first_desc;
1143 desc != dbri->pipes[info->pipe].first_desc);
1145 dbri->pipes[info->pipe].desc = -1;
1146 dbri->pipes[info->pipe].first_desc = -1;
1206 dbri->pipes[info->pipe].first_desc = first_desc;
1207 dbri->pipes[info->pipe].desc = first_desc;
1721 if (info->pipe >= 0) {
1722 first_td = dbri->pipes[info->pipe].first_desc;
1730 dbri->pipes[info->pipe].sdp
1736 /* Reset our admin of the pipe. */
1737 dbri->pipes[info->pipe].desc = first_td;
1743 if (info->pipe >= 0) {
1744 first_td = dbri->pipes[info->pipe].first_desc;
1752 dbri->pipes[info->pipe].sdp
1758 /* Reset our admin of the pipe. */
1759 dbri->pipes[info->pipe].desc = first_td;
1769 * on a pipe (interrupt triggered by the B bit in a transmit descriptor).
1771 * Walks through the pipe's list of transmit buffer descriptors and marks
1780 static void transmission_complete_intr(struct snd_dbri *dbri, int pipe)
1783 int td = dbri->pipes[pipe].desc;
1788 printk(KERN_ERR "DBRI: invalid td on pipe %d\n", pipe);
1802 dbri->pipes[pipe].desc = td;
1811 static void reception_complete_intr(struct snd_dbri *dbri, int pipe)
1814 int rd = dbri->pipes[pipe].desc;
1818 printk(KERN_ERR "DBRI: invalid rd on pipe %d\n", pipe);
1822 dbri->pipes[pipe].desc = dbri->next_desc[rd];
1872 * resend SDP command with clear pipe bit (C) set
1879 int pipe = channel;
1880 int td = dbri->pipes[pipe].desc;
1885 dbri->pipes[pipe].sdp
1963 * if you let a transmit pipe underrun, then try to CDP it.
2057 info->pipe = -1;
2142 if (info->pipe != -1) {
2143 reset_pipe(dbri, info->pipe);
2144 info->pipe = -1;
2158 info->pipe = 4; /* Send pipe */
2160 info->pipe = 6; /* Receive pipe */
2192 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,