david/ipxe
Archived
1
0
Commit Graph

921 Commits

Author SHA1 Message Date
Michael Brown
1941c933f8 [pci] Enable memory cycles in adjust_pci_device()
adjust_pci_device() has historically enabled bus-mastering and I/O
cycles, but has never previously needed to enable memory cycles.  Some
EFI systems seem not to enable memory cycles by default, so add that
to the list of PCI command register bits that we force on.
2008-12-12 19:15:00 +00:00
Marty Connor
1206999288 [e1000] Use PCI_BASE_ADDRESS_* symbols instead of integers
When compiling for the Linux kernel, PCI_BASE_ADDRESS_0 == 0, and
PCI_BASE_ADDRESS_1 == 1.  This is not so when compiling for gPXE.  We
must use the symbolic names rather than integers to get the correct
values.

Bug identified and patch supplied by:

   George Chou <george.chou@advantech.com>
2008-12-05 16:35:33 +00:00
Michael Brown
b0d2c9a4d5 [hermon] Fix permissions broken in 3a799e9 ("Add PCI ID for ConnectX QDR card")
The patch file supplied for commit 3a799e9 ("[hermon] Add PCI ID for
ConnectX QDR card") accidentally marked drivers/infiniband/hermon.c as
being executable.
2008-12-04 23:27:21 +00:00
Michael Brown
3a799e99ca [hermon] Add PCI ID for ConnectX QDR card
Patch provided by Itay Gazit <itaygazit@gmail.com>.
2008-12-04 20:48:53 +00:00
Pantelis Koukousoulas
7166bc7b2d [b44] Add driver for Broadcom bcm44xx cards
This driver is based on Stefan Hajnoczi's summer work, which
is in turn based on version 1.01 of the linux b44 driver.
I just assembled the pieces and fixed/added a few pieces
here and there to make it work for my hardware.

The most major limitation is that this driver won't work
on systems with >1GB RAM due to the card not having enough
address bits for that and gPXE not working around this
limitation.

Still, other than that the driver works well enough for
at least 2 users :) and the above limitation can always
be fixed when somebody wants it bad enough :)

Signed-off-by: Pantelis Koukousoulas <pktoss@gmail.com>
2008-11-21 23:22:50 +00:00
Laurent Vivier
a2686a55c4 [blockdev] Move block device operations to structure block_device_operations
Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net>
2008-11-19 20:04:43 +00:00
Laurent Vivier
b48f37e69a [virtio] Split virtio-net.c into several files.
Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net>
2008-11-19 19:58:51 +00:00
Laurent Vivier
14a739ba6a [virtio] Consolidate virtio-net static data into a struct vring_virtqueue
Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net>
2008-11-19 19:55:54 +00:00
Laurent Vivier
d3d8f20626 [virtio] Remove dependency on nic for virtio PCI functions
Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net>
2008-11-19 19:51:38 +00:00
Laurent Vivier
fc49421c7e [virtio] Consolidate vring_get_buf() by using a buffer list to add to the vring
Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net>
2008-11-19 19:50:51 +00:00
Laurent Vivier
5dd5107976 [virtio] Move virtio-pci.h and virtio-ring.h to include/gpxe
Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net>
2008-11-19 19:48:30 +00:00
Michael Brown
0ebbbb95fa [x86_64] Fix assorted 64-bit compilation errors and warnings
Remove various 32-bit assumptions scattered throughout the codebase.
The code is still not necessarily 64-bit clean, but will at least
compile.
2008-11-19 19:33:05 +00:00
Michael Brown
b59e0cc56e [i386] Change [u]int32_t to [unsigned] int, rather than [unsigned] long
This brings us in to line with Linux definitions, and also simplifies
adding x86_64 support since both platforms have 2-byte shorts, 4-byte
ints and 8-byte long longs.
2008-11-19 19:15:44 +00:00
Marty Connor
85f82f09e9 [r8169] New rtl8169 family driver
This is a completely rewritten version of the rtl8169 family driver
using the gPXE driver API.
2008-11-18 04:04:07 +00:00
Michael Brown
464bf35cc0 [linda] Add missing copyright notices 2008-11-18 00:14:10 +00:00
Michael Brown
8a80e7ace1 [linda] Purge references to 8051 2008-11-17 23:55:43 +00:00
Michael Brown
1b3edd9e11 [infiniband] Respect hop pointer when building directed route SMP return path
The return path in directed route SMPs lists the egress ports in order
from SM to node, rather than from node to SM.

To write to the correct offset within the return path, we need to
parse the hop pointer.  This is held within the class-specific data
portion of the MAD header, which was previously unused by us and
defined to be a uint16_t.  Define this field to be a union type; this
requires some rearrangement of ib_mad.h and corresponding changes to
ipoib.c.
2008-11-12 15:35:45 +00:00
Michael Brown
125c6d66a8 [linda] Add support for QLogic 7220-based Infiniband HCAs
These cards very nearly support our current IB Verbs model.  There is
one minor difference: multicast packets will always be delivered by
the hardware to QP0, so the driver has to redirect them to the
appropriate QP.  This means that QP owners may see receive completions
for buffers that they never posted.  Nothing in our current codebase
will break because of this.
2008-11-11 05:58:47 +00:00
Michael Brown
9e5fd8ec59 [infiniband] Add raw packet parser and constructor
This can be used with cards that require the driver to construct and
parse packet headers manually.  Headers are optionally handled
out-of-line from the packet payload, since some such cards will split
received headers into a separate ring buffer.
2008-11-11 05:31:19 +00:00
Michael Brown
c0ec00f47f [infiniband] Add a standalone subnet management agent
This generic SMA code can be used for any cards that do not provide
firmware-based embedded SMAs.
2008-11-11 05:31:18 +00:00
Michael Brown
9a35830d1f [ipoib] Kill off the IPoIB pseudo-header
Some Infiniband cards will not be as accommodating as the Arbel and
Hermon cards in providing enough space for us to push a fake extra
header at the start of the received packet.  We must therefore make do
with squeezing enough information to identify source and destination
addresses into the two bytes of padding within a genuine IPoIB
link-layer header.
2008-11-11 05:31:08 +00:00
Michael Brown
663904a7bc [infiniband] Split subnet management agent client out into ib_smc.c
Not all Infiniband cards have embedded subnet management agents.
Split out the code that communicates with such an embedded SMA into a
separate ib_smc.c file, and have drivers call ib_smc_update()
explicitly when they suspect that the answers given by the embedded
SMA may have changed.
2008-11-11 05:31:07 +00:00
Michael Brown
830e19eb54 [infiniband] Pass address vector in receive completions
Receive completion handlers now get passed an address vector
containing the information extracted from the packet headers
(including the GRH, if present), and only the payload remains in the
I/O buffer.

This breaks the symmetry between transmit and receive completions, so
remove the ib_completer_t type and use an ib_completion_queue_operations
structure instead.

Rename the "destination QPN" and "destination LID" fields in struct
ib_address_vector to reflect its new dual usage.

Since the ib_completion structure now contains only an IB status code,
("syndrome") replace it with a generic gPXE integer status code.
2008-11-11 05:31:07 +00:00
Michael Brown
0de5f7af6d [infiniband] Maintain queue fill level as a property of a work queue
Both queue owners and drivers often need to keep track of the fill
level, so let's make it a generic property.
2008-11-11 05:31:06 +00:00
Michael Brown
d9751edafa [infiniband] Flush uncompleted work queue entries at QP teardown
Avoid leaking I/O buffers in ib_destroy_qp() by completing any
outstanding work queue entries with a generic error code.  This
requires the completion handlers to be available to ib_destroy_qp(),
which is done by making them static configuration parameters of the CQ
(set by ib_create_cq()) rather than being provided on each call to
ib_poll_cq().

This mimics the functionality of netdev_{tx,rx}_flush().  The netdev
flush functions would previously have been catching any I/O buffers
leaked by the IPoIB data queue (though not by the IPoIB metadata
queue).
2008-11-11 05:31:06 +00:00
Pantelis Koukousoulas
dd34500188 [ne2k_isa] Restore support for ne2k isa cards
Add the simplified ne2k_isa driver.  It is just a selective copy+paste
of the relevant parts from ns8390.c plus a little trivial hacking to
make it actually work.

It is true that the code is pretty ugly, but:
  a) ns8390.c is worse
  b) It is only 372 lines and no #ifdefs
  c) It works both in qemu/bochs and in real hardware
     and we all know it is easier to cleanup working code

Hope someone will find the time to rewrite this driver properly,
but until then at least for me this is an ok solution.

Signed-off-by: Pantelis Koukousoulas <pktoss@gmail.com>
2008-11-08 13:01:20 +00:00
Pantelis Koukousoulas
180d99fc22 [isa] Fix a small typo in isa.c.
With this patch ISA drivers actually get probed so they have a fair
chance of working now.

