summaryrefslogtreecommitdiffstats
path: root/src/net/pkbpad.c
diff options
context:
space:
mode:
authorMichael Brown2007-05-19 20:39:40 +0200
committerMichael Brown2007-05-19 20:39:40 +0200
commit3e2c6b6736729633c5d6c00cd31458a1c6a49730 (patch)
tree8c9e1ed94b301680c9870ed09424e3a2a2e4bafa /src/net/pkbpad.c
parentAdd explicit "freeing" debug messages. (diff)
downloadipxe-3e2c6b6736729633c5d6c00cd31458a1c6a49730.tar.gz
ipxe-3e2c6b6736729633c5d6c00cd31458a1c6a49730.tar.xz
ipxe-3e2c6b6736729633c5d6c00cd31458a1c6a49730.zip
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;'
Diffstat (limited to 'src/net/pkbpad.c')
-rw-r--r--src/net/pkbpad.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/net/pkbpad.c b/src/net/pkbpad.c
index e12e46b9..9961edca 100644
--- a/src/net/pkbpad.c
+++ b/src/net/pkbpad.c
@@ -19,48 +19,48 @@
/**
* @file
*
- * Packet buffer padding
+ * I/O buffer padding
*
*/
#include <string.h>
-#include <gpxe/pkbuff.h>
+#include <gpxe/iobuf.h>
/**
- * Pad packet buffer
+ * Pad I/O buffer
*
- * @v pkb Packet buffer
+ * @v iobuf I/O buffer
* @v min_len Minimum length
*
- * This function pads and aligns packet buffers, for devices that
+ * This function pads and aligns I/O buffers, for devices that
* aren't capable of padding in hardware, or that require specific
* alignment in TX buffers. The packet data will end up aligned to a
- * multiple of @c PKB_ALIGN.
+ * multiple of @c IOB_ALIGN.
*
- * @c min_len must not exceed @v PKB_ZLEN.
+ * @c min_len must not exceed @v IOB_ZLEN.
*/
-void pkb_pad ( struct pk_buff *pkb, size_t min_len ) {
+void iob_pad ( struct io_buffer *iobuf, size_t min_len ) {
void *data;
size_t len;
size_t headroom;
signed int pad_len;
- assert ( min_len <= PKB_ZLEN );
+ assert ( min_len <= IOB_ZLEN );
- /* Move packet data to start of packet buffer. This will both
- * align the data (since packet buffers are aligned to
- * PKB_ALIGN) and give us sufficient space for the
+ /* Move packet data to start of I/O buffer. This will both
+ * align the data (since I/O buffers are aligned to
+ * IOB_ALIGN) and give us sufficient space for the
* zero-padding
*/
- data = pkb->data;
- len = pkb_len ( pkb );
- headroom = pkb_headroom ( pkb );
- pkb_push ( pkb, headroom );
- memmove ( pkb->data, data, len );
- pkb_unput ( pkb, headroom );
+ data = iobuf->data;
+ len = iob_len ( iobuf );
+ headroom = iob_headroom ( iobuf );
+ iob_push ( iobuf, headroom );
+ memmove ( iobuf->data, data, len );
+ iob_unput ( iobuf, headroom );
/* Pad to minimum packet length */
- pad_len = ( min_len - pkb_len ( pkb ) );
+ pad_len = ( min_len - iob_len ( iobuf ) );
if ( pad_len > 0 )
- memset ( pkb_put ( pkb, pad_len ), 0, pad_len );
+ memset ( iob_put ( iobuf, pad_len ), 0, pad_len );
}