aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netxen/netxen_nic.h
diff options
context:
space:
mode:
authorDhananjay Phadke <dhananjay@netxen.com>2008-07-21 22:44:04 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-07-22 17:51:53 -0400
commit2956640d4aaaecd42bd8ba800cc8c33bfe206b7e (patch)
tree78c0442fd1a382f5f01489d4f268c5876d243b95 /drivers/net/netxen/netxen_nic.h
parent3ce06a320f8d5a3f16960e63021cc372283efffb (diff)
netxen: pci probe and firmware init changes
Add initialization code in pci probe for new chip and retain compatibility with old revisions. 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.h40
1 files changed, 33 insertions, 7 deletions
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h
index 29ab2ce30d6e..b23a5a447f0c 100644
--- a/drivers/net/netxen/netxen_nic.h
+++ b/drivers/net/netxen/netxen_nic.h
@@ -801,6 +801,7 @@ struct netxen_hardware_context {
801 unsigned long db_len; 801 unsigned long db_len;
802 unsigned long pci_len0; 802 unsigned long pci_len0;
803 803
804 u8 cut_through;
804 int qdr_sn_window; 805 int qdr_sn_window;
805 int ddr_mn_window; 806 int ddr_mn_window;
806 unsigned long mn_win_crb; 807 unsigned long mn_win_crb;
@@ -871,9 +872,16 @@ struct netxen_recv_context {
871 struct status_desc *rcv_status_desc_head; 872 struct status_desc *rcv_status_desc_head;
872}; 873};
873 874
874#define NETXEN_NIC_MSI_ENABLED 0x02 875#define NETXEN_NIC_MSI_ENABLED 0x02
875#define NETXEN_DMA_MASK 0xfffffffe 876#define NETXEN_NIC_MSIX_ENABLED 0x04
876#define NETXEN_DB_MAPSIZE_BYTES 0x1000 877#define NETXEN_IS_MSI_FAMILY(adapter) \
878 ((adapter)->flags & (NETXEN_NIC_MSI_ENABLED | NETXEN_NIC_MSIX_ENABLED))
879
880#define MSIX_ENTRIES_PER_ADAPTER 8
881#define NETXEN_MSIX_TBL_SPACE 8192
882#define NETXEN_PCI_REG_MSIX_TBL 0x44
883
884#define NETXEN_DB_MAPSIZE_BYTES 0x1000
877 885
878struct netxen_dummy_dma { 886struct netxen_dummy_dma {
879 void *addr; 887 void *addr;
@@ -885,6 +893,7 @@ struct netxen_adapter {
885 893
886 struct net_device *netdev; 894 struct net_device *netdev;
887 struct pci_dev *pdev; 895 struct pci_dev *pdev;
896 int pci_using_dac;
888 struct napi_struct napi; 897 struct napi_struct napi;
889 struct net_device_stats net_stats; 898 struct net_device_stats net_stats;
890 unsigned char mac_addr[ETH_ALEN]; 899 unsigned char mac_addr[ETH_ALEN];
@@ -895,6 +904,8 @@ struct netxen_adapter {
895 uint8_t mc_enabled; 904 uint8_t mc_enabled;
896 uint8_t max_mc_count; 905 uint8_t max_mc_count;
897 906
907 struct netxen_legacy_intr_set legacy_intr;
908
898 struct work_struct watchdog_task; 909 struct work_struct watchdog_task;
899 struct timer_list watchdog_timer; 910 struct timer_list watchdog_timer;
900 struct work_struct tx_timeout_task; 911 struct work_struct tx_timeout_task;
@@ -903,6 +914,8 @@ struct netxen_adapter {
903 u32 crb_win; 914 u32 crb_win;
904 rwlock_t adapter_lock; 915 rwlock_t adapter_lock;
905 916
917 uint64_t dma_mask;
918
906 u32 cmd_producer; 919 u32 cmd_producer;
907 __le32 *cmd_consumer; 920 __le32 *cmd_consumer;
908 u32 last_cmd_consumer; 921 u32 last_cmd_consumer;
@@ -919,6 +932,12 @@ struct netxen_adapter {
919 int driver_mismatch; 932 int driver_mismatch;
920 u32 temp; 933 u32 temp;
921 934
935 u32 fw_major;
936
937 u8 msix_supported;
938 u8 max_possible_rss_rings;
939 struct msix_entry msix_entries[MSIX_ENTRIES_PER_ADAPTER];
940
922 struct netxen_adapter_stats stats; 941 struct netxen_adapter_stats stats;
923 942
924 u16 link_speed; 943 u16 link_speed;
@@ -1092,8 +1111,10 @@ unsigned long netxen_nic_pci_set_window_2M(struct netxen_adapter *adapter,
1092void netxen_free_adapter_offload(struct netxen_adapter *adapter); 1111void netxen_free_adapter_offload(struct netxen_adapter *adapter);
1093int netxen_initialize_adapter_offload(struct netxen_adapter *adapter); 1112int netxen_initialize_adapter_offload(struct netxen_adapter *adapter);
1094int netxen_phantom_init(struct netxen_adapter *adapter, int pegtune_val); 1113int netxen_phantom_init(struct netxen_adapter *adapter, int pegtune_val);
1114int netxen_receive_peg_ready(struct netxen_adapter *adapter);
1095int netxen_load_firmware(struct netxen_adapter *adapter); 1115int netxen_load_firmware(struct netxen_adapter *adapter);
1096int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose); 1116int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose);
1117
1097int netxen_rom_fast_read(struct netxen_adapter *adapter, int addr, int *valp); 1118int netxen_rom_fast_read(struct netxen_adapter *adapter, int addr, int *valp);
1098int netxen_rom_fast_read_words(struct netxen_adapter *adapter, int addr, 1119int netxen_rom_fast_read_words(struct netxen_adapter *adapter, int addr,
1099 u8 *bytes, size_t size); 1120 u8 *bytes, size_t size);
@@ -1107,14 +1128,19 @@ void netxen_halt_pegs(struct netxen_adapter *adapter);
1107 1128
1108int netxen_rom_se(struct netxen_adapter *adapter, int addr); 1129int netxen_rom_se(struct netxen_adapter *adapter, int addr);
1109 1130
1110/* Functions from netxen_nic_isr.c */ 1131int netxen_alloc_sw_resources(struct netxen_adapter *adapter);
1111void netxen_initialize_adapter_sw(struct netxen_adapter *adapter); 1132void netxen_free_sw_resources(struct netxen_adapter *adapter);
1133
1134int netxen_alloc_hw_resources(struct netxen_adapter *adapter);
1135void netxen_free_hw_resources(struct netxen_adapter *adapter);
1136
1137void netxen_release_rx_buffers(struct netxen_adapter *adapter);
1138void netxen_release_tx_buffers(struct netxen_adapter *adapter);
1139
1112void netxen_initialize_adapter_ops(struct netxen_adapter *adapter); 1140void netxen_initialize_adapter_ops(struct netxen_adapter *adapter);
1113int netxen_init_firmware(struct netxen_adapter *adapter); 1141int netxen_init_firmware(struct netxen_adapter *adapter);
1114void netxen_free_hw_resources(struct netxen_adapter *adapter);
1115void netxen_tso_check(struct netxen_adapter *adapter, 1142void netxen_tso_check(struct netxen_adapter *adapter,
1116 struct cmd_desc_type0 *desc, struct sk_buff *skb); 1143 struct cmd_desc_type0 *desc, struct sk_buff *skb);
1117int netxen_nic_hw_resources(struct netxen_adapter *adapter);
1118void netxen_nic_clear_stats(struct netxen_adapter *adapter); 1144void netxen_nic_clear_stats(struct netxen_adapter *adapter);
1119void netxen_watchdog_task(struct work_struct *work); 1145void netxen_watchdog_task(struct work_struct *work);
1120void netxen_post_rx_buffers(struct netxen_adapter *adapter, u32 ctx, 1146void netxen_post_rx_buffers(struct netxen_adapter *adapter, u32 ctx,