summaryrefslogtreecommitdiffstats
path: root/src/operations.c
diff options
context:
space:
mode:
authorPali Rohár <pali.rohar@gmail.com>2012-11-24 01:03:27 +0100
committerPali Rohár <pali.rohar@gmail.com>2012-11-24 01:03:27 +0100
commit51072eb40a34ea9a0241a1eaa4cea522b5b4e223 (patch)
treea41d847cbe5e32ae74340de44bc912522c9113c6 /src/operations.c
parentbd54b19bbf02aaa7129878182339c2b2c25d838e (diff)
download0xFFFF-51072eb40a34ea9a0241a1eaa4cea522b5b4e223.tar.bz2
operations: Added support for initfs version string
Diffstat (limited to 'src/operations.c')
-rw-r--r--src/operations.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/operations.c b/src/operations.c
index 4a63c09..88a7a59 100644
--- a/src/operations.c
+++ b/src/operations.c
@@ -490,6 +490,43 @@ int dev_set_kernel_ver(struct device_info * dev, const char * ver) {
}
+int dev_get_initfs_ver(struct device_info * dev, char * ver, size_t size) {
+
+ if ( dev->method == METHOD_LOCAL )
+ return local_get_initfs_ver(ver, size);
+
+ if ( dev->method == METHOD_USB ) {
+
+ if ( dev->usb->flash_device->protocol == FLASH_NOLO )
+ return nolo_get_initfs_ver(dev->usb, ver, size);
+
+ }
+
+ return -1;
+
+}
+
+int dev_set_initfs_ver(struct device_info * dev, const char * ver) {
+
+ if ( dev->method == METHOD_LOCAL )
+ return local_set_initfs_ver(ver);
+
+ if ( dev->method == METHOD_USB ) {
+
+ if ( dev->usb->flash_device->protocol == FLASH_NOLO )
+ return nolo_set_initfs_ver(dev->usb, ver);
+
+ if ( dev->usb->flash_device->protocol == FLASH_COLD ) {
+ usb_switch_to_nolo(dev->usb);
+ return -EAGAIN;
+ }
+
+ }
+
+ return -1;
+
+}
+
int dev_get_nolo_ver(struct device_info * dev, char * ver, size_t size) {
if ( dev->method == METHOD_LOCAL )