blob: 68b80084f83f28f787c591afd6f2fed87a4e075d [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * PCMCIA 16-bit compatibility functions
3 *
4 * The initial developer of the original code is David A. Hinds
5 * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds
6 * are Copyright (C) 1999 David A. Hinds. All Rights Reserved.
7 *
8 * Copyright (C) 2004 Dominik Brodowski
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 *
14 */
15
16#include <linux/config.h>
17#include <linux/module.h>
18#include <linux/init.h>
19
20#define IN_CARD_SERVICES
21#include <pcmcia/version.h>
22#include <pcmcia/cs_types.h>
23#include <pcmcia/cs.h>
24#include <pcmcia/bulkmem.h>
25#include <pcmcia/cistpl.h>
26#include <pcmcia/ds.h>
27#include <pcmcia/ss.h>
28
29#include "cs_internal.h"
30
31int pcmcia_get_first_tuple(client_handle_t handle, tuple_t *tuple)
32{
33 struct pcmcia_socket *s;
34 if (CHECK_HANDLE(handle))
35 return CS_BAD_HANDLE;
36 s = SOCKET(handle);
37 return pccard_get_first_tuple(s, handle->Function, tuple);
38}
39EXPORT_SYMBOL(pcmcia_get_first_tuple);
40
41int pcmcia_get_next_tuple(client_handle_t handle, tuple_t *tuple)
42{
43 struct pcmcia_socket *s;
44 if (CHECK_HANDLE(handle))
45 return CS_BAD_HANDLE;
46 s = SOCKET(handle);
47 return pccard_get_next_tuple(s, handle->Function, tuple);
48}
49EXPORT_SYMBOL(pcmcia_get_next_tuple);
50
51int pcmcia_get_tuple_data(client_handle_t handle, tuple_t *tuple)
52{
53 struct pcmcia_socket *s;
54 if (CHECK_HANDLE(handle))
55 return CS_BAD_HANDLE;
56 s = SOCKET(handle);
57 return pccard_get_tuple_data(s, tuple);
58}
59EXPORT_SYMBOL(pcmcia_get_tuple_data);
60
61int pcmcia_parse_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse)
62{
63 return pccard_parse_tuple(tuple, parse);
64}
65EXPORT_SYMBOL(pcmcia_parse_tuple);
66
67int pcmcia_validate_cis(client_handle_t handle, cisinfo_t *info)
68{
69 struct pcmcia_socket *s;
70 if (CHECK_HANDLE(handle))
71 return CS_BAD_HANDLE;
72 s = SOCKET(handle);
73 return pccard_validate_cis(s, handle->Function, info);
74}
75EXPORT_SYMBOL(pcmcia_validate_cis);
76
77int pcmcia_get_configuration_info(client_handle_t handle,
78 config_info_t *config)
79{
80 struct pcmcia_socket *s;
81
82 if ((CHECK_HANDLE(handle)) || !config)
83 return CS_BAD_HANDLE;
84 s = SOCKET(handle);
85 if (!s)
86 return CS_BAD_HANDLE;
87 return pccard_get_configuration_info(s, handle->Function, config);
88}
89EXPORT_SYMBOL(pcmcia_get_configuration_info);
90
91int pcmcia_reset_card(client_handle_t handle, client_req_t *req)
92{
93 struct pcmcia_socket *skt;
94
95 if (CHECK_HANDLE(handle))
96 return CS_BAD_HANDLE;
97 skt = SOCKET(handle);
98 if (!skt)
99 return CS_BAD_HANDLE;
100
101 return pccard_reset_card(skt);
102}
103EXPORT_SYMBOL(pcmcia_reset_card);
104
105int pcmcia_get_status(client_handle_t handle, cs_status_t *status)
106{
107 struct pcmcia_socket *s;
108 if (CHECK_HANDLE(handle))
109 return CS_BAD_HANDLE;
110 s = SOCKET(handle);
111 return pccard_get_status(s, handle->Function, status);
112}
113EXPORT_SYMBOL(pcmcia_get_status);
114
115int pcmcia_access_configuration_register(client_handle_t handle,
116 conf_reg_t *reg)
117{
118 struct pcmcia_socket *s;
119 if (CHECK_HANDLE(handle))
120 return CS_BAD_HANDLE;
121 s = SOCKET(handle);
122 return pccard_access_configuration_register(s, handle->Function, reg);
123}
124EXPORT_SYMBOL(pcmcia_access_configuration_register);
125