On 13/02/2008, Garrett D'Amore <[EMAIL PROTECTED]> wrote: > > Nabil Rahiman wrote: > > Hi, > > > > I am trying to port the lnux device driver into Solaris platform. > > > Just a heads up. Unless you wrote the original Linux driver, or have > explicit permission from the author to perform such a port, generally > you cannot do this. At least one prominent author of Linux device > drivers (Donald Becker) has been very vocal about his willingness to > bring lawsuits against anyone who tries to port (or otherwise create > derivative works) his code to any operating system which is not GPLv2. > At the moment, I believe Linux is the only major OS that carries a GPLv2. > > What can work, is to use the Linux code to understand how the device > works, and then write a fresh driver based on your understanding of the > device. This is hard to do safely -- if you are going to do that, I > recommend writing a chip specification from the Linux code (assuming you > can't find one), or writing, in plain language, chip behaviors. Then > use *that* to help you write your driver.
Yes Garret. I am doing the same what you recommended for. But Instead of writing a fresh code what I am doing here I used souce which is available in http://homepage2.nifty.com/mrym3/taiyodo/eng/ as .(open source). For allocating the dma resources, the call made in linux is direct and easy to under stand. But in Solaris the multiple calls we have to make and need to set some attributes(ddi_dma_attr) which is specific to the device. Nabil In general, if a driver in NetBSD/FreeBSD/OpenBSD exists, they are much > safer to use. (Plus, to be quite honest, I have found that the code > written by BSD developers tends to be a little higher quality -- easier > to understand and maintain, and you'll also find that the BSD style > guidelines are almost bang-on identical to Solaris' cstyle rules.) > > -- Garrett > > > > > In Solaris for allocatting dma resource, we have to set the > > following set of dma attributes. > > > > typedef struct ddi_dma_attr { > > > > uint_t dma_attr_version; /* version number */ > > uint64_t dma_attr_addr_lo; /* low DMA address range > */ > > uint64_t dma_attr_addr_hi; /* high DMA address > range */ > > > > uint64_t dma_attr_count_max; /* DMA counter register > */ > > uint64_t dma_attr_align; /* DMA address alignment > */ > > uint_t dma_attr_burstsizes; /* DMA burstsizes */ > > > > uint32_t dma_attr_minxfer; /* min effective DMA > size */ > > uint64_t dma_attr_maxxfer; /* max DMA xfer size */ > > uint64_t dma_attr_seg; /* segment boundary */ > > > > int dma_attr_sgllen; /* s/g length */ > > uint32_t dma_attr_granular; /* granularity of device > */ > > uint_t dma_attr_flags; /* Bus specific DMA > flags */ > > > > } ddi_dma_attr_t; > > > > And most of these attribute values are specific to the device. > > > > But I couldn't find out the corresponding structure/functionality in > > Linux. > > > > Please guide me. > > > > > > Regards, > > Nabil > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > driver-discuss mailing list > > [email protected] > > http://mail.opensolaris.org/mailman/listinfo/driver-discuss > > > >
_______________________________________________ driver-discuss mailing list [email protected] http://mail.opensolaris.org/mailman/listinfo/driver-discuss
