i8254xGBe.cc (12087:0e082672ac6b) | i8254xGBe.cc (12392:e0dbdf30a2a5) |
---|---|
1/* 2 * Copyright (c) 2006 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 2276 unchanged lines hidden (view full) --- 2285 2286 // If the packet is done check for interrupts/descriptors/etc 2287 if (rxDescCache.packetDone()) { 2288 rxDmaPacket = false; 2289 DPRINTF(EthernetSM, "RXS: Packet completed DMA to memory\n"); 2290 int descLeft = rxDescCache.descLeft(); 2291 DPRINTF(EthernetSM, "RXS: descLeft: %d rdmts: %d rdlen: %d\n", 2292 descLeft, regs.rctl.rdmts(), regs.rdlen()); | 1/* 2 * Copyright (c) 2006 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 2276 unchanged lines hidden (view full) --- 2285 2286 // If the packet is done check for interrupts/descriptors/etc 2287 if (rxDescCache.packetDone()) { 2288 rxDmaPacket = false; 2289 DPRINTF(EthernetSM, "RXS: Packet completed DMA to memory\n"); 2290 int descLeft = rxDescCache.descLeft(); 2291 DPRINTF(EthernetSM, "RXS: descLeft: %d rdmts: %d rdlen: %d\n", 2292 descLeft, regs.rctl.rdmts(), regs.rdlen()); |
2293 switch (regs.rctl.rdmts()) { 2294 case 2: if (descLeft > .125 * regs.rdlen()) break; 2295 case 1: if (descLeft > .250 * regs.rdlen()) break; 2296 case 0: if (descLeft > .500 * regs.rdlen()) break; | 2293 2294 // rdmts 2->1/8, 1->1/4, 0->1/2 2295 int ratio = (1ULL << (regs.rctl.rdmts() + 1)); 2296 if (descLeft * ratio <= regs.rdlen()) { |
2297 DPRINTF(Ethernet, "RXS: Interrupting (RXDMT) " 2298 "because of descriptors left\n"); 2299 postInterrupt(IT_RXDMT); | 2297 DPRINTF(Ethernet, "RXS: Interrupting (RXDMT) " 2298 "because of descriptors left\n"); 2299 postInterrupt(IT_RXDMT); |
2300 break; | |
2301 } 2302 2303 if (rxFifo.empty()) 2304 rxDescCache.writeback(0); 2305 2306 if (descLeft == 0) { 2307 anBegin("RXS", "Writeback Descriptors"); 2308 rxDescCache.writeback(0); --- 277 unchanged lines hidden --- | 2300 } 2301 2302 if (rxFifo.empty()) 2303 rxDescCache.writeback(0); 2304 2305 if (descLeft == 0) { 2306 anBegin("RXS", "Writeback Descriptors"); 2307 rxDescCache.writeback(0); --- 277 unchanged lines hidden --- |