Lines Matching defs:count
173 __le16 count;
187 #define set_desc_count(a,b)(a).count = cpu_to_le16((unsigned short)(b))
190 #define desc_count(a) (le16_to_cpu((a).count))
223 int port_count; /* count of ports on adapter */
439 static bool tx_load(struct slgt_info *info, const char *buf, unsigned int count);
496 static void trace_block(struct slgt_info *info, const char *data, int count, const char *label)
501 while(count) {
502 linecount = (count > 16) ? 16 : count;
515 count -= linecount;
528 printk("%d: count=%04X status=%04X\n",
529 i, le16_to_cpu(info->tbufs[i].count), le16_to_cpu(info->tbufs[i].status));
542 printk("%d: count=%04X status=%04X\n",
543 i, le16_to_cpu(info->rbufs[i].count), le16_to_cpu(info->rbufs[i].status));
577 const __u8 *data, char *flags, int count)
585 ld->ops->receive_buf(tty, data, flags, count);
617 DBGINFO(("%s open, old ref count = %d\n", info->device_name, info->port.count));
629 info->port.count++;
632 if (info->port.count == 1) {
651 if (tty->count == 1)
653 if(info->port.count)
654 info->port.count--;
667 DBGINFO(("%s close entry, count=%d\n", info->device_name, info->port.count));
684 DBGINFO(("%s close exit, count=%d\n", tty->driver->name, info->port.count));
702 info->port.count = 0;
758 const unsigned char *buf, int count)
767 DBGINFO(("%s write count=%d\n", info->device_name, count));
769 if (!info->tx_buf || (count > info->max_frame_size))
772 if (!count || tty->stopped || tty->hw_stopped)
784 if (tx_load(info, buf, count))
785 ret = count;
1256 * return count of bytes in transmit buffer
1261 int count;
1264 count = tbuf_bytes(info);
1265 DBGINFO(("%s chars_in_buffer()=%d\n", info->device_name, count));
1266 return count;
1360 if (info->port.count)
1455 if (info->port.count != 0 || info->netcount != 0) {
1539 if (info->port.count)
1660 * @size: count of data bytes in buf
1771 int i, count;
1779 count = desc_count(bufs[end]) - info->rbuf_index;
1782 DBGISR(("%s rx_async count=%d\n", info->device_name, count));
1783 DBGDATA(info, p, count, "rx");
1785 for(i=0 ; i < count; i+=2, p+=2) {
1809 if (i < count) {
2035 unsigned int count = info->rbuf_fill_count;
2048 info->rbufs[i].buf[count++] = (unsigned char)reg;
2051 info->rbufs[i].buf[count++] = (unsigned char)(reg >> 8);
2052 if (count == info->rbuf_fill_level || (reg & BIT10)) {
2054 set_desc_count(info->rbufs[i], count);
2056 info->rbuf_fill_count = count = 0;
2064 info->rbuf_fill_count = count;
2326 if ((port->port.count || port->netcount) &&
2851 * xctrl[16] 1 = enable terminal count, 0=disabled
2852 * xctrl[15:0] receive terminal count for fixed length packets
2853 * value is count minus one (0 = 1 byte packet)
2854 * when terminal count is reached, receiver
3196 * this loop, port->count is dropped by one, so that
3205 port->count--;
3240 port->count++;
3339 static int alloc_bufs(struct slgt_info *info, struct slgt_desc *bufs, int count)
3342 for (i=0; i < count; i++) {
3352 static void free_bufs(struct slgt_info *info, struct slgt_desc *bufs, int count)
3355 for (i=0; i < count; i++) {
3434 * global linked list of devices and increment the device count.
4697 unsigned int count;
4701 count = desc_count(info->rbufs[i]);
4708 count--;
4711 DBGDATA(info, info->rbufs[i].buf, count, "rx");
4712 DBGINFO(("rx_get_buf size=%d\n", count));
4713 if (count)
4715 info->flag_buf, count);
4726 info->tbufs[i].count = 0;
4735 unsigned int count = 0;
4742 ++count;
4747 /* if tx DMA active, last zero count buffer is in use */
4748 if (count && (rd_reg32(info, TDCSR) & BIT0))
4749 --count;
4751 return count;
4763 unsigned int count;
4768 * If count is zero (cleared by DMA controller after read),
4771 * Record buf_count of last buffer with zero count starting
4773 * copy of count and is not cleared by serial controller.
4778 count = desc_count(info->tbufs[i]);
4779 if (count)
4780 total_count += count;
4790 /* if tx DMA active, last zero count buffer is in use */
4794 /* add tx FIFO count = reg_value[15..8] */
4810 unsigned short count;
4826 * setting descriptor count of the first buffer.
4836 count = (unsigned short)((size > DMABUFSIZE) ? DMABUFSIZE : size);
4837 memcpy(d->buf, buf, count);
4839 size -= count;
4840 buf += count;
4852 /* set descriptor count for all but first buffer */
4854 set_desc_count(*d, count);
4855 d->buf_count = count;
4863 /* set first buffer count to make new data visible to DMA controller */
4879 static unsigned int count = ARRAY_SIZE(patterns);
4883 for (i=0 ; i < count ; i++) {
4885 wr_reg16(info, BDR, patterns[(i+1)%count]);
4887 (rd_reg16(info, BDR) != patterns[(i+1)%count])) {
4942 int count;
4945 count = desc_count(info->rbufs[0]);
4949 for( ; count ; count-=2, src+=2) {
4968 u16 count = TESTFRAMESIZE;
4984 for (count = 0; count < TESTFRAMESIZE; ++count)
4985 buf[count] = (unsigned char)count;
4994 tx_load(info, buf, count);
5007 if (!rc && (info->tmp_rbuf_count != count ||
5008 memcmp(buf, info->tmp_rbuf, count))) {