[Stgt-devel] [Patch 1/2] Add MODE SENSE (6) & MODE SENSE (10) support

Mark Harvey markh794
Fri Jul 6 00:06:13 CEST 2007


On 7/5/07, FUJITA Tomonori <fujita.tomonori at lab.ntt.co.jp> wrote:
> Thanks a lot and sorry for the delay.
>
> From: Mark Harvey <markh794 at gmail.com>
> Subject: [Stgt-devel] [Patch 1/2] Add MODE SENSE (6) & MODE SENSE (10)  support
> Date: Sat, 30 Jun 2007 17:47:10 +1000
>
> > >From 4afa975c190c87fab099f52bcd95cafa608fcf96 Mon Sep 17 00:00:00 2001
> > From: Mark Harvey <markh794 at gmail.com>
> > Date: Sat, 30 Jun 2007 16:56:19 +1000
> > Subject: Initial commit of Dynamic MODE SENSE support
> >
> > Add support for:
> >  - MODE SENSE (6)
> >  - MODE SENSE (10)
> >
> > Add ability to add mode pages 'on the fly'. i.e. At setup time.
> >
> > Configuration/creation of mode pages via the 'tgtadm --params mode_page'
> >
> > Page data information is seperated by ':'
> > e.g.
> >  --params mode_page=10:1:11:2:0:0:0:0:0:0:0:2:0:0
> > Where '10' is mode page 10
> >       '1'  is the subpage
> >       '11' is the length of the page data (11 bytes of information follow)
>
> I keep this format but is the length necessary?

I added the length for two reasons.
 - Simplicity in figuring out how much data was going to be saved &
returned via MODE SENSE.
 - Sanity check. Make sure the user entered the correct mode page
length & data to match..

It is not necessary, I just thought the sanity check was a valid reason for it.


> > SBC & MMC devices set up some default pages at lu creation time.
> >
> > The example script 'scripts/tgt-core-test' contains an executable example.
> >
> > The 'doc/README.lu_configuration' updated for mode page informaiton.
> >
> > Signed-off-by: Mark Harvey <markh794 at gmail.com>
>
> I simplified the code slightly. I'll apply this if it works for you.


ACK

It works for me.

Many thanks.
Mark



More information about the stgt mailing list