From: Jean-Michel A. <au...@us...> - 2010-04-16 13:41:29
|
Update of /cvsroot/ipmitool/ipmitool/lib In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv22551 Modified Files: ipmi_hpmfwupg.c Log Message: - Add support for BIG Buffer (Use when -z option is used) Index: ipmi_hpmfwupg.c =================================================================== RCS file: /cvsroot/ipmitool/ipmitool/lib/ipmi_hpmfwupg.c,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** ipmi_hpmfwupg.c 20 Jan 2010 15:01:03 -0000 1.24 --- ipmi_hpmfwupg.c 16 Apr 2010 13:41:21 -0000 1.25 *************** *** 596,600 **** */ ! #define HPMFWUPG_SEND_DATA_COUNT_MAX 32 #define HPMFWUPG_SEND_DATA_COUNT_KCS 30 #define HPMFWUPG_SEND_DATA_COUNT_LAN 25 --- 596,600 ---- */ ! #define HPMFWUPG_SEND_DATA_COUNT_MAX 128 #define HPMFWUPG_SEND_DATA_COUNT_KCS 30 #define HPMFWUPG_SEND_DATA_COUNT_LAN 25 *************** *** 2243,2247 **** } - if(!skip) { --- 2243,2246 ---- *************** *** 2249,2283 **** uploadCmd.req.blockNumber = 0; ! /* Find max buffer length according the connection parameters */ ! if ( strstr(intf->name,"lan") != NULL ) { ! bufLength = HPMFWUPG_SEND_DATA_COUNT_LAN - 2; ! if ( intf->transit_addr != intf->my_addr && intf->transit_addr != 0 ) ! bufLength -= 8; } else { ! if ! ( ! strstr(intf->name,"open") != NULL ! && ! ( ! intf->target_addr == intf->my_addr ! ) ! ) ! { ! bufLength = HPMFWUPG_SEND_DATA_COUNT_KCS - 2; ! } ! else ! { ! if ( intf->target_channel == 7 ) ! { ! bufLength = HPMFWUPG_SEND_DATA_COUNT_IPMBL; ! } ! else ! { ! bufLength = HPMFWUPG_SEND_DATA_COUNT_IPMB; ! } ! } } --- 2248,2290 ---- uploadCmd.req.blockNumber = 0; ! /* Check if we receive size in parameters */ ! if(intf->channel_buf_size != 0) { ! bufLength = intf->channel_buf_size - 9; /* Plan for overhead */ } else { ! /* Find max buffer length according the connection parameters */ ! if ( strstr(intf->name,"lan") != NULL ) ! { ! bufLength = HPMFWUPG_SEND_DATA_COUNT_LAN - 2; ! if ( intf->transit_addr != intf->my_addr && intf->transit_addr != 0 ) ! bufLength -= 8; ! } ! else ! { ! if ! ( ! strstr(intf->name,"open") != NULL ! && ! ( ! intf->target_addr == intf->my_addr ! ) ! ) ! { ! bufLength = HPMFWUPG_SEND_DATA_COUNT_KCS - 2; ! } ! else ! { ! if ( intf->target_channel == 7 ) ! { ! bufLength = HPMFWUPG_SEND_DATA_COUNT_IPMBL; ! } ! else ! { ! bufLength = HPMFWUPG_SEND_DATA_COUNT_IPMB; ! } ! } ! } } *************** *** 2305,2308 **** --- 2312,2316 ---- displayFWLength= firmwareLength; time(&start); + while ( (pData < (pDataTemp+lengthOfBlock)) && (rc == HPMFWUPG_SUCCESS) ) { *************** *** 2332,2343 **** { bufLength -= (unsigned char)8; ! lprintf(LOG_INFO,"Trying reduced buffer length: %d", ! bufLength); } else { bufLength -= (unsigned char)1; ! lprintf(LOG_INFO,"Trying reduced buffer length: %d", ! bufLength); } rc = HPMFWUPG_SUCCESS; --- 2340,2349 ---- { bufLength -= (unsigned char)8; ! lprintf(LOG_INFO,"Trying reduced buffer length: %d", bufLength); } else { bufLength -= (unsigned char)1; ! lprintf(LOG_INFO,"Trying reduced buffer length: %d", bufLength); } rc = HPMFWUPG_SUCCESS; *************** *** 2915,2923 **** rc = HpmfwupgWaitLongDurationCmd(intf, pFwupgCtx); } ! /* ! * If we get 0xcc here this is probably because we send an invalid sequence ! * number (Packet sent twice). Continue as if we had no error. ! */ ! else if ( (rsp->ccode != 0x00) && (rsp->ccode != 0xcc) ) { /* --- 2921,2925 ---- rc = HpmfwupgWaitLongDurationCmd(intf, pFwupgCtx); } ! else if (rsp->ccode != 0x00) { /* *************** *** 3432,3436 **** lprintf(LOG_DEBUG,"HPM: try to re-open IOL session"); - if ( intf->target_addr == intf->my_addr ) { /* force session re-open */ --- 3434,3437 ---- |