iPXE
eepro100.c File Reference
#include <stdint.h>
#include <string.h>
#include <byteswap.h>
#include <errno.h>
#include <stdio.h>
#include <unistd.h>
#include <ipxe/ethernet.h>
#include <ipxe/if_ether.h>
#include <ipxe/iobuf.h>
#include <ipxe/malloc.h>
#include <ipxe/pci.h>
#include <ipxe/spi_bit.h>
#include <ipxe/timer.h>
#include <ipxe/nvs.h>
#include <ipxe/threewire.h>
#include <ipxe/netdevice.h>
#include "eepro100.h"

Go to the source code of this file.

Macros

#define INTERRUPT_MASK   ( SCBMaskEarlyRx | SCBMaskFlowCtl )
#define RFD_STATUS

Functions

 FILE_LICENCE (GPL2_OR_LATER)
static int ifec_pci_probe (struct pci_device *pci)
static void ifec_pci_remove (struct pci_device *pci)
static void ifec_net_close (struct net_device *netdev)
static void ifec_net_irq (struct net_device *netdev, int enable)
static int ifec_net_open (struct net_device *netdev)
static void ifec_net_poll (struct net_device *netdev)
static int ifec_net_transmit (struct net_device *netdev, struct io_buffer *iobuf)
static int ifec_spi_read_bit (struct bit_basher *basher, unsigned int bit_id)
static void ifec_spi_write_bit (struct bit_basher *basher, unsigned int bit_id, unsigned long data)
static void ifec_init_eeprom (struct net_device *netdev)
static int ifec_mdio_read (struct net_device *netdev, int phy_id, int location)
static void ifec_mdio_setup (struct net_device *netdev, int options)
static int ifec_mdio_write (struct net_device *netdev, int phy_id, int location, int value)
static void ifec_reset (struct net_device *netdev)
static void ifec_free (struct net_device *netdev)
static void ifec_rfd_init (struct ifec_rfd *rfd, s16 command, u32 link)
static void ifec_reprime_ru (struct net_device *netdev)
static void ifec_check_ru_status (struct net_device *netdev, unsigned short intr_status)
static void ifec_rx_process (struct net_device *netdev)
static int ifec_get_rx_desc (struct net_device *netdev, int cur, int cmd, int link)
static void ifec_refill_rx_ring (struct net_device *netdev)
static int ifec_rx_setup (struct net_device *netdev)
static int ifec_scb_cmd (struct net_device *netdev, u32 ptr, u8 cmd)
static int ifec_scb_cmd_wait (struct net_device *netdev)
static void ifec_tx_process (struct net_device *netdev)
static int ifec_tx_setup (struct net_device *netdev)
void ifec_tx_wake (struct net_device *netdev)

Variables

static struct ifec_cfg ifec_cfg
static struct net_device_operations ifec_operations
static const uint16_t ifec_ee_bits []
static struct bit_basher_operations ifec_basher_ops
static struct pci_device_id ifec_nics []
struct pci_driver ifec_driver __pci_driver

Macro Definition Documentation

◆ INTERRUPT_MASK

#define INTERRUPT_MASK   ( SCBMaskEarlyRx | SCBMaskFlowCtl )

Definition at line 281 of file eepro100.c.

Referenced by ifec_net_irq(), and ifec_net_poll().

◆ RFD_STATUS

#define RFD_STATUS
Value:
@ RFDShort
Definition eepro100.h:71
@ RFDNoBufs
Definition eepro100.h:72
@ RFDRxErr
Definition eepro100.h:70
@ RFDRxCol
Definition eepro100.h:69
@ RFD_OK
Definition eepro100.h:73
@ RFDCRCError
Definition eepro100.h:72
@ RFDDMAOverrun
Definition eepro100.h:71

Definition at line 786 of file eepro100.c.

786#define RFD_STATUS ( RFD_OK | RFDRxCol | RFDRxErr | RFDShort | \
787 RFDDMAOverrun | RFDNoBufs | RFDCRCError )

Referenced by ifec_rx_process().

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER )

◆ ifec_pci_probe()

int ifec_pci_probe ( struct pci_device * pci)
static

Definition at line 172 of file eepro100.c.

173{
174 struct net_device *netdev;
175 struct ifec_private *priv;
176 int rc;
177
178 DBGP ( "ifec_pci_probe: " );
179
180 if ( pci->ioaddr == 0 )
181 return -EINVAL;
182
183 netdev = alloc_etherdev ( sizeof(*priv) );
184 if ( !netdev )
185 return -ENOMEM;
186
188 priv = netdev->priv;
189
190 pci_set_drvdata ( pci, netdev );
191 netdev->dev = &pci->dev;
192
193 /* enable bus master, etc */
194 adjust_pci_device( pci );
195
196 DBGP ( "pci " );
197
198 memset ( priv, 0, sizeof(*priv) );
199 priv->ioaddr = pci->ioaddr;
200
201 ifec_reset ( netdev );
202 DBGP ( "reset " );
203
205
206 /* read MAC address */
207 nvs_read ( &priv->eeprom.nvs, EEPROM_ADDR_MAC_0, netdev->hw_addr,
208 ETH_ALEN );
209 /* read mdio_register */
211 &priv->mdio_register, 2 );
212
213 if ( ( rc = register_netdev ( netdev ) ) != 0 )
214 goto error;
215
217
218 DBGP ( "ints\n" );
219
220 return 0;
221
222error:
223 ifec_reset ( netdev );
225 netdev_put ( netdev );
226
227 return rc;
228}
struct arbelprm_rc_send_wqe rc
Definition arbel.h:3
struct arbelprm_completion_with_error error
Definition arbel.h:1
static void ifec_reset(struct net_device *netdev)
Definition eepro100.c:666
static void ifec_init_eeprom(struct net_device *netdev)
Definition eepro100.c:541
static struct net_device_operations ifec_operations
Definition eepro100.c:152
#define EEPROM_ADDR_MDIO_REGISTER
Definition eepro100.h:27
#define EEPROM_ADDR_MAC_0
Definition eepro100.h:26
struct net_device * alloc_etherdev(size_t priv_size)
Allocate Ethernet device.
Definition ethernet.c:265
static struct net_device * netdev
Definition gdbudp.c:53
#define DBGP(...)
Definition compiler.h:532
#define EINVAL
Invalid argument.
Definition errno.h:429
#define ENOMEM
Not enough space.
Definition errno.h:535
#define ETH_ALEN
Definition if_ether.h:9
void * memset(void *dest, int character, size_t len) __nonnull
int register_netdev(struct net_device *netdev)
Register network device.
Definition netdevice.c:760
static void netdev_link_up(struct net_device *netdev)
Mark network device as having link up.
Definition netdevice.h:789
static void netdev_init(struct net_device *netdev, struct net_device_operations *op)
Initialise a network device.
Definition netdevice.h:519
static void netdev_nullify(struct net_device *netdev)
Stop using a network device.
Definition netdevice.h:532
static void netdev_put(struct net_device *netdev)
Drop reference to network device.
Definition netdevice.h:576
int nvs_read(struct nvs_device *nvs, unsigned int address, void *data, size_t len)
Read from non-volatile storage device.
Definition nvs.c:76
void adjust_pci_device(struct pci_device *pci)
Enable PCI device.
Definition pci.c:241
static void pci_set_drvdata(struct pci_device *pci, void *priv)
Set PCI driver-private data.
Definition pci.h:366
A network device.
Definition netdevice.h:353
unsigned long ioaddr
I/O address.
Definition pci.h:226
struct device dev
Generic device.
Definition pci.h:213
static struct tlan_private * priv
Definition tlan.c:225

