aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netxen/netxen_nic.h
diff options
context:
space:
mode:
authorDhananjay Phadke <dhananjay@netxen.com>2008-07-21 22:44:03 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-07-22 17:51:44 -0400
commit3ce06a320f8d5a3f16960e63021cc372283efffb (patch)
treecea5b02fc44b8c2367c57d7c249592683edffcc9 /drivers/net/netxen/netxen_nic.h
parente4c93c817ce650401db42db6c869cf7688217ff4 (diff)
netxen: add 2MB PCI memory support
New revision of netxen chip has 2MB PCI memory. Older chips had 128MB addressable PCI memory. To retain compatibility, this patch adds function pointers based on pci bar0 size. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/netxen/netxen_nic.h')
-rw-r--r--drivers/net/netxen/netxen_nic.h70
1 files changed, 61 insertions, 9 deletions
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h
index acc7d79457d6..29ab2ce30d6e 100644
--- a/drivers/net/netxen/netxen_nic.h
+++ b/drivers/net/netxen/netxen_nic.h
@@ -799,6 +799,12 @@ struct netxen_hardware_context {
799 unsigned long first_page_group_start; 799 unsigned long first_page_group_start;
800 void __iomem *db_base; 800 void __iomem *db_base;
801 unsigned long db_len; 801 unsigned long db_len;
802 unsigned long pci_len0;
803
804 int qdr_sn_window;
805 int ddr_mn_window;
806 unsigned long mn_win_crb;
807 unsigned long ms_win_crb;
802 808
803 u8 revision_id; 809 u8 revision_id;
804 u16 board_type; 810 u16 board_type;
@@ -894,6 +900,8 @@ struct netxen_adapter {
894 struct work_struct tx_timeout_task; 900 struct work_struct tx_timeout_task;
895 901
896 u32 curr_window; 902 u32 curr_window;
903 u32 crb_win;
904 rwlock_t adapter_lock;
897 905
898 u32 cmd_producer; 906 u32 cmd_producer;
899 __le32 *cmd_consumer; 907 __le32 *cmd_consumer;
@@ -947,6 +955,17 @@ struct netxen_adapter {
947 int (*init_port) (struct netxen_adapter *, int); 955 int (*init_port) (struct netxen_adapter *, int);
948 void (*init_niu) (struct netxen_adapter *); 956 void (*init_niu) (struct netxen_adapter *);
949 int (*stop_port) (struct netxen_adapter *); 957 int (*stop_port) (struct netxen_adapter *);
958
959 int (*hw_read_wx)(struct netxen_adapter *, ulong, void *, int);
960 int (*hw_write_wx)(struct netxen_adapter *, ulong, void *, int);
961 int (*pci_mem_read)(struct netxen_adapter *, u64, void *, int);
962 int (*pci_mem_write)(struct netxen_adapter *, u64, void *, int);
963 int (*pci_write_immediate)(struct netxen_adapter *, u64, u32);
964 u32 (*pci_read_immediate)(struct netxen_adapter *, u64);
965 void (*pci_write_normalize)(struct netxen_adapter *, u64, u32);
966 u32 (*pci_read_normalize)(struct netxen_adapter *, u64);
967 unsigned long (*pci_set_window)(struct netxen_adapter *,
968 unsigned long long);
950}; /* netxen_adapter structure */ 969}; /* netxen_adapter structure */
951 970
952/* 971/*
@@ -1022,19 +1041,52 @@ int netxen_niu_gbe_phy_write(struct netxen_adapter *adapter,
1022int netxen_nic_set_mtu_xgb(struct netxen_adapter *adapter, int new_mtu); 1041int netxen_nic_set_mtu_xgb(struct netxen_adapter *adapter, int new_mtu);
1023int netxen_nic_set_mtu_gb(struct netxen_adapter *adapter, int new_mtu); 1042int netxen_nic_set_mtu_gb(struct netxen_adapter *adapter, int new_mtu);
1024void netxen_nic_init_niu_gb(struct netxen_adapter *adapter); 1043void netxen_nic_init_niu_gb(struct netxen_adapter *adapter);
1025void netxen_nic_pci_change_crbwindow(struct netxen_adapter *adapter, u32 wndw);
1026void netxen_nic_reg_write(struct netxen_adapter *adapter, u64 off, u32 val); 1044void netxen_nic_reg_write(struct netxen_adapter *adapter, u64 off, u32 val);
1027int netxen_nic_reg_read(struct netxen_adapter *adapter, u64 off); 1045int netxen_nic_reg_read(struct netxen_adapter *adapter, u64 off);
1028void netxen_nic_write_w0(struct netxen_adapter *adapter, u32 index, u32 value); 1046void netxen_nic_write_w0(struct netxen_adapter *adapter, u32 index, u32 value);
1029void netxen_nic_read_w0(struct netxen_adapter *adapter, u32 index, u32 * value); 1047void netxen_nic_read_w0(struct netxen_adapter *adapter, u32 index, u32 *value);
1048void netxen_nic_write_w1(struct netxen_adapter *adapter, u32 index, u32 value);
1049void netxen_nic_read_w1(struct netxen_adapter *adapter, u32 index, u32 *value);
1030 1050
1031int netxen_nic_get_board_info(struct netxen_adapter *adapter); 1051int netxen_nic_get_board_info(struct netxen_adapter *adapter);
1032int netxen_nic_hw_read_wx(struct netxen_adapter *adapter, u64 off, void *data, 1052
1033 int len); 1053int netxen_nic_hw_read_wx_128M(struct netxen_adapter *adapter,
1034int netxen_nic_hw_write_wx(struct netxen_adapter *adapter, u64 off, void *data, 1054 ulong off, void *data, int len);
1035 int len); 1055int netxen_nic_hw_write_wx_128M(struct netxen_adapter *adapter,
1056 ulong off, void *data, int len);
1057int netxen_nic_pci_mem_read_128M(struct netxen_adapter *adapter,
1058 u64 off, void *data, int size);
1059int netxen_nic_pci_mem_write_128M(struct netxen_adapter *adapter,
1060 u64 off, void *data, int size);
1061int netxen_nic_pci_write_immediate_128M(struct netxen_adapter *adapter,
1062 u64 off, u32 data);
1063u32 netxen_nic_pci_read_immediate_128M(struct netxen_adapter *adapter, u64 off);
1064void netxen_nic_pci_write_normalize_128M(struct netxen_adapter *adapter,
1065 u64 off, u32 data);
1066u32 netxen_nic_pci_read_normalize_128M(struct netxen_adapter *adapter, u64 off);
1067unsigned long netxen_nic_pci_set_window_128M(struct netxen_adapter *adapter,
1068 unsigned long long addr);
1069void netxen_nic_pci_change_crbwindow_128M(struct netxen_adapter *adapter,
1070 u32 wndw);
1071
1072int netxen_nic_hw_read_wx_2M(struct netxen_adapter *adapter,
1073 ulong off, void *data, int len);
1074int netxen_nic_hw_write_wx_2M(struct netxen_adapter *adapter,
1075 ulong off, void *data, int len);
1076int netxen_nic_pci_mem_read_2M(struct netxen_adapter *adapter,
1077 u64 off, void *data, int size);
1078int netxen_nic_pci_mem_write_2M(struct netxen_adapter *adapter,
1079 u64 off, void *data, int size);
1036void netxen_crb_writelit_adapter(struct netxen_adapter *adapter, 1080void netxen_crb_writelit_adapter(struct netxen_adapter *adapter,
1037 unsigned long off, int data); 1081 unsigned long off, int data);
1082int netxen_nic_pci_write_immediate_2M(struct netxen_adapter *adapter,
1083 u64 off, u32 data);
1084u32 netxen_nic_pci_read_immediate_2M(struct netxen_adapter *adapter, u64 off);
1085void netxen_nic_pci_write_normalize_2M(struct netxen_adapter *adapter,
1086 u64 off, u32 data);
1087u32 netxen_nic_pci_read_normalize_2M(struct netxen_adapter *adapter, u64 off);
1088unsigned long netxen_nic_pci_set_window_2M(struct netxen_adapter *adapter,
1089 unsigned long long addr);
1038 1090
1039/* Functions from netxen_nic_init.c */ 1091/* Functions from netxen_nic_init.c */
1040void netxen_free_adapter_offload(struct netxen_adapter *adapter); 1092void netxen_free_adapter_offload(struct netxen_adapter *adapter);
@@ -1129,7 +1181,7 @@ dma_watchdog_shutdown_request(struct netxen_adapter *adapter)
1129 u32 ctrl; 1181 u32 ctrl;
1130 1182
1131 /* check if already inactive */ 1183 /* check if already inactive */
1132 if (netxen_nic_hw_read_wx(adapter, 1184 if (adapter->hw_read_wx(adapter,
1133 NETXEN_CAM_RAM(NETXEN_CAM_RAM_DMA_WATCHDOG_CTRL), &ctrl, 4)) 1185 NETXEN_CAM_RAM(NETXEN_CAM_RAM_DMA_WATCHDOG_CTRL), &ctrl, 4))
1134 printk(KERN_ERR "failed to read dma watchdog status\n"); 1186 printk(KERN_ERR "failed to read dma watchdog status\n");
1135 1187
@@ -1149,7 +1201,7 @@ dma_watchdog_shutdown_poll_result(struct netxen_adapter *adapter)
1149{ 1201{
1150 u32 ctrl; 1202 u32 ctrl;
1151 1203
1152 if (netxen_nic_hw_read_wx(adapter, 1204 if (adapter->hw_read_wx(adapter,
1153 NETXEN_CAM_RAM(NETXEN_CAM_RAM_DMA_WATCHDOG_CTRL), &ctrl, 4)) 1205 NETXEN_CAM_RAM(NETXEN_CAM_RAM_DMA_WATCHDOG_CTRL), &ctrl, 4))
1154 printk(KERN_ERR "failed to read dma watchdog status\n"); 1206 printk(KERN_ERR "failed to read dma watchdog status\n");
1155 1207
@@ -1161,7 +1213,7 @@ dma_watchdog_wakeup(struct netxen_adapter *adapter)
1161{ 1213{
1162 u32 ctrl; 1214 u32 ctrl;
1163 1215
1164 if (netxen_nic_hw_read_wx(adapter, 1216 if (adapter->hw_read_wx(adapter,
1165 NETXEN_CAM_RAM(NETXEN_CAM_RAM_DMA_WATCHDOG_CTRL), &ctrl, 4)) 1217 NETXEN_CAM_RAM(NETXEN_CAM_RAM_DMA_WATCHDOG_CTRL), &ctrl, 4))
1166 printk(KERN_ERR "failed to read dma watchdog status\n"); 1218 printk(KERN_ERR "failed to read dma watchdog status\n");
1167 1219