Kernel driver patch 2 of 9.
Signed-off-by: Glenn Grundstrom [EMAIL PROTECTED]
==
diff -ruNp old/drivers/infiniband/hw/nes/nes.c
new/drivers/infiniband/hw/nes/nes.c
--- old/drivers/infiniband/hw/nes/nes.c 1969-12-31 18:00:00.0
-0600
+++ new/drivers/infiniband/hw/nes/nes.c 2006-10-25 10:15:49.0
-0500
@@ -0,0 +1,653 @@
+/*
+ * Copyright (c) 2006 NetEffect, Inc. All rights reserved.
+ * Copyright (c) 2005 Open Grid Computing, Inc. All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses. You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ * Redistribution and use in source and binary forms, with or
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ * - Redistributions of source code must retain the above
+ *copyright notice, this list of conditions and the following
+ *disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above
+ *copyright notice, this list of conditions and the following
+ *disclaimer in the documentation and/or other materials
+ *provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+#include linux/module.h
+#include linux/moduleparam.h
+#include linux/etherdevice.h
+#include linux/ethtool.h
+#include linux/mii.h
+#include linux/if_vlan.h
+#include linux/crc32.h
+#include linux/in.h
+#include linux/init.h
+#include linux/if_arp.h
+#include asm/io.h
+#include asm/irq.h
+#include asm/byteorder.h
+
+#include rdma/ib_smi.h
+#include rdma/ib_verbs.h
+#include rdma/ib_pack.h
+#include rdma/iw_cm.h
+
+#include nes.h
+
+MODULE_AUTHOR(NetEffect);
+MODULE_DESCRIPTION(NetEffect RNIC Low-level iWARP Driver);
+MODULE_LICENSE(Dual BSD/GPL);
+MODULE_VERSION(DRV_VERSION);
+
+int max_mtu = ETH_DATA_LEN;
+
+
+/* Interoperability */
+int mpa_version = 1;
+module_param(mpa_version, int, 0);
+MODULE_PARM_DESC(mpa_version, MPA version to be used int MPA Req/Resp
(0 or 1));
+
+/* Interoperability */
+int disable_mpa_crc = 0;
+module_param(disable_mpa_crc, int, 0);
+MODULE_PARM_DESC(disable_mpa_crc, Disable checking of MPA CRC);
+
+
+unsigned int send_first = 0;
+module_param(send_first, int, 0);
+MODULE_PARM_DESC(send_first, Send RDMA Message First on Active
Connection);
+
+
+LIST_HEAD(nes_adapter_list);
+LIST_HEAD(nes_dev_list);
+
+static int nes_device_event(struct notifier_block *notifier, unsigned
long event, void *ptr);
+static int nes_inetaddr_event(struct notifier_block *notifier, unsigned
long event, void *ptr);
+static void nes_print_macaddr(struct net_device *netdev);
+static irqreturn_t nes_interrupt(int, void *, struct pt_regs *);
+static int __devinit nes_probe(struct pci_dev *, const struct
pci_device_id *);
+static int nes_suspend(struct pci_dev *, pm_message_t);
+static int nes_resume(struct pci_dev *);
+static void __devexit nes_remove(struct pci_dev *);
+static int __init nes_init_module(void);
+static void __exit nes_exit_module(void);
+
+extern struct nes_dev *nes_ifs[];
+
+// _the_ function interface handle to nes_tcpip module
+struct nes_stack_ops *stack_ops_p;
+
+static struct pci_device_id nes_pci_table[] = {
+ {PCI_VENDOR_ID_NETEFFECT, PCI_DEVICE_ID_NETEFFECT_NE010,
PCI_ANY_ID, PCI_ANY_ID},
+ {0}
+};
+
+MODULE_DEVICE_TABLE(pci, nes_pci_table);
+
+
+static struct notifier_block nes_dev_notifier = {
+ notifier_call: nes_device_event
+};
+
+static struct notifier_block nes_inetaddr_notifier = {
+ notifier_call: nes_inetaddr_event
+};
+
+
+/**
+ * nes_device_event
+ *
+ * @param notifier
+ * @param event
+ * @param ptr
+ *
+ * @return int
+ */
+static int nes_device_event(struct notifier_block *notifier,
+ unsigned long
event, void *ptr)
+{
+ struct net_device *netdev = (struct net_device *)ptr;
+ struct nes_dev *nesdev;
+
+ dprintk(nes_device_event: notifier %p event=%ld netdev=%p,
interface name = %s.\n,
+ notifier, event, netdev, netdev-name);
+
+ list_for_each_entry(nesdev, nes_dev_list, list) {
+ dprintk(Nesdev list entry = 0x%p.\n, nesdev);
+ if (nesdev-netdev == netdev) {
+ switch (event) {
+