summaryrefslogtreecommitdiffstats
path: root/src/net
diff options
context:
space:
mode:
authorMichael Brown2007-06-08 17:33:24 +0200
committerMichael Brown2007-06-08 17:33:24 +0200
commit6f0a6c09db3b714849e3f84dabd3ad9ee9041607 (patch)
tree67b0a5d66d2ea9a0508c36ca0a4eaaffa3045725 /src/net
parentShould call ftp_done() if constructor fails. (diff)
parentConflicts with native asn1.c (diff)
downloadipxe-6f0a6c09db3b714849e3f84dabd3ad9ee9041607.tar.gz
ipxe-6f0a6c09db3b714849e3f84dabd3ad9ee9041607.tar.xz
ipxe-6f0a6c09db3b714849e3f84dabd3ad9ee9041607.zip
Merge branch 'master' into mcb-tcp-xfer
Diffstat (limited to 'src/net')
-rw-r--r--src/net/netdevice.c7
-rw-r--r--src/net/retry.c10
-rw-r--r--src/net/tcp/iscsi.c27
3 files changed, 7 insertions, 37 deletions
diff --git a/src/net/netdevice.c b/src/net/netdevice.c
index c1ad5f68e..ddcb296f4 100644
--- a/src/net/netdevice.c
+++ b/src/net/netdevice.c
@@ -388,7 +388,7 @@ int net_rx ( struct io_buffer *iobuf, struct net_device *netdev,
* This polls all interfaces for received packets, and processes
* packets from the RX queue.
*/
-static void net_step ( struct process *process ) {
+static void net_step ( struct process *process __unused ) {
struct net_device *netdev;
struct io_buffer *iobuf;
@@ -410,9 +410,6 @@ static void net_step ( struct process *process ) {
netdev->ll_protocol->rx ( iobuf, netdev );
}
}
-
- /* Re-schedule ourself */
- schedule ( process );
}
/** Networking stack process */
@@ -422,7 +419,7 @@ static struct process net_process = {
/** Initialise the networking stack process */
static void init_net ( void ) {
- schedule ( &net_process );
+ process_add ( &net_process );
}
INIT_FN ( INIT_PROCESS, init_net, NULL, NULL );
diff --git a/src/net/retry.c b/src/net/retry.c
index cd683f5b7..f8c34b813 100644
--- a/src/net/retry.c
+++ b/src/net/retry.c
@@ -64,7 +64,7 @@ static LIST_HEAD ( timers );
* be stopped and the timer's callback function will be called.
*/
void start_timer ( struct retry_timer *timer ) {
- if ( ! timer->start )
+ if ( ! timer_running ( timer ) )
list_add ( &timer->list, &timers );
timer->start = currticks();
if ( timer->timeout < MIN_TIMEOUT )
@@ -86,7 +86,7 @@ void stop_timer ( struct retry_timer *timer ) {
unsigned long runtime;
/* If timer was already stopped, do nothing */
- if ( ! timer->start )
+ if ( ! timer_running ( timer ) )
return;
list_del ( &timer->list );
@@ -153,7 +153,7 @@ static void timer_expired ( struct retry_timer *timer ) {
*
* @v process Retry timer process
*/
-static void retry_step ( struct process *process ) {
+static void retry_step ( struct process *process __unused ) {
struct retry_timer *timer;
struct retry_timer *tmp;
unsigned long now = currticks();
@@ -164,8 +164,6 @@ static void retry_step ( struct process *process ) {
if ( used >= timer->timeout )
timer_expired ( timer );
}
-
- schedule ( process );
}
/** Retry timer process */
@@ -175,7 +173,7 @@ static struct process retry_process = {
/** Initialise the retry timer module */
static void init_retry ( void ) {
- schedule ( &retry_process );
+ process_add ( &retry_process );
}
INIT_FN ( INIT_PROCESS, init_retry, NULL, NULL );
diff --git a/src/net/tcp/iscsi.c b/src/net/tcp/iscsi.c
index 56567976f..f95286d09 100644
--- a/src/net/tcp/iscsi.c
+++ b/src/net/tcp/iscsi.c
@@ -23,6 +23,7 @@
#include <errno.h>
#include <assert.h>
#include <byteswap.h>
+#include <gpxe/vsprintf.h>
#include <gpxe/scsi.h>
#include <gpxe/process.h>
#include <gpxe/uaccess.h>
@@ -349,32 +350,6 @@ static void iscsi_tx_data_out ( struct iscsi_session *iscsi,
*/
/**
- * Version of snprintf() that accepts a signed buffer size
- *
- * @v buf Buffer into which to write the string
- * @v size Size of buffer
- * @v fmt Format string
- * @v args Arguments corresponding to the format string
- * @ret len Length of formatted string
- *
- * This is a utility function for iscsi_build_login_request_strings().
- */
-static int ssnprintf ( char *buf, ssize_t ssize, const char *fmt, ... ) {
- va_list args;
- int len;
-
- /* Treat negative buffer size as zero buffer size */
- if ( ssize < 0 )
- ssize = 0;
-
- /* Hand off to vsnprintf */
- va_start ( args, fmt );
- len = vsnprintf ( buf, ssize, fmt, args );
- va_end ( args );
- return len;
-}
-
-/**
* Build iSCSI login request strings
*
* @v iscsi iSCSI session