*len = sense_data_build(p, 0xf0, ILLEGAL_REQUEST,
*len = sense_data_build(p, 0x70, ILLEGAL_REQUEST,
static int report_luns(int tid, uint32_t unused, uint8_t *scb, uint8_t *p, int *len){	uint32_t lun;	uint32_t *data = (uint32_t *) p;	int idx, alen, oalen, rbuflen, nr_luns;	DIR *dir;	struct dirent *ent;	char buf[128];	int result = SAM_STAT_GOOD;	dir = opendir("/sys/class/stgt_device");	if (!dir) {		perror("can't open /sys/class/stgt_device\n");		exit(0);	}	alen = be32_to_cpu(*(uint32_t *)&scb[6]);	if (alen < 16) {		*len = sense_data_build(p, 0xf0, ILLEGAL_REQUEST,					0x24, 0);		result = SAM_STAT_CHECK_CONDITION;		goto out;	}	alen &= ~(8 - 1);	oalen = alen;	/* We'll set data[0] later. */	data[1] = 0;	alen -= 8;	rbuflen = 8192 - 8; /* FIXME */	idx = 2;	nr_luns = 0;	sprintf(buf, "device%d:", tid);	while ((ent = readdir(dir))) {		if (!strncmp(ent->d_name, buf, strlen(buf))) {			sscanf(ent->d_name, "device%d:%u", &tid, &lun);			data[idx++] = cpu_to_be32((0x3ff & lun) << 16 |						  ((lun > 0xff) ? (0x1 << 30) : 0));			data[idx++] = 0;			if (!(alen -= 8))				break;			if (!(rbuflen -= 8)) {				fprintf(stderr, "FIXME: too many luns\n");				exit(-1);			}			nr_luns++;		}	}	data[0] = cpu_to_be32(nr_luns * 8);	*len = min(oalen, nr_luns * 8 + 8);out:	closedir(dir);	return result;}