#ifndef __TESTS_BODY_H__
#define __TESTS_BODY_H__

#include "et1000.h"
#include "smartbits.h"

#define TEST_2_1_1 0
#define TEST_2_1_2 1
#define TEST_2_2_1 2
#define TEST_2_2_2 3
#define TEST_2_2_5 4
#define TEST_2_2_6 5
#define TEST_2_2_7 6

extern const char* TLIST[7];

#define DPORT_NONE 0xFE
#define TX_PALL 0x4
#define VID_NONE -1
#define RX_PALL 0xFF

#define VLAN_TAG(vid,prio) ((0x8100 << 16) | (prio<<13) | (vid))
#define NOVLAN_TAG 0x0800

#define TEST_PASSED 2
#define TEST_WARNING 1
#define TEST_FAILED 0

/* Tests parameters */
#define T_2XX_FNUM 1000
#define T_2XX_UNRECOG_THR 10

struct smb_port_tx {
  int d_port;  //SMB destination port index [0..3]; 0xff for broadcast
  int q_vid;     //VLAN ID, if 802.1d, make it -1
  int q_pri;    //priority, if 802.1d, make it -1
  int fsize;     //size of transmitted frames
  int fload;     //traffic load [1..100]%
  int fnum;      //amount of frames sent in a single burst
};

struct smb_port_rx {
  int  s_port;       //Source SMB port for setting TRIG1
  char trig2_len;    //TRIG2 pattern length, if 0 TRIG2 not set
  char trig2_pat[6]; //TRIG2 pattern - Ethtype + VLAN tag
};

struct smb_test {
  struct smb_port_tx ptx[SMB_PORTS];
  struct smb_port_rx prx[SMB_PORTS];
};

void init_wr_tests(int num);
int run_test( HTCountStructure *cntrs );
int anl_result( HTCountStructure *cntrs, int testno);

#endif
