On Thu, Sep 6, 2012 at 4:24 PM, Johnathan Van Why <jrvan...@gmail.com>wrote:

> We are trying to use RTNet for EtherCAT communications (we just need raw
> socket access). However, our specific NIC is not recognized by the r8169
> driver in RTNet.
>
> Is there someone who can make a driver for this NIC? If not, how
> reasonable is it for me to fix the current one or port over the vanilla
> Linux r8169 driver?
>

Most likely all you need to do is add your particular card to the pci
device id list of the drivers/experimental/rt_r8169.c driver.  You can find
your pci device vendor, device ids using the output  of
lspci
 and
lspci -n

Here's my patch to  add the RealTek 0x8167, 0x8169 device ids. The patch
also fixes a double irq free and quiets some debugging chatter from the
driver.  The patch is made against the January 2012 git version.
--- rt_r8169.c  (.../vendor/rtnet/trunk/drivers/experimental/rt_r8169.c)
    (revision 10422)
+++ rt_r8169.c  (.../shared/rtnet/trunk/drivers/experimental/rt_r8169.c)
    (revision 10667)
@@ -102,8 +102,8 @@
        #define rt_assert(expr) \
                if(!(expr)) { rtdm_printk( "Assertion failed!
%s,%s,%s,line=%d\n", #expr,__FILE__,__FUNCTION__,__LINE__); }
        /*** RTnet / <kk>: RT_DBG_PRINT must be used instead of DBG_PRINT()
within interrupt context! ***/
-       #define DBG_PRINT( fmt, args...)   printk("r8169: " fmt, ## args);
-       #define RT_DBG_PRINT( fmt, args...)   rtdm_printk("r8169: " fmt, ##
args);
+       #define DBG_PRINT( fmt, args...)   printk("rt_r8169: " fmt, ##
args);
+       #define RT_DBG_PRINT( fmt, args...)  rtdm_printk("rt_r8169: " fmt,
## args);
 #else
        #define assert(expr) do {} while (0)
        #define rt_assert(expr) do {} while (0)
@@ -127,8 +127,8 @@
 #define DEBUG_TX_SYNC 4
 #define DEBUG_TX_OTHER 8
 #define DEBUG_RUN 16
-static int debug = -1;
-static int r8169_debug = -1;
+static int debug = 0;
+static int r8169_debug = 0;
 module_param(debug, int, 0444);
 MODULE_PARM_DESC(debug, MODULENAME " debug level (bit mask, see docs!)");

@@ -220,8 +220,10 @@


 static struct pci_device_id rtl8169_pci_tbl[] __devinitdata = {
-       { 0x10ec, 0x8169, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
-       { 0x1186, 0x4300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },    /* <kk>
D-Link DGE-528T */
+       { PCI_VENDOR_ID_REALTEK, 0x8167, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { PCI_VENDOR_ID_REALTEK, 0x8169, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       /* <kk> D-Link DGE-528T */
+       { PCI_VENDOR_ID_DLINK, 0x4300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
        {0,},
 };

@@ -1936,7 +1938,6 @@
        *** /RTnet ***/

        /*** RTnet ***/
-       free_irq (rtdev->irq, rtdev);
        if ( (i=rtdm_irq_free(&priv->irq_handle))<0 )
                return i;

@@ -2090,9 +2091,7 @@
 static int __init rtl8169_init_module (void)
 {
        /* <kk> Enable debugging output... */
-       if (debug > 0) {
-               r8169_debug = debug;
-       }
+       r8169_debug = debug;
        if (r8169_debug & DEBUG_RUN) printk("Initializing " MODULENAME "
driver");
        return compat_pci_register_driver (&rtl8169_pci_driver);
 }
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
RTnet-users mailing list
RTnet-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rtnet-users

Reply via email to