struct mii_ioctl_data *data = (struct mii_ioctl_data *)&ifr->ifr_data; 
struct mii_ioctl_data *data = if_mii(ifr); 
static int cas_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd){	struct cas *cp = netdev_priv(dev);	struct mii_ioctl_data *data = (struct mii_ioctl_data *)&ifr->ifr_data;	unsigned long flags;	int rc = -EOPNOTSUPP;		/* Hold the PM semaphore while doing ioctl's or we may collide	 * with open/close and power management and oops.	 */	down(&cp->pm_sem);	switch (cmd) {	case SIOCETHTOOL:		rc = cas_ethtool_ioctl(dev, ifr->ifr_data);		break;	case SIOCGMIIPHY:		/* Get address of MII PHY in use. */		data->phy_id = cp->phy_addr;		/* Fallthrough... */	case SIOCGMIIREG:		/* Read MII PHY register. */		spin_lock_irqsave(&cp->lock, flags);		cas_mif_poll(cp, 0);		data->val_out = cas_phy_read(cp, data->reg_num & 0x1f);		cas_mif_poll(cp, 1);		spin_unlock_irqrestore(&cp->lock, flags);		rc = 0;		break;	case SIOCSMIIREG:		/* Write MII PHY register. */		if (!capable(CAP_NET_ADMIN)) {			rc = -EPERM;			break;		}		spin_lock_irqsave(&cp->lock, flags);		cas_mif_poll(cp, 0);		rc = cas_phy_write(cp, data->reg_num & 0x1f, data->val_in);		cas_mif_poll(cp, 1);		spin_unlock_irqrestore(&cp->lock, flags);		break;	default:		break;	};	up(&cp->pm_sem);	return rc;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/46d7031ecb8a8360b0022abd8014f38cc1197166/cassini.c/buggy/drivers/net/cassini.c