diff options
Diffstat (limited to 'drivers/net/netxen/netxen_nic.h')
-rw-r--r-- | drivers/net/netxen/netxen_nic.h | 146 |
1 files changed, 64 insertions, 82 deletions
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h index f8e601c51da..c11c568fd7d 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 | ||
333 | struct cmd_desc_type0 { | 322 | struct cmd_desc_type0 { |
334 | u8 tcp_hdr_offset; /* For LSO only */ | 323 | u8 tcp_hdr_offset; /* For LSO only */ |
@@ -510,7 +499,8 @@ typedef enum { | |||
510 | NETXEN_BRDTYPE_P3_10G_SFP_CT = 0x002a, | 499 | NETXEN_BRDTYPE_P3_10G_SFP_CT = 0x002a, |
511 | NETXEN_BRDTYPE_P3_10G_SFP_QT = 0x002b, | 500 | NETXEN_BRDTYPE_P3_10G_SFP_QT = 0x002b, |
512 | NETXEN_BRDTYPE_P3_10G_CX4 = 0x0031, | 501 | NETXEN_BRDTYPE_P3_10G_CX4 = 0x0031, |
513 | NETXEN_BRDTYPE_P3_10G_XFP = 0x0032 | 502 | NETXEN_BRDTYPE_P3_10G_XFP = 0x0032, |
503 | NETXEN_BRDTYPE_P3_10G_TP = 0x0080 | ||
514 | 504 | ||
515 | } netxen_brdtype_t; | 505 | } netxen_brdtype_t; |
516 | 506 | ||
@@ -757,7 +747,7 @@ extern char netxen_nic_driver_name[]; | |||
757 | */ | 747 | */ |
758 | struct netxen_skb_frag { | 748 | struct netxen_skb_frag { |
759 | u64 dma; | 749 | u64 dma; |
760 | u32 length; | 750 | ulong length; |
761 | }; | 751 | }; |
762 | 752 | ||
763 | #define _netxen_set_bits(config_word, start, bits, val) {\ | 753 | #define _netxen_set_bits(config_word, start, bits, val) {\ |
@@ -783,13 +773,7 @@ struct netxen_skb_frag { | |||
783 | struct netxen_cmd_buffer { | 773 | struct netxen_cmd_buffer { |
784 | struct sk_buff *skb; | 774 | struct sk_buff *skb; |
785 | struct netxen_skb_frag frag_array[MAX_BUFFERS_PER_CMD + 1]; | 775 | struct netxen_skb_frag frag_array[MAX_BUFFERS_PER_CMD + 1]; |
786 | u32 total_length; | 776 | 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 | }; | 777 | }; |
794 | 778 | ||
795 | /* In rx_buffer, we do not need multiple fragments as is a single buffer */ | 779 | /* In rx_buffer, we do not need multiple fragments as is a single buffer */ |
@@ -876,7 +860,6 @@ struct nx_host_rds_ring { | |||
876 | u32 skb_size; | 860 | u32 skb_size; |
877 | struct netxen_rx_buffer *rx_buf_arr; /* rx buffers for receive */ | 861 | struct netxen_rx_buffer *rx_buf_arr; /* rx buffers for receive */ |
878 | struct list_head free_list; | 862 | struct list_head free_list; |
879 | int begin_alloc; | ||
880 | }; | 863 | }; |
881 | 864 | ||
882 | /* | 865 | /* |
@@ -995,31 +978,31 @@ struct netxen_recv_context { | |||
995 | */ | 978 | */ |
996 | 979 | ||
997 | typedef struct { | 980 | typedef struct { |
998 | u64 host_phys_addr; /* Ring base addr */ | 981 | __le64 host_phys_addr; /* Ring base addr */ |
999 | u32 ring_size; /* Ring entries */ | 982 | __le32 ring_size; /* Ring entries */ |
1000 | u16 msi_index; | 983 | __le16 msi_index; |
1001 | u16 rsvd; /* Padding */ | 984 | __le16 rsvd; /* Padding */ |
1002 | } nx_hostrq_sds_ring_t; | 985 | } nx_hostrq_sds_ring_t; |
1003 | 986 | ||
1004 | typedef struct { | 987 | typedef struct { |
1005 | u64 host_phys_addr; /* Ring base addr */ | 988 | __le64 host_phys_addr; /* Ring base addr */ |
1006 | u64 buff_size; /* Packet buffer size */ | 989 | __le64 buff_size; /* Packet buffer size */ |
1007 | u32 ring_size; /* Ring entries */ | 990 | __le32 ring_size; /* Ring entries */ |
1008 | u32 ring_kind; /* Class of ring */ | 991 | __le32 ring_kind; /* Class of ring */ |
1009 | } nx_hostrq_rds_ring_t; | 992 | } nx_hostrq_rds_ring_t; |
1010 | 993 | ||
1011 | typedef struct { | 994 | typedef struct { |
1012 | u64 host_rsp_dma_addr; /* Response dma'd here */ | 995 | __le64 host_rsp_dma_addr; /* Response dma'd here */ |
1013 | u32 capabilities[4]; /* Flag bit vector */ | 996 | __le32 capabilities[4]; /* Flag bit vector */ |
1014 | u32 host_int_crb_mode; /* Interrupt crb usage */ | 997 | __le32 host_int_crb_mode; /* Interrupt crb usage */ |
1015 | u32 host_rds_crb_mode; /* RDS crb usage */ | 998 | __le32 host_rds_crb_mode; /* RDS crb usage */ |
1016 | /* These ring offsets are relative to data[0] below */ | 999 | /* These ring offsets are relative to data[0] below */ |
1017 | u32 rds_ring_offset; /* Offset to RDS config */ | 1000 | __le32 rds_ring_offset; /* Offset to RDS config */ |
1018 | u32 sds_ring_offset; /* Offset to SDS config */ | 1001 | __le32 sds_ring_offset; /* Offset to SDS config */ |
1019 | u16 num_rds_rings; /* Count of RDS rings */ | 1002 | __le16 num_rds_rings; /* Count of RDS rings */ |
1020 | u16 num_sds_rings; /* Count of SDS rings */ | 1003 | __le16 num_sds_rings; /* Count of SDS rings */ |
1021 | u16 rsvd1; /* Padding */ | 1004 | __le16 rsvd1; /* Padding */ |
1022 | u16 rsvd2; /* Padding */ | 1005 | __le16 rsvd2; /* Padding */ |
1023 | u8 reserved[128]; /* reserve space for future expansion*/ | 1006 | u8 reserved[128]; /* reserve space for future expansion*/ |
1024 | /* MUST BE 64-bit aligned. | 1007 | /* MUST BE 64-bit aligned. |
1025 | The following is packed: | 1008 | The following is packed: |
@@ -1029,24 +1012,24 @@ typedef struct { | |||
1029 | } nx_hostrq_rx_ctx_t; | 1012 | } nx_hostrq_rx_ctx_t; |
1030 | 1013 | ||
1031 | typedef struct { | 1014 | typedef struct { |
1032 | u32 host_producer_crb; /* Crb to use */ | 1015 | __le32 host_producer_crb; /* Crb to use */ |
1033 | u32 rsvd1; /* Padding */ | 1016 | __le32 rsvd1; /* Padding */ |
1034 | } nx_cardrsp_rds_ring_t; | 1017 | } nx_cardrsp_rds_ring_t; |
1035 | 1018 | ||
1036 | typedef struct { | 1019 | typedef struct { |
1037 | u32 host_consumer_crb; /* Crb to use */ | 1020 | __le32 host_consumer_crb; /* Crb to use */ |
1038 | u32 interrupt_crb; /* Crb to use */ | 1021 | __le32 interrupt_crb; /* Crb to use */ |
1039 | } nx_cardrsp_sds_ring_t; | 1022 | } nx_cardrsp_sds_ring_t; |
1040 | 1023 | ||
1041 | typedef struct { | 1024 | typedef struct { |
1042 | /* These ring offsets are relative to data[0] below */ | 1025 | /* These ring offsets are relative to data[0] below */ |
1043 | u32 rds_ring_offset; /* Offset to RDS config */ | 1026 | __le32 rds_ring_offset; /* Offset to RDS config */ |
1044 | u32 sds_ring_offset; /* Offset to SDS config */ | 1027 | __le32 sds_ring_offset; /* Offset to SDS config */ |
1045 | u32 host_ctx_state; /* Starting State */ | 1028 | __le32 host_ctx_state; /* Starting State */ |
1046 | u32 num_fn_per_port; /* How many PCI fn share the port */ | 1029 | __le32 num_fn_per_port; /* How many PCI fn share the port */ |
1047 | u16 num_rds_rings; /* Count of RDS rings */ | 1030 | __le16 num_rds_rings; /* Count of RDS rings */ |
1048 | u16 num_sds_rings; /* Count of SDS rings */ | 1031 | __le16 num_sds_rings; /* Count of SDS rings */ |
1049 | u16 context_id; /* Handle for context */ | 1032 | __le16 context_id; /* Handle for context */ |
1050 | u8 phys_port; /* Physical id of port */ | 1033 | u8 phys_port; /* Physical id of port */ |
1051 | u8 virt_port; /* Virtual/Logical id of port */ | 1034 | u8 virt_port; /* Virtual/Logical id of port */ |
1052 | u8 reserved[128]; /* save space for future expansion */ | 1035 | u8 reserved[128]; /* save space for future expansion */ |
@@ -1072,34 +1055,34 @@ typedef struct { | |||
1072 | */ | 1055 | */ |
1073 | 1056 | ||
1074 | typedef struct { | 1057 | typedef struct { |
1075 | u64 host_phys_addr; /* Ring base addr */ | 1058 | __le64 host_phys_addr; /* Ring base addr */ |
1076 | u32 ring_size; /* Ring entries */ | 1059 | __le32 ring_size; /* Ring entries */ |
1077 | u32 rsvd; /* Padding */ | 1060 | __le32 rsvd; /* Padding */ |
1078 | } nx_hostrq_cds_ring_t; | 1061 | } nx_hostrq_cds_ring_t; |
1079 | 1062 | ||
1080 | typedef struct { | 1063 | typedef struct { |
1081 | u64 host_rsp_dma_addr; /* Response dma'd here */ | 1064 | __le64 host_rsp_dma_addr; /* Response dma'd here */ |
1082 | u64 cmd_cons_dma_addr; /* */ | 1065 | __le64 cmd_cons_dma_addr; /* */ |
1083 | u64 dummy_dma_addr; /* */ | 1066 | __le64 dummy_dma_addr; /* */ |
1084 | u32 capabilities[4]; /* Flag bit vector */ | 1067 | __le32 capabilities[4]; /* Flag bit vector */ |
1085 | u32 host_int_crb_mode; /* Interrupt crb usage */ | 1068 | __le32 host_int_crb_mode; /* Interrupt crb usage */ |
1086 | u32 rsvd1; /* Padding */ | 1069 | __le32 rsvd1; /* Padding */ |
1087 | u16 rsvd2; /* Padding */ | 1070 | __le16 rsvd2; /* Padding */ |
1088 | u16 interrupt_ctl; | 1071 | __le16 interrupt_ctl; |
1089 | u16 msi_index; | 1072 | __le16 msi_index; |
1090 | u16 rsvd3; /* Padding */ | 1073 | __le16 rsvd3; /* Padding */ |
1091 | nx_hostrq_cds_ring_t cds_ring; /* Desc of cds ring */ | 1074 | nx_hostrq_cds_ring_t cds_ring; /* Desc of cds ring */ |
1092 | u8 reserved[128]; /* future expansion */ | 1075 | u8 reserved[128]; /* future expansion */ |
1093 | } nx_hostrq_tx_ctx_t; | 1076 | } nx_hostrq_tx_ctx_t; |
1094 | 1077 | ||
1095 | typedef struct { | 1078 | typedef struct { |
1096 | u32 host_producer_crb; /* Crb to use */ | 1079 | __le32 host_producer_crb; /* Crb to use */ |
1097 | u32 interrupt_crb; /* Crb to use */ | 1080 | __le32 interrupt_crb; /* Crb to use */ |
1098 | } nx_cardrsp_cds_ring_t; | 1081 | } nx_cardrsp_cds_ring_t; |
1099 | 1082 | ||
1100 | typedef struct { | 1083 | typedef struct { |
1101 | u32 host_ctx_state; /* Starting state */ | 1084 | __le32 host_ctx_state; /* Starting state */ |
1102 | u16 context_id; /* Handle for context */ | 1085 | __le16 context_id; /* Handle for context */ |
1103 | u8 phys_port; /* Physical id of port */ | 1086 | u8 phys_port; /* Physical id of port */ |
1104 | u8 virt_port; /* Virtual/Logical id of port */ | 1087 | u8 virt_port; /* Virtual/Logical id of port */ |
1105 | nx_cardrsp_cds_ring_t cds_ring; /* Card cds settings */ | 1088 | nx_cardrsp_cds_ring_t cds_ring; /* Card cds settings */ |
@@ -1202,9 +1185,9 @@ enum { | |||
1202 | #define VPORT_MISS_MODE_ACCEPT_MULTI 2 /* accept unmatched multicast */ | 1185 | #define VPORT_MISS_MODE_ACCEPT_MULTI 2 /* accept unmatched multicast */ |
1203 | 1186 | ||
1204 | typedef struct { | 1187 | typedef struct { |
1205 | u64 qhdr; | 1188 | __le64 qhdr; |
1206 | u64 req_hdr; | 1189 | __le64 req_hdr; |
1207 | u64 words[6]; | 1190 | __le64 words[6]; |
1208 | } nx_nic_req_t; | 1191 | } nx_nic_req_t; |
1209 | 1192 | ||
1210 | typedef struct { | 1193 | typedef struct { |
@@ -1486,8 +1469,6 @@ void netxen_release_tx_buffers(struct netxen_adapter *adapter); | |||
1486 | 1469 | ||
1487 | void netxen_initialize_adapter_ops(struct netxen_adapter *adapter); | 1470 | void netxen_initialize_adapter_ops(struct netxen_adapter *adapter); |
1488 | int netxen_init_firmware(struct netxen_adapter *adapter); | 1471 | int netxen_init_firmware(struct netxen_adapter *adapter); |
1489 | void netxen_tso_check(struct netxen_adapter *adapter, | ||
1490 | struct cmd_desc_type0 *desc, struct sk_buff *skb); | ||
1491 | void netxen_nic_clear_stats(struct netxen_adapter *adapter); | 1472 | void netxen_nic_clear_stats(struct netxen_adapter *adapter); |
1492 | void netxen_watchdog_task(struct work_struct *work); | 1473 | void netxen_watchdog_task(struct work_struct *work); |
1493 | void netxen_post_rx_buffers(struct netxen_adapter *adapter, u32 ctx, | 1474 | void netxen_post_rx_buffers(struct netxen_adapter *adapter, u32 ctx, |
@@ -1496,6 +1477,7 @@ int netxen_process_cmd_ring(struct netxen_adapter *adapter); | |||
1496 | u32 netxen_process_rcv_ring(struct netxen_adapter *adapter, int ctx, int max); | 1477 | u32 netxen_process_rcv_ring(struct netxen_adapter *adapter, int ctx, int max); |
1497 | void netxen_p2_nic_set_multi(struct net_device *netdev); | 1478 | void netxen_p2_nic_set_multi(struct net_device *netdev); |
1498 | void netxen_p3_nic_set_multi(struct net_device *netdev); | 1479 | void netxen_p3_nic_set_multi(struct net_device *netdev); |
1480 | void netxen_p3_free_mac_list(struct netxen_adapter *adapter); | ||
1499 | int netxen_p3_nic_set_promisc(struct netxen_adapter *adapter, u32); | 1481 | int netxen_p3_nic_set_promisc(struct netxen_adapter *adapter, u32); |
1500 | int netxen_config_intr_coalesce(struct netxen_adapter *adapter); | 1482 | int netxen_config_intr_coalesce(struct netxen_adapter *adapter); |
1501 | 1483 | ||