Lines Matching refs:dev_current
75 static int dev_current; variable
85 #define CUR_ENVSIZE ENVSIZE(dev_current)
1197 off_t offset = DEVOFFSET(dev_current) + in flash_write()
1202 DEVOFFSET(dev_current), DEVNAME(dev_current)); in flash_write()
1204 flash_flag_obsolete(dev_current, fd_current, offset); in flash_write()
1214 if (IS_UBI(dev_current)) { in flash_read()
1215 DEVTYPE(dev_current) = MTD_ABSENT; in flash_read()
1220 rc = flash_read_buf(dev_current, fd, environment.image, CUR_ENVSIZE, in flash_read()
1221 DEVOFFSET(dev_current)); in flash_read()
1230 char *dup_name = strdup(DEVNAME(dev_current)); in flash_open_tempfile()
1273 dev_target = !dev_current; in flash_io_write()
1292 dev_target = dev_current; in flash_io_write()
1302 DEVNAME(dev_current), strerror(errno)); in flash_io_write()
1310 DEVNAME(dev_current), strerror(errno)); in flash_io_write()
1357 fd_current = open(DEVNAME(dev_current), mode); in flash_io()
1361 DEVNAME(dev_current), strerror(errno)); in flash_io()
1374 DEVNAME(dev_current), strerror(errno)); in flash_io()
1429 dev_current = 0; in fw_env_open()
1448 dev_current = 1; in fw_env_open()
1470 if (DEVTYPE(dev_current) == MTD_NORFLASH && in fw_env_open()
1471 DEVTYPE(!dev_current) == MTD_NORFLASH) { in fw_env_open()
1473 } else if (DEVTYPE(dev_current) == MTD_NANDFLASH && in fw_env_open()
1474 DEVTYPE(!dev_current) == MTD_NANDFLASH) { in fw_env_open()
1476 } else if (DEVTYPE(dev_current) == MTD_DATAFLASH && in fw_env_open()
1477 DEVTYPE(!dev_current) == MTD_DATAFLASH) { in fw_env_open()
1479 } else if (DEVTYPE(dev_current) == MTD_UBIVOLUME && in fw_env_open()
1480 DEVTYPE(!dev_current) == MTD_UBIVOLUME) { in fw_env_open()
1482 } else if (DEVTYPE(dev_current) == MTD_ABSENT && in fw_env_open()
1483 DEVTYPE(!dev_current) == MTD_ABSENT && in fw_env_open()
1484 IS_UBI(dev_current) == IS_UBI(!dev_current)) { in fw_env_open()
1498 dev_current = 0; in fw_env_open()
1500 dev_current = 1; in fw_env_open()
1506 dev_current = 0; in fw_env_open()
1512 dev_current = 0; in fw_env_open()
1515 dev_current = 1; in fw_env_open()
1517 dev_current = 0; in fw_env_open()
1519 dev_current = 0; in fw_env_open()
1521 dev_current = 1; in fw_env_open()
1523 dev_current = 0; in fw_env_open()
1528 dev_current = 1; in fw_env_open()
1531 dev_current = 0; in fw_env_open()
1533 dev_current = 1; in fw_env_open()
1547 if (dev_current) { in fw_env_open()
1559 fprintf(stderr, "Selected env in %s\n", DEVNAME(dev_current)); in fw_env_open()