References adjust_pci_device(), alloc_etherdev(), DBGP, pci_device::dev, EEPROM_ADDR_MAC_0, EEPROM_ADDR_MDIO_REGISTER, EINVAL, ENOMEM, error, ETH_ALEN, ifec_init_eeprom(), ifec_operations, ifec_reset(), pci_device::ioaddr, memset(), netdev, netdev_init(), netdev_link_up(), netdev_nullify(), netdev_put(), nvs_read(), pci_set_drvdata(), priv, rc, and register_netdev().

◆ ifec_pci_remove()

void ifec_pci_remove ( struct pci_device * pci)
static

Definition at line 237 of file eepro100.c.

238{
239 struct net_device *netdev = pci_get_drvdata ( pci );
240
241 DBGP ( "ifec_pci_remove\n" );
242
244 ifec_reset ( netdev );
246 netdev_put ( netdev );
247}
void unregister_netdev(struct net_device *netdev)
Unregister network device.
Definition netdevice.c:942
static void * pci_get_drvdata(struct pci_device *pci)
Get PCI driver-private data.
Definition pci.h:376

References DBGP, ifec_reset(), netdev, netdev_nullify(), netdev_put(), pci_get_drvdata(), and unregister_netdev().

◆ ifec_net_close()

void ifec_net_close ( struct net_device * netdev)
static

Definition at line 258 of file eepro100.c.

259{
260 struct ifec_private *priv = netdev->priv;
261 unsigned long ioaddr = priv->ioaddr;
262 unsigned short intr_status;
263
264 DBGP ( "ifec_net_close\n" );
265
266 /* disable interrupts */
267 ifec_net_irq ( netdev, 0 );
268
269 /* Ack & clear ints */
270 intr_status = inw ( ioaddr + SCBStatus );
271 outw ( intr_status, ioaddr + SCBStatus );
272 inw ( ioaddr + SCBStatus );
273
274 ifec_reset ( netdev );
275
276 /* Free any resources */
277 ifec_free ( netdev );
278}
static unsigned long ioaddr
Definition davicom.c:129
static void ifec_free(struct net_device *netdev)
Definition eepro100.c:692
static void ifec_net_irq(struct net_device *netdev, int enable)
Definition eepro100.c:291
@ SCBStatus
Definition eepro100.h:31
#define inw(io_addr)
Definition io.h:292
#define outw(data, io_addr)
Definition io.h:320

References DBGP, ifec_free(), ifec_net_irq(), ifec_reset(), inw, ioaddr, netdev, outw, priv, and SCBStatus.

◆ ifec_net_irq()

void ifec_net_irq ( struct net_device * netdev,
int enable )
static

Definition at line 291 of file eepro100.c.

292{
293 struct ifec_private *priv = netdev->priv;
294 unsigned long ioaddr = priv->ioaddr;
295
296 DBGP ( "ifec_net_irq\n" );
297
298 outw ( enable ? INTERRUPT_MASK : SCBMaskAll, ioaddr + SCBCmd );
299}
#define INTERRUPT_MASK
Definition eepro100.c:281
@ SCBMaskAll
Definition eepro100.h:41
@ SCBCmd
Definition eepro100.h:31

References DBGP, INTERRUPT_MASK, ioaddr, netdev, outw, priv, SCBCmd, and SCBMaskAll.

Referenced by ifec_net_close(), ifec_net_open(), and ifec_reset().

◆ ifec_net_open()

int ifec_net_open ( struct net_device * netdev)
static

Definition at line 310 of file eepro100.c.

311{
312 struct ifec_private *priv = netdev->priv;
313 struct ifec_ias *ias = NULL;
314 struct ifec_cfg *cfg = NULL;
315 int i, options;
316 int rc = -ENOMEM;
317
318 DBGP ( "ifec_net_open: " );
319
320 /* Ensure interrupts are disabled. */
321 ifec_net_irq ( netdev, 0 );
322
323 /* Initialize Command Unit and Receive Unit base addresses. */
327
328 /* Initialize both rings */
329 if ( ( rc = ifec_rx_setup ( netdev ) ) != 0 )
330 goto error;
331 if ( ( rc = ifec_tx_setup ( netdev ) ) != 0 )
332 goto error;
333
334 /* Initialize MDIO */
335 options = 0x00; /* 0x40 = 10mbps half duplex, 0x00 = Autosense */
337
338 /* Prepare MAC address w/ Individual Address Setup (ias) command.*/
339 ias = malloc_phys ( sizeof ( *ias ), CB_ALIGN );
340 if ( !ias ) {
341 rc = -ENOMEM;
342 goto error;
343 }
344 ias->command = CmdIASetup;
345 ias->status = 0;
346 memcpy ( ias->ia, netdev->ll_addr, ETH_ALEN );
347
348 /* Prepare operating parameters w/ a configure command. */
349 cfg = malloc_phys ( sizeof ( *cfg ), CB_ALIGN );
350 if ( !cfg ) {
351 rc = -ENOMEM;
352 goto error;
353 }
354 memcpy ( cfg, &ifec_cfg, sizeof ( *cfg ) );
355 cfg->link = virt_to_bus ( priv->tcbs );
356 cfg->byte[19] = ( options & 0x10 ) ? 0xC0 : 0x80;
357 ias->link = virt_to_bus ( cfg );
358
359 /* Issue the ias and configure commands. */
362 priv->configured = 1;
363
364 /* Wait up to 10 ms for configuration to initiate */
365 for ( i = 10; i && !cfg->status; i-- )
366 mdelay ( 1 );
367 if ( ! cfg->status ) {
368 DBG ( "Failed to initiate!\n" );
369 goto error;
370 }
371 free_phys ( ias, sizeof ( *ias ) );
372 free_phys ( cfg, sizeof ( *cfg ) );
373 DBG2 ( "cfg " );
374
375 /* Enable rx by sending ring address to card */
376 if ( priv->rfds[0] != NULL ) {
377 ifec_scb_cmd ( netdev, virt_to_bus( priv->rfds[0] ), RUStart );
379 }
380 DBG2 ( "rx_start\n" );
381
382 return 0;
383
384error:
385 free_phys ( cfg, sizeof ( *cfg ) );
386 free_phys ( ias, sizeof ( *ias ) );
387 ifec_free ( netdev );
388 ifec_reset ( netdev );
389 return rc;
390}
static int options
Definition 3c515.c:286
#define NULL
NULL pointer (VOID *)
Definition Base.h:322
static void ifec_mdio_setup(struct net_device *netdev, int options)
Definition eepro100.c:604
static int ifec_scb_cmd_wait(struct net_device *netdev)
Definition eepro100.c:965
static int ifec_scb_cmd(struct net_device *netdev, u32 ptr, u8 cmd)
Definition eepro100.c:943
static int ifec_rx_setup(struct net_device *netdev)
Definition eepro100.c:916
static int ifec_tx_setup(struct net_device *netdev)
Definition eepro100.c:1020
@ CUCmdBase
Definition eepro100.h:44
@ CUStatsAddr
Definition eepro100.h:43
@ RUAddrLoad
Definition eepro100.h:46
@ RUStart
Definition eepro100.h:45
@ CUStart
Definition eepro100.h:43
#define CB_ALIGN
Definition eepro100.h:18
@ CmdIASetup
Definition eepro100.h:55
#define DBG2(...)
Definition compiler.h:515
#define DBG(...)
Print a debugging message.
Definition compiler.h:498
static __always_inline unsigned long virt_to_bus(volatile const void *addr)
Convert virtual address to a bus address.
Definition io.h:184
void * memcpy(void *dest, const void *src, size_t len) __nonnull
void * malloc_phys(size_t size, size_t phys_align)
Allocate memory with specified physical alignment.
Definition malloc.c:707
void free_phys(void *ptr, size_t size)
Free memory allocated with malloc_phys()
Definition malloc.c:723
@ cfg
Definition sis900.h:23
u8 ia[6]
Definition eepro100.h:135
u16 command
Definition eepro100.h:133
volatile s16 status
Definition eepro100.h:132
u32 link
Definition eepro100.h:134
void mdelay(unsigned long msecs)
Delay for a fixed number of milliseconds.
Definition timer.c:79

