summaryrefslogtreecommitdiffstats
path: root/src/arch/i386/drivers/net/undinet.c
diff options
context:
space:
mode:
authorMichael Brown2007-07-02 19:33:41 +0200
committerMichael Brown2007-07-02 19:33:41 +0200
commite42eba4af49729c5535512d8b83ea6d18a8e3e95 (patch)
tree49805fcc50d3552642c9dee6c1838eb76abadfcf /src/arch/i386/drivers/net/undinet.c
parentpxe_netdev now holds a reference to the network device. (diff)
downloadipxe-e42eba4af49729c5535512d8b83ea6d18a8e3e95.tar.gz
ipxe-e42eba4af49729c5535512d8b83ea6d18a8e3e95.tar.xz
ipxe-e42eba4af49729c5535512d8b83ea6d18a8e3e95.zip
Use a common base-memory packet buffer for DHCP construction (as used
by PXE and NBI) and UNDI packets (as used by undinet and UNDI).
Diffstat (limited to 'src/arch/i386/drivers/net/undinet.c')
-rw-r--r--src/arch/i386/drivers/net/undinet.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/arch/i386/drivers/net/undinet.c b/src/arch/i386/drivers/net/undinet.c
index 865c6e8d..6bc0fc36 100644
--- a/src/arch/i386/drivers/net/undinet.c
+++ b/src/arch/i386/drivers/net/undinet.c
@@ -22,6 +22,7 @@
#include <pic8259.h>
#include <biosint.h>
#include <pnpbios.h>
+#include <basemem_packet.h>
#include <gpxe/iobuf.h>
#include <gpxe/netdevice.h>
#include <gpxe/if_ether.h>
@@ -314,13 +315,6 @@ static int undinet_isr_triggered ( void ) {
*****************************************************************************
*/
-/** Maximum length of a packet transmitted via the UNDI API */
-#define UNDI_IOB_LEN 1514
-
-/** UNDI I/O buffer */
-static char __data16_array ( undinet_iob, [UNDI_IOB_LEN] );
-#define undinet_iob __use_data16 ( undinet_iob )
-
/** UNDI transmit buffer descriptor */
static struct s_PXENV_UNDI_TBD __data16 ( undinet_tbd );
#define undinet_tbd __use_data16 ( undinet_tbd )
@@ -340,9 +334,9 @@ static int undinet_transmit ( struct net_device *netdev,
int rc;
/* Copy packet to UNDI I/O buffer */
- if ( len > sizeof ( undinet_iob ) )
- len = sizeof ( undinet_iob );
- memcpy ( &undinet_iob, iobuf->data, len );
+ if ( len > sizeof ( basemem_packet ) )
+ len = sizeof ( basemem_packet );
+ memcpy ( &basemem_packet, iobuf->data, len );
/* Create PXENV_UNDI_TRANSMIT data structure */
memset ( &undi_transmit, 0, sizeof ( undi_transmit ) );
@@ -357,7 +351,7 @@ static int undinet_transmit ( struct net_device *netdev,
undinet_tbd.ImmedLength = len;
undinet_tbd.Xmit.segment = rm_ds;
undinet_tbd.Xmit.offset
- = ( ( unsigned ) & __from_data16 ( undinet_iob ) );
+ = ( ( unsigned ) & __from_data16 ( basemem_packet ) );
/* Issue PXE API call */
if ( ( rc = undinet_call ( undinic, PXENV_UNDI_TRANSMIT,