From owner-svn-src-all@freebsd.org Fri Jul 24 17:11:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A9A9F36C89D; Fri, 24 Jul 2020 17:11:14 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCwhf46Zdz3Yxr; Fri, 24 Jul 2020 17:11:14 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 70CDDD576; Fri, 24 Jul 2020 17:11:14 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06OHBEo5065128; Fri, 24 Jul 2020 17:11:14 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06OHBE7g065127; Fri, 24 Jul 2020 17:11:14 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202007241711.06OHBE7g065127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 24 Jul 2020 17:11:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363479 - head/sys/cam/mmc X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/cam/mmc X-SVN-Commit-Revision: 363479 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2020 17:11:14 -0000 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 #include #include +#include #include #include #include @@ -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.