+ desc->supported |= OFPPF_10GB_FD;
+ if (ecmd.supported & SUPPORTED_TP)
+ desc->supported |= OFPPF_COPPER;
+ if (ecmd.supported & SUPPORTED_FIBRE)
+ desc->supported |= OFPPF_FIBER;
+ if (ecmd.supported & SUPPORTED_Autoneg)
+ desc->supported |= OFPPF_AUTONEG;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14)
+ if (ecmd.supported & SUPPORTED_Pause)
+ desc->supported |= OFPPF_PAUSE;
+ if (ecmd.supported & SUPPORTED_Asym_Pause)
+ desc->supported |= OFPPF_PAUSE_ASYM;
+#endif /* kernel >= 2.6.14 */
+
+ /* Set the advertised features */
+ if (ecmd.advertising & ADVERTISED_10baseT_Half)
+ desc->advertised |= OFPPF_10MB_HD;
+ if (ecmd.advertising & ADVERTISED_10baseT_Full)
+ desc->advertised |= OFPPF_10MB_FD;
+ if (ecmd.advertising & ADVERTISED_100baseT_Half)
+ desc->advertised |= OFPPF_100MB_HD;
+ if (ecmd.advertising & ADVERTISED_100baseT_Full)
+ desc->advertised |= OFPPF_100MB_FD;
+ if (ecmd.advertising & ADVERTISED_1000baseT_Half)
+ desc->advertised |= OFPPF_1GB_HD;
+ if (ecmd.advertising & ADVERTISED_1000baseT_Full)
+ desc->advertised |= OFPPF_1GB_FD;
+ if (ecmd.advertising & ADVERTISED_10000baseT_Full)
+ desc->advertised |= OFPPF_10GB_FD;
+ if (ecmd.advertising & ADVERTISED_TP)
+ desc->advertised |= OFPPF_COPPER;
+ if (ecmd.advertising & ADVERTISED_FIBRE)
+ desc->advertised |= OFPPF_FIBER;
+ if (ecmd.advertising & ADVERTISED_Autoneg)
+ desc->advertised |= OFPPF_AUTONEG;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14)
+ if (ecmd.advertising & ADVERTISED_Pause)
+ desc->advertised |= OFPPF_PAUSE;
+ if (ecmd.advertising & ADVERTISED_Asym_Pause)
+ desc->advertised |= OFPPF_PAUSE_ASYM;
+#endif /* kernel >= 2.6.14 */
+
+ /* Set the current features */
+ if (ecmd.speed == SPEED_10)
+ desc->curr = (ecmd.duplex) ? OFPPF_10MB_FD : OFPPF_10MB_HD;
+ else if (ecmd.speed == SPEED_100)
+ desc->curr = (ecmd.duplex) ? OFPPF_100MB_FD : OFPPF_100MB_HD;
+ else if (ecmd.speed == SPEED_1000)
+ desc->curr = (ecmd.duplex) ? OFPPF_1GB_FD : OFPPF_1GB_HD;
+ else if (ecmd.speed == SPEED_10000)
+ desc->curr = OFPPF_10GB_FD;
+
+ if (ecmd.port == PORT_TP)
+ desc->curr |= OFPPF_COPPER;
+ else if (ecmd.port == PORT_FIBRE)
+ desc->curr |= OFPPF_FIBER;
+
+ if (ecmd.autoneg)
+ desc->curr |= OFPPF_AUTONEG;