26c26
< * $FreeBSD: head/sys/dev/sound/pcm/channel.h 164614 2006-11-26 12:24:06Z ariff $
---
> * $FreeBSD: head/sys/dev/sound/pcm/channel.h 170161 2007-05-31 18:43:33Z ariff $
29,33d28
< struct pcmchan_children {
< SLIST_ENTRY(pcmchan_children) link;
< struct pcm_channel *channel;
< };
<
75d69
< int num;
96a91
> int unit;
98a94
> int trigger;
126c122,141
< SLIST_HEAD(, pcmchan_children) children;
---
>
> struct {
> SLIST_HEAD(, pcm_channel) head;
> SLIST_ENTRY(pcm_channel) link;
> struct {
> SLIST_HEAD(, pcm_channel) head;
> SLIST_ENTRY(pcm_channel) link;
> } busy;
> } children;
>
> struct {
> struct {
> SLIST_ENTRY(pcm_channel) link;
> struct {
> SLIST_ENTRY(pcm_channel) link;
> } busy;
> } pcm;
> } channels;
>
> void *data1, *data2;
128a144,201
> #define CHN_HEAD(x, y) &(x)->y.head
> #define CHN_INIT(x, y) SLIST_INIT(CHN_HEAD(x, y))
> #define CHN_LINK(y) y.link
> #define CHN_EMPTY(x, y) SLIST_EMPTY(CHN_HEAD(x, y))
> #define CHN_FIRST(x, y) SLIST_FIRST(CHN_HEAD(x, y))
>
> #define CHN_FOREACH(x, y, z) \
> SLIST_FOREACH(x, CHN_HEAD(y, z), CHN_LINK(z))
>
> #define CHN_FOREACH_SAFE(w, x, y, z) \
> SLIST_FOREACH_SAFE(w, CHN_HEAD(x, z), CHN_LINK(z), y)
>
> #define CHN_INSERT_HEAD(x, y, z) \
> SLIST_INSERT_HEAD(CHN_HEAD(x, z), y, CHN_LINK(z))
>
> #define CHN_INSERT_AFTER(x, y, z) \
> SLIST_INSERT_AFTER(x, y, CHN_LINK(z))
>
> #define CHN_REMOVE(x, y, z) \
> SLIST_REMOVE(CHN_HEAD(x, z), y, pcm_channel, CHN_LINK(z))
>
> #define CHN_INSERT_HEAD_SAFE(x, y, z) do { \
> struct pcm_channel *t = NULL; \
> CHN_FOREACH(t, x, z) { \
> if (t == y) \
> break; \
> } \
> if (t != y) { \
> CHN_INSERT_HEAD(x, y, z); \
> } \
> } while(0)
>
> #define CHN_INSERT_AFTER_SAFE(w, x, y, z) do { \
> struct pcm_channel *t = NULL; \
> CHN_FOREACH(t, w, z) { \
> if (t == y) \
> break; \
> } \
> if (t != y) { \
> CHN_INSERT_AFTER(x, y, z); \
> } \
> } while(0)
>
> #define CHN_REMOVE_SAFE(x, y, z) do { \
> struct pcm_channel *t = NULL; \
> CHN_FOREACH(t, x, z) { \
> if (t == y) \
> break; \
> } \
> if (t == y) { \
> CHN_REMOVE(x, y, z); \
> } \
> } while(0)
>
> #define CHN_UNIT(x) (snd_unit2u((x)->unit))
> #define CHN_DEV(x) (snd_unit2d((x)->unit))
> #define CHN_CHAN(x) (snd_unit2c((x)->unit))
>
211,213c284,287
< #define PCMDIR_VIRTUAL 2
< #define PCMDIR_PLAY 1
< #define PCMDIR_REC -1
---
> #define PCMDIR_PLAY 1
> #define PCMDIR_PLAY_VIRTUAL 2
> #define PCMDIR_REC -1
> #define PCMDIR_REC_VIRTUAL -2
225a300
> #define CHN_F_SLEEPING 0x00000080
< * $FreeBSD: head/sys/dev/sound/pcm/channel.h 164614 2006-11-26 12:24:06Z ariff $
---
> * $FreeBSD: head/sys/dev/sound/pcm/channel.h 170161 2007-05-31 18:43:33Z ariff $
29,33d28
< struct pcmchan_children {
< SLIST_ENTRY(pcmchan_children) link;
< struct pcm_channel *channel;
< };
<
75d69
< int num;
96a91
> int unit;
98a94
> int trigger;
126c122,141
< SLIST_HEAD(, pcmchan_children) children;
---
>
> struct {
> SLIST_HEAD(, pcm_channel) head;
> SLIST_ENTRY(pcm_channel) link;
> struct {
> SLIST_HEAD(, pcm_channel) head;
> SLIST_ENTRY(pcm_channel) link;
> } busy;
> } children;
>
> struct {
> struct {
> SLIST_ENTRY(pcm_channel) link;
> struct {
> SLIST_ENTRY(pcm_channel) link;
> } busy;
> } pcm;
> } channels;
>
> void *data1, *data2;
128a144,201
> #define CHN_HEAD(x, y) &(x)->y.head
> #define CHN_INIT(x, y) SLIST_INIT(CHN_HEAD(x, y))
> #define CHN_LINK(y) y.link
> #define CHN_EMPTY(x, y) SLIST_EMPTY(CHN_HEAD(x, y))
> #define CHN_FIRST(x, y) SLIST_FIRST(CHN_HEAD(x, y))
>
> #define CHN_FOREACH(x, y, z) \
> SLIST_FOREACH(x, CHN_HEAD(y, z), CHN_LINK(z))
>
> #define CHN_FOREACH_SAFE(w, x, y, z) \
> SLIST_FOREACH_SAFE(w, CHN_HEAD(x, z), CHN_LINK(z), y)
>
> #define CHN_INSERT_HEAD(x, y, z) \
> SLIST_INSERT_HEAD(CHN_HEAD(x, z), y, CHN_LINK(z))
>
> #define CHN_INSERT_AFTER(x, y, z) \
> SLIST_INSERT_AFTER(x, y, CHN_LINK(z))
>
> #define CHN_REMOVE(x, y, z) \
> SLIST_REMOVE(CHN_HEAD(x, z), y, pcm_channel, CHN_LINK(z))
>
> #define CHN_INSERT_HEAD_SAFE(x, y, z) do { \
> struct pcm_channel *t = NULL; \
> CHN_FOREACH(t, x, z) { \
> if (t == y) \
> break; \
> } \
> if (t != y) { \
> CHN_INSERT_HEAD(x, y, z); \
> } \
> } while(0)
>
> #define CHN_INSERT_AFTER_SAFE(w, x, y, z) do { \
> struct pcm_channel *t = NULL; \
> CHN_FOREACH(t, w, z) { \
> if (t == y) \
> break; \
> } \
> if (t != y) { \
> CHN_INSERT_AFTER(x, y, z); \
> } \
> } while(0)
>
> #define CHN_REMOVE_SAFE(x, y, z) do { \
> struct pcm_channel *t = NULL; \
> CHN_FOREACH(t, x, z) { \
> if (t == y) \
> break; \
> } \
> if (t == y) { \
> CHN_REMOVE(x, y, z); \
> } \
> } while(0)
>
> #define CHN_UNIT(x) (snd_unit2u((x)->unit))
> #define CHN_DEV(x) (snd_unit2d((x)->unit))
> #define CHN_CHAN(x) (snd_unit2c((x)->unit))
>
211,213c284,287
< #define PCMDIR_VIRTUAL 2
< #define PCMDIR_PLAY 1
< #define PCMDIR_REC -1
---
> #define PCMDIR_PLAY 1
> #define PCMDIR_PLAY_VIRTUAL 2
> #define PCMDIR_REC -1
> #define PCMDIR_REC_VIRTUAL -2
225a300
> #define CHN_F_SLEEPING 0x00000080