Signed-off-by: Pantelis Koukousoulas <pktoss@gmail.com>
2008-11-08 12:54:18 +00:00
Michael Brown
46f43d8ea7 [phantom] Do not halt PEGs on driver shutdown
Halting the PEGs breaks platforms where there is sideband access to
the NIC (e.g. HP machines using iLO).  (We have to retain the
unhalting code because on some other platforms (e.g. IBM blades with
BOFM) the pre-PXE firmware must halt the PEGs to avoid issues with the
BIOS rereading via the expansion ROM BAR.)
2008-11-08 05:10:23 +00:00
Michael Brown
aa95744915 [phantom] Allow for PXE boot to be enabled/disabled on a per-port basis
This is something of an ugly hack to accommodate an OEM requirement.
The NIC has only one expansion ROM BAR, rather than one per port.  To
allow individual ports to be selectively enabled/disabled for PXE boot
(as required), we must therefore leave the expansion ROM always
enabled, and place the per-port enable/disable logic within the gPXE
driver.
2008-11-01 01:55:13 +00:00
Michael Brown
32bc76f902 [phantom] Assume one net device per PCI function
The Phantom firmware selectively disables PCI functions based on the
board type, with the end result that we see one PCI function for each
network port.  This allows us to eliminate the code for reading from
flash and, more importantly, removes knowledge of the board type magic
number from the gPXE driver.
2008-10-31 01:55:58 +00:00
Michael Brown
0a6c66a830 [settings] Add the notion of a "tag magic" to numbered settings
Settings can be constructed using a dotted-decimal notation, to allow
for access to unnamed settings.  The default interpretation is as a
DHCP option number (with encapsulated options represented as
"<encapsulating option>.<encapsulated option>".

In several contexts (e.g. SMBIOS, Phantom CLP), it is useful to
interpret the dotted-decimal notation as referring to non-DHCP
options.  In this case, it becomes necessary for these contexts to
ignore standard DHCP options, otherwise we end up trying to, for
example, retrieve the boot filename from SMBIOS.

Allow settings blocks to specify a "tag magic".  When dotted-decimal
notation is used to construct a setting, the tag magic value of the
originating settings block will be ORed in to the tag number.
Store/fetch methods can then check for the magic number before
interpreting arbitrarily-numbered settings.
2008-10-30 21:47:14 +00:00
Michael Brown
1bc2adea9a [phantom] Add CLP settings interface
This interface provides access to firmware settings (e.g. MAC address)
that will apply to all drivers loaded for the duration of the current
system boot.
2008-10-28 18:49:58 +00:00
Michael Brown
664f4cf365 [phantom] Unhalt/halt all PEGs during driver startup/shutdown
A hardware bug means that reads through the expansion ROM BAR can
return corrupted data if the PEGs are running.  This breaks platforms
that re-read the expansion ROM after invoking gPXE code, such as IBM
blade servers.

Halt PEGs during driver shutdown, and unhalt PEGs during driver
startup if we detect that this is not the first startup since
power-on.
2008-10-28 18:47:44 +00:00
Michael Brown
df033de24f [phantom] Add line count limit to phantom_dmesg()
The Phantom firmware debug logs can be extremely long, so add the
ability to restrict the output to the last N lines.
2008-10-28 18:47:00 +00:00
Michael Brown
d4c8273569 [phantom] Change register space abstraction to match other drivers
Most other Phantom drivers define a register space in terms of a 64M
virtual address space.  While this doesn't map in any meaningful way
to the actual addresses used on the latest cards, it makes maintenance
easier if we do the same.
2008-10-24 03:52:17 +01:00
Michael Brown
85f09b5fc0 [tg3] Add PCI ID for BCM5786
Contributed by Steve Cayford <cayfo001@umn.edu>
2008-10-21 22:31:10 +01:00
Michael Brown
58dd6e04c5 [etherfabric] Merge changes from vendor tree
Also clean up minor errors in the use of debug macros.
2008-10-17 01:51:41 +01:00
Eduardo Habkost
744b98d273 virtio-net: Fix kick/wait logic
The virtnet_transmit() logic for waiting the packet to be transmitted is
reversed: we can't wait the packet to be transmitted if we didn't kick()
the ring yet. The vring_more_used() while loop logic is reversed also,
that explains why the code works today.

The current code risks trying to free a buffer from the used ring
when none was available, that will happen most times because KVM
doesn't handle the packet immediately on kick(). Luckily it was working
because it was unlikely to have a buffer still queued for transmit when
virtnet_transmit() was called.

Also, adds a BUG_ON() to vring_get_buf(), to catch cases where we try
to free a buffer from the used ring when there was none available.

Patch for Etherboot. gPXE has the same problem on the code, but I hadn't
a chance to test gPXE using virtio-net yet.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
2008-10-16 20:32:56 +01:00
Michael Brown
3a505dfc35 [netdevice] Change link-layer push() and pull() methods to take raw types
EFI requires us to be able to specify the source address for
individual transmitted packets, and to be able to extract the
destination address on received packets.

Take advantage of this to rationalise the push() and pull() methods so
that push() takes a (dest,source,proto) tuple and pull() returns a
(dest,source,proto) tuple.
2008-10-16 05:13:40 +01:00
Michael Brown
6b9cc25556 [netdevice] Split multicast hashing out into an mc_hash method
Multicast hashing is an ugly overlap between network and link layers.
EFI requires us to provide access to this functionality, so move it
out of ipv4.c and expose it as a method of the link layer.
2008-10-16 05:12:56 +01:00
Michael Brown
832668105e [netdevice] Add maximum packet length as a net device property
Currently this length is set at device allocation time, and is never
changed.
2008-10-16 05:11:47 +01:00
Michael Brown
16f1e35775 [timer] Formalise the timer API
We now have two implementations for the timer API: one using the
time-of-day counter at 40:70 and one using RDTSC.  Both make use of
timer2_udelay().
2008-10-12 20:22:02 +01:00
Michael Brown
e226a8d8d9 [phantom] Add missing #include <gpxe/io.h> 2008-10-12 12:52:47 +01:00
Michael Brown
8e38669d54 [rtl8139] Add missing #include <string.h> 2008-10-12 02:14:16 +01:00
Michael Brown
a1e11a6beb [natsemi] Add missing #include <string.h> 2008-10-12 02:14:10 +01:00
Michael Brown
1641b5d39b [e1000] Add missing #include <string.h> 2008-10-12 02:14:05 +01:00
Michael Brown
ee2df1d6d6 [ioapi] Remove old io.h file and switch all users over to <gpxe/io.h> 2008-10-12 01:06:27 +01:00
Michael Brown
b40b4f2dbf [cs89x0] Simplify obscure loop syntax 2008-10-12 00:54:58 +01:00
Michael Brown
0b5c39d167 [e1000] Fix dubious syntax in e1000 I/O wrapper macros 2008-10-12 00:54:44 +01:00
Michael Brown
2e812235f4 [makefile] Add -Wformat-nonliteral as an extra warning category
-Wformat-nonliteral is not enabled by -Wall and needs to be explicitly
 specified.

Modified the few files that use nonliteral format strings to work with
this new setting in place.

Inspired by a patch from Carl Karsten <carl@personnelware.com> and an
identical patch from Rorschach <r0rschach@lavabit.com>.
2008-10-10 18:41:24 +01:00
Michael Brown
9dccbc0af2 [i2c] Generalise i2c bit-bashing support to addressless devices
Some devices (e.g. the Atmel AT24C11) have no concept of a device
address; they respond to every device address and use this value as
the word address.  Some other devices use part of the device address
field to extend the word address field.

Generalise the i2c bit-bashing support to handle this by defining the
device address length and word address length as properties of an i2c
device.  The word address is assumed to overflow into the device
address field if the address used exceeds the width of the word
address field.

Also add a bus reset mechanism.  i2c chips don't usually have a reset
line, so rebooting the host will not clear any bizarre state that the
chip may be in.  We reset the bus by clocking SCL until we see SDA
high, at which point we know we can generate a start condition and
have it seen by all devices.  We then generate a stop condition to
leave the bus in a known state prior to use.

Finally, add some extra debugging messages to i2c_bit.c.
2008-10-01 19:24:56 +01:00
Michael Brown
df02c54f86 [arbel] Fix off-by-one error in the failure path in arbel_probe() 2008-10-01 08:11:03 +01:00
Michael Brown
76f6cad8af [hermon] Fix off-by-one error in the failure path in hermon_probe() 2008-10-01 08:10:50 +01:00
Michael Brown
6f87d622e1 [tg3] Add PCI ID
Reported working by Martin Kreiner <m.kreiner@levigo.de>
2008-09-29 16:00:09 +01:00
Michael Brown
39047c5636 [hermon] Allocate only as much memory as is needed for ICM and ICM AUX
Use individual page mappings rather than a single whole-region
mapping, to avoid the waste of memory that occurs due to the
constraint that each mapped block must be aligned on its own size.
2008-09-28 20:43:18 +01:00
Michael Brown
fa880ec70a [arbel] Allocate sufficient space for firmware buffer
We were accidentally allocating only half the required amount of
memory (given the alignment method) for the firmware buffer, leading
to conflicts between the firmware buffer and gPXE code/data segments.
2008-09-25 07:23:34 +01:00
Michael Brown
b45b39260c [hermon] Allocate sufficient space for firmware buffer
We were accidentally allocating only half the required amount of
memory (given the alignment method) for the firmware buffer, leading
to conflicts between the firmware buffer and gPXE code/data segments.
2008-09-25 07:22:06 +01:00
Michael Brown
4011f9d956 [phantom] Skip command PEG initialisation if PEG is already running
It is possible for the BIOS to use the UNDI API to bring up the NIC
prior to system boot.  If this happens, UNM_NIC_REG_CMDPEG_STATE will
contain the value 0xf00f (UNM_NIC_REG_CMDPEG_STATE_INITIALIZE_ACK),
and we should skip initialising the command PEG.
2008-09-23 23:36:55 +01:00
Michael Brown
e13d793160 [phantom] Omit an initialisation step now performed by the firmware
The firmware will now determine the right port mode on all cards, so
the PXE driver doesn't have to set it.  (Setting the port mode
apparently breaks some newer cards.)
2008-09-23 23:11:05 +01:00
Michael Brown
cb6fea0690 [phantom] Fix P3 B1 silicon bug workaround
Commit f58cc3f introduced a temporary workaround for a bug in current
prototype silicon, but failed to apply it to all eight PCI functions
within the device.
2008-08-27 21:25:06 +01:00
Michael Brown
07581d3faa [phantom] Remove comment that no longer matches reality 2008-08-26 04:45:31 +01:00
Michael Brown
f58cc3fca8 [phantom] Temporary workaround for bug in prototype (P3 B1) silicon 2008-08-25 23:25:33 +01:00
Michael Brown
30fb3b3810 [undi] Fill in ProtType correctly in PXENV_UNDI_ISR
Determine the network-layer packet type and fill it in for UNDI
clients.  This is required by some NBPs such as emBoot's winBoot/i.

