rem: int stk500_initialize(PROGRAMMER * pgm, AVRPART * p)
add: static int stk500_initialize(PROGRAMMER * pgm, AVRPART * p)
context: int stk500_initialize(PROGRAMMER * pgm, AVRPART * p){  unsigned char buf[32];  AVRMEM * m;  int tries;  tries = 0; retry:  tries++;  /*   * set device programming parameters   */  buf[0] = Cmnd_STK_SET_DEVICE;  buf[1] = p->devicecode;  buf[2] = 0; /* device revision */  buf[3] = 0; /* parallel and serial programming */  buf[4] = 1; /* full parallel interface */  buf[5] = 1; /* polling supported - XXX need this in config file */  buf[6] = 1; /* programming is self-timed - XXX need in config file */  m = avr_locate_mem(p, "lock");  if (m)    buf[7] = m->size;  else    buf[7] = 0;  /*   * number of fuse bytes   */  buf[8] = 0;  m = avr_locate_mem(p, "fuse");  if (m)    buf[8] += m->size;  m = avr_locate_mem(p, "lfuse");  if (m)    buf[8] += m->size;  m = avr_locate_mem(p, "hfuse");  if (m)    buf[8] += m->size;  m = avr_locate_mem(p, "efuse");  if (m)    buf[8] += m->size;  m = avr_locate_mem(p, "flash");  if (m) {    buf[9] = m->readback[0];    buf[10] = m->readback[1];    if (m->paged) {      buf[13] = (m->page_size >> 8) & 0x00ff;      buf[14] = m->page_size & 0x00ff;    }    buf[17] = (m->size >> 24) & 0xff;    buf[18] = (m->size >> 16) & 0xff;    buf[19] = (m->size >> 8) & 0xff;    buf[20] = m->size & 0xff;  }  else {    buf[9]  = 0xff;    buf[10]  = 0xff;    buf[13] = 0;    buf[14] = 0;    buf[17] = 0;    buf[18] = 0;    buf[19] = 0;    buf[20] = 0;  }  m = avr_locate_mem(p, "eeprom");  if (m) {    buf[11] = m->readback[0];    buf[12] = m->readback[1];    buf[15] = (m->size >> 8) & 0x00ff;    buf[16] = m->size & 0x00ff;  }  else {    buf[11] = 0xff;    buf[12] = 0xff;    buf[15] = 0;    buf[16] = 0;  }  buf[21] = Sync_CRC_EOP;  stk500_send(pgm, buf, 22);  stk500_recv(pgm, buf, 1);  if (buf[0] == Resp_STK_NOSYNC) {    fprintf(stderr,            "%s: stk500_initialize(): programmer not in sync, resp=0x%02x\n",             progname, buf[0]);    if (tries > 33)      return -1;    stk500_getsync(pgm);    goto retry;    return -1;  }  else if (buf[0] != Resp_STK_INSYNC) {    fprintf(stderr,            "%s: stk500_initialize(): (a) protocol error, "            "expect=0x%02x, resp=0x%02x\n",             progname, Resp_STK_INSYNC, buf[0]);    return -1;  }  stk500_recv(pgm, buf, 1);  if (buf[0] != Resp_STK_OK) {    fprintf(stderr,            "%s: stk500_initialize(): (b) protocol error, "            "expect=0x%02x, resp=0x%02x\n",             progname, Resp_STK_OK, buf[0]);    return -1;  }  return pgm->program_enable(pgm, p);}