ioctl implementation
Brought to you by:
jgarzik
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
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.
Logged In: YES
user_id=17443
Linux kernel bugs should now be reported to bugme.osdl.org.