This change requires refactoring the link-layer portions of the
gPXE netdevice API, so that it becomes possible to strip the
link-layer header without passing the packet up the network stack.
2008-08-20 03:21:37 +01:00
Stefan Hajnoczi
50babca5da [virtio] Add legacy driver for KVM virtio-net
This patch adds support for the virtio-net adapter provided by KVM.

Written by Laurent Vivier <Laurent.Vivier@bull.net> for Etherboot.
Wrapped as legacy driver for gPXE by Stefan Hajnoczi
<stefanha@gmail.com>.
2008-08-01 16:55:49 +01:00
Andrew Schran
6b58992318 [tg3] Added support for tg3-5754.
In tg3_chip_reset(), the PCI_EXPRESS change is taken from the Linux
tg3 driver. I am not sure what exactly it does (it is not documented
in the Linux driver), but it is necessary for the NIC to work
correctly.
2008-07-24 19:55:53 +01:00
Michael Brown
f493283c74 [phantom] Add new board type 2008-07-24 19:40:10 +01:00
Michael Brown
4e033c774b [phantom] Guard against partially-written status descriptors
Conjecture: The hardware issues 64-bit DMA writes of status descriptors,
which some PCI bridges seem to split into two 32-bit writes in reverse
order (i.e. dword 1 first).  This means that we sometimes observe a
partial status descriptor.  Add an explicit check to ensure that the
descriptor is complete before processing it.

Also ensure that the RDS consumer counter is incremented only when we
know that we have actually consumed an RX descriptor.
2008-07-17 15:45:40 +01:00
Andrew Schran
34c1a5b91d [forcedeth] Add support for PCI ID 10de:0373 2008-07-10 01:19:08 +01:00
Michael Brown
997bccc64e [hermon] Add support for MT26418 device
PCI ID supplied (and tested) by Frederic
Temporelli <frederic.temporelli@bull.net>
2008-07-09 00:53:38 +01:00
Michael Brown
d474386336 [phantom] Remove warning relating to now-fixed firmware bug 2008-07-08 22:37:36 +01:00
Michael Brown
22d00797f1 [phantom] Add NetXen dual copyright 2008-07-08 22:36:07 +01:00
Michael Brown
4f05d2fca7 [phantom] Initialise RCVPEG before reading MAC addresses 2008-07-08 20:59:33 +01:00
Michael Brown
3ad348e55a [phantom] Add support for NetXen Phantom NICs 2008-07-04 19:38:14 -07:00
H. Peter Anvin
1152b78ec1 [ns8390] Use stub files instead of src/Config
ns8390.c can produce four different drivers (one PCI, three ISA.)  The
ISA driver requires setting a few macros; do that by setting defines
in stub files instead of using src/Config.

Currently, all the ISA drivers are broken (they were not enabled by
default), so #if 0 them out.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-06-30 12:26:12 -07:00
Steven Walter
14fe4d4ba5 [tg3] Recognize the BCM5789
Add an entry to tg3_nics for the BCM5789

Signed-off-by: Steven Walter <stevenrwalter@gmail.com>
2008-06-27 22:12:43 +01:00
Stefan Hajnoczi
a71b4df1c9 [via-rhine] Fix erroneous uses of memory I/O instead of port I/O 2008-06-12 15:21:42 +01:00
Michael Brown
7d01bf663e [libc] Fix isdigit(), islower() and isupper().
From: Stefan Hajnoczi <stefanha@gmail.com>
2008-05-19 16:34:17 +01:00
Michael Brown
78281b09e6 [tg3] Add support for tg3-5721
From: Daniel Mealha Cabrita <dancab@utfpr.edu.br>

I've added tg3-5721 support for gPXE, the patch (against gpxe-0.9.3) is
attached to this message.

This chipset is present in HP ML150 G2 servers (possibly other HP machines
as well).
2008-05-19 16:22:13 +01:00
Michael Brown
3430226d40 [MTNIC] Minor cleanups of vendor-provided driver for Mellanox 10GigE cards
Drivers are not allowed to call printf().  Converted eprintf() to DBG(),
and removed spurious startup banner.

Fixed hardcoded inclusion of little_bswap.h

Use EIO rather than 1 as an error number.
2008-04-22 17:50:30 +01:00
Michael Brown
1ba959c6b3 [NETDEV] Add notion of link state
Add ability for network devices to flag link up/down state to the
networking core.

Autobooting code will now wait for link-up before attempting DHCP.

IPoIB reflects the Infiniband link state as the network device link state
(which is not strictly correct; we also need a succesful IPoIB IPv4
broadcast group join), but is probably more informative.
2008-04-22 17:40:50 +01:00
Michael Brown
d72bf13b78 [Infiniband] Fix event queue doorbell ringing on Arbel 2008-04-22 02:18:32 +01:00
Michael Brown
c9fb012d4f [Infiniband] Add multiport support for Arbel cards 2008-04-22 01:37:00 +01:00
Michael Brown
35a5836677 [Infiniband] Move event-queue process from driver to Infiniband core 2008-04-21 13:23:11 +01:00
Michael Brown
e55bab3ce3 [Hermon] Fix event queue doorbells.
Event queue doorbells must use UAR pages 0-127 depending on event queue
number; other doorbells must use pages 128+ (and we choose to use page
128).
2008-04-18 05:33:39 +01:00
Michael Brown
a176a24ac0 [Infiniband] Add preliminary multiple port support for Hermon cards
Infiniband devices no longer block waiting for link-up in
register_ibdev().

Hermon driver needs to create an event queue and poll for link-up events.

Infiniband core needs to reread MAD parameters when link state changes.

IPoIB needs to cope with Infiniband link parameters being only partially
available at probe and open time.
2008-04-18 02:50:48 +01:00
Marty Connor
fbb6a3fd65 [Drivers-r8169] Add support for newer rtl8169 variants from Hilko Bengen
03-19-2008, Hilko Bengen, Cleanups and fixes for newer cards
(successfully tested with 8110SC-d onboard NIC)
2008-03-31 09:14:23 -04:00
Michael Brown
8fceee785f Merge branch 'master' of rom.etherboot.org:/pub/scm/gpxe 2008-03-22 00:50:06 +00:00
Michael Brown
8afb36c3bc [Settings] Migrate DHCP and NVO code to the new settings API (untested) 2008-03-21 22:15:31 +00:00
Marty Connor
e97ae4a788 ]Drivers] Update licensing for cs89x0.[ch] and cs89x0.txt
Russ Nelson sent an email requesting the license change to
GPL Version 2.
2008-03-18 22:31:26 -04:00
Michael Brown
3e781eb87f Merge branch 'xl0-timer' 2008-03-10 13:02:53 +00:00
Michael Brown
06e8a70488 [tg3] Added device ID for rebranded HP card. 2008-03-06 13:19:42 +00:00
Alexey Zaytsev
a1572e0ab0 Modify gPXE core and drivers to work with the new timer subsystem
Signed-off-by: Alexey Zaytsev <alexey.zaytsev@gmail.com>
2008-03-02 03:41:10 +03:00
Michael Brown
bc3f0a25c6 [Infiniband] Add preliminary support for multi-port devices.
Arbel and Hermon cards both have multiple ports.  Add the
infrastructure required to register each port as a separate IB
device.  Don't yet register more than one port, since registration
will currently fail unless a valid link is detected.

Use ib_*_{set,get}_{drv,owner}data wrappers to access driver- and
owner-private data on Infiniband structures.
2008-02-27 13:59:56 +00:00
Michael Brown
6570203571 [Infiniband] Centralise MAD operations
Pull out common code for handling management datagrams from arbel.c
and hermon.c into infiniband.c.

Add port number to struct ib_device.

