diff options
Diffstat (limited to 'include/pcmcia/cs.h')
-rw-r--r-- | include/pcmcia/cs.h | 165 |
1 files changed, 1 insertions, 164 deletions
diff --git a/include/pcmcia/cs.h b/include/pcmcia/cs.h index 45d84b275789..904468a191ef 100644 --- a/include/pcmcia/cs.h +++ b/include/pcmcia/cs.h | |||
@@ -28,72 +28,16 @@ typedef struct conf_reg_t { | |||
28 | #define CS_WRITE 2 | 28 | #define CS_WRITE 2 |
29 | 29 | ||
30 | /* for AdjustResourceInfo */ | 30 | /* for AdjustResourceInfo */ |
31 | typedef struct adjust_t { | ||
32 | u_int Action; | ||
33 | u_int Resource; | ||
34 | u_int Attributes; | ||
35 | union { | ||
36 | struct memory { | ||
37 | u_long Base; | ||
38 | u_long Size; | ||
39 | } memory; | ||
40 | struct io { | ||
41 | ioaddr_t BasePort; | ||
42 | ioaddr_t NumPorts; | ||
43 | u_int IOAddrLines; | ||
44 | } io; | ||
45 | struct irq { | ||
46 | u_int IRQ; | ||
47 | } irq; | ||
48 | } resource; | ||
49 | } adjust_t; | ||
50 | |||
51 | /* Action field */ | 31 | /* Action field */ |
52 | #define REMOVE_MANAGED_RESOURCE 1 | 32 | #define REMOVE_MANAGED_RESOURCE 1 |
53 | #define ADD_MANAGED_RESOURCE 2 | 33 | #define ADD_MANAGED_RESOURCE 2 |
54 | #define GET_FIRST_MANAGED_RESOURCE 3 | 34 | |
55 | #define GET_NEXT_MANAGED_RESOURCE 4 | ||
56 | /* Resource field */ | ||
57 | #define RES_MEMORY_RANGE 1 | ||
58 | #define RES_IO_RANGE 2 | ||
59 | #define RES_IRQ 3 | ||
60 | /* Attribute field */ | ||
61 | #define RES_IRQ_TYPE 0x03 | ||
62 | #define RES_IRQ_TYPE_EXCLUSIVE 0 | ||
63 | #define RES_IRQ_TYPE_TIME 1 | ||
64 | #define RES_IRQ_TYPE_DYNAMIC 2 | ||
65 | #define RES_IRQ_CSC 0x04 | ||
66 | #define RES_SHARED 0x08 | ||
67 | #define RES_RESERVED 0x10 | ||
68 | #define RES_ALLOCATED 0x20 | ||
69 | #define RES_REMOVED 0x40 | ||
70 | 35 | ||
71 | typedef struct event_callback_args_t { | 36 | typedef struct event_callback_args_t { |
72 | struct pcmcia_device *client_handle; | 37 | struct pcmcia_device *client_handle; |
73 | void *client_data; | 38 | void *client_data; |
74 | } event_callback_args_t; | 39 | } event_callback_args_t; |
75 | 40 | ||
76 | /* for GetConfigurationInfo */ | ||
77 | typedef struct config_info_t { | ||
78 | u_char Function; | ||
79 | u_int Attributes; | ||
80 | u_int Vcc, Vpp1, Vpp2; | ||
81 | u_int IntType; | ||
82 | u_int ConfigBase; | ||
83 | u_char Status, Pin, Copy, Option, ExtStatus; | ||
84 | u_int Present; | ||
85 | u_int CardValues; | ||
86 | u_int AssignedIRQ; | ||
87 | u_int IRQAttributes; | ||
88 | ioaddr_t BasePort1; | ||
89 | ioaddr_t NumPorts1; | ||
90 | u_int Attributes1; | ||
91 | ioaddr_t BasePort2; | ||
92 | ioaddr_t NumPorts2; | ||
93 | u_int Attributes2; | ||
94 | u_int IOAddrLines; | ||
95 | } config_info_t; | ||
96 | |||
97 | /* For CardValues field */ | 41 | /* For CardValues field */ |
98 | #define CV_OPTION_VALUE 0x01 | 42 | #define CV_OPTION_VALUE 0x01 |
99 | #define CV_STATUS_VALUE 0x02 | 43 | #define CV_STATUS_VALUE 0x02 |
@@ -257,22 +201,6 @@ typedef struct win_req_t { | |||
257 | #define WIN_BAR_MASK 0xe000 | 201 | #define WIN_BAR_MASK 0xe000 |
258 | #define WIN_BAR_SHIFT 13 | 202 | #define WIN_BAR_SHIFT 13 |
259 | 203 | ||
260 | /* Attributes for RegisterClient -- UNUSED -- */ | ||
261 | #define INFO_MASTER_CLIENT 0x01 | ||
262 | #define INFO_IO_CLIENT 0x02 | ||
263 | #define INFO_MTD_CLIENT 0x04 | ||
264 | #define INFO_MEM_CLIENT 0x08 | ||
265 | #define MAX_NUM_CLIENTS 3 | ||
266 | |||
267 | #define INFO_CARD_SHARE 0x10 | ||
268 | #define INFO_CARD_EXCL 0x20 | ||
269 | |||
270 | typedef struct cs_status_t { | ||
271 | u_char Function; | ||
272 | event_t CardState; | ||
273 | event_t SocketState; | ||
274 | } cs_status_t; | ||
275 | |||
276 | typedef struct error_info_t { | 204 | typedef struct error_info_t { |
277 | int func; | 205 | int func; |
278 | int retcode; | 206 | int retcode; |
@@ -308,95 +236,4 @@ typedef struct error_info_t { | |||
308 | #define CS_EVENT_3VCARD 0x200000 | 236 | #define CS_EVENT_3VCARD 0x200000 |
309 | #define CS_EVENT_XVCARD 0x400000 | 237 | #define CS_EVENT_XVCARD 0x400000 |
310 | 238 | ||
311 | /* Return codes */ | ||
312 | #define CS_SUCCESS 0x00 | ||
313 | #define CS_BAD_ADAPTER 0x01 | ||
314 | #define CS_BAD_ATTRIBUTE 0x02 | ||
315 | #define CS_BAD_BASE 0x03 | ||
316 | #define CS_BAD_EDC 0x04 | ||
317 | #define CS_BAD_IRQ 0x06 | ||
318 | #define CS_BAD_OFFSET 0x07 | ||
319 | #define CS_BAD_PAGE 0x08 | ||
320 | #define CS_READ_FAILURE 0x09 | ||
321 | #define CS_BAD_SIZE 0x0a | ||
322 | #define CS_BAD_SOCKET 0x0b | ||
323 | #define CS_BAD_TYPE 0x0d | ||
324 | #define CS_BAD_VCC 0x0e | ||
325 | #define CS_BAD_VPP 0x0f | ||
326 | #define CS_BAD_WINDOW 0x11 | ||
327 | #define CS_WRITE_FAILURE 0x12 | ||
328 | #define CS_NO_CARD 0x14 | ||
329 | #define CS_UNSUPPORTED_FUNCTION 0x15 | ||
330 | #define CS_UNSUPPORTED_MODE 0x16 | ||
331 | #define CS_BAD_SPEED 0x17 | ||
332 | #define CS_BUSY 0x18 | ||
333 | #define CS_GENERAL_FAILURE 0x19 | ||
334 | #define CS_WRITE_PROTECTED 0x1a | ||
335 | #define CS_BAD_ARG_LENGTH 0x1b | ||
336 | #define CS_BAD_ARGS 0x1c | ||
337 | #define CS_CONFIGURATION_LOCKED 0x1d | ||
338 | #define CS_IN_USE 0x1e | ||
339 | #define CS_NO_MORE_ITEMS 0x1f | ||
340 | #define CS_OUT_OF_RESOURCE 0x20 | ||
341 | #define CS_BAD_HANDLE 0x21 | ||
342 | |||
343 | #define CS_BAD_TUPLE 0x40 | ||
344 | |||
345 | #ifdef __KERNEL__ | ||
346 | |||
347 | /* | ||
348 | * The main Card Services entry point | ||
349 | */ | ||
350 | |||
351 | enum service { | ||
352 | AccessConfigurationRegister, AddSocketServices, | ||
353 | AdjustResourceInfo, CheckEraseQueue, CloseMemory, CopyMemory, | ||
354 | DeregisterClient, DeregisterEraseQueue, GetCardServicesInfo, | ||
355 | GetClientInfo, GetConfigurationInfo, GetEventMask, | ||
356 | GetFirstClient, GetFirstPartion, GetFirstRegion, GetFirstTuple, | ||
357 | GetNextClient, GetNextPartition, GetNextRegion, GetNextTuple, | ||
358 | GetStatus, GetTupleData, MapLogSocket, MapLogWindow, MapMemPage, | ||
359 | MapPhySocket, MapPhyWindow, ModifyConfiguration, ModifyWindow, | ||
360 | OpenMemory, ParseTuple, ReadMemory, RegisterClient, | ||
361 | RegisterEraseQueue, RegisterMTD, RegisterTimer, | ||
362 | ReleaseConfiguration, ReleaseExclusive, ReleaseIO, ReleaseIRQ, | ||
363 | ReleaseSocketMask, ReleaseWindow, ReplaceSocketServices, | ||
364 | RequestConfiguration, RequestExclusive, RequestIO, RequestIRQ, | ||
365 | RequestSocketMask, RequestWindow, ResetCard, ReturnSSEntry, | ||
366 | SetEventMask, SetRegion, ValidateCIS, VendorSpecific, | ||
367 | WriteMemory, BindDevice, BindMTD, ReportError, | ||
368 | SuspendCard, ResumeCard, EjectCard, InsertCard, ReplaceCIS, | ||
369 | GetFirstWindow, GetNextWindow, GetMemPage | ||
370 | }; | ||
371 | |||
372 | struct pcmcia_socket; | ||
373 | |||
374 | int pcmcia_access_configuration_register(struct pcmcia_device *p_dev, conf_reg_t *reg); | ||
375 | int pcmcia_get_configuration_info(struct pcmcia_device *p_dev, config_info_t *config); | ||
376 | int pcmcia_get_mem_page(window_handle_t win, memreq_t *req); | ||
377 | int pcmcia_map_mem_page(window_handle_t win, memreq_t *req); | ||
378 | int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod); | ||
379 | int pcmcia_release_window(window_handle_t win); | ||
380 | int pcmcia_request_configuration(struct pcmcia_device *p_dev, config_req_t *req); | ||
381 | int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req); | ||
382 | int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req); | ||
383 | int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req, window_handle_t *wh); | ||
384 | int pcmcia_suspend_card(struct pcmcia_socket *skt); | ||
385 | int pcmcia_resume_card(struct pcmcia_socket *skt); | ||
386 | int pcmcia_eject_card(struct pcmcia_socket *skt); | ||
387 | int pcmcia_insert_card(struct pcmcia_socket *skt); | ||
388 | int pccard_reset_card(struct pcmcia_socket *skt); | ||
389 | |||
390 | struct pcmcia_device * pcmcia_dev_present(struct pcmcia_device *p_dev); | ||
391 | void pcmcia_disable_device(struct pcmcia_device *p_dev); | ||
392 | |||
393 | struct pcmcia_socket * pcmcia_get_socket(struct pcmcia_socket *skt); | ||
394 | void pcmcia_put_socket(struct pcmcia_socket *skt); | ||
395 | |||
396 | /* compatibility functions */ | ||
397 | #define pcmcia_reset_card(p_dev, req) \ | ||
398 | pccard_reset_card(p_dev->socket) | ||
399 | |||
400 | #endif /* __KERNEL__ */ | ||
401 | |||
402 | #endif /* _LINUX_CS_H */ | 239 | #endif /* _LINUX_CS_H */ |