Skip to contentSkip to conversation

Patch to add M3Pnet Driver

DISCUSSION Kevin D. Kissell 2 participants 4 messages May 22, 2008 – Jun 17, 2008

Subsystems (3)
lore
Share & tools
lore
Acked-by
#1 lore raw
Quoted 8 lines · Kevin D. Kissell

From: "Kevin D. Kissell" <[email protected]>
Date: Fri, 23 May 2008 00:45:45 +0200
To: Linux MIPS Org <[email protected]>
Subject: Patch to add M3Pnet Driver
Content-Type: multipart/mixed;

	boundary="------------050707080700070300010401"

As per previous messages, here's 2 of 2

This is largely a network driver patch with minor arch bits thrown in so this one will have to go via [email protected] and [email protected]. The MIPS bits are looking good though so feel free to add my

line for them.

Ralf

#2 lore raw

Guysm

Yet another network driver is probably not what the world needs most, but I had to write one for MIPS Linux this month that was a little different from any of the others. It's a driver that impersonates an ethernet interface whilst actually passing packets in memory between different processors running different OS images in a shared memory environment, something that actually happens in embedded systems. I call it M3P (pronounced "mep"), for MIPS Memory Message Passing, but if I didn't think it could be adapted to non-MIPS based and indeed heterogeneous systems, I wouldn't trouble you with it. I note that the "mipsnet" driver, which is limited in its function to running on a MIPS simulator, made it in, so I figured I'd at least ask if it's something that could be absorbed into the network driver mass, the better for other folks to improve on it - there are a lot of enhancements I'd like to make, some of which are described in the comments, but it's not clear that I'll have time to make them any time soon. A familiar refrain, I suppose. Anyway, the patch is attached. See also Ralf's ack below.

Regards,

Kevin K.

Quoted 14 lines · Ralf Baechle
Quoted 8 lines · Kevin D. Kissell

From: "Kevin D. Kissell" <[email protected]>
Date: Fri, 23 May 2008 00:45:45 +0200
To: Linux MIPS Org <[email protected]>
Subject: Patch to add M3Pnet Driver
Content-Type: multipart/mixed;

	boundary="------------050707080700070300010401"

As per previous messages, here's 2 of 2

This is largely a network driver patch with minor arch bits thrown in so this one will have to go via [email protected] and [email protected]. The MIPS bits are looking good though so feel free to add my

Quoted 7 lines

line for them.

Ralf

From f98ebc82b0273d30e0a29943a1553a60c7684200 Mon Sep 17 00:00:00 2001

From: Kevin D. Kissell <[email protected]>
Date: Thu, 22 May 2008 16:34:42 +0200
Subject: [PATCH] Add support for M3P (MIPS Memory Message Passing) pseudo-ethernet
device for communication between e.g. AP and RP in APRP Linux.

---
 arch/mips/mips-boards/generic/Makefile   |    3 +-
 arch/mips/mips-boards/generic/platform.c |   34 +++
 drivers/net/Kconfig                      |    8 +
 drivers/net/Makefile                     |    1 +
 drivers/net/m3pnet.c                     |  431 ++++++++++++++++++++++++++++++
 drivers/net/m3pnet.h                     |   47 ++++
 6 files changed, 523 insertions(+), 1 deletions(-)
 create mode 100644 arch/mips/mips-boards/generic/platform.c
 create mode 100644 drivers/net/m3pnet.c
 create mode 100644 drivers/net/m3pnet.h
arch/mips/mips-boards/generic/Makefile +2 -1
index b31d8df..6f0d02b 100644
@@ -19,10 +19,11 @@
 #
 
 obj-y				:= reset.o display.o init.o memory.o \
-				   cmdline.o time.o
+				   cmdline.o time.o platform.o
 
 obj-$(CONFIG_EARLY_PRINTK)	+= console.o
 obj-$(CONFIG_PCI)		+= pci.o
 obj-$(CONFIG_KGDB)		+= gdb_hook.o
+obj-$(CONFIG_MIPS_M3P_NET)	+= platform.o
 
 EXTRA_CFLAGS += -Werror
