Lines Matching refs:pi

33 #define PC			pi->private
49 static int bpck_read_regr( PIA *pi, int cont, int regr ) in bpck_read_regr() argument
55 switch (pi->mode) { in bpck_read_regr()
80 static void bpck_write_regr( PIA *pi, int cont, int regr, int val ) in bpck_write_regr() argument
86 switch (pi->mode) { in bpck_write_regr()
106 #define WR(r,v) bpck_write_regr(pi,2,r,v)
107 #define RR(r) (bpck_read_regr(pi,2,r))
109 static void bpck_write_block( PIA *pi, char * buf, int count ) in bpck_write_block() argument
113 switch (pi->mode) { in bpck_write_block()
150 static void bpck_read_block( PIA *pi, char * buf, int count ) in bpck_read_block() argument
154 switch (pi->mode) { in bpck_read_block()
197 static int bpck_probe_unit ( PIA *pi ) in bpck_probe_unit() argument
202 id = pi->unit; in bpck_probe_unit()
220 static void bpck_connect ( PIA *pi ) in bpck_connect() argument
222 { pi->saved_r0 = r0(); in bpck_connect()
223 w0(0xff-pi->unit); w2(4); w0(pi->unit); in bpck_connect()
227 switch (pi->mode) { in bpck_connect()
244 if (pi->devtype == PI_PCD) { in bpck_connect()
254 static void bpck_disconnect ( PIA *pi ) in bpck_disconnect() argument
257 if (pi->mode >= 2) { w2(9); w2(0); } else t2(2); in bpck_disconnect()
258 w2(0x4c); w0(pi->saved_r0); in bpck_disconnect()
261 static void bpck_force_spp ( PIA *pi ) in bpck_force_spp() argument
265 { pi->saved_r0 = r0(); in bpck_force_spp()
266 w0(0xff-pi->unit); w2(4); w0(pi->unit); in bpck_force_spp()
274 w2(0x4c); w0(pi->saved_r0); in bpck_force_spp()
279 static int bpck_test_proto( PIA *pi, char * scratch, int verbose ) in bpck_test_proto() argument
284 bpck_force_spp(pi); in bpck_test_proto()
286 switch (pi->mode) { in bpck_test_proto()
288 case 0: bpck_connect(pi); in bpck_test_proto()
296 bpck_disconnect(pi); in bpck_test_proto()
299 case 1: bpck_connect(pi); in bpck_test_proto()
304 bpck_disconnect(pi); in bpck_test_proto()
309 case 4: om = pi->mode; in bpck_test_proto()
310 pi->mode = 0; in bpck_test_proto()
311 bpck_connect(pi); in bpck_test_proto()
314 bpck_disconnect(pi); in bpck_test_proto()
316 pi->mode = om; in bpck_test_proto()
317 bpck_connect(pi); in bpck_test_proto()
320 switch (pi->mode) { in bpck_test_proto()
331 bpck_disconnect(pi); in bpck_test_proto()
339 pi->device,pi->port,pi->unit,pi->mode); in bpck_test_proto()
349 static void bpck_read_eeprom ( PIA *pi, char * buf ) in bpck_read_eeprom() argument
353 bpck_force_spp(pi); in bpck_read_eeprom()
355 om = pi->mode; od = pi->delay; in bpck_read_eeprom()
356 pi->mode = 0; pi->delay = 6; in bpck_read_eeprom()
358 bpck_connect(pi); in bpck_read_eeprom()
388 bpck_disconnect(pi); in bpck_read_eeprom()
391 bpck_connect(pi); in bpck_read_eeprom()
394 bpck_disconnect(pi); in bpck_read_eeprom()
397 pi->mode = om; pi->delay = od; in bpck_read_eeprom()
400 static int bpck_test_port ( PIA *pi ) /* check for 8-bit port */ in bpck_test_port() argument
419 static void bpck_log_adapter( PIA *pi, char * scratch, int verbose ) in bpck_log_adapter() argument
428 bpck_read_eeprom(pi,scratch); in bpck_log_adapter()
435 printk("%s: bpck EEPROM: %64.64s\n",pi->device,scratch); in bpck_log_adapter()
436 printk("%s: %64.64s\n",pi->device,&scratch[64]); in bpck_log_adapter()
441 pi->device,BPCK_VERSION,&scratch[110],pi->unit); in bpck_log_adapter()
442 printk(" at 0x%x, mode %d (%s), delay %d\n",pi->port, in bpck_log_adapter()
443 pi->mode,mode_string[pi->mode],pi->delay); in bpck_log_adapter()