Hi Jesper, Thanks for the patch, it was very interesting.
Unfortunately our linux distro does not have the hotplug/udev framework required for request_firmware to work. So, what I have done is added the ability to "request_firmware_direct" which will read firmware files direct from the kernel. I've attached a patch with my additions. (Sorry, there's also a few formatting changes in the patch to match the code to the etherlabs coding standards.) Theres two defines: - REQUEST_SII_DIRECT to enable request_firmware_direct (otherwise uses request_firmware) - SII_PATH the path to the firmware directory Firmware files will also require read permissions for all users, eg: # chmod a=r ec_[VENDOR_ID]_[PRODUCT_CODE].bin Regards, Graeme. -----Original Message----- From: etherlab-users-boun...@etherlab.org [mailto:etherlab-users-boun...@etherlab.org] On Behalf Of Jesper Smith Sent: Tuesday, 1 November 2011 10:54 To: Graeme Foot Cc: etherlab-users@etherlab.org Subject: Re: [etherlab-users] Problem reading SII configuration from slave The patch I have is for the latest stable-1.5 tag. To use the patch, put the SII information (export using TwinCAT) in [FIRMWARE_LOCATION]/ethercat/ec_[VENDOR ID]_[PRODUCT CODE].bin For my distro, OpenSuSE, the firmware location is /lib/firmware/[KERNEL_VERSION], but this can differ between distro's. Regards, Jesper Op dinsdag 1 november 2011 10:00:04 schreef Graeme Foot: > Hi, > > Yes, I'm interested in the patch. > > Thanks, > Graeme. > > > -----Original Message----- > From: etherlab-users-boun...@etherlab.org > [mailto:etherlab-users-boun...@etherlab.org] On Behalf Of Jesper Smith > Sent: Friday, 28 October 2011 04:02 > To: etherlab-users@etherlab.org > Subject: Re: [etherlab-users] Problem reading SII configuration from > slave > > Hello, > > Because the supplier of our slaves told us that their SII information > will > never fit in the slave (the SII binary is 3kb and the slave only has a > 2kb > memory location) and we're stuck with 14 of them I've cleaned up the > hack to > read the SII information from a binary file and made it work in > combination > with other slaves. If someone is interested I can make a patch to the > most > recent master code. > > I've adjusted the fsm_slave_scan state machine to works as follows > > - Read vendor id + product code from slave > - Use the kernels firmware_request to load > ec_${vendor_id}_${product_code}.bin > /lib/firmware/${uname -r}/ethercat (or whatever path your distribution > uses) > > If firmware is found, > use that to load the SII information > else > read SII information from the slave > > > I think this can be used as starting point for reading XML files. I'm > thinking > of the following solutions > > - Make a separate user space program that compiles the XML files to SII > binaries and stores them in /lib/firmware > - Store the XML file in /lib/firmware and parse it in the master module > - Create a separate communication between the kernel and user space that > > requests slave information from a daemon/udev. > > Maybe someone on this list can voice their opinion what would be the > neatest > way to do it. > > > Regards, > > Jesper
etherlabmaster-1.5-2124-e_load_sii_from_file_changes.patch
Description: etherlabmaster-1.5-2124-e_load_sii_from_file_changes.patch
_______________________________________________ etherlab-users mailing list etherlab-users@etherlab.org http://lists.etherlab.org/mailman/listinfo/etherlab-users