/* spider_net_write_phy reads from an arbitrary PHY register via the spider GPCROPCMD register  */
static int spider_net_read_phy(struct net_device *netdev, int mii_id, int reg)
/* spider_net_write_phy reads from an arbitrary PHY register via the spider GPCROPCMD register  */
static int spider_net_read_phy(struct net_device *netdev, int mii_id, int reg)
{
	struct spider_net_card *card = netdev_priv(netdev);
	u32 readvalue;
	readvalue = ((u32)mii_id << 21) | ((u32)reg << 16);
	spider_net_write_reg(card, SPIDER_NET_GPCROPCMD, readvalue);
	do {
		readvalue = spider_net_read_reg(card, SPIDER_NET_GPCROPCMD);
	} while (readvalue & SPIDER_NET_GPREXEC);
	readvalue &= SPIDER_NET_GPRDAT_MASK;
	return readvalue;
}