diff options
author | Pali Rohár <pali.rohar@gmail.com> | 2012-08-09 21:02:20 +0200 |
---|---|---|
committer | Pali Rohár <pali.rohar@gmail.com> | 2012-08-09 21:02:20 +0200 |
commit | 01a7da1d95fc37c2c28d94ef7519117a7f7f3903 (patch) | |
tree | 3458ec168556947288e85d9407e99158d2ebd62a /src | |
parent | 70c09fb5b7dfee921a27c17eae67ca5e01274a1e (diff) | |
download | 0xFFFF-01a7da1d95fc37c2c28d94ef7519117a7f7f3903.tar.bz2 |
Rename flash.c to nolo.c
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile | 2 | ||||
-rw-r--r-- | src/main.h | 10 | ||||
-rw-r--r-- | src/nolo.c (renamed from src/flash.c) | 19 | ||||
-rw-r--r-- | src/nolo.h | 27 |
4 files changed, 44 insertions, 14 deletions
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 @@ -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 <usb.h> -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; @@ -1,6 +1,7 @@ /* * 0xFFFF - Open Free Fiasco Firmware Flasher * Copyright (C) 2007 pancake <pancake@youterm.com> + * Copyright (C) 2012 Pali Rohár <pali.rohar@gmail.com> * * 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 <http://www.gnu.org/licenses/>. */ -#if HAVE_USB -#include "main.h" -#include "hexdump.h" #include <stdio.h> #include <string.h> #include <stdlib.h> +#include <usb.h> + +#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 @@ -1,3 +1,28 @@ +/* + * 0xFFFF - Open Free Fiasco Firmware Flasher + * Copyright (C) 2007 pancake <pancake@youterm.com> + * Copyright (C) 2012 Pali Rohár <pali.rohar@gmail.com> + * + * 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 <http://www.gnu.org/licenses/>. + */ + +#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 |