[vuplus-wifi-util] fix default ccode
[vuplus_openvuplus_3.0] / meta-openvuplus / recipes-vuplus / usbtunerhelper / usbtunerhelper / setfrontend_ofdm_fecauto.patch
1 diff --git a/usbtunerhelper.c b/usbtunerhelper.c
2 index 7906f9b..5bdd359 100644
3 --- a/usbtunerhelper.c
4 +++ b/usbtunerhelper.c
5 @@ -90,6 +90,7 @@ struct vtuner_adapter
6         int firstdata;
7         pthread_t eventthread, pumpthread;
8         __u16 pidlist[30];
9 +       fe_type_t fe_type;
10  };
11  
12  struct vtuner_adapter adapters[MAX_ADAPTERS];
13 @@ -294,6 +295,11 @@ void *event_proc(void *ptr)
14                         {
15                         case MSG_SET_FRONTEND:
16                                 adapter->firstdata = 1;
17 +                               if ((adapter->fe_type == FE_OFDM) && (message.body.dvb_frontend_parameters.u.ofdm.code_rate_HP != FEC_AUTO))
18 +                               {
19 +                                       message.body.dvb_frontend_parameters.u.ofdm.code_rate_HP = FEC_AUTO;
20 +                                       printf("[FE_SET_FRONTEND] OFDM CODE RATE HP SETTED AUTO\n", adapter->vtunerindex);
21 +                               }
22                                 ioctl(adapter->frontend, FE_SET_FRONTEND, &message.body.dvb_frontend_parameters);
23                                 break;
24                         case MSG_GET_FRONTEND:
25 @@ -585,6 +591,8 @@ int init_adapter(int id)
26                 goto error;
27         }
28  
29 +       adapter->fe_type = fe_info.type;
30 +
31         ioctl(adapter->vtuner, VTUNER_SET_NAME, adapter->name);
32         ioctl(adapter->vtuner, VTUNER_SET_TYPE, type);
33         ioctl(adapter->vtuner, VTUNER_SET_FE_INFO, &fe_info);