Fixes for sys/dev/sound/pci/t4dwave.c

看板DFBSD_submit作者時間21年前 (2004/10/29 04:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/2 (看更多)
This is a multi-part message in MIME format. --------------080206050600010908050401 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Taken as is from FreeBSD revs 1.45 and 1.46 This lets my laptop load the snd_t4dwave module without locking it up --------------080206050600010908050401 Content-Type: text/x-patch; name="trident.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="trident.patch" Index: sys/dev/sound/pci/t4dwave.c =================================================================== RCS file: /home/dcvs/src/sys/dev/sound/pci/t4dwave.c,v retrieving revision 1.3 diff -u -r1.3 t4dwave.c --- sys/dev/sound/pci/t4dwave.c 7 Aug 2003 21:17:13 -0000 1.3 +++ sys/dev/sound/pci/t4dwave.c 26 Oct 2004 04:17:18 -0000 @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/pci/t4dwave.c,v 1.9.2.11 2002/10/22 08:27:13 cognet Exp $ - * $DragonFly: src/sys/dev/sound/pci/t4dwave.c,v 1.3 2003/08/07 21:17:13 dillon Exp $ + * $DragonFly$ */ #include <dev/sound/pcm/sound.h> @@ -34,7 +34,7 @@ #include <bus/pci/pcireg.h> #include <bus/pci/pcivar.h> -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/t4dwave.c,v 1.3 2003/08/07 21:17:13 dillon Exp $"); +SND_DECLARE_FILE("$DragonFly$"); /* -------------------------------------------------------------------- */ #define TDX_PCI_ID 0x20001023 @@ -45,6 +45,16 @@ #define TR_DEFAULT_BUFSZ 0x1000 #define TR_TIMEOUT_CDC 0xffff #define TR_MAXPLAYCH 4 +/* + * Though, it's not clearly documented in trident datasheet, trident + * audio cards can't handle DMA addresses located above 1GB. The LBA + * (loop begin address) register which holds DMA base address is 32bits + * register. + * But the MSB 2bits are used for other purposes(I guess it is really + * bad idea). This effectivly limits the DMA address space up to 1GB. + */ +#define TR_MAXADDR ((1 << 30) - 1) + struct tr_info; @@ -486,7 +496,7 @@ ch->buffer = b; ch->parent = tr; ch->channel = c; - if (sndbuf_alloc(ch->buffer, tr->parent_dmat, tr->bufsz) == -1) + if (sndbuf_alloc(ch->buffer, tr->parent_dmat, tr->bufsz) != 0) return NULL; return ch; @@ -594,7 +604,7 @@ ch->buffer = b; ch->parent = tr; ch->channel = c; - if (sndbuf_alloc(ch->buffer, tr->parent_dmat, tr->bufsz) == -1) + if (sndbuf_alloc(ch->buffer, tr->parent_dmat, tr->bufsz) != 0) return NULL; return ch; @@ -852,7 +862,7 @@ } if (bus_dma_tag_create(/*parent*/NULL, /*alignment*/2, /*boundary*/0, - /*lowaddr*/BUS_SPACE_MAXADDR_32BIT, + /*lowaddr*/TR_MAXADDR, /*highaddr*/BUS_SPACE_MAXADDR, /*filter*/NULL, /*filterarg*/NULL, /*maxsize*/tr->bufsz, /*nsegments*/1, /*maxsegz*/0x3ffff, --------------080206050600010908050401--
文章代碼(AID): #11WLT800 (DFBSD_submit)
文章代碼(AID): #11WLT800 (DFBSD_submit)