diff options
Diffstat (limited to 'compat/compat-2.6.34.c')
-rw-r--r-- | compat/compat-2.6.34.c | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/compat/compat-2.6.34.c b/compat/compat-2.6.34.c new file mode 100644 index 0000000..863be64 --- /dev/null +++ b/compat/compat-2.6.34.c @@ -0,0 +1,86 @@ +/* + * Copyright 2012 Luis R. Rodriguez <mcgrof@do-not-panic.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Compatibility file for Linux wireless for kernels 2.6.34. + */ + +#include <linux/mmc/sdio_func.h> +#include <linux/seq_file.h> +#include "compat-2.6.34.h" + +static mmc_pm_flag_t backport_mmc_pm_flags; + +void backport_init_mmc_pm_flags(void) +{ + backport_mmc_pm_flags = 0; +} + +mmc_pm_flag_t sdio_get_host_pm_caps(struct sdio_func *func) +{ + return backport_mmc_pm_flags; +} + +int sdio_set_host_pm_flags(struct sdio_func *func, mmc_pm_flag_t flags) +{ + return -EINVAL; +} + +/** + * seq_hlist_start - start an iteration of a hlist + * @head: the head of the hlist + * @pos: the start position of the sequence + * + * Called at seq_file->op->start(). + */ +static struct hlist_node * +seq_hlist_start(struct hlist_head *head, loff_t pos) +{ + struct hlist_node *node; + + hlist_for_each(node, head) + if (pos-- == 0) + return node; + return NULL; +} + +/** + * seq_hlist_start_head - start an iteration of a hlist + * @head: the head of the hlist + * @pos: the start position of the sequence + * + * Called at seq_file->op->start(). Call this function if you want to + * print a header at the top of the output. + */ +struct hlist_node *seq_hlist_start_head(struct hlist_head *head, loff_t pos) +{ + if (!pos) + return SEQ_START_TOKEN; + + return seq_hlist_start(head, pos - 1); +} +EXPORT_SYMBOL_GPL(seq_hlist_start_head); + +/** + * seq_hlist_next - move to the next position of the hlist + * @v: the current iterator + * @head: the head of the hlist + * @ppos: the current position + * + * Called at seq_file->op->next(). + */ +struct hlist_node *seq_hlist_next(void *v, struct hlist_head *head, + loff_t *ppos) +{ + struct hlist_node *node = v; + + ++*ppos; + if (v == SEQ_START_TOKEN) + return head->first; + else + return node->next; +} +EXPORT_SYMBOL_GPL(seq_hlist_next); |