A while ago, I suggested splitting the transport functions from at86rf230.c (basically at86rf230_{read,write}_{subreg,fbuf}) so that specialized versions for interfaces that aren't quite SPI could be written.
Dmitry didn't like the idea, and the init/probe/remove side of things promised to get a little awkward. So I tried to make the device-specific driver look like a regular SPI master. Here's the result: http://projects.qi-hardware.com/index.php/p/qi-kernel/source/tree/ben-wpan/drivers/spi/spi_atben.c Compared to spi_gpio, throughput for copying data to/from the frame buffer increased from about 820 kbps to about 4.2 Mbps (the maximum the chip could do would be about 6.76 Mbps in this case). This is calculated from ping times for different packet sizes, so it includes various memory copies along the way (they should only contribute a few percent to the overhead, though) and it doesn't include starting/ending the SPI transfer, protocol/scheduling overhead, etc. This is the average from read and write time. The whole split worked quite well. A few details: - needs the platform-specific reset function in the at86rf230 driver I posted a moment ago - not sure how portable irq_alloc_desc is. We'll find out soon with the spi_atusb driver, which will use the same approach. - for interrupt synchronization, atben_transfer needs to decode requests and "know" how the at86rf230 driver does synchronization. This will get more important in the spi_atusb driver, where we have to flush interrupts across USB. A cleaner approach may be to have another platform-specific function for interrupt flushing. - also in spi_atusb, there will be more restrictions on the types of SPI transfers (general-purpose SPI would be awkward with our current USB protocol) - I put spi_atben under drivers/spi/, but drivers/ieee802154/ may be a more appropriate place, considering its very narrow focus Overall, I like the look of it, and it seems to be a nice enough approach for making drivers like at86rf230 work over a broad range of board/interface designs without forking the driver core. - Werner ------------------------------------------------------------------------------ All of the data generated in your IT infrastructure is seriously valuable. Why? It contains a definitive record of application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-d2d-c2 _______________________________________________ Linux-zigbee-devel mailing list Linux-zigbee-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel