Changeset 1268 for branches/monitor-improvement/csctapi/ifd_sci.c
- Timestamp:
- 01/17/10 18:02:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/monitor-improvement/csctapi/ifd_sci.c
r1240 r1268 20 20 #include "../globals.h" 21 21 22 #include "ifd_towitoko.h"23 22 #define IFD_TOWITOKO_ATR_TIMEOUT 800 24 23 … … 142 141 } 143 142 144 #endif 143 int Sci_Activate () 144 { 145 #ifdef DEBUG_IFD 146 printf ("IFD: Activating card\n"); 147 #endif 148 #ifdef SCI_DEV 149 if(reader[ridx].typ == R_INTERNAL) 150 { 151 int in; 152 153 #if defined(TUXBOX) && (defined(MIPSEL) || defined(PPC) || defined(SH4)) 154 if(ioctl(reader[ridx].handle, IOCTL_GET_IS_CARD_PRESENT, &in)<0) 155 #else 156 if(ioctl(reader[ridx].handle, IOCTL_GET_IS_CARD_ACTIVATED, &in)<0) 157 #endif 158 return ERROR; 159 160 if(in) 161 { 162 struct timespec req_ts; 163 req_ts.tv_sec = 0; 164 req_ts.tv_nsec = 50000000; 165 nanosleep (&req_ts, NULL); 166 return OK; 167 } 168 else 169 return ERROR; 170 } 171 else 172 #endif 173 { 174 return OK; 175 } 176 } 177 178 int Sci_Deactivate () 179 { 180 #ifdef DEBUG_IFD 181 printf ("IFD: Deactivating card\n"); 182 #endif 183 184 #ifdef SCI_DEV 185 if(reader[ridx].typ == R_INTERNAL) 186 { 187 int in; 188 189 #if defined(TUXBOX) && (defined(MIPSEL) || defined(PPC) || defined(SH4)) 190 if(ioctl(reader[ridx].handle, IOCTL_GET_IS_CARD_PRESENT, &in)<0) 191 #else 192 if(ioctl(reader[ridx].handle, IOCTL_GET_IS_CARD_ACTIVATED, &in)<0) 193 #endif 194 return ERROR; 195 196 if(in) 197 { 198 if(ioctl(reader[ridx].handle, IOCTL_SET_DEACTIVATE)<0) 199 return ERROR; 200 } 201 202 203 } 204 #endif 205 206 return OK; 207 } 208 209 #endif
Note:
See TracChangeset
for help on using the changeset viewer.