arch/mips/mips-boards/generic/platform.c new file +34 -0
new file mode 100644
index 0000000..1d56094
@@ -0,0 +1,34 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 2008 by Kevin D. Kissell, MIPS Technologies Inc.
+ */
+#include <linux/init.h>
+#include <linux/if_ether.h>
+#include <linux/kernel.h>
+#include <linux/platform_device.h>
+
+static char m3pnet_string[] = "m3pnet";
+
+static struct platform_device eth3_device = {
+	.name		= m3pnet_string,
+	.id		= 0,
+};
+
+/*
+ * Create a platform device for the M3P driver
+ */
+static int __init m3pnet_devinit(void)
+{
+	int err;
+
+	err = platform_device_register(&eth3_device);
+	if (err)
+		printk(KERN_ERR "%s: registration failed\n", m3pnet_string);
+
+	return err;
+}
+
+device_initcall(m3pnet_devinit);
drivers/net/Kconfig +8 -0
index 28d284a..b38e2c5 100644
@@ -496,6 +496,14 @@ config MIPS_SIM_NET
 	  emulated by the MIPS Simulator.
 	  If you are not using a MIPSsim or are unsure, say N.
 
+config MIPS_M3P_NET
+	tristate "MIPS Memory Message Passing device"
+	depends on MIPS
+	help
+	  The M3PNET device is a pseudo-network device intended
+	  for communication between real or virtual processors
+	  running distinct OS images.
+	  If you are unsure, say N.
 config SGI_O2MACE_ETH
 	tristate "SGI O2 MACE Fast Ethernet support"
 	depends on SGI_IP32=y
drivers/net/Makefile +1 -0
index 931264b..140be5b 100644
@@ -192,6 +192,7 @@ obj-$(CONFIG_EQUALIZER) += eql.o
 obj-$(CONFIG_MIPS_JAZZ_SONIC) += jazzsonic.o
 obj-$(CONFIG_MIPS_AU1X00_ENET) += au1000_eth.o
 obj-$(CONFIG_MIPS_SIM_NET) += mipsnet.o
+obj-$(CONFIG_MIPS_M3P_NET) += m3pnet.o
 obj-$(CONFIG_SGI_IOC3_ETH) += ioc3-eth.o
 obj-$(CONFIG_DECLANCE) += declance.o
 obj-$(CONFIG_ATARILANCE) += atarilance.o
drivers/net/m3pnet.c new file +431 -0

431 lines not on this page · raw message

drivers/net/m3pnet.h new file +47 -0

47 lines not on this page · raw message

Signature · 1 line
1.5.3.3
#3 lore raw

Jeff,

Ralf and I never heard back from you on this one. Have you had a chance to think about it yet?

Regards,

Kevin K.

Quoted 45 lines · Kevin D. Kissell

Guysm

Yet another network driver is probably not what the world needs most, but I had to write one for MIPS Linux this month that was a little different from any of the others. It's a driver that impersonates an ethernet interface whilst actually passing packets in memory between different processors running different OS images in a shared memory environment, something that actually happens in embedded systems. I call it M3P (pronounced "mep"), for MIPS Memory Message Passing, but if I didn't think it could be adapted to non-MIPS based and indeed heterogeneous systems, I wouldn't trouble you with it. I note that the "mipsnet" driver, which is limited in its function to running on a MIPS simulator, made it in, so I figured I'd at least ask if it's something that could be absorbed into the network driver mass, the better for other folks to improve on it - there are a lot of enhancements I'd like to make, some of which are described in the comments, but it's not clear that I'll have time to make them any time soon. A familiar refrain, I suppose. Anyway, the patch is attached. See also Ralf's ack below.

Regards,

Kevin K.

Quoted 19 lines · Ralf Baechle
Quoted 8 lines · Kevin D. Kissell

From: "Kevin D. Kissell" <[email protected]>
Date: Fri, 23 May 2008 00:45:45 +0200
To: Linux MIPS Org <[email protected]>
Subject: Patch to add M3Pnet Driver
Content-Type: multipart/mixed;

    boundary="------------050707080700070300010401"

As per previous messages, here's 2 of 2

This is largely a network driver patch with minor arch bits thrown in so this one will have to go via [email protected] and [email protected]. The MIPS bits are looking good though so feel free to add my

line for them.

Ralf