Re: Return of PENDING status to SCSI driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> This is bulshit. Get your act together babe. You are hacking and deriving from
>  GPLed code. You are legally bind by that.
>
>  But you are welcome to remove any lowlevel rocket science from your driver
>  and just post the Linux relevant things. Infact why don't you start with a
>  demo driver that just emulates in SW IO transfers close to what your driver
>  will do. scsi_debug is a good place to look.
>
>
>  > But Still I am confused with return status (to SCSI layer) for the
>  > command while it is in progress, to get the next command. Is it some
>  > thing like PENDING?
>  >
>
>
> Look in scsi_debug enable some prints. It queues and completes cmnds
>  asynchronously. Look in Alan's other mail I think you are hit with the
>  usb queue_command posting the commands to a thread. This is unique to
>  usb.
>
>  > -RD
>
>
>  Boaz
>

At this stage, I can not reveal the complete code without my client’s
permission. But the entire code will be made public (According to GPL)
once driver is completed.

But here I am pasting the template structure code that I am using in my driver.

struct scsi_host_template usb_stor_host_template = {
	/* basic userland interface stuff */
	.name =				"usb-storage",
	.proc_name =			"usb-storage",
	.proc_info =			proc_info,
	.info =				host_info,

	/* command interface -- queued only */
	.queuecommand =			queuecommand,

	/* error and abort handlers */
	.eh_abort_handler =		command_abort,
	.eh_device_reset_handler =	device_reset,
	.eh_bus_reset_handler =		bus_reset,

	/* queue commands only, only one command per LUN */
	.can_queue =			5,
	.cmd_per_lun =			5,

	/* unknown initiator id */
	.this_id =			-1,

	.slave_alloc =			slave_alloc,
	.slave_configure =		slave_configure,

	/* lots of sg segments can be handled */
	.sg_tablesize =			SG_ALL,

	/* limit the total size of a transfer to 120 KB */
	.max_sectors =                  240,

	/* merge commands... this seems to help performance, but
	 * periodically someone should test to see which setting is more
	 * optimal.
	 */
	.use_clustering =		1,

	/* emulated HBA */
	.emulated =			5,

	/* we do our own delay after a device or bus reset */
	.skip_settle_delay =		1,

	/* sysfs device attributes */
	.sdev_attrs =			sysfs_device_attr_list,

	/* module management */
	.module =			THIS_MODULE
};


Here I am giving some portion of the data structure us_data I am using

struct us_data {
	
	.......
	
	/* SCSI interfaces */
	struct scsi_cmnd	*srb[5];		 /* current srb		*/
	unsigned int		tag[5];		 /* current dCBWTag	*/

	...continued.

}

If I call void (*done)(struct scsi_cmnd *) call back immediately after
receiving a command, will I get another command ?


Regards,
RD
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux