diff options
author | Keith Mange <keith.mange@microsoft.com> | 2015-08-13 11:43:49 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Odin.com> | 2015-08-27 01:41:35 -0400 |
commit | cb11feada9c049bc633831d3a5dcc50163f13b5e (patch) | |
tree | 78d249f375465e6d7eaa7890dcc22f09d5f643b2 | |
parent | 1a3631081d88180f5cc421711e40b4aecff8618e (diff) |
storvsc: use correct defaults for values determined by protocol negotiation
Use correct defaults for values determined by protocol negotiation,
instead of resetting them with every scsi controller.
Tested-by: Alex Ng <alexng@microsoft.com>
Signed-off-by: Keith Mange <keith.mange@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
-rw-r--r-- | drivers/scsi/storvsc_drv.c | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index d6a42c000048..8937ce92f875 100644 --- a/drivers/scsi/storvsc_drv.c +++ b/drivers/scsi/storvsc_drv.c | |||
@@ -151,19 +151,17 @@ struct hv_fc_wwn_packet { | |||
151 | 151 | ||
152 | /* | 152 | /* |
153 | * Sense buffer size changed in win8; have a run-time | 153 | * Sense buffer size changed in win8; have a run-time |
154 | * variable to track the size we should use. | 154 | * variable to track the size we should use. This value will |
155 | * likely change during protocol negotiation but it is valid | ||
156 | * to start by assuming pre-Win8. | ||
155 | */ | 157 | */ |
156 | static int sense_buffer_size; | 158 | static int sense_buffer_size = PRE_WIN8_STORVSC_SENSE_BUFFER_SIZE; |
157 | 159 | ||
158 | /* | 160 | /* |
159 | * The size of the vmscsi_request has changed in win8. The | 161 | * The storage protocol version is determined during the |
160 | * additional size is because of new elements added to the | 162 | * initial exchange with the host. It will indicate which |
161 | * structure. These elements are valid only when we are talking | 163 | * storage functionality is available in the host. |
162 | * to a win8 host. | 164 | */ |
163 | * Track the correction to size we need to apply. | ||
164 | */ | ||
165 | |||
166 | static int vmscsi_size_delta; | ||
167 | static int vmstor_proto_version; | 165 | static int vmstor_proto_version; |
168 | 166 | ||
169 | struct vmscsi_win8_extension { | 167 | struct vmscsi_win8_extension { |
@@ -209,6 +207,17 @@ struct vmscsi_request { | |||
209 | 207 | ||
210 | 208 | ||
211 | /* | 209 | /* |
210 | * The size of the vmscsi_request has changed in win8. The | ||
211 | * additional size is because of new elements added to the | ||
212 | * structure. These elements are valid only when we are talking | ||
213 | * to a win8 host. | ||
214 | * Track the correction to size we need to apply. This value | ||
215 | * will likely change during protocol negotiation but it is | ||
216 | * valid to start by assuming pre-Win8. | ||
217 | */ | ||
218 | static int vmscsi_size_delta = sizeof(struct vmscsi_win8_extension); | ||
219 | |||
220 | /* | ||
212 | * The list of storage protocols in order of preference. | 221 | * The list of storage protocols in order of preference. |
213 | */ | 222 | */ |
214 | struct vmstor_protocol { | 223 | struct vmstor_protocol { |
@@ -1810,14 +1819,10 @@ static int storvsc_probe(struct hv_device *device, | |||
1810 | */ | 1819 | */ |
1811 | 1820 | ||
1812 | if (vmbus_proto_version < VERSION_WIN8) { | 1821 | if (vmbus_proto_version < VERSION_WIN8) { |
1813 | sense_buffer_size = PRE_WIN8_STORVSC_SENSE_BUFFER_SIZE; | ||
1814 | vmscsi_size_delta = sizeof(struct vmscsi_win8_extension); | ||
1815 | max_luns_per_target = STORVSC_IDE_MAX_LUNS_PER_TARGET; | 1822 | max_luns_per_target = STORVSC_IDE_MAX_LUNS_PER_TARGET; |
1816 | max_targets = STORVSC_IDE_MAX_TARGETS; | 1823 | max_targets = STORVSC_IDE_MAX_TARGETS; |
1817 | max_channels = STORVSC_IDE_MAX_CHANNELS; | 1824 | max_channels = STORVSC_IDE_MAX_CHANNELS; |
1818 | } else { | 1825 | } else { |
1819 | sense_buffer_size = POST_WIN7_STORVSC_SENSE_BUFFER_SIZE; | ||
1820 | vmscsi_size_delta = 0; | ||
1821 | max_luns_per_target = STORVSC_MAX_LUNS_PER_TARGET; | 1826 | max_luns_per_target = STORVSC_MAX_LUNS_PER_TARGET; |
1822 | max_targets = STORVSC_MAX_TARGETS; | 1827 | max_targets = STORVSC_MAX_TARGETS; |
1823 | max_channels = STORVSC_MAX_CHANNELS; | 1828 | max_channels = STORVSC_MAX_CHANNELS; |