+static int netdev_ioctl (struct net_device *dev, struct ifreq *rq, int cmd)
+{
+ struct r6040_private *lp = dev->priv;
+
+ RDC_DBUG("netdev_ioctl()", 0);
+ if (lp->switch_sig == 0x0243 && cmd == SIOCDEVPRIVATE)
+ {
+ unsigned long *data = (unsigned long *)rq->ifr_data, args[4];
+ int ioaddr = dev->base_addr;
+ unsigned int val;
+
+ data = (unsigned long *)rq->ifr_data;
+ if (copy_from_user(args, data, 4*sizeof(unsigned long)))
+ return -EFAULT;
+
+ /* port priority */
+ if(args[0]&(1<<31))phy_write(ioaddr,29,19,(phy_read(ioaddr,29,19)|0x2000)); /* port 0 */
+ if(args[0]&(1<<29))phy_write(ioaddr,29,19,(phy_read(ioaddr,29,19)|0x0020)); /* port 1 */
+ if(args[0]&(1<<27))phy_write(ioaddr,29,20,(phy_read(ioaddr,29,20)|0x2000)); /* port 2 */
+ if(args[0]&(1<<25))phy_write(ioaddr,29,20,(phy_read(ioaddr,29,20)|0x0020)); /* port 3 */
+
+ }
+ return -EOPNOTSUPP;
+}
+