remarkable-linux/drivers/staging/greybus/firmware.h
Viresh Kumar ac96a609dc greybus: firmware: add comment to show size calculations
The firmware file name's maximum length is set to 56 right now, but it
isn't very much readable how we got to that value (unless someone reads
that line).

Update the comment to show calculations.

Reported-by: Alex Elder <alex.elder@linaro.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-08-12 17:38:19 +02:00

43 lines
1.2 KiB
C

/*
* Greybus Firmware Management Header
*
* Copyright 2016 Google Inc.
* Copyright 2016 Linaro Ltd.
*
* Released under the GPLv2 only.
*/
#ifndef __FIRMWARE_H
#define __FIRMWARE_H
#include "greybus.h"
#define FW_NAME_PREFIX "gmp_"
/*
* Length of the string in format: "FW_NAME_PREFIX""%08x_%08x_%08x_%08x_%s.tftf"
* (3 + 1 + 4 * (8 + 1) + 10 + 1 + 4 + 1)
*/
#define FW_NAME_SIZE 56
/* Firmware Management Protocol specific functions */
int fw_mgmt_init(void);
void fw_mgmt_exit(void);
struct gb_connection *to_fw_mgmt_connection(struct device *dev);
int gb_fw_mgmt_request_handler(struct gb_operation *op);
int gb_fw_mgmt_connection_init(struct gb_connection *connection);
void gb_fw_mgmt_connection_exit(struct gb_connection *connection);
/* Firmware Download Protocol specific functions */
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);
/* CAP Protocol specific functions */
int cap_init(void);
void cap_exit(void);
int gb_cap_connection_init(struct gb_connection *connection);
void gb_cap_connection_exit(struct gb_connection *connection);
#endif /* __FIRMWARE_H */