From 7aff6d8ed3abaade70dbae63504df473d568ce81 Mon Sep 17 00:00:00 2001 From: Kip Macy Date: Fri, 17 Aug 2007 05:57:04 +0000 Subject: [PATCH] forward port signedness fixes from RELENG_6 fix compile error for case where MSI_SUPPORTED not defined Approved by: re (blanket) --- sys/dev/cxgb/common/cxgb_t3_hw.c | 2 +- sys/dev/cxgb/cxgb_adapter.h | 2 +- sys/dev/cxgb/cxgb_ioctl.h | 2 +- sys/dev/cxgb/cxgb_l2t.c | 5 +++-- sys/dev/cxgb/cxgb_l2t.h | 11 +++++++++++ sys/dev/cxgb/cxgb_main.c | 9 ++++++--- sys/dev/cxgb/cxgb_offload.c | 2 +- sys/dev/cxgb/cxgb_offload.h | 2 +- sys/dev/cxgb/cxgb_sge.c | 14 ++++++-------- 9 files changed, 31 insertions(+), 18 deletions(-) diff --git a/sys/dev/cxgb/common/cxgb_t3_hw.c b/sys/dev/cxgb/common/cxgb_t3_hw.c index a8d9e113f7e..69e0e83353f 100644 --- a/sys/dev/cxgb/common/cxgb_t3_hw.c +++ b/sys/dev/cxgb/common/cxgb_t3_hw.c @@ -501,7 +501,7 @@ static struct port_type_info port_types[] = { #undef CAPS_10G #define VPD_ENTRY(name, len) \ - u8 name##_kword[2]; u8 name##_len; u8 name##_data[len] + u8 name##_kword[2]; u8 name##_len; char name##_data[len] /* * Partial EEPROM Vital Product Data structure. Includes only the ID and diff --git a/sys/dev/cxgb/cxgb_adapter.h b/sys/dev/cxgb/cxgb_adapter.h index 6edef64a4c3..6605ea9693e 100644 --- a/sys/dev/cxgb/cxgb_adapter.h +++ b/sys/dev/cxgb/cxgb_adapter.h @@ -310,7 +310,7 @@ struct adapter { TAILQ_ENTRY(adapter) adapter_entry; /* PCI register resources */ - uint32_t regs_rid; + int regs_rid; struct resource *regs_res; bus_space_handle_t bh; bus_space_tag_t bt; diff --git a/sys/dev/cxgb/cxgb_ioctl.h b/sys/dev/cxgb/cxgb_ioctl.h index 21d3cce8c4c..65deb447da3 100644 --- a/sys/dev/cxgb/cxgb_ioctl.h +++ b/sys/dev/cxgb/cxgb_ioctl.h @@ -128,7 +128,7 @@ struct ch_hw_sched { int8_t channel; int32_t kbps; /* rate in Kbps */ int32_t class_ipg; /* tenths of nanoseconds */ - int32_t flow_ipg; /* usec */ + uint32_t flow_ipg; /* usec */ }; struct ch_filter_tuple { diff --git a/sys/dev/cxgb/cxgb_l2t.c b/sys/dev/cxgb/cxgb_l2t.c index 046132da85d..d4a40bad430 100644 --- a/sys/dev/cxgb/cxgb_l2t.c +++ b/sys/dev/cxgb/cxgb_l2t.c @@ -37,8 +37,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#if __FreeBSD_version > 700000 #include - +#endif #include #include @@ -58,7 +59,7 @@ __FBSDID("$FreeBSD$"); #define VLAN_NONE 0xfff #define SDL(s) ((struct sockaddr_dl *)s) -#define RT_ENADDR(rt) ((char *)LLADDR(SDL((rt)))) +#define RT_ENADDR(rt) ((u_char *)LLADDR(SDL((rt)))) #define rt_expire rt_rmx.rmx_expire struct llinfo_arp { diff --git a/sys/dev/cxgb/cxgb_l2t.h b/sys/dev/cxgb/cxgb_l2t.h index a690c77491e..0944f623a54 100644 --- a/sys/dev/cxgb/cxgb_l2t.h +++ b/sys/dev/cxgb/cxgb_l2t.h @@ -33,7 +33,18 @@ $FreeBSD$ #include #include + +#if __FreeBSD_version > 700000 #include +#else +#define rwlock mtx +#define rw_wlock(x) mtx_lock((x)) +#define rw_wunlock(x) mtx_unlock((x)) +#define rw_rlock(x) mtx_lock((x)) +#define rw_runlock(x) mtx_unlock((x)) +#define rw_init(x, str) mtx_init((x), (str), NULL, MTX_DEF) +#define rw_destroy(x) mtx_destroy((x)) +#endif enum { L2T_STATE_VALID, /* entry is up to date */ diff --git a/sys/dev/cxgb/cxgb_main.c b/sys/dev/cxgb/cxgb_main.c index f8cee4b59fd..ef10aabc3e4 100644 --- a/sys/dev/cxgb/cxgb_main.c +++ b/sys/dev/cxgb/cxgb_main.c @@ -384,10 +384,12 @@ cxgb_controller_attach(device_t dev) device_t child; const struct adapter_info *ai; struct adapter *sc; - int i, reg, msi_needed, error = 0; + int i, reg, error = 0; uint32_t vers; int port_qsets = 1; - +#ifdef MSI_SUPPORTED + int msi_needed; +#endif sc = device_get_softc(dev); sc->dev = dev; sc->msi_count = 0; @@ -935,6 +937,7 @@ cxgb_makedev(struct port_info *pi) /* Don't enable TSO6 yet */ #define CXGB_CAP_ENABLE (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_JUMBO_MTU) #define IFCAP_TSO4 0x0 +#define IFCAP_TSO6 0x0 #define CSUM_TSO 0x0 #endif @@ -1038,7 +1041,7 @@ cxgb_port_attach(device_t dev) taskqueue_thread_enqueue, &p->tq); #else /* Create a port for handling TX without starvation */ - p->tq = taskqueue_create_fast(buf, M_NOWAIT, + p->tq = taskqueue_create_fast(p->taskqbuf, M_NOWAIT, taskqueue_thread_enqueue, &p->tq); #endif diff --git a/sys/dev/cxgb/cxgb_offload.c b/sys/dev/cxgb/cxgb_offload.c index 6356a94145d..991fb7e96a6 100644 --- a/sys/dev/cxgb/cxgb_offload.c +++ b/sys/dev/cxgb/cxgb_offload.c @@ -596,7 +596,7 @@ cxgb_remove_tid(struct toedev *tdev, void *ctx, unsigned int tid) BUG_ON(tid >= t->ntids); if (tdev->type == T3A) - atomic_cmpset_ptr((long *)&t->tid_tab[tid].ctx, (long)NULL, (long)ctx); + atomic_cmpset_ptr((uintptr_t *)&t->tid_tab[tid].ctx, (long)NULL, (long)ctx); else { struct mbuf *m; diff --git a/sys/dev/cxgb/cxgb_offload.h b/sys/dev/cxgb/cxgb_offload.h index 131640afa5f..62ecfa8183c 100644 --- a/sys/dev/cxgb/cxgb_offload.h +++ b/sys/dev/cxgb/cxgb_offload.h @@ -149,7 +149,7 @@ union active_open_entry { struct tid_info { struct toe_tid_entry *tid_tab; unsigned int ntids; - volatile int tids_in_use; + volatile unsigned int tids_in_use; union listen_entry *stid_tab; unsigned int nstids; diff --git a/sys/dev/cxgb/cxgb_sge.c b/sys/dev/cxgb/cxgb_sge.c index f3652e8d4ac..0a1d3eef62f 100644 --- a/sys/dev/cxgb/cxgb_sge.c +++ b/sys/dev/cxgb/cxgb_sge.c @@ -1168,8 +1168,8 @@ t3_encap(struct port_info *p, struct mbuf **m) struct sge_txq *txq; struct tx_sw_desc *stx; struct txq_state txqs; - unsigned int nsegs, ndesc, flits, cntrl, mlen; - int err, tso_info = 0; + unsigned int ndesc, flits, cntrl, mlen; + int err, nsegs, tso_info = 0; struct work_request_hdr *wrp; struct tx_sw_desc *txsd; @@ -1212,7 +1212,7 @@ t3_encap(struct port_info *p, struct mbuf **m) struct cpl_tx_pkt_lso *hdr = (struct cpl_tx_pkt_lso *) cpl; struct ip *ip; struct tcphdr *tcp; - uint8_t *pkthdr, tmp[TCPPKTHDRSIZE]; /* is this too large for the stack? */ + char *pkthdr, tmp[TCPPKTHDRSIZE]; /* is this too large for the stack? */ txd->flit[2] = 0; cntrl |= V_TXPKT_OPCODE(CPL_TX_PKT_LSO); @@ -1222,7 +1222,7 @@ t3_encap(struct port_info *p, struct mbuf **m) pkthdr = &tmp[0]; m_copydata(m0, 0, TCPPKTHDRSIZE, pkthdr); } else { - pkthdr = mtod(m0, uint8_t *); + pkthdr = mtod(m0, char *); } if (__predict_false(m0->m_flags & M_VLANTAG)) { @@ -1792,12 +1792,10 @@ calc_tx_descs_ofld(struct mbuf *m, unsigned int nsegs) static int ofld_xmit(adapter_t *adap, struct sge_txq *q, struct mbuf *m) { - int ret; - unsigned int pidx, gen, nsegs; - unsigned int ndesc; + unsigned int pidx, gen, ndesc; struct mbuf *m_vec[TX_CLEAN_MAX_DESC]; bus_dma_segment_t segs[TX_MAX_SEGS]; - int i, cleaned; + int i, cleaned, ret, nsegs; struct tx_sw_desc *stx = &q->sdesc[q->pidx]; mtx_lock(&q->lock);