blob: ae0ac4faa2a9db34c157eeb49667091f1d3a393b [file] [log] [blame]
Dave Chapmane17043e2007-03-15 22:55:36 +00001/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
Dave Chapman4a812912007-03-15 23:02:37 +00008 * $Id$
Dave Chapmane17043e2007-03-15 22:55:36 +00009 *
10 * Copyright (C) 2006-2007 Dave Chapman
11 *
Daniel Stenberg2acc0ac2008-06-28 18:10:04 +000012 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
Dave Chapmane17043e2007-03-15 22:55:36 +000016 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
Dave Chapmanbe297162007-03-16 00:23:23 +000022#ifndef _SANSAPATCHER_H
23#define _SANSAPATCHER_H
Dave Chapmane17043e2007-03-15 22:55:36 +000024
Dominik Riebeling3f65a702008-05-22 17:51:35 +000025#ifdef __cplusplus
26extern "C" {
27#endif
28
Dave Chapmane17043e2007-03-15 22:55:36 +000029#include "sansaio.h"
30
Dominik Riebelingd131a312008-06-17 17:52:13 +000031extern int sansa_verbose;
Dave Chapmane17043e2007-03-15 22:55:36 +000032/* Size of buffer for disk I/O - 8MB is large enough for any version
33 of the Apple firmware, but not the Nano's RSRC image. */
34#define BUFFER_SIZE 8*1024*1024
Dominik Riebelingd131a312008-06-17 17:52:13 +000035extern unsigned char* sansa_sectorbuf;
Dave Chapmane17043e2007-03-15 22:55:36 +000036
37#define FILETYPE_MI4 0
Dave Chapmane8156012007-03-15 23:26:47 +000038#define FILETYPE_INTERNAL 1
Dave Chapmane17043e2007-03-15 22:55:36 +000039
Dave Chapmanbe297162007-03-16 00:23:23 +000040int sansa_read_partinfo(struct sansa_t* sansa, int silent);
Dave Chapman8d145a52007-09-19 18:46:54 +000041int is_sansa(struct sansa_t* sansa);
Dave Chapmane17043e2007-03-15 22:55:36 +000042int sansa_scan(struct sansa_t* sansa);
Dave Chapmanbe297162007-03-16 00:23:23 +000043int sansa_read_firmware(struct sansa_t* sansa, char* filename);
44int sansa_add_bootloader(struct sansa_t* sansa, char* filename, int type);
45int sansa_delete_bootloader(struct sansa_t* sansa);
Barry Wardell6a0ec8b2007-08-02 11:39:43 +000046int sansa_update_of(struct sansa_t* sansa,char* filename);
Barry Wardell080889a2007-10-14 18:09:40 +000047int sansa_update_ppbl(struct sansa_t* sansa,char* filename);
Dave Chapmanbe297162007-03-16 00:23:23 +000048void sansa_list_images(struct sansa_t* sansa);
Dave Chapmane17043e2007-03-15 22:55:36 +000049
Dominik Riebeling3f65a702008-05-22 17:51:35 +000050#ifdef __cplusplus
51}
Dave Chapmane17043e2007-03-15 22:55:36 +000052#endif
Dominik Riebeling3f65a702008-05-22 17:51:35 +000053#endif
54