[PATCH 2.6.17 6/9] NetXen: Main header file

2006-08-31 Thread Amit S. Kale

diff -Narup -X linux-2.6.17.orig/Documentation/dontdiff 
linux-2.6.17.orig/drivers/net/netxen/netxen_nic.h 
linux-2.6.17/drivers/net/netxen/netxen_nic.h
--- linux-2.6.17.orig/drivers/net/netxen/netxen_nic.h   1969-12-31 
16:00:00.0 -0800
+++ linux-2.6.17/drivers/net/netxen/netxen_nic.h2006-08-31 
06:17:22.0 -0700
@@ -0,0 +1,901 @@
+/*
+ * Copyright (C) 2003 - 2006 NetXen, Inc.
+ * All rights reserved.
+ * 
+ * This program is free software; you can redistribute it and/or

+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful, but

+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License

+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+ * MA  02111-1307, USA.
+ * 
+ * The full GNU General Public License is included in this distribution

+ * in the file called LICENSE.
+ * 
+ * Contact Information:

+ *[EMAIL PROTECTED]
+ * NetXen,
+ * 3965 Freedom Circle, Fourth floor,
+ * Santa Clara, CA 95054
+ */
+
+#ifndef _NETXEN_NIC_H_
+#define _NETXEN_NIC_H_
+
+#include linux/config.h
+#include linux/module.h
+#include linux/kernel.h
+#include linux/types.h
+#include linux/compiler.h
+#include linux/slab.h
+#include linux/delay.h
+#include linux/init.h
+#include linux/ioport.h
+#include linux/pci.h
+#include linux/netdevice.h
+#include linux/etherdevice.h
+#include linux/ip.h
+#include linux/in.h
+#include linux/tcp.h
+#include linux/skbuff.h
+#include linux/version.h
+
+#include linux/ethtool.h
+#include linux/mii.h
+#include linux/interrupt.h
+#include linux/timer.h
+
+#include linux/mm.h
+#include linux/mman.h
+
+#include asm/system.h
+#include asm/io.h
+#include asm/byteorder.h
+#include asm/uaccess.h
+#include asm/pgtable.h
+
+#include linux/skbuff.h
+
+#include netxen_nic_hw.h
+
+#define NETXEN_NIC_BUILD_NO 232
+#define _NETXEN_NIC_LINUX_MAJOR 2
+#define _NETXEN_NIC_LINUX_MINOR 3
+#define _NETXEN_NIC_LINUX_SUBVERSION 57
+#define NETXEN_NIC_LINUX_VERSIONID  2.3.57
+#define NETXEN_NIC_FW_VERSIONID 2.3.57
+
+#define RCV_DESC_RINGSIZE  \
+   (sizeof(struct rcv_desc_t) * adapter-max_rx_desc_count)
+#define STATUS_DESC_RINGSIZE   \
+   (sizeof(struct status_desc_t)* adapter-max_rx_desc_count)
+#define TX_RINGSIZE\
+   (sizeof(struct netxen_cmd_buffer) * adapter-max_tx_desc_count)
+#define RCV_BUFFSIZE   \
+   (sizeof(struct netxen_rx_buffer) * rcv_desc-max_rx_desc_count)
+#define find_diff_among(a,b,range) ((a)(b)?((b)-(a)):((b)+(range)-(a)))
+
+#define NETXEN_NETDEV_STATUS 0x1
+
+#define ADDR_IN_WINDOW1(off)   \
+   ((off  NETXEN_CRB_PCIX_HOST2)  (off  NETXEN_CRB_MAX)) ? 1 : 0
+
+/* 
+ * normalize a 64MB crb address to 32MB PCI window 
+ * To use NETXEN_CRB_NORMALIZE, window _must_ be set to 1

+ */
+#define NETXEN_CRB_NORMALIZE(adapter, reg) \
+   (void __iomem *)(ptrdiff_t)((adapter)-ahw.pci_base + (reg)  \
+   - NETXEN_CRB_PCIX_HOST2 + NETXEN_CRB_PCIX_HOST)
+
+#define MAX_RX_BUFFER_LENGTH   2000
+#define MAX_RX_JUMBO_BUFFER_LENGTH 9046
+#define RX_DMA_MAP_LEN (MAX_RX_BUFFER_LENGTH - NET_IP_ALIGN)
+#define RX_JUMBO_DMA_MAP_LEN   \
+   (MAX_RX_JUMBO_BUFFER_LENGTH - NET_IP_ALIGN)
+
+/*
+ * Maximum number of ring contexts
+ */
+#define MAX_RING_CTX 1
+
+/* Opcodes to be used with the commands */
+enum {
+   TX_ETHER_PKT = 0x01,
+/* The following opcodes are for IP checksum   */
+   TX_TCP_PKT,
+   TX_UDP_PKT,
+   TX_IP_PKT,
+   TX_TCP_LSO,
+   TX_IPSEC,
+   TX_IPSEC_CMD
+};
+
+/* The following opcodes are for internal consumption. */
+#define NETXEN_CONTROL_OP  0x10
+#define PEGNET_REQUEST 0x11
+
+#defineMAX_NUM_CARDS   4
+
+#define MAX_BUFFERS_PER_CMD32
+
+/*
+ * Following are the states of the Phantom. Phantom will set them and
+ * Host will read to check if the fields are correct.
+ */
+#define PHAN_INITIALIZE_START  0xff00
+#define PHAN_INITIALIZE_FAILED 0x
+#define PHAN_INITIALIZE_COMPLETE   0xff01
+
+/* Host writes the following to notify that it has done the init-handshake */
+#define PHAN_INITIALIZE_ACK0xf00f
+
+#define NUM_RCV_DESC_RINGS 2   /* No of Rcv Descriptor contexts */
+
+/* descriptor types */
+#define RCV_DESC_NORMAL0x01
+#define RCV_DESC_JUMBO 0x02
+#define RCV_DESC_NORMAL_CTXID  0
+#define RCV_DESC_JUMBO_CTXID   1
+
+#define RCV_DESC_TYPE(ID) \
+   ((ID == RCV_DESC_JUMBO_CTXID) ? RCV_DESC_JUMBO : RCV_DESC_NORMAL)
+
+#define MAX_CMD_DESCRIPTORS1024
+#define MAX_RCV_DESCRIPTORS32768

