Hello Jan ( not all :) )

Please check the new patch against revision 1091.
I think now is everything ok.

Greetings

Em Terça, 5 de Dezembro de 2006 08:23, escreveu:
> Hi Jorge,
> 
> Jorge Almeida wrote:
> > Hello to all.
> > 
> 
> Hmm, but your mail didn't reach them all yet...
> 
> > 
> > Sorry for the late answer but i was out of the office in the last days.
> > 
> > Please see the attached patch with your comments incorporated.
> 
> The patch to socket.c looks broken (empty hunk, a lot of unknown
> characters). Please re-check if nothing is missing.
> 
> > 
> > Jan if the patch is OK, please insert it in the SVN trunck of RTnet, 
setting 
> > the correct TODO statement (I don't put nothing).
> > 
> > For when is scheduled the next RTnet release?
> > I'm almost entering in the test phase of my project and it was good to 
star 
> > already with a stable release of RTnet to make my tests :)
> 
> As 0.9.7 just rolled out and your patch is currently the only one
> pending, there is no timetable for the next release yet. May quickly
> change when more patches or bug reports come in. Still, there is nothing
> preventing you to consider the SVN revision that will contain your patch
> as a release.
> 
> > ------------------------------------------------------------------------
> > 
> > Index: stack/socket.c
> > ===================================================================
> > --- stack/socket.c  (revision 1087)
> > +++ stack/socket.c  (working copy)
> > @@ -229,7 +229,7 @@
> >      struct ifreq        *ifr = arg;
> >      int                 ret = 0;
> >  
> >      if (request == SIOCGIFCONF) {
> >          struct ifconf       *ifc = arg;
> >          struct ifreq        *cur_ifr = ifc->ifc_req;
> > @@ -279,6 +279,10 @@
> >          case SIOCGIFFLAGS:
> >              ifr->ifr_flags = rtdev->flags;
> >              break;
> > +            
> > +        case SIOCETHTOOL:
> > + ? ? ? ? ? ?if (rtdev->do_ioctl) {
> > + ? ? ? ? ? ? ? ? ? ?ret = rtdev->do_ioctl( rtdev, request, arg);
> > + ? ? ? ? ? ?}
> > +            break;
> >  
> >          default:
> >              ret = -EOPNOTSUPP;
> > Index: drivers/rt_8139too.c
> > ===================================================================
> > --- drivers/rt_8139too.c    (revision 1087)
> > +++ drivers/rt_8139too.c    (working copy)
> > @@ -40,6 +40,8 @@
> >  #include <linux/ioport.h>
> >  #include <linux/netdevice.h>
> >  #include <linux/etherdevice.h>
> > +#include <linux/if.h>
> > +#include <linux/ethtool.h>
> >  #include <linux/rtnetlink.h>
> >  #include <linux/delay.h>
> >  #include <linux/ethtool.h>
> > @@ -525,6 +527,7 @@
> >  static int rtl8139_interrupt (rtdm_irq_t *irq_handle);
> >  static int rtl8139_start_xmit (struct rtskb *skb, struct rtnet_device 
*rtdev);
> >  
> > +static int rtl8139_ioctl(struct rtnet_device *rtdev, unsigned int 
request, void * cmd);
> >  
> >  static void rtl8139_init_ring (struct rtnet_device *rtdev);
> >  static void rtl8139_set_rx_mode (struct rtnet_device *rtdev);
> > @@ -834,6 +837,7 @@
> >          rtdev->stop = rtl8139_close;
> >          rtdev->hard_header = &rt_eth_header;
> >          rtdev->hard_start_xmit = rtl8139_start_xmit;
> > +        rtdev->do_ioctl = rtl8139_ioctl;
> >  
> >          /*rtdev->set_multicast_list = rtl8139_set_rx_mode; */
> >          rtdev->features |= NETIF_F_SG|NETIF_F_HW_CSUM;
> > @@ -1341,6 +1345,37 @@
> >          return 0;
> >  }
> >  
> > +static int rtl8139_ioctl(struct rtnet_device *rtdev, unsigned int 
request, void * arg)
> > +{
> > +    struct rtl8139_private *tp = rtdev->priv;
> > +    void *ioaddr = tp->mmio_addr;
> > +    int nReturn = 0;
> > +    struct ifreq         *ifr = arg;
> > +    struct ethtool_value *value;
> > +    switch( request )
> > +    {
> > +        case SIOCETHTOOL :
> > +        {
> > +            value = (struct ethtool_value *)ifr->ifr_data;
> > +            if( value->cmd == ETHTOOL_GLINK )
> > +            {
> > +                if(RTL_R16 (CSCR) & CSCR_LinkOKBit)
> > +                    value->data = 1;
> > +                else
> > +                    value->data = 0;
> > +            }
> > +            break;
> > +        }
> > +        default :
> > +        {
> > +            rtdm_printk("rtl8139_ioctl: IOCTL not implemented.\n");
> > +            nReturn = -EOPNOTSUPP;
> > +            break;
> > +        }
> > +    }
> > +    return nReturn;
> > +}
> 
> Jan
> 
> 

