dst.c (3eb66e91a25497065c5322b1268cbc3953642227) dst.c (167905540e08e37162adc24066427944f71bf7a4)
1/*
2 Frontend/Card driver for TwinHan DST Frontend
3 Copyright (C) 2003 Jamie Honan
4 Copyright (C) 2004, 2005 Manu Abraham (manu@kromtek.com)
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or

--- 1281 unchanged lines hidden (view full) ---

1290 }
1291 state->cur_jiff = jiffies;
1292 }
1293 return 0;
1294}
1295
1296static int dst_tone_power_cmd(struct dst_state *state)
1297{
1/*
2 Frontend/Card driver for TwinHan DST Frontend
3 Copyright (C) 2003 Jamie Honan
4 Copyright (C) 2004, 2005 Manu Abraham (manu@kromtek.com)
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or

--- 1281 unchanged lines hidden (view full) ---

1290 }
1291 state->cur_jiff = jiffies;
1292 }
1293 return 0;
1294}
1295
1296static int dst_tone_power_cmd(struct dst_state *state)
1297{
1298 u8 paket[8] = { 0x00, 0x09, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00 };
1298 u8 packet[8] = { 0x00, 0x09, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00 };
1299
1300 if (state->dst_type != DST_TYPE_IS_SAT)
1301 return -EOPNOTSUPP;
1299
1300 if (state->dst_type != DST_TYPE_IS_SAT)
1301 return -EOPNOTSUPP;
1302 paket[4] = state->tx_tuna[4];
1303 paket[2] = state->tx_tuna[2];
1304 paket[3] = state->tx_tuna[3];
1305 paket[7] = dst_check_sum (paket, 7);
1306 return dst_command(state, paket, 8);
1302 packet[4] = state->tx_tuna[4];
1303 packet[2] = state->tx_tuna[2];
1304 packet[3] = state->tx_tuna[3];
1305 packet[7] = dst_check_sum (packet, 7);
1306 return dst_command(state, packet, 8);
1307}
1308
1309static int dst_get_tuna(struct dst_state *state)
1310{
1311 int retval;
1312
1313 if ((state->diseq_flags & ATTEMPT_TUNE) == 0)
1314 return 0;

--- 109 unchanged lines hidden (view full) ---

1424 * Diseqc 2 0x00, 0x08, 0x04, 0xe0, 0x10, 0x38, 0xf4, 0xe8
1425 * Diseqc 3 0x00, 0x08, 0x04, 0xe0, 0x10, 0x38, 0xf8, 0xe4
1426 * Diseqc 4 0x00, 0x08, 0x04, 0xe0, 0x10, 0x38, 0xfc, 0xe0
1427 */
1428
1429static int dst_set_diseqc(struct dvb_frontend *fe, struct dvb_diseqc_master_cmd *cmd)
1430{
1431 struct dst_state *state = fe->demodulator_priv;
1307}
1308
1309static int dst_get_tuna(struct dst_state *state)
1310{
1311 int retval;
1312
1313 if ((state->diseq_flags & ATTEMPT_TUNE) == 0)
1314 return 0;

--- 109 unchanged lines hidden (view full) ---

1424 * Diseqc 2 0x00, 0x08, 0x04, 0xe0, 0x10, 0x38, 0xf4, 0xe8
1425 * Diseqc 3 0x00, 0x08, 0x04, 0xe0, 0x10, 0x38, 0xf8, 0xe4
1426 * Diseqc 4 0x00, 0x08, 0x04, 0xe0, 0x10, 0x38, 0xfc, 0xe0
1427 */
1428
1429static int dst_set_diseqc(struct dvb_frontend *fe, struct dvb_diseqc_master_cmd *cmd)
1430{
1431 struct dst_state *state = fe->demodulator_priv;
1432 u8 paket[8] = { 0x00, 0x08, 0x04, 0xe0, 0x10, 0x38, 0xf0, 0xec };
1432 u8 packet[8] = { 0x00, 0x08, 0x04, 0xe0, 0x10, 0x38, 0xf0, 0xec };
1433
1434 if (state->dst_type != DST_TYPE_IS_SAT)
1435 return -EOPNOTSUPP;
1436 if (cmd->msg_len > 0 && cmd->msg_len < 5)
1433
1434 if (state->dst_type != DST_TYPE_IS_SAT)
1435 return -EOPNOTSUPP;
1436 if (cmd->msg_len > 0 && cmd->msg_len < 5)
1437 memcpy(&paket[3], cmd->msg, cmd->msg_len);
1437 memcpy(&packet[3], cmd->msg, cmd->msg_len);
1438 else if (cmd->msg_len == 5 && state->dst_hw_cap & DST_TYPE_HAS_DISEQC5)
1438 else if (cmd->msg_len == 5 && state->dst_hw_cap & DST_TYPE_HAS_DISEQC5)
1439 memcpy(&paket[2], cmd->msg, cmd->msg_len);
1439 memcpy(&packet[2], cmd->msg, cmd->msg_len);
1440 else
1441 return -EINVAL;
1440 else
1441 return -EINVAL;
1442 paket[7] = dst_check_sum(&paket[0], 7);
1443 return dst_command(state, paket, 8);
1442 packet[7] = dst_check_sum(&packet[0], 7);
1443 return dst_command(state, packet, 8);
1444}
1445
1446static int dst_set_voltage(struct dvb_frontend *fe, enum fe_sec_voltage voltage)
1447{
1448 int need_cmd, retval = 0;
1449 struct dst_state *state = fe->demodulator_priv;
1450
1451 state->voltage = voltage;

--- 399 unchanged lines hidden ---
1444}
1445
1446static int dst_set_voltage(struct dvb_frontend *fe, enum fe_sec_voltage voltage)
1447{
1448 int need_cmd, retval = 0;
1449 struct dst_state *state = fe->demodulator_priv;
1450
1451 state->voltage = voltage;

--- 399 unchanged lines hidden ---