diff --git a/net/aoe/Makefile b/net/aoe/Makefile index 1ad2f1cf6e69..4a1e523107f2 100644 --- a/net/aoe/Makefile +++ b/net/aoe/Makefile @@ -1,29 +1,29 @@ PORTNAME= aoe PORTVERSION= 1.2.0 -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES= net MASTER_SITES= https://people.freebsd.org/~sson/aoe/ DISTNAME= ${PORTNAME}-freebsd-${PORTVERSION} MAINTAINER= ports@FreeBSD.org COMMENT= FreeBSD driver for ATA over Ethernet (AoE) WWW= https://web.archive.org/web/20120420082041/http://www.coraid.com/support/freebsd/ LICENSE= BSD2CLAUSE BROKEN_armv6= fails to compile: implicit declaration of function 'cp15_pmccntr_get' is invalid in C99 BROKEN_FreeBSD_13= crashes dereferencing vnet_entry_ifnet BROKEN_FreeBSD_14= crashes dereferencing vnet_entry_ifnet USES= kmod uidfix USE_RC_SUBR= aoe WRKSRC= ${WRKDIR}/dev/aoe PLIST_FILES= share/man/man4/aoe.4.gz \ ${KMODDIR}/aoe.ko post-install: ${INSTALL_MAN} ${WRKDIR}/aoe.4 ${STAGEDIR}${PREFIX}/share/man/man4/ .include diff --git a/net/aoe/files/patch-aoeblk.c b/net/aoe/files/patch-aoeblk.c new file mode 100644 index 000000000000..7c096292da89 --- /dev/null +++ b/net/aoe/files/patch-aoeblk.c @@ -0,0 +1,23 @@ +--- aoeblk.c.orig 2024-01-03 00:56:10 UTC ++++ aoeblk.c +@@ -114,7 +114,7 @@ aoeblk_ioctl(struct disk *disk, u_long cmd, void *vp, + { + struct ata_ioc_request *iocmd; + struct aoedev *d; +- int n; ++ int error, n; + + if (cmd != IOCATAREQUEST) { + IPRINTK("cmd %ld not IOCATA.\n", cmd); +@@ -153,9 +153,9 @@ aoeblk_ioctl(struct disk *disk, u_long cmd, void *vp, + + switch (iocmd->ata_ioc_request_ata.command) { + case ATA_ATA_IDENTIFY: +- copyout(d->ad_ident, iocmd->ata_ioc_request_data, sizeof d->ad_ident); ++ error = copyout(d->ad_ident, iocmd->ata_ioc_request_data, sizeof d->ad_ident); + mtx_unlock(&d->ad_mtx); +- return (0); ++ return (error); + case ATA_SMART: + if (iocmd->ata_ioc_request_ata.feature != ATA_SMART_ATTR_AUTOSAVE) { + n = aoecmd_ata_smart(d, iocmd); diff --git a/net/aoe/files/patch-aoecmd.c b/net/aoe/files/patch-aoecmd.c index 6868561e5ffb..7a8694ee7c81 100644 --- a/net/aoe/files/patch-aoecmd.c +++ b/net/aoe/files/patch-aoecmd.c @@ -1,57 +1,95 @@ ---- aoecmd.c.orig 2006-05-26 00:13:09.000000000 +0700 -+++ aoecmd.c 2010-09-13 20:15:55.000000000 +0700 -@@ -44,6 +44,7 @@ +--- aoecmd.c.orig 2006-05-25 17:13:09 UTC ++++ aoecmd.c +@@ -44,6 +44,7 @@ __FBSDID("$FreeBSD: src/sys/dev/aoe/aoecmd.c,v 1.23.2. #include #include #include +#include #include -@@ -427,29 +428,6 @@ +@@ -197,12 +198,11 @@ rexmit(struct aoedev *d, struct frame *f) + { + /* struct mbuf *m; */ + struct aoe_hdr *h; +- struct aoe_atahdr *ah; + + h = (struct aoe_hdr *) f->f_hdr; +- ah = (struct aoe_atahdr *) (h+1); + + #ifdef AOE_DEBUG ++ struct aoe_atahdr *ah = (struct aoe_atahdr *) (h+1); + + IPRINTK("mlen=%ld verfl=%X major=%X minor=%X cmd=%X\n" + "\ttag=%lX aflags=%X errfeat=%X scnt=%X cmdstat=%X\n" +@@ -427,29 +427,6 @@ loop: goto loop; } -static u_short -lhget16(u_char *p) -{ - u_short n; - - n = p[1]; - n <<= 8; - n |= p[0]; - return (n); -} - -static u_long -lhget32(u_char *p) -{ - u_long n; - - n = lhget16(p+2); - n <<= 16; - n |= lhget16(p); - return (n); -} - - static void ataid_complete(struct aoedev *d, char *id) { -@@ -457,13 +435,13 @@ +@@ -457,13 +434,13 @@ ataid_complete(struct aoedev *d, char *id) memcpy(d->ad_ident, id, sizeof d->ad_ident); - n = lhget16(id + (83<<1)); /* Command set supported. */ + n = le16toh(*(uint16_t *) (id + (83<<1))); /* Command set supported. */ if (n & (1<<10)) { /* Lba48 */ atomic_set_32(&d->ad_flags, DEVFL_EXT); - d->ad_nsectors = lhget32(id + (100<<1)); /* n lba48 sectors. */ + d->ad_nsectors = le64toh(*(uint64_t *) (id + (100<<1))); /* n lba48 sectors. */ } else { atomic_clear_32(&d->ad_flags, DEVFL_EXT); - d->ad_nsectors = lhget32(id + (60<<1)); /* n lba28 sectors. */ + d->ad_nsectors = le32toh(*(uint32_t *) (id + (60<<1))); /* n lba28 sectors. */ } if (aoeblk_register(d) != 0) IPRINTK("could not register disk\n"); +@@ -614,7 +591,7 @@ aoecmd_ata_smart(struct aoedev *d, struct ata_ioc_requ + struct aoe_hdr *h; + struct aoe_atahdr *ah; + register daddr_t lba; +- int timeout; ++ int error, timeout; + + timeout = iocmd->ata_ioc_request_timeout; + +@@ -664,10 +641,12 @@ aoecmd_ata_smart(struct aoedev *d, struct ata_ioc_requ + iocmd->ata_ioc_request_ata.lba = lba; + + if (iocmd->ata_ioc_request_flags == ATA_CMD_READ) +- copyout(ah+1, iocmd->ata_ioc_request_data, iocmd->ata_ioc_request_count); ++ error = copyout(ah+1, iocmd->ata_ioc_request_data, iocmd->ata_ioc_request_count); ++ else ++ error = 0; + + f->f_tag = FREETAG; +- return (0); ++ return (error); + } + + /* Set the write caching. */