aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netxen/netxen_nic.h
diff options
context:
space:
mode:
authorDhananjay Phadke <dhananjay@netxen.com>2009-03-13 10:52:03 -0400
committerDavid S. Miller <davem@davemloft.net>2009-03-14 17:00:32 -0400
commit438627c77b877e445a4b918a50ff910a5ea2a12d (patch)
tree254abcb0c57f6c57947428f9c8ec38b6904801fc /drivers/net/netxen/netxen_nic.h
parent0b72e659a10ec50acbef90756bf04177b66c8266 (diff)
netxen: sanitize variable names
o remove max_ prefix from ring sizes, since they don't really represent max possible sizes. o cleanup naming of rx ring types (normal, jumbo, lro). o simplify logic to choose rx ring size, gig ports get half rx ring of 10 gig ports. 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.h47
1 files changed, 17 insertions, 30 deletions
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h
index 75cb30f27ae2..f00efe84744f 100644
--- a/drivers/net/netxen/netxen_nic.h
+++ b/drivers/net/netxen/netxen_nic.h
@@ -79,15 +79,15 @@
79#define PHAN_VENDOR_ID 0x4040 79#define PHAN_VENDOR_ID 0x4040
80 80
81#define RCV_DESC_RINGSIZE \ 81#define RCV_DESC_RINGSIZE \
82 (sizeof(struct rcv_desc) * adapter->max_rx_desc_count) 82 (sizeof(struct rcv_desc) * adapter->num_rxd)
83#define STATUS_DESC_RINGSIZE \ 83#define STATUS_DESC_RINGSIZE \
84 (sizeof(struct status_desc)* adapter->max_rx_desc_count) 84 (sizeof(struct status_desc) * adapter->num_rxd)
85#define LRO_DESC_RINGSIZE \ 85#define LRO_DESC_RINGSIZE \
86 (sizeof(rcvDesc_t) * adapter->max_lro_rx_desc_count) 86 (sizeof(rcvDesc_t) * adapter->num_lro_rxd)
87#define TX_RINGSIZE \ 87#define TX_RINGSIZE \
88 (sizeof(struct netxen_cmd_buffer) * adapter->max_tx_desc_count) 88 (sizeof(struct netxen_cmd_buffer) * adapter->num_txd)
89#define RCV_BUFFSIZE \ 89#define RCV_BUFFSIZE \
90 (sizeof(struct netxen_rx_buffer) * rds_ring->max_rx_desc_count) 90 (sizeof(struct netxen_rx_buffer) * rds_ring->num_desc)
91#define find_diff_among(a,b,range) ((a)<(b)?((b)-(a)):((b)+(range)-(a))) 91#define find_diff_among(a,b,range) ((a)<(b)?((b)-(a)):((b)+(range)-(a)))
92 92
93#define NETXEN_RCV_PRODUCER_OFFSET 0 93#define NETXEN_RCV_PRODUCER_OFFSET 0
@@ -190,20 +190,9 @@
190 190
191#define NUM_RCV_DESC_RINGS 3 /* No of Rcv Descriptor contexts */ 191#define NUM_RCV_DESC_RINGS 3 /* No of Rcv Descriptor contexts */
192 192
193/* descriptor types */ 193#define RCV_RING_NORMAL 0
194#define RCV_DESC_NORMAL 0x01 194#define RCV_RING_JUMBO 1
195#define RCV_DESC_JUMBO 0x02 195#define RCV_RING_LRO 2
196#define RCV_DESC_LRO 0x04
197#define RCV_DESC_NORMAL_CTXID 0
198#define RCV_DESC_JUMBO_CTXID 1
199#define RCV_DESC_LRO_CTXID 2
200
201#define RCV_DESC_TYPE(ID) \
202 ((ID == RCV_DESC_JUMBO_CTXID) \
203 ? RCV_DESC_JUMBO \
204 : ((ID == RCV_DESC_LRO_CTXID) \
205 ? RCV_DESC_LRO : \
206 (RCV_DESC_NORMAL)))
207 196
208#define MAX_CMD_DESCRIPTORS 4096 197#define MAX_CMD_DESCRIPTORS 4096
209#define MAX_RCV_DESCRIPTORS 16384 198#define MAX_RCV_DESCRIPTORS 16384
@@ -815,8 +804,6 @@ struct netxen_hardware_context {
815 int pci_func; 804 int pci_func;
816}; 805};
817 806
818#define RCV_RING_LRO RCV_DESC_LRO
819
820#define MINIMUM_ETHERNET_FRAME_SIZE 64 /* With FCS */ 807#define MINIMUM_ETHERNET_FRAME_SIZE 64 /* With FCS */
821#define ETHERNET_FCS_SIZE 4 808#define ETHERNET_FCS_SIZE 4
822 809
@@ -842,16 +829,16 @@ struct netxen_adapter_stats {
842 * be one Rcv Descriptor for normal packets, one for jumbo and may be others. 829 * be one Rcv Descriptor for normal packets, one for jumbo and may be others.
843 */ 830 */
844struct nx_host_rds_ring { 831struct nx_host_rds_ring {
845 u32 flags;
846 u32 producer; 832 u32 producer;
847 dma_addr_t phys_addr;
848 u32 crb_rcv_producer; /* reg offset */ 833 u32 crb_rcv_producer; /* reg offset */
849 struct rcv_desc *desc_head; /* address of rx ring in Phantom */ 834 struct rcv_desc *desc_head; /* address of rx ring in Phantom */
850 u32 max_rx_desc_count;
851 u32 dma_size;
852 u32 skb_size;
853 struct netxen_rx_buffer *rx_buf_arr; /* rx buffers for receive */ 835 struct netxen_rx_buffer *rx_buf_arr; /* rx buffers for receive */
854 struct list_head free_list; 836 struct list_head free_list;
837 u32 num_desc;
838 u32 dma_size;
839 u32 skb_size;
840 u32 flags;
841 dma_addr_t phys_addr;
855}; 842};
856 843
857/* 844/*
@@ -1244,10 +1231,10 @@ struct netxen_adapter {
1244 u32 crb_addr_cmd_producer; 1231 u32 crb_addr_cmd_producer;
1245 u32 crb_addr_cmd_consumer; 1232 u32 crb_addr_cmd_consumer;
1246 1233
1247 u32 max_tx_desc_count; 1234 u32 num_txd;
1248 u32 max_rx_desc_count; 1235 u32 num_rxd;
1249 u32 max_jumbo_rx_desc_count; 1236 u32 num_jumbo_rxd;
1250 u32 max_lro_rx_desc_count; 1237 u32 num_lro_rxd;
1251 1238
1252 int max_rds_rings; 1239 int max_rds_rings;
1253 1240