david/ipxe
Archived
1
0
Commit Graph

921 Commits

Author SHA1 Message Date
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
Michael Brown
aa2468babe Added abstraction layer for a three-wire serial device (e.g. the EEPROM
used on RTL8139 cards).
2006-05-26 15:39:24 +00:00
Michael Brown
95956443e1 Fixed debug code 2006-05-21 16:04:41 +00:00
Michael Brown
80958ff69c Added (untested) support for ATA devices. This code should be generic
enough to support both real IDE chipsets and AoE.
2006-05-21 16:01:23 +00:00
Michael Brown
4d0a0f822d Use insb/outsb; it's marginally faster. 2006-05-20 12:28:44 +00:00
Michael Brown
402ba15c64 READ CAPACITY (16) turns out to be an optional command (even though
READ(16) is mandatory); we must use READ CAPACITY (10) first and then
use READ CAPACITY (16) if the READ CAPACITY (10) returns "out of range".
2006-05-19 18:54:38 +00:00
Michael Brown
d48d0fb1bb Add the concept of a "user pointer" (similar to the void __user * in
the kernel), which encapsulates the information needed to refer to an
external buffer.  Under normal operation, this can just be a void *
equivalent, but under -DKEEP_IT_REAL it would be a segoff_t equivalent.

Use this concept to avoid the need for bounce buffers in int13.c,
which reduces memory usage and opens up the possibility of using
multi-sector reads.

Extend the block-device API and the SCSI block device implementation
to support multi-sector reads.

Update iscsi.c to use user buffers.

Move the obsolete portions of realmode.h to old_realmode.h.

MS-DOS now boots an order of magnitude faster over iSCSI (~10 seconds
from power-up to C:> prompt in bochs).
2006-05-19 15:06:51 +00:00
Michael Brown
6b6096d28b Strip down i386 PCI configuration space I/O to the bare minimum. A
typical build will now include 880 bytes of PCI support code, compared to
2327 bytes in Etherboot 5.4.

(There is a slight cost of around 5 extra bytes per access to a
non-constant config space address; this should be an overall win.
Driver-specific accesses will usually be to constant addresses, for
which there is no additional cost.)
2006-05-17 01:12:11 +00:00
Michael Brown
15ee09ed10 Restructured PCI subsystem to fit the new device model.
Generic PCI code now handles 64-bit BARs correctly when setting
"membase"; drivers should need to call pci_bar_start() only if they want
to use BARs other than the first memory or I/O BAR.

Split rarely-used PCI functions out into pciextra.c.

Core PCI code is now 662 bytes (down from 1308 bytes in Etherboot 5.4).
284 bytes of this saving comes from the pci/pciextra split.

Cosmetic changes to lots of drivers (e.g. vendor_id->vendor in order to
match the names used in Linux).
2006-05-16 15:12:06 +00:00
Michael Brown
f25731d08f Split "iSCSI as a SCSI device" out from "iSCSI as a TCP protocol". 2006-05-14 23:29:16 +00:00
Michael Brown
f33f01c126 Defined SCSI device interface, and added SCSI block device
implementation.
2006-05-13 11:37:50 +00:00
Michael Brown
79f64eea55 Transmit the buffer contents, not the buffer descriptor... 2006-04-28 14:08:41 +00:00
Michael Brown
fcf765e42d Add missing {register,free}_netdev().
Tie into existing driver API; we'll fix that up soon.
2006-04-24 18:44:50 +00:00
Michael Brown
832e86246b gcc is rather over-aggressive about optimising out static data structures
even when __atribute__ (( unused )) is correctly set...
2006-04-24 18:31:37 +00:00
Michael Brown
824d6ffa7f Header rearrangement.
I want to get to the point where any header in include/ reflects a
standard user-level header (e.g. a POSIX header), while everything that's
specific to gPXE lives in include/gpxe/.  Headers that reflect a Linux
header (e.g. if_ether.h) should also be in include/gpxe/, with the same
name as the Linux header and, preferably, the same names used for the
definitions.
2006-04-24 15:42:49 +00:00
Michael Brown
fdc2ee79db Network API now allows for multiple network devices (although the
implementation allows for only one, and does so without compromising on
the efficiency of static allocation).

