Skip to content

Commit

Permalink
Update bits for READ POSITION
Browse files Browse the repository at this point in the history
- 7 bits reflecting:
BOP, EOP, LOCU, BYCU, LOLU, PERR & BPEW

Signed-off-by: Mark Harvey <markh794@gmail.com>
  • Loading branch information
markh794 committed Mar 19, 2013
1 parent 8b5618c commit 0f8dbea
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions usr/vtllib.c
Expand Up @@ -246,18 +246,19 @@ If this fails to compile - sizeof MAM != 1024 bytes !
*/
int resp_read_position_long(loff_t pos, uint8_t *buf, uint8_t *sam_stat)
{
uint64_t partition = 1L;
uint32_t partition = 1;

MHVTL_DBG(1, "Position %ld", (long)pos);

memset(buf, 0, READ_POSITION_LONG_LEN); /* Clear 'array' */

if ((pos == 0) || (pos == 1))
buf[0] = 0x80; /* Begining of Partition */
buf[0] |= 0x04; /* Set LONU bit valid */

/* partition should be zero, as we only support one */
put_unaligned_be32(partition, &buf[4]);
/* FIXME: Need to update EOP & BPEW bits too */

put_unaligned_be32(partition, &buf[4]);
put_unaligned_be64(pos, &buf[8]);

MHVTL_DBG(1, "Positioned at block %ld", (long)pos);
Expand All @@ -272,6 +273,10 @@ int resp_read_position(loff_t pos, uint8_t *buf, uint8_t *sam_stat)

if ((pos == 0) || (pos == 1))
buf[0] = 0x80; /* Begining of Partition */
buf[0] |= 0x20; /* Logical object count unknwon */
buf[0] |= 0x10; /* Logical byte count unknwon */

/* FIXME: Need to update EOP & BPEW bits too */

put_unaligned_be32(pos, &buf[4]);
put_unaligned_be32(pos, &buf[8]);
Expand Down

0 comments on commit 0f8dbea

Please sign in to comment.