FreeBSD/sys/dev/qlxge/qls_dbg.c
/*
 * Name: qls_dump_buf16
 * Function: dumps a buffer as 16 bit words
 */
qls_dump_buf16
Function: dumps a buffer as 16 bit words
qls_dump_buf16 Function : dumps a buffer as 16 bit words
void
qls_dump_buf16(qla_host_t *ha, const char *msg, void *dbuf16, uint32_t len16)
{
        device_t dev;
	uint32_t i = 0;
	uint16_t *buf;
        dev = ha->pci_dev;
	buf = dbuf16;
	device_printf(dev, "%s: %s dump start\n", __func__, msg);
	while (len16 >= 8) {
		device_printf(dev,"0x%08x: 0x%04x 0x%04x 0x%04x 0x%04x"
			" 0x%04x 0x%04x 0x%04x 0x%04x\n", i, buf[0],
			buf[1], buf[2], buf[3], buf[4], buf[5], buf[6], buf[7]);
		i += 16;
		len16 -= 8;
		buf += 8;
	}
	switch (len16) {
	case 1:
		device_printf(dev,"0x%08x: 0x%04x\n", i, buf[0]);
		break;
	case 2:
		device_printf(dev,"0x%08x: 0x%04x 0x%04x\n", i, buf[0], buf[1]);
		break;
	case 3:
		device_printf(dev,"0x%08x: 0x%04x 0x%04x 0x%04x\n",
			i, buf[0], buf[1], buf[2]);
		break;
	case 4:
		device_printf(dev,"0x%08x: 0x%04x 0x%04x 0x%04x 0x%04x\n", i,
			buf[0], buf[1], buf[2], buf[3]);
		break;
	case 5:
		device_printf(dev,"0x%08x:"
			" 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x\n", i,
			buf[0], buf[1], buf[2], buf[3], buf[4]);
		break;
	case 6:
		device_printf(dev,"0x%08x:"
			" 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x\n", i,
			buf[0], buf[1], buf[2], buf[3], buf[4], buf[5]);
		break;
	case 7:
		device_printf(dev,"0x%04x: 0x%04x 0x%04x 0x%04x 0x%04x"
			" 0x%04x 0x%04x 0x%04x\n", i, buf[0], buf[1],
			buf[2], buf[3], buf[4], buf[5], buf[6]);
		break;
	default:
		break;
	}
	device_printf(dev, "%s: %s dump end\n", __func__, msg);
	return;
}
void qls_dump_buf16 ( qla_host_t * ha , const char * msg , void * dbuf16 , uint32_t len16 ) { device_t dev ; uint32_t i = 0 ; uint16_t * buf ; dev = ha -> pci_dev ; buf = dbuf16 ; device_printf ( dev , " \n " , __func__ , msg ) ; while ( len16 >= 8 ) { device_printf ( dev , " " " \n " , i , buf [ 0 ] , buf [ 1 ] , buf [ 2 ] , buf [ 3 ] , buf [ 4 ] , buf [ 5 ] , buf [ 6 ] , buf [ 7 ] ) ; i += 16 ; len16 -= 8 ; buf += 8 ; } switch ( len16 ) { case 1 : device_printf ( dev , " \n " , i , buf [ 0 ] ) ; break ; case 2 : device_printf ( dev , " \n " , i , buf [ 0 ] , buf [ 1 ] ) ; break ; case 3 : device_printf ( dev , " \n " , i , buf [ 0 ] , buf [ 1 ] , buf [ 2 ] ) ; break ; case 4 : device_printf ( dev , " \n " , i , buf [ 0 ] , buf [ 1 ] , buf [ 2 ] , buf [ 3 ] ) ; break ; case 5 : device_printf ( dev , " " " \n " , i , buf [ 0 ] , buf [ 1 ] , buf [ 2 ] , buf [ 3 ] , buf [ 4 ] ) ; break ; case 6 : device_printf ( dev , " " " \n " , i , buf [ 0 ] , buf [ 1 ] , buf [ 2 ] , buf [ 3 ] , buf [ 4 ] , buf [ 5 ] ) ; break ; case 7 : device_printf ( dev , " " " \n " , i , buf [ 0 ] , buf [ 1 ] , buf [ 2 ] , buf [ 3 ] , buf [ 4 ] , buf [ 5 ] , buf [ 6 ] ) ; break ; default : break ; } device_printf ( dev , " \n " , __func__ , msg ) ; return ; }
Name: qls_dump_buf16
 Function: dumps a buffer as 16 bit words
Name : qls_dump_buf16 Function : dumps a buffer as 16 bit words