Lines Matching full:state
26 struct dtt200u_fe_state *state = fe->demodulator_priv; in dtt200u_fe_read_status() local
29 mutex_lock(&state->data_mutex); in dtt200u_fe_read_status()
30 state->data[0] = GET_TUNE_STATUS; in dtt200u_fe_read_status()
32 ret = dvb_usb_generic_rw(state->d, state->data, 1, state->data, 3, 0); in dtt200u_fe_read_status()
35 mutex_unlock(&state->data_mutex); in dtt200u_fe_read_status()
39 switch (state->data[0]) { in dtt200u_fe_read_status()
52 mutex_unlock(&state->data_mutex); in dtt200u_fe_read_status()
58 struct dtt200u_fe_state *state = fe->demodulator_priv; in dtt200u_fe_read_ber() local
61 mutex_lock(&state->data_mutex); in dtt200u_fe_read_ber()
62 state->data[0] = GET_VIT_ERR_CNT; in dtt200u_fe_read_ber()
64 ret = dvb_usb_generic_rw(state->d, state->data, 1, state->data, 3, 0); in dtt200u_fe_read_ber()
66 *ber = (state->data[0] << 16) | (state->data[1] << 8) | state->data[2]; in dtt200u_fe_read_ber()
68 mutex_unlock(&state->data_mutex); in dtt200u_fe_read_ber()
74 struct dtt200u_fe_state *state = fe->demodulator_priv; in dtt200u_fe_read_unc_blocks() local
77 mutex_lock(&state->data_mutex); in dtt200u_fe_read_unc_blocks()
78 state->data[0] = GET_RS_UNCOR_BLK_CNT; in dtt200u_fe_read_unc_blocks()
80 ret = dvb_usb_generic_rw(state->d, state->data, 1, state->data, 2, 0); in dtt200u_fe_read_unc_blocks()
82 *unc = (state->data[0] << 8) | state->data[1]; in dtt200u_fe_read_unc_blocks()
84 mutex_unlock(&state->data_mutex); in dtt200u_fe_read_unc_blocks()
90 struct dtt200u_fe_state *state = fe->demodulator_priv; in dtt200u_fe_read_signal_strength() local
93 mutex_lock(&state->data_mutex); in dtt200u_fe_read_signal_strength()
94 state->data[0] = GET_AGC; in dtt200u_fe_read_signal_strength()
96 ret = dvb_usb_generic_rw(state->d, state->data, 1, state->data, 1, 0); in dtt200u_fe_read_signal_strength()
98 *strength = (state->data[0] << 8) | state->data[0]; in dtt200u_fe_read_signal_strength()
100 mutex_unlock(&state->data_mutex); in dtt200u_fe_read_signal_strength()
106 struct dtt200u_fe_state *state = fe->demodulator_priv; in dtt200u_fe_read_snr() local
109 mutex_lock(&state->data_mutex); in dtt200u_fe_read_snr()
110 state->data[0] = GET_SNR; in dtt200u_fe_read_snr()
112 ret = dvb_usb_generic_rw(state->d, state->data, 1, state->data, 1, 0); in dtt200u_fe_read_snr()
114 *snr = ~((state->data[0] << 8) | state->data[0]); in dtt200u_fe_read_snr()
116 mutex_unlock(&state->data_mutex); in dtt200u_fe_read_snr()
122 struct dtt200u_fe_state *state = fe->demodulator_priv; in dtt200u_fe_init() local
125 mutex_lock(&state->data_mutex); in dtt200u_fe_init()
126 state->data[0] = SET_INIT; in dtt200u_fe_init()
128 ret = dvb_usb_generic_write(state->d, state->data, 1); in dtt200u_fe_init()
129 mutex_unlock(&state->data_mutex); in dtt200u_fe_init()
150 struct dtt200u_fe_state *state = fe->demodulator_priv; in dtt200u_fe_set_frontend() local
154 mutex_lock(&state->data_mutex); in dtt200u_fe_set_frontend()
155 state->data[0] = SET_BANDWIDTH; in dtt200u_fe_set_frontend()
158 state->data[1] = 8; in dtt200u_fe_set_frontend()
161 state->data[1] = 7; in dtt200u_fe_set_frontend()
164 state->data[1] = 6; in dtt200u_fe_set_frontend()
171 ret = dvb_usb_generic_write(state->d, state->data, 2); in dtt200u_fe_set_frontend()
175 state->data[0] = SET_RF_FREQ; in dtt200u_fe_set_frontend()
176 state->data[1] = freq & 0xff; in dtt200u_fe_set_frontend()
177 state->data[2] = (freq >> 8) & 0xff; in dtt200u_fe_set_frontend()
178 ret = dvb_usb_generic_write(state->d, state->data, 3); in dtt200u_fe_set_frontend()
183 mutex_unlock(&state->data_mutex); in dtt200u_fe_set_frontend()
190 struct dtt200u_fe_state *state = fe->demodulator_priv; in dtt200u_fe_get_frontend() local
192 memcpy(fep, &state->fep, sizeof(struct dtv_frontend_properties)); in dtt200u_fe_get_frontend()
198 struct dtt200u_fe_state *state = fe->demodulator_priv; in dtt200u_fe_release() local
199 kfree(state); in dtt200u_fe_release()
206 struct dtt200u_fe_state* state = NULL; in dtt200u_fe_attach() local
208 /* allocate memory for the internal state */ in dtt200u_fe_attach()
209 state = kzalloc(sizeof(struct dtt200u_fe_state), GFP_KERNEL); in dtt200u_fe_attach()
210 if (state == NULL) in dtt200u_fe_attach()
215 state->d = d; in dtt200u_fe_attach()
216 mutex_init(&state->data_mutex); in dtt200u_fe_attach()
218 memcpy(&state->frontend.ops,&dtt200u_fe_ops,sizeof(struct dvb_frontend_ops)); in dtt200u_fe_attach()
219 state->frontend.demodulator_priv = state; in dtt200u_fe_attach()
221 return &state->frontend; in dtt200u_fe_attach()