Re: [PATCH 2.6.17 6/9] NetXen: Main header file (Name prefix change)

2006-08-21 Thread Pradeep Dalvi

diff -u linux-2.6.17/drivers/net/netxen/netxen_nic.h 
linux-2.6.17/drivers/net/netxen/netxen_nic.h
--- linux-2.6.17/drivers/net/netxen/netxen_nic.h2006-08-17 
07:12:34.0 -0700
+++ linux-2.6.17/drivers/net/netxen/netxen_nic.h2006-08-21 
02:20:00.0 -0700
@@ -550,8 +550,8 @@
 #define FLASH_SECONDARY_SIZE   (USER_START-SECONDARY_START)
 #define NUM_PRIMARY_SECTORS(0x20)
 #define NUM_CONFIG_SECTORS (1)
-int is_flash_supported(struct netxen_adapter *adapter);
-int get_flash_mac_addr(struct netxen_adapter *adapter, u64 mac[]);
+int netxen_is_flash_supported(struct netxen_adapter *adapter);
+int netxen_get_flash_mac_addr(struct netxen_adapter *adapter, u64 mac[]);

 extern void netxen_change_ringparam(struct netxen_adapter *adapter);
 extern int netxen_rom_fast_read(struct netxen_adapter *adapter, int addr,
@@ -817,9 +817,9 @@
 unsigned long off, int data);

 /* Functions from netxen_nic_init.c */
