xref: /reactos/drivers/storage/ide/uniata/todo.txt (revision 3fb5ca3b)
1*c2c66affSColin Finck1.  use ScsiPortGetBusData() instead of HalGetBusData() to enumerate    ...
2*c2c66affSColin Finck    PCI devices                                                        (8b )
3*c2c66affSColin Finck2.  create 2 channels on non-primary HBA                               (9  )
4*c2c66affSColin Finck3.  add BusMaster detection to ISA & ISA/PCI FindController() routines  ...
5*c2c66affSColin Finck    I've decided to modify AtapiFindBusMasterController() for this      ...
6*c2c66affSColin Finck    purpose                                                            (9  )
7*c2c66affSColin Finck4.  beautify sources ;)
8*c2c66affSColin Finck5.  add LBA support                                                    (8  )
9*c2c66affSColin Finck6.  return modified Cylinders in IDENTYFY_DATA to handle HDDs > 8Gb     ...
10*c2c66affSColin Finck    properly                                                           (8  )
11*c2c66affSColin Finck7.  return good HDD size value for                                      ...
12*c2c66affSColin Finck    a) IdeVerify()                                                     (8  )
13*c2c66affSColin Finck    b) SCSIOP_READ_CAPACITY                                            (8  )
14*c2c66affSColin Finck8.  use READ_NATIVE_SIZE command to determine actual drive capacity    (8a )
15*c2c66affSColin Finck9.  send FLUSH command to device                                       (9  )
16*c2c66affSColin Finck10. check (IO_WDx - 0x08) ports in AtapiFindBusMasterController()      (+++)
17*c2c66affSColin Finck11. use SelectDrive() instead of ScsiPortWritePortXXX()                (9a )
18*c2c66affSColin Finck12. remove obsolete AtapiFindPCIController()                           (9a )
19*c2c66affSColin Finck13. make a separate routine AtapiInitController() for HBA               ...
20*c2c66affSColin Finck    initialization (move there some parts of code from                  ...
21*c2c66affSColin Finck    AtapiFindBusMasterController()                                     (---)
22*c2c66affSColin Finck14. add feature enabling code to drive (re)init routine IdeHardReset()  ...
23*c2c66affSColin Finck    AtapiHwInitialize() does all necessary staff                       (10+)
24*c2c66affSColin Finck15, use AtapiInitController() in AtapiHwInitialize()                   (---)
25*c2c66affSColin Finck16. remove obsolete FindBrokenController() and                          ...
26*c2c66affSColin Finck    AtapiFindNativeModeController()                                    (10 )
27*c2c66affSColin Finck17. move FindDevices() to id_probe.cpp                                 (10 )
28*c2c66affSColin Finck18. set HDD PIO modes if no DMA available                              (10 )
29*c2c66affSColin Finck19. implement AtaCommand()                                             (10 )
30*c2c66affSColin Finck20. implement AtaPioMode() & AtaPio2Mode()                             (10 )
31*c2c66affSColin Finck21. add some new ChipSets support from FBSD 4.5                        (10a)
32*c2c66affSColin Finck22. set Controller PIO timigs                                           ...
33*c2c66affSColin Finck    a) via                                                             (11 ) ??
34*c2c66affSColin Finck    b) intel                                                           (+++)
35*c2c66affSColin Finck    c) AcerLabs Aladdin IV/V                                           (23 )
36*c2c66affSColin Finck23. update Identify block                                              (11 )
37*c2c66affSColin Finck24. add LBA-48 support                                                 (11 )
38*c2c66affSColin Finck25. use AtapiCommand()/AtapiCommand48() instead of direct port I/O      ...
39*c2c66affSColin Finck    a) for Read/Write/Identify                                         (11 )
40*c2c66affSColin Finck    b) Set features, Smart, Set drive params                           (11c)
41*c2c66affSColin Finck26. port/implement AtapiDmaInit() for well-known controllers           (11 )
42*c2c66affSColin Finck27. Beautify IdeReadWrite()                                            (11c)
43*c2c66affSColin Finck28. port/implement DMA-specific parts of interrupt handlers            (12 )
44*c2c66affSColin Finck29. request queueing                                                   (16b)
45*c2c66affSColin Finck30. port/implement DMA-start routine                                   (12 )
46*c2c66affSColin Finck31. remove MODE_SENSE/SELECT 6<->10 translation. It'll improve          ...
47*c2c66affSColin Finck    performance.                                                       (11a)
48*c2c66affSColin Finck32. move InterruptService to DPC (via ScsiPortNotification())          (17 )
49*c2c66affSColin Finck33. implement ATA_WAIT_INTR branch in AtapiCommand()/AtapiCommand48()  (11b)
50*c2c66affSColin Finck34. fix bugs in Identify structure                                     (11b)
51*c2c66affSColin Finck35. use normal Lba detection in IssueIdentify()                        (11b)
52*c2c66affSColin Finck36. fix bug with default structure elements alignment                   ...
53*c2c66affSColin Finck    use pragma pack (1)                                                (11c)
54*c2c66affSColin Finck37. use ATA_WAIT_INTR in IdeReadWrite() for Write branch and            ...
55*c2c66affSColin Finck    ATA_IMMEDIATE for Read one                                         (11c)
56*c2c66affSColin Finck38. update Identify dtructure                                          (11c)
57*c2c66affSColin Finck39. fix some size detection bugs in IssueIdentify()                    (11c)
58*c2c66affSColin Finck40. don't forget setting ExpectingInterrupt flag before WriteBuffer()   ...
59*c2c66affSColin Finck    on PIO transfer                                                    (12g)
60*c2c66affSColin Finck41. try generic DMA for old devices instead of PIO default             (12g)
61*c2c66affSColin Finck42. clear 4 lower bits of AccessRange                                  (12g)
62*c2c66affSColin Finck43. reconstruct _Original_ ConfigInfo (not temporary) on Detect         ...
63*c2c66affSColin Finck    phase                                                              (13 )
64*c2c66affSColin Finck44. set 32-bit addressing for all bus types                            (13 )
65*c2c66affSColin Finck45. handle invalid address value (-1) in AtapiDmaSetup()               (13 )
66*c2c66affSColin Finck46. add some new ChipSets support from FBSD 4.6                        (13c)
67*c2c66affSColin Finck47. add 'offset' parameter to AtapiGetIoRange() to allow claiming       ...
68*c2c66affSColin Finck    different io-regions of the same PCI device by different            ...
69*c2c66affSColin Finck    DeviceObjects (representing different channels of this device      (13a)
70*c2c66affSColin Finck48. claim both BusMaster io-regions on SimplexOnly controllers         (+++)
71*c2c66affSColin Finck49. add ATAPI DMA support                                              (19 )
72*c2c66affSColin Finck50. read 'PSS ID Number: Q133706' in NT DDK & implement Registry-       ...
73*c2c66affSColin Finck    supplied params. Use a small hack instead: Argument2 is the         ...
74*c2c66affSColin Finck    pointer to UNICODE_STRING we need                                  (18a)
75*c2c66affSColin Finck51. implement Reinitialize functionality                               (+++)
76*c2c66affSColin Finck52. optimize DMA init (move similar parts of code to loops/functions    ...
77*c2c66affSColin Finck    a) VIA/AMD/nVidia                                                  (13c)
78*c2c66affSColin Finck    b) Promise TX2                                                     (13c)
79*c2c66affSColin Finck    c) Promise Ultra                                                   (23 )
80*c2c66affSColin Finck    d) ServerWorks                                                     (23 )
81*c2c66affSColin Finck    e) CMD 64x                                                         (+++)
82*c2c66affSColin Finck    f) SiS                                                             (+++)
83*c2c66affSColin Finck    g) AcerLabs Aladdin IV/V                                           (+++)
84*c2c66affSColin Finck    h) Intel                                                           (+++)
85*c2c66affSColin Finck    i) Sil                                                             (23 )
86*c2c66affSColin Finck    j) HPT                                                             (23 )
87*c2c66affSColin Finck53. use LogicalUnitExtension instead of xxx[Srb->TargetId]             (14 )
88*c2c66affSColin Finck54. use SrbExtension to manage queue                                   (16b)
89*c2c66affSColin Finck55. IdeReadWrite() should support non-zero initial offset in DataBuffer ...
90*c2c66affSColin Finck    to allow scatter/gather simulation, queueing & retries
91*c2c66affSColin Finck56. keep 'dma_tab' in SrbExtension                                     (16b)
92*c2c66affSColin Finck57. never set SpecificLuExtensionSize to 0                             (14a)
93*c2c66affSColin Finck58. never call ScsiPortGetUncachedExtension() twice for the same HBA,   ...
94*c2c66affSColin Finck    even if the 1st call failed. Use deviceExtension->HbaCtrlFlags &    ...
95*c2c66affSColin Finck    HBAFLAGS_DMA_DISABLED to indicate such case                        (16 )
96*c2c66affSColin Finck59. set deviceExtension->BaseIoAddressBM[1] properly for dual-channel   ...
97*c2c66affSColin Finck    HBAs (it was equal to BaseIoAddressBM[0])                          (16 )
98*c2c66affSColin Finck60. set Channel properly in AtapiInterrupt__() for dual-channel HBAs    ...
99*c2c66affSColin Finck    (lChannel was ignored)                                             (16 )
100*c2c66affSColin Finck61. initialize ConfigINfo members required by                           ...
101*c2c66affSColin Finck    ScsiPortGetUncachedExtension() _before_ call to AtapiDmaAlloc()    (16 )
102*c2c66affSColin Finck62. move SCSI-address-2-Channel/Device translation to macros. This      ...
103*c2c66affSColin Finck    makes code more readable & flexible.                               (16 )
104*c2c66affSColin Finck63. implement SCSI-bus - IDE-channel and                                ...
105*c2c66affSColin Finck    SCSI-TargetId - IDE-master/slave correspondance (using p.62)       (16 )
106*c2c66affSColin Finck64. set AutoRequestSense to TRUE                                       (16a)
107*c2c66affSColin Finck65. set inquiryData->CommandQueue to 1                                 (16a)
108*c2c66affSColin Finck66. fill SenseInfoBufer in                                              ...
109*c2c66affSColin Finck    a) IDE MapError()                                                  (16a)
110*c2c66affSColin Finck    b) IDE/ATAPI success                                               (20d)
111*c2c66affSColin Finck67. use AtaReq->ReqState to indicate request processing state          (16b)
112*c2c66affSColin Finck68. fill AtaReq->ReqState in all necessary places to reflect actual     ...
113*c2c66affSColin Finck    request state (for optimizer)                                      (18+)
114*c2c66affSColin Finck69. fix bug with unconditional returning FALSE in AtapiInterrupt()     (16c)
115*c2c66affSColin Finck70. copy pointer to original AtaReq from Srb to InternalSrb            (16c)
116*c2c66affSColin Finck71. check input Srb value for NULL in AtapiRemoveRequest()             (16c)
117*c2c66affSColin Finck72. return from IssueIdentify loop if no error occured. Previous        ...
118*c2c66affSColin Finck    versions have a bug: SUCCESS status was ignored & this caused       ...
119*c2c66affSColin Finck    obsolet retries                                                    (16c)
120*c2c66affSColin Finck73. clear CTRFLAGS_INTR_DISABLED flag in AtapiEnableInterrupts_Xxx()   (17a)
121*c2c66affSColin Finck74. use Sync Object to manage access to request queue                  (---)
122*c2c66affSColin Finck75. remove AtapiEnableInterrupts_Xxx()-related code duplicates from     ...
123*c2c66affSColin Finck    AtapiInterrupt__()                                                 (17a)
124*c2c66affSColin Finck76. check calls to AtapiResetController() & related routines.           ...
125*c2c66affSColin Finck    See p. 80, 81                                                      (+++)
126*c2c66affSColin Finck77. use ScsiPortNotification() with RequestTimerCall instead of         ...
127*c2c66affSColin Finck    CallDis(En)ableInterrupts to allow servicing 2 channels in          ...
128*c2c66affSColin Finck    parallel. See p.87                                                 (---)
129*c2c66affSColin Finck78. do not use DPC ISR for fast operations, like                        ...
130*c2c66affSColin Finck    a) DMA-completion                                                  (18 )
131*c2c66affSColin Finck    b) sending CDB to ATAPI devices                                    (18a)
132*c2c66affSColin Finck    c) short ATAPI transfers                                           (18a)
133*c2c66affSColin Finck79. call both AtapiEnableInterrupts_X() & AtapiCallBack_X() on DSC      ...
134*c2c66affSColin Finck    restrictive commands completion                                    (18 )
135*c2c66affSColin Finck80. invoke AtapiStartIo__() from ISR as callback to parform it's        ...
136*c2c66affSColin Finck    execution at lower IRQL                                            (19x)
137*c2c66affSColin Finck81. invoke AtapiResetController() from ISR as callback to parform it's  ...
138*c2c66affSColin Finck    execution at lower IRQL                                            (19x)
139*c2c66affSColin Finck82. do not use ScsiPortCompleteRequest() in AtapiResetController()      ...
140*c2c66affSColin Finck    Use standard completion way with setting SenseData instead         (18a)
141*c2c66affSColin Finck83. reset single channel on normal (non-simplex-only) controllers in    ...
142*c2c66affSColin Finck    AtapiResetController()                                             (18a)
143*c2c66affSColin Finck84. sort records in BMList on enumeration phase & simplify init loops   ...
144*c2c66affSColin Finck    in DriverEntry()                                                   (18a)
145*c2c66affSColin Finck85. fix bug with wrong numberChannels init for 2nd channel in           ...
146*c2c66affSColin Finck    AtapiResetController()                                             (18b)
147*c2c66affSColin Finck86. implement channel-sensetive AtapiHwInitialize__() and use in in     ...
148*c2c66affSColin Finck    AtapiResetController() & AtapiHwInitialize()                       (18+)
149*c2c66affSColin Finck87. Due to SCSI-port restrictions we should Enable/Disable interruptys  ...
150*c2c66affSColin Finck    for BOTH channels :((((. Implement this....                        (19 )
151*c2c66affSColin Finck88. Deprecate p.87. ;) It doesn't work. Solution: connect manually      ...
152*c2c66affSColin Finck    created DeviceObject to the same interrupt & check in its ISR if    ...
153*c2c66affSColin Finck    our device interrupted while original ISR/DPC processing            ...
154*c2c66affSColin Finck    another channel's interrupt.                                       (20 )
155*c2c66affSColin Finck90. add error handling on additional DevObj init                       (20a)
156*c2c66affSColin Finck91. deprecate p.80,81. We should acquire QueueSpinLock at DIRQL        (+/-)
157*c2c66affSColin Finck92. perform all possible request init on queueing stage even if we      ...
158*c2c66affSColin Finck    can't send it to device immediately (use CMD_ACTION_XXX)            ...
159*c2c66affSColin Finck    a) for IDE branch                                                  (20c)
160*c2c66affSColin Finck    b) for ATAPI branch                                                (21a)
161*c2c66affSColin Finck93. complete the following commands immediately:                        ...
162*c2c66affSColin Finck    SCSIOP_INQUIRY, SCSIOP_READ_CAPACITY, SCSIOP_REQUEST_SENSE         (20c)
163*c2c66affSColin Finck94. implement ABORT_COMMAND functionality                              (20d)
164*c2c66affSColin Finck95. reorder incoming requests in AtapiQueueRequest()                   (21c)
165*c2c66affSColin Finck96. make 2 modes for ResetController(): complete current & complete     ...
166*c2c66affSColin Finck    all for p.94.                                                      (20d)
167*c2c66affSColin Finck97. store queue size statistics in HW_CHANNEL                          (20d)
168*c2c66affSColin Finck98. remove obsolete DPC code from AtapiInterrupt__()                   (20e)
169*c2c66affSColin Finck99. store error rate in HW_CHANNEL                                     (20e)
170*c2c66affSColin Finck100.try falling back to PIO when DMA error occured                     (20e)
171*c2c66affSColin Finck101.use Dma & Pio error rates to distinguish between BadBlock &         ...
172*c2c66affSColin Finck    BadCable conditions, See also p.127, 128                           (+++)
173*c2c66affSColin Finck102.don't use HDD's algorithm of falling back to PIO for ATAPI         (21 )
174*c2c66affSColin Finck103.clear REQ_FLAG_DMA_OPERATION when falling back to PIO              (21 )
175*c2c66affSColin Finck104.set REQ_FLAG_REORDERABLE_CMD in IdeReadWrite()                     (21 )
176*c2c66affSColin Finck105.store bcount along with lba in ATA_REQ on CMD_ACTION_PREPARE stage (21 )
177*c2c66affSColin Finck106.do like p.105,104 in AtapiSendCommand for read/write ops           (21 )
178*c2c66affSColin Finck107.set operation type flag (Read/Write) in AtaReq on                   ...
179*c2c66affSColin Finck    CMD_ACTION_PREPARE stage                                           (21b)
180*c2c66affSColin Finck108.send comamnds to queue _after_ CMD_ACTION_PREPARE stage            (21a)
181*c2c66affSColin Finck109.fix bug (incorrect queue_size check) in p.108                      (21b)
182*c2c66affSColin Finck110.handle SRB_FLAGS_DISABLE_AUTOSENSE
183*c2c66affSColin Finck111.handle Srb->QueueAction                                            (21d)
184*c2c66affSColin Finck112.check SRB_STATUS_AUTOSENSE_VALID usage policy                      (+++)
185*c2c66affSColin Finck113.add support for hardware queueing/overlapped commands
186*c2c66affSColin Finck114.handle immediate commands properly: don't initiate bus reset        ...
187*c2c66affSColin Finck    while formatting CDRW                                              (+++)
188*c2c66affSColin Finck115.add hardware IDE RAID support
189*c2c66affSColin Finck116.fix bug with data type missmatch in AtapiDmaInit(),                 ...
190*c2c66affSColin Finck    some VIA branches. This bug caused array boundary cross, leading    ...
191*c2c66affSColin Finck    to system crash                                                    (22 )
192*c2c66affSColin Finck117.default udmamode to 0 if there are no well-known devices found      ...
193*c2c66affSColin Finck    in AtapiDmaInit(), VIA branch.                                     (22 )
194*c2c66affSColin Finck118.do not check RevID in AtapiFindDev if RevID == -1                  (22 )
195*c2c66affSColin Finck119.use best settings for newer RevIDs
196*c2c66affSColin Finck120.fix signed/unsigned missmatch (i vs udmamode) in AtapiDmaInit(),    ...
197*c2c66affSColin Finck    VIA branch                                                         (22 )
198*c2c66affSColin Finck121.fix bug with incorrect UDMA init in VIA branch. use UDMA0+i         ...
199*c2c66affSColin Finck    instead of UDMA0+udmamode                                          (22a)
200*c2c66affSColin Finck122.fall back to WDMA mode before PIO                                  (22a)
201*c2c66affSColin Finck123.use transfer speed slowdown algorithm when high error rate          ...
202*c2c66affSColin Finck    detected                                                           (22a)
203*c2c66affSColin Finck124.don't forget updating AtaReq->retry on R/W error (non-DMA)         (22a)
204*c2c66affSColin Finck125.fill AtaReq with ZEROs on TopLevel condition                       (22a)
205*c2c66affSColin Finck126.fix bug in IdeVerify() with sending SectorCount to device before    ...
206*c2c66affSColin Finck    call to AtaCommand48() and using 0 SectorCount in that call        (22a)
207*c2c66affSColin Finck127.store Error/Recover rate statistics in LunExtension                (22a)
208*c2c66affSColin Finck128.use p.127 for smart slowdown algorithm                             (22b)
209*c2c66affSColin Finck129.use lChannel  instead of phChannel for indexing in find-channel     ...
210*c2c66affSColin Finck    loop in AtapiFindBusMasterController()                             (22b)
211*c2c66affSColin Finck130.programm controller for lower speed in Ide/AtapiSendCommand(), not  ...
212*c2c66affSColin Finck    in AtapiInterrupt__()                                              (22b)
213*c2c66affSColin Finck131.use AtapiDmaReinit() routine for p.131                             (22b)
214*c2c66affSColin Finck132.implement per-device queueing                                      (23 )
215*c2c66affSColin Finck134.add Sil, ICH4, Some HPT, PromiseTX2(133) support from 4.7          (23 )
216*c2c66affSColin Finck135.fix wrong bit-shift bug in lba48 branch                            (23 )
217*c2c66affSColin Finck136.update and sort BusMasterAdapters[]                                (23a)
218*c2c66affSColin Finck137.fix bugs in AtapiTimerDpc() that caused incorrect handling of       ...
219*c2c66affSColin Finck    DSC restrictive commands                                            ...
220*c2c66affSColin Finck    a) call ScsiPortNotification(RequestTimerCall, ...) when we had     ...
221*c2c66affSColin Finck       a 2nd request on entry only                                     (23c)
222*c2c66affSColin Finck    b) check HwScsiTimer1 first to decide whether we have to go to      ...
223*c2c66affSColin Finck       GetNextDpc                                                      (23c)
224*c2c66affSColin Finck    c) wrong condition check 'time <= DpcTime1' instead of              ...
225*c2c66affSColin Finck       'time >= DpcTime1'                                              (23c)
226*c2c66affSColin Finck    d) remove request from queue _before_ call to HwScsiTimer()        (23c)
227*c2c66affSColin Finck138.add support for Acard controllers                                  (25 )
228*c2c66affSColin Finck139.use some additional code for HP/Promise Dma Star/Stop              (25 )
229*c2c66affSColin Finck140.assign queueing priority for each device
230*c2c66affSColin Finck141.assign BusMaster io-range to 1st channel only.                     (26e)
231*c2c66affSColin Finck142.do not change bus type to PCI for legacy ISA-PCI controllers under  ...
232*c2c66affSColin Finck    NT4                                                                (28 )
233*c2c66affSColin Finck143.implement Device/Vendor/Rev. filtering via registry keys           (30+)
234*c2c66affSColin Finck144.implement transfer mode control IOCTLs                             (28 )
235*c2c66affSColin Finck145.set max. transfer length > 64k.
236*c2c66affSColin Finck146.implement fix for miss-aligned user buffer
237*c2c66affSColin Finck147.set chip-specific init/operation flags only once during             ...
238*c2c66affSColin Finck    initialization and use them in future. Do not perform multiple      ...
239*c2c66affSColin Finck    bus scans and other detections.                                    (29a)
240*c2c66affSColin Finck148.fix bug with miss-functioning Enable/Disable interrupt for         (+++)
241*c2c66affSColin Finck    secondary channel                                                  (28 )
242*c2c66affSColin Finck149.add serial-ATA support                                             (29a)
243*c2c66affSColin Finck150.add support for new controllers (SiS, Promise)                     (29a)
244*c2c66affSColin Finck151.fix detection/init algorithms in order to avoid usage of            ...
245*c2c66affSColin Finck    non-generic code for unknown chips                                 (29a)
246*c2c66affSColin Finck152.add support for >2 channels                                        (29a)
247*c2c66affSColin Finck153.improve Intr-detection loop. Start each time from next channel      ...
248*c2c66affSColin Finck    for load-balance                                                   (29a)
249*c2c66affSColin Finck154.add support for machines with >4G physical memory                  (38 )
250*c2c66affSColin Finck155.add FreeBSD software RAID support
251*c2c66affSColin Finck156.use http://www.winimage.com/readfi15.zip for performance checks
252*c2c66affSColin Finck157.use IOCTL_SCSI_MINIPORT_IDENTIFY in atactl.exe to determine         ...
253*c2c66affSColin Finck    PIO/DMA when no uniata.sys is installed                            (+++)
254*c2c66affSColin Finck158.implement .INF generator
255*c2c66affSColin Finck159.fix bug with invalid INF section under XP+                         (43e2)
256*c2c66affSColin Finck160.add INF handler for SCSI\NET\VEN_UNIATA&PROD_MANAGEMENT_PORT
257*c2c66affSColin Finck161.