• Home
  • Raw
  • Download

Lines Matching refs:rtl

226 	struct rtl8139_nic *rtl = container_of ( basher, struct rtl8139_nic,  in rtl_spi_read_bit()  local
231 eereg = inb ( rtl->ioaddr + Cfg9346 ); in rtl_spi_read_bit()
237 struct rtl8139_nic *rtl = container_of ( basher, struct rtl8139_nic, in rtl_spi_write_bit() local
242 eereg = inb ( rtl->ioaddr + Cfg9346 ); in rtl_spi_write_bit()
245 outb ( eereg, rtl->ioaddr + Cfg9346 ); in rtl_spi_write_bit()
270 struct rtl8139_nic *rtl = netdev->priv; in rtl_init_eeprom() local
275 rtl->spibit.basher.op = &rtl_basher_ops; in rtl_init_eeprom()
276 rtl->spibit.bus.mode = SPI_MODE_THREEWIRE; in rtl_init_eeprom()
277 init_spi_bit_basher ( &rtl->spibit ); in rtl_init_eeprom()
280 ee9356 = ( inw ( rtl->ioaddr + RxConfig ) & Eeprom9356 ); in rtl_init_eeprom()
282 DBGC ( rtl, "rtl8139 %p EEPROM is an AT93C56\n", rtl ); in rtl_init_eeprom()
283 init_at93c56 ( &rtl->eeprom, 16 ); in rtl_init_eeprom()
285 DBGC ( rtl, "rtl8139 %p EEPROM is an AT93C46\n", rtl ); in rtl_init_eeprom()
286 init_at93c46 ( &rtl->eeprom, 16 ); in rtl_init_eeprom()
288 rtl->eeprom.bus = &rtl->spibit.bus; in rtl_init_eeprom()
291 vpd = ( inw ( rtl->ioaddr + Config1 ) & VPDEnable ); in rtl_init_eeprom()
293 DBGC ( rtl, "rtl8139 %p EEPROM in use for VPD; cannot use " in rtl_init_eeprom()
294 "for options\n", rtl ); in rtl_init_eeprom()
296 nvo_init ( &rtl->nvo, &rtl->eeprom.nvs, rtl_nvo_fragments, in rtl_init_eeprom()
309 struct rtl8139_nic *rtl = netdev->priv; in rtl_reset() local
312 outb ( CmdReset, rtl->ioaddr + ChipCmd ); in rtl_reset()
314 memset ( &rtl->tx, 0, sizeof ( rtl->tx ) ); in rtl_reset()
315 rtl->rx.offset = 0; in rtl_reset()
325 struct rtl8139_nic *rtl = netdev->priv; in rtl_open() local
330 outb ( netdev->ll_addr[i], rtl->ioaddr + MAC0 + i ); in rtl_open()
333 rtl->rx.ring = malloc ( RX_BUF_LEN + RX_BUF_PAD ); in rtl_open()
334 if ( ! rtl->rx.ring ) in rtl_open()
336 outl ( virt_to_bus ( rtl->rx.ring ), rtl->ioaddr + RxBuf ); in rtl_open()
337 DBGC ( rtl, "rtl8139 %p RX ring at %lx\n", in rtl_open()
338 rtl, virt_to_bus ( rtl->rx.ring ) ); in rtl_open()
341 outb ( ( CmdRxEnb | CmdTxEnb ), rtl->ioaddr + ChipCmd ); in rtl_open()
344 AcceptMyPhys ), rtl->ioaddr + RxConfig ); in rtl_open()
345 outl ( 0xffffffffUL, rtl->ioaddr + MAR0 + 0 ); in rtl_open()
346 outl ( 0xffffffffUL, rtl->ioaddr + MAR0 + 4 ); in rtl_open()
348 rtl->ioaddr + TxConfig ); in rtl_open()
359 struct rtl8139_nic *rtl = netdev->priv; in rtl_close() local
365 free ( rtl->rx.ring ); in rtl_close()
366 rtl->rx.ring = NULL; in rtl_close()
378 struct rtl8139_nic *rtl = netdev->priv; in rtl_transmit() local
381 if ( rtl->tx.iobuf[rtl->tx.next] != NULL ) { in rtl_transmit()
382 DBGC ( rtl, "rtl8139 %p TX overflow\n", rtl ); in rtl_transmit()
390 DBGC2 ( rtl, "rtl8139 %p TX id %d at %lx+%zx\n", rtl, rtl->tx.next, in rtl_transmit()
392 rtl->tx.iobuf[rtl->tx.next] = iobuf; in rtl_transmit()
394 rtl->ioaddr + TxAddr0 + 4 * rtl->tx.next ); in rtl_transmit()
396 rtl->ioaddr + TxStatus0 + 4 * rtl->tx.next ); in rtl_transmit()
397 rtl->tx.next = ( rtl->tx.next + 1 ) % TX_RING_SIZE; in rtl_transmit()
408 struct rtl8139_nic *rtl = netdev->priv; in rtl_poll() local
418 status = inw ( rtl->ioaddr + IntrStatus ); in rtl_poll()
421 outw ( status, rtl->ioaddr + IntrStatus ); in rtl_poll()
424 tsad = inw ( rtl->ioaddr + TxSummary ); in rtl_poll()
426 if ( ( rtl->tx.iobuf[i] != NULL ) && ( tsad & ( 1 << i ) ) ) { in rtl_poll()
427 DBGC2 ( rtl, "rtl8139 %p TX id %d complete\n", in rtl_poll()
428 rtl, i ); in rtl_poll()
429 netdev_tx_complete ( netdev, rtl->tx.iobuf[i] ); in rtl_poll()
430 rtl->tx.iobuf[i] = NULL; in rtl_poll()
435 while ( ! ( inw ( rtl->ioaddr + ChipCmd ) & RxBufEmpty ) ) { in rtl_poll()
437 ( rtl->rx.ring + rtl->rx.offset ) ); in rtl_poll()
439 ( rtl->rx.ring + rtl->rx.offset + 2 ) ); in rtl_poll()
441 DBGC2 ( rtl, "rtl8139 %p RX packet at offset " in rtl_poll()
442 "%x+%x\n", rtl, rtl->rx.offset, rx_len ); in rtl_poll()
451 wrapped_len = ( ( rtl->rx.offset + 4 + rx_len ) in rtl_poll()
457 rtl->rx.ring + rtl->rx.offset + 4, in rtl_poll()
460 rtl->rx.ring, wrapped_len ); in rtl_poll()
464 DBGC ( rtl, "rtl8139 %p RX bad packet (status %#04x " in rtl_poll()
465 "len %d)\n", rtl, rx_status, rx_len ); in rtl_poll()
468 rtl->rx.offset = ( ( ( rtl->rx.offset + 4 + rx_len + 3 ) & ~3 ) in rtl_poll()
470 outw ( rtl->rx.offset - 16, rtl->ioaddr + RxBufPtr ); in rtl_poll()
481 struct rtl8139_nic *rtl = netdev->priv; in rtl_irq() local
483 DBGC ( rtl, "rtl8139 %p interrupts %s\n", in rtl_irq()
484 rtl, ( enable ? "enabled" : "disabled" ) ); in rtl_irq()
486 rtl->ioaddr + IntrMask ); in rtl_irq()
508 struct rtl8139_nic *rtl; in rtl_probe() local
512 netdev = alloc_etherdev ( sizeof ( *rtl ) ); in rtl_probe()
516 rtl = netdev->priv; in rtl_probe()
519 memset ( rtl, 0, sizeof ( *rtl ) ); in rtl_probe()
520 rtl->ioaddr = pci->ioaddr; in rtl_probe()
528 nvs_read ( &rtl->eeprom.nvs, EE_MAC, netdev->hw_addr, ETH_ALEN ); in rtl_probe()
538 if ( rtl->nvo.nvs ) { in rtl_probe()
539 if ( ( rc = register_nvo ( &rtl->nvo, in rtl_probe()
562 struct rtl8139_nic *rtl = netdev->priv; in rtl_remove() local
564 if ( rtl->nvo.nvs ) in rtl_remove()
565 unregister_nvo ( &rtl->nvo ); in rtl_remove()