References CB_ALIGN, cfg, CmdIASetup, ifec_ias::command, CUCmdBase, CUStart, CUStatsAddr, DBG, DBG2, DBGP, ENOMEM, error, ETH_ALEN, free_phys(), ifec_ias::ia, ifec_free(), ifec_mdio_setup(), ifec_net_irq(), ifec_reset(), ifec_rx_setup(), ifec_scb_cmd(), ifec_scb_cmd_wait(), ifec_tx_setup(), ifec_ias::link, malloc_phys(), mdelay(), memcpy(), netdev, NULL, options, priv, rc, RUAddrLoad, RUStart, ifec_ias::status, and virt_to_bus().

◆ ifec_net_poll()

void ifec_net_poll ( struct net_device * netdev)
static

Definition at line 401 of file eepro100.c.

402{
403 struct ifec_private *priv = netdev->priv;
404 unsigned short intr_status;
405
406 DBGP ( "ifec_net_poll\n" );
407
408 /* acknowledge interrupts ASAP */
409 intr_status = inw ( priv->ioaddr + SCBStatus );
410 outw ( intr_status, priv->ioaddr + SCBStatus );
411 inw ( priv->ioaddr + SCBStatus );
412
413 DBG2 ( "poll - status: 0x%04X\n", intr_status );
414
415 /* anything to do here? */
416 if ( ( intr_status & ( ~INTERRUPT_MASK ) ) == 0 )
417 return;
418
419 /* process received and transmitted packets */
422
423 ifec_check_ru_status ( netdev, intr_status );
424
425 return;
426}
static void ifec_rx_process(struct net_device *netdev)
Definition eepro100.c:794
static void ifec_tx_process(struct net_device *netdev)
Definition eepro100.c:986
static void ifec_check_ru_status(struct net_device *netdev, unsigned short intr_status)
Definition eepro100.c:755

References DBG2, DBGP, ifec_check_ru_status(), ifec_rx_process(), ifec_tx_process(), INTERRUPT_MASK, inw, netdev, outw, priv, and SCBStatus.

◆ ifec_net_transmit()

int ifec_net_transmit ( struct net_device * netdev,
struct io_buffer * iobuf )
static

Definition at line 437 of file eepro100.c.

439{
440 struct ifec_private *priv = netdev->priv;
441 struct ifec_tcb *tcb = priv->tcb_head->next;
442 unsigned long ioaddr = priv->ioaddr;
443
444 DBGP ( "ifec_net_transmit\n" );
445
446 /* Wait for TCB to become available. */
447 if ( tcb->status || tcb->iob ) {
448 DBG ( "TX overflow\n" );
449 return -ENOBUFS;
450 }
451
452 DBG2 ( "transmitting packet (%zd bytes). status = %hX, cmd=%hX\n",
453 iob_len ( iobuf ), tcb->status, inw ( ioaddr + SCBCmd ) );
454
456 tcb->count = 0x01208000;
457 tcb->tbd_addr0 = virt_to_bus ( iobuf->data );
458 tcb->tbd_size0 = 0x3FFF & iob_len ( iobuf );
459 tcb->iob = iobuf;
460
462
463 /* Append to end of ring. */
464 priv->tcb_head = tcb;
465
466 return 0;
467}
void ifec_tx_wake(struct net_device *netdev)
Definition eepro100.c:1073
@ CmdTxFlex
Definition eepro100.h:60
@ CmdTx
Definition eepro100.h:56
@ CmdSuspend
Definition eepro100.h:60
#define ENOBUFS
No buffer space available.
Definition errno.h:499
static size_t iob_len(struct io_buffer *iobuf)
Calculate length of data in an I/O buffer.
Definition iobuf.h:160
volatile s16 status
Definition eepro100.h:107
struct io_buffer * iob
Definition eepro100.h:117
s32 count
Definition eepro100.h:111
s32 tbd_size0
Definition eepro100.h:115
u16 command
Definition eepro100.h:108
u32 tbd_addr0
Definition eepro100.h:114
void * data
Start of data.
Definition iobuf.h:53

References CmdSuspend, CmdTx, CmdTxFlex, ifec_tcb::command, ifec_tcb::count, io_buffer::data, DBG, DBG2, DBGP, ENOBUFS, ifec_tx_wake(), inw, ioaddr, ifec_tcb::iob, iob_len(), netdev, priv, SCBCmd, ifec_tcb::status, ifec_tcb::tbd_addr0, ifec_tcb::tbd_size0, and virt_to_bus().

◆ ifec_spi_read_bit()

int ifec_spi_read_bit ( struct bit_basher * basher,
unsigned int bit_id )
static

Definition at line 486 of file eepro100.c.

488{
489 struct ifec_private *priv =
490 container_of ( basher, struct ifec_private, spi.basher );
491 unsigned long ee_addr = priv->ioaddr + CSREeprom;
492 unsigned int ret = 0;
493 uint16_t mask;
494
495 DBGP ( "ifec_spi_read_bit\n" );
496
497 mask = ifec_ee_bits[bit_id];
498 ret = inw (ee_addr);
499
500 return ( ret & mask ) ? 1 : 0;
501}
unsigned short uint16_t
Definition stdint.h:11
static const uint16_t ifec_ee_bits[]
Definition eepro100.c:472
@ CSREeprom
Definition eepro100.h:32
#define container_of(ptr, type, field)
Get containing structure.
Definition stddef.h:36
struct spi_bit_basher spi
Definition eepro100.h:166
struct bit_basher basher
Bit-bashing interface.
Definition spi_bit.h:21

References spi_bit_basher::basher, container_of, CSREeprom, DBGP, ifec_ee_bits, inw, priv, and ifec_private::spi.

◆ ifec_spi_write_bit()

void ifec_spi_write_bit ( struct bit_basher * basher,
unsigned int bit_id,
unsigned long data )
static

Definition at line 511 of file eepro100.c.

514{
515 struct ifec_private *priv =
516 container_of ( basher, struct ifec_private, spi.basher );
517 unsigned long ee_addr = priv->ioaddr + CSREeprom;
518 short val;
519 uint16_t mask = ifec_ee_bits[bit_id];
520
521 DBGP ( "ifec_spi_write_bit\n" );
522
523 val = inw ( ee_addr );
524 val &= ~mask;
525 val |= data & mask;
526
527 outw ( val, ee_addr );
528}
uint8_t data[48]
Additional event data.
Definition ena.h:11
void __asmcall int val
Definition setjmp.h:12

