Plan 9 from Bell Labs’s /usr/web/sources/contrib/axel/wlanfastkey/inspiration/firmware.h

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#ifndef _ORINOCO_FIRMWARE_H
#define _ORINOCO_FIRMWARE_H

#include <linux/version.h>
#include <linux/config.h>

#if defined(CONFIG_FW_LOADER) || defined(CONFIG_FW_LOADER_MODULE)
#include <linux/firmware.h>
#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)

#ifndef _LINUX_FIRMWARE_H
#define _LINUX_FIRMWARE_H
#define FIRMWARE_NAME_MAX 30 
struct firmware {
	size_t size;
	u8 *data;
};
int request_firmware (const struct firmware **fw, const char *name,
		      const char *device);
int request_firmware_nowait (
	struct module *module,
	const char *name, const char *device, void *context,
	void (*cont)(const struct firmware *fw, void *context));
/* On 2.5 'device' is 'struct device *' */

void release_firmware (const struct firmware *fw);
void register_firmware (const char *name, const u8 *data, size_t size);
#endif /* !_LINUX_FIRMWARE_H */

#else
/* fw loader is not available, provide a useless placeholder */
#warning request_firmware() not available.

#ifndef _LINUX_FIRMWARE_H
#define _LINUX_FIRMWARE_H
#define FIRMWARE_NAME_MAX 30 

#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 0)
#include <linux/device.h>
#endif

struct firmware {
	size_t size;
	u8 *data;
};

#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 0)
static int request_firmware (const struct firmware **fw, const char *name,
			     struct device *device) {
#else
static int request_firmware (const struct firmware **fw, const char *name,
			     const char *device) {
#endif
	if(fw)
		*fw = NULL;
	return -ENOSYS;
}
/* For 2.5 'device' should be 'struct device *' */

static void release_firmware (const struct firmware *fw)
{};
static void register_firmware (const char *name, const u8 *data, size_t size)
{};

#endif /* !_LINUX_FIRMWARE_H */

#endif /* defined(CONFIG_FW_LOADER) || defined(CONFIG_FW_LOADER_MODULE) */
#endif /* _ORINOCO_FIRMWARE_H */

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.