FreeBSD/sys/dev/cxgbe/t4_main.c
/*
 * The firmware in the KLD is usable, but should it be installed?  This routine
 * explains itself in detail if it indicates the KLD firmware should be
 * installed.
 */
The firmware in the KLD is usable, but should it be installed.  This routine
explains itself in detail if it indicates the KLD firmware should be
installed.
The firmware in the KLD is usable but should it be installed . This routine explains itself in detail if it indicates the KLD firmware should be installed .
static int
should_install_kld_fw(struct adapter *sc, int card_fw_usable, int k, int c)
{
	const char *reason;
	if (!card_fw_usable) {
		reason = "incompatible or unusable";
		goto install;
	}
	if (k > c) {
		reason = "older than the version bundled with this driver";
		goto install;
	}
	if (t4_fw_install == 2 && k != c) {
		reason = "different than the version bundled with this driver";
		goto install;
	}
	return (0);
install:
	if (t4_fw_install == 0) {
		device_printf(sc->dev, "firmware on card (%u.%u.%u.%u) is %s, "
		    "but the driver is prohibited from installing a different "
		    "firmware on the card.\n",
		    G_FW_HDR_FW_VER_MAJOR(c), G_FW_HDR_FW_VER_MINOR(c),
		    G_FW_HDR_FW_VER_MICRO(c), G_FW_HDR_FW_VER_BUILD(c), reason);
		return (0);
	}
	device_printf(sc->dev, "firmware on card (%u.%u.%u.%u) is %s, "
	    "installing firmware %u.%u.%u.%u on card.\n",
	    G_FW_HDR_FW_VER_MAJOR(c), G_FW_HDR_FW_VER_MINOR(c),
	    G_FW_HDR_FW_VER_MICRO(c), G_FW_HDR_FW_VER_BUILD(c), reason,
	    G_FW_HDR_FW_VER_MAJOR(k), G_FW_HDR_FW_VER_MINOR(k),
	    G_FW_HDR_FW_VER_MICRO(k), G_FW_HDR_FW_VER_BUILD(k));
	return (1);
}
static int should_install_kld_fw ( struct adapter * sc , int card_fw_usable , int k , int c ) { const char * reason ; if ( ! card_fw_usable ) { reason = " " ; goto install ; } if ( k > c ) { reason = " " ; goto install ; } if ( t4_fw_install == 2 && k != c ) { reason = " " ; goto install ; } return ( 0 ) ; install : if ( t4_fw_install == 0 ) { device_printf ( sc -> dev , " " " " " \n " , G_FW_HDR_FW_VER_MAJOR ( c ) , G_FW_HDR_FW_VER_MINOR ( c ) , G_FW_HDR_FW_VER_MICRO ( c ) , G_FW_HDR_FW_VER_BUILD ( c ) , reason ) ; return ( 0 ) ; } device_printf ( sc -> dev , " " " \n " , G_FW_HDR_FW_VER_MAJOR ( c ) , G_FW_HDR_FW_VER_MINOR ( c ) , G_FW_HDR_FW_VER_MICRO ( c ) , G_FW_HDR_FW_VER_BUILD ( c ) , reason , G_FW_HDR_FW_VER_MAJOR ( k ) , G_FW_HDR_FW_VER_MINOR ( k ) , G_FW_HDR_FW_VER_MICRO ( k ) , G_FW_HDR_FW_VER_BUILD ( k ) ) ; return ( 1 ) ; }
The firmware in the KLD is usable, but should it be installed?
The firmware in the KLD is usable but should it be installed?