Merge a6770c8b999eb511273a8bdc1715f98763fb954e into bb191aa5d7bf5b27a80644b7d69303f197a2b2ad

This commit is contained in:
Andrey Dyldin 2016-08-31 10:29:27 +00:00 committed by GitHub
commit 0d756ea519

View File

@ -1504,9 +1504,9 @@ static int get_ber_t2(struct cxd_state *state, u32 *n, u32 *d)
*n = 0; *n = 0;
*d = 1; *d = 1;
freeze_regst(state); freeze_regst(state);
readregst(state, 0x24, 0x40, BERRegs, 4); readregst_unlocked(state, 0x24, 0x40, BERRegs, 4);
readregst(state, 0x22, 0x5e, &FECType, 1); readregst_unlocked(state, 0x22, 0x5e, &FECType, 1);
readregst(state, 0x22, 0x5b, &CodeRate, 1); readregst_unlocked(state, 0x22, 0x5b, &CodeRate, 1);
FECType &= 0x03; FECType &= 0x03;
CodeRate &= 0x07; CodeRate &= 0x07;
@ -1514,10 +1514,9 @@ static int get_ber_t2(struct cxd_state *state, u32 *n, u32 *d)
if (FECType > 1) if (FECType > 1)
return 0; return 0;
readregst(state, 0x20, 0x72, &Scale, 1); readregst(state, 0x20, 0x72, &Scale, 1);
Scale &= 0x0F; Scale &= 0x0F;
if (BERRegs[0] & 0x01) { if (BERRegs[0] & 0x01) {
state->LastBERNominator = (((u32) BERRegs[1] & 0x3F) << 16) | state->LastBERNominator = (((u32) BERRegs[1] & 0x3F) << 16) |
(((u32) BERRegs[2]) << 8) | BERRegs[3]; (((u32) BERRegs[2]) << 8) | BERRegs[3];
state->LastBERDenominator = nBCHBitsLookup[FECType][CodeRate] << Scale; state->LastBERDenominator = nBCHBitsLookup[FECType][CodeRate] << Scale;
@ -1529,6 +1528,7 @@ static int get_ber_t2(struct cxd_state *state, u32 *n, u32 *d)
} }
*n = state->LastBERNominator; *n = state->LastBERNominator;
*d = state->LastBERDenominator; *d = state->LastBERDenominator;
return 0; return 0;
} }