Link-layer protocols are cleanly separated from the device drivers.

Network-layer protocols are cleanly separated from individual network
devices.

Link-layer and network-layer protocols are cleanly separated from each
other.
2006-04-24 15:33:06 +00:00
Michael Brown
7be870acd3 More purging 2006-03-17 14:14:36 +00:00
Michael Brown
d08ce741a4 Build in gpxe 2006-03-16 19:09:31 +00:00
Michael Brown
0806436d99 Remove accidental duplicate arising from merge 2006-03-16 19:04:19 +00:00
Michael Brown
239579efcf Build under gpxe 2006-03-16 19:02:18 +00:00
Michael Brown
d0777627c6 Back out duplication arising from the merge 2006-03-16 18:56:16 +00:00
Michael Brown
c4f25b637c Fix to compile under gpxe 2006-03-16 18:54:57 +00:00
Michael Brown
4ee0e0f85e Merge from Etherboot 5.4 2006-03-16 18:51:23 +00:00
Michael Brown
46e7bd5b52 Merge from Etherboot 5.4 2006-03-16 18:44:31 +00:00
Michael Brown
7e0a7a2e08 Merge from Etherboot 5.4 2006-03-16 18:30:54 +00:00
Michael Brown
28cefdccc4 Merge from Etherboot 5.4 2006-03-16 18:30:46 +00:00
Michael Brown
bb7394b041 Merge from Etherboot 5.4 2006-03-16 17:59:51 +00:00
George Baum
bd9d4e0bd7 Reorder functions to match the linux driver.
No code changes apart from commenting one unused function out.
2005-07-11 19:26:12 +00:00
Timothy Legge
4184dc5c6a Fix COMET TxUnderrun issue 2005-06-17 20:11:10 +00:00
Timothy Legge
95967adc8c Jan Kiszka provided a patch for the smc9000 for missing phy-setup 2005-06-02 01:26:37 +00:00
Michael Brown
0e494614b5 Some versions of doxygen seem to object to "@ret None" or similar. 2005-05-24 00:11:25 +00:00
George Baum
c4c05bbbf7 the uncontroversal gcc 4.0 compilation fixes 2005-05-23 19:30:37 +00:00
Michael Brown
a96759f9c8 Use "#var" rather than "@c var" for doxygen. 2005-05-20 10:27:02 +00:00
Michael Brown
e14c739d2d Imported from Etherboot 5.4 tree 2005-05-19 16:51:32 +00:00
Michael Brown
4e87543c74 Synced across updates from Etherboot 5.4 tree 2005-05-19 16:47:19 +00:00
Michael Brown
f88c0d42d5 Doxygenation 2005-05-19 15:35:47 +00:00
Michael Brown
e91c65bea1 Make PCI ID tables const so as not to trigger a warning about a large
symbol.
2005-05-03 12:36:06 +00:00
Michael Brown
24c0498cbc Move tulip_private structure into shared data. 2005-05-03 12:29:32 +00:00
Michael Brown
42eb786ced D'oh 2005-05-03 12:18:31 +00:00
Michael Brown
4bcd42699b Use __shared 2005-05-03 12:16:49 +00:00
Michael Brown
303ff86c75 Added example of how to use __shared.
Moved transmit before poll, since typically transmit will be implemented first.
2005-05-03 12:14:29 +00:00
Michael Brown
c112f12c5b Symbol fixups 2005-05-03 11:29:33 +00:00
Michael Brown
3c2851e563 Arbitrary alignment is now available.
Use shared symbols.
Correct other symbol violations.
2005-05-03 09:56:57 +00:00
Michael Brown
ee15c47cb5 Use shared symbols 2005-05-02 17:45:24 +00:00
Michael Brown
3267ca5568 Use shared symbols to save space 2005-05-02 16:35:44 +00:00
Michael Brown
60b82eb5cd Moved definition of __shared into compiler.h 2005-05-02 16:21:52 +00:00
Michael Brown
a1f50f27b0 Correct symbol violations reported by "make symcheck" 2005-05-02 15:22:32 +00:00
Michael Brown
282b6f1a1a isa.c uses the new table infrastructure. 2005-04-27 12:24:38 +00:00
Michael Brown
e301acc0d4 Add isapnp_max_csn to reduce scan time. 2005-04-26 14:07:30 +00:00
Michael Brown
3dbdeb588f ISA bus driver updated to report devices as present only if a driver
thinks they are.
Other bus drivers modified for consistency.
2005-04-26 12:30:14 +00:00
Michael Brown
7e534b585f Automatically updated with
perl -pi -0777 -e 's/^static struct \w+_driver (\w+) =\s*(\w+_DRIVER \()/${2} ${1},/msg' *.c
2005-04-26 12:19:39 +00:00
Michael Brown
99b857559b Added "name" field to struct bus_driver 2005-04-25 19:26:33 +00:00
Michael Brown
5bace628ae Added "name" field to bus structure. 2005-04-25 18:54:15 +00:00
Michael Brown
9dc7ebc152 Symbol errors caught by symcheck.pl 2005-04-23 14:45:37 +00:00
Michael Brown
e8f364551a Typo 2005-04-22 16:32:29 +00:00
Michael Brown
08ff0c1d30 Ensured that all drivers call xxx_fill_nic(). 2005-04-22 16:31:52 +00:00
Michael Brown
e7c177cc33 Coerced into compiling 2005-04-22 16:27:56 +00:00
Michael Brown
628444af86 Updated to new device probing API 2005-04-22 16:24:21 +00:00
Michael Brown
49fe02e501 Coerced into compiling 2005-04-22 16:09:54 +00:00
Michael Brown
ee88aacdb6 Coerced into compiling. 2005-04-22 16:07:48 +00:00
Michael Brown
fba7f011d2 Coerced into actually compiling. 2005-04-22 16:06:46 +00:00
Michael Brown
67c9385577 Fields in struct pci_device slightly changed. 2005-04-22 16:05:05 +00:00
Michael Brown
7bd88df08d Documented where to get hold of the datasheet. 2005-04-22 16:01:51 +00:00
Michael Brown
091a579be1 Updated to new API. 2005-04-22 16:00:51 +00:00
Michael Brown
db3a44b66d Debug message fixes. 2005-04-22 15:56:57 +00:00
Michael Brown
139d0fe481 Updated to new bus API, and improved using the 3c5x9 reference manual. 2005-04-22 15:55:13 +00:00
Michael Brown
441ee4f8f3 Need to leave structure zeroed 2005-04-22 15:33:35 +00:00
Michael Brown
8af80c6b10 disable() is a void 2005-04-22 12:07:22 +00:00
Michael Brown
feb652709d Must not go beyond end of driver's probe list. 2005-04-22 12:02:34 +00:00
Michael Brown
e596c42ade Updated to current API. 2005-04-22 11:57:35 +00:00
Michael Brown
329ccfdc21 Updated to new API. 2005-04-22 11:56:49 +00:00
Michael Brown
1e156f537b Consistency 2005-04-22 11:56:27 +00:00
Michael Brown
0e2dc7aa8e Updated to new device API. 2005-04-22 11:29:40 +00:00
Michael Brown
3e8c2aa78b Fix up fill_mca_nic. 2005-04-22 02:47:39 +00:00
Michael Brown
97346a75f7 Added friendly enable/disable functions 2005-04-22 02:43:24 +00:00
Michael Brown
924143661a Updated all common buses to new API. 2005-04-22 02:28:16 +00:00
Michael Brown
614c39a8a4 Automatically updated with the program
#!/usr/bin/perl -w -pi -0777

