diff --git a/sys/dev/firewire/firewire.c b/sys/dev/firewire/firewire.c index fb6af5750b21..e18bb8e113e4 100644 --- a/sys/dev/firewire/firewire.c +++ b/sys/dev/firewire/firewire.c @@ -1843,7 +1843,11 @@ fw_rcv(struct firewire_comm* fc, caddr_t buf, u_int len, u_int sub, u_int off, u bind = fw_bindlookup(fc, ntohs(fp->mode.rreqq.dest_hi), ntohl(fp->mode.rreqq.dest_lo)); if(bind == NULL){ +#if __FreeBSD_version >= 500000 printf("Unknown service addr 0x%08x:0x%08x tcode=%x\n", +#else + printf("Unknown service addr 0x%08x:0x%08lx tcode=%x\n", +#endif ntohs(fp->mode.rreqq.dest_hi), ntohl(fp->mode.rreqq.dest_lo), fp->mode.common.tcode); diff --git a/sys/dev/firewire/fwohci.c b/sys/dev/firewire/fwohci.c index 62876065a20c..ea8532e7fd4e 100644 --- a/sys/dev/firewire/fwohci.c +++ b/sys/dev/firewire/fwohci.c @@ -2073,7 +2073,11 @@ print_db(volatile struct fwohcidb *db, u_int32_t ch, u_int32_t max) "Cnt"); for( i = 0 ; i <= max ; i ++){ key = db[i].db.desc.cmd & OHCI_KEY_MASK; +#if __FreeBSD_version >= 500000 printf("%08tx %s %s %s %s %5d %08x %08x %04x:%04x", +#else + printf("%08x %s %s %s %s %5d %08x %08x %04x:%04x", +#endif vtophys(&db[i]), dbcode[(db[i].db.desc.cmd >> 28) & 0xf], dbkey[(db[i].db.desc.cmd >> 24) & 0x7], diff --git a/sys/dev/firewire/if_fwe.c b/sys/dev/firewire/if_fwe.c index 41f036166ef7..49722fee36a9 100644 --- a/sys/dev/firewire/if_fwe.c +++ b/sys/dev/firewire/if_fwe.c @@ -193,12 +193,18 @@ fwe_attach(device_t dev) ifp->if_snd.ifq_maxlen = FWMAXQUEUE - 1; s = splimp(); +#if __FreeBSD_version >= 500000 ether_ifattach(ifp, eaddr); +#else + ether_ifattach(ifp, 1); +#endif splx(s); /* Tell the upper layer(s) we support long frames. */ ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header); +#if __FreeBSD_version >= 500000 ifp->if_capabilities |= IFCAP_VLAN_MTU; +#endif ifp->if_snd.ifq_maxlen = MAX_QUEUED - 1; @@ -241,7 +247,11 @@ fwe_detach(device_t dev) s = splimp(); fwe_stop(fwe); +#if __FreeBSD_version >= 500000 ether_ifdetach(&fwe->fwe_if); +#else + ether_ifdetach(&fwe->fwe_if, 1); +#endif splx(s); return 0; @@ -328,7 +338,7 @@ fwe_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) break; case SIOCADDMULTI: case SIOCDELMULTI: - break; + break; case SIOCGIFSTATUS: s = splimp(); @@ -340,13 +350,22 @@ fwe_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) "\tch %d dma %d\n", fwe->stream_ch, fwe->dma_ch); splx(s); - break; - + break; +#if __FreeBSD_version >= 500000 default: +#else + case SIOCSIFADDR: + case SIOCGIFADDR: + case SIOCSIFMTU: +#endif s = splimp(); error = ether_ioctl(ifp, cmd, data); splx(s); return (error); +#if __FreeBSD_version < 500000 + default: + return (EINVAL); +#endif } return (0); @@ -432,7 +451,12 @@ fwe_as_output(struct fwe_softc *fwe, struct ifnet *ifp) if (xfer == NULL) { return; } +#if __FreeBSD_version >= 500000 BPF_MTAP(ifp, m); +#else + if (ifp->if_bpf != NULL) + bpf_mtap(ifp, m); +#endif xfer->send.off = 0; xfer->spd = 2; @@ -540,7 +564,13 @@ fwe_as_input(struct fw_xferq *xferq) #endif p = xfer->recv.buf + xfer->recv.off + HDR_LEN + ALIGN_PAD; eh = (struct ether_header *)p; +#if __FreeBSD_version >= 500000 len -= xfer->recv.off + HDR_LEN + ALIGN_PAD; +#else + p += sizeof(struct ether_header); + len -= xfer->recv.off + HDR_LEN + ALIGN_PAD + + sizeof(struct ether_header); +#endif m->m_data = p; m->m_len = m->m_pkthdr.len = len; m->m_pkthdr.rcvif = ifp; @@ -560,7 +590,11 @@ fwe_as_input(struct fw_xferq *xferq) c[20], c[21], c[22], c[23] ); #endif +#if __FreeBSD_version >= 500000 (*ifp->if_input)(ifp, m); +#else + ether_input(ifp, eh, m); +#endif ifp->if_ipackets ++; xfer->recv.buf = NULL; diff --git a/sys/dev/firewire/sbp.c b/sys/dev/firewire/sbp.c index ed53d03891cc..9954778934ec 100644 --- a/sys/dev/firewire/sbp.c +++ b/sys/dev/firewire/sbp.c @@ -1353,7 +1353,11 @@ SBP_DEBUG(0) sbp_show_sdev_info(sdev, 2); printf("ORB status src:%x resp:%x dead:%x" +#if __FreeBSD_version >= 500000 " len:%x stat:%x orb:%x%08x\n", +#else + " len:%x stat:%x orb:%x%08lx\n", +#endif sbp_status->src, sbp_status->resp, sbp_status->dead, sbp_status->len, sbp_status->status, ntohs(sbp_status->orb_hi), ntohl(sbp_status->orb_lo)); @@ -2024,7 +2028,11 @@ sbp_execute_ocb(void *arg, bus_dma_segment_t *segments, int seg, int error) SBP_DEBUG(1) printf("sbp_execute_ocb: seg %d", seg); for (i = 0; i < seg; i++) +#if __FreeBSD_version >= 500000 printf(", %tx:%zd", segments[i].ds_addr, +#else + printf(", %x:%zd", segments[i].ds_addr, +#endif segments[i].ds_len); printf("\n"); END_DEBUG @@ -2068,7 +2076,11 @@ sbp_dequeue_ocb(struct sbp_dev *sdev, u_int32_t orb_lo) next = STAILQ_NEXT(ocb, ocb); flags = ocb->flags; SBP_DEBUG(1) +#if __FreeBSD_version >= 500000 printf("orb: 0x%tx next: 0x%x, flags %x\n", +#else + printf("orb: 0x%x next: 0x%lx, flags %x\n", +#endif vtophys(&ocb->orb[0]), ntohl(ocb->orb[1]), flags); END_DEBUG if (vtophys(&ocb->orb[0]) == orb_lo) { @@ -2114,7 +2126,11 @@ sbp_enqueue_ocb(struct sbp_dev *sdev, struct sbp_ocb *ocb) SBP_DEBUG(2) sbp_show_sdev_info(sdev, 2); +#if __FreeBSD_version >= 500000 printf("sbp_enqueue_ocb orb=0x%tx in physical memory\n", vtophys(&ocb->orb[0])); +#else + printf("sbp_enqueue_ocb orb=0x%x in physical memory\n", vtophys(&ocb->orb[0])); +#endif END_DEBUG prev = STAILQ_LAST(&sdev->ocbs, sbp_ocb, ocb); STAILQ_INSERT_TAIL(&sdev->ocbs, ocb, ocb); @@ -2127,7 +2143,11 @@ END_DEBUG && ((prev->flags & OCB_ACT_MASK) == OCB_ACT_CMD) && ((ocb->flags & OCB_ACT_MASK) == OCB_ACT_CMD)) { SBP_DEBUG(1) +#if __FreeBSD_version >= 500000 printf("linking chain 0x%tx -> 0x%tx\n", vtophys(&prev->orb[0]), +#else + printf("linking chain 0x%x -> 0x%x\n", vtophys(&prev->orb[0]), +#endif vtophys(&ocb->orb[0])); END_DEBUG prev->flags |= OCB_RESERVED;