Lines Matching refs:pi

45 #define PPCSTRUCT(pi) ((PPC_STORAGE *)(pi->privptr))  argument
64 static int bpck6_read_regr(PIA *pi, int cont, int reg) in bpck6_read_regr() argument
73 out=ppc6_rd_port(PPCSTRUCT(pi),cont?reg|8:reg); in bpck6_read_regr()
77 static void bpck6_write_regr(PIA *pi, int cont, int reg, int val) in bpck6_write_regr() argument
82 ppc6_wr_port(PPCSTRUCT(pi),cont?reg|8:reg,(u8)val); in bpck6_write_regr()
86 static void bpck6_write_block( PIA *pi, char * buf, int len ) in bpck6_write_block() argument
88 ppc6_wr_port16_blk(PPCSTRUCT(pi),ATAPI_DATA,buf,(u32)len>>1); in bpck6_write_block()
91 static void bpck6_read_block( PIA *pi, char * buf, int len ) in bpck6_read_block() argument
93 ppc6_rd_port16_blk(PPCSTRUCT(pi),ATAPI_DATA,buf,(u32)len>>1); in bpck6_read_block()
96 static void bpck6_connect ( PIA *pi ) in bpck6_connect() argument
103 if(pi->mode >=2) in bpck6_connect()
105 PPCSTRUCT(pi)->mode=4+pi->mode-2; in bpck6_connect()
107 else if(pi->mode==1) in bpck6_connect()
109 PPCSTRUCT(pi)->mode=3; in bpck6_connect()
113 PPCSTRUCT(pi)->mode=1; in bpck6_connect()
116 ppc6_open(PPCSTRUCT(pi)); in bpck6_connect()
117 ppc6_wr_extout(PPCSTRUCT(pi),0x3); in bpck6_connect()
120 static void bpck6_disconnect ( PIA *pi ) in bpck6_disconnect() argument
126 ppc6_wr_extout(PPCSTRUCT(pi),0x0); in bpck6_disconnect()
127 ppc6_close(PPCSTRUCT(pi)); in bpck6_disconnect()
130 static int bpck6_test_port ( PIA *pi ) /* check for 8-bit port */ in bpck6_test_port() argument
135 ((struct pardevice*)(pi->pardev))->port->modes, in bpck6_test_port()
136 ((struct pardevice *)(pi->pardev))->port->base); in bpck6_test_port()
140 PPCSTRUCT(pi)->ppc_id=pi->unit; in bpck6_test_port()
141 PPCSTRUCT(pi)->lpt_addr=pi->port; in bpck6_test_port()
149 if(((struct pardevice *)(pi->pardev))->port->modes & in bpck6_test_port()
155 else if(((struct pardevice *)(pi->pardev))->port->modes & in bpck6_test_port()
172 static int bpck6_probe_unit ( PIA *pi ) in bpck6_probe_unit() argument
178 printk(KERN_DEBUG "PROBE UNIT %x on port:%x\n",pi->unit,pi->port); in bpck6_probe_unit()
182 PPCSTRUCT(pi)->ppc_id=pi->unit; in bpck6_probe_unit()
185 PPCSTRUCT(pi)->mode=1; in bpck6_probe_unit()
187 out=ppc6_open(PPCSTRUCT(pi)); in bpck6_probe_unit()
196 ppc6_close(PPCSTRUCT(pi)); in bpck6_probe_unit()
213 static void bpck6_log_adapter( PIA *pi, char * scratch, int verbose ) in bpck6_log_adapter() argument
218 printk("%s: BACKPACK Protocol Driver V"BACKPACK_VERSION"\n",pi->device); in bpck6_log_adapter()
219 printk("%s: Copyright 2001 by Micro Solutions, Inc., DeKalb IL.\n",pi->device); in bpck6_log_adapter()
221 pi->device,BACKPACK_VERSION,pi->port); in bpck6_log_adapter()
222 printk("%s: Unit: %d Mode:%d (%s) Delay %d\n",pi->device, in bpck6_log_adapter()
223 pi->unit,pi->mode,mode_string[pi->mode],pi->delay); in bpck6_log_adapter()
226 static void bpck6_init_proto(PIA *pi) in bpck6_init_proto() argument
229 pi->privptr=kmalloc(sizeof(PPC_STORAGE),GFP_KERNEL); in bpck6_init_proto()
231 if(pi->privptr==NULL) in bpck6_init_proto()
233 printk(KERN_ERR "%s: ERROR COULDN'T ALLOCATE MEMORY\n",pi->device); in bpck6_init_proto()
241 memset(pi->privptr, 0, sizeof(PPC_STORAGE)); in bpck6_init_proto()
244 static void bpck6_release_proto(PIA *pi) in bpck6_release_proto() argument
249 kfree(pi->privptr); in bpck6_release_proto()