References spi_bit_basher::basher, container_of, CSREeprom, data, DBGP, ifec_ee_bits, inw, outw, priv, ifec_private::spi, and val.

◆ ifec_init_eeprom()

void ifec_init_eeprom ( struct net_device * netdev)
static

Definition at line 541 of file eepro100.c.

542{
543 struct ifec_private *priv = netdev->priv;
544
545 DBGP ( "ifec_init_eeprom\n" );
546
547 priv->spi.basher.op = &ifec_basher_ops;
548 priv->spi.bus.mode = SPI_MODE_THREEWIRE;
549 init_spi_bit_basher ( &priv->spi );
550
551 priv->eeprom.bus = &priv->spi.bus;
552
553 /* init as 93c46(93c14 compatible) first, to set the command len,
554 * block size and word len. Needs to be set for address len detection.
555 */
556 init_at93c46 ( &priv->eeprom, 16 );
557
558 /* detect address length, */
560
561 /* address len == 8 means 93c66 instead of 93c46 */
562 if ( priv->eeprom.address_len == 8 )
563 init_at93c66 ( &priv->eeprom, 16 );
564}
static struct bit_basher_operations ifec_basher_ops
Definition eepro100.c:531
#define SPI_MODE_THREEWIRE
Threewire-compatible mode.
Definition spi.h:200
void init_spi_bit_basher(struct spi_bit_basher *spibit)
Initialise SPI bit-bashing interface.
Definition spi_bit.c:236
int threewire_detect_address_len(struct spi_device *device)
Autodetect device address length.
Definition threewire.c:120

References DBGP, ifec_basher_ops, init_spi_bit_basher(), netdev, priv, SPI_MODE_THREEWIRE, and threewire_detect_address_len().

Referenced by ifec_pci_probe().

◆ ifec_mdio_read()

int ifec_mdio_read ( struct net_device * netdev,
int phy_id,
int location )
static

Definition at line 572 of file eepro100.c.

574{
575 struct ifec_private *priv = netdev->priv;
576 unsigned long ioaddr = priv->ioaddr;
577 int val;
578 int boguscnt = 64*4; /* <64 usec. to complete, typ 27 ticks */
579
580 DBGP ( "ifec_mdio_read\n" );
581
582 outl ( 0x08000000 | ( location << 16 ) | ( phy_id << 21 ),
583 ioaddr + CSRCtrlMDI );
584 do {
585 udelay ( 16 );
586
587 val = inl ( ioaddr + CSRCtrlMDI );
588
589 if ( --boguscnt < 0 ) {
590 DBG ( " ifec_mdio_read() time out with val = %X.\n",
591 val );
592 break;
593 }
594 } while (! ( val & 0x10000000 ) );
595 return val & 0xffff;
596}
@ CSRCtrlMDI
Definition eepro100.h:33
#define inl(io_addr)
Definition io.h:301
#define outl(data, io_addr)
Definition io.h:330
void udelay(unsigned long usecs)
Delay for a fixed number of microseconds.
Definition timer.c:61

References CSRCtrlMDI, DBG, DBGP, inl, ioaddr, netdev, outl, priv, udelay(), and val.

Referenced by ifec_mdio_setup().

◆ ifec_mdio_setup()

void ifec_mdio_setup ( struct net_device * netdev,
int options )
static

Definition at line 604 of file eepro100.c.

605{
606 struct ifec_private *priv = netdev->priv;
607 unsigned short mdio_register = priv->mdio_register;
608
609 DBGP ( "ifec_mdio_setup\n" );
610
611 if ( ( (mdio_register>>8) & 0x3f ) == DP83840
612 || ( (mdio_register>>8) & 0x3f ) == DP83840A ) {
613 int mdi_reg23 = ifec_mdio_read ( netdev, mdio_register
614 & 0x1f, 23 ) | 0x0422;
615 if (CONGENB)
616 mdi_reg23 |= 0x0100;
617 DBG2 ( "DP83840 specific setup, setting register 23 to "
618 "%hX.\n", mdi_reg23 );
619 ifec_mdio_write ( netdev, mdio_register & 0x1f, 23, mdi_reg23 );
620 }
621 DBG2 ( "dp83840 " );
622 if ( options != 0 ) {
624 ( (options & 0x20) ? 0x2000 : 0 ) |
625 ( (options & 0x10) ? 0x0100 : 0 ) );
626 DBG2 ( "set mdio_register. " );
627 }
628}
static int ifec_mdio_write(struct net_device *netdev, int phy_id, int location, int value)
Definition eepro100.c:636
static int ifec_mdio_read(struct net_device *netdev, int phy_id, int location)
Definition eepro100.c:572
#define CONGENB
Definition eepro100.h:7
@ DP83840
Definition eepro100.h:82
@ DP83840A
Definition eepro100.h:83
unsigned short mdio_register
Definition eepro100.h:148

References CONGENB, DBG2, DBGP, DP83840, DP83840A, ifec_mdio_read(), ifec_mdio_write(), ifec_private::mdio_register, netdev, options, and priv.

Referenced by ifec_net_open().

◆ ifec_mdio_write()

int ifec_mdio_write ( struct net_device * netdev,
int phy_id,
int location,
int value )
static

Definition at line 636 of file eepro100.c.

638{
639 struct ifec_private *priv = netdev->priv;
640 unsigned long ioaddr = priv->ioaddr;
641 int val;
642 int boguscnt = 64*4; /* <64 usec. to complete, typ 27 ticks */
643
644 DBGP ( "ifec_mdio_write\n" );
645
646 outl ( 0x04000000 | ( location << 16 ) | ( phy_id << 21 ) | value,
647 ioaddr + CSRCtrlMDI );
648 do {
649 udelay ( 16 );
650
651 val = inl ( ioaddr + CSRCtrlMDI );
652 if ( --boguscnt < 0 ) {
653 DBG ( " ifec_mdio_write() time out with val = %X.\n",
654 val );
655 break;
656 }
657 } while (! ( val & 0x10000000 ) );
658 return val & 0xffff;
659}
pseudo_bit_t value[0x00020]
Definition arbel.h:2

References CSRCtrlMDI, DBG, DBGP, inl, ioaddr, netdev, outl, priv, udelay(), val, and value.

Referenced by ifec_mdio_setup().

◆ ifec_reset()

void ifec_reset ( struct net_device * netdev)
static

Definition at line 666 of file eepro100.c.

667{
668 struct ifec_private *priv = netdev->priv;
669 unsigned long ioaddr = priv->ioaddr;
670
671 DBGP ( "ifec_reset\n" );
672
673 /* do partial reset first */
675 inw ( ioaddr + SCBStatus );
676 udelay ( 20 );
677
678 /* full reset */
680 inw ( ioaddr + SCBStatus );
681 udelay ( 20 );
682
683 /* disable interrupts again */
684 ifec_net_irq ( netdev, 0 );
685}
@ PortReset
Definition eepro100.h:50
@ PortPartialReset
Definition eepro100.h:50
@ CSRPort
Definition eepro100.h:32

References CSRPort, DBGP, ifec_net_irq(), inw, ioaddr, netdev, outl, PortPartialReset, PortReset, priv, SCBStatus, and udelay().

