diff options
author | Johannes Stezenbach <js@linuxtv.org> | 2005-05-17 00:54:14 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-05-17 10:59:25 -0400 |
commit | 778241313819e17de3bdf91523c724b4704402c6 (patch) | |
tree | b0638104fbf6de5a6bfec9ed28d55c33f43e3320 /drivers/media/dvb | |
parent | 3ed8a31cb387b2ae3e4ca508f973931b61e6f6bd (diff) |
[PATCH] dvb: flexcop: fix MAC address reading
read MAC address directly into dvb_adapter->proposed_mac
Signed-off-by: Patrick Boettcher <pb@linuxtv.org>
Signed-off-by: Johannes Stezenbach <js@linuxtv.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r-- | drivers/media/dvb/b2c2/flexcop-common.h | 1 | ||||
-rw-r--r-- | drivers/media/dvb/b2c2/flexcop-eeprom.c | 10 | ||||
-rw-r--r-- | drivers/media/dvb/b2c2/flexcop-usb.c | 3 | ||||
-rw-r--r-- | drivers/media/dvb/b2c2/flexcop.c | 10 |
4 files changed, 11 insertions, 13 deletions
diff --git a/drivers/media/dvb/b2c2/flexcop-common.h b/drivers/media/dvb/b2c2/flexcop-common.h index 82b7f8fa7b9c..534876d616b8 100644 --- a/drivers/media/dvb/b2c2/flexcop-common.h +++ b/drivers/media/dvb/b2c2/flexcop-common.h | |||
@@ -57,7 +57,6 @@ struct flexcop_device { | |||
57 | int init_state; | 57 | int init_state; |
58 | 58 | ||
59 | /* device information */ | 59 | /* device information */ |
60 | u8 mac_address[6]; | ||
61 | int has_32_hw_pid_filter; | 60 | int has_32_hw_pid_filter; |
62 | flexcop_revision_t rev; | 61 | flexcop_revision_t rev; |
63 | flexcop_device_type_t dev_type; | 62 | flexcop_device_type_t dev_type; |
diff --git a/drivers/media/dvb/b2c2/flexcop-eeprom.c b/drivers/media/dvb/b2c2/flexcop-eeprom.c index 4dbedd819734..bbcf070a178d 100644 --- a/drivers/media/dvb/b2c2/flexcop-eeprom.c +++ b/drivers/media/dvb/b2c2/flexcop-eeprom.c | |||
@@ -129,8 +129,6 @@ static int flexcop_eeprom_lrc_read(struct flexcop_device *fc, u16 addr, u8 *buf, | |||
129 | return ret; | 129 | return ret; |
130 | } | 130 | } |
131 | 131 | ||
132 | /* TODO how is it handled in USB */ | ||
133 | |||
134 | /* JJ's comment about extended == 1: it is not presently used anywhere but was | 132 | /* JJ's comment about extended == 1: it is not presently used anywhere but was |
135 | * added to the low-level functions for possible support of EUI64 | 133 | * added to the low-level functions for possible support of EUI64 |
136 | */ | 134 | */ |
@@ -139,18 +137,16 @@ int flexcop_eeprom_check_mac_addr(struct flexcop_device *fc, int extended) | |||
139 | u8 buf[8]; | 137 | u8 buf[8]; |
140 | int ret = 0; | 138 | int ret = 0; |
141 | 139 | ||
142 | memset(fc->mac_address,0,6); | ||
143 | |||
144 | if ((ret = flexcop_eeprom_lrc_read(fc,0x3f8,buf,8,4)) == 0) { | 140 | if ((ret = flexcop_eeprom_lrc_read(fc,0x3f8,buf,8,4)) == 0) { |
145 | if (extended != 0) { | 141 | if (extended != 0) { |
146 | err("TODO: extended (EUI64) MAC addresses aren't completely supported yet"); | 142 | err("TODO: extended (EUI64) MAC addresses aren't completely supported yet"); |
147 | ret = -EINVAL; | 143 | ret = -EINVAL; |
148 | /* memcpy(fc->mac_address,buf,3); | 144 | /* memcpy(fc->dvb_adapter.proposed_mac,buf,3); |
149 | mac[3] = 0xfe; | 145 | mac[3] = 0xfe; |
150 | mac[4] = 0xff; | 146 | mac[4] = 0xff; |
151 | memcpy(&fc->mac_address[3],&buf[5],3); */ | 147 | memcpy(&fc->dvb_adapter.proposed_mac[3],&buf[5],3); */ |
152 | } else | 148 | } else |
153 | memcpy(fc->mac_address,buf,6); | 149 | memcpy(fc->dvb_adapter.proposed_mac,buf,6); |
154 | } | 150 | } |
155 | return ret; | 151 | return ret; |
156 | } | 152 | } |
diff --git a/drivers/media/dvb/b2c2/flexcop-usb.c b/drivers/media/dvb/b2c2/flexcop-usb.c index 98470ce9a054..20db6329a686 100644 --- a/drivers/media/dvb/b2c2/flexcop-usb.c +++ b/drivers/media/dvb/b2c2/flexcop-usb.c | |||
@@ -180,7 +180,8 @@ static int flexcop_usb_memory_req(struct flexcop_usb *fc_usb,flexcop_usb_request | |||
180 | 180 | ||
181 | static int flexcop_usb_get_mac_addr(struct flexcop_device *fc, int extended) | 181 | static int flexcop_usb_get_mac_addr(struct flexcop_device *fc, int extended) |
182 | { | 182 | { |
183 | return flexcop_usb_memory_req(fc->bus_specific,B2C2_USB_READ_V8_MEM,V8_MEMORY_PAGE_FLASH,0x1f010,1,fc->mac_address,6); | 183 | return flexcop_usb_memory_req(fc->bus_specific,B2C2_USB_READ_V8_MEM, |
184 | V8_MEMORY_PAGE_FLASH,0x1f010,1,fc->dvb_adapter.proposed_mac,6); | ||
184 | } | 185 | } |
185 | 186 | ||
186 | #if 0 | 187 | #if 0 |
diff --git a/drivers/media/dvb/b2c2/flexcop.c b/drivers/media/dvb/b2c2/flexcop.c index 1998267207fb..ad590875064b 100644 --- a/drivers/media/dvb/b2c2/flexcop.c +++ b/drivers/media/dvb/b2c2/flexcop.c | |||
@@ -233,16 +233,18 @@ int flexcop_device_initialize(struct flexcop_device *fc) | |||
233 | 233 | ||
234 | flexcop_smc_ctrl(fc, 0); | 234 | flexcop_smc_ctrl(fc, 0); |
235 | 235 | ||
236 | if ((ret = flexcop_dvb_init(fc))) | ||
237 | goto error; | ||
238 | |||
239 | /* do the MAC address reading after initializing the dvb_adapter */ | ||
236 | if (fc->get_mac_addr(fc, 0) == 0) { | 240 | if (fc->get_mac_addr(fc, 0) == 0) { |
237 | u8 *b = fc->mac_address; | 241 | u8 *b = fc->dvb_adapter.proposed_mac; |
238 | info("MAC address = %02x:%02x:%02x:%02x:%02x:%02x", b[0],b[1],b[2],b[3],b[4],b[5]); | 242 | info("MAC address = %02x:%02x:%02x:%02x:%02x:%02x", b[0],b[1],b[2],b[3],b[4],b[5]); |
239 | flexcop_set_mac_filter(fc,fc->mac_address); | 243 | flexcop_set_mac_filter(fc,b); |
240 | flexcop_mac_filter_ctrl(fc,1); | 244 | flexcop_mac_filter_ctrl(fc,1); |
241 | } else | 245 | } else |
242 | warn("reading of MAC address failed.\n"); | 246 | warn("reading of MAC address failed.\n"); |
243 | 247 | ||
244 | if ((ret = flexcop_dvb_init(fc))) | ||
245 | goto error; | ||
246 | 248 | ||
247 | if ((ret = flexcop_i2c_init(fc))) | 249 | if ((ret = flexcop_i2c_init(fc))) |
248 | goto error; | 250 | goto error; |