Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 205806
b: refs/heads/master
c: c8b8857
h: refs/heads/master
v: v3
  • Loading branch information
Kulikov Vasiliy authored and Greg Kroah-Hartman committed Jul 8, 2010
1 parent f2e3505 commit e13cd15
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2addf798e4507f29276d0b00f318a603c57e4a8a
refs/heads/master: c8b8857e7a0bdb6d1e45406d5f90bd74a4fd84d6
16 changes: 6 additions & 10 deletions trunk/drivers/staging/otus/hal/hpani.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ s32_t BEACON_RSSI(zdev_t *dev)

void zfHpAniAttach(zdev_t *dev)
{
#define N(a) (sizeof(a) / sizeof(a[0]))
u32_t i;
struct zsHpPriv *HpPriv;

Expand Down Expand Up @@ -125,15 +124,13 @@ void zfHpAniAttach(zdev_t *dev)
HpPriv->stats.ast_nodestats.ns_avgbrssi = ZM_RSSI_DUMMY_MARKER;
HpPriv->stats.ast_nodestats.ns_avgrssi = ZM_RSSI_DUMMY_MARKER;
HpPriv->stats.ast_nodestats.ns_avgtxrssi = ZM_RSSI_DUMMY_MARKER;
#undef N
}

/*
* Control Adaptive Noise Immunity Parameters
*/
u8_t zfHpAniControl(zdev_t *dev, ZM_HAL_ANI_CMD cmd, int param)
{
#define N(a) (sizeof(a)/sizeof(a[0]))
typedef s32_t TABLE[];
struct zsHpPriv *HpPriv;
struct zsAniState *aniState;
Expand All @@ -148,9 +145,9 @@ u8_t zfHpAniControl(zdev_t *dev, ZM_HAL_ANI_CMD cmd, int param)
{
u32_t level = param;

if (level >= N(HpPriv->totalSizeDesired)) {
if (level >= ARRAY_SIZE(HpPriv->totalSizeDesired)) {
zm_debug_msg1("level out of range, desired level : ", level);
zm_debug_msg1("max level : ", N(HpPriv->totalSizeDesired));
zm_debug_msg1("max level : ", ARRAY_SIZE(HpPriv->totalSizeDesired));
return FALSE;
}

Expand Down Expand Up @@ -260,10 +257,10 @@ u8_t zfHpAniControl(zdev_t *dev, ZM_HAL_ANI_CMD cmd, int param)
const TABLE firstep = { 0, 4, 8 };
u32_t level = param;

if (level >= N(firstep))
if (level >= ARRAY_SIZE(firstep))
{
zm_debug_msg1("level out of range, desired level : ", level);
zm_debug_msg1("max level : ", N(firstep));
zm_debug_msg1("max level : ", ARRAY_SIZE(firstep));
return FALSE;
}
zfDelayWriteInternalReg(dev, AR_PHY_FIND_SIG,
Expand All @@ -283,10 +280,10 @@ u8_t zfHpAniControl(zdev_t *dev, ZM_HAL_ANI_CMD cmd, int param)
const TABLE cycpwrThr1 = { 2, 4, 6, 8, 10, 12, 14, 16 };
u32_t level = param;

if (level >= N(cycpwrThr1))
if (level >= ARRAY_SIZE(cycpwrThr1))
{
zm_debug_msg1("level out of range, desired level : ", level);
zm_debug_msg1("max level : ", N(cycpwrThr1));
zm_debug_msg1("max level : ", ARRAY_SIZE(cycpwrThr1));
return FALSE;
}
zfDelayWriteInternalReg(dev, AR_PHY_TIMING5,
Expand Down Expand Up @@ -335,7 +332,6 @@ u8_t zfHpAniControl(zdev_t *dev, ZM_HAL_ANI_CMD cmd, int param)
return FALSE;
}
return TRUE;
#undef N
}

void zfHpAniRestart(zdev_t* dev)
Expand Down

0 comments on commit e13cd15

Please sign in to comment.