diff options
author | Jiri Kosina <jkosina@suse.cz> | 2008-05-06 10:57:55 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2008-05-06 10:57:55 -0400 |
commit | 7022b15e2a9f878fd5184586064c63352c3dd225 (patch) | |
tree | 5365c2f5bc82ae1946636ee8d5cd5d3b7e804f1b /drivers/net/s2io.h | |
parent | aaad2b0c757f3e6e02552cb0bdcd91a5ec0d6305 (diff) | |
parent | a15306365a16380f3bafee9e181ba01231d4acd7 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'drivers/net/s2io.h')
-rw-r--r-- | drivers/net/s2io.h | 91 |
1 files changed, 53 insertions, 38 deletions
diff --git a/drivers/net/s2io.h b/drivers/net/s2io.h index e68fdf7e4260..0709ebae9139 100644 --- a/drivers/net/s2io.h +++ b/drivers/net/s2io.h | |||
@@ -678,11 +678,53 @@ struct rx_block_info { | |||
678 | struct rxd_info *rxds; | 678 | struct rxd_info *rxds; |
679 | }; | 679 | }; |
680 | 680 | ||
681 | /* Data structure to represent a LRO session */ | ||
682 | struct lro { | ||
683 | struct sk_buff *parent; | ||
684 | struct sk_buff *last_frag; | ||
685 | u8 *l2h; | ||
686 | struct iphdr *iph; | ||
687 | struct tcphdr *tcph; | ||
688 | u32 tcp_next_seq; | ||
689 | __be32 tcp_ack; | ||
690 | int total_len; | ||
691 | int frags_len; | ||
692 | int sg_num; | ||
693 | int in_use; | ||
694 | __be16 window; | ||
695 | u16 vlan_tag; | ||
696 | u32 cur_tsval; | ||
697 | __be32 cur_tsecr; | ||
698 | u8 saw_ts; | ||
699 | } ____cacheline_aligned; | ||
700 | |||
681 | /* Ring specific structure */ | 701 | /* Ring specific structure */ |
682 | struct ring_info { | 702 | struct ring_info { |
683 | /* The ring number */ | 703 | /* The ring number */ |
684 | int ring_no; | 704 | int ring_no; |
685 | 705 | ||
706 | /* per-ring buffer counter */ | ||
707 | u32 rx_bufs_left; | ||
708 | |||
709 | #define MAX_LRO_SESSIONS 32 | ||
710 | struct lro lro0_n[MAX_LRO_SESSIONS]; | ||
711 | u8 lro; | ||
712 | |||
713 | /* copy of sp->rxd_mode flag */ | ||
714 | int rxd_mode; | ||
715 | |||
716 | /* Number of rxds per block for the rxd_mode */ | ||
717 | int rxd_count; | ||
718 | |||
719 | /* copy of sp pointer */ | ||
720 | struct s2io_nic *nic; | ||
721 | |||
722 | /* copy of sp->dev pointer */ | ||
723 | struct net_device *dev; | ||
724 | |||
725 | /* copy of sp->pdev pointer */ | ||
726 | struct pci_dev *pdev; | ||
727 | |||
686 | /* | 728 | /* |
687 | * Place holders for the virtual and physical addresses of | 729 | * Place holders for the virtual and physical addresses of |
688 | * all the Rx Blocks | 730 | * all the Rx Blocks |
@@ -703,13 +745,16 @@ struct ring_info { | |||
703 | */ | 745 | */ |
704 | struct rx_curr_get_info rx_curr_get_info; | 746 | struct rx_curr_get_info rx_curr_get_info; |
705 | 747 | ||
706 | /* Index to the absolute position of the put pointer of Rx ring */ | 748 | /* interface MTU value */ |
707 | int put_pos; | 749 | unsigned mtu; |
708 | 750 | ||
709 | /* Buffer Address store. */ | 751 | /* Buffer Address store. */ |
710 | struct buffAdd **ba; | 752 | struct buffAdd **ba; |
711 | struct s2io_nic *nic; | 753 | |
712 | }; | 754 | /* per-Ring statistics */ |
755 | unsigned long rx_packets; | ||
756 | unsigned long rx_bytes; | ||
757 | } ____cacheline_aligned; | ||
713 | 758 | ||
714 | /* Fifo specific structure */ | 759 | /* Fifo specific structure */ |
715 | struct fifo_info { | 760 | struct fifo_info { |
@@ -816,26 +861,6 @@ struct msix_info_st { | |||
816 | u64 data; | 861 | u64 data; |
817 | }; | 862 | }; |
818 | 863 | ||
819 | /* Data structure to represent a LRO session */ | ||
820 | struct lro { | ||
821 | struct sk_buff *parent; | ||
822 | struct sk_buff *last_frag; | ||
823 | u8 *l2h; | ||
824 | struct iphdr *iph; | ||
825 | struct tcphdr *tcph; | ||
826 | u32 tcp_next_seq; | ||
827 | __be32 tcp_ack; | ||
828 | int total_len; | ||
829 | int frags_len; | ||
830 | int sg_num; | ||
831 | int in_use; | ||
832 | __be16 window; | ||
833 | u16 vlan_tag; | ||
834 | u32 cur_tsval; | ||
835 | __be32 cur_tsecr; | ||
836 | u8 saw_ts; | ||
837 | } ____cacheline_aligned; | ||
838 | |||
839 | /* These flags represent the devices temporary state */ | 864 | /* These flags represent the devices temporary state */ |
840 | enum s2io_device_state_t | 865 | enum s2io_device_state_t |
841 | { | 866 | { |
@@ -868,8 +893,6 @@ struct s2io_nic { | |||
868 | int device_enabled_once; | 893 | int device_enabled_once; |
869 | 894 | ||
870 | char name[60]; | 895 | char name[60]; |
871 | struct tasklet_struct task; | ||
872 | volatile unsigned long tasklet_status; | ||
873 | 896 | ||
874 | /* Timer that handles I/O errors/exceptions */ | 897 | /* Timer that handles I/O errors/exceptions */ |
875 | struct timer_list alarm_timer; | 898 | struct timer_list alarm_timer; |
@@ -877,10 +900,6 @@ struct s2io_nic { | |||
877 | /* Space to back up the PCI config space */ | 900 | /* Space to back up the PCI config space */ |
878 | u32 config_space[256 / sizeof(u32)]; | 901 | u32 config_space[256 / sizeof(u32)]; |
879 | 902 | ||
880 | atomic_t rx_bufs_left[MAX_RX_RINGS]; | ||
881 | |||
882 | spinlock_t put_lock; | ||
883 | |||
884 | #define PROMISC 1 | 903 | #define PROMISC 1 |
885 | #define ALL_MULTI 2 | 904 | #define ALL_MULTI 2 |
886 | 905 | ||
@@ -957,14 +976,11 @@ struct s2io_nic { | |||
957 | #define XFRAME_II_DEVICE 2 | 976 | #define XFRAME_II_DEVICE 2 |
958 | u8 device_type; | 977 | u8 device_type; |
959 | 978 | ||
960 | #define MAX_LRO_SESSIONS 32 | ||
961 | struct lro lro0_n[MAX_LRO_SESSIONS]; | ||
962 | unsigned long clubbed_frms_cnt; | 979 | unsigned long clubbed_frms_cnt; |
963 | unsigned long sending_both; | 980 | unsigned long sending_both; |
964 | u8 lro; | 981 | u8 lro; |
965 | u16 lro_max_aggr_per_sess; | 982 | u16 lro_max_aggr_per_sess; |
966 | volatile unsigned long state; | 983 | volatile unsigned long state; |
967 | spinlock_t rx_lock; | ||
968 | u64 general_int_mask; | 984 | u64 general_int_mask; |
969 | #define VPD_STRING_LEN 80 | 985 | #define VPD_STRING_LEN 80 |
970 | u8 product_name[VPD_STRING_LEN]; | 986 | u8 product_name[VPD_STRING_LEN]; |
@@ -1094,7 +1110,6 @@ static void s2io_handle_errors(void * dev_id); | |||
1094 | static int s2io_starter(void); | 1110 | static int s2io_starter(void); |
1095 | static void s2io_closer(void); | 1111 | static void s2io_closer(void); |
1096 | static void s2io_tx_watchdog(struct net_device *dev); | 1112 | static void s2io_tx_watchdog(struct net_device *dev); |
1097 | static void s2io_tasklet(unsigned long dev_addr); | ||
1098 | static void s2io_set_multicast(struct net_device *dev); | 1113 | static void s2io_set_multicast(struct net_device *dev); |
1099 | static int rx_osm_handler(struct ring_info *ring_data, struct RxD_t * rxdp); | 1114 | static int rx_osm_handler(struct ring_info *ring_data, struct RxD_t * rxdp); |
1100 | static void s2io_link(struct s2io_nic * sp, int link); | 1115 | static void s2io_link(struct s2io_nic * sp, int link); |
@@ -1127,9 +1142,9 @@ static int do_s2io_add_mc(struct s2io_nic *sp, u8 *addr); | |||
1127 | static int do_s2io_add_mac(struct s2io_nic *sp, u64 addr, int offset); | 1142 | static int do_s2io_add_mac(struct s2io_nic *sp, u64 addr, int offset); |
1128 | static int do_s2io_delete_unicast_mc(struct s2io_nic *sp, u64 addr); | 1143 | static int do_s2io_delete_unicast_mc(struct s2io_nic *sp, u64 addr); |
1129 | 1144 | ||
1130 | static int | 1145 | static int s2io_club_tcp_session(struct ring_info *ring_data, u8 *buffer, |
1131 | s2io_club_tcp_session(u8 *buffer, u8 **tcp, u32 *tcp_len, struct lro **lro, | 1146 | u8 **tcp, u32 *tcp_len, struct lro **lro, struct RxD_t *rxdp, |
1132 | struct RxD_t *rxdp, struct s2io_nic *sp); | 1147 | struct s2io_nic *sp); |
1133 | static void clear_lro_session(struct lro *lro); | 1148 | static void clear_lro_session(struct lro *lro); |
1134 | static void queue_rx_frame(struct sk_buff *skb, u16 vlan_tag); | 1149 | static void queue_rx_frame(struct sk_buff *skb, u16 vlan_tag); |
1135 | static void update_L3L4_header(struct s2io_nic *sp, struct lro *lro); | 1150 | static void update_L3L4_header(struct s2io_nic *sp, struct lro *lro); |