mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 11:56:10 +08:00
nuttx: resolve various 'FAR' and 'CODE' issues
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
This commit is contained in:
committed by
Xiang Xiao
parent
a4b4fd16e9
commit
1528b8dcca
@@ -83,8 +83,8 @@ int32_t altcom_injectimage_pkt_compose(FAR void **arg, size_t arglen,
|
||||
int32_t size = 0;
|
||||
|
||||
FAR uint8_t *sending_data = (FAR uint8_t *)arg[0];
|
||||
int len = *(int *)arg[1];
|
||||
bool mode = *(bool *)arg[2];
|
||||
int len = *(FAR int *)arg[1];
|
||||
bool mode = *(FAR bool *)arg[2];
|
||||
|
||||
#ifndef CONFIG_MODEM_ALT1250_DISABLE_PV1
|
||||
if (altver == ALTCOM_VER1)
|
||||
|
||||
@@ -278,7 +278,7 @@ static bool is_header_ok(FAR struct altcom_cmdhdr_s *hdr)
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
bool altcom_is_v1pkt_ok(struct altcom_cmdhdr_s *cmdhdr)
|
||||
bool altcom_is_v1pkt_ok(FAR struct altcom_cmdhdr_s *cmdhdr)
|
||||
{
|
||||
struct calculated_checksum checksum;
|
||||
|
||||
@@ -292,7 +292,7 @@ bool altcom_is_v1pkt_ok(struct altcom_cmdhdr_s *cmdhdr)
|
||||
&& (cmdhdr->payload[0] == LTE_RESULT_OK);
|
||||
}
|
||||
|
||||
bool altcom_is_v4pkt_ok(struct altcom_cmdhdr_s *cmdhdr)
|
||||
bool altcom_is_v4pkt_ok(FAR struct altcom_cmdhdr_s *cmdhdr)
|
||||
{
|
||||
struct calculated_checksum checksum;
|
||||
|
||||
@@ -308,9 +308,10 @@ bool altcom_is_v4pkt_ok(struct altcom_cmdhdr_s *cmdhdr)
|
||||
|
||||
FAR void *altcom_make_poweron_cmd_v1(int *sz)
|
||||
{
|
||||
struct altcom_cmdhdr_s *hdr = (struct altcom_cmdhdr_s *)g_poweron_cmd;
|
||||
struct altcom_cmdfooter_s *footer
|
||||
= (struct altcom_cmdfooter_s *)&hdr->payload[0];
|
||||
FAR struct altcom_cmdhdr_s *hdr =
|
||||
(FAR struct altcom_cmdhdr_s *)g_poweron_cmd;
|
||||
FAR struct altcom_cmdfooter_s *footer =
|
||||
(FAR struct altcom_cmdfooter_s *)&hdr->payload[0];
|
||||
|
||||
set_header_top(hdr, ALTCOM_VER1, ALTCOM_CMDID_POWER_ON_V1);
|
||||
hdr->v1_options = htons(ALTCOM_CMDOPT_CHECKSUM_EN);
|
||||
@@ -334,11 +335,12 @@ FAR void *altcom_make_poweron_cmd_v1(int *sz)
|
||||
|
||||
FAR void *altcom_make_poweron_cmd_v4(int *sz)
|
||||
{
|
||||
struct altcom_cmdhdr_s *hdr = (struct altcom_cmdhdr_s *)g_poweron_cmd;
|
||||
FAR struct altcom_cmdhdr_s *hdr =
|
||||
(FAR struct altcom_cmdhdr_s *)g_poweron_cmd;
|
||||
|
||||
set_header_top(hdr, ALTCOM_VER4, ALTCOM_CMDID_POWER_ON_V4);
|
||||
hdr->v4_hdr_cksum = htons(calc_checksum_v4((FAR uint8_t *)hdr,
|
||||
sizeof(struct altcom_cmdhdr_s)-4));
|
||||
sizeof(struct altcom_cmdhdr_s) - 4));
|
||||
hdr->v4_data_cksum = htons(calc_checksum_v4(&hdr->payload[0], 0));
|
||||
|
||||
/* No payload of this altcom command. So sending size is just header size */
|
||||
@@ -405,8 +407,8 @@ uint16_t altcom_make_header(FAR struct altcom_cmdhdr_s *hdr,
|
||||
|
||||
if (ver == ALTCOM_VER1)
|
||||
{
|
||||
struct altcom_cmdfooter_s *footer
|
||||
= (struct altcom_cmdfooter_s *)&hdr->payload[sz];
|
||||
FAR struct altcom_cmdfooter_s *footer =
|
||||
(FAR struct altcom_cmdfooter_s *)&hdr->payload[sz];
|
||||
|
||||
hdr->v1_options = htons(ALTCOM_CMDOPT_CHECKSUM_EN);
|
||||
hdr->v1_checksum =
|
||||
|
||||
@@ -917,7 +917,7 @@ static altmdm_state_t process_state_v1set(uint32_t event,
|
||||
altmdm_state_t state)
|
||||
{
|
||||
int len;
|
||||
void *pkt;
|
||||
FAR void *pkt;
|
||||
|
||||
pkt = altcom_make_poweron_cmd_v1(&len);
|
||||
set_vp(VP_TRYV1);
|
||||
@@ -934,7 +934,7 @@ static altmdm_state_t process_state_v4set(uint32_t event,
|
||||
altmdm_state_t state)
|
||||
{
|
||||
int len;
|
||||
void *pkt;
|
||||
FAR void *pkt;
|
||||
|
||||
pkt = altcom_make_poweron_cmd_v4(&len);
|
||||
set_vp(VP_TRYV4);
|
||||
@@ -962,7 +962,7 @@ static altmdm_state_t process_state_sleepset(uint32_t event,
|
||||
static altmdm_state_t process_state_txprepare(uint32_t event,
|
||||
altmdm_state_t state)
|
||||
{
|
||||
void *buff;
|
||||
FAR void *buff;
|
||||
int len;
|
||||
|
||||
nxsem_wait_uninterruptible(&g_altmdm_dev.lock_txreq);
|
||||
@@ -1217,7 +1217,7 @@ static altmdm_state_t process_state_gotrx(uint32_t event,
|
||||
altmdm_state_t state)
|
||||
{
|
||||
enum version_phase_e vp;
|
||||
void *rcv_data;
|
||||
FAR void *rcv_data;
|
||||
|
||||
state = ALTMDM_STATE_DECIDEDELAY;
|
||||
|
||||
@@ -1232,7 +1232,7 @@ static altmdm_state_t process_state_gotrx(uint32_t event,
|
||||
vp = get_vp();
|
||||
if (vp == VP_TRYV1)
|
||||
{
|
||||
if (altcom_is_v1pkt_ok((struct altcom_cmdhdr_s *)rcv_data))
|
||||
if (altcom_is_v1pkt_ok((FAR struct altcom_cmdhdr_s *)rcv_data))
|
||||
{
|
||||
set_vp(VP_V1);
|
||||
set_return_code(ALTMDM_RETURN_RESET_V1);
|
||||
@@ -1244,7 +1244,7 @@ static altmdm_state_t process_state_gotrx(uint32_t event,
|
||||
}
|
||||
}
|
||||
else if ((vp == VP_TRYV4)
|
||||
&& altcom_is_v4pkt_ok((struct altcom_cmdhdr_s *)rcv_data))
|
||||
&& altcom_is_v4pkt_ok((FAR struct altcom_cmdhdr_s *)rcv_data))
|
||||
{
|
||||
set_vp(VP_V4);
|
||||
set_return_code(ALTMDM_RETURN_RESET_V4);
|
||||
|
||||
Reference in New Issue
Block a user