summaryrefslogtreecommitdiff
path: root/linux/drivers
diff options
context:
space:
mode:
authorPatrick Boettcher <devnull@localhost>2005-04-29 11:24:21 +0000
committerPatrick Boettcher <devnull@localhost>2005-04-29 11:24:21 +0000
commitba9471648385c55140fff4f67c2de8822c3c9678 (patch)
treef8e89ae4aa85e98f8097edfa2afb311d8962273d /linux/drivers
parente86aed48d36edbea2385cab090e464064c5620d5 (diff)
downloadmediapointer-dvb-s2-ba9471648385c55140fff4f67c2de8822c3c9678.tar.gz
mediapointer-dvb-s2-ba9471648385c55140fff4f67c2de8822c3c9678.tar.bz2
added experimental (guessed) nova-t mac address reading
Diffstat (limited to 'linux/drivers')
-rw-r--r--linux/drivers/media/dvb/dvb-usb/dibusb-common.c7
-rw-r--r--linux/drivers/media/dvb/dvb-usb/dibusb.h3
-rw-r--r--linux/drivers/media/dvb/dvb-usb/nova-t-usb2.c28
3 files changed, 35 insertions, 3 deletions
diff --git a/linux/drivers/media/dvb/dvb-usb/dibusb-common.c b/linux/drivers/media/dvb/dvb-usb/dibusb-common.c
index d98e694bc..048513b8f 100644
--- a/linux/drivers/media/dvb/dvb-usb/dibusb-common.c
+++ b/linux/drivers/media/dvb/dvb-usb/dibusb-common.c
@@ -150,6 +150,13 @@ struct i2c_algorithm dibusb_i2c_algo = {
};
EXPORT_SYMBOL(dibusb_i2c_algo);
+int dibusb_read_eeprom_byte(struct dvb_usb_device *d, u8 offs, u8 *val)
+{
+ u8 wbuf[1] = { offs };
+ return dibusb_i2c_msg(d, 0x50, wbuf, 1, val, 1);
+}
+EXPORT_SYMBOL(dibusb_read_eeprom_byte);
+
int dibusb_pll_init_i2c(struct dvb_frontend *fe)
{
struct dvb_usb_device *d = fe->dvb->priv;
diff --git a/linux/drivers/media/dvb/dvb-usb/dibusb.h b/linux/drivers/media/dvb/dvb-usb/dibusb.h
index d6871f19f..88e47d027 100644
--- a/linux/drivers/media/dvb/dvb-usb/dibusb.h
+++ b/linux/drivers/media/dvb/dvb-usb/dibusb.h
@@ -124,6 +124,7 @@ extern int dibusb2_0_power_ctrl(struct dvb_usb_device *d, int onoff);
//#define DEFAULT_RC_INTERVAL 100000
extern struct dvb_usb_rc_key dibusb_rc_keys[];
-extern int dibusb_rc_query(struct dvb_usb_device *d, u32 *event, int *state);
+extern int dibusb_rc_query(struct dvb_usb_device *, u32 *, int *);
+extern int dibusb_read_eeprom_byte(struct dvb_usb_device *, u8, u8 *);
#endif
diff --git a/linux/drivers/media/dvb/dvb-usb/nova-t-usb2.c b/linux/drivers/media/dvb/dvb-usb/nova-t-usb2.c
index 86f697495..3198db391 100644
--- a/linux/drivers/media/dvb/dvb-usb/nova-t-usb2.c
+++ b/linux/drivers/media/dvb/dvb-usb/nova-t-usb2.c
@@ -13,9 +13,10 @@
static int debug;
module_param(debug, int, 0644);
-MODULE_PARM_DESC(debug, "set debugging level (1=rc (|-able))." DVB_USB_DEBUG_STATUS);
+MODULE_PARM_DESC(debug, "set debugging level (1=rc,2=eeprom (|-able))." DVB_USB_DEBUG_STATUS);
#define deb_rc(args...) dprintk(debug,0x01,args)
+#define deb_ee(args...) dprintk(debug,0x02,args)
/* Hauppauge NOVA-T USB2 keys */
static struct dvb_usb_rc_key haupp_rc_keys [] = {
@@ -113,6 +114,29 @@ static int nova_t_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
return 0;
}
+static int nova_t_read_mac_address (struct dvb_usb_device *d, u8 mac[6])
+{
+ int i;
+ u8 b;
+
+ mac[0] = 0x00;
+ mac[1] = 0x0d;
+ mac[2] = 0xfe;
+
+ /* this is a complete guess, but works for my box */
+ for (i = 136; i < 139; i++) {
+ dibusb_read_eeprom_byte(d,i, &b);
+
+ mac[5 - (i - 136)] = b;
+
+/* deb_ee("%02x ",b);
+ if ((i+1) % 16 == 0)
+ deb_ee("\n");*/
+ }
+
+ return 0;
+}
+
/* USB Driver stuff */
static struct dvb_usb_properties nova_t_properties;
@@ -145,7 +169,7 @@ static struct dvb_usb_properties nova_t_properties = {
.power_ctrl = dibusb2_0_power_ctrl,
.frontend_attach = dibusb_dib3000mc_frontend_attach,
.tuner_attach = dibusb_dib3000mc_tuner_attach,
- .read_mac_address = NULL,
+ .read_mac_address = nova_t_read_mac_address,
.rc_interval = 100,
.rc_key_map = haupp_rc_keys,