#include <stdlib.h>
#include <fcntl.h>
#include <machine/smb.h>

int
main (void)
{
	int i, j, fd;
	struct smbcmd cmd;
	unsigned char bdata = 0;

	memset(&cmd, 0, sizeof(cmd));
	cmd.data.byte_ptr = &bdata;

	fd = open("/dev/smb0", O_RDWR);
	for(  i = 0x2d;  i <= 0x2e;  i++  )  {
		cmd.slave = i;
		for(  j = 0x00;  j <= 0xff;  j++  )  {
			if(  j % 0x10 == 0x00  )  {
				printf("%02X%02X :", i, j);
			}
			cmd.cmd = j;
			if(  ioctl(fd, SMB_READB, (caddr_t)&cmd)  < 0  )  {
				printf(" XX");
			}  else  {
				printf(" %02X", bdata);
			}
			if(  j % 0x10 == 0x0f  )  {
				printf("\n");
			}
		}
	}
	close(fd);

	return 0;
}


