[Armadeus-commitlog] armadeus branch, master, updated. armadeus-4.0-2418-g2403b93
Brought to you by:
sszy
|
From: Fabien M <fa...@us...> - 2011-07-18 11:30:59
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 2403b93f95e677fbee6aeda72f447c42aef8c198 (commit)
via de6259ba0fb4b02d500c1cccd928e8fd3bb2e425 (commit)
from d17ee90acbecc8ef1c6198c78ab42ca78f9fba46 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 2403b93f95e677fbee6aeda72f447c42aef8c198
Author: Kevin JOLY <jol...@gm...>
Date: Mon Jul 18 11:45:17 2011 +0200
Add ioctl support in Anybus driver
Signed-off-by: Kevin JOLY <jol...@gm...>
commit de6259ba0fb4b02d500c1cccd928e8fd3bb2e425
Author: Kevin JOLY <jol...@gm...>
Date: Mon Jul 18 11:45:16 2011 +0200
Add extension .patch to the kernel patch 440-add-hms-anybus-driver
Signed-off-by: Kevin JOLY <jol...@gm...>
-----------------------------------------------------------------------
Summary of changes:
...er => 440-armadeus-add-hms-anybus-driver.patch} | 212 ++++++++++++++------
1 files changed, 147 insertions(+), 65 deletions(-)
rename buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/{440-add-hms-anybus-driver => 440-armadeus-add-hms-anybus-driver.patch} (83%)
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/440-add-hms-anybus-driver b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/440-armadeus-add-hms-anybus-driver.patch
similarity index 83%
rename from buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/440-add-hms-anybus-driver
rename to buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/440-armadeus-add-hms-anybus-driver.patch
index d812b1f..6f9acf9 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/440-add-hms-anybus-driver
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/440-armadeus-add-hms-anybus-driver.patch
@@ -1,7 +1,12 @@
+Add HMS Anybus module support
+
+Signed-off-by: Kevin JOLY <jol...@gm...>
+---
+
Index: linux-2.6.38.1/drivers/net/Kconfig
===================================================================
---- linux-2.6.38.1.orig/drivers/net/Kconfig 2011-07-11 14:30:35.704127431 +0200
-+++ linux-2.6.38.1/drivers/net/Kconfig 2011-07-11 14:16:06.000000000 +0200
+--- linux-2.6.38.1.orig/drivers/net/Kconfig 2011-03-23 21:04:47.000000000 +0100
++++ linux-2.6.38.1/drivers/net/Kconfig 2011-07-18 10:53:53.509814002 +0200
@@ -3422,4 +3422,12 @@
To compile this driver as a module, choose M here: the
module will be called vmxnet3.
@@ -17,8 +22,8 @@ Index: linux-2.6.38.1/drivers/net/Kconfig
endif # NETDEVICES
Index: linux-2.6.38.1/drivers/net/Makefile
===================================================================
---- linux-2.6.38.1.orig/drivers/net/Makefile 2011-07-11 14:30:41.352127431 +0200
-+++ linux-2.6.38.1/drivers/net/Makefile 2011-07-11 14:16:57.000000000 +0200
+--- linux-2.6.38.1.orig/drivers/net/Makefile 2011-03-23 21:04:47.000000000 +0100
++++ linux-2.6.38.1/drivers/net/Makefile 2011-07-18 10:53:53.509814002 +0200
@@ -242,6 +242,7 @@
obj-$(CONFIG_R8169) += r8169.o
obj-$(CONFIG_AMD8111_ETH) += amd8111e.o
@@ -30,8 +35,8 @@ Index: linux-2.6.38.1/drivers/net/Makefile
Index: linux-2.6.38.1/drivers/net/anybus_interface.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.38.1/drivers/net/anybus_interface.c 2011-07-11 13:58:03.000000000 +0200
-@@ -0,0 +1,993 @@
++++ linux-2.6.38.1/drivers/net/anybus_interface.c 2011-07-18 11:39:19.637814000 +0200
+@@ -0,0 +1,1061 @@
+/*
+ * HMS Anybus module driver
+ *
@@ -60,11 +65,12 @@ Index: linux-2.6.38.1/drivers/net/anybus_interface.c
+#include <linux/delay.h>
+#include <linux/etherdevice.h>
+#include <linux/gpio.h>
++#include <linux/cdev.h>
++#include <linux/fs.h>
++#include <linux/string.h>
+
+#include <net/anybus_interface.h>
+
-+#define ANYBUS_INTERFACE_DRIVER_NAME "anybus_interface"
-+
+/* Interface registers */
+#define IFRG_ID 0x00
+#define IFRG_CTRL 0x02
@@ -141,20 +147,14 @@ Index: linux-2.6.38.1/drivers/net/anybus_interface.c
+bool received_mailbox_message;
+bool anybus_available;
+
-+struct mailbox_msg {
-+ unsigned short id;
-+ unsigned short msg_information;
-+ unsigned short command_number;
-+ unsigned short data_size;
-+ unsigned short extended_word[8];
-+ unsigned short data[256];
-+};
++struct platform_device *platform_dev;
+
+struct anybus_private {
+ void __iomem *reg_base;
+ int gpio_reset;
+ int irq_flags;
-+ struct device *dev;
++ struct cdev *cdev;
++ struct class *anybus_class;
+};
+
+static u16 anybus_interface_read(struct anybus_private *anybus_priv, int reg)
@@ -215,7 +215,7 @@ Index: linux-2.6.38.1/drivers/net/anybus_interface.c
+ ret = anybus_reg_read(anybus_priv, APPLICATION_INDICATION_REG);
+
+ if (ret < 0) {
-+ dev_err(anybus_priv->dev, "Unable to read on anybus module\n");
++ dev_err(&platform_dev->dev, "Unable to read on anybus module\n");
+ return -EIO;
+ }
+
@@ -250,7 +250,7 @@ Index: linux-2.6.38.1/drivers/net/anybus_interface.c
+
+ if (anybus_reg_write(anybus_priv, APPLICATION_INDICATION_REG,
+ register_status) < 0) {
-+ dev_err(anybus_priv->dev,
++ dev_err(&platform_dev->dev,
+ "Unable to write on anybus module\n");
+ return -EIO;
+ }
@@ -302,7 +302,7 @@ Index: linux-2.6.38.1/drivers/net/anybus_interface.c
+ ret = anybus_reg_read(anybus_priv, ANYBUS_INDICATION_REG);
+
+ if (ret < 0) {
-+ dev_err(anybus_priv->dev, "Communication error.\n");
++ dev_err(&platform_dev->dev, "Communication error.\n");
+ return -EIO;
+ }
+
@@ -344,7 +344,7 @@ Index: linux-2.6.38.1/drivers/net/anybus_interface.c
+ ret = anybus_reg_read(anybus_priv, ANYBUS_INDICATION_REG);
+
+ if (ret < 0) {
-+ dev_err(anybus_priv->dev, "Communication error.\n");
++ dev_err(&platform_dev->dev, "Communication error.\n");
+ return -EIO;
+ }
+
@@ -354,7 +354,7 @@ Index: linux-2.6.38.1/drivers/net/anybus_interface.c
+
+ skb = dev_alloc_skb(sizeof(frame));
+ if (!skb) {
-+ dev_err(anybus_priv->dev, "Low memory space available.\n");
++ dev_err(&platform_dev->dev, "Low memory space available.\n");
+ dev->stats.rx_dropped++;
+ }
+
@@ -384,7 +384,7 @@ Index: linux-2.6.38.1/drivers/net/anybus_interface.c
+ ret = anybus_reg_read(anybus_priv, ANYBUS_INDICATION_REG);
+
+ if (ret < 0) {
-+ dev_err(anybus_priv->dev, "Communication error.\n");
++ dev_err(&platform_dev->dev, "Communication error.\n");
+ return IRQ_NONE;
+ }
+
@@ -395,7 +395,7 @@ Index: linux-2.6.38.1/drivers/net/anybus_interface.c
+ ret = anybus_reg_read(anybus_priv, APPLICATION_INDICATION_REG);
+
+ if (ret < 0) {
-+ dev_err(anybus_priv->dev, "Communication error.\n");
++ dev_err(&platform_dev->dev, "Communication error.\n");
+ return IRQ_NONE;
+ }
+
@@ -423,7 +423,7 @@ Index: linux-2.6.38.1/drivers/net/anybus_interface.c
+ ANYBUS_INDICATION_REG);
+
+ if (ret < 0) {
-+ dev_err(anybus_priv->dev,
++ dev_err(&platform_dev->dev,
+ "Communication error.\n");
+ return IRQ_NONE;
+ }
@@ -435,14 +435,14 @@ Index: linux-2.6.38.1/drivers/net/anybus_interface.c
+ ret = anybus_reg_read(anybus_priv, EVENT_NOTIFICATION_CAUSE);
+
+ if (ret < 0) {
-+ dev_err(anybus_priv->dev,
++ dev_err(&platform_dev->dev,
+ "Unable to read in the Anybus module register\n");
+ return IRQ_NONE;
+ }
+
+ if (anybus_reg_write(anybus_priv, EVENT_NOTIFICATION_CAUSE,
+ 0x00) < 0) {
-+ dev_err(anybus_priv->dev,
++ dev_err(&platform_dev->dev,
+ "Unable to read in the Anybus module register\n");
+ return IRQ_NONE;
+ }
@@ -458,7 +458,7 @@ Index: linux-2.6.38.1/drivers/net/anybus_interface.c
+ ANYBUS_INDICATION_REG);
+
+ if (ret < 0) {
-+ dev_err(anybus_priv->dev,
++ dev_err(&platform_dev->dev,
+ "Communication error.\n");
+ return IRQ_NONE;
+ }
@@ -470,12 +470,12 @@ Index: linux-2.6.38.1/drivers/net/anybus_interface.c
+ ret = anybus_reg_read(anybus_priv, ANYBUS_INDICATION_REG);
+
+ if (ret < 0) {
-+ dev_err(anybus_priv->dev, "Communication error.\n");
++ dev_err(&platform_dev->dev, "Communication error.\n");
+ return IRQ_NONE;
+ }
+
+ if (application_indication_register(anybus_priv, AP_EVENT)) {
-+ dev_err(anybus_priv->dev, "Communication error.\n");
++ dev_err(&platform_dev->dev, "Communication error.\n");
+ return IRQ_NONE;
+ }
+ }
@@ -483,10 +483,10 @@ Index: linux-2.6.38.1/drivers/net/anybus_interface.c
+ return IRQ_HANDLED;
+}
+
-+int write_mailbox_message(struct net_device *dev, struct mailbox_msg message)
++int write_mailbox_message(struct anybus_private *anybus_priv,
++ struct mailbox_msg message)
+{
+ int i;
-+ struct anybus_private *anybus_priv = netdev_priv(dev);
+
+ sending_mailbox_message = 1;
+
@@ -606,7 +606,7 @@ Index: linux-2.6.38.1/drivers/net/anybus_interface.c
+ ret = anybus_reg_read(anybus_priv, FIELDBUS_TYPE_MSB);
+
+ if (ret < 0) {
-+ dev_err(anybus_priv->dev, "Communication error.\n");
++ dev_err(&platform_dev->dev, "Communication error.\n");
+ return -EAGAIN;
+ }
+
@@ -615,7 +615,7 @@ Index: linux-2.6.38.1/drivers/net/anybus_interface.c
+ ret = anybus_reg_read(anybus_priv, FIELDBUS_TYPE_LSB);
+
+ if (ret < 0) {
-+ dev_err(anybus_priv->dev, "Communication error.\n");
++ dev_err(&platform_dev->dev, "Communication error.\n");
+ return -EAGAIN;
+ }
+
@@ -624,7 +624,7 @@ Index: linux-2.6.38.1/drivers/net/anybus_interface.c
+ ret = anybus_reg_read(anybus_priv, APPLICATION_VERSION_MSB);
+
+ if (ret < 0) {
-+ dev_err(anybus_priv->dev, "Communication error.\n");
++ dev_err(&platform_dev->dev, "Communication error.\n");
+ return -EAGAIN;
+ }
+
@@ -633,7 +633,7 @@ Index: linux-2.6.38.1/drivers/net/anybus_interface.c
+ ret = anybus_reg_read(anybus_priv, APPLICATION_VERSION_LSB);
+
+ if (ret < 0) {
-+ dev_err(anybus_priv->dev, "Communication error.\n");
++ dev_err(&platform_dev->dev, "Communication error.\n");
+ return -EAGAIN;
+ }
+
@@ -642,7 +642,7 @@ Index: linux-2.6.38.1/drivers/net/anybus_interface.c
+ ret = anybus_reg_read(anybus_priv, SERIAL_NUMBER0);
+
+ if (ret < 0) {
-+ dev_err(anybus_priv->dev, "Communication error.\n");
++ dev_err(&platform_dev->dev, "Communication error.\n");
+ return -EAGAIN;
+ }
+
@@ -651,7 +651,7 @@ Index: linux-2.6.38.1/drivers/net/anybus_interface.c
+ ret = anybus_reg_read(anybus_priv, SERIAL_NUMBER1);
+
+ if (ret < 0) {
-+ dev_err(anybus_priv->dev, "Communication error.\n");
++ dev_err(&platform_dev->dev, "Communication error.\n");
+ return -EAGAIN;
+ }
+
@@ -660,7 +660,7 @@ Index: linux-2.6.38.1/drivers/net/anybus_interface.c
+ ret = anybus_reg_read(anybus_priv, SERIAL_NUMBER2);
+
+ if (ret < 0) {
-+ dev_err(anybus_priv->dev, "Communication error.\n");
++ dev_err(&platform_dev->dev, "Communication error.\n");
+ return -EAGAIN;
+ }
+
@@ -669,7 +669,7 @@ Index: linux-2.6.38.1/drivers/net/anybus_interface.c
+ ret = anybus_reg_read(anybus_priv, SERIAL_NUMBER3);
+
+ if (ret < 0) {
-+ dev_err(anybus_priv->dev, "Communication error.\n");
++ dev_err(&platform_dev->dev, "Communication error.\n");
+ return -EAGAIN;
+ }
+
@@ -692,7 +692,7 @@ Index: linux-2.6.38.1/drivers/net/anybus_interface.c
+
+ if (request_irq(dev->irq, anybus_interrupt, anybus_priv->irq_flags,
+ dev->name, (void *)dev) < 0) {
-+ dev_err(anybus_priv->dev,
++ dev_err(&platform_dev->dev,
+ "Unable to request irq n° %d (GPIO %d)\n",
+ dev->irq, irq_to_gpio(dev->irq));
+ return -EAGAIN;
@@ -704,9 +704,10 @@ Index: linux-2.6.38.1/drivers/net/anybus_interface.c
+ while (!anybus_available) {
+ msleep(100);
+ i++;
-+ if (i > 10) {
++ if (i > 50) {
+ i = 0;
+ anybus_stop(dev);
++ dev_err(&platform_dev->dev, "The module is unavailable.\n");
+ return -ETIMEDOUT;
+ }
+ }
@@ -718,8 +719,8 @@ Index: linux-2.6.38.1/drivers/net/anybus_interface.c
+ for (i = 0 ; i < 9 ; i++)
+ message.extended_word[i] = 0;
+
-+ if (write_mailbox_message(dev, message)) {
-+ dev_err(anybus_priv->dev,
++ if (write_mailbox_message(anybus_priv, message)) {
++ dev_err(&platform_dev->dev,
+ "Unable to write in the Anybus module mailbox register\n");
+ return -EIO;
+ }
@@ -728,9 +729,11 @@ Index: linux-2.6.38.1/drivers/net/anybus_interface.c
+ while (!received_mailbox_message) {
+ msleep(100);
+ i++;
-+ if (i > 10) {
++ if (i > 50) {
+ i = 0;
+ anybus_stop(dev);
++ dev_err(&platform_dev->dev,
++ "The module hasn't responded.\n");
+ return -ETIMEDOUT;
+ }
+ }
@@ -739,9 +742,9 @@ Index: linux-2.6.38.1/drivers/net/anybus_interface.c
+
+ message = read_mailbox_message(anybus_priv);
+ if ((message.id != 0x0001) || (message.msg_information != 0x0001)) {
-+ dev_err(anybus_priv->dev,
++ dev_err(&platform_dev->dev,
+ "Error while checking response of start init\n");
-+ dev_err(anybus_priv->dev, "id: 0x%X msg info: 0x%X\n",
++ dev_err(&platform_dev->dev, "id: 0x%X msg info: 0x%X\n",
+ message.id, message.msg_information);
+ anybus_stop(dev);
+ return -EAGAIN;
@@ -757,8 +760,8 @@ Index: linux-2.6.38.1/drivers/net/anybus_interface.c
+ for (i = 0; i < message.data_size/2; i++)
+ message.data[i] = start_init_anybus_data_msg[i];
+
-+ if (write_mailbox_message(dev, message)) {
-+ dev_err(anybus_priv->dev,
++ if (write_mailbox_message(anybus_priv, message)) {
++ dev_err(&platform_dev->dev,
+ "Unable to write in the Anybus module mailbox register\n");
+ return -EIO;
+ }
@@ -767,7 +770,7 @@ Index: linux-2.6.38.1/drivers/net/anybus_interface.c
+ while (!received_mailbox_message) {
+ msleep(100);
+ i++;
-+ if (i > 10) {
++ if (i > 50) {
+ i = 0;
+ anybus_stop(dev);
+ return -ETIMEDOUT;
@@ -778,9 +781,9 @@ Index: linux-2.6.38.1/drivers/net/anybus_interface.c
+
+ message = read_mailbox_message(anybus_priv);
+ if ((message.id != 0x0002) || (message.msg_information != 0x0001)) {
-+ dev_err(anybus_priv->dev,
++ dev_err(&platform_dev->dev,
+ "Error while checking response of init anybus\n");
-+ dev_err(anybus_priv->dev, "id: 0x%X msg info: 0x%X\n",
++ dev_err(&platform_dev->dev, "id: 0x%X msg info: 0x%X\n",
+ message.id, message.msg_information);
+ return -EAGAIN;
+ }
@@ -792,8 +795,8 @@ Index: linux-2.6.38.1/drivers/net/anybus_interface.c
+ for (i = 0 ; i < 9 ; i++)
+ message.extended_word[i] = 0;
+
-+ if (write_mailbox_message(dev, message)) {
-+ dev_err(anybus_priv->dev,
++ if (write_mailbox_message(anybus_priv, message)) {
++ dev_err(&platform_dev->dev,
+ "Unable to write in the Anybus module mailbox register\n");
+ return -EIO;
+ }
@@ -802,9 +805,11 @@ Index: linux-2.6.38.1/drivers/net/anybus_interface.c
+ while (!received_mailbox_message) {
+ msleep(100);
+ i++;
-+ if (i > 10) {
++ if (i > 50) {
+ i = 0;
+ anybus_stop(dev);
++ dev_err(&platform_dev->dev,
++ "The module hasn't responded.\n");
+ return -ETIMEDOUT;
+ }
+ }
@@ -813,9 +818,9 @@ Index: linux-2.6.38.1/drivers/net/anybus_interface.c
+
+ message = read_mailbox_message(anybus_priv);
+ if ((message.id != 0x0003) || (message.msg_information != 0x0001)) {
-+ dev_err(anybus_priv->dev,
++ dev_err(&platform_dev->dev,
+ "Error while checking response of end init\n");
-+ dev_err(anybus_priv->dev, "id: 0x%X msg info: 0x%X\n",
++ dev_err(&platform_dev->dev, "id: 0x%X msg info: 0x%X\n",
+ message.id, message.msg_information);
+ return -EAGAIN;
+ }
@@ -830,7 +835,7 @@ Index: linux-2.6.38.1/drivers/net/anybus_interface.c
+ struct anybus_private *anybus_priv = netdev_priv(dev);
+
+ if ((frame->reg + frame->len) > (INPUT_AREA_END / 2) + 1) {
-+ dev_err(anybus_priv->dev,
++ dev_err(&platform_dev->dev,
+ "Overflow in the Anybus input data area.\n");
+ dev->stats.tx_errors++;
+ dev->stats.tx_dropped++;
@@ -863,6 +868,38 @@ Index: linux-2.6.38.1/drivers/net/anybus_interface.c
+ return 0;
+}
+
++long anybus_ioctl(struct file *filp, unsigned int cmd, unsigned long ptr_mail)
++{
++ struct net_device *dev = dev_get_drvdata(&platform_dev->dev);
++ struct anybus_private *anybus_priv = netdev_priv(dev);
++ struct mailbox_msg mail;
++
++ memcpy(&mail, (struct mailbox_msg *)ptr_mail,
++ sizeof(struct mailbox_msg));
++
++ if (cmd == MB_READ) {
++ if (received_mailbox_message) {
++ mail = read_mailbox_message(anybus_priv);
++ memcpy((struct mailbox_msg *)ptr_mail,
++ &mail,
++ sizeof(struct mailbox_msg));
++ } else
++ return -EAGAIN;
++ } else if (cmd == MB_WRITE) {
++ memcpy(&mail, (struct mailbox_msg *)ptr_mail,
++ sizeof(struct mailbox_msg));
++
++ if (write_mailbox_message(anybus_priv, mail))
++ return -EIO;
++ }
++
++ return 0;
++}
++
++static const struct file_operations anybus_fops = {
++ .unlocked_ioctl = anybus_ioctl
++};
++
+static void anybus_setup(struct net_device *dev)
+{
+ dev->type = ARPHRD_VOID;
@@ -887,11 +924,9 @@ Index: linux-2.6.38.1/drivers/net/anybus_interface.c
+ struct net_device *dev = alloc_netdev(sizeof(struct anybus_private),
+ "anybus%d", anybus_setup);
+ struct anybus_private *anybus_priv = netdev_priv(dev);
-+
++ char dev_mailbox_name[20];
+ void __iomem *mem;
-+
+ int err = 0;
-+
+ u16 id;
+
+ resource_memory = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -907,7 +942,7 @@ Index: linux-2.6.38.1/drivers/net/anybus_interface.c
+ anybus_priv->irq_flags = resource_irq->flags &
+ (IRQF_TRIGGER_MASK | IRQF_SHARED);
+ anybus_priv->gpio_reset = resource_reset->start;
-+ anybus_priv->dev = &pdev->dev;
++ platform_dev = pdev;
+
+ err = gpio_request_one(anybus_priv->gpio_reset,
+ GPIOF_OUT_INIT_HIGH, ANYBUS_INTERFACE_DRIVER_NAME);
@@ -963,10 +998,44 @@ Index: linux-2.6.38.1/drivers/net/anybus_interface.c
+
+ gpio_set_value(anybus_priv->gpio_reset, 1);
+
-+ dev_err(&pdev->dev, "Anybus interface probed\n");
++ anybus_priv->cdev = cdev_alloc();
++ err = alloc_chrdev_region(&anybus_priv->cdev->dev, 1, 1,
++ ANYBUS_INTERFACE_DRIVER_NAME);
++ if (err) {
++ dev_err(&pdev->dev, "Unable to allocate device numbers\n");
++ goto exit_iounmap;
++ }
++
++ anybus_priv->cdev->owner = THIS_MODULE;
++ anybus_priv->cdev->ops = &anybus_fops;
++ err = cdev_add(anybus_priv->cdev, anybus_priv->cdev->dev, 256);
++ if (err) {
++ dev_err(&pdev->dev, "Unable to add cdev\n");
++ goto exit_unreg;
++ }
++
++ anybus_priv->anybus_class = class_create(THIS_MODULE,
++ ANYBUS_INTERFACE_DRIVER_NAME);
++ if (IS_ERR(anybus_priv->anybus_class)) {
++ dev_err(&pdev->dev, "Unable to create anybus class device\n");
++ err = PTR_ERR(anybus_priv->anybus_class);
++ goto exit_unreg;
++ }
++
++ strcpy(dev_mailbox_name, dev->name);
++ strcat(dev_mailbox_name, "_mailbox");
++ if (device_create(anybus_priv->anybus_class, NULL,
++ anybus_priv->cdev->dev, NULL, dev_mailbox_name) == NULL) {
++ dev_err(&pdev->dev, "Unable to create device\n");
++ goto exit_class_destroy;
++ }
+
+ return 0;
+
++exit_class_destroy:
++ class_destroy(anybus_priv->anybus_class);
++exit_unreg:
++ unregister_chrdev_region(anybus_priv->cdev->dev, 1);
+exit_iounmap:
+ iounmap(anybus_priv->reg_base);
+ release_mem_region(resource_memory->start,
@@ -984,6 +1053,10 @@ Index: linux-2.6.38.1/drivers/net/anybus_interface.c
+ struct anybus_private *anybus_priv = netdev_priv(dev);
+ struct resource *resource_memory;
+
++ device_destroy(anybus_priv->anybus_class, anybus_priv->cdev->dev);
++ class_destroy(anybus_priv->anybus_class);
++ unregister_chrdev_region(anybus_priv->cdev->dev, 1);
++
+ unregister_netdev(dev);
+ dev_set_drvdata(&pdev->dev, NULL);
+
@@ -1028,8 +1101,8 @@ Index: linux-2.6.38.1/drivers/net/anybus_interface.c
Index: linux-2.6.38.1/include/net/anybus_interface.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.38.1/include/net/anybus_interface.h 2011-07-06 17:12:58.000000000 +0200
-@@ -0,0 +1,31 @@
++++ linux-2.6.38.1/include/net/anybus_interface.h 2011-07-18 11:42:44.385814001 +0200
+@@ -0,0 +1,40 @@
+/*
+ * Definitions for the module HMS anybus
+ *
@@ -1060,4 +1133,13 @@ Index: linux-2.6.38.1/include/net/anybus_interface.h
+ int len;
+};
+
++struct mailbox_msg {
++ unsigned short id;
++ unsigned short msg_information;
++ unsigned short command_number;
++ unsigned short data_size;
++ unsigned short extended_word[8];
++ unsigned short data[256];
++};
++
+#endif
hooks/post-receive
--
armadeus
|