Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Aug 2023 22:26:13 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: b2c44f1fc1c6 - main - cam: Remove non-sbuf announce/denounce proto and xport ops
Message-ID:  <202308012226.371MQDVJ045667@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=b2c44f1fc1c68dfb8a0a1f14f035241f6b96f30f

commit b2c44f1fc1c68dfb8a0a1f14f035241f6b96f30f
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2023-08-01 22:25:38 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2023-08-01 22:25:38 +0000

    cam: Remove non-sbuf announce/denounce proto and xport ops
    
    Reviewed by:    mav, imp
    Sponsored by:   Chelsio Communications
    Differential Revision:  https://reviews.freebsd.org/D41264
---
 sys/cam/ata/ata_xpt.c      | 89 ----------------------------------------------
 sys/cam/cam_xpt_internal.h |  3 --
 sys/cam/mmc/mmc_xpt.c      | 48 -------------------------
 sys/cam/nvme/nvme_xpt.c    | 42 ----------------------
 sys/cam/scsi/scsi_xpt.c    | 75 --------------------------------------
 5 files changed, 257 deletions(-)

diff --git a/sys/cam/ata/ata_xpt.c b/sys/cam/ata/ata_xpt.c
index 2b2fec06a06a..55aa5e346daa 100644
--- a/sys/cam/ata/ata_xpt.c
+++ b/sys/cam/ata/ata_xpt.c
@@ -188,16 +188,11 @@ static void	 ata_dev_async(uint32_t async_code,
 				struct cam_ed *device,
 				void *async_arg);
 static void	 ata_action(union ccb *start_ccb);
-static void	 ata_announce_periph(struct cam_periph *periph);
 static void	 ata_announce_periph_sbuf(struct cam_periph *periph, struct sbuf *sb);
-static void	 ata_proto_announce(struct cam_ed *device);
 static void	 ata_proto_announce_sbuf(struct cam_ed *device, struct sbuf *sb);
-static void	 ata_proto_denounce(struct cam_ed *device);
 static void	 ata_proto_denounce_sbuf(struct cam_ed *device, struct sbuf *sb);
 static void	 ata_proto_debug_out(union ccb *ccb);
-static void	 semb_proto_announce(struct cam_ed *device);
 static void	 semb_proto_announce_sbuf(struct cam_ed *device, struct sbuf *sb);
-static void	 semb_proto_denounce(struct cam_ed *device);
 static void	 semb_proto_denounce_sbuf(struct cam_ed *device, struct sbuf *sb);
 
 static int ata_dma = 1;
@@ -210,7 +205,6 @@ static struct xpt_xport_ops ata_xport_ops = {
 	.alloc_device = ata_alloc_device,
 	.action = ata_action,
 	.async = ata_dev_async,
-	.announce = ata_announce_periph,
 	.announce_sbuf = ata_announce_periph_sbuf,
 };
 #define ATA_XPT_XPORT(x, X)			\
@@ -227,9 +221,7 @@ ATA_XPT_XPORT(sata, SATA);
 #undef ATA_XPORT_XPORT
 
 static struct xpt_proto_ops ata_proto_ops_ata = {
-	.announce = ata_proto_announce,
 	.announce_sbuf = ata_proto_announce_sbuf,
-	.denounce = ata_proto_denounce,
 	.denounce_sbuf = ata_proto_denounce_sbuf,
 	.debug_out = ata_proto_debug_out,
 };
@@ -240,9 +232,7 @@ static struct xpt_proto ata_proto_ata = {
 };
 
 static struct xpt_proto_ops ata_proto_ops_satapm = {
-	.announce = ata_proto_announce,
 	.announce_sbuf = ata_proto_announce_sbuf,
-	.denounce = ata_proto_denounce,
 	.denounce_sbuf = ata_proto_denounce_sbuf,
 	.debug_out = ata_proto_debug_out,
 };
@@ -253,9 +243,7 @@ static struct xpt_proto ata_proto_satapm = {
 };
 
 static struct xpt_proto_ops ata_proto_ops_semb = {
-	.announce = semb_proto_announce,
 	.announce_sbuf = semb_proto_announce_sbuf,
-	.denounce = semb_proto_denounce,
 	.denounce_sbuf = semb_proto_denounce_sbuf,
 	.debug_out = ata_proto_debug_out,
 };
@@ -2133,59 +2121,6 @@ _ata_announce_periph(struct cam_periph *periph, struct ccb_trans_settings *cts,
 	}
 }
 