Referenced by ifec_net_close(), ifec_net_open(), ifec_pci_probe(), and ifec_pci_remove().

◆ ifec_free()

void ifec_free ( struct net_device * netdev)
static

Definition at line 692 of file eepro100.c.

693{
694 struct ifec_private *priv = netdev->priv;
695 int i;
696
697 DBGP ( "ifec_free\n" );
698
699 /* free all allocated receive io_buffers */
700 for ( i = 0; i < RFD_COUNT; i++ ) {
701 free_iob ( priv->rx_iobs[i] );
702 priv->rx_iobs[i] = NULL;
703 priv->rfds[i] = NULL;
704 }
705
706 /* free TX ring buffer */
707 free_phys ( priv->tcbs, TX_RING_BYTES );
708
709 priv->tcbs = NULL;
710}
#define TX_RING_BYTES
Definition eepro100.h:23
#define RFD_COUNT
Definition eepro100.h:20
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
Definition iobuf.c:153

References DBGP, free_iob(), free_phys(), netdev, NULL, priv, RFD_COUNT, and TX_RING_BYTES.

Referenced by ifec_net_close(), and ifec_net_open().

◆ ifec_rfd_init()

void ifec_rfd_init ( struct ifec_rfd * rfd,
s16 command,
u32 link )
static

Definition at line 719 of file eepro100.c.

720{
721 DBGP ( "ifec_rfd_init\n" );
722
723 rfd->status = 0;
724 rfd->command = command;
725 rfd->rx_buf_addr = 0xFFFFFFFF;
726 rfd->count = 0;
727 rfd->size = RFD_PACKET_LEN;
728 rfd->link = link;
729}
u32 link
Link to next descriptor.
Definition ar9003_mac.h:1
#define RFD_PACKET_LEN
Definition eepro100.h:15
A command-line command.
Definition command.h:10
u32 rx_buf_addr
Definition eepro100.h:125
s16 command
Definition eepro100.h:123
u32 link
Definition eepro100.h:124
volatile s16 status
Definition eepro100.h:122
u16 count
Definition eepro100.h:126
u16 size
Definition eepro100.h:127

References ifec_rfd::command, ifec_rfd::count, DBGP, ifec_rfd::link, link, RFD_PACKET_LEN, ifec_rfd::rx_buf_addr, ifec_rfd::size, ifec_rfd::status, and u32.

Referenced by ifec_get_rx_desc().

◆ ifec_reprime_ru()

void ifec_reprime_ru ( struct net_device * netdev)
static

Definition at line 736 of file eepro100.c.

737{
738 struct ifec_private *priv = netdev->priv;
739 int cur_rx = priv->cur_rx;
740
741 DBGP ( "ifec_reprime_ru\n" );
742
743 if ( priv->rfds[cur_rx] != NULL ) {
745 RUStart );
747 }
748}
static unsigned int cur_rx
Definition epic100.c:84

References cur_rx, DBGP, ifec_scb_cmd(), ifec_scb_cmd_wait(), netdev, NULL, priv, RUStart, and virt_to_bus().

Referenced by ifec_check_ru_status().

◆ ifec_check_ru_status()

void ifec_check_ru_status ( struct net_device * netdev,
unsigned short intr_status )
static

Definition at line 755 of file eepro100.c.

757{
758 struct ifec_private *priv = netdev->priv;
759
760 DBGP ( "ifec_check_ru_status\n" );
761
762 /*
763 * The chip may have suspended reception for various reasons.
764 * Check for that, and re-prime it should this be the case.
765 */
766 switch ( ( intr_status >> 2 ) & 0xf ) {
767 case 0: /* Idle */
768 case 4: /* Ready */
769 break;
770 case 1: /* Suspended */
771 case 2: /* No resources (RFDs) */
772 case 9: /* Suspended with no more RBDs */
773 case 10: /* No resources due to no RBDs */
774 case 12: /* Ready with no RBDs */
775 DBG ( "ifec_net_poll: RU reprimed.\n" );
777 break;
778 default:
779 /* reserved values */
780 DBG ( "ifec_net_poll: RU state anomaly: %i\n",
781 ( inw ( priv->ioaddr + SCBStatus ) >> 2 ) & 0xf );
782 break;
783 }
784}
static void ifec_reprime_ru(struct net_device *netdev)
Definition eepro100.c:736

References DBG, DBGP, ifec_reprime_ru(), inw, netdev, priv, and SCBStatus.

Referenced by ifec_net_poll(), and ifec_refill_rx_ring().

◆ ifec_rx_process()

void ifec_rx_process ( struct net_device * netdev)
static

Definition at line 794 of file eepro100.c.

795{
796 struct ifec_private *priv = netdev->priv;
797 int cur_rx = priv->cur_rx;
798 struct io_buffer *iob = priv->rx_iobs[cur_rx];
799 struct ifec_rfd *rfd = priv->rfds[cur_rx];
800 unsigned int rx_len;
801 s16 status;
802
803 DBGP ( "ifec_rx_process\n" );
804
805 /* Process any received packets */
806 while ( iob && rfd && ( status = rfd->status ) ) {
807 rx_len = rfd->count & RFDMaskCount;
808
809 DBG2 ( "Got a packet: Len = %d, cur_rx = %d.\n", rx_len,
810 cur_rx );
811 DBGIO_HD ( (void*)rfd->packet, 0x30 );
812
813 if ( ( status & ( RFD_STATUS & ~RFDShort ) ) != RFD_OK ) {
814 DBG ( "Corrupted packet received. "
815 "Status = %#08hx\n", status );
816 netdev_rx_err ( netdev, iob, -EINVAL );
817 } else {
818 /* Hand off the packet to the network subsystem */
819 iob_put ( iob, rx_len );
820 DBG2 ( "Received packet: %p, len: %d\n", iob, rx_len );
821 netdev_rx ( netdev, iob );
822 }
823
824 /* make sure we don't reuse this RFD */
825 priv->rx_iobs[cur_rx] = NULL;
826 priv->rfds[cur_rx] = NULL;
827
828 /* Next RFD */
829 priv->cur_rx = ( cur_rx + 1 ) % RFD_COUNT;
830 cur_rx = priv->cur_rx;
831 iob = priv->rx_iobs[cur_rx];
832 rfd = priv->rfds[cur_rx];
833 }
834
836}
#define RFD_STATUS
Definition eepro100.c:786
static void ifec_refill_rx_ring(struct net_device *netdev)
Definition eepro100.c:876
@ RFDMaskCount
Definition eepro100.h:77
uint8_t status
Status.
Definition ena.h:5
#define DBGIO_HD(...)
Definition compiler.h:551
int16_t s16
Definition stdint.h:21
#define iob_put(iobuf, len)
Definition iobuf.h:125
void netdev_rx(struct net_device *netdev, struct io_buffer *iobuf)
Add packet to receive queue.
Definition netdevice.c:549
void netdev_rx_err(struct net_device *netdev, struct io_buffer *iobuf, int rc)
Discard received packet.
Definition netdevice.c:587
char packet[RFD_PACKET_LEN]
Definition eepro100.h:128
A persistent I/O buffer.
Definition iobuf.h:38

