blob: 1ae101e01219c1b7df28d63c5457ede64bc6850c [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
Dave Chapmane17043e2007-03-15 22:55:36 +000035
Dave Chapmanbe297162007-03-16 00:23:23 +000036int sansa_read_partinfo(struct sansa_t* sansa, int silent);
Dave Chapman8d145a52007-09-19 18:46:54 +000037int is_sansa(struct sansa_t* sansa);
Dave Chapmane17043e2007-03-15 22:55:36 +000038int sansa_scan(struct sansa_t* sansa);
Bertrik Sikkend4e38392008-07-14 16:43:47 +000039int sansa_read_firmware(struct sansa_t* sansa, const char* filename);
Dominik Riebeling38f03d42011-12-04 19:40:43 +000040unsigned int sansa_read_bootloader(struct sansa_t* sansa, const char* filename, unsigned char** bl_buffer);
41int sansa_add_bootloader(struct sansa_t* sansa, const unsigned char* buf, unsigned int len);
Dave Chapmanbe297162007-03-16 00:23:23 +000042int sansa_delete_bootloader(struct sansa_t* sansa);
Bertrik Sikkend4e38392008-07-14 16:43:47 +000043int sansa_update_of(struct sansa_t* sansa,const char* filename);
44int sansa_update_ppbl(struct sansa_t* sansa,const char* filename);
Dominik Riebeling08a27c12008-07-16 18:46:37 +000045int sansa_list_images(struct sansa_t* sansa);
Dave Chapmane17043e2007-03-15 22:55:36 +000046
Dominik Riebeling3f65a702008-05-22 17:51:35 +000047#ifdef __cplusplus
48}
Dave Chapmane17043e2007-03-15 22:55:36 +000049#endif
Dominik Riebeling3f65a702008-05-22 17:51:35 +000050#endif
51