From: Kristian V. D. V. <va...@li...> - 2006-10-23 00:22:46
|
On Sunday 22 October 2006 23:25, Nico van Huis wrote: > I`m making some progress in understanding on how to port drivers to > syllable, but not understanding all of it. > I`m comparing the syllable r8169 driver to the linux tg3 driver > and finding some structs that are in linux header files, is there a > syllable replacement for these? Some of them are unesacary on Syllable: > or can i just copy them from the > linux source: > > From: netdevice.h > struct net_device_stats Take a look in some of the other drivers; possibly the Via Rhine driver has an implementation for this. Other drivers just remove the stats code, because there is no API to retrieve the stats information on Syllable anyway. > From: linux/timer.h > struct list_head > timer_list Timers work differently and these lists are not needed. See the rtl8169 driver for create_timer(), start_timer() and delete_timer() as an example, or <atheos/timer.h> > From: workqueue.h > struct work_struct I assume these are for creating worker processes E.g. bottom-half tasks? If so you'll have to find a different way to handle this on Syllable. You may find these are not needed, otherwise creating a kernel thread and running these tasks inside it may be appropriate. > From: ethtool.h > struct ethtool_coalesce Ethertool is not available on Syllable so these are not required. You should remove any ethtool related code from the driver. > Now i`m having difficulties with the following struct: > > static DeviceOperations_s g_sDevOps = > { > device_3c59x_open, > device_3c59x_close, > device_3c59x_ioctl, > device_3c59x_read, > device_3c59x_write, > NULL, // dop_readv > NULL, // dop_writev > NULL, // dop_add_select_req > NULL // dop_rem_select_req > }; > > How do i implement this for the tg3? > can i copy the 5 functions into the tg3 driver from the 3c59x driver? > Or.....? This describes the device interface for the device; that is, the device node in /dev/net/eth/... , not the "eth0" virtual device. If you take a look at the device_3c59x_* functions listed there you'll see they are pretty simple. You should be able to copy & paste them into your driver and make the simple modifications required. -- Vanders http://www.syllable.org http://www.liqwyd.com |