diff options
author | Johannes Stezenbach <devnull@localhost> | 2004-12-26 02:16:13 +0000 |
---|---|---|
committer | Johannes Stezenbach <devnull@localhost> | 2004-12-26 02:16:13 +0000 |
commit | c23a8b2b1ed73f9e18510b1efe379b73bbcf63d5 (patch) | |
tree | c59703ab95783e65bc4bb5e101c7dc90aeb2d210 /linux/drivers/media/dvb/ttpci/av7110_hw.c | |
parent | cee6d44aa9ebf486690fac0983365f9baeeb3606 (diff) | |
download | mediapointer-dvb-s2-c23a8b2b1ed73f9e18510b1efe379b73bbcf63d5.tar.gz mediapointer-dvb-s2-c23a8b2b1ed73f9e18510b1efe379b73bbcf63d5.tar.bz2 |
- clean up debi irq/tasklet handling to make it work on SMP
- misc. changes to av7110_send_fw_cmd() error handling done
along the way
Diffstat (limited to 'linux/drivers/media/dvb/ttpci/av7110_hw.c')
-rw-r--r-- | linux/drivers/media/dvb/ttpci/av7110_hw.c | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/linux/drivers/media/dvb/ttpci/av7110_hw.c b/linux/drivers/media/dvb/ttpci/av7110_hw.c index f5e753851..67a95df63 100644 --- a/linux/drivers/media/dvb/ttpci/av7110_hw.c +++ b/linux/drivers/media/dvb/ttpci/av7110_hw.c @@ -336,7 +336,7 @@ int __av7110_send_fw_cmd(struct av7110 *av7110, u16* buf, int length) if (!av7110->arm_ready) { dprintk(1, "arm not ready.\n"); - return -1; + return -ENXIO; } start = jiffies; @@ -344,7 +344,7 @@ int __av7110_send_fw_cmd(struct av7110 *av7110, u16* buf, int length) msleep(1); if (time_after(jiffies, start + ARM_WAIT_FREE)) { printk(KERN_ERR "dvb-ttpci: %s(): timeout waiting for COMMAND idle\n", __FUNCTION__); - return -1; + return -ETIMEDOUT; } } @@ -356,7 +356,7 @@ int __av7110_send_fw_cmd(struct av7110 *av7110, u16* buf, int length) msleep(1); if (time_after(jiffies, start + ARM_WAIT_SHAKE)) { printk(KERN_ERR "dvb-ttpci: %s(): timeout waiting for HANDSHAKE_REG\n", __FUNCTION__); - return -1; + return -ETIMEDOUT; } } #endif @@ -426,18 +426,18 @@ int __av7110_send_fw_cmd(struct av7110 *av7110, u16* buf, int length) if (time_after(jiffies, start + ARM_WAIT_FREE)) { printk(KERN_ERR "dvb-ttpci: %s(): timeout waiting for COMMAND to complete\n", __FUNCTION__); - return -1; + return -ETIMEDOUT; } } stat = rdebi(av7110, DEBINOSWAP, MSGSTATE, 0, 2); if (stat & GPMQOver) { printk(KERN_ERR "dvb-ttpci: %s(): GPMQOver\n", __FUNCTION__); - return -1; + return -ENOSPC; } else if (stat & OSDQOver) { printk(KERN_ERR "dvb-ttpci: %s(): OSDQOver\n", __FUNCTION__); - return -1; + return -ENOSPC; } #endif @@ -460,7 +460,8 @@ int av7110_send_fw_cmd(struct av7110 *av7110, u16* buf, int length) ret = __av7110_send_fw_cmd(av7110, buf, length); up(&av7110->dcomlock); if (ret) - printk("dvb-ttpci: %s(): av7110_send_fw_cmd error\n", __FUNCTION__); + printk(KERN_ERR "dvb-ttpci: %s(): av7110_send_fw_cmd error %d\n", + __FUNCTION__, ret); return ret; } @@ -484,7 +485,7 @@ int av7110_fw_cmd(struct av7110 *av7110, int type, int com, int num, ...) ret = av7110_send_fw_cmd(av7110, buf, num + 2); if (ret) - printk("dvb-ttpci: av7110_fw_cmd error\n"); + printk(KERN_ERR "dvb-ttpci: av7110_fw_cmd error %d\n", ret); return ret; } @@ -506,7 +507,7 @@ int av7110_send_ci_cmd(struct av7110 *av7110, u8 subcom, u8 *buf, u8 len) ret = av7110_send_fw_cmd(av7110, cmd, 18); if (ret) - printk("dvb-ttpci: av7110_send_ci_cmd error\n"); + printk(KERN_ERR "dvb-ttpci: av7110_send_ci_cmd error %d\n", ret); return ret; } @@ -532,7 +533,7 @@ int av7110_fw_request(struct av7110 *av7110, u16 *request_buf, if ((err = __av7110_send_fw_cmd(av7110, request_buf, request_buf_len)) < 0) { up(&av7110->dcomlock); - printk("dvb-ttpci: av7110_fw_request error\n"); + printk(KERN_ERR "dvb-ttpci: av7110_fw_request error %d\n", err); return err; } @@ -586,7 +587,7 @@ int av7110_fw_query(struct av7110 *av7110, u16 tag, u16* buf, s16 length) int ret; ret = av7110_fw_request(av7110, &tag, 0, buf, length); if (ret) - printk("dvb-ttpci: av7110_fw_query error\n"); + printk(KERN_ERR "dvb-ttpci: av7110_fw_query error %d\n", ret); return ret; } @@ -633,7 +634,7 @@ int av7110_firmversion(struct av7110 *av7110) int av7110_diseqc_send(struct av7110 *av7110, int len, u8 *msg, unsigned long burst) { - int i; + int i, ret; u16 buf[18] = { ((COMTYPE_AUDIODAC << 8) + SendDiSEqC), 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; @@ -653,8 +654,8 @@ int av7110_diseqc_send(struct av7110 *av7110, int len, u8 *msg, unsigned long bu for (i = 0; i < len; i++) buf[i + 4] = msg[i]; - if (av7110_send_fw_cmd(av7110, buf, 18)) - printk("dvb-ttpci: av7110_diseqc_send error\n"); + if ((ret = av7110_send_fw_cmd(av7110, buf, 18))) + printk(KERN_ERR "dvb-ttpci: av7110_diseqc_send error %d\n", ret); return 0; } @@ -763,7 +764,7 @@ static int WriteText(struct av7110 *av7110, u8 win, u16 x, u16 y, u8* buf) ret = __av7110_send_fw_cmd(av7110, cbuf, 5); up(&av7110->dcomlock); if (ret) - printk("dvb-ttpci: WriteText error\n"); + printk(KERN_ERR "dvb-ttpci: WriteText error %d\n", ret); return ret; } @@ -830,7 +831,8 @@ static inline int LoadBitmap(struct av7110 *av7110, u16 format, ret = wait_event_interruptible_timeout(av7110->bmpq, av7110->bmp_state != BMP_LOADING, HZ); if (ret == -ERESTARTSYS || ret == 0) { - printk("dvb-ttpci: warning: timeout waiting in %s()\n", __FUNCTION__); + printk("dvb-ttpci: warning: timeout waiting in LoadBitmap: %d, %d\n", + ret, av7110->bmp_state); av7110->bmp_state = BMP_NONE; return -1; } @@ -872,6 +874,7 @@ static inline int LoadBitmap(struct av7110 *av7110, u16 format, } } av7110->bmplen += 1024; + dprintk(4, "av7110_fw_cmd: LoadBmp size %d\n", av7110->bmplen); return av7110_fw_cmd(av7110, COMTYPE_OSD, LoadBmp, 3, format, dx, dy); } @@ -886,7 +889,8 @@ static int BlitBitmap(struct av7110 *av7110, u16 win, u16 x, u16 y, u16 trans) ret = wait_event_interruptible_timeout(av7110->bmpq, av7110->bmp_state != BMP_LOADING, 10*HZ); if (ret == -ERESTARTSYS || ret == 0) { - printk("dvb-ttpci: warning: timeout waiting in %s()\n", __FUNCTION__); + printk("dvb-ttpci: warning: timeout waiting in BlitBitmap: %d, %d\n", + ret, av7110->bmp_state); av7110->bmp_state = BMP_NONE; return (ret == 0) ? -ETIMEDOUT : ret; } |