diff options
Diffstat (limited to 'drivers/net/s2io.h')
-rw-r--r-- | drivers/net/s2io.h | 50 |
1 files changed, 47 insertions, 3 deletions
diff --git a/drivers/net/s2io.h b/drivers/net/s2io.h index 64b88eb48287..e68fdf7e4260 100644 --- a/drivers/net/s2io.h +++ b/drivers/net/s2io.h | |||
@@ -360,7 +360,10 @@ struct stat_block { | |||
360 | #define MAX_TX_FIFOS 8 | 360 | #define MAX_TX_FIFOS 8 |
361 | #define MAX_RX_RINGS 8 | 361 | #define MAX_RX_RINGS 8 |
362 | 362 | ||
363 | #define FIFO_DEFAULT_NUM 1 | 363 | #define FIFO_DEFAULT_NUM 5 |
364 | #define FIFO_UDP_MAX_NUM 2 /* 0 - even, 1 -odd ports */ | ||
365 | #define FIFO_OTHER_MAX_NUM 1 | ||
366 | |||
364 | 367 | ||
365 | #define MAX_RX_DESC_1 (MAX_RX_RINGS * MAX_RX_BLOCKS_PER_RING * 127 ) | 368 | #define MAX_RX_DESC_1 (MAX_RX_RINGS * MAX_RX_BLOCKS_PER_RING * 127 ) |
366 | #define MAX_RX_DESC_2 (MAX_RX_RINGS * MAX_RX_BLOCKS_PER_RING * 85 ) | 369 | #define MAX_RX_DESC_2 (MAX_RX_RINGS * MAX_RX_BLOCKS_PER_RING * 85 ) |
@@ -379,6 +382,8 @@ static int fifo_map[][MAX_TX_FIFOS] = { | |||
379 | {0, 1, 2, 3, 4, 5, 6, 7}, | 382 | {0, 1, 2, 3, 4, 5, 6, 7}, |
380 | }; | 383 | }; |
381 | 384 | ||
385 | static u16 fifo_selector[MAX_TX_FIFOS] = {0, 1, 3, 3, 7, 7, 7, 7}; | ||
386 | |||
382 | /* Maintains Per FIFO related information. */ | 387 | /* Maintains Per FIFO related information. */ |
383 | struct tx_fifo_config { | 388 | struct tx_fifo_config { |
384 | #define MAX_AVAILABLE_TXDS 8192 | 389 | #define MAX_AVAILABLE_TXDS 8192 |
@@ -431,6 +436,12 @@ struct config_param { | |||
431 | /* Tx Side */ | 436 | /* Tx Side */ |
432 | u32 tx_fifo_num; /*Number of Tx FIFOs */ | 437 | u32 tx_fifo_num; /*Number of Tx FIFOs */ |
433 | 438 | ||
439 | /* 0-No steering, 1-Priority steering, 2-Default fifo map */ | ||
440 | #define NO_STEERING 0 | ||
441 | #define TX_PRIORITY_STEERING 0x1 | ||
442 | #define TX_DEFAULT_STEERING 0x2 | ||
443 | u8 tx_steering_type; | ||
444 | |||
434 | u8 fifo_mapping[MAX_TX_FIFOS]; | 445 | u8 fifo_mapping[MAX_TX_FIFOS]; |
435 | struct tx_fifo_config tx_cfg[MAX_TX_FIFOS]; /*Per-Tx FIFO config */ | 446 | struct tx_fifo_config tx_cfg[MAX_TX_FIFOS]; /*Per-Tx FIFO config */ |
436 | u32 max_txds; /*Max no. of Tx buffer descriptor per TxDL */ | 447 | u32 max_txds; /*Max no. of Tx buffer descriptor per TxDL */ |
@@ -464,6 +475,7 @@ struct config_param { | |||
464 | int max_mc_addr; /* xena=64 herc=256 */ | 475 | int max_mc_addr; /* xena=64 herc=256 */ |
465 | int max_mac_addr; /* xena=16 herc=64 */ | 476 | int max_mac_addr; /* xena=16 herc=64 */ |
466 | int mc_start_offset; /* xena=16 herc=64 */ | 477 | int mc_start_offset; /* xena=16 herc=64 */ |
478 | u8 multiq; | ||
467 | }; | 479 | }; |
468 | 480 | ||
469 | /* Structure representing MAC Addrs */ | 481 | /* Structure representing MAC Addrs */ |
@@ -534,6 +546,7 @@ struct RxD_t { | |||
534 | #define RXD_OWN_XENA s2BIT(7) | 546 | #define RXD_OWN_XENA s2BIT(7) |
535 | #define RXD_T_CODE (s2BIT(12)|s2BIT(13)|s2BIT(14)|s2BIT(15)) | 547 | #define RXD_T_CODE (s2BIT(12)|s2BIT(13)|s2BIT(14)|s2BIT(15)) |
536 | #define RXD_FRAME_PROTO vBIT(0xFFFF,24,8) | 548 | #define RXD_FRAME_PROTO vBIT(0xFFFF,24,8) |
549 | #define RXD_FRAME_VLAN_TAG s2BIT(24) | ||
537 | #define RXD_FRAME_PROTO_IPV4 s2BIT(27) | 550 | #define RXD_FRAME_PROTO_IPV4 s2BIT(27) |
538 | #define RXD_FRAME_PROTO_IPV6 s2BIT(28) | 551 | #define RXD_FRAME_PROTO_IPV6 s2BIT(28) |
539 | #define RXD_FRAME_IP_FRAG s2BIT(29) | 552 | #define RXD_FRAME_IP_FRAG s2BIT(29) |
@@ -720,6 +733,15 @@ struct fifo_info { | |||
720 | * the buffers | 733 | * the buffers |
721 | */ | 734 | */ |
722 | struct tx_curr_get_info tx_curr_get_info; | 735 | struct tx_curr_get_info tx_curr_get_info; |
736 | #define FIFO_QUEUE_START 0 | ||
737 | #define FIFO_QUEUE_STOP 1 | ||
738 | int queue_state; | ||
739 | |||
740 | /* copy of sp->dev pointer */ | ||
741 | struct net_device *dev; | ||
742 | |||
743 | /* copy of multiq status */ | ||
744 | u8 multiq; | ||
723 | 745 | ||
724 | /* Per fifo lock */ | 746 | /* Per fifo lock */ |
725 | spinlock_t tx_lock; | 747 | spinlock_t tx_lock; |
@@ -808,10 +830,11 @@ struct lro { | |||
808 | int sg_num; | 830 | int sg_num; |
809 | int in_use; | 831 | int in_use; |
810 | __be16 window; | 832 | __be16 window; |
833 | u16 vlan_tag; | ||
811 | u32 cur_tsval; | 834 | u32 cur_tsval; |
812 | __be32 cur_tsecr; | 835 | __be32 cur_tsecr; |
813 | u8 saw_ts; | 836 | u8 saw_ts; |
814 | }; | 837 | } ____cacheline_aligned; |
815 | 838 | ||
816 | /* These flags represent the devices temporary state */ | 839 | /* These flags represent the devices temporary state */ |
817 | enum s2io_device_state_t | 840 | enum s2io_device_state_t |
@@ -885,6 +908,27 @@ struct s2io_nic { | |||
885 | */ | 908 | */ |
886 | int rx_csum; | 909 | int rx_csum; |
887 | 910 | ||
911 | /* Below variables are used for fifo selection to transmit a packet */ | ||
912 | u16 fifo_selector[MAX_TX_FIFOS]; | ||
913 | |||
914 | /* Total fifos for tcp packets */ | ||
915 | u8 total_tcp_fifos; | ||
916 | |||
917 | /* | ||
918 | * Beginning index of udp for udp packets | ||
919 | * Value will be equal to | ||
920 | * (tx_fifo_num - FIFO_UDP_MAX_NUM - FIFO_OTHER_MAX_NUM) | ||
921 | */ | ||
922 | u8 udp_fifo_idx; | ||
923 | |||
924 | u8 total_udp_fifos; | ||
925 | |||
926 | /* | ||
927 | * Beginning index of fifo for all other packets | ||
928 | * Value will be equal to (tx_fifo_num - FIFO_OTHER_MAX_NUM) | ||
929 | */ | ||
930 | u8 other_fifo_idx; | ||
931 | |||
888 | /* after blink, the adapter must be restored with original | 932 | /* after blink, the adapter must be restored with original |
889 | * values. | 933 | * values. |
890 | */ | 934 | */ |
@@ -1087,7 +1131,7 @@ static int | |||
1087 | s2io_club_tcp_session(u8 *buffer, u8 **tcp, u32 *tcp_len, struct lro **lro, | 1131 | s2io_club_tcp_session(u8 *buffer, u8 **tcp, u32 *tcp_len, struct lro **lro, |
1088 | struct RxD_t *rxdp, struct s2io_nic *sp); | 1132 | struct RxD_t *rxdp, struct s2io_nic *sp); |
1089 | static void clear_lro_session(struct lro *lro); | 1133 | static void clear_lro_session(struct lro *lro); |
1090 | static void queue_rx_frame(struct sk_buff *skb); | 1134 | static void queue_rx_frame(struct sk_buff *skb, u16 vlan_tag); |
1091 | static void update_L3L4_header(struct s2io_nic *sp, struct lro *lro); | 1135 | static void update_L3L4_header(struct s2io_nic *sp, struct lro *lro); |
1092 | static void lro_append_pkt(struct s2io_nic *sp, struct lro *lro, | 1136 | static void lro_append_pkt(struct s2io_nic *sp, struct lro *lro, |
1093 | struct sk_buff *skb, u32 tcp_len); | 1137 | struct sk_buff *skb, u32 tcp_len); |