References ifec_rfd::count, cur_rx, DBG, DBG2, DBGIO_HD, DBGP, EINVAL, ifec_refill_rx_ring(), iob_put, netdev, netdev_rx(), netdev_rx_err(), NULL, ifec_rfd::packet, priv, RFD_COUNT, RFD_OK, RFD_STATUS, RFDMaskCount, RFDShort, ifec_rfd::status, and status.

Referenced by ifec_net_poll().

◆ ifec_get_rx_desc()

int ifec_get_rx_desc ( struct net_device * netdev,
int cur,
int cmd,
int link )
static

Definition at line 848 of file eepro100.c.

850{
851 struct ifec_private *priv = netdev->priv;
852 struct ifec_rfd *rfd = priv->rfds[cur];
853
854 DBGP ( "ifec_get_rx_desc\n" );
855
856 priv->rx_iobs[cur] = alloc_iob ( sizeof ( *rfd ) );
857 if ( ! priv->rx_iobs[cur] ) {
858 DBG ( "alloc_iob failed. desc. nr: %d\n", cur );
859 priv->rfds[cur] = NULL;
860 return -ENOMEM;
861 }
862
863 /* Initialize new tail. */
864 priv->rfds[cur] = priv->rx_iobs[cur]->data;
865 ifec_rfd_init ( priv->rfds[cur], cmd, link );
866 iob_reserve ( priv->rx_iobs[cur], RFD_HEADER_LEN );
867
868 return 0;
869}
struct golan_eqe_cmd cmd
Definition CIB_PRM.h:1
static void ifec_rfd_init(struct ifec_rfd *rfd, s16 command, u32 link)
Definition eepro100.c:719
#define RFD_HEADER_LEN
Definition eepro100.h:17
struct io_buffer * alloc_iob(size_t len)
Allocate I/O buffer.
Definition iobuf.c:131
#define iob_reserve(iobuf, len)
Definition iobuf.h:72

References alloc_iob(), cmd, DBG, DBGP, ENOMEM, ifec_rfd_init(), iob_reserve, link, netdev, NULL, priv, and RFD_HEADER_LEN.

Referenced by ifec_refill_rx_ring().

◆ ifec_refill_rx_ring()

void ifec_refill_rx_ring ( struct net_device * netdev)
static

Definition at line 876 of file eepro100.c.

877{
878 struct ifec_private *priv = netdev->priv;
879 int i, cur_rx;
880 unsigned short intr_status;
881
882 DBGP ( "ifec_refill_rx_ring\n" );
883
884 for ( i = 0; i < RFD_COUNT; i++ ) {
885 cur_rx = ( priv->cur_rx + i ) % RFD_COUNT;
886 /* only refill if empty */
887 if ( priv->rfds[cur_rx] != NULL ||
888 priv->rx_iobs[cur_rx] != NULL )
889 continue;
890
891 DBG2 ( "refilling RFD %d\n", cur_rx );
892
894 CmdSuspend | CmdEndOfList, 0 ) == 0 ) {
895 if ( i > 0 ) {
896 int prev_rx = ( ( ( cur_rx + RFD_COUNT ) - 1 )
897 % RFD_COUNT );
898 struct ifec_rfd *rfd = priv->rfds[prev_rx];
899
900 rfd->command = 0;
901 rfd->link = virt_to_bus ( priv->rfds[cur_rx] );
902 }
903 }
904 }
905
906 intr_status = inw ( priv->ioaddr + SCBStatus );
907 ifec_check_ru_status ( netdev, intr_status );
908}
static int ifec_get_rx_desc(struct net_device *netdev, int cur, int cmd, int link)
Definition eepro100.c:848
@ CmdEndOfList
Definition eepro100.h:59

References CmdEndOfList, CmdSuspend, ifec_rfd::command, cur_rx, DBG2, DBGP, ifec_check_ru_status(), ifec_get_rx_desc(), inw, ifec_rfd::link, netdev, NULL, priv, RFD_COUNT, SCBStatus, and virt_to_bus().

Referenced by ifec_rx_process(), and ifec_rx_setup().

◆ ifec_rx_setup()

int ifec_rx_setup ( struct net_device * netdev)
static

Definition at line 916 of file eepro100.c.

917{
918 struct ifec_private *priv = netdev->priv;
919 int i;
920
921 DBGP ( "ifec_rx_setup\n" );
922
923 priv->cur_rx = 0;
924
925 /* init values for ifec_refill_rx_ring() */
926 for ( i = 0; i < RFD_COUNT; i++ ) {
927 priv->rfds[i] = NULL;
928 priv->rx_iobs[i] = NULL;
929 }
931
932 return 0;
933}

References DBGP, ifec_refill_rx_ring(), netdev, NULL, priv, and RFD_COUNT.

Referenced by ifec_net_open().

◆ ifec_scb_cmd()

int ifec_scb_cmd ( struct net_device * netdev,
u32 ptr,
u8 cmd )
static

Definition at line 943 of file eepro100.c.

944{
945 struct ifec_private *priv = netdev->priv;
946 unsigned long ioaddr = priv->ioaddr;
947 int rc;
948
949 DBGP ( "ifec_scb_cmd\n" );
950
951 rc = ifec_scb_cmd_wait ( netdev ); /* Wait until ready */
952 if ( !rc ) {
953 outl ( ptr, ioaddr + SCBPointer );
954 outb ( cmd, ioaddr + SCBCmd ); /* Issue command */
955 }
956 return rc;
957}
@ SCBPointer
Definition eepro100.h:31
#define outb(data, io_addr)
Definition io.h:310

References cmd, DBGP, ifec_scb_cmd_wait(), ioaddr, netdev, outb, outl, priv, rc, SCBCmd, SCBPointer, u32, and u8.

Referenced by ifec_net_open(), ifec_reprime_ru(), and ifec_tx_wake().

◆ ifec_scb_cmd_wait()

int ifec_scb_cmd_wait ( struct net_device * netdev)
static

Definition at line 965 of file eepro100.c.

966{
967 struct ifec_private *priv = netdev->priv;
968 unsigned long cmd_ioaddr = priv->ioaddr + SCBCmd;
969 int rc, wait = CU_CMD_TIMEOUT;
970
971 DBGP ( "ifec_scb_cmd_wait\n" );
972
973 for ( ; wait && ( rc = inb ( cmd_ioaddr ) ); wait-- )
974 udelay ( 1 );
975
976 if ( !wait )
977 DBG ( "ifec_scb_cmd_wait timeout!\n" );
978 return rc;
979}
#define CU_CMD_TIMEOUT
Definition eepro100.h:12
#define inb(io_addr)
Definition io.h:283

References CU_CMD_TIMEOUT, DBG, DBGP, inb, netdev, priv, rc, SCBCmd, and udelay().

Referenced by ifec_net_open(), ifec_reprime_ru(), ifec_scb_cmd(), and ifec_tx_wake().

◆ ifec_tx_process()

void ifec_tx_process ( struct net_device * netdev)
static

Definition at line 986 of file eepro100.c.

