.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | Frontend/Card driver for TwinHan DST Frontend |
---|
3 | 4 | Copyright (C) 2003 Jamie Honan |
---|
4 | 5 | Copyright (C) 2004, 2005 Manu Abraham (manu@kromtek.com) |
---|
5 | 6 | |
---|
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 |
---|
9 | | - (at your option) any later version. |
---|
10 | | - |
---|
11 | | - This program is distributed in the hope that it will be useful, |
---|
12 | | - but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
13 | | - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
14 | | - GNU General Public License for more details. |
---|
15 | | - |
---|
16 | | - You should have received a copy of the GNU General Public License |
---|
17 | | - along with this program; if not, write to the Free Software |
---|
18 | | - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
---|
19 | 7 | */ |
---|
20 | 8 | |
---|
21 | 9 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
---|
.. | .. |
---|
1100 | 1088 | /* Card capabilities */ |
---|
1101 | 1089 | state->dst_hw_cap = p_dst_type->dst_feature; |
---|
1102 | 1090 | pr_err("Recognise [%s]\n", p_dst_type->device_id); |
---|
1103 | | - strncpy(&state->fw_name[0], p_dst_type->device_id, 6); |
---|
| 1091 | + strscpy(state->fw_name, p_dst_type->device_id, |
---|
| 1092 | + sizeof(state->fw_name)); |
---|
1104 | 1093 | /* Multiple tuners */ |
---|
1105 | 1094 | if (p_dst_type->tuner_type & TUNER_TYPE_MULTI) { |
---|
1106 | 1095 | switch (use_dst_type) { |
---|
.. | .. |
---|
1295 | 1284 | |
---|
1296 | 1285 | static int dst_tone_power_cmd(struct dst_state *state) |
---|
1297 | 1286 | { |
---|
1298 | | - u8 paket[8] = { 0x00, 0x09, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00 }; |
---|
| 1287 | + u8 packet[8] = { 0x00, 0x09, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00 }; |
---|
1299 | 1288 | |
---|
1300 | 1289 | if (state->dst_type != DST_TYPE_IS_SAT) |
---|
1301 | 1290 | 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); |
---|
| 1291 | + packet[4] = state->tx_tuna[4]; |
---|
| 1292 | + packet[2] = state->tx_tuna[2]; |
---|
| 1293 | + packet[3] = state->tx_tuna[3]; |
---|
| 1294 | + packet[7] = dst_check_sum (packet, 7); |
---|
| 1295 | + return dst_command(state, packet, 8); |
---|
1307 | 1296 | } |
---|
1308 | 1297 | |
---|
1309 | 1298 | static int dst_get_tuna(struct dst_state *state) |
---|
.. | .. |
---|
1429 | 1418 | static int dst_set_diseqc(struct dvb_frontend *fe, struct dvb_diseqc_master_cmd *cmd) |
---|
1430 | 1419 | { |
---|
1431 | 1420 | struct dst_state *state = fe->demodulator_priv; |
---|
1432 | | - u8 paket[8] = { 0x00, 0x08, 0x04, 0xe0, 0x10, 0x38, 0xf0, 0xec }; |
---|
| 1421 | + u8 packet[8] = { 0x00, 0x08, 0x04, 0xe0, 0x10, 0x38, 0xf0, 0xec }; |
---|
1433 | 1422 | |
---|
1434 | 1423 | if (state->dst_type != DST_TYPE_IS_SAT) |
---|
1435 | 1424 | return -EOPNOTSUPP; |
---|
1436 | 1425 | if (cmd->msg_len > 0 && cmd->msg_len < 5) |
---|
1437 | | - memcpy(&paket[3], cmd->msg, cmd->msg_len); |
---|
| 1426 | + memcpy(&packet[3], cmd->msg, cmd->msg_len); |
---|
1438 | 1427 | else if (cmd->msg_len == 5 && state->dst_hw_cap & DST_TYPE_HAS_DISEQC5) |
---|
1439 | | - memcpy(&paket[2], cmd->msg, cmd->msg_len); |
---|
| 1428 | + memcpy(&packet[2], cmd->msg, cmd->msg_len); |
---|
1440 | 1429 | else |
---|
1441 | 1430 | return -EINVAL; |
---|
1442 | | - paket[7] = dst_check_sum(&paket[0], 7); |
---|
1443 | | - return dst_command(state, paket, 8); |
---|
| 1431 | + packet[7] = dst_check_sum(&packet[0], 7); |
---|
| 1432 | + return dst_command(state, packet, 8); |
---|
1444 | 1433 | } |
---|
1445 | 1434 | |
---|
1446 | 1435 | static int dst_set_voltage(struct dvb_frontend *fe, enum fe_sec_voltage voltage) |
---|
.. | .. |
---|
1733 | 1722 | return state; /* Manu (DST is a card not a frontend) */ |
---|
1734 | 1723 | } |
---|
1735 | 1724 | |
---|
1736 | | -EXPORT_SYMBOL(dst_attach); |
---|
| 1725 | +EXPORT_SYMBOL_GPL(dst_attach); |
---|
1737 | 1726 | |
---|
1738 | 1727 | static const struct dvb_frontend_ops dst_dvbt_ops = { |
---|
1739 | 1728 | .delsys = { SYS_DVBT }, |
---|