Ejemplo n.º 1
0
static int
urtwn_rtl8192cfwT_fw_modevent(module_t mod, int type, void *unused)
{
	const struct firmware *fp, *parent;
	int error;
	switch (type) {
	case MOD_LOAD:


		TUNABLE_LONG_FETCH("legal.realtek.license_ack", &realtek_license_ack);
		if (!realtek_license_ack) {
			printf("urtwn-rtl8192cfwT: You need to read the LICENSE file in /usr/share/doc/legal/realtek.LICENSE.\n");
			printf("urtwn-rtl8192cfwT: If you agree with the license, set legal.realtek.license_ack=1 in /boot/loader.conf.\n");
			return(EPERM);
		}

		fp = firmware_register("urtwn-rtl8192cfwT", _binary_urtwn_rtl8192cfwT_fw_start , (size_t)(_binary_urtwn_rtl8192cfwT_fw_end - _binary_urtwn_rtl8192cfwT_fw_start), 111, NULL);
		if (fp == NULL)
			goto fail_0;
		parent = fp;
		return (0);
	fail_0:
		return (ENXIO);
	case MOD_UNLOAD:
		error = firmware_unregister("urtwn-rtl8192cfwT");
		return (error);
	}
	return (EINVAL);
}
Ejemplo n.º 2
0
static void __exit
pdc_stable_exit(void)
{
	pdcs_unregister_pathentries();
	subsystem_unregister(&paths_subsys);

	firmware_unregister(&stable_subsys);
}
Ejemplo n.º 3
0
Archivo: edd.c Proyecto: wxlong/Test
static void __exit
edd_exit(void)
{
	int i;
	struct edd_device *edev;

	for (i = 0; i < eddnr && i < EDDMAXNR; i++) {
		if ((edev = edd_devices[i]))
			edd_device_unregister(edev);
	}
	firmware_unregister(&edd_subsys);
}
Ejemplo n.º 4
0
/*
 * For now we register the stable subsystem with the firmware subsystem
 * and the paths subsystem with the stable subsystem
 */
static int __init
pdc_stable_init(void)
{
	struct subsys_attribute *attr;
	int i, rc = 0, error = 0;

	/* find the size of the stable storage */
	if (pdc_stable_get_size(&pdcs_size) != PDC_OK) 
		return -ENODEV;

	/* make sure we have enough data */
	if (pdcs_size < 96)
		return -ENODATA;

	printk(KERN_INFO PDCS_PREFIX " facility v%s\n", PDCS_VERSION);

	/* For now we'll register the stable subsys within this driver */
	if ((rc = firmware_register(&stable_subsys)))
		goto fail_firmreg;

	/* Don't forget the root entries */
	for (i = 0; (attr = pdcs_subsys_attrs[i]) && !error; i++)
		if (attr->show)
			error = subsys_create_file(&stable_subsys, attr);
	
	/* register the paths subsys as a subsystem of stable subsys */
	kset_set_kset_s(&paths_subsys, stable_subsys);
	if ((rc= subsystem_register(&paths_subsys)))
		goto fail_subsysreg;

	/* now we create all "files" for the paths subsys */
	if ((rc = pdcs_register_pathentries()))
		goto fail_pdcsreg;

	return rc;
	
fail_pdcsreg:
	pdcs_unregister_pathentries();
	subsystem_unregister(&paths_subsys);
	
fail_subsysreg:
	firmware_unregister(&stable_subsys);
	
fail_firmreg:
	printk(KERN_INFO PDCS_PREFIX " bailing out\n");
	return rc;
}
Ejemplo n.º 5
0
static int
mxge_ethp_z8e_fw_modevent(module_t mod, int type, void *unused)
{
	const struct firmware *fp, *parent;
	int error;
	switch (type) {
	case MOD_LOAD:

		fp = firmware_register("mxge_ethp_z8e", ethp_z8e, 
				       (size_t)ethp_z8e_length,
				       ethp_z8e_uncompressed_length, NULL);
		if (fp == NULL)
			goto fail_0;
		parent = fp;
		return (0);
	fail_0:
		return (ENXIO);
	case MOD_UNLOAD:
		error = firmware_unregister("mxge_ethp_z8e");
		return (error);
	}
	return (EINVAL);
}
static int
cxgb_t3b_tp_eeprom_modevent(module_t mod, int type, void *unused)
{
	const struct firmware *fp, *parent;
	int error;
	switch (type) {
	case MOD_LOAD:

		fp = firmware_register("cxgb_t3b_tp_eeprom", t3b_tp_eeprom, 
				       (size_t)t3b_tp_eeprom_length,
				       0, NULL);
		if (fp == NULL)
			goto fail_0;
		parent = fp;
		return (0);
	fail_0:
		return (ENXIO);
	case MOD_UNLOAD:
		error = firmware_unregister("cxgb_t3b_tp_eeprom");
		return (error);
	}
	return (EINVAL);
}
Ejemplo n.º 7
0
/*
 * test_reg_firm
 *	test call to register_firmware, which will
 *	register the subsystem, takes in a struct
 *	subsystem pointer, we can use our bus pointer
 *	that should have been found in a previous test
 *	to pass in a subsystem pointer, returns an
 *	error code
 */
static int test_reg_firm() {
	struct subsystem *subsys = NULL;

	/* check pointer exists */
	if (!(subsys = &test_bus_type.subsys)) {
		printk("tbase: subsys pointer not set in reg firmware\n");
		return 1;
	}

	/* unregiser firmware */
	firmware_unregister(subsys);

	/* make test call */
	if (firmware_register(subsys)) {
		printk("tbase: failed register firmware\n");
		return 1;
	}
	else {
		printk("tbase: regsitered firmware\n");
		return 0;
	}

}
Ejemplo n.º 8
0
Archivo: edd.c Proyecto: wxlong/Test
/**
 * edd_init() - creates sysfs tree of EDD data
 *
 * This assumes that eddnr and edd were
 * assigned in setup.c already.
 */
static int __init
edd_init(void)
{
	unsigned int i;
	int rc=0;
	struct edd_device *edev;

	printk(KERN_INFO "BIOS EDD facility v%s, %d devices found\n",
	       EDD_VERSION, eddnr);
	printk(KERN_INFO "Please report your BIOS at %s\n", REPORT_URL);

	if (!eddnr) {
		printk(KERN_INFO "EDD information not available.\n");
		return 1;
	}

	rc = firmware_register(&edd_subsys);
	if (rc)
		return rc;

	for (i = 0; i < eddnr && i < EDDMAXNR && !rc; i++) {
		edev = kmalloc(sizeof (*edev), GFP_KERNEL);
		if (!edev)
			return -ENOMEM;

		rc = edd_device_register(edev, i);
		if (rc) {
			kfree(edev);
			break;
		}
		edd_devices[i] = edev;
	}

	if (rc)
		firmware_unregister(&edd_subsys);
	return rc;
}