Lines Matching refs:pi
47 static int frpw_read_regr( PIA *pi, int cont, int regr )
63 static void frpw_write_regr( PIA *pi, int cont, int regr, int val)
74 static void frpw_read_block_int( PIA *pi, char * buf, int count, int regr )
78 switch(pi->mode) {
135 static void frpw_read_block( PIA *pi, char * buf, int count)
137 { frpw_read_block_int(pi,buf,count,0x08);
140 static void frpw_write_block( PIA *pi, char * buf, int count )
144 switch(pi->mode) {
173 static void frpw_connect ( PIA *pi )
175 { pi->saved_r0 = r0();
176 pi->saved_r2 = r2();
180 static void frpw_disconnect ( PIA *pi )
183 w0(pi->saved_r0);
184 w2(pi->saved_r2);
191 static int frpw_test_pnp ( PIA *pi )
202 olddelay = pi->delay;
203 pi->delay = 10;
205 pi->saved_r0 = r0();
206 pi->saved_r2 = r2();
212 pi->delay = olddelay;
213 w0(pi->saved_r0);
214 w2(pi->saved_r2);
219 /* We use the pi->private to remember the result of the PNP test.
224 static int frpw_test_proto( PIA *pi, char * scratch, int verbose )
229 if ((pi->private>>1) != pi->port)
230 pi->private = frpw_test_pnp(pi) + 2*pi->port;
232 if (((pi->private%2) == 0) && (pi->mode > 2)) {
235 pi->device, pi->mode);
239 if (((pi->private%2) == 1) && (pi->mode == 2)) {
242 pi->device);
246 frpw_connect(pi);
248 frpw_write_regr(pi,0,6,0xa0+j*0x10);
250 frpw_write_regr(pi,0,2,k^0xaa);
251 frpw_write_regr(pi,0,3,k^0x55);
252 if (frpw_read_regr(pi,0,2) != (k^0xaa)) e[j]++;
255 frpw_disconnect(pi);
257 frpw_connect(pi);
258 frpw_read_block_int(pi,scratch,512,0x10);
261 frpw_disconnect(pi);
265 pi->device,pi->port,(pi->private%2),pi->mode,e[0],e[1],r);
272 static void frpw_log_adapter( PIA *pi, char * scratch, int verbose )
277 printk("%s: frpw %s, Freecom (%s) adapter at 0x%x, ", pi->device,
278 FRPW_VERSION,((pi->private%2) == 0)?"Xilinx":"ASIC",pi->port);
279 printk("mode %d (%s), delay %d\n",pi->mode,
280 mode_string[pi->mode],pi->delay);