Messages in this thread | | | Date | Fri, 3 Apr 2020 15:55:04 +0200 (CEST) | From | Julia Lawall <> | Subject | question about drivers/atm/iphase.c |
| |
Hello,
The function ia_frontend_intr in iphase.c contains the following code:
if (iadev->phy_type & FE_25MBIT_PHY) { status = ia_phy_read32(iadev, MB25_INTR_STATUS); iadev->carrier_detect = (status & MB25_IS_GSB) ? 1 : 0; } else if (iadev->phy_type & FE_DS3_PHY) { ia_phy_read32(iadev, SUNI_DS3_FRM_INTR_STAT); status = ia_phy_read32(iadev, SUNI_DS3_FRM_STAT); iadev->carrier_detect = (status & SUNI_DS3_LOSV) ? 0 : 1; } else if (iadev->phy_type & FE_E3_PHY) { ia_phy_read32(iadev, SUNI_E3_FRM_MAINT_INTR_IND); status = ia_phy_read32(iadev, SUNI_E3_FRM_FRAM_INTR_IND_STAT); iadev->carrier_detect = (status & SUNI_E3_LOS) ? 0 : 1; } else { status = ia_phy_read32(iadev, SUNI_RSOP_STATUS); iadev->carrier_detect = (status & SUNI_LOSV) ? 0 : 1; }
Specifically, the second if does a bit and with FE_DS3_PHY and the third if does a bit and with FE_E3_PHY. According to drivers/atm/iphase.h, the former is 0x0080 and the latter is 0x0090. Therefore, if the third test would be true, it will never be reached. How should the code be changed?
thanks, julia
| |