Jorge Almeida wrote:
> 
> Jan,
> 
> please consider the new patch for the link beat functionality using the 
> ethtool structure.
> 
> 
> Any comments??!!

Looks OK, find just one issue below. For the nitpicking (coding style
etc.) see my previous review.

[please trim your replies...]

> ------------------------------------------------------------------------
> 
> 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:
> +            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;
> +        }
> +    }
> +    rtdev_dereference(rtdev);

rtdev is already dereferenced in rt_socket_if_ioctl.

> +    return nReturn;
> +}
> 
> 

Jan

Attachment: signature.asc
Description: OpenPGP digital signature

-------------------------------------------------------------------------
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