6 #include <gpxe/async.h>
9 #include <gpxe/uaccess.h>
12 static void test_http_callback ( struct http_request *http, char *data, size_t len ) {
13 userptr_t pxe_buffer = real_to_user ( 0, 0x7c00 );
14 unsigned long offset = http->file_recv;
15 http->file_recv += len;
16 copy_to_user ( pxe_buffer, offset, data, len );
19 void test_http ( struct net_device *netdev, struct sockaddr_tcpip *server, const char *filename ) {
20 struct http_request http;
23 memset ( &http, 0, sizeof ( http ) );
24 memcpy ( &http.tcp.peer, server, sizeof ( http.tcp.peer ) );
25 http.filename = filename;
26 http.callback = test_http_callback;
28 rc = async_wait ( get_http ( &http ) );
30 printf ( "HTTP fetch failed\n" );
33 printf ( "Attempting PXE boot\n" );
36 printf ( "PXE NBP returned with status %04x\n", rc);