summaryrefslogtreecommitdiffstats
path: root/src/drivers
diff options
context:
space:
mode:
authorMichael Brown2008-11-19 20:33:05 +0100
committerMichael Brown2008-11-19 20:33:05 +0100
commit0ebbbb95fa03622423154a3e56251dd58832654d (patch)
tree3bb6fa8df8158cf546a3fe42364cfd3d0b4ef831 /src/drivers
parent[build] Explicitly link efilink against -liberty (diff)
downloadipxe-0ebbbb95fa03622423154a3e56251dd58832654d.tar.gz
ipxe-0ebbbb95fa03622423154a3e56251dd58832654d.tar.xz
ipxe-0ebbbb95fa03622423154a3e56251dd58832654d.zip
[x86_64] Fix assorted 64-bit compilation errors and warnings
Remove various 32-bit assumptions scattered throughout the codebase. The code is still not necessarily 64-bit clean, but will at least compile.
Diffstat (limited to 'src/drivers')
-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
11 files changed, 44 insertions, 39 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;