Skip to contentSkip to conversation

af9013 empty buffer overflow command.

PATCH In review Malcolm Priestley 2 participants 2 messages Nov 12, 2011 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 7/7 af9013 empty buffer overflow command.

This command is present in other Afatech devices zeroing bit 7 seems to force streaming output even if it isn't one.

I was considering timing it out, but it seems to have no harmful effect on streaming output.

---
 drivers/media/dvb/frontends/af9013.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
drivers/media/dvb/frontends/af9013.c +4 -1
index 6a5b40c..fbf6bca 100644
@@ -1094,7 +1094,10 @@ static int af9013_read_status(struct dvb_frontend *fe, fe_status_t *status)
 	}
 
 	ret = af9013_update_statistics(fe);
-
+	if (ret)
+		goto error;
+	/* Force empty stream buffer if overflow */
+	ret = af9013_write_reg_bits(state, 0xd500, 7, 1, 0);
 error:
 	return ret;
 }
Signature · 1 line
1.7.5.4
#1 lore raw
Quoted 5 lines · Malcolm Priestley

This command is present in other Afatech devices zeroing bit 7 seems to force streaming output even if it isn't one.

I was considering timing it out, but it seems to have no harmful effect on streaming output.

You didn't find any reason this makes sense?

regards
Antti

Quoted 22 lines
---
  drivers/media/dvb/frontends/af9013.c |    5 ++++-
  1 files changed, 4 insertions(+), 1 deletions(-)
drivers/media/dvb/frontends/af9013.c +4 -1
index 6a5b40c..fbf6bca 100644
@@ -1094,7 +1094,10 @@ static int af9013_read_status(struct dvb_frontend *fe, fe_status_t *status)
  	}
 
  	ret = af9013_update_statistics(fe);
-
+	if (ret)
+		goto error;
+	/* Force empty stream buffer if overflow */
+	ret = af9013_write_reg_bits(state, 0xd500, 7, 1, 0);
  error:
  	return ret;
  }
Signature · 1 line
http://palosaari.fi/