diff options
author | Patrick Boettcher <devnull@localhost> | 2005-03-31 18:55:37 +0000 |
---|---|---|
committer | Patrick Boettcher <devnull@localhost> | 2005-03-31 18:55:37 +0000 |
commit | 1d6c24e8bb867fb63c46b1be11c08dde5d9c6b9b (patch) | |
tree | b4e1c3f4ddff0cd8ec1ca312c139aebe42ac9544 /linux/drivers/media/dvb/dvb-usb/vp7045.c | |
parent | 4ae33e4f5ab7230b6a4650fc00536f17ee5875a4 (diff) | |
download | mediapointer-dvb-s2-1d6c24e8bb867fb63c46b1be11c08dde5d9c6b9b.tar.gz mediapointer-dvb-s2-1d6c24e8bb867fb63c46b1be11c08dde5d9c6b9b.tar.bz2 |
- added read_mac_address-callback
- filling the MAC address into dvb_adapter->proposed_mac
Thanks to Andreas Oberritter for pointing out.
Diffstat (limited to 'linux/drivers/media/dvb/dvb-usb/vp7045.c')
-rw-r--r-- | linux/drivers/media/dvb/dvb-usb/vp7045.c | 44 |
1 files changed, 34 insertions, 10 deletions
diff --git a/linux/drivers/media/dvb/dvb-usb/vp7045.c b/linux/drivers/media/dvb/dvb-usb/vp7045.c index 103c36361..10945591b 100644 --- a/linux/drivers/media/dvb/dvb-usb/vp7045.c +++ b/linux/drivers/media/dvb/dvb-usb/vp7045.c @@ -94,12 +94,32 @@ static int vp7045_rc_query(struct dvb_usb_device *d, u8 *key_buf, int *state) { deb_info("remote query\n"); *state = REMOTE_KEY_NO; - return 0; //vp7045_usb_op(d,RC_VAL_READ,&v,1,NULL,0,20); + return 0; //vp7045_usb_op(d,RC_VAL_READ,NULL,0,&v,1,20); +} + +static int vp7045_read_eeprom(struct dvb_usb_device *d,u8 *buf, int len, int offset) +{ + int i = 0; + u8 v,br[2]; + for (i=0; i < len; i++) { + v = offset + i; + vp7045_usb_op(d,GET_EE_VALUE,&v,1,br,2,5); + buf[i] = br[1]; + } + deb_info("VP7045 EEPROM read (offs: %d, len: %d) : ",offset, i); + debug_dump(buf,i,deb_info); + return 0; +} + + +static int vp7045_read_mac_addr(struct dvb_usb_device *d,u8 mac[6]) +{ + return vp7045_read_eeprom(d,mac, 6, MAC_0_ADDR); } static int vp7045_frontend_attach(struct dvb_usb_device *d) { - u8 buf[20]; + u8 buf[255] = { 0 }; vp7045_usb_op(d,VENDOR_STRING_READ,NULL,0,buf,20,0); buf[10] = '\0'; @@ -113,6 +133,9 @@ static int vp7045_frontend_attach(struct dvb_usb_device *d) buf[10] = '\0'; deb_info("v%s\n",buf); +/* Dump the EEPROM */ +/* vp7045_read_eeprom(d,buf, 255, FX2_ID_ADDR); */ + d->fe = vp7045_fe_attach(d); return 0; @@ -138,15 +161,16 @@ static struct dvb_usb_properties vp7045_properties = { .usb_ctrl = CYPRESS_FX2, .firmware = "dvb-usb-vp7045-01.fw", - .streaming_ctrl = NULL, - .pid_filter = NULL, - .pid_filter_ctrl = NULL, - .power_ctrl = vp7045_power_ctrl, - .frontend_attach = vp7045_frontend_attach, + .streaming_ctrl = NULL, + .pid_filter = NULL, + .pid_filter_ctrl = NULL, + .power_ctrl = vp7045_power_ctrl, + .frontend_attach = vp7045_frontend_attach, + .read_mac_address = vp7045_read_mac_addr, - .rc_interval = 400, - .remote_protocol = USB_REMOTE_PROTO_NEC, - .query_rc = vp7045_rc_query, + .rc_interval = 400, + .remote_protocol = USB_REMOTE_PROTO_NEC, + .query_rc = vp7045_rc_query, /* parameter for the MPEG2-data transfer */ .urb = { |