| 127 | |
| 128 | |
| 129 | void FGmac_IntrHandler(void *Args) |
| 130 | { |
| 131 | Ft_Gmac_t *Gmac; |
| 132 | u32 RegValue; |
| 133 | u32 MACRegValue; |
| 134 | Ft_assertVoid(Args != NULL); |
| 135 | Gmac = (Ft_Gmac_t *)Args; |
| 136 | |
| 137 | RegValue = Ft_in32(Gmac->Config.BaseAddress + DMA_STATUS_OFFSET); |
| 138 | if ((RegValue)&DMA_STATUS_GLI) |
| 139 | { |
| 140 | MACRegValue = Ft_in32(Gmac->Config.BaseAddress + GMAC_MAC_MAC_PHY_STATUS); |
| 141 | if (Gmac->StatusHandler) |
| 142 | { |
| 143 | Gmac->StatusHandler(Gmac->StatusArgs, MACRegValue); |
| 144 | } |
| 145 | } |
| 146 | |
| 147 | /* Frame received */ |
| 148 | if ((RegValue & (DMA_STATUS_RI)) != 0) |
| 149 | { |
| 150 | if (Gmac->RecvHandler) |
| 151 | { |
| 152 | Gmac->RecvHandler(Gmac->RecvArgs); |
| 153 | } |
| 154 | |
| 155 | Ft_out32(Gmac->Config.BaseAddress + DMA_STATUS_OFFSET, DMA_STATUS_RI); |
| 156 | } |
| 157 | else if ((RegValue & DMA_STATUS_TI) == DMA_STATUS_TI) |
| 158 | { |
| 159 | Ft_printf("DMA_STATUS_TI %x \r\n", RegValue); |
| 160 | Ft_printf("ti debug %x \r\n", Ft_in32(Gmac->Config.BaseAddress + GMAC_INTERNAL_MODULE_STATUS_OFFSET)); |
| 161 | |
| 162 | Ft_out32(Gmac->Config.BaseAddress + DMA_STATUS_OFFSET, DMA_STATUS_TI); |
| 163 | } |
| 164 | |
| 165 | Ft_out32(Gmac->Config.BaseAddress + DMA_STATUS_OFFSET, DMA_STATUS_NIS); |
| 166 | |
| 167 | /* DMA Error */ |
| 168 | if ((Ft_in32(Gmac->Config.BaseAddress + DMA_STATUS_OFFSET) & DMA_STATUS_AIS) == DMA_STATUS_AIS) |
| 169 | { |
| 170 | if (Gmac->ErrorHandler) |
| 171 | Gmac->ErrorHandler(Gmac->ErrorArgs, FGmac_ErrorCheck(Gmac)); |
| 172 | Ft_out32(Gmac->Config.BaseAddress + DMA_STATUS_OFFSET, Ft_in32(Gmac->Config.BaseAddress + DMA_STATUS_OFFSET)); |
| 173 | } |
| 174 | } |
no test coverage detected