use strict;

( my $type ) = /find_(\w+?)_boot_device/ or die "Could not find type\n";

( my $disable ) = /\.disable\s*=\s*(\w+)/ or die "Could not locate disable\n";

s/(${disable}\s*\(\s*struct\s+nic\s+\*nic)(\s*\)\s*\{)(\s*)/${1}, struct ${type}_device \*${type} __unused${2}${3}nic_disable ( nic );${3}/s;

s/(${disable}\s*\(\s*struct\s+nic\s+\*nic)(\s*\)\s*;)/${1}, struct ${type}_device \*${type}${2}/g;

s/^\s*.disable\s*=\s*${disable}\s*,\s*?$//m;

s/(_probe\s*\(\s*)struct\s+dev\s+\*dev/${1}struct nic \*nic/g;

s/^\s*struct\s+nic\s+\*nic\s*=\s*nic_device\s*\(\s*dev\s*\)\s*;\s*?$//m;

s/^(\s*)(nic->(ioaddr|irqno)\s*=\s*${type})/${1}${type}_fill_nic ( nic, ${type} );\n${1}${2}/m;
2005-04-21 19:20:39 +00:00
Michael Brown
cfe3a663af Tweaked API to minimise changes to existing drivers even further. 2005-04-21 19:04:53 +00:00
Michael Brown
a713813596 Updated to current API 2005-04-21 18:31:31 +00:00
Michael Brown
98ff29345e Created a bus/device API that allows for the ROM prefix to specify an
initial device, and will also allow for e.g. a device menu to be presented
to the user.
2005-04-21 18:18:29 +00:00
Michael Brown
928c388c6f bswap_16() exists; no need to use __bswap_16() 2005-04-21 16:38:28 +00:00
Michael Brown
2c7d72e11e Moved floppy.c to i386 arch, since it's i386-specific. 2005-04-18 18:56:18 +00:00
Michael Brown
cf79681b80 Fix BUILD_SERIAL.
Change from using #if to #ifdef, since #if can't cope with string
constants.
2005-04-18 12:43:18 +00:00
Michael Brown
85b00c4b72 Move RELOCATE into config.h
Move ISA probe address logic from config.c into isa.c, create header file
config/isa.h.
2005-04-18 11:00:42 +00:00
Michael Brown
a0c5430749 CONFIG_PCI and CONFIG_ISA no longer exist 2005-04-18 10:18:38 +00:00
Michael Brown
bd2c3b0f27 Split out EISA driver into a separate file, since 3c509s can only take 16K
ROMs (AFAIK).
2005-04-17 17:52:33 +00:00
Michael Brown
03346742c0 Use only the header files that we need 2005-04-17 10:51:05 +00:00
Michael Brown
5ca20abf95 Place the call to adjust_pci_device() back in the individual drivers,
since we probably shouldn't be doing this to arbitrary devices during a
PCI bus scan...
2005-04-16 17:30:37 +00:00
Michael Brown
66e54f1274 ...this time with the correct syntax. :( 2005-04-16 14:54:11 +00:00
Michael Brown
8c2b42e08e Added activate_isapnp_device() line 2005-04-16 14:53:27 +00:00
Michael Brown
86d2127204 Remove debugging call to getchar() 2005-04-16 14:42:48 +00:00
Michael Brown
c659a54f70 Now known to work with an old Adaptec 1505 that I found lying around. 2005-04-16 14:41:04 +00:00
Michael Brown
7bd3e883d7 Consistency 2005-04-16 11:43:16 +00:00
Michael Brown
e29be5e342 Speed up PCI bus scanning by skipping fns 1-7 if fn 0 is not present. 2005-04-16 11:42:56 +00:00
Michael Brown
6e5a3858bf Read number of PCI buses returned by BIOS so that we can scan more
quickly.
2005-04-16 11:16:31 +00:00
Michael Brown
e1a9798af4 Improved debugging output 2005-04-16 10:19:13 +00:00
Michael Brown
ed7b9109be Made debug messages more consistent. 2005-04-16 10:04:56 +00:00
Michael Brown
211a607147 Improved debug messages.
Prevented find_pci_device() from being an endless loop.
2005-04-16 09:57:19 +00:00
Michael Brown
9f02376409 Make isa_probe_addr a simple integer rather than a struct, to facilitate
specification of ISA_PROBE_ADDRS.
2005-04-16 09:30:48 +00:00
Michael Brown
a60aadf9e9 Improve debug message legibility. 2005-04-15 17:09:47 +00:00
Michael Brown
8aa3b9d972 Need to do isolation when find_isapnp_device is first called,
otherwise isapnp_max_csn is zero and we never call fill_isapnp_device.

Fix debug message.
2005-04-15 17:03:39 +00:00
Michael Brown
39cb4d8dbb Fix debug message 2005-04-15 16:56:18 +00:00
Michael Brown
d26889cb04 Don't even try to compile until the code is tidied up. 2005-04-15 16:50:36 +00:00
Michael Brown
8c082aa468 This at least compiles now. Haven't separated out the EMBEDDED code yet. 2005-04-15 16:49:46 +00:00
Michael Brown
1bd7b97e5c Not sure why I made these cosmetic changes, but I appear to have done so. 2005-04-15 16:30:35 +00:00
Michael Brown
f61fa0dc64 Added "classical" ISA example. 2005-04-15 16:28:14 +00:00
Michael Brown
897eeee4ee Added EISA, ISAPnP and MCA examples. 2005-04-15 16:18:56 +00:00
Michael Brown
38ea910098 Updated to new PCI bus interface. 2005-04-15 16:08:10 +00:00
Michael Brown
a26edc2eec Updated to work with new ISAPnP bus code. 2005-04-15 15:50:27 +00:00
Michael Brown
e6e43a2f2f We now correctly use logical devices. 2005-04-15 15:37:39 +00:00
Michael Brown
d11ea1e44b Added debugging messages for activation/deactivation of logical devices. 2005-04-15 14:31:08 +00:00
Michael Brown
888277d2d1 Read current ioaddr and irqno from PnP registers. 2005-04-15 14:27:49 +00:00
Michael Brown
ab443ba4b0 Don't verify checksum except after serial isolation 2005-04-15 13:54:44 +00:00
Michael Brown
120192e8d1 Reduce binary size by factoring out common parameterised calls to
udelay().
2005-04-15 13:18:54 +00:00
Michael Brown
85dd4fd8d6 Activation code now generalised as well. 2005-04-15 13:07:25 +00:00
Michael Brown
1980018b8b Cleaned up isolation protocol. 2005-04-15 12:25:17 +00:00
Michael Brown
344ea224b4 Standardised debug message. 2005-04-14 23:43:34 +00:00
Michael Brown
ed92171527 Standardised debug messages to make it easy to get a bus scan printout
(just build debugging versions of the relevant bus objects).
2005-04-14 23:32:36 +00:00
Michael Brown
c7694a5322 Cleaner separation of find_t509_device/fill_t509_device. 2005-04-14 23:20:56 +00:00
Michael Brown
f78fd79c16 Moved core/isapnp.c to drivers/bus/isapnp.c 2005-04-14 22:42:57 +00:00
Michael Brown
d5e1561fb8 Updated to new ISA API, but this driver probably has deeper problems. 2005-04-14 21:18:36 +00:00
Michael Brown
487574fc02 This code is unbelievably ugly, has never been fixed up to work with
relocation and (hence) presumably has not been used since Etherboot 5.0.
Say bye-bye!
2005-04-14 20:02:10 +00:00
Michael Brown
8165c14e71 Updated to general ISA bus API. 2005-04-14 19:25:36 +00:00
Michael Brown
a80fe976ed Updated to common ISA bus API. 2005-04-14 19:07:53 +00:00
Michael Brown
9eac705dd2 Added a generalised ISA device-probing mechanism. 2005-04-14 18:46:43 +00:00
Michael Brown
e5b537fed0 name should be const 2005-04-14 17:52:27 +00:00
Michael Brown
cee678de7c Fixed up automatic modifications by hand. 2005-04-14 15:09:28 +00:00
Michael Brown
2c60617836 Automatically modified by
perl -pi -0777 -e 's/\s*?if\s*\(\s*!\s*find_pci_device.*?,\s*\&(\w+)\s*\)\s*\)\s*return\s*0;(.*BOOT_DRIVER\s*\(.*?,)(.*?\))/$2 find_pci_boot_device, $1,$3/sm' *.c
2005-04-14 15:00:05 +00:00
Michael Brown
393969a3f8 Fix up the automatic modifications. 2005-04-14 14:59:04 +00:00
Michael Brown
476dff5bb7 Made amenable to automatic update. 2005-04-14 14:49:32 +00:00
Michael Brown
cbd5d4f849 This is the only driver that has a genuine reason to call
find_pci_device() directly.
2005-04-14 14:48:07 +00:00
Michael Brown
963dbefb51 Automatically updated using
perl -pi -0777 -e 's/(_probe\s*\(\s*struct\s+dev.*?)(\s*\)\s*{.*?$)\s*struct pci_device.*?=\s*pci_device \( dev \);$/${1}, struct pci_device *pci${2}/ms' *.c

sis900 excluded from update
2005-04-14 14:44:33 +00:00
Michael Brown
72fe23a76e Updated to new device API. 2005-04-14 14:31:11 +00:00
Michael Brown
9183f2412e bus header files must include dev.h to get struct dev. 2005-04-14 14:26:28 +00:00
Michael Brown
e0a8ee385e Updated to current device API. 2005-04-14 13:49:58 +00:00
Michael Brown
104880ca19 Tweak API to allow separation of bus-scanning and device-probing logic. 2005-04-14 13:44:07 +00:00
Michael Brown
4c0d5a0b71 Split 3c509.c into 3c509.9 and 3c529.c, with shared code in 3c5x9.c.
Probe mechanisms now use standard EISA and MCA bus methods, with 3c509.c
defining a custom ISA bus to handle the 3c509 contention resolution logic.
2005-04-14 12:23:12 +00:00
Michael Brown
44c7cc8c12 Standardised debug mechanism in place now. 2005-04-14 11:55:57 +00:00
Michael Brown
75d864432c Use the magic of common symbols to allow struct dev to effectively grow at
link time to accommodate whatever bus objects are included.
2005-04-14 10:10:54 +00:00
Michael Brown
0dc98309b2 Stripped references to variables in C code. 2005-04-13 13:48:26 +00:00
Michael Brown
e294a1ddce EISA support now provided by eisa.c
MCA support now provided by mca.c
2005-04-13 13:06:56 +00:00
Michael Brown
200b39a645 Extraced from 3c509.c 2005-04-13 12:45:38 +00:00
Michael Brown
4ae83f28f2 Don't use htons, for compatibility with PCI :( 2005-04-13 12:15:14 +00:00
Michael Brown
4ecbc63296 Use __bswap_16, since we're not dealing with quantities to go onto the network. 2005-04-13 12:11:21 +00:00
Michael Brown
5b8e549c83 htons was used in ISAPnP code just due to ISAPnP storing bytes in
reverse order.
2005-04-13 12:06:33 +00:00
Michael Brown
9711f50e20 Created separate isa_ids.h file and a utility function to print out ISA
IDs in a human-readable format.
2005-04-13 12:01:44 +00:00
Michael Brown
677cda3263 Minor fixups 2005-04-13 03:00:30 +00:00
Michael Brown
1aee4e8001 Extracted from 3c509.c 2005-04-13 02:59:13 +00:00
Michael Brown
7cc6366a84 Finished by hand 2005-04-13 02:02:08 +00:00
Michael Brown
951e305081 Finished by hand 2005-04-13 01:45:20 +00:00
Michael Brown
f39cc6d978 Finished by hand 2005-04-13 01:31:44 +00:00
Michael Brown
9848135950 Finished by hand 2005-04-13 01:01:33 +00:00
Michael Brown
3616de915e Hand-finished 2005-04-13 00:21:59 +00:00
Michael Brown
28590d718b Hand-finished 2005-04-13 00:15:45 +00:00
Michael Brown
91e46ed588 Automatically updated using
perl -pi -0777 -e 's/^(\s*)dev->disable(\s*)=\s*(\w+)_disable;\s*nic->poll\s*=\s*(\w+);\s*nic->transmit\s*=\s*(\w+);\s*nic->irq\s*=\s*(\w+);/static struct nic_operations ${3}_operations;\nstatic struct nic_operations ${3}_operations = {\n\t.connect\t= dummy_connect,\n\t.poll\t\t= $4,\n\t.transmit\t= $5,\n\t.irq\t\t= $6,\n\t.disable\t= ${3}_disable,\n};${1}nic->nic_op\t= &${3}_operations;/msg' *.c
2005-04-13 00:02:40 +00:00
Michael Brown
d9c64c9422 Manual tweaks to get all drivers to follow the "disable, poll, transmit,
irq" pattern.
2005-04-12 23:47:52 +00:00
Michael Brown
881023e9ca Automatically updated using
perl -pi -e 's/(_probe\s*\(\s*struct )dev \*.*?(\s*\);)/${1}dev *dev$2/' *.c

perl -pi -e 's/(_disable\s*\(\s*struct )dev \*.*?(\s*\);)/${1}nic *nic$2/' *.c
2005-04-12 23:39:16 +00:00
Michael Brown
c87ba23399 Automatically updated using
perl -pi -0777 -e 's/_disable\s*\(\s*struct dev \*dev\s*\)\s*{\s*struct nic \*nic.*?$/_disable ( struct nic *nic ) {/ms' *.c

perl -pi -0777 -e 's/_disable\s*\(\s*struct dev \*dev(\s*__unused)?\)\s*{/_disable ( struct nic *nic$1 ) {/ms' *.c
2005-04-12 23:31:37 +00:00
Michael Brown
bd9ae7cc70 Automatically updated using
perl -pi -0777 -e 's/_probe\s*\(\s*struct dev \*dev,\s*struct pci_device \*(\w+?)\s*\)\s*{(\s*)struct nic \*nic.*?$/_probe ( struct dev *dev ) {\n${2}struct nic *nic = nic_device ( dev );\n${2}struct pci_device *$1 = pci_device ( dev );/ms' *.c
2005-04-12 23:24:39 +00:00
Michael Brown
35e6f3e58a Minor regexp tweaks to catch degenerate cases. 2005-04-12 23:13:54 +00:00
Michael Brown
4e3e389200 Auto-updated using
perl -pi -0777 -e 's/static struct pci_driver (\w+) __pci_driver = {.*\.name\s*=\s*(\"\S+\").*\.probe\s*=\s*(\w+).*\.ids\s*=\s*(\w+).*\.class\s*=\s*(\w+).*?};/static struct pci_driver $1 =\n\tPCI_DRIVER ( $2, $4, $5 );\n\nBOOT_DRIVER ( $2, $3 );/ms' *.c

perl -pi -e 's/(PCI_DRIVER \(.*, )0 \);/${1}PCI_NO_CLASS );/' *.c
2005-04-12 23:05:00 +00:00
Michael Brown
81320fae4b Remove debugging by default 2005-04-12 18:32:20 +00:00
Michael Brown
27a55b514c Updated to new device API. 2005-04-12 18:23:00 +00:00
Michael Brown
8fa0e38233 Fixed up PCI-scanning code to use new PCI interface. 2005-04-12 18:13:59 +00:00
Michael Brown
3293c68488 Make adjust_pci_device global, since many drivers call it. 2005-04-12 18:10:57 +00:00
Michael Brown
762fa9a478 Fix up find_pci_device so that it can be used for scanning for devices
*other* than the main boot device.
2005-04-12 18:04:03 +00:00
Michael Brown
707720c4e5 New PCI scan functions now work. 2005-04-12 16:36:55 +00:00
Michael Brown
121e7386f6 New device probing mechanism written, not tested. 2005-04-11 19:19:35 +00:00
Michael Brown
2ebc56f334 Moved in functions from old core/pci.c that we want to keep. 2005-04-11 13:43:53 +00:00
Michael Brown
b9237160ad Almost all information in this file is now obsolete. Writing a new driver
should, with the new build system, just be a case of writing the .c file
and dropping it in place in drivers/net.  :)
2005-04-10 23:45:55 +00:00
Michael Brown
0ff80b477d Merged mcb30-realmode-redesign back to HEAD 2005-04-08 15:01:17 +00:00
Michael Brown
3d6123e69a Initial revision 2005-03-08 18:53:11 +00:00