summaryrefslogtreecommitdiffstats
path: root/backport-include/pcmcia
diff options
context:
space:
mode:
authorroot <root@artemis.panaceas.org>2015-12-25 15:00:15 +0000
committerroot <root@artemis.panaceas.org>2015-12-25 15:00:15 +0000
commitddd86436f4e3643c04b797f858dab95d5f2e4de9 (patch)
treebfe7a780cf9a2f4fc33aec32c82e625e79dece1f /backport-include/pcmcia
downloadbackports-3.10.19-1-master.tar.gz
backports-3.10.19-1-master.tar.bz2
backports-3.10.19-1-master.zip
Diffstat (limited to 'backport-include/pcmcia')
-rw-r--r--backport-include/pcmcia/cistpl.h10
-rw-r--r--backport-include/pcmcia/device_id.h23
-rw-r--r--backport-include/pcmcia/ds.h87
3 files changed, 120 insertions, 0 deletions
diff --git a/backport-include/pcmcia/cistpl.h b/backport-include/pcmcia/cistpl.h
new file mode 100644
index 0000000..789dc59
--- /dev/null
+++ b/backport-include/pcmcia/cistpl.h
@@ -0,0 +1,10 @@
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)
+#include <pcmcia/cs_types.h>
+#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
+#include <pcmcia/cs.h>
+#endif
+
+#include_next <pcmcia/cistpl.h>
diff --git a/backport-include/pcmcia/device_id.h b/backport-include/pcmcia/device_id.h
new file mode 100644
index 0000000..908af50
--- /dev/null
+++ b/backport-include/pcmcia/device_id.h
@@ -0,0 +1,23 @@
+#ifndef __BACKPORT_PCMCIA_DEVICE_ID_H
+#define __BACKPORT_PCMCIA_DEVICE_ID_H
+#include_next <pcmcia/device_id.h>
+
+#ifndef PCMCIA_DEVICE_MANF_CARD_PROD_ID3
+#define PCMCIA_DEVICE_MANF_CARD_PROD_ID3(manf, card, v3, vh3) { \
+ .match_flags = PCMCIA_DEV_ID_MATCH_MANF_ID| \
+ PCMCIA_DEV_ID_MATCH_CARD_ID| \
+ PCMCIA_DEV_ID_MATCH_PROD_ID3, \
+ .manf_id = (manf), \
+ .card_id = (card), \
+ .prod_id = { NULL, NULL, (v3), NULL }, \
+ .prod_id_hash = { 0, 0, (vh3), 0 }, }
+#endif
+
+#ifndef PCMCIA_DEVICE_PROD_ID3
+#define PCMCIA_DEVICE_PROD_ID3(v3, vh3) { \
+ .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID3, \
+ .prod_id = { NULL, NULL, (v3), NULL }, \
+ .prod_id_hash = { 0, 0, (vh3), 0 }, }
+#endif
+
+#endif /* __BACKPORT_PCMCIA_DEVICE_ID_H */
diff --git a/backport-include/pcmcia/ds.h b/backport-include/pcmcia/ds.h
new file mode 100644
index 0000000..0e317cd
--- /dev/null
+++ b/backport-include/pcmcia/ds.h
@@ -0,0 +1,87 @@
+#ifndef __BACKPORT_PCMCIA_DS_H
+#define __BACKPORT_PCMCIA_DS_H
+#include_next <pcmcia/ds.h>
+
+#ifndef module_pcmcia_driver
+/**
+ * backport of:
+ *
+ * commit 6ed7ffddcf61f668114edb676417e5fb33773b59
+ * Author: H Hartley Sweeten <hsweeten@visionengravers.com>
+ * Date: Wed Mar 6 11:24:44 2013 -0700
+ *
+ * pcmcia/ds.h: introduce helper for pcmcia_driver module boilerplate
+ */
+
+/**
+ * module_pcmcia_driver() - Helper macro for registering a pcmcia driver
+ * @__pcmcia_driver: pcmcia_driver struct
+ *
+ * Helper macro for pcmcia drivers which do not do anything special in module
+ * init/exit. This eliminates a lot of boilerplate. Each module may only use
+ * this macro once, and calling it replaces module_init() and module_exit().
+ */
+#define module_pcmcia_driver(__pcmcia_driver) \
+ module_driver(__pcmcia_driver, pcmcia_register_driver, \
+ pcmcia_unregister_driver)
+#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
+#define pcmcia_enable_device(link) pcmcia_request_configuration(link, &link->conf)
+#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)
+static inline int pcmcia_read_config_byte(struct pcmcia_device *p_dev, off_t where, u8 *val)
+{
+ int ret;
+ conf_reg_t reg = { 0, CS_READ, where, 0 };
+ ret = pcmcia_access_configuration_register(p_dev, &reg);
+ *val = reg.Value;
+ return ret;
+}
+
+static inline int pcmcia_write_config_byte(struct pcmcia_device *p_dev, off_t where, u8 val)
+{
+ conf_reg_t reg = { 0, CS_WRITE, where, val };
+ return pcmcia_access_configuration_register(p_dev, &reg);
+}
+#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
+#define pcmcia_request_window(a, b, c) pcmcia_request_window(&a, b, c)
+#define pcmcia_map_mem_page(a, b, c) pcmcia_map_mem_page(b, c)
+
+#define pcmcia_loop_tuple LINUX_BACKPORT(pcmcia_loop_tuple)
+int pcmcia_loop_tuple(struct pcmcia_device *p_dev, cisdata_t code,
+ int (*loop_tuple) (struct pcmcia_device *p_dev,
+ tuple_t *tuple,
+ void *priv_data),
+ void *priv_data);
+
+#define pccard_loop_tuple LINUX_BACKPORT(pccard_loop_tuple)
+int pccard_loop_tuple(struct pcmcia_socket *s, unsigned int function,
+ cisdata_t code, cisparse_t *parse, void *priv_data,
+ int (*loop_tuple) (tuple_t *tuple,
+ cisparse_t *parse,
+ void *priv_data));
+#endif /* < 2.6.33 */
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
+#ifdef pcmcia_parse_tuple
+#undef pcmcia_parse_tuple
+#define pcmcia_parse_tuple(tuple, parse) pccard_parse_tuple(tuple, parse)
+#endif
+
+/* From : include/pcmcia/ds.h */
+/* loop CIS entries for valid configuration */
+#define pcmcia_loop_config LINUX_BACKPORT(pcmcia_loop_config)
+int pcmcia_loop_config(struct pcmcia_device *p_dev,
+ int (*conf_check) (struct pcmcia_device *p_dev,
+ cistpl_cftable_entry_t *cfg,
+ cistpl_cftable_entry_t *dflt,
+ unsigned int vcc,
+ void *priv_data),
+ void *priv_data);
+#endif
+
+#endif /* __BACKPORT_PCMCIA_DS_H */