Lines Matching refs:inf_3c90x
99 static void a3c90x_internal_SetWindow(struct INF_3C90X *inf_3c90x, int window) in a3c90x_internal_SetWindow() argument
103 if (inf_3c90x->CurrentWindow == window) in a3c90x_internal_SetWindow()
107 a3c90x_internal_IssueCommand(inf_3c90x->IOAddr, in a3c90x_internal_SetWindow()
109 inf_3c90x->CurrentWindow = window; in a3c90x_internal_SetWindow()
114 static void a3c90x_internal_WaitForEeprom(struct INF_3C90X *inf_3c90x) in a3c90x_internal_WaitForEeprom() argument
120 while (eepromBusy & inw(inf_3c90x->IOAddr + regEepromCommand_0_w)) { in a3c90x_internal_WaitForEeprom()
144 struct INF_3C90X *inf_3c90x = in a3c90x_internal_ReadEeprom() local
153 a3c90x_internal_SetWindow(inf_3c90x, winEepromBios0); in a3c90x_internal_ReadEeprom()
156 address += (inf_3c90x->is3c556 ? eepromRead_556 : eepromRead); in a3c90x_internal_ReadEeprom()
158 a3c90x_internal_WaitForEeprom(inf_3c90x); in a3c90x_internal_ReadEeprom()
160 outw(address, inf_3c90x->IOAddr + regEepromCommand_0_w); in a3c90x_internal_ReadEeprom()
161 a3c90x_internal_WaitForEeprom(inf_3c90x); in a3c90x_internal_ReadEeprom()
164 *dest = inw(inf_3c90x->IOAddr + regEepromData_0_w); in a3c90x_internal_ReadEeprom()
186 static void a3c90x_internal_ReadEepromContents(struct INF_3C90X *inf_3c90x) in a3c90x_internal_ReadEepromContents() argument
188 int eeprom_size = (inf_3c90x->isBrev ? 0x20 : 0x17) * 2; in a3c90x_internal_ReadEepromContents()
192 nvs_read(&inf_3c90x->nvs, 0, inf_3c90x->eeprom, eeprom_size); in a3c90x_internal_ReadEepromContents()
204 static void a3c90x_reset(struct INF_3C90X *inf_3c90x) in a3c90x_reset() argument
209 a3c90x_internal_IssueCommand(inf_3c90x->IOAddr, cmdGlobalReset, 0); in a3c90x_reset()
214 a3c90x_internal_SetWindow(inf_3c90x, winAddressing2); in a3c90x_reset()
215 outw(0, inf_3c90x->IOAddr + regStationMask_2_3w + 0); in a3c90x_reset()
216 outw(0, inf_3c90x->IOAddr + regStationMask_2_3w + 2); in a3c90x_reset()
217 outw(0, inf_3c90x->IOAddr + regStationMask_2_3w + 4); in a3c90x_reset()
220 a3c90x_internal_IssueCommand(inf_3c90x->IOAddr, cmdTxReset, 0); in a3c90x_reset()
222 a3c90x_internal_IssueCommand(inf_3c90x->IOAddr, cmdTxEnable, 0); in a3c90x_reset()
228 a3c90x_internal_IssueCommand(inf_3c90x->IOAddr, cmdRxReset, in a3c90x_reset()
229 inf_3c90x->isBrev ? 0x04 : 0x00); in a3c90x_reset()
231 a3c90x_internal_IssueCommand(inf_3c90x->IOAddr, cmdRxEnable, 0); in a3c90x_reset()
233 a3c90x_internal_IssueCommand(inf_3c90x->IOAddr, in a3c90x_reset()
236 a3c90x_internal_IssueCommand(inf_3c90x->IOAddr, in a3c90x_reset()
240 a3c90x_internal_IssueCommand(inf_3c90x->IOAddr, in a3c90x_reset()
328 struct INF_3C90X *inf_3c90x = netdev_priv(netdev); in a3c90x_transmit() local
337 if (inf_3c90x->tx_cnt == TX_RING_SIZE) { in a3c90x_transmit()
342 inf_3c90x->tx_iobuf[inf_3c90x->tx_cur] = iob; in a3c90x_transmit()
343 tx_cur_desc = inf_3c90x->tx_ring + inf_3c90x->tx_cur; in a3c90x_transmit()
345 tx_prev_desc = inf_3c90x->tx_ring + in a3c90x_transmit()
346 (((inf_3c90x->tx_cur + TX_RING_SIZE) - 1) % TX_RING_SIZE); in a3c90x_transmit()
358 fshTxIndicate | (inf_3c90x->isBrev ? 0x00 : len); in a3c90x_transmit()
368 a3c90x_internal_IssueCommand(inf_3c90x->IOAddr, cmdStallCtl, in a3c90x_transmit()
373 downlist_ptr = inl(inf_3c90x->IOAddr + regDnListPtr_l); in a3c90x_transmit()
377 inf_3c90x->IOAddr + regDnListPtr_l); in a3c90x_transmit()
381 a3c90x_internal_IssueCommand(inf_3c90x->IOAddr, cmdStallCtl, in a3c90x_transmit()
384 inf_3c90x->tx_cur = (inf_3c90x->tx_cur + 1) % TX_RING_SIZE; in a3c90x_transmit()
385 inf_3c90x->tx_cnt++; in a3c90x_transmit()
618 struct INF_3C90X *inf_3c90x = netdev_priv(netdev); in a3c90x_remove() local
622 a3c90x_reset(inf_3c90x); in a3c90x_remove()
625 outw(cmdRxDisable, inf_3c90x->IOAddr + regCommandIntStatus_w); in a3c90x_remove()
626 outw(cmdTxDisable, inf_3c90x->IOAddr + regCommandIntStatus_w); in a3c90x_remove()
664 struct INF_3C90X *inf_3c90x = netdev_priv(netdev); in a3c90x_hw_start() local
669 if (inf_3c90x->is3c556) { in a3c90x_hw_start()
671 a3c90x_internal_SetWindow(inf_3c90x, winAddressing2); in a3c90x_hw_start()
672 tmp = inw(inf_3c90x->IOAddr + regResetOptions_2_w); in a3c90x_hw_start()
674 outw(tmp, inf_3c90x->IOAddr + regResetOptions_2_w); in a3c90x_hw_start()
678 a3c90x_internal_SetWindow(inf_3c90x, winAddressing2); in a3c90x_hw_start()
681 inf_3c90x->IOAddr + regStationAddress_2_3w + i); in a3c90x_hw_start()
683 outb(0, inf_3c90x->IOAddr + regStationMask_2_3w + i); in a3c90x_hw_start()
691 a3c90x_internal_SetWindow(inf_3c90x, winTxRxOptions3); in a3c90x_hw_start()
692 mopt = inw(inf_3c90x->IOAddr + regResetMediaOptions_3_w); in a3c90x_hw_start()
695 if (!inf_3c90x->isBrev) { in a3c90x_hw_start()
737 if (inf_3c90x->isBrev) { in a3c90x_hw_start()
738 if ((inf_3c90x->eeprom[0x16] & 0xFF00) == XCVR_MAGIC) { in a3c90x_hw_start()
740 linktype = inf_3c90x->eeprom[0x16] & 0x000F; in a3c90x_hw_start()
745 if (inf_3c90x->isBrev) in a3c90x_hw_start()
753 a3c90x_internal_IssueCommand(inf_3c90x->IOAddr, in a3c90x_hw_start()
758 a3c90x_internal_SetWindow(inf_3c90x, winTxRxOptions3); in a3c90x_hw_start()
759 cfg = inl(inf_3c90x->IOAddr + regInternalConfig_3_l); in a3c90x_hw_start()
766 outl(cfg, inf_3c90x->IOAddr + regInternalConfig_3_l); in a3c90x_hw_start()
769 a3c90x_internal_IssueCommand(inf_3c90x->IOAddr, cmdTxReset, 0x00); in a3c90x_hw_start()
771 if (!inf_3c90x->isBrev) in a3c90x_hw_start()
772 outb(0x01, inf_3c90x->IOAddr + regTxFreeThresh_b); in a3c90x_hw_start()
775 a3c90x_internal_IssueCommand(inf_3c90x->IOAddr, cmdSetRxFilter, in a3c90x_hw_start()
782 a3c90x_internal_IssueCommand(inf_3c90x->IOAddr, in a3c90x_hw_start()
785 a3c90x_internal_IssueCommand(inf_3c90x->IOAddr, in a3c90x_hw_start()
788 a3c90x_internal_IssueCommand(inf_3c90x->IOAddr, in a3c90x_hw_start()
803 struct INF_3C90X *inf_3c90x = netdev_priv(netdev); in a3c90x_open() local
809 rc = a3c90x_setup_tx_ring(inf_3c90x); in a3c90x_open()
815 rc = a3c90x_setup_rx_ring(inf_3c90x); in a3c90x_open()
822 outl(virt_to_bus(inf_3c90x->rx_ring), in a3c90x_open()
823 inf_3c90x->IOAddr + regUpListPtr_l); in a3c90x_open()
826 a3c90x_internal_IssueCommand(inf_3c90x->IOAddr, cmdTxEnable, 0); in a3c90x_open()
827 a3c90x_internal_IssueCommand(inf_3c90x->IOAddr, cmdRxEnable, 0); in a3c90x_open()
832 a3c90x_free_resources(inf_3c90x); in a3c90x_open()
833 a3c90x_reset(inf_3c90x); in a3c90x_open()
844 struct INF_3C90X *inf_3c90x = netdev_priv(netdev); in a3c90x_close() local
848 a3c90x_reset(inf_3c90x); in a3c90x_close()
849 outw(cmdRxDisable, inf_3c90x->IOAddr + regCommandIntStatus_w); in a3c90x_close()
850 outw(cmdTxDisable, inf_3c90x->IOAddr + regCommandIntStatus_w); in a3c90x_close()
851 a3c90x_free_resources(inf_3c90x); in a3c90x_close()
878 struct INF_3C90X *inf_3c90x; in a3c90x_probe() local
887 netdev = alloc_etherdev(sizeof(*inf_3c90x)); in a3c90x_probe()
895 inf_3c90x = netdev_priv(netdev); in a3c90x_probe()
896 memset(inf_3c90x, 0, sizeof(*inf_3c90x)); in a3c90x_probe()
900 inf_3c90x->is3c556 = (pci->device == 0x6055); in a3c90x_probe()
901 inf_3c90x->IOAddr = pci->ioaddr; in a3c90x_probe()
902 inf_3c90x->CurrentWindow = winNone; in a3c90x_probe()
904 inf_3c90x->isBrev = 1; in a3c90x_probe()
910 inf_3c90x->isBrev = 0; in a3c90x_probe()
915 pci->vendor, pci->device, inf_3c90x->isBrev, in a3c90x_probe()
916 inf_3c90x->is3c556); in a3c90x_probe()
919 inf_3c90x->nvs.word_len_log2 = 1; /* word */ in a3c90x_probe()
920 inf_3c90x->nvs.size = (inf_3c90x->isBrev ? 0x20 : 0x17); in a3c90x_probe()
921 inf_3c90x->nvs.block_size = 1; in a3c90x_probe()
922 inf_3c90x->nvs.read = a3c90x_internal_ReadEeprom; in a3c90x_probe()
923 inf_3c90x->nvs.write = a3c90x_internal_WriteEeprom; in a3c90x_probe()
926 a3c90x_reset(inf_3c90x); in a3c90x_probe()
929 a3c90x_internal_ReadEepromContents(inf_3c90x); in a3c90x_probe()
934 HWAddr[0] = inf_3c90x->eeprom[eepromHwAddrOffset + 0] >> 8; in a3c90x_probe()
935 HWAddr[1] = inf_3c90x->eeprom[eepromHwAddrOffset + 0] & 0xFF; in a3c90x_probe()
936 HWAddr[2] = inf_3c90x->eeprom[eepromHwAddrOffset + 1] >> 8; in a3c90x_probe()
937 HWAddr[3] = inf_3c90x->eeprom[eepromHwAddrOffset + 1] & 0xFF; in a3c90x_probe()
938 HWAddr[4] = inf_3c90x->eeprom[eepromHwAddrOffset + 2] >> 8; in a3c90x_probe()
939 HWAddr[5] = inf_3c90x->eeprom[eepromHwAddrOffset + 2] & 0xFF; in a3c90x_probe()