removed many compiler warnings
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7435 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
bef5b86a74
commit
720aa69389
@ -30,10 +30,8 @@ ipro1000_open(const char *name, uint32 flags, void** cookie)
|
|||||||
{
|
{
|
||||||
ipro1000_device *device;
|
ipro1000_device *device;
|
||||||
char *deviceName;
|
char *deviceName;
|
||||||
uint32 val;
|
|
||||||
int dev_id;
|
int dev_id;
|
||||||
int mask;
|
int mask;
|
||||||
int i;
|
|
||||||
|
|
||||||
TRACE("ipro1000_open()\n");
|
TRACE("ipro1000_open()\n");
|
||||||
|
|
||||||
@ -154,7 +152,7 @@ retry:
|
|||||||
len = mb->m_len;
|
len = mb->m_len;
|
||||||
if (len < 0)
|
if (len < 0)
|
||||||
len = 0;
|
len = 0;
|
||||||
if (len > *num_bytes)
|
if (len > (int)*num_bytes)
|
||||||
len = *num_bytes;
|
len = *num_bytes;
|
||||||
|
|
||||||
memcpy(buf, mtod(mb, uint8 *), len); // XXX this is broken for jumbo frames
|
memcpy(buf, mtod(mb, uint8 *), len); // XXX this is broken for jumbo frames
|
||||||
|
@ -21,7 +21,7 @@ pci_module_info *gPci;
|
|||||||
char* gDevNameList[MAX_CARDS + 1];
|
char* gDevNameList[MAX_CARDS + 1];
|
||||||
pci_info *gDevList[MAX_CARDS];
|
pci_info *gDevList[MAX_CARDS];
|
||||||
|
|
||||||
const char *
|
static const char *
|
||||||
identify_device(const pci_info *info)
|
identify_device(const pci_info *info)
|
||||||
{
|
{
|
||||||
if (info->vendor_id != 0x8086)
|
if (info->vendor_id != 0x8086)
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
spinlock mbuf_lock = 0;
|
spinlock mbuf_lock = 0;
|
||||||
|
|
||||||
struct mbuf *
|
struct mbuf *
|
||||||
m_alloc()
|
m_gethdr(int how, int type)
|
||||||
{
|
{
|
||||||
struct mbuf *m = mbuf_pool_get();
|
struct mbuf *m = mbuf_pool_get();
|
||||||
if (!m)
|
if (!m)
|
||||||
@ -20,12 +20,6 @@ m_alloc()
|
|||||||
return m;
|
return m;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct mbuf *
|
|
||||||
m_gethdr(int how, int type)
|
|
||||||
{
|
|
||||||
return m_alloc();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
m_clget(struct mbuf * m, int how)
|
m_clget(struct mbuf * m, int how)
|
||||||
{
|
{
|
||||||
@ -40,7 +34,7 @@ m_clget(struct mbuf * m, int how)
|
|||||||
void
|
void
|
||||||
m_adj(struct mbuf *mp, int bytes)
|
m_adj(struct mbuf *mp, int bytes)
|
||||||
{
|
{
|
||||||
mp->m_data += bytes;
|
mp->m_data = (char *)mp->m_data + bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -58,7 +52,7 @@ m_freem(struct mbuf *mp)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
ether_input(struct ifnet *ifp, struct mbuf *m)
|
ether_input(struct ifnet *ifp, struct mbuf *m)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|
@ -1914,7 +1914,7 @@ em_initialize_transmit_unit(struct adapter * adapter)
|
|||||||
E1000_WRITE_REG(&adapter->hw, TDT, 0);
|
E1000_WRITE_REG(&adapter->hw, TDT, 0);
|
||||||
|
|
||||||
|
|
||||||
HW_DEBUGOUT2("Base = %x, Length = %x\n",
|
HW_DEBUGOUT2("Base = %lx, Length = %lx\n",
|
||||||
E1000_READ_REG(&adapter->hw, TDBAL),
|
E1000_READ_REG(&adapter->hw, TDBAL),
|
||||||
E1000_READ_REG(&adapter->hw, TDLEN));
|
E1000_READ_REG(&adapter->hw, TDLEN));
|
||||||
|
|
||||||
@ -2846,10 +2846,10 @@ em_print_debug_info(struct adapter *adapter)
|
|||||||
uint8_t *hw_addr = adapter->hw.hw_addr;
|
uint8_t *hw_addr = adapter->hw.hw_addr;
|
||||||
|
|
||||||
printf("em%d: Adapter hardware address = %p \n", unit, hw_addr);
|
printf("em%d: Adapter hardware address = %p \n", unit, hw_addr);
|
||||||
printf("em%d:tx_int_delay = %d, tx_abs_int_delay = %d\n", unit,
|
printf("em%d:tx_int_delay = %ld, tx_abs_int_delay = %ld\n", unit,
|
||||||
E1000_READ_REG(&adapter->hw, TIDV),
|
E1000_READ_REG(&adapter->hw, TIDV),
|
||||||
E1000_READ_REG(&adapter->hw, TADV));
|
E1000_READ_REG(&adapter->hw, TADV));
|
||||||
printf("em%d:rx_int_delay = %d, rx_abs_int_delay = %d\n", unit,
|
printf("em%d:rx_int_delay = %ld, rx_abs_int_delay = %ld\n", unit,
|
||||||
E1000_READ_REG(&adapter->hw, RDTR),
|
E1000_READ_REG(&adapter->hw, RDTR),
|
||||||
E1000_READ_REG(&adapter->hw, RADV));
|
E1000_READ_REG(&adapter->hw, RADV));
|
||||||
#ifdef DBG_STATS
|
#ifdef DBG_STATS
|
||||||
@ -2861,7 +2861,7 @@ em_print_debug_info(struct adapter *adapter)
|
|||||||
printf("em%d: fifo workaround = %lld, fifo_reset = %lld\n", unit,
|
printf("em%d: fifo workaround = %lld, fifo_reset = %lld\n", unit,
|
||||||
(long long)adapter->tx_fifo_wrk,
|
(long long)adapter->tx_fifo_wrk,
|
||||||
(long long)adapter->tx_fifo_reset);
|
(long long)adapter->tx_fifo_reset);
|
||||||
printf("em%d: hw tdh = %d, hw tdt = %d\n", unit,
|
printf("em%d: hw tdh = %ld, hw tdt = %ld\n", unit,
|
||||||
E1000_READ_REG(&adapter->hw, TDH),
|
E1000_READ_REG(&adapter->hw, TDH),
|
||||||
E1000_READ_REG(&adapter->hw, TDT));
|
E1000_READ_REG(&adapter->hw, TDT));
|
||||||
printf("em%d: Num Tx descriptors avail = %d\n", unit,
|
printf("em%d: Num Tx descriptors avail = %d\n", unit,
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
*/
|
*/
|
||||||
#include "if_em_osdep.h"
|
#include "if_em_osdep.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
#include "util.h"
|
||||||
|
|
||||||
#undef malloc
|
#undef malloc
|
||||||
#undef free
|
#undef free
|
||||||
@ -34,7 +35,7 @@ contigfree(void *p, int p1, int p2)
|
|||||||
delete_area(area_for(p));
|
delete_area(area_for(p));
|
||||||
}
|
}
|
||||||
|
|
||||||
int32
|
static int32
|
||||||
timer_dispatch_hook(timer *t)
|
timer_dispatch_hook(timer *t)
|
||||||
{
|
{
|
||||||
struct callout_handle *h = (struct callout_handle *)t;
|
struct callout_handle *h = (struct callout_handle *)t;
|
||||||
|
@ -73,8 +73,15 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#define splx(s)
|
#define splx(s)
|
||||||
#define splimp() 0
|
#define splimp() 0
|
||||||
|
|
||||||
#define bzero(d,c) memset(d,0,c)
|
#ifndef bzero
|
||||||
#define bcopy(s,d,c) memmove(d,s,c)
|
#define bzero(d,c) memset((d), (0), (c))
|
||||||
|
#endif
|
||||||
|
#ifndef bcopy
|
||||||
|
#define bcopy(s,d,c) memmove((d), (s), (c))
|
||||||
|
#endif
|
||||||
|
#ifndef bcmp
|
||||||
|
#define bcmp(p1, p2, s) memcmp((p1), (p2), (s)) // XXX correct order?
|
||||||
|
#endif
|
||||||
|
|
||||||
#define TUNABLE_INT(a, b) /* ignored */
|
#define TUNABLE_INT(a, b) /* ignored */
|
||||||
|
|
||||||
@ -141,7 +148,7 @@ static inline unsigned long vtophys(unsigned long virtual_addr)
|
|||||||
{
|
{
|
||||||
physical_entry pe;
|
physical_entry pe;
|
||||||
if (get_memory_map((void *)virtual_addr, 2048, &pe, 1) < 0) {
|
if (get_memory_map((void *)virtual_addr, 2048, &pe, 1) < 0) {
|
||||||
TRACE("get_memory_map failed for %p\n", virtual_addr);
|
TRACE("get_memory_map failed for %p\n", (void *)virtual_addr);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return (unsigned long) pe.address;
|
return (unsigned long) pe.address;
|
||||||
@ -193,9 +200,10 @@ void bus_teardown_intr(device_t dev, struct resource *res, void *tag);
|
|||||||
void *driver_malloc(int size, int p2, int p3);
|
void *driver_malloc(int size, int p2, int p3);
|
||||||
void driver_free(void *p, int p2);
|
void driver_free(void *p, int p2);
|
||||||
|
|
||||||
|
/* GCC will always emit a read opcode when reading from */
|
||||||
|
/* a volatile poitner, even if the result is unused */
|
||||||
#define E1000_WRITE_FLUSH(a) \
|
#define E1000_WRITE_FLUSH(a) \
|
||||||
do { volatile uint32 dummy = E1000_READ_REG(a, STATUS); } while (0)
|
E1000_READ_REG(a, STATUS)
|
||||||
|
|
||||||
/* Read from an absolute offset in the adapter's memory space */
|
/* Read from an absolute offset in the adapter's memory space */
|
||||||
#define E1000_READ_OFFSET(hw, offset) \
|
#define E1000_READ_OFFSET(hw, offset) \
|
||||||
|
@ -15,7 +15,7 @@ void *chunk_pool = 0;
|
|||||||
void *mbuf_head = 0;
|
void *mbuf_head = 0;
|
||||||
void *chunk_head = 0;
|
void *chunk_head = 0;
|
||||||
|
|
||||||
void *
|
static void *
|
||||||
area_malloc(int size)
|
area_malloc(int size)
|
||||||
{
|
{
|
||||||
void *p;
|
void *p;
|
||||||
@ -26,7 +26,7 @@ area_malloc(int size)
|
|||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
area_free(void *p)
|
area_free(void *p)
|
||||||
{
|
{
|
||||||
delete_area(area_for(p));
|
delete_area(area_for(p));
|
||||||
@ -74,14 +74,14 @@ mempool_init(int count)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
mempool_exit()
|
mempool_exit(void)
|
||||||
{
|
{
|
||||||
area_free(chunk_pool);
|
area_free(chunk_pool);
|
||||||
area_free(mbuf_pool);
|
area_free(mbuf_pool);
|
||||||
}
|
}
|
||||||
|
|
||||||
void *
|
void *
|
||||||
mbuf_pool_get()
|
mbuf_pool_get(void)
|
||||||
{
|
{
|
||||||
void *p;
|
void *p;
|
||||||
cpu_status s;
|
cpu_status s;
|
||||||
@ -112,7 +112,7 @@ mbuf_pool_put(void *p)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void *
|
void *
|
||||||
chunk_pool_get()
|
chunk_pool_get(void)
|
||||||
{
|
{
|
||||||
void *p;
|
void *p;
|
||||||
cpu_status s;
|
cpu_status s;
|
||||||
|
@ -5,10 +5,10 @@
|
|||||||
#define __MEMPOOL_H
|
#define __MEMPOOL_H
|
||||||
|
|
||||||
int mempool_init(int count);
|
int mempool_init(int count);
|
||||||
void mempool_exit();
|
void mempool_exit(void);
|
||||||
|
|
||||||
void *mbuf_pool_get();
|
void *mbuf_pool_get(void);
|
||||||
void *chunk_pool_get();
|
void *chunk_pool_get(void);
|
||||||
|
|
||||||
void chunk_pool_put(void *p);
|
void chunk_pool_put(void *p);
|
||||||
void mbuf_pool_put(void *p);
|
void mbuf_pool_put(void *p);
|
||||||
|
Loading…
Reference in New Issue
Block a user