-static void
-ata_announce_periph(struct cam_periph *periph)
-{
-	struct ccb_trans_settings cts;
-	u_int speed, mb;
-
-	bzero(&cts, sizeof(cts));
-	_ata_announce_periph(periph, &cts, &speed);
-	if ((cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP)
-		return;
-
-	mb = speed / 1000;
-	if (mb > 0)
-		printf("%s%d: %d.%03dMB/s transfers",
-		       periph->periph_name, periph->unit_number,
-		       mb, speed % 1000);
-	else
-		printf("%s%d: %dKB/s transfers", periph->periph_name,
-		       periph->unit_number, speed);
-	/* Report additional information about connection */
-	if (cts.transport == XPORT_ATA) {
-		struct ccb_trans_settings_pata *pata =
-		    &cts.xport_specific.ata;
-
-		printf(" (");
-		if (pata->valid & CTS_ATA_VALID_MODE)
-			printf("%s, ", ata_mode2string(pata->mode));
-		if ((pata->valid & CTS_ATA_VALID_ATAPI) && pata->atapi != 0)
-			printf("ATAPI %dbytes, ", pata->atapi);
-		if (pata->valid & CTS_ATA_VALID_BYTECOUNT)
-			printf("PIO %dbytes", pata->bytecount);
-		printf(")");
-	}
-	if (cts.transport == XPORT_SATA) {
-		struct ccb_trans_settings_sata *sata =
-		    &cts.xport_specific.sata;
-
-		printf(" (");
-		if (sata->valid & CTS_SATA_VALID_REVISION)
-			printf("SATA %d.x, ", sata->revision);
-		else
-			printf("SATA, ");
-		if (sata->valid & CTS_SATA_VALID_MODE)
-			printf("%s, ", ata_mode2string(sata->mode));
-		if ((sata->valid & CTS_ATA_VALID_ATAPI) && sata->atapi != 0)
-			printf("ATAPI %dbytes, ", sata->atapi);
-		if (sata->valid & CTS_SATA_VALID_BYTECOUNT)
-			printf("PIO %dbytes", sata->bytecount);
-		printf(")");
-	}
-	printf("\n");
-}
-
 static void
 ata_announce_periph_sbuf(struct cam_periph *periph, struct sbuf *sb)
 {
@@ -2245,18 +2180,6 @@ ata_proto_announce_sbuf(struct cam_ed *device, struct sbuf *sb)
 	ata_print_ident_sbuf(&device->ident_data, sb);
 }
 
-static void
-ata_proto_announce(struct cam_ed *device)
-{
-	ata_print_ident(&device->ident_data);
-}
-
-static void
-ata_proto_denounce(struct cam_ed *device)
-{
-	ata_print_ident_short(&device->ident_data);
-}
-
 static void
 ata_proto_denounce_sbuf(struct cam_ed *device, struct sbuf *sb)
 {
@@ -2269,18 +2192,6 @@ semb_proto_announce_sbuf(struct cam_ed *device, struct sbuf *sb)
 	semb_print_ident_sbuf((struct sep_identify_data *)&device->ident_data, sb);
 }
 
-static void
-semb_proto_announce(struct cam_ed *device)
-{
-	semb_print_ident((struct sep_identify_data *)&device->ident_data);
-}
-
-static void
-semb_proto_denounce(struct cam_ed *device)
-{
-	semb_print_ident_short((struct sep_identify_data *)&device->ident_data);
-}
-
 static void
 semb_proto_denounce_sbuf(struct cam_ed *device, struct sbuf *sb)
 {
diff --git a/sys/cam/cam_xpt_internal.h b/sys/cam/cam_xpt_internal.h
index f30ef2aa81b5..0e8302cb74ed 100644
--- a/sys/cam/cam_xpt_internal.h
+++ b/sys/cam/cam_xpt_internal.h
@@ -56,7 +56,6 @@ struct xpt_xport_ops {
 	xpt_release_device_func	reldev;
 	xpt_action_func		action;
 	xpt_dev_async_func	async;
-	xpt_announce_periph_func announce;
 	xpt_announce_periph_sbuf_func announce_sbuf;
 };
 
@@ -75,9 +74,7 @@ typedef void (*xpt_proto_announce_sbuf_func)(struct cam_ed *, struct sbuf *);
 typedef void (*xpt_proto_debug_out_func)(union ccb *);
 
 struct xpt_proto_ops {
-	xpt_proto_announce_func	announce;
 	xpt_proto_announce_sbuf_func	announce_sbuf;
-	xpt_proto_announce_func	denounce;
 	xpt_proto_announce_sbuf_func	denounce_sbuf;
 	xpt_proto_debug_out_func debug_out;
 };
diff --git a/sys/cam/mmc/mmc_xpt.c b/sys/cam/mmc/mmc_xpt.c
index 0930717b0a2a..406b91df2e35 100644
--- a/sys/cam/mmc/mmc_xpt.c
+++ b/sys/cam/mmc/mmc_xpt.c
@@ -73,7 +73,6 @@ static void mmc_dev_async(uint32_t async_code, struct cam_eb *bus,
     struct cam_et *target, struct cam_ed *device, void *async_arg);
 static void	 mmc_action(union ccb *start_ccb);
 static void	 mmc_dev_advinfo(union ccb *start_ccb);
-static void	 mmc_announce_periph(struct cam_periph *periph);
 static void	 mmc_announce_periph_sbuf(struct cam_periph *periph,
     struct sbuf *sb);
 static void	 mmc_scan_lun(struct cam_periph *periph,
@@ -85,9 +84,7 @@ static void	 mmcprobe_start(struct cam_periph *periph, union ccb *start_ccb);
 static void	 mmcprobe_cleanup(struct cam_periph *periph);
 static void	 mmcprobe_done(struct cam_periph *periph, union ccb *done_ccb);
 
-static void mmc_proto_announce(struct cam_ed *device);
 static void mmc_proto_announce_sbuf(struct cam_ed *device, struct sbuf *sb);
-static void mmc_proto_denounce(struct cam_ed *device);
 static void mmc_proto_denounce_sbuf(struct cam_ed *device, struct sbuf *sb);
 static void mmc_proto_debug_out(union ccb *ccb);
 
@@ -151,7 +148,6 @@ static struct xpt_xport_ops mmc_xport_ops = {
 	.alloc_device = mmc_alloc_device,
 	.action = mmc_action,
 	.async = mmc_dev_async,
-	.announce = mmc_announce_periph,
 	.announce_sbuf = mmc_announce_periph_sbuf,
 };
 
@@ -166,9 +162,7 @@ static struct xpt_xport_ops mmc_xport_ops = {
 MMC_XPT_XPORT(mmc, MMCSD);
 
 static struct xpt_proto_ops mmc_proto_ops = {
-	.announce = mmc_proto_announce,
 	.announce_sbuf = mmc_proto_announce_sbuf,
-	.denounce = mmc_proto_denounce,
 	.denounce_sbuf = mmc_proto_denounce_sbuf,
 	.debug_out = mmc_proto_debug_out,
 };
@@ -383,29 +377,6 @@ mmc_dev_advinfo(union ccb *start_ccb)
 	start_ccb->ccb_h.status = CAM_REQ_CMP;
 }
 
-static void
-mmc_announce_periph(struct cam_periph *periph)
-{
-	struct	ccb_pathinq cpi;
-	struct	ccb_trans_settings cts;
-	struct	cam_path *path = periph->path;
-
-	cam_periph_assert(periph, MA_OWNED);
-
-	CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("mmc_announce_periph"));
-
-	memset(&cts, 0, sizeof(cts));
-	xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL);
-	cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS;
-	cts.type = CTS_TYPE_CURRENT_SETTINGS;
-	xpt_action((union ccb*)&cts);
-	if ((cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP)
-		return;
-	xpt_path_inq(&cpi, periph->path);
-	CAM_DEBUG(path, CAM_DEBUG_INFO,
-	    ("XPT info: CLK %04d, ...\n", cts.proto_specific.mmc.ios.clock));
-}
-
 static void
 mmc_announce_periph_sbuf(struct cam_periph *periph, struct sbuf *sb)
 {
@@ -498,31 +469,12 @@ mmc_print_ident(struct mmc_params *ident_data, struct sbuf *sb)
 	}
 }
 
-static void
-mmc_proto_announce(struct cam_ed *device)
-{
-	struct sbuf	sb;
-	char		buffer[256];
-
-	sbuf_new(&sb, buffer, sizeof(buffer), SBUF_FIXEDLEN);
-	mmc_print_ident(&device->mmc_ident_data, &sb);
-	sbuf_finish(&sb);
-	sbuf_putbuf(&sb);
-}
-
 static void
 mmc_proto_announce_sbuf(struct cam_ed *device, struct sbuf *sb)
 {
 	mmc_print_ident(&device->mmc_ident_data, sb);
 }
 
-static void
-mmc_proto_denounce(struct cam_ed *device)
-{
-
-	mmc_proto_announce(device);
-}
-
 static void
 mmc_proto_denounce_sbuf(struct cam_ed *device, struct sbuf *sb)
 {
diff --git a/sys/cam/nvme/nvme_xpt.c b/sys/cam/nvme/nvme_xpt.c
index d2968d1019d1..ad0718bfcf3b 100644
--- a/sys/cam/nvme/nvme_xpt.c
+++ b/sys/cam/nvme/nvme_xpt.c
@@ -156,13 +156,10 @@ static void	 nvme_dev_async(uint32_t async_code,
 				struct cam_ed *device,
 				void *async_arg);
 static void	 nvme_action(union ccb *start_ccb);
-static void	 nvme_announce_periph(struct cam_periph *periph);
 static void	 nvme_announce_periph_sbuf(struct cam_periph *periph,
     struct sbuf *sb);
-static void	 nvme_proto_announce(struct cam_ed *device);
 static void	 nvme_proto_announce_sbuf(struct cam_ed *device,
     struct sbuf *sb);
-static void	 nvme_proto_denounce(struct cam_ed *device);
 static void	 nvme_proto_denounce_sbuf(struct cam_ed *device,
     struct sbuf *sb);
 static void	 nvme_proto_debug_out(union ccb *ccb);
@@ -171,7 +168,6 @@ static struct xpt_xport_ops nvme_xport_ops = {
 	.alloc_device = nvme_alloc_device,
 	.action = nvme_action,
 	.async = nvme_dev_async,
-	.announce = nvme_announce_periph,
 	.announce_sbuf = nvme_announce_periph_sbuf,
 };
 #define NVME_XPT_XPORT(x, X)			\
@@ -187,9 +183,7 @@ NVME_XPT_XPORT(nvme, NVME);
 #undef NVME_XPT_XPORT
 
 static struct xpt_proto_ops nvme_proto_ops = {
-	.announce = nvme_proto_announce,
 	.announce_sbuf = nvme_proto_announce_sbuf,
-	.denounce = nvme_proto_denounce,
 	.denounce_sbuf = nvme_proto_denounce_sbuf,
 	.debug_out = nvme_proto_debug_out,
 };
@@ -827,48 +821,12 @@ nvme_announce_periph_sbuf(struct cam_periph *periph, struct sbuf *sb)
 	sbuf_printf(sb, "\n");
 }
 
-static void
-nvme_announce_periph(struct cam_periph *periph)
-{
-	struct sbuf	sb;
-	char		buffer[120];
-
-	sbuf_new(&sb, buffer, sizeof(buffer), SBUF_FIXEDLEN);
-	nvme_announce_periph_sbuf(periph, &sb);
-	sbuf_finish(&sb);
-	sbuf_putbuf(&sb);
-}
-
-static void
-nvme_proto_announce(struct cam_ed *device)
-{
-	struct sbuf	sb;
-	char		buffer[120];
-
-	sbuf_new(&sb, buffer, sizeof(buffer), SBUF_FIXEDLEN);
-	nvme_print_ident(device->nvme_cdata, device->nvme_data, &sb);
-	sbuf_finish(&sb);
-	sbuf_putbuf(&sb);
-}
-
 static void
 nvme_proto_announce_sbuf(struct cam_ed *device, struct sbuf *sb)
 {
 	nvme_print_ident(device->nvme_cdata, device->nvme_data, sb);
 }
 
-static void
-nvme_proto_denounce(struct cam_ed *device)
-{
-	struct sbuf	sb;
-	char		buffer[120];
-
-	sbuf_new(&sb, buffer, sizeof(buffer), SBUF_FIXEDLEN);
-	nvme_print_ident_short(device->nvme_cdata, device->nvme_data, &sb);
-	sbuf_finish(&sb);
-	sbuf_putbuf(&sb);
-}
-
 static void
 nvme_proto_denounce_sbuf(struct cam_ed *device, struct sbuf *sb)
 {
diff --git a/sys/cam/scsi/scsi_xpt.c b/sys/cam/scsi/scsi_xpt.c
index 619841720bb3..734668995299 100644
--- a/sys/cam/scsi/scsi_xpt.c
+++ b/sys/cam/scsi/scsi_xpt.c
@@ -593,12 +593,9 @@ static void	 scsi_dev_async(uint32_t async_code,
 				struct cam_ed *device,
 				void *async_arg);
 static void	 scsi_action(union ccb *start_ccb);
-static void	 scsi_announce_periph(struct cam_periph *periph);
 static void	 scsi_announce_periph_sbuf(struct cam_periph *periph, struct sbuf *sb);
-static void	 scsi_proto_announce(struct cam_ed *device);
 static void	 scsi_proto_announce_sbuf(struct cam_ed *device,
 					  struct sbuf *sb);
-static void	 scsi_proto_denounce(struct cam_ed *device);
 static void	 scsi_proto_denounce_sbuf(struct cam_ed *device,
 					  struct sbuf *sb);
 static void	 scsi_proto_debug_out(union ccb *ccb);
@@ -608,7 +605,6 @@ static struct xpt_xport_ops scsi_xport_ops = {
 	.alloc_device = scsi_alloc_device,
 	.action = scsi_action,
 	.async = scsi_dev_async,
-	.announce = scsi_announce_periph,
 	.announce_sbuf = scsi_announce_periph_sbuf,
 };
 #define SCSI_XPT_XPORT(x, X)			\
@@ -630,9 +626,7 @@ SCSI_XPT_XPORT(ppb, PPB);
 #undef SCSI_XPORT_XPORT
 
 static struct xpt_proto_ops scsi_proto_ops = {
-	.announce = scsi_proto_announce,
 	.announce_sbuf = scsi_proto_announce_sbuf,
-	.denounce = scsi_proto_denounce,
 	.denounce_sbuf = scsi_proto_denounce_sbuf,
 	.debug_out = scsi_proto_debug_out,
 };
@@ -3150,87 +3144,18 @@ scsi_announce_periph_sbuf(struct cam_periph *periph, struct sbuf *sb)
 	sbuf_printf(sb, "\n");
 }
 
-static void
-scsi_announce_periph(struct cam_periph *periph)
-{
-	struct	ccb_trans_settings cts;
-	u_int speed, freq, mb;
-
-	memset(&cts, 0, sizeof(cts));
-	_scsi_announce_periph(periph, &speed, &freq, &cts);
-	if (cam_ccb_status((union ccb *)&cts) != CAM_REQ_CMP)
-		return;
-
-	mb = speed / 1000;
-	if (mb > 0)
-		printf("%s%d: %d.%03dMB/s transfers",
-		       periph->periph_name, periph->unit_number,
-		       mb, speed % 1000);
-	else
-		printf("%s%d: %dKB/s transfers", periph->periph_name,
-		       periph->unit_number, speed);
-	/* Report additional information about SPI connections */
-	if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_SPI) {
-		struct	ccb_trans_settings_spi *spi;
-
-		spi = &cts.xport_specific.spi;
-		if (freq != 0) {
-			printf(" (%d.%03dMHz%s, offset %d", freq / 1000,
-			       freq % 1000,
-			       (spi->ppr_options & MSG_EXT_PPR_DT_REQ) != 0
-			     ? " DT" : "",
-			       spi->sync_offset);
-		}
-		if ((spi->valid & CTS_SPI_VALID_BUS_WIDTH) != 0
-		 && spi->bus_width > 0) {
-			if (freq != 0) {
-				printf(", ");
-			} else {
-				printf(" (");
-			}
-			printf("%dbit)", 8 * (0x01 << spi->bus_width));
-		} else if (freq != 0) {
-			printf(")");
-		}
-	}
-	if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_FC) {
-		struct	ccb_trans_settings_fc *fc;
-
-		fc = &cts.xport_specific.fc;
-		if (fc->valid & CTS_FC_VALID_WWNN)
-			printf(" WWNN 0x%llx", (long long) fc->wwnn);
-		if (fc->valid & CTS_FC_VALID_WWPN)
-			printf(" WWPN 0x%llx", (long long) fc->wwpn);
-		if (fc->valid & CTS_FC_VALID_PORT)
-			printf(" PortID 0x%x", fc->port);
-	}
-	printf("\n");
-}
-
 static void
 scsi_proto_announce_sbuf(struct cam_ed *device, struct sbuf *sb)
 {
 	scsi_print_inquiry_sbuf(sb, &device->inq_data);
 }
 
-static void
-scsi_proto_announce(struct cam_ed *device)
-{
-	scsi_print_inquiry(&device->inq_data);
-}
-
 static void
 scsi_proto_denounce_sbuf(struct cam_ed *device, struct sbuf *sb)
 {
 	scsi_print_inquiry_short_sbuf(sb, &device->inq_data);
 }
 
-static void
-scsi_proto_denounce(struct cam_ed *device)
-{
-	scsi_print_inquiry_short(&device->inq_data);
-}
-
 static void
 scsi_proto_debug_out(union ccb *ccb)
 {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202308012226.371MQDVJ045667>