--- cmpci-cmedia.c Thu Apr 06 06:22:38 2000 +++ cmpci.c Tue May 30 09:32:39 2000 @@ -63,11 +63,14 @@ * (8738 only) * Fix bug cause x11amp cannot play. * + * 28.05.00 Patches for kernel 2.4 compliance + * by Paolo Rossi (lupo@aitek.it) */ /*****************************************************************************/ #define EXPORT_SYMTAB +#include #include #include #include @@ -82,7 +85,7 @@ #include #include #include -#include +#include #include #include @@ -256,7 +259,7 @@ spinlock_t lock; struct semaphore open_sem; mode_t open_mode; - struct wait_queue *open_wait; + wait_queue_head_t open_wait; struct dmabuf { void *rawbuf; @@ -268,7 +271,7 @@ unsigned total_bytes; int count; unsigned error; /* over/underrun */ - struct wait_queue *wait; + wait_queue_head_t wait; /* redundant, but makes calculations easier */ unsigned fragsize; unsigned dmasize; @@ -287,8 +290,8 @@ struct { unsigned ird, iwr, icnt; unsigned ord, owr, ocnt; - struct wait_queue *iwait; - struct wait_queue *owait; + wait_queue_head_t iwait; + wait_queue_head_t owait; struct timer_list timer; unsigned char ibuf[MIDIINBUF]; unsigned char obuf[MIDIOUTBUF]; @@ -1394,7 +1397,7 @@ static int drain_dac(struct cm_state *s, int nonblock) { - struct wait_queue wait = { current, NULL }; + DECLARE_WAITQUEUE(wait, current); unsigned long flags; int count, tmo; @@ -1616,7 +1619,7 @@ db = &s->dma_adc; } else return -EINVAL; - if (vma->vm_offset != 0) + if (vma->vm_pgoff != 0) return -EINVAL; size = vma->vm_end - vma->vm_start; if (size > (PAGE_SIZE << db->buforder)) @@ -2172,7 +2175,7 @@ db = &s->dma_adc; } else return -EINVAL; - if (vma->vm_offset != 0) + if (vma->vm_pgoff != 0) return -EINVAL; size = vma->vm_end - vma->vm_start; if (size > (PAGE_SIZE << db->buforder)) @@ -2991,7 +2994,8 @@ MODULE_PARM(rear_out, "i"); MODULE_PARM(modem, "i"); MODULE_PARM(joystick, "i"); -__initfunc(int init_module(void)) + +int __init init_module(void) #else #ifdef CONFIG_SOUND_CMPCI_SPDIFLOOP int spdif_loop = 1; @@ -3056,15 +3060,15 @@ } } memset(s, 0, sizeof(struct cm_state)); - init_waitqueue(&s->dma_adc.wait); - init_waitqueue(&s->dma_dac.wait); - init_waitqueue(&s->open_wait); - init_waitqueue(&s->midi.iwait); - init_waitqueue(&s->midi.owait); + init_waitqueue_head(&s->dma_adc.wait); + init_waitqueue_head(&s->dma_dac.wait); + init_waitqueue_head(&s->open_wait); + init_waitqueue_head(&s->midi.iwait); + init_waitqueue_head(&s->midi.owait); spin_lock_init(&s->lock); - s->open_sem = MUTEX; + init_MUTEX(&s->open_sem); s->magic = CM_MAGIC; - s->iobase = pcidev->base_address[0] & PCI_BASE_ADDRESS_IO_MASK; + s->iobase = pcidev->resource[0].start; #ifdef CONFIG_SOUND_CMPCI_FM s->iosynth = 0x388; #endif