Subject: Re: Tekram DC395/DC315 SCSI Adapter driver update
To: None <email@example.com>
From: Izumi Tsutsui <firstname.lastname@example.org>
Date: 09/16/2001 17:32:07
In article <20010916145130.A260@rxgpc.iplus.net.tw>
> 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:
> If we get no problem, I will send-pr. :)
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 :-)
(sorry I don't have the card.)