This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
I am the same person who sent the mailing list titled "What functions should I call in ethernet drv ?". At that time I was helped by your advices. I was very much obliged.
I am sorry to say that I am encountered another trouble and I ask you again your help.
Since then I continued to test transmission between host and target. host(Client) : 172.16.1.28 : nc_test_master target(Server): 172.16.1.200 : nc_test_slave
But when host tries to connect to target in TCP, always happens connection error(timeout). Below is host's output on cygwin shell.
$ ./nc_test_master.exe 172.16.1.200 Start Network Characterization - MASTER ================== No load, master at 100% ======================== Start TCP echo [64,10240] - no delays Can't connect to slave: Connection refused Can't connect to slave: Connection refused Can't connect to slave: Connection refused
I sent also Etherreal packets captutre log file(text-gz format). \TCP-checksum-log\DEBUG-00-prescale-20\EtherReal-log-txt\etherreal-TCP-2.txt DEBUG=00,CYGHWR_HAL_SH_RTC_PRESCALE=20(CYGNUM_HAL_RTC_PERIOD=14745)
From here on,I refer to this file as er.txt.
I traced TCP checksum routine,and I am not sure they are correct. I set break at 735 line in tcp_output() function in packages\net\bsd_tcpip\current\src\sys\netinet\tcp_output.c
199: u_short 200: in_addword(u_short a, u_short b) 201: { 202: u_int32_t sum = a + b; 203: 204: ADDCARRY(sum); 205: return (sum); 206: }
Now this looks not doing one's complement sum for me. Is this really correct function ?
Whereas in case of UDP checksum, I set break at 735 line in udp_output() function in packages\net\bsd_tcpip\current\src\sys\netinet\udp_usrreq.c(662) udp_usrreq.c 662: udp_output(inp, m, addr, control, p)
And jumped to 208: u_short 209: in_pseudo(u_int32_t a, u_int32_t b, u_int32_t c) 210: { 211: u_int64_t sum; 212: union q_util q_util; 213: union l_util l_util; 214: 215: sum = (u_int64_t) a + b + c; 216: REDUCE16; 217: return (sum); 218: }
#define REDUCE16 \ { \ q_util.q = sum; \ l_util.l = q_util.s[0] + q_util.s[1] + q_util.s[2] + q_util.s[3]; \ sum = l_util.s[0] + l_util.s[1]; \ ADDCARRY(sum); \ }
As Gary suggested,I checked hearbeat. I changed CYGHWR_HAL_SH_RTC_PRESCALE from default 4 to 20 and now,CYGNUM_HAL_RTC_PERIOD=14745,
I concocted in \packages\devs\eth\smsc\lan91cxx\current\src\if_lan91cxx.c. cyg_uint8 get_data_byte(struct eth_drv_sc *sc) { //20070919 int sf;
cyg_uint8 c; struct lan91cxx_priv_data *cpd = (struct lan91cxx_priv_data *)sc->driver_private;
if( cpd->data_pos == sizeof(rxd_t) ) { cpd->data_buf = get_data(sc); cpd->data_pos = 0; //20070919 sf = 1; } //20070919 begin else{ sf = 0; } //20070919 end
//20070919 begin //ORG c = (cpd->data_buf>>(cpd->data_pos*8))&0xFF; c = (cpd->data_buf>>(sf*8))&0xFF;
return c; } cyg_uint16 get_data_short(struct eth_drv_sc *sc) { cyg_uint16 val;
val = get_data_byte(sc); //20071023 //ORG val |= get_data_byte(sc)<<8; val = val<<8 | get_data_byte(sc);
return CYG_LE16_TO_CPU(val); }
I am perplexed what is happening,please help me. Thanks in advance.
Attachment:
TCP-checksum-log.tar.gz
Description: GNU Zip compressed data
-- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |