diff options
Diffstat (limited to 'drivers/net/netxen/netxen_nic.h')
-rw-r--r-- | drivers/net/netxen/netxen_nic.h | 74 |
1 files changed, 47 insertions, 27 deletions
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h index 56fad22fed9..595171d943f 100644 --- a/drivers/net/netxen/netxen_nic.h +++ b/drivers/net/netxen/netxen_nic.h | |||
@@ -78,16 +78,17 @@ | |||
78 | 78 | ||
79 | #define PHAN_VENDOR_ID 0x4040 | 79 | #define PHAN_VENDOR_ID 0x4040 |
80 | 80 | ||
81 | #define RCV_DESC_RINGSIZE \ | 81 | #define RCV_DESC_RINGSIZE(rds_ring) \ |
82 | (sizeof(struct rcv_desc) * adapter->num_rxd) | 82 | (sizeof(struct rcv_desc) * (rds_ring)->num_desc) |
83 | #define STATUS_DESC_RINGSIZE \ | 83 | #define RCV_BUFF_RINGSIZE(rds_ring) \ |
84 | (sizeof(struct status_desc) * adapter->num_rxd) | ||
85 | #define LRO_DESC_RINGSIZE \ | ||
86 | (sizeof(rcvDesc_t) * adapter->num_lro_rxd) | ||
87 | #define TX_RINGSIZE \ | ||
88 | (sizeof(struct netxen_cmd_buffer) * adapter->num_txd) | ||
89 | #define RCV_BUFFSIZE \ | ||
90 | (sizeof(struct netxen_rx_buffer) * rds_ring->num_desc) | 84 | (sizeof(struct netxen_rx_buffer) * rds_ring->num_desc) |
85 | #define STATUS_DESC_RINGSIZE(sds_ring) \ | ||
86 | (sizeof(struct status_desc) * (sds_ring)->num_desc) | ||
87 | #define TX_BUFF_RINGSIZE(adapter) \ | ||
88 | (sizeof(struct netxen_cmd_buffer) * adapter->num_txd) | ||
89 | #define TX_DESC_RINGSIZE(adapter) \ | ||
90 | (sizeof(struct cmd_desc_type0) * adapter->num_txd) | ||
91 | |||
91 | #define find_diff_among(a,b,range) ((a)<(b)?((b)-(a)):((b)+(range)-(a))) | 92 | #define find_diff_among(a,b,range) ((a)<(b)?((b)-(a)):((b)+(range)-(a))) |
92 | 93 | ||
93 | #define NETXEN_RCV_PRODUCER_OFFSET 0 | 94 | #define NETXEN_RCV_PRODUCER_OFFSET 0 |
@@ -188,7 +189,8 @@ | |||
188 | /* Host writes the following to notify that it has done the init-handshake */ | 189 | /* Host writes the following to notify that it has done the init-handshake */ |
189 | #define PHAN_INITIALIZE_ACK 0xf00f | 190 | #define PHAN_INITIALIZE_ACK 0xf00f |
190 | 191 | ||
191 | #define NUM_RCV_DESC_RINGS 3 /* No of Rcv Descriptor contexts */ | 192 | #define NUM_RCV_DESC_RINGS 3 |
193 | #define NUM_STS_DESC_RINGS 4 | ||
192 | 194 | ||
193 | #define RCV_RING_NORMAL 0 | 195 | #define RCV_RING_NORMAL 0 |
194 | #define RCV_RING_JUMBO 1 | 196 | #define RCV_RING_JUMBO 1 |
@@ -722,7 +724,7 @@ extern char netxen_nic_driver_name[]; | |||
722 | #endif | 724 | #endif |
723 | 725 | ||
724 | /* Number of status descriptors to handle per interrupt */ | 726 | /* Number of status descriptors to handle per interrupt */ |
725 | #define MAX_STATUS_HANDLE (128) | 727 | #define MAX_STATUS_HANDLE (64) |
726 | 728 | ||
727 | /* | 729 | /* |
728 | * netxen_skb_frag{} is to contain mapping info for each SG list. This | 730 | * netxen_skb_frag{} is to contain mapping info for each SG list. This |
@@ -827,17 +829,37 @@ struct netxen_adapter_stats { | |||
827 | */ | 829 | */ |
828 | struct nx_host_rds_ring { | 830 | struct nx_host_rds_ring { |
829 | u32 producer; | 831 | u32 producer; |
830 | u32 crb_rcv_producer; /* reg offset */ | 832 | u32 crb_rcv_producer; |
831 | struct rcv_desc *desc_head; /* address of rx ring in Phantom */ | ||
832 | struct netxen_rx_buffer *rx_buf_arr; /* rx buffers for receive */ | ||
833 | struct list_head free_list; | ||
834 | u32 num_desc; | 833 | u32 num_desc; |
835 | u32 dma_size; | 834 | u32 dma_size; |
836 | u32 skb_size; | 835 | u32 skb_size; |
837 | u32 flags; | 836 | u32 flags; |
837 | struct rcv_desc *desc_head; | ||
838 | struct netxen_rx_buffer *rx_buf_arr; | ||
839 | struct list_head free_list; | ||
840 | spinlock_t lock; | ||
838 | dma_addr_t phys_addr; | 841 | dma_addr_t phys_addr; |
839 | }; | 842 | }; |
840 | 843 | ||
844 | struct nx_host_sds_ring { | ||
845 | u32 consumer; | ||
846 | u32 crb_sts_consumer; | ||
847 | u32 crb_intr_mask; | ||
848 | u32 num_desc; | ||
849 | |||
850 | struct status_desc *desc_head; | ||
851 | struct netxen_adapter *adapter; | ||
852 | struct napi_struct napi; | ||
853 | struct list_head free_list[NUM_RCV_DESC_RINGS]; | ||
854 | |||
855 | u16 clean_tx; | ||
856 | u16 post_rxd; | ||
857 | int irq; | ||
858 | |||
859 | dma_addr_t phys_addr; | ||
860 | char name[IFNAMSIZ+4]; | ||
861 | }; | ||
862 | |||
841 | /* | 863 | /* |
842 | * Receive context. There is one such structure per instance of the | 864 | * Receive context. There is one such structure per instance of the |
843 | * receive processing. Any state information that is relevant to | 865 | * receive processing. Any state information that is relevant to |
@@ -850,10 +872,7 @@ struct netxen_recv_context { | |||
850 | u16 virt_port; | 872 | u16 virt_port; |
851 | 873 | ||
852 | struct nx_host_rds_ring rds_rings[NUM_RCV_DESC_RINGS]; | 874 | struct nx_host_rds_ring rds_rings[NUM_RCV_DESC_RINGS]; |
853 | u32 status_rx_consumer; | 875 | struct nx_host_sds_ring sds_rings[NUM_STS_DESC_RINGS]; |
854 | u32 crb_sts_consumer; /* reg offset */ | ||
855 | dma_addr_t rcv_status_desc_phys_addr; | ||
856 | struct status_desc *rcv_status_desc_head; | ||
857 | }; | 876 | }; |
858 | 877 | ||
859 | /* New HW context creation */ | 878 | /* New HW context creation */ |
@@ -1179,13 +1198,13 @@ typedef struct { | |||
1179 | #define NETXEN_IS_MSI_FAMILY(adapter) \ | 1198 | #define NETXEN_IS_MSI_FAMILY(adapter) \ |
1180 | ((adapter)->flags & (NETXEN_NIC_MSI_ENABLED | NETXEN_NIC_MSIX_ENABLED)) | 1199 | ((adapter)->flags & (NETXEN_NIC_MSI_ENABLED | NETXEN_NIC_MSIX_ENABLED)) |
1181 | 1200 | ||
1182 | #define MSIX_ENTRIES_PER_ADAPTER 1 | 1201 | #define MSIX_ENTRIES_PER_ADAPTER NUM_STS_DESC_RINGS |
1183 | #define NETXEN_MSIX_TBL_SPACE 8192 | 1202 | #define NETXEN_MSIX_TBL_SPACE 8192 |
1184 | #define NETXEN_PCI_REG_MSIX_TBL 0x44 | 1203 | #define NETXEN_PCI_REG_MSIX_TBL 0x44 |
1185 | 1204 | ||
1186 | #define NETXEN_DB_MAPSIZE_BYTES 0x1000 | 1205 | #define NETXEN_DB_MAPSIZE_BYTES 0x1000 |
1187 | 1206 | ||
1188 | #define NETXEN_NETDEV_WEIGHT 120 | 1207 | #define NETXEN_NETDEV_WEIGHT 128 |
1189 | #define NETXEN_ADAPTER_UP_MAGIC 777 | 1208 | #define NETXEN_ADAPTER_UP_MAGIC 777 |
1190 | #define NETXEN_NIC_PEG_TUNE 0 | 1209 | #define NETXEN_NIC_PEG_TUNE 0 |
1191 | 1210 | ||
@@ -1200,7 +1219,6 @@ struct netxen_adapter { | |||
1200 | struct net_device *netdev; | 1219 | struct net_device *netdev; |
1201 | struct pci_dev *pdev; | 1220 | struct pci_dev *pdev; |
1202 | int pci_using_dac; | 1221 | int pci_using_dac; |
1203 | struct napi_struct napi; | ||
1204 | struct net_device_stats net_stats; | 1222 | struct net_device_stats net_stats; |
1205 | int mtu; | 1223 | int mtu; |
1206 | int portnum; | 1224 | int portnum; |
@@ -1212,7 +1230,6 @@ struct netxen_adapter { | |||
1212 | nx_mac_list_t *mac_list; | 1230 | nx_mac_list_t *mac_list; |
1213 | 1231 | ||
1214 | struct netxen_legacy_intr_set legacy_intr; | 1232 | struct netxen_legacy_intr_set legacy_intr; |
1215 | u32 crb_intr_mask; | ||
1216 | 1233 | ||
1217 | struct work_struct watchdog_task; | 1234 | struct work_struct watchdog_task; |
1218 | struct timer_list watchdog_timer; | 1235 | struct timer_list watchdog_timer; |
@@ -1227,6 +1244,7 @@ struct netxen_adapter { | |||
1227 | u32 last_cmd_consumer; | 1244 | u32 last_cmd_consumer; |
1228 | u32 crb_addr_cmd_producer; | 1245 | u32 crb_addr_cmd_producer; |
1229 | u32 crb_addr_cmd_consumer; | 1246 | u32 crb_addr_cmd_consumer; |
1247 | spinlock_t tx_clean_lock; | ||
1230 | 1248 | ||
1231 | u32 num_txd; | 1249 | u32 num_txd; |
1232 | u32 num_rxd; | 1250 | u32 num_rxd; |
@@ -1234,6 +1252,7 @@ struct netxen_adapter { | |||
1234 | u32 num_lro_rxd; | 1252 | u32 num_lro_rxd; |
1235 | 1253 | ||
1236 | int max_rds_rings; | 1254 | int max_rds_rings; |
1255 | int max_sds_rings; | ||
1237 | 1256 | ||
1238 | u32 flags; | 1257 | u32 flags; |
1239 | u32 irq; | 1258 | u32 irq; |
@@ -1243,8 +1262,7 @@ struct netxen_adapter { | |||
1243 | u32 fw_major; | 1262 | u32 fw_major; |
1244 | u32 fw_version; | 1263 | u32 fw_version; |
1245 | 1264 | ||
1246 | u8 msix_supported; | 1265 | int msix_supported; |
1247 | u8 max_possible_rss_rings; | ||
1248 | struct msix_entry msix_entries[MSIX_ENTRIES_PER_ADAPTER]; | 1266 | struct msix_entry msix_entries[MSIX_ENTRIES_PER_ADAPTER]; |
1249 | 1267 | ||
1250 | struct netxen_adapter_stats stats; | 1268 | struct netxen_adapter_stats stats; |
@@ -1447,14 +1465,16 @@ void netxen_initialize_adapter_ops(struct netxen_adapter *adapter); | |||
1447 | int netxen_init_firmware(struct netxen_adapter *adapter); | 1465 | int netxen_init_firmware(struct netxen_adapter *adapter); |
1448 | void netxen_nic_clear_stats(struct netxen_adapter *adapter); | 1466 | void netxen_nic_clear_stats(struct netxen_adapter *adapter); |
1449 | void netxen_watchdog_task(struct work_struct *work); | 1467 | void netxen_watchdog_task(struct work_struct *work); |
1450 | void netxen_post_rx_buffers(struct netxen_adapter *adapter, u32 ringid); | 1468 | void netxen_post_rx_buffers(struct netxen_adapter *adapter, u32 ringid, |
1469 | struct nx_host_rds_ring *rds_ring); | ||
1451 | int netxen_process_cmd_ring(struct netxen_adapter *adapter); | 1470 | int netxen_process_cmd_ring(struct netxen_adapter *adapter); |
1452 | int netxen_process_rcv_ring(struct netxen_adapter *adapter, int max); | 1471 | int netxen_process_rcv_ring(struct nx_host_sds_ring *sds_ring, int max); |
1453 | void netxen_p2_nic_set_multi(struct net_device *netdev); | 1472 | void netxen_p2_nic_set_multi(struct net_device *netdev); |
1454 | void netxen_p3_nic_set_multi(struct net_device *netdev); | 1473 | void netxen_p3_nic_set_multi(struct net_device *netdev); |
1455 | void netxen_p3_free_mac_list(struct netxen_adapter *adapter); | 1474 | void netxen_p3_free_mac_list(struct netxen_adapter *adapter); |
1456 | int netxen_p3_nic_set_promisc(struct netxen_adapter *adapter, u32); | 1475 | int netxen_p3_nic_set_promisc(struct netxen_adapter *adapter, u32); |
1457 | int netxen_config_intr_coalesce(struct netxen_adapter *adapter); | 1476 | int netxen_config_intr_coalesce(struct netxen_adapter *adapter); |
1477 | int netxen_config_rss(struct netxen_adapter *adapter, int enable); | ||
1458 | 1478 | ||
1459 | int nx_fw_cmd_set_mtu(struct netxen_adapter *adapter, int mtu); | 1479 | int nx_fw_cmd_set_mtu(struct netxen_adapter *adapter, int mtu); |
1460 | int netxen_nic_change_mtu(struct net_device *netdev, int new_mtu); | 1480 | int netxen_nic_change_mtu(struct net_device *netdev, int new_mtu); |