mmcam: Use a static length sbuf buffer
We cannot sleep during cam proto_announce and sbuf sleeps so use a static length buffer like nvme(4) Reviewed by: kibab Differential Revision: https://reviews.freebsd.org/D25949
This commit is contained in:
parent
25f965fdaa
commit
cd2f74af6f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=363861
@ -68,7 +68,6 @@
|
|||||||
#include <cam/mmc/mmc.h>
|
#include <cam/mmc/mmc.h>
|
||||||
#include <dev/mmc/mmcreg.h>
|
#include <dev/mmc/mmcreg.h>
|
||||||
|
|
||||||
void mmc_print_ident(struct mmc_params *ident_data);
|
|
||||||
struct ccb_pathinq;
|
struct ccb_pathinq;
|
||||||
struct cam_sim;
|
struct cam_sim;
|
||||||
void mmc_path_inq(struct ccb_pathinq *cpi, const char *hba,
|
void mmc_path_inq(struct ccb_pathinq *cpi, const char *hba,
|
||||||
|
@ -411,13 +411,11 @@ mmccam_start_discovery(struct cam_sim *sim) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* This func is called per attached device :-( */
|
/* This func is called per attached device :-( */
|
||||||
void
|
static void
|
||||||
mmc_print_ident(struct mmc_params *ident_data)
|
mmc_print_ident(struct mmc_params *ident_data, struct sbuf *sb)
|
||||||
{
|
{
|
||||||
struct sbuf *sb;
|
|
||||||
bool space = false;
|
bool space = false;
|
||||||
|
|
||||||
sb = sbuf_new_auto();
|
|
||||||
sbuf_printf(sb, "Relative addr: %08x\n", ident_data->card_rca);
|
sbuf_printf(sb, "Relative addr: %08x\n", ident_data->card_rca);
|
||||||
sbuf_printf(sb, "Card features: <");
|
sbuf_printf(sb, "Card features: <");
|
||||||
if (ident_data->card_features & CARD_FEATURE_MMC) {
|
if (ident_data->card_features & CARD_FEATURE_MMC) {
|
||||||
@ -463,13 +461,20 @@ mmc_print_ident(struct mmc_params *ident_data)
|
|||||||
static void
|
static void
|
||||||
mmc_proto_announce(struct cam_ed *device)
|
mmc_proto_announce(struct cam_ed *device)
|
||||||
{
|
{
|
||||||
mmc_print_ident(&device->mmc_ident_data);
|
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
|
static void
|
||||||
mmc_proto_denounce(struct cam_ed *device)
|
mmc_proto_denounce(struct cam_ed *device)
|
||||||
{
|
{
|
||||||
mmc_print_ident(&device->mmc_ident_data);
|
|
||||||
|
mmc_proto_announce(device);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user