static int sbmac_mii_ioctl(struct net_device *dev, struct ifreq *rq, int cmd){	struct sbmac_softc *sc = netdev_priv(dev);	u16 *data = (u16 *)&rq->ifr_ifru;	unsigned long flags;	int retval;		spin_lock_irqsave(&sc->sbm_lock, flags);	retval = 0;		switch(cmd) {	case SIOCDEVPRIVATE:		/* Get the address of the PHY in use. */		data[0] = sc->sbm_phys[0] & 0x1f;		/* Fall Through */	case SIOCDEVPRIVATE+1:		/* Read the specified MII register. */		data[3] = sbmac_mii_read(sc, data[0] & 0x1f, data[1] & 0x1f);		break;	case SIOCDEVPRIVATE+2:		/* Write the specified MII register */		if (!capable(CAP_NET_ADMIN)) {			retval = -EPERM;			break;		}		if (debug > 1) {		    printk(KERN_DEBUG "%s: sbmac_mii_ioctl: write %02X %02X %02X\n",dev->name,		       data[0],data[1],data[2]);		    }		sbmac_mii_write(sc, data[0] & 0x1f, data[1] & 0x1f, data[2]);		break;	default:		retval = -EOPNOTSUPP;	}		spin_unlock_irqrestore(&sc->sbm_lock, flags);	return retval;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/74b0247fbd4b6ed1693a420d85cf50267d840ef4/sb1250-mac.c/buggy/drivers/net/sb1250-mac.c