Add open(), close() and mad() methods to struct ib_device_operations.
2008-02-26 22:56:19 +00:00
Michael Brown
03d1fc1da3 [Hermon] Donate joint copyright on Hermon driver to Mellanox. 2008-02-23 11:05:46 +00:00
Michael Brown
396dc6e797 [Hermon] Add driver for Mellanox Hermon (ConnectX) cards. 2008-02-23 10:51:38 +00:00
Michael Brown
c60050614a Added mtnic driver provided by Mellanox.
Stripped out trailing whitespace to keep git happy.
2008-02-13 15:01:18 +00:00
Marty Connor
9d4e4dbc32 3c90x driver fix (legacy) from Geert Staapers
From: Geert Stappers <stappers@stappers.nl>
To: etherboot-developers@lists.sourceforge.net
Subject: [Etherboot-developers] 3c90x polling again [patch]
Date: Thu, 29 Nov 2007 09:22:36 +0100
User-Agent: Mutt/1.5.16 (2007-06-11)

Hello,

gPXE didn't work on 3COM 905C Tornado cards for me.
It did transmit the DHCP request, but it didn't see the DHCP offer.

Adding debug print statements allready solved the problem.
Attached is a patch that has a cleaner delay then print statements.
The core of it is
-    for(i=0;i<40000;i++);
+    mdelay(1);

There was no research if the change is about a longer delay
or about code NOT being optimized away. It works for me   :-)

Cheers
Geert Stappers
2007-12-20 11:53:00 -05:00
Marty Connor
ff476c04e9 Fix e1000 receive tail pointer (RDT) handling
e1000 should now work in VMware.
2007-12-17 13:07:29 -05:00
Michael Brown
7e8624a26f Merge branch 'master' of rom.etherboot.org:/pub/scm/gpxe 2007-12-15 19:37:44 +00:00
Michael Brown
1d7974182e Overwrite the device descriptor's IRQ number with whatever the legacy
driver's probe() routine fills in in nic->irqno.  This is so that
non-interrupt-capable legacy drivers which set nic->irqno=0 will end
up reporting IRQ#0 via PXENV_UNDI_GET_INFORMATION; this in turn means
that the calling PXE NBP will (should) hook the timer interrupt, and
everything will sort of work.
2007-12-15 19:32:32 +00:00
Marty Connor
bd2607305c Correct e1000 interrupt routine to enable on 1 disable on 0. duh.
The e1000_irq() routine should (per mcb30) do enable on non-zero,
disable on zero.  This is not consistent in all drivers, so I'll
wait to update it when doing a global sweep.
2007-12-13 11:20:45 -05:00
Marty Connor
1a867bfb39 Remove *_fill_nic() calls, and directly set nic->ioaddr and nic->irqno .
This needs to be done manually because if the irq() routine is
implemented then we want something like "nic->irqno = pci->irqno;",
else we do "nic->irqno = 0;" nic->ioaddr may also need to be set
carefully.

Also added local variables to end of many files, for emacs indentation
to match kernel style (tab does 8 space indent).
2007-12-13 11:08:40 -05:00
Michael Brown
1949641d10 Fix compiler warnings that appear only on OpenBSD. 2007-12-06 14:16:46 -06:00
Michael Brown
df868476e7 Various warnings fixups for OpenBSD with gcc-3.3.5. 2007-12-07 00:11:43 +00:00
Michael Brown
64787bad29 Fix prototype mismatch. 2007-12-06 23:35:37 +00:00
Marty Connor
82a3e80645 Add copyright, clean up comments a bit, remove unnecessary code.
Cleanups for e1000.c.
2007-12-03 01:17:41 -05:00
Marty Connor
fa0bd77270 Added netdev_nullify to natsemi_remove() 2007-11-21 15:45:08 +00:00
Michael Brown
de329a36d0 Removed old e1000 driver. 2007-11-21 15:37:58 +00:00
Marty Connor
2d60a3963f Fixed receive instability by not enabling interrupts. duh.
I have successfully booted DOS via iSCSI and PXELINUX via TFTP with this
version of the e1000 driver.
2007-11-20 21:33:42 -05:00
Marty Connor
645a752bc2 This version now transmits and receives.
There may still be an issue with memory handling, since it seems to
die ungracefully when ARP packets come in after loading a kernel.
Something to debug.
2007-11-20 16:23:12 -05:00
Marty Connor
8973caa1e6 Autonegotiation fixes. NIC now autonegotiates to whatever the switch supports. 2007-11-20 12:06:22 -05:00
Marty Connor
e41550b0ba A version of the new e1000 driver that transmits.
autonegotiation still needs work.  receive is not working yet.
2007-11-20 10:23:32 -05:00
Marty Connor
8b0d86914b Rename e1000_main.c to e1000.c to so we can type 'make bin/e1000.dsk' instead of 'make bin/e1000_main.dsk' 2007-11-18 10:54:42 -05:00
Marty Connor
0fea19c398 Introduce files for new e1000 driver 2007-11-18 10:31:00 -05:00
Marty Connor
8564711c20 Move current e1000 driver files to e1000-old/ directory to avoid collisions 2007-11-18 09:58:28 -05:00
Marty Connor
9a4ed0f2d5 Remove unnecessary variable. 2007-11-18 03:11:02 -05:00
Michael Brown
82124ea688 Merge branch 'master' of rom.etherboot.org:/pub/scm/gpxe 2007-10-29 17:22:27 +00:00
Michael Brown
1620b3512c Merge branch '3leaf' 2007-10-29 17:21:58 +00:00
Michael Brown
be7d32396f Added one more PCI ID 2007-10-22 16:24:09 +01:00
Michael Brown
338d45a61e Change ROM names to lower case. 2007-10-11 00:43:21 +01:00
Michael Brown
8069598a99 Add a missing PCI ID that is tested as working. 2007-10-10 02:07:18 +01:00
Michael Brown
14fb6ba189 Quick and very dirty hack to get r8169 driver working again, prior to
any rewrite.
2007-09-26 17:58:51 +01:00
Michael Brown
ed5ff61790 Standardise DBG_PRINTF()->DBG(), and remove custom definitions for
DBG_PRINTF() and assert().
2007-09-26 17:38:36 +01:00
Michael Brown
0f60150c44 Reverted driver/net/mlx_ipoib to clean master state 2007-09-18 07:07:04 +01:00
Michael Brown
95498fa038 Remove the last remaining visible hack. 2007-09-18 06:26:31 +01:00
Michael Brown
982e4dd101 Separated out to a clean new drivers/infiniband directory. 2007-09-18 06:06:55 +01:00
Michael Brown
a5ec029d24 First version that works with SELF_INIT! 2007-09-18 05:46:49 +01:00
Michael Brown
8423b0b109 Gets most of the way through initialisation. 2007-09-18 05:39:34 +01:00
Michael Brown
def5ae9127 Added sw2hw_mpt 2007-09-18 04:45:55 +01:00
Michael Brown
da014080f9 INIT_HCA block now matches. 2007-09-18 04:20:41 +01:00
Michael Brown
57bf8d9905 Seems to get through the ICM mapping process 2007-09-18 03:58:59 +01:00
Michael Brown
4ea6223f5a ICM allocation code in place; about to start test-and-compare runs. 2007-09-18 02:57:49 +01:00
Michael Brown
f20cd6f721 ICM allocation code *should* now be complete. 2007-09-18 02:05:25 +01:00
Michael Brown
af88f60228 Started with the ICM partitioning code. 2007-09-18 01:49:39 +01:00
Michael Brown
c818d47e25 Restructured bits of initialisation (not testable at present) 2007-09-17 22:25:46 +01:00
Michael Brown
dc3165b746 Starting the firmware directly now works. 2007-09-17 21:59:41 +01:00
Michael Brown
0f62bcaa77 Start migrating the remaining initialisation steps. 2007-09-17 21:14:09 +01:00
Michael Brown
f3fcb53faf Don't use the mailboxless version of the HW2SW_CQ command; it seems to
crash the machine.
2007-09-17 19:47:19 +01:00
Michael Brown
12b4cb964b Removed more hacks, and adjusted number of queue entries for likely usage. 2007-09-17 19:17:55 +01:00
Michael Brown
11541b1e01 Remove hacks, and fix leaving the multicast GID. 2007-09-17 19:12:06 +01:00
Michael Brown
267a4483ab Added an almost obscene amount of debugging and assertion code while
tracking down a bug that turned out to be a free_iob() used where I
needed a netdev_tx_complete().  This left the freed I/O buffer on the
net device's TX list, with bad, bad consequences later.

