diff options
| author | Michael Brown | 2010-07-02 13:12:16 +0200 |
|---|---|---|
| committer | Michael Brown | 2010-09-03 22:21:14 +0200 |
| commit | 364b92521ad19051083db605de3b8a058374e096 (patch) | |
| tree | 14d3d80d6f7563fc12be91826e03534818ce0cd2 /src/net/udp | |
| parent | [eepro100] Add new PCI ID 8086:27dc (diff) | |
| download | ipxe-364b92521ad19051083db605de3b8a058374e096.tar.gz ipxe-364b92521ad19051083db605de3b8a058374e096.tar.xz ipxe-364b92521ad19051083db605de3b8a058374e096.zip | |
[xfer] Generalise metadata "whence" field to "flags" field
iPXE has never supported SEEK_END; the usage of "whence" offers only
the options of SEEK_SET and SEEK_CUR and so is effectively a boolean
flag. Further flags will be required to support additional metadata
required by the Fibre Channel network model, so repurpose the "whence"
field as a generic "flags" field.
xfer_seek() has always been used with SEEK_SET, so remove the "whence"
field altogether from its argument list.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/net/udp')
| -rw-r--r-- | src/net/udp/slam.c | 4 | ||||
| -rw-r--r-- | src/net/udp/tftp.c | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/net/udp/slam.c b/src/net/udp/slam.c index 84bb9cba3..026bc1797 100644 --- a/src/net/udp/slam.c +++ b/src/net/udp/slam.c @@ -462,7 +462,7 @@ static int slam_pull_header ( struct slam_request *slam, } /* Notify recipient of file size */ - xfer_seek ( &slam->xfer, slam->total_bytes, SEEK_SET ); + xfer_seek ( &slam->xfer, slam->total_bytes ); return 0; } @@ -526,7 +526,7 @@ static int slam_mc_socket_deliver ( struct slam_request *slam, /* Pass to recipient */ memset ( &meta, 0, sizeof ( meta ) ); - meta.whence = SEEK_SET; + meta.flags = XFER_FL_ABS_OFFSET; meta.offset = ( packet * slam->block_size ); if ( ( rc = xfer_deliver ( &slam->xfer, iobuf, &meta ) ) != 0 ) goto err; diff --git a/src/net/udp/tftp.c b/src/net/udp/tftp.c index 3bcd0a258..e8223c99c 100644 --- a/src/net/udp/tftp.c +++ b/src/net/udp/tftp.c @@ -269,8 +269,8 @@ static int tftp_presize ( struct tftp_request *tftp, size_t filesize ) { tftp->filesize = filesize; /* Notify recipient of file size */ - xfer_seek ( &tftp->xfer, filesize, SEEK_SET ); - xfer_seek ( &tftp->xfer, 0, SEEK_SET ); + xfer_seek ( &tftp->xfer, filesize ); + xfer_seek ( &tftp->xfer, 0 ); /* Calculate expected number of blocks. Note that files whose * length is an exact multiple of the blocksize will have a @@ -854,7 +854,7 @@ static int tftp_rx_data ( struct tftp_request *tftp, /* Deliver data */ memset ( &meta, 0, sizeof ( meta ) ); - meta.whence = SEEK_SET; + meta.flags = XFER_FL_ABS_OFFSET; meta.offset = offset; if ( ( rc = xfer_deliver ( &tftp->xfer, iob_disown ( iobuf ), &meta ) ) != 0 ) { |
