Lines Matching defs:ethDevice
52 static bool IsLinkUp(struct EthDevice *ethDevice)
56 if (NetIfGetLinkStatus(ethDevice->netdev, &status) != 0) {
79 struct EthDevice *ethDevice = (struct EthDevice *)arg;
80 struct EthDrvSc *drvSc = (struct EthDrvSc *)ethDevice->priv;
86 if (IsLinkUp(ethDevice) && !linkStatus) {
87 NetIfSetLinkStatus(ethDevice->netdev, NETIF_LINK_DOWN);
88 } else if (!IsLinkUp(ethDevice) && linkStatus) {
89 NetIfSetLinkStatus(ethDevice->netdev, NETIF_LINK_UP);
95 struct EthDevice *ethDevice = (struct EthDevice *)arg;
96 struct EthDrvSc *drvSc = (struct EthDrvSc *)ethDevice->priv;
103 RestartTimer(&priv->monitorTimer, HIETH_MONITOR_TIME, HiethMonitorFunc, (uintptr_t)ethDevice);
107 static void EthDrvRecv(struct EthDevice *ethDevice, NetBuf *netBuf)
109 struct EthDrvSc *drvSc = (struct EthDrvSc *)ethDevice->priv;
118 NetIfRxNi(ethDevice->netdev, netBuf);
121 void UnRegisterTimerFunction(struct EthDevice *ethDevice)
123 struct EthDrvSc *drvInfo = (struct EthDrvSc *)(ethDevice->priv);
162 struct EthDevice *ethDevice = (struct EthDevice *)arg;
163 struct EthDrvSc *drvSc = (struct EthDrvSc *)ethDevice->priv;
170 (drvSc->funs->deliver)(ethDevice);
176 static int32_t CreateEthIrqThread(struct EthDevice *ethDevice)
185 if (OsalThreadCreate(&thread, HisiEthDsr, (void *)ethDevice) != HDF_SUCCESS) {
207 static int32_t HiethCanSend(struct EthDevice *ethDevice)
210 struct EthDrvSc *drvSc = (struct EthDrvSc *)ethDevice->priv;
246 static void HiethSend(struct EthDevice *ethDevice, NetBuf *netBuf)
248 struct EthDrvSc *drvSc = (struct EthDrvSc *)ethDevice->priv;
259 static void HiethDeliver(struct EthDevice *ethDevice)
261 struct EthDrvSc *drvSc = (struct EthDrvSc *)ethDevice->priv;
299 EthDrvRecv(ethDevice, netBuf);
304 RestartTimer(&priv->monitorTimer, HIETH_MONITOR_TIME, HiethMonitorFunc, (uintptr_t)ethDevice);
332 static int32_t HiethIntVector(struct EthDevice *ethDevice)
337 void EthDrvSend(struct EthDevice *ethDevice, NetBuf *netBuf)
339 struct EthDrvSc *drvSc = (struct EthDrvSc *)ethDevice->priv;
343 if (!(drvSc->funs->canSend)(ethDevice)) {
347 (drvSc->funs->send)(ethDevice, netBuf);
367 void HiethLinkStatusChanged(struct EthDevice *ethDevice)
369 struct EthDrvSc *drvSc = (struct EthDrvSc *)ethDevice->priv;
380 if (IsLinkUp(ethDevice)) {
407 if (IsLinkUp(ethDevice)) {
414 uint8_t HiethSetHwaddr(struct EthDevice *ethDevice, uint8_t *addr, uint8_t len)
416 HiethPriv *priv = (HiethPriv *)((struct EthDrvSc *)ethDevice->priv)->driverPrivate;
446 bool HiethHwInit(struct EthDevice *ethDevice)
448 struct EthDrvSc *drvSc = (struct EthDrvSc *)ethDevice->priv;
528 void RegisterHiethData(struct EthDevice *ethDevice)
533 struct EthDrvSc *drvSc = (struct EthDrvSc *)ethDevice->priv;
536 ret = CreateEthIrqThread(ethDevice);
547 if (OsalTimerCreate(&priv->phyTimer, PHY_STATE_TIME, PhyStateMachine, (uintptr_t)ethDevice) != HDF_SUCCESS) {
584 int32_t HiethInit(struct EthDevice *ethDevice)
586 if (ethDevice == NULL) {
599 struct ConfigEthDevList *config = ethDevice->config;
608 HiethHwInit(ethDevice);
617 struct HiethNetdevLocal *GetHiethNetDevLocal(struct EthDevice *ethDevice)
620 if (ethDevice == NULL) {
624 struct EthDrvSc *drvSc = (struct EthDrvSc *)ethDevice->priv;
634 int ethnet_hieth_init(struct EthDevice *ethDevice)