-- 
Jorge Almeida
[EMAIL PROTECTED]

DISCLAIMER: This message may contain confidential information or privileged
 material and is intended only for the individual(s) named. If you are not a
 named addressee and mistakenly received this message you should not copy or
 otherwise disseminate it: please delete this e-mail from your system and no
tify the sender immediately. E-mail transmissions are not guaranteed to be s
ecure or without errors as information could be intercepted, corrupted, lost
, destroyed, arrive late or incomplete or contain viruses. Therefore, the se
nder does not accept liability for any errors or omissions in the contents o
f this message that arise as a result of e-mail transmissions. Please reques
t a hard copy version if verification is required. Critical Software, SA.


Index: stack/socket.c
===================================================================
--- stack/socket.c	(revision 1091)
+++ stack/socket.c	(working copy)
@@ -279,6 +279,13 @@
         case SIOCGIFFLAGS:
             ifr->ifr_flags = rtdev->flags;
             break;
+            
+        case SIOCETHTOOL:
+            if(rtdev->do_ioctl != NULL)
+                ret = rtdev->do_ioctl( rtdev, request, arg);
+            else 
+                ret = -EOPNOTSUPP;
+            break;
 
         default:
             ret = -EOPNOTSUPP;
Index: drivers/rt_8139too.c
===================================================================
--- drivers/rt_8139too.c	(revision 1091)
+++ drivers/rt_8139too.c	(working copy)
@@ -39,6 +39,8 @@
 #include <linux/ioport.h>
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
+#include <linux/if.h>
+#include <linux/ethtool.h>
 #include <linux/rtnetlink.h>
 #include <linux/delay.h>
 #include <linux/ethtool.h>
@@ -524,6 +526,7 @@
 static int rtl8139_interrupt (rtdm_irq_t *irq_handle);
 static int rtl8139_start_xmit (struct rtskb *skb, struct rtnet_device *rtdev);
 
+static int rtl8139_ioctl(struct rtnet_device *rtdev, unsigned int request, void * cmd);
 
 static void rtl8139_init_ring (struct rtnet_device *rtdev);
 static void rtl8139_set_rx_mode (struct rtnet_device *rtdev);
@@ -833,6 +836,7 @@
         rtdev->stop = rtl8139_close;
         rtdev->hard_header = &rt_eth_header;
         rtdev->hard_start_xmit = rtl8139_start_xmit;
+        rtdev->do_ioctl = rtl8139_ioctl;
 
         /*rtdev->set_multicast_list = rtl8139_set_rx_mode; */
         rtdev->features |= NETIF_F_SG|NETIF_F_HW_CSUM;
@@ -1340,6 +1344,36 @@
         return 0;
 }
 
+static int rtl8139_ioctl(struct rtnet_device *rtdev, unsigned int request, void * arg)
+{
+    struct rtl8139_private *tp = rtdev->priv;
+    void *ioaddr = tp->mmio_addr;
+    int nReturn = 0;
+    struct ifreq         *ifr = arg;
+    struct ethtool_value *value;
+    switch( request )
+    {
+        case SIOCETHTOOL :
+        {
+            value = (struct ethtool_value *)ifr->ifr_data;
+            if( value->cmd == ETHTOOL_GLINK )
+            {
+                if(RTL_R16 (CSCR) & CSCR_LinkOKBit)
+                    value->data = 1;
+                else
+                    value->data = 0;
+            }
+            break;
+        }
+        default :
+        {
+            rtdm_printk("rtl8139_ioctl: IOCTL not implemented.\n");
+            nReturn = -EOPNOTSUPP;
+            break;
+        }
+    }
+    return nReturn;
+}
 
 static void rtl8139_tx_interrupt (struct rtnet_device *rtdev,
                                   struct rtl8139_private *tp,
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
RTnet-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rtnet-developers

Reply via email to