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