987{
988 struct ifec_private *priv = netdev->priv;
989 struct ifec_tcb *tcb = priv->tcb_tail;
990 s16 status;
991
992 DBGP ( "ifec_tx_process\n" );
993
994 /* Check status of transmitted packets */
995 while ( ( status = tcb->status ) && tcb->iob ) {
996 if ( status & TCB_U ) {
997 /* report error to iPXE */
998 DBG ( "ifec_tx_process : tx error!\n " );
1000 } else {
1001 /* report successful transmit */
1002 netdev_tx_complete ( netdev, tcb->iob );
1003 }
1004 DBG2 ( "tx completion\n" );
1005
1006 tcb->iob = NULL;
1007 tcb->status = 0;
1008
1009 priv->tcb_tail = tcb->next; /* Next TCB */
1010 tcb = tcb->next;
1011 }
1012}
@ TCB_U
Definition eepro100.h:64
void netdev_tx_complete_err(struct net_device *netdev, struct io_buffer *iobuf, int rc)
Complete network transmission.
Definition netdevice.c:471
static void netdev_tx_complete(struct net_device *netdev, struct io_buffer *iobuf)
Complete network transmission.
Definition netdevice.h:767
struct ifec_tcb * next
Definition eepro100.h:118

References DBG, DBG2, DBGP, EINVAL, ifec_tcb::iob, netdev, netdev_tx_complete(), netdev_tx_complete_err(), ifec_tcb::next, NULL, priv, ifec_tcb::status, status, and TCB_U.

Referenced by ifec_net_poll().

◆ ifec_tx_setup()

int ifec_tx_setup ( struct net_device * netdev)
static

Definition at line 1020 of file eepro100.c.

1021{
1022 struct ifec_private *priv = netdev->priv;
1023 struct ifec_tcb *tcb;
1024 int i;
1025
1026 DBGP ( "ifec_tx_setup\n" );
1027
1028 /* allocate tx ring */
1030 if ( !priv->tcbs ) {
1031 DBG ( "TX-ring allocation failed\n" );
1032 return -ENOMEM;
1033 }
1034
1035 tcb = priv->tcb_tail = priv->tcbs;
1036 priv->tx_curr = priv->tx_tail = 0;
1037 priv->tx_cnt = 0;
1038
1039 for ( i = 0; i < TCB_COUNT; i++, tcb++ ) {
1040 tcb->status = 0;
1041 tcb->count = 0x01208000;
1042 tcb->iob = NULL;
1043 tcb->tbda_addr = virt_to_bus ( &tcb->tbd_addr0 );
1044 tcb->link = virt_to_bus ( tcb + 1 );
1045 tcb->next = tcb + 1;
1046 }
1047 /* We point tcb_head at the last TCB, so the first ifec_net_transmit()
1048 * will use the first (head->next) TCB to transmit. */
1049 priv->tcb_head = --tcb;
1050 tcb->link = virt_to_bus ( priv->tcbs );
1051 tcb->next = priv->tcbs;
1052
1053 return 0;
1054}
#define TCB_COUNT
Definition eepro100.h:21
u32 tbda_addr
Definition eepro100.h:110
u32 link
Definition eepro100.h:109

References CB_ALIGN, ifec_tcb::count, DBG, DBGP, ENOMEM, ifec_tcb::iob, ifec_tcb::link, malloc_phys(), netdev, ifec_tcb::next, NULL, priv, ifec_tcb::status, ifec_tcb::tbd_addr0, ifec_tcb::tbda_addr, TCB_COUNT, TX_RING_BYTES, and virt_to_bus().

Referenced by ifec_net_open().

◆ ifec_tx_wake()

void ifec_tx_wake ( struct net_device * netdev)

Definition at line 1073 of file eepro100.c.

1074{
1075 struct ifec_private *priv = netdev->priv;
1076 unsigned long ioaddr = priv->ioaddr;
1077 struct ifec_tcb *tcb = priv->tcb_head->next;
1078
1079 DBGP ( "ifec_tx_wake\n" );
1080
1081 /* For the special case of the first transmit, we issue a START. The
1082 * card won't RESUME after the configure command. */
1083 if ( priv->configured ) {
1084 priv->configured = 0;
1085 ifec_scb_cmd ( netdev, virt_to_bus ( tcb ), CUStart );
1087 return;
1088 }
1089
1090 /* Resume if suspended. */
1091 switch ( ( inw ( ioaddr + SCBStatus ) >> 6 ) & 0x3 ) {
1092 case 0: /* Idle - We should not reach this state. */
1093 DBG2 ( "ifec_tx_wake: tx idle!\n" );
1094 ifec_scb_cmd ( netdev, virt_to_bus ( tcb ), CUStart );
1096 return;
1097 case 1: /* Suspended */
1098 DBG2 ( "s" );
1099 break;
1100 default: /* Active */
1101 DBG2 ( "a" );
1102 }
1104 outl ( 0, ioaddr + SCBPointer );
1105 priv->tcb_head->command &= ~CmdSuspend;
1106 /* Immediately issue Resume command */
1107 outb ( CUResume, ioaddr + SCBCmd );
1109}
@ CUResume
Definition eepro100.h:43

References CmdSuspend, CUResume, CUStart, DBG2, DBGP, ifec_scb_cmd(), ifec_scb_cmd_wait(), inw, ioaddr, netdev, outb, outl, priv, SCBCmd, SCBPointer, SCBStatus, and virt_to_bus().

Referenced by ifec_net_transmit().

Variable Documentation

◆ ifec_cfg

struct ifec_cfg ifec_cfg
static
Initial value:
= {
.status = 0,
.command = CmdConfigure | CmdSuspend,
.link = 0,
.byte = { 22,
( TX_FIFO << 4 ) | RX_FIFO,
0, 0,
TX_DMA_COUNT + 0x80,
0x32,
0x03,
1,
0,
0x2E,
0,
0x60,
0, 0xf2,
0x48,
0, 0x40,
0xf2,
0x80,
0x3f,
0x0D }
}
#define RX_FIFO
Definition eepro100.h:9
@ CmdConfigure
Definition eepro100.h:55
#define RX_DMA_COUNT
Definition eepro100.h:11
#define TX_FIFO
Definition eepro100.h:8
#define TX_DMA_COUNT
Definition eepro100.h:10

Definition at line 127 of file eepro100.c.

127 {
128 .status = 0,
129 .command = CmdConfigure | CmdSuspend,
130 .link = 0, /* Filled in later */
131 .byte = { 22, /* How many bytes in this array */
132 ( TX_FIFO << 4 ) | RX_FIFO, /* Rx & Tx FIFO limits */
133 0, 0, /* Adaptive Interframe Spacing */
134 RX_DMA_COUNT, /* Rx DMA max byte count */
135 TX_DMA_COUNT + 0x80, /* Tx DMA max byte count */
136 0x32, /* Many bits. */
137 0x03, /* Discard short receive & Underrun retries */
138 1, /* 1=Use MII 0=Use AUI */
139 0,
140 0x2E, /* NSAI, Preamble length, & Loopback*/
141 0, /* Linear priority */
142 0x60, /* L PRI MODE & Interframe spacing */
143 0, 0xf2,
144 0x48, /* Promiscuous, Broadcast disable, CRS & CDT */
145 0, 0x40,
146 0xf2, /* Stripping, Padding, Receive CRC Transfer */
147 0x80, /* 0x40=Force full-duplex, 0x80=Allowfull-duplex*/
148 0x3f, /* Multiple IA */
149 0x0D } /* Multicast all */
150};

◆ ifec_operations

