win-pvdrivers

view xenscsi/scsiport.c @ 382:ecfd4ddaaf3d

remove dead code
author Andy Grover <andy.grover@oracle.com>
date Wed Jul 09 12:35:41 2008 -0700 (2008-07-09)
parents a55d72ac422f
children
line source
1 /*
2 PV Drivers for Windows Xen HVM Domains
3 Copyright (C) 2007 James Harper
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
20 #include "xenscsi.h"
21 #include <scsi.h>
22 #include <ntddscsi.h>
23 #include <ntdddisk.h>
24 #include <stdlib.h>
25 #include <xen_public.h>
26 #include <io/xenbus.h>
27 #include <io/protocols.h>
29 #pragma warning(disable: 4127)
31 static vscsiif_shadow_t *
32 get_shadow_from_freelist(PXENSCSI_DEVICE_DATA xsdd)
33 {
34 if (xsdd->shadow_free == 0)
35 {
36 KdPrint((__DRIVER_NAME " No more shadow entries\n"));
37 return NULL;
38 }
39 xsdd->shadow_free--;
40 return &xsdd->shadows[xsdd->shadow_free_list[xsdd->shadow_free]];
41 }
43 static VOID
44 put_shadow_on_freelist(PXENSCSI_DEVICE_DATA xsdd, vscsiif_shadow_t *shadow)
45 {
46 xsdd->shadow_free_list[xsdd->shadow_free] = (USHORT)shadow->req.rqid;
47 shadow->Srb = NULL;
48 xsdd->shadow_free++;
49 }
51 static grant_ref_t
52 get_grant_from_freelist(PXENSCSI_DEVICE_DATA xsdd)
53 {
54 if (xsdd->grant_free == 0)
55 {
56 KdPrint((__DRIVER_NAME " No more grant refs\n"));
57 return (grant_ref_t)0x0FFFFFFF;
58 }
59 xsdd->grant_free--;
60 return xsdd->grant_free_list[xsdd->grant_free];
61 }
63 static VOID
64 put_grant_on_freelist(PXENSCSI_DEVICE_DATA xsdd, grant_ref_t grant)
65 {
66 xsdd->grant_free_list[xsdd->grant_free] = grant;
67 xsdd->grant_free++;
68 }
70 static BOOLEAN
71 XenScsi_HwScsiInterrupt(PVOID DeviceExtension)
72 {
73 PXENSCSI_DEVICE_DATA xsdd = (PXENSCSI_DEVICE_DATA)DeviceExtension;
74 PSCSI_REQUEST_BLOCK Srb;
75 RING_IDX i, rp;
76 int j;
77 vscsiif_response_t *rep;
78 int more_to_do = TRUE;
79 vscsiif_shadow_t *shadow;
80 ULONG remaining;
82 //KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
84 while (more_to_do)
85 {
86 rp = xsdd->ring.sring->rsp_prod;
87 KeMemoryBarrier();
88 for (i = xsdd->ring.rsp_cons; i != rp; i++)
89 {
90 rep = RING_GET_RESPONSE(&xsdd->ring, i);
91 shadow = &xsdd->shadows[rep->rqid];
92 KdPrint((__DRIVER_NAME " Operation complete - result = 0x%08x\n", rep->rslt));
93 Srb = shadow->Srb;
94 Srb->ScsiStatus = (UCHAR)rep->rslt;
95 if (rep->sense_len > 0 && Srb->SenseInfoBuffer != NULL)
96 {
97 memcpy(Srb->SenseInfoBuffer, rep->sense_buffer, min(Srb->SenseInfoBufferLength, rep->sense_len));
98 }
99 if (!rep->rslt)
100 {
101 Srb->SrbStatus = SRB_STATUS_SUCCESS;
102 }
103 else
104 {
105 KdPrint((__DRIVER_NAME " Xen Operation returned error (result = 0x%08x)\n", rep->rslt));
106 Srb->SrbStatus = SRB_STATUS_ERROR;
107 if (rep->sense_len > 0 && !(Srb->SrbFlags & SRB_FLAGS_DISABLE_AUTOSENSE) && Srb->SenseInfoBuffer != NULL)
108 {
109 Srb->SrbStatus |= SRB_STATUS_AUTOSENSE_VALID;
110 }
111 }
112 remaining = Srb->DataTransferLength;
113 for (j = 0; remaining != 0; j++)
114 {
115 xsdd->vectors.GntTbl_EndAccess(xsdd->vectors.context, shadow->req.seg[j].gref, TRUE);
116 put_grant_on_freelist(xsdd, shadow->req.seg[j].gref);
117 shadow->req.seg[j].gref = 0;
118 remaining -= shadow->req.seg[j].length;
119 }
120 put_shadow_on_freelist(xsdd, shadow);
121 ScsiPortNotification(RequestComplete, xsdd, Srb);
122 ScsiPortNotification(NextRequest, xsdd);
123 }
125 xsdd->ring.rsp_cons = i;
126 if (i != xsdd->ring.req_prod_pvt)
127 {
128 RING_FINAL_CHECK_FOR_RESPONSES(&xsdd->ring, more_to_do);
129 }
130 else
131 {
132 xsdd->ring.sring->rsp_event = i + 1;
133 more_to_do = FALSE;
134 }
135 }
137 //KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
139 return FALSE; /* we just don't know... */
140 }
142 static VOID
143 XenScsi_ParseBackendDevice(PXENSCSI_DEVICE_DATA xsdd, PCHAR value)
144 {
145 int i = 0;
146 int j = 0;
147 BOOLEAN scanning = TRUE;
149 while (scanning)
150 {
151 if (value[i] == 0)
152 scanning = FALSE;
153 if (value[i] == ':' || value[i] == 0)
154 {
155 value[i] = 0;
156 xsdd->host = xsdd->channel;
157 xsdd->channel = xsdd->id;
158 xsdd->id = xsdd->lun;
159 xsdd->lun = atoi(&value[j]);
160 j = i + 1;
161 }
162 i++;
163 }
164 KdPrint((__DRIVER_NAME " host = %d, channel = %d, id = %d, lun = %d\n",
165 xsdd->host, xsdd->channel, xsdd->id, xsdd->lun));
166 }
168 static ULONG
169 XenScsi_HwScsiFindAdapter(PVOID DeviceExtension, PVOID HwContext, PVOID BusInformation, PCHAR ArgumentString, PPORT_CONFIGURATION_INFORMATION ConfigInfo, PBOOLEAN Again)
170 {
171 ULONG i;
172 // PACCESS_RANGE AccessRange;
173 PXENSCSI_DEVICE_DATA xsdd = (PXENSCSI_DEVICE_DATA)DeviceExtension;
174 // ULONG status;
175 // PXENPCI_XEN_DEVICE_DATA XenDeviceData;
176 PACCESS_RANGE access_range;
177 PUCHAR ptr;
178 USHORT type;
179 PCHAR setting, value;
180 vscsiif_sring_t *sring;
182 UNREFERENCED_PARAMETER(HwContext);
183 UNREFERENCED_PARAMETER(BusInformation);
184 UNREFERENCED_PARAMETER(ArgumentString);
186 KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
187 KdPrint((__DRIVER_NAME " IRQL = %d\n", KeGetCurrentIrql()));
189 *Again = FALSE;
191 KdPrint((__DRIVER_NAME " BusInterruptLevel = %d\n", ConfigInfo->BusInterruptLevel));
192 KdPrint((__DRIVER_NAME " BusInterruptVector = %03x\n", ConfigInfo->BusInterruptVector));
194 if (ConfigInfo->NumberOfAccessRanges != 1)
195 {
196 KdPrint((__DRIVER_NAME " NumberOfAccessRanges = %d\n", ConfigInfo->NumberOfAccessRanges));
197 return SP_RETURN_BAD_CONFIG;
198 }
200 access_range = &((*(ConfigInfo->AccessRanges))[0]);
202 KdPrint((__DRIVER_NAME " RangeStart = %08x, RangeLength = %08x\n",
203 access_range->RangeStart.LowPart, access_range->RangeLength));
205 ptr = ScsiPortGetDeviceBase(
206 DeviceExtension,
207 ConfigInfo->AdapterInterfaceType,
208 ConfigInfo->SystemIoBusNumber,
209 access_range->RangeStart,
210 access_range->RangeLength,
211 !access_range->RangeInMemory);
212 //ptr = MmMapIoSpace(access_range->RangeStart, access_range->RangeLength, MmCached);
213 if (ptr == NULL)
214 {
215 KdPrint((__DRIVER_NAME " Unable to map range\n"));
216 KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
217 return SP_RETURN_BAD_CONFIG;
218 }
220 sring = NULL;
221 xsdd->event_channel = 0;
222 while((type = GET_XEN_INIT_RSP(&ptr, &setting, &value)) != XEN_INIT_TYPE_END)
223 {
224 switch(type)
225 {
226 case XEN_INIT_TYPE_RING: /* frontend ring */
227 KdPrint((__DRIVER_NAME " XEN_INIT_TYPE_RING - %s = %p\n", setting, value));
228 if (strcmp(setting, "ring-ref") == 0)
229 {
230 sring = (vscsiif_sring_t *)value;
231 FRONT_RING_INIT(&xsdd->ring, sring, PAGE_SIZE);
232 }
233 break;
234 case XEN_INIT_TYPE_EVENT_CHANNEL: /* frontend event channel */
235 case XEN_INIT_TYPE_EVENT_CHANNEL_IRQ: /* frontend event channel */
236 KdPrint((__DRIVER_NAME " XEN_INIT_TYPE_EVENT_CHANNEL - %s = %d\n", setting, PtrToUlong(value)));
237 if (strcmp(setting, "event-channel") == 0)
238 {
239 xsdd->event_channel = PtrToUlong(value);
240 }
241 break;
242 case XEN_INIT_TYPE_READ_STRING_BACK:
243 case XEN_INIT_TYPE_READ_STRING_FRONT:
244 KdPrint((__DRIVER_NAME " XEN_INIT_TYPE_READ_STRING - %s = %s\n", setting, value));
245 if (strcmp(setting, "b-dev") == 0)
246 {
247 XenScsi_ParseBackendDevice(xsdd, value);
248 }
249 break;
250 case XEN_INIT_TYPE_VECTORS:
251 KdPrint((__DRIVER_NAME " XEN_INIT_TYPE_VECTORS\n"));
252 if (((PXENPCI_VECTORS)value)->length != sizeof(XENPCI_VECTORS) ||
253 ((PXENPCI_VECTORS)value)->magic != XEN_DATA_MAGIC)
254 {
255 KdPrint((__DRIVER_NAME " vectors mismatch (magic = %08x, length = %d)\n",
256 ((PXENPCI_VECTORS)value)->magic, ((PXENPCI_VECTORS)value)->length));
257 KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
258 return SP_RETURN_BAD_CONFIG;
259 }
260 else
261 memcpy(&xsdd->vectors, value, sizeof(XENPCI_VECTORS));
262 break;
263 case XEN_INIT_TYPE_GRANT_ENTRIES:
264 KdPrint((__DRIVER_NAME " XEN_INIT_TYPE_GRANT_ENTRIES - %d\n", PtrToUlong(setting)));
265 xsdd->grant_entries = (USHORT)PtrToUlong(setting);
266 memcpy(&xsdd->grant_free_list, value, sizeof(grant_ref_t) * xsdd->grant_entries);
267 xsdd->grant_free = xsdd->grant_entries;
268 break;
269 default:
270 KdPrint((__DRIVER_NAME " XEN_INIT_TYPE_%d\n", type));
271 break;
272 }
273 }
274 #if 0
275 if (xsdd->device_type == XENSCSI_DEVICETYPE_UNKNOWN
276 || sring == NULL
277 || xsdd->event_channel == 0)
278 {
279 KdPrint((__DRIVER_NAME " Missing settings\n"));
280 KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
281 return SP_RETURN_BAD_CONFIG;
282 }
283 #endif
284 ConfigInfo->MaximumTransferLength = VSCSIIF_SG_TABLESIZE * PAGE_SIZE;
285 ConfigInfo->NumberOfPhysicalBreaks = VSCSIIF_SG_TABLESIZE - 1;
286 ConfigInfo->ScatterGather = TRUE;
287 ConfigInfo->AlignmentMask = 0;
288 ConfigInfo->NumberOfBuses = 1;
289 ConfigInfo->InitiatorBusId[0] = 1;
290 ConfigInfo->MaximumNumberOfLogicalUnits = 1;
291 ConfigInfo->MaximumNumberOfTargets = 2;
292 ConfigInfo->BufferAccessScsiPortControlled = TRUE;
293 if (ConfigInfo->Dma64BitAddresses == SCSI_DMA64_SYSTEM_SUPPORTED)
294 {
295 ConfigInfo->Master = TRUE;
296 ConfigInfo->Dma64BitAddresses = SCSI_DMA64_MINIPORT_SUPPORTED;
297 KdPrint((__DRIVER_NAME " Dma64BitAddresses supported\n"));
298 }
299 else
300 {
301 ConfigInfo->Master = FALSE;
302 KdPrint((__DRIVER_NAME " Dma64BitAddresses not supported\n"));
303 }
305 xsdd->shadow_free = 0;
306 memset(xsdd->shadows, 0, sizeof(vscsiif_shadow_t) * SHADOW_ENTRIES);
307 for (i = 0; i < SHADOW_ENTRIES; i++)
308 {
309 xsdd->shadows[i].req.rqid = (USHORT)i;
310 put_shadow_on_freelist(xsdd, &xsdd->shadows[i]);
311 }
313 KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
315 return SP_RETURN_FOUND;
316 }
318 static BOOLEAN
319 XenScsi_HwScsiInitialize(PVOID DeviceExtension)
320 {
321 //PXENSCSI_DEVICE_DATA xsdd = (PXENSCSI_DEVICE_DATA)DeviceExtension;
323 UNREFERENCED_PARAMETER(DeviceExtension);
325 KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
326 KdPrint((__DRIVER_NAME " IRQL = %d\n", KeGetCurrentIrql()));
328 KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
330 return TRUE;
331 }
333 static VOID
334 XenScsi_PutSrbOnRing(PXENSCSI_DEVICE_DATA xsdd, PSCSI_REQUEST_BLOCK Srb)
335 {
336 PUCHAR ptr;
337 PHYSICAL_ADDRESS physical_address;
338 PFN_NUMBER pfn;
339 //int i;
340 vscsiif_shadow_t *shadow;
341 int remaining;
343 // KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
345 shadow = get_shadow_from_freelist(xsdd);
346 ASSERT(shadow);
347 shadow->Srb = Srb;
348 shadow->req.cmd = VSCSIIF_CMND_SCSI;
349 memset(shadow->req.cmnd, 0, VSCSIIF_MAX_COMMAND_SIZE);
350 memcpy(shadow->req.cmnd, Srb->Cdb, Srb->CdbLength);
351 shadow->req.cmd_len = Srb->CdbLength;
352 shadow->req.id = (USHORT)xsdd->id;
353 shadow->req.lun = (USHORT)xsdd->lun;
354 shadow->req.channel = (USHORT)xsdd->channel;
355 if (Srb->DataTransferLength && (Srb->SrbFlags & SRB_FLAGS_DATA_IN) && (Srb->SrbFlags & SRB_FLAGS_DATA_OUT))
356 {
357 KdPrint((__DRIVER_NAME " Cmd = %02x, Length = %d, DMA_BIDIRECTIONAL\n", Srb->Cdb[0], Srb->DataTransferLength));
358 shadow->req.sc_data_direction = DMA_BIDIRECTIONAL;
359 }
360 else if (Srb->DataTransferLength && (Srb->SrbFlags & SRB_FLAGS_DATA_IN))
361 {
362 KdPrint((__DRIVER_NAME " Cmd = %02x, Length = %d, DMA_FROM_DEVICE\n", Srb->Cdb[0], Srb->DataTransferLength));
363 shadow->req.sc_data_direction = DMA_FROM_DEVICE;
364 }
365 else if (Srb->DataTransferLength && (Srb->SrbFlags & SRB_FLAGS_DATA_OUT))
366 {
367 KdPrint((__DRIVER_NAME " Cmd = %02x, Length = %d, DMA_TO_DEVICE\n", Srb->Cdb[0], Srb->DataTransferLength));
368 shadow->req.sc_data_direction = DMA_TO_DEVICE;
369 }
370 else
371 {
372 KdPrint((__DRIVER_NAME " Cmd = %02x, Length = %d, DMA_NONE\n", Srb->Cdb[0], Srb->DataTransferLength));
373 shadow->req.sc_data_direction = DMA_NONE;
374 }
375 //shadow->req.use_sg = (UINT8)((Srb->DataTransferLength + PAGE_SIZE - 1) >> PAGE_SHIFT);
376 shadow->req.request_bufflen = Srb->DataTransferLength;
378 remaining = Srb->DataTransferLength;
379 shadow->req.seg[0].offset = 0;
380 shadow->req.seg[0].length = 0;
382 ptr = Srb->DataBuffer;
384 for (shadow->req.use_sg = 0; remaining != 0; shadow->req.use_sg++)
385 {
386 physical_address = MmGetPhysicalAddress(ptr);
387 pfn = (ULONG)(physical_address.QuadPart >> PAGE_SHIFT);
388 shadow->req.seg[shadow->req.use_sg].gref = get_grant_from_freelist(xsdd);
389 ASSERT(shadow->req.seg[shadow->req.use_sg].gref);
390 xsdd->vectors.GntTbl_GrantAccess(xsdd->vectors.context, 0, (ULONG)pfn, 0, shadow->req.seg[shadow->req.use_sg].gref);
391 shadow->req.seg[shadow->req.use_sg].offset = (USHORT)(physical_address.LowPart & (PAGE_SIZE - 1));
392 shadow->req.seg[shadow->req.use_sg].length = (USHORT)min(PAGE_SIZE - shadow->req.seg[shadow->req.use_sg].offset, remaining);
393 remaining -= shadow->req.seg[shadow->req.use_sg].length;
394 ptr += shadow->req.seg[shadow->req.use_sg].length;
395 //KdPrint((__DRIVER_NAME " Page = %d, Offset = %d, Length = %d, Remaining = %d\n", shadow->req.use_sg, shadow->req.seg[shadow->req.use_sg].offset, shadow->req.seg[shadow->req.use_sg].length, remaining));
396 }
397 *RING_GET_REQUEST(&xsdd->ring, xsdd->ring.req_prod_pvt) = shadow->req;
398 xsdd->ring.req_prod_pvt++;
400 // KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
401 }
403 static BOOLEAN
404 XenScsi_HwScsiStartIo(PVOID DeviceExtension, PSCSI_REQUEST_BLOCK Srb)
405 {
406 PXENSCSI_DEVICE_DATA xsdd = DeviceExtension;
407 int notify;
409 //KdPrint((__DRIVER_NAME " --> HwScsiStartIo PathId = %d, TargetId = %d, Lun = %d\n", Srb->PathId, Srb->TargetId, Srb->Lun));
411 // KdPrint((__DRIVER_NAME " IRQL = %d\n", KeGetCurrentIrql()));
413 if (Srb->PathId != 0 || Srb->TargetId != 0)
414 {
415 Srb->SrbStatus = SRB_STATUS_NO_DEVICE;
416 ScsiPortNotification(RequestComplete, DeviceExtension, Srb);
417 ScsiPortNotification(NextRequest, DeviceExtension, NULL);
418 KdPrint((__DRIVER_NAME " --- HwScsiStartIo (Out of bounds)\n"));
419 return TRUE;
420 }
422 switch (Srb->Function)
423 {
424 case SRB_FUNCTION_EXECUTE_SCSI:
425 XenScsi_PutSrbOnRing(xsdd, Srb);
426 RING_PUSH_REQUESTS_AND_CHECK_NOTIFY(&xsdd->ring, notify);
427 if (notify)
428 xsdd->vectors.EvtChn_Notify(xsdd->vectors.context, xsdd->event_channel);
429 if (!xsdd->shadow_free)
430 ScsiPortNotification(NextRequest, DeviceExtension);
431 break;
432 case SRB_FUNCTION_IO_CONTROL:
433 KdPrint((__DRIVER_NAME " SRB_FUNCTION_IO_CONTROL\n"));
434 Srb->SrbStatus = SRB_STATUS_INVALID_REQUEST;
435 ScsiPortNotification(RequestComplete, DeviceExtension, Srb);
436 ScsiPortNotification(NextRequest, DeviceExtension, NULL);
437 break;
438 case SRB_FUNCTION_FLUSH:
439 KdPrint((__DRIVER_NAME " SRB_FUNCTION_FLUSH\n"));
440 Srb->SrbStatus = SRB_STATUS_INVALID_REQUEST;
441 ScsiPortNotification(RequestComplete, DeviceExtension, Srb);
442 ScsiPortNotification(NextRequest, DeviceExtension, NULL);
443 break;
444 default:
445 KdPrint((__DRIVER_NAME " Unhandled Srb->Function = %08X\n", Srb->Function));
446 Srb->SrbStatus = SRB_STATUS_INVALID_REQUEST;
447 ScsiPortNotification(RequestComplete, DeviceExtension, Srb);
448 ScsiPortNotification(NextRequest, DeviceExtension, NULL);
449 break;
450 }
452 //KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
453 return TRUE;
454 }
456 static BOOLEAN
457 XenScsi_HwScsiResetBus(PVOID DeviceExtension, ULONG PathId)
458 {
459 UNREFERENCED_PARAMETER(DeviceExtension);
460 UNREFERENCED_PARAMETER(PathId);
463 KdPrint((__DRIVER_NAME " --> HwScsiResetBus\n"));
464 KdPrint((__DRIVER_NAME " IRQL = %d\n", KeGetCurrentIrql()));
466 KdPrint((__DRIVER_NAME " <-- HwScsiResetBus\n"));
468 return TRUE;
469 }
471 static BOOLEAN
472 XenScsi_HwScsiAdapterState(PVOID DeviceExtension, PVOID Context, BOOLEAN SaveState)
473 {
474 UNREFERENCED_PARAMETER(DeviceExtension);
475 UNREFERENCED_PARAMETER(Context);
476 UNREFERENCED_PARAMETER(SaveState);
478 KdPrint((__DRIVER_NAME " --> HwScsiAdapterState\n"));
479 KdPrint((__DRIVER_NAME " IRQL = %d\n", KeGetCurrentIrql()));
481 KdPrint((__DRIVER_NAME " <-- HwScsiAdapterState\n"));
483 return TRUE;
484 }
486 static SCSI_ADAPTER_CONTROL_STATUS
487 XenScsi_HwScsiAdapterControl(PVOID DeviceExtension, SCSI_ADAPTER_CONTROL_TYPE ControlType, PVOID Parameters)
488 {
489 SCSI_ADAPTER_CONTROL_STATUS Status = ScsiAdapterControlSuccess;
490 PSCSI_SUPPORTED_CONTROL_TYPE_LIST SupportedControlTypeList;
491 //KIRQL OldIrql;
493 UNREFERENCED_PARAMETER(DeviceExtension);
495 KdPrint((__DRIVER_NAME " --> HwScsiAdapterControl\n"));
496 KdPrint((__DRIVER_NAME " IRQL = %d\n", KeGetCurrentIrql()));
498 switch (ControlType)
499 {
500 case ScsiQuerySupportedControlTypes:
501 SupportedControlTypeList = (PSCSI_SUPPORTED_CONTROL_TYPE_LIST)Parameters;
502 KdPrint((__DRIVER_NAME " ScsiQuerySupportedControlTypes (Max = %d)\n", SupportedControlTypeList->MaxControlType));
503 SupportedControlTypeList->SupportedTypeList[ScsiQuerySupportedControlTypes] = TRUE;
504 SupportedControlTypeList->SupportedTypeList[ScsiStopAdapter] = TRUE;
505 break;
506 case ScsiStopAdapter:
507 KdPrint((__DRIVER_NAME " ScsiStopAdapter\n"));
508 break;
509 case ScsiRestartAdapter:
510 KdPrint((__DRIVER_NAME " ScsiRestartAdapter\n"));
511 break;
512 case ScsiSetBootConfig:
513 KdPrint((__DRIVER_NAME " ScsiSetBootConfig\n"));
514 break;
515 case ScsiSetRunningConfig:
516 KdPrint((__DRIVER_NAME " ScsiSetRunningConfig\n"));
517 break;
518 default:
519 KdPrint((__DRIVER_NAME " UNKNOWN\n"));
520 break;
521 }
523 KdPrint((__DRIVER_NAME " <-- HwScsiAdapterControl\n"));
525 return Status;
526 }
528 VOID
529 XenScsi_FillInitCallbacks(PHW_INITIALIZATION_DATA HwInitializationData)
530 {
531 KdPrint((__DRIVER_NAME " --> "__FUNCTION__ "\n"));
532 KdPrint((__DRIVER_NAME " IRQL = %d\n", KeGetCurrentIrql()));
534 HwInitializationData->HwInitialize = XenScsi_HwScsiInitialize;
535 HwInitializationData->HwStartIo = XenScsi_HwScsiStartIo;
536 HwInitializationData->HwInterrupt = XenScsi_HwScsiInterrupt;
537 HwInitializationData->HwFindAdapter = XenScsi_HwScsiFindAdapter;
538 HwInitializationData->HwResetBus = XenScsi_HwScsiResetBus;
539 HwInitializationData->HwAdapterState = XenScsi_HwScsiAdapterState;
540 HwInitializationData->HwAdapterControl = XenScsi_HwScsiAdapterControl;
542 KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
543 }