summaryrefslogtreecommitdiffstats
path: root/carl9170fw/tools/lib/carlfw.h
blob: 6e722c944cf7e4266b6902a7c9d729d6dfd101d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
 * Copyright 2010-2011 Christian Lamparter <chunkeey@googlemail.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 version 2 of the License.
 *
 * 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, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */

#ifndef __CARLFW_H
#define __CARLFW_H

#include <linux/types.h>
#include "compiler.h"
#include "fwdesc.h"
#include "list.h"

struct carlfw;

void carlfw_release(struct carlfw *fw);
struct carlfw *carlfw_load(const char *basename);
int carlfw_store(struct carlfw *fw);
void *carlfw_find_desc(struct carlfw *fw,
	const uint8_t descid[4], const unsigned int len,
	const uint8_t compatible_revision);

int carlfw_desc_add_tail(struct carlfw *fw,
			 const struct carl9170fw_desc_head *desc);

int carlfw_desc_add(struct carlfw *fw,
		    const struct carl9170fw_desc_head *desc,
		    struct carl9170fw_desc_head *prev,
		    struct carl9170fw_desc_head *next);

void *carlfw_desc_mod_len(struct carlfw *fw,
			  struct carl9170fw_desc_head *desc,
			  size_t len);

int carlfw_desc_add_before(struct carlfw *fw,
			   const struct carl9170fw_desc_head *desc,
			   struct carl9170fw_desc_head *pos);

void carlfw_desc_unlink(struct carlfw *fw,
			struct carl9170fw_desc_head *desc);

void carlfw_desc_del(struct carlfw *fw,
		     struct carl9170fw_desc_head *entry);

void *carlfw_desc_next(struct carlfw *fw,
		       struct carl9170fw_desc_head *pos);

void *carlfw_mod_tailroom(struct carlfw *fw, ssize_t len);
void *carlfw_mod_headroom(struct carlfw *fw, ssize_t len);

void *carlfw_get_fw(struct carlfw *fw, size_t *len);

unsigned int carlfw_get_descs_num(struct carlfw *fw);
unsigned int carlfw_get_descs_size(struct carlfw *fw);
#endif /* __CARLFW_H */