Also fixed the bug in question.
2007-09-17 19:01:10 +01:00
Michael Brown
bdac591726 Some interesting packet corruption happening now. 2007-09-17 13:31:13 +01:00
Michael Brown
2ed1acb9e9 Broadcast GID is now calculated by IPoIB layer. 2007-09-17 11:50:25 +01:00
Michael Brown
32a7bbb1e3 Cleaned up some debug messages. 2007-09-17 10:56:21 +01:00
Michael Brown
ab191e45db Unicasts seem to be working. :) 2007-09-17 10:39:30 +01:00
Michael Brown
2209090120 Dead code disabling 2007-09-17 08:41:06 +01:00
Michael Brown
b3d3814c17 Obtains a response to the get path record! 2007-09-17 08:36:56 +01:00
Michael Brown
e05a8cd4de Use pkey table access to determine broadcast GID directly. 2007-09-17 06:35:21 +01:00
Michael Brown
f6f1f2b7bb Prepare for adding a metadata queue to IPoIB 2007-09-17 06:12:33 +01:00
Michael Brown
440e7926fb Dead code removal 2007-09-17 05:12:47 +01:00
Michael Brown
4e78a53cf2 IPoIB code separated out to ipoib.c. 2007-09-17 05:04:58 +01:00
Michael Brown
67836430e6 Read port GID directly using MAD IFC. 2007-09-17 02:54:15 +01:00
Michael Brown
3c6a6bdc5d Multicast join now works. 2007-09-17 00:24:44 +01:00
Michael Brown
96d0c75c00 Now transmits packets on our own allocated IPoIB queue pair. :) 2007-09-16 22:53:57 +01:00
Michael Brown
4ddb6570f8 Almost working with own-queue allocation. 2007-09-16 22:47:45 +01:00
Michael Brown
7e85f0d296 create_qp() and destroy_qp() now written (but not tested). 2007-09-16 20:54:21 +01:00
Michael Brown
251cc84ed6 Started implementing create_qp() and destroy_qp(). 2007-09-16 19:03:24 +01:00
Michael Brown
b21d4ca21e Revert to dev_priv/owner_priv scheme, rather than container_of; it
makes it easier to put the generic allocation code into infiniband.c
2007-09-16 17:25:15 +01:00
Michael Brown
e238bb1e43 destroy_cq() now implemented (not tested). 2007-09-16 14:39:51 +01:00
Michael Brown
18edcf6634 create_cq() implemented (but not tested). 2007-09-16 14:18:17 +01:00
Michael Brown
725a574042 Match doorbell layout to expected usage. 2007-09-16 13:10:15 +01:00
Michael Brown
5a43293c38 Started to add code for CQ creation 2007-09-16 12:52:58 +01:00
Michael Brown
156b409ccc Rearrange data structures to maximise embedding (and hence minimise
the number of separate allocations that need to be done).
2007-09-16 04:02:20 +01:00
Michael Brown
791f992657 Command interface now reasonably friendly. 2007-09-16 03:13:25 +01:00
Michael Brown
bf9bd93856 First (working) draft of command interface. 2007-09-16 01:44:57 +01:00
Michael Brown
baa885ee8e Kill off more dead code. 2007-09-15 23:36:41 +01:00
Michael Brown
37fc40bc8c post_recv() now works, and we can pass data on the IPoIB queue pair
using entirely our own code.
2007-09-15 23:33:25 +01:00
Michael Brown
838b972cd3 Kill off some dead code 2007-09-15 21:26:14 +01:00
Michael Brown
31b82ea1dd Hack up IB structures at start-of-day, instead of on each use. 2007-09-15 21:23:34 +01:00
Michael Brown
8deef093d9 Direct polling of TX completion queue now works. 2007-09-15 20:58:29 +01:00
Michael Brown
6a791649f0 Updated MLX_* accessor macros to use implicit type information. 2007-09-15 18:44:09 +01:00
Michael Brown
a3a91fedc1 Started added poll_cq() verb.
Started reworking MLX_EXTRACT(), MLX_POPULATE() etc. to automatically
determine type information.
2007-09-15 15:40:35 +01:00
Michael Brown
37a036bd48 Map the whole of physical memory 2007-09-15 03:22:04 +01:00
Michael Brown
970951666f arbel_post_send() has been observed to transmit a packet! 2007-09-15 02:53:05 +01:00
Michael Brown
8b27da9de1 Gets a response out of the hardware. (An error completion, to be precise.) 2007-09-15 01:35:07 +01:00
Michael Brown
21d4ab3ce2 Prefix arbel-specific functions etc. with arbel_ 2007-09-15 00:27:09 +01:00
Michael Brown
38a73b55c4 Now at least compiles 2007-09-15 00:19:38 +01:00
Michael Brown
9d08b7c692 Starting to introduce an Infiniband device abstraction 2007-09-14 20:29:44 +01:00
Michael Brown
75fbc96f75 Remove some dead code 2007-09-14 11:23:06 +01:00
Michael Brown
08e8dfd801 Now handling TX completions in our poll loop. 2007-09-14 11:10:25 +01:00
Michael Brown
e69863b5fb Proof-of-concept to manually parse completion event 2007-09-14 10:18:09 +01:00
Michael Brown
e9df4f691e Add EX_FLD_BE() 2007-09-14 10:17:29 +01:00
Michael Brown
da23e8d287 Start constructing a generic poll() routine. 2007-09-13 17:47:14 +01:00
Michael Brown
30a19c3f1c Can now both send and receive packets. LL header format not yet
fixed; still using a quick hack-up just to be able to pass through
data.
2007-09-13 14:43:12 +01:00
Michael Brown
03c90e183f Dump received packet, including GRH. 2007-09-13 03:15:27 +01:00
Michael Brown
9e32e8e513 Now sends IP packets correctly. 2007-09-13 01:14:56 +01:00
Michael Brown
7b6d11e713 Started IB driver rewrite 2007-09-12 22:17:43 +01:00
Michael Brown
5f6439c828 Merge branch 'master' into 3leaf-rewrite 2007-09-11 15:42:17 +01:00
Marty Connor
eaca053174 Add sis900 variant (patch from Vampyre) 2007-08-30 08:36:00 -04:00
Michael Brown
74a49af4ab Force MAC address for testing purposes 2007-08-29 20:07:41 +01:00
Michael Brown
b42c5905cb Very quick and very dirty hack to get the Mellanox code building
inside gPXE.
2007-08-18 18:04:18 +01:00
Michael Brown
9d2c54735e Started fixing up compilation warnings. 2007-08-17 20:34:48 +01:00
Michael Brown
d9bba621c8 Imported latest versions from Etherboot 5.4 2007-08-17 19:35:40 +01:00
Holger Lubitz
857c5db4dd fix gcc 4.2.1 warning: discards qualifiers from pointer target type 2007-08-02 01:56:57 +01:00
Michael Brown
43013da9bf Quick hack to get AoE back in to the tree, on a par with the current
iSCSI hack.
2007-07-29 02:31:14 +01:00
Michael Brown
e3484e26eb Merge branch 'symcheck2' 2007-07-28 22:55:31 +01:00
Michael Brown
ca41159f57 Ensure clock line is in the idle state before asserting chip select. 2007-07-28 16:05:41 +01:00
Holger Lubitz
63e489c14d make struct velocity_info vptx static 2007-07-27 22:07:01 +02:00
Holger Lubitz
5c486ee75d make struct velocity_info_tbl *info static 2007-07-27 22:05:47 +02:00
Holger Lubitz
5a0c703403 make struct nsx static 2007-07-27 22:03:04 +02:00
Holger Lubitz
4cd21524ef make struct bnx2 bnx2 static 2007-07-27 22:02:11 +02:00
Holger Lubitz
909ad9e80a make cards_found static and add missing initialization 2007-07-27 21:50:12 +02:00
Holger Lubitz
59ad3dac40 Merge branch 'master' into symcheck2 2007-07-27 21:40:38 +02:00
Holger Lubitz
77ffd636fa make RTL8169_READ_GMII_REG, RTL8169_WRITE_GMII_REG static 2007-07-27 21:39:31 +02:00
Michael Brown
84c347c7de Inhibit a spurious warning on GCC 4.0.1 2007-07-26 00:46:27 +01:00
Michael Brown
3f338b7b80 Include errno.h in the few drivers which use it, rather than in nic.h 2007-07-24 14:05:32 +01:00
Marty Connor
02a7514128 Change #warning to FIXME for ns8390.c
This driver really needs to be rewritten.
It tries to build both ISA and PCI images,
and makes life diffifult for the build system
and rom-o-matic.net.  The warning was just a reminder
that it needs to be cleaned up and re-factored
to split the PCI and ISA drivers.
2007-07-22 21:00:55 -04:00
Marty Connor
4e177aee17 Change #warning to FIXME for depca
This ancient ISA driver should probably be removed.
It is hard to get a card to test it with, and there
are comments to the effect that it cannot work with
relocation.  I would be quite interested to get a
bug report by someone who actually has this card.
2007-07-22 20:56:26 -04:00
Udayan Kumar
37517f7752 removed type casting from DBG statements. 2007-07-14 21:08:07 -04:00
Udayan Kumar
fc47f2a4ce replaces printf with dbg 2007-07-14 21:08:07 -04:00
Udayan Kumar
04962a0b31 added natsemi.h 2007-07-14 21:08:06 -04:00
Udayan Kumar
ecfa8f41e8 mdc's+nvs 2007-07-14 21:08:06 -04:00
Udayan Kumar
008bfb6e85 more debugging 2007-07-14 21:08:06 -04:00
Udayan Kumar
f58c8511a0 more debugging 2007-07-14 21:08:06 -04:00
Udayan Kumar
d6ceb8bbd7 added silicon revision number 2007-07-14 21:08:06 -04:00
Udayan Kumar
334abbde83 init_fix_up 2007-07-14 21:08:06 -04:00
Udayan Kumar
751cb2e450 added cable magic for 100Mps in natsemi 2007-07-14 21:08:06 -04:00
Udayan Kumar
11d246f3b5 duplex setting added to natsemi.c 2007-07-14 21:08:06 -04:00
Udayan Kumar
621f6fb503 more indentation and styling done 2007-07-14 21:08:06 -04:00
Udayan Kumar
bfa322bb19 :x 2007-07-14 21:08:06 -04:00
Udayan Kumar
f213f6a1a3 no changes 2007-07-14 21:08:06 -04:00
Udayan Kumar
a8c2a4fa11 added nat_irq to natsemi.c 2007-07-14 21:08:06 -04:00
Udayan Kumar
132d0fb70c stopped memory leak in natsemi::nat_open() 2007-07-14 21:08:06 -04:00
Udayan Kumar
83dd194330 Natsemi commented and almost done 2007-07-14 21:08:05 -04:00
Udayan Kumar
4f2fab2e14 natsemi.c is workin 2007-07-14 21:08:05 -04:00
Udayan Kumar
a86b12728a irq still not working will have to remove it 2007-07-14 21:08:05 -04:00
Udayan Kumar
2383a070d8 natsemi 2007-07-14 21:08:05 -04:00
Udayan Kumar
5e91a38269 interrupt in natsemi 2007-07-14 21:08:05 -04:00
Udayan Kumar
0d4ecfa63c enabled interrupt in natsemi.c 2007-07-14 21:08:05 -04:00
Udayan Kumar
9ad59b60c5 added change log to natsemi.c 2007-07-14 21:08:05 -04:00
Udayan Kumar
6d4dafdc6e added netdev_tx_complete to natsemi.c 2007-07-14 21:08:05 -04:00
Udayan Kumar
c6d0ef3478 added endianness to natsemi. 2007-07-14 21:08:05 -04:00
Udayan Kumar
0c324caecf free_netdev -> netdev_put 2007-07-14 21:08:05 -04:00
Udayan Kumar
623d10c66f debugging natsemi.c 2007-07-14 21:08:05 -04:00
Udayan Kumar
4a73631106 added eeprom from rtl8139 but not working 2007-07-14 21:08:05 -04:00
Udayan Kumar
9e962c3a01 natsemi now needs eeprom access 2007-07-14 21:08:05 -04:00
Udayan Kumar
99c680f743 same as before, but now compiling natsemi 2007-07-14 21:08:05 -04:00
Udayan Kumar
c8f6207e7e added polling and transmit. eeprom access still remaining 2007-07-14 21:08:05 -04:00
Udayan Kumar
97efdbe9d7 skel of new natsemi driver (still in developments) 2007-07-14 21:08:05 -04:00
Udayan Kumar
4cea792470 testing if it works 2007-07-14 21:08:05 -04:00
Michael Brown
208ff0d42e Revert mdc's warnings purge on natsemi.c, to allow for a clean rebase. 2007-07-14 21:08:05 -04:00
Michael Brown
e330db3c74 Dead code removal.
Kill off use of etherboot.h outside drivers/net.
2007-07-14 15:42:26 +01:00
Michael Brown
55d03ccbe3 Added missing "static" 2007-07-09 03:54:29 +01:00
Michael Brown
b94420a52b Ready to start testing 2007-07-08 22:01:49 +01:00
Michael Brown
4c418d2100 Use net_device_operations structure and netdev_nullify() to allow for
safe dropping of the netdev ref by the driver while other refs still
exist.

