summaryrefslogtreecommitdiff
path: root/application/smm
diff options
context:
space:
mode:
authorBenjamin Decavel2008-11-07 17:14:53 +0100
committerBenjamin Decavel2008-11-07 17:14:53 +0100
commit7f7211099a0038bb2ffc8929e7ba985d27627c56 (patch)
tree0ebdea0d076a51a6bbec5b35eda84f50dd6feffd /application/smm
parent45321b0a08e45ec6612f6089f776769789a0a7b3 (diff)
Smm client updated accordingly to new auto-update specs
Diffstat (limited to 'application/smm')
-rw-r--r--application/smm/smm-client/inc/smmlib.h2
-rw-r--r--application/smm/smm-client/src/smmlib.c12
2 files changed, 8 insertions, 6 deletions
diff --git a/application/smm/smm-client/inc/smmlib.h b/application/smm/smm-client/inc/smmlib.h
index 384f32a7f6..32f4021166 100644
--- a/application/smm/smm-client/inc/smmlib.h
+++ b/application/smm/smm-client/inc/smmlib.h
@@ -123,7 +123,7 @@ extern int smm_set_telnet(const unsigned char *dest_addr, unsigned int retries,
extern int smm_get_ftp(const unsigned char *dest_addr, unsigned int retries, int *status);
extern int smm_set_ftp(const unsigned char *dest_addr, unsigned int retries, int status);
-extern int smm_set_update(const unsigned char *dest_addr, unsigned int retries, char* md5_sum, char* version, char* image, int length);
+extern int smm_set_update(const unsigned char *dest_addr, unsigned int retries, char* md5_sum, char* version, char* image, unsigned int length, unsigned int type);
extern int smm_echo(const unsigned char *dest_addr, unsigned int retries, char *test_buff, const size_t max_data_len);
diff --git a/application/smm/smm-client/src/smmlib.c b/application/smm/smm-client/src/smmlib.c
index 9aa0f860fb..14cda05b88 100644
--- a/application/smm/smm-client/src/smmlib.c
+++ b/application/smm/smm-client/src/smmlib.c
@@ -1246,11 +1246,11 @@ smm_set_ftp(const unsigned char *dest_addr, unsigned int retries, int status)
}
int
-smm_set_update(const unsigned char *dest_addr, unsigned int retries, char* md5_sum, char* version, char* image, int length)
+smm_set_update(const unsigned char *dest_addr, unsigned int retries, char* md5_sum, char* version, char* image, unsigned int length, unsigned int type)
{
/* Buffer to hold Ethernet frames of request and response messages. */
unsigned char smm_buffer[SMM_HLEN + UPDATE_FRAME_SIZE + 4 + 4];
- size_t buff_len = SMM_HLEN + 32;
+ size_t buff_len = SMM_HLEN + 40;
unsigned char *smmentry = smm_buffer + SMM_HLEN;
@@ -1262,9 +1262,11 @@ smm_set_update(const unsigned char *dest_addr, unsigned int retries, char* md5_s
memset(smm_buffer, 0, buff_len);
memcpy(smmentry, version, 16);
memcpy(smmentry + 16, md5_sum, 16);
+ memcpy(smmentry + 32, &length, 4);
+ memcpy(smmentry + 36, &type, 4);
/* Send update_init request and get response from slave. */
- if (smm_communication(dest_addr, retries, SMM_UPDATE_INIT_REQ, smm_buffer, SMM_HLEN + 32, &buff_len) != 0)
+ if (smm_communication(dest_addr, retries, SMM_UPDATE_INIT_REQ, smm_buffer, SMM_HLEN + 40, &buff_len) != 0)
return -SMM_ECOMM;
/* Extract data from received SMMENTRY: */
@@ -1300,7 +1302,7 @@ smm_set_update(const unsigned char *dest_addr, unsigned int retries, char* md5_s
/* Nack received, resend the requested frame */
if (smmentry[1])
{
- int* temp = smmentry + 2;
+ int* temp = (int *) (smmentry + 2);
i = *temp;
return -SMM_ENACK;
}
@@ -1327,7 +1329,7 @@ smm_set_update(const unsigned char *dest_addr, unsigned int retries, char* md5_s
/* Nack received, resend the requested frame */
if (smmentry[1])
{
- int* temp = smmentry + 2;
+ int* temp = (int *) (smmentry + 2);
i = *temp;
return -SMM_ENACK;
}