aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netxen/netxen_nic.h
diff options
context:
space:
mode:
authorDhananjay Phadke <dhananjay@netxen.com>2009-01-14 23:48:11 -0500
committerDavid S. Miller <davem@davemloft.net>2009-01-14 23:48:11 -0500
commit391587c3447d99b842a647f8e701895c9eea050b (patch)
tree5acf2f1282d068195261216953a1b71f20fb1c9a /drivers/net/netxen/netxen_nic.h
parent2edbb454428729f450f7a0aabbf95ac62b46b78a (diff)
netxen: fix ipv6 offload and tx cleanup
o fix the ip/tcp hdr offset in tx descriptors for ipv6. o cleanup xmit function, move the tso checks into separate function, this reduces unnecessary endian conversions back and forth. o optimize macros to initialize tx descriptors. 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.h43
1 files changed, 12 insertions, 31 deletions
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h
index 31311cc66d18..acb2ac971ca3 100644
--- a/drivers/net/netxen/netxen_nic.h
+++ b/drivers/net/netxen/netxen_nic.h
@@ -308,27 +308,16 @@ struct netxen_ring_ctx {
308#define netxen_set_cmd_desc_ctxid(cmd_desc, var) \ 308#define netxen_set_cmd_desc_ctxid(cmd_desc, var) \
309 ((cmd_desc)->port_ctxid |= ((var) << 4 & 0xF0)) 309 ((cmd_desc)->port_ctxid |= ((var) << 4 & 0xF0))
310 310
311#define netxen_set_cmd_desc_flags(cmd_desc, val) \ 311#define netxen_set_tx_port(_desc, _port) \
312 (cmd_desc)->flags_opcode = ((cmd_desc)->flags_opcode & \ 312 (_desc)->port_ctxid = ((_port) & 0xf) | (((_port) << 4) & 0xf0)
313 ~cpu_to_le16(0x7f)) | cpu_to_le16((val) & 0x7f) 313
314#define netxen_set_cmd_desc_opcode(cmd_desc, val) \ 314#define netxen_set_tx_flags_opcode(_desc, _flags, _opcode) \
315 (cmd_desc)->flags_opcode = ((cmd_desc)->flags_opcode & \ 315 (_desc)->flags_opcode = \
316 ~cpu_to_le16((u16)0x3f << 7)) | cpu_to_le16(((val) & 0x3f) << 7) 316 cpu_to_le16(((_flags) & 0x7f) | (((_opcode) & 0x3f) << 7))
317 317
318#define netxen_set_cmd_desc_num_of_buff(cmd_desc, val) \ 318#define netxen_set_tx_frags_len(_desc, _frags, _len) \
319 (cmd_desc)->num_of_buffers_total_length = \ 319 (_desc)->num_of_buffers_total_length = \
320 ((cmd_desc)->num_of_buffers_total_length & \ 320 cpu_to_le32(((_frags) & 0xff) | (((_len) & 0xffffff) << 8))
321 ~cpu_to_le32(0xff)) | cpu_to_le32((val) & 0xff)
322#define netxen_set_cmd_desc_totallength(cmd_desc, val) \
323 (cmd_desc)->num_of_buffers_total_length = \
324 ((cmd_desc)->num_of_buffers_total_length & \
325 ~cpu_to_le32((u32)0xffffff << 8)) | \
326 cpu_to_le32(((val) & 0xffffff) << 8)
327
328#define netxen_get_cmd_desc_opcode(cmd_desc) \
329 ((le16_to_cpu((cmd_desc)->flags_opcode) >> 7) & 0x003f)
330#define netxen_get_cmd_desc_totallength(cmd_desc) \
331 ((le32_to_cpu((cmd_desc)->num_of_buffers_total_length) >> 8) & 0xffffff)
332 321
333struct cmd_desc_type0 { 322struct cmd_desc_type0 {
334 u8 tcp_hdr_offset; /* For LSO only */ 323 u8 tcp_hdr_offset; /* For LSO only */
@@ -757,7 +746,7 @@ extern char netxen_nic_driver_name[];
757 */ 746 */
758struct netxen_skb_frag { 747struct netxen_skb_frag {
759 u64 dma; 748 u64 dma;
760 u32 length; 749 ulong length;
761}; 750};
762 751
763#define _netxen_set_bits(config_word, start, bits, val) {\ 752#define _netxen_set_bits(config_word, start, bits, val) {\
@@ -783,13 +772,7 @@ struct netxen_skb_frag {
783struct netxen_cmd_buffer { 772struct netxen_cmd_buffer {
784 struct sk_buff *skb; 773 struct sk_buff *skb;
785 struct netxen_skb_frag frag_array[MAX_BUFFERS_PER_CMD + 1]; 774 struct netxen_skb_frag frag_array[MAX_BUFFERS_PER_CMD + 1];
786 u32 total_length; 775 u32 frag_count;
787 u32 mss;
788 u16 port;
789 u8 cmd;
790 u8 frag_count;
791 unsigned long time_stamp;
792 u32 state;
793}; 776};
794 777
795/* In rx_buffer, we do not need multiple fragments as is a single buffer */ 778/* In rx_buffer, we do not need multiple fragments as is a single buffer */
@@ -1486,8 +1469,6 @@ void netxen_release_tx_buffers(struct netxen_adapter *adapter);
1486 1469
1487void netxen_initialize_adapter_ops(struct netxen_adapter *adapter); 1470void netxen_initialize_adapter_ops(struct netxen_adapter *adapter);
1488int netxen_init_firmware(struct netxen_adapter *adapter); 1471int netxen_init_firmware(struct netxen_adapter *adapter);
1489void netxen_tso_check(struct netxen_adapter *adapter,
1490 struct cmd_desc_type0 *desc, struct sk_buff *skb);
1491void netxen_nic_clear_stats(struct netxen_adapter *adapter); 1472void netxen_nic_clear_stats(struct netxen_adapter *adapter);
1492void netxen_watchdog_task(struct work_struct *work); 1473void netxen_watchdog_task(struct work_struct *work);
1493void netxen_post_rx_buffers(struct netxen_adapter *adapter, u32 ctx, 1474void netxen_post_rx_buffers(struct netxen_adapter *adapter, u32 ctx,