First checks for fixed gigabit ports which are always full duplex. Next checks the port administrative speed (portAdminSpeed) which if set to autonegotiate then the duplex will also autonegotiate, otherwise it uses the reported port duplex (portDuplex).