public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Johannes Stezenbach <js@linuxtv.org>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org, Patrick Boettcher <pb@linuxtv.org>
Subject: [DVB patch 05/11] flexcop: fix MAC address reading
Date: Sat, 14 May 2005 00:00:24 +0200	[thread overview]
Message-ID: <20050513220225.520542000@abc> (raw)
In-Reply-To: 20050513220019.907667000@abc

[-- Attachment #1: dvb-flexcop-mac.patch --]
[-- Type: text/plain, Size: 3965 bytes --]

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>
---

 drivers/media/dvb/b2c2/flexcop-common.h |    1 -
 drivers/media/dvb/b2c2/flexcop-eeprom.c |   10 +++-------
 drivers/media/dvb/b2c2/flexcop-usb.c    |    3 ++-
 drivers/media/dvb/b2c2/flexcop.c        |   10 ++++++----
 4 files changed, 11 insertions(+), 13 deletions(-)

Index: linux-2.6.12-rc4/drivers/media/dvb/b2c2/flexcop-common.h
===================================================================
--- linux-2.6.12-rc4.orig/drivers/media/dvb/b2c2/flexcop-common.h	2005-05-12 01:30:04.000000000 +0200
+++ linux-2.6.12-rc4/drivers/media/dvb/b2c2/flexcop-common.h	2005-05-12 01:30:26.000000000 +0200
@@ -57,7 +57,6 @@ struct flexcop_device {
 	int init_state;
 
 	/* device information */
-	u8 mac_address[6];
 	int has_32_hw_pid_filter;
 	flexcop_revision_t rev;
 	flexcop_device_type_t dev_type;
Index: linux-2.6.12-rc4/drivers/media/dvb/b2c2/flexcop-eeprom.c
===================================================================
--- linux-2.6.12-rc4.orig/drivers/media/dvb/b2c2/flexcop-eeprom.c	2005-05-12 01:30:04.000000000 +0200
+++ linux-2.6.12-rc4/drivers/media/dvb/b2c2/flexcop-eeprom.c	2005-05-12 01:30:26.000000000 +0200
@@ -129,8 +129,6 @@ static int flexcop_eeprom_lrc_read(struc
 	return ret;
 }
 
-/* TODO how is it handled in USB */
-
 /* JJ's comment about extended == 1: it is not presently used anywhere but was
  * added to the low-level functions for possible support of EUI64
  */
@@ -139,18 +137,16 @@ int flexcop_eeprom_check_mac_addr(struct
 	u8 buf[8];
 	int ret = 0;
 
-	memset(fc->mac_address,0,6);
-
 	if ((ret = flexcop_eeprom_lrc_read(fc,0x3f8,buf,8,4)) == 0) {
 		if (extended != 0) {
 			err("TODO: extended (EUI64) MAC addresses aren't completely supported yet");
 			ret = -EINVAL;
-/*			memcpy(fc->mac_address,buf,3);
+/*			memcpy(fc->dvb_adapter.proposed_mac,buf,3);
 			mac[3] = 0xfe;
 			mac[4] = 0xff;
-			memcpy(&fc->mac_address[3],&buf[5],3); */
+			memcpy(&fc->dvb_adapter.proposed_mac[3],&buf[5],3); */
 		} else
-			memcpy(fc->mac_address,buf,6);
+			memcpy(fc->dvb_adapter.proposed_mac,buf,6);
 	}
 	return ret;
 }
Index: linux-2.6.12-rc4/drivers/media/dvb/b2c2/flexcop-usb.c
===================================================================
--- linux-2.6.12-rc4.orig/drivers/media/dvb/b2c2/flexcop-usb.c	2005-05-12 01:30:16.000000000 +0200
+++ linux-2.6.12-rc4/drivers/media/dvb/b2c2/flexcop-usb.c	2005-05-12 01:30:26.000000000 +0200
@@ -180,7 +180,8 @@ static int flexcop_usb_memory_req(struct
 
 static int flexcop_usb_get_mac_addr(struct flexcop_device *fc, int extended)
 {
-	return flexcop_usb_memory_req(fc->bus_specific,B2C2_USB_READ_V8_MEM,V8_MEMORY_PAGE_FLASH,0x1f010,1,fc->mac_address,6);
+	return flexcop_usb_memory_req(fc->bus_specific,B2C2_USB_READ_V8_MEM,
+			V8_MEMORY_PAGE_FLASH,0x1f010,1,fc->dvb_adapter.proposed_mac,6);
 }
 
 #if 0
Index: linux-2.6.12-rc4/drivers/media/dvb/b2c2/flexcop.c
===================================================================
--- linux-2.6.12-rc4.orig/drivers/media/dvb/b2c2/flexcop.c	2005-05-12 01:30:04.000000000 +0200
+++ linux-2.6.12-rc4/drivers/media/dvb/b2c2/flexcop.c	2005-05-12 01:30:26.000000000 +0200
@@ -233,16 +233,18 @@ int flexcop_device_initialize(struct fle
 
 	flexcop_smc_ctrl(fc, 0);
 
+	if ((ret = flexcop_dvb_init(fc)))
+		goto error;
+
+	/* do the MAC address reading after initializing the dvb_adapter */
 	if (fc->get_mac_addr(fc, 0) == 0) {
-		u8 *b = fc->mac_address;
+		u8 *b = fc->dvb_adapter.proposed_mac;
 		info("MAC address = %02x:%02x:%02x:%02x:%02x:%02x", b[0],b[1],b[2],b[3],b[4],b[5]);
-		flexcop_set_mac_filter(fc,fc->mac_address);
+		flexcop_set_mac_filter(fc,b);
 		flexcop_mac_filter_ctrl(fc,1);
 	} else
 		warn("reading of MAC address failed.\n");
 
-	if ((ret = flexcop_dvb_init(fc)))
-		goto error;
 
 	if ((ret = flexcop_i2c_init(fc)))
 		goto error;

--


  parent reply	other threads:[~2005-05-13 22:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-13 22:00 [DVB patch 00/11] B2C2 / FlexCop driver rewrite Johannes Stezenbach
2005-05-13 22:00 ` [DVB patch 01/11] b2c2/flexcop driver refactoring part 1: drop old b2c2-usb stuff Johannes Stezenbach
2005-05-13 22:00 ` [DVB patch 03/11] flexcop: fix USB transfer handling Johannes Stezenbach
2005-05-13 22:00 ` [DVB patch 04/11] flexcop: add acknowledgements Johannes Stezenbach
2005-05-13 22:00 ` Johannes Stezenbach [this message]
2005-05-13 22:00 ` [DVB patch 06/11] flexcop: fixed interrupt-sharing Johannes Stezenbach
2005-05-13 22:00 ` [DVB patch 07/11] flexcop: use hw pid filter Johannes Stezenbach
2005-05-13 22:00 ` [DVB patch 08/11] flexcop: fix module refcount handling Johannes Stezenbach
2005-05-13 22:00 ` [DVB patch 09/11] flexcop: readme update Johannes Stezenbach
2005-05-13 22:00 ` [DVB patch 10/11] flexcop: i2c read fixes Johannes Stezenbach
2005-05-13 22:00 ` [DVB patch 11/11] B2C2 / FlexCop driver rewrite Johannes Stezenbach

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050513220225.520542000@abc \
    --to=js@linuxtv.org \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pb@linuxtv.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox