Lines Matching defs:etdev
105 void ConfigMACRegs1(struct et131x_adapter *etdev)
107 struct _MAC_t __iomem *pMac = &etdev->regs->mac;
139 station2.bits.Octet1 = etdev->CurrentAddress[0];
140 station2.bits.Octet2 = etdev->CurrentAddress[1];
141 station1.bits.Octet3 = etdev->CurrentAddress[2];
142 station1.bits.Octet4 = etdev->CurrentAddress[3];
143 station1.bits.Octet5 = etdev->CurrentAddress[4];
144 station1.bits.Octet6 = etdev->CurrentAddress[5];
155 writel(etdev->RegistryJumboPacket + 4, &pMac->max_fm_len);
165 void ConfigMACRegs2(struct et131x_adapter *etdev)
168 struct _MAC_t __iomem *pMac = &etdev->regs->mac;
174 ctl = readl(&etdev->regs->txmac.ctl);
181 if (etdev->linkspeed == TRUEPHY_SPEED_1000MBPS) {
194 if (etdev->FlowControl == RxOnly || etdev->FlowControl == Both)
205 if (etdev->duplex_mode)
209 if (!etdev->duplex_mode)
222 dev_warn(&etdev->pdev->dev,
229 writel(ctl, &etdev->regs->txmac.ctl);
232 if (etdev->Flags & fMP_ADAPTER_LOWER_POWER) {
233 et131x_rx_dma_enable(etdev);
234 et131x_tx_dma_enable(etdev);
238 void ConfigRxMacRegs(struct et131x_adapter *etdev)
240 struct _RXMAC_t __iomem *pRxMac = &etdev->regs->rxmac;
283 sa_lo.bits.sa3 = etdev->CurrentAddress[2];
284 sa_lo.bits.sa4 = etdev->CurrentAddress[3];
285 sa_lo.bits.sa5 = etdev->CurrentAddress[4];
286 sa_lo.bits.sa6 = etdev->CurrentAddress[5];
289 sa_hi.bits.sa1 = etdev->CurrentAddress[0];
290 sa_hi.bits.sa2 = etdev->CurrentAddress[1];
297 if (etdev->PacketFilter & ET131X_PACKET_TYPE_DIRECTED) {
298 SetupDeviceForUnicast(etdev);
307 if (!(etdev->PacketFilter & ET131X_PACKET_TYPE_ALL_MULTICAST)) {
309 SetupDeviceForMulticast(etdev);
316 if (etdev->RegistryJumboPacket > 8192)
353 if (etdev->linkspeed == TRUEPHY_SPEED_100MBPS)
368 void ConfigTxMacRegs(struct et131x_adapter *etdev)
370 struct txmac_regs *txmac = &etdev->regs->txmac;
376 if (etdev->FlowControl == None)
382 void ConfigMacStatRegs(struct et131x_adapter *etdev)
385 &etdev->regs->macstat;
414 void ConfigFlowControl(struct et131x_adapter *etdev)
416 if (etdev->duplex_mode == 0) {
417 etdev->FlowControl = None;
421 ET1310_PhyAccessMiBit(etdev,
423 ET1310_PhyAccessMiBit(etdev,
429 etdev->FlowControl = etdev->RegistryFlowControl;
432 if (etdev->RegistryFlowControl == Both)
433 etdev->FlowControl = Both;
435 etdev->FlowControl = None;
438 etdev->FlowControl = None;
441 if (etdev->RegistryFlowControl == Both)
442 etdev->FlowControl = RxOnly;
444 etdev->FlowControl = None;
451 * @etdev: pointer to the adapter structure
453 void UpdateMacStatHostCounters(struct et131x_adapter *etdev)
455 struct _ce_stats_t *stats = &etdev->Stats;
457 &etdev->regs->macstat;
479 * @etdev: pointer to the adapter structure
485 void HandleMacStatInterrupt(struct et131x_adapter *etdev)
493 Carry1 = readl(&etdev->regs->macstat.Carry1);
494 Carry2 = readl(&etdev->regs->macstat.Carry2);
496 writel(Carry1, &etdev->regs->macstat.Carry1);
497 writel(Carry2, &etdev->regs->macstat.Carry2);
506 etdev->Stats.code_violations += COUNTER_WRAP_16_BIT;
508 etdev->Stats.alignment_err += COUNTER_WRAP_12_BIT;
510 etdev->Stats.length_err += COUNTER_WRAP_16_BIT;
512 etdev->Stats.other_errors += COUNTER_WRAP_16_BIT;
514 etdev->Stats.crc_err += COUNTER_WRAP_16_BIT;
516 etdev->Stats.rx_ov_flow += COUNTER_WRAP_16_BIT;
518 etdev->Stats.norcvbuf += COUNTER_WRAP_16_BIT;
520 etdev->Stats.max_pkt_error += COUNTER_WRAP_12_BIT;
522 etdev->Stats.tx_uflo += COUNTER_WRAP_12_BIT;
524 etdev->Stats.first_collision += COUNTER_WRAP_12_BIT;
526 etdev->Stats.tx_deferred += COUNTER_WRAP_12_BIT;
528 etdev->Stats.excessive_collisions += COUNTER_WRAP_12_BIT;
530 etdev->Stats.late_collisions += COUNTER_WRAP_12_BIT;
532 etdev->Stats.collisions += COUNTER_WRAP_12_BIT;
535 void SetupDeviceForMulticast(struct et131x_adapter *etdev)
537 struct _RXMAC_t __iomem *rxmac = &etdev->regs->rxmac;
551 if (etdev->PacketFilter & ET131X_PACKET_TYPE_MULTICAST) {
553 for (nIndex = 0; nIndex < etdev->MCAddressCount; nIndex++) {
554 result = ether_crc(6, etdev->MCList[nIndex]);
574 pm_csr = readl(&etdev->regs->global.pm_csr);
583 void SetupDeviceForUnicast(struct et131x_adapter *etdev)
585 struct _RXMAC_t __iomem *rxmac = &etdev->regs->rxmac;
600 uni_pf3.bits.addr1_1 = etdev->CurrentAddress[0];
601 uni_pf3.bits.addr1_2 = etdev->CurrentAddress[1];
602 uni_pf3.bits.addr2_1 = etdev->CurrentAddress[0];
603 uni_pf3.bits.addr2_2 = etdev->CurrentAddress[1];
605 uni_pf2.bits.addr2_3 = etdev->CurrentAddress[2];
606 uni_pf2.bits.addr2_4 = etdev->CurrentAddress[3];
607 uni_pf2.bits.addr2_5 = etdev->CurrentAddress[4];
608 uni_pf2.bits.addr2_6 = etdev->CurrentAddress[5];
610 uni_pf1.bits.addr1_3 = etdev->CurrentAddress[2];
611 uni_pf1.bits.addr1_4 = etdev->CurrentAddress[3];
612 uni_pf1.bits.addr1_5 = etdev->CurrentAddress[4];
613 uni_pf1.bits.addr1_6 = etdev->CurrentAddress[5];
615 pm_csr = readl(&etdev->regs->global.pm_csr);