diff options
Diffstat (limited to 'drivers/net/s2io.h')
-rw-r--r-- | drivers/net/s2io.h | 55 |
1 files changed, 45 insertions, 10 deletions
diff --git a/drivers/net/s2io.h b/drivers/net/s2io.h index 852a6a899d07..0a0b5b29d81e 100644 --- a/drivers/net/s2io.h +++ b/drivers/net/s2io.h | |||
@@ -64,7 +64,7 @@ typedef enum xena_max_outstanding_splits { | |||
64 | #define INTR_DBG 4 | 64 | #define INTR_DBG 4 |
65 | 65 | ||
66 | /* Global variable that defines the present debug level of the driver. */ | 66 | /* Global variable that defines the present debug level of the driver. */ |
67 | int debug_level = ERR_DBG; /* Default level. */ | 67 | static int debug_level = ERR_DBG; |
68 | 68 | ||
69 | /* DEBUG message print. */ | 69 | /* DEBUG message print. */ |
70 | #define DBG_PRINT(dbg_level, args...) if(!(debug_level<dbg_level)) printk(args) | 70 | #define DBG_PRINT(dbg_level, args...) if(!(debug_level<dbg_level)) printk(args) |
@@ -78,6 +78,13 @@ int debug_level = ERR_DBG; /* Default level. */ | |||
78 | typedef struct { | 78 | typedef struct { |
79 | unsigned long long single_ecc_errs; | 79 | unsigned long long single_ecc_errs; |
80 | unsigned long long double_ecc_errs; | 80 | unsigned long long double_ecc_errs; |
81 | /* LRO statistics */ | ||
82 | unsigned long long clubbed_frms_cnt; | ||
83 | unsigned long long sending_both; | ||
84 | unsigned long long outof_sequence_pkts; | ||
85 | unsigned long long flush_max_pkts; | ||
86 | unsigned long long sum_avg_pkts_aggregated; | ||
87 | unsigned long long num_aggregations; | ||
81 | } swStat_t; | 88 | } swStat_t; |
82 | 89 | ||
83 | /* The statistics block of Xena */ | 90 | /* The statistics block of Xena */ |
@@ -268,7 +275,7 @@ typedef struct stat_block { | |||
268 | #define MAX_RX_RINGS 8 | 275 | #define MAX_RX_RINGS 8 |
269 | 276 | ||
270 | /* FIFO mappings for all possible number of fifos configured */ | 277 | /* FIFO mappings for all possible number of fifos configured */ |
271 | int fifo_map[][MAX_TX_FIFOS] = { | 278 | static int fifo_map[][MAX_TX_FIFOS] = { |
272 | {0, 0, 0, 0, 0, 0, 0, 0}, | 279 | {0, 0, 0, 0, 0, 0, 0, 0}, |
273 | {0, 0, 0, 0, 1, 1, 1, 1}, | 280 | {0, 0, 0, 0, 1, 1, 1, 1}, |
274 | {0, 0, 0, 1, 1, 1, 2, 2}, | 281 | {0, 0, 0, 1, 1, 1, 2, 2}, |
@@ -680,6 +687,24 @@ struct msix_info_st { | |||
680 | u64 data; | 687 | u64 data; |
681 | }; | 688 | }; |
682 | 689 | ||
690 | /* Data structure to represent a LRO session */ | ||
691 | typedef struct lro { | ||
692 | struct sk_buff *parent; | ||
693 | u8 *l2h; | ||
694 | struct iphdr *iph; | ||
695 | struct tcphdr *tcph; | ||
696 | u32 tcp_next_seq; | ||
697 | u32 tcp_ack; | ||
698 | int total_len; | ||
699 | int frags_len; | ||
700 | int sg_num; | ||
701 | int in_use; | ||
702 | u16 window; | ||
703 | u32 cur_tsval; | ||
704 | u32 cur_tsecr; | ||
705 | u8 saw_ts; | ||
706 | }lro_t; | ||
707 | |||
683 | /* Structure representing one instance of the NIC */ | 708 | /* Structure representing one instance of the NIC */ |
684 | struct s2io_nic { | 709 | struct s2io_nic { |
685 | int rxd_mode; | 710 | int rxd_mode; |
@@ -784,6 +809,13 @@ struct s2io_nic { | |||
784 | #define XFRAME_II_DEVICE 2 | 809 | #define XFRAME_II_DEVICE 2 |
785 | u8 device_type; | 810 | u8 device_type; |
786 | 811 | ||
812 | #define MAX_LRO_SESSIONS 32 | ||
813 | lro_t lro0_n[MAX_LRO_SESSIONS]; | ||
814 | unsigned long clubbed_frms_cnt; | ||
815 | unsigned long sending_both; | ||
816 | u8 lro; | ||
817 | u16 lro_max_aggr_per_sess; | ||
818 | |||
787 | #define INTA 0 | 819 | #define INTA 0 |
788 | #define MSI 1 | 820 | #define MSI 1 |
789 | #define MSI_X 2 | 821 | #define MSI_X 2 |
@@ -911,18 +943,16 @@ static void tx_intr_handler(fifo_info_t *fifo_data); | |||
911 | static void alarm_intr_handler(struct s2io_nic *sp); | 943 | static void alarm_intr_handler(struct s2io_nic *sp); |
912 | 944 | ||
913 | static int s2io_starter(void); | 945 | static int s2io_starter(void); |
914 | void s2io_closer(void); | ||
915 | static void s2io_tx_watchdog(struct net_device *dev); | 946 | static void s2io_tx_watchdog(struct net_device *dev); |
916 | static void s2io_tasklet(unsigned long dev_addr); | 947 | static void s2io_tasklet(unsigned long dev_addr); |
917 | static void s2io_set_multicast(struct net_device *dev); | 948 | static void s2io_set_multicast(struct net_device *dev); |
918 | static int rx_osm_handler(ring_info_t *ring_data, RxD_t * rxdp); | 949 | static int rx_osm_handler(ring_info_t *ring_data, RxD_t * rxdp); |
919 | void s2io_link(nic_t * sp, int link); | 950 | static void s2io_link(nic_t * sp, int link); |
920 | void s2io_reset(nic_t * sp); | ||
921 | #if defined(CONFIG_S2IO_NAPI) | 951 | #if defined(CONFIG_S2IO_NAPI) |
922 | static int s2io_poll(struct net_device *dev, int *budget); | 952 | static int s2io_poll(struct net_device *dev, int *budget); |
923 | #endif | 953 | #endif |
924 | static void s2io_init_pci(nic_t * sp); | 954 | static void s2io_init_pci(nic_t * sp); |
925 | int s2io_set_mac_addr(struct net_device *dev, u8 * addr); | 955 | static int s2io_set_mac_addr(struct net_device *dev, u8 * addr); |
926 | static void s2io_alarm_handle(unsigned long data); | 956 | static void s2io_alarm_handle(unsigned long data); |
927 | static int s2io_enable_msi(nic_t *nic); | 957 | static int s2io_enable_msi(nic_t *nic); |
928 | static irqreturn_t s2io_msi_handle(int irq, void *dev_id, struct pt_regs *regs); | 958 | static irqreturn_t s2io_msi_handle(int irq, void *dev_id, struct pt_regs *regs); |
@@ -930,14 +960,19 @@ static irqreturn_t | |||
930 | s2io_msix_ring_handle(int irq, void *dev_id, struct pt_regs *regs); | 960 | s2io_msix_ring_handle(int irq, void *dev_id, struct pt_regs *regs); |
931 | static irqreturn_t | 961 | static irqreturn_t |
932 | s2io_msix_fifo_handle(int irq, void *dev_id, struct pt_regs *regs); | 962 | s2io_msix_fifo_handle(int irq, void *dev_id, struct pt_regs *regs); |
933 | int s2io_enable_msi_x(nic_t *nic); | ||
934 | static irqreturn_t s2io_isr(int irq, void *dev_id, struct pt_regs *regs); | 963 | static irqreturn_t s2io_isr(int irq, void *dev_id, struct pt_regs *regs); |
935 | static int verify_xena_quiescence(nic_t *sp, u64 val64, int flag); | 964 | static int verify_xena_quiescence(nic_t *sp, u64 val64, int flag); |
936 | static struct ethtool_ops netdev_ethtool_ops; | 965 | static struct ethtool_ops netdev_ethtool_ops; |
937 | static void s2io_set_link(unsigned long data); | 966 | static void s2io_set_link(unsigned long data); |
938 | int s2io_set_swapper(nic_t * sp); | 967 | static int s2io_set_swapper(nic_t * sp); |
939 | static void s2io_card_down(nic_t *nic); | 968 | static void s2io_card_down(nic_t *nic); |
940 | static int s2io_card_up(nic_t *nic); | 969 | static int s2io_card_up(nic_t *nic); |
941 | int get_xena_rev_id(struct pci_dev *pdev); | 970 | static int get_xena_rev_id(struct pci_dev *pdev); |
942 | void restore_xmsi_data(nic_t *nic); | 971 | static void restore_xmsi_data(nic_t *nic); |
972 | |||
973 | static int s2io_club_tcp_session(u8 *buffer, u8 **tcp, u32 *tcp_len, lro_t **lro, RxD_t *rxdp, nic_t *sp); | ||
974 | static void clear_lro_session(lro_t *lro); | ||
975 | static void queue_rx_frame(struct sk_buff *skb); | ||
976 | static void update_L3L4_header(nic_t *sp, lro_t *lro); | ||
977 | static void lro_append_pkt(nic_t *sp, lro_t *lro, struct sk_buff *skb, u32 tcp_len); | ||
943 | #endif /* _S2IO_H */ | 978 | #endif /* _S2IO_H */ |