Lines Matching refs:dev
122 extern int pcbit_l2_write(struct pcbit_dev * dev, ulong msg, ushort refnum,
130 static __inline__ void log_state(struct pcbit_dev *dev) { in log_state() argument
132 (ulong) (dev->writeptr - dev->sh_mem)); in log_state()
134 (ulong) (dev->readptr - (dev->sh_mem + BANK2))); in log_state()
136 dev->rcv_seq, dev->send_seq, dev->unack_seq); in log_state()
142 struct pcbit_dev * dev; in chan2dev() local
147 if ((dev=dev_pcbit[i])) in chan2dev()
148 if (dev->b1 == chan || dev->b2 == chan) in chan2dev()
149 return dev; in chan2dev()
156 struct pcbit_dev * dev; in finddev() local
160 if ((dev=dev_pcbit[i])) in finddev()
161 if (dev->id == id) in finddev()
162 return dev; in finddev()
171 static __inline__ void pcbit_writeb(struct pcbit_dev *dev, unsigned char dt) in pcbit_writeb() argument
173 writeb(dt, dev->writeptr++); in pcbit_writeb()
174 if (dev->writeptr == dev->sh_mem + BANKLEN) in pcbit_writeb()
175 dev->writeptr = dev->sh_mem; in pcbit_writeb()
178 static __inline__ void pcbit_writew(struct pcbit_dev *dev, unsigned short dt) in pcbit_writew() argument
182 dist = BANKLEN - (dev->writeptr - dev->sh_mem); in pcbit_writew()
185 writew(dt, dev->writeptr); in pcbit_writew()
186 dev->writeptr = dev->sh_mem; in pcbit_writew()
189 writeb((u_char) (dt & 0x00ffU), dev->writeptr); in pcbit_writew()
190 dev->writeptr = dev->sh_mem; in pcbit_writew()
191 writeb((u_char) (dt >> 8), dev->writeptr++); in pcbit_writew()
194 writew(dt, dev->writeptr); in pcbit_writew()
195 dev->writeptr += 2; in pcbit_writew()
200 static __inline__ void memcpy_topcbit(struct pcbit_dev * dev, u_char * data, in memcpy_topcbit() argument
205 diff = len - (BANKLEN - (dev->writeptr - dev->sh_mem) ); in memcpy_topcbit()
209 memcpy_toio(dev->writeptr, data, len - diff); in memcpy_topcbit()
210 memcpy_toio(dev->sh_mem, data + (len - diff), diff); in memcpy_topcbit()
211 dev->writeptr = dev->sh_mem + diff; in memcpy_topcbit()
215 memcpy_toio(dev->writeptr, data, len); in memcpy_topcbit()
217 dev->writeptr += len; in memcpy_topcbit()
219 dev->writeptr = dev->sh_mem; in memcpy_topcbit()
223 static __inline__ unsigned char pcbit_readb(struct pcbit_dev *dev) in pcbit_readb() argument
227 val = readb(dev->readptr++); in pcbit_readb()
228 if (dev->readptr == dev->sh_mem + BANK2 + BANKLEN) in pcbit_readb()
229 dev->readptr = dev->sh_mem + BANK2; in pcbit_readb()
234 static __inline__ unsigned short pcbit_readw(struct pcbit_dev *dev) in pcbit_readw() argument
239 dist = BANKLEN - ( dev->readptr - (dev->sh_mem + BANK2 ) ); in pcbit_readw()
242 val = readw(dev->readptr); in pcbit_readw()
243 dev->readptr = dev->sh_mem + BANK2; in pcbit_readw()
246 val = readb(dev->readptr); in pcbit_readw()
247 dev->readptr = dev->sh_mem + BANK2; in pcbit_readw()
248 val = (readb(dev->readptr++) << 8) | val; in pcbit_readw()
251 val = readw(dev->readptr); in pcbit_readw()
252 dev->readptr += 2; in pcbit_readw()
258 static __inline__ void memcpy_frompcbit(struct pcbit_dev * dev, u_char * data, int len) in memcpy_frompcbit() argument
262 diff = len - (BANKLEN - (dev->readptr - (dev->sh_mem + BANK2) ) ); in memcpy_frompcbit()
265 memcpy_fromio(data, dev->readptr, len - diff); in memcpy_frompcbit()
266 memcpy_fromio(data + (len - diff), dev->sh_mem + BANK2 , diff); in memcpy_frompcbit()
267 dev->readptr = dev->sh_mem + BANK2 + diff; in memcpy_frompcbit()
271 memcpy_fromio(data, dev->readptr, len); in memcpy_frompcbit()
272 dev->readptr += len; in memcpy_frompcbit()
274 dev->readptr = dev->sh_mem + BANK2; in memcpy_frompcbit()