diff options
Diffstat (limited to 'include/pcmcia/ds.h')
-rw-r--r-- | include/pcmcia/ds.h | 94 |
1 files changed, 34 insertions, 60 deletions
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h index a2be80b9a095..ee148573c114 100644 --- a/include/pcmcia/ds.h +++ b/include/pcmcia/ds.h | |||
@@ -34,6 +34,7 @@ | |||
34 | struct pcmcia_socket; | 34 | struct pcmcia_socket; |
35 | struct pcmcia_device; | 35 | struct pcmcia_device; |
36 | struct config_t; | 36 | struct config_t; |
37 | struct net_device; | ||
37 | 38 | ||
38 | /* dynamic device IDs for PCMCIA device drivers. See | 39 | /* dynamic device IDs for PCMCIA device drivers. See |
39 | * Documentation/pcmcia/driver.txt for details. | 40 | * Documentation/pcmcia/driver.txt for details. |
@@ -81,7 +82,7 @@ struct pcmcia_device { | |||
81 | /* the hardware "function" device; certain subdevices can | 82 | /* the hardware "function" device; certain subdevices can |
82 | * share one hardware "function" device. */ | 83 | * share one hardware "function" device. */ |
83 | u8 func; | 84 | u8 func; |
84 | struct config_t* function_config; | 85 | struct config_t *function_config; |
85 | 86 | ||
86 | struct list_head socket_device_list; | 87 | struct list_head socket_device_list; |
87 | 88 | ||
@@ -120,14 +121,14 @@ struct pcmcia_device { | |||
120 | u16 manf_id; | 121 | u16 manf_id; |
121 | u16 card_id; | 122 | u16 card_id; |
122 | 123 | ||
123 | char * prod_id[4]; | 124 | char *prod_id[4]; |
124 | 125 | ||
125 | u64 dma_mask; | 126 | u64 dma_mask; |
126 | struct device dev; | 127 | struct device dev; |
127 | 128 | ||
128 | #ifdef CONFIG_PCMCIA_IOCTL | 129 | #ifdef CONFIG_PCMCIA_IOCTL |
129 | /* device driver wanted by cardmgr */ | 130 | /* device driver wanted by cardmgr */ |
130 | struct pcmcia_driver * cardmgr; | 131 | struct pcmcia_driver *cardmgr; |
131 | #endif | 132 | #endif |
132 | 133 | ||
133 | /* data private to drivers */ | 134 | /* data private to drivers */ |
@@ -137,65 +138,39 @@ struct pcmcia_device { | |||
137 | #define to_pcmcia_dev(n) container_of(n, struct pcmcia_device, dev) | 138 | #define to_pcmcia_dev(n) container_of(n, struct pcmcia_device, dev) |
138 | #define to_pcmcia_drv(n) container_of(n, struct pcmcia_driver, drv) | 139 | #define to_pcmcia_drv(n) container_of(n, struct pcmcia_driver, drv) |
139 | 140 | ||
140 | /* deprecated -- don't use! */ | ||
141 | #define handle_to_dev(handle) (handle->dev) | ||
142 | 141 | ||
143 | 142 | /* | |
144 | /* (deprecated) error reporting by PCMCIA devices. Use dev_printk() | 143 | * CIS access. |
145 | * or dev_dbg() directly in the driver, without referring to pcmcia_error_func() | 144 | * |
146 | * and/or pcmcia_error_ret() for those functions will go away soon. | 145 | * Please use the following functions to access CIS tuples: |
147 | */ | 146 | * - pcmcia_get_tuple() |
148 | enum service { | 147 | * - pcmcia_loop_tuple() |
149 | AccessConfigurationRegister, AddSocketServices, | 148 | * - pcmcia_get_mac_from_cis() |
150 | AdjustResourceInfo, CheckEraseQueue, CloseMemory, CopyMemory, | 149 | * |
151 | DeregisterClient, DeregisterEraseQueue, GetCardServicesInfo, | 150 | * To parse a tuple_t, pcmcia_parse_tuple() exists. Its interface |
152 | GetClientInfo, GetConfigurationInfo, GetEventMask, | 151 | * might change in future. |
153 | GetFirstClient, GetFirstPartion, GetFirstRegion, GetFirstTuple, | ||
154 | GetNextClient, GetNextPartition, GetNextRegion, GetNextTuple, | ||
155 | GetStatus, GetTupleData, MapLogSocket, MapLogWindow, MapMemPage, | ||
156 | MapPhySocket, MapPhyWindow, ModifyConfiguration, ModifyWindow, | ||
157 | OpenMemory, ParseTuple, ReadMemory, RegisterClient, | ||
158 | RegisterEraseQueue, RegisterMTD, RegisterTimer, | ||
159 | ReleaseConfiguration, ReleaseExclusive, ReleaseIO, ReleaseIRQ, | ||
160 | ReleaseSocketMask, ReleaseWindow, ReplaceSocketServices, | ||
161 | RequestConfiguration, RequestExclusive, RequestIO, RequestIRQ, | ||
162 | RequestSocketMask, RequestWindow, ResetCard, ReturnSSEntry, | ||
163 | SetEventMask, SetRegion, ValidateCIS, VendorSpecific, | ||
164 | WriteMemory, BindDevice, BindMTD, ReportError, | ||
165 | SuspendCard, ResumeCard, EjectCard, InsertCard, ReplaceCIS, | ||
166 | GetFirstWindow, GetNextWindow, GetMemPage | ||
167 | }; | ||
168 | const char *pcmcia_error_func(int func); | ||
169 | const char *pcmcia_error_ret(int ret); | ||
170 | |||
171 | #define cs_error(p_dev, func, ret) \ | ||
172 | { \ | ||
173 | dev_printk(KERN_NOTICE, &p_dev->dev, \ | ||
174 | "%s : %s\n", \ | ||
175 | pcmcia_error_func(func), \ | ||
176 | pcmcia_error_ret(ret)); \ | ||
177 | } | ||
178 | |||
179 | /* CIS access. | ||
180 | * Use the pcmcia_* versions in PCMCIA drivers | ||
181 | */ | 152 | */ |
182 | int pcmcia_parse_tuple(tuple_t *tuple, cisparse_t *parse); | ||
183 | 153 | ||
184 | int pccard_get_first_tuple(struct pcmcia_socket *s, unsigned int function, | 154 | /* get the very first CIS entry of type @code. Note that buf is pointer |
185 | tuple_t *tuple); | 155 | * to u8 *buf; and that you need to kfree(buf) afterwards. */ |
186 | #define pcmcia_get_first_tuple(p_dev, tuple) \ | 156 | size_t pcmcia_get_tuple(struct pcmcia_device *p_dev, cisdata_t code, |
187 | pccard_get_first_tuple(p_dev->socket, p_dev->func, tuple) | 157 | u8 **buf); |
188 | 158 | ||
189 | int pccard_get_next_tuple(struct pcmcia_socket *s, unsigned int function, | 159 | /* loop over CIS entries */ |
190 | tuple_t *tuple); | 160 | int pcmcia_loop_tuple(struct pcmcia_device *p_dev, cisdata_t code, |
191 | #define pcmcia_get_next_tuple(p_dev, tuple) \ | 161 | int (*loop_tuple) (struct pcmcia_device *p_dev, |
192 | pccard_get_next_tuple(p_dev->socket, p_dev->func, tuple) | 162 | tuple_t *tuple, |
163 | void *priv_data), | ||
164 | void *priv_data); | ||
193 | 165 | ||
194 | int pccard_get_tuple_data(struct pcmcia_socket *s, tuple_t *tuple); | 166 | /* get the MAC address from CISTPL_FUNCE */ |
195 | #define pcmcia_get_tuple_data(p_dev, tuple) \ | 167 | int pcmcia_get_mac_from_cis(struct pcmcia_device *p_dev, |
196 | pccard_get_tuple_data(p_dev->socket, tuple) | 168 | struct net_device *dev); |
197 | 169 | ||
198 | 170 | ||
171 | /* parse a tuple_t */ | ||
172 | int pcmcia_parse_tuple(tuple_t *tuple, cisparse_t *parse); | ||
173 | |||
199 | /* loop CIS entries for valid configuration */ | 174 | /* loop CIS entries for valid configuration */ |
200 | int pcmcia_loop_config(struct pcmcia_device *p_dev, | 175 | int pcmcia_loop_config(struct pcmcia_device *p_dev, |
201 | int (*conf_check) (struct pcmcia_device *p_dev, | 176 | int (*conf_check) (struct pcmcia_device *p_dev, |
@@ -221,12 +196,11 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req); | |||
221 | int pcmcia_request_configuration(struct pcmcia_device *p_dev, | 196 | int pcmcia_request_configuration(struct pcmcia_device *p_dev, |
222 | config_req_t *req); | 197 | config_req_t *req); |
223 | 198 | ||
224 | int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req, | 199 | int pcmcia_request_window(struct pcmcia_device *p_dev, win_req_t *req, |
225 | window_handle_t *wh); | 200 | window_handle_t *wh); |
226 | int pcmcia_release_window(window_handle_t win); | 201 | int pcmcia_release_window(struct pcmcia_device *p_dev, window_handle_t win); |
227 | 202 | int pcmcia_map_mem_page(struct pcmcia_device *p_dev, window_handle_t win, | |
228 | int pcmcia_get_mem_page(window_handle_t win, memreq_t *req); | 203 | memreq_t *req); |
229 | int pcmcia_map_mem_page(window_handle_t win, memreq_t *req); | ||
230 | 204 | ||
231 | int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod); | 205 | int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod); |
232 | void pcmcia_disable_device(struct pcmcia_device *p_dev); | 206 | void pcmcia_disable_device(struct pcmcia_device *p_dev); |