~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
Linux/include/pcmcia/ss.h

Version: ~ [ 2.4.0 ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * ss.h 1.28 2000/06/12 21:55:40
  3  *
  4  * The contents of this file are subject to the Mozilla Public License
  5  * Version 1.1 (the "License"); you may not use this file except in
  6  * compliance with the License. You may obtain a copy of the License
  7  * at http://www.mozilla.org/MPL/
  8  *
  9  * Software distributed under the License is distributed on an "AS IS"
 10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
 11  * the License for the specific language governing rights and
 12  * limitations under the License. 
 13  *
 14  * The initial developer of the original code is David A. Hinds
 15  * <dahinds@users.sourceforge.net>.  Portions created by David A. Hinds
 16  * are Copyright (C) 1999 David A. Hinds.  All Rights Reserved.
 17  *
 18  * Alternatively, the contents of this file may be used under the
 19  * terms of the GNU Public License version 2 (the "GPL"), in which
 20  * case the provisions of the GPL are applicable instead of the
 21  * above.  If you wish to allow the use of your version of this file
 22  * only under the terms of the GPL and not to allow others to use
 23  * your version of this file under the MPL, indicate your decision by
 24  * deleting the provisions above and replace them with the notice and
 25  * other provisions required by the GPL.  If you do not delete the
 26  * provisions above, a recipient may use your version of this file
 27  * under either the MPL or the GPL.
 28  */
 29 
 30 #ifndef _LINUX_SS_H
 31 #define _LINUX_SS_H
 32 
 33 /* Definitions for card status flags for GetStatus */
 34 #define SS_WRPROT       0x0001
 35 #define SS_CARDLOCK     0x0002
 36 #define SS_EJECTION     0x0004
 37 #define SS_INSERTION    0x0008
 38 #define SS_BATDEAD      0x0010
 39 #define SS_BATWARN      0x0020
 40 #define SS_READY        0x0040
 41 #define SS_DETECT       0x0080
 42 #define SS_POWERON      0x0100
 43 #define SS_GPI          0x0200
 44 #define SS_STSCHG       0x0400
 45 #define SS_CARDBUS      0x0800
 46 #define SS_3VCARD       0x1000
 47 #define SS_XVCARD       0x2000
 48 #define SS_PENDING      0x4000
 49 
 50 /* for InquireSocket */
 51 typedef struct socket_cap_t {
 52     u_int       features;
 53     u_int       irq_mask;
 54     u_int       map_size;
 55     u_char      pci_irq;
 56     struct pci_dev *cb_dev;
 57     struct bus_operations *bus;
 58 } socket_cap_t;
 59 
 60 /* InquireSocket capabilities */
 61 #define SS_CAP_PAGE_REGS        0x0001
 62 #define SS_CAP_VIRTUAL_BUS      0x0002
 63 #define SS_CAP_MEM_ALIGN        0x0004
 64 #define SS_CAP_STATIC_MAP       0x0008
 65 #define SS_CAP_PCCARD           0x4000
 66 #define SS_CAP_CARDBUS          0x8000
 67 
 68 /* for GetSocket, SetSocket */
 69 typedef struct socket_state_t {
 70     u_int       flags;
 71     u_int       csc_mask;
 72     u_char      Vcc, Vpp;
 73     u_char      io_irq;
 74 } socket_state_t;
 75 
 76 extern socket_state_t dead_socket;
 77 
 78 /* Socket configuration flags */
 79 #define SS_PWR_AUTO     0x0010
 80 #define SS_IOCARD       0x0020
 81 #define SS_RESET        0x0040
 82 #define SS_DMA_MODE     0x0080
 83 #define SS_SPKR_ENA     0x0100
 84 #define SS_OUTPUT_ENA   0x0200
 85 #define SS_DEBOUNCED    0x0400  /* Tell driver that the debounce delay has ended */
 86 
 87 /* Flags for I/O port and memory windows */
 88 #define MAP_ACTIVE      0x01
 89 #define MAP_16BIT       0x02
 90 #define MAP_AUTOSZ      0x04
 91 #define MAP_0WS         0x08
 92 #define MAP_WRPROT      0x10
 93 #define MAP_ATTRIB      0x20
 94 #define MAP_USE_WAIT    0x40
 95 #define MAP_PREFETCH    0x80
 96 
 97 /* Use this just for bridge windows */
 98 #define MAP_IOSPACE     0x20
 99 
100 typedef struct pccard_io_map {
101     u_char      map;
102     u_char      flags;
103     u_short     speed;
104     u_short     start, stop;
105 } pccard_io_map;
106 
107 typedef struct pccard_mem_map {
108     u_char      map;
109     u_char      flags;
110     u_short     speed;
111     u_long      sys_start, sys_stop;
112     u_int       card_start;
113 } pccard_mem_map;
114 
115 typedef struct cb_bridge_map {
116     u_char      map;
117     u_char      flags;
118     u_int       start, stop;
119 } cb_bridge_map;
120 
121 /*
122  * Socket operations.
123  */
124 struct pccard_operations {
125         int (*init)(unsigned int sock);
126         int (*suspend)(unsigned int sock);
127         int (*register_callback)(unsigned int sock, void (*handler)(void *, unsigned int), void * info);
128         int (*inquire_socket)(unsigned int sock, socket_cap_t *cap);
129         int (*get_status)(unsigned int sock, u_int *value);
130         int (*get_socket)(unsigned int sock, socket_state_t *state);
131         int (*set_socket)(unsigned int sock, socket_state_t *state);
132         int (*get_io_map)(unsigned int sock, struct pccard_io_map *io);
133         int (*set_io_map)(unsigned int sock, struct pccard_io_map *io);
134         int (*get_mem_map)(unsigned int sock, struct pccard_mem_map *mem);
135         int (*set_mem_map)(unsigned int sock, struct pccard_mem_map *mem);
136         void (*proc_setup)(unsigned int sock, struct proc_dir_entry *base);
137 };
138 
139 /*
140  *  Calls to set up low-level "Socket Services" drivers
141  */
142 extern int register_ss_entry(int nsock, struct pccard_operations *ops);
143 extern void unregister_ss_entry(struct pccard_operations *ops);
144 
145 #endif /* _LINUX_SS_H */
146 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.