#define RMEVERSION "0.8"
#endif
-#include <linux/version.h>
#include <linux/module.h>
#include <linux/string.h>
#include <linux/sched.h>
#include <linux/smp_lock.h>
#include <linux/delay.h>
#include <linux/slab.h>
-#include <asm/hardirq.h>
+#include <linux/interrupt.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/poll.h>
#define NR_DEVICE 2
static int devices = 1;
-MODULE_PARM(devices, "1-" __MODULE_STRING(NR_DEVICE) "i");
+module_param(devices, int, 0);
MODULE_PARM_DESC(devices, "number of dsp devices allocated by the driver");
/* hardware settings */
int magic;
struct pci_dev * pcidev; /* pci_dev structure */
- unsigned long *iobase;
+ unsigned long __iomem *iobase;
unsigned int irq;
/* list of rme96xx devices */
/* fiddling with the card (first level hardware control) */
-inline void rme96xx_set_ctrl(rme96xx_info* s,int mask)
+static inline void rme96xx_set_ctrl(rme96xx_info* s,int mask)
{
s->control_register|=mask;
}
-inline void rme96xx_unset_ctrl(rme96xx_info* s,int mask)
+static inline void rme96xx_unset_ctrl(rme96xx_info* s,int mask)
{
s->control_register&=(~mask);
}
-inline int rme96xx_get_sample_rate_status(rme96xx_info* s)
+static inline int rme96xx_get_sample_rate_status(rme96xx_info* s)
{
int val;
u32 status;
return val;
}
-inline int rme96xx_get_sample_rate_ctrl(rme96xx_info* s)
+static inline int rme96xx_get_sample_rate_ctrl(rme96xx_info* s)
{
int val;
val = (s->control_register & RME96xx_freq) ? 48000 : 44100;
/* the function returns the hardware pointer in bytes */
#define RME96xx_BURSTBYTES -64 /* bytes by which hwptr could be off */
-inline int rme96xx_gethwptr(rme96xx_info* s,int exact)
+static inline int rme96xx_gethwptr(rme96xx_info* s,int exact)
{
unsigned long flags;
if (exact) {
return (s->hwbufid ? s->fragsize : 0);
}
-inline void rme96xx_setlatency(rme96xx_info* s,int l)
+static inline void rme96xx_setlatency(rme96xx_info* s,int l)
{
s->latency = l;
s->fragsize = 1<<(8+l);
}
-inline int rme96xx_getospace(struct dmabuf * dma, unsigned int hwp)
+static inline int rme96xx_getospace(struct dmabuf * dma, unsigned int hwp)
{
int cnt;
int swptr;
return cnt;
}
-inline int rme96xx_getispace(struct dmabuf * dma, unsigned int hwp)
+static inline int rme96xx_getispace(struct dmabuf * dma, unsigned int hwp)
{
int cnt;
int swptr;
}
-inline int rme96xx_copyfromuser(struct dmabuf* dma,const char __user * buffer,int count,int hop)
+static inline int rme96xx_copyfromuser(struct dmabuf* dma,const char __user * buffer,int count,int hop)
{
int swptr = dma->writeptr;
switch (dma->format) {
}
/* The count argument is the number of bytes */
-inline int rme96xx_copytouser(struct dmabuf* dma,const char __user* buffer,int count,int hop)
+static inline int rme96xx_copytouser(struct dmabuf* dma,const char __user* buffer,int count,int hop)
{
int swptr = dma->readptr;
switch (dma->format) {
PCI detection and module initialization stuff
----------------------------------------------------------------------------*/
-void* busmaster_malloc(int size) {
+static void* busmaster_malloc(int size) {
int pg; /* 2 s exponent of memory size */
char *buf;
struct page* page, *last_page;
page = virt_to_page(buf);
- last_page = virt_to_page(buf + (1 << pg));
+ last_page = page + (1 << pg);
DBG(printk("setting reserved bit\n"));
while (page < last_page) {
SetPageReserved(page);
return NULL;
}
-void busmaster_free(void* ptr,int size) {
+static void busmaster_free(void* ptr,int size) {
int pg;
struct page* page, *last_page;
}
-int rme96xx_init(rme96xx_info* s)
+static int rme96xx_init(rme96xx_info* s)
{
int i;
int status;
devices = ((devices-1) & RME96xx_MASK_DEVS) + 1;
printk(KERN_INFO RME_MESS" reserving %d dsp device(s)\n",devices);
numcards = 0;
- return pci_module_init(&rme96xx_driver);
+ return pci_register_driver(&rme96xx_driver);
}
static void __exit cleanup_rme96xx(void)
DBG(printk("device num %d open\n",devnum));
+ nonseekable_open(in, f);
for (list = devs.next; ; list = list->next) {
if (list == &devs)
return -ENODEV;
if(dma == NULL || (dma->s) == NULL)
return -ENXIO;
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (dma->mmapped || !dma->opened)
return -ENXIO;
if(dma == NULL || (dma->s) == NULL)
return -ENXIO;
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (dma->mmapped || !dma->opened)
return -ENXIO;
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);
- 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)) {
unlock_kernel();
return -EAGAIN;
}
static struct file_operations rme96xx_audio_fops = {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
.owner = THIS_MODULE,
-#endif
.read = rme96xx_read,
.write = rme96xx_write,
.poll = rme96xx_poll,
COMM ("mixer open");
+ nonseekable_open(inode, file);
for (list = devs.next; ; list = list->next) {
if (list == &devs)
return -ENODEV;
}
static /*const*/ struct file_operations rme96xx_mixer_fops = {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
.owner = THIS_MODULE,
-#endif
.ioctl = rme96xx_mixer_ioctl,
.open = rme96xx_mixer_open,
.release = rme96xx_mixer_release,