aboutsummaryrefslogtreecommitdiffstats
path: root/src/arch/i386/image
diff options
context:
space:
mode:
authorMichael Brown <mcb30@etherboot.org>2009-06-28 20:08:58 +0100
committerMichael Brown <mcb30@etherboot.org>2009-06-28 20:11:32 +0100
commit07b5be33413a23e150b84aed41881dfa056e41df (patch)
treebb541ff9199e174e0e35b23dd96cf2e52260a58b /src/arch/i386/image
parentc2965b0fe72ea6b2a9efb7f852682226d60bee7f (diff)
downloadipxe-07b5be33413a23e150b84aed41881dfa056e41df.tar.gz
[pxe] Create pxe_[de]activate() wrapper functions
Merge the pxe_set_netdev()+pxe_[un]hook_int1a() pattern into a single pxe_[de]activate() call.
Diffstat (limited to 'src/arch/i386/image')
-rw-r--r--src/arch/i386/image/pxe_image.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/arch/i386/image/pxe_image.c b/src/arch/i386/image/pxe_image.c
index fde8f09b..63429f87 100644
--- a/src/arch/i386/image/pxe_image.c
+++ b/src/arch/i386/image/pxe_image.c
@@ -44,27 +44,24 @@ struct image_type pxe_image_type __image_type ( PROBE_PXE );
* @ret rc Return status code
*/
static int pxe_exec ( struct image *image ) {
+ struct net_device *netdev;
int rc;
- /* Ensure that PXE stack is ready to use */
- pxe_hook_int1a();
-
/* Arbitrarily pick the most recently opened network device */
- pxe_set_netdev ( last_opened_netdev() );
-
- /* Many things will break if pxe_netdev is NULL */
- if ( ! pxe_netdev ) {
+ if ( ( netdev = last_opened_netdev() ) == NULL ) {
DBGC ( image, "IMAGE %p could not locate PXE net device\n",
image );
return -ENODEV;
}
+ /* Activate PXE */
+ pxe_activate ( netdev );
+
/* Start PXE NBP */
rc = pxe_start_nbp();
/* Deactivate PXE */
- pxe_set_netdev ( NULL );
- pxe_unhook_int1a();
+ pxe_deactivate();
return rc;
}