Add netdev_irq() method.  Net device open()/close() methods should no
longer enable or disable IRQs.

Remove rx_quota; it wasn't used anywhere and added too much complexity
to implementing correct interrupt-masking behaviour in pxe_undi.c.
2007-07-07 16:43:39 +01:00
Michael Brown
2823688a92 Revert "Replace natsemi driver with Indolent's updated one that uses the gPXE API"
This reverts commit 3487640397.
2007-07-07 16:40:58 +01:00
Michael Brown
627feee265 Merge branch 'zalloc' 2007-07-07 04:01:52 +01:00
Michael Brown
436adb2890 Revert "convert to zalloc"
This reverts commit 68add6e814.
2007-07-07 03:59:37 +01:00
Holger Lubitz
85e04b5837 Revert "convert to zalloc"
This reverts commit a4bea78974.
2007-07-07 01:56:37 +02:00
Holger Lubitz
e3c72a3438 Revert "convert to zalloc"
This reverts commit 3414fd8df8.
2007-07-07 01:56:27 +02:00
Holger Lubitz
ac323c5e4d Revert "convert to zalloc"
This reverts commit 636bd2cd0a.
2007-07-07 01:56:15 +02:00
Holger Lubitz
50fe2159d5 Revert "convert to zalloc"
This reverts commit 7297f04481.
2007-07-07 01:55:45 +02:00
Holger Lubitz
a772dc4a2a Revert "convert to zalloc"
This reverts commit 5ce16b03a1.
2007-07-07 01:55:23 +02:00
Holger Lubitz
68add6e814 convert to zalloc 2007-07-06 20:42:05 +02:00
Holger Lubitz
5ce16b03a1 convert to zalloc 2007-07-06 20:42:05 +02:00
Holger Lubitz
7297f04481 convert to zalloc 2007-07-06 20:42:05 +02:00
Holger Lubitz
636bd2cd0a convert to zalloc 2007-07-06 20:42:05 +02:00
Holger Lubitz
3414fd8df8 convert to zalloc 2007-07-06 20:42:05 +02:00
Holger Lubitz
a4bea78974 convert to zalloc 2007-07-06 20:42:05 +02:00
Michael Brown
ed7eae6005 Use netdev_rx_err() to report receive errors. 2007-07-05 17:23:03 +01:00
Marty Connor
3487640397 Replace natsemi driver with Indolent's updated one that uses the gPXE API
This version uses the gPXE driver API rather than the legacy wrapper API.
2007-07-05 08:54:12 -04:00
Marty Connor
1069a74d20 Warnings purge for via-velocity.[ch] 2007-07-04 21:58:28 -04:00
Marty Connor
8d39559192 Update warnings in depca.c ns8390.c 2007-07-04 20:14:10 -04:00
Marty Connor
13016297ed Purge warnings from tg3.c 2007-07-04 19:49:46 -04:00
Marty Connor
e5950283ec Purge warnings from prism2 drivers 2007-07-04 19:47:01 -04:00
Marty Connor
1af1668c95 Warnings purge of drivers (continued) 2007-07-04 05:52:56 -04:00
Michael Brown
b5311c2c88 This comment is no longer relevant. 2007-07-03 20:39:47 +01:00
Michael Brown
0924cf678e Implemented (untested) PXENV_START_UNDI. 2007-07-03 18:17:14 +01:00
Michael Brown
ca4bd3e24e Kill off now-redundant _irq() methods. 2007-07-03 15:37:56 +01:00
Michael Brown
e436b993a9 Avoid double free on I/O buffer when rtl_transmit() returns failure.
Convert printf() to DBG(); printf() is not allowed in drivers.
2007-07-03 14:44:33 +01:00
Michael Brown
71f500ff1b Enable/disable interrupts in driver open/close. 2007-07-03 12:50:58 +01:00
Michael Brown
290280f90e Enable/disable interrupts at open/close time. 2007-07-03 03:34:08 +01:00
Michael Brown
a2a0c2eace Enable/disable interrupts on open/close. 2007-07-03 00:57:04 +01:00
Michael Brown
5f17089b14 pxe_netdev now holds a reference to the network device.
Use generic fields in struct device_description rather than assuming
that the struct device * is contained within a pci_device or
isapnp_device; this assumption is broken when using the undionly
driver.

Add PXENV_UNDI_SET_STATION_ADDRESS.
2007-07-02 17:43:32 +01:00
Michael Brown
95cb7aaacf Support cards such as natsemi which treat the data as little-endian
(i.e. LSB transmitted first on the wire), even though SPI commands and
addresses always have to be big-endian.
2007-07-01 15:22:12 +01:00
Michael Brown
31fe5b9415 Hack together far enough to support ne2k-pci. 2007-07-01 00:37:29 +01:00
Michael Brown
f33bbd4112 How has the legacy wrapper been working for the past month or so...? 2007-07-01 00:36:48 +01:00
Michael Brown
f77815f2b1 Kill off hotplug.h and just make net devices normal reference-counted
structures.

DHCP still broken and #if 0'd out.
2007-06-27 14:48:31 +01:00
Michael Brown
0316eaf85d Add missing call to free_iob(). 2007-06-10 18:33:42 +01:00
Marty Connor
f97e642d17 Update email addresses in drivers 2007-06-09 15:23:17 -04:00
Marty Connor
8c25ea0970 Updated email mdc's email address 2007-06-08 11:23:26 -04:00
Michael Brown
3e2c6b6736 pkbuff->iobuf changeover
Achieved via Perl using:

perl -pi -e 's/pk_buff/io_buffer/g; s/Packet buffer/I\/O buffer/ig; ' \
	-e 's/pkbuff\.h/iobuf.h/g; s/pkb_/iob_/g; s/_pkb/_iob/g; ' \
	-e 's/pkb/iobuf/g; s/PKB/IOB/g;'
