FreeBSD/sys/dev/qlxgbe/ql_dbg.c
/*
 * Name: ql_dump_buf32
 * Function: dumps a buffer as 32 bit words
 */
ql_dump_buf32
Function: dumps a buffer as 32 bit words
ql_dump_buf32 Function : dumps a buffer as 32 bit words
void ql_dump_buf32(qla_host_t *ha, const char *msg, void *dbuf32, uint32_t len32)
{
        device_t dev;
	uint32_t i = 0;
	uint32_t *buf;
        dev = ha->pci_dev;
	buf = dbuf32;
	device_printf(dev, "%s: %s dump start\n", __func__, msg);
	while (len32 >= 4) {
		device_printf(dev,"0x%08x: 0x%08x 0x%08x 0x%08x 0x%08x\n",
			i, buf[0], buf[1], buf[2], buf[3]);
		i += 4 * 4;
		len32 -= 4;
		buf += 4;
	}
	switch (len32) {
	case 1:
		device_printf(dev,"0x%08x: 0x%08x\n", i, buf[0]);
		break;
	case 2:
		device_printf(dev,"0x%08x: 0x%08x 0x%08x\n", i, buf[0], buf[1]);
		break;
	case 3:
		device_printf(dev,"0x%08x: 0x%08x 0x%08x 0x%08x\n",
			i, buf[0], buf[1], buf[2]);
		break;
	default:
		break;
	}
	device_printf(dev, "%s: %s dump end\n", __func__, msg);
}
void ql_dump_buf32 ( qla_host_t * ha , const char * msg , void * dbuf32 , uint32_t len32 ) { device_t dev ; uint32_t i = 0 ; uint32_t * buf ; dev = ha -> pci_dev ; buf = dbuf32 ; device_printf ( dev , " \n " , __func__ , msg ) ; while ( len32 >= 4 ) { device_printf ( dev , " \n " , i , buf [ 0 ] , buf [ 1 ] , buf [ 2 ] , buf [ 3 ] ) ; i += 4 * 4 ; len32 -= 4 ; buf += 4 ; } switch ( len32 ) { 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 ; default : break ; } device_printf ( dev , " \n " , __func__ , msg ) ; }
Name: ql_dump_buf32
 Function: dumps a buffer as 32 bit words
Name : ql_dump_buf32 Function : dumps a buffer as 32 bit words