struct net_device_operations ifec_operations
static
Initial value:
= {
.open = ifec_net_open,
.close = ifec_net_close,
.transmit = ifec_net_transmit,
.poll = ifec_net_poll,
.irq = ifec_net_irq
}
static int ifec_net_open(struct net_device *netdev)
Definition eepro100.c:310
static void ifec_net_close(struct net_device *netdev)
Definition eepro100.c:258
static int ifec_net_transmit(struct net_device *netdev, struct io_buffer *iobuf)
Definition eepro100.c:437
static void ifec_net_poll(struct net_device *netdev)
Definition eepro100.c:401

Definition at line 152 of file eepro100.c.

152 {
153 .open = ifec_net_open,
154 .close = ifec_net_close,
155 .transmit = ifec_net_transmit,
156 .poll = ifec_net_poll,
157 .irq = ifec_net_irq
158};

Referenced by ifec_pci_probe().

◆ ifec_ee_bits

const uint16_t ifec_ee_bits[]
static
Initial value:
= {
}
#define EE_DATA_READ
Definition davicom.c:80
#define EE_DATA_WRITE
Definition davicom.c:77
#define EE_SHIFT_CLK
Definition davicom.c:75
#define EE_ENB
Definition davicom.c:81
@ SPI_BIT_MOSI
Master Out Slave In.
Definition spi_bit.h:38
@ SPI_BIT_MISO
Master In Slave Out.
Definition spi_bit.h:40
@ SPI_BIT_SCLK
Serial clock.
Definition spi_bit.h:36
#define SPI_BIT_SS(slave)
Determine bit index for a particular slave.
Definition spi_bit.h:51

Definition at line 472 of file eepro100.c.

472 {
476 [SPI_BIT_SS(0)] = EE_ENB,
477};

Referenced by ifec_spi_read_bit(), and ifec_spi_write_bit().

◆ ifec_basher_ops

struct bit_basher_operations ifec_basher_ops
static
Initial value:
= {
}
static void ifec_spi_write_bit(struct bit_basher *basher, unsigned int bit_id, unsigned long data)
Definition eepro100.c:511
static int ifec_spi_read_bit(struct bit_basher *basher, unsigned int bit_id)
Definition eepro100.c:486

Definition at line 531 of file eepro100.c.

531 {
532 .read = ifec_spi_read_bit,
533 .write = ifec_spi_write_bit,
534};

Referenced by ifec_init_eeprom().

◆ ifec_nics

struct pci_device_id ifec_nics[]
static

Definition at line 1113 of file eepro100.c.

1113 {
1114PCI_ROM(0x8086, 0x1029, "id1029", "Intel EtherExpressPro100 ID1029", 0),
1115PCI_ROM(0x8086, 0x1030, "id1030", "Intel EtherExpressPro100 ID1030", 0),
1116PCI_ROM(0x8086, 0x1031, "82801cam", "Intel 82801CAM (ICH3) Chipset Ethernet Controller", 0),
1117PCI_ROM(0x8086, 0x1032, "eepro100-1032", "Intel PRO/100 VE Network Connection", 0),
1118PCI_ROM(0x8086, 0x1033, "eepro100-1033", "Intel PRO/100 VM Network Connection", 0),
1119PCI_ROM(0x8086, 0x1034, "eepro100-1034", "Intel PRO/100 VM Network Connection", 0),
1120PCI_ROM(0x8086, 0x1035, "eepro100-1035", "Intel 82801CAM (ICH3) Chipset Ethernet Controller", 0),
1121PCI_ROM(0x8086, 0x1036, "eepro100-1036", "Intel 82801CAM (ICH3) Chipset Ethernet Controller", 0),
1122PCI_ROM(0x8086, 0x1037, "eepro100-1037", "Intel 82801CAM (ICH3) Chipset Ethernet Controller", 0),
1123PCI_ROM(0x8086, 0x1038, "id1038", "Intel PRO/100 VM Network Connection", 0),
1124PCI_ROM(0x8086, 0x1039, "82562et", "Intel PRO100 VE 82562ET", 0),
1125PCI_ROM(0x8086, 0x103a, "id103a", "Intel Corporation 82559 InBusiness 10/100", 0),
1126PCI_ROM(0x8086, 0x103b, "82562etb", "Intel PRO100 VE 82562ETB", 0),
1127PCI_ROM(0x8086, 0x103c, "eepro100-103c", "Intel PRO/100 VM Network Connection", 0),
1128PCI_ROM(0x8086, 0x103d, "eepro100-103d", "Intel PRO/100 VE Network Connection", 0),
1129PCI_ROM(0x8086, 0x103e, "eepro100-103e", "Intel PRO/100 VM Network Connection", 0),
1130PCI_ROM(0x8086, 0x1050, "82562ez", "Intel 82562EZ Network Connection", 0),
1131PCI_ROM(0x8086, 0x1051, "prove", "Intel PRO/100 VE Network Connection", 0),
1132PCI_ROM(0x8086, 0x1059, "82551qm", "Intel PRO/100 M Mobile Connection", 0),
1133PCI_ROM(0x8086, 0x1065, "82562-3", "Intel 82562 based Fast Ethernet Connection", 0),
1134PCI_ROM(0x8086, 0x1092, "82562-3", "Intel Pro/100 VE Network", 0),
1135PCI_ROM(0x8086, 0x10fe, "82552", "Intel 82552 10/100 Network Connection", 0),
1136PCI_ROM(0x8086, 0x1209, "82559er", "Intel EtherExpressPro100 82559ER", 0),
1137PCI_ROM(0x8086, 0x1227, "82865", "Intel 82865 EtherExpress PRO/100A", 0),
1138PCI_ROM(0x8086, 0x1228, "82556", "Intel 82556 EtherExpress PRO/100 Smart", 0),
1139PCI_ROM(0x8086, 0x1229, "eepro100", "Intel EtherExpressPro100", 0),
1140PCI_ROM(0x8086, 0x2449, "82562em", "Intel EtherExpressPro100 82562EM", 0),
1141PCI_ROM(0x8086, 0x2459, "82562-1", "Intel 82562 based Fast Ethernet Connection", 0),
1142PCI_ROM(0x8086, 0x245d, "82562-2", "Intel 82562 based Fast Ethernet Connection", 0),
1143PCI_ROM(0x8086, 0x27dc, "eepro100-27dc", "Intel 82801G (ICH7) Chipset Ethernet Controller", 0),
1144PCI_ROM(0x8086, 0x5200, "eepro100-5200", "Intel EtherExpress PRO/100 Intelligent Server", 0),
1145PCI_ROM(0x8086, 0x5201, "eepro100-5201", "Intel EtherExpress PRO/100 Intelligent Server", 0),
1146};
#define PCI_ROM(_vendor, _device, _name, _description, _data)
Definition pci.h:308

◆ __pci_driver

struct pci_driver ifec_driver __pci_driver
Initial value:
= {
.ids = ifec_nics,
.id_count = ( sizeof (ifec_nics) / sizeof (ifec_nics[0]) ),
.probe = ifec_pci_probe,
}
static struct pci_device_id ifec_nics[]
Definition eepro100.c:1113
static int ifec_pci_probe(struct pci_device *pci)
Definition eepro100.c:172
static void ifec_pci_remove(struct pci_device *pci)
Definition eepro100.c:237
static struct xen_remove_from_physmap * remove
Definition xenmem.h:40

Definition at line 1152 of file eepro100.c.

1152 {
1153 .ids = ifec_nics,
1154 .id_count = ( sizeof (ifec_nics) / sizeof (ifec_nics[0]) ),
1155 .probe = ifec_pci_probe,
1157};