-void phantom_init(struct netxen_adapter *adapter);
-void load_firmware(struct netxen_adapter *adapter);
-int pinit_from_rom(struct netxen_adapter *adapter, int verbose);
+void netxen_phantom_init(struct netxen_adapter *adapter);
+void netxen_load_firmware(struct netxen_adapter *adapter);
+int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose);
 int netxen_rom_fast_read(struct netxen_adapter *adapter, int addr, int *valp);

 /* Functions from netxen_nic_isr.c */
@@ -842,9 +842,9 @@
 int netxen_nic_unset_promisc_mode(struct netxen_port *port);
 void netxen_nic_stop_all_ports(struct netxen_adapter *adapter);
 void netxen_nic_stop_port(struct netxen_port *port);
-void initialize_adapter_sw(struct netxen_adapter *adapter);
-void initialize_adapter_hw(struct netxen_adapter *adapter);
-int init_firmware(struct netxen_adapter *adapter);
+void netxen_initialize_adapter_sw(struct netxen_adapter *adapter);
+void netxen_initialize_adapter_hw(struct netxen_adapter *adapter);
+int netxen_init_firmware(struct netxen_adapter *adapter);
 void netxen_free_hw_resources(struct netxen_adapter *adapter);
 void netxen_tso_check(struct netxen_adapter *adapter,
  struct cmd_desc_type0_t *desc, struct sk_buff *skb);

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2.6.17 6/9] NetXen: Main header file

2006-08-18 Thread Amit S. Kale