2007-05-19 18:39:40 +00:00
James Harper
80cc27cbc4 Ported bnx2 driver from Etherboot 5.4. 2007-03-13 23:03:50 +00:00
Michael Brown
13137a4d61 t5x9 code relies on nic->ioaddr being set 2007-03-11 00:37:46 +00:00
Michael Brown
62548c9f0d Updated 3c509 to current device model 2007-03-10 22:28:22 +00:00
Michael Brown
520d9c36af Updated ISAPnP, EISA, MCA and ISA buses to current device model.
ISA 3c509 is currently non-functional, although the EISA (3c509-eisa) and
MCA (3c529) variants should build OK.

None of this code is yet tested.
2007-03-10 18:08:33 +00:00
Michael Brown
c63af1ea14 Remove no-longer-used variable 2007-02-19 17:31:20 +00:00
James Harper
e1735d5fc2 Fix some bad pointer arithmatic in the tg3 driver that was causing the dynamic memory pool to be corrupted (or worse) 2007-02-10 00:28:41 +00:00
James Harper
1c971f1234 Fix padding problem - from Michael 2007-02-10 00:27:46 +00:00
Michael Brown
2cf1e33df1 Split bootsector execution code out into bootsector.c.
Added basic El Torito ISO image boot capability
2007-01-29 04:21:38 +00:00
Michael Brown
73b09ecba6 Use stdio.h instead of vsprintf.h 2007-01-19 01:13:12 +00:00
Michael Brown
5ff23aa406 Include stdlib.h rather than malloc.h 2007-01-18 20:06:03 +00:00
Michael Brown
48fe701716 Respect the RX quota. This improves poll time by about 0.7us when the
quota is 1.
2007-01-18 12:34:12 +00:00
Michael Brown
ff8528ea9a Create and use async_block() macro; it cuts down on the visual overhead
of blocking on asynchronous operations, when that isn't an important
aspect of the code.
2007-01-16 08:10:54 +00:00
Michael Brown
4e20d73bb5 Gave asynchronous operations approximate POSIX signal semantics. This
will enable us to cascade async operations, which is necessary in order to
properly support DNS.  (For example, an HTTP request may have to redirect
to a new location and will have to perform a new DNS lookup, so we can't
just rely on doing the name lookup at the time of parsing the initial
URL).

Anything other than HTTP is probably broken right now; I'll fix the others
up asap.
2007-01-15 08:49:10 +00:00
Michael Brown
03390f0cd6 Use pkb_pad() rather than doing it the dangerous way :) 2007-01-11 05:26:16 +00:00
Michael Brown
a3ed0cbbc7 Extract packet-padding login from rtl8139.c to a separate pkbpad.c file. 2007-01-11 05:25:50 +00:00
Michael Brown
fdc97499bf Add device description fields to struct device. 2007-01-10 15:27:48 +00:00
Michael Brown
dad5274522 Add "name" field to struct device to allow human-readable hardware device
names.

Add "dev" pointer in struct net_device to tie network interfaces back to a
hardware device.

Force natural alignment of data types in __table() macros.  This seems to
prevent gcc from taking the unilateral decision to occasionally increase
their alignment (which screws up the table packing).
2007-01-10 04:22:09 +00:00
Michael Brown
c65fae2475 Add RX quotas to the net device poll() method. This avoids the problem
of alloc_pkb() exhaustion when e.g. an iSCSI-booted DOS session is left
idle for a long time at the C:\ prompt and builds up a huge packet
backlog.
2007-01-09 21:47:01 +00:00
Michael Brown
e822bc2a90 Autopadding was sometimes overwriting the struct list_head at the end
of the packet buffer.  Although pkbuffs are guaranteed to be at least
PKB_ZLEN bytes long, there's no guarantee that the data starts at the
start of the packet buffer.

Since we have to align data for rtl8139 anyway, and since the start of
the packet buffer is guaranteed to be aligned to PKB_ALIGN, we may as
well just shuffle the packet down so that it starts at the start of
the packet buffer.  This simultaneously aligns the packet and ensures
that there is enough room for the zero-padding.
2007-01-09 21:01:55 +00:00
Michael Brown
b7fcfe8ece Added net device TX queue; this will be needed to support the PXE UNDI API
(which will need us to wait for TX completions).

Added debug autocolourisation to netdevice.c
2007-01-09 20:18:31 +00:00
Michael Brown
5af4918356 Added support for wildcard device/vendor ID matches 2007-01-08 03:23:38 +00:00
Michael Brown
7b9617f5df Add device to hierarchy before calling the driver's probe() function; this
way everything remains consistent if the probe() ends up creating child
devices.
2007-01-08 01:29:51 +00:00
Michael Brown
0c03bb5a9a Make open() and close() an official part of the netdevice API.
Call netdevice's poll() and transmit() methods only when device is open.
2007-01-04 04:20:08 +00:00
Michael Brown
61ed298bc7 Merge changes from mcb-tcp-fixes branch. 2006-12-27 23:09:46 +00:00
Michael Brown
ab242a760d Add ability to shut down iSCSI connection 2006-12-21 17:17:47 +00:00
Michael Brown
7ce3df65c2 Default to port 0 (sic). 2006-12-21 17:16:06 +00:00
Michael Brown
6ceaa158da Return -EIO when verification fails, instead of -EINVAL. 2006-12-20 14:11:50 +00:00
Michael Brown
9f953322a1 Remove warning (at least on platforms with uint32_t == unsigned long). 2006-12-20 00:34:53 +00:00
Michael Brown
a646e38f03 Use stdlib.h for malloc() instead of malloc.h. 2006-12-19 23:42:46 +00:00
Michael Brown
a497e16767 The "increment MAC address by port number" hack applies only to EF1. 2006-12-18 15:28:34 +00:00
Michael Brown
a39b111684 Automatically select between the "10" and "16" variants of command set,
based on the device size.
2006-12-12 18:54:35 +00:00
Michael Brown
3bd7e479a2 Catch SCSI errors, and work around the start-of-day CHECK CONDITION
that some targets send.
2006-12-12 18:18:54 +00:00
Michael Brown
29db66fb51 Add support for non-volatile stored options in the RTL8139 EEPROM. 2006-12-06 20:45:44 +00:00
Michael Brown
d2bf7abe75 Added write support for three-wire devices (e.g. the RTL8139 EEPROM) 2006-12-06 19:51:58 +00:00
Michael Brown
ac401f481d Verify data after writing 2006-12-06 18:51:31 +00:00
Michael Brown
a128b33b8b The VPD engine is broken and can't actually handle placing VPD
anywhere other than offset 0 within the EEPROM, so we have to put our
settings at 0x100 instead.
2006-12-05 17:56:13 +00:00
Michael Brown
4c3e0fede5 Adjust EEPROM/flash detection to fit expected manufacturing practice. 2006-12-05 16:00:06 +00:00
Michael Brown
cb883b3faf Change some debugging messages to use DBG() 2006-12-05 10:01:00 +00:00
Michael Brown
6b45947a59 Added debug statements 2006-12-04 23:20:56 +00:00
Michael Brown
052ef6dc5a Added nvs_write(). This shares a lot of code in common with nvs_read();
this can probably be optimised down quite a lot.
2006-12-04 22:06:54 +00:00
Michael Brown
cc9bcb99a0 Add the concept of a fragment list for non-volatile stored options. 2006-12-04 21:46:13 +00:00
Michael Brown
f944737045 Fixed two logic errors that were cancelling each other out. 2006-12-04 21:12:52 +00:00
Michael Brown
d62c83a350 Migrated etherfabric driver to using generic SPI layer. 2006-12-04 20:47:51 +00:00
Michael Brown
2d8d21fe74 Added the generic block-splitting code to nvs.c 2006-12-04 19:06:07 +00:00
Michael Brown
1961ba44e1 Added generic SPI protocol handler with read and write support. 2006-12-04 18:32:55 +00:00
Michael Brown
946967f09c Abstracted out part of the concept of an SPI device to a generalised NVS
device.

Separated the mechanisms of non-volatile storage access and non-volatile
stored options.
2006-12-04 18:23:06 +00:00
Michael Brown
dc06c895fc Changed length parameter in SPI methods to be a byte length, rather than
a word length.
2006-12-04 16:09:59 +00:00
Michael Brown
931f94dca3 Generalised the SPI abstraction layer to also be able to handle interfaces
that don't provide the full flexibility of a bit-bashing interface.

