unsigned char max_selector = 0xB0; if (usbat_get_device_type(us) == USBAT_DEV_FLASH) max_selector = 0xA0; 
static int usbat_select_and_test_registers(struct us_data *us){	int selector;	unsigned char *status = us->iobuf;	unsigned char max_selector = 0xB0;	if (usbat_get_device_type(us) == USBAT_DEV_FLASH)		max_selector = 0xA0;	// try device = master, then device = slave.	for (selector = 0xA0; selector <= max_selector; selector += 0x10) {		if (usbat_get_device_type(us) == USBAT_DEV_HP8200 &&			usbat_write(us, USBAT_ATA, USBAT_ATA_DEVICE, selector) != 				USB_STOR_XFER_GOOD)			return USB_STOR_TRANSPORT_ERROR;		if (usbat_read(us, USBAT_ATA, USBAT_ATA_STATUS, status) != 				USB_STOR_XFER_GOOD)			return USB_STOR_TRANSPORT_ERROR;		if (usbat_read(us, USBAT_ATA, USBAT_ATA_DEVICE, status) != 				USB_STOR_XFER_GOOD)			return USB_STOR_TRANSPORT_ERROR;		if (usbat_read(us, USBAT_ATA, USBAT_ATA_LBA_ME, status) != 				USB_STOR_XFER_GOOD)			return USB_STOR_TRANSPORT_ERROR;		if (usbat_read(us, USBAT_ATA, USBAT_ATA_LBA_HI, status) != 				USB_STOR_XFER_GOOD)			return USB_STOR_TRANSPORT_ERROR;		if (usbat_write(us, USBAT_ATA, USBAT_ATA_LBA_ME, 0x55) != 				USB_STOR_XFER_GOOD)			return USB_STOR_TRANSPORT_ERROR;		if (usbat_write(us, USBAT_ATA, USBAT_ATA_LBA_HI, 0xAA) != 				USB_STOR_XFER_GOOD)			return USB_STOR_TRANSPORT_ERROR;		if (usbat_read(us, USBAT_ATA, USBAT_ATA_LBA_ME, status) != 				USB_STOR_XFER_GOOD)			return USB_STOR_TRANSPORT_ERROR;		if (usbat_read(us, USBAT_ATA, USBAT_ATA_LBA_ME, status) != 				USB_STOR_XFER_GOOD)			return USB_STOR_TRANSPORT_ERROR;	}	return USB_STOR_TRANSPORT_GOOD;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/68a6457edb8a64fdcc231a4fc5406f6e3f6c9b33/shuttle_usbat.c/buggy/drivers/usb/storage/shuttle_usbat.c