diff -Nrup -X linux-2.6.17.orig/Documentation/dontdiff 
linux-2.6.17.orig/drivers/net/netxen/netxen_nic.h 
linux-2.6.17/drivers/net/netxen/netxen_nic.h
--- linux-2.6.17.orig/drivers/net/netxen/netxen_nic.h   1969-12-31 
16:00:00.0 -0800
+++ linux-2.6.17/drivers/net/netxen/netxen_nic.h2006-08-17 
07:12:34.0 -0700
@@ -0,0 +1,901 @@
+/*
+ * Copyright (C) 2003 - 2006 NetXen, Inc.
+ * All rights reserved.
+ * 
+ * This program is free software; you can redistribute it and/or

+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful, but

+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License

+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+ * MA  02111-1307, USA.
+ * 
+ * The full GNU General Public License is included in this distribution

+ * in the file called LICENSE.
+ * 
+ * Contact Information:

+ *[EMAIL PROTECTED]
+ * NetXen,
+ * 3965 Freedom Circle, Fourth floor,
+ * Santa Clara, CA 95054
+ */
+
+#ifndef _NETXEN_NIC_H_
+#define _NETXEN_NIC_H_
+
+#include linux/config.h
+#include linux/module.h
+#include linux/kernel.h
+#include linux/types.h
+#include linux/compiler.h
+#include linux/slab.h
+#include linux/delay.h
+#include linux/init.h
+#include linux/ioport.h
+#include linux/pci.h
+#include linux/netdevice.h
+#include linux/etherdevice.h
+#include linux/ip.h
+#include linux/in.h
+#include linux/tcp.h
+#include linux/skbuff.h
+#include linux/version.h
+
+#include linux/ethtool.h
+#include linux/mii.h
+#include linux/interrupt.h
+#include linux/timer.h
+
+#include linux/mm.h
+#include linux/mman.h
+
+#include asm/system.h
+#include asm/io.h
+#include asm/byteorder.h
+#include asm/uaccess.h
+#include asm/pgtable.h
+
+#include linux/skbuff.h
+
+#include netxen_nic_hw.h
+
+#define NETXEN_NIC_BUILD_NO 232
+#define _NETXEN_NIC_LINUX_MAJOR 2
+#define _NETXEN_NIC_LINUX_MINOR 3
+#define _NETXEN_NIC_LINUX_SUBVERSION 57
+#define NETXEN_NIC_LINUX_VERSIONID  2.3.57
+#define NETXEN_NIC_FW_VERSIONID 2.3.57
+
+#define RCV_DESC_RINGSIZE  \
+   (sizeof(struct rcv_desc_t) * adapter-max_rx_desc_count)
+#define STATUS_DESC_RINGSIZE   \
+   (sizeof(struct status_desc_t)* adapter-max_rx_desc_count)
+#define TX_RINGSIZE\
+   (sizeof(struct netxen_cmd_buffer) * adapter-max_tx_desc_count)
+#define RCV_BUFFSIZE   \
+   (sizeof(struct netxen_rx_buffer) * rcv_desc-max_rx_desc_count)
+#define find_diff_among(a,b,range) ((a)(b)?((b)-(a)):((b)+(range)-(a)))
+
+#define NETXEN_NETDEV_STATUS 0x1
+
+#define ADDR_IN_WINDOW1(off)   \
+   ((off  NETXEN_CRB_PCIX_HOST2)  (off  NETXEN_CRB_MAX)) ? 1 : 0
+
+/* 
+ * normalize a 64MB crb address to 32MB PCI window 
+ * To use NETXEN_CRB_NORMALIZE, window _must_ be set to 1

+ */
+#define NETXEN_CRB_NORMALIZE(adapter, reg) \
+   (void __iomem *)(ptrdiff_t)((adapter)-ahw.pci_base + (reg)  \
+   - NETXEN_CRB_PCIX_HOST2 + NETXEN_CRB_PCIX_HOST)
+
+#define MAX_RX_BUFFER_LENGTH   2000
+#define MAX_RX_JUMBO_BUFFER_LENGTH 9046
+#define RX_DMA_MAP_LEN (MAX_RX_BUFFER_LENGTH - NET_IP_ALIGN)
+#define RX_JUMBO_DMA_MAP_LEN   \
+   (MAX_RX_JUMBO_BUFFER_LENGTH - NET_IP_ALIGN)
+
+/*
+ * Maximum number of ring contexts
+ */
+#define MAX_RING_CTX 1
+
+/* Opcodes to be used with the commands */
+enum {
+   TX_ETHER_PKT = 0x01,
+/* The following opcodes are for IP checksum   */
+   TX_TCP_PKT,
+   TX_UDP_PKT,
+   TX_IP_PKT,
+   TX_TCP_LSO,
+   TX_IPSEC,
+   TX_IPSEC_CMD
+};
+
+/* The following opcodes are for internal consumption. */
+#define NETXEN_CONTROL_OP  0x10
+#define PEGNET_REQUEST 0x11
+
+#defineMAX_NUM_CARDS   4
+
+#define MAX_BUFFERS_PER_CMD32
+
+/*
+ * Following are the states of the Phantom. Phantom will set them and
+ * Host will read to check if the fields are correct.
+ */
+#define PHAN_INITIALIZE_START  0xff00
+#define PHAN_INITIALIZE_FAILED 0x
+#define PHAN_INITIALIZE_COMPLETE   0xff01
+
+/* Host writes the following to notify that it has done the init-handshake */
+#define PHAN_INITIALIZE_ACK0xf00f
+
+#define NUM_RCV_DESC_RINGS 2   /* No of Rcv Descriptor contexts */
+
+/* descriptor types */
+#define RCV_DESC_NORMAL0x01
+#define RCV_DESC_JUMBO 0x02
+#define RCV_DESC_NORMAL_CTXID  0
+#define RCV_DESC_JUMBO_CTXID   1
+
+#define RCV_DESC_TYPE(ID) \
+   ((ID == RCV_DESC_JUMBO_CTXID) ? RCV_DESC_JUMBO : RCV_DESC_NORMAL)
+
+#define MAX_CMD_DESCRIPTORS1024
+#define MAX_RCV_DESCRIPTORS32768