Temporarily hacked rtl8139.c to use the new interface.
2006-12-04 15:36:51 +00:00
Michael Brown
4cd56820ea Basic non-volatile storage support 2006-11-29 02:41:08 +00:00
Michael Brown
3234ef1b0b Merged changes from Solarflare 2006-11-28 13:25:23 +00:00
Michael Brown
3f0b4d9ed8 Updated to use asynchronous operation model for iSCSI requests
Added CHAP authentication
2006-11-28 00:29:02 +00:00
Michael Brown
88e38fa148 We don't actually have a stdio.h header file. Our printf() functions are
defined in vsprintf.h.  (This may change, since vsprintf.h is a
non-standard name, but for now it's the one to use.)

There should be no need to include vsprintf.h just for DBG() statements,
since include/compiler.h forces it in for a debug build anyway.
2006-09-27 10:58:14 +00:00
Marty Connor
6ac78f6aff added stdio.h to includes for DBG compilation 2006-09-27 05:57:06 +00:00
Marty Connor
757618edea eth_ntoa and warnings cleanup 2006-09-27 03:05:21 +00:00
Marty Connor
cd8168b071 eth_ntoa cleanup. still has warnings. needs work. 2006-09-27 03:00:21 +00:00
Marty Connor
727a88709e eth_ntoa and warnings cleanup 2006-09-27 02:18:07 +00:00
Marty Connor
0d1087a5de eth_ntoa and warnings cleanup 2006-09-27 02:07:59 +00:00
Marty Connor
859cc71158 compilation warnings cleanup 2006-09-26 22:18:00 +00:00
Marty Connor
a02dccdafa eth_ntoa cleanup 2006-09-26 22:11:45 +00:00
Marty Connor
b88aa51b07 warnings cleanup (still gives lots of compilation warnings from unused functions and missing legacy support) 2006-09-26 22:09:03 +00:00
Marty Connor
9588e20828 warnings cleanup 2006-09-26 22:04:33 +00:00
Marty Connor
e753444e04 compilation warnings cleanup 2006-09-26 21:58:08 +00:00
Marty Connor
cf84605271 eth_ntoa and compilation warnings fixes 2006-09-26 21:33:12 +00:00
Marty Connor
097c1b341d eth_ntoa fixes 2006-09-26 21:06:29 +00:00
Michael Brown
7952bb76ec Minor fix 2006-09-25 14:41:54 +00:00
Marty Connor
cce8755fb8 eth_ntoa and warnings fixups, memcpy compilation fix 2006-09-25 09:06:50 +00:00
Marty Connor
d86c080024 eth_ntoa and warnings fixups 2006-09-25 03:52:01 +00:00
Marty Connor
eefac0e258 eth_ntoa and warnings fixups 2006-09-25 03:21:25 +00:00
Marty Connor
d4b060be3b eth_ntoa and warnings fixups 2006-09-25 02:55:13 +00:00
Marty Connor
f4d0f2e5b5 eth_ntoa and warnings fixups 2006-09-25 02:47:50 +00:00
Marty Connor
9e71390930 eth_ntoa and warnings fixups 2006-09-25 02:41:46 +00:00
Marty Connor
447ed77525 eth_ntoa and warnings fixups 2006-09-25 02:18:11 +00:00
Marty Connor
3ffeffebb2 eth_ntoa and warnings fixups 2006-09-25 02:11:52 +00:00
Marty Connor
c0e91255d0 eth_ntoa fixups 2006-09-20 00:20:37 +00:00
Marty Connor
fe62800bad eth_ntoa fixups 2006-09-20 00:06:52 +00:00
Marty Connor
637411c2ab eth_ntoa fixups 2006-09-20 00:00:44 +00:00
Marty Connor
3df3ac72e1 eth_ntoa fixups 2006-09-19 16:33:46 +00:00
Marty Connor
896f871fba eth_ntoa fixups 2006-09-19 15:58:37 +00:00
Marty Connor
077bbc220a eth_ntoa fixup 2006-09-19 15:49:57 +00:00
Marty Connor
338a6de549 eth_ntoa fixup, some warnings fixups (isa/pnp fixups still needed) 2006-09-19 15:23:28 +00:00
Marty Connor
5a39995f8b eth_ntoa fixup, _disable arg fixup 2006-09-19 15:17:51 +00:00
Marty Connor
a9cb4ca079 DBG MAC addr printout in driver 2006-09-15 12:54:11 +00:00
Marty Connor
a998286c8b change MAC address printout to DBG using eth_ntoa (temporary legacy support) 2006-09-15 12:42:43 +00:00
Marty Connor
b41f754e3a Fix compile warnings, remove unused var 2006-09-14 17:58:23 +00:00
Marty Connor
08d7ea1d34 Fixed DBG macro format, fixed compile warnings. removed extra parameter from mtd80x_disable(...) 2006-09-14 17:15:53 +00:00
Marty Connor
35f90278a8 Remove nic_disable call from drivers. Call should be made at a higher level 2006-09-14 14:51:38 +00:00
Marty Connor
1ed6e69ea5 Remove printf of MAC address in driver. 2006-09-14 14:06:33 +00:00
Michael Brown
21bc2015f2 Fix gcc-induced reference to memcpy 2006-09-01 10:48:35 +00:00
Michael Brown
bb3df618b8 Remove old-style debug message 2006-08-16 00:02:43 +00:00
Michael Brown
97439cb6eb Kill off poll_interruptions(); it is lethal when we're acting as a PXE
stack or INT 13 emulator etc.
2006-08-14 22:29:51 +00:00
Michael Brown
d393e61d8a Temporary hack to work around the "TX overflow" problem in the interim
period before updating to the new driver API (which can cope with
having TX packets in progress).
2006-06-16 14:38:16 +00:00
Michael Brown
52de4935f9 Add 4 bytes to maximum frame length to allow for the frame checksum.
(This actually matters once you try using TCP, because you *will*
receive full-sized frames.)
2006-06-16 14:30:41 +00:00
Michael Brown
7c76791730 Improve debugging output for legacy wrapper 2006-06-16 14:27:04 +00:00
Michael Brown
e5865e796b Forward-port event queue fixes from 5.4 tree. 2006-06-16 14:05:43 +00:00
Michael Brown
a20c565ef3 Forward-port start-of-day fixes from 5.4 tree 2006-06-16 14:03:43 +00:00
Michael Brown
50ab8c0e5b Forward-port reset-related changes from 5.4 tree. 2006-06-16 14:00:43 +00:00
Michael Brown
3b51c719d3 Generalise three-wire interface to generic SPI interface.
Update rtl8139 driver to instantiate an SPI interface with a three-wire
device attached.
2006-06-14 00:22:50 +00:00
Michael Brown
ab4f96e525 Move per-transition delays from generic bit-bashing layer to i2c layer
(since SPI bit-bashing will require different delay semantics).
2006-06-14 00:20:35 +00:00
Michael Brown
714641ae6d Translate between "0 = success" and "0 = failure" call standards. 2006-06-14 00:18:13 +00:00
Michael Brown
51a36f1cfb Change read_bit() to return 0 or -1UL, rather than 0 or 1. 2006-06-12 19:29:50 +00:00
Michael Brown
2e49441535 Updated debug message to reflect change in data structure. 2006-06-12 01:10:08 +00:00
Michael Brown
7ce44f7480 Update to use the generic i2c bit-bashing code. 2006-06-11 00:57:38 +00:00
Michael Brown
3ed40686c9 Added bit-bashing i2c interface code 2006-06-11 00:57:00 +00:00
Michael Brown
e90b64d625 Added sketch of bit-bashing interface common code 2006-06-08 19:47:09 +00:00
Michael Brown
1697c78848 Legacy drivers cannot cope with multiple active devices. 2006-06-08 15:18:27 +00:00
Michael Brown
02df45352c Force pci.o to be included.
Print warning message at probe time.
2006-06-05 16:17:52 +00:00
Michael Brown
754cfdfcf4 Legacy drivers will not pad when necessary 2006-06-05 16:10:36 +00:00
Michael Brown
7826de3f7e PNIC doesn't auto-pad. 2006-06-05 16:10:14 +00:00
Michael Brown
286bf68faf Added a very quick and dirty compatibility layer, to allow
not-yet-updated drivers to at least function.
2006-06-05 15:45:21 +00:00
Michael Brown
c3e41e6fd1 Added soon-to-be-requisite missing include. 2006-06-05 15:41:22 +00:00
Michael Brown
1f394c2f7c Backing out last change; no immediate plans to make the whole block-device
layer asynchronous, so keeping the sync/async boundary within aoedev.c
seems cleanest for now.
2006-06-01 11:14:59 +00:00
Michael Brown
99ef98d0bf ATA devices are now asynchronous. The ATA layer itself now performs the
async_wait(), though we may wish to move this higher up the stack, and
consider making the block device model asynchronous.  (There is only a
marginal cost for synchronous devices, since they can simply call
async_done() before returning; async_wait() will work seamlessly in this
situation).
2006-05-31 18:57:11 +00:00
Michael Brown
68125bc441 Added generic asynchronous operations code.
Removed data_in_len and data_out_len from ata_command structure; the
lengths are implied by the sector count and the presence of the data_in
or data_out pointers.

Changed AoE code to use subcommands by default, and made aoe_issue()
nonblocking (with completion via async_wait()).
2006-05-31 14:34:17 +00:00
Michael Brown
6541338897 Handle multi-sector reads by splitting them into subcommands. 2006-05-29 08:25:31 +00:00
Michael Brown
9a2a52693d Initial AoE implementation. Limitations are:
Cannot yet handle reads of more than two sectors

  No retransmission

  No way to find out a target's MAC address (this proof of concept uses
  broadcasts)

These limitations shall not last long!  :)
2006-05-28 23:29:43 +00:00
Michael Brown
6f998cecb3 Use separate data-in and data-out buffers.
Increase code simplicity at the expense of around 64 bytes.
2006-05-28 23:26:42 +00:00
Michael Brown
70ef6dbb7c Rewrote to use the new net driver API, the updated PCI API, and the
generic three-wire serial device support for EEPROM access.
2006-05-27 13:45:14 +00:00