Subject: Re: Tekram DC395/DC315 SCSI Adapter driver update
To: None <rxg@ms25.url.com.tw>
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
List: port-i386
Date: 09/16/2001 17:32:07
In article <20010916145130.A260@rxgpc.iplus.net.tw>
rxg@ms25.url.com.tw wrote:
> I updated the driver with insteading of inb(), outb() by bus_space functions
> and remove the vtophys().
> So, it should be machine independent now.
> If someone has these cards and wants to test it, please fetch it from:
> http://members.tripodasia.com.tw/rxg/
> If we get no problem, I will send-pr. :)
Great!
It looks good, but I'd like some more cosmetics:
1) The PCI vendor ID and device ID are defined in sys/dev/pcidevs.h,
so we should use them rather than define locally.
2) The driver now uses bus_space(9) properly, so it seems
IOPortBase member of struct ACB is no longer needed.
3) All SRBs are allocated by bus_dmamem_alloc(), but
it is better to use bus_dmamem_alloc() only for memory
used to pass parameters to the adapter via DMA,
i.e. only memory for SegmentX[] member should be
allocated by bus_dmamem_alloc(). (see sys/dev/ic/iha*.[ch])
Otherwise it causes some performance penalty because
allocated memory by bus_dmamem_alloc() with BUS_DMA_COHERENT
does not use cache on some architectures (like arm and mips).
4) bus_dmamap_sync with BUS_DMASYNC_PREWRITE is also needed
for SegmentX[] before transfer.
5) It seems SRBSGPhyAddr member of struct SRB is not needed.
It is refered only in trm_DataIO_transfer().
6) Maybe some byteswap code is required for big-endian machines.
(But it should be trivial.)
7) It is much better to adapt these sources to KNF :-)
(see /usr/share/misc/style)
(sorry I don't have the card.)
---
Izumi Tsutsui
tsutsui@ceres.dti.ne.jp