Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Jul 2020 17:11:14 +0000 (UTC)
From:      Emmanuel Vadot <manu@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r363479 - head/sys/cam/mmc
Message-ID:  <202007241711.06OHBE7g065127@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: manu
Date: Fri Jul 24 17:11:14 2020
New Revision: 363479
URL: https://svnweb.freebsd.org/changeset/base/363479

Log:
  mmccam: Add some aliases for non-mmccam to mmccam transition
  
  A new tunable is present, kern.cam.sdda.mmcsd_compat to enable
  this feature or not (default is enabled)

Modified:
  head/sys/cam/mmc/mmc_da.c

Modified: head/sys/cam/mmc/mmc_da.c
==============================================================================
--- head/sys/cam/mmc/mmc_da.c	Fri Jul 24 16:58:13 2020	(r363478)
+++ head/sys/cam/mmc/mmc_da.c	Fri Jul 24 17:11:14 2020	(r363479)
@@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/systm.h>
 #include <sys/kernel.h>
 #include <sys/bio.h>
+#include <sys/sysctl.h>
 #include <sys/endian.h>
 #include <sys/taskqueue.h>
 #include <sys/lock.h>
@@ -186,6 +187,13 @@ static void sdda_init_switch_part(struct cam_periph *p
 static int mmc_select_card(struct cam_periph *periph, union ccb *ccb, uint32_t rca);
 static inline uint32_t mmc_get_sector_size(struct cam_periph *periph) {return MMC_SECTOR_SIZE;}
 
+static SYSCTL_NODE(_kern_cam, OID_AUTO, sdda, CTLFLAG_RD | CTLFLAG_MPSAFE, 0,
+    "CAM Direct Access Disk driver");
+
+static int sdda_mmcsd_compat = 1;
+SYSCTL_INT(_kern_cam_sdda, OID_AUTO, mmcsd_compat, CTLFLAG_RDTUN,
+    &sdda_mmcsd_compat, 1, "Enable creation of mmcsd aliases.");
+
 /* TODO: actually issue GET_TRAN_SETTINGS to get R/O status */
 static inline bool sdda_get_read_only(struct cam_periph *periph, union ccb *start_ccb)
 {
@@ -1604,6 +1612,9 @@ sdda_add_part(struct cam_periph *periph, u_int type, c
 	part->disk->d_stripesize = 0;
 	part->disk->d_fwsectors = 0;
 	part->disk->d_fwheads = 0;
+
+	if (sdda_mmcsd_compat)
+		disk_add_alias(part->disk, "mmcsd");
 
 	/*
 	 * Acquire a reference to the periph before we register with GEOM.



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