Subject: Re: control tool for amr(4)
To: Manuel Bouyer <bouyer@antioche.eu.org>
From: Andrew Doran <andrew@hairylemon.org>
List: tech-kern
Date: 06/27/2006 11:27:45
Few more comments..

+       if (au_length != 0 && au_cmd[0] != 0x06) {
+               dp = malloc(au_length, M_DEVBUF, M_WAITOK|M_ZERO);

What does 0x06 signify?

+       error = amr_ccb_map(amr, ac, dp, au_length, 0);

What if au_length == 0 or dp == NULL in this case? Which direction is the
transfer in (for bus_dmamap_sync())? We might need to add a bi-directional
flag.

If you alter amr_ccb_map() to take a "proc *" argument and pass this to
bus_dmamap_load() then the double buffering step becomes un-necessary.

+       if (au_length != 0) {
+               error = copyout(dp, au_buffer, au_length);

It looks like this doesn't cover the case of (au_length != 0 and au_cmd[0]
== 0x06).

Andrew