From 01a7da1d95fc37c2c28d94ef7519117a7f7f3903 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pali=20Roh=C3=A1r?= Date: Thu, 9 Aug 2012 21:02:20 +0200 Subject: [PATCH] Rename flash.c to nolo.c --- src/Makefile | 2 +- src/main.h | 10 +++------- src/{flash.c => nolo.c} | 19 +++++++++++++------ src/nolo.h | 27 +++++++++++++++++++++++++++ 4 files changed, 44 insertions(+), 14 deletions(-) rename src/{flash.c => nolo.c} (95%) diff --git a/src/Makefile b/src/Makefile index 8760fb5..eb70167 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,5 +1,5 @@ include ../config.mk -OBJ=main.o hexdump.o dump.o flash.o serial.o qmode.o +OBJ=main.o hexdump.o dump.o nolo.o serial.o qmode.o OBJ+=query.o utils.o console.o OBJ+=squeue/squeue.o OBJ+=image.o fiasco.o device.o usb-device.o cold-flash.o diff --git a/src/main.h b/src/main.h index e88264e..e26b0a4 100644 --- a/src/main.h +++ b/src/main.h @@ -21,7 +21,6 @@ struct image; int queue_mode(); int reverse_extract_pieces(char *dir); //void flash_image(const char *filename, const char *piece, const char *device, const char *hwrevs, const char *version); -void flash_image(struct image * image); int fiasco_read_image(char *file); //void check_nolo_order(); extern struct usb_dev_handle *dev; @@ -39,7 +38,7 @@ void eprintf(const char *format, ...); #if HAVE_USB #include -int fiasco_flash(const char *file); +//int fiasco_flash(const char *file); extern struct usb_device *device; extern struct usb_dev_handle *dev; int is_valid_device(struct usb_device_descriptor *udd); @@ -59,9 +58,6 @@ int dump_config(); extern int verbose; #define D if (verbose) -#define CMD_WRITE 64 -#define CMD_QUERY 192 - /*struct piece_t { char *name; char *type; @@ -70,12 +66,12 @@ extern int verbose; char *version; };*/ -enum flash_mode { +/*enum flash_mode { FLASH_COLD, FLASH_NORMAL, FLASH_MKII, FLASH_DISK, -}; +};*/ /*struct devices { char *name; diff --git a/src/flash.c b/src/nolo.c similarity index 95% rename from src/flash.c rename to src/nolo.c index 503fa40..6be4f86 100644 --- a/src/flash.c +++ b/src/nolo.c @@ -1,6 +1,7 @@ /* * 0xFFFF - Open Free Fiasco Firmware Flasher * Copyright (C) 2007 pancake + * Copyright (C) 2012 Pali Rohár * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,15 +17,22 @@ * along with this program. If not, see . */ -#if HAVE_USB -#include "main.h" -#include "hexdump.h" #include #include #include +#include + +#include "nolo.h" #include "image.h" +#include "hexdump.h" + +#define CMD_WRITE 64 +#define CMD_QUERY 192 + +extern struct usb_dev_handle *dev; + /*void check_nolo_order_failed() { fprintf(stderr, "\nERROR: Provide xloader before the secondary. NOLO disagrees anything else.\n"); @@ -32,7 +40,7 @@ exit(1); }*/ -void query_error_message() +static void query_error_message() { /* query error message */ int len = 0; @@ -75,7 +83,7 @@ void query_error_message() check_nolo_order_failed(); }*/ -void flash_image(struct image * image) +void nolo_flash_image(struct image * image) { // FILE *fd; int vlen = 0; @@ -219,4 +227,3 @@ void flash_image(struct image * image) } printf("Flash done succesfully.\n"); } -#endif diff --git a/src/nolo.h b/src/nolo.h index f0a71a4..9eb38a2 100644 --- a/src/nolo.h +++ b/src/nolo.h @@ -1,3 +1,28 @@ +/* + * 0xFFFF - Open Free Fiasco Firmware Flasher + * Copyright (C) 2007 pancake + * Copyright (C) 2012 Pali Rohár + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef NOLO_H +#define NOLO_H + +#include "image.h" + +void nolo_flash_image(struct image * image); #define NOLO_GET_STATUS 1 #define NOLO_GET_BOARD_ID 2 @@ -5,3 +30,5 @@ #define NOLO_GET_HWVERSION 4 #define NOLO_SET_RDFLAGS 16 #define NOLO_GET_RDFLAGS 17 + +#endif