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)
This commit is contained in:
parent
ce219ecd93
commit
bf2868538e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=363479
@ -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 *periph, union ccb *start_cc
|
||||
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)
|
||||
{
|
||||
@ -1605,6 +1613,9 @@ sdda_add_part(struct cam_periph *periph, u_int type, const char *name,
|
||||
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.
|
||||
* We'll release this reference once GEOM calls us back (via
|
||||
|
Loading…
Reference in New Issue
Block a user