summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/drivers/infiniband/arbel.c1
-rw-r--r--src/drivers/infiniband/hermon.c1
-rw-r--r--src/drivers/infiniband/linda.c3
-rw-r--r--src/drivers/net/dmfe.c20
-rw-r--r--src/drivers/net/etherfabric.c7
-rwxr-xr-xsrc/drivers/net/mtnic.c5
-rw-r--r--src/drivers/net/prism2.c2
-rw-r--r--src/drivers/net/prism2_pci.c9
-rw-r--r--src/drivers/net/prism2_plx.c1
-rw-r--r--src/drivers/net/via-rhine.c32
-rw-r--r--src/drivers/net/via-velocity.c2
-rw-r--r--src/include/gpxe/socket.h12
-rw-r--r--src/interface/efi/efi_snp.c43
-rw-r--r--src/net/tcp.c11
-rw-r--r--src/net/udp.c5
-rw-r--r--src/net/udp/slam.c4
16 files changed, 88 insertions, 70 deletions
diff --git a/src/drivers/infiniband/arbel.c b/src/drivers/infiniband/arbel.c
index 7d509954..e9bc260e 100644
--- a/src/drivers/infiniband/arbel.c
+++ b/src/drivers/infiniband/arbel.c
@@ -27,6 +27,7 @@
#include <unistd.h>
#include <errno.h>
#include <byteswap.h>
+#include <gpxe/io.h>
#include <gpxe/pci.h>
#include <gpxe/malloc.h>
#include <gpxe/umalloc.h>
diff --git a/src/drivers/infiniband/hermon.c b/src/drivers/infiniband/hermon.c
index 44f0e2d5..dbf92a0f 100644
--- a/src/drivers/infiniband/hermon.c
+++ b/src/drivers/infiniband/hermon.c
@@ -25,6 +25,7 @@
#include <unistd.h>
#include <errno.h>
#include <byteswap.h>
+#include <gpxe/io.h>
#include <gpxe/pci.h>
#include <gpxe/malloc.h>
#include <gpxe/umalloc.h>
diff --git a/src/drivers/infiniband/linda.c b/src/drivers/infiniband/linda.c
index b2f9e2ab..c5d13177 100644
--- a/src/drivers/infiniband/linda.c
+++ b/src/drivers/infiniband/linda.c
@@ -21,6 +21,7 @@
#include <errno.h>
#include <unistd.h>
#include <assert.h>
+#include <gpxe/io.h>
#include <gpxe/pci.h>
#include <gpxe/infiniband.h>
#include <gpxe/i2c.h>
@@ -1065,7 +1066,7 @@ static int linda_post_recv ( struct ib_device *ibdev,
return -EINVAL;
}
if ( len != LINDA_RECV_PAYLOAD_SIZE ) {
- DBGC ( linda, "Linda %p QPN %ld wrong RX buffer size (%d)\n",
+ DBGC ( linda, "Linda %p QPN %ld wrong RX buffer size (%zd)\n",
linda, qp->qpn, len );
return -EINVAL;
}
diff --git a/src/drivers/net/dmfe.c b/src/drivers/net/dmfe.c
index 9cf50418..26021e6b 100644
--- a/src/drivers/net/dmfe.c
+++ b/src/drivers/net/dmfe.c
@@ -133,14 +133,14 @@
/* Structure/enum declaration ------------------------------- */
struct tx_desc {
u32 tdes0, tdes1, tdes2, tdes3; /* Data for the card */
- u32 tx_buf_ptr; /* Data for us */
- u32 /* struct tx_desc * */ next_tx_desc;
+ void * tx_buf_ptr; /* Data for us */
+ struct tx_desc * next_tx_desc;
} __attribute__ ((aligned(32)));
struct rx_desc {
u32 rdes0, rdes1, rdes2, rdes3; /* Data for the card */
- u32 rx_skb_ptr; /* Data for us */
- u32 /* struct rx_desc * */ next_rx_desc;
+ void * rx_skb_ptr; /* Data for us */
+ struct rx_desc * next_rx_desc;
} __attribute__ ((aligned(32)));
static struct dmfe_private {
@@ -522,30 +522,30 @@ static void dmfe_descriptor_init(struct nic *nic __unused, unsigned long ioaddr)
/* Init Transmit chain */
for (i = 0; i < TX_DESC_CNT; i++) {
- txd[i].tx_buf_ptr = (u32) & txb[i];
+ txd[i].tx_buf_ptr = &txb[i];
txd[i].tdes0 = cpu_to_le32(0);
txd[i].tdes1 = cpu_to_le32(0x81000000); /* IC, chain */
txd[i].tdes2 = cpu_to_le32(virt_to_bus(&txb[i]));
txd[i].tdes3 = cpu_to_le32(virt_to_bus(&txd[i + 1]));
- txd[i].next_tx_desc = virt_to_le32desc(&txd[i + 1]);
+ txd[i].next_tx_desc = &txd[i + 1];
}
/* Mark the last entry as wrapping the ring */
txd[i - 1].tdes3 = virt_to_le32desc(&txd[0]);
- txd[i - 1].next_tx_desc = (u32) & txd[0];
+ txd[i - 1].next_tx_desc = &txd[0];
/* receive descriptor chain */
for (i = 0; i < RX_DESC_CNT; i++) {
- rxd[i].rx_skb_ptr = (u32) & rxb[i * RX_ALLOC_SIZE];
+ rxd[i].rx_skb_ptr = &rxb[i * RX_ALLOC_SIZE];
rxd[i].rdes0 = cpu_to_le32(0x80000000);
rxd[i].rdes1 = cpu_to_le32(0x01000600);
rxd[i].rdes2 =
cpu_to_le32(virt_to_bus(&rxb[i * RX_ALLOC_SIZE]));
rxd[i].rdes3 = cpu_to_le32(virt_to_bus(&rxd[i + 1]));
- rxd[i].next_rx_desc = virt_to_le32desc(&rxd[i + 1]);
+ rxd[i].next_rx_desc = &rxd[i + 1];
}
/* Mark the last entry as wrapping the ring */
rxd[i - 1].rdes3 = cpu_to_le32(virt_to_bus(&rxd[0]));
- rxd[i - 1].next_rx_desc = virt_to_le32desc(&rxd[0]);
+ rxd[i - 1].next_rx_desc = &rxd[0];
}
diff --git a/src/drivers/net/etherfabric.c b/src/drivers/net/etherfabric.c
index 7cd29f27..365a1602 100644
--- a/src/drivers/net/etherfabric.c
+++ b/src/drivers/net/etherfabric.c
@@ -22,6 +22,7 @@
#include <assert.h>
#include <byteswap.h>
#include <console.h>
+#include <gpxe/io.h>
#include <gpxe/pci.h>
#include <gpxe/malloc.h>
#include <gpxe/ethernet.h>
@@ -1449,7 +1450,7 @@ falcon_spi_rw ( struct spi_bus* bus, struct spi_device *device,
return -EINVAL;
}
- EFAB_TRACE ( "Executing spi command %d on device %d at %d for %d bytes\n",
+ EFAB_TRACE ( "Executing spi command %d on device %d at %d for %zd bytes\n",
command, device_id, address, len );
/* The bus must be idle */
@@ -1497,7 +1498,7 @@ falcon_spi_rw ( struct spi_bus* bus, struct spi_device *device,
fail2:
fail1:
- EFAB_ERR ( "Failed SPI command %d to device %d address 0x%x len 0x%x\n",
+ EFAB_ERR ( "Failed SPI command %d to device %d address 0x%x len 0x%zx\n",
command, device_id, address, len );
return rc;
@@ -3763,7 +3764,7 @@ efab_transmit ( struct net_device *netdev, struct io_buffer *iob )
assert ( tx_queue->buf[buf_id] == NULL );
tx_queue->buf[buf_id] = iob;
- EFAB_TRACE ( "tx_buf[%d] for iob %p data %p len %d\n",
+ EFAB_TRACE ( "tx_buf[%d] for iob %p data %p len %zd\n",
buf_id, iob, iob->data, iob_len ( iob ) );
/* Form the descriptor, and push it to hardware */
diff --git a/src/drivers/net/mtnic.c b/src/drivers/net/mtnic.c
index 240caf60..d06c24ed 100755
--- a/src/drivers/net/mtnic.c
+++ b/src/drivers/net/mtnic.c
@@ -37,6 +37,7 @@
#include <gpxe/umalloc.h>
#include <byteswap.h>
#include <unistd.h>
+#include <gpxe/io.h>
#include <gpxe/pci.h>
#include <gpxe/ethernet.h>
#include <gpxe/netdevice.h>
@@ -1618,8 +1619,8 @@ mtnic_disable(struct pci_device *pci)
free(priv->cmd.buf);
iounmap(priv->hcr);
- ufree((u32)priv->fw.fw_pages.buf);
- ufree((u32)priv->fw.extra_pages.buf);
+ ufree((intptr_t)priv->fw.fw_pages.buf);
+ ufree((intptr_t)priv->fw.extra_pages.buf);
free(priv->eq.buf);
iounmap(priv->eq_db);
priv->state = CARD_DOWN;
diff --git a/src/drivers/net/prism2.c b/src/drivers/net/prism2.c
index aaf4c968..c54dba5d 100644
--- a/src/drivers/net/prism2.c
+++ b/src/drivers/net/prism2.c
@@ -118,7 +118,7 @@ static const char hardcoded_ssid[] = "";
typedef struct hfa384x
{
UINT32 iobase;
- UINT32 membase;
+ void *membase;
UINT16 lastcmd;
UINT16 status; /* in host order */
UINT16 resp0; /* in host order */
diff --git a/src/drivers/net/prism2_pci.c b/src/drivers/net/prism2_pci.c
index 63cc22e3..eda7bf50 100644
--- a/src/drivers/net/prism2_pci.c
+++ b/src/drivers/net/prism2_pci.c
@@ -22,14 +22,11 @@ $Id$
static int prism2_pci_probe ( struct nic *nic, struct pci_device *pci ) {
hfa384x_t *hw = &hw_global;
- uint32_t membase = 0; /* Prism2.5 Memory Base */
- pci_read_config_dword( pci, PRISM2_PCI_MEM_BASE, &membase);
- membase &= PCI_BASE_ADDRESS_MEM_MASK;
- hw->membase = (uint32_t) phys_to_virt(membase);
- printf ( "Prism2.5 has registers at %#lx\n", hw->membase );
+ printf ( "Prism2.5 has registers at %#lx\n", pci->membase );
+ hw->membase = ioremap ( pci->membase, 0x100 );
- nic->ioaddr = hw->membase;
+ nic->ioaddr = pci->membase;
nic->irqno = 0;
return prism2_probe ( nic, hw );
diff --git a/src/drivers/net/prism2_plx.c b/src/drivers/net/prism2_plx.c
index b5e3755f..a10eef29 100644
--- a/src/drivers/net/prism2_plx.c
+++ b/src/drivers/net/prism2_plx.c
@@ -48,7 +48,6 @@ static int prism2_find_plx ( hfa384x_t *hw, struct pci_device *p )
iobase &= PCI_BASE_ADDRESS_IO_MASK;
/* Fill out hw structure */
- hw->membase = attr_mem;
hw->iobase = iobase;
printf ( "PLX9052 has local config registers at %#x\n", plx_lcr );
printf ( "Prism2 has attribute memory at %#x and I/O base at %#x\n", attr_mem, iobase );
diff --git a/src/drivers/net/via-rhine.c b/src/drivers/net/via-rhine.c
index 201ebb08..d9880c32 100644
--- a/src/drivers/net/via-rhine.c
+++ b/src/drivers/net/via-rhine.c
@@ -1194,40 +1194,44 @@ rhine_reset (struct nic *nic)
int ioaddr = tp->ioaddr;
int i, j;
int FDXFlag, CRbak;
- int rx_ring_tmp, rx_ring_tmp1;
- int tx_ring_tmp, tx_ring_tmp1;
- int rx_bufs_tmp, rx_bufs_tmp1;
- int tx_bufs_tmp, tx_bufs_tmp1;
+ void *rx_ring_tmp;
+ void *tx_ring_tmp;
+ void *rx_bufs_tmp;
+ void *tx_bufs_tmp;
+ unsigned long rx_ring_tmp1;
+ unsigned long tx_ring_tmp1;
+ unsigned long rx_bufs_tmp1;
+ unsigned long tx_bufs_tmp1;
/* printf ("rhine_reset\n"); */
/* Soft reset the chip. */
/*outb(CmdReset, ioaddr + ChipCmd); */
- tx_bufs_tmp = (int) rhine_buffers.txbuf;
- tx_ring_tmp = (int) rhine_buffers.txdesc;
- rx_bufs_tmp = (int) rhine_buffers.rxbuf;
- rx_ring_tmp = (int) rhine_buffers.rxdesc;
+ tx_bufs_tmp = rhine_buffers.txbuf;
+ tx_ring_tmp = rhine_buffers.txdesc;
+ rx_bufs_tmp = rhine_buffers.rxbuf;
+ rx_ring_tmp = rhine_buffers.rxdesc;
/* tune RD TD 32 byte alignment */
- rx_ring_tmp1 = (int) virt_to_bus ((char *) rx_ring_tmp);
+ rx_ring_tmp1 = virt_to_bus ( rx_ring_tmp );
j = (rx_ring_tmp1 + 32) & (~0x1f);
/* printf ("txring[%d]", j); */
tp->rx_ring = (struct rhine_rx_desc *) bus_to_virt (j);
- tx_ring_tmp1 = (int) virt_to_bus ((char *) tx_ring_tmp);
+ tx_ring_tmp1 = virt_to_bus ( tx_ring_tmp );
j = (tx_ring_tmp1 + 32) & (~0x1f);
tp->tx_ring = (struct rhine_tx_desc *) bus_to_virt (j);
/* printf ("rxring[%X]", j); */
- tx_bufs_tmp1 = (int) virt_to_bus ((char *) tx_bufs_tmp);
+ tx_bufs_tmp1 = virt_to_bus ( tx_bufs_tmp );
j = (int) (tx_bufs_tmp1 + 32) & (~0x1f);
- tx_bufs_tmp = (int) bus_to_virt (j);
+ tx_bufs_tmp = bus_to_virt (j);
/* printf ("txb[%X]", j); */
- rx_bufs_tmp1 = (int) virt_to_bus ((char *) rx_bufs_tmp);
+ rx_bufs_tmp1 = virt_to_bus ( rx_bufs_tmp );
j = (int) (rx_bufs_tmp1 + 32) & (~0x1f);
- rx_bufs_tmp = (int) bus_to_virt (j);
+ rx_bufs_tmp = bus_to_virt (j);
/* printf ("rxb[%X][%X]", rx_bufs_tmp1, j); */
for (i = 0; i < RX_RING_SIZE; i++)
diff --git a/src/drivers/net/via-velocity.c b/src/drivers/net/via-velocity.c
index a786735e..4473ed15 100644
--- a/src/drivers/net/via-velocity.c
+++ b/src/drivers/net/via-velocity.c
@@ -550,7 +550,7 @@ static void velocity_transmit(struct nic *nic, const char *dest, /* Destination
vptr->td_rings[entry].tdesc0.pktsize = pktlen;
vptr->td_rings[entry].td_buf[0].pa_low = virt_to_bus(ptxb);
vptr->td_rings[entry].td_buf[0].pa_high &=
- cpu_to_le32(0xffff0000L);
+ cpu_to_le32(0xffff0000UL);
vptr->td_rings[entry].td_buf[0].bufsize =
vptr->td_rings[entry].tdesc0.pktsize;
vptr->td_rings[entry].tdesc1.CMDZ = 2;
diff --git a/src/include/gpxe/socket.h b/src/include/gpxe/socket.h
index 9c7afb87..582de4ef 100644
--- a/src/include/gpxe/socket.h
+++ b/src/include/gpxe/socket.h
@@ -7,6 +7,8 @@
*
*/
+#include <stdint.h>
+
/**
* @defgroup commtypes Communication semantics
*
@@ -14,12 +16,14 @@
*/
/** Connection-based, reliable streams */
-#define SOCK_STREAM ( ( int ) TCP_SOCK_STREAM )
-extern char TCP_SOCK_STREAM[];
+extern int tcp_sock_stream;
+#define TCP_SOCK_STREAM 0x1
+#define SOCK_STREAM tcp_sock_stream
/** Connectionless, unreliable streams */
-#define SOCK_DGRAM ( ( int ) UDP_SOCK_DGRAM )
-extern char UDP_SOCK_DGRAM[];
+extern int udp_sock_dgram;
+#define UDP_SOCK_DGRAM 0x2
+#define SOCK_DGRAM udp_sock_dgram
/** @} */
diff --git a/src/interface/efi/efi_snp.c b/src/interface/efi/efi_snp.c
index 6256aeea..102130c8 100644
--- a/src/interface/efi/efi_snp.c
+++ b/src/interface/efi/efi_snp.c
@@ -173,8 +173,9 @@ efi_snp_initialize ( EFI_SIMPLE_NETWORK_PROTOCOL *snp,
container_of ( snp, struct efi_snp_device, snp );
int rc;
- DBGC2 ( snpdev, "SNPDEV %p INITIALIZE (%d extra RX, %d extra TX)\n",
- snpdev, extra_rx_bufsize, extra_tx_bufsize );
+ DBGC2 ( snpdev, "SNPDEV %p INITIALIZE (%ld extra RX, %ld extra TX)\n",
+ snpdev, ( ( unsigned long ) extra_rx_bufsize ),
+ ( ( unsigned long ) extra_tx_bufsize ) );
if ( ( rc = netdev_open ( snpdev->netdev ) ) != 0 ) {
DBGC ( snpdev, "SNPDEV %p could not open %s: %s\n",
@@ -252,9 +253,9 @@ efi_snp_receive_filters ( EFI_SIMPLE_NETWORK_PROTOCOL *snp, UINT32 enable,
container_of ( snp, struct efi_snp_device, snp );
unsigned int i;
- DBGC2 ( snpdev, "SNPDEV %p RECEIVE_FILTERS %08x&~%08x%s %d mcast\n",
+ DBGC2 ( snpdev, "SNPDEV %p RECEIVE_FILTERS %08x&~%08x%s %ld mcast\n",
snpdev, enable, disable, ( mcast_reset ? " reset" : "" ),
- mcast_count );
+ ( ( unsigned long ) mcast_count ) );
for ( i = 0 ; i < mcast_count ; i++ ) {
DBGC2_HDA ( snpdev, i, &mcast[i],
snpdev->netdev->ll_protocol->ll_addr_len );
@@ -390,8 +391,9 @@ efi_snp_nvdata ( EFI_SIMPLE_NETWORK_PROTOCOL *snp, BOOLEAN read,
struct efi_snp_device *snpdev =
container_of ( snp, struct efi_snp_device, snp );
- DBGC2 ( snpdev, "SNPDEV %p NVDATA %s %x+%x\n", snpdev,
- ( read ? "read" : "write" ), offset, len );
+ DBGC2 ( snpdev, "SNPDEV %p NVDATA %s %lx+%lx\n", snpdev,
+ ( read ? "read" : "write" ), ( ( unsigned long ) offset ),
+ ( ( unsigned long ) len ) );
if ( ! read )
DBGC2_HDA ( snpdev, offset, data, len );
@@ -492,7 +494,8 @@ efi_snp_transmit ( EFI_SIMPLE_NETWORK_PROTOCOL *snp,
int rc;
EFI_STATUS efirc;
- DBGC2 ( snpdev, "SNPDEV %p TRANSMIT %p+%x", snpdev, data, len );
+ DBGC2 ( snpdev, "SNPDEV %p TRANSMIT %p+%lx", snpdev, data,
+ ( ( unsigned long ) len ) );
if ( ll_header_len ) {
if ( ll_src ) {
DBGC2 ( snpdev, " src %s",
@@ -512,13 +515,14 @@ efi_snp_transmit ( EFI_SIMPLE_NETWORK_PROTOCOL *snp,
if ( ll_header_len ) {
if ( ll_header_len != ll_protocol->ll_header_len ) {
DBGC ( snpdev, "SNPDEV %p TX invalid header length "
- "%d\n", snpdev, ll_header_len );
+ "%ld\n", snpdev,
+ ( ( unsigned long ) ll_header_len ) );
efirc = EFI_INVALID_PARAMETER;
goto err_sanity;
}
if ( len < ll_header_len ) {
- DBGC ( snpdev, "SNPDEV %p invalid packet length %d\n",
- snpdev, len );
+ DBGC ( snpdev, "SNPDEV %p invalid packet length %ld\n",
+ snpdev, ( ( unsigned long ) len ) );
efirc = EFI_BUFFER_TOO_SMALL;
goto err_sanity;
}
@@ -541,8 +545,8 @@ efi_snp_transmit ( EFI_SIMPLE_NETWORK_PROTOCOL *snp,
/* Allocate buffer */
iobuf = alloc_iob ( len );
if ( ! iobuf ) {
- DBGC ( snpdev, "SNPDEV %p TX could not allocate %d-byte "
- "buffer\n", snpdev, len );
+ DBGC ( snpdev, "SNPDEV %p TX could not allocate %ld-byte "
+ "buffer\n", snpdev, ( ( unsigned long ) len ) );
efirc = EFI_DEVICE_ERROR;
goto err_alloc_iob;
}
@@ -610,7 +614,8 @@ efi_snp_receive ( EFI_SIMPLE_NETWORK_PROTOCOL *snp,
int rc;
EFI_STATUS efirc;
- DBGC2 ( snpdev, "SNPDEV %p RECEIVE %p(+%x)", snpdev, data, *len );
+ DBGC2 ( snpdev, "SNPDEV %p RECEIVE %p(+%lx)", snpdev, data,
+ ( ( unsigned long ) *len ) );
/* Poll the network device */
efi_snp_poll ( snpdev );
@@ -741,8 +746,10 @@ efi_snp_netdev ( EFI_DRIVER_BINDING_PROTOCOL *driver, EFI_HANDLE device ) {
driver, device, efi_strerror ( efirc ) );
goto out_no_pci_location;
}
- DBGCP ( driver, "SNPDRV %p device %p is PCI %04x:%02x:%02x.%x\n",
- driver, device, pci_segment, pci_bus, pci_dev, pci_fn );
+ DBGCP ( driver, "SNPDRV %p device %p is PCI %04lx:%02lx:%02lx.%lx\n",
+ driver, device, ( ( unsigned long ) pci_segment ),
+ ( ( unsigned long ) pci_bus ), ( ( unsigned long ) pci_dev ),
+ ( ( unsigned long ) pci_fn ) );
/* Look up corresponding network device */
pci_busdevfn = PCI_BUSDEVFN ( pci_bus, PCI_DEVFN ( pci_dev, pci_fn ) );
@@ -858,7 +865,7 @@ efi_snp_driver_start ( EFI_DRIVER_BINDING_PROTOCOL *driver,
/* Sanity check */
if ( netdev->ll_protocol->ll_addr_len > sizeof ( EFI_MAC_ADDRESS ) ) {
DBGC ( snpdev, "SNPDEV %p cannot support link-layer address "
- "length %zd for %s\n", snpdev,
+ "length %d for %s\n", snpdev,
netdev->ll_protocol->ll_addr_len, netdev->name );
efirc = EFI_INVALID_PARAMETER;
goto err_ll_addr_len;
@@ -923,8 +930,8 @@ efi_snp_driver_stop ( EFI_DRIVER_BINDING_PROTOCOL *driver,
EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
struct efi_snp_device *snpdev;
- DBGCP ( driver, "SNPDRV %p DRIVER_STOP %p (%d %p)\n",
- driver, device, num_children, children );
+ DBGCP ( driver, "SNPDRV %p DRIVER_STOP %p (%ld %p)\n",
+ driver, device, ( ( unsigned long ) num_children ), children );
/* Locate SNP device */
snpdev = efi_snp_snpdev ( driver, device );
diff --git a/src/net/tcp.c b/src/net/tcp.c
index 3a9ab621..4e0db464 100644
--- a/src/net/tcp.c
+++ b/src/net/tcp.c
@@ -483,7 +483,7 @@ static int tcp_xmit ( struct tcp_connection *tcp, int force_send ) {
tcphdr->csum = tcpip_chksum ( iobuf->data, iob_len ( iobuf ) );
/* Dump header */
- DBGC ( tcp, "TCP %p TX %d->%d %08x..%08x %08x %4zd",
+ DBGC ( tcp, "TCP %p TX %d->%d %08x..%08zx %08x %4zd",
tcp, ntohs ( tcphdr->src ), ntohs ( tcphdr->dest ),
ntohl ( tcphdr->seq ), ( ntohl ( tcphdr->seq ) + seq_len ),
ntohl ( tcphdr->ack ), len );
@@ -702,7 +702,7 @@ static int tcp_rx_ack ( struct tcp_connection *tcp, uint32_t ack,
/* Ignore duplicate or out-of-range ACK */
if ( ack_len > tcp->snd_sent ) {
- DBGC ( tcp, "TCP %p received ACK for [%08x,%08x), "
+ DBGC ( tcp, "TCP %p received ACK for [%08x,%08zx), "
"sent only [%08x,%08x)\n", tcp, tcp->snd_seq,
( tcp->snd_seq + ack_len ), tcp->snd_seq,
( tcp->snd_seq + tcp->snd_sent ) );
@@ -894,7 +894,7 @@ static int tcp_rx ( struct io_buffer *iobuf,
len = iob_len ( iobuf );
/* Dump header */
- DBGC ( tcp, "TCP %p RX %d<-%d %08x %08x..%08x %4zd",
+ DBGC ( tcp, "TCP %p RX %d<-%d %08x %08x..%08zx %4zd",
tcp, ntohs ( tcphdr->dest ), ntohs ( tcphdr->src ),
ntohl ( tcphdr->ack ), ntohl ( tcphdr->seq ),
( ntohl ( tcphdr->seq ) + len +
@@ -1070,12 +1070,13 @@ static struct xfer_interface_operations tcp_xfer_operations = {
/** TCP socket opener */
struct socket_opener tcp_socket_opener __socket_opener = {
- .semantics = SOCK_STREAM,
+ .semantics = TCP_SOCK_STREAM,
.family = AF_INET,
.open = tcp_open,
};
-char TCP_SOCK_STREAM[1];
+/** Linkage hack */
+int tcp_sock_stream = TCP_SOCK_STREAM;
/**
* Open TCP URI
diff --git a/src/net/udp.c b/src/net/udp.c
index 407ea14d..fddf81df 100644
--- a/src/net/udp.c
+++ b/src/net/udp.c
@@ -438,12 +438,13 @@ static struct xfer_interface_operations udp_xfer_operations = {
/** UDP socket opener */
struct socket_opener udp_socket_opener __socket_opener = {
- .semantics = SOCK_DGRAM,
+ .semantics = UDP_SOCK_DGRAM,
.family = AF_INET,
.open = udp_open,
};
-char UDP_SOCK_DGRAM[1];
+/** Linkage hack */
+int udp_sock_dgram = UDP_SOCK_DGRAM;
/**
* Open UDP URI
diff --git a/src/net/udp/slam.c b/src/net/udp/slam.c
index cb0dfa5c..6add99bc 100644
--- a/src/net/udp/slam.c
+++ b/src/net/udp/slam.c
@@ -219,7 +219,7 @@ static int slam_put_value ( struct slam_request *slam,
*/
len = ( ( flsl ( value ) + 10 ) / 8 );
if ( len >= iob_tailroom ( iobuf ) ) {
- DBGC2 ( slam, "SLAM %p cannot add %d-byte value\n",
+ DBGC2 ( slam, "SLAM %p cannot add %zd-byte value\n",
slam, len );
return -ENOBUFS;
}
@@ -380,7 +380,7 @@ static int slam_pull_value ( struct slam_request *slam,
len = ( *data >> 5 );
if ( ( len == 0 ) ||
( value && ( len > sizeof ( *value ) ) ) ) {
- DBGC ( slam, "SLAM %p invalid value length %d bytes\n",
+ DBGC ( slam, "SLAM %p invalid value length %zd bytes\n",
slam, len );
return -EINVAL;
}