/* the function returns the hardware pointer in bytes */
#define RME96xx_BURSTBYTES -64 /* bytes by which hwptr could be off */
/* the function returns the hardware pointer in bytes */
#define RME96xx_BURSTBYTES -64 /* bytes by which hwptr could be off */
-inline int rme96xx_copyfromuser(struct dmabuf* dma,const char* buffer,int count,int hop)
+static inline int rme96xx_copyfromuser(struct dmabuf* dma,const char __user * buffer,int count,int hop)
short* hwbuf =(short*) &dma->s->playbuf[(dma->outoffset + i)*RME96xx_DMA_MAX_SAMPLES];
hwbuf+=(swptr>>1);
for (j=0;j<(cnt>>1);j++) {
short* hwbuf =(short*) &dma->s->playbuf[(dma->outoffset + i)*RME96xx_DMA_MAX_SAMPLES];
hwbuf+=(swptr>>1);
for (j=0;j<(cnt>>1);j++) {
-inline int rme96xx_copytouser(struct dmabuf* dma,const char* buffer,int count,int hop)
+static inline int rme96xx_copytouser(struct dmabuf* dma,const char __user* buffer,int count,int hop)
short* hwbuf =(short*) &dma->s->recbuf[(dma->inoffset + i)*RME96xx_DMA_MAX_SAMPLES];
hwbuf+=(swptr>>1);
for (j=0;j<(cnt>>1);j++) {
short* hwbuf =(short*) &dma->s->recbuf[(dma->inoffset + i)*RME96xx_DMA_MAX_SAMPLES];
hwbuf+=(swptr>>1);
for (j=0;j<(cnt>>1);j++) {
PCI detection and module initialization stuff
----------------------------------------------------------------------------*/
PCI detection and module initialization stuff
----------------------------------------------------------------------------*/
struct page* page, *last_page;
page = virt_to_page(buf);
struct page* page, *last_page;
page = virt_to_page(buf);
static int rme96xx_dmabuf_init(rme96xx_info * s,struct dmabuf* dma,int ioffset,int ooffset) {
static int rme96xx_dmabuf_init(rme96xx_info * s,struct dmabuf* dma,int ioffset,int ooffset) {
devices = ((devices-1) & RME96xx_MASK_DEVS) + 1;
printk(KERN_INFO RME_MESS" reserving %d dsp device(s)\n",devices);
numcards = 0;
devices = ((devices-1) & RME96xx_MASK_DEVS) + 1;
printk(KERN_INFO RME_MESS" reserving %d dsp device(s)\n",devices);
numcards = 0;
static int rme96xx_ioctl(struct inode *in, struct file *file, unsigned int cmd, unsigned long arg)
{
static int rme96xx_ioctl(struct inode *in, struct file *file, unsigned int cmd, unsigned long arg)
{
spin_unlock_irqrestore(&s->lock, flags);
}
DBG(printk("speed set to %d\n",val));
spin_unlock_irqrestore(&s->lock, flags);
}
DBG(printk("speed set to %d\n",val));
case SNDCTL_DSP_SETFMT: /* Selects ONE fmt*/
DBG(printk("setting to format %x\n",val));
case SNDCTL_DSP_SETFMT: /* Selects ONE fmt*/
DBG(printk("setting to format %x\n",val));
dma->readptr &= s->fragsize<<1;
spin_unlock_irqrestore(&s->lock,flags);
dma->readptr &= s->fragsize<<1;
spin_unlock_irqrestore(&s->lock,flags);
if (dma->mmapped)
dma->writeptr &= s->fragsize<<1;
spin_unlock_irqrestore(&s->lock,flags);
if (dma->mmapped)
dma->writeptr &= s->fragsize<<1;
spin_unlock_irqrestore(&s->lock,flags);
if ((file->f_mode & FMODE_READ && s->dma_adc.subdivision) ||
(file->f_mode & FMODE_WRITE && s->dma_dac2.subdivision))
return -EINVAL;
if ((file->f_mode & FMODE_READ && s->dma_adc.subdivision) ||
(file->f_mode & FMODE_WRITE && s->dma_dac2.subdivision))
return -EINVAL;
return -EBUSY;
}
add_wait_queue(&dma->open_wait, &wait);
__set_current_state(TASK_INTERRUPTIBLE);
return -EBUSY;
}
add_wait_queue(&dma->open_wait, &wait);
__set_current_state(TASK_INTERRUPTIBLE);
schedule();
remove_wait_queue(&dma->open_wait, &wait);
set_current_state(TASK_RUNNING);
if (signal_pending(current))
return -ERESTARTSYS;
schedule();
remove_wait_queue(&dma->open_wait, &wait);
set_current_state(TASK_RUNNING);
if (signal_pending(current))
return -ERESTARTSYS;
-static ssize_t rme96xx_write(struct file *file, const char *buffer, size_t count, loff_t *ppos)
+static ssize_t rme96xx_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos)
-static ssize_t rme96xx_read(struct file *file, char *buffer, size_t count, loff_t *ppos)
+static ssize_t rme96xx_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
if (vma->vm_flags & VM_WRITE) {
if (!s->started) rme96xx_startcard(s,1);
if (vma->vm_flags & VM_WRITE) {
if (!s->started) rme96xx_startcard(s,1);
- if (remap_page_range(vma, vma->vm_start, virt_to_phys(s->playbuf + dma->outoffset*RME96xx_DMA_MAX_SIZE), size, vma->vm_page_prot)) {
+ if (remap_pfn_range(vma, vma->vm_start, virt_to_phys(s->playbuf + dma->outoffset*RME96xx_DMA_MAX_SIZE) >> PAGE_SHIFT, size, vma->vm_page_prot)) {
unlock_kernel();
return -EAGAIN;
}
}
else if (vma->vm_flags & VM_READ) {
if (!s->started) rme96xx_startcard(s,1);
unlock_kernel();
return -EAGAIN;
}
}
else if (vma->vm_flags & VM_READ) {
if (!s->started) rme96xx_startcard(s,1);
- if (remap_page_range(vma, vma->vm_start, virt_to_phys(s->playbuf + dma->inoffset*RME96xx_DMA_MAX_SIZE), size, vma->vm_page_prot)) {
+ if (remap_pfn_range(vma, vma->vm_start, virt_to_phys(s->playbuf + dma->inoffset*RME96xx_DMA_MAX_SIZE) >> PAGE_SHIFT, size, vma->vm_page_prot)) {
status = readl(s->iobase + RME96xx_status_register);
/* hack to convert rev 1.5 SPDIF rate to "crystalrate" format HP 20020201 */
status = readl(s->iobase + RME96xx_status_register);
/* hack to convert rev 1.5 SPDIF rate to "crystalrate" format HP 20020201 */
.ioctl = rme96xx_mixer_ioctl,
.open = rme96xx_mixer_open,
.release = rme96xx_mixer_release,
.ioctl = rme96xx_mixer_ioctl,
.open = rme96xx_mixer_open,
.release = rme96xx_mixer_release,