Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 8139
b: refs/heads/master
c: 62121b1
h: refs/heads/master
i:
  8137: df46c94
  8135: c08517a
v: v3
  • Loading branch information
Manu Abraham authored and Linus Torvalds committed Sep 9, 2005
1 parent 22b4fc7 commit 0d24fb3
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a427de6f72bc0d83ebb1d87f9003c5e1009f21cd
refs/heads/master: 62121b1f9e25377ff50121f8c34a4aa92c47f465
89 changes: 86 additions & 3 deletions trunk/drivers/media/dvb/bt8xx/dst.c
Original file line number Diff line number Diff line change
Expand Up @@ -673,23 +673,23 @@ struct dst_types dst_tlist[] = {
.offset = 1,
.dst_type = DST_TYPE_IS_CABLE,
.type_flags = DST_TYPE_HAS_TS204 | DST_TYPE_HAS_NEWTUNE | DST_TYPE_HAS_FW_1
| DST_TYPE_HAS_FW_2 | DST_TYPE_HAS_FW_BUILD,
| DST_TYPE_HAS_FW_2,
.dst_feature = DST_TYPE_HAS_CA
},

{
.device_id = "DCTNEW",
.offset = 1,
.dst_type = DST_TYPE_IS_CABLE,
.type_flags = DST_TYPE_HAS_NEWTUNE | DST_TYPE_HAS_FW_3,
.type_flags = DST_TYPE_HAS_NEWTUNE | DST_TYPE_HAS_FW_3 | DST_TYPE_HAS_FW_BUILD,
.dst_feature = 0
},

{
.device_id = "DTT-CI",
.offset = 1,
.dst_type = DST_TYPE_IS_TERR,
.type_flags = DST_TYPE_HAS_TS204 | DST_TYPE_HAS_FW_2 | DST_TYPE_HAS_FW_BUILD,
.type_flags = DST_TYPE_HAS_TS204 | DST_TYPE_HAS_FW_2,
.dst_feature = 0
},

Expand Down Expand Up @@ -729,6 +729,71 @@ struct dst_types dst_tlist[] = {

};

static int dst_get_mac(struct dst_state *state)
{
u8 get_mac[] = { 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
get_mac[7] = dst_check_sum(get_mac, 7);
if (dst_command(state, get_mac, 8) < 0) {
dprintk(verbose, DST_INFO, 1, "Unsupported Command");
return -1;
}
memset(&state->mac_address, '\0', 8);
memcpy(&state->mac_address, &state->rxbuffer, 6);
dprintk(verbose, DST_ERROR, 1, "MAC Address=[%02x:%02x:%02x:%02x:%02x:%02x]",
state->mac_address[0], state->mac_address[1], state->mac_address[2],
state->mac_address[4], state->mac_address[5], state->mac_address[6]);

return 0;
}

static int dst_fw_ver(struct dst_state *state)
{
u8 get_ver[] = { 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
get_ver[7] = dst_check_sum(get_ver, 7);
if (dst_command(state, get_ver, 8) < 0) {
dprintk(verbose, DST_INFO, 1, "Unsupported Command");
return -1;
}
memset(&state->fw_version, '\0', 8);
memcpy(&state->fw_version, &state->rxbuffer, 8);
dprintk(verbose, DST_ERROR, 1, "Firmware Ver = %x.%x Build = %02x, on %x:%x, %x-%x-20%02x",
state->fw_version[0] >> 4, state->fw_version[0] & 0x0f,
state->fw_version[1],
state->fw_version[5], state->fw_version[6],
state->fw_version[4], state->fw_version[3], state->fw_version[2]);

return 0;
}

static int dst_card_type(struct dst_state *state)
{
u8 get_type[] = { 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
get_type[7] = dst_check_sum(get_type, 7);
if (dst_command(state, get_type, 8) < 0) {
dprintk(verbose, DST_INFO, 1, "Unsupported Command");
return -1;
}
memset(&state->card_info, '\0', 8);
memcpy(&state->card_info, &state->rxbuffer, 8);
dprintk(verbose, DST_ERROR, 1, "Device Model=[%s]", &state->card_info[0]);

return 0;
}

static int dst_get_vendor(struct dst_state *state)
{
u8 get_vendor[] = { 0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
get_vendor[7] = dst_check_sum(get_vendor, 7);
if (dst_command(state, get_vendor, 8) < 0) {
dprintk(verbose, DST_INFO, 1, "Unsupported Command");
return -1;
}
memset(&state->vendor, '\0', 8);
memcpy(&state->vendor, &state->rxbuffer, 8);
dprintk(verbose, DST_ERROR, 1, "Vendor=[%s]", &state->vendor[0]);

return 0;
}

static int dst_get_device_id(struct dst_state *state)
{
Expand Down Expand Up @@ -816,6 +881,24 @@ static int dst_probe(struct dst_state *state)
dprintk(verbose, DST_ERROR, 1, "unknown device.");
return -1;
}
if (dst_get_mac(state) < 0) {
dprintk(verbose, DST_INFO, 1, "MAC: Unsupported command");
return 0;
}
if (state->type_flags & DST_TYPE_HAS_FW_BUILD) {
if (dst_fw_ver(state) < 0) {
dprintk(verbose, DST_INFO, 1, "FW: Unsupported command");
return 0;
}
if (dst_card_type(state) < 0) {
dprintk(verbose, DST_INFO, 1, "Card: Unsupported command");
return 0;
}
if (dst_get_vendor(state) < 0) {
dprintk(verbose, DST_INFO, 1, "Vendor: Unsupported command");
return 0;
}
}

return 0;
}
Expand Down
4 changes: 4 additions & 0 deletions trunk/drivers/media/dvb/bt8xx/dst_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ struct dst_state {
fe_sec_mini_cmd_t minicmd;
fe_modulation_t modulation;
u8 messages[256];
u8 mac_address[8];
u8 fw_version[8];
u8 card_info[8];
u8 vendor[8];
};

struct dst_types {
Expand Down

0 comments on commit 0d24fb3

Please sign in to comment.