Lines Matching refs:environment
107 struct environment { struct
115 static struct environment environment = { argument
401 for (env = environment.data; *env; env = nxt + 1) { in fw_getenv()
405 if (nxt >= &environment.data[ENV_SIZE]) { in fw_getenv()
467 for (env = environment.data; *env; env = nxt + 1) { in fw_printenv()
469 if (nxt >= &environment.data[ENV_SIZE]) { in fw_printenv()
514 *environment.crc = crc32(0, (uint8_t *) environment.data, ENV_SIZE); in fw_env_flush()
540 for (nxt = env = environment.data; *env; env = nxt + 1) { in fw_env_write()
542 if (nxt >= &environment.data[ENV_SIZE]) { in fw_env_write()
617 for (env = environment.data; *env || *(env + 1); ++env) in fw_env_write()
619 if (env > environment.data) in fw_env_write()
629 if (len > (&environment.data[ENV_SIZE] - env)) { in fw_env_write()
1164 switch (environment.flag_scheme) { in flash_write()
1168 (*environment.flags)++; in flash_write()
1171 *environment.flags = active_flag; in flash_write()
1175 environment.flag_scheme); in flash_write()
1187 return ubi_write(fd_target, environment.image, CUR_ENVSIZE); in flash_write()
1190 rc = flash_write_buf(dev_target, fd_target, environment.image, in flash_write()
1195 if (environment.flag_scheme == FLAG_BOOLEAN) { in flash_write()
1217 return ubi_read(fd, environment.image, CUR_ENVSIZE); in flash_read()
1220 rc = flash_read_buf(dev_current, fd, environment.image, CUR_ENVSIZE, in flash_read()
1415 environment.image = addr0; in fw_env_open()
1419 environment.crc = &redundant->crc; in fw_env_open()
1420 environment.flags = &redundant->flags; in fw_env_open()
1421 environment.data = redundant->data; in fw_env_open()
1424 environment.crc = &single->crc; in fw_env_open()
1425 environment.flags = NULL; in fw_env_open()
1426 environment.data = single->data; in fw_env_open()
1435 crc0 = crc32(0, (uint8_t *)environment.data, ENV_SIZE); in fw_env_open()
1437 crc0_ok = (crc0 == *environment.crc); in fw_env_open()
1442 memcpy(environment.data, default_environment, in fw_env_open()
1446 flag0 = *environment.flags; in fw_env_open()
1463 environment.image = addr1; in fw_env_open()
1472 environment.flag_scheme = FLAG_BOOLEAN; in fw_env_open()
1475 environment.flag_scheme = FLAG_INCREMENTAL; in fw_env_open()
1478 environment.flag_scheme = FLAG_BOOLEAN; in fw_env_open()
1481 environment.flag_scheme = FLAG_INCREMENTAL; in fw_env_open()
1485 environment.flag_scheme = FLAG_INCREMENTAL; in fw_env_open()
1504 memcpy(environment.data, default_environment, in fw_env_open()
1508 switch (environment.flag_scheme) { in fw_env_open()
1537 environment.flag_scheme); in fw_env_open()
1548 environment.image = addr1; in fw_env_open()
1549 environment.crc = &redundant->crc; in fw_env_open()
1550 environment.flags = &redundant->flags; in fw_env_open()
1551 environment.data = redundant->data; in fw_env_open()
1554 environment.image = addr0; in fw_env_open()
1579 if (environment.image) in fw_env_close()
1580 free(environment.image); in fw_env_close()
1582 environment.image = NULL; in fw_env_close()