freebsd_network: Add firmware_get_flags.

Needed by the MT7601U driver.
This commit is contained in:
Augustin Cavalier
2025-03-03 16:28:39 -05:00
parent 640cf189a0
commit 1f00d7e571
2 changed files with 21 additions and 9 deletions
@@ -1,23 +1,28 @@
/*
* Copyright 2009 Haiku Inc. All rights reserved.
* Copyright 2009-2025, Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _FBSD_COMPAT_SYS_FIRMWARE_H_
#define _FBSD_COMPAT_SYS_FIRMWARE_H_
#define FIRMWARE_UNLOAD 0x0001
struct firmware {
const char* name; // system-wide name
const void* data; // location of image
size_t datasize; // size of image in bytes
unsigned int version; // version of the image
const char* name;
const void* data;
size_t datasize;
unsigned int version;
};
#define FIRMWARE_GET_NOWARN 0x0001
const struct firmware* firmware_get(const char*);
void firmware_put(const struct firmware*, int);
const struct firmware* firmware_get_flags(const char*, int flags);
#define FIRMWARE_UNLOAD 0x0001
void firmware_put(const struct firmware*, int flags);
#endif /* _FBSD_COMPAT_SYS_FIRMWARE_H_ */
@@ -45,6 +45,13 @@ getHaikuFirmwareName(const char* fbsdFirmwareName,
const struct firmware*
firmware_get(const char* fbsdFirmwareName)
{
return firmware_get_flags(fbsdFirmwareName, 0);
}
const struct firmware*
firmware_get_flags(const char* fbsdFirmwareName, int flags)
{
char* fbsdFirmwareNameCopy = NULL;
int fileDescriptor = -1;