aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netxen/netxen_nic.h
diff options
context:
space:
mode:
authorDhananjay Phadke <dhananjay@netxen.com>2009-04-07 18:50:39 -0400
committerDavid S. Miller <davem@davemloft.net>2009-04-08 18:58:25 -0400
commit1b1f789818c6be9437cfe199932ee13faafca60f (patch)
treebcaef3319a13e5f6a57bca983de97921e612c3b0 /drivers/net/netxen/netxen_nic.h
parente98e3350c03af4187e1d5fe007c7b460e378990c (diff)
netxen: refactor netxen_adapter
Rearrange members to align them at right offset. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/netxen/netxen_nic.h')
-rw-r--r--drivers/net/netxen/netxen_nic.h80
1 files changed, 39 insertions, 41 deletions
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h
index 184eb6f76d55..1165f53ea2ca 100644
--- a/drivers/net/netxen/netxen_nic.h
+++ b/drivers/net/netxen/netxen_nic.h
@@ -700,14 +700,13 @@ struct netxen_hardware_context {
700 700
701 u8 cut_through; 701 u8 cut_through;
702 u8 revision_id; 702 u8 revision_id;
703 u8 pci_func;
704 u8 linkup;
703 u16 port_type; 705 u16 port_type;
704 int board_type; 706 u16 board_type;
705 u32 linkup;
706 /* Address of cmd ring in Phantom */ 707 /* Address of cmd ring in Phantom */
707 struct cmd_desc_type0 *cmd_desc_head; 708 struct cmd_desc_type0 *cmd_desc_head;
708 dma_addr_t cmd_desc_phys_addr; 709 dma_addr_t cmd_desc_phys_addr;
709 struct netxen_adapter *adapter;
710 int pci_func;
711}; 710};
712 711
713#define MINIMUM_ETHERNET_FRAME_SIZE 64 /* With FCS */ 712#define MINIMUM_ETHERNET_FRAME_SIZE 64 /* With FCS */
@@ -1146,61 +1145,52 @@ struct netxen_adapter {
1146 1145
1147 struct net_device *netdev; 1146 struct net_device *netdev;
1148 struct pci_dev *pdev; 1147 struct pci_dev *pdev;
1149 int pci_using_dac;
1150 struct net_device_stats net_stats;
1151 int mtu;
1152 int portnum;
1153 u8 physical_port;
1154 u16 tx_context_id;
1155
1156 uint8_t mc_enabled;
1157 uint8_t max_mc_count;
1158 nx_mac_list_t *mac_list; 1148 nx_mac_list_t *mac_list;
1159 1149
1160 struct netxen_legacy_intr_set legacy_intr;
1161
1162 struct work_struct watchdog_task;
1163 struct timer_list watchdog_timer;
1164 struct work_struct tx_timeout_task;
1165
1166 u32 curr_window; 1150 u32 curr_window;
1167 u32 crb_win; 1151 u32 crb_win;
1168 rwlock_t adapter_lock; 1152 rwlock_t adapter_lock;
1169 1153
1154 spinlock_t tx_clean_lock;
1170 u32 cmd_producer; 1155 u32 cmd_producer;
1171 __le32 *cmd_consumer;
1172 u32 last_cmd_consumer; 1156 u32 last_cmd_consumer;
1173 u32 crb_addr_cmd_producer; 1157 u32 crb_addr_cmd_producer;
1174 u32 crb_addr_cmd_consumer; 1158 u32 crb_addr_cmd_consumer;
1175 spinlock_t tx_clean_lock; 1159 __le32 *cmd_consumer;
1176 1160
1177 u32 num_txd; 1161 u32 num_txd;
1178 u32 num_rxd; 1162 u32 num_rxd;
1179 u32 num_jumbo_rxd; 1163 u32 num_jumbo_rxd;
1180 u32 num_lro_rxd; 1164 u32 num_lro_rxd;
1181 1165
1182 int max_rds_rings; 1166 u8 max_rds_rings;
1183 int max_sds_rings; 1167 u8 max_sds_rings;
1168 u8 driver_mismatch;
1169 u8 msix_supported;
1170 u8 rx_csum;
1171 u8 pci_using_dac;
1172 u8 portnum;
1173 u8 physical_port;
1174
1175 u8 mc_enabled;
1176 u8 max_mc_count;
1177 u16 tx_context_id;
1178 u16 mtu;
1179 u16 is_up;
1180 u16 link_speed;
1181 u16 link_duplex;
1182 u16 link_autoneg;
1183 u16 resv1;
1184 1184
1185 u32 resv2;
1185 u32 flags; 1186 u32 flags;
1186 u32 irq; 1187 u32 irq;
1187 int driver_mismatch;
1188 u32 temp; 1188 u32 temp;
1189
1190 u32 fw_major; 1189 u32 fw_major;
1191 u32 fw_version; 1190 u32 fw_version;
1192 1191
1193 int msix_supported;
1194 struct msix_entry msix_entries[MSIX_ENTRIES_PER_ADAPTER];
1195
1196 struct netxen_adapter_stats stats; 1192 struct netxen_adapter_stats stats;
1197 1193
1198 u16 link_speed;
1199 u16 link_duplex;
1200 u16 state;
1201 u16 link_autoneg;
1202 int rx_csum;
1203
1204 struct netxen_cmd_buffer *cmd_buf_arr; /* Command buffers for xmit */ 1194 struct netxen_cmd_buffer *cmd_buf_arr; /* Command buffers for xmit */
1205 1195
1206 /* 1196 /*
@@ -1209,15 +1199,9 @@ struct netxen_adapter {
1209 */ 1199 */
1210 struct netxen_recv_context recv_ctx; 1200 struct netxen_recv_context recv_ctx;
1211 1201
1212 int is_up;
1213 struct netxen_dummy_dma dummy_dma;
1214 nx_nic_intr_coalesce_t coal;
1215
1216 /* Context interface shared between card and host */ 1202 /* Context interface shared between card and host */
1217 struct netxen_ring_ctx *ctx_desc; 1203 struct netxen_ring_ctx *ctx_desc;
1218 dma_addr_t ctx_desc_phys_addr; 1204 dma_addr_t ctx_desc_phys_addr;
1219 int intr_scheme;
1220 int msi_mode;
1221 int (*enable_phy_interrupts) (struct netxen_adapter *); 1205 int (*enable_phy_interrupts) (struct netxen_adapter *);
1222 int (*disable_phy_interrupts) (struct netxen_adapter *); 1206 int (*disable_phy_interrupts) (struct netxen_adapter *);
1223 int (*macaddr_set) (struct netxen_adapter *, netxen_ethernet_macaddr_t); 1207 int (*macaddr_set) (struct netxen_adapter *, netxen_ethernet_macaddr_t);
@@ -1238,7 +1222,21 @@ struct netxen_adapter {
1238 u32 (*pci_read_normalize)(struct netxen_adapter *, u64); 1222 u32 (*pci_read_normalize)(struct netxen_adapter *, u64);
1239 unsigned long (*pci_set_window)(struct netxen_adapter *, 1223 unsigned long (*pci_set_window)(struct netxen_adapter *,
1240 unsigned long long); 1224 unsigned long long);
1241}; /* netxen_adapter structure */ 1225
1226 struct netxen_legacy_intr_set legacy_intr;
1227
1228 struct msix_entry msix_entries[MSIX_ENTRIES_PER_ADAPTER];
1229
1230 struct netxen_dummy_dma dummy_dma;
1231
1232 struct work_struct watchdog_task;
1233 struct timer_list watchdog_timer;
1234 struct work_struct tx_timeout_task;
1235
1236 struct net_device_stats net_stats;
1237
1238 nx_nic_intr_coalesce_t coal;
1239};
1242 1240
1243/* 1241/*
1244 * NetXen dma watchdog control structure 1242 * NetXen dma watchdog control structure