Lines Matching refs:pi
40 #define PPCSTRUCT(pi) ((Interface *)(pi->private)) argument
59 static int bpck6_read_regr(PIA *pi, int cont, int reg) in bpck6_read_regr() argument
68 out=ppc6_rd_port(PPCSTRUCT(pi),cont?reg|8:reg); in bpck6_read_regr()
72 static void bpck6_write_regr(PIA *pi, int cont, int reg, int val) in bpck6_write_regr() argument
77 ppc6_wr_port(PPCSTRUCT(pi),cont?reg|8:reg,(u8)val); in bpck6_write_regr()
81 static void bpck6_write_block( PIA *pi, char * buf, int len ) in bpck6_write_block() argument
83 ppc6_wr_port16_blk(PPCSTRUCT(pi),ATAPI_DATA,buf,(u32)len>>1); in bpck6_write_block()
86 static void bpck6_read_block( PIA *pi, char * buf, int len ) in bpck6_read_block() argument
88 ppc6_rd_port16_blk(PPCSTRUCT(pi),ATAPI_DATA,buf,(u32)len>>1); in bpck6_read_block()
91 static void bpck6_connect ( PIA *pi ) in bpck6_connect() argument
98 if(pi->mode >=2) in bpck6_connect()
100 PPCSTRUCT(pi)->mode=4+pi->mode-2; in bpck6_connect()
102 else if(pi->mode==1) in bpck6_connect()
104 PPCSTRUCT(pi)->mode=3; in bpck6_connect()
108 PPCSTRUCT(pi)->mode=1; in bpck6_connect()
111 ppc6_open(PPCSTRUCT(pi)); in bpck6_connect()
112 ppc6_wr_extout(PPCSTRUCT(pi),0x3); in bpck6_connect()
115 static void bpck6_disconnect ( PIA *pi ) in bpck6_disconnect() argument
121 ppc6_wr_extout(PPCSTRUCT(pi),0x0); in bpck6_disconnect()
122 ppc6_close(PPCSTRUCT(pi)); in bpck6_disconnect()
125 static int bpck6_test_port ( PIA *pi ) /* check for 8-bit port */ in bpck6_test_port() argument
130 ((struct pardevice*)(pi->pardev))->port->modes, in bpck6_test_port()
131 ((struct pardevice *)(pi->pardev))->port->base); in bpck6_test_port()
135 PPCSTRUCT(pi)->ppc_id=pi->unit; in bpck6_test_port()
136 PPCSTRUCT(pi)->lpt_addr=pi->port; in bpck6_test_port()
139 if(((struct pardevice *)(pi->pardev))->port->modes & in bpck6_test_port()
145 else if(((struct pardevice *)(pi->pardev))->port->modes & in bpck6_test_port()
157 static int bpck6_probe_unit ( PIA *pi ) in bpck6_probe_unit() argument
163 printk(KERN_DEBUG "PROBE UNIT %x on port:%x\n",pi->unit,pi->port); in bpck6_probe_unit()
167 PPCSTRUCT(pi)->ppc_id=pi->unit; in bpck6_probe_unit()
170 PPCSTRUCT(pi)->mode=1; in bpck6_probe_unit()
172 out=ppc6_open(PPCSTRUCT(pi)); in bpck6_probe_unit()
181 ppc6_close(PPCSTRUCT(pi)); in bpck6_probe_unit()
198 static void bpck6_log_adapter( PIA *pi, char * scratch, int verbose ) in bpck6_log_adapter() argument
203 printk("%s: BACKPACK Protocol Driver V"BACKPACK_VERSION"\n",pi->device); in bpck6_log_adapter()
204 printk("%s: Copyright 2001 by Micro Solutions, Inc., DeKalb IL.\n",pi->device); in bpck6_log_adapter()
206 pi->device,BACKPACK_VERSION,pi->port); in bpck6_log_adapter()
207 printk("%s: Unit: %d Mode:%d (%s) Delay %d\n",pi->device, in bpck6_log_adapter()
208 pi->unit,pi->mode,mode_string[pi->mode],pi->delay); in bpck6_log_adapter()
211 static int bpck6_init_proto(PIA *pi) in bpck6_init_proto() argument
216 pi->private = (unsigned long)p; in bpck6_init_proto()
220 printk(KERN_ERR "%s: ERROR COULDN'T ALLOCATE MEMORY\n", pi->device); in bpck6_init_proto()
224 static void bpck6_release_proto(PIA *pi) in bpck6_release_proto() argument
226 kfree((void *)(pi->private)); in bpck6_release_proto()