Пример #1
0
static int zoran_read_proc(char *buffer, char **start, off_t offset, int size, int *eof, void *data)
{
#ifdef CONFIG_PROC_FS
	int len = 0;
	off_t begin = 0;

	int i;
	struct zoran *zr;

	zr = (struct zoran *) data;
	DEBUG2(printk(KERN_INFO "%s: read_proc: buffer=%x, offset=%d, size=%d, data=%x\n", zr->name, (int) buffer, (int) offset, size, (int) data));
	*eof = 1;
	PRINT_PROC("ZR36067 registers:");
	for (i = 0; i < 0x130; i += 4) {
		if (!(i % 16)) {
			PRINT_PROC("\n%03X", i);
		}
		PRINT_PROC(" %08X ", btread(i));
	}
	PRINT_PROC("\n");
	if (offset >= len + begin) {
		return 0;
	}
	*start = buffer + begin - offset;
	return ((size < begin + len - offset) ? size : begin + len - offset);
#endif
	return 0;
}
Пример #2
0
static int stram_proc_show(struct seq_file *m, void *v)
{
	BLOCK *p;

	PRINT_PROC("Total ST-RAM:      %8u kB\n",
			   (stram_end - stram_start) >> 10);
	PRINT_PROC( "Allocated regions:\n" );
	for( p = alloc_list; p; p = p->next ) {
		PRINT_PROC("0x%08lx-0x%08lx: %s (",
			   virt_to_phys(p->start),
			   virt_to_phys(p->start+p->size-1),
			   p->owner);
		if (p->flags & BLOCK_GFP)
			PRINT_PROC( "page-alloced)\n" );
		else
			PRINT_PROC( "??)\n" );
	}

	return 0;
}
static int
spi_proc_infos(char *buffer, int *len, off_t *begin, off_t offset, int size)
{
	int i;
	int rx_depth, tx_depth;

        PRINT_PROC("PFS168 SPI driver v%d.%d:\n",
		   PFS168_SPI_MUX_VERS >> 8,
		   PFS168_SPI_MUX_VERS & 0xff);

	PRINT_PROC("bytes: in %lu, out %lu\n",
		   stats.bytes_in, stats.bytes_out);

	PRINT_PROC("frames: in %lu, out %lu\n",
		   stats.frames_in, stats.frames_out);

	PRINT_PROC("errors: crc %lu, len %lu, memory %lu\n",
		   stats.bad_crc, stats.bad_len, stats.no_mem);

	PRINT_PROC("io:\n");

	for (i = 0; i < 4; i++) {
		char *what = "";

		switch (i) {
		case 0: what = "CTL"; break;
		case 1: what = "MDB"; break;
		case 2: what = "I2C"; break;
		case 3: what = "CCR"; break;
		}
		PRINT_PROC("%s - reads %lu, writes %lu, overflows %lu\n",
			   what, stats.reads[i], stats.writes[i],
			   stats.qfulls[i]);
	}

	PRINT_PROC("msg: seq sent %d, acked %d\n",
		   msg_seq_sent, msg_seq_acked);

	PRINT_PROC("     out %lu, retrans %lu, ack %lu, nak %lu\n",
		   stats.msg_out, stats.retrans,
		   stats.ack_in, stats.nak_in);

	pfs168_spi_get_fifo_state(&rx_depth, &tx_depth);

	PRINT_PROC("spi: state %d, fifo depth - rx %d, tx %d\n",
		   pfs168_spi_get_rx_state(),
		   rx_depth, tx_depth);

        return 1;
}
Пример #4
0
int get_stram_list( char *buf )
{
	int len = 0;
	BLOCK *p;

	PRINT_PROC("Total ST-RAM:      %8u kB\n",
			   (stram_end - stram_start) >> 10);
	PRINT_PROC( "Allocated regions:\n" );
	for( p = alloc_list; p; p = p->next ) {
		if (len + 50 >= PAGE_SIZE)
			break;
		PRINT_PROC("0x%08lx-0x%08lx: %s (",
			   virt_to_phys(p->start),
			   virt_to_phys(p->start+p->size-1),
			   p->owner);
		if (p->flags & BLOCK_GFP)
			PRINT_PROC( "page-alloced)\n" );
		else
			PRINT_PROC( "??)\n" );
	}

	return( len );
}