summaryrefslogtreecommitdiffstats
path: root/src/drivers/block
Commit message (Collapse)AuthorAgeFilesLines
* [legal] Relicense files under GPL2_OR_LATER_OR_UBDLMichael Brown2015-03-022-2/+10
| | | | | | | Relicense files for which I am the sole author (as identified by util/relicense.pl). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [iscsi] Include IP address origin in iBFTMichael Brown2014-06-121-0/+7
| | | | | | | | | | | The iBFT includes an "origin" field to indicate the source of the IP address. We use the heuristic of assuming that the source should be "manual" if the IP address originates directly from the network device settings block, and "DHCP" otherwise. This is an imperfect guess, but is likely to be correct in most common situations. Originally-implemented-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [iscsi] Read IPv4 settings only from the relevant network deviceMichael Brown2014-06-121-9/+14
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [scsi] Improve sense code parsingMichael Brown2014-06-032-8/+37
| | | | | | | | Parse the sense data to extract the reponse code, the sense key, the additional sense code, and the additional sense code qualifier. Originally-implemented-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Explicitly separate the concept of a completed fetched settingMichael Brown2013-12-051-4/+6
| | | | | | | | | | The fetch_setting() family of functions may currently modify the definition of the specified setting (e.g. to add missing type information). Clean up this interface by requiring callers to provide an explicit buffer to contain the completed definition of the fetched setting, if required. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libc] Use __einfo() tuple as first argument to EUNIQ()Michael Brown2013-04-192-2/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [iscsi] Include 802.1Q VLAN identifier in iBFTStefan Hajnoczi2013-03-011-0/+3
| | | | | | | | | | | | | | | The iBFT NIC section has a VLAN field which must be filled in so that iSCSI booting works over VLANs. Unfortunately it is unclear from the IBM specification linked in ibft.c whether the VLAN field is just the 802.1Q VLAN Identifier or the full 802.1Q TCI. For now just fill in the VID, the Priority Code Point and Drop Eligible Indicator could be set in the future if it turns out they should be present too. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Update FSF mailing address in GPL licence textsMichael Brown2012-07-202-2/+4
| | | | | Suggested-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [scsi] Eliminate polling while waiting for window to openMichael Brown2011-06-281-6/+13
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [process] Pass containing object pointer to process step() methodsMichael Brown2011-06-281-5/+8
| | | | | | | | | Give the step() method a pointer to the containing object, rather than a pointer to the process. This is consistent with the operation of interface methods, and allows a single function to serve as both an interface method and a process step() method. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [iscsi] Change default initiator IQNMichael Brown2011-03-031-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The default initiator IQN is "iqn.2000-09.org.etherboot:UNKNOWN". This is problematic for two reasons: a) the etherboot.org domain (and hence the associated IQN namespace) is not under the control of the iPXE project, and b) some targets (correctly) refuse to allow concurrent connections from different initiators using the same initiator IQN. Solve both problems by changing the default initiator IQN to be iqn.2010-04.org.ipxe:<hostname> if a hostname is set, or iqn.2010-04.org.ipxe:<uuid> if no hostname is set. Explicit initiator IQNs set via DHCP option 203 are not affected by this change. Unfortunately, this change is likely to break some existing configurations, where ACL rules have been put in place referring to the old default initiator IQN. Users may need to update ACLs, or force the use of the old IQN using an iPXE script line such as set initiator-iqn iqn.2000-09.org.etherboot:UNKNOWN or a dhcpd.conf option such as option iscsi-initiator-iqn "iqn.2000-09.org.etherboot:UNKNOWN" Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [iscsi] Fix minor typo in ibft_set_ipaddr()Michael Brown2011-02-251-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [iscsi] Include both DNS addresses in iBFT, if availableMichael Brown2010-12-091-9/+17
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [scsi] Wait for a successful TEST UNIT READY commandMichael Brown2010-10-191-3/+132
| | | | | | | | | | | | | Some SCSI targets (observed with an EMC CLARiiON Fibre Channel target) will not respond to commands correctly until a TEST UNIT READY has been issued. In particular, a READ CAPACITY (10) command will return with a success status, but no capacity data. Fix by issuing a TEST UNIT READY command automatically, and delaying further SCSI commands until the TEST UNIT READY has succeeded. Reported-by: Hadar Hen Zion <hadarh@mellanox.co.il> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Include the SRP login rejection reason in the error numberMichael Brown2010-09-221-5/+50
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ata] Add support for describing an ATA device using EDDMichael Brown2010-09-221-0/+19
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Add support for identifying the underlying hardware deviceMichael Brown2010-09-221-2/+3
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [scsi] Include sense key within error number reported to userMichael Brown2010-09-151-1/+62
| | | | | | | The sense key gives a first idea of what the problem might be, and so is potentially useful in diagnosing problems in a non-debug build. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [block] Replace gPXE block-device API with an iPXE asynchronous interfaceMichael Brown2010-09-145-717/+2242
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The block device interface used in gPXE predates the invention of even the old gPXE data-transfer interface, let alone the current iPXE generic asynchronous interface mechanism. Bring this old code up to date, with the following benefits: o Block device commands can be cancelled by the requestor. The INT 13 layer uses this to provide a global timeout on all INT 13 calls, with the result that an unexpected passive failure mode (such as an iSCSI target ACKing the request but never sending a response) will lead to a timeout that gets reported back to the INT 13 user, rather than simply freezing the system. o INT 13,00 (reset drive) is now able to reset the underlying block device. INT 13 users, such as DOS, that use INT 13,00 as a method for error recovery now have a chance of recovering. o All block device commands are tagged, with a numerical tag that will show up in debugging output and in packet captures; this will allow easier interpretation of bug reports that include both sources of information. o The extremely ugly hacks used to generate the boot firmware tables have been eradicated and replaced with a generic acpi_describe() method (exploiting the ability of iPXE interfaces to pass through methods to an underlying interface). The ACPI tables are now built in a shared data block within .bss16, rather than each requiring dedicated space in .data16. o The architecture-independent concept of a SAN device has been exposed to the iPXE core through the sanboot API, which provides calls to hook, unhook, boot, and describe SAN devices. This allows for much more flexible usage patterns (such as hooking an empty SAN device and then running an OS installer via TFTP). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [interface] Convert all data-xfer interfaces to generic interfacesMichael Brown2010-06-221-32/+14Star
| | | | | | | | | | | | | | Remove data-xfer as an interface type, and replace data-xfer interfaces with generic interfaces supporting the data-xfer methods. Filter interfaces (as used by the TLS layer) are handled using the generic pass-through interface capability. A side-effect of this is that deliver_raw() no longer exists as a data-xfer method. (In practice this doesn't lose any efficiency, since there are no instances within the current codebase where xfer_deliver_raw() is used to pass data to an interface supporting the deliver_raw() method.) Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [refcnt] Add ref_init() wrapper functionMichael Brown2010-06-221-0/+1
| | | | | | | Standardise on using ref_init() to initialise an embedded reference count, to match the coding style used by other embedded objects. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Rename gPXE to iPXEMichael Brown2010-04-204-13/+13
| | | | | | | | | | | Access to the gpxe.org and etherboot.org domains and associated resources has been revoked by the registrant of the domain. Work around this problem by renaming project from gPXE to iPXE, and updating URLs to match. Also update README, LOG and COPYRIGHTS to remove obsolete information. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Allow SRP reconnection attempts even after reporting failuresMichael Brown2009-08-101-12/+5Star
| | | | | | | | | With iSCSI, connection attempts are expensive; it may take many seconds to determine that a connection will fail. SRP connection attempts are much less expensive, so we may as well avoid the "optimisation" of declaring a state of permanent failure after a certain number of attempts. This allows a gPXE SRP initiator to resume operations after an arbitrary amount of SRP target downtime.
* [infiniband] Add support for SRP over InfinibandMichael Brown2009-08-101-0/+530
| | | | | | | | SRP is the SCSI RDMA Protocol. It allows for a method of SAN booting whereby the target is responsible for reading and writing data using Remote DMA directly to the initiator's memory. The software initiator merely sends and receives SCSI commands; it never has to touch the actual data.
* [scsi] Generalise iscsi_parse_lun() to scsi_parse_lun()Michael Brown2009-08-101-0/+30
|
* [scsi] Generalise iscsi_detached_command() to scsi_detached_command()Michael Brown2009-08-101-0/+12
|
* [ata] Make ATA command issuing partially asynchronousMichael Brown2009-07-181-1/+24
| | | | | | | | | Move the icky call to step() from aoe.c to ata.c; this takes it at least one step further away from where it really doesn't belong. Unfortunately, AoE has the ugly aoe_discover() mechanism which means that we still have a step() loop in aoe.c for now; this needs to be replaced at some future point.
* [scsi] Improve SCSI debuggingMichael Brown2009-07-181-9/+26
|
* [scsi] Make SCSI command issuing partially asynchronousMichael Brown2009-07-181-3/+15
| | | | | Move the icky call to step() from iscsi.c to scsi.c; this takes it at least one step further away from where it really doesn't belong.
* [legal] Add a selection of FILE_LICENCE declarationsMichael Brown2009-05-183-0/+6
| | | | | Add FILE_LICENCE declarations to almost all files that make up the various standard builds of gPXE.
* [scsi] Fix DBG() message reporting of error numberMichael Brown2009-02-191-2/+2
|
* [scsi] Cope with targets that send multiple CHECK CONDITIONS at power-onMichael Brown2009-01-301-5/+19
| | | | | | | | | | | | | | | Some targets send a spurious CHECK CONDITION message in response to the first SCSI command. We issue (and ignore the status of) an arbitary harmless SCSI command (a READ CAPACITY (10)) in order to draw out this response. The Solaris Comstar target seems to send more than one spurious CHECK CONDITION response. Attempt up to SCSI_MAX_DUMMY_READ_CAP dummy READ CAPACITY (10) commands before assuming that error responses are meaningful. Problem reported by Kristof Van Doorsselaere <kvandoor@aserver.com> and Shiva Shankar <802.11e@gmail.com>.
* [blockdev] Move block device operations to structure block_device_operationsLaurent Vivier2008-11-193-8/+24
| | | | Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net>
* Split bootsector execution code out into bootsector.c.Michael Brown2007-01-291-0/+91
| | | | Added basic El Torito ISO image boot capability
* Automatically select between the "10" and "16" variants of command set,Michael Brown2006-12-121-31/+72
| | | | based on the device size.
* Catch SCSI errors, and work around the start-of-day CHECK CONDITIONMichael Brown2006-12-121-1/+32
| | | | that some targets send.
* We don't actually have a stdio.h header file. Our printf() functions areMichael Brown2006-09-271-1/+0Star
| | | | | | | | 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.
* added stdio.h to includes for DBG compilationMarty Connor2006-09-271-0/+1
|
* Updated debug message to reflect change in data structure.Michael Brown2006-06-121-2/+3
|
* Backing out last change; no immediate plans to make the whole block-deviceMichael Brown2006-06-011-2/+1Star
| | | | | layer asynchronous, so keeping the sync/async boundary within aoedev.c seems cleanest for now.
* ATA devices are now asynchronous. The ATA layer itself now performs theMichael Brown2006-05-311-1/+2
| | | | | | | | 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).
* Added generic asynchronous operations code.Michael Brown2006-05-311-5/+4Star
| | | | | | | | | 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()).
* Use separate data-in and data-out buffers.Michael Brown2006-05-291-40/+30Star
| | | | Increase code simplicity at the expense of around 64 bytes.
* Fixed debug codeMichael Brown2006-05-211-3/+3
|
* Added (untested) support for ATA devices. This code should be genericMichael Brown2006-05-211-0/+169
| | | | enough to support both real IDE chipsets and AoE.
* READ CAPACITY (16) turns out to be an optional command (even thoughMichael Brown2006-05-191-2/+57
| | | | | 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".
* Add the concept of a "user pointer" (similar to the void __user * inMichael Brown2006-05-191-7/+9
| | | | | | | | | | | | | | | | | | | | 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).
* Defined SCSI device interface, and added SCSI block deviceMichael Brown2006-05-131-0/+142
implementation.