Fixed a small bug. But it still says media is inactive whereas the interrupt displays "link is up".

CPU usage is also always at 100% for some reason.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34992 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Adrien Destugues 2010-01-10 19:45:05 +00:00
parent 6a6b71135a
commit 2d6539b687

View File

@ -36,6 +36,7 @@
#define GPCR 0x1E // General purpose control
#define GPR 0x1F // General purpose
#define NCR_EXT_PHY 0x80 // External PHY
#define NCR_FDX 0x08 // Full duplex
#define NCR_LBK 0x06 // Loopback mode
@ -733,6 +734,8 @@ DavicomDevice::StartDevice()
TRACE_ALWAYS("Error reading NCR: %#010x.\n", result);
return result;
}
if (tmp_reg & NCR_EXT_PHY)
TRACE_ALWAYS("Device uses external PHY\n");
tmp_reg &= ~NCR_LBK;
result = _Write1Register(NCR, tmp_reg);
if (result != B_OK) {
@ -830,7 +833,7 @@ DavicomDevice::GetLinkState(ether_link_state *linkState)
linkState->quality = 1000;
uint16 mediumStatus = IFM_ETHER | IFM_100_TX;
if (tmp_reg & NSR_LINKST) {
if (fHasConnection) {
mediumStatus |= IFM_ACTIVE;
result = _ReadRegister(NCR,1,&tmp_reg);
if (result != B_OK)
@ -845,6 +848,8 @@ DavicomDevice::GetLinkState(ether_link_state *linkState)
mediumStatus |= IFM_LOOP;
}
linkState->media = mediumStatus;
TRACE_FLOW("Medium state: %s, %lld MBit/s, %s duplex.\n",
(linkState->media & IFM_ACTIVE) ? "active" : "inactive",
linkState->speed / 1000,