[go: up one dir, main page]

Menu

#97 ioctl implementation

important
closed-wont-fix
8139too (65)
5
2004-08-20
2002-12-24
Anonymous
No

static int netdev_ioctl (struct net_device *dev, struct ifreq
*rq, int cmd)
{
struct rtl8139_private *tp = dev->priv;
struct mii_ioctl_data *data = (struct mii_ioctl_data
*)&rq->ifr_data;
int rc = 0;
int phy = tp->phys[0] & 0x3f;

if (!netif_running(dev)) <==============
return -EINVAL; <==============
....
Hi all,

I have a qustion about the driver 8139too.c. Why should
we force the running state up before we do ioctl action? I
think user should be allowed to setup some parameters
even the nic is down.
Thanks and Merry Christmas.

Regards,

James Ding

Discussion

  • Jeff Garzik

    Jeff Garzik - 2003-01-06

    Logged In: YES
    user_id=17443

    The NIC and the MAC are assumed to be in the power-off state
    when the interface is down.

    This is an area where the driver is incomplete: the
    netif_running() test you indicate should indeed be removed:
    but only after the proper power management code is added to
    ensure that the hardware is "alive" to accept your changes.
    Further, it might be pointless to power-up sleeping
    hardware, talk to it, and power it down. It would perhaps
    better serve the user to write code which validated then
    stored the requested changes in temporary storage. When the
    interface is next up'd, program the hardware accordingly.

    If the hardware is never put to sleep, then yes, it also
    makes sense to dispense with the netif_running() test for
    that case.

     
  • Jeff Garzik

    Jeff Garzik - 2003-01-06
    • assigned_to: nobody --> jgarzik
     
  • Jeff Garzik

    Jeff Garzik - 2004-08-17

    Logged In: YES
    user_id=17443

    Linux kernel bugs should now be reported to bugme.osdl.org.

     
  • Jeff Garzik

    Jeff Garzik - 2004-08-17
    • status: open --> open-rejected
     
  • Jeff Garzik

    Jeff Garzik - 2004-08-20
    • status: open-rejected --> closed-wont-fix
     

Log in to post a comment.