Documentation/networking/device_drivers/ethernet/davicom/dm9000.rst

Source file repositories/reference/linux-study-clean/Documentation/networking/device_drivers/ethernet/davicom/dm9000.rst

File Facts

System
Linux kernel
Corpus path
Documentation/networking/device_drivers/ethernet/davicom/dm9000.rst
Extension
.rst
Size
5211 bytes
Lines
172
Domain
Support Tooling And Documentation
Bucket
Documentation
Inferred role
Support Tooling And Documentation: documentation
Status
atlas-only

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

.. SPDX-License-Identifier: GPL-2.0

=====================
DM9000 Network driver
=====================

Copyright 2008 Simtec Electronics,

	  Ben Dooks <ben@simtec.co.uk> <ben-linux@fluff.org>


Introduction
------------

This file describes how to use the DM9000 platform-device based network driver
that is contained in the files drivers/net/dm9000.c and drivers/net/dm9000.h.

The driver supports three DM9000 variants, the DM9000E which is the first chip
supported as well as the newer DM9000A and DM9000B devices. It is currently
maintained and tested by Ben Dooks, who should be CC: to any patches for this
driver.


Defining the platform device
----------------------------

The minimum set of resources attached to the platform device are as follows:

    1) The physical address of the address register
    2) The physical address of the data register
    3) The IRQ line the device's interrupt pin is connected to.

These resources should be specified in that order, as the ordering of the
two address regions is important (the driver expects these to be address
and then data).

An example from arch/arm/mach-s3c/mach-bast.c is::

  static struct resource bast_dm9k_resource[] = {
	[0] = {
		.start = S3C2410_CS5 + BAST_PA_DM9000,
		.end   = S3C2410_CS5 + BAST_PA_DM9000 + 3,
		.flags = IORESOURCE_MEM,
	},
	[1] = {
		.start = S3C2410_CS5 + BAST_PA_DM9000 + 0x40,
		.end   = S3C2410_CS5 + BAST_PA_DM9000 + 0x40 + 0x3f,
		.flags = IORESOURCE_MEM,
	},
	[2] = {
		.start = IRQ_DM9000,
		.end   = IRQ_DM9000,
		.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
	}
  };

  static struct platform_device bast_device_dm9k = {
	.name		= "dm9000",
	.id		= 0,
	.num_resources	= ARRAY_SIZE(bast_dm9k_resource),
	.resource	= bast_dm9k_resource,
  };

Note the setting of the IRQ trigger flag in bast_dm9k_resource[2].flags,
as this will generate a warning if it is not present. The trigger from
the flags field will be passed to request_irq() when registering the IRQ
handler to ensure that the IRQ is setup correctly.

This shows a typical platform device, without the optional configuration
platform data supplied. The next example uses the same resources, but adds

Annotation

Implementation Notes