Commit c06271e0 authored by Sylwester Nawrocki's avatar Sylwester Nawrocki Committed by Mauro Carvalho Chehab

[media] staging: as102: Remove unnecessary typedefs

According to the kernel coding rules typedefs should be avoided,
so replace theit occurances with explicit enum/union types.

Cc: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: default avatarSylwester Nawrocki <snjw23@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 7f033e33
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
/*********************************/ /*********************************/
/* TYPE DEFINITION */ /* TYPE DEFINITION */
/*********************************/ /*********************************/
typedef enum { enum control_proc {
CONTROL_PROC_TURNON = 0x0001, CONTROL_PROC_TURNON = 0x0001,
CONTROL_PROC_TURNON_RSP = 0x0100, CONTROL_PROC_TURNON_RSP = 0x0100,
CONTROL_PROC_SET_REGISTER = 0x0002, CONTROL_PROC_SET_REGISTER = 0x0002,
...@@ -92,11 +92,11 @@ typedef enum { ...@@ -92,11 +92,11 @@ typedef enum {
CONTROL_PROC_DUMPLOG_MEMORY_RSP = 0xFE00, CONTROL_PROC_DUMPLOG_MEMORY_RSP = 0xFE00,
CONTROL_PROC_TURNOFF = 0x00FF, CONTROL_PROC_TURNOFF = 0x00FF,
CONTROL_PROC_TURNOFF_RSP = 0xFF00 CONTROL_PROC_TURNOFF_RSP = 0xFF00
} control_proc; };
#pragma pack(1) #pragma pack(1)
typedef union { union as10x_turn_on {
/* request */ /* request */
struct { struct {
/* request identifier */ /* request identifier */
...@@ -109,9 +109,9 @@ typedef union { ...@@ -109,9 +109,9 @@ typedef union {
/* error */ /* error */
uint8_t error; uint8_t error;
} rsp; } rsp;
} TURN_ON; };
typedef union { union as10x_turn_off {
/* request */ /* request */
struct { struct {
/* request identifier */ /* request identifier */
...@@ -124,9 +124,9 @@ typedef union { ...@@ -124,9 +124,9 @@ typedef union {
/* error */ /* error */
uint8_t err; uint8_t err;
} rsp; } rsp;
} TURN_OFF; };
typedef union { union as10x_set_tune {
/* request */ /* request */
struct { struct {
/* request identifier */ /* request identifier */
...@@ -141,9 +141,9 @@ typedef union { ...@@ -141,9 +141,9 @@ typedef union {
/* response error */ /* response error */
uint8_t error; uint8_t error;
} rsp; } rsp;
} SET_TUNE; };
typedef union { union as10x_get_tune_status {
/* request */ /* request */
struct { struct {
/* request identifier */ /* request identifier */
...@@ -158,9 +158,9 @@ typedef union { ...@@ -158,9 +158,9 @@ typedef union {
/* tune status */ /* tune status */
struct as10x_tune_status sts; struct as10x_tune_status sts;
} rsp; } rsp;
} GET_TUNE_STATUS; };
typedef union { union as10x_get_tps {
/* request */ /* request */
struct { struct {
/* request identifier */ /* request identifier */
...@@ -175,9 +175,9 @@ typedef union { ...@@ -175,9 +175,9 @@ typedef union {
/* tps details */ /* tps details */
struct as10x_tps tps; struct as10x_tps tps;
} rsp; } rsp;
} GET_TPS; };
typedef union { union as10x_common {
/* request */ /* request */
struct { struct {
/* request identifier */ /* request identifier */
...@@ -190,9 +190,9 @@ typedef union { ...@@ -190,9 +190,9 @@ typedef union {
/* response error */ /* response error */
uint8_t error; uint8_t error;
} rsp; } rsp;
} COMMON; };
typedef union { union as10x_add_pid_filter {
/* request */ /* request */
struct { struct {
/* request identifier */ /* request identifier */
...@@ -213,9 +213,9 @@ typedef union { ...@@ -213,9 +213,9 @@ typedef union {
/* Filter id */ /* Filter id */
uint8_t filter_id; uint8_t filter_id;
} rsp; } rsp;
} ADD_PID_FILTER; };
typedef union { union as10x_del_pid_filter {
/* request */ /* request */
struct { struct {
/* request identifier */ /* request identifier */
...@@ -230,9 +230,9 @@ typedef union { ...@@ -230,9 +230,9 @@ typedef union {
/* response error */ /* response error */
uint8_t error; uint8_t error;
} rsp; } rsp;
} DEL_PID_FILTER; };
typedef union { union as10x_start_streaming {
/* request */ /* request */
struct { struct {
/* request identifier */ /* request identifier */
...@@ -245,9 +245,9 @@ typedef union { ...@@ -245,9 +245,9 @@ typedef union {
/* error */ /* error */
uint8_t error; uint8_t error;
} rsp; } rsp;
} START_STREAMING; };
typedef union { union as10x_stop_streaming {
/* request */ /* request */
struct { struct {
/* request identifier */ /* request identifier */
...@@ -260,9 +260,9 @@ typedef union { ...@@ -260,9 +260,9 @@ typedef union {
/* error */ /* error */
uint8_t error; uint8_t error;
} rsp; } rsp;
} STOP_STREAMING; };
typedef union { union as10x_get_demod_stats {
/* request */ /* request */
struct { struct {
/* request identifier */ /* request identifier */
...@@ -277,9 +277,9 @@ typedef union { ...@@ -277,9 +277,9 @@ typedef union {
/* demod stats */ /* demod stats */
struct as10x_demod_stats stats; struct as10x_demod_stats stats;
} rsp; } rsp;
} GET_DEMOD_STATS; };
typedef union { union as10x_get_impulse_resp {
/* request */ /* request */
struct { struct {
/* request identifier */ /* request identifier */
...@@ -294,9 +294,9 @@ typedef union { ...@@ -294,9 +294,9 @@ typedef union {
/* impulse response ready */ /* impulse response ready */
uint8_t is_ready; uint8_t is_ready;
} rsp; } rsp;
} GET_IMPULSE_RESP; };
typedef union { union as10x_fw_context {
/* request */ /* request */
struct { struct {
/* request identifier */ /* request identifier */
...@@ -319,9 +319,9 @@ typedef union { ...@@ -319,9 +319,9 @@ typedef union {
/* error */ /* error */
uint8_t error; uint8_t error;
} rsp; } rsp;
} FW_CONTEXT; };
typedef union { union as10x_set_register {
/* request */ /* request */
struct { struct {
/* response identifier */ /* response identifier */
...@@ -338,9 +338,9 @@ typedef union { ...@@ -338,9 +338,9 @@ typedef union {
/* error */ /* error */
uint8_t error; uint8_t error;
} rsp; } rsp;
} SET_REGISTER; };
typedef union { union as10x_get_register {
/* request */ /* request */
struct { struct {
/* response identifier */ /* response identifier */
...@@ -357,9 +357,9 @@ typedef union { ...@@ -357,9 +357,9 @@ typedef union {
/* register content */ /* register content */
struct as10x_register_value reg_val; struct as10x_register_value reg_val;
} rsp; } rsp;
} GET_REGISTER; };
typedef union { union as10x_cfg_change_mode {
/* request */ /* request */
struct { struct {
/* request identifier */ /* request identifier */
...@@ -374,7 +374,7 @@ typedef union { ...@@ -374,7 +374,7 @@ typedef union {
/* error */ /* error */
uint8_t error; uint8_t error;
} rsp; } rsp;
} CFG_CHANGE_MODE; };
struct as10x_cmd_header_t { struct as10x_cmd_header_t {
uint16_t req_id; uint16_t req_id;
...@@ -384,7 +384,8 @@ struct as10x_cmd_header_t { ...@@ -384,7 +384,8 @@ struct as10x_cmd_header_t {
}; };
#define DUMP_BLOCK_SIZE 16 #define DUMP_BLOCK_SIZE 16
typedef union {
union as10x_dump_memory {
/* request */ /* request */
struct { struct {
/* request identifier */ /* request identifier */
...@@ -411,9 +412,9 @@ typedef union { ...@@ -411,9 +412,9 @@ typedef union {
uint32_t data32[DUMP_BLOCK_SIZE / sizeof(uint32_t)]; uint32_t data32[DUMP_BLOCK_SIZE / sizeof(uint32_t)];
} u; } u;
} rsp; } rsp;
} DUMP_MEMORY; };
typedef union { union as10x_dumplog_memory {
struct { struct {
/* request identifier */ /* request identifier */
uint16_t proc_id; uint16_t proc_id;
...@@ -430,9 +431,9 @@ typedef union { ...@@ -430,9 +431,9 @@ typedef union {
/* dump data */ /* dump data */
uint8_t data[DUMP_BLOCK_SIZE]; uint8_t data[DUMP_BLOCK_SIZE];
} rsp; } rsp;
} DUMPLOG_MEMORY; };
typedef union { union as10x_raw_data {
/* request */ /* request */
struct { struct {
uint16_t proc_id; uint16_t proc_id;
...@@ -445,33 +446,31 @@ typedef union { ...@@ -445,33 +446,31 @@ typedef union {
uint8_t data[64 - sizeof(struct as10x_cmd_header_t) /* header */ uint8_t data[64 - sizeof(struct as10x_cmd_header_t) /* header */
- 2 /* proc_id */ - 1 /* rc */]; - 2 /* proc_id */ - 1 /* rc */];
} rsp; } rsp;
} RAW_DATA; };
struct as10x_cmd_t { struct as10x_cmd_t {
/* header */ struct as10x_cmd_header_t header;
struct as10x_cmd_header_t header; union {
/* body */ union as10x_turn_on turn_on;
union { union as10x_turn_off turn_off;
TURN_ON turn_on; union as10x_set_tune set_tune;
TURN_OFF turn_off; union as10x_get_tune_status get_tune_status;
SET_TUNE set_tune; union as10x_get_tps get_tps;
GET_TUNE_STATUS get_tune_status; union as10x_common common;
GET_TPS get_tps; union as10x_add_pid_filter add_pid_filter;
COMMON common; union as10x_del_pid_filter del_pid_filter;
ADD_PID_FILTER add_pid_filter; union as10x_start_streaming start_streaming;
DEL_PID_FILTER del_pid_filter; union as10x_stop_streaming stop_streaming;
START_STREAMING start_streaming; union as10x_get_demod_stats get_demod_stats;
STOP_STREAMING stop_streaming; union as10x_get_impulse_resp get_impulse_rsp;
GET_DEMOD_STATS get_demod_stats; union as10x_fw_context context;
GET_IMPULSE_RESP get_impulse_rsp; union as10x_set_register set_register;
FW_CONTEXT context; union as10x_get_register get_register;
SET_REGISTER set_register; union as10x_cfg_change_mode cfg_change_mode;
GET_REGISTER get_register; union as10x_dump_memory dump_memory;
CFG_CHANGE_MODE cfg_change_mode; union as10x_dumplog_memory dumplog_memory;
DUMP_MEMORY dump_memory; union as10x_raw_data raw_data;
DUMPLOG_MEMORY dumplog_memory; } body;
RAW_DATA raw_data;
} body;
}; };
struct as10x_token_cmd_t { struct as10x_token_cmd_t {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment