2 * Copyright 2010-2011 Christian Lamparter <chunkeey@googlemail.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation version 2 of the License.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 /* These macros are already defined as part of newlib's sys/cdefs.h.
22 * However they are not part of standard libc which is used to compile
23 * the host tools. For now, simply add them here.
25 #define __packed __attribute__((packed))
26 #define __unused __attribute__((unused))
27 #define __aligned(x) __attribute__((aligned(x)))
29 #include <linux/types.h>
36 void carlfw_release(struct carlfw *fw);
37 struct carlfw *carlfw_load(const char *basename);
38 int carlfw_store(struct carlfw *fw);
39 void *carlfw_find_desc(struct carlfw *fw,
40 const uint8_t descid[4], const unsigned int len,
41 const uint8_t compatible_revision);
43 int carlfw_desc_add_tail(struct carlfw *fw,
44 const struct carl9170fw_desc_head *desc);
46 int carlfw_desc_add(struct carlfw *fw,
47 const struct carl9170fw_desc_head *desc,
48 struct carl9170fw_desc_head *prev,
49 struct carl9170fw_desc_head *next);
51 void *carlfw_desc_mod_len(struct carlfw *fw,
52 struct carl9170fw_desc_head *desc,
55 int carlfw_desc_add_before(struct carlfw *fw,
56 const struct carl9170fw_desc_head *desc,
57 struct carl9170fw_desc_head *pos);
59 void carlfw_desc_unlink(struct carlfw *fw,
60 struct carl9170fw_desc_head *desc);
62 void carlfw_desc_del(struct carlfw *fw,
63 struct carl9170fw_desc_head *entry);
65 void *carlfw_desc_next(struct carlfw *fw,
66 struct carl9170fw_desc_head *pos);
68 void *carlfw_mod_tailroom(struct carlfw *fw, ssize_t len);
69 void *carlfw_mod_headroom(struct carlfw *fw, ssize_t len);
71 void *carlfw_get_fw(struct carlfw *fw, size_t *len);
73 unsigned int carlfw_get_descs_num(struct carlfw *fw);
74 unsigned int carlfw_get_descs_size(struct carlfw *fw);
75 #endif /* __CARLFW_H */