#
-# Copyright (C) 2009 OpenWrt.org
+# Copyright (C) 2010 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=ucmb
-PKG_RELEASE:=1
+PKG_RELEASE:=2
include $(INCLUDE_DIR)/package.mk
* Microcontroller Message Bus
* Linux kernel driver
*
- * Copyright (c) 2009 Michael Buesch <mb@bu3sch.de>
+ * Copyright (c) 2009-2010 Michael Buesch <mb@bu3sch.de>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
#include "ucmb.h"
+#include <linux/version.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/miscdevice.h>
return 0;
}
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)
+static long ucmb_ioctl(struct file *filp,
+ unsigned int cmd, unsigned long arg)
+#else
static int ucmb_ioctl(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg)
+#endif
{
struct ucmb *ucmb = filp_to_ucmb(filp);
int ret = 0;
struct ucmb_message_hdr hdr = { .magic = cpu_to_le16(UCMB_MAGIC), };
struct ucmb_message_footer footer = { .crc = 0xFFFF, };
struct ucmb_status status;
- size_t i, current_size, chunk_size;
mutex_lock(&ucmb->mutex);
ucmb->mdev_fops.release = ucmb_release;
ucmb->mdev_fops.read = ucmb_read;
ucmb->mdev_fops.write = ucmb_write;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)
+ ucmb->mdev_fops.unlocked_ioctl = ucmb_ioctl;
+#else
ucmb->mdev_fops.ioctl = ucmb_ioctl;
+#endif
ucmb->mdev.fops = &ucmb->mdev_fops;
err = misc_register(&ucmb->mdev);