#include <linux/firmware.h>
#include <linux/jiffies.h>
#include <linux/mutex.h>
#include <linux/workqueue.h>
#include <linux/greybus.h>
#include "firmware.h"
#define MIN_FETCH_SIZE …
#define NEXT_REQ_TIMEOUT_J …
struct fw_request { … };
struct fw_download { … };
static void fw_req_release(struct kref *kref)
{ … }
static void put_fw_req(struct fw_request *fw_req)
{ … }
static struct fw_request *get_fw_req(struct fw_download *fw_download,
u8 firmware_id)
{ … }
static void free_firmware(struct fw_download *fw_download,
struct fw_request *fw_req)
{ … }
static void fw_request_timedout(struct work_struct *work)
{ … }
static int exceeds_release_timeout(struct fw_request *fw_req)
{ … }
static struct fw_request *find_firmware(struct fw_download *fw_download,
const char *tag)
{ … }
static int fw_download_find_firmware(struct gb_operation *op)
{ … }
static int fw_download_fetch_firmware(struct gb_operation *op)
{ … }
static int fw_download_release_firmware(struct gb_operation *op)
{ … }
int gb_fw_download_request_handler(struct gb_operation *op)
{ … }
int gb_fw_download_connection_init(struct gb_connection *connection)
{ … }
void gb_fw_download_connection_exit(struct gb_connection *connection)
{ … }