[meta-freescale] fec_main.c patch ENGR00275371 (2013-10-30) prevents use of MII ioctls

Carlos Sánchez de La Lama csanchezdll at gmail.com
Fri Feb 19 07:16:51 PST 2016


Hi all,

I was trying so use MII ioctls (SIOCGMIIPHY & SIOG{G,M}MIIREG) to access
registers of the PHY attached to FEC MAC in an iMX6 using Freescale
BSP. I noticed they were failing, so after some debug I found that this
patch (author and commiter cc'ed):

http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/commit/drivers/net/ethernet/freescale/fec_main.c?h=imx_3.10.17_1.0.0_ga&id=8eeda5ac98beb9e43f5a76ae77af3251c0b97ec8

includes the following modification:

@@ -1656,8 +1677,11 @@ static int fec_enet_ioctl(struct net_device
*ndev, struct ifreq *rq, int cmd)
       if (!phydev)
          return -ENODEV;

-       if (cmd == SIOCSHWTSTAMP && fep->bufdesc_ex)
+       if (((cmd == SIOCSHWTSTAMP) || ((cmd >= PTP_ENBL_TXTS_IOCTL) &&
+          (cmd <= PTP_FLUSH_TIMESTAMP))) && fep->bufdesc_ex)
                return fec_ptp_ioctl(ndev, rq, cmd);
+       else if (fep->bufdesc_ex)
+               return -ENODEV;

        return phy_mii_ioctl(phydev, rq, cmd);
 }

which effectively prevents phy_mii_ioctl to be reached (the code will
always return through one of the if/else branches). The code in the repo
seems to be unchanged since that patch. 

After removing else branch on my local sources, I am able to use the
ioctls. 

BR